(function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); else if(typeof define === 'function' && define.amd) define([], factory); else { var a = factory(); for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i]; } })(global, () => { return /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ /***/ "./node_modules/@electron/remote/dist/src/common/get-electron-binding.js": /*!*******************************************************************************!*\ !*** ./node_modules/@electron/remote/dist/src/common/get-electron-binding.js ***! \*******************************************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getElectronBinding = void 0; const getElectronBinding = (name) => { if (process._linkedBinding) { return process._linkedBinding('electron_common_' + name); } else if (process.electronBinding) { return process.electronBinding(name); } else { return null; } }; exports.getElectronBinding = getElectronBinding; /***/ }), /***/ "./node_modules/@electron/remote/dist/src/common/module-names.js": /*!***********************************************************************!*\ !*** ./node_modules/@electron/remote/dist/src/common/module-names.js ***! \***********************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var _a, _b; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.browserModuleNames = exports.commonModuleNames = void 0; const get_electron_binding_1 = __webpack_require__(/*! ./get-electron-binding */ "./node_modules/@electron/remote/dist/src/common/get-electron-binding.js"); exports.commonModuleNames = [ 'clipboard', 'nativeImage', 'shell', ]; exports.browserModuleNames = [ 'app', 'autoUpdater', 'BaseWindow', 'BrowserView', 'BrowserWindow', 'contentTracing', 'crashReporter', 'dialog', 'globalShortcut', 'ipcMain', 'inAppPurchase', 'Menu', 'MenuItem', 'nativeTheme', 'net', 'netLog', 'MessageChannelMain', 'Notification', 'powerMonitor', 'powerSaveBlocker', 'protocol', 'pushNotifications', 'safeStorage', 'screen', 'session', 'ShareMenu', 'systemPreferences', 'TopLevelWindow', 'TouchBar', 'Tray', 'utilityProcess', 'View', 'webContents', 'WebContentsView', 'webFrameMain', ].concat(exports.commonModuleNames); const features = get_electron_binding_1.getElectronBinding('features'); if (((_a = features === null || features === void 0 ? void 0 : features.isDesktopCapturerEnabled) === null || _a === void 0 ? void 0 : _a.call(features)) !== false) { exports.browserModuleNames.push('desktopCapturer'); } if (((_b = features === null || features === void 0 ? void 0 : features.isViewApiEnabled) === null || _b === void 0 ? void 0 : _b.call(features)) !== false) { exports.browserModuleNames.push('ImageView'); } /***/ }), /***/ "./node_modules/@electron/remote/dist/src/common/type-utils.js": /*!*********************************************************************!*\ !*** ./node_modules/@electron/remote/dist/src/common/type-utils.js ***! \*********************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.deserialize = exports.serialize = exports.isSerializableObject = exports.isPromise = void 0; const electron_1 = __webpack_require__(/*! electron */ "electron"); function isPromise(val) { return (val && val.then && val.then instanceof Function && val.constructor && val.constructor.reject && val.constructor.reject instanceof Function && val.constructor.resolve && val.constructor.resolve instanceof Function); } exports.isPromise = isPromise; const serializableTypes = [ Boolean, Number, String, Date, Error, RegExp, ArrayBuffer ]; // https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm#Supported_types function isSerializableObject(value) { return value === null || ArrayBuffer.isView(value) || serializableTypes.some(type => value instanceof type); } exports.isSerializableObject = isSerializableObject; const objectMap = function (source, mapper) { const sourceEntries = Object.entries(source); const targetEntries = sourceEntries.map(([key, val]) => [key, mapper(val)]); return Object.fromEntries(targetEntries); }; function serializeNativeImage(image) { const representations = []; const scaleFactors = image.getScaleFactors(); // Use Buffer when there's only one representation for better perf. // This avoids compressing to/from PNG where it's not necessary to // ensure uniqueness of dataURLs (since there's only one). if (scaleFactors.length === 1) { const scaleFactor = scaleFactors[0]; const size = image.getSize(scaleFactor); const buffer = image.toBitmap({ scaleFactor }); representations.push({ scaleFactor, size, buffer }); } else { // Construct from dataURLs to ensure that they are not lost in creation. for (const scaleFactor of scaleFactors) { const size = image.getSize(scaleFactor); const dataURL = image.toDataURL({ scaleFactor }); representations.push({ scaleFactor, size, dataURL }); } } return { __ELECTRON_SERIALIZED_NativeImage__: true, representations }; } function deserializeNativeImage(value) { const image = electron_1.nativeImage.createEmpty(); // Use Buffer when there's only one representation for better perf. // This avoids compressing to/from PNG where it's not necessary to // ensure uniqueness of dataURLs (since there's only one). if (value.representations.length === 1) { const { buffer, size, scaleFactor } = value.representations[0]; const { width, height } = size; image.addRepresentation({ buffer, scaleFactor, width, height }); } else { // Construct from dataURLs to ensure that they are not lost in creation. for (const rep of value.representations) { const { dataURL, size, scaleFactor } = rep; const { width, height } = size; image.addRepresentation({ dataURL, scaleFactor, width, height }); } } return image; } function serialize(value) { if (value && value.constructor && value.constructor.name === 'NativeImage') { return serializeNativeImage(value); } if (Array.isArray(value)) { return value.map(serialize); } else if (isSerializableObject(value)) { return value; } else if (value instanceof Object) { return objectMap(value, serialize); } else { return value; } } exports.serialize = serialize; function deserialize(value) { if (value && value.__ELECTRON_SERIALIZED_NativeImage__) { return deserializeNativeImage(value); } else if (Array.isArray(value)) { return value.map(deserialize); } else if (isSerializableObject(value)) { return value; } else if (value instanceof Object) { return objectMap(value, deserialize); } else { return value; } } exports.deserialize = deserialize; /***/ }), /***/ "./node_modules/@electron/remote/dist/src/renderer/callbacks-registry.js": /*!*******************************************************************************!*\ !*** ./node_modules/@electron/remote/dist/src/renderer/callbacks-registry.js ***! \*******************************************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.CallbacksRegistry = void 0; class CallbacksRegistry { constructor() { this.nextId = 0; this.callbacks = {}; this.callbackIds = new WeakMap(); this.locationInfo = new WeakMap(); } add(callback) { // The callback is already added. let id = this.callbackIds.get(callback); if (id != null) return id; id = this.nextId += 1; this.callbacks[id] = callback; this.callbackIds.set(callback, id); // Capture the location of the function and put it in the ID string, // so that release errors can be tracked down easily. const regexp = /at (.*)/gi; const stackString = (new Error()).stack; if (!stackString) return id; let filenameAndLine; let match; while ((match = regexp.exec(stackString)) !== null) { const location = match[1]; if (location.includes('(native)')) continue; if (location.includes('()')) continue; if (location.includes('callbacks-registry.js')) continue; if (location.includes('remote.js')) continue; if (location.includes('@electron/remote/dist')) continue; const ref = /([^/^)]*)\)?$/gi.exec(location); if (ref) filenameAndLine = ref[1]; break; } this.locationInfo.set(callback, filenameAndLine); return id; } get(id) { return this.callbacks[id] || function () { }; } getLocation(callback) { return this.locationInfo.get(callback); } apply(id, ...args) { return this.get(id).apply(global, ...args); } remove(id) { const callback = this.callbacks[id]; if (callback) { this.callbackIds.delete(callback); delete this.callbacks[id]; } } } exports.CallbacksRegistry = CallbacksRegistry; /***/ }), /***/ "./node_modules/@electron/remote/dist/src/renderer/index.js": /*!******************************************************************!*\ !*** ./node_modules/@electron/remote/dist/src/renderer/index.js ***! \******************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); }; Object.defineProperty(exports, "__esModule", ({ value: true })); if (process.type === 'browser') throw new Error(`"@electron/remote" cannot be required in the browser process. Instead require("@electron/remote/main").`); __exportStar(__webpack_require__(/*! ./remote */ "./node_modules/@electron/remote/dist/src/renderer/remote.js"), exports); /***/ }), /***/ "./node_modules/@electron/remote/dist/src/renderer/remote.js": /*!*******************************************************************!*\ !*** ./node_modules/@electron/remote/dist/src/renderer/remote.js ***! \*******************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.createFunctionWithReturnValue = exports.getGlobal = exports.getCurrentWebContents = exports.getCurrentWindow = exports.getBuiltin = void 0; const callbacks_registry_1 = __webpack_require__(/*! ./callbacks-registry */ "./node_modules/@electron/remote/dist/src/renderer/callbacks-registry.js"); const type_utils_1 = __webpack_require__(/*! ../common/type-utils */ "./node_modules/@electron/remote/dist/src/common/type-utils.js"); const electron_1 = __webpack_require__(/*! electron */ "electron"); const module_names_1 = __webpack_require__(/*! ../common/module-names */ "./node_modules/@electron/remote/dist/src/common/module-names.js"); const get_electron_binding_1 = __webpack_require__(/*! ../common/get-electron-binding */ "./node_modules/@electron/remote/dist/src/common/get-electron-binding.js"); const { Promise } = global; const callbacksRegistry = new callbacks_registry_1.CallbacksRegistry(); const remoteObjectCache = new Map(); const finalizationRegistry = new FinalizationRegistry((id) => { const ref = remoteObjectCache.get(id); if (ref !== undefined && ref.deref() === undefined) { remoteObjectCache.delete(id); electron_1.ipcRenderer.send("REMOTE_BROWSER_DEREFERENCE" /* BROWSER_DEREFERENCE */, contextId, id, 0); } }); const electronIds = new WeakMap(); const isReturnValue = new WeakSet(); function getCachedRemoteObject(id) { const ref = remoteObjectCache.get(id); if (ref !== undefined) { const deref = ref.deref(); if (deref !== undefined) return deref; } } function setCachedRemoteObject(id, value) { const wr = new WeakRef(value); remoteObjectCache.set(id, wr); finalizationRegistry.register(value, id); return value; } function getContextId() { const v8Util = get_electron_binding_1.getElectronBinding('v8_util'); if (v8Util) { return v8Util.getHiddenValue(global, 'contextId'); } else { throw new Error('Electron >=v13.0.0-beta.6 required to support sandboxed renderers'); } } // An unique ID that can represent current context. const contextId = process.contextId || getContextId(); // Notify the main process when current context is going to be released. // Note that when the renderer process is destroyed, the message may not be // sent, we also listen to the "render-view-deleted" event in the main process // to guard that situation. process.on('exit', () => { const command = "REMOTE_BROWSER_CONTEXT_RELEASE" /* BROWSER_CONTEXT_RELEASE */; electron_1.ipcRenderer.send(command, contextId); }); const IS_REMOTE_PROXY = Symbol('is-remote-proxy'); // Convert the arguments object into an array of meta data. function wrapArgs(args, visited = new Set()) { const valueToMeta = (value) => { // Check for circular reference. if (visited.has(value)) { return { type: 'value', value: null }; } if (value && value.constructor && value.constructor.name === 'NativeImage') { return { type: 'nativeimage', value: type_utils_1.serialize(value) }; } else if (Array.isArray(value)) { visited.add(value); const meta = { type: 'array', value: wrapArgs(value, visited) }; visited.delete(value); return meta; } else if (value instanceof Buffer) { return { type: 'buffer', value }; } else if (type_utils_1.isSerializableObject(value)) { return { type: 'value', value }; } else if (typeof value === 'object') { if (type_utils_1.isPromise(value)) { return { type: 'promise', then: valueToMeta(function (onFulfilled, onRejected) { value.then(onFulfilled, onRejected); }) }; } else if (electronIds.has(value)) { return { type: 'remote-object', id: electronIds.get(value) }; } const meta = { type: 'object', name: value.constructor ? value.constructor.name : '', members: [] }; visited.add(value); for (const prop in value) { // eslint-disable-line guard-for-in meta.members.push({ name: prop, value: valueToMeta(value[prop]) }); } visited.delete(value); return meta; } else if (typeof value === 'function' && isReturnValue.has(value)) { return { type: 'function-with-return-value', value: valueToMeta(value()) }; } else if (typeof value === 'function') { return { type: 'function', id: callbacksRegistry.add(value), location: callbacksRegistry.getLocation(value), length: value.length }; } else { return { type: 'value', value }; } }; return args.map(valueToMeta); } // Populate object's members from descriptors. // The |ref| will be kept referenced by |members|. // This matches |getObjectMemebers| in rpc-server. function setObjectMembers(ref, object, metaId, members) { if (!Array.isArray(members)) return; for (const member of members) { if (Object.prototype.hasOwnProperty.call(object, member.name)) continue; const descriptor = { enumerable: member.enumerable }; if (member.type === 'method') { const remoteMemberFunction = function (...args) { let command; if (this && this.constructor === remoteMemberFunction) { command = "REMOTE_BROWSER_MEMBER_CONSTRUCTOR" /* BROWSER_MEMBER_CONSTRUCTOR */; } else { command = "REMOTE_BROWSER_MEMBER_CALL" /* BROWSER_MEMBER_CALL */; } const ret = electron_1.ipcRenderer.sendSync(command, contextId, metaId, member.name, wrapArgs(args)); return metaToValue(ret); }; let descriptorFunction = proxyFunctionProperties(remoteMemberFunction, metaId, member.name); descriptor.get = () => { descriptorFunction.ref = ref; // The member should reference its object. return descriptorFunction; }; // Enable monkey-patch the method descriptor.set = (value) => { descriptorFunction = value; return value; }; descriptor.configurable = true; } else if (member.type === 'get') { descriptor.get = () => { const command = "REMOTE_BROWSER_MEMBER_GET" /* BROWSER_MEMBER_GET */; const meta = electron_1.ipcRenderer.sendSync(command, contextId, metaId, member.name); return metaToValue(meta); }; if (member.writable) { descriptor.set = (value) => { const args = wrapArgs([value]); const command = "REMOTE_BROWSER_MEMBER_SET" /* BROWSER_MEMBER_SET */; const meta = electron_1.ipcRenderer.sendSync(command, contextId, metaId, member.name, args); if (meta != null) metaToValue(meta); return value; }; } } Object.defineProperty(object, member.name, descriptor); } } // Populate object's prototype from descriptor. // This matches |getObjectPrototype| in rpc-server. function setObjectPrototype(ref, object, metaId, descriptor) { if (descriptor === null) return; const proto = {}; setObjectMembers(ref, proto, metaId, descriptor.members); setObjectPrototype(ref, proto, metaId, descriptor.proto); Object.setPrototypeOf(object, proto); } // Wrap function in Proxy for accessing remote properties function proxyFunctionProperties(remoteMemberFunction, metaId, name) { let loaded = false; // Lazily load function properties const loadRemoteProperties = () => { if (loaded) return; loaded = true; const command = "REMOTE_BROWSER_MEMBER_GET" /* BROWSER_MEMBER_GET */; const meta = electron_1.ipcRenderer.sendSync(command, contextId, metaId, name); setObjectMembers(remoteMemberFunction, remoteMemberFunction, meta.id, meta.members); }; return new Proxy(remoteMemberFunction, { set: (target, property, value) => { if (property !== 'ref') loadRemoteProperties(); target[property] = value; return true; }, get: (target, property) => { if (property === IS_REMOTE_PROXY) return true; if (!Object.prototype.hasOwnProperty.call(target, property)) loadRemoteProperties(); const value = target[property]; if (property === 'toString' && typeof value === 'function') { return value.bind(target); } return value; }, ownKeys: (target) => { loadRemoteProperties(); return Object.getOwnPropertyNames(target); }, getOwnPropertyDescriptor: (target, property) => { const descriptor = Object.getOwnPropertyDescriptor(target, property); if (descriptor) return descriptor; loadRemoteProperties(); return Object.getOwnPropertyDescriptor(target, property); } }); } // Convert meta data from browser into real value. function metaToValue(meta) { if (!meta) return {}; if (meta.type === 'value') { return meta.value; } else if (meta.type === 'array') { return meta.members.map((member) => metaToValue(member)); } else if (meta.type === 'nativeimage') { return type_utils_1.deserialize(meta.value); } else if (meta.type === 'buffer') { return Buffer.from(meta.value.buffer, meta.value.byteOffset, meta.value.byteLength); } else if (meta.type === 'promise') { return Promise.resolve({ then: metaToValue(meta.then) }); } else if (meta.type === 'error') { return metaToError(meta); } else if (meta.type === 'exception') { if (meta.value.type === 'error') { throw metaToError(meta.value); } else { throw new Error(`Unexpected value type in exception: ${meta.value.type}`); } } else { let ret; if ('id' in meta) { const cached = getCachedRemoteObject(meta.id); if (cached !== undefined) { return cached; } } // A shadow class to represent the remote function object. if (meta.type === 'function') { const remoteFunction = function (...args) { let command; if (this && this.constructor === remoteFunction) { command = "REMOTE_BROWSER_CONSTRUCTOR" /* BROWSER_CONSTRUCTOR */; } else { command = "REMOTE_BROWSER_FUNCTION_CALL" /* BROWSER_FUNCTION_CALL */; } const obj = electron_1.ipcRenderer.sendSync(command, contextId, meta.id, wrapArgs(args)); return metaToValue(obj); }; ret = remoteFunction; } else { ret = {}; } setObjectMembers(ret, ret, meta.id, meta.members); setObjectPrototype(ret, ret, meta.id, meta.proto); if (ret.constructor && ret.constructor[IS_REMOTE_PROXY]) { Object.defineProperty(ret.constructor, 'name', { value: meta.name }); } // Track delegate obj's lifetime & tell browser to clean up when object is GCed. electronIds.set(ret, meta.id); setCachedRemoteObject(meta.id, ret); return ret; } } function metaToError(meta) { const obj = meta.value; for (const { name, value } of meta.members) { obj[name] = metaToValue(value); } return obj; } function hasSenderId(input) { return typeof input.senderId === "number"; } function handleMessage(channel, handler) { electron_1.ipcRenderer.on(channel, (event, passedContextId, id, ...args) => { if (hasSenderId(event)) { if (event.senderId !== 0 && event.senderId !== undefined) { console.error(`Message ${channel} sent by unexpected WebContents (${event.senderId})`); return; } } if (passedContextId === contextId) { handler(id, ...args); } else { // Message sent to an un-exist context, notify the error to main process. electron_1.ipcRenderer.send("REMOTE_BROWSER_WRONG_CONTEXT_ERROR" /* BROWSER_WRONG_CONTEXT_ERROR */, contextId, passedContextId, id); } }); } const enableStacks = process.argv.includes('--enable-api-filtering-logging'); function getCurrentStack() { const target = { stack: undefined }; if (enableStacks) { Error.captureStackTrace(target, getCurrentStack); } return target.stack; } // Browser calls a callback in renderer. handleMessage("REMOTE_RENDERER_CALLBACK" /* RENDERER_CALLBACK */, (id, args) => { callbacksRegistry.apply(id, metaToValue(args)); }); // A callback in browser is released. handleMessage("REMOTE_RENDERER_RELEASE_CALLBACK" /* RENDERER_RELEASE_CALLBACK */, (id) => { callbacksRegistry.remove(id); }); exports.require = (module) => { const command = "REMOTE_BROWSER_REQUIRE" /* BROWSER_REQUIRE */; const meta = electron_1.ipcRenderer.sendSync(command, contextId, module, getCurrentStack()); return metaToValue(meta); }; // Alias to remote.require('electron').xxx. function getBuiltin(module) { const command = "REMOTE_BROWSER_GET_BUILTIN" /* BROWSER_GET_BUILTIN */; const meta = electron_1.ipcRenderer.sendSync(command, contextId, module, getCurrentStack()); return metaToValue(meta); } exports.getBuiltin = getBuiltin; function getCurrentWindow() { const command = "REMOTE_BROWSER_GET_CURRENT_WINDOW" /* BROWSER_GET_CURRENT_WINDOW */; const meta = electron_1.ipcRenderer.sendSync(command, contextId, getCurrentStack()); return metaToValue(meta); } exports.getCurrentWindow = getCurrentWindow; // Get current WebContents object. function getCurrentWebContents() { const command = "REMOTE_BROWSER_GET_CURRENT_WEB_CONTENTS" /* BROWSER_GET_CURRENT_WEB_CONTENTS */; const meta = electron_1.ipcRenderer.sendSync(command, contextId, getCurrentStack()); return metaToValue(meta); } exports.getCurrentWebContents = getCurrentWebContents; // Get a global object in browser. function getGlobal(name) { const command = "REMOTE_BROWSER_GET_GLOBAL" /* BROWSER_GET_GLOBAL */; const meta = electron_1.ipcRenderer.sendSync(command, contextId, name, getCurrentStack()); return metaToValue(meta); } exports.getGlobal = getGlobal; // Get the process object in browser. Object.defineProperty(exports, "process", ({ enumerable: true, get: () => exports.getGlobal('process') })); // Create a function that will return the specified value when called in browser. function createFunctionWithReturnValue(returnValue) { const func = () => returnValue; isReturnValue.add(func); return func; } exports.createFunctionWithReturnValue = createFunctionWithReturnValue; const addBuiltinProperty = (name) => { Object.defineProperty(exports, name, { enumerable: true, get: () => exports.getBuiltin(name) }); }; module_names_1.browserModuleNames .forEach(addBuiltinProperty); /***/ }), /***/ "./node_modules/@electron/remote/renderer/index.js": /*!*********************************************************!*\ !*** ./node_modules/@electron/remote/renderer/index.js ***! \*********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { module.exports = __webpack_require__(/*! ../dist/src/renderer */ "./node_modules/@electron/remote/dist/src/renderer/index.js") /***/ }), /***/ "./node_modules/@vue/compiler-core/dist/compiler-core.cjs.js": /*!*******************************************************************!*\ !*** ./node_modules/@vue/compiler-core/dist/compiler-core.cjs.js ***! \*******************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * @vue/compiler-core v3.5.13 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/ Object.defineProperty(exports, "__esModule", ({ value: true })); var shared = __webpack_require__(/*! @vue/shared */ "./node_modules/@vue/shared/dist/shared.cjs.js"); var decode_js = __webpack_require__(/*! entities/lib/decode.js */ "./node_modules/entities/lib/decode.js"); var parser = __webpack_require__(/*! @babel/parser */ "./node_modules/@babel/parser/lib/index.js"); var estreeWalker = __webpack_require__(/*! estree-walker */ "./node_modules/estree-walker/dist/umd/estree-walker.js"); var sourceMapJs = __webpack_require__(/*! source-map-js */ "./node_modules/source-map-js/source-map.js"); const FRAGMENT = Symbol(`Fragment` ); const TELEPORT = Symbol(`Teleport` ); const SUSPENSE = Symbol(`Suspense` ); const KEEP_ALIVE = Symbol(`KeepAlive` ); const BASE_TRANSITION = Symbol( `BaseTransition` ); const OPEN_BLOCK = Symbol(`openBlock` ); const CREATE_BLOCK = Symbol(`createBlock` ); const CREATE_ELEMENT_BLOCK = Symbol( `createElementBlock` ); const CREATE_VNODE = Symbol(`createVNode` ); const CREATE_ELEMENT_VNODE = Symbol( `createElementVNode` ); const CREATE_COMMENT = Symbol( `createCommentVNode` ); const CREATE_TEXT = Symbol( `createTextVNode` ); const CREATE_STATIC = Symbol( `createStaticVNode` ); const RESOLVE_COMPONENT = Symbol( `resolveComponent` ); const RESOLVE_DYNAMIC_COMPONENT = Symbol( `resolveDynamicComponent` ); const RESOLVE_DIRECTIVE = Symbol( `resolveDirective` ); const RESOLVE_FILTER = Symbol( `resolveFilter` ); const WITH_DIRECTIVES = Symbol( `withDirectives` ); const RENDER_LIST = Symbol(`renderList` ); const RENDER_SLOT = Symbol(`renderSlot` ); const CREATE_SLOTS = Symbol(`createSlots` ); const TO_DISPLAY_STRING = Symbol( `toDisplayString` ); const MERGE_PROPS = Symbol(`mergeProps` ); const NORMALIZE_CLASS = Symbol( `normalizeClass` ); const NORMALIZE_STYLE = Symbol( `normalizeStyle` ); const NORMALIZE_PROPS = Symbol( `normalizeProps` ); const GUARD_REACTIVE_PROPS = Symbol( `guardReactiveProps` ); const TO_HANDLERS = Symbol(`toHandlers` ); const CAMELIZE = Symbol(`camelize` ); const CAPITALIZE = Symbol(`capitalize` ); const TO_HANDLER_KEY = Symbol( `toHandlerKey` ); const SET_BLOCK_TRACKING = Symbol( `setBlockTracking` ); const PUSH_SCOPE_ID = Symbol(`pushScopeId` ); const POP_SCOPE_ID = Symbol(`popScopeId` ); const WITH_CTX = Symbol(`withCtx` ); const UNREF = Symbol(`unref` ); const IS_REF = Symbol(`isRef` ); const WITH_MEMO = Symbol(`withMemo` ); const IS_MEMO_SAME = Symbol(`isMemoSame` ); const helperNameMap = { [FRAGMENT]: `Fragment`, [TELEPORT]: `Teleport`, [SUSPENSE]: `Suspense`, [KEEP_ALIVE]: `KeepAlive`, [BASE_TRANSITION]: `BaseTransition`, [OPEN_BLOCK]: `openBlock`, [CREATE_BLOCK]: `createBlock`, [CREATE_ELEMENT_BLOCK]: `createElementBlock`, [CREATE_VNODE]: `createVNode`, [CREATE_ELEMENT_VNODE]: `createElementVNode`, [CREATE_COMMENT]: `createCommentVNode`, [CREATE_TEXT]: `createTextVNode`, [CREATE_STATIC]: `createStaticVNode`, [RESOLVE_COMPONENT]: `resolveComponent`, [RESOLVE_DYNAMIC_COMPONENT]: `resolveDynamicComponent`, [RESOLVE_DIRECTIVE]: `resolveDirective`, [RESOLVE_FILTER]: `resolveFilter`, [WITH_DIRECTIVES]: `withDirectives`, [RENDER_LIST]: `renderList`, [RENDER_SLOT]: `renderSlot`, [CREATE_SLOTS]: `createSlots`, [TO_DISPLAY_STRING]: `toDisplayString`, [MERGE_PROPS]: `mergeProps`, [NORMALIZE_CLASS]: `normalizeClass`, [NORMALIZE_STYLE]: `normalizeStyle`, [NORMALIZE_PROPS]: `normalizeProps`, [GUARD_REACTIVE_PROPS]: `guardReactiveProps`, [TO_HANDLERS]: `toHandlers`, [CAMELIZE]: `camelize`, [CAPITALIZE]: `capitalize`, [TO_HANDLER_KEY]: `toHandlerKey`, [SET_BLOCK_TRACKING]: `setBlockTracking`, [PUSH_SCOPE_ID]: `pushScopeId`, [POP_SCOPE_ID]: `popScopeId`, [WITH_CTX]: `withCtx`, [UNREF]: `unref`, [IS_REF]: `isRef`, [WITH_MEMO]: `withMemo`, [IS_MEMO_SAME]: `isMemoSame` }; function registerRuntimeHelpers(helpers) { Object.getOwnPropertySymbols(helpers).forEach((s) => { helperNameMap[s] = helpers[s]; }); } const Namespaces = { "HTML": 0, "0": "HTML", "SVG": 1, "1": "SVG", "MATH_ML": 2, "2": "MATH_ML" }; const NodeTypes = { "ROOT": 0, "0": "ROOT", "ELEMENT": 1, "1": "ELEMENT", "TEXT": 2, "2": "TEXT", "COMMENT": 3, "3": "COMMENT", "SIMPLE_EXPRESSION": 4, "4": "SIMPLE_EXPRESSION", "INTERPOLATION": 5, "5": "INTERPOLATION", "ATTRIBUTE": 6, "6": "ATTRIBUTE", "DIRECTIVE": 7, "7": "DIRECTIVE", "COMPOUND_EXPRESSION": 8, "8": "COMPOUND_EXPRESSION", "IF": 9, "9": "IF", "IF_BRANCH": 10, "10": "IF_BRANCH", "FOR": 11, "11": "FOR", "TEXT_CALL": 12, "12": "TEXT_CALL", "VNODE_CALL": 13, "13": "VNODE_CALL", "JS_CALL_EXPRESSION": 14, "14": "JS_CALL_EXPRESSION", "JS_OBJECT_EXPRESSION": 15, "15": "JS_OBJECT_EXPRESSION", "JS_PROPERTY": 16, "16": "JS_PROPERTY", "JS_ARRAY_EXPRESSION": 17, "17": "JS_ARRAY_EXPRESSION", "JS_FUNCTION_EXPRESSION": 18, "18": "JS_FUNCTION_EXPRESSION", "JS_CONDITIONAL_EXPRESSION": 19, "19": "JS_CONDITIONAL_EXPRESSION", "JS_CACHE_EXPRESSION": 20, "20": "JS_CACHE_EXPRESSION", "JS_BLOCK_STATEMENT": 21, "21": "JS_BLOCK_STATEMENT", "JS_TEMPLATE_LITERAL": 22, "22": "JS_TEMPLATE_LITERAL", "JS_IF_STATEMENT": 23, "23": "JS_IF_STATEMENT", "JS_ASSIGNMENT_EXPRESSION": 24, "24": "JS_ASSIGNMENT_EXPRESSION", "JS_SEQUENCE_EXPRESSION": 25, "25": "JS_SEQUENCE_EXPRESSION", "JS_RETURN_STATEMENT": 26, "26": "JS_RETURN_STATEMENT" }; const ElementTypes = { "ELEMENT": 0, "0": "ELEMENT", "COMPONENT": 1, "1": "COMPONENT", "SLOT": 2, "2": "SLOT", "TEMPLATE": 3, "3": "TEMPLATE" }; const ConstantTypes = { "NOT_CONSTANT": 0, "0": "NOT_CONSTANT", "CAN_SKIP_PATCH": 1, "1": "CAN_SKIP_PATCH", "CAN_CACHE": 2, "2": "CAN_CACHE", "CAN_STRINGIFY": 3, "3": "CAN_STRINGIFY" }; const locStub = { start: { line: 1, column: 1, offset: 0 }, end: { line: 1, column: 1, offset: 0 }, source: "" }; function createRoot(children, source = "") { return { type: 0, source, children, helpers: /* @__PURE__ */ new Set(), components: [], directives: [], hoists: [], imports: [], cached: [], temps: 0, codegenNode: void 0, loc: locStub }; } function createVNodeCall(context, tag, props, children, patchFlag, dynamicProps, directives, isBlock = false, disableTracking = false, isComponent = false, loc = locStub) { if (context) { if (isBlock) { context.helper(OPEN_BLOCK); context.helper(getVNodeBlockHelper(context.inSSR, isComponent)); } else { context.helper(getVNodeHelper(context.inSSR, isComponent)); } if (directives) { context.helper(WITH_DIRECTIVES); } } return { type: 13, tag, props, children, patchFlag, dynamicProps, directives, isBlock, disableTracking, isComponent, loc }; } function createArrayExpression(elements, loc = locStub) { return { type: 17, loc, elements }; } function createObjectExpression(properties, loc = locStub) { return { type: 15, loc, properties }; } function createObjectProperty(key, value) { return { type: 16, loc: locStub, key: shared.isString(key) ? createSimpleExpression(key, true) : key, value }; } function createSimpleExpression(content, isStatic = false, loc = locStub, constType = 0) { return { type: 4, loc, content, isStatic, constType: isStatic ? 3 : constType }; } function createInterpolation(content, loc) { return { type: 5, loc, content: shared.isString(content) ? createSimpleExpression(content, false, loc) : content }; } function createCompoundExpression(children, loc = locStub) { return { type: 8, loc, children }; } function createCallExpression(callee, args = [], loc = locStub) { return { type: 14, loc, callee, arguments: args }; } function createFunctionExpression(params, returns = void 0, newline = false, isSlot = false, loc = locStub) { return { type: 18, params, returns, newline, isSlot, loc }; } function createConditionalExpression(test, consequent, alternate, newline = true) { return { type: 19, test, consequent, alternate, newline, loc: locStub }; } function createCacheExpression(index, value, needPauseTracking = false, inVOnce = false) { return { type: 20, index, value, needPauseTracking, inVOnce, needArraySpread: false, loc: locStub }; } function createBlockStatement(body) { return { type: 21, body, loc: locStub }; } function createTemplateLiteral(elements) { return { type: 22, elements, loc: locStub }; } function createIfStatement(test, consequent, alternate) { return { type: 23, test, consequent, alternate, loc: locStub }; } function createAssignmentExpression(left, right) { return { type: 24, left, right, loc: locStub }; } function createSequenceExpression(expressions) { return { type: 25, expressions, loc: locStub }; } function createReturnStatement(returns) { return { type: 26, returns, loc: locStub }; } function getVNodeHelper(ssr, isComponent) { return ssr || isComponent ? CREATE_VNODE : CREATE_ELEMENT_VNODE; } function getVNodeBlockHelper(ssr, isComponent) { return ssr || isComponent ? CREATE_BLOCK : CREATE_ELEMENT_BLOCK; } function convertToBlock(node, { helper, removeHelper, inSSR }) { if (!node.isBlock) { node.isBlock = true; removeHelper(getVNodeHelper(inSSR, node.isComponent)); helper(OPEN_BLOCK); helper(getVNodeBlockHelper(inSSR, node.isComponent)); } } const defaultDelimitersOpen = new Uint8Array([123, 123]); const defaultDelimitersClose = new Uint8Array([125, 125]); function isTagStartChar(c) { return c >= 97 && c <= 122 || c >= 65 && c <= 90; } function isWhitespace(c) { return c === 32 || c === 10 || c === 9 || c === 12 || c === 13; } function isEndOfTagSection(c) { return c === 47 || c === 62 || isWhitespace(c); } function toCharCodes(str) { const ret = new Uint8Array(str.length); for (let i = 0; i < str.length; i++) { ret[i] = str.charCodeAt(i); } return ret; } const Sequences = { Cdata: new Uint8Array([67, 68, 65, 84, 65, 91]), // CDATA[ CdataEnd: new Uint8Array([93, 93, 62]), // ]]> CommentEnd: new Uint8Array([45, 45, 62]), // `-->` ScriptEnd: new Uint8Array([60, 47, 115, 99, 114, 105, 112, 116]), // `<\/script` StyleEnd: new Uint8Array([60, 47, 115, 116, 121, 108, 101]), // ` this.emitCodePoint(cp, consumed) ); } } get inSFCRoot() { return this.mode === 2 && this.stack.length === 0; } reset() { this.state = 1; this.mode = 0; this.buffer = ""; this.sectionStart = 0; this.index = 0; this.baseState = 1; this.inRCDATA = false; this.currentSequence = void 0; this.newlines.length = 0; this.delimiterOpen = defaultDelimitersOpen; this.delimiterClose = defaultDelimitersClose; } /** * Generate Position object with line / column information using recorded * newline positions. We know the index is always going to be an already * processed index, so all the newlines up to this index should have been * recorded. */ getPos(index) { let line = 1; let column = index + 1; for (let i = this.newlines.length - 1; i >= 0; i--) { const newlineIndex = this.newlines[i]; if (index > newlineIndex) { line = i + 2; column = index - newlineIndex; break; } } return { column, line, offset: index }; } peek() { return this.buffer.charCodeAt(this.index + 1); } stateText(c) { if (c === 60) { if (this.index > this.sectionStart) { this.cbs.ontext(this.sectionStart, this.index); } this.state = 5; this.sectionStart = this.index; } else if (c === 38) { this.startEntity(); } else if (!this.inVPre && c === this.delimiterOpen[0]) { this.state = 2; this.delimiterIndex = 0; this.stateInterpolationOpen(c); } } stateInterpolationOpen(c) { if (c === this.delimiterOpen[this.delimiterIndex]) { if (this.delimiterIndex === this.delimiterOpen.length - 1) { const start = this.index + 1 - this.delimiterOpen.length; if (start > this.sectionStart) { this.cbs.ontext(this.sectionStart, start); } this.state = 3; this.sectionStart = start; } else { this.delimiterIndex++; } } else if (this.inRCDATA) { this.state = 32; this.stateInRCDATA(c); } else { this.state = 1; this.stateText(c); } } stateInterpolation(c) { if (c === this.delimiterClose[0]) { this.state = 4; this.delimiterIndex = 0; this.stateInterpolationClose(c); } } stateInterpolationClose(c) { if (c === this.delimiterClose[this.delimiterIndex]) { if (this.delimiterIndex === this.delimiterClose.length - 1) { this.cbs.oninterpolation(this.sectionStart, this.index + 1); if (this.inRCDATA) { this.state = 32; } else { this.state = 1; } this.sectionStart = this.index + 1; } else { this.delimiterIndex++; } } else { this.state = 3; this.stateInterpolation(c); } } stateSpecialStartSequence(c) { const isEnd = this.sequenceIndex === this.currentSequence.length; const isMatch = isEnd ? ( // If we are at the end of the sequence, make sure the tag name has ended isEndOfTagSection(c) ) : ( // Otherwise, do a case-insensitive comparison (c | 32) === this.currentSequence[this.sequenceIndex] ); if (!isMatch) { this.inRCDATA = false; } else if (!isEnd) { this.sequenceIndex++; return; } this.sequenceIndex = 0; this.state = 6; this.stateInTagName(c); } /** Look for an end tag. For and <textarea>, also decode entities. */ stateInRCDATA(c) { if (this.sequenceIndex === this.currentSequence.length) { if (c === 62 || isWhitespace(c)) { const endOfText = this.index - this.currentSequence.length; if (this.sectionStart < endOfText) { const actualIndex = this.index; this.index = endOfText; this.cbs.ontext(this.sectionStart, endOfText); this.index = actualIndex; } this.sectionStart = endOfText + 2; this.stateInClosingTagName(c); this.inRCDATA = false; return; } this.sequenceIndex = 0; } if ((c | 32) === this.currentSequence[this.sequenceIndex]) { this.sequenceIndex += 1; } else if (this.sequenceIndex === 0) { if (this.currentSequence === Sequences.TitleEnd || this.currentSequence === Sequences.TextareaEnd && !this.inSFCRoot) { if (c === 38) { this.startEntity(); } else if (!this.inVPre && c === this.delimiterOpen[0]) { this.state = 2; this.delimiterIndex = 0; this.stateInterpolationOpen(c); } } else if (this.fastForwardTo(60)) { this.sequenceIndex = 1; } } else { this.sequenceIndex = Number(c === 60); } } stateCDATASequence(c) { if (c === Sequences.Cdata[this.sequenceIndex]) { if (++this.sequenceIndex === Sequences.Cdata.length) { this.state = 28; this.currentSequence = Sequences.CdataEnd; this.sequenceIndex = 0; this.sectionStart = this.index + 1; } } else { this.sequenceIndex = 0; this.state = 23; this.stateInDeclaration(c); } } /** * When we wait for one specific character, we can speed things up * by skipping through the buffer until we find it. * * @returns Whether the character was found. */ fastForwardTo(c) { while (++this.index < this.buffer.length) { const cc = this.buffer.charCodeAt(this.index); if (cc === 10) { this.newlines.push(this.index); } if (cc === c) { return true; } } this.index = this.buffer.length - 1; return false; } /** * Comments and CDATA end with `-->` and `]]>`. * * Their common qualities are: * - Their end sequences have a distinct character they start with. * - That character is then repeated, so we have to check multiple repeats. * - All characters but the start character of the sequence can be skipped. */ stateInCommentLike(c) { if (c === this.currentSequence[this.sequenceIndex]) { if (++this.sequenceIndex === this.currentSequence.length) { if (this.currentSequence === Sequences.CdataEnd) { this.cbs.oncdata(this.sectionStart, this.index - 2); } else { this.cbs.oncomment(this.sectionStart, this.index - 2); } this.sequenceIndex = 0; this.sectionStart = this.index + 1; this.state = 1; } } else if (this.sequenceIndex === 0) { if (this.fastForwardTo(this.currentSequence[0])) { this.sequenceIndex = 1; } } else if (c !== this.currentSequence[this.sequenceIndex - 1]) { this.sequenceIndex = 0; } } startSpecial(sequence, offset) { this.enterRCDATA(sequence, offset); this.state = 31; } enterRCDATA(sequence, offset) { this.inRCDATA = true; this.currentSequence = sequence; this.sequenceIndex = offset; } stateBeforeTagName(c) { if (c === 33) { this.state = 22; this.sectionStart = this.index + 1; } else if (c === 63) { this.state = 24; this.sectionStart = this.index + 1; } else if (isTagStartChar(c)) { this.sectionStart = this.index; if (this.mode === 0) { this.state = 6; } else if (this.inSFCRoot) { this.state = 34; } else if (!this.inXML) { if (c === 116) { this.state = 30; } else { this.state = c === 115 ? 29 : 6; } } else { this.state = 6; } } else if (c === 47) { this.state = 8; } else { this.state = 1; this.stateText(c); } } stateInTagName(c) { if (isEndOfTagSection(c)) { this.handleTagName(c); } } stateInSFCRootTagName(c) { if (isEndOfTagSection(c)) { const tag = this.buffer.slice(this.sectionStart, this.index); if (tag !== "template") { this.enterRCDATA(toCharCodes(`</` + tag), 0); } this.handleTagName(c); } } handleTagName(c) { this.cbs.onopentagname(this.sectionStart, this.index); this.sectionStart = -1; this.state = 11; this.stateBeforeAttrName(c); } stateBeforeClosingTagName(c) { if (isWhitespace(c)) ; else if (c === 62) { { this.cbs.onerr(14, this.index); } this.state = 1; this.sectionStart = this.index + 1; } else { this.state = isTagStartChar(c) ? 9 : 27; this.sectionStart = this.index; } } stateInClosingTagName(c) { if (c === 62 || isWhitespace(c)) { this.cbs.onclosetag(this.sectionStart, this.index); this.sectionStart = -1; this.state = 10; this.stateAfterClosingTagName(c); } } stateAfterClosingTagName(c) { if (c === 62) { this.state = 1; this.sectionStart = this.index + 1; } } stateBeforeAttrName(c) { if (c === 62) { this.cbs.onopentagend(this.index); if (this.inRCDATA) { this.state = 32; } else { this.state = 1; } this.sectionStart = this.index + 1; } else if (c === 47) { this.state = 7; if (this.peek() !== 62) { this.cbs.onerr(22, this.index); } } else if (c === 60 && this.peek() === 47) { this.cbs.onopentagend(this.index); this.state = 5; this.sectionStart = this.index; } else if (!isWhitespace(c)) { if (c === 61) { this.cbs.onerr( 19, this.index ); } this.handleAttrStart(c); } } handleAttrStart(c) { if (c === 118 && this.peek() === 45) { this.state = 13; this.sectionStart = this.index; } else if (c === 46 || c === 58 || c === 64 || c === 35) { this.cbs.ondirname(this.index, this.index + 1); this.state = 14; this.sectionStart = this.index + 1; } else { this.state = 12; this.sectionStart = this.index; } } stateInSelfClosingTag(c) { if (c === 62) { this.cbs.onselfclosingtag(this.index); this.state = 1; this.sectionStart = this.index + 1; this.inRCDATA = false; } else if (!isWhitespace(c)) { this.state = 11; this.stateBeforeAttrName(c); } } stateInAttrName(c) { if (c === 61 || isEndOfTagSection(c)) { this.cbs.onattribname(this.sectionStart, this.index); this.handleAttrNameEnd(c); } else if (c === 34 || c === 39 || c === 60) { this.cbs.onerr( 17, this.index ); } } stateInDirName(c) { if (c === 61 || isEndOfTagSection(c)) { this.cbs.ondirname(this.sectionStart, this.index); this.handleAttrNameEnd(c); } else if (c === 58) { this.cbs.ondirname(this.sectionStart, this.index); this.state = 14; this.sectionStart = this.index + 1; } else if (c === 46) { this.cbs.ondirname(this.sectionStart, this.index); this.state = 16; this.sectionStart = this.index + 1; } } stateInDirArg(c) { if (c === 61 || isEndOfTagSection(c)) { this.cbs.ondirarg(this.sectionStart, this.index); this.handleAttrNameEnd(c); } else if (c === 91) { this.state = 15; } else if (c === 46) { this.cbs.ondirarg(this.sectionStart, this.index); this.state = 16; this.sectionStart = this.index + 1; } } stateInDynamicDirArg(c) { if (c === 93) { this.state = 14; } else if (c === 61 || isEndOfTagSection(c)) { this.cbs.ondirarg(this.sectionStart, this.index + 1); this.handleAttrNameEnd(c); { this.cbs.onerr( 27, this.index ); } } } stateInDirModifier(c) { if (c === 61 || isEndOfTagSection(c)) { this.cbs.ondirmodifier(this.sectionStart, this.index); this.handleAttrNameEnd(c); } else if (c === 46) { this.cbs.ondirmodifier(this.sectionStart, this.index); this.sectionStart = this.index + 1; } } handleAttrNameEnd(c) { this.sectionStart = this.index; this.state = 17; this.cbs.onattribnameend(this.index); this.stateAfterAttrName(c); } stateAfterAttrName(c) { if (c === 61) { this.state = 18; } else if (c === 47 || c === 62) { this.cbs.onattribend(0, this.sectionStart); this.sectionStart = -1; this.state = 11; this.stateBeforeAttrName(c); } else if (!isWhitespace(c)) { this.cbs.onattribend(0, this.sectionStart); this.handleAttrStart(c); } } stateBeforeAttrValue(c) { if (c === 34) { this.state = 19; this.sectionStart = this.index + 1; } else if (c === 39) { this.state = 20; this.sectionStart = this.index + 1; } else if (!isWhitespace(c)) { this.sectionStart = this.index; this.state = 21; this.stateInAttrValueNoQuotes(c); } } handleInAttrValue(c, quote) { if (c === quote || false) { this.cbs.onattribdata(this.sectionStart, this.index); this.sectionStart = -1; this.cbs.onattribend( quote === 34 ? 3 : 2, this.index + 1 ); this.state = 11; } else if (c === 38) { this.startEntity(); } } stateInAttrValueDoubleQuotes(c) { this.handleInAttrValue(c, 34); } stateInAttrValueSingleQuotes(c) { this.handleInAttrValue(c, 39); } stateInAttrValueNoQuotes(c) { if (isWhitespace(c) || c === 62) { this.cbs.onattribdata(this.sectionStart, this.index); this.sectionStart = -1; this.cbs.onattribend(1, this.index); this.state = 11; this.stateBeforeAttrName(c); } else if (c === 34 || c === 39 || c === 60 || c === 61 || c === 96) { this.cbs.onerr( 18, this.index ); } else if (c === 38) { this.startEntity(); } } stateBeforeDeclaration(c) { if (c === 91) { this.state = 26; this.sequenceIndex = 0; } else { this.state = c === 45 ? 25 : 23; } } stateInDeclaration(c) { if (c === 62 || this.fastForwardTo(62)) { this.state = 1; this.sectionStart = this.index + 1; } } stateInProcessingInstruction(c) { if (c === 62 || this.fastForwardTo(62)) { this.cbs.onprocessinginstruction(this.sectionStart, this.index); this.state = 1; this.sectionStart = this.index + 1; } } stateBeforeComment(c) { if (c === 45) { this.state = 28; this.currentSequence = Sequences.CommentEnd; this.sequenceIndex = 2; this.sectionStart = this.index + 1; } else { this.state = 23; } } stateInSpecialComment(c) { if (c === 62 || this.fastForwardTo(62)) { this.cbs.oncomment(this.sectionStart, this.index); this.state = 1; this.sectionStart = this.index + 1; } } stateBeforeSpecialS(c) { if (c === Sequences.ScriptEnd[3]) { this.startSpecial(Sequences.ScriptEnd, 4); } else if (c === Sequences.StyleEnd[3]) { this.startSpecial(Sequences.StyleEnd, 4); } else { this.state = 6; this.stateInTagName(c); } } stateBeforeSpecialT(c) { if (c === Sequences.TitleEnd[3]) { this.startSpecial(Sequences.TitleEnd, 4); } else if (c === Sequences.TextareaEnd[3]) { this.startSpecial(Sequences.TextareaEnd, 4); } else { this.state = 6; this.stateInTagName(c); } } startEntity() { { this.baseState = this.state; this.state = 33; this.entityStart = this.index; this.entityDecoder.startEntity( this.baseState === 1 || this.baseState === 32 ? decode_js.DecodingMode.Legacy : decode_js.DecodingMode.Attribute ); } } stateInEntity() { { const length = this.entityDecoder.write(this.buffer, this.index); if (length >= 0) { this.state = this.baseState; if (length === 0) { this.index = this.entityStart; } } else { this.index = this.buffer.length - 1; } } } /** * Iterates through the buffer, calling the function corresponding to the current state. * * States that are more likely to be hit are higher up, as a performance improvement. */ parse(input) { this.buffer = input; while (this.index < this.buffer.length) { const c = this.buffer.charCodeAt(this.index); if (c === 10) { this.newlines.push(this.index); } switch (this.state) { case 1: { this.stateText(c); break; } case 2: { this.stateInterpolationOpen(c); break; } case 3: { this.stateInterpolation(c); break; } case 4: { this.stateInterpolationClose(c); break; } case 31: { this.stateSpecialStartSequence(c); break; } case 32: { this.stateInRCDATA(c); break; } case 26: { this.stateCDATASequence(c); break; } case 19: { this.stateInAttrValueDoubleQuotes(c); break; } case 12: { this.stateInAttrName(c); break; } case 13: { this.stateInDirName(c); break; } case 14: { this.stateInDirArg(c); break; } case 15: { this.stateInDynamicDirArg(c); break; } case 16: { this.stateInDirModifier(c); break; } case 28: { this.stateInCommentLike(c); break; } case 27: { this.stateInSpecialComment(c); break; } case 11: { this.stateBeforeAttrName(c); break; } case 6: { this.stateInTagName(c); break; } case 34: { this.stateInSFCRootTagName(c); break; } case 9: { this.stateInClosingTagName(c); break; } case 5: { this.stateBeforeTagName(c); break; } case 17: { this.stateAfterAttrName(c); break; } case 20: { this.stateInAttrValueSingleQuotes(c); break; } case 18: { this.stateBeforeAttrValue(c); break; } case 8: { this.stateBeforeClosingTagName(c); break; } case 10: { this.stateAfterClosingTagName(c); break; } case 29: { this.stateBeforeSpecialS(c); break; } case 30: { this.stateBeforeSpecialT(c); break; } case 21: { this.stateInAttrValueNoQuotes(c); break; } case 7: { this.stateInSelfClosingTag(c); break; } case 23: { this.stateInDeclaration(c); break; } case 22: { this.stateBeforeDeclaration(c); break; } case 25: { this.stateBeforeComment(c); break; } case 24: { this.stateInProcessingInstruction(c); break; } case 33: { this.stateInEntity(); break; } } this.index++; } this.cleanup(); this.finish(); } /** * Remove data that has already been consumed from the buffer. */ cleanup() { if (this.sectionStart !== this.index) { if (this.state === 1 || this.state === 32 && this.sequenceIndex === 0) { this.cbs.ontext(this.sectionStart, this.index); this.sectionStart = this.index; } else if (this.state === 19 || this.state === 20 || this.state === 21) { this.cbs.onattribdata(this.sectionStart, this.index); this.sectionStart = this.index; } } } finish() { if (this.state === 33) { this.entityDecoder.end(); this.state = this.baseState; } this.handleTrailingData(); this.cbs.onend(); } /** Handle any trailing data. */ handleTrailingData() { const endIndex = this.buffer.length; if (this.sectionStart >= endIndex) { return; } if (this.state === 28) { if (this.currentSequence === Sequences.CdataEnd) { this.cbs.oncdata(this.sectionStart, endIndex); } else { this.cbs.oncomment(this.sectionStart, endIndex); } } else if (this.state === 6 || this.state === 11 || this.state === 18 || this.state === 17 || this.state === 12 || this.state === 13 || this.state === 14 || this.state === 15 || this.state === 16 || this.state === 20 || this.state === 19 || this.state === 21 || this.state === 9) ; else { this.cbs.ontext(this.sectionStart, endIndex); } } emitCodePoint(cp, consumed) { { if (this.baseState !== 1 && this.baseState !== 32) { if (this.sectionStart < this.entityStart) { this.cbs.onattribdata(this.sectionStart, this.entityStart); } this.sectionStart = this.entityStart + consumed; this.index = this.sectionStart - 1; this.cbs.onattribentity( decode_js.fromCodePoint(cp), this.entityStart, this.sectionStart ); } else { if (this.sectionStart < this.entityStart) { this.cbs.ontext(this.sectionStart, this.entityStart); } this.sectionStart = this.entityStart + consumed; this.index = this.sectionStart - 1; this.cbs.ontextentity( decode_js.fromCodePoint(cp), this.entityStart, this.sectionStart ); } } } } const CompilerDeprecationTypes = { "COMPILER_IS_ON_ELEMENT": "COMPILER_IS_ON_ELEMENT", "COMPILER_V_BIND_SYNC": "COMPILER_V_BIND_SYNC", "COMPILER_V_BIND_OBJECT_ORDER": "COMPILER_V_BIND_OBJECT_ORDER", "COMPILER_V_ON_NATIVE": "COMPILER_V_ON_NATIVE", "COMPILER_V_IF_V_FOR_PRECEDENCE": "COMPILER_V_IF_V_FOR_PRECEDENCE", "COMPILER_NATIVE_TEMPLATE": "COMPILER_NATIVE_TEMPLATE", "COMPILER_INLINE_TEMPLATE": "COMPILER_INLINE_TEMPLATE", "COMPILER_FILTERS": "COMPILER_FILTERS" }; const deprecationData = { ["COMPILER_IS_ON_ELEMENT"]: { message: `Platform-native elements with "is" prop will no longer be treated as components in Vue 3 unless the "is" value is explicitly prefixed with "vue:".`, link: `https://v3-migration.vuejs.org/breaking-changes/custom-elements-interop.html` }, ["COMPILER_V_BIND_SYNC"]: { message: (key) => `.sync modifier for v-bind has been removed. Use v-model with argument instead. \`v-bind:${key}.sync\` should be changed to \`v-model:${key}\`.`, link: `https://v3-migration.vuejs.org/breaking-changes/v-model.html` }, ["COMPILER_V_BIND_OBJECT_ORDER"]: { message: `v-bind="obj" usage is now order sensitive and behaves like JavaScript object spread: it will now overwrite an existing non-mergeable attribute that appears before v-bind in the case of conflict. To retain 2.x behavior, move v-bind to make it the first attribute. You can also suppress this warning if the usage is intended.`, link: `https://v3-migration.vuejs.org/breaking-changes/v-bind.html` }, ["COMPILER_V_ON_NATIVE"]: { message: `.native modifier for v-on has been removed as is no longer necessary.`, link: `https://v3-migration.vuejs.org/breaking-changes/v-on-native-modifier-removed.html` }, ["COMPILER_V_IF_V_FOR_PRECEDENCE"]: { message: `v-if / v-for precedence when used on the same element has changed in Vue 3: v-if now takes higher precedence and will no longer have access to v-for scope variables. It is best to avoid the ambiguity with <template> tags or use a computed property that filters v-for data source.`, link: `https://v3-migration.vuejs.org/breaking-changes/v-if-v-for.html` }, ["COMPILER_NATIVE_TEMPLATE"]: { message: `<template> with no special directives will render as a native template element instead of its inner content in Vue 3.` }, ["COMPILER_INLINE_TEMPLATE"]: { message: `"inline-template" has been removed in Vue 3.`, link: `https://v3-migration.vuejs.org/breaking-changes/inline-template-attribute.html` }, ["COMPILER_FILTERS"]: { message: `filters have been removed in Vue 3. The "|" symbol will be treated as native JavaScript bitwise OR operator. Use method calls or computed properties instead.`, link: `https://v3-migration.vuejs.org/breaking-changes/filters.html` } }; function getCompatValue(key, { compatConfig }) { const value = compatConfig && compatConfig[key]; if (key === "MODE") { return value || 3; } else { return value; } } function isCompatEnabled(key, context) { const mode = getCompatValue("MODE", context); const value = getCompatValue(key, context); return mode === 3 ? value === true : value !== false; } function checkCompatEnabled(key, context, loc, ...args) { const enabled = isCompatEnabled(key, context); if (enabled) { warnDeprecation(key, context, loc, ...args); } return enabled; } function warnDeprecation(key, context, loc, ...args) { const val = getCompatValue(key, context); if (val === "suppress-warning") { return; } const { message, link } = deprecationData[key]; const msg = `(deprecation ${key}) ${typeof message === "function" ? message(...args) : message}${link ? ` Details: ${link}` : ``}`; const err = new SyntaxError(msg); err.code = key; if (loc) err.loc = loc; context.onWarn(err); } function defaultOnError(error) { throw error; } function defaultOnWarn(msg) { console.warn(`[Vue warn] ${msg.message}`); } function createCompilerError(code, loc, messages, additionalMessage) { const msg = (messages || errorMessages)[code] + (additionalMessage || ``) ; const error = new SyntaxError(String(msg)); error.code = code; error.loc = loc; return error; } const ErrorCodes = { "ABRUPT_CLOSING_OF_EMPTY_COMMENT": 0, "0": "ABRUPT_CLOSING_OF_EMPTY_COMMENT", "CDATA_IN_HTML_CONTENT": 1, "1": "CDATA_IN_HTML_CONTENT", "DUPLICATE_ATTRIBUTE": 2, "2": "DUPLICATE_ATTRIBUTE", "END_TAG_WITH_ATTRIBUTES": 3, "3": "END_TAG_WITH_ATTRIBUTES", "END_TAG_WITH_TRAILING_SOLIDUS": 4, "4": "END_TAG_WITH_TRAILING_SOLIDUS", "EOF_BEFORE_TAG_NAME": 5, "5": "EOF_BEFORE_TAG_NAME", "EOF_IN_CDATA": 6, "6": "EOF_IN_CDATA", "EOF_IN_COMMENT": 7, "7": "EOF_IN_COMMENT", "EOF_IN_SCRIPT_HTML_COMMENT_LIKE_TEXT": 8, "8": "EOF_IN_SCRIPT_HTML_COMMENT_LIKE_TEXT", "EOF_IN_TAG": 9, "9": "EOF_IN_TAG", "INCORRECTLY_CLOSED_COMMENT": 10, "10": "INCORRECTLY_CLOSED_COMMENT", "INCORRECTLY_OPENED_COMMENT": 11, "11": "INCORRECTLY_OPENED_COMMENT", "INVALID_FIRST_CHARACTER_OF_TAG_NAME": 12, "12": "INVALID_FIRST_CHARACTER_OF_TAG_NAME", "MISSING_ATTRIBUTE_VALUE": 13, "13": "MISSING_ATTRIBUTE_VALUE", "MISSING_END_TAG_NAME": 14, "14": "MISSING_END_TAG_NAME", "MISSING_WHITESPACE_BETWEEN_ATTRIBUTES": 15, "15": "MISSING_WHITESPACE_BETWEEN_ATTRIBUTES", "NESTED_COMMENT": 16, "16": "NESTED_COMMENT", "UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME": 17, "17": "UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME", "UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE": 18, "18": "UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE", "UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME": 19, "19": "UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME", "UNEXPECTED_NULL_CHARACTER": 20, "20": "UNEXPECTED_NULL_CHARACTER", "UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME": 21, "21": "UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME", "UNEXPECTED_SOLIDUS_IN_TAG": 22, "22": "UNEXPECTED_SOLIDUS_IN_TAG", "X_INVALID_END_TAG": 23, "23": "X_INVALID_END_TAG", "X_MISSING_END_TAG": 24, "24": "X_MISSING_END_TAG", "X_MISSING_INTERPOLATION_END": 25, "25": "X_MISSING_INTERPOLATION_END", "X_MISSING_DIRECTIVE_NAME": 26, "26": "X_MISSING_DIRECTIVE_NAME", "X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END": 27, "27": "X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END", "X_V_IF_NO_EXPRESSION": 28, "28": "X_V_IF_NO_EXPRESSION", "X_V_IF_SAME_KEY": 29, "29": "X_V_IF_SAME_KEY", "X_V_ELSE_NO_ADJACENT_IF": 30, "30": "X_V_ELSE_NO_ADJACENT_IF", "X_V_FOR_NO_EXPRESSION": 31, "31": "X_V_FOR_NO_EXPRESSION", "X_V_FOR_MALFORMED_EXPRESSION": 32, "32": "X_V_FOR_MALFORMED_EXPRESSION", "X_V_FOR_TEMPLATE_KEY_PLACEMENT": 33, "33": "X_V_FOR_TEMPLATE_KEY_PLACEMENT", "X_V_BIND_NO_EXPRESSION": 34, "34": "X_V_BIND_NO_EXPRESSION", "X_V_ON_NO_EXPRESSION": 35, "35": "X_V_ON_NO_EXPRESSION", "X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET": 36, "36": "X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET", "X_V_SLOT_MIXED_SLOT_USAGE": 37, "37": "X_V_SLOT_MIXED_SLOT_USAGE", "X_V_SLOT_DUPLICATE_SLOT_NAMES": 38, "38": "X_V_SLOT_DUPLICATE_SLOT_NAMES", "X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN": 39, "39": "X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN", "X_V_SLOT_MISPLACED": 40, "40": "X_V_SLOT_MISPLACED", "X_V_MODEL_NO_EXPRESSION": 41, "41": "X_V_MODEL_NO_EXPRESSION", "X_V_MODEL_MALFORMED_EXPRESSION": 42, "42": "X_V_MODEL_MALFORMED_EXPRESSION", "X_V_MODEL_ON_SCOPE_VARIABLE": 43, "43": "X_V_MODEL_ON_SCOPE_VARIABLE", "X_V_MODEL_ON_PROPS": 44, "44": "X_V_MODEL_ON_PROPS", "X_INVALID_EXPRESSION": 45, "45": "X_INVALID_EXPRESSION", "X_KEEP_ALIVE_INVALID_CHILDREN": 46, "46": "X_KEEP_ALIVE_INVALID_CHILDREN", "X_PREFIX_ID_NOT_SUPPORTED": 47, "47": "X_PREFIX_ID_NOT_SUPPORTED", "X_MODULE_MODE_NOT_SUPPORTED": 48, "48": "X_MODULE_MODE_NOT_SUPPORTED", "X_CACHE_HANDLER_NOT_SUPPORTED": 49, "49": "X_CACHE_HANDLER_NOT_SUPPORTED", "X_SCOPE_ID_NOT_SUPPORTED": 50, "50": "X_SCOPE_ID_NOT_SUPPORTED", "X_VNODE_HOOKS": 51, "51": "X_VNODE_HOOKS", "X_V_BIND_INVALID_SAME_NAME_ARGUMENT": 52, "52": "X_V_BIND_INVALID_SAME_NAME_ARGUMENT", "__EXTEND_POINT__": 53, "53": "__EXTEND_POINT__" }; const errorMessages = { // parse errors [0]: "Illegal comment.", [1]: "CDATA section is allowed only in XML context.", [2]: "Duplicate attribute.", [3]: "End tag cannot have attributes.", [4]: "Illegal '/' in tags.", [5]: "Unexpected EOF in tag.", [6]: "Unexpected EOF in CDATA section.", [7]: "Unexpected EOF in comment.", [8]: "Unexpected EOF in script.", [9]: "Unexpected EOF in tag.", [10]: "Incorrectly closed comment.", [11]: "Incorrectly opened comment.", [12]: "Illegal tag name. Use '<' to print '<'.", [13]: "Attribute value was expected.", [14]: "End tag name was expected.", [15]: "Whitespace was expected.", [16]: "Unexpected '<!--' in comment.", [17]: `Attribute name cannot contain U+0022 ("), U+0027 ('), and U+003C (<).`, [18]: "Unquoted attribute value cannot contain U+0022 (\"), U+0027 ('), U+003C (<), U+003D (=), and U+0060 (`).", [19]: "Attribute name cannot start with '='.", [21]: "'<?' is allowed only in XML context.", [20]: `Unexpected null character.`, [22]: "Illegal '/' in tags.", // Vue-specific parse errors [23]: "Invalid end tag.", [24]: "Element is missing end tag.", [25]: "Interpolation end sign was not found.", [27]: "End bracket for dynamic directive argument was not found. Note that dynamic directive argument cannot contain spaces.", [26]: "Legal directive name was expected.", // transform errors [28]: `v-if/v-else-if is missing expression.`, [29]: `v-if/else branches must use unique keys.`, [30]: `v-else/v-else-if has no adjacent v-if or v-else-if.`, [31]: `v-for is missing expression.`, [32]: `v-for has invalid expression.`, [33]: `<template v-for> key should be placed on the <template> tag.`, [34]: `v-bind is missing expression.`, [52]: `v-bind with same-name shorthand only allows static argument.`, [35]: `v-on is missing expression.`, [36]: `Unexpected custom directive on <slot> outlet.`, [37]: `Mixed v-slot usage on both the component and nested <template>. When there are multiple named slots, all slots should use <template> syntax to avoid scope ambiguity.`, [38]: `Duplicate slot names found. `, [39]: `Extraneous children found when component already has explicitly named default slot. These children will be ignored.`, [40]: `v-slot can only be used on components or <template> tags.`, [41]: `v-model is missing expression.`, [42]: `v-model value must be a valid JavaScript member expression.`, [43]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`, [44]: `v-model cannot be used on a prop, because local prop bindings are not writable. Use a v-bind binding combined with a v-on listener that emits update:x event instead.`, [45]: `Error parsing JavaScript expression: `, [46]: `<KeepAlive> expects exactly one child component.`, [51]: `@vnode-* hooks in templates are no longer supported. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support has been removed in 3.4.`, // generic errors [47]: `"prefixIdentifiers" option is not supported in this build of compiler.`, [48]: `ES module mode is not supported in this build of compiler.`, [49]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`, [50]: `"scopeId" option is only supported in module mode.`, // just to fulfill types [53]: `` }; function walkIdentifiers(root, onIdentifier, includeAll = false, parentStack = [], knownIds = /* @__PURE__ */ Object.create(null)) { const rootExp = root.type === "Program" ? root.body[0].type === "ExpressionStatement" && root.body[0].expression : root; estreeWalker.walk(root, { enter(node, parent) { parent && parentStack.push(parent); if (parent && parent.type.startsWith("TS") && !TS_NODE_TYPES.includes(parent.type)) { return this.skip(); } if (node.type === "Identifier") { const isLocal = !!knownIds[node.name]; const isRefed = isReferencedIdentifier(node, parent, parentStack); if (includeAll || isRefed && !isLocal) { onIdentifier(node, parent, parentStack, isRefed, isLocal); } } else if (node.type === "ObjectProperty" && // eslint-disable-next-line no-restricted-syntax (parent == null ? void 0 : parent.type) === "ObjectPattern") { node.inPattern = true; } else if (isFunctionType(node)) { if (node.scopeIds) { node.scopeIds.forEach((id) => markKnownIds(id, knownIds)); } else { walkFunctionParams( node, (id) => markScopeIdentifier(node, id, knownIds) ); } } else if (node.type === "BlockStatement") { if (node.scopeIds) { node.scopeIds.forEach((id) => markKnownIds(id, knownIds)); } else { walkBlockDeclarations( node, (id) => markScopeIdentifier(node, id, knownIds) ); } } else if (node.type === "CatchClause" && node.param) { for (const id of extractIdentifiers(node.param)) { markScopeIdentifier(node, id, knownIds); } } else if (isForStatement(node)) { walkForStatement( node, false, (id) => markScopeIdentifier(node, id, knownIds) ); } }, leave(node, parent) { parent && parentStack.pop(); if (node !== rootExp && node.scopeIds) { for (const id of node.scopeIds) { knownIds[id]--; if (knownIds[id] === 0) { delete knownIds[id]; } } } } }); } function isReferencedIdentifier(id, parent, parentStack) { if (!parent) { return true; } if (id.name === "arguments") { return false; } if (isReferenced(id, parent)) { return true; } switch (parent.type) { case "AssignmentExpression": case "AssignmentPattern": return true; case "ObjectPattern": case "ArrayPattern": return isInDestructureAssignment(parent, parentStack); } return false; } function isInDestructureAssignment(parent, parentStack) { if (parent && (parent.type === "ObjectProperty" || parent.type === "ArrayPattern")) { let i = parentStack.length; while (i--) { const p = parentStack[i]; if (p.type === "AssignmentExpression") { return true; } else if (p.type !== "ObjectProperty" && !p.type.endsWith("Pattern")) { break; } } } return false; } function isInNewExpression(parentStack) { let i = parentStack.length; while (i--) { const p = parentStack[i]; if (p.type === "NewExpression") { return true; } else if (p.type !== "MemberExpression") { break; } } return false; } function walkFunctionParams(node, onIdent) { for (const p of node.params) { for (const id of extractIdentifiers(p)) { onIdent(id); } } } function walkBlockDeclarations(block, onIdent) { for (const stmt of block.body) { if (stmt.type === "VariableDeclaration") { if (stmt.declare) continue; for (const decl of stmt.declarations) { for (const id of extractIdentifiers(decl.id)) { onIdent(id); } } } else if (stmt.type === "FunctionDeclaration" || stmt.type === "ClassDeclaration") { if (stmt.declare || !stmt.id) continue; onIdent(stmt.id); } else if (isForStatement(stmt)) { walkForStatement(stmt, true, onIdent); } } } function isForStatement(stmt) { return stmt.type === "ForOfStatement" || stmt.type === "ForInStatement" || stmt.type === "ForStatement"; } function walkForStatement(stmt, isVar, onIdent) { const variable = stmt.type === "ForStatement" ? stmt.init : stmt.left; if (variable && variable.type === "VariableDeclaration" && (variable.kind === "var" ? isVar : !isVar)) { for (const decl of variable.declarations) { for (const id of extractIdentifiers(decl.id)) { onIdent(id); } } } } function extractIdentifiers(param, nodes = []) { switch (param.type) { case "Identifier": nodes.push(param); break; case "MemberExpression": let object = param; while (object.type === "MemberExpression") { object = object.object; } nodes.push(object); break; case "ObjectPattern": for (const prop of param.properties) { if (prop.type === "RestElement") { extractIdentifiers(prop.argument, nodes); } else { extractIdentifiers(prop.value, nodes); } } break; case "ArrayPattern": param.elements.forEach((element) => { if (element) extractIdentifiers(element, nodes); }); break; case "RestElement": extractIdentifiers(param.argument, nodes); break; case "AssignmentPattern": extractIdentifiers(param.left, nodes); break; } return nodes; } function markKnownIds(name, knownIds) { if (name in knownIds) { knownIds[name]++; } else { knownIds[name] = 1; } } function markScopeIdentifier(node, child, knownIds) { const { name } = child; if (node.scopeIds && node.scopeIds.has(name)) { return; } markKnownIds(name, knownIds); (node.scopeIds || (node.scopeIds = /* @__PURE__ */ new Set())).add(name); } const isFunctionType = (node) => { return /Function(?:Expression|Declaration)$|Method$/.test(node.type); }; const isStaticProperty = (node) => node && (node.type === "ObjectProperty" || node.type === "ObjectMethod") && !node.computed; const isStaticPropertyKey = (node, parent) => isStaticProperty(parent) && parent.key === node; function isReferenced(node, parent, grandparent) { switch (parent.type) { // yes: PARENT[NODE] // yes: NODE.child // no: parent.NODE case "MemberExpression": case "OptionalMemberExpression": if (parent.property === node) { return !!parent.computed; } return parent.object === node; case "JSXMemberExpression": return parent.object === node; // no: let NODE = init; // yes: let id = NODE; case "VariableDeclarator": return parent.init === node; // yes: () => NODE // no: (NODE) => {} case "ArrowFunctionExpression": return parent.body === node; // no: class { #NODE; } // no: class { get #NODE() {} } // no: class { #NODE() {} } // no: class { fn() { return this.#NODE; } } case "PrivateName": return false; // no: class { NODE() {} } // yes: class { [NODE]() {} } // no: class { foo(NODE) {} } case "ClassMethod": case "ClassPrivateMethod": case "ObjectMethod": if (parent.key === node) { return !!parent.computed; } return false; // yes: { [NODE]: "" } // no: { NODE: "" } // depends: { NODE } // depends: { key: NODE } case "ObjectProperty": if (parent.key === node) { return !!parent.computed; } return !grandparent; // no: class { NODE = value; } // yes: class { [NODE] = value; } // yes: class { key = NODE; } case "ClassProperty": if (parent.key === node) { return !!parent.computed; } return true; case "ClassPrivateProperty": return parent.key !== node; // no: class NODE {} // yes: class Foo extends NODE {} case "ClassDeclaration": case "ClassExpression": return parent.superClass === node; // yes: left = NODE; // no: NODE = right; case "AssignmentExpression": return parent.right === node; // no: [NODE = foo] = []; // yes: [foo = NODE] = []; case "AssignmentPattern": return parent.right === node; // no: NODE: for (;;) {} case "LabeledStatement": return false; // no: try {} catch (NODE) {} case "CatchClause": return false; // no: function foo(...NODE) {} case "RestElement": return false; case "BreakStatement": case "ContinueStatement": return false; // no: function NODE() {} // no: function foo(NODE) {} case "FunctionDeclaration": case "FunctionExpression": return false; // no: export NODE from "foo"; // no: export * as NODE from "foo"; case "ExportNamespaceSpecifier": case "ExportDefaultSpecifier": return false; // no: export { foo as NODE }; // yes: export { NODE as foo }; // no: export { NODE as foo } from "foo"; case "ExportSpecifier": return parent.local === node; // no: import NODE from "foo"; // no: import * as NODE from "foo"; // no: import { NODE as foo } from "foo"; // no: import { foo as NODE } from "foo"; // no: import NODE from "bar"; case "ImportDefaultSpecifier": case "ImportNamespaceSpecifier": case "ImportSpecifier": return false; // no: import "foo" assert { NODE: "json" } case "ImportAttribute": return false; // no: <div NODE="foo" /> case "JSXAttribute": return false; // no: [NODE] = []; // no: ({ NODE }) = []; case "ObjectPattern": case "ArrayPattern": return false; // no: new.NODE // no: NODE.target case "MetaProperty": return false; // yes: type X = { someProperty: NODE } // no: type X = { NODE: OtherType } case "ObjectTypeProperty": return parent.key !== node; // yes: enum X { Foo = NODE } // no: enum X { NODE } case "TSEnumMember": return parent.id !== node; // yes: { [NODE]: value } // no: { NODE: value } case "TSPropertySignature": if (parent.key === node) { return !!parent.computed; } return true; } return true; } const TS_NODE_TYPES = [ "TSAsExpression", // foo as number "TSTypeAssertion", // (<number>foo) "TSNonNullExpression", // foo! "TSInstantiationExpression", // foo<string> "TSSatisfiesExpression" // foo satisfies T ]; function unwrapTSNode(node) { if (TS_NODE_TYPES.includes(node.type)) { return unwrapTSNode(node.expression); } else { return node; } } const isStaticExp = (p) => p.type === 4 && p.isStatic; function isCoreComponent(tag) { switch (tag) { case "Teleport": case "teleport": return TELEPORT; case "Suspense": case "suspense": return SUSPENSE; case "KeepAlive": case "keep-alive": return KEEP_ALIVE; case "BaseTransition": case "base-transition": return BASE_TRANSITION; } } const nonIdentifierRE = /^\d|[^\$\w\xA0-\uFFFF]/; const isSimpleIdentifier = (name) => !nonIdentifierRE.test(name); const validFirstIdentCharRE = /[A-Za-z_$\xA0-\uFFFF]/; const validIdentCharRE = /[\.\?\w$\xA0-\uFFFF]/; const whitespaceRE = /\s+[.[]\s*|\s*[.[]\s+/g; const getExpSource = (exp) => exp.type === 4 ? exp.content : exp.loc.source; const isMemberExpressionBrowser = (exp) => { const path = getExpSource(exp).trim().replace(whitespaceRE, (s) => s.trim()); let state = 0 /* inMemberExp */; let stateStack = []; let currentOpenBracketCount = 0; let currentOpenParensCount = 0; let currentStringType = null; for (let i = 0; i < path.length; i++) { const char = path.charAt(i); switch (state) { case 0 /* inMemberExp */: if (char === "[") { stateStack.push(state); state = 1 /* inBrackets */; currentOpenBracketCount++; } else if (char === "(") { stateStack.push(state); state = 2 /* inParens */; currentOpenParensCount++; } else if (!(i === 0 ? validFirstIdentCharRE : validIdentCharRE).test(char)) { return false; } break; case 1 /* inBrackets */: if (char === `'` || char === `"` || char === "`") { stateStack.push(state); state = 3 /* inString */; currentStringType = char; } else if (char === `[`) { currentOpenBracketCount++; } else if (char === `]`) { if (!--currentOpenBracketCount) { state = stateStack.pop(); } } break; case 2 /* inParens */: if (char === `'` || char === `"` || char === "`") { stateStack.push(state); state = 3 /* inString */; currentStringType = char; } else if (char === `(`) { currentOpenParensCount++; } else if (char === `)`) { if (i === path.length - 1) { return false; } if (!--currentOpenParensCount) { state = stateStack.pop(); } } break; case 3 /* inString */: if (char === currentStringType) { state = stateStack.pop(); currentStringType = null; } break; } } return !currentOpenBracketCount && !currentOpenParensCount; }; const isMemberExpressionNode = (exp, context) => { try { let ret = exp.ast || parser.parseExpression(getExpSource(exp), { plugins: context.expressionPlugins ? [...context.expressionPlugins, "typescript"] : ["typescript"] }); ret = unwrapTSNode(ret); return ret.type === "MemberExpression" || ret.type === "OptionalMemberExpression" || ret.type === "Identifier" && ret.name !== "undefined"; } catch (e) { return false; } }; const isMemberExpression = isMemberExpressionNode; const fnExpRE = /^\s*(async\s*)?(\([^)]*?\)|[\w$_]+)\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/; const isFnExpressionBrowser = (exp) => fnExpRE.test(getExpSource(exp)); const isFnExpressionNode = (exp, context) => { try { let ret = exp.ast || parser.parseExpression(getExpSource(exp), { plugins: context.expressionPlugins ? [...context.expressionPlugins, "typescript"] : ["typescript"] }); if (ret.type === "Program") { ret = ret.body[0]; if (ret.type === "ExpressionStatement") { ret = ret.expression; } } ret = unwrapTSNode(ret); return ret.type === "FunctionExpression" || ret.type === "ArrowFunctionExpression"; } catch (e) { return false; } }; const isFnExpression = isFnExpressionNode; function advancePositionWithClone(pos, source, numberOfCharacters = source.length) { return advancePositionWithMutation( { offset: pos.offset, line: pos.line, column: pos.column }, source, numberOfCharacters ); } function advancePositionWithMutation(pos, source, numberOfCharacters = source.length) { let linesCount = 0; let lastNewLinePos = -1; for (let i = 0; i < numberOfCharacters; i++) { if (source.charCodeAt(i) === 10) { linesCount++; lastNewLinePos = i; } } pos.offset += numberOfCharacters; pos.line += linesCount; pos.column = lastNewLinePos === -1 ? pos.column + numberOfCharacters : numberOfCharacters - lastNewLinePos; return pos; } function assert(condition, msg) { if (!condition) { throw new Error(msg || `unexpected compiler condition`); } } function findDir(node, name, allowEmpty = false) { for (let i = 0; i < node.props.length; i++) { const p = node.props[i]; if (p.type === 7 && (allowEmpty || p.exp) && (shared.isString(name) ? p.name === name : name.test(p.name))) { return p; } } } function findProp(node, name, dynamicOnly = false, allowEmpty = false) { for (let i = 0; i < node.props.length; i++) { const p = node.props[i]; if (p.type === 6) { if (dynamicOnly) continue; if (p.name === name && (p.value || allowEmpty)) { return p; } } else if (p.name === "bind" && (p.exp || allowEmpty) && isStaticArgOf(p.arg, name)) { return p; } } } function isStaticArgOf(arg, name) { return !!(arg && isStaticExp(arg) && arg.content === name); } function hasDynamicKeyVBind(node) { return node.props.some( (p) => p.type === 7 && p.name === "bind" && (!p.arg || // v-bind="obj" p.arg.type !== 4 || // v-bind:[_ctx.foo] !p.arg.isStatic) // v-bind:[foo] ); } function isText$1(node) { return node.type === 5 || node.type === 2; } function isVSlot(p) { return p.type === 7 && p.name === "slot"; } function isTemplateNode(node) { return node.type === 1 && node.tagType === 3; } function isSlotOutlet(node) { return node.type === 1 && node.tagType === 2; } const propsHelperSet = /* @__PURE__ */ new Set([NORMALIZE_PROPS, GUARD_REACTIVE_PROPS]); function getUnnormalizedProps(props, callPath = []) { if (props && !shared.isString(props) && props.type === 14) { const callee = props.callee; if (!shared.isString(callee) && propsHelperSet.has(callee)) { return getUnnormalizedProps( props.arguments[0], callPath.concat(props) ); } } return [props, callPath]; } function injectProp(node, prop, context) { let propsWithInjection; let props = node.type === 13 ? node.props : node.arguments[2]; let callPath = []; let parentCall; if (props && !shared.isString(props) && props.type === 14) { const ret = getUnnormalizedProps(props); props = ret[0]; callPath = ret[1]; parentCall = callPath[callPath.length - 1]; } if (props == null || shared.isString(props)) { propsWithInjection = createObjectExpression([prop]); } else if (props.type === 14) { const first = props.arguments[0]; if (!shared.isString(first) && first.type === 15) { if (!hasProp(prop, first)) { first.properties.unshift(prop); } } else { if (props.callee === TO_HANDLERS) { propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [ createObjectExpression([prop]), props ]); } else { props.arguments.unshift(createObjectExpression([prop])); } } !propsWithInjection && (propsWithInjection = props); } else if (props.type === 15) { if (!hasProp(prop, props)) { props.properties.unshift(prop); } propsWithInjection = props; } else { propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [ createObjectExpression([prop]), props ]); if (parentCall && parentCall.callee === GUARD_REACTIVE_PROPS) { parentCall = callPath[callPath.length - 2]; } } if (node.type === 13) { if (parentCall) { parentCall.arguments[0] = propsWithInjection; } else { node.props = propsWithInjection; } } else { if (parentCall) { parentCall.arguments[0] = propsWithInjection; } else { node.arguments[2] = propsWithInjection; } } } function hasProp(prop, props) { let result = false; if (prop.key.type === 4) { const propKeyName = prop.key.content; result = props.properties.some( (p) => p.key.type === 4 && p.key.content === propKeyName ); } return result; } function toValidAssetId(name, type) { return `_${type}_${name.replace(/[^\w]/g, (searchValue, replaceValue) => { return searchValue === "-" ? "_" : name.charCodeAt(replaceValue).toString(); })}`; } function hasScopeRef(node, ids) { if (!node || Object.keys(ids).length === 0) { return false; } switch (node.type) { case 1: for (let i = 0; i < node.props.length; i++) { const p = node.props[i]; if (p.type === 7 && (hasScopeRef(p.arg, ids) || hasScopeRef(p.exp, ids))) { return true; } } return node.children.some((c) => hasScopeRef(c, ids)); case 11: if (hasScopeRef(node.source, ids)) { return true; } return node.children.some((c) => hasScopeRef(c, ids)); case 9: return node.branches.some((b) => hasScopeRef(b, ids)); case 10: if (hasScopeRef(node.condition, ids)) { return true; } return node.children.some((c) => hasScopeRef(c, ids)); case 4: return !node.isStatic && isSimpleIdentifier(node.content) && !!ids[node.content]; case 8: return node.children.some((c) => shared.isObject(c) && hasScopeRef(c, ids)); case 5: case 12: return hasScopeRef(node.content, ids); case 2: case 3: case 20: return false; default: return false; } } function getMemoedVNodeCall(node) { if (node.type === 14 && node.callee === WITH_MEMO) { return node.arguments[1].returns; } else { return node; } } const forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+(\S[\s\S]*)/; const defaultParserOptions = { parseMode: "base", ns: 0, delimiters: [`{{`, `}}`], getNamespace: () => 0, isVoidTag: shared.NO, isPreTag: shared.NO, isIgnoreNewlineTag: shared.NO, isCustomElement: shared.NO, onError: defaultOnError, onWarn: defaultOnWarn, comments: true, prefixIdentifiers: false }; let currentOptions = defaultParserOptions; let currentRoot = null; let currentInput = ""; let currentOpenTag = null; let currentProp = null; let currentAttrValue = ""; let currentAttrStartIndex = -1; let currentAttrEndIndex = -1; let inPre = 0; let inVPre = false; let currentVPreBoundary = null; const stack = []; const tokenizer = new Tokenizer(stack, { onerr: emitError, ontext(start, end) { onText(getSlice(start, end), start, end); }, ontextentity(char, start, end) { onText(char, start, end); }, oninterpolation(start, end) { if (inVPre) { return onText(getSlice(start, end), start, end); } let innerStart = start + tokenizer.delimiterOpen.length; let innerEnd = end - tokenizer.delimiterClose.length; while (isWhitespace(currentInput.charCodeAt(innerStart))) { innerStart++; } while (isWhitespace(currentInput.charCodeAt(innerEnd - 1))) { innerEnd--; } let exp = getSlice(innerStart, innerEnd); if (exp.includes("&")) { { exp = decode_js.decodeHTML(exp); } } addNode({ type: 5, content: createExp(exp, false, getLoc(innerStart, innerEnd)), loc: getLoc(start, end) }); }, onopentagname(start, end) { const name = getSlice(start, end); currentOpenTag = { type: 1, tag: name, ns: currentOptions.getNamespace(name, stack[0], currentOptions.ns), tagType: 0, // will be refined on tag close props: [], children: [], loc: getLoc(start - 1, end), codegenNode: void 0 }; }, onopentagend(end) { endOpenTag(end); }, onclosetag(start, end) { const name = getSlice(start, end); if (!currentOptions.isVoidTag(name)) { let found = false; for (let i = 0; i < stack.length; i++) { const e = stack[i]; if (e.tag.toLowerCase() === name.toLowerCase()) { found = true; if (i > 0) { emitError(24, stack[0].loc.start.offset); } for (let j = 0; j <= i; j++) { const el = stack.shift(); onCloseTag(el, end, j < i); } break; } } if (!found) { emitError(23, backTrack(start, 60)); } } }, onselfclosingtag(end) { const name = currentOpenTag.tag; currentOpenTag.isSelfClosing = true; endOpenTag(end); if (stack[0] && stack[0].tag === name) { onCloseTag(stack.shift(), end); } }, onattribname(start, end) { currentProp = { type: 6, name: getSlice(start, end), nameLoc: getLoc(start, end), value: void 0, loc: getLoc(start) }; }, ondirname(start, end) { const raw = getSlice(start, end); const name = raw === "." || raw === ":" ? "bind" : raw === "@" ? "on" : raw === "#" ? "slot" : raw.slice(2); if (!inVPre && name === "") { emitError(26, start); } if (inVPre || name === "") { currentProp = { type: 6, name: raw, nameLoc: getLoc(start, end), value: void 0, loc: getLoc(start) }; } else { currentProp = { type: 7, name, rawName: raw, exp: void 0, arg: void 0, modifiers: raw === "." ? [createSimpleExpression("prop")] : [], loc: getLoc(start) }; if (name === "pre") { inVPre = tokenizer.inVPre = true; currentVPreBoundary = currentOpenTag; const props = currentOpenTag.props; for (let i = 0; i < props.length; i++) { if (props[i].type === 7) { props[i] = dirToAttr(props[i]); } } } } }, ondirarg(start, end) { if (start === end) return; const arg = getSlice(start, end); if (inVPre) { currentProp.name += arg; setLocEnd(currentProp.nameLoc, end); } else { const isStatic = arg[0] !== `[`; currentProp.arg = createExp( isStatic ? arg : arg.slice(1, -1), isStatic, getLoc(start, end), isStatic ? 3 : 0 ); } }, ondirmodifier(start, end) { const mod = getSlice(start, end); if (inVPre) { currentProp.name += "." + mod; setLocEnd(currentProp.nameLoc, end); } else if (currentProp.name === "slot") { const arg = currentProp.arg; if (arg) { arg.content += "." + mod; setLocEnd(arg.loc, end); } } else { const exp = createSimpleExpression(mod, true, getLoc(start, end)); currentProp.modifiers.push(exp); } }, onattribdata(start, end) { currentAttrValue += getSlice(start, end); if (currentAttrStartIndex < 0) currentAttrStartIndex = start; currentAttrEndIndex = end; }, onattribentity(char, start, end) { currentAttrValue += char; if (currentAttrStartIndex < 0) currentAttrStartIndex = start; currentAttrEndIndex = end; }, onattribnameend(end) { const start = currentProp.loc.start.offset; const name = getSlice(start, end); if (currentProp.type === 7) { currentProp.rawName = name; } if (currentOpenTag.props.some( (p) => (p.type === 7 ? p.rawName : p.name) === name )) { emitError(2, start); } }, onattribend(quote, end) { if (currentOpenTag && currentProp) { setLocEnd(currentProp.loc, end); if (quote !== 0) { if (currentProp.type === 6) { if (currentProp.name === "class") { currentAttrValue = condense(currentAttrValue).trim(); } if (quote === 1 && !currentAttrValue) { emitError(13, end); } currentProp.value = { type: 2, content: currentAttrValue, loc: quote === 1 ? getLoc(currentAttrStartIndex, currentAttrEndIndex) : getLoc(currentAttrStartIndex - 1, currentAttrEndIndex + 1) }; if (tokenizer.inSFCRoot && currentOpenTag.tag === "template" && currentProp.name === "lang" && currentAttrValue && currentAttrValue !== "html") { tokenizer.enterRCDATA(toCharCodes(`</template`), 0); } } else { let expParseMode = 0 /* Normal */; { if (currentProp.name === "for") { expParseMode = 3 /* Skip */; } else if (currentProp.name === "slot") { expParseMode = 1 /* Params */; } else if (currentProp.name === "on" && currentAttrValue.includes(";")) { expParseMode = 2 /* Statements */; } } currentProp.exp = createExp( currentAttrValue, false, getLoc(currentAttrStartIndex, currentAttrEndIndex), 0, expParseMode ); if (currentProp.name === "for") { currentProp.forParseResult = parseForExpression(currentProp.exp); } let syncIndex = -1; if (currentProp.name === "bind" && (syncIndex = currentProp.modifiers.findIndex( (mod) => mod.content === "sync" )) > -1 && checkCompatEnabled( "COMPILER_V_BIND_SYNC", currentOptions, currentProp.loc, currentProp.rawName )) { currentProp.name = "model"; currentProp.modifiers.splice(syncIndex, 1); } } } if (currentProp.type !== 7 || currentProp.name !== "pre") { currentOpenTag.props.push(currentProp); } } currentAttrValue = ""; currentAttrStartIndex = currentAttrEndIndex = -1; }, oncomment(start, end) { if (currentOptions.comments) { addNode({ type: 3, content: getSlice(start, end), loc: getLoc(start - 4, end + 3) }); } }, onend() { const end = currentInput.length; if (tokenizer.state !== 1) { switch (tokenizer.state) { case 5: case 8: emitError(5, end); break; case 3: case 4: emitError( 25, tokenizer.sectionStart ); break; case 28: if (tokenizer.currentSequence === Sequences.CdataEnd) { emitError(6, end); } else { emitError(7, end); } break; case 6: case 7: case 9: case 11: case 12: case 13: case 14: case 15: case 16: case 17: case 18: case 19: // " case 20: // ' case 21: emitError(9, end); break; } } for (let index = 0; index < stack.length; index++) { onCloseTag(stack[index], end - 1); emitError(24, stack[index].loc.start.offset); } }, oncdata(start, end) { if (stack[0].ns !== 0) { onText(getSlice(start, end), start, end); } else { emitError(1, start - 9); } }, onprocessinginstruction(start) { if ((stack[0] ? stack[0].ns : currentOptions.ns) === 0) { emitError( 21, start - 1 ); } } }); const forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/; const stripParensRE = /^\(|\)$/g; function parseForExpression(input) { const loc = input.loc; const exp = input.content; const inMatch = exp.match(forAliasRE); if (!inMatch) return; const [, LHS, RHS] = inMatch; const createAliasExpression = (content, offset, asParam = false) => { const start = loc.start.offset + offset; const end = start + content.length; return createExp( content, false, getLoc(start, end), 0, asParam ? 1 /* Params */ : 0 /* Normal */ ); }; const result = { source: createAliasExpression(RHS.trim(), exp.indexOf(RHS, LHS.length)), value: void 0, key: void 0, index: void 0, finalized: false }; let valueContent = LHS.trim().replace(stripParensRE, "").trim(); const trimmedOffset = LHS.indexOf(valueContent); const iteratorMatch = valueContent.match(forIteratorRE); if (iteratorMatch) { valueContent = valueContent.replace(forIteratorRE, "").trim(); const keyContent = iteratorMatch[1].trim(); let keyOffset; if (keyContent) { keyOffset = exp.indexOf(keyContent, trimmedOffset + valueContent.length); result.key = createAliasExpression(keyContent, keyOffset, true); } if (iteratorMatch[2]) { const indexContent = iteratorMatch[2].trim(); if (indexContent) { result.index = createAliasExpression( indexContent, exp.indexOf( indexContent, result.key ? keyOffset + keyContent.length : trimmedOffset + valueContent.length ), true ); } } } if (valueContent) { result.value = createAliasExpression(valueContent, trimmedOffset, true); } return result; } function getSlice(start, end) { return currentInput.slice(start, end); } function endOpenTag(end) { if (tokenizer.inSFCRoot) { currentOpenTag.innerLoc = getLoc(end + 1, end + 1); } addNode(currentOpenTag); const { tag, ns } = currentOpenTag; if (ns === 0 && currentOptions.isPreTag(tag)) { inPre++; } if (currentOptions.isVoidTag(tag)) { onCloseTag(currentOpenTag, end); } else { stack.unshift(currentOpenTag); if (ns === 1 || ns === 2) { tokenizer.inXML = true; } } currentOpenTag = null; } function onText(content, start, end) { const parent = stack[0] || currentRoot; const lastNode = parent.children[parent.children.length - 1]; if (lastNode && lastNode.type === 2) { lastNode.content += content; setLocEnd(lastNode.loc, end); } else { parent.children.push({ type: 2, content, loc: getLoc(start, end) }); } } function onCloseTag(el, end, isImplied = false) { if (isImplied) { setLocEnd(el.loc, backTrack(end, 60)); } else { setLocEnd(el.loc, lookAhead(end, 62) + 1); } if (tokenizer.inSFCRoot) { if (el.children.length) { el.innerLoc.end = shared.extend({}, el.children[el.children.length - 1].loc.end); } else { el.innerLoc.end = shared.extend({}, el.innerLoc.start); } el.innerLoc.source = getSlice( el.innerLoc.start.offset, el.innerLoc.end.offset ); } const { tag, ns, children } = el; if (!inVPre) { if (tag === "slot") { el.tagType = 2; } else if (isFragmentTemplate(el)) { el.tagType = 3; } else if (isComponent(el)) { el.tagType = 1; } } if (!tokenizer.inRCDATA) { el.children = condenseWhitespace(children); } if (ns === 0 && currentOptions.isIgnoreNewlineTag(tag)) { const first = children[0]; if (first && first.type === 2) { first.content = first.content.replace(/^\r?\n/, ""); } } if (ns === 0 && currentOptions.isPreTag(tag)) { inPre--; } if (currentVPreBoundary === el) { inVPre = tokenizer.inVPre = false; currentVPreBoundary = null; } if (tokenizer.inXML && (stack[0] ? stack[0].ns : currentOptions.ns) === 0) { tokenizer.inXML = false; } { const props = el.props; if (isCompatEnabled( "COMPILER_V_IF_V_FOR_PRECEDENCE", currentOptions )) { let hasIf = false; let hasFor = false; for (let i = 0; i < props.length; i++) { const p = props[i]; if (p.type === 7) { if (p.name === "if") { hasIf = true; } else if (p.name === "for") { hasFor = true; } } if (hasIf && hasFor) { warnDeprecation( "COMPILER_V_IF_V_FOR_PRECEDENCE", currentOptions, el.loc ); break; } } } if (!tokenizer.inSFCRoot && isCompatEnabled( "COMPILER_NATIVE_TEMPLATE", currentOptions ) && el.tag === "template" && !isFragmentTemplate(el)) { warnDeprecation( "COMPILER_NATIVE_TEMPLATE", currentOptions, el.loc ); const parent = stack[0] || currentRoot; const index = parent.children.indexOf(el); parent.children.splice(index, 1, ...el.children); } const inlineTemplateProp = props.find( (p) => p.type === 6 && p.name === "inline-template" ); if (inlineTemplateProp && checkCompatEnabled( "COMPILER_INLINE_TEMPLATE", currentOptions, inlineTemplateProp.loc ) && el.children.length) { inlineTemplateProp.value = { type: 2, content: getSlice( el.children[0].loc.start.offset, el.children[el.children.length - 1].loc.end.offset ), loc: inlineTemplateProp.loc }; } } } function lookAhead(index, c) { let i = index; while (currentInput.charCodeAt(i) !== c && i < currentInput.length - 1) i++; return i; } function backTrack(index, c) { let i = index; while (currentInput.charCodeAt(i) !== c && i >= 0) i--; return i; } const specialTemplateDir = /* @__PURE__ */ new Set(["if", "else", "else-if", "for", "slot"]); function isFragmentTemplate({ tag, props }) { if (tag === "template") { for (let i = 0; i < props.length; i++) { if (props[i].type === 7 && specialTemplateDir.has(props[i].name)) { return true; } } } return false; } function isComponent({ tag, props }) { if (currentOptions.isCustomElement(tag)) { return false; } if (tag === "component" || isUpperCase(tag.charCodeAt(0)) || isCoreComponent(tag) || currentOptions.isBuiltInComponent && currentOptions.isBuiltInComponent(tag) || currentOptions.isNativeTag && !currentOptions.isNativeTag(tag)) { return true; } for (let i = 0; i < props.length; i++) { const p = props[i]; if (p.type === 6) { if (p.name === "is" && p.value) { if (p.value.content.startsWith("vue:")) { return true; } else if (checkCompatEnabled( "COMPILER_IS_ON_ELEMENT", currentOptions, p.loc )) { return true; } } } else if (// :is on plain element - only treat as component in compat mode p.name === "bind" && isStaticArgOf(p.arg, "is") && checkCompatEnabled( "COMPILER_IS_ON_ELEMENT", currentOptions, p.loc )) { return true; } } return false; } function isUpperCase(c) { return c > 64 && c < 91; } const windowsNewlineRE = /\r\n/g; function condenseWhitespace(nodes, tag) { const shouldCondense = currentOptions.whitespace !== "preserve"; let removedWhitespace = false; for (let i = 0; i < nodes.length; i++) { const node = nodes[i]; if (node.type === 2) { if (!inPre) { if (isAllWhitespace(node.content)) { const prev = nodes[i - 1] && nodes[i - 1].type; const next = nodes[i + 1] && nodes[i + 1].type; if (!prev || !next || shouldCondense && (prev === 3 && (next === 3 || next === 1) || prev === 1 && (next === 3 || next === 1 && hasNewlineChar(node.content)))) { removedWhitespace = true; nodes[i] = null; } else { node.content = " "; } } else if (shouldCondense) { node.content = condense(node.content); } } else { node.content = node.content.replace(windowsNewlineRE, "\n"); } } } return removedWhitespace ? nodes.filter(Boolean) : nodes; } function isAllWhitespace(str) { for (let i = 0; i < str.length; i++) { if (!isWhitespace(str.charCodeAt(i))) { return false; } } return true; } function hasNewlineChar(str) { for (let i = 0; i < str.length; i++) { const c = str.charCodeAt(i); if (c === 10 || c === 13) { return true; } } return false; } function condense(str) { let ret = ""; let prevCharIsWhitespace = false; for (let i = 0; i < str.length; i++) { if (isWhitespace(str.charCodeAt(i))) { if (!prevCharIsWhitespace) { ret += " "; prevCharIsWhitespace = true; } } else { ret += str[i]; prevCharIsWhitespace = false; } } return ret; } function addNode(node) { (stack[0] || currentRoot).children.push(node); } function getLoc(start, end) { return { start: tokenizer.getPos(start), // @ts-expect-error allow late attachment end: end == null ? end : tokenizer.getPos(end), // @ts-expect-error allow late attachment source: end == null ? end : getSlice(start, end) }; } function cloneLoc(loc) { return getLoc(loc.start.offset, loc.end.offset); } function setLocEnd(loc, end) { loc.end = tokenizer.getPos(end); loc.source = getSlice(loc.start.offset, end); } function dirToAttr(dir) { const attr = { type: 6, name: dir.rawName, nameLoc: getLoc( dir.loc.start.offset, dir.loc.start.offset + dir.rawName.length ), value: void 0, loc: dir.loc }; if (dir.exp) { const loc = dir.exp.loc; if (loc.end.offset < dir.loc.end.offset) { loc.start.offset--; loc.start.column--; loc.end.offset++; loc.end.column++; } attr.value = { type: 2, content: dir.exp.content, loc }; } return attr; } function createExp(content, isStatic = false, loc, constType = 0, parseMode = 0 /* Normal */) { const exp = createSimpleExpression(content, isStatic, loc, constType); if (!isStatic && currentOptions.prefixIdentifiers && parseMode !== 3 /* Skip */ && content.trim()) { if (isSimpleIdentifier(content)) { exp.ast = null; return exp; } try { const plugins = currentOptions.expressionPlugins; const options = { plugins: plugins ? [...plugins, "typescript"] : ["typescript"] }; if (parseMode === 2 /* Statements */) { exp.ast = parser.parse(` ${content} `, options).program; } else if (parseMode === 1 /* Params */) { exp.ast = parser.parseExpression(`(${content})=>{}`, options); } else { exp.ast = parser.parseExpression(`(${content})`, options); } } catch (e) { exp.ast = false; emitError(45, loc.start.offset, e.message); } } return exp; } function emitError(code, index, message) { currentOptions.onError( createCompilerError(code, getLoc(index, index), void 0, message) ); } function reset() { tokenizer.reset(); currentOpenTag = null; currentProp = null; currentAttrValue = ""; currentAttrStartIndex = -1; currentAttrEndIndex = -1; stack.length = 0; } function baseParse(input, options) { reset(); currentInput = input; currentOptions = shared.extend({}, defaultParserOptions); if (options) { let key; for (key in options) { if (options[key] != null) { currentOptions[key] = options[key]; } } } { if (currentOptions.decodeEntities) { console.warn( `[@vue/compiler-core] decodeEntities option is passed but will be ignored in non-browser builds.` ); } } tokenizer.mode = currentOptions.parseMode === "html" ? 1 : currentOptions.parseMode === "sfc" ? 2 : 0; tokenizer.inXML = currentOptions.ns === 1 || currentOptions.ns === 2; const delimiters = options && options.delimiters; if (delimiters) { tokenizer.delimiterOpen = toCharCodes(delimiters[0]); tokenizer.delimiterClose = toCharCodes(delimiters[1]); } const root = currentRoot = createRoot([], input); tokenizer.parse(currentInput); root.loc = getLoc(0, input.length); root.children = condenseWhitespace(root.children); currentRoot = null; return root; } function cacheStatic(root, context) { walk( root, void 0, context, // Root node is unfortunately non-hoistable due to potential parent // fallthrough attributes. isSingleElementRoot(root, root.children[0]) ); } function isSingleElementRoot(root, child) { const { children } = root; return children.length === 1 && child.type === 1 && !isSlotOutlet(child); } function walk(node, parent, context, doNotHoistNode = false, inFor = false) { const { children } = node; const toCache = []; for (let i = 0; i < children.length; i++) { const child = children[i]; if (child.type === 1 && child.tagType === 0) { const constantType = doNotHoistNode ? 0 : getConstantType(child, context); if (constantType > 0) { if (constantType >= 2) { child.codegenNode.patchFlag = -1; toCache.push(child); continue; } } else { const codegenNode = child.codegenNode; if (codegenNode.type === 13) { const flag = codegenNode.patchFlag; if ((flag === void 0 || flag === 512 || flag === 1) && getGeneratedPropsConstantType(child, context) >= 2) { const props = getNodeProps(child); if (props) { codegenNode.props = context.hoist(props); } } if (codegenNode.dynamicProps) { codegenNode.dynamicProps = context.hoist(codegenNode.dynamicProps); } } } } else if (child.type === 12) { const constantType = doNotHoistNode ? 0 : getConstantType(child, context); if (constantType >= 2) { toCache.push(child); continue; } } if (child.type === 1) { const isComponent = child.tagType === 1; if (isComponent) { context.scopes.vSlot++; } walk(child, node, context, false, inFor); if (isComponent) { context.scopes.vSlot--; } } else if (child.type === 11) { walk(child, node, context, child.children.length === 1, true); } else if (child.type === 9) { for (let i2 = 0; i2 < child.branches.length; i2++) { walk( child.branches[i2], node, context, child.branches[i2].children.length === 1, inFor ); } } } let cachedAsArray = false; if (toCache.length === children.length && node.type === 1) { if (node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && shared.isArray(node.codegenNode.children)) { node.codegenNode.children = getCacheExpression( createArrayExpression(node.codegenNode.children) ); cachedAsArray = true; } else if (node.tagType === 1 && node.codegenNode && node.codegenNode.type === 13 && node.codegenNode.children && !shared.isArray(node.codegenNode.children) && node.codegenNode.children.type === 15) { const slot = getSlotNode(node.codegenNode, "default"); if (slot) { slot.returns = getCacheExpression( createArrayExpression(slot.returns) ); cachedAsArray = true; } } else if (node.tagType === 3 && parent && parent.type === 1 && parent.tagType === 1 && parent.codegenNode && parent.codegenNode.type === 13 && parent.codegenNode.children && !shared.isArray(parent.codegenNode.children) && parent.codegenNode.children.type === 15) { const slotName = findDir(node, "slot", true); const slot = slotName && slotName.arg && getSlotNode(parent.codegenNode, slotName.arg); if (slot) { slot.returns = getCacheExpression( createArrayExpression(slot.returns) ); cachedAsArray = true; } } } if (!cachedAsArray) { for (const child of toCache) { child.codegenNode = context.cache(child.codegenNode); } } function getCacheExpression(value) { const exp = context.cache(value); if (inFor && context.hmr) { exp.needArraySpread = true; } return exp; } function getSlotNode(node2, name) { if (node2.children && !shared.isArray(node2.children) && node2.children.type === 15) { const slot = node2.children.properties.find( (p) => p.key === name || p.key.content === name ); return slot && slot.value; } } if (toCache.length && context.transformHoist) { context.transformHoist(children, context, node); } } function getConstantType(node, context) { const { constantCache } = context; switch (node.type) { case 1: if (node.tagType !== 0) { return 0; } const cached = constantCache.get(node); if (cached !== void 0) { return cached; } const codegenNode = node.codegenNode; if (codegenNode.type !== 13) { return 0; } if (codegenNode.isBlock && node.tag !== "svg" && node.tag !== "foreignObject" && node.tag !== "math") { return 0; } if (codegenNode.patchFlag === void 0) { let returnType2 = 3; const generatedPropsType = getGeneratedPropsConstantType(node, context); if (generatedPropsType === 0) { constantCache.set(node, 0); return 0; } if (generatedPropsType < returnType2) { returnType2 = generatedPropsType; } for (let i = 0; i < node.children.length; i++) { const childType = getConstantType(node.children[i], context); if (childType === 0) { constantCache.set(node, 0); return 0; } if (childType < returnType2) { returnType2 = childType; } } if (returnType2 > 1) { for (let i = 0; i < node.props.length; i++) { const p = node.props[i]; if (p.type === 7 && p.name === "bind" && p.exp) { const expType = getConstantType(p.exp, context); if (expType === 0) { constantCache.set(node, 0); return 0; } if (expType < returnType2) { returnType2 = expType; } } } } if (codegenNode.isBlock) { for (let i = 0; i < node.props.length; i++) { const p = node.props[i]; if (p.type === 7) { constantCache.set(node, 0); return 0; } } context.removeHelper(OPEN_BLOCK); context.removeHelper( getVNodeBlockHelper(context.inSSR, codegenNode.isComponent) ); codegenNode.isBlock = false; context.helper(getVNodeHelper(context.inSSR, codegenNode.isComponent)); } constantCache.set(node, returnType2); return returnType2; } else { constantCache.set(node, 0); return 0; } case 2: case 3: return 3; case 9: case 11: case 10: return 0; case 5: case 12: return getConstantType(node.content, context); case 4: return node.constType; case 8: let returnType = 3; for (let i = 0; i < node.children.length; i++) { const child = node.children[i]; if (shared.isString(child) || shared.isSymbol(child)) { continue; } const childType = getConstantType(child, context); if (childType === 0) { return 0; } else if (childType < returnType) { returnType = childType; } } return returnType; case 20: return 2; default: return 0; } } const allowHoistedHelperSet = /* @__PURE__ */ new Set([ NORMALIZE_CLASS, NORMALIZE_STYLE, NORMALIZE_PROPS, GUARD_REACTIVE_PROPS ]); function getConstantTypeOfHelperCall(value, context) { if (value.type === 14 && !shared.isString(value.callee) && allowHoistedHelperSet.has(value.callee)) { const arg = value.arguments[0]; if (arg.type === 4) { return getConstantType(arg, context); } else if (arg.type === 14) { return getConstantTypeOfHelperCall(arg, context); } } return 0; } function getGeneratedPropsConstantType(node, context) { let returnType = 3; const props = getNodeProps(node); if (props && props.type === 15) { const { properties } = props; for (let i = 0; i < properties.length; i++) { const { key, value } = properties[i]; const keyType = getConstantType(key, context); if (keyType === 0) { return keyType; } if (keyType < returnType) { returnType = keyType; } let valueType; if (value.type === 4) { valueType = getConstantType(value, context); } else if (value.type === 14) { valueType = getConstantTypeOfHelperCall(value, context); } else { valueType = 0; } if (valueType === 0) { return valueType; } if (valueType < returnType) { returnType = valueType; } } } return returnType; } function getNodeProps(node) { const codegenNode = node.codegenNode; if (codegenNode.type === 13) { return codegenNode.props; } } function createTransformContext(root, { filename = "", prefixIdentifiers = false, hoistStatic = false, hmr = false, cacheHandlers = false, nodeTransforms = [], directiveTransforms = {}, transformHoist = null, isBuiltInComponent = shared.NOOP, isCustomElement = shared.NOOP, expressionPlugins = [], scopeId = null, slotted = true, ssr = false, inSSR = false, ssrCssVars = ``, bindingMetadata = shared.EMPTY_OBJ, inline = false, isTS = false, onError = defaultOnError, onWarn = defaultOnWarn, compatConfig }) { const nameMatch = filename.replace(/\?.*$/, "").match(/([^/\\]+)\.\w+$/); const context = { // options filename, selfName: nameMatch && shared.capitalize(shared.camelize(nameMatch[1])), prefixIdentifiers, hoistStatic, hmr, cacheHandlers, nodeTransforms, directiveTransforms, transformHoist, isBuiltInComponent, isCustomElement, expressionPlugins, scopeId, slotted, ssr, inSSR, ssrCssVars, bindingMetadata, inline, isTS, onError, onWarn, compatConfig, // state root, helpers: /* @__PURE__ */ new Map(), components: /* @__PURE__ */ new Set(), directives: /* @__PURE__ */ new Set(), hoists: [], imports: [], cached: [], constantCache: /* @__PURE__ */ new WeakMap(), temps: 0, identifiers: /* @__PURE__ */ Object.create(null), scopes: { vFor: 0, vSlot: 0, vPre: 0, vOnce: 0 }, parent: null, grandParent: null, currentNode: root, childIndex: 0, inVOnce: false, // methods helper(name) { const count = context.helpers.get(name) || 0; context.helpers.set(name, count + 1); return name; }, removeHelper(name) { const count = context.helpers.get(name); if (count) { const currentCount = count - 1; if (!currentCount) { context.helpers.delete(name); } else { context.helpers.set(name, currentCount); } } }, helperString(name) { return `_${helperNameMap[context.helper(name)]}`; }, replaceNode(node) { { if (!context.currentNode) { throw new Error(`Node being replaced is already removed.`); } if (!context.parent) { throw new Error(`Cannot replace root node.`); } } context.parent.children[context.childIndex] = context.currentNode = node; }, removeNode(node) { if (!context.parent) { throw new Error(`Cannot remove root node.`); } const list = context.parent.children; const removalIndex = node ? list.indexOf(node) : context.currentNode ? context.childIndex : -1; if (removalIndex < 0) { throw new Error(`node being removed is not a child of current parent`); } if (!node || node === context.currentNode) { context.currentNode = null; context.onNodeRemoved(); } else { if (context.childIndex > removalIndex) { context.childIndex--; context.onNodeRemoved(); } } context.parent.children.splice(removalIndex, 1); }, onNodeRemoved: shared.NOOP, addIdentifiers(exp) { { if (shared.isString(exp)) { addId(exp); } else if (exp.identifiers) { exp.identifiers.forEach(addId); } else if (exp.type === 4) { addId(exp.content); } } }, removeIdentifiers(exp) { { if (shared.isString(exp)) { removeId(exp); } else if (exp.identifiers) { exp.identifiers.forEach(removeId); } else if (exp.type === 4) { removeId(exp.content); } } }, hoist(exp) { if (shared.isString(exp)) exp = createSimpleExpression(exp); context.hoists.push(exp); const identifier = createSimpleExpression( `_hoisted_${context.hoists.length}`, false, exp.loc, 2 ); identifier.hoisted = exp; return identifier; }, cache(exp, isVNode = false, inVOnce = false) { const cacheExp = createCacheExpression( context.cached.length, exp, isVNode, inVOnce ); context.cached.push(cacheExp); return cacheExp; } }; { context.filters = /* @__PURE__ */ new Set(); } function addId(id) { const { identifiers } = context; if (identifiers[id] === void 0) { identifiers[id] = 0; } identifiers[id]++; } function removeId(id) { context.identifiers[id]--; } return context; } function transform(root, options) { const context = createTransformContext(root, options); traverseNode(root, context); if (options.hoistStatic) { cacheStatic(root, context); } if (!options.ssr) { createRootCodegen(root, context); } root.helpers = /* @__PURE__ */ new Set([...context.helpers.keys()]); root.components = [...context.components]; root.directives = [...context.directives]; root.imports = context.imports; root.hoists = context.hoists; root.temps = context.temps; root.cached = context.cached; root.transformed = true; { root.filters = [...context.filters]; } } function createRootCodegen(root, context) { const { helper } = context; const { children } = root; if (children.length === 1) { const child = children[0]; if (isSingleElementRoot(root, child) && child.codegenNode) { const codegenNode = child.codegenNode; if (codegenNode.type === 13) { convertToBlock(codegenNode, context); } root.codegenNode = codegenNode; } else { root.codegenNode = child; } } else if (children.length > 1) { let patchFlag = 64; if (children.filter((c) => c.type !== 3).length === 1) { patchFlag |= 2048; } root.codegenNode = createVNodeCall( context, helper(FRAGMENT), void 0, root.children, patchFlag, void 0, void 0, true, void 0, false ); } else ; } function traverseChildren(parent, context) { let i = 0; const nodeRemoved = () => { i--; }; for (; i < parent.children.length; i++) { const child = parent.children[i]; if (shared.isString(child)) continue; context.grandParent = context.parent; context.parent = parent; context.childIndex = i; context.onNodeRemoved = nodeRemoved; traverseNode(child, context); } } function traverseNode(node, context) { context.currentNode = node; const { nodeTransforms } = context; const exitFns = []; for (let i2 = 0; i2 < nodeTransforms.length; i2++) { const onExit = nodeTransforms[i2](node, context); if (onExit) { if (shared.isArray(onExit)) { exitFns.push(...onExit); } else { exitFns.push(onExit); } } if (!context.currentNode) { return; } else { node = context.currentNode; } } switch (node.type) { case 3: if (!context.ssr) { context.helper(CREATE_COMMENT); } break; case 5: if (!context.ssr) { context.helper(TO_DISPLAY_STRING); } break; // for container types, further traverse downwards case 9: for (let i2 = 0; i2 < node.branches.length; i2++) { traverseNode(node.branches[i2], context); } break; case 10: case 11: case 1: case 0: traverseChildren(node, context); break; } context.currentNode = node; let i = exitFns.length; while (i--) { exitFns[i](); } } function createStructuralDirectiveTransform(name, fn) { const matches = shared.isString(name) ? (n) => n === name : (n) => name.test(n); return (node, context) => { if (node.type === 1) { const { props } = node; if (node.tagType === 3 && props.some(isVSlot)) { return; } const exitFns = []; for (let i = 0; i < props.length; i++) { const prop = props[i]; if (prop.type === 7 && matches(prop.name)) { props.splice(i, 1); i--; const onExit = fn(node, prop, context); if (onExit) exitFns.push(onExit); } } return exitFns; } }; } const PURE_ANNOTATION = `/*@__PURE__*/`; const aliasHelper = (s) => `${helperNameMap[s]}: _${helperNameMap[s]}`; function createCodegenContext(ast, { mode = "function", prefixIdentifiers = mode === "module", sourceMap = false, filename = `template.vue.html`, scopeId = null, optimizeImports = false, runtimeGlobalName = `Vue`, runtimeModuleName = `vue`, ssrRuntimeModuleName = "vue/server-renderer", ssr = false, isTS = false, inSSR = false }) { const context = { mode, prefixIdentifiers, sourceMap, filename, scopeId, optimizeImports, runtimeGlobalName, runtimeModuleName, ssrRuntimeModuleName, ssr, isTS, inSSR, source: ast.source, code: ``, column: 1, line: 1, offset: 0, indentLevel: 0, pure: false, map: void 0, helper(key) { return `_${helperNameMap[key]}`; }, push(code, newlineIndex = -2 /* None */, node) { context.code += code; if (context.map) { if (node) { let name; if (node.type === 4 && !node.isStatic) { const content = node.content.replace(/^_ctx\./, ""); if (content !== node.content && isSimpleIdentifier(content)) { name = content; } } addMapping(node.loc.start, name); } if (newlineIndex === -3 /* Unknown */) { advancePositionWithMutation(context, code); } else { context.offset += code.length; if (newlineIndex === -2 /* None */) { context.column += code.length; } else { if (newlineIndex === -1 /* End */) { newlineIndex = code.length - 1; } context.line++; context.column = code.length - newlineIndex; } } if (node && node.loc !== locStub) { addMapping(node.loc.end); } } }, indent() { newline(++context.indentLevel); }, deindent(withoutNewLine = false) { if (withoutNewLine) { --context.indentLevel; } else { newline(--context.indentLevel); } }, newline() { newline(context.indentLevel); } }; function newline(n) { context.push("\n" + ` `.repeat(n), 0 /* Start */); } function addMapping(loc, name = null) { const { _names, _mappings } = context.map; if (name !== null && !_names.has(name)) _names.add(name); _mappings.add({ originalLine: loc.line, originalColumn: loc.column - 1, // source-map column is 0 based generatedLine: context.line, generatedColumn: context.column - 1, source: filename, name }); } if (sourceMap) { context.map = new sourceMapJs.SourceMapGenerator(); context.map.setSourceContent(filename, context.source); context.map._sources.add(filename); } return context; } function generate(ast, options = {}) { const context = createCodegenContext(ast, options); if (options.onContextCreated) options.onContextCreated(context); const { mode, push, prefixIdentifiers, indent, deindent, newline, scopeId, ssr } = context; const helpers = Array.from(ast.helpers); const hasHelpers = helpers.length > 0; const useWithBlock = !prefixIdentifiers && mode !== "module"; const genScopeId = scopeId != null && mode === "module"; const isSetupInlined = !!options.inline; const preambleContext = isSetupInlined ? createCodegenContext(ast, options) : context; if (mode === "module") { genModulePreamble(ast, preambleContext, genScopeId, isSetupInlined); } else { genFunctionPreamble(ast, preambleContext); } const functionName = ssr ? `ssrRender` : `render`; const args = ssr ? ["_ctx", "_push", "_parent", "_attrs"] : ["_ctx", "_cache"]; if (options.bindingMetadata && !options.inline) { args.push("$props", "$setup", "$data", "$options"); } const signature = options.isTS ? args.map((arg) => `${arg}: any`).join(",") : args.join(", "); if (isSetupInlined) { push(`(${signature}) => {`); } else { push(`function ${functionName}(${signature}) {`); } indent(); if (useWithBlock) { push(`with (_ctx) {`); indent(); if (hasHelpers) { push( `const { ${helpers.map(aliasHelper).join(", ")} } = _Vue `, -1 /* End */ ); newline(); } } if (ast.components.length) { genAssets(ast.components, "component", context); if (ast.directives.length || ast.temps > 0) { newline(); } } if (ast.directives.length) { genAssets(ast.directives, "directive", context); if (ast.temps > 0) { newline(); } } if (ast.filters && ast.filters.length) { newline(); genAssets(ast.filters, "filter", context); newline(); } if (ast.temps > 0) { push(`let `); for (let i = 0; i < ast.temps; i++) { push(`${i > 0 ? `, ` : ``}_temp${i}`); } } if (ast.components.length || ast.directives.length || ast.temps) { push(` `, 0 /* Start */); newline(); } if (!ssr) { push(`return `); } if (ast.codegenNode) { genNode(ast.codegenNode, context); } else { push(`null`); } if (useWithBlock) { deindent(); push(`}`); } deindent(); push(`}`); return { ast, code: context.code, preamble: isSetupInlined ? preambleContext.code : ``, map: context.map ? context.map.toJSON() : void 0 }; } function genFunctionPreamble(ast, context) { const { ssr, prefixIdentifiers, push, newline, runtimeModuleName, runtimeGlobalName, ssrRuntimeModuleName } = context; const VueBinding = ssr ? `require(${JSON.stringify(runtimeModuleName)})` : runtimeGlobalName; const helpers = Array.from(ast.helpers); if (helpers.length > 0) { if (prefixIdentifiers) { push( `const { ${helpers.map(aliasHelper).join(", ")} } = ${VueBinding} `, -1 /* End */ ); } else { push(`const _Vue = ${VueBinding} `, -1 /* End */); if (ast.hoists.length) { const staticHelpers = [ CREATE_VNODE, CREATE_ELEMENT_VNODE, CREATE_COMMENT, CREATE_TEXT, CREATE_STATIC ].filter((helper) => helpers.includes(helper)).map(aliasHelper).join(", "); push(`const { ${staticHelpers} } = _Vue `, -1 /* End */); } } } if (ast.ssrHelpers && ast.ssrHelpers.length) { push( `const { ${ast.ssrHelpers.map(aliasHelper).join(", ")} } = require("${ssrRuntimeModuleName}") `, -1 /* End */ ); } genHoists(ast.hoists, context); newline(); push(`return `); } function genModulePreamble(ast, context, genScopeId, inline) { const { push, newline, optimizeImports, runtimeModuleName, ssrRuntimeModuleName } = context; if (ast.helpers.size) { const helpers = Array.from(ast.helpers); if (optimizeImports) { push( `import { ${helpers.map((s) => helperNameMap[s]).join(", ")} } from ${JSON.stringify(runtimeModuleName)} `, -1 /* End */ ); push( ` // Binding optimization for webpack code-split const ${helpers.map((s) => `_${helperNameMap[s]} = ${helperNameMap[s]}`).join(", ")} `, -1 /* End */ ); } else { push( `import { ${helpers.map((s) => `${helperNameMap[s]} as _${helperNameMap[s]}`).join(", ")} } from ${JSON.stringify(runtimeModuleName)} `, -1 /* End */ ); } } if (ast.ssrHelpers && ast.ssrHelpers.length) { push( `import { ${ast.ssrHelpers.map((s) => `${helperNameMap[s]} as _${helperNameMap[s]}`).join(", ")} } from "${ssrRuntimeModuleName}" `, -1 /* End */ ); } if (ast.imports.length) { genImports(ast.imports, context); newline(); } genHoists(ast.hoists, context); newline(); if (!inline) { push(`export `); } } function genAssets(assets, type, { helper, push, newline, isTS }) { const resolver = helper( type === "filter" ? RESOLVE_FILTER : type === "component" ? RESOLVE_COMPONENT : RESOLVE_DIRECTIVE ); for (let i = 0; i < assets.length; i++) { let id = assets[i]; const maybeSelfReference = id.endsWith("__self"); if (maybeSelfReference) { id = id.slice(0, -6); } push( `const ${toValidAssetId(id, type)} = ${resolver}(${JSON.stringify(id)}${maybeSelfReference ? `, true` : ``})${isTS ? `!` : ``}` ); if (i < assets.length - 1) { newline(); } } } function genHoists(hoists, context) { if (!hoists.length) { return; } context.pure = true; const { push, newline } = context; newline(); for (let i = 0; i < hoists.length; i++) { const exp = hoists[i]; if (exp) { push(`const _hoisted_${i + 1} = `); genNode(exp, context); newline(); } } context.pure = false; } function genImports(importsOptions, context) { if (!importsOptions.length) { return; } importsOptions.forEach((imports) => { context.push(`import `); genNode(imports.exp, context); context.push(` from '${imports.path}'`); context.newline(); }); } function isText(n) { return shared.isString(n) || n.type === 4 || n.type === 2 || n.type === 5 || n.type === 8; } function genNodeListAsArray(nodes, context) { const multilines = nodes.length > 3 || nodes.some((n) => shared.isArray(n) || !isText(n)); context.push(`[`); multilines && context.indent(); genNodeList(nodes, context, multilines); multilines && context.deindent(); context.push(`]`); } function genNodeList(nodes, context, multilines = false, comma = true) { const { push, newline } = context; for (let i = 0; i < nodes.length; i++) { const node = nodes[i]; if (shared.isString(node)) { push(node, -3 /* Unknown */); } else if (shared.isArray(node)) { genNodeListAsArray(node, context); } else { genNode(node, context); } if (i < nodes.length - 1) { if (multilines) { comma && push(","); newline(); } else { comma && push(", "); } } } } function genNode(node, context) { if (shared.isString(node)) { context.push(node, -3 /* Unknown */); return; } if (shared.isSymbol(node)) { context.push(context.helper(node)); return; } switch (node.type) { case 1: case 9: case 11: assert( node.codegenNode != null, `Codegen node is missing for element/if/for node. Apply appropriate transforms first.` ); genNode(node.codegenNode, context); break; case 2: genText(node, context); break; case 4: genExpression(node, context); break; case 5: genInterpolation(node, context); break; case 12: genNode(node.codegenNode, context); break; case 8: genCompoundExpression(node, context); break; case 3: genComment(node, context); break; case 13: genVNodeCall(node, context); break; case 14: genCallExpression(node, context); break; case 15: genObjectExpression(node, context); break; case 17: genArrayExpression(node, context); break; case 18: genFunctionExpression(node, context); break; case 19: genConditionalExpression(node, context); break; case 20: genCacheExpression(node, context); break; case 21: genNodeList(node.body, context, true, false); break; // SSR only types case 22: genTemplateLiteral(node, context); break; case 23: genIfStatement(node, context); break; case 24: genAssignmentExpression(node, context); break; case 25: genSequenceExpression(node, context); break; case 26: genReturnStatement(node, context); break; /* v8 ignore start */ case 10: break; default: { assert(false, `unhandled codegen node type: ${node.type}`); const exhaustiveCheck = node; return exhaustiveCheck; } } } function genText(node, context) { context.push(JSON.stringify(node.content), -3 /* Unknown */, node); } function genExpression(node, context) { const { content, isStatic } = node; context.push( isStatic ? JSON.stringify(content) : content, -3 /* Unknown */, node ); } function genInterpolation(node, context) { const { push, helper, pure } = context; if (pure) push(PURE_ANNOTATION); push(`${helper(TO_DISPLAY_STRING)}(`); genNode(node.content, context); push(`)`); } function genCompoundExpression(node, context) { for (let i = 0; i < node.children.length; i++) { const child = node.children[i]; if (shared.isString(child)) { context.push(child, -3 /* Unknown */); } else { genNode(child, context); } } } function genExpressionAsPropertyKey(node, context) { const { push } = context; if (node.type === 8) { push(`[`); genCompoundExpression(node, context); push(`]`); } else if (node.isStatic) { const text = isSimpleIdentifier(node.content) ? node.content : JSON.stringify(node.content); push(text, -2 /* None */, node); } else { push(`[${node.content}]`, -3 /* Unknown */, node); } } function genComment(node, context) { const { push, helper, pure } = context; if (pure) { push(PURE_ANNOTATION); } push( `${helper(CREATE_COMMENT)}(${JSON.stringify(node.content)})`, -3 /* Unknown */, node ); } function genVNodeCall(node, context) { const { push, helper, pure } = context; const { tag, props, children, patchFlag, dynamicProps, directives, isBlock, disableTracking, isComponent } = node; let patchFlagString; if (patchFlag) { { if (patchFlag < 0) { patchFlagString = patchFlag + ` /* ${shared.PatchFlagNames[patchFlag]} */`; } else { const flagNames = Object.keys(shared.PatchFlagNames).map(Number).filter((n) => n > 0 && patchFlag & n).map((n) => shared.PatchFlagNames[n]).join(`, `); patchFlagString = patchFlag + ` /* ${flagNames} */`; } } } if (directives) { push(helper(WITH_DIRECTIVES) + `(`); } if (isBlock) { push(`(${helper(OPEN_BLOCK)}(${disableTracking ? `true` : ``}), `); } if (pure) { push(PURE_ANNOTATION); } const callHelper = isBlock ? getVNodeBlockHelper(context.inSSR, isComponent) : getVNodeHelper(context.inSSR, isComponent); push(helper(callHelper) + `(`, -2 /* None */, node); genNodeList( genNullableArgs([tag, props, children, patchFlagString, dynamicProps]), context ); push(`)`); if (isBlock) { push(`)`); } if (directives) { push(`, `); genNode(directives, context); push(`)`); } } function genNullableArgs(args) { let i = args.length; while (i--) { if (args[i] != null) break; } return args.slice(0, i + 1).map((arg) => arg || `null`); } function genCallExpression(node, context) { const { push, helper, pure } = context; const callee = shared.isString(node.callee) ? node.callee : helper(node.callee); if (pure) { push(PURE_ANNOTATION); } push(callee + `(`, -2 /* None */, node); genNodeList(node.arguments, context); push(`)`); } function genObjectExpression(node, context) { const { push, indent, deindent, newline } = context; const { properties } = node; if (!properties.length) { push(`{}`, -2 /* None */, node); return; } const multilines = properties.length > 1 || properties.some((p) => p.value.type !== 4); push(multilines ? `{` : `{ `); multilines && indent(); for (let i = 0; i < properties.length; i++) { const { key, value } = properties[i]; genExpressionAsPropertyKey(key, context); push(`: `); genNode(value, context); if (i < properties.length - 1) { push(`,`); newline(); } } multilines && deindent(); push(multilines ? `}` : ` }`); } function genArrayExpression(node, context) { genNodeListAsArray(node.elements, context); } function genFunctionExpression(node, context) { const { push, indent, deindent } = context; const { params, returns, body, newline, isSlot } = node; if (isSlot) { push(`_${helperNameMap[WITH_CTX]}(`); } push(`(`, -2 /* None */, node); if (shared.isArray(params)) { genNodeList(params, context); } else if (params) { genNode(params, context); } push(`) => `); if (newline || body) { push(`{`); indent(); } if (returns) { if (newline) { push(`return `); } if (shared.isArray(returns)) { genNodeListAsArray(returns, context); } else { genNode(returns, context); } } else if (body) { genNode(body, context); } if (newline || body) { deindent(); push(`}`); } if (isSlot) { if (node.isNonScopedSlot) { push(`, undefined, true`); } push(`)`); } } function genConditionalExpression(node, context) { const { test, consequent, alternate, newline: needNewline } = node; const { push, indent, deindent, newline } = context; if (test.type === 4) { const needsParens = !isSimpleIdentifier(test.content); needsParens && push(`(`); genExpression(test, context); needsParens && push(`)`); } else { push(`(`); genNode(test, context); push(`)`); } needNewline && indent(); context.indentLevel++; needNewline || push(` `); push(`? `); genNode(consequent, context); context.indentLevel--; needNewline && newline(); needNewline || push(` `); push(`: `); const isNested = alternate.type === 19; if (!isNested) { context.indentLevel++; } genNode(alternate, context); if (!isNested) { context.indentLevel--; } needNewline && deindent( true /* without newline */ ); } function genCacheExpression(node, context) { const { push, helper, indent, deindent, newline } = context; const { needPauseTracking, needArraySpread } = node; if (needArraySpread) { push(`[...(`); } push(`_cache[${node.index}] || (`); if (needPauseTracking) { indent(); push(`${helper(SET_BLOCK_TRACKING)}(-1`); if (node.inVOnce) push(`, true`); push(`),`); newline(); push(`(`); } push(`_cache[${node.index}] = `); genNode(node.value, context); if (needPauseTracking) { push(`).cacheIndex = ${node.index},`); newline(); push(`${helper(SET_BLOCK_TRACKING)}(1),`); newline(); push(`_cache[${node.index}]`); deindent(); } push(`)`); if (needArraySpread) { push(`)]`); } } function genTemplateLiteral(node, context) { const { push, indent, deindent } = context; push("`"); const l = node.elements.length; const multilines = l > 3; for (let i = 0; i < l; i++) { const e = node.elements[i]; if (shared.isString(e)) { push(e.replace(/(`|\$|\\)/g, "\\$1"), -3 /* Unknown */); } else { push("${"); if (multilines) indent(); genNode(e, context); if (multilines) deindent(); push("}"); } } push("`"); } function genIfStatement(node, context) { const { push, indent, deindent } = context; const { test, consequent, alternate } = node; push(`if (`); genNode(test, context); push(`) {`); indent(); genNode(consequent, context); deindent(); push(`}`); if (alternate) { push(` else `); if (alternate.type === 23) { genIfStatement(alternate, context); } else { push(`{`); indent(); genNode(alternate, context); deindent(); push(`}`); } } } function genAssignmentExpression(node, context) { genNode(node.left, context); context.push(` = `); genNode(node.right, context); } function genSequenceExpression(node, context) { context.push(`(`); genNodeList(node.expressions, context); context.push(`)`); } function genReturnStatement({ returns }, context) { context.push(`return `); if (shared.isArray(returns)) { genNodeListAsArray(returns, context); } else { genNode(returns, context); } } const isLiteralWhitelisted = /* @__PURE__ */ shared.makeMap("true,false,null,this"); const transformExpression = (node, context) => { if (node.type === 5) { node.content = processExpression( node.content, context ); } else if (node.type === 1) { const memo = findDir(node, "memo"); for (let i = 0; i < node.props.length; i++) { const dir = node.props[i]; if (dir.type === 7 && dir.name !== "for") { const exp = dir.exp; const arg = dir.arg; if (exp && exp.type === 4 && !(dir.name === "on" && arg) && // key has been processed in transformFor(vMemo + vFor) !(memo && arg && arg.type === 4 && arg.content === "key")) { dir.exp = processExpression( exp, context, // slot args must be processed as function params dir.name === "slot" ); } if (arg && arg.type === 4 && !arg.isStatic) { dir.arg = processExpression(arg, context); } } } } }; function processExpression(node, context, asParams = false, asRawStatements = false, localVars = Object.create(context.identifiers)) { if (!context.prefixIdentifiers || !node.content.trim()) { return node; } const { inline, bindingMetadata } = context; const rewriteIdentifier = (raw, parent, id) => { const type = shared.hasOwn(bindingMetadata, raw) && bindingMetadata[raw]; if (inline) { const isAssignmentLVal = parent && parent.type === "AssignmentExpression" && parent.left === id; const isUpdateArg = parent && parent.type === "UpdateExpression" && parent.argument === id; const isDestructureAssignment = parent && isInDestructureAssignment(parent, parentStack); const isNewExpression = parent && isInNewExpression(parentStack); const wrapWithUnref = (raw2) => { const wrapped = `${context.helperString(UNREF)}(${raw2})`; return isNewExpression ? `(${wrapped})` : wrapped; }; if (isConst(type) || type === "setup-reactive-const" || localVars[raw]) { return raw; } else if (type === "setup-ref") { return `${raw}.value`; } else if (type === "setup-maybe-ref") { return isAssignmentLVal || isUpdateArg || isDestructureAssignment ? `${raw}.value` : wrapWithUnref(raw); } else if (type === "setup-let") { if (isAssignmentLVal) { const { right: rVal, operator } = parent; const rExp = rawExp.slice(rVal.start - 1, rVal.end - 1); const rExpString = stringifyExpression( processExpression( createSimpleExpression(rExp, false), context, false, false, knownIds ) ); return `${context.helperString(IS_REF)}(${raw})${context.isTS ? ` //@ts-ignore ` : ``} ? ${raw}.value ${operator} ${rExpString} : ${raw}`; } else if (isUpdateArg) { id.start = parent.start; id.end = parent.end; const { prefix: isPrefix, operator } = parent; const prefix = isPrefix ? operator : ``; const postfix = isPrefix ? `` : operator; return `${context.helperString(IS_REF)}(${raw})${context.isTS ? ` //@ts-ignore ` : ``} ? ${prefix}${raw}.value${postfix} : ${prefix}${raw}${postfix}`; } else if (isDestructureAssignment) { return raw; } else { return wrapWithUnref(raw); } } else if (type === "props") { return shared.genPropsAccessExp(raw); } else if (type === "props-aliased") { return shared.genPropsAccessExp(bindingMetadata.__propsAliases[raw]); } } else { if (type && type.startsWith("setup") || type === "literal-const") { return `$setup.${raw}`; } else if (type === "props-aliased") { return `$props['${bindingMetadata.__propsAliases[raw]}']`; } else if (type) { return `$${type}.${raw}`; } } return `_ctx.${raw}`; }; const rawExp = node.content; let ast = node.ast; if (ast === false) { return node; } if (ast === null || !ast && isSimpleIdentifier(rawExp)) { const isScopeVarReference = context.identifiers[rawExp]; const isAllowedGlobal = shared.isGloballyAllowed(rawExp); const isLiteral = isLiteralWhitelisted(rawExp); if (!asParams && !isScopeVarReference && !isLiteral && (!isAllowedGlobal || bindingMetadata[rawExp])) { if (isConst(bindingMetadata[rawExp])) { node.constType = 1; } node.content = rewriteIdentifier(rawExp); } else if (!isScopeVarReference) { if (isLiteral) { node.constType = 3; } else { node.constType = 2; } } return node; } if (!ast) { const source = asRawStatements ? ` ${rawExp} ` : `(${rawExp})${asParams ? `=>{}` : ``}`; try { ast = parser.parseExpression(source, { sourceType: "module", plugins: context.expressionPlugins }); } catch (e) { context.onError( createCompilerError( 45, node.loc, void 0, e.message ) ); return node; } } const ids = []; const parentStack = []; const knownIds = Object.create(context.identifiers); walkIdentifiers( ast, (node2, parent, _, isReferenced, isLocal) => { if (isStaticPropertyKey(node2, parent)) { return; } if (node2.name.startsWith("_filter_")) { return; } const needPrefix = isReferenced && canPrefix(node2); if (needPrefix && !isLocal) { if (isStaticProperty(parent) && parent.shorthand) { node2.prefix = `${node2.name}: `; } node2.name = rewriteIdentifier(node2.name, parent, node2); ids.push(node2); } else { if (!(needPrefix && isLocal) && (!parent || parent.type !== "CallExpression" && parent.type !== "NewExpression" && parent.type !== "MemberExpression")) { node2.isConstant = true; } ids.push(node2); } }, true, // invoke on ALL identifiers parentStack, knownIds ); const children = []; ids.sort((a, b) => a.start - b.start); ids.forEach((id, i) => { const start = id.start - 1; const end = id.end - 1; const last = ids[i - 1]; const leadingText = rawExp.slice(last ? last.end - 1 : 0, start); if (leadingText.length || id.prefix) { children.push(leadingText + (id.prefix || ``)); } const source = rawExp.slice(start, end); children.push( createSimpleExpression( id.name, false, { start: advancePositionWithClone(node.loc.start, source, start), end: advancePositionWithClone(node.loc.start, source, end), source }, id.isConstant ? 3 : 0 ) ); if (i === ids.length - 1 && end < rawExp.length) { children.push(rawExp.slice(end)); } }); let ret; if (children.length) { ret = createCompoundExpression(children, node.loc); ret.ast = ast; } else { ret = node; ret.constType = 3; } ret.identifiers = Object.keys(knownIds); return ret; } function canPrefix(id) { if (shared.isGloballyAllowed(id.name)) { return false; } if (id.name === "require") { return false; } return true; } function stringifyExpression(exp) { if (shared.isString(exp)) { return exp; } else if (exp.type === 4) { return exp.content; } else { return exp.children.map(stringifyExpression).join(""); } } function isConst(type) { return type === "setup-const" || type === "literal-const"; } const transformIf = createStructuralDirectiveTransform( /^(if|else|else-if)$/, (node, dir, context) => { return processIf(node, dir, context, (ifNode, branch, isRoot) => { const siblings = context.parent.children; let i = siblings.indexOf(ifNode); let key = 0; while (i-- >= 0) { const sibling = siblings[i]; if (sibling && sibling.type === 9) { key += sibling.branches.length; } } return () => { if (isRoot) { ifNode.codegenNode = createCodegenNodeForBranch( branch, key, context ); } else { const parentCondition = getParentCondition(ifNode.codegenNode); parentCondition.alternate = createCodegenNodeForBranch( branch, key + ifNode.branches.length - 1, context ); } }; }); } ); function processIf(node, dir, context, processCodegen) { if (dir.name !== "else" && (!dir.exp || !dir.exp.content.trim())) { const loc = dir.exp ? dir.exp.loc : node.loc; context.onError( createCompilerError(28, dir.loc) ); dir.exp = createSimpleExpression(`true`, false, loc); } if (context.prefixIdentifiers && dir.exp) { dir.exp = processExpression(dir.exp, context); } if (dir.name === "if") { const branch = createIfBranch(node, dir); const ifNode = { type: 9, loc: cloneLoc(node.loc), branches: [branch] }; context.replaceNode(ifNode); if (processCodegen) { return processCodegen(ifNode, branch, true); } } else { const siblings = context.parent.children; const comments = []; let i = siblings.indexOf(node); while (i-- >= -1) { const sibling = siblings[i]; if (sibling && sibling.type === 3) { context.removeNode(sibling); comments.unshift(sibling); continue; } if (sibling && sibling.type === 2 && !sibling.content.trim().length) { context.removeNode(sibling); continue; } if (sibling && sibling.type === 9) { if (dir.name === "else-if" && sibling.branches[sibling.branches.length - 1].condition === void 0) { context.onError( createCompilerError(30, node.loc) ); } context.removeNode(); const branch = createIfBranch(node, dir); if (comments.length && // #3619 ignore comments if the v-if is direct child of <transition> !(context.parent && context.parent.type === 1 && (context.parent.tag === "transition" || context.parent.tag === "Transition"))) { branch.children = [...comments, ...branch.children]; } { const key = branch.userKey; if (key) { sibling.branches.forEach(({ userKey }) => { if (isSameKey(userKey, key)) { context.onError( createCompilerError( 29, branch.userKey.loc ) ); } }); } } sibling.branches.push(branch); const onExit = processCodegen && processCodegen(sibling, branch, false); traverseNode(branch, context); if (onExit) onExit(); context.currentNode = null; } else { context.onError( createCompilerError(30, node.loc) ); } break; } } } function createIfBranch(node, dir) { const isTemplateIf = node.tagType === 3; return { type: 10, loc: node.loc, condition: dir.name === "else" ? void 0 : dir.exp, children: isTemplateIf && !findDir(node, "for") ? node.children : [node], userKey: findProp(node, `key`), isTemplateIf }; } function createCodegenNodeForBranch(branch, keyIndex, context) { if (branch.condition) { return createConditionalExpression( branch.condition, createChildrenCodegenNode(branch, keyIndex, context), // make sure to pass in asBlock: true so that the comment node call // closes the current block. createCallExpression(context.helper(CREATE_COMMENT), [ '"v-if"' , "true" ]) ); } else { return createChildrenCodegenNode(branch, keyIndex, context); } } function createChildrenCodegenNode(branch, keyIndex, context) { const { helper } = context; const keyProperty = createObjectProperty( `key`, createSimpleExpression( `${keyIndex}`, false, locStub, 2 ) ); const { children } = branch; const firstChild = children[0]; const needFragmentWrapper = children.length !== 1 || firstChild.type !== 1; if (needFragmentWrapper) { if (children.length === 1 && firstChild.type === 11) { const vnodeCall = firstChild.codegenNode; injectProp(vnodeCall, keyProperty, context); return vnodeCall; } else { let patchFlag = 64; if (!branch.isTemplateIf && children.filter((c) => c.type !== 3).length === 1) { patchFlag |= 2048; } return createVNodeCall( context, helper(FRAGMENT), createObjectExpression([keyProperty]), children, patchFlag, void 0, void 0, true, false, false, branch.loc ); } } else { const ret = firstChild.codegenNode; const vnodeCall = getMemoedVNodeCall(ret); if (vnodeCall.type === 13) { convertToBlock(vnodeCall, context); } injectProp(vnodeCall, keyProperty, context); return ret; } } function isSameKey(a, b) { if (!a || a.type !== b.type) { return false; } if (a.type === 6) { if (a.value.content !== b.value.content) { return false; } } else { const exp = a.exp; const branchExp = b.exp; if (exp.type !== branchExp.type) { return false; } if (exp.type !== 4 || exp.isStatic !== branchExp.isStatic || exp.content !== branchExp.content) { return false; } } return true; } function getParentCondition(node) { while (true) { if (node.type === 19) { if (node.alternate.type === 19) { node = node.alternate; } else { return node; } } else if (node.type === 20) { node = node.value; } } } const transformBind = (dir, _node, context) => { const { modifiers, loc } = dir; const arg = dir.arg; let { exp } = dir; if (exp && exp.type === 4 && !exp.content.trim()) { { context.onError( createCompilerError(34, loc) ); return { props: [ createObjectProperty(arg, createSimpleExpression("", true, loc)) ] }; } } if (!exp) { if (arg.type !== 4 || !arg.isStatic) { context.onError( createCompilerError( 52, arg.loc ) ); return { props: [ createObjectProperty(arg, createSimpleExpression("", true, loc)) ] }; } transformBindShorthand(dir, context); exp = dir.exp; } if (arg.type !== 4) { arg.children.unshift(`(`); arg.children.push(`) || ""`); } else if (!arg.isStatic) { arg.content = `${arg.content} || ""`; } if (modifiers.some((mod) => mod.content === "camel")) { if (arg.type === 4) { if (arg.isStatic) { arg.content = shared.camelize(arg.content); } else { arg.content = `${context.helperString(CAMELIZE)}(${arg.content})`; } } else { arg.children.unshift(`${context.helperString(CAMELIZE)}(`); arg.children.push(`)`); } } if (!context.inSSR) { if (modifiers.some((mod) => mod.content === "prop")) { injectPrefix(arg, "."); } if (modifiers.some((mod) => mod.content === "attr")) { injectPrefix(arg, "^"); } } return { props: [createObjectProperty(arg, exp)] }; }; const transformBindShorthand = (dir, context) => { const arg = dir.arg; const propName = shared.camelize(arg.content); dir.exp = createSimpleExpression(propName, false, arg.loc); { dir.exp = processExpression(dir.exp, context); } }; const injectPrefix = (arg, prefix) => { if (arg.type === 4) { if (arg.isStatic) { arg.content = prefix + arg.content; } else { arg.content = `\`${prefix}\${${arg.content}}\``; } } else { arg.children.unshift(`'${prefix}' + (`); arg.children.push(`)`); } }; const transformFor = createStructuralDirectiveTransform( "for", (node, dir, context) => { const { helper, removeHelper } = context; return processFor(node, dir, context, (forNode) => { const renderExp = createCallExpression(helper(RENDER_LIST), [ forNode.source ]); const isTemplate = isTemplateNode(node); const memo = findDir(node, "memo"); const keyProp = findProp(node, `key`, false, true); const isDirKey = keyProp && keyProp.type === 7; if (isDirKey && !keyProp.exp) { transformBindShorthand(keyProp, context); } let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp); if (memo && keyExp && isDirKey) { { keyProp.exp = keyExp = processExpression( keyExp, context ); } } const keyProperty = keyProp && keyExp ? createObjectProperty(`key`, keyExp) : null; if (isTemplate) { if (memo) { memo.exp = processExpression( memo.exp, context ); } if (keyProperty && keyProp.type !== 6) { keyProperty.value = processExpression( keyProperty.value, context ); } } const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0; const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256; forNode.codegenNode = createVNodeCall( context, helper(FRAGMENT), void 0, renderExp, fragmentFlag, void 0, void 0, true, !isStableFragment, false, node.loc ); return () => { let childBlock; const { children } = forNode; if (isTemplate) { node.children.some((c) => { if (c.type === 1) { const key = findProp(c, "key"); if (key) { context.onError( createCompilerError( 33, key.loc ) ); return true; } } }); } const needFragmentWrapper = children.length !== 1 || children[0].type !== 1; const slotOutlet = isSlotOutlet(node) ? node : isTemplate && node.children.length === 1 && isSlotOutlet(node.children[0]) ? node.children[0] : null; if (slotOutlet) { childBlock = slotOutlet.codegenNode; if (isTemplate && keyProperty) { injectProp(childBlock, keyProperty, context); } } else if (needFragmentWrapper) { childBlock = createVNodeCall( context, helper(FRAGMENT), keyProperty ? createObjectExpression([keyProperty]) : void 0, node.children, 64, void 0, void 0, true, void 0, false ); } else { childBlock = children[0].codegenNode; if (isTemplate && keyProperty) { injectProp(childBlock, keyProperty, context); } if (childBlock.isBlock !== !isStableFragment) { if (childBlock.isBlock) { removeHelper(OPEN_BLOCK); removeHelper( getVNodeBlockHelper(context.inSSR, childBlock.isComponent) ); } else { removeHelper( getVNodeHelper(context.inSSR, childBlock.isComponent) ); } } childBlock.isBlock = !isStableFragment; if (childBlock.isBlock) { helper(OPEN_BLOCK); helper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent)); } else { helper(getVNodeHelper(context.inSSR, childBlock.isComponent)); } } if (memo) { const loop = createFunctionExpression( createForLoopParams(forNode.parseResult, [ createSimpleExpression(`_cached`) ]) ); loop.body = createBlockStatement([ createCompoundExpression([`const _memo = (`, memo.exp, `)`]), createCompoundExpression([ `if (_cached`, ...keyExp ? [` && _cached.key === `, keyExp] : [], ` && ${context.helperString( IS_MEMO_SAME )}(_cached, _memo)) return _cached` ]), createCompoundExpression([`const _item = `, childBlock]), createSimpleExpression(`_item.memo = _memo`), createSimpleExpression(`return _item`) ]); renderExp.arguments.push( loop, createSimpleExpression(`_cache`), createSimpleExpression(String(context.cached.length)) ); context.cached.push(null); } else { renderExp.arguments.push( createFunctionExpression( createForLoopParams(forNode.parseResult), childBlock, true ) ); } }; }); } ); function processFor(node, dir, context, processCodegen) { if (!dir.exp) { context.onError( createCompilerError(31, dir.loc) ); return; } const parseResult = dir.forParseResult; if (!parseResult) { context.onError( createCompilerError(32, dir.loc) ); return; } finalizeForParseResult(parseResult, context); const { addIdentifiers, removeIdentifiers, scopes } = context; const { source, value, key, index } = parseResult; const forNode = { type: 11, loc: dir.loc, source, valueAlias: value, keyAlias: key, objectIndexAlias: index, parseResult, children: isTemplateNode(node) ? node.children : [node] }; context.replaceNode(forNode); scopes.vFor++; if (context.prefixIdentifiers) { value && addIdentifiers(value); key && addIdentifiers(key); index && addIdentifiers(index); } const onExit = processCodegen && processCodegen(forNode); return () => { scopes.vFor--; if (context.prefixIdentifiers) { value && removeIdentifiers(value); key && removeIdentifiers(key); index && removeIdentifiers(index); } if (onExit) onExit(); }; } function finalizeForParseResult(result, context) { if (result.finalized) return; if (context.prefixIdentifiers) { result.source = processExpression( result.source, context ); if (result.key) { result.key = processExpression( result.key, context, true ); } if (result.index) { result.index = processExpression( result.index, context, true ); } if (result.value) { result.value = processExpression( result.value, context, true ); } } result.finalized = true; } function createForLoopParams({ value, key, index }, memoArgs = []) { return createParamsList([value, key, index, ...memoArgs]); } function createParamsList(args) { let i = args.length; while (i--) { if (args[i]) break; } return args.slice(0, i + 1).map((arg, i2) => arg || createSimpleExpression(`_`.repeat(i2 + 1), false)); } const defaultFallback = createSimpleExpression(`undefined`, false); const trackSlotScopes = (node, context) => { if (node.type === 1 && (node.tagType === 1 || node.tagType === 3)) { const vSlot = findDir(node, "slot"); if (vSlot) { const slotProps = vSlot.exp; if (context.prefixIdentifiers) { slotProps && context.addIdentifiers(slotProps); } context.scopes.vSlot++; return () => { if (context.prefixIdentifiers) { slotProps && context.removeIdentifiers(slotProps); } context.scopes.vSlot--; }; } } }; const trackVForSlotScopes = (node, context) => { let vFor; if (isTemplateNode(node) && node.props.some(isVSlot) && (vFor = findDir(node, "for"))) { const result = vFor.forParseResult; if (result) { finalizeForParseResult(result, context); const { value, key, index } = result; const { addIdentifiers, removeIdentifiers } = context; value && addIdentifiers(value); key && addIdentifiers(key); index && addIdentifiers(index); return () => { value && removeIdentifiers(value); key && removeIdentifiers(key); index && removeIdentifiers(index); }; } } }; const buildClientSlotFn = (props, _vForExp, children, loc) => createFunctionExpression( props, children, false, true, children.length ? children[0].loc : loc ); function buildSlots(node, context, buildSlotFn = buildClientSlotFn) { context.helper(WITH_CTX); const { children, loc } = node; const slotsProperties = []; const dynamicSlots = []; let hasDynamicSlots = context.scopes.vSlot > 0 || context.scopes.vFor > 0; if (!context.ssr && context.prefixIdentifiers) { hasDynamicSlots = hasScopeRef(node, context.identifiers); } const onComponentSlot = findDir(node, "slot", true); if (onComponentSlot) { const { arg, exp } = onComponentSlot; if (arg && !isStaticExp(arg)) { hasDynamicSlots = true; } slotsProperties.push( createObjectProperty( arg || createSimpleExpression("default", true), buildSlotFn(exp, void 0, children, loc) ) ); } let hasTemplateSlots = false; let hasNamedDefaultSlot = false; const implicitDefaultChildren = []; const seenSlotNames = /* @__PURE__ */ new Set(); let conditionalBranchIndex = 0; for (let i = 0; i < children.length; i++) { const slotElement = children[i]; let slotDir; if (!isTemplateNode(slotElement) || !(slotDir = findDir(slotElement, "slot", true))) { if (slotElement.type !== 3) { implicitDefaultChildren.push(slotElement); } continue; } if (onComponentSlot) { context.onError( createCompilerError(37, slotDir.loc) ); break; } hasTemplateSlots = true; const { children: slotChildren, loc: slotLoc } = slotElement; const { arg: slotName = createSimpleExpression(`default`, true), exp: slotProps, loc: dirLoc } = slotDir; let staticSlotName; if (isStaticExp(slotName)) { staticSlotName = slotName ? slotName.content : `default`; } else { hasDynamicSlots = true; } const vFor = findDir(slotElement, "for"); const slotFunction = buildSlotFn(slotProps, vFor, slotChildren, slotLoc); let vIf; let vElse; if (vIf = findDir(slotElement, "if")) { hasDynamicSlots = true; dynamicSlots.push( createConditionalExpression( vIf.exp, buildDynamicSlot(slotName, slotFunction, conditionalBranchIndex++), defaultFallback ) ); } else if (vElse = findDir( slotElement, /^else(-if)?$/, true /* allowEmpty */ )) { let j = i; let prev; while (j--) { prev = children[j]; if (prev.type !== 3) { break; } } if (prev && isTemplateNode(prev) && findDir(prev, /^(else-)?if$/)) { let conditional = dynamicSlots[dynamicSlots.length - 1]; while (conditional.alternate.type === 19) { conditional = conditional.alternate; } conditional.alternate = vElse.exp ? createConditionalExpression( vElse.exp, buildDynamicSlot( slotName, slotFunction, conditionalBranchIndex++ ), defaultFallback ) : buildDynamicSlot(slotName, slotFunction, conditionalBranchIndex++); } else { context.onError( createCompilerError(30, vElse.loc) ); } } else if (vFor) { hasDynamicSlots = true; const parseResult = vFor.forParseResult; if (parseResult) { finalizeForParseResult(parseResult, context); dynamicSlots.push( createCallExpression(context.helper(RENDER_LIST), [ parseResult.source, createFunctionExpression( createForLoopParams(parseResult), buildDynamicSlot(slotName, slotFunction), true ) ]) ); } else { context.onError( createCompilerError( 32, vFor.loc ) ); } } else { if (staticSlotName) { if (seenSlotNames.has(staticSlotName)) { context.onError( createCompilerError( 38, dirLoc ) ); continue; } seenSlotNames.add(staticSlotName); if (staticSlotName === "default") { hasNamedDefaultSlot = true; } } slotsProperties.push(createObjectProperty(slotName, slotFunction)); } } if (!onComponentSlot) { const buildDefaultSlotProperty = (props, children2) => { const fn = buildSlotFn(props, void 0, children2, loc); if (context.compatConfig) { fn.isNonScopedSlot = true; } return createObjectProperty(`default`, fn); }; if (!hasTemplateSlots) { slotsProperties.push(buildDefaultSlotProperty(void 0, children)); } else if (implicitDefaultChildren.length && // #3766 // with whitespace: 'preserve', whitespaces between slots will end up in // implicitDefaultChildren. Ignore if all implicit children are whitespaces. implicitDefaultChildren.some((node2) => isNonWhitespaceContent(node2))) { if (hasNamedDefaultSlot) { context.onError( createCompilerError( 39, implicitDefaultChildren[0].loc ) ); } else { slotsProperties.push( buildDefaultSlotProperty(void 0, implicitDefaultChildren) ); } } } const slotFlag = hasDynamicSlots ? 2 : hasForwardedSlots(node.children) ? 3 : 1; let slots = createObjectExpression( slotsProperties.concat( createObjectProperty( `_`, // 2 = compiled but dynamic = can skip normalization, but must run diff // 1 = compiled and static = can skip normalization AND diff as optimized createSimpleExpression( slotFlag + (` /* ${shared.slotFlagsText[slotFlag]} */` ), false ) ) ), loc ); if (dynamicSlots.length) { slots = createCallExpression(context.helper(CREATE_SLOTS), [ slots, createArrayExpression(dynamicSlots) ]); } return { slots, hasDynamicSlots }; } function buildDynamicSlot(name, fn, index) { const props = [ createObjectProperty(`name`, name), createObjectProperty(`fn`, fn) ]; if (index != null) { props.push( createObjectProperty(`key`, createSimpleExpression(String(index), true)) ); } return createObjectExpression(props); } function hasForwardedSlots(children) { for (let i = 0; i < children.length; i++) { const child = children[i]; switch (child.type) { case 1: if (child.tagType === 2 || hasForwardedSlots(child.children)) { return true; } break; case 9: if (hasForwardedSlots(child.branches)) return true; break; case 10: case 11: if (hasForwardedSlots(child.children)) return true; break; } } return false; } function isNonWhitespaceContent(node) { if (node.type !== 2 && node.type !== 12) return true; return node.type === 2 ? !!node.content.trim() : isNonWhitespaceContent(node.content); } const directiveImportMap = /* @__PURE__ */ new WeakMap(); const transformElement = (node, context) => { return function postTransformElement() { node = context.currentNode; if (!(node.type === 1 && (node.tagType === 0 || node.tagType === 1))) { return; } const { tag, props } = node; const isComponent = node.tagType === 1; let vnodeTag = isComponent ? resolveComponentType(node, context) : `"${tag}"`; const isDynamicComponent = shared.isObject(vnodeTag) && vnodeTag.callee === RESOLVE_DYNAMIC_COMPONENT; let vnodeProps; let vnodeChildren; let patchFlag = 0; let vnodeDynamicProps; let dynamicPropNames; let vnodeDirectives; let shouldUseBlock = ( // dynamic component may resolve to plain elements isDynamicComponent || vnodeTag === TELEPORT || vnodeTag === SUSPENSE || !isComponent && // <svg> and <foreignObject> must be forced into blocks so that block // updates inside get proper isSVG flag at runtime. (#639, #643) // This is technically web-specific, but splitting the logic out of core // leads to too much unnecessary complexity. (tag === "svg" || tag === "foreignObject" || tag === "math") ); if (props.length > 0) { const propsBuildResult = buildProps( node, context, void 0, isComponent, isDynamicComponent ); vnodeProps = propsBuildResult.props; patchFlag = propsBuildResult.patchFlag; dynamicPropNames = propsBuildResult.dynamicPropNames; const directives = propsBuildResult.directives; vnodeDirectives = directives && directives.length ? createArrayExpression( directives.map((dir) => buildDirectiveArgs(dir, context)) ) : void 0; if (propsBuildResult.shouldUseBlock) { shouldUseBlock = true; } } if (node.children.length > 0) { if (vnodeTag === KEEP_ALIVE) { shouldUseBlock = true; patchFlag |= 1024; if (node.children.length > 1) { context.onError( createCompilerError(46, { start: node.children[0].loc.start, end: node.children[node.children.length - 1].loc.end, source: "" }) ); } } const shouldBuildAsSlots = isComponent && // Teleport is not a real component and has dedicated runtime handling vnodeTag !== TELEPORT && // explained above. vnodeTag !== KEEP_ALIVE; if (shouldBuildAsSlots) { const { slots, hasDynamicSlots } = buildSlots(node, context); vnodeChildren = slots; if (hasDynamicSlots) { patchFlag |= 1024; } } else if (node.children.length === 1 && vnodeTag !== TELEPORT) { const child = node.children[0]; const type = child.type; const hasDynamicTextChild = type === 5 || type === 8; if (hasDynamicTextChild && getConstantType(child, context) === 0) { patchFlag |= 1; } if (hasDynamicTextChild || type === 2) { vnodeChildren = child; } else { vnodeChildren = node.children; } } else { vnodeChildren = node.children; } } if (dynamicPropNames && dynamicPropNames.length) { vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames); } node.codegenNode = createVNodeCall( context, vnodeTag, vnodeProps, vnodeChildren, patchFlag === 0 ? void 0 : patchFlag, vnodeDynamicProps, vnodeDirectives, !!shouldUseBlock, false, isComponent, node.loc ); }; }; function resolveComponentType(node, context, ssr = false) { let { tag } = node; const isExplicitDynamic = isComponentTag(tag); const isProp = findProp( node, "is", false, true /* allow empty */ ); if (isProp) { if (isExplicitDynamic || isCompatEnabled( "COMPILER_IS_ON_ELEMENT", context )) { let exp; if (isProp.type === 6) { exp = isProp.value && createSimpleExpression(isProp.value.content, true); } else { exp = isProp.exp; if (!exp) { exp = createSimpleExpression(`is`, false, isProp.arg.loc); { exp = isProp.exp = processExpression(exp, context); } } } if (exp) { return createCallExpression(context.helper(RESOLVE_DYNAMIC_COMPONENT), [ exp ]); } } else if (isProp.type === 6 && isProp.value.content.startsWith("vue:")) { tag = isProp.value.content.slice(4); } } const builtIn = isCoreComponent(tag) || context.isBuiltInComponent(tag); if (builtIn) { if (!ssr) context.helper(builtIn); return builtIn; } { const fromSetup = resolveSetupReference(tag, context); if (fromSetup) { return fromSetup; } const dotIndex = tag.indexOf("."); if (dotIndex > 0) { const ns = resolveSetupReference(tag.slice(0, dotIndex), context); if (ns) { return ns + tag.slice(dotIndex); } } } if (context.selfName && shared.capitalize(shared.camelize(tag)) === context.selfName) { context.helper(RESOLVE_COMPONENT); context.components.add(tag + `__self`); return toValidAssetId(tag, `component`); } context.helper(RESOLVE_COMPONENT); context.components.add(tag); return toValidAssetId(tag, `component`); } function resolveSetupReference(name, context) { const bindings = context.bindingMetadata; if (!bindings || bindings.__isScriptSetup === false) { return; } const camelName = shared.camelize(name); const PascalName = shared.capitalize(camelName); const checkType = (type) => { if (bindings[name] === type) { return name; } if (bindings[camelName] === type) { return camelName; } if (bindings[PascalName] === type) { return PascalName; } }; const fromConst = checkType("setup-const") || checkType("setup-reactive-const") || checkType("literal-const"); if (fromConst) { return context.inline ? ( // in inline mode, const setup bindings (e.g. imports) can be used as-is fromConst ) : `$setup[${JSON.stringify(fromConst)}]`; } const fromMaybeRef = checkType("setup-let") || checkType("setup-ref") || checkType("setup-maybe-ref"); if (fromMaybeRef) { return context.inline ? ( // setup scope bindings that may be refs need to be unrefed `${context.helperString(UNREF)}(${fromMaybeRef})` ) : `$setup[${JSON.stringify(fromMaybeRef)}]`; } const fromProps = checkType("props"); if (fromProps) { return `${context.helperString(UNREF)}(${context.inline ? "__props" : "$props"}[${JSON.stringify(fromProps)}])`; } } function buildProps(node, context, props = node.props, isComponent, isDynamicComponent, ssr = false) { const { tag, loc: elementLoc, children } = node; let properties = []; const mergeArgs = []; const runtimeDirectives = []; const hasChildren = children.length > 0; let shouldUseBlock = false; let patchFlag = 0; let hasRef = false; let hasClassBinding = false; let hasStyleBinding = false; let hasHydrationEventBinding = false; let hasDynamicKeys = false; let hasVnodeHook = false; const dynamicPropNames = []; const pushMergeArg = (arg) => { if (properties.length) { mergeArgs.push( createObjectExpression(dedupeProperties(properties), elementLoc) ); properties = []; } if (arg) mergeArgs.push(arg); }; const pushRefVForMarker = () => { if (context.scopes.vFor > 0) { properties.push( createObjectProperty( createSimpleExpression("ref_for", true), createSimpleExpression("true") ) ); } }; const analyzePatchFlag = ({ key, value }) => { if (isStaticExp(key)) { const name = key.content; const isEventHandler = shared.isOn(name); if (isEventHandler && (!isComponent || isDynamicComponent) && // omit the flag for click handlers because hydration gives click // dedicated fast path. name.toLowerCase() !== "onclick" && // omit v-model handlers name !== "onUpdate:modelValue" && // omit onVnodeXXX hooks !shared.isReservedProp(name)) { hasHydrationEventBinding = true; } if (isEventHandler && shared.isReservedProp(name)) { hasVnodeHook = true; } if (isEventHandler && value.type === 14) { value = value.arguments[0]; } if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) { return; } if (name === "ref") { hasRef = true; } else if (name === "class") { hasClassBinding = true; } else if (name === "style") { hasStyleBinding = true; } else if (name !== "key" && !dynamicPropNames.includes(name)) { dynamicPropNames.push(name); } if (isComponent && (name === "class" || name === "style") && !dynamicPropNames.includes(name)) { dynamicPropNames.push(name); } } else { hasDynamicKeys = true; } }; for (let i = 0; i < props.length; i++) { const prop = props[i]; if (prop.type === 6) { const { loc, name, nameLoc, value } = prop; let isStatic = true; if (name === "ref") { hasRef = true; pushRefVForMarker(); if (value && context.inline) { const binding = context.bindingMetadata[value.content]; if (binding === "setup-let" || binding === "setup-ref" || binding === "setup-maybe-ref") { isStatic = false; properties.push( createObjectProperty( createSimpleExpression("ref_key", true), createSimpleExpression(value.content, true, value.loc) ) ); } } } if (name === "is" && (isComponentTag(tag) || value && value.content.startsWith("vue:") || isCompatEnabled( "COMPILER_IS_ON_ELEMENT", context ))) { continue; } properties.push( createObjectProperty( createSimpleExpression(name, true, nameLoc), createSimpleExpression( value ? value.content : "", isStatic, value ? value.loc : loc ) ) ); } else { const { name, arg, exp, loc, modifiers } = prop; const isVBind = name === "bind"; const isVOn = name === "on"; if (name === "slot") { if (!isComponent) { context.onError( createCompilerError(40, loc) ); } continue; } if (name === "once" || name === "memo") { continue; } if (name === "is" || isVBind && isStaticArgOf(arg, "is") && (isComponentTag(tag) || isCompatEnabled( "COMPILER_IS_ON_ELEMENT", context ))) { continue; } if (isVOn && ssr) { continue; } if ( // #938: elements with dynamic keys should be forced into blocks isVBind && isStaticArgOf(arg, "key") || // inline before-update hooks need to force block so that it is invoked // before children isVOn && hasChildren && isStaticArgOf(arg, "vue:before-update") ) { shouldUseBlock = true; } if (isVBind && isStaticArgOf(arg, "ref")) { pushRefVForMarker(); } if (!arg && (isVBind || isVOn)) { hasDynamicKeys = true; if (exp) { if (isVBind) { pushRefVForMarker(); pushMergeArg(); { { const hasOverridableKeys = mergeArgs.some((arg2) => { if (arg2.type === 15) { return arg2.properties.some(({ key }) => { if (key.type !== 4 || !key.isStatic) { return true; } return key.content !== "class" && key.content !== "style" && !shared.isOn(key.content); }); } else { return true; } }); if (hasOverridableKeys) { checkCompatEnabled( "COMPILER_V_BIND_OBJECT_ORDER", context, loc ); } } if (isCompatEnabled( "COMPILER_V_BIND_OBJECT_ORDER", context )) { mergeArgs.unshift(exp); continue; } } mergeArgs.push(exp); } else { pushMergeArg({ type: 14, loc, callee: context.helper(TO_HANDLERS), arguments: isComponent ? [exp] : [exp, `true`] }); } } else { context.onError( createCompilerError( isVBind ? 34 : 35, loc ) ); } continue; } if (isVBind && modifiers.some((mod) => mod.content === "prop")) { patchFlag |= 32; } const directiveTransform = context.directiveTransforms[name]; if (directiveTransform) { const { props: props2, needRuntime } = directiveTransform(prop, node, context); !ssr && props2.forEach(analyzePatchFlag); if (isVOn && arg && !isStaticExp(arg)) { pushMergeArg(createObjectExpression(props2, elementLoc)); } else { properties.push(...props2); } if (needRuntime) { runtimeDirectives.push(prop); if (shared.isSymbol(needRuntime)) { directiveImportMap.set(prop, needRuntime); } } } else if (!shared.isBuiltInDirective(name)) { runtimeDirectives.push(prop); if (hasChildren) { shouldUseBlock = true; } } } } let propsExpression = void 0; if (mergeArgs.length) { pushMergeArg(); if (mergeArgs.length > 1) { propsExpression = createCallExpression( context.helper(MERGE_PROPS), mergeArgs, elementLoc ); } else { propsExpression = mergeArgs[0]; } } else if (properties.length) { propsExpression = createObjectExpression( dedupeProperties(properties), elementLoc ); } if (hasDynamicKeys) { patchFlag |= 16; } else { if (hasClassBinding && !isComponent) { patchFlag |= 2; } if (hasStyleBinding && !isComponent) { patchFlag |= 4; } if (dynamicPropNames.length) { patchFlag |= 8; } if (hasHydrationEventBinding) { patchFlag |= 32; } } if (!shouldUseBlock && (patchFlag === 0 || patchFlag === 32) && (hasRef || hasVnodeHook || runtimeDirectives.length > 0)) { patchFlag |= 512; } if (!context.inSSR && propsExpression) { switch (propsExpression.type) { case 15: let classKeyIndex = -1; let styleKeyIndex = -1; let hasDynamicKey = false; for (let i = 0; i < propsExpression.properties.length; i++) { const key = propsExpression.properties[i].key; if (isStaticExp(key)) { if (key.content === "class") { classKeyIndex = i; } else if (key.content === "style") { styleKeyIndex = i; } } else if (!key.isHandlerKey) { hasDynamicKey = true; } } const classProp = propsExpression.properties[classKeyIndex]; const styleProp = propsExpression.properties[styleKeyIndex]; if (!hasDynamicKey) { if (classProp && !isStaticExp(classProp.value)) { classProp.value = createCallExpression( context.helper(NORMALIZE_CLASS), [classProp.value] ); } if (styleProp && // the static style is compiled into an object, // so use `hasStyleBinding` to ensure that it is a dynamic style binding (hasStyleBinding || styleProp.value.type === 4 && styleProp.value.content.trim()[0] === `[` || // v-bind:style and style both exist, // v-bind:style with static literal object styleProp.value.type === 17)) { styleProp.value = createCallExpression( context.helper(NORMALIZE_STYLE), [styleProp.value] ); } } else { propsExpression = createCallExpression( context.helper(NORMALIZE_PROPS), [propsExpression] ); } break; case 14: break; default: propsExpression = createCallExpression( context.helper(NORMALIZE_PROPS), [ createCallExpression(context.helper(GUARD_REACTIVE_PROPS), [ propsExpression ]) ] ); break; } } return { props: propsExpression, directives: runtimeDirectives, patchFlag, dynamicPropNames, shouldUseBlock }; } function dedupeProperties(properties) { const knownProps = /* @__PURE__ */ new Map(); const deduped = []; for (let i = 0; i < properties.length; i++) { const prop = properties[i]; if (prop.key.type === 8 || !prop.key.isStatic) { deduped.push(prop); continue; } const name = prop.key.content; const existing = knownProps.get(name); if (existing) { if (name === "style" || name === "class" || shared.isOn(name)) { mergeAsArray(existing, prop); } } else { knownProps.set(name, prop); deduped.push(prop); } } return deduped; } function mergeAsArray(existing, incoming) { if (existing.value.type === 17) { existing.value.elements.push(incoming.value); } else { existing.value = createArrayExpression( [existing.value, incoming.value], existing.loc ); } } function buildDirectiveArgs(dir, context) { const dirArgs = []; const runtime = directiveImportMap.get(dir); if (runtime) { dirArgs.push(context.helperString(runtime)); } else { const fromSetup = resolveSetupReference("v-" + dir.name, context); if (fromSetup) { dirArgs.push(fromSetup); } else { context.helper(RESOLVE_DIRECTIVE); context.directives.add(dir.name); dirArgs.push(toValidAssetId(dir.name, `directive`)); } } const { loc } = dir; if (dir.exp) dirArgs.push(dir.exp); if (dir.arg) { if (!dir.exp) { dirArgs.push(`void 0`); } dirArgs.push(dir.arg); } if (Object.keys(dir.modifiers).length) { if (!dir.arg) { if (!dir.exp) { dirArgs.push(`void 0`); } dirArgs.push(`void 0`); } const trueExpression = createSimpleExpression(`true`, false, loc); dirArgs.push( createObjectExpression( dir.modifiers.map( (modifier) => createObjectProperty(modifier, trueExpression) ), loc ) ); } return createArrayExpression(dirArgs, dir.loc); } function stringifyDynamicPropNames(props) { let propsNamesString = `[`; for (let i = 0, l = props.length; i < l; i++) { propsNamesString += JSON.stringify(props[i]); if (i < l - 1) propsNamesString += ", "; } return propsNamesString + `]`; } function isComponentTag(tag) { return tag === "component" || tag === "Component"; } const transformSlotOutlet = (node, context) => { if (isSlotOutlet(node)) { const { children, loc } = node; const { slotName, slotProps } = processSlotOutlet(node, context); const slotArgs = [ context.prefixIdentifiers ? `_ctx.$slots` : `$slots`, slotName, "{}", "undefined", "true" ]; let expectedLen = 2; if (slotProps) { slotArgs[2] = slotProps; expectedLen = 3; } if (children.length) { slotArgs[3] = createFunctionExpression([], children, false, false, loc); expectedLen = 4; } if (context.scopeId && !context.slotted) { expectedLen = 5; } slotArgs.splice(expectedLen); node.codegenNode = createCallExpression( context.helper(RENDER_SLOT), slotArgs, loc ); } }; function processSlotOutlet(node, context) { let slotName = `"default"`; let slotProps = void 0; const nonNameProps = []; for (let i = 0; i < node.props.length; i++) { const p = node.props[i]; if (p.type === 6) { if (p.value) { if (p.name === "name") { slotName = JSON.stringify(p.value.content); } else { p.name = shared.camelize(p.name); nonNameProps.push(p); } } } else { if (p.name === "bind" && isStaticArgOf(p.arg, "name")) { if (p.exp) { slotName = p.exp; } else if (p.arg && p.arg.type === 4) { const name = shared.camelize(p.arg.content); slotName = p.exp = createSimpleExpression(name, false, p.arg.loc); { slotName = p.exp = processExpression(p.exp, context); } } } else { if (p.name === "bind" && p.arg && isStaticExp(p.arg)) { p.arg.content = shared.camelize(p.arg.content); } nonNameProps.push(p); } } } if (nonNameProps.length > 0) { const { props, directives } = buildProps( node, context, nonNameProps, false, false ); slotProps = props; if (directives.length) { context.onError( createCompilerError( 36, directives[0].loc ) ); } } return { slotName, slotProps }; } const transformOn = (dir, node, context, augmentor) => { const { loc, modifiers, arg } = dir; if (!dir.exp && !modifiers.length) { context.onError(createCompilerError(35, loc)); } let eventName; if (arg.type === 4) { if (arg.isStatic) { let rawName = arg.content; if (rawName.startsWith("vnode")) { context.onError(createCompilerError(51, arg.loc)); } if (rawName.startsWith("vue:")) { rawName = `vnode-${rawName.slice(4)}`; } const eventString = node.tagType !== 0 || rawName.startsWith("vnode") || !/[A-Z]/.test(rawName) ? ( // for non-element and vnode lifecycle event listeners, auto convert // it to camelCase. See issue #2249 shared.toHandlerKey(shared.camelize(rawName)) ) : ( // preserve case for plain element listeners that have uppercase // letters, as these may be custom elements' custom events `on:${rawName}` ); eventName = createSimpleExpression(eventString, true, arg.loc); } else { eventName = createCompoundExpression([ `${context.helperString(TO_HANDLER_KEY)}(`, arg, `)` ]); } } else { eventName = arg; eventName.children.unshift(`${context.helperString(TO_HANDLER_KEY)}(`); eventName.children.push(`)`); } let exp = dir.exp; if (exp && !exp.content.trim()) { exp = void 0; } let shouldCache = context.cacheHandlers && !exp && !context.inVOnce; if (exp) { const isMemberExp = isMemberExpression(exp, context); const isInlineStatement = !(isMemberExp || isFnExpression(exp, context)); const hasMultipleStatements = exp.content.includes(`;`); if (context.prefixIdentifiers) { isInlineStatement && context.addIdentifiers(`$event`); exp = dir.exp = processExpression( exp, context, false, hasMultipleStatements ); isInlineStatement && context.removeIdentifiers(`$event`); shouldCache = context.cacheHandlers && // unnecessary to cache inside v-once !context.inVOnce && // runtime constants don't need to be cached // (this is analyzed by compileScript in SFC <script setup>) !(exp.type === 4 && exp.constType > 0) && // #1541 bail if this is a member exp handler passed to a component - // we need to use the original function to preserve arity, // e.g. <transition> relies on checking cb.length to determine // transition end handling. Inline function is ok since its arity // is preserved even when cached. !(isMemberExp && node.tagType === 1) && // bail if the function references closure variables (v-for, v-slot) // it must be passed fresh to avoid stale values. !hasScopeRef(exp, context.identifiers); if (shouldCache && isMemberExp) { if (exp.type === 4) { exp.content = `${exp.content} && ${exp.content}(...args)`; } else { exp.children = [...exp.children, ` && `, ...exp.children, `(...args)`]; } } } if (isInlineStatement || shouldCache && isMemberExp) { exp = createCompoundExpression([ `${isInlineStatement ? context.isTS ? `($event: any)` : `$event` : `${context.isTS ? ` //@ts-ignore ` : ``}(...args)`} => ${hasMultipleStatements ? `{` : `(`}`, exp, hasMultipleStatements ? `}` : `)` ]); } } let ret = { props: [ createObjectProperty( eventName, exp || createSimpleExpression(`() => {}`, false, loc) ) ] }; if (augmentor) { ret = augmentor(ret); } if (shouldCache) { ret.props[0].value = context.cache(ret.props[0].value); } ret.props.forEach((p) => p.key.isHandlerKey = true); return ret; }; const transformText = (node, context) => { if (node.type === 0 || node.type === 1 || node.type === 11 || node.type === 10) { return () => { const children = node.children; let currentContainer = void 0; let hasText = false; for (let i = 0; i < children.length; i++) { const child = children[i]; if (isText$1(child)) { hasText = true; for (let j = i + 1; j < children.length; j++) { const next = children[j]; if (isText$1(next)) { if (!currentContainer) { currentContainer = children[i] = createCompoundExpression( [child], child.loc ); } currentContainer.children.push(` + `, next); children.splice(j, 1); j--; } else { currentContainer = void 0; break; } } } } if (!hasText || // if this is a plain element with a single text child, leave it // as-is since the runtime has dedicated fast path for this by directly // setting textContent of the element. // for component root it's always normalized anyway. children.length === 1 && (node.type === 0 || node.type === 1 && node.tagType === 0 && // #3756 // custom directives can potentially add DOM elements arbitrarily, // we need to avoid setting textContent of the element at runtime // to avoid accidentally overwriting the DOM elements added // by the user through custom directives. !node.props.find( (p) => p.type === 7 && !context.directiveTransforms[p.name] ) && // in compat mode, <template> tags with no special directives // will be rendered as a fragment so its children must be // converted into vnodes. !(node.tag === "template"))) { return; } for (let i = 0; i < children.length; i++) { const child = children[i]; if (isText$1(child) || child.type === 8) { const callArgs = []; if (child.type !== 2 || child.content !== " ") { callArgs.push(child); } if (!context.ssr && getConstantType(child, context) === 0) { callArgs.push( 1 + (` /* ${shared.PatchFlagNames[1]} */` ) ); } children[i] = { type: 12, content: child, loc: child.loc, codegenNode: createCallExpression( context.helper(CREATE_TEXT), callArgs ) }; } } }; } }; const seen$1 = /* @__PURE__ */ new WeakSet(); const transformOnce = (node, context) => { if (node.type === 1 && findDir(node, "once", true)) { if (seen$1.has(node) || context.inVOnce || context.inSSR) { return; } seen$1.add(node); context.inVOnce = true; context.helper(SET_BLOCK_TRACKING); return () => { context.inVOnce = false; const cur = context.currentNode; if (cur.codegenNode) { cur.codegenNode = context.cache( cur.codegenNode, true, true ); } }; } }; const transformModel = (dir, node, context) => { const { exp, arg } = dir; if (!exp) { context.onError( createCompilerError(41, dir.loc) ); return createTransformProps(); } const rawExp = exp.loc.source.trim(); const expString = exp.type === 4 ? exp.content : rawExp; const bindingType = context.bindingMetadata[rawExp]; if (bindingType === "props" || bindingType === "props-aliased") { context.onError(createCompilerError(44, exp.loc)); return createTransformProps(); } const maybeRef = context.inline && (bindingType === "setup-let" || bindingType === "setup-ref" || bindingType === "setup-maybe-ref"); if (!expString.trim() || !isMemberExpression(exp, context) && !maybeRef) { context.onError( createCompilerError(42, exp.loc) ); return createTransformProps(); } if (context.prefixIdentifiers && isSimpleIdentifier(expString) && context.identifiers[expString]) { context.onError( createCompilerError(43, exp.loc) ); return createTransformProps(); } const propName = arg ? arg : createSimpleExpression("modelValue", true); const eventName = arg ? isStaticExp(arg) ? `onUpdate:${shared.camelize(arg.content)}` : createCompoundExpression(['"onUpdate:" + ', arg]) : `onUpdate:modelValue`; let assignmentExp; const eventArg = context.isTS ? `($event: any)` : `$event`; if (maybeRef) { if (bindingType === "setup-ref") { assignmentExp = createCompoundExpression([ `${eventArg} => ((`, createSimpleExpression(rawExp, false, exp.loc), `).value = $event)` ]); } else { const altAssignment = bindingType === "setup-let" ? `${rawExp} = $event` : `null`; assignmentExp = createCompoundExpression([ `${eventArg} => (${context.helperString(IS_REF)}(${rawExp}) ? (`, createSimpleExpression(rawExp, false, exp.loc), `).value = $event : ${altAssignment})` ]); } } else { assignmentExp = createCompoundExpression([ `${eventArg} => ((`, exp, `) = $event)` ]); } const props = [ // modelValue: foo createObjectProperty(propName, dir.exp), // "onUpdate:modelValue": $event => (foo = $event) createObjectProperty(eventName, assignmentExp) ]; if (context.prefixIdentifiers && !context.inVOnce && context.cacheHandlers && !hasScopeRef(exp, context.identifiers)) { props[1].value = context.cache(props[1].value); } if (dir.modifiers.length && node.tagType === 1) { const modifiers = dir.modifiers.map((m) => m.content).map((m) => (isSimpleIdentifier(m) ? m : JSON.stringify(m)) + `: true`).join(`, `); const modifiersKey = arg ? isStaticExp(arg) ? `${arg.content}Modifiers` : createCompoundExpression([arg, ' + "Modifiers"']) : `modelModifiers`; props.push( createObjectProperty( modifiersKey, createSimpleExpression( `{ ${modifiers} }`, false, dir.loc, 2 ) ) ); } return createTransformProps(props); }; function createTransformProps(props = []) { return { props }; } const validDivisionCharRE = /[\w).+\-_$\]]/; const transformFilter = (node, context) => { if (!isCompatEnabled("COMPILER_FILTERS", context)) { return; } if (node.type === 5) { rewriteFilter(node.content, context); } else if (node.type === 1) { node.props.forEach((prop) => { if (prop.type === 7 && prop.name !== "for" && prop.exp) { rewriteFilter(prop.exp, context); } }); } }; function rewriteFilter(node, context) { if (node.type === 4) { parseFilter(node, context); } else { for (let i = 0; i < node.children.length; i++) { const child = node.children[i]; if (typeof child !== "object") continue; if (child.type === 4) { parseFilter(child, context); } else if (child.type === 8) { rewriteFilter(node, context); } else if (child.type === 5) { rewriteFilter(child.content, context); } } } } function parseFilter(node, context) { const exp = node.content; let inSingle = false; let inDouble = false; let inTemplateString = false; let inRegex = false; let curly = 0; let square = 0; let paren = 0; let lastFilterIndex = 0; let c, prev, i, expression, filters = []; for (i = 0; i < exp.length; i++) { prev = c; c = exp.charCodeAt(i); if (inSingle) { if (c === 39 && prev !== 92) inSingle = false; } else if (inDouble) { if (c === 34 && prev !== 92) inDouble = false; } else if (inTemplateString) { if (c === 96 && prev !== 92) inTemplateString = false; } else if (inRegex) { if (c === 47 && prev !== 92) inRegex = false; } else if (c === 124 && // pipe exp.charCodeAt(i + 1) !== 124 && exp.charCodeAt(i - 1) !== 124 && !curly && !square && !paren) { if (expression === void 0) { lastFilterIndex = i + 1; expression = exp.slice(0, i).trim(); } else { pushFilter(); } } else { switch (c) { case 34: inDouble = true; break; // " case 39: inSingle = true; break; // ' case 96: inTemplateString = true; break; // ` case 40: paren++; break; // ( case 41: paren--; break; // ) case 91: square++; break; // [ case 93: square--; break; // ] case 123: curly++; break; // { case 125: curly--; break; } if (c === 47) { let j = i - 1; let p; for (; j >= 0; j--) { p = exp.charAt(j); if (p !== " ") break; } if (!p || !validDivisionCharRE.test(p)) { inRegex = true; } } } } if (expression === void 0) { expression = exp.slice(0, i).trim(); } else if (lastFilterIndex !== 0) { pushFilter(); } function pushFilter() { filters.push(exp.slice(lastFilterIndex, i).trim()); lastFilterIndex = i + 1; } if (filters.length) { warnDeprecation( "COMPILER_FILTERS", context, node.loc ); for (i = 0; i < filters.length; i++) { expression = wrapFilter(expression, filters[i], context); } node.content = expression; node.ast = void 0; } } function wrapFilter(exp, filter, context) { context.helper(RESOLVE_FILTER); const i = filter.indexOf("("); if (i < 0) { context.filters.add(filter); return `${toValidAssetId(filter, "filter")}(${exp})`; } else { const name = filter.slice(0, i); const args = filter.slice(i + 1); context.filters.add(name); return `${toValidAssetId(name, "filter")}(${exp}${args !== ")" ? "," + args : args}`; } } const seen = /* @__PURE__ */ new WeakSet(); const transformMemo = (node, context) => { if (node.type === 1) { const dir = findDir(node, "memo"); if (!dir || seen.has(node)) { return; } seen.add(node); return () => { const codegenNode = node.codegenNode || context.currentNode.codegenNode; if (codegenNode && codegenNode.type === 13) { if (node.tagType !== 1) { convertToBlock(codegenNode, context); } node.codegenNode = createCallExpression(context.helper(WITH_MEMO), [ dir.exp, createFunctionExpression(void 0, codegenNode), `_cache`, String(context.cached.length) ]); context.cached.push(null); } }; } }; function getBaseTransformPreset(prefixIdentifiers) { return [ [ transformOnce, transformIf, transformMemo, transformFor, ...[transformFilter] , ...prefixIdentifiers ? [ // order is important trackVForSlotScopes, transformExpression ] : [], transformSlotOutlet, transformElement, trackSlotScopes, transformText ], { on: transformOn, bind: transformBind, model: transformModel } ]; } function baseCompile(source, options = {}) { const onError = options.onError || defaultOnError; const isModuleMode = options.mode === "module"; const prefixIdentifiers = options.prefixIdentifiers === true || isModuleMode; if (!prefixIdentifiers && options.cacheHandlers) { onError(createCompilerError(49)); } if (options.scopeId && !isModuleMode) { onError(createCompilerError(50)); } const resolvedOptions = shared.extend({}, options, { prefixIdentifiers }); const ast = shared.isString(source) ? baseParse(source, resolvedOptions) : source; const [nodeTransforms, directiveTransforms] = getBaseTransformPreset(prefixIdentifiers); if (options.isTS) { const { expressionPlugins } = options; if (!expressionPlugins || !expressionPlugins.includes("typescript")) { options.expressionPlugins = [...expressionPlugins || [], "typescript"]; } } transform( ast, shared.extend({}, resolvedOptions, { nodeTransforms: [ ...nodeTransforms, ...options.nodeTransforms || [] // user transforms ], directiveTransforms: shared.extend( {}, directiveTransforms, options.directiveTransforms || {} // user transforms ) }) ); return generate(ast, resolvedOptions); } const BindingTypes = { "DATA": "data", "PROPS": "props", "PROPS_ALIASED": "props-aliased", "SETUP_LET": "setup-let", "SETUP_CONST": "setup-const", "SETUP_REACTIVE_CONST": "setup-reactive-const", "SETUP_MAYBE_REF": "setup-maybe-ref", "SETUP_REF": "setup-ref", "OPTIONS": "options", "LITERAL_CONST": "literal-const" }; const noopDirectiveTransform = () => ({ props: [] }); exports.generateCodeFrame = shared.generateCodeFrame; exports.BASE_TRANSITION = BASE_TRANSITION; exports.BindingTypes = BindingTypes; exports.CAMELIZE = CAMELIZE; exports.CAPITALIZE = CAPITALIZE; exports.CREATE_BLOCK = CREATE_BLOCK; exports.CREATE_COMMENT = CREATE_COMMENT; exports.CREATE_ELEMENT_BLOCK = CREATE_ELEMENT_BLOCK; exports.CREATE_ELEMENT_VNODE = CREATE_ELEMENT_VNODE; exports.CREATE_SLOTS = CREATE_SLOTS; exports.CREATE_STATIC = CREATE_STATIC; exports.CREATE_TEXT = CREATE_TEXT; exports.CREATE_VNODE = CREATE_VNODE; exports.CompilerDeprecationTypes = CompilerDeprecationTypes; exports.ConstantTypes = ConstantTypes; exports.ElementTypes = ElementTypes; exports.ErrorCodes = ErrorCodes; exports.FRAGMENT = FRAGMENT; exports.GUARD_REACTIVE_PROPS = GUARD_REACTIVE_PROPS; exports.IS_MEMO_SAME = IS_MEMO_SAME; exports.IS_REF = IS_REF; exports.KEEP_ALIVE = KEEP_ALIVE; exports.MERGE_PROPS = MERGE_PROPS; exports.NORMALIZE_CLASS = NORMALIZE_CLASS; exports.NORMALIZE_PROPS = NORMALIZE_PROPS; exports.NORMALIZE_STYLE = NORMALIZE_STYLE; exports.Namespaces = Namespaces; exports.NodeTypes = NodeTypes; exports.OPEN_BLOCK = OPEN_BLOCK; exports.POP_SCOPE_ID = POP_SCOPE_ID; exports.PUSH_SCOPE_ID = PUSH_SCOPE_ID; exports.RENDER_LIST = RENDER_LIST; exports.RENDER_SLOT = RENDER_SLOT; exports.RESOLVE_COMPONENT = RESOLVE_COMPONENT; exports.RESOLVE_DIRECTIVE = RESOLVE_DIRECTIVE; exports.RESOLVE_DYNAMIC_COMPONENT = RESOLVE_DYNAMIC_COMPONENT; exports.RESOLVE_FILTER = RESOLVE_FILTER; exports.SET_BLOCK_TRACKING = SET_BLOCK_TRACKING; exports.SUSPENSE = SUSPENSE; exports.TELEPORT = TELEPORT; exports.TO_DISPLAY_STRING = TO_DISPLAY_STRING; exports.TO_HANDLERS = TO_HANDLERS; exports.TO_HANDLER_KEY = TO_HANDLER_KEY; exports.TS_NODE_TYPES = TS_NODE_TYPES; exports.UNREF = UNREF; exports.WITH_CTX = WITH_CTX; exports.WITH_DIRECTIVES = WITH_DIRECTIVES; exports.WITH_MEMO = WITH_MEMO; exports.advancePositionWithClone = advancePositionWithClone; exports.advancePositionWithMutation = advancePositionWithMutation; exports.assert = assert; exports.baseCompile = baseCompile; exports.baseParse = baseParse; exports.buildDirectiveArgs = buildDirectiveArgs; exports.buildProps = buildProps; exports.buildSlots = buildSlots; exports.checkCompatEnabled = checkCompatEnabled; exports.convertToBlock = convertToBlock; exports.createArrayExpression = createArrayExpression; exports.createAssignmentExpression = createAssignmentExpression; exports.createBlockStatement = createBlockStatement; exports.createCacheExpression = createCacheExpression; exports.createCallExpression = createCallExpression; exports.createCompilerError = createCompilerError; exports.createCompoundExpression = createCompoundExpression; exports.createConditionalExpression = createConditionalExpression; exports.createForLoopParams = createForLoopParams; exports.createFunctionExpression = createFunctionExpression; exports.createIfStatement = createIfStatement; exports.createInterpolation = createInterpolation; exports.createObjectExpression = createObjectExpression; exports.createObjectProperty = createObjectProperty; exports.createReturnStatement = createReturnStatement; exports.createRoot = createRoot; exports.createSequenceExpression = createSequenceExpression; exports.createSimpleExpression = createSimpleExpression; exports.createStructuralDirectiveTransform = createStructuralDirectiveTransform; exports.createTemplateLiteral = createTemplateLiteral; exports.createTransformContext = createTransformContext; exports.createVNodeCall = createVNodeCall; exports.errorMessages = errorMessages; exports.extractIdentifiers = extractIdentifiers; exports.findDir = findDir; exports.findProp = findProp; exports.forAliasRE = forAliasRE; exports.generate = generate; exports.getBaseTransformPreset = getBaseTransformPreset; exports.getConstantType = getConstantType; exports.getMemoedVNodeCall = getMemoedVNodeCall; exports.getVNodeBlockHelper = getVNodeBlockHelper; exports.getVNodeHelper = getVNodeHelper; exports.hasDynamicKeyVBind = hasDynamicKeyVBind; exports.hasScopeRef = hasScopeRef; exports.helperNameMap = helperNameMap; exports.injectProp = injectProp; exports.isCoreComponent = isCoreComponent; exports.isFnExpression = isFnExpression; exports.isFnExpressionBrowser = isFnExpressionBrowser; exports.isFnExpressionNode = isFnExpressionNode; exports.isFunctionType = isFunctionType; exports.isInDestructureAssignment = isInDestructureAssignment; exports.isInNewExpression = isInNewExpression; exports.isMemberExpression = isMemberExpression; exports.isMemberExpressionBrowser = isMemberExpressionBrowser; exports.isMemberExpressionNode = isMemberExpressionNode; exports.isReferencedIdentifier = isReferencedIdentifier; exports.isSimpleIdentifier = isSimpleIdentifier; exports.isSlotOutlet = isSlotOutlet; exports.isStaticArgOf = isStaticArgOf; exports.isStaticExp = isStaticExp; exports.isStaticProperty = isStaticProperty; exports.isStaticPropertyKey = isStaticPropertyKey; exports.isTemplateNode = isTemplateNode; exports.isText = isText$1; exports.isVSlot = isVSlot; exports.locStub = locStub; exports.noopDirectiveTransform = noopDirectiveTransform; exports.processExpression = processExpression; exports.processFor = processFor; exports.processIf = processIf; exports.processSlotOutlet = processSlotOutlet; exports.registerRuntimeHelpers = registerRuntimeHelpers; exports.resolveComponentType = resolveComponentType; exports.stringifyExpression = stringifyExpression; exports.toValidAssetId = toValidAssetId; exports.trackSlotScopes = trackSlotScopes; exports.trackVForSlotScopes = trackVForSlotScopes; exports.transform = transform; exports.transformBind = transformBind; exports.transformElement = transformElement; exports.transformExpression = transformExpression; exports.transformModel = transformModel; exports.transformOn = transformOn; exports.traverseNode = traverseNode; exports.unwrapTSNode = unwrapTSNode; exports.walkBlockDeclarations = walkBlockDeclarations; exports.walkFunctionParams = walkFunctionParams; exports.walkIdentifiers = walkIdentifiers; exports.warnDeprecation = warnDeprecation; /***/ }), /***/ "./node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.js": /*!*****************************************************************!*\ !*** ./node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.js ***! \*****************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * @vue/compiler-dom v3.5.13 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/ Object.defineProperty(exports, "__esModule", ({ value: true })); var compilerCore = __webpack_require__(/*! @vue/compiler-core */ "./node_modules/@vue/compiler-core/dist/compiler-core.cjs.js"); var shared = __webpack_require__(/*! @vue/shared */ "./node_modules/@vue/shared/dist/shared.cjs.js"); const V_MODEL_RADIO = Symbol(`vModelRadio` ); const V_MODEL_CHECKBOX = Symbol( `vModelCheckbox` ); const V_MODEL_TEXT = Symbol(`vModelText` ); const V_MODEL_SELECT = Symbol( `vModelSelect` ); const V_MODEL_DYNAMIC = Symbol( `vModelDynamic` ); const V_ON_WITH_MODIFIERS = Symbol( `vOnModifiersGuard` ); const V_ON_WITH_KEYS = Symbol( `vOnKeysGuard` ); const V_SHOW = Symbol(`vShow` ); const TRANSITION = Symbol(`Transition` ); const TRANSITION_GROUP = Symbol( `TransitionGroup` ); compilerCore.registerRuntimeHelpers({ [V_MODEL_RADIO]: `vModelRadio`, [V_MODEL_CHECKBOX]: `vModelCheckbox`, [V_MODEL_TEXT]: `vModelText`, [V_MODEL_SELECT]: `vModelSelect`, [V_MODEL_DYNAMIC]: `vModelDynamic`, [V_ON_WITH_MODIFIERS]: `withModifiers`, [V_ON_WITH_KEYS]: `withKeys`, [V_SHOW]: `vShow`, [TRANSITION]: `Transition`, [TRANSITION_GROUP]: `TransitionGroup` }); const parserOptions = { parseMode: "html", isVoidTag: shared.isVoidTag, isNativeTag: (tag) => shared.isHTMLTag(tag) || shared.isSVGTag(tag) || shared.isMathMLTag(tag), isPreTag: (tag) => tag === "pre", isIgnoreNewlineTag: (tag) => tag === "pre" || tag === "textarea", decodeEntities: void 0, isBuiltInComponent: (tag) => { if (tag === "Transition" || tag === "transition") { return TRANSITION; } else if (tag === "TransitionGroup" || tag === "transition-group") { return TRANSITION_GROUP; } }, // https://html.spec.whatwg.org/multipage/parsing.html#tree-construction-dispatcher getNamespace(tag, parent, rootNamespace) { let ns = parent ? parent.ns : rootNamespace; if (parent && ns === 2) { if (parent.tag === "annotation-xml") { if (tag === "svg") { return 1; } if (parent.props.some( (a) => a.type === 6 && a.name === "encoding" && a.value != null && (a.value.content === "text/html" || a.value.content === "application/xhtml+xml") )) { ns = 0; } } else if (/^m(?:[ions]|text)$/.test(parent.tag) && tag !== "mglyph" && tag !== "malignmark") { ns = 0; } } else if (parent && ns === 1) { if (parent.tag === "foreignObject" || parent.tag === "desc" || parent.tag === "title") { ns = 0; } } if (ns === 0) { if (tag === "svg") { return 1; } if (tag === "math") { return 2; } } return ns; } }; const transformStyle = (node) => { if (node.type === 1) { node.props.forEach((p, i) => { if (p.type === 6 && p.name === "style" && p.value) { node.props[i] = { type: 7, name: `bind`, arg: compilerCore.createSimpleExpression(`style`, true, p.loc), exp: parseInlineCSS(p.value.content, p.loc), modifiers: [], loc: p.loc }; } }); } }; const parseInlineCSS = (cssText, loc) => { const normalized = shared.parseStringStyle(cssText); return compilerCore.createSimpleExpression( JSON.stringify(normalized), false, loc, 3 ); }; function createDOMCompilerError(code, loc) { return compilerCore.createCompilerError( code, loc, DOMErrorMessages ); } const DOMErrorCodes = { "X_V_HTML_NO_EXPRESSION": 53, "53": "X_V_HTML_NO_EXPRESSION", "X_V_HTML_WITH_CHILDREN": 54, "54": "X_V_HTML_WITH_CHILDREN", "X_V_TEXT_NO_EXPRESSION": 55, "55": "X_V_TEXT_NO_EXPRESSION", "X_V_TEXT_WITH_CHILDREN": 56, "56": "X_V_TEXT_WITH_CHILDREN", "X_V_MODEL_ON_INVALID_ELEMENT": 57, "57": "X_V_MODEL_ON_INVALID_ELEMENT", "X_V_MODEL_ARG_ON_ELEMENT": 58, "58": "X_V_MODEL_ARG_ON_ELEMENT", "X_V_MODEL_ON_FILE_INPUT_ELEMENT": 59, "59": "X_V_MODEL_ON_FILE_INPUT_ELEMENT", "X_V_MODEL_UNNECESSARY_VALUE": 60, "60": "X_V_MODEL_UNNECESSARY_VALUE", "X_V_SHOW_NO_EXPRESSION": 61, "61": "X_V_SHOW_NO_EXPRESSION", "X_TRANSITION_INVALID_CHILDREN": 62, "62": "X_TRANSITION_INVALID_CHILDREN", "X_IGNORED_SIDE_EFFECT_TAG": 63, "63": "X_IGNORED_SIDE_EFFECT_TAG", "__EXTEND_POINT__": 64, "64": "__EXTEND_POINT__" }; const DOMErrorMessages = { [53]: `v-html is missing expression.`, [54]: `v-html will override element children.`, [55]: `v-text is missing expression.`, [56]: `v-text will override element children.`, [57]: `v-model can only be used on <input>, <textarea> and <select> elements.`, [58]: `v-model argument is not supported on plain elements.`, [59]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`, [60]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`, [61]: `v-show is missing expression.`, [62]: `<Transition> expects exactly one child element or component.`, [63]: `Tags with side effect (<script> and <style>) are ignored in client component templates.` }; const transformVHtml = (dir, node, context) => { const { exp, loc } = dir; if (!exp) { context.onError( createDOMCompilerError(53, loc) ); } if (node.children.length) { context.onError( createDOMCompilerError(54, loc) ); node.children.length = 0; } return { props: [ compilerCore.createObjectProperty( compilerCore.createSimpleExpression(`innerHTML`, true, loc), exp || compilerCore.createSimpleExpression("", true) ) ] }; }; const transformVText = (dir, node, context) => { const { exp, loc } = dir; if (!exp) { context.onError( createDOMCompilerError(55, loc) ); } if (node.children.length) { context.onError( createDOMCompilerError(56, loc) ); node.children.length = 0; } return { props: [ compilerCore.createObjectProperty( compilerCore.createSimpleExpression(`textContent`, true), exp ? compilerCore.getConstantType(exp, context) > 0 ? exp : compilerCore.createCallExpression( context.helperString(compilerCore.TO_DISPLAY_STRING), [exp], loc ) : compilerCore.createSimpleExpression("", true) ) ] }; }; const transformModel = (dir, node, context) => { const baseResult = compilerCore.transformModel(dir, node, context); if (!baseResult.props.length || node.tagType === 1) { return baseResult; } if (dir.arg) { context.onError( createDOMCompilerError( 58, dir.arg.loc ) ); } function checkDuplicatedValue() { const value = compilerCore.findDir(node, "bind"); if (value && compilerCore.isStaticArgOf(value.arg, "value")) { context.onError( createDOMCompilerError( 60, value.loc ) ); } } const { tag } = node; const isCustomElement = context.isCustomElement(tag); if (tag === "input" || tag === "textarea" || tag === "select" || isCustomElement) { let directiveToUse = V_MODEL_TEXT; let isInvalidType = false; if (tag === "input" || isCustomElement) { const type = compilerCore.findProp(node, `type`); if (type) { if (type.type === 7) { directiveToUse = V_MODEL_DYNAMIC; } else if (type.value) { switch (type.value.content) { case "radio": directiveToUse = V_MODEL_RADIO; break; case "checkbox": directiveToUse = V_MODEL_CHECKBOX; break; case "file": isInvalidType = true; context.onError( createDOMCompilerError( 59, dir.loc ) ); break; default: checkDuplicatedValue(); break; } } } else if (compilerCore.hasDynamicKeyVBind(node)) { directiveToUse = V_MODEL_DYNAMIC; } else { checkDuplicatedValue(); } } else if (tag === "select") { directiveToUse = V_MODEL_SELECT; } else { checkDuplicatedValue(); } if (!isInvalidType) { baseResult.needRuntime = context.helper(directiveToUse); } } else { context.onError( createDOMCompilerError( 57, dir.loc ) ); } baseResult.props = baseResult.props.filter( (p) => !(p.key.type === 4 && p.key.content === "modelValue") ); return baseResult; }; const isEventOptionModifier = /* @__PURE__ */ shared.makeMap(`passive,once,capture`); const isNonKeyModifier = /* @__PURE__ */ shared.makeMap( // event propagation management `stop,prevent,self,ctrl,shift,alt,meta,exact,middle` ); const maybeKeyModifier = /* @__PURE__ */ shared.makeMap("left,right"); const isKeyboardEvent = /* @__PURE__ */ shared.makeMap(`onkeyup,onkeydown,onkeypress`); const resolveModifiers = (key, modifiers, context, loc) => { const keyModifiers = []; const nonKeyModifiers = []; const eventOptionModifiers = []; for (let i = 0; i < modifiers.length; i++) { const modifier = modifiers[i].content; if (modifier === "native" && compilerCore.checkCompatEnabled( "COMPILER_V_ON_NATIVE", context, loc )) { eventOptionModifiers.push(modifier); } else if (isEventOptionModifier(modifier)) { eventOptionModifiers.push(modifier); } else { if (maybeKeyModifier(modifier)) { if (compilerCore.isStaticExp(key)) { if (isKeyboardEvent(key.content.toLowerCase())) { keyModifiers.push(modifier); } else { nonKeyModifiers.push(modifier); } } else { keyModifiers.push(modifier); nonKeyModifiers.push(modifier); } } else { if (isNonKeyModifier(modifier)) { nonKeyModifiers.push(modifier); } else { keyModifiers.push(modifier); } } } } return { keyModifiers, nonKeyModifiers, eventOptionModifiers }; }; const transformClick = (key, event) => { const isStaticClick = compilerCore.isStaticExp(key) && key.content.toLowerCase() === "onclick"; return isStaticClick ? compilerCore.createSimpleExpression(event, true) : key.type !== 4 ? compilerCore.createCompoundExpression([ `(`, key, `) === "onClick" ? "${event}" : (`, key, `)` ]) : key; }; const transformOn = (dir, node, context) => { return compilerCore.transformOn(dir, node, context, (baseResult) => { const { modifiers } = dir; if (!modifiers.length) return baseResult; let { key, value: handlerExp } = baseResult.props[0]; const { keyModifiers, nonKeyModifiers, eventOptionModifiers } = resolveModifiers(key, modifiers, context, dir.loc); if (nonKeyModifiers.includes("right")) { key = transformClick(key, `onContextmenu`); } if (nonKeyModifiers.includes("middle")) { key = transformClick(key, `onMouseup`); } if (nonKeyModifiers.length) { handlerExp = compilerCore.createCallExpression(context.helper(V_ON_WITH_MODIFIERS), [ handlerExp, JSON.stringify(nonKeyModifiers) ]); } if (keyModifiers.length && // if event name is dynamic, always wrap with keys guard (!compilerCore.isStaticExp(key) || isKeyboardEvent(key.content.toLowerCase()))) { handlerExp = compilerCore.createCallExpression(context.helper(V_ON_WITH_KEYS), [ handlerExp, JSON.stringify(keyModifiers) ]); } if (eventOptionModifiers.length) { const modifierPostfix = eventOptionModifiers.map(shared.capitalize).join(""); key = compilerCore.isStaticExp(key) ? compilerCore.createSimpleExpression(`${key.content}${modifierPostfix}`, true) : compilerCore.createCompoundExpression([`(`, key, `) + "${modifierPostfix}"`]); } return { props: [compilerCore.createObjectProperty(key, handlerExp)] }; }); }; const transformShow = (dir, node, context) => { const { exp, loc } = dir; if (!exp) { context.onError( createDOMCompilerError(61, loc) ); } return { props: [], needRuntime: context.helper(V_SHOW) }; }; const transformTransition = (node, context) => { if (node.type === 1 && node.tagType === 1) { const component = context.isBuiltInComponent(node.tag); if (component === TRANSITION) { return () => { if (!node.children.length) { return; } if (hasMultipleChildren(node)) { context.onError( createDOMCompilerError( 62, { start: node.children[0].loc.start, end: node.children[node.children.length - 1].loc.end, source: "" } ) ); } const child = node.children[0]; if (child.type === 1) { for (const p of child.props) { if (p.type === 7 && p.name === "show") { node.props.push({ type: 6, name: "persisted", nameLoc: node.loc, value: void 0, loc: node.loc }); } } } }; } } }; function hasMultipleChildren(node) { const children = node.children = node.children.filter( (c) => c.type !== 3 && !(c.type === 2 && !c.content.trim()) ); const child = children[0]; return children.length !== 1 || child.type === 11 || child.type === 9 && child.branches.some(hasMultipleChildren); } const expReplaceRE = /__VUE_EXP_START__(.*?)__VUE_EXP_END__/g; const stringifyStatic = (children, context, parent) => { if (context.scopes.vSlot > 0) { return; } const isParentCached = parent.type === 1 && parent.codegenNode && parent.codegenNode.type === 13 && parent.codegenNode.children && !shared.isArray(parent.codegenNode.children) && parent.codegenNode.children.type === 20; let nc = 0; let ec = 0; const currentChunk = []; const stringifyCurrentChunk = (currentIndex) => { if (nc >= 20 || ec >= 5) { const staticCall = compilerCore.createCallExpression(context.helper(compilerCore.CREATE_STATIC), [ JSON.stringify( currentChunk.map((node) => stringifyNode(node, context)).join("") ).replace(expReplaceRE, `" + $1 + "`), // the 2nd argument indicates the number of DOM nodes this static vnode // will insert / hydrate String(currentChunk.length) ]); const deleteCount = currentChunk.length - 1; if (isParentCached) { children.splice( currentIndex - currentChunk.length, currentChunk.length, // @ts-expect-error staticCall ); } else { currentChunk[0].codegenNode.value = staticCall; if (currentChunk.length > 1) { children.splice(currentIndex - currentChunk.length + 1, deleteCount); const cacheIndex = context.cached.indexOf( currentChunk[currentChunk.length - 1].codegenNode ); if (cacheIndex > -1) { for (let i2 = cacheIndex; i2 < context.cached.length; i2++) { const c = context.cached[i2]; if (c) c.index -= deleteCount; } context.cached.splice(cacheIndex - deleteCount + 1, deleteCount); } } } return deleteCount; } return 0; }; let i = 0; for (; i < children.length; i++) { const child = children[i]; const isCached = isParentCached || getCachedNode(child); if (isCached) { const result = analyzeNode(child); if (result) { nc += result[0]; ec += result[1]; currentChunk.push(child); continue; } } i -= stringifyCurrentChunk(i); nc = 0; ec = 0; currentChunk.length = 0; } stringifyCurrentChunk(i); }; const getCachedNode = (node) => { if ((node.type === 1 && node.tagType === 0 || node.type === 12) && node.codegenNode && node.codegenNode.type === 20) { return node.codegenNode; } }; const dataAriaRE = /^(data|aria)-/; const isStringifiableAttr = (name, ns) => { return (ns === 0 ? shared.isKnownHtmlAttr(name) : ns === 1 ? shared.isKnownSvgAttr(name) : ns === 2 ? shared.isKnownMathMLAttr(name) : false) || dataAriaRE.test(name); }; const isNonStringifiable = /* @__PURE__ */ shared.makeMap( `caption,thead,tr,th,tbody,td,tfoot,colgroup,col` ); function analyzeNode(node) { if (node.type === 1 && isNonStringifiable(node.tag)) { return false; } if (node.type === 12) { return [1, 0]; } let nc = 1; let ec = node.props.length > 0 ? 1 : 0; let bailed = false; const bail = () => { bailed = true; return false; }; function walk(node2) { const isOptionTag = node2.tag === "option" && node2.ns === 0; for (let i = 0; i < node2.props.length; i++) { const p = node2.props[i]; if (p.type === 6 && !isStringifiableAttr(p.name, node2.ns)) { return bail(); } if (p.type === 7 && p.name === "bind") { if (p.arg && (p.arg.type === 8 || p.arg.isStatic && !isStringifiableAttr(p.arg.content, node2.ns))) { return bail(); } if (p.exp && (p.exp.type === 8 || p.exp.constType < 3)) { return bail(); } if (isOptionTag && compilerCore.isStaticArgOf(p.arg, "value") && p.exp && !p.exp.isStatic) { return bail(); } } } for (let i = 0; i < node2.children.length; i++) { nc++; const child = node2.children[i]; if (child.type === 1) { if (child.props.length > 0) { ec++; } walk(child); if (bailed) { return false; } } } return true; } return walk(node) ? [nc, ec] : false; } function stringifyNode(node, context) { if (shared.isString(node)) { return node; } if (shared.isSymbol(node)) { return ``; } switch (node.type) { case 1: return stringifyElement(node, context); case 2: return shared.escapeHtml(node.content); case 3: return `<!--${shared.escapeHtml(node.content)}-->`; case 5: return shared.escapeHtml(shared.toDisplayString(evaluateConstant(node.content))); case 8: return shared.escapeHtml(evaluateConstant(node)); case 12: return stringifyNode(node.content, context); default: return ""; } } function stringifyElement(node, context) { let res = `<${node.tag}`; let innerHTML = ""; for (let i = 0; i < node.props.length; i++) { const p = node.props[i]; if (p.type === 6) { res += ` ${p.name}`; if (p.value) { res += `="${shared.escapeHtml(p.value.content)}"`; } } else if (p.type === 7) { if (p.name === "bind") { const exp = p.exp; if (exp.content[0] === "_") { res += ` ${p.arg.content}="__VUE_EXP_START__${exp.content}__VUE_EXP_END__"`; continue; } if (shared.isBooleanAttr(p.arg.content) && exp.content === "false") { continue; } let evaluated = evaluateConstant(exp); if (evaluated != null) { const arg = p.arg && p.arg.content; if (arg === "class") { evaluated = shared.normalizeClass(evaluated); } else if (arg === "style") { evaluated = shared.stringifyStyle(shared.normalizeStyle(evaluated)); } res += ` ${p.arg.content}="${shared.escapeHtml( evaluated )}"`; } } else if (p.name === "html") { innerHTML = evaluateConstant(p.exp); } else if (p.name === "text") { innerHTML = shared.escapeHtml( shared.toDisplayString(evaluateConstant(p.exp)) ); } } } if (context.scopeId) { res += ` ${context.scopeId}`; } res += `>`; if (innerHTML) { res += innerHTML; } else { for (let i = 0; i < node.children.length; i++) { res += stringifyNode(node.children[i], context); } } if (!shared.isVoidTag(node.tag)) { res += `</${node.tag}>`; } return res; } function evaluateConstant(exp) { if (exp.type === 4) { return new Function(`return (${exp.content})`)(); } else { let res = ``; exp.children.forEach((c) => { if (shared.isString(c) || shared.isSymbol(c)) { return; } if (c.type === 2) { res += c.content; } else if (c.type === 5) { res += shared.toDisplayString(evaluateConstant(c.content)); } else { res += evaluateConstant(c); } }); return res; } } const ignoreSideEffectTags = (node, context) => { if (node.type === 1 && node.tagType === 0 && (node.tag === "script" || node.tag === "style")) { context.onError( createDOMCompilerError( 63, node.loc ) ); context.removeNode(); } }; function isValidHTMLNesting(parent, child) { if (parent in onlyValidChildren) { return onlyValidChildren[parent].has(child); } if (child in onlyValidParents) { return onlyValidParents[child].has(parent); } if (parent in knownInvalidChildren) { if (knownInvalidChildren[parent].has(child)) return false; } if (child in knownInvalidParents) { if (knownInvalidParents[child].has(parent)) return false; } return true; } const headings = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "h6"]); const emptySet = /* @__PURE__ */ new Set([]); const onlyValidChildren = { head: /* @__PURE__ */ new Set([ "base", "basefront", "bgsound", "link", "meta", "title", "noscript", "noframes", "style", "script", "template" ]), optgroup: /* @__PURE__ */ new Set(["option"]), select: /* @__PURE__ */ new Set(["optgroup", "option", "hr"]), // table table: /* @__PURE__ */ new Set(["caption", "colgroup", "tbody", "tfoot", "thead"]), tr: /* @__PURE__ */ new Set(["td", "th"]), colgroup: /* @__PURE__ */ new Set(["col"]), tbody: /* @__PURE__ */ new Set(["tr"]), thead: /* @__PURE__ */ new Set(["tr"]), tfoot: /* @__PURE__ */ new Set(["tr"]), // these elements can not have any children elements script: emptySet, iframe: emptySet, option: emptySet, textarea: emptySet, style: emptySet, title: emptySet }; const onlyValidParents = { // sections html: emptySet, body: /* @__PURE__ */ new Set(["html"]), head: /* @__PURE__ */ new Set(["html"]), // table td: /* @__PURE__ */ new Set(["tr"]), colgroup: /* @__PURE__ */ new Set(["table"]), caption: /* @__PURE__ */ new Set(["table"]), tbody: /* @__PURE__ */ new Set(["table"]), tfoot: /* @__PURE__ */ new Set(["table"]), col: /* @__PURE__ */ new Set(["colgroup"]), th: /* @__PURE__ */ new Set(["tr"]), thead: /* @__PURE__ */ new Set(["table"]), tr: /* @__PURE__ */ new Set(["tbody", "thead", "tfoot"]), // data list dd: /* @__PURE__ */ new Set(["dl", "div"]), dt: /* @__PURE__ */ new Set(["dl", "div"]), // other figcaption: /* @__PURE__ */ new Set(["figure"]), // li: new Set(["ul", "ol"]), summary: /* @__PURE__ */ new Set(["details"]), area: /* @__PURE__ */ new Set(["map"]) }; const knownInvalidChildren = { p: /* @__PURE__ */ new Set([ "address", "article", "aside", "blockquote", "center", "details", "dialog", "dir", "div", "dl", "fieldset", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "header", "hgroup", "hr", "li", "main", "nav", "menu", "ol", "p", "pre", "section", "table", "ul" ]), svg: /* @__PURE__ */ new Set([ "b", "blockquote", "br", "code", "dd", "div", "dl", "dt", "em", "embed", "h1", "h2", "h3", "h4", "h5", "h6", "hr", "i", "img", "li", "menu", "meta", "ol", "p", "pre", "ruby", "s", "small", "span", "strong", "sub", "sup", "table", "u", "ul", "var" ]) }; const knownInvalidParents = { a: /* @__PURE__ */ new Set(["a"]), button: /* @__PURE__ */ new Set(["button"]), dd: /* @__PURE__ */ new Set(["dd", "dt"]), dt: /* @__PURE__ */ new Set(["dd", "dt"]), form: /* @__PURE__ */ new Set(["form"]), li: /* @__PURE__ */ new Set(["li"]), h1: headings, h2: headings, h3: headings, h4: headings, h5: headings, h6: headings }; const validateHtmlNesting = (node, context) => { if (node.type === 1 && node.tagType === 0 && context.parent && context.parent.type === 1 && context.parent.tagType === 0 && !isValidHTMLNesting(context.parent.tag, node.tag)) { const error = new SyntaxError( `<${node.tag}> cannot be child of <${context.parent.tag}>, according to HTML specifications. This can cause hydration errors or potentially disrupt future functionality.` ); error.loc = node.loc; context.onWarn(error); } }; const DOMNodeTransforms = [ transformStyle, ...[transformTransition, validateHtmlNesting] ]; const DOMDirectiveTransforms = { cloak: compilerCore.noopDirectiveTransform, html: transformVHtml, text: transformVText, model: transformModel, // override compiler-core on: transformOn, // override compiler-core show: transformShow }; function compile(src, options = {}) { return compilerCore.baseCompile( src, shared.extend({}, parserOptions, options, { nodeTransforms: [ // ignore <script> and <tag> // this is not put inside DOMNodeTransforms because that list is used // by compiler-ssr to generate vnode fallback branches ignoreSideEffectTags, ...DOMNodeTransforms, ...options.nodeTransforms || [] ], directiveTransforms: shared.extend( {}, DOMDirectiveTransforms, options.directiveTransforms || {} ), transformHoist: stringifyStatic }) ); } function parse(template, options = {}) { return compilerCore.baseParse(template, shared.extend({}, parserOptions, options)); } exports.DOMDirectiveTransforms = DOMDirectiveTransforms; exports.DOMErrorCodes = DOMErrorCodes; exports.DOMErrorMessages = DOMErrorMessages; exports.DOMNodeTransforms = DOMNodeTransforms; exports.TRANSITION = TRANSITION; exports.TRANSITION_GROUP = TRANSITION_GROUP; exports.V_MODEL_CHECKBOX = V_MODEL_CHECKBOX; exports.V_MODEL_DYNAMIC = V_MODEL_DYNAMIC; exports.V_MODEL_RADIO = V_MODEL_RADIO; exports.V_MODEL_SELECT = V_MODEL_SELECT; exports.V_MODEL_TEXT = V_MODEL_TEXT; exports.V_ON_WITH_KEYS = V_ON_WITH_KEYS; exports.V_ON_WITH_MODIFIERS = V_ON_WITH_MODIFIERS; exports.V_SHOW = V_SHOW; exports.compile = compile; exports.createDOMCompilerError = createDOMCompilerError; exports.parse = parse; exports.parserOptions = parserOptions; exports.transformStyle = transformStyle; Object.keys(compilerCore).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = compilerCore[k]; }); /***/ }), /***/ "./node_modules/@vue/reactivity/dist/reactivity.cjs.js": /*!*************************************************************!*\ !*** ./node_modules/@vue/reactivity/dist/reactivity.cjs.js ***! \*************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * @vue/reactivity v3.5.13 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/ Object.defineProperty(exports, "__esModule", ({ value: true })); var shared = __webpack_require__(/*! @vue/shared */ "./node_modules/@vue/shared/dist/shared.cjs.js"); function warn(msg, ...args) { console.warn(`[Vue warn] ${msg}`, ...args); } let activeEffectScope; class EffectScope { constructor(detached = false) { this.detached = detached; /** * @internal */ this._active = true; /** * @internal */ this.effects = []; /** * @internal */ this.cleanups = []; this._isPaused = false; this.parent = activeEffectScope; if (!detached && activeEffectScope) { this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push( this ) - 1; } } get active() { return this._active; } pause() { if (this._active) { this._isPaused = true; let i, l; if (this.scopes) { for (i = 0, l = this.scopes.length; i < l; i++) { this.scopes[i].pause(); } } for (i = 0, l = this.effects.length; i < l; i++) { this.effects[i].pause(); } } } /** * Resumes the effect scope, including all child scopes and effects. */ resume() { if (this._active) { if (this._isPaused) { this._isPaused = false; let i, l; if (this.scopes) { for (i = 0, l = this.scopes.length; i < l; i++) { this.scopes[i].resume(); } } for (i = 0, l = this.effects.length; i < l; i++) { this.effects[i].resume(); } } } } run(fn) { if (this._active) { const currentEffectScope = activeEffectScope; try { activeEffectScope = this; return fn(); } finally { activeEffectScope = currentEffectScope; } } else { warn(`cannot run an inactive effect scope.`); } } /** * This should only be called on non-detached scopes * @internal */ on() { activeEffectScope = this; } /** * This should only be called on non-detached scopes * @internal */ off() { activeEffectScope = this.parent; } stop(fromParent) { if (this._active) { this._active = false; let i, l; for (i = 0, l = this.effects.length; i < l; i++) { this.effects[i].stop(); } this.effects.length = 0; for (i = 0, l = this.cleanups.length; i < l; i++) { this.cleanups[i](); } this.cleanups.length = 0; if (this.scopes) { for (i = 0, l = this.scopes.length; i < l; i++) { this.scopes[i].stop(true); } this.scopes.length = 0; } if (!this.detached && this.parent && !fromParent) { const last = this.parent.scopes.pop(); if (last && last !== this) { this.parent.scopes[this.index] = last; last.index = this.index; } } this.parent = void 0; } } } function effectScope(detached) { return new EffectScope(detached); } function getCurrentScope() { return activeEffectScope; } function onScopeDispose(fn, failSilently = false) { if (activeEffectScope) { activeEffectScope.cleanups.push(fn); } else if (!failSilently) { warn( `onScopeDispose() is called when there is no active effect scope to be associated with.` ); } } let activeSub; const EffectFlags = { "ACTIVE": 1, "1": "ACTIVE", "RUNNING": 2, "2": "RUNNING", "TRACKING": 4, "4": "TRACKING", "NOTIFIED": 8, "8": "NOTIFIED", "DIRTY": 16, "16": "DIRTY", "ALLOW_RECURSE": 32, "32": "ALLOW_RECURSE", "PAUSED": 64, "64": "PAUSED" }; const pausedQueueEffects = /* @__PURE__ */ new WeakSet(); class ReactiveEffect { constructor(fn) { this.fn = fn; /** * @internal */ this.deps = void 0; /** * @internal */ this.depsTail = void 0; /** * @internal */ this.flags = 1 | 4; /** * @internal */ this.next = void 0; /** * @internal */ this.cleanup = void 0; this.scheduler = void 0; if (activeEffectScope && activeEffectScope.active) { activeEffectScope.effects.push(this); } } pause() { this.flags |= 64; } resume() { if (this.flags & 64) { this.flags &= ~64; if (pausedQueueEffects.has(this)) { pausedQueueEffects.delete(this); this.trigger(); } } } /** * @internal */ notify() { if (this.flags & 2 && !(this.flags & 32)) { return; } if (!(this.flags & 8)) { batch(this); } } run() { if (!(this.flags & 1)) { return this.fn(); } this.flags |= 2; cleanupEffect(this); prepareDeps(this); const prevEffect = activeSub; const prevShouldTrack = shouldTrack; activeSub = this; shouldTrack = true; try { return this.fn(); } finally { if (activeSub !== this) { warn( "Active effect was not restored correctly - this is likely a Vue internal bug." ); } cleanupDeps(this); activeSub = prevEffect; shouldTrack = prevShouldTrack; this.flags &= ~2; } } stop() { if (this.flags & 1) { for (let link = this.deps; link; link = link.nextDep) { removeSub(link); } this.deps = this.depsTail = void 0; cleanupEffect(this); this.onStop && this.onStop(); this.flags &= ~1; } } trigger() { if (this.flags & 64) { pausedQueueEffects.add(this); } else if (this.scheduler) { this.scheduler(); } else { this.runIfDirty(); } } /** * @internal */ runIfDirty() { if (isDirty(this)) { this.run(); } } get dirty() { return isDirty(this); } } let batchDepth = 0; let batchedSub; let batchedComputed; function batch(sub, isComputed = false) { sub.flags |= 8; if (isComputed) { sub.next = batchedComputed; batchedComputed = sub; return; } sub.next = batchedSub; batchedSub = sub; } function startBatch() { batchDepth++; } function endBatch() { if (--batchDepth > 0) { return; } if (batchedComputed) { let e = batchedComputed; batchedComputed = void 0; while (e) { const next = e.next; e.next = void 0; e.flags &= ~8; e = next; } } let error; while (batchedSub) { let e = batchedSub; batchedSub = void 0; while (e) { const next = e.next; e.next = void 0; e.flags &= ~8; if (e.flags & 1) { try { ; e.trigger(); } catch (err) { if (!error) error = err; } } e = next; } } if (error) throw error; } function prepareDeps(sub) { for (let link = sub.deps; link; link = link.nextDep) { link.version = -1; link.prevActiveLink = link.dep.activeLink; link.dep.activeLink = link; } } function cleanupDeps(sub) { let head; let tail = sub.depsTail; let link = tail; while (link) { const prev = link.prevDep; if (link.version === -1) { if (link === tail) tail = prev; removeSub(link); removeDep(link); } else { head = link; } link.dep.activeLink = link.prevActiveLink; link.prevActiveLink = void 0; link = prev; } sub.deps = head; sub.depsTail = tail; } function isDirty(sub) { for (let link = sub.deps; link; link = link.nextDep) { if (link.dep.version !== link.version || link.dep.computed && (refreshComputed(link.dep.computed) || link.dep.version !== link.version)) { return true; } } if (sub._dirty) { return true; } return false; } function refreshComputed(computed) { if (computed.flags & 4 && !(computed.flags & 16)) { return; } computed.flags &= ~16; if (computed.globalVersion === globalVersion) { return; } computed.globalVersion = globalVersion; const dep = computed.dep; computed.flags |= 2; if (dep.version > 0 && !computed.isSSR && computed.deps && !isDirty(computed)) { computed.flags &= ~2; return; } const prevSub = activeSub; const prevShouldTrack = shouldTrack; activeSub = computed; shouldTrack = true; try { prepareDeps(computed); const value = computed.fn(computed._value); if (dep.version === 0 || shared.hasChanged(value, computed._value)) { computed._value = value; dep.version++; } } catch (err) { dep.version++; throw err; } finally { activeSub = prevSub; shouldTrack = prevShouldTrack; cleanupDeps(computed); computed.flags &= ~2; } } function removeSub(link, soft = false) { const { dep, prevSub, nextSub } = link; if (prevSub) { prevSub.nextSub = nextSub; link.prevSub = void 0; } if (nextSub) { nextSub.prevSub = prevSub; link.nextSub = void 0; } if (dep.subsHead === link) { dep.subsHead = nextSub; } if (dep.subs === link) { dep.subs = prevSub; if (!prevSub && dep.computed) { dep.computed.flags &= ~4; for (let l = dep.computed.deps; l; l = l.nextDep) { removeSub(l, true); } } } if (!soft && !--dep.sc && dep.map) { dep.map.delete(dep.key); } } function removeDep(link) { const { prevDep, nextDep } = link; if (prevDep) { prevDep.nextDep = nextDep; link.prevDep = void 0; } if (nextDep) { nextDep.prevDep = prevDep; link.nextDep = void 0; } } function effect(fn, options) { if (fn.effect instanceof ReactiveEffect) { fn = fn.effect.fn; } const e = new ReactiveEffect(fn); if (options) { shared.extend(e, options); } try { e.run(); } catch (err) { e.stop(); throw err; } const runner = e.run.bind(e); runner.effect = e; return runner; } function stop(runner) { runner.effect.stop(); } let shouldTrack = true; const trackStack = []; function pauseTracking() { trackStack.push(shouldTrack); shouldTrack = false; } function enableTracking() { trackStack.push(shouldTrack); shouldTrack = true; } function resetTracking() { const last = trackStack.pop(); shouldTrack = last === void 0 ? true : last; } function onEffectCleanup(fn, failSilently = false) { if (activeSub instanceof ReactiveEffect) { activeSub.cleanup = fn; } else if (!failSilently) { warn( `onEffectCleanup() was called when there was no active effect to associate with.` ); } } function cleanupEffect(e) { const { cleanup } = e; e.cleanup = void 0; if (cleanup) { const prevSub = activeSub; activeSub = void 0; try { cleanup(); } finally { activeSub = prevSub; } } } let globalVersion = 0; class Link { constructor(sub, dep) { this.sub = sub; this.dep = dep; this.version = dep.version; this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0; } } class Dep { constructor(computed) { this.computed = computed; this.version = 0; /** * Link between this dep and the current active effect */ this.activeLink = void 0; /** * Doubly linked list representing the subscribing effects (tail) */ this.subs = void 0; /** * For object property deps cleanup */ this.map = void 0; this.key = void 0; /** * Subscriber counter */ this.sc = 0; { this.subsHead = void 0; } } track(debugInfo) { if (!activeSub || !shouldTrack || activeSub === this.computed) { return; } let link = this.activeLink; if (link === void 0 || link.sub !== activeSub) { link = this.activeLink = new Link(activeSub, this); if (!activeSub.deps) { activeSub.deps = activeSub.depsTail = link; } else { link.prevDep = activeSub.depsTail; activeSub.depsTail.nextDep = link; activeSub.depsTail = link; } addSub(link); } else if (link.version === -1) { link.version = this.version; if (link.nextDep) { const next = link.nextDep; next.prevDep = link.prevDep; if (link.prevDep) { link.prevDep.nextDep = next; } link.prevDep = activeSub.depsTail; link.nextDep = void 0; activeSub.depsTail.nextDep = link; activeSub.depsTail = link; if (activeSub.deps === link) { activeSub.deps = next; } } } if (activeSub.onTrack) { activeSub.onTrack( shared.extend( { effect: activeSub }, debugInfo ) ); } return link; } trigger(debugInfo) { this.version++; globalVersion++; this.notify(debugInfo); } notify(debugInfo) { startBatch(); try { if (true) { for (let head = this.subsHead; head; head = head.nextSub) { if (head.sub.onTrigger && !(head.sub.flags & 8)) { head.sub.onTrigger( shared.extend( { effect: head.sub }, debugInfo ) ); } } } for (let link = this.subs; link; link = link.prevSub) { if (link.sub.notify()) { ; link.sub.dep.notify(); } } } finally { endBatch(); } } } function addSub(link) { link.dep.sc++; if (link.sub.flags & 4) { const computed = link.dep.computed; if (computed && !link.dep.subs) { computed.flags |= 4 | 16; for (let l = computed.deps; l; l = l.nextDep) { addSub(l); } } const currentTail = link.dep.subs; if (currentTail !== link) { link.prevSub = currentTail; if (currentTail) currentTail.nextSub = link; } if (link.dep.subsHead === void 0) { link.dep.subsHead = link; } link.dep.subs = link; } } const targetMap = /* @__PURE__ */ new WeakMap(); const ITERATE_KEY = Symbol( "Object iterate" ); const MAP_KEY_ITERATE_KEY = Symbol( "Map keys iterate" ); const ARRAY_ITERATE_KEY = Symbol( "Array iterate" ); function track(target, type, key) { if (shouldTrack && activeSub) { let depsMap = targetMap.get(target); if (!depsMap) { targetMap.set(target, depsMap = /* @__PURE__ */ new Map()); } let dep = depsMap.get(key); if (!dep) { depsMap.set(key, dep = new Dep()); dep.map = depsMap; dep.key = key; } { dep.track({ target, type, key }); } } } function trigger(target, type, key, newValue, oldValue, oldTarget) { const depsMap = targetMap.get(target); if (!depsMap) { globalVersion++; return; } const run = (dep) => { if (dep) { { dep.trigger({ target, type, key, newValue, oldValue, oldTarget }); } } }; startBatch(); if (type === "clear") { depsMap.forEach(run); } else { const targetIsArray = shared.isArray(target); const isArrayIndex = targetIsArray && shared.isIntegerKey(key); if (targetIsArray && key === "length") { const newLength = Number(newValue); depsMap.forEach((dep, key2) => { if (key2 === "length" || key2 === ARRAY_ITERATE_KEY || !shared.isSymbol(key2) && key2 >= newLength) { run(dep); } }); } else { if (key !== void 0 || depsMap.has(void 0)) { run(depsMap.get(key)); } if (isArrayIndex) { run(depsMap.get(ARRAY_ITERATE_KEY)); } switch (type) { case "add": if (!targetIsArray) { run(depsMap.get(ITERATE_KEY)); if (shared.isMap(target)) { run(depsMap.get(MAP_KEY_ITERATE_KEY)); } } else if (isArrayIndex) { run(depsMap.get("length")); } break; case "delete": if (!targetIsArray) { run(depsMap.get(ITERATE_KEY)); if (shared.isMap(target)) { run(depsMap.get(MAP_KEY_ITERATE_KEY)); } } break; case "set": if (shared.isMap(target)) { run(depsMap.get(ITERATE_KEY)); } break; } } } endBatch(); } function getDepFromReactive(object, key) { const depMap = targetMap.get(object); return depMap && depMap.get(key); } function reactiveReadArray(array) { const raw = toRaw(array); if (raw === array) return raw; track(raw, "iterate", ARRAY_ITERATE_KEY); return isShallow(array) ? raw : raw.map(toReactive); } function shallowReadArray(arr) { track(arr = toRaw(arr), "iterate", ARRAY_ITERATE_KEY); return arr; } const arrayInstrumentations = { __proto__: null, [Symbol.iterator]() { return iterator(this, Symbol.iterator, toReactive); }, concat(...args) { return reactiveReadArray(this).concat( ...args.map((x) => shared.isArray(x) ? reactiveReadArray(x) : x) ); }, entries() { return iterator(this, "entries", (value) => { value[1] = toReactive(value[1]); return value; }); }, every(fn, thisArg) { return apply(this, "every", fn, thisArg, void 0, arguments); }, filter(fn, thisArg) { return apply(this, "filter", fn, thisArg, (v) => v.map(toReactive), arguments); }, find(fn, thisArg) { return apply(this, "find", fn, thisArg, toReactive, arguments); }, findIndex(fn, thisArg) { return apply(this, "findIndex", fn, thisArg, void 0, arguments); }, findLast(fn, thisArg) { return apply(this, "findLast", fn, thisArg, toReactive, arguments); }, findLastIndex(fn, thisArg) { return apply(this, "findLastIndex", fn, thisArg, void 0, arguments); }, // flat, flatMap could benefit from ARRAY_ITERATE but are not straight-forward to implement forEach(fn, thisArg) { return apply(this, "forEach", fn, thisArg, void 0, arguments); }, includes(...args) { return searchProxy(this, "includes", args); }, indexOf(...args) { return searchProxy(this, "indexOf", args); }, join(separator) { return reactiveReadArray(this).join(separator); }, // keys() iterator only reads `length`, no optimisation required lastIndexOf(...args) { return searchProxy(this, "lastIndexOf", args); }, map(fn, thisArg) { return apply(this, "map", fn, thisArg, void 0, arguments); }, pop() { return noTracking(this, "pop"); }, push(...args) { return noTracking(this, "push", args); }, reduce(fn, ...args) { return reduce(this, "reduce", fn, args); }, reduceRight(fn, ...args) { return reduce(this, "reduceRight", fn, args); }, shift() { return noTracking(this, "shift"); }, // slice could use ARRAY_ITERATE but also seems to beg for range tracking some(fn, thisArg) { return apply(this, "some", fn, thisArg, void 0, arguments); }, splice(...args) { return noTracking(this, "splice", args); }, toReversed() { return reactiveReadArray(this).toReversed(); }, toSorted(comparer) { return reactiveReadArray(this).toSorted(comparer); }, toSpliced(...args) { return reactiveReadArray(this).toSpliced(...args); }, unshift(...args) { return noTracking(this, "unshift", args); }, values() { return iterator(this, "values", toReactive); } }; function iterator(self, method, wrapValue) { const arr = shallowReadArray(self); const iter = arr[method](); if (arr !== self && !isShallow(self)) { iter._next = iter.next; iter.next = () => { const result = iter._next(); if (result.value) { result.value = wrapValue(result.value); } return result; }; } return iter; } const arrayProto = Array.prototype; function apply(self, method, fn, thisArg, wrappedRetFn, args) { const arr = shallowReadArray(self); const needsWrap = arr !== self && !isShallow(self); const methodFn = arr[method]; if (methodFn !== arrayProto[method]) { const result2 = methodFn.apply(self, args); return needsWrap ? toReactive(result2) : result2; } let wrappedFn = fn; if (arr !== self) { if (needsWrap) { wrappedFn = function(item, index) { return fn.call(this, toReactive(item), index, self); }; } else if (fn.length > 2) { wrappedFn = function(item, index) { return fn.call(this, item, index, self); }; } } const result = methodFn.call(arr, wrappedFn, thisArg); return needsWrap && wrappedRetFn ? wrappedRetFn(result) : result; } function reduce(self, method, fn, args) { const arr = shallowReadArray(self); let wrappedFn = fn; if (arr !== self) { if (!isShallow(self)) { wrappedFn = function(acc, item, index) { return fn.call(this, acc, toReactive(item), index, self); }; } else if (fn.length > 3) { wrappedFn = function(acc, item, index) { return fn.call(this, acc, item, index, self); }; } } return arr[method](wrappedFn, ...args); } function searchProxy(self, method, args) { const arr = toRaw(self); track(arr, "iterate", ARRAY_ITERATE_KEY); const res = arr[method](...args); if ((res === -1 || res === false) && isProxy(args[0])) { args[0] = toRaw(args[0]); return arr[method](...args); } return res; } function noTracking(self, method, args = []) { pauseTracking(); startBatch(); const res = toRaw(self)[method].apply(self, args); endBatch(); resetTracking(); return res; } const isNonTrackableKeys = /* @__PURE__ */ shared.makeMap(`__proto__,__v_isRef,__isVue`); const builtInSymbols = new Set( /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(shared.isSymbol) ); function hasOwnProperty(key) { if (!shared.isSymbol(key)) key = String(key); const obj = toRaw(this); track(obj, "has", key); return obj.hasOwnProperty(key); } class BaseReactiveHandler { constructor(_isReadonly = false, _isShallow = false) { this._isReadonly = _isReadonly; this._isShallow = _isShallow; } get(target, key, receiver) { if (key === "__v_skip") return target["__v_skip"]; const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow; if (key === "__v_isReactive") { return !isReadonly2; } else if (key === "__v_isReadonly") { return isReadonly2; } else if (key === "__v_isShallow") { return isShallow2; } else if (key === "__v_raw") { if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype // this means the receiver is a user proxy of the reactive proxy Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) { return target; } return; } const targetIsArray = shared.isArray(target); if (!isReadonly2) { let fn; if (targetIsArray && (fn = arrayInstrumentations[key])) { return fn; } if (key === "hasOwnProperty") { return hasOwnProperty; } } const res = Reflect.get( target, key, // if this is a proxy wrapping a ref, return methods using the raw ref // as receiver so that we don't have to call `toRaw` on the ref in all // its class methods isRef(target) ? target : receiver ); if (shared.isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) { return res; } if (!isReadonly2) { track(target, "get", key); } if (isShallow2) { return res; } if (isRef(res)) { return targetIsArray && shared.isIntegerKey(key) ? res : res.value; } if (shared.isObject(res)) { return isReadonly2 ? readonly(res) : reactive(res); } return res; } } class MutableReactiveHandler extends BaseReactiveHandler { constructor(isShallow2 = false) { super(false, isShallow2); } set(target, key, value, receiver) { let oldValue = target[key]; if (!this._isShallow) { const isOldValueReadonly = isReadonly(oldValue); if (!isShallow(value) && !isReadonly(value)) { oldValue = toRaw(oldValue); value = toRaw(value); } if (!shared.isArray(target) && isRef(oldValue) && !isRef(value)) { if (isOldValueReadonly) { return false; } else { oldValue.value = value; return true; } } } const hadKey = shared.isArray(target) && shared.isIntegerKey(key) ? Number(key) < target.length : shared.hasOwn(target, key); const result = Reflect.set( target, key, value, isRef(target) ? target : receiver ); if (target === toRaw(receiver)) { if (!hadKey) { trigger(target, "add", key, value); } else if (shared.hasChanged(value, oldValue)) { trigger(target, "set", key, value, oldValue); } } return result; } deleteProperty(target, key) { const hadKey = shared.hasOwn(target, key); const oldValue = target[key]; const result = Reflect.deleteProperty(target, key); if (result && hadKey) { trigger(target, "delete", key, void 0, oldValue); } return result; } has(target, key) { const result = Reflect.has(target, key); if (!shared.isSymbol(key) || !builtInSymbols.has(key)) { track(target, "has", key); } return result; } ownKeys(target) { track( target, "iterate", shared.isArray(target) ? "length" : ITERATE_KEY ); return Reflect.ownKeys(target); } } class ReadonlyReactiveHandler extends BaseReactiveHandler { constructor(isShallow2 = false) { super(true, isShallow2); } set(target, key) { { warn( `Set operation on key "${String(key)}" failed: target is readonly.`, target ); } return true; } deleteProperty(target, key) { { warn( `Delete operation on key "${String(key)}" failed: target is readonly.`, target ); } return true; } } const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler(); const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(); const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(true); const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true); const toShallow = (value) => value; const getProto = (v) => Reflect.getPrototypeOf(v); function createIterableMethod(method, isReadonly2, isShallow2) { return function(...args) { const target = this["__v_raw"]; const rawTarget = toRaw(target); const targetIsMap = shared.isMap(rawTarget); const isPair = method === "entries" || method === Symbol.iterator && targetIsMap; const isKeyOnly = method === "keys" && targetIsMap; const innerIterator = target[method](...args); const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive; !isReadonly2 && track( rawTarget, "iterate", isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY ); return { // iterator protocol next() { const { value, done } = innerIterator.next(); return done ? { value, done } : { value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value), done }; }, // iterable protocol [Symbol.iterator]() { return this; } }; }; } function createReadonlyMethod(type) { return function(...args) { { const key = args[0] ? `on key "${args[0]}" ` : ``; warn( `${shared.capitalize(type)} operation ${key}failed: target is readonly.`, toRaw(this) ); } return type === "delete" ? false : type === "clear" ? void 0 : this; }; } function createInstrumentations(readonly, shallow) { const instrumentations = { get(key) { const target = this["__v_raw"]; const rawTarget = toRaw(target); const rawKey = toRaw(key); if (!readonly) { if (shared.hasChanged(key, rawKey)) { track(rawTarget, "get", key); } track(rawTarget, "get", rawKey); } const { has } = getProto(rawTarget); const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive; if (has.call(rawTarget, key)) { return wrap(target.get(key)); } else if (has.call(rawTarget, rawKey)) { return wrap(target.get(rawKey)); } else if (target !== rawTarget) { target.get(key); } }, get size() { const target = this["__v_raw"]; !readonly && track(toRaw(target), "iterate", ITERATE_KEY); return Reflect.get(target, "size", target); }, has(key) { const target = this["__v_raw"]; const rawTarget = toRaw(target); const rawKey = toRaw(key); if (!readonly) { if (shared.hasChanged(key, rawKey)) { track(rawTarget, "has", key); } track(rawTarget, "has", rawKey); } return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey); }, forEach(callback, thisArg) { const observed = this; const target = observed["__v_raw"]; const rawTarget = toRaw(target); const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive; !readonly && track(rawTarget, "iterate", ITERATE_KEY); return target.forEach((value, key) => { return callback.call(thisArg, wrap(value), wrap(key), observed); }); } }; shared.extend( instrumentations, readonly ? { add: createReadonlyMethod("add"), set: createReadonlyMethod("set"), delete: createReadonlyMethod("delete"), clear: createReadonlyMethod("clear") } : { add(value) { if (!shallow && !isShallow(value) && !isReadonly(value)) { value = toRaw(value); } const target = toRaw(this); const proto = getProto(target); const hadKey = proto.has.call(target, value); if (!hadKey) { target.add(value); trigger(target, "add", value, value); } return this; }, set(key, value) { if (!shallow && !isShallow(value) && !isReadonly(value)) { value = toRaw(value); } const target = toRaw(this); const { has, get } = getProto(target); let hadKey = has.call(target, key); if (!hadKey) { key = toRaw(key); hadKey = has.call(target, key); } else { checkIdentityKeys(target, has, key); } const oldValue = get.call(target, key); target.set(key, value); if (!hadKey) { trigger(target, "add", key, value); } else if (shared.hasChanged(value, oldValue)) { trigger(target, "set", key, value, oldValue); } return this; }, delete(key) { const target = toRaw(this); const { has, get } = getProto(target); let hadKey = has.call(target, key); if (!hadKey) { key = toRaw(key); hadKey = has.call(target, key); } else { checkIdentityKeys(target, has, key); } const oldValue = get ? get.call(target, key) : void 0; const result = target.delete(key); if (hadKey) { trigger(target, "delete", key, void 0, oldValue); } return result; }, clear() { const target = toRaw(this); const hadItems = target.size !== 0; const oldTarget = shared.isMap(target) ? new Map(target) : new Set(target) ; const result = target.clear(); if (hadItems) { trigger( target, "clear", void 0, void 0, oldTarget ); } return result; } } ); const iteratorMethods = [ "keys", "values", "entries", Symbol.iterator ]; iteratorMethods.forEach((method) => { instrumentations[method] = createIterableMethod(method, readonly, shallow); }); return instrumentations; } function createInstrumentationGetter(isReadonly2, shallow) { const instrumentations = createInstrumentations(isReadonly2, shallow); return (target, key, receiver) => { if (key === "__v_isReactive") { return !isReadonly2; } else if (key === "__v_isReadonly") { return isReadonly2; } else if (key === "__v_raw") { return target; } return Reflect.get( shared.hasOwn(instrumentations, key) && key in target ? instrumentations : target, key, receiver ); }; } const mutableCollectionHandlers = { get: /* @__PURE__ */ createInstrumentationGetter(false, false) }; const shallowCollectionHandlers = { get: /* @__PURE__ */ createInstrumentationGetter(false, true) }; const readonlyCollectionHandlers = { get: /* @__PURE__ */ createInstrumentationGetter(true, false) }; const shallowReadonlyCollectionHandlers = { get: /* @__PURE__ */ createInstrumentationGetter(true, true) }; function checkIdentityKeys(target, has, key) { const rawKey = toRaw(key); if (rawKey !== key && has.call(target, rawKey)) { const type = shared.toRawType(target); warn( `Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.` ); } } const reactiveMap = /* @__PURE__ */ new WeakMap(); const shallowReactiveMap = /* @__PURE__ */ new WeakMap(); const readonlyMap = /* @__PURE__ */ new WeakMap(); const shallowReadonlyMap = /* @__PURE__ */ new WeakMap(); function targetTypeMap(rawType) { switch (rawType) { case "Object": case "Array": return 1 /* COMMON */; case "Map": case "Set": case "WeakMap": case "WeakSet": return 2 /* COLLECTION */; default: return 0 /* INVALID */; } } function getTargetType(value) { return value["__v_skip"] || !Object.isExtensible(value) ? 0 /* INVALID */ : targetTypeMap(shared.toRawType(value)); } function reactive(target) { if (isReadonly(target)) { return target; } return createReactiveObject( target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap ); } function shallowReactive(target) { return createReactiveObject( target, false, shallowReactiveHandlers, shallowCollectionHandlers, shallowReactiveMap ); } function readonly(target) { return createReactiveObject( target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap ); } function shallowReadonly(target) { return createReactiveObject( target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap ); } function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) { if (!shared.isObject(target)) { { warn( `value cannot be made ${isReadonly2 ? "readonly" : "reactive"}: ${String( target )}` ); } return target; } if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) { return target; } const existingProxy = proxyMap.get(target); if (existingProxy) { return existingProxy; } const targetType = getTargetType(target); if (targetType === 0 /* INVALID */) { return target; } const proxy = new Proxy( target, targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers ); proxyMap.set(target, proxy); return proxy; } function isReactive(value) { if (isReadonly(value)) { return isReactive(value["__v_raw"]); } return !!(value && value["__v_isReactive"]); } function isReadonly(value) { return !!(value && value["__v_isReadonly"]); } function isShallow(value) { return !!(value && value["__v_isShallow"]); } function isProxy(value) { return value ? !!value["__v_raw"] : false; } function toRaw(observed) { const raw = observed && observed["__v_raw"]; return raw ? toRaw(raw) : observed; } function markRaw(value) { if (!shared.hasOwn(value, "__v_skip") && Object.isExtensible(value)) { shared.def(value, "__v_skip", true); } return value; } const toReactive = (value) => shared.isObject(value) ? reactive(value) : value; const toReadonly = (value) => shared.isObject(value) ? readonly(value) : value; function isRef(r) { return r ? r["__v_isRef"] === true : false; } function ref(value) { return createRef(value, false); } function shallowRef(value) { return createRef(value, true); } function createRef(rawValue, shallow) { if (isRef(rawValue)) { return rawValue; } return new RefImpl(rawValue, shallow); } class RefImpl { constructor(value, isShallow2) { this.dep = new Dep(); this["__v_isRef"] = true; this["__v_isShallow"] = false; this._rawValue = isShallow2 ? value : toRaw(value); this._value = isShallow2 ? value : toReactive(value); this["__v_isShallow"] = isShallow2; } get value() { { this.dep.track({ target: this, type: "get", key: "value" }); } return this._value; } set value(newValue) { const oldValue = this._rawValue; const useDirectValue = this["__v_isShallow"] || isShallow(newValue) || isReadonly(newValue); newValue = useDirectValue ? newValue : toRaw(newValue); if (shared.hasChanged(newValue, oldValue)) { this._rawValue = newValue; this._value = useDirectValue ? newValue : toReactive(newValue); { this.dep.trigger({ target: this, type: "set", key: "value", newValue, oldValue }); } } } } function triggerRef(ref2) { if (ref2.dep) { { ref2.dep.trigger({ target: ref2, type: "set", key: "value", newValue: ref2._value }); } } } function unref(ref2) { return isRef(ref2) ? ref2.value : ref2; } function toValue(source) { return shared.isFunction(source) ? source() : unref(source); } const shallowUnwrapHandlers = { get: (target, key, receiver) => key === "__v_raw" ? target : unref(Reflect.get(target, key, receiver)), set: (target, key, value, receiver) => { const oldValue = target[key]; if (isRef(oldValue) && !isRef(value)) { oldValue.value = value; return true; } else { return Reflect.set(target, key, value, receiver); } } }; function proxyRefs(objectWithRefs) { return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers); } class CustomRefImpl { constructor(factory) { this["__v_isRef"] = true; this._value = void 0; const dep = this.dep = new Dep(); const { get, set } = factory(dep.track.bind(dep), dep.trigger.bind(dep)); this._get = get; this._set = set; } get value() { return this._value = this._get(); } set value(newVal) { this._set(newVal); } } function customRef(factory) { return new CustomRefImpl(factory); } function toRefs(object) { if (!isProxy(object)) { warn(`toRefs() expects a reactive object but received a plain one.`); } const ret = shared.isArray(object) ? new Array(object.length) : {}; for (const key in object) { ret[key] = propertyToRef(object, key); } return ret; } class ObjectRefImpl { constructor(_object, _key, _defaultValue) { this._object = _object; this._key = _key; this._defaultValue = _defaultValue; this["__v_isRef"] = true; this._value = void 0; } get value() { const val = this._object[this._key]; return this._value = val === void 0 ? this._defaultValue : val; } set value(newVal) { this._object[this._key] = newVal; } get dep() { return getDepFromReactive(toRaw(this._object), this._key); } } class GetterRefImpl { constructor(_getter) { this._getter = _getter; this["__v_isRef"] = true; this["__v_isReadonly"] = true; this._value = void 0; } get value() { return this._value = this._getter(); } } function toRef(source, key, defaultValue) { if (isRef(source)) { return source; } else if (shared.isFunction(source)) { return new GetterRefImpl(source); } else if (shared.isObject(source) && arguments.length > 1) { return propertyToRef(source, key, defaultValue); } else { return ref(source); } } function propertyToRef(source, key, defaultValue) { const val = source[key]; return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue); } class ComputedRefImpl { constructor(fn, setter, isSSR) { this.fn = fn; this.setter = setter; /** * @internal */ this._value = void 0; /** * @internal */ this.dep = new Dep(this); /** * @internal */ this.__v_isRef = true; // TODO isolatedDeclarations "__v_isReadonly" // A computed is also a subscriber that tracks other deps /** * @internal */ this.deps = void 0; /** * @internal */ this.depsTail = void 0; /** * @internal */ this.flags = 16; /** * @internal */ this.globalVersion = globalVersion - 1; /** * @internal */ this.next = void 0; // for backwards compat this.effect = this; this["__v_isReadonly"] = !setter; this.isSSR = isSSR; } /** * @internal */ notify() { this.flags |= 16; if (!(this.flags & 8) && // avoid infinite self recursion activeSub !== this) { batch(this, true); return true; } } get value() { const link = this.dep.track({ target: this, type: "get", key: "value" }) ; refreshComputed(this); if (link) { link.version = this.dep.version; } return this._value; } set value(newValue) { if (this.setter) { this.setter(newValue); } else { warn("Write operation failed: computed value is readonly"); } } } function computed(getterOrOptions, debugOptions, isSSR = false) { let getter; let setter; if (shared.isFunction(getterOrOptions)) { getter = getterOrOptions; } else { getter = getterOrOptions.get; setter = getterOrOptions.set; } const cRef = new ComputedRefImpl(getter, setter, isSSR); if (debugOptions && !isSSR) { cRef.onTrack = debugOptions.onTrack; cRef.onTrigger = debugOptions.onTrigger; } return cRef; } const TrackOpTypes = { "GET": "get", "HAS": "has", "ITERATE": "iterate" }; const TriggerOpTypes = { "SET": "set", "ADD": "add", "DELETE": "delete", "CLEAR": "clear" }; const ReactiveFlags = { "SKIP": "__v_skip", "IS_REACTIVE": "__v_isReactive", "IS_READONLY": "__v_isReadonly", "IS_SHALLOW": "__v_isShallow", "RAW": "__v_raw", "IS_REF": "__v_isRef" }; const WatchErrorCodes = { "WATCH_GETTER": 2, "2": "WATCH_GETTER", "WATCH_CALLBACK": 3, "3": "WATCH_CALLBACK", "WATCH_CLEANUP": 4, "4": "WATCH_CLEANUP" }; const INITIAL_WATCHER_VALUE = {}; const cleanupMap = /* @__PURE__ */ new WeakMap(); let activeWatcher = void 0; function getCurrentWatcher() { return activeWatcher; } function onWatcherCleanup(cleanupFn, failSilently = false, owner = activeWatcher) { if (owner) { let cleanups = cleanupMap.get(owner); if (!cleanups) cleanupMap.set(owner, cleanups = []); cleanups.push(cleanupFn); } else if (!failSilently) { warn( `onWatcherCleanup() was called when there was no active watcher to associate with.` ); } } function watch(source, cb, options = shared.EMPTY_OBJ) { const { immediate, deep, once, scheduler, augmentJob, call } = options; const warnInvalidSource = (s) => { (options.onWarn || warn)( `Invalid watch source: `, s, `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.` ); }; const reactiveGetter = (source2) => { if (deep) return source2; if (isShallow(source2) || deep === false || deep === 0) return traverse(source2, 1); return traverse(source2); }; let effect; let getter; let cleanup; let boundCleanup; let forceTrigger = false; let isMultiSource = false; if (isRef(source)) { getter = () => source.value; forceTrigger = isShallow(source); } else if (isReactive(source)) { getter = () => reactiveGetter(source); forceTrigger = true; } else if (shared.isArray(source)) { isMultiSource = true; forceTrigger = source.some((s) => isReactive(s) || isShallow(s)); getter = () => source.map((s) => { if (isRef(s)) { return s.value; } else if (isReactive(s)) { return reactiveGetter(s); } else if (shared.isFunction(s)) { return call ? call(s, 2) : s(); } else { warnInvalidSource(s); } }); } else if (shared.isFunction(source)) { if (cb) { getter = call ? () => call(source, 2) : source; } else { getter = () => { if (cleanup) { pauseTracking(); try { cleanup(); } finally { resetTracking(); } } const currentEffect = activeWatcher; activeWatcher = effect; try { return call ? call(source, 3, [boundCleanup]) : source(boundCleanup); } finally { activeWatcher = currentEffect; } }; } } else { getter = shared.NOOP; warnInvalidSource(source); } if (cb && deep) { const baseGetter = getter; const depth = deep === true ? Infinity : deep; getter = () => traverse(baseGetter(), depth); } const scope = getCurrentScope(); const watchHandle = () => { effect.stop(); if (scope && scope.active) { shared.remove(scope.effects, effect); } }; if (once && cb) { const _cb = cb; cb = (...args) => { _cb(...args); watchHandle(); }; } let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE; const job = (immediateFirstRun) => { if (!(effect.flags & 1) || !effect.dirty && !immediateFirstRun) { return; } if (cb) { const newValue = effect.run(); if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => shared.hasChanged(v, oldValue[i])) : shared.hasChanged(newValue, oldValue))) { if (cleanup) { cleanup(); } const currentWatcher = activeWatcher; activeWatcher = effect; try { const args = [ newValue, // pass undefined as the old value when it's changed for the first time oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue, boundCleanup ]; call ? call(cb, 3, args) : ( // @ts-expect-error cb(...args) ); oldValue = newValue; } finally { activeWatcher = currentWatcher; } } } else { effect.run(); } }; if (augmentJob) { augmentJob(job); } effect = new ReactiveEffect(getter); effect.scheduler = scheduler ? () => scheduler(job, false) : job; boundCleanup = (fn) => onWatcherCleanup(fn, false, effect); cleanup = effect.onStop = () => { const cleanups = cleanupMap.get(effect); if (cleanups) { if (call) { call(cleanups, 4); } else { for (const cleanup2 of cleanups) cleanup2(); } cleanupMap.delete(effect); } }; { effect.onTrack = options.onTrack; effect.onTrigger = options.onTrigger; } if (cb) { if (immediate) { job(true); } else { oldValue = effect.run(); } } else if (scheduler) { scheduler(job.bind(null, true), true); } else { effect.run(); } watchHandle.pause = effect.pause.bind(effect); watchHandle.resume = effect.resume.bind(effect); watchHandle.stop = watchHandle; return watchHandle; } function traverse(value, depth = Infinity, seen) { if (depth <= 0 || !shared.isObject(value) || value["__v_skip"]) { return value; } seen = seen || /* @__PURE__ */ new Set(); if (seen.has(value)) { return value; } seen.add(value); depth--; if (isRef(value)) { traverse(value.value, depth, seen); } else if (shared.isArray(value)) { for (let i = 0; i < value.length; i++) { traverse(value[i], depth, seen); } } else if (shared.isSet(value) || shared.isMap(value)) { value.forEach((v) => { traverse(v, depth, seen); }); } else if (shared.isPlainObject(value)) { for (const key in value) { traverse(value[key], depth, seen); } for (const key of Object.getOwnPropertySymbols(value)) { if (Object.prototype.propertyIsEnumerable.call(value, key)) { traverse(value[key], depth, seen); } } } return value; } exports.ARRAY_ITERATE_KEY = ARRAY_ITERATE_KEY; exports.EffectFlags = EffectFlags; exports.EffectScope = EffectScope; exports.ITERATE_KEY = ITERATE_KEY; exports.MAP_KEY_ITERATE_KEY = MAP_KEY_ITERATE_KEY; exports.ReactiveEffect = ReactiveEffect; exports.ReactiveFlags = ReactiveFlags; exports.TrackOpTypes = TrackOpTypes; exports.TriggerOpTypes = TriggerOpTypes; exports.WatchErrorCodes = WatchErrorCodes; exports.computed = computed; exports.customRef = customRef; exports.effect = effect; exports.effectScope = effectScope; exports.enableTracking = enableTracking; exports.getCurrentScope = getCurrentScope; exports.getCurrentWatcher = getCurrentWatcher; exports.isProxy = isProxy; exports.isReactive = isReactive; exports.isReadonly = isReadonly; exports.isRef = isRef; exports.isShallow = isShallow; exports.markRaw = markRaw; exports.onEffectCleanup = onEffectCleanup; exports.onScopeDispose = onScopeDispose; exports.onWatcherCleanup = onWatcherCleanup; exports.pauseTracking = pauseTracking; exports.proxyRefs = proxyRefs; exports.reactive = reactive; exports.reactiveReadArray = reactiveReadArray; exports.readonly = readonly; exports.ref = ref; exports.resetTracking = resetTracking; exports.shallowReactive = shallowReactive; exports.shallowReadArray = shallowReadArray; exports.shallowReadonly = shallowReadonly; exports.shallowRef = shallowRef; exports.stop = stop; exports.toRaw = toRaw; exports.toReactive = toReactive; exports.toReadonly = toReadonly; exports.toRef = toRef; exports.toRefs = toRefs; exports.toValue = toValue; exports.track = track; exports.traverse = traverse; exports.trigger = trigger; exports.triggerRef = triggerRef; exports.unref = unref; exports.watch = watch; /***/ }), /***/ "./node_modules/@vue/runtime-core/dist/runtime-core.cjs.js": /*!*****************************************************************!*\ !*** ./node_modules/@vue/runtime-core/dist/runtime-core.cjs.js ***! \*****************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * @vue/runtime-core v3.5.13 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/ Object.defineProperty(exports, "__esModule", ({ value: true })); var reactivity = __webpack_require__(/*! @vue/reactivity */ "./node_modules/@vue/reactivity/dist/reactivity.cjs.js"); var shared = __webpack_require__(/*! @vue/shared */ "./node_modules/@vue/shared/dist/shared.cjs.js"); const stack = []; function pushWarningContext(vnode) { stack.push(vnode); } function popWarningContext() { stack.pop(); } let isWarning = false; function warn$1(msg, ...args) { if (isWarning) return; isWarning = true; reactivity.pauseTracking(); const instance = stack.length ? stack[stack.length - 1].component : null; const appWarnHandler = instance && instance.appContext.config.warnHandler; const trace = getComponentTrace(); if (appWarnHandler) { callWithErrorHandling( appWarnHandler, instance, 11, [ // eslint-disable-next-line no-restricted-syntax msg + args.map((a) => { var _a, _b; return (_b = (_a = a.toString) == null ? void 0 : _a.call(a)) != null ? _b : JSON.stringify(a); }).join(""), instance && instance.proxy, trace.map( ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>` ).join("\n"), trace ] ); } else { const warnArgs = [`[Vue warn]: ${msg}`, ...args]; if (trace.length && // avoid spamming console during tests true) { warnArgs.push(` `, ...formatTrace(trace)); } console.warn(...warnArgs); } reactivity.resetTracking(); isWarning = false; } function getComponentTrace() { let currentVNode = stack[stack.length - 1]; if (!currentVNode) { return []; } const normalizedStack = []; while (currentVNode) { const last = normalizedStack[0]; if (last && last.vnode === currentVNode) { last.recurseCount++; } else { normalizedStack.push({ vnode: currentVNode, recurseCount: 0 }); } const parentInstance = currentVNode.component && currentVNode.component.parent; currentVNode = parentInstance && parentInstance.vnode; } return normalizedStack; } function formatTrace(trace) { const logs = []; trace.forEach((entry, i) => { logs.push(...i === 0 ? [] : [` `], ...formatTraceEntry(entry)); }); return logs; } function formatTraceEntry({ vnode, recurseCount }) { const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``; const isRoot = vnode.component ? vnode.component.parent == null : false; const open = ` at <${formatComponentName( vnode.component, vnode.type, isRoot )}`; const close = `>` + postfix; return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close]; } function formatProps(props) { const res = []; const keys = Object.keys(props); keys.slice(0, 3).forEach((key) => { res.push(...formatProp(key, props[key])); }); if (keys.length > 3) { res.push(` ...`); } return res; } function formatProp(key, value, raw) { if (shared.isString(value)) { value = JSON.stringify(value); return raw ? value : [`${key}=${value}`]; } else if (typeof value === "number" || typeof value === "boolean" || value == null) { return raw ? value : [`${key}=${value}`]; } else if (reactivity.isRef(value)) { value = formatProp(key, reactivity.toRaw(value.value), true); return raw ? value : [`${key}=Ref<`, value, `>`]; } else if (shared.isFunction(value)) { return [`${key}=fn${value.name ? `<${value.name}>` : ``}`]; } else { value = reactivity.toRaw(value); return raw ? value : [`${key}=`, value]; } } function assertNumber(val, type) { if (val === void 0) { return; } else if (typeof val !== "number") { warn$1(`${type} is not a valid number - got ${JSON.stringify(val)}.`); } else if (isNaN(val)) { warn$1(`${type} is NaN - the duration expression might be incorrect.`); } } const ErrorCodes = { "SETUP_FUNCTION": 0, "0": "SETUP_FUNCTION", "RENDER_FUNCTION": 1, "1": "RENDER_FUNCTION", "NATIVE_EVENT_HANDLER": 5, "5": "NATIVE_EVENT_HANDLER", "COMPONENT_EVENT_HANDLER": 6, "6": "COMPONENT_EVENT_HANDLER", "VNODE_HOOK": 7, "7": "VNODE_HOOK", "DIRECTIVE_HOOK": 8, "8": "DIRECTIVE_HOOK", "TRANSITION_HOOK": 9, "9": "TRANSITION_HOOK", "APP_ERROR_HANDLER": 10, "10": "APP_ERROR_HANDLER", "APP_WARN_HANDLER": 11, "11": "APP_WARN_HANDLER", "FUNCTION_REF": 12, "12": "FUNCTION_REF", "ASYNC_COMPONENT_LOADER": 13, "13": "ASYNC_COMPONENT_LOADER", "SCHEDULER": 14, "14": "SCHEDULER", "COMPONENT_UPDATE": 15, "15": "COMPONENT_UPDATE", "APP_UNMOUNT_CLEANUP": 16, "16": "APP_UNMOUNT_CLEANUP" }; const ErrorTypeStrings$1 = { ["sp"]: "serverPrefetch hook", ["bc"]: "beforeCreate hook", ["c"]: "created hook", ["bm"]: "beforeMount hook", ["m"]: "mounted hook", ["bu"]: "beforeUpdate hook", ["u"]: "updated", ["bum"]: "beforeUnmount hook", ["um"]: "unmounted hook", ["a"]: "activated hook", ["da"]: "deactivated hook", ["ec"]: "errorCaptured hook", ["rtc"]: "renderTracked hook", ["rtg"]: "renderTriggered hook", [0]: "setup function", [1]: "render function", [2]: "watcher getter", [3]: "watcher callback", [4]: "watcher cleanup function", [5]: "native event handler", [6]: "component event handler", [7]: "vnode hook", [8]: "directive hook", [9]: "transition hook", [10]: "app errorHandler", [11]: "app warnHandler", [12]: "ref function", [13]: "async component loader", [14]: "scheduler flush", [15]: "component update", [16]: "app unmount cleanup function" }; function callWithErrorHandling(fn, instance, type, args) { try { return args ? fn(...args) : fn(); } catch (err) { handleError(err, instance, type); } } function callWithAsyncErrorHandling(fn, instance, type, args) { if (shared.isFunction(fn)) { const res = callWithErrorHandling(fn, instance, type, args); if (res && shared.isPromise(res)) { res.catch((err) => { handleError(err, instance, type); }); } return res; } if (shared.isArray(fn)) { const values = []; for (let i = 0; i < fn.length; i++) { values.push(callWithAsyncErrorHandling(fn[i], instance, type, args)); } return values; } else { warn$1( `Invalid value type passed to callWithAsyncErrorHandling(): ${typeof fn}` ); } } function handleError(err, instance, type, throwInDev = true) { const contextVNode = instance ? instance.vnode : null; const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || shared.EMPTY_OBJ; if (instance) { let cur = instance.parent; const exposedInstance = instance.proxy; const errorInfo = ErrorTypeStrings$1[type] ; while (cur) { const errorCapturedHooks = cur.ec; if (errorCapturedHooks) { for (let i = 0; i < errorCapturedHooks.length; i++) { if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) { return; } } } cur = cur.parent; } if (errorHandler) { reactivity.pauseTracking(); callWithErrorHandling(errorHandler, null, 10, [ err, exposedInstance, errorInfo ]); reactivity.resetTracking(); return; } } logError(err, type, contextVNode, throwInDev, throwUnhandledErrorInProduction); } function logError(err, type, contextVNode, throwInDev = true, throwInProd = false) { { const info = ErrorTypeStrings$1[type]; if (contextVNode) { pushWarningContext(contextVNode); } warn$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`); if (contextVNode) { popWarningContext(); } if (throwInDev) { throw err; } else { console.error(err); } } } const queue = []; let flushIndex = -1; const pendingPostFlushCbs = []; let activePostFlushCbs = null; let postFlushIndex = 0; const resolvedPromise = /* @__PURE__ */ Promise.resolve(); let currentFlushPromise = null; const RECURSION_LIMIT = 100; function nextTick(fn) { const p = currentFlushPromise || resolvedPromise; return fn ? p.then(this ? fn.bind(this) : fn) : p; } function findInsertionIndex(id) { let start = flushIndex + 1; let end = queue.length; while (start < end) { const middle = start + end >>> 1; const middleJob = queue[middle]; const middleJobId = getId(middleJob); if (middleJobId < id || middleJobId === id && middleJob.flags & 2) { start = middle + 1; } else { end = middle; } } return start; } function queueJob(job) { if (!(job.flags & 1)) { const jobId = getId(job); const lastJob = queue[queue.length - 1]; if (!lastJob || // fast path when the job id is larger than the tail !(job.flags & 2) && jobId >= getId(lastJob)) { queue.push(job); } else { queue.splice(findInsertionIndex(jobId), 0, job); } job.flags |= 1; queueFlush(); } } function queueFlush() { if (!currentFlushPromise) { currentFlushPromise = resolvedPromise.then(flushJobs); } } function queuePostFlushCb(cb) { if (!shared.isArray(cb)) { if (activePostFlushCbs && cb.id === -1) { activePostFlushCbs.splice(postFlushIndex + 1, 0, cb); } else if (!(cb.flags & 1)) { pendingPostFlushCbs.push(cb); cb.flags |= 1; } } else { pendingPostFlushCbs.push(...cb); } queueFlush(); } function flushPreFlushCbs(instance, seen, i = flushIndex + 1) { { seen = seen || /* @__PURE__ */ new Map(); } for (; i < queue.length; i++) { const cb = queue[i]; if (cb && cb.flags & 2) { if (instance && cb.id !== instance.uid) { continue; } if (checkRecursiveUpdates(seen, cb)) { continue; } queue.splice(i, 1); i--; if (cb.flags & 4) { cb.flags &= ~1; } cb(); if (!(cb.flags & 4)) { cb.flags &= ~1; } } } } function flushPostFlushCbs(seen) { if (pendingPostFlushCbs.length) { const deduped = [...new Set(pendingPostFlushCbs)].sort( (a, b) => getId(a) - getId(b) ); pendingPostFlushCbs.length = 0; if (activePostFlushCbs) { activePostFlushCbs.push(...deduped); return; } activePostFlushCbs = deduped; { seen = seen || /* @__PURE__ */ new Map(); } for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) { const cb = activePostFlushCbs[postFlushIndex]; if (checkRecursiveUpdates(seen, cb)) { continue; } if (cb.flags & 4) { cb.flags &= ~1; } if (!(cb.flags & 8)) cb(); cb.flags &= ~1; } activePostFlushCbs = null; postFlushIndex = 0; } } const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id; function flushJobs(seen) { { seen = seen || /* @__PURE__ */ new Map(); } const check = (job) => checkRecursiveUpdates(seen, job) ; try { for (flushIndex = 0; flushIndex < queue.length; flushIndex++) { const job = queue[flushIndex]; if (job && !(job.flags & 8)) { if (check(job)) { continue; } if (job.flags & 4) { job.flags &= ~1; } callWithErrorHandling( job, job.i, job.i ? 15 : 14 ); if (!(job.flags & 4)) { job.flags &= ~1; } } } } finally { for (; flushIndex < queue.length; flushIndex++) { const job = queue[flushIndex]; if (job) { job.flags &= ~1; } } flushIndex = -1; queue.length = 0; flushPostFlushCbs(seen); currentFlushPromise = null; if (queue.length || pendingPostFlushCbs.length) { flushJobs(seen); } } } function checkRecursiveUpdates(seen, fn) { const count = seen.get(fn) || 0; if (count > RECURSION_LIMIT) { const instance = fn.i; const componentName = instance && getComponentName(instance.type); handleError( `Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`, null, 10 ); return true; } seen.set(fn, count + 1); return false; } let isHmrUpdating = false; const hmrDirtyComponents = /* @__PURE__ */ new Map(); { shared.getGlobalThis().__VUE_HMR_RUNTIME__ = { createRecord: tryWrap(createRecord), rerender: tryWrap(rerender), reload: tryWrap(reload) }; } const map = /* @__PURE__ */ new Map(); function registerHMR(instance) { const id = instance.type.__hmrId; let record = map.get(id); if (!record) { createRecord(id, instance.type); record = map.get(id); } record.instances.add(instance); } function unregisterHMR(instance) { map.get(instance.type.__hmrId).instances.delete(instance); } function createRecord(id, initialDef) { if (map.has(id)) { return false; } map.set(id, { initialDef: normalizeClassComponent(initialDef), instances: /* @__PURE__ */ new Set() }); return true; } function normalizeClassComponent(component) { return isClassComponent(component) ? component.__vccOpts : component; } function rerender(id, newRender) { const record = map.get(id); if (!record) { return; } record.initialDef.render = newRender; [...record.instances].forEach((instance) => { if (newRender) { instance.render = newRender; normalizeClassComponent(instance.type).render = newRender; } instance.renderCache = []; isHmrUpdating = true; instance.update(); isHmrUpdating = false; }); } function reload(id, newComp) { const record = map.get(id); if (!record) return; newComp = normalizeClassComponent(newComp); updateComponentDef(record.initialDef, newComp); const instances = [...record.instances]; for (let i = 0; i < instances.length; i++) { const instance = instances[i]; const oldComp = normalizeClassComponent(instance.type); let dirtyInstances = hmrDirtyComponents.get(oldComp); if (!dirtyInstances) { if (oldComp !== record.initialDef) { updateComponentDef(oldComp, newComp); } hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set()); } dirtyInstances.add(instance); instance.appContext.propsCache.delete(instance.type); instance.appContext.emitsCache.delete(instance.type); instance.appContext.optionsCache.delete(instance.type); if (instance.ceReload) { dirtyInstances.add(instance); instance.ceReload(newComp.styles); dirtyInstances.delete(instance); } else if (instance.parent) { queueJob(() => { isHmrUpdating = true; instance.parent.update(); isHmrUpdating = false; dirtyInstances.delete(instance); }); } else if (instance.appContext.reload) { instance.appContext.reload(); } else if (typeof window !== "undefined") { window.location.reload(); } else { console.warn( "[HMR] Root or manually mounted instance modified. Full reload required." ); } if (instance.root.ce && instance !== instance.root) { instance.root.ce._removeChildStyle(oldComp); } } queuePostFlushCb(() => { hmrDirtyComponents.clear(); }); } function updateComponentDef(oldComp, newComp) { shared.extend(oldComp, newComp); for (const key in oldComp) { if (key !== "__file" && !(key in newComp)) { delete oldComp[key]; } } } function tryWrap(fn) { return (id, arg) => { try { return fn(id, arg); } catch (e) { console.error(e); console.warn( `[HMR] Something went wrong during Vue component hot-reload. Full reload required.` ); } }; } let devtools$1; let buffer = []; let devtoolsNotInstalled = false; function emit$1(event, ...args) { if (devtools$1) { devtools$1.emit(event, ...args); } else if (!devtoolsNotInstalled) { buffer.push({ event, args }); } } function setDevtoolsHook$1(hook, target) { var _a, _b; devtools$1 = hook; if (devtools$1) { devtools$1.enabled = true; buffer.forEach(({ event, args }) => devtools$1.emit(event, ...args)); buffer = []; } else if ( // handle late devtools injection - only do this if we are in an actual // browser environment to avoid the timer handle stalling test runner exit // (#4815) typeof window !== "undefined" && // some envs mock window but not fully window.HTMLElement && // also exclude jsdom // eslint-disable-next-line no-restricted-syntax !((_b = (_a = window.navigator) == null ? void 0 : _a.userAgent) == null ? void 0 : _b.includes("jsdom")) ) { const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || []; replay.push((newHook) => { setDevtoolsHook$1(newHook, target); }); setTimeout(() => { if (!devtools$1) { target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null; devtoolsNotInstalled = true; buffer = []; } }, 3e3); } else { devtoolsNotInstalled = true; buffer = []; } } function devtoolsInitApp(app, version) { emit$1("app:init" /* APP_INIT */, app, version, { Fragment, Text, Comment, Static }); } function devtoolsUnmountApp(app) { emit$1("app:unmount" /* APP_UNMOUNT */, app); } const devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook("component:added" /* COMPONENT_ADDED */); const devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook("component:updated" /* COMPONENT_UPDATED */); const _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook( "component:removed" /* COMPONENT_REMOVED */ ); const devtoolsComponentRemoved = (component) => { if (devtools$1 && typeof devtools$1.cleanupBuffer === "function" && // remove the component if it wasn't buffered !devtools$1.cleanupBuffer(component)) { _devtoolsComponentRemoved(component); } }; /*! #__NO_SIDE_EFFECTS__ */ // @__NO_SIDE_EFFECTS__ function createDevtoolsComponentHook(hook) { return (component) => { emit$1( hook, component.appContext.app, component.uid, component.parent ? component.parent.uid : void 0, component ); }; } const devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook("perf:start" /* PERFORMANCE_START */); const devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook("perf:end" /* PERFORMANCE_END */); function createDevtoolsPerformanceHook(hook) { return (component, type, time) => { emit$1(hook, component.appContext.app, component.uid, component, type, time); }; } function devtoolsComponentEmit(component, event, params) { emit$1( "component:emit" /* COMPONENT_EMIT */, component.appContext.app, component, event, params ); } let currentRenderingInstance = null; let currentScopeId = null; function setCurrentRenderingInstance(instance) { const prev = currentRenderingInstance; currentRenderingInstance = instance; currentScopeId = instance && instance.type.__scopeId || null; return prev; } function pushScopeId(id) { currentScopeId = id; } function popScopeId() { currentScopeId = null; } const withScopeId = (_id) => withCtx; function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) { if (!ctx) return fn; if (fn._n) { return fn; } const renderFnWithContext = (...args) => { if (renderFnWithContext._d) { setBlockTracking(-1); } const prevInstance = setCurrentRenderingInstance(ctx); let res; try { res = fn(...args); } finally { setCurrentRenderingInstance(prevInstance); if (renderFnWithContext._d) { setBlockTracking(1); } } { devtoolsComponentUpdated(ctx); } return res; }; renderFnWithContext._n = true; renderFnWithContext._c = true; renderFnWithContext._d = true; return renderFnWithContext; } function validateDirectiveName(name) { if (shared.isBuiltInDirective(name)) { warn$1("Do not use built-in directive ids as custom directive id: " + name); } } function withDirectives(vnode, directives) { if (currentRenderingInstance === null) { warn$1(`withDirectives can only be used inside render functions.`); return vnode; } const instance = getComponentPublicInstance(currentRenderingInstance); const bindings = vnode.dirs || (vnode.dirs = []); for (let i = 0; i < directives.length; i++) { let [dir, value, arg, modifiers = shared.EMPTY_OBJ] = directives[i]; if (dir) { if (shared.isFunction(dir)) { dir = { mounted: dir, updated: dir }; } if (dir.deep) { reactivity.traverse(value); } bindings.push({ dir, instance, value, oldValue: void 0, arg, modifiers }); } } return vnode; } function invokeDirectiveHook(vnode, prevVNode, instance, name) { const bindings = vnode.dirs; const oldBindings = prevVNode && prevVNode.dirs; for (let i = 0; i < bindings.length; i++) { const binding = bindings[i]; if (oldBindings) { binding.oldValue = oldBindings[i].value; } let hook = binding.dir[name]; if (hook) { reactivity.pauseTracking(); callWithAsyncErrorHandling(hook, instance, 8, [ vnode.el, binding, vnode, prevVNode ]); reactivity.resetTracking(); } } } const TeleportEndKey = Symbol("_vte"); const isTeleport = (type) => type.__isTeleport; const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === ""); const isTeleportDeferred = (props) => props && (props.defer || props.defer === ""); const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target instanceof SVGElement; const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement; const resolveTarget = (props, select) => { const targetSelector = props && props.to; if (shared.isString(targetSelector)) { if (!select) { warn$1( `Current renderer does not support string target for Teleports. (missing querySelector renderer option)` ); return null; } else { const target = select(targetSelector); if (!target && !isTeleportDisabled(props)) { warn$1( `Failed to locate Teleport target with selector "${targetSelector}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.` ); } return target; } } else { if (!targetSelector && !isTeleportDisabled(props)) { warn$1(`Invalid Teleport target: ${targetSelector}`); } return targetSelector; } }; const TeleportImpl = { name: "Teleport", __isTeleport: true, process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) { const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment } } = internals; const disabled = isTeleportDisabled(n2.props); let { shapeFlag, children, dynamicChildren } = n2; if (isHmrUpdating) { optimized = false; dynamicChildren = null; } if (n1 == null) { const placeholder = n2.el = createComment("teleport start") ; const mainAnchor = n2.anchor = createComment("teleport end") ; insert(placeholder, container, anchor); insert(mainAnchor, container, anchor); const mount = (container2, anchor2) => { if (shapeFlag & 16) { if (parentComponent && parentComponent.isCE) { parentComponent.ce._teleportTarget = container2; } mountChildren( children, container2, anchor2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized ); } }; const mountToTarget = () => { const target = n2.target = resolveTarget(n2.props, querySelector); const targetAnchor = prepareAnchor(target, n2, createText, insert); if (target) { if (namespace !== "svg" && isTargetSVG(target)) { namespace = "svg"; } else if (namespace !== "mathml" && isTargetMathML(target)) { namespace = "mathml"; } if (!disabled) { mount(target, targetAnchor); updateCssVars(n2, false); } } else if (!disabled) { warn$1( "Invalid Teleport target on mount:", target, `(${typeof target})` ); } }; if (disabled) { mount(container, mainAnchor); updateCssVars(n2, true); } if (isTeleportDeferred(n2.props)) { queuePostRenderEffect(() => { mountToTarget(); n2.el.__isMounted = true; }, parentSuspense); } else { mountToTarget(); } } else { if (isTeleportDeferred(n2.props) && !n1.el.__isMounted) { queuePostRenderEffect(() => { TeleportImpl.process( n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals ); delete n1.el.__isMounted; }, parentSuspense); return; } n2.el = n1.el; n2.targetStart = n1.targetStart; const mainAnchor = n2.anchor = n1.anchor; const target = n2.target = n1.target; const targetAnchor = n2.targetAnchor = n1.targetAnchor; const wasDisabled = isTeleportDisabled(n1.props); const currentContainer = wasDisabled ? container : target; const currentAnchor = wasDisabled ? mainAnchor : targetAnchor; if (namespace === "svg" || isTargetSVG(target)) { namespace = "svg"; } else if (namespace === "mathml" || isTargetMathML(target)) { namespace = "mathml"; } if (dynamicChildren) { patchBlockChildren( n1.dynamicChildren, dynamicChildren, currentContainer, parentComponent, parentSuspense, namespace, slotScopeIds ); traverseStaticChildren(n1, n2, true); } else if (!optimized) { patchChildren( n1, n2, currentContainer, currentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, false ); } if (disabled) { if (!wasDisabled) { moveTeleport( n2, container, mainAnchor, internals, 1 ); } else { if (n2.props && n1.props && n2.props.to !== n1.props.to) { n2.props.to = n1.props.to; } } } else { if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) { const nextTarget = n2.target = resolveTarget( n2.props, querySelector ); if (nextTarget) { moveTeleport( n2, nextTarget, null, internals, 0 ); } else { warn$1( "Invalid Teleport target on update:", target, `(${typeof target})` ); } } else if (wasDisabled) { moveTeleport( n2, target, targetAnchor, internals, 1 ); } } updateCssVars(n2, disabled); } }, remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) { const { shapeFlag, children, anchor, targetStart, targetAnchor, target, props } = vnode; if (target) { hostRemove(targetStart); hostRemove(targetAnchor); } doRemove && hostRemove(anchor); if (shapeFlag & 16) { const shouldRemove = doRemove || !isTeleportDisabled(props); for (let i = 0; i < children.length; i++) { const child = children[i]; unmount( child, parentComponent, parentSuspense, shouldRemove, !!child.dynamicChildren ); } } }, move: moveTeleport, hydrate: hydrateTeleport }; function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) { if (moveType === 0) { insert(vnode.targetAnchor, container, parentAnchor); } const { el, anchor, shapeFlag, children, props } = vnode; const isReorder = moveType === 2; if (isReorder) { insert(el, container, parentAnchor); } if (!isReorder || isTeleportDisabled(props)) { if (shapeFlag & 16) { for (let i = 0; i < children.length; i++) { move( children[i], container, parentAnchor, 2 ); } } } if (isReorder) { insert(anchor, container, parentAnchor); } } function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, { o: { nextSibling, parentNode, querySelector, insert, createText } }, hydrateChildren) { const target = vnode.target = resolveTarget( vnode.props, querySelector ); if (target) { const disabled = isTeleportDisabled(vnode.props); const targetNode = target._lpa || target.firstChild; if (vnode.shapeFlag & 16) { if (disabled) { vnode.anchor = hydrateChildren( nextSibling(node), vnode, parentNode(node), parentComponent, parentSuspense, slotScopeIds, optimized ); vnode.targetStart = targetNode; vnode.targetAnchor = targetNode && nextSibling(targetNode); } else { vnode.anchor = nextSibling(node); let targetAnchor = targetNode; while (targetAnchor) { if (targetAnchor && targetAnchor.nodeType === 8) { if (targetAnchor.data === "teleport start anchor") { vnode.targetStart = targetAnchor; } else if (targetAnchor.data === "teleport anchor") { vnode.targetAnchor = targetAnchor; target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor); break; } } targetAnchor = nextSibling(targetAnchor); } if (!vnode.targetAnchor) { prepareAnchor(target, vnode, createText, insert); } hydrateChildren( targetNode && nextSibling(targetNode), vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized ); } } updateCssVars(vnode, disabled); } return vnode.anchor && nextSibling(vnode.anchor); } const Teleport = TeleportImpl; function updateCssVars(vnode, isDisabled) { const ctx = vnode.ctx; if (ctx && ctx.ut) { let node, anchor; if (isDisabled) { node = vnode.el; anchor = vnode.anchor; } else { node = vnode.targetStart; anchor = vnode.targetAnchor; } while (node && node !== anchor) { if (node.nodeType === 1) node.setAttribute("data-v-owner", ctx.uid); node = node.nextSibling; } ctx.ut(); } } function prepareAnchor(target, vnode, createText, insert) { const targetStart = vnode.targetStart = createText(""); const targetAnchor = vnode.targetAnchor = createText(""); targetStart[TeleportEndKey] = targetAnchor; if (target) { insert(targetStart, target); insert(targetAnchor, target); } return targetAnchor; } const leaveCbKey = Symbol("_leaveCb"); const enterCbKey = Symbol("_enterCb"); function useTransitionState() { const state = { isMounted: false, isLeaving: false, isUnmounting: false, leavingVNodes: /* @__PURE__ */ new Map() }; onMounted(() => { state.isMounted = true; }); onBeforeUnmount(() => { state.isUnmounting = true; }); return state; } const TransitionHookValidator = [Function, Array]; const BaseTransitionPropsValidators = { mode: String, appear: Boolean, persisted: Boolean, // enter onBeforeEnter: TransitionHookValidator, onEnter: TransitionHookValidator, onAfterEnter: TransitionHookValidator, onEnterCancelled: TransitionHookValidator, // leave onBeforeLeave: TransitionHookValidator, onLeave: TransitionHookValidator, onAfterLeave: TransitionHookValidator, onLeaveCancelled: TransitionHookValidator, // appear onBeforeAppear: TransitionHookValidator, onAppear: TransitionHookValidator, onAfterAppear: TransitionHookValidator, onAppearCancelled: TransitionHookValidator }; const recursiveGetSubtree = (instance) => { const subTree = instance.subTree; return subTree.component ? recursiveGetSubtree(subTree.component) : subTree; }; const BaseTransitionImpl = { name: `BaseTransition`, props: BaseTransitionPropsValidators, setup(props, { slots }) { const instance = getCurrentInstance(); const state = useTransitionState(); return () => { const children = slots.default && getTransitionRawChildren(slots.default(), true); if (!children || !children.length) { return; } const child = findNonCommentChild(children); const rawProps = reactivity.toRaw(props); const { mode } = rawProps; if (mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") { warn$1(`invalid <transition> mode: ${mode}`); } if (state.isLeaving) { return emptyPlaceholder(child); } const innerChild = getInnerChild$1(child); if (!innerChild) { return emptyPlaceholder(child); } let enterHooks = resolveTransitionHooks( innerChild, rawProps, state, instance, // #11061, ensure enterHooks is fresh after clone (hooks) => enterHooks = hooks ); if (innerChild.type !== Comment) { setTransitionHooks(innerChild, enterHooks); } let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree); if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) { let leavingHooks = resolveTransitionHooks( oldInnerChild, rawProps, state, instance ); setTransitionHooks(oldInnerChild, leavingHooks); if (mode === "out-in" && innerChild.type !== Comment) { state.isLeaving = true; leavingHooks.afterLeave = () => { state.isLeaving = false; if (!(instance.job.flags & 8)) { instance.update(); } delete leavingHooks.afterLeave; oldInnerChild = void 0; }; return emptyPlaceholder(child); } else if (mode === "in-out" && innerChild.type !== Comment) { leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => { const leavingVNodesCache = getLeavingNodesForType( state, oldInnerChild ); leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild; el[leaveCbKey] = () => { earlyRemove(); el[leaveCbKey] = void 0; delete enterHooks.delayedLeave; oldInnerChild = void 0; }; enterHooks.delayedLeave = () => { delayedLeave(); delete enterHooks.delayedLeave; oldInnerChild = void 0; }; }; } else { oldInnerChild = void 0; } } else if (oldInnerChild) { oldInnerChild = void 0; } return child; }; } }; function findNonCommentChild(children) { let child = children[0]; if (children.length > 1) { let hasFound = false; for (const c of children) { if (c.type !== Comment) { if (hasFound) { warn$1( "<transition> can only be used on a single element or component. Use <transition-group> for lists." ); break; } child = c; hasFound = true; } } } return child; } const BaseTransition = BaseTransitionImpl; function getLeavingNodesForType(state, vnode) { const { leavingVNodes } = state; let leavingVNodesCache = leavingVNodes.get(vnode.type); if (!leavingVNodesCache) { leavingVNodesCache = /* @__PURE__ */ Object.create(null); leavingVNodes.set(vnode.type, leavingVNodesCache); } return leavingVNodesCache; } function resolveTransitionHooks(vnode, props, state, instance, postClone) { const { appear, mode, persisted = false, onBeforeEnter, onEnter, onAfterEnter, onEnterCancelled, onBeforeLeave, onLeave, onAfterLeave, onLeaveCancelled, onBeforeAppear, onAppear, onAfterAppear, onAppearCancelled } = props; const key = String(vnode.key); const leavingVNodesCache = getLeavingNodesForType(state, vnode); const callHook = (hook, args) => { hook && callWithAsyncErrorHandling( hook, instance, 9, args ); }; const callAsyncHook = (hook, args) => { const done = args[1]; callHook(hook, args); if (shared.isArray(hook)) { if (hook.every((hook2) => hook2.length <= 1)) done(); } else if (hook.length <= 1) { done(); } }; const hooks = { mode, persisted, beforeEnter(el) { let hook = onBeforeEnter; if (!state.isMounted) { if (appear) { hook = onBeforeAppear || onBeforeEnter; } else { return; } } if (el[leaveCbKey]) { el[leaveCbKey]( true /* cancelled */ ); } const leavingVNode = leavingVNodesCache[key]; if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) { leavingVNode.el[leaveCbKey](); } callHook(hook, [el]); }, enter(el) { let hook = onEnter; let afterHook = onAfterEnter; let cancelHook = onEnterCancelled; if (!state.isMounted) { if (appear) { hook = onAppear || onEnter; afterHook = onAfterAppear || onAfterEnter; cancelHook = onAppearCancelled || onEnterCancelled; } else { return; } } let called = false; const done = el[enterCbKey] = (cancelled) => { if (called) return; called = true; if (cancelled) { callHook(cancelHook, [el]); } else { callHook(afterHook, [el]); } if (hooks.delayedLeave) { hooks.delayedLeave(); } el[enterCbKey] = void 0; }; if (hook) { callAsyncHook(hook, [el, done]); } else { done(); } }, leave(el, remove) { const key2 = String(vnode.key); if (el[enterCbKey]) { el[enterCbKey]( true /* cancelled */ ); } if (state.isUnmounting) { return remove(); } callHook(onBeforeLeave, [el]); let called = false; const done = el[leaveCbKey] = (cancelled) => { if (called) return; called = true; remove(); if (cancelled) { callHook(onLeaveCancelled, [el]); } else { callHook(onAfterLeave, [el]); } el[leaveCbKey] = void 0; if (leavingVNodesCache[key2] === vnode) { delete leavingVNodesCache[key2]; } }; leavingVNodesCache[key2] = vnode; if (onLeave) { callAsyncHook(onLeave, [el, done]); } else { done(); } }, clone(vnode2) { const hooks2 = resolveTransitionHooks( vnode2, props, state, instance, postClone ); if (postClone) postClone(hooks2); return hooks2; } }; return hooks; } function emptyPlaceholder(vnode) { if (isKeepAlive(vnode)) { vnode = cloneVNode(vnode); vnode.children = null; return vnode; } } function getInnerChild$1(vnode) { if (!isKeepAlive(vnode)) { if (isTeleport(vnode.type) && vnode.children) { return findNonCommentChild(vnode.children); } return vnode; } if (vnode.component) { return vnode.component.subTree; } const { shapeFlag, children } = vnode; if (children) { if (shapeFlag & 16) { return children[0]; } if (shapeFlag & 32 && shared.isFunction(children.default)) { return children.default(); } } } function setTransitionHooks(vnode, hooks) { if (vnode.shapeFlag & 6 && vnode.component) { vnode.transition = hooks; setTransitionHooks(vnode.component.subTree, hooks); } else if (vnode.shapeFlag & 128) { vnode.ssContent.transition = hooks.clone(vnode.ssContent); vnode.ssFallback.transition = hooks.clone(vnode.ssFallback); } else { vnode.transition = hooks; } } function getTransitionRawChildren(children, keepComment = false, parentKey) { let ret = []; let keyedFragmentCount = 0; for (let i = 0; i < children.length; i++) { let child = children[i]; const key = parentKey == null ? child.key : String(parentKey) + String(child.key != null ? child.key : i); if (child.type === Fragment) { if (child.patchFlag & 128) keyedFragmentCount++; ret = ret.concat( getTransitionRawChildren(child.children, keepComment, key) ); } else if (keepComment || child.type !== Comment) { ret.push(key != null ? cloneVNode(child, { key }) : child); } } if (keyedFragmentCount > 1) { for (let i = 0; i < ret.length; i++) { ret[i].patchFlag = -2; } } return ret; } /*! #__NO_SIDE_EFFECTS__ */ // @__NO_SIDE_EFFECTS__ function defineComponent(options, extraOptions) { return shared.isFunction(options) ? ( // #8236: extend call and options.name access are considered side-effects // by Rollup, so we have to wrap it in a pure-annotated IIFE. /* @__PURE__ */ (() => shared.extend({ name: options.name }, extraOptions, { setup: options }))() ) : options; } function useId() { const i = getCurrentInstance(); if (i) { return (i.appContext.config.idPrefix || "v") + "-" + i.ids[0] + i.ids[1]++; } else { warn$1( `useId() is called when there is no active component instance to be associated with.` ); } return ""; } function markAsyncBoundary(instance) { instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0]; } const knownTemplateRefs = /* @__PURE__ */ new WeakSet(); function useTemplateRef(key) { const i = getCurrentInstance(); const r = reactivity.shallowRef(null); if (i) { const refs = i.refs === shared.EMPTY_OBJ ? i.refs = {} : i.refs; let desc; if ((desc = Object.getOwnPropertyDescriptor(refs, key)) && !desc.configurable) { warn$1(`useTemplateRef('${key}') already exists.`); } else { Object.defineProperty(refs, key, { enumerable: true, get: () => r.value, set: (val) => r.value = val }); } } else { warn$1( `useTemplateRef() is called when there is no active component instance to be associated with.` ); } const ret = reactivity.readonly(r) ; { knownTemplateRefs.add(ret); } return ret; } function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) { if (shared.isArray(rawRef)) { rawRef.forEach( (r, i) => setRef( r, oldRawRef && (shared.isArray(oldRawRef) ? oldRawRef[i] : oldRawRef), parentSuspense, vnode, isUnmount ) ); return; } if (isAsyncWrapper(vnode) && !isUnmount) { if (vnode.shapeFlag & 512 && vnode.type.__asyncResolved && vnode.component.subTree.component) { setRef(rawRef, oldRawRef, parentSuspense, vnode.component.subTree); } return; } const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el; const value = isUnmount ? null : refValue; const { i: owner, r: ref } = rawRef; if (!owner) { warn$1( `Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.` ); return; } const oldRef = oldRawRef && oldRawRef.r; const refs = owner.refs === shared.EMPTY_OBJ ? owner.refs = {} : owner.refs; const setupState = owner.setupState; const rawSetupState = reactivity.toRaw(setupState); const canSetSetupRef = setupState === shared.EMPTY_OBJ ? () => false : (key) => { { if (shared.hasOwn(rawSetupState, key) && !reactivity.isRef(rawSetupState[key])) { warn$1( `Template ref "${key}" used on a non-ref value. It will not work in the production build.` ); } if (knownTemplateRefs.has(rawSetupState[key])) { return false; } } return shared.hasOwn(rawSetupState, key); }; if (oldRef != null && oldRef !== ref) { if (shared.isString(oldRef)) { refs[oldRef] = null; if (canSetSetupRef(oldRef)) { setupState[oldRef] = null; } } else if (reactivity.isRef(oldRef)) { oldRef.value = null; } } if (shared.isFunction(ref)) { callWithErrorHandling(ref, owner, 12, [value, refs]); } else { const _isString = shared.isString(ref); const _isRef = reactivity.isRef(ref); if (_isString || _isRef) { const doSet = () => { if (rawRef.f) { const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : ref.value; if (isUnmount) { shared.isArray(existing) && shared.remove(existing, refValue); } else { if (!shared.isArray(existing)) { if (_isString) { refs[ref] = [refValue]; if (canSetSetupRef(ref)) { setupState[ref] = refs[ref]; } } else { ref.value = [refValue]; if (rawRef.k) refs[rawRef.k] = ref.value; } } else if (!existing.includes(refValue)) { existing.push(refValue); } } } else if (_isString) { refs[ref] = value; if (canSetSetupRef(ref)) { setupState[ref] = value; } } else if (_isRef) { ref.value = value; if (rawRef.k) refs[rawRef.k] = value; } else { warn$1("Invalid template ref type:", ref, `(${typeof ref})`); } }; if (value) { doSet.id = -1; queuePostRenderEffect(doSet, parentSuspense); } else { doSet(); } } else { warn$1("Invalid template ref type:", ref, `(${typeof ref})`); } } } let hasLoggedMismatchError = false; const logMismatchError = () => { if (hasLoggedMismatchError) { return; } console.error("Hydration completed but contains mismatches."); hasLoggedMismatchError = true; }; const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject"; const isMathMLContainer = (container) => container.namespaceURI.includes("MathML"); const getContainerType = (container) => { if (container.nodeType !== 1) return void 0; if (isSVGContainer(container)) return "svg"; if (isMathMLContainer(container)) return "mathml"; return void 0; }; const isComment = (node) => node.nodeType === 8; function createHydrationFunctions(rendererInternals) { const { mt: mountComponent, p: patch, o: { patchProp, createText, nextSibling, parentNode, remove, insert, createComment } } = rendererInternals; const hydrate = (vnode, container) => { if (!container.hasChildNodes()) { warn$1( `Attempting to hydrate existing markup but container is empty. Performing full mount instead.` ); patch(null, vnode, container); flushPostFlushCbs(); container._vnode = vnode; return; } hydrateNode(container.firstChild, vnode, null, null, null); flushPostFlushCbs(); container._vnode = vnode; }; const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => { optimized = optimized || !!vnode.dynamicChildren; const isFragmentStart = isComment(node) && node.data === "["; const onMismatch = () => handleMismatch( node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragmentStart ); const { type, ref, shapeFlag, patchFlag } = vnode; let domType = node.nodeType; vnode.el = node; { shared.def(node, "__vnode", vnode, true); shared.def(node, "__vueParentComponent", parentComponent, true); } if (patchFlag === -2) { optimized = false; vnode.dynamicChildren = null; } let nextNode = null; switch (type) { case Text: if (domType !== 3) { if (vnode.children === "") { insert(vnode.el = createText(""), parentNode(node), node); nextNode = node; } else { nextNode = onMismatch(); } } else { if (node.data !== vnode.children) { warn$1( `Hydration text mismatch in`, node.parentNode, ` - rendered on server: ${JSON.stringify( node.data )} - expected on client: ${JSON.stringify(vnode.children)}` ); logMismatchError(); node.data = vnode.children; } nextNode = nextSibling(node); } break; case Comment: if (isTemplateNode(node)) { nextNode = nextSibling(node); replaceNode( vnode.el = node.content.firstChild, node, parentComponent ); } else if (domType !== 8 || isFragmentStart) { nextNode = onMismatch(); } else { nextNode = nextSibling(node); } break; case Static: if (isFragmentStart) { node = nextSibling(node); domType = node.nodeType; } if (domType === 1 || domType === 3) { nextNode = node; const needToAdoptContent = !vnode.children.length; for (let i = 0; i < vnode.staticCount; i++) { if (needToAdoptContent) vnode.children += nextNode.nodeType === 1 ? nextNode.outerHTML : nextNode.data; if (i === vnode.staticCount - 1) { vnode.anchor = nextNode; } nextNode = nextSibling(nextNode); } return isFragmentStart ? nextSibling(nextNode) : nextNode; } else { onMismatch(); } break; case Fragment: if (!isFragmentStart) { nextNode = onMismatch(); } else { nextNode = hydrateFragment( node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized ); } break; default: if (shapeFlag & 1) { if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) { nextNode = onMismatch(); } else { nextNode = hydrateElement( node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized ); } } else if (shapeFlag & 6) { vnode.slotScopeIds = slotScopeIds; const container = parentNode(node); if (isFragmentStart) { nextNode = locateClosingAnchor(node); } else if (isComment(node) && node.data === "teleport start") { nextNode = locateClosingAnchor(node, node.data, "teleport end"); } else { nextNode = nextSibling(node); } mountComponent( vnode, container, null, parentComponent, parentSuspense, getContainerType(container), optimized ); if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) { let subTree; if (isFragmentStart) { subTree = createVNode(Fragment); subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild; } else { subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div"); } subTree.el = node; vnode.component.subTree = subTree; } } else if (shapeFlag & 64) { if (domType !== 8) { nextNode = onMismatch(); } else { nextNode = vnode.type.hydrate( node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, rendererInternals, hydrateChildren ); } } else if (shapeFlag & 128) { nextNode = vnode.type.hydrate( node, vnode, parentComponent, parentSuspense, getContainerType(parentNode(node)), slotScopeIds, optimized, rendererInternals, hydrateNode ); } else { warn$1("Invalid HostVNode type:", type, `(${typeof type})`); } } if (ref != null) { setRef(ref, null, parentSuspense, vnode); } return nextNode; }; const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => { optimized = optimized || !!vnode.dynamicChildren; const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode; const forcePatch = type === "input" || type === "option"; { if (dirs) { invokeDirectiveHook(vnode, null, parentComponent, "created"); } let needCallTransitionHooks = false; if (isTemplateNode(el)) { needCallTransitionHooks = needTransition( null, // no need check parentSuspense in hydration transition ) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear; const content = el.content.firstChild; if (needCallTransitionHooks) { transition.beforeEnter(content); } replaceNode(content, el, parentComponent); vnode.el = el = content; } if (shapeFlag & 16 && // skip if element has innerHTML / textContent !(props && (props.innerHTML || props.textContent))) { let next = hydrateChildren( el.firstChild, vnode, el, parentComponent, parentSuspense, slotScopeIds, optimized ); let hasWarned = false; while (next) { if (!isMismatchAllowed(el, 1 /* CHILDREN */)) { if (!hasWarned) { warn$1( `Hydration children mismatch on`, el, ` Server rendered element contains more child nodes than client vdom.` ); hasWarned = true; } logMismatchError(); } const cur = next; next = next.nextSibling; remove(cur); } } else if (shapeFlag & 8) { let clientText = vnode.children; if (clientText[0] === "\n" && (el.tagName === "PRE" || el.tagName === "TEXTAREA")) { clientText = clientText.slice(1); } if (el.textContent !== clientText) { if (!isMismatchAllowed(el, 0 /* TEXT */)) { warn$1( `Hydration text content mismatch on`, el, ` - rendered on server: ${el.textContent} - expected on client: ${vnode.children}` ); logMismatchError(); } el.textContent = vnode.children; } } if (props) { { const isCustomElement = el.tagName.includes("-"); for (const key in props) { if (// #11189 skip if this node has directives that have created hooks // as it could have mutated the DOM in any possible way !(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) { logMismatchError(); } if (forcePatch && (key.endsWith("value") || key === "indeterminate") || shared.isOn(key) && !shared.isReservedProp(key) || // force hydrate v-bind with .prop modifiers key[0] === "." || isCustomElement) { patchProp(el, key, null, props[key], void 0, parentComponent); } } } } let vnodeHooks; if (vnodeHooks = props && props.onVnodeBeforeMount) { invokeVNodeHook(vnodeHooks, parentComponent, vnode); } if (dirs) { invokeDirectiveHook(vnode, null, parentComponent, "beforeMount"); } if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) { queueEffectWithSuspense(() => { vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode); needCallTransitionHooks && transition.enter(el); dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted"); }, parentSuspense); } } return el.nextSibling; }; const hydrateChildren = (node, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized) => { optimized = optimized || !!parentVNode.dynamicChildren; const children = parentVNode.children; const l = children.length; let hasWarned = false; for (let i = 0; i < l; i++) { const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]); const isText = vnode.type === Text; if (node) { if (isText && !optimized) { if (i + 1 < l && normalizeVNode(children[i + 1]).type === Text) { insert( createText( node.data.slice(vnode.children.length) ), container, nextSibling(node) ); node.data = vnode.children; } } node = hydrateNode( node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized ); } else if (isText && !vnode.children) { insert(vnode.el = createText(""), container); } else { if (!isMismatchAllowed(container, 1 /* CHILDREN */)) { if (!hasWarned) { warn$1( `Hydration children mismatch on`, container, ` Server rendered element contains fewer child nodes than client vdom.` ); hasWarned = true; } logMismatchError(); } patch( null, vnode, container, null, parentComponent, parentSuspense, getContainerType(container), slotScopeIds ); } } return node; }; const hydrateFragment = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => { const { slotScopeIds: fragmentSlotScopeIds } = vnode; if (fragmentSlotScopeIds) { slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds; } const container = parentNode(node); const next = hydrateChildren( nextSibling(node), vnode, container, parentComponent, parentSuspense, slotScopeIds, optimized ); if (next && isComment(next) && next.data === "]") { return nextSibling(vnode.anchor = next); } else { logMismatchError(); insert(vnode.anchor = createComment(`]`), container, next); return next; } }; const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => { if (!isMismatchAllowed(node.parentElement, 1 /* CHILDREN */)) { warn$1( `Hydration node mismatch: - rendered on server:`, node, node.nodeType === 3 ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``, ` - expected on client:`, vnode.type ); logMismatchError(); } vnode.el = null; if (isFragment) { const end = locateClosingAnchor(node); while (true) { const next2 = nextSibling(node); if (next2 && next2 !== end) { remove(next2); } else { break; } } } const next = nextSibling(node); const container = parentNode(node); remove(node); patch( null, vnode, container, next, parentComponent, parentSuspense, getContainerType(container), slotScopeIds ); if (parentComponent) { parentComponent.vnode.el = vnode.el; updateHOCHostEl(parentComponent, vnode.el); } return next; }; const locateClosingAnchor = (node, open = "[", close = "]") => { let match = 0; while (node) { node = nextSibling(node); if (node && isComment(node)) { if (node.data === open) match++; if (node.data === close) { if (match === 0) { return nextSibling(node); } else { match--; } } } } return node; }; const replaceNode = (newNode, oldNode, parentComponent) => { const parentNode2 = oldNode.parentNode; if (parentNode2) { parentNode2.replaceChild(newNode, oldNode); } let parent = parentComponent; while (parent) { if (parent.vnode.el === oldNode) { parent.vnode.el = parent.subTree.el = newNode; } parent = parent.parent; } }; const isTemplateNode = (node) => { return node.nodeType === 1 && node.tagName === "TEMPLATE"; }; return [hydrate, hydrateNode]; } function propHasMismatch(el, key, clientValue, vnode, instance) { let mismatchType; let mismatchKey; let actual; let expected; if (key === "class") { actual = el.getAttribute("class"); expected = shared.normalizeClass(clientValue); if (!isSetEqual(toClassSet(actual || ""), toClassSet(expected))) { mismatchType = 2 /* CLASS */; mismatchKey = `class`; } } else if (key === "style") { actual = el.getAttribute("style") || ""; expected = shared.isString(clientValue) ? clientValue : shared.stringifyStyle(shared.normalizeStyle(clientValue)); const actualMap = toStyleMap(actual); const expectedMap = toStyleMap(expected); if (vnode.dirs) { for (const { dir, value } of vnode.dirs) { if (dir.name === "show" && !value) { expectedMap.set("display", "none"); } } } if (instance) { resolveCssVars(instance, vnode, expectedMap); } if (!isMapEqual(actualMap, expectedMap)) { mismatchType = 3 /* STYLE */; mismatchKey = "style"; } } else if (el instanceof SVGElement && shared.isKnownSvgAttr(key) || el instanceof HTMLElement && (shared.isBooleanAttr(key) || shared.isKnownHtmlAttr(key))) { if (shared.isBooleanAttr(key)) { actual = el.hasAttribute(key); expected = shared.includeBooleanAttr(clientValue); } else if (clientValue == null) { actual = el.hasAttribute(key); expected = false; } else { if (el.hasAttribute(key)) { actual = el.getAttribute(key); } else if (key === "value" && el.tagName === "TEXTAREA") { actual = el.value; } else { actual = false; } expected = shared.isRenderableAttrValue(clientValue) ? String(clientValue) : false; } if (actual !== expected) { mismatchType = 4 /* ATTRIBUTE */; mismatchKey = key; } } if (mismatchType != null && !isMismatchAllowed(el, mismatchType)) { const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`; const preSegment = `Hydration ${MismatchTypeString[mismatchType]} mismatch on`; const postSegment = ` - rendered on server: ${format(actual)} - expected on client: ${format(expected)} Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead. You should fix the source of the mismatch.`; { warn$1(preSegment, el, postSegment); } return true; } return false; } function toClassSet(str) { return new Set(str.trim().split(/\s+/)); } function isSetEqual(a, b) { if (a.size !== b.size) { return false; } for (const s of a) { if (!b.has(s)) { return false; } } return true; } function toStyleMap(str) { const styleMap = /* @__PURE__ */ new Map(); for (const item of str.split(";")) { let [key, value] = item.split(":"); key = key.trim(); value = value && value.trim(); if (key && value) { styleMap.set(key, value); } } return styleMap; } function isMapEqual(a, b) { if (a.size !== b.size) { return false; } for (const [key, value] of a) { if (value !== b.get(key)) { return false; } } return true; } function resolveCssVars(instance, vnode, expectedMap) { const root = instance.subTree; if (instance.getCssVars && (vnode === root || root && root.type === Fragment && root.children.includes(vnode))) { const cssVars = instance.getCssVars(); for (const key in cssVars) { expectedMap.set( `--${shared.getEscapedCssVarName(key, false)}`, String(cssVars[key]) ); } } if (vnode === root && instance.parent) { resolveCssVars(instance.parent, instance.vnode, expectedMap); } } const allowMismatchAttr = "data-allow-mismatch"; const MismatchTypeString = { [0 /* TEXT */]: "text", [1 /* CHILDREN */]: "children", [2 /* CLASS */]: "class", [3 /* STYLE */]: "style", [4 /* ATTRIBUTE */]: "attribute" }; function isMismatchAllowed(el, allowedType) { if (allowedType === 0 /* TEXT */ || allowedType === 1 /* CHILDREN */) { while (el && !el.hasAttribute(allowMismatchAttr)) { el = el.parentElement; } } const allowedAttr = el && el.getAttribute(allowMismatchAttr); if (allowedAttr == null) { return false; } else if (allowedAttr === "") { return true; } else { const list = allowedAttr.split(","); if (allowedType === 0 /* TEXT */ && list.includes("children")) { return true; } return allowedAttr.split(",").includes(MismatchTypeString[allowedType]); } } const requestIdleCallback = shared.getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1)); const cancelIdleCallback = shared.getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id)); const hydrateOnIdle = (timeout = 1e4) => (hydrate) => { const id = requestIdleCallback(hydrate, { timeout }); return () => cancelIdleCallback(id); }; function elementIsVisibleInViewport(el) { const { top, left, bottom, right } = el.getBoundingClientRect(); const { innerHeight, innerWidth } = window; return (top > 0 && top < innerHeight || bottom > 0 && bottom < innerHeight) && (left > 0 && left < innerWidth || right > 0 && right < innerWidth); } const hydrateOnVisible = (opts) => (hydrate, forEach) => { const ob = new IntersectionObserver((entries) => { for (const e of entries) { if (!e.isIntersecting) continue; ob.disconnect(); hydrate(); break; } }, opts); forEach((el) => { if (!(el instanceof Element)) return; if (elementIsVisibleInViewport(el)) { hydrate(); ob.disconnect(); return false; } ob.observe(el); }); return () => ob.disconnect(); }; const hydrateOnMediaQuery = (query) => (hydrate) => { if (query) { const mql = matchMedia(query); if (mql.matches) { hydrate(); } else { mql.addEventListener("change", hydrate, { once: true }); return () => mql.removeEventListener("change", hydrate); } } }; const hydrateOnInteraction = (interactions = []) => (hydrate, forEach) => { if (shared.isString(interactions)) interactions = [interactions]; let hasHydrated = false; const doHydrate = (e) => { if (!hasHydrated) { hasHydrated = true; teardown(); hydrate(); e.target.dispatchEvent(new e.constructor(e.type, e)); } }; const teardown = () => { forEach((el) => { for (const i of interactions) { el.removeEventListener(i, doHydrate); } }); }; forEach((el) => { for (const i of interactions) { el.addEventListener(i, doHydrate, { once: true }); } }); return teardown; }; function forEachElement(node, cb) { if (isComment(node) && node.data === "[") { let depth = 1; let next = node.nextSibling; while (next) { if (next.nodeType === 1) { const result = cb(next); if (result === false) { break; } } else if (isComment(next)) { if (next.data === "]") { if (--depth === 0) break; } else if (next.data === "[") { depth++; } } next = next.nextSibling; } } else { cb(node); } } const isAsyncWrapper = (i) => !!i.type.__asyncLoader; /*! #__NO_SIDE_EFFECTS__ */ // @__NO_SIDE_EFFECTS__ function defineAsyncComponent(source) { if (shared.isFunction(source)) { source = { loader: source }; } const { loader, loadingComponent, errorComponent, delay = 200, hydrate: hydrateStrategy, timeout, // undefined = never times out suspensible = true, onError: userOnError } = source; let pendingRequest = null; let resolvedComp; let retries = 0; const retry = () => { retries++; pendingRequest = null; return load(); }; const load = () => { let thisRequest; return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => { err = err instanceof Error ? err : new Error(String(err)); if (userOnError) { return new Promise((resolve, reject) => { const userRetry = () => resolve(retry()); const userFail = () => reject(err); userOnError(err, userRetry, userFail, retries + 1); }); } else { throw err; } }).then((comp) => { if (thisRequest !== pendingRequest && pendingRequest) { return pendingRequest; } if (!comp) { warn$1( `Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.` ); } if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) { comp = comp.default; } if (comp && !shared.isObject(comp) && !shared.isFunction(comp)) { throw new Error(`Invalid async component load result: ${comp}`); } resolvedComp = comp; return comp; })); }; return defineComponent({ name: "AsyncComponentWrapper", __asyncLoader: load, __asyncHydrate(el, instance, hydrate) { const doHydrate = hydrateStrategy ? () => { const teardown = hydrateStrategy( hydrate, (cb) => forEachElement(el, cb) ); if (teardown) { (instance.bum || (instance.bum = [])).push(teardown); } } : hydrate; if (resolvedComp) { doHydrate(); } else { load().then(() => !instance.isUnmounted && doHydrate()); } }, get __asyncResolved() { return resolvedComp; }, setup() { const instance = currentInstance; markAsyncBoundary(instance); if (resolvedComp) { return () => createInnerComp(resolvedComp, instance); } const onError = (err) => { pendingRequest = null; handleError( err, instance, 13, !errorComponent ); }; if (suspensible && instance.suspense || isInSSRComponentSetup) { return load().then((comp) => { return () => createInnerComp(comp, instance); }).catch((err) => { onError(err); return () => errorComponent ? createVNode(errorComponent, { error: err }) : null; }); } const loaded = reactivity.ref(false); const error = reactivity.ref(); const delayed = reactivity.ref(!!delay); if (delay) { setTimeout(() => { delayed.value = false; }, delay); } if (timeout != null) { setTimeout(() => { if (!loaded.value && !error.value) { const err = new Error( `Async component timed out after ${timeout}ms.` ); onError(err); error.value = err; } }, timeout); } load().then(() => { loaded.value = true; if (instance.parent && isKeepAlive(instance.parent.vnode)) { instance.parent.update(); } }).catch((err) => { onError(err); error.value = err; }); return () => { if (loaded.value && resolvedComp) { return createInnerComp(resolvedComp, instance); } else if (error.value && errorComponent) { return createVNode(errorComponent, { error: error.value }); } else if (loadingComponent && !delayed.value) { return createVNode(loadingComponent); } }; } }); } function createInnerComp(comp, parent) { const { ref: ref2, props, children, ce } = parent.vnode; const vnode = createVNode(comp, props, children); vnode.ref = ref2; vnode.ce = ce; delete parent.vnode.ce; return vnode; } const isKeepAlive = (vnode) => vnode.type.__isKeepAlive; const KeepAliveImpl = { name: `KeepAlive`, // Marker for special handling inside the renderer. We are not using a === // check directly on KeepAlive in the renderer, because importing it directly // would prevent it from being tree-shaken. __isKeepAlive: true, props: { include: [String, RegExp, Array], exclude: [String, RegExp, Array], max: [String, Number] }, setup(props, { slots }) { const instance = getCurrentInstance(); const sharedContext = instance.ctx; if (!sharedContext.renderer) { return () => { const children = slots.default && slots.default(); return children && children.length === 1 ? children[0] : children; }; } const cache = /* @__PURE__ */ new Map(); const keys = /* @__PURE__ */ new Set(); let current = null; { instance.__v_cache = cache; } const parentSuspense = instance.suspense; const { renderer: { p: patch, m: move, um: _unmount, o: { createElement } } } = sharedContext; const storageContainer = createElement("div"); sharedContext.activate = (vnode, container, anchor, namespace, optimized) => { const instance2 = vnode.component; move(vnode, container, anchor, 0, parentSuspense); patch( instance2.vnode, vnode, container, anchor, instance2, parentSuspense, namespace, vnode.slotScopeIds, optimized ); queuePostRenderEffect(() => { instance2.isDeactivated = false; if (instance2.a) { shared.invokeArrayFns(instance2.a); } const vnodeHook = vnode.props && vnode.props.onVnodeMounted; if (vnodeHook) { invokeVNodeHook(vnodeHook, instance2.parent, vnode); } }, parentSuspense); { devtoolsComponentAdded(instance2); } }; sharedContext.deactivate = (vnode) => { const instance2 = vnode.component; invalidateMount(instance2.m); invalidateMount(instance2.a); move(vnode, storageContainer, null, 1, parentSuspense); queuePostRenderEffect(() => { if (instance2.da) { shared.invokeArrayFns(instance2.da); } const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted; if (vnodeHook) { invokeVNodeHook(vnodeHook, instance2.parent, vnode); } instance2.isDeactivated = true; }, parentSuspense); { devtoolsComponentAdded(instance2); } }; function unmount(vnode) { resetShapeFlag(vnode); _unmount(vnode, instance, parentSuspense, true); } function pruneCache(filter) { cache.forEach((vnode, key) => { const name = getComponentName(vnode.type); if (name && !filter(name)) { pruneCacheEntry(key); } }); } function pruneCacheEntry(key) { const cached = cache.get(key); if (cached && (!current || !isSameVNodeType(cached, current))) { unmount(cached); } else if (current) { resetShapeFlag(current); } cache.delete(key); keys.delete(key); } watch( () => [props.include, props.exclude], ([include, exclude]) => { include && pruneCache((name) => matches(include, name)); exclude && pruneCache((name) => !matches(exclude, name)); }, // prune post-render after `current` has been updated { flush: "post", deep: true } ); let pendingCacheKey = null; const cacheSubtree = () => { if (pendingCacheKey != null) { if (isSuspense(instance.subTree.type)) { queuePostRenderEffect(() => { cache.set(pendingCacheKey, getInnerChild(instance.subTree)); }, instance.subTree.suspense); } else { cache.set(pendingCacheKey, getInnerChild(instance.subTree)); } } }; onMounted(cacheSubtree); onUpdated(cacheSubtree); onBeforeUnmount(() => { cache.forEach((cached) => { const { subTree, suspense } = instance; const vnode = getInnerChild(subTree); if (cached.type === vnode.type && cached.key === vnode.key) { resetShapeFlag(vnode); const da = vnode.component.da; da && queuePostRenderEffect(da, suspense); return; } unmount(cached); }); }); return () => { pendingCacheKey = null; if (!slots.default) { return current = null; } const children = slots.default(); const rawVNode = children[0]; if (children.length > 1) { { warn$1(`KeepAlive should contain exactly one component child.`); } current = null; return children; } else if (!isVNode(rawVNode) || !(rawVNode.shapeFlag & 4) && !(rawVNode.shapeFlag & 128)) { current = null; return rawVNode; } let vnode = getInnerChild(rawVNode); if (vnode.type === Comment) { current = null; return vnode; } const comp = vnode.type; const name = getComponentName( isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp ); const { include, exclude, max } = props; if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) { vnode.shapeFlag &= ~256; current = vnode; return rawVNode; } const key = vnode.key == null ? comp : vnode.key; const cachedVNode = cache.get(key); if (vnode.el) { vnode = cloneVNode(vnode); if (rawVNode.shapeFlag & 128) { rawVNode.ssContent = vnode; } } pendingCacheKey = key; if (cachedVNode) { vnode.el = cachedVNode.el; vnode.component = cachedVNode.component; if (vnode.transition) { setTransitionHooks(vnode, vnode.transition); } vnode.shapeFlag |= 512; keys.delete(key); keys.add(key); } else { keys.add(key); if (max && keys.size > parseInt(max, 10)) { pruneCacheEntry(keys.values().next().value); } } vnode.shapeFlag |= 256; current = vnode; return isSuspense(rawVNode.type) ? rawVNode : vnode; }; } }; const KeepAlive = KeepAliveImpl; function matches(pattern, name) { if (shared.isArray(pattern)) { return pattern.some((p) => matches(p, name)); } else if (shared.isString(pattern)) { return pattern.split(",").includes(name); } else if (shared.isRegExp(pattern)) { pattern.lastIndex = 0; return pattern.test(name); } return false; } function onActivated(hook, target) { registerKeepAliveHook(hook, "a", target); } function onDeactivated(hook, target) { registerKeepAliveHook(hook, "da", target); } function registerKeepAliveHook(hook, type, target = currentInstance) { const wrappedHook = hook.__wdc || (hook.__wdc = () => { let current = target; while (current) { if (current.isDeactivated) { return; } current = current.parent; } return hook(); }); injectHook(type, wrappedHook, target); if (target) { let current = target.parent; while (current && current.parent) { if (isKeepAlive(current.parent.vnode)) { injectToKeepAliveRoot(wrappedHook, type, target, current); } current = current.parent; } } } function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) { const injected = injectHook( type, hook, keepAliveRoot, true /* prepend */ ); onUnmounted(() => { shared.remove(keepAliveRoot[type], injected); }, target); } function resetShapeFlag(vnode) { vnode.shapeFlag &= ~256; vnode.shapeFlag &= ~512; } function getInnerChild(vnode) { return vnode.shapeFlag & 128 ? vnode.ssContent : vnode; } function injectHook(type, hook, target = currentInstance, prepend = false) { if (target) { const hooks = target[type] || (target[type] = []); const wrappedHook = hook.__weh || (hook.__weh = (...args) => { reactivity.pauseTracking(); const reset = setCurrentInstance(target); const res = callWithAsyncErrorHandling(hook, target, type, args); reset(); reactivity.resetTracking(); return res; }); if (prepend) { hooks.unshift(wrappedHook); } else { hooks.push(wrappedHook); } return wrappedHook; } else { const apiName = shared.toHandlerKey(ErrorTypeStrings$1[type].replace(/ hook$/, "")); warn$1( `${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup().` + (` If you are using async setup(), make sure to register lifecycle hooks before the first await statement.` ) ); } } const createHook = (lifecycle) => (hook, target = currentInstance) => { if (!isInSSRComponentSetup || lifecycle === "sp") { injectHook(lifecycle, (...args) => hook(...args), target); } }; const onBeforeMount = createHook("bm"); const onMounted = createHook("m"); const onBeforeUpdate = createHook( "bu" ); const onUpdated = createHook("u"); const onBeforeUnmount = createHook( "bum" ); const onUnmounted = createHook("um"); const onServerPrefetch = createHook( "sp" ); const onRenderTriggered = createHook("rtg"); const onRenderTracked = createHook("rtc"); function onErrorCaptured(hook, target = currentInstance) { injectHook("ec", hook, target); } const COMPONENTS = "components"; const DIRECTIVES = "directives"; function resolveComponent(name, maybeSelfReference) { return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name; } const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc"); function resolveDynamicComponent(component) { if (shared.isString(component)) { return resolveAsset(COMPONENTS, component, false) || component; } else { return component || NULL_DYNAMIC_COMPONENT; } } function resolveDirective(name) { return resolveAsset(DIRECTIVES, name); } function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) { const instance = currentRenderingInstance || currentInstance; if (instance) { const Component = instance.type; if (type === COMPONENTS) { const selfName = getComponentName( Component, false ); if (selfName && (selfName === name || selfName === shared.camelize(name) || selfName === shared.capitalize(shared.camelize(name)))) { return Component; } } const res = ( // local registration // check instance[type] first which is resolved for options API resolve(instance[type] || Component[type], name) || // global registration resolve(instance.appContext[type], name) ); if (!res && maybeSelfReference) { return Component; } if (warnMissing && !res) { const extra = type === COMPONENTS ? ` If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``; warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`); } return res; } else { warn$1( `resolve${shared.capitalize(type.slice(0, -1))} can only be used in render() or setup().` ); } } function resolve(registry, name) { return registry && (registry[name] || registry[shared.camelize(name)] || registry[shared.capitalize(shared.camelize(name))]); } function renderList(source, renderItem, cache, index) { let ret; const cached = cache && cache[index]; const sourceIsArray = shared.isArray(source); if (sourceIsArray || shared.isString(source)) { const sourceIsReactiveArray = sourceIsArray && reactivity.isReactive(source); let needsWrap = false; if (sourceIsReactiveArray) { needsWrap = !reactivity.isShallow(source); source = reactivity.shallowReadArray(source); } ret = new Array(source.length); for (let i = 0, l = source.length; i < l; i++) { ret[i] = renderItem( needsWrap ? reactivity.toReactive(source[i]) : source[i], i, void 0, cached && cached[i] ); } } else if (typeof source === "number") { if (!Number.isInteger(source)) { warn$1(`The v-for range expect an integer value but got ${source}.`); } ret = new Array(source); for (let i = 0; i < source; i++) { ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]); } } else if (shared.isObject(source)) { if (source[Symbol.iterator]) { ret = Array.from( source, (item, i) => renderItem(item, i, void 0, cached && cached[i]) ); } else { const keys = Object.keys(source); ret = new Array(keys.length); for (let i = 0, l = keys.length; i < l; i++) { const key = keys[i]; ret[i] = renderItem(source[key], key, i, cached && cached[i]); } } } else { ret = []; } if (cache) { cache[index] = ret; } return ret; } function createSlots(slots, dynamicSlots) { for (let i = 0; i < dynamicSlots.length; i++) { const slot = dynamicSlots[i]; if (shared.isArray(slot)) { for (let j = 0; j < slot.length; j++) { slots[slot[j].name] = slot[j].fn; } } else if (slot) { slots[slot.name] = slot.key ? (...args) => { const res = slot.fn(...args); if (res) res.key = slot.key; return res; } : slot.fn; } } return slots; } function renderSlot(slots, name, props = {}, fallback, noSlotted) { if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) { if (name !== "default") props.name = name; return openBlock(), createBlock( Fragment, null, [createVNode("slot", props, fallback && fallback())], 64 ); } let slot = slots[name]; if (slot && slot.length > 1) { warn$1( `SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template.` ); slot = () => []; } if (slot && slot._c) { slot._d = false; } openBlock(); const validSlotContent = slot && ensureValidVNode(slot(props)); const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch // key attached in the `createSlots` helper, respect that validSlotContent && validSlotContent.key; const rendered = createBlock( Fragment, { key: (slotKey && !shared.isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content (!validSlotContent && fallback ? "_fb" : "") }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 ? 64 : -2 ); if (!noSlotted && rendered.scopeId) { rendered.slotScopeIds = [rendered.scopeId + "-s"]; } if (slot && slot._c) { slot._d = true; } return rendered; } function ensureValidVNode(vnodes) { return vnodes.some((child) => { if (!isVNode(child)) return true; if (child.type === Comment) return false; if (child.type === Fragment && !ensureValidVNode(child.children)) return false; return true; }) ? vnodes : null; } function toHandlers(obj, preserveCaseIfNecessary) { const ret = {}; if (!shared.isObject(obj)) { warn$1(`v-on with no argument expects an object value.`); return ret; } for (const key in obj) { ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : shared.toHandlerKey(key)] = obj[key]; } return ret; } const getPublicInstance = (i) => { if (!i) return null; if (isStatefulComponent(i)) return getComponentPublicInstance(i); return getPublicInstance(i.parent); }; const publicPropertiesMap = ( // Move PURE marker to new line to workaround compiler discarding it // due to type annotation /* @__PURE__ */ shared.extend(/* @__PURE__ */ Object.create(null), { $: (i) => i, $el: (i) => i.vnode.el, $data: (i) => i.data, $props: (i) => reactivity.shallowReadonly(i.props) , $attrs: (i) => reactivity.shallowReadonly(i.attrs) , $slots: (i) => reactivity.shallowReadonly(i.slots) , $refs: (i) => reactivity.shallowReadonly(i.refs) , $parent: (i) => getPublicInstance(i.parent), $root: (i) => getPublicInstance(i.root), $host: (i) => i.ce, $emit: (i) => i.emit, $options: (i) => resolveMergedOptions(i) , $forceUpdate: (i) => i.f || (i.f = () => { queueJob(i.update); }), $nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)), $watch: (i) => instanceWatch.bind(i) }) ); const isReservedPrefix = (key) => key === "_" || key === "$"; const hasSetupBinding = (state, key) => state !== shared.EMPTY_OBJ && !state.__isScriptSetup && shared.hasOwn(state, key); const PublicInstanceProxyHandlers = { get({ _: instance }, key) { if (key === "__v_skip") { return true; } const { ctx, setupState, data, props, accessCache, type, appContext } = instance; if (key === "__isVue") { return true; } let normalizedProps; if (key[0] !== "$") { const n = accessCache[key]; if (n !== void 0) { switch (n) { case 1 /* SETUP */: return setupState[key]; case 2 /* DATA */: return data[key]; case 4 /* CONTEXT */: return ctx[key]; case 3 /* PROPS */: return props[key]; } } else if (hasSetupBinding(setupState, key)) { accessCache[key] = 1 /* SETUP */; return setupState[key]; } else if (data !== shared.EMPTY_OBJ && shared.hasOwn(data, key)) { accessCache[key] = 2 /* DATA */; return data[key]; } else if ( // only cache other properties when instance has declared (thus stable) // props (normalizedProps = instance.propsOptions[0]) && shared.hasOwn(normalizedProps, key) ) { accessCache[key] = 3 /* PROPS */; return props[key]; } else if (ctx !== shared.EMPTY_OBJ && shared.hasOwn(ctx, key)) { accessCache[key] = 4 /* CONTEXT */; return ctx[key]; } else if (shouldCacheAccess) { accessCache[key] = 0 /* OTHER */; } } const publicGetter = publicPropertiesMap[key]; let cssModule, globalProperties; if (publicGetter) { if (key === "$attrs") { reactivity.track(instance.attrs, "get", ""); markAttrsAccessed(); } else if (key === "$slots") { reactivity.track(instance, "get", key); } return publicGetter(instance); } else if ( // css module (injected by vue-loader) (cssModule = type.__cssModules) && (cssModule = cssModule[key]) ) { return cssModule; } else if (ctx !== shared.EMPTY_OBJ && shared.hasOwn(ctx, key)) { accessCache[key] = 4 /* CONTEXT */; return ctx[key]; } else if ( // global properties globalProperties = appContext.config.globalProperties, shared.hasOwn(globalProperties, key) ) { { return globalProperties[key]; } } else if (currentRenderingInstance && (!shared.isString(key) || // #1091 avoid internal isRef/isVNode checks on component instance leading // to infinite warning loop key.indexOf("__v") !== 0)) { if (data !== shared.EMPTY_OBJ && isReservedPrefix(key[0]) && shared.hasOwn(data, key)) { warn$1( `Property ${JSON.stringify( key )} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.` ); } else if (instance === currentRenderingInstance) { warn$1( `Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.` ); } } }, set({ _: instance }, key, value) { const { data, setupState, ctx } = instance; if (hasSetupBinding(setupState, key)) { setupState[key] = value; return true; } else if (setupState.__isScriptSetup && shared.hasOwn(setupState, key)) { warn$1(`Cannot mutate <script setup> binding "${key}" from Options API.`); return false; } else if (data !== shared.EMPTY_OBJ && shared.hasOwn(data, key)) { data[key] = value; return true; } else if (shared.hasOwn(instance.props, key)) { warn$1(`Attempting to mutate prop "${key}". Props are readonly.`); return false; } if (key[0] === "$" && key.slice(1) in instance) { warn$1( `Attempting to mutate public property "${key}". Properties starting with $ are reserved and readonly.` ); return false; } else { if (key in instance.appContext.config.globalProperties) { Object.defineProperty(ctx, key, { enumerable: true, configurable: true, value }); } else { ctx[key] = value; } } return true; }, has({ _: { data, setupState, accessCache, ctx, appContext, propsOptions } }, key) { let normalizedProps; return !!accessCache[key] || data !== shared.EMPTY_OBJ && shared.hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && shared.hasOwn(normalizedProps, key) || shared.hasOwn(ctx, key) || shared.hasOwn(publicPropertiesMap, key) || shared.hasOwn(appContext.config.globalProperties, key); }, defineProperty(target, key, descriptor) { if (descriptor.get != null) { target._.accessCache[key] = 0; } else if (shared.hasOwn(descriptor, "value")) { this.set(target, key, descriptor.value, null); } return Reflect.defineProperty(target, key, descriptor); } }; { PublicInstanceProxyHandlers.ownKeys = (target) => { warn$1( `Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.` ); return Reflect.ownKeys(target); }; } const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ shared.extend({}, PublicInstanceProxyHandlers, { get(target, key) { if (key === Symbol.unscopables) { return; } return PublicInstanceProxyHandlers.get(target, key, target); }, has(_, key) { const has = key[0] !== "_" && !shared.isGloballyAllowed(key); if (!has && PublicInstanceProxyHandlers.has(_, key)) { warn$1( `Property ${JSON.stringify( key )} should not start with _ which is a reserved prefix for Vue internals.` ); } return has; } }); function createDevRenderContext(instance) { const target = {}; Object.defineProperty(target, `_`, { configurable: true, enumerable: false, get: () => instance }); Object.keys(publicPropertiesMap).forEach((key) => { Object.defineProperty(target, key, { configurable: true, enumerable: false, get: () => publicPropertiesMap[key](instance), // intercepted by the proxy so no need for implementation, // but needed to prevent set errors set: shared.NOOP }); }); return target; } function exposePropsOnRenderContext(instance) { const { ctx, propsOptions: [propsOptions] } = instance; if (propsOptions) { Object.keys(propsOptions).forEach((key) => { Object.defineProperty(ctx, key, { enumerable: true, configurable: true, get: () => instance.props[key], set: shared.NOOP }); }); } } function exposeSetupStateOnRenderContext(instance) { const { ctx, setupState } = instance; Object.keys(reactivity.toRaw(setupState)).forEach((key) => { if (!setupState.__isScriptSetup) { if (isReservedPrefix(key[0])) { warn$1( `setup() return property ${JSON.stringify( key )} should not start with "$" or "_" which are reserved prefixes for Vue internals.` ); return; } Object.defineProperty(ctx, key, { enumerable: true, configurable: true, get: () => setupState[key], set: shared.NOOP }); } }); } const warnRuntimeUsage = (method) => warn$1( `${method}() is a compiler-hint helper that is only usable inside <script setup> of a single file component. Its arguments should be compiled away and passing it at runtime has no effect.` ); function defineProps() { { warnRuntimeUsage(`defineProps`); } return null; } function defineEmits() { { warnRuntimeUsage(`defineEmits`); } return null; } function defineExpose(exposed) { { warnRuntimeUsage(`defineExpose`); } } function defineOptions(options) { { warnRuntimeUsage(`defineOptions`); } } function defineSlots() { { warnRuntimeUsage(`defineSlots`); } return null; } function defineModel() { { warnRuntimeUsage("defineModel"); } } function withDefaults(props, defaults) { { warnRuntimeUsage(`withDefaults`); } return null; } function useSlots() { return getContext().slots; } function useAttrs() { return getContext().attrs; } function getContext() { const i = getCurrentInstance(); if (!i) { warn$1(`useContext() called without active instance.`); } return i.setupContext || (i.setupContext = createSetupContext(i)); } function normalizePropsOrEmits(props) { return shared.isArray(props) ? props.reduce( (normalized, p) => (normalized[p] = null, normalized), {} ) : props; } function mergeDefaults(raw, defaults) { const props = normalizePropsOrEmits(raw); for (const key in defaults) { if (key.startsWith("__skip")) continue; let opt = props[key]; if (opt) { if (shared.isArray(opt) || shared.isFunction(opt)) { opt = props[key] = { type: opt, default: defaults[key] }; } else { opt.default = defaults[key]; } } else if (opt === null) { opt = props[key] = { default: defaults[key] }; } else { warn$1(`props default key "${key}" has no corresponding declaration.`); } if (opt && defaults[`__skip_${key}`]) { opt.skipFactory = true; } } return props; } function mergeModels(a, b) { if (!a || !b) return a || b; if (shared.isArray(a) && shared.isArray(b)) return a.concat(b); return shared.extend({}, normalizePropsOrEmits(a), normalizePropsOrEmits(b)); } function createPropsRestProxy(props, excludedKeys) { const ret = {}; for (const key in props) { if (!excludedKeys.includes(key)) { Object.defineProperty(ret, key, { enumerable: true, get: () => props[key] }); } } return ret; } function withAsyncContext(getAwaitable) { const ctx = getCurrentInstance(); if (!ctx) { warn$1( `withAsyncContext called without active current instance. This is likely a bug.` ); } let awaitable = getAwaitable(); unsetCurrentInstance(); if (shared.isPromise(awaitable)) { awaitable = awaitable.catch((e) => { setCurrentInstance(ctx); throw e; }); } return [awaitable, () => setCurrentInstance(ctx)]; } function createDuplicateChecker() { const cache = /* @__PURE__ */ Object.create(null); return (type, key) => { if (cache[key]) { warn$1(`${type} property "${key}" is already defined in ${cache[key]}.`); } else { cache[key] = type; } }; } let shouldCacheAccess = true; function applyOptions(instance) { const options = resolveMergedOptions(instance); const publicThis = instance.proxy; const ctx = instance.ctx; shouldCacheAccess = false; if (options.beforeCreate) { callHook(options.beforeCreate, instance, "bc"); } const { // state data: dataOptions, computed: computedOptions, methods, watch: watchOptions, provide: provideOptions, inject: injectOptions, // lifecycle created, beforeMount, mounted, beforeUpdate, updated, activated, deactivated, beforeDestroy, beforeUnmount, destroyed, unmounted, render, renderTracked, renderTriggered, errorCaptured, serverPrefetch, // public API expose, inheritAttrs, // assets components, directives, filters } = options; const checkDuplicateProperties = createDuplicateChecker() ; { const [propsOptions] = instance.propsOptions; if (propsOptions) { for (const key in propsOptions) { checkDuplicateProperties("Props" /* PROPS */, key); } } } if (injectOptions) { resolveInjections(injectOptions, ctx, checkDuplicateProperties); } if (methods) { for (const key in methods) { const methodHandler = methods[key]; if (shared.isFunction(methodHandler)) { { Object.defineProperty(ctx, key, { value: methodHandler.bind(publicThis), configurable: true, enumerable: true, writable: true }); } { checkDuplicateProperties("Methods" /* METHODS */, key); } } else { warn$1( `Method "${key}" has type "${typeof methodHandler}" in the component definition. Did you reference the function correctly?` ); } } } if (dataOptions) { if (!shared.isFunction(dataOptions)) { warn$1( `The data option must be a function. Plain object usage is no longer supported.` ); } const data = dataOptions.call(publicThis, publicThis); if (shared.isPromise(data)) { warn$1( `data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>.` ); } if (!shared.isObject(data)) { warn$1(`data() should return an object.`); } else { instance.data = reactivity.reactive(data); { for (const key in data) { checkDuplicateProperties("Data" /* DATA */, key); if (!isReservedPrefix(key[0])) { Object.defineProperty(ctx, key, { configurable: true, enumerable: true, get: () => data[key], set: shared.NOOP }); } } } } } shouldCacheAccess = true; if (computedOptions) { for (const key in computedOptions) { const opt = computedOptions[key]; const get = shared.isFunction(opt) ? opt.bind(publicThis, publicThis) : shared.isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : shared.NOOP; if (get === shared.NOOP) { warn$1(`Computed property "${key}" has no getter.`); } const set = !shared.isFunction(opt) && shared.isFunction(opt.set) ? opt.set.bind(publicThis) : () => { warn$1( `Write operation failed: computed property "${key}" is readonly.` ); } ; const c = computed({ get, set }); Object.defineProperty(ctx, key, { enumerable: true, configurable: true, get: () => c.value, set: (v) => c.value = v }); { checkDuplicateProperties("Computed" /* COMPUTED */, key); } } } if (watchOptions) { for (const key in watchOptions) { createWatcher(watchOptions[key], ctx, publicThis, key); } } if (provideOptions) { const provides = shared.isFunction(provideOptions) ? provideOptions.call(publicThis) : provideOptions; Reflect.ownKeys(provides).forEach((key) => { provide(key, provides[key]); }); } if (created) { callHook(created, instance, "c"); } function registerLifecycleHook(register, hook) { if (shared.isArray(hook)) { hook.forEach((_hook) => register(_hook.bind(publicThis))); } else if (hook) { register(hook.bind(publicThis)); } } registerLifecycleHook(onBeforeMount, beforeMount); registerLifecycleHook(onMounted, mounted); registerLifecycleHook(onBeforeUpdate, beforeUpdate); registerLifecycleHook(onUpdated, updated); registerLifecycleHook(onActivated, activated); registerLifecycleHook(onDeactivated, deactivated); registerLifecycleHook(onErrorCaptured, errorCaptured); registerLifecycleHook(onRenderTracked, renderTracked); registerLifecycleHook(onRenderTriggered, renderTriggered); registerLifecycleHook(onBeforeUnmount, beforeUnmount); registerLifecycleHook(onUnmounted, unmounted); registerLifecycleHook(onServerPrefetch, serverPrefetch); if (shared.isArray(expose)) { if (expose.length) { const exposed = instance.exposed || (instance.exposed = {}); expose.forEach((key) => { Object.defineProperty(exposed, key, { get: () => publicThis[key], set: (val) => publicThis[key] = val }); }); } else if (!instance.exposed) { instance.exposed = {}; } } if (render && instance.render === shared.NOOP) { instance.render = render; } if (inheritAttrs != null) { instance.inheritAttrs = inheritAttrs; } if (components) instance.components = components; if (directives) instance.directives = directives; if (serverPrefetch) { markAsyncBoundary(instance); } } function resolveInjections(injectOptions, ctx, checkDuplicateProperties = shared.NOOP) { if (shared.isArray(injectOptions)) { injectOptions = normalizeInject(injectOptions); } for (const key in injectOptions) { const opt = injectOptions[key]; let injected; if (shared.isObject(opt)) { if ("default" in opt) { injected = inject( opt.from || key, opt.default, true ); } else { injected = inject(opt.from || key); } } else { injected = inject(opt); } if (reactivity.isRef(injected)) { Object.defineProperty(ctx, key, { enumerable: true, configurable: true, get: () => injected.value, set: (v) => injected.value = v }); } else { ctx[key] = injected; } { checkDuplicateProperties("Inject" /* INJECT */, key); } } } function callHook(hook, instance, type) { callWithAsyncErrorHandling( shared.isArray(hook) ? hook.map((h) => h.bind(instance.proxy)) : hook.bind(instance.proxy), instance, type ); } function createWatcher(raw, ctx, publicThis, key) { let getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key]; if (shared.isString(raw)) { const handler = ctx[raw]; if (shared.isFunction(handler)) { { watch(getter, handler); } } else { warn$1(`Invalid watch handler specified by key "${raw}"`, handler); } } else if (shared.isFunction(raw)) { { watch(getter, raw.bind(publicThis)); } } else if (shared.isObject(raw)) { if (shared.isArray(raw)) { raw.forEach((r) => createWatcher(r, ctx, publicThis, key)); } else { const handler = shared.isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler]; if (shared.isFunction(handler)) { watch(getter, handler, raw); } else { warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler); } } } else { warn$1(`Invalid watch option: "${key}"`, raw); } } function resolveMergedOptions(instance) { const base = instance.type; const { mixins, extends: extendsOptions } = base; const { mixins: globalMixins, optionsCache: cache, config: { optionMergeStrategies } } = instance.appContext; const cached = cache.get(base); let resolved; if (cached) { resolved = cached; } else if (!globalMixins.length && !mixins && !extendsOptions) { { resolved = base; } } else { resolved = {}; if (globalMixins.length) { globalMixins.forEach( (m) => mergeOptions(resolved, m, optionMergeStrategies, true) ); } mergeOptions(resolved, base, optionMergeStrategies); } if (shared.isObject(base)) { cache.set(base, resolved); } return resolved; } function mergeOptions(to, from, strats, asMixin = false) { const { mixins, extends: extendsOptions } = from; if (extendsOptions) { mergeOptions(to, extendsOptions, strats, true); } if (mixins) { mixins.forEach( (m) => mergeOptions(to, m, strats, true) ); } for (const key in from) { if (asMixin && key === "expose") { warn$1( `"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.` ); } else { const strat = internalOptionMergeStrats[key] || strats && strats[key]; to[key] = strat ? strat(to[key], from[key]) : from[key]; } } return to; } const internalOptionMergeStrats = { data: mergeDataFn, props: mergeEmitsOrPropsOptions, emits: mergeEmitsOrPropsOptions, // objects methods: mergeObjectOptions, computed: mergeObjectOptions, // lifecycle beforeCreate: mergeAsArray, created: mergeAsArray, beforeMount: mergeAsArray, mounted: mergeAsArray, beforeUpdate: mergeAsArray, updated: mergeAsArray, beforeDestroy: mergeAsArray, beforeUnmount: mergeAsArray, destroyed: mergeAsArray, unmounted: mergeAsArray, activated: mergeAsArray, deactivated: mergeAsArray, errorCaptured: mergeAsArray, serverPrefetch: mergeAsArray, // assets components: mergeObjectOptions, directives: mergeObjectOptions, // watch watch: mergeWatchOptions, // provide / inject provide: mergeDataFn, inject: mergeInject }; function mergeDataFn(to, from) { if (!from) { return to; } if (!to) { return from; } return function mergedDataFn() { return (shared.extend)( shared.isFunction(to) ? to.call(this, this) : to, shared.isFunction(from) ? from.call(this, this) : from ); }; } function mergeInject(to, from) { return mergeObjectOptions(normalizeInject(to), normalizeInject(from)); } function normalizeInject(raw) { if (shared.isArray(raw)) { const res = {}; for (let i = 0; i < raw.length; i++) { res[raw[i]] = raw[i]; } return res; } return raw; } function mergeAsArray(to, from) { return to ? [...new Set([].concat(to, from))] : from; } function mergeObjectOptions(to, from) { return to ? shared.extend(/* @__PURE__ */ Object.create(null), to, from) : from; } function mergeEmitsOrPropsOptions(to, from) { if (to) { if (shared.isArray(to) && shared.isArray(from)) { return [.../* @__PURE__ */ new Set([...to, ...from])]; } return shared.extend( /* @__PURE__ */ Object.create(null), normalizePropsOrEmits(to), normalizePropsOrEmits(from != null ? from : {}) ); } else { return from; } } function mergeWatchOptions(to, from) { if (!to) return from; if (!from) return to; const merged = shared.extend(/* @__PURE__ */ Object.create(null), to); for (const key in from) { merged[key] = mergeAsArray(to[key], from[key]); } return merged; } function createAppContext() { return { app: null, config: { isNativeTag: shared.NO, performance: false, globalProperties: {}, optionMergeStrategies: {}, errorHandler: void 0, warnHandler: void 0, compilerOptions: {} }, mixins: [], components: {}, directives: {}, provides: /* @__PURE__ */ Object.create(null), optionsCache: /* @__PURE__ */ new WeakMap(), propsCache: /* @__PURE__ */ new WeakMap(), emitsCache: /* @__PURE__ */ new WeakMap() }; } let uid$1 = 0; function createAppAPI(render, hydrate) { return function createApp(rootComponent, rootProps = null) { if (!shared.isFunction(rootComponent)) { rootComponent = shared.extend({}, rootComponent); } if (rootProps != null && !shared.isObject(rootProps)) { warn$1(`root props passed to app.mount() must be an object.`); rootProps = null; } const context = createAppContext(); const installedPlugins = /* @__PURE__ */ new WeakSet(); const pluginCleanupFns = []; let isMounted = false; const app = context.app = { _uid: uid$1++, _component: rootComponent, _props: rootProps, _container: null, _context: context, _instance: null, version, get config() { return context.config; }, set config(v) { { warn$1( `app.config cannot be replaced. Modify individual options instead.` ); } }, use(plugin, ...options) { if (installedPlugins.has(plugin)) { warn$1(`Plugin has already been applied to target app.`); } else if (plugin && shared.isFunction(plugin.install)) { installedPlugins.add(plugin); plugin.install(app, ...options); } else if (shared.isFunction(plugin)) { installedPlugins.add(plugin); plugin(app, ...options); } else { warn$1( `A plugin must either be a function or an object with an "install" function.` ); } return app; }, mixin(mixin) { { if (!context.mixins.includes(mixin)) { context.mixins.push(mixin); } else { warn$1( "Mixin has already been applied to target app" + (mixin.name ? `: ${mixin.name}` : "") ); } } return app; }, component(name, component) { { validateComponentName(name, context.config); } if (!component) { return context.components[name]; } if (context.components[name]) { warn$1(`Component "${name}" has already been registered in target app.`); } context.components[name] = component; return app; }, directive(name, directive) { { validateDirectiveName(name); } if (!directive) { return context.directives[name]; } if (context.directives[name]) { warn$1(`Directive "${name}" has already been registered in target app.`); } context.directives[name] = directive; return app; }, mount(rootContainer, isHydrate, namespace) { if (!isMounted) { if (rootContainer.__vue_app__) { warn$1( `There is already an app instance mounted on the host container. If you want to mount another app on the same host container, you need to unmount the previous app by calling \`app.unmount()\` first.` ); } const vnode = app._ceVNode || createVNode(rootComponent, rootProps); vnode.appContext = context; if (namespace === true) { namespace = "svg"; } else if (namespace === false) { namespace = void 0; } { context.reload = () => { render( cloneVNode(vnode), rootContainer, namespace ); }; } if (isHydrate && hydrate) { hydrate(vnode, rootContainer); } else { render(vnode, rootContainer, namespace); } isMounted = true; app._container = rootContainer; rootContainer.__vue_app__ = app; { app._instance = vnode.component; devtoolsInitApp(app, version); } return getComponentPublicInstance(vnode.component); } else { warn$1( `App has already been mounted. If you want to remount the same app, move your app creation logic into a factory function and create fresh app instances for each mount - e.g. \`const createMyApp = () => createApp(App)\`` ); } }, onUnmount(cleanupFn) { if (typeof cleanupFn !== "function") { warn$1( `Expected function as first argument to app.onUnmount(), but got ${typeof cleanupFn}` ); } pluginCleanupFns.push(cleanupFn); }, unmount() { if (isMounted) { callWithAsyncErrorHandling( pluginCleanupFns, app._instance, 16 ); render(null, app._container); { app._instance = null; devtoolsUnmountApp(app); } delete app._container.__vue_app__; } else { warn$1(`Cannot unmount an app that is not mounted.`); } }, provide(key, value) { if (key in context.provides) { warn$1( `App already provides property with key "${String(key)}". It will be overwritten with the new value.` ); } context.provides[key] = value; return app; }, runWithContext(fn) { const lastApp = currentApp; currentApp = app; try { return fn(); } finally { currentApp = lastApp; } } }; return app; }; } let currentApp = null; function provide(key, value) { if (!currentInstance) { { warn$1(`provide() can only be used inside setup().`); } } else { let provides = currentInstance.provides; const parentProvides = currentInstance.parent && currentInstance.parent.provides; if (parentProvides === provides) { provides = currentInstance.provides = Object.create(parentProvides); } provides[key] = value; } } function inject(key, defaultValue, treatDefaultAsFactory = false) { const instance = currentInstance || currentRenderingInstance; if (instance || currentApp) { const provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0; if (provides && key in provides) { return provides[key]; } else if (arguments.length > 1) { return treatDefaultAsFactory && shared.isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue; } else { warn$1(`injection "${String(key)}" not found.`); } } else { warn$1(`inject() can only be used inside setup() or functional components.`); } } function hasInjectionContext() { return !!(currentInstance || currentRenderingInstance || currentApp); } const internalObjectProto = {}; const createInternalObject = () => Object.create(internalObjectProto); const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto; function initProps(instance, rawProps, isStateful, isSSR = false) { const props = {}; const attrs = createInternalObject(); instance.propsDefaults = /* @__PURE__ */ Object.create(null); setFullProps(instance, rawProps, props, attrs); for (const key in instance.propsOptions[0]) { if (!(key in props)) { props[key] = void 0; } } { validateProps(rawProps || {}, props, instance); } if (isStateful) { instance.props = isSSR ? props : reactivity.shallowReactive(props); } else { if (!instance.type.props) { instance.props = attrs; } else { instance.props = props; } } instance.attrs = attrs; } function isInHmrContext(instance) { while (instance) { if (instance.type.__hmrId) return true; instance = instance.parent; } } function updateProps(instance, rawProps, rawPrevProps, optimized) { const { props, attrs, vnode: { patchFlag } } = instance; const rawCurrentProps = reactivity.toRaw(props); const [options] = instance.propsOptions; let hasAttrsChanged = false; if ( // always force full diff in dev // - #1942 if hmr is enabled with sfc component // - vite#872 non-sfc component used by sfc component !isInHmrContext(instance) && (optimized || patchFlag > 0) && !(patchFlag & 16) ) { if (patchFlag & 8) { const propsToUpdate = instance.vnode.dynamicProps; for (let i = 0; i < propsToUpdate.length; i++) { let key = propsToUpdate[i]; if (isEmitListener(instance.emitsOptions, key)) { continue; } const value = rawProps[key]; if (options) { if (shared.hasOwn(attrs, key)) { if (value !== attrs[key]) { attrs[key] = value; hasAttrsChanged = true; } } else { const camelizedKey = shared.camelize(key); props[camelizedKey] = resolvePropValue( options, rawCurrentProps, camelizedKey, value, instance, false ); } } else { if (value !== attrs[key]) { attrs[key] = value; hasAttrsChanged = true; } } } } } else { if (setFullProps(instance, rawProps, props, attrs)) { hasAttrsChanged = true; } let kebabKey; for (const key in rawCurrentProps) { if (!rawProps || // for camelCase !shared.hasOwn(rawProps, key) && // it's possible the original props was passed in as kebab-case // and converted to camelCase (#955) ((kebabKey = shared.hyphenate(key)) === key || !shared.hasOwn(rawProps, kebabKey))) { if (options) { if (rawPrevProps && // for camelCase (rawPrevProps[key] !== void 0 || // for kebab-case rawPrevProps[kebabKey] !== void 0)) { props[key] = resolvePropValue( options, rawCurrentProps, key, void 0, instance, true ); } } else { delete props[key]; } } } if (attrs !== rawCurrentProps) { for (const key in attrs) { if (!rawProps || !shared.hasOwn(rawProps, key) && true) { delete attrs[key]; hasAttrsChanged = true; } } } } if (hasAttrsChanged) { reactivity.trigger(instance.attrs, "set", ""); } { validateProps(rawProps || {}, props, instance); } } function setFullProps(instance, rawProps, props, attrs) { const [options, needCastKeys] = instance.propsOptions; let hasAttrsChanged = false; let rawCastValues; if (rawProps) { for (let key in rawProps) { if (shared.isReservedProp(key)) { continue; } const value = rawProps[key]; let camelKey; if (options && shared.hasOwn(options, camelKey = shared.camelize(key))) { if (!needCastKeys || !needCastKeys.includes(camelKey)) { props[camelKey] = value; } else { (rawCastValues || (rawCastValues = {}))[camelKey] = value; } } else if (!isEmitListener(instance.emitsOptions, key)) { if (!(key in attrs) || value !== attrs[key]) { attrs[key] = value; hasAttrsChanged = true; } } } } if (needCastKeys) { const rawCurrentProps = reactivity.toRaw(props); const castValues = rawCastValues || shared.EMPTY_OBJ; for (let i = 0; i < needCastKeys.length; i++) { const key = needCastKeys[i]; props[key] = resolvePropValue( options, rawCurrentProps, key, castValues[key], instance, !shared.hasOwn(castValues, key) ); } } return hasAttrsChanged; } function resolvePropValue(options, props, key, value, instance, isAbsent) { const opt = options[key]; if (opt != null) { const hasDefault = shared.hasOwn(opt, "default"); if (hasDefault && value === void 0) { const defaultValue = opt.default; if (opt.type !== Function && !opt.skipFactory && shared.isFunction(defaultValue)) { const { propsDefaults } = instance; if (key in propsDefaults) { value = propsDefaults[key]; } else { const reset = setCurrentInstance(instance); value = propsDefaults[key] = defaultValue.call( null, props ); reset(); } } else { value = defaultValue; } if (instance.ce) { instance.ce._setProp(key, value); } } if (opt[0 /* shouldCast */]) { if (isAbsent && !hasDefault) { value = false; } else if (opt[1 /* shouldCastTrue */] && (value === "" || value === shared.hyphenate(key))) { value = true; } } } return value; } const mixinPropsCache = /* @__PURE__ */ new WeakMap(); function normalizePropsOptions(comp, appContext, asMixin = false) { const cache = asMixin ? mixinPropsCache : appContext.propsCache; const cached = cache.get(comp); if (cached) { return cached; } const raw = comp.props; const normalized = {}; const needCastKeys = []; let hasExtends = false; if (!shared.isFunction(comp)) { const extendProps = (raw2) => { hasExtends = true; const [props, keys] = normalizePropsOptions(raw2, appContext, true); shared.extend(normalized, props); if (keys) needCastKeys.push(...keys); }; if (!asMixin && appContext.mixins.length) { appContext.mixins.forEach(extendProps); } if (comp.extends) { extendProps(comp.extends); } if (comp.mixins) { comp.mixins.forEach(extendProps); } } if (!raw && !hasExtends) { if (shared.isObject(comp)) { cache.set(comp, shared.EMPTY_ARR); } return shared.EMPTY_ARR; } if (shared.isArray(raw)) { for (let i = 0; i < raw.length; i++) { if (!shared.isString(raw[i])) { warn$1(`props must be strings when using array syntax.`, raw[i]); } const normalizedKey = shared.camelize(raw[i]); if (validatePropName(normalizedKey)) { normalized[normalizedKey] = shared.EMPTY_OBJ; } } } else if (raw) { if (!shared.isObject(raw)) { warn$1(`invalid props options`, raw); } for (const key in raw) { const normalizedKey = shared.camelize(key); if (validatePropName(normalizedKey)) { const opt = raw[key]; const prop = normalized[normalizedKey] = shared.isArray(opt) || shared.isFunction(opt) ? { type: opt } : shared.extend({}, opt); const propType = prop.type; let shouldCast = false; let shouldCastTrue = true; if (shared.isArray(propType)) { for (let index = 0; index < propType.length; ++index) { const type = propType[index]; const typeName = shared.isFunction(type) && type.name; if (typeName === "Boolean") { shouldCast = true; break; } else if (typeName === "String") { shouldCastTrue = false; } } } else { shouldCast = shared.isFunction(propType) && propType.name === "Boolean"; } prop[0 /* shouldCast */] = shouldCast; prop[1 /* shouldCastTrue */] = shouldCastTrue; if (shouldCast || shared.hasOwn(prop, "default")) { needCastKeys.push(normalizedKey); } } } } const res = [normalized, needCastKeys]; if (shared.isObject(comp)) { cache.set(comp, res); } return res; } function validatePropName(key) { if (key[0] !== "$" && !shared.isReservedProp(key)) { return true; } else { warn$1(`Invalid prop name: "${key}" is a reserved property.`); } return false; } function getType(ctor) { if (ctor === null) { return "null"; } if (typeof ctor === "function") { return ctor.name || ""; } else if (typeof ctor === "object") { const name = ctor.constructor && ctor.constructor.name; return name || ""; } return ""; } function validateProps(rawProps, props, instance) { const resolvedValues = reactivity.toRaw(props); const options = instance.propsOptions[0]; const camelizePropsKey = Object.keys(rawProps).map((key) => shared.camelize(key)); for (const key in options) { let opt = options[key]; if (opt == null) continue; validateProp( key, resolvedValues[key], opt, reactivity.shallowReadonly(resolvedValues) , !camelizePropsKey.includes(key) ); } } function validateProp(name, value, prop, props, isAbsent) { const { type, required, validator, skipCheck } = prop; if (required && isAbsent) { warn$1('Missing required prop: "' + name + '"'); return; } if (value == null && !required) { return; } if (type != null && type !== true && !skipCheck) { let isValid = false; const types = shared.isArray(type) ? type : [type]; const expectedTypes = []; for (let i = 0; i < types.length && !isValid; i++) { const { valid, expectedType } = assertType(value, types[i]); expectedTypes.push(expectedType || ""); isValid = valid; } if (!isValid) { warn$1(getInvalidTypeMessage(name, value, expectedTypes)); return; } } if (validator && !validator(value, props)) { warn$1('Invalid prop: custom validator check failed for prop "' + name + '".'); } } const isSimpleType = /* @__PURE__ */ shared.makeMap( "String,Number,Boolean,Function,Symbol,BigInt" ); function assertType(value, type) { let valid; const expectedType = getType(type); if (expectedType === "null") { valid = value === null; } else if (isSimpleType(expectedType)) { const t = typeof value; valid = t === expectedType.toLowerCase(); if (!valid && t === "object") { valid = value instanceof type; } } else if (expectedType === "Object") { valid = shared.isObject(value); } else if (expectedType === "Array") { valid = shared.isArray(value); } else { valid = value instanceof type; } return { valid, expectedType }; } function getInvalidTypeMessage(name, value, expectedTypes) { if (expectedTypes.length === 0) { return `Prop type [] for prop "${name}" won't match anything. Did you mean to use type Array instead?`; } let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(shared.capitalize).join(" | ")}`; const expectedType = expectedTypes[0]; const receivedType = shared.toRawType(value); const expectedValue = styleValue(value, expectedType); const receivedValue = styleValue(value, receivedType); if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) { message += ` with value ${expectedValue}`; } message += `, got ${receivedType} `; if (isExplicable(receivedType)) { message += `with value ${receivedValue}.`; } return message; } function styleValue(value, type) { if (type === "String") { return `"${value}"`; } else if (type === "Number") { return `${Number(value)}`; } else { return `${value}`; } } function isExplicable(type) { const explicitTypes = ["string", "number", "boolean"]; return explicitTypes.some((elem) => type.toLowerCase() === elem); } function isBoolean(...args) { return args.some((elem) => elem.toLowerCase() === "boolean"); } const isInternalKey = (key) => key[0] === "_" || key === "$stable"; const normalizeSlotValue = (value) => shared.isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)]; const normalizeSlot = (key, rawSlot, ctx) => { if (rawSlot._n) { return rawSlot; } const normalized = withCtx((...args) => { if (currentInstance && (!ctx || ctx.root === currentInstance.root)) { warn$1( `Slot "${key}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.` ); } return normalizeSlotValue(rawSlot(...args)); }, ctx); normalized._c = false; return normalized; }; const normalizeObjectSlots = (rawSlots, slots, instance) => { const ctx = rawSlots._ctx; for (const key in rawSlots) { if (isInternalKey(key)) continue; const value = rawSlots[key]; if (shared.isFunction(value)) { slots[key] = normalizeSlot(key, value, ctx); } else if (value != null) { { warn$1( `Non-function value encountered for slot "${key}". Prefer function slots for better performance.` ); } const normalized = normalizeSlotValue(value); slots[key] = () => normalized; } } }; const normalizeVNodeSlots = (instance, children) => { if (!isKeepAlive(instance.vnode) && true) { warn$1( `Non-function value encountered for default slot. Prefer function slots for better performance.` ); } const normalized = normalizeSlotValue(children); instance.slots.default = () => normalized; }; const assignSlots = (slots, children, optimized) => { for (const key in children) { if (optimized || key !== "_") { slots[key] = children[key]; } } }; const initSlots = (instance, children, optimized) => { const slots = instance.slots = createInternalObject(); if (instance.vnode.shapeFlag & 32) { const type = children._; if (type) { assignSlots(slots, children, optimized); if (optimized) { shared.def(slots, "_", type, true); } } else { normalizeObjectSlots(children, slots); } } else if (children) { normalizeVNodeSlots(instance, children); } }; const updateSlots = (instance, children, optimized) => { const { vnode, slots } = instance; let needDeletionCheck = true; let deletionComparisonTarget = shared.EMPTY_OBJ; if (vnode.shapeFlag & 32) { const type = children._; if (type) { if (isHmrUpdating) { assignSlots(slots, children, optimized); reactivity.trigger(instance, "set", "$slots"); } else if (optimized && type === 1) { needDeletionCheck = false; } else { assignSlots(slots, children, optimized); } } else { needDeletionCheck = !children.$stable; normalizeObjectSlots(children, slots); } deletionComparisonTarget = children; } else if (children) { normalizeVNodeSlots(instance, children); deletionComparisonTarget = { default: 1 }; } if (needDeletionCheck) { for (const key in slots) { if (!isInternalKey(key) && deletionComparisonTarget[key] == null) { delete slots[key]; } } } }; let supported; let perf; function startMeasure(instance, type) { if (instance.appContext.config.performance && isSupported()) { perf.mark(`vue-${type}-${instance.uid}`); } { devtoolsPerfStart(instance, type, isSupported() ? perf.now() : Date.now()); } } function endMeasure(instance, type) { if (instance.appContext.config.performance && isSupported()) { const startTag = `vue-${type}-${instance.uid}`; const endTag = startTag + `:end`; perf.mark(endTag); perf.measure( `<${formatComponentName(instance, instance.type)}> ${type}`, startTag, endTag ); perf.clearMarks(startTag); perf.clearMarks(endTag); } { devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now()); } } function isSupported() { if (supported !== void 0) { return supported; } if (typeof window !== "undefined" && window.performance) { supported = true; perf = window.performance; } else { supported = false; } return supported; } const queuePostRenderEffect = queueEffectWithSuspense ; function createRenderer(options) { return baseCreateRenderer(options); } function createHydrationRenderer(options) { return baseCreateRenderer(options, createHydrationFunctions); } function baseCreateRenderer(options, createHydrationFns) { const target = shared.getGlobalThis(); target.__VUE__ = true; { setDevtoolsHook$1(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target); } const { insert: hostInsert, remove: hostRemove, patchProp: hostPatchProp, createElement: hostCreateElement, createText: hostCreateText, createComment: hostCreateComment, setText: hostSetText, setElementText: hostSetElementText, parentNode: hostParentNode, nextSibling: hostNextSibling, setScopeId: hostSetScopeId = shared.NOOP, insertStaticContent: hostInsertStaticContent } = options; const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = isHmrUpdating ? false : !!n2.dynamicChildren) => { if (n1 === n2) { return; } if (n1 && !isSameVNodeType(n1, n2)) { anchor = getNextHostNode(n1); unmount(n1, parentComponent, parentSuspense, true); n1 = null; } if (n2.patchFlag === -2) { optimized = false; n2.dynamicChildren = null; } const { type, ref, shapeFlag } = n2; switch (type) { case Text: processText(n1, n2, container, anchor); break; case Comment: processCommentNode(n1, n2, container, anchor); break; case Static: if (n1 == null) { mountStaticNode(n2, container, anchor, namespace); } else { patchStaticNode(n1, n2, container, namespace); } break; case Fragment: processFragment( n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized ); break; default: if (shapeFlag & 1) { processElement( n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized ); } else if (shapeFlag & 6) { processComponent( n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized ); } else if (shapeFlag & 64) { type.process( n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals ); } else if (shapeFlag & 128) { type.process( n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals ); } else { warn$1("Invalid VNode type:", type, `(${typeof type})`); } } if (ref != null && parentComponent) { setRef(ref, n1 && n1.ref, parentSuspense, n2 || n1, !n2); } }; const processText = (n1, n2, container, anchor) => { if (n1 == null) { hostInsert( n2.el = hostCreateText(n2.children), container, anchor ); } else { const el = n2.el = n1.el; if (n2.children !== n1.children) { hostSetText(el, n2.children); } } }; const processCommentNode = (n1, n2, container, anchor) => { if (n1 == null) { hostInsert( n2.el = hostCreateComment(n2.children || ""), container, anchor ); } else { n2.el = n1.el; } }; const mountStaticNode = (n2, container, anchor, namespace) => { [n2.el, n2.anchor] = hostInsertStaticContent( n2.children, container, anchor, namespace, n2.el, n2.anchor ); }; const patchStaticNode = (n1, n2, container, namespace) => { if (n2.children !== n1.children) { const anchor = hostNextSibling(n1.anchor); removeStaticNode(n1); [n2.el, n2.anchor] = hostInsertStaticContent( n2.children, container, anchor, namespace ); } else { n2.el = n1.el; n2.anchor = n1.anchor; } }; const moveStaticNode = ({ el, anchor }, container, nextSibling) => { let next; while (el && el !== anchor) { next = hostNextSibling(el); hostInsert(el, container, nextSibling); el = next; } hostInsert(anchor, container, nextSibling); }; const removeStaticNode = ({ el, anchor }) => { let next; while (el && el !== anchor) { next = hostNextSibling(el); hostRemove(el); el = next; } hostRemove(anchor); }; const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { if (n2.type === "svg") { namespace = "svg"; } else if (n2.type === "math") { namespace = "mathml"; } if (n1 == null) { mountElement( n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized ); } else { patchElement( n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized ); } }; const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { let el; let vnodeHook; const { props, shapeFlag, transition, dirs } = vnode; el = vnode.el = hostCreateElement( vnode.type, namespace, props && props.is, props ); if (shapeFlag & 8) { hostSetElementText(el, vnode.children); } else if (shapeFlag & 16) { mountChildren( vnode.children, el, null, parentComponent, parentSuspense, resolveChildrenNamespace(vnode, namespace), slotScopeIds, optimized ); } if (dirs) { invokeDirectiveHook(vnode, null, parentComponent, "created"); } setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent); if (props) { for (const key in props) { if (key !== "value" && !shared.isReservedProp(key)) { hostPatchProp(el, key, null, props[key], namespace, parentComponent); } } if ("value" in props) { hostPatchProp(el, "value", null, props.value, namespace); } if (vnodeHook = props.onVnodeBeforeMount) { invokeVNodeHook(vnodeHook, parentComponent, vnode); } } { shared.def(el, "__vnode", vnode, true); shared.def(el, "__vueParentComponent", parentComponent, true); } if (dirs) { invokeDirectiveHook(vnode, null, parentComponent, "beforeMount"); } const needCallTransitionHooks = needTransition(parentSuspense, transition); if (needCallTransitionHooks) { transition.beforeEnter(el); } hostInsert(el, container, anchor); if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) { queuePostRenderEffect(() => { vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode); needCallTransitionHooks && transition.enter(el); dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted"); }, parentSuspense); } }; const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => { if (scopeId) { hostSetScopeId(el, scopeId); } if (slotScopeIds) { for (let i = 0; i < slotScopeIds.length; i++) { hostSetScopeId(el, slotScopeIds[i]); } } if (parentComponent) { let subTree = parentComponent.subTree; if (subTree.patchFlag > 0 && subTree.patchFlag & 2048) { subTree = filterSingleRoot(subTree.children) || subTree; } if (vnode === subTree || isSuspense(subTree.type) && (subTree.ssContent === vnode || subTree.ssFallback === vnode)) { const parentVNode = parentComponent.vnode; setScopeId( el, parentVNode, parentVNode.scopeId, parentVNode.slotScopeIds, parentComponent.parent ); } } }; const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => { for (let i = start; i < children.length; i++) { const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]); patch( null, child, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized ); } }; const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { const el = n2.el = n1.el; { el.__vnode = n2; } let { patchFlag, dynamicChildren, dirs } = n2; patchFlag |= n1.patchFlag & 16; const oldProps = n1.props || shared.EMPTY_OBJ; const newProps = n2.props || shared.EMPTY_OBJ; let vnodeHook; parentComponent && toggleRecurse(parentComponent, false); if (vnodeHook = newProps.onVnodeBeforeUpdate) { invokeVNodeHook(vnodeHook, parentComponent, n2, n1); } if (dirs) { invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate"); } parentComponent && toggleRecurse(parentComponent, true); if (isHmrUpdating) { patchFlag = 0; optimized = false; dynamicChildren = null; } if (oldProps.innerHTML && newProps.innerHTML == null || oldProps.textContent && newProps.textContent == null) { hostSetElementText(el, ""); } if (dynamicChildren) { patchBlockChildren( n1.dynamicChildren, dynamicChildren, el, parentComponent, parentSuspense, resolveChildrenNamespace(n2, namespace), slotScopeIds ); { traverseStaticChildren(n1, n2); } } else if (!optimized) { patchChildren( n1, n2, el, null, parentComponent, parentSuspense, resolveChildrenNamespace(n2, namespace), slotScopeIds, false ); } if (patchFlag > 0) { if (patchFlag & 16) { patchProps(el, oldProps, newProps, parentComponent, namespace); } else { if (patchFlag & 2) { if (oldProps.class !== newProps.class) { hostPatchProp(el, "class", null, newProps.class, namespace); } } if (patchFlag & 4) { hostPatchProp(el, "style", oldProps.style, newProps.style, namespace); } if (patchFlag & 8) { const propsToUpdate = n2.dynamicProps; for (let i = 0; i < propsToUpdate.length; i++) { const key = propsToUpdate[i]; const prev = oldProps[key]; const next = newProps[key]; if (next !== prev || key === "value") { hostPatchProp(el, key, prev, next, namespace, parentComponent); } } } } if (patchFlag & 1) { if (n1.children !== n2.children) { hostSetElementText(el, n2.children); } } } else if (!optimized && dynamicChildren == null) { patchProps(el, oldProps, newProps, parentComponent, namespace); } if ((vnodeHook = newProps.onVnodeUpdated) || dirs) { queuePostRenderEffect(() => { vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1); dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated"); }, parentSuspense); } }; const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => { for (let i = 0; i < newChildren.length; i++) { const oldVNode = oldChildren[i]; const newVNode = newChildren[i]; const container = ( // oldVNode may be an errored async setup() component inside Suspense // which will not have a mounted element oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent // of the Fragment itself so it can move its children. (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement // which also requires the correct parent container !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything. oldVNode.shapeFlag & (6 | 64)) ? hostParentNode(oldVNode.el) : ( // In other cases, the parent container is not actually used so we // just pass the block element here to avoid a DOM parentNode call. fallbackContainer ) ); patch( oldVNode, newVNode, container, null, parentComponent, parentSuspense, namespace, slotScopeIds, true ); } }; const patchProps = (el, oldProps, newProps, parentComponent, namespace) => { if (oldProps !== newProps) { if (oldProps !== shared.EMPTY_OBJ) { for (const key in oldProps) { if (!shared.isReservedProp(key) && !(key in newProps)) { hostPatchProp( el, key, oldProps[key], null, namespace, parentComponent ); } } } for (const key in newProps) { if (shared.isReservedProp(key)) continue; const next = newProps[key]; const prev = oldProps[key]; if (next !== prev && key !== "value") { hostPatchProp(el, key, prev, next, namespace, parentComponent); } } if ("value" in newProps) { hostPatchProp(el, "value", oldProps.value, newProps.value, namespace); } } }; const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText(""); const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText(""); let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2; if ( // #5523 dev root fragment may inherit directives isHmrUpdating || patchFlag & 2048 ) { patchFlag = 0; optimized = false; dynamicChildren = null; } if (fragmentSlotScopeIds) { slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds; } if (n1 == null) { hostInsert(fragmentStartAnchor, container, anchor); hostInsert(fragmentEndAnchor, container, anchor); mountChildren( // #10007 // such fragment like `<></>` will be compiled into // a fragment which doesn't have a children. // In this case fallback to an empty array n2.children || [], container, fragmentEndAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized ); } else { if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result // of renderSlot() with no valid children n1.dynamicChildren) { patchBlockChildren( n1.dynamicChildren, dynamicChildren, container, parentComponent, parentSuspense, namespace, slotScopeIds ); { traverseStaticChildren(n1, n2); } } else { patchChildren( n1, n2, container, fragmentEndAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized ); } } }; const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { n2.slotScopeIds = slotScopeIds; if (n1 == null) { if (n2.shapeFlag & 512) { parentComponent.ctx.activate( n2, container, anchor, namespace, optimized ); } else { mountComponent( n2, container, anchor, parentComponent, parentSuspense, namespace, optimized ); } } else { updateComponent(n1, n2, optimized); } }; const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => { const instance = (initialVNode.component = createComponentInstance( initialVNode, parentComponent, parentSuspense )); if (instance.type.__hmrId) { registerHMR(instance); } { pushWarningContext(initialVNode); startMeasure(instance, `mount`); } if (isKeepAlive(initialVNode)) { instance.ctx.renderer = internals; } { { startMeasure(instance, `init`); } setupComponent(instance, false, optimized); { endMeasure(instance, `init`); } } if (instance.asyncDep) { if (isHmrUpdating) initialVNode.el = null; parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized); if (!initialVNode.el) { const placeholder = instance.subTree = createVNode(Comment); processCommentNode(null, placeholder, container, anchor); } } else { setupRenderEffect( instance, initialVNode, container, anchor, parentSuspense, namespace, optimized ); } { popWarningContext(); endMeasure(instance, `mount`); } }; const updateComponent = (n1, n2, optimized) => { const instance = n2.component = n1.component; if (shouldUpdateComponent(n1, n2, optimized)) { if (instance.asyncDep && !instance.asyncResolved) { { pushWarningContext(n2); } updateComponentPreRender(instance, n2, optimized); { popWarningContext(); } return; } else { instance.next = n2; instance.update(); } } else { n2.el = n1.el; instance.vnode = n2; } }; const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => { const componentUpdateFn = () => { if (!instance.isMounted) { let vnodeHook; const { el, props } = initialVNode; const { bm, m, parent, root, type } = instance; const isAsyncWrapperVNode = isAsyncWrapper(initialVNode); toggleRecurse(instance, false); if (bm) { shared.invokeArrayFns(bm); } if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeBeforeMount)) { invokeVNodeHook(vnodeHook, parent, initialVNode); } toggleRecurse(instance, true); if (el && hydrateNode) { const hydrateSubTree = () => { { startMeasure(instance, `render`); } instance.subTree = renderComponentRoot(instance); { endMeasure(instance, `render`); } { startMeasure(instance, `hydrate`); } hydrateNode( el, instance.subTree, instance, parentSuspense, null ); { endMeasure(instance, `hydrate`); } }; if (isAsyncWrapperVNode && type.__asyncHydrate) { type.__asyncHydrate( el, instance, hydrateSubTree ); } else { hydrateSubTree(); } } else { if (root.ce) { root.ce._injectChildStyle(type); } { startMeasure(instance, `render`); } const subTree = instance.subTree = renderComponentRoot(instance); { endMeasure(instance, `render`); } { startMeasure(instance, `patch`); } patch( null, subTree, container, anchor, instance, parentSuspense, namespace ); { endMeasure(instance, `patch`); } initialVNode.el = subTree.el; } if (m) { queuePostRenderEffect(m, parentSuspense); } if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) { const scopedInitialVNode = initialVNode; queuePostRenderEffect( () => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode), parentSuspense ); } if (initialVNode.shapeFlag & 256 || parent && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) { instance.a && queuePostRenderEffect(instance.a, parentSuspense); } instance.isMounted = true; { devtoolsComponentAdded(instance); } initialVNode = container = anchor = null; } else { let { next, bu, u, parent, vnode } = instance; { const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance); if (nonHydratedAsyncRoot) { if (next) { next.el = vnode.el; updateComponentPreRender(instance, next, optimized); } nonHydratedAsyncRoot.asyncDep.then(() => { if (!instance.isUnmounted) { componentUpdateFn(); } }); return; } } let originNext = next; let vnodeHook; { pushWarningContext(next || instance.vnode); } toggleRecurse(instance, false); if (next) { next.el = vnode.el; updateComponentPreRender(instance, next, optimized); } else { next = vnode; } if (bu) { shared.invokeArrayFns(bu); } if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) { invokeVNodeHook(vnodeHook, parent, next, vnode); } toggleRecurse(instance, true); { startMeasure(instance, `render`); } const nextTree = renderComponentRoot(instance); { endMeasure(instance, `render`); } const prevTree = instance.subTree; instance.subTree = nextTree; { startMeasure(instance, `patch`); } patch( prevTree, nextTree, // parent may have changed if it's in a teleport hostParentNode(prevTree.el), // anchor may have changed if it's in a fragment getNextHostNode(prevTree), instance, parentSuspense, namespace ); { endMeasure(instance, `patch`); } next.el = nextTree.el; if (originNext === null) { updateHOCHostEl(instance, nextTree.el); } if (u) { queuePostRenderEffect(u, parentSuspense); } if (vnodeHook = next.props && next.props.onVnodeUpdated) { queuePostRenderEffect( () => invokeVNodeHook(vnodeHook, parent, next, vnode), parentSuspense ); } { devtoolsComponentUpdated(instance); } { popWarningContext(); } } }; instance.scope.on(); const effect = instance.effect = new reactivity.ReactiveEffect(componentUpdateFn); instance.scope.off(); const update = instance.update = effect.run.bind(effect); const job = instance.job = effect.runIfDirty.bind(effect); job.i = instance; job.id = instance.uid; effect.scheduler = () => queueJob(job); toggleRecurse(instance, true); { effect.onTrack = instance.rtc ? (e) => shared.invokeArrayFns(instance.rtc, e) : void 0; effect.onTrigger = instance.rtg ? (e) => shared.invokeArrayFns(instance.rtg, e) : void 0; } update(); }; const updateComponentPreRender = (instance, nextVNode, optimized) => { nextVNode.component = instance; const prevProps = instance.vnode.props; instance.vnode = nextVNode; instance.next = null; updateProps(instance, nextVNode.props, prevProps, optimized); updateSlots(instance, nextVNode.children, optimized); reactivity.pauseTracking(); flushPreFlushCbs(instance); reactivity.resetTracking(); }; const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => { const c1 = n1 && n1.children; const prevShapeFlag = n1 ? n1.shapeFlag : 0; const c2 = n2.children; const { patchFlag, shapeFlag } = n2; if (patchFlag > 0) { if (patchFlag & 128) { patchKeyedChildren( c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized ); return; } else if (patchFlag & 256) { patchUnkeyedChildren( c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized ); return; } } if (shapeFlag & 8) { if (prevShapeFlag & 16) { unmountChildren(c1, parentComponent, parentSuspense); } if (c2 !== c1) { hostSetElementText(container, c2); } } else { if (prevShapeFlag & 16) { if (shapeFlag & 16) { patchKeyedChildren( c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized ); } else { unmountChildren(c1, parentComponent, parentSuspense, true); } } else { if (prevShapeFlag & 8) { hostSetElementText(container, ""); } if (shapeFlag & 16) { mountChildren( c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized ); } } } }; const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { c1 = c1 || shared.EMPTY_ARR; c2 = c2 || shared.EMPTY_ARR; const oldLength = c1.length; const newLength = c2.length; const commonLength = Math.min(oldLength, newLength); let i; for (i = 0; i < commonLength; i++) { const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]); patch( c1[i], nextChild, container, null, parentComponent, parentSuspense, namespace, slotScopeIds, optimized ); } if (oldLength > newLength) { unmountChildren( c1, parentComponent, parentSuspense, true, false, commonLength ); } else { mountChildren( c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, commonLength ); } }; const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { let i = 0; const l2 = c2.length; let e1 = c1.length - 1; let e2 = l2 - 1; while (i <= e1 && i <= e2) { const n1 = c1[i]; const n2 = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]); if (isSameVNodeType(n1, n2)) { patch( n1, n2, container, null, parentComponent, parentSuspense, namespace, slotScopeIds, optimized ); } else { break; } i++; } while (i <= e1 && i <= e2) { const n1 = c1[e1]; const n2 = c2[e2] = optimized ? cloneIfMounted(c2[e2]) : normalizeVNode(c2[e2]); if (isSameVNodeType(n1, n2)) { patch( n1, n2, container, null, parentComponent, parentSuspense, namespace, slotScopeIds, optimized ); } else { break; } e1--; e2--; } if (i > e1) { if (i <= e2) { const nextPos = e2 + 1; const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor; while (i <= e2) { patch( null, c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]), container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized ); i++; } } } else if (i > e2) { while (i <= e1) { unmount(c1[i], parentComponent, parentSuspense, true); i++; } } else { const s1 = i; const s2 = i; const keyToNewIndexMap = /* @__PURE__ */ new Map(); for (i = s2; i <= e2; i++) { const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]); if (nextChild.key != null) { if (keyToNewIndexMap.has(nextChild.key)) { warn$1( `Duplicate keys found during update:`, JSON.stringify(nextChild.key), `Make sure keys are unique.` ); } keyToNewIndexMap.set(nextChild.key, i); } } let j; let patched = 0; const toBePatched = e2 - s2 + 1; let moved = false; let maxNewIndexSoFar = 0; const newIndexToOldIndexMap = new Array(toBePatched); for (i = 0; i < toBePatched; i++) newIndexToOldIndexMap[i] = 0; for (i = s1; i <= e1; i++) { const prevChild = c1[i]; if (patched >= toBePatched) { unmount(prevChild, parentComponent, parentSuspense, true); continue; } let newIndex; if (prevChild.key != null) { newIndex = keyToNewIndexMap.get(prevChild.key); } else { for (j = s2; j <= e2; j++) { if (newIndexToOldIndexMap[j - s2] === 0 && isSameVNodeType(prevChild, c2[j])) { newIndex = j; break; } } } if (newIndex === void 0) { unmount(prevChild, parentComponent, parentSuspense, true); } else { newIndexToOldIndexMap[newIndex - s2] = i + 1; if (newIndex >= maxNewIndexSoFar) { maxNewIndexSoFar = newIndex; } else { moved = true; } patch( prevChild, c2[newIndex], container, null, parentComponent, parentSuspense, namespace, slotScopeIds, optimized ); patched++; } } const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : shared.EMPTY_ARR; j = increasingNewIndexSequence.length - 1; for (i = toBePatched - 1; i >= 0; i--) { const nextIndex = s2 + i; const nextChild = c2[nextIndex]; const anchor = nextIndex + 1 < l2 ? c2[nextIndex + 1].el : parentAnchor; if (newIndexToOldIndexMap[i] === 0) { patch( null, nextChild, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized ); } else if (moved) { if (j < 0 || i !== increasingNewIndexSequence[j]) { move(nextChild, container, anchor, 2); } else { j--; } } } } }; const move = (vnode, container, anchor, moveType, parentSuspense = null) => { const { el, type, transition, children, shapeFlag } = vnode; if (shapeFlag & 6) { move(vnode.component.subTree, container, anchor, moveType); return; } if (shapeFlag & 128) { vnode.suspense.move(container, anchor, moveType); return; } if (shapeFlag & 64) { type.move(vnode, container, anchor, internals); return; } if (type === Fragment) { hostInsert(el, container, anchor); for (let i = 0; i < children.length; i++) { move(children[i], container, anchor, moveType); } hostInsert(vnode.anchor, container, anchor); return; } if (type === Static) { moveStaticNode(vnode, container, anchor); return; } const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition; if (needTransition2) { if (moveType === 0) { transition.beforeEnter(el); hostInsert(el, container, anchor); queuePostRenderEffect(() => transition.enter(el), parentSuspense); } else { const { leave, delayLeave, afterLeave } = transition; const remove2 = () => hostInsert(el, container, anchor); const performLeave = () => { leave(el, () => { remove2(); afterLeave && afterLeave(); }); }; if (delayLeave) { delayLeave(el, remove2, performLeave); } else { performLeave(); } } } else { hostInsert(el, container, anchor); } }; const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => { const { type, props, ref, children, dynamicChildren, shapeFlag, patchFlag, dirs, cacheIndex } = vnode; if (patchFlag === -2) { optimized = false; } if (ref != null) { setRef(ref, null, parentSuspense, vnode, true); } if (cacheIndex != null) { parentComponent.renderCache[cacheIndex] = void 0; } if (shapeFlag & 256) { parentComponent.ctx.deactivate(vnode); return; } const shouldInvokeDirs = shapeFlag & 1 && dirs; const shouldInvokeVnodeHook = !isAsyncWrapper(vnode); let vnodeHook; if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) { invokeVNodeHook(vnodeHook, parentComponent, vnode); } if (shapeFlag & 6) { unmountComponent(vnode.component, parentSuspense, doRemove); } else { if (shapeFlag & 128) { vnode.suspense.unmount(parentSuspense, doRemove); return; } if (shouldInvokeDirs) { invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount"); } if (shapeFlag & 64) { vnode.type.remove( vnode, parentComponent, parentSuspense, internals, doRemove ); } else if (dynamicChildren && // #5154 // when v-once is used inside a block, setBlockTracking(-1) marks the // parent block with hasOnce: true // so that it doesn't take the fast path during unmount - otherwise // components nested in v-once are never unmounted. !dynamicChildren.hasOnce && // #1153: fast path should not be taken for non-stable (v-for) fragments (type !== Fragment || patchFlag > 0 && patchFlag & 64)) { unmountChildren( dynamicChildren, parentComponent, parentSuspense, false, true ); } else if (type === Fragment && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) { unmountChildren(children, parentComponent, parentSuspense); } if (doRemove) { remove(vnode); } } if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) { queuePostRenderEffect(() => { vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode); shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted"); }, parentSuspense); } }; const remove = (vnode) => { const { type, el, anchor, transition } = vnode; if (type === Fragment) { if (vnode.patchFlag > 0 && vnode.patchFlag & 2048 && transition && !transition.persisted) { vnode.children.forEach((child) => { if (child.type === Comment) { hostRemove(child.el); } else { remove(child); } }); } else { removeFragment(el, anchor); } return; } if (type === Static) { removeStaticNode(vnode); return; } const performRemove = () => { hostRemove(el); if (transition && !transition.persisted && transition.afterLeave) { transition.afterLeave(); } }; if (vnode.shapeFlag & 1 && transition && !transition.persisted) { const { leave, delayLeave } = transition; const performLeave = () => leave(el, performRemove); if (delayLeave) { delayLeave(vnode.el, performRemove, performLeave); } else { performLeave(); } } else { performRemove(); } }; const removeFragment = (cur, end) => { let next; while (cur !== end) { next = hostNextSibling(cur); hostRemove(cur); cur = next; } hostRemove(end); }; const unmountComponent = (instance, parentSuspense, doRemove) => { if (instance.type.__hmrId) { unregisterHMR(instance); } const { bum, scope, job, subTree, um, m, a } = instance; invalidateMount(m); invalidateMount(a); if (bum) { shared.invokeArrayFns(bum); } scope.stop(); if (job) { job.flags |= 8; unmount(subTree, instance, parentSuspense, doRemove); } if (um) { queuePostRenderEffect(um, parentSuspense); } queuePostRenderEffect(() => { instance.isUnmounted = true; }, parentSuspense); if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) { parentSuspense.deps--; if (parentSuspense.deps === 0) { parentSuspense.resolve(); } } { devtoolsComponentRemoved(instance); } }; const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => { for (let i = start; i < children.length; i++) { unmount(children[i], parentComponent, parentSuspense, doRemove, optimized); } }; const getNextHostNode = (vnode) => { if (vnode.shapeFlag & 6) { return getNextHostNode(vnode.component.subTree); } if (vnode.shapeFlag & 128) { return vnode.suspense.next(); } const el = hostNextSibling(vnode.anchor || vnode.el); const teleportEnd = el && el[TeleportEndKey]; return teleportEnd ? hostNextSibling(teleportEnd) : el; }; let isFlushing = false; const render = (vnode, container, namespace) => { if (vnode == null) { if (container._vnode) { unmount(container._vnode, null, null, true); } } else { patch( container._vnode || null, vnode, container, null, null, null, namespace ); } container._vnode = vnode; if (!isFlushing) { isFlushing = true; flushPreFlushCbs(); flushPostFlushCbs(); isFlushing = false; } }; const internals = { p: patch, um: unmount, m: move, r: remove, mt: mountComponent, mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, n: getNextHostNode, o: options }; let hydrate; let hydrateNode; if (createHydrationFns) { [hydrate, hydrateNode] = createHydrationFns( internals ); } return { render, hydrate, createApp: createAppAPI(render, hydrate) }; } function resolveChildrenNamespace({ type, props }, currentNamespace) { return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace; } function toggleRecurse({ effect, job }, allowed) { if (allowed) { effect.flags |= 32; job.flags |= 4; } else { effect.flags &= ~32; job.flags &= ~4; } } function needTransition(parentSuspense, transition) { return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted; } function traverseStaticChildren(n1, n2, shallow = false) { const ch1 = n1.children; const ch2 = n2.children; if (shared.isArray(ch1) && shared.isArray(ch2)) { for (let i = 0; i < ch1.length; i++) { const c1 = ch1[i]; let c2 = ch2[i]; if (c2.shapeFlag & 1 && !c2.dynamicChildren) { if (c2.patchFlag <= 0 || c2.patchFlag === 32) { c2 = ch2[i] = cloneIfMounted(ch2[i]); c2.el = c1.el; } if (!shallow && c2.patchFlag !== -2) traverseStaticChildren(c1, c2); } if (c2.type === Text) { c2.el = c1.el; } if (c2.type === Comment && !c2.el) { c2.el = c1.el; } } } } function getSequence(arr) { const p = arr.slice(); const result = [0]; let i, j, u, v, c; const len = arr.length; for (i = 0; i < len; i++) { const arrI = arr[i]; if (arrI !== 0) { j = result[result.length - 1]; if (arr[j] < arrI) { p[i] = j; result.push(i); continue; } u = 0; v = result.length - 1; while (u < v) { c = u + v >> 1; if (arr[result[c]] < arrI) { u = c + 1; } else { v = c; } } if (arrI < arr[result[u]]) { if (u > 0) { p[i] = result[u - 1]; } result[u] = i; } } } u = result.length; v = result[u - 1]; while (u-- > 0) { result[u] = v; v = p[v]; } return result; } function locateNonHydratedAsyncRoot(instance) { const subComponent = instance.subTree.component; if (subComponent) { if (subComponent.asyncDep && !subComponent.asyncResolved) { return subComponent; } else { return locateNonHydratedAsyncRoot(subComponent); } } } function invalidateMount(hooks) { if (hooks) { for (let i = 0; i < hooks.length; i++) hooks[i].flags |= 8; } } const ssrContextKey = Symbol.for("v-scx"); const useSSRContext = () => { { const ctx = inject(ssrContextKey); if (!ctx) { warn$1( `Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.` ); } return ctx; } }; function watchEffect(effect, options) { return doWatch(effect, null, options); } function watchPostEffect(effect, options) { return doWatch( effect, null, shared.extend({}, options, { flush: "post" }) ); } function watchSyncEffect(effect, options) { return doWatch( effect, null, shared.extend({}, options, { flush: "sync" }) ); } function watch(source, cb, options) { if (!shared.isFunction(cb)) { warn$1( `\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.` ); } return doWatch(source, cb, options); } function doWatch(source, cb, options = shared.EMPTY_OBJ) { const { immediate, deep, flush, once } = options; if (!cb) { if (immediate !== void 0) { warn$1( `watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.` ); } if (deep !== void 0) { warn$1( `watch() "deep" option is only respected when using the watch(source, callback, options?) signature.` ); } if (once !== void 0) { warn$1( `watch() "once" option is only respected when using the watch(source, callback, options?) signature.` ); } } const baseWatchOptions = shared.extend({}, options); baseWatchOptions.onWarn = warn$1; const runsImmediately = cb && immediate || !cb && flush !== "post"; let ssrCleanup; if (isInSSRComponentSetup) { if (flush === "sync") { const ctx = useSSRContext(); ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []); } else if (!runsImmediately) { const watchStopHandle = () => { }; watchStopHandle.stop = shared.NOOP; watchStopHandle.resume = shared.NOOP; watchStopHandle.pause = shared.NOOP; return watchStopHandle; } } const instance = currentInstance; baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args); let isPre = false; if (flush === "post") { baseWatchOptions.scheduler = (job) => { queuePostRenderEffect(job, instance && instance.suspense); }; } else if (flush !== "sync") { isPre = true; baseWatchOptions.scheduler = (job, isFirstRun) => { if (isFirstRun) { job(); } else { queueJob(job); } }; } baseWatchOptions.augmentJob = (job) => { if (cb) { job.flags |= 4; } if (isPre) { job.flags |= 2; if (instance) { job.id = instance.uid; job.i = instance; } } }; const watchHandle = reactivity.watch(source, cb, baseWatchOptions); if (isInSSRComponentSetup) { if (ssrCleanup) { ssrCleanup.push(watchHandle); } else if (runsImmediately) { watchHandle(); } } return watchHandle; } function instanceWatch(source, value, options) { const publicThis = this.proxy; const getter = shared.isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis); let cb; if (shared.isFunction(value)) { cb = value; } else { cb = value.handler; options = value; } const reset = setCurrentInstance(this); const res = doWatch(getter, cb.bind(publicThis), options); reset(); return res; } function createPathGetter(ctx, path) { const segments = path.split("."); return () => { let cur = ctx; for (let i = 0; i < segments.length && cur; i++) { cur = cur[segments[i]]; } return cur; }; } function useModel(props, name, options = shared.EMPTY_OBJ) { const i = getCurrentInstance(); if (!i) { warn$1(`useModel() called without active instance.`); return reactivity.ref(); } const camelizedName = shared.camelize(name); if (!i.propsOptions[0][camelizedName]) { warn$1(`useModel() called with prop "${name}" which is not declared.`); return reactivity.ref(); } const hyphenatedName = shared.hyphenate(name); const modifiers = getModelModifiers(props, camelizedName); const res = reactivity.customRef((track, trigger) => { let localValue; let prevSetValue = shared.EMPTY_OBJ; let prevEmittedValue; watchSyncEffect(() => { const propValue = props[camelizedName]; if (shared.hasChanged(localValue, propValue)) { localValue = propValue; trigger(); } }); return { get() { track(); return options.get ? options.get(localValue) : localValue; }, set(value) { const emittedValue = options.set ? options.set(value) : value; if (!shared.hasChanged(emittedValue, localValue) && !(prevSetValue !== shared.EMPTY_OBJ && shared.hasChanged(value, prevSetValue))) { return; } const rawProps = i.vnode.props; if (!(rawProps && // check if parent has passed v-model (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps))) { localValue = value; trigger(); } i.emit(`update:${name}`, emittedValue); if (shared.hasChanged(value, emittedValue) && shared.hasChanged(value, prevSetValue) && !shared.hasChanged(emittedValue, prevEmittedValue)) { trigger(); } prevSetValue = value; prevEmittedValue = emittedValue; } }; }); res[Symbol.iterator] = () => { let i2 = 0; return { next() { if (i2 < 2) { return { value: i2++ ? modifiers || shared.EMPTY_OBJ : res, done: false }; } else { return { done: true }; } } }; }; return res; } const getModelModifiers = (props, modelName) => { return modelName === "modelValue" || modelName === "model-value" ? props.modelModifiers : props[`${modelName}Modifiers`] || props[`${shared.camelize(modelName)}Modifiers`] || props[`${shared.hyphenate(modelName)}Modifiers`]; }; function emit(instance, event, ...rawArgs) { if (instance.isUnmounted) return; const props = instance.vnode.props || shared.EMPTY_OBJ; { const { emitsOptions, propsOptions: [propsOptions] } = instance; if (emitsOptions) { if (!(event in emitsOptions) && true) { if (!propsOptions || !(shared.toHandlerKey(shared.camelize(event)) in propsOptions)) { warn$1( `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${shared.toHandlerKey(shared.camelize(event))}" prop.` ); } } else { const validator = emitsOptions[event]; if (shared.isFunction(validator)) { const isValid = validator(...rawArgs); if (!isValid) { warn$1( `Invalid event arguments: event validation failed for event "${event}".` ); } } } } } let args = rawArgs; const isModelListener = event.startsWith("update:"); const modifiers = isModelListener && getModelModifiers(props, event.slice(7)); if (modifiers) { if (modifiers.trim) { args = rawArgs.map((a) => shared.isString(a) ? a.trim() : a); } if (modifiers.number) { args = rawArgs.map(shared.looseToNumber); } } { devtoolsComponentEmit(instance, event, args); } { const lowerCaseEvent = event.toLowerCase(); if (lowerCaseEvent !== event && props[shared.toHandlerKey(lowerCaseEvent)]) { warn$1( `Event "${lowerCaseEvent}" is emitted in component ${formatComponentName( instance, instance.type )} but the handler is registered for "${event}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${shared.hyphenate( event )}" instead of "${event}".` ); } } let handlerName; let handler = props[handlerName = shared.toHandlerKey(event)] || // also try camelCase event handler (#2249) props[handlerName = shared.toHandlerKey(shared.camelize(event))]; if (!handler && isModelListener) { handler = props[handlerName = shared.toHandlerKey(shared.hyphenate(event))]; } if (handler) { callWithAsyncErrorHandling( handler, instance, 6, args ); } const onceHandler = props[handlerName + `Once`]; if (onceHandler) { if (!instance.emitted) { instance.emitted = {}; } else if (instance.emitted[handlerName]) { return; } instance.emitted[handlerName] = true; callWithAsyncErrorHandling( onceHandler, instance, 6, args ); } } function normalizeEmitsOptions(comp, appContext, asMixin = false) { const cache = appContext.emitsCache; const cached = cache.get(comp); if (cached !== void 0) { return cached; } const raw = comp.emits; let normalized = {}; let hasExtends = false; if (!shared.isFunction(comp)) { const extendEmits = (raw2) => { const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true); if (normalizedFromExtend) { hasExtends = true; shared.extend(normalized, normalizedFromExtend); } }; if (!asMixin && appContext.mixins.length) { appContext.mixins.forEach(extendEmits); } if (comp.extends) { extendEmits(comp.extends); } if (comp.mixins) { comp.mixins.forEach(extendEmits); } } if (!raw && !hasExtends) { if (shared.isObject(comp)) { cache.set(comp, null); } return null; } if (shared.isArray(raw)) { raw.forEach((key) => normalized[key] = null); } else { shared.extend(normalized, raw); } if (shared.isObject(comp)) { cache.set(comp, normalized); } return normalized; } function isEmitListener(options, key) { if (!options || !shared.isOn(key)) { return false; } key = key.slice(2).replace(/Once$/, ""); return shared.hasOwn(options, key[0].toLowerCase() + key.slice(1)) || shared.hasOwn(options, shared.hyphenate(key)) || shared.hasOwn(options, key); } let accessedAttrs = false; function markAttrsAccessed() { accessedAttrs = true; } function renderComponentRoot(instance) { const { type: Component, vnode, proxy, withProxy, propsOptions: [propsOptions], slots, attrs, emit, render, renderCache, props, data, setupState, ctx, inheritAttrs } = instance; const prev = setCurrentRenderingInstance(instance); let result; let fallthroughAttrs; { accessedAttrs = false; } try { if (vnode.shapeFlag & 4) { const proxyToUse = withProxy || proxy; const thisProxy = setupState.__isScriptSetup ? new Proxy(proxyToUse, { get(target, key, receiver) { warn$1( `Property '${String( key )}' was accessed via 'this'. Avoid using 'this' in templates.` ); return Reflect.get(target, key, receiver); } }) : proxyToUse; result = normalizeVNode( render.call( thisProxy, proxyToUse, renderCache, true ? reactivity.shallowReadonly(props) : 0, setupState, data, ctx ) ); fallthroughAttrs = attrs; } else { const render2 = Component; if (attrs === props) { markAttrsAccessed(); } result = normalizeVNode( render2.length > 1 ? render2( true ? reactivity.shallowReadonly(props) : 0, true ? { get attrs() { markAttrsAccessed(); return reactivity.shallowReadonly(attrs); }, slots, emit } : 0 ) : render2( true ? reactivity.shallowReadonly(props) : 0, null ) ); fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs); } } catch (err) { blockStack.length = 0; handleError(err, instance, 1); result = createVNode(Comment); } let root = result; let setRoot = void 0; if (result.patchFlag > 0 && result.patchFlag & 2048) { [root, setRoot] = getChildRoot(result); } if (fallthroughAttrs && inheritAttrs !== false) { const keys = Object.keys(fallthroughAttrs); const { shapeFlag } = root; if (keys.length) { if (shapeFlag & (1 | 6)) { if (propsOptions && keys.some(shared.isModelListener)) { fallthroughAttrs = filterModelListeners( fallthroughAttrs, propsOptions ); } root = cloneVNode(root, fallthroughAttrs, false, true); } else if (!accessedAttrs && root.type !== Comment) { const allAttrs = Object.keys(attrs); const eventAttrs = []; const extraAttrs = []; for (let i = 0, l = allAttrs.length; i < l; i++) { const key = allAttrs[i]; if (shared.isOn(key)) { if (!shared.isModelListener(key)) { eventAttrs.push(key[2].toLowerCase() + key.slice(3)); } } else { extraAttrs.push(key); } } if (extraAttrs.length) { warn$1( `Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text or teleport root nodes.` ); } if (eventAttrs.length) { warn$1( `Extraneous non-emits event listeners (${eventAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.` ); } } } } if (vnode.dirs) { if (!isElementRoot(root)) { warn$1( `Runtime directive used on component with non-element root node. The directives will not function as intended.` ); } root = cloneVNode(root, null, false, true); root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs; } if (vnode.transition) { if (!isElementRoot(root)) { warn$1( `Component inside <Transition> renders non-element root node that cannot be animated.` ); } setTransitionHooks(root, vnode.transition); } if (setRoot) { setRoot(root); } else { result = root; } setCurrentRenderingInstance(prev); return result; } const getChildRoot = (vnode) => { const rawChildren = vnode.children; const dynamicChildren = vnode.dynamicChildren; const childRoot = filterSingleRoot(rawChildren, false); if (!childRoot) { return [vnode, void 0]; } else if (childRoot.patchFlag > 0 && childRoot.patchFlag & 2048) { return getChildRoot(childRoot); } const index = rawChildren.indexOf(childRoot); const dynamicIndex = dynamicChildren ? dynamicChildren.indexOf(childRoot) : -1; const setRoot = (updatedRoot) => { rawChildren[index] = updatedRoot; if (dynamicChildren) { if (dynamicIndex > -1) { dynamicChildren[dynamicIndex] = updatedRoot; } else if (updatedRoot.patchFlag > 0) { vnode.dynamicChildren = [...dynamicChildren, updatedRoot]; } } }; return [normalizeVNode(childRoot), setRoot]; }; function filterSingleRoot(children, recurse = true) { let singleRoot; for (let i = 0; i < children.length; i++) { const child = children[i]; if (isVNode(child)) { if (child.type !== Comment || child.children === "v-if") { if (singleRoot) { return; } else { singleRoot = child; if (recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) { return filterSingleRoot(singleRoot.children); } } } } else { return; } } return singleRoot; } const getFunctionalFallthrough = (attrs) => { let res; for (const key in attrs) { if (key === "class" || key === "style" || shared.isOn(key)) { (res || (res = {}))[key] = attrs[key]; } } return res; }; const filterModelListeners = (attrs, props) => { const res = {}; for (const key in attrs) { if (!shared.isModelListener(key) || !(key.slice(9) in props)) { res[key] = attrs[key]; } } return res; }; const isElementRoot = (vnode) => { return vnode.shapeFlag & (6 | 1) || vnode.type === Comment; }; function shouldUpdateComponent(prevVNode, nextVNode, optimized) { const { props: prevProps, children: prevChildren, component } = prevVNode; const { props: nextProps, children: nextChildren, patchFlag } = nextVNode; const emits = component.emitsOptions; if ((prevChildren || nextChildren) && isHmrUpdating) { return true; } if (nextVNode.dirs || nextVNode.transition) { return true; } if (optimized && patchFlag >= 0) { if (patchFlag & 1024) { return true; } if (patchFlag & 16) { if (!prevProps) { return !!nextProps; } return hasPropsChanged(prevProps, nextProps, emits); } else if (patchFlag & 8) { const dynamicProps = nextVNode.dynamicProps; for (let i = 0; i < dynamicProps.length; i++) { const key = dynamicProps[i]; if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) { return true; } } } } else { if (prevChildren || nextChildren) { if (!nextChildren || !nextChildren.$stable) { return true; } } if (prevProps === nextProps) { return false; } if (!prevProps) { return !!nextProps; } if (!nextProps) { return true; } return hasPropsChanged(prevProps, nextProps, emits); } return false; } function hasPropsChanged(prevProps, nextProps, emitsOptions) { const nextKeys = Object.keys(nextProps); if (nextKeys.length !== Object.keys(prevProps).length) { return true; } for (let i = 0; i < nextKeys.length; i++) { const key = nextKeys[i]; if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) { return true; } } return false; } function updateHOCHostEl({ vnode, parent }, el) { while (parent) { const root = parent.subTree; if (root.suspense && root.suspense.activeBranch === vnode) { root.el = vnode.el; } if (root === vnode) { (vnode = parent.vnode).el = el; parent = parent.parent; } else { break; } } } const isSuspense = (type) => type.__isSuspense; let suspenseId = 0; const SuspenseImpl = { name: "Suspense", // In order to make Suspense tree-shakable, we need to avoid importing it // directly in the renderer. The renderer checks for the __isSuspense flag // on a vnode's type and calls the `process` method, passing in renderer // internals. __isSuspense: true, process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) { if (n1 == null) { mountSuspense( n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals ); } else { if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) { n2.suspense = n1.suspense; n2.suspense.vnode = n2; n2.el = n1.el; return; } patchSuspense( n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, rendererInternals ); } }, hydrate: hydrateSuspense, normalize: normalizeSuspenseChildren }; const Suspense = SuspenseImpl ; function triggerEvent(vnode, name) { const eventListener = vnode.props && vnode.props[name]; if (shared.isFunction(eventListener)) { eventListener(); } } function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) { const { p: patch, o: { createElement } } = rendererInternals; const hiddenContainer = createElement("div"); const suspense = vnode.suspense = createSuspenseBoundary( vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, namespace, slotScopeIds, optimized, rendererInternals ); patch( null, suspense.pendingBranch = vnode.ssContent, hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds ); if (suspense.deps > 0) { triggerEvent(vnode, "onPending"); triggerEvent(vnode, "onFallback"); patch( null, vnode.ssFallback, container, anchor, parentComponent, null, // fallback tree will not have suspense context namespace, slotScopeIds ); setActiveBranch(suspense, vnode.ssFallback); } else { suspense.resolve(false, true); } } function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) { const suspense = n2.suspense = n1.suspense; suspense.vnode = n2; n2.el = n1.el; const newBranch = n2.ssContent; const newFallback = n2.ssFallback; const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense; if (pendingBranch) { suspense.pendingBranch = newBranch; if (isSameVNodeType(newBranch, pendingBranch)) { patch( pendingBranch, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized ); if (suspense.deps <= 0) { suspense.resolve(); } else if (isInFallback) { if (!isHydrating) { patch( activeBranch, newFallback, container, anchor, parentComponent, null, // fallback tree will not have suspense context namespace, slotScopeIds, optimized ); setActiveBranch(suspense, newFallback); } } } else { suspense.pendingId = suspenseId++; if (isHydrating) { suspense.isHydrating = false; suspense.activeBranch = pendingBranch; } else { unmount(pendingBranch, parentComponent, suspense); } suspense.deps = 0; suspense.effects.length = 0; suspense.hiddenContainer = createElement("div"); if (isInFallback) { patch( null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized ); if (suspense.deps <= 0) { suspense.resolve(); } else { patch( activeBranch, newFallback, container, anchor, parentComponent, null, // fallback tree will not have suspense context namespace, slotScopeIds, optimized ); setActiveBranch(suspense, newFallback); } } else if (activeBranch && isSameVNodeType(newBranch, activeBranch)) { patch( activeBranch, newBranch, container, anchor, parentComponent, suspense, namespace, slotScopeIds, optimized ); suspense.resolve(true); } else { patch( null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized ); if (suspense.deps <= 0) { suspense.resolve(); } } } } else { if (activeBranch && isSameVNodeType(newBranch, activeBranch)) { patch( activeBranch, newBranch, container, anchor, parentComponent, suspense, namespace, slotScopeIds, optimized ); setActiveBranch(suspense, newBranch); } else { triggerEvent(n2, "onPending"); suspense.pendingBranch = newBranch; if (newBranch.shapeFlag & 512) { suspense.pendingId = newBranch.component.suspenseId; } else { suspense.pendingId = suspenseId++; } patch( null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, namespace, slotScopeIds, optimized ); if (suspense.deps <= 0) { suspense.resolve(); } else { const { timeout, pendingId } = suspense; if (timeout > 0) { setTimeout(() => { if (suspense.pendingId === pendingId) { suspense.fallback(newFallback); } }, timeout); } else if (timeout === 0) { suspense.fallback(newFallback); } } } } } let hasWarned = false; function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, namespace, slotScopeIds, optimized, rendererInternals, isHydrating = false) { if (!hasWarned) { hasWarned = true; console[console.info ? "info" : "log"]( `<Suspense> is an experimental feature and its API will likely change.` ); } const { p: patch, m: move, um: unmount, n: next, o: { parentNode, remove } } = rendererInternals; let parentSuspenseId; const isSuspensible = isVNodeSuspensible(vnode); if (isSuspensible) { if (parentSuspense && parentSuspense.pendingBranch) { parentSuspenseId = parentSuspense.pendingId; parentSuspense.deps++; } } const timeout = vnode.props ? shared.toNumber(vnode.props.timeout) : void 0; { assertNumber(timeout, `Suspense timeout`); } const initialAnchor = anchor; const suspense = { vnode, parent: parentSuspense, parentComponent, namespace, container, hiddenContainer, deps: 0, pendingId: suspenseId++, timeout: typeof timeout === "number" ? timeout : -1, activeBranch: null, pendingBranch: null, isInFallback: !isHydrating, isHydrating, isUnmounted: false, effects: [], resolve(resume = false, sync = false) { { if (!resume && !suspense.pendingBranch) { throw new Error( `suspense.resolve() is called without a pending branch.` ); } if (suspense.isUnmounted) { throw new Error( `suspense.resolve() is called on an already unmounted suspense boundary.` ); } } const { vnode: vnode2, activeBranch, pendingBranch, pendingId, effects, parentComponent: parentComponent2, container: container2 } = suspense; let delayEnter = false; if (suspense.isHydrating) { suspense.isHydrating = false; } else if (!resume) { delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in"; if (delayEnter) { activeBranch.transition.afterLeave = () => { if (pendingId === suspense.pendingId) { move( pendingBranch, container2, anchor === initialAnchor ? next(activeBranch) : anchor, 0 ); queuePostFlushCb(effects); } }; } if (activeBranch) { if (parentNode(activeBranch.el) === container2) { anchor = next(activeBranch); } unmount(activeBranch, parentComponent2, suspense, true); } if (!delayEnter) { move(pendingBranch, container2, anchor, 0); } } setActiveBranch(suspense, pendingBranch); suspense.pendingBranch = null; suspense.isInFallback = false; let parent = suspense.parent; let hasUnresolvedAncestor = false; while (parent) { if (parent.pendingBranch) { parent.effects.push(...effects); hasUnresolvedAncestor = true; break; } parent = parent.parent; } if (!hasUnresolvedAncestor && !delayEnter) { queuePostFlushCb(effects); } suspense.effects = []; if (isSuspensible) { if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) { parentSuspense.deps--; if (parentSuspense.deps === 0 && !sync) { parentSuspense.resolve(); } } } triggerEvent(vnode2, "onResolve"); }, fallback(fallbackVNode) { if (!suspense.pendingBranch) { return; } const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense; triggerEvent(vnode2, "onFallback"); const anchor2 = next(activeBranch); const mountFallback = () => { if (!suspense.isInFallback) { return; } patch( null, fallbackVNode, container2, anchor2, parentComponent2, null, // fallback tree will not have suspense context namespace2, slotScopeIds, optimized ); setActiveBranch(suspense, fallbackVNode); }; const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in"; if (delayEnter) { activeBranch.transition.afterLeave = mountFallback; } suspense.isInFallback = true; unmount( activeBranch, parentComponent2, null, // no suspense so unmount hooks fire now true // shouldRemove ); if (!delayEnter) { mountFallback(); } }, move(container2, anchor2, type) { suspense.activeBranch && move(suspense.activeBranch, container2, anchor2, type); suspense.container = container2; }, next() { return suspense.activeBranch && next(suspense.activeBranch); }, registerDep(instance, setupRenderEffect, optimized2) { const isInPendingSuspense = !!suspense.pendingBranch; if (isInPendingSuspense) { suspense.deps++; } const hydratedEl = instance.vnode.el; instance.asyncDep.catch((err) => { handleError(err, instance, 0); }).then((asyncSetupResult) => { if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) { return; } instance.asyncResolved = true; const { vnode: vnode2 } = instance; { pushWarningContext(vnode2); } handleSetupResult(instance, asyncSetupResult, false); if (hydratedEl) { vnode2.el = hydratedEl; } const placeholder = !hydratedEl && instance.subTree.el; setupRenderEffect( instance, vnode2, // component may have been moved before resolve. // if this is not a hydration, instance.subTree will be the comment // placeholder. parentNode(hydratedEl || instance.subTree.el), // anchor will not be used if this is hydration, so only need to // consider the comment placeholder case. hydratedEl ? null : next(instance.subTree), suspense, namespace, optimized2 ); if (placeholder) { remove(placeholder); } updateHOCHostEl(instance, vnode2.el); { popWarningContext(); } if (isInPendingSuspense && --suspense.deps === 0) { suspense.resolve(); } }); }, unmount(parentSuspense2, doRemove) { suspense.isUnmounted = true; if (suspense.activeBranch) { unmount( suspense.activeBranch, parentComponent, parentSuspense2, doRemove ); } if (suspense.pendingBranch) { unmount( suspense.pendingBranch, parentComponent, parentSuspense2, doRemove ); } } }; return suspense; } function hydrateSuspense(node, vnode, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals, hydrateNode) { const suspense = vnode.suspense = createSuspenseBoundary( vnode, parentSuspense, parentComponent, node.parentNode, // eslint-disable-next-line no-restricted-globals document.createElement("div"), null, namespace, slotScopeIds, optimized, rendererInternals, true ); const result = hydrateNode( node, suspense.pendingBranch = vnode.ssContent, parentComponent, suspense, slotScopeIds, optimized ); if (suspense.deps === 0) { suspense.resolve(false, true); } return result; } function normalizeSuspenseChildren(vnode) { const { shapeFlag, children } = vnode; const isSlotChildren = shapeFlag & 32; vnode.ssContent = normalizeSuspenseSlot( isSlotChildren ? children.default : children ); vnode.ssFallback = isSlotChildren ? normalizeSuspenseSlot(children.fallback) : createVNode(Comment); } function normalizeSuspenseSlot(s) { let block; if (shared.isFunction(s)) { const trackBlock = isBlockTreeEnabled && s._c; if (trackBlock) { s._d = false; openBlock(); } s = s(); if (trackBlock) { s._d = true; block = currentBlock; closeBlock(); } } if (shared.isArray(s)) { const singleChild = filterSingleRoot(s); if (!singleChild && s.filter((child) => child !== NULL_DYNAMIC_COMPONENT).length > 0) { warn$1(`<Suspense> slots expect a single root node.`); } s = singleChild; } s = normalizeVNode(s); if (block && !s.dynamicChildren) { s.dynamicChildren = block.filter((c) => c !== s); } return s; } function queueEffectWithSuspense(fn, suspense) { if (suspense && suspense.pendingBranch) { if (shared.isArray(fn)) { suspense.effects.push(...fn); } else { suspense.effects.push(fn); } } else { queuePostFlushCb(fn); } } function setActiveBranch(suspense, branch) { suspense.activeBranch = branch; const { vnode, parentComponent } = suspense; let el = branch.el; while (!el && branch.component) { branch = branch.component.subTree; el = branch.el; } vnode.el = el; if (parentComponent && parentComponent.subTree === vnode) { parentComponent.vnode.el = el; updateHOCHostEl(parentComponent, el); } } function isVNodeSuspensible(vnode) { const suspensible = vnode.props && vnode.props.suspensible; return suspensible != null && suspensible !== false; } const Fragment = Symbol.for("v-fgt"); const Text = Symbol.for("v-txt"); const Comment = Symbol.for("v-cmt"); const Static = Symbol.for("v-stc"); const blockStack = []; let currentBlock = null; function openBlock(disableTracking = false) { blockStack.push(currentBlock = disableTracking ? null : []); } function closeBlock() { blockStack.pop(); currentBlock = blockStack[blockStack.length - 1] || null; } let isBlockTreeEnabled = 1; function setBlockTracking(value, inVOnce = false) { isBlockTreeEnabled += value; if (value < 0 && currentBlock && inVOnce) { currentBlock.hasOnce = true; } } function setupBlock(vnode) { vnode.dynamicChildren = isBlockTreeEnabled > 0 ? currentBlock || shared.EMPTY_ARR : null; closeBlock(); if (isBlockTreeEnabled > 0 && currentBlock) { currentBlock.push(vnode); } return vnode; } function createElementBlock(type, props, children, patchFlag, dynamicProps, shapeFlag) { return setupBlock( createBaseVNode( type, props, children, patchFlag, dynamicProps, shapeFlag, true ) ); } function createBlock(type, props, children, patchFlag, dynamicProps) { return setupBlock( createVNode( type, props, children, patchFlag, dynamicProps, true ) ); } function isVNode(value) { return value ? value.__v_isVNode === true : false; } function isSameVNodeType(n1, n2) { if (n2.shapeFlag & 6 && n1.component) { const dirtyInstances = hmrDirtyComponents.get(n2.type); if (dirtyInstances && dirtyInstances.has(n1.component)) { n1.shapeFlag &= ~256; n2.shapeFlag &= ~512; return false; } } return n1.type === n2.type && n1.key === n2.key; } let vnodeArgsTransformer; function transformVNodeArgs(transformer) { vnodeArgsTransformer = transformer; } const createVNodeWithArgsTransform = (...args) => { return _createVNode( ...vnodeArgsTransformer ? vnodeArgsTransformer(args, currentRenderingInstance) : args ); }; const normalizeKey = ({ key }) => key != null ? key : null; const normalizeRef = ({ ref, ref_key, ref_for }) => { if (typeof ref === "number") { ref = "" + ref; } return ref != null ? shared.isString(ref) || reactivity.isRef(ref) || shared.isFunction(ref) ? { i: currentRenderingInstance, r: ref, k: ref_key, f: !!ref_for } : ref : null; }; function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) { const vnode = { __v_isVNode: true, __v_skip: true, type, props, key: props && normalizeKey(props), ref: props && normalizeRef(props), scopeId: currentScopeId, slotScopeIds: null, children, component: null, suspense: null, ssContent: null, ssFallback: null, dirs: null, transition: null, el: null, anchor: null, target: null, targetStart: null, targetAnchor: null, staticCount: 0, shapeFlag, patchFlag, dynamicProps, dynamicChildren: null, appContext: null, ctx: currentRenderingInstance }; if (needFullChildrenNormalization) { normalizeChildren(vnode, children); if (shapeFlag & 128) { type.normalize(vnode); } } else if (children) { vnode.shapeFlag |= shared.isString(children) ? 8 : 16; } if (vnode.key !== vnode.key) { warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type); } if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself !isBlockNode && // has current parent block currentBlock && // presence of a patch flag indicates this node needs patching on updates. // component nodes also should always be patched, because even if the // component doesn't need to update, it needs to persist the instance on to // the next vnode so that it can be properly unmounted later. (vnode.patchFlag > 0 || shapeFlag & 6) && // the EVENTS flag is only for hydration and if it is the only flag, the // vnode should not be considered dynamic due to handler caching. vnode.patchFlag !== 32) { currentBlock.push(vnode); } return vnode; } const createVNode = createVNodeWithArgsTransform ; function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) { if (!type || type === NULL_DYNAMIC_COMPONENT) { if (!type) { warn$1(`Invalid vnode type when creating vnode: ${type}.`); } type = Comment; } if (isVNode(type)) { const cloned = cloneVNode( type, props, true /* mergeRef: true */ ); if (children) { normalizeChildren(cloned, children); } if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) { if (cloned.shapeFlag & 6) { currentBlock[currentBlock.indexOf(type)] = cloned; } else { currentBlock.push(cloned); } } cloned.patchFlag = -2; return cloned; } if (isClassComponent(type)) { type = type.__vccOpts; } if (props) { props = guardReactiveProps(props); let { class: klass, style } = props; if (klass && !shared.isString(klass)) { props.class = shared.normalizeClass(klass); } if (shared.isObject(style)) { if (reactivity.isProxy(style) && !shared.isArray(style)) { style = shared.extend({}, style); } props.style = shared.normalizeStyle(style); } } const shapeFlag = shared.isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : shared.isObject(type) ? 4 : shared.isFunction(type) ? 2 : 0; if (shapeFlag & 4 && reactivity.isProxy(type)) { type = reactivity.toRaw(type); warn$1( `Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with \`markRaw\` or using \`shallowRef\` instead of \`ref\`.`, ` Component that was made reactive: `, type ); } return createBaseVNode( type, props, children, patchFlag, dynamicProps, shapeFlag, isBlockNode, true ); } function guardReactiveProps(props) { if (!props) return null; return reactivity.isProxy(props) || isInternalObject(props) ? shared.extend({}, props) : props; } function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) { const { props, ref, patchFlag, children, transition } = vnode; const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props; const cloned = { __v_isVNode: true, __v_skip: true, type: vnode.type, props: mergedProps, key: mergedProps && normalizeKey(mergedProps), ref: extraProps && extraProps.ref ? ( // #2078 in the case of <component :is="vnode" ref="extra"/> // if the vnode itself already has a ref, cloneVNode will need to merge // the refs so the single vnode can be set on multiple refs mergeRef && ref ? shared.isArray(ref) ? ref.concat(normalizeRef(extraProps)) : [ref, normalizeRef(extraProps)] : normalizeRef(extraProps) ) : ref, scopeId: vnode.scopeId, slotScopeIds: vnode.slotScopeIds, children: patchFlag === -1 && shared.isArray(children) ? children.map(deepCloneVNode) : children, target: vnode.target, targetStart: vnode.targetStart, targetAnchor: vnode.targetAnchor, staticCount: vnode.staticCount, shapeFlag: vnode.shapeFlag, // if the vnode is cloned with extra props, we can no longer assume its // existing patch flag to be reliable and need to add the FULL_PROPS flag. // note: preserve flag for fragments since they use the flag for children // fast paths only. patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 ? 16 : patchFlag | 16 : patchFlag, dynamicProps: vnode.dynamicProps, dynamicChildren: vnode.dynamicChildren, appContext: vnode.appContext, dirs: vnode.dirs, transition, // These should technically only be non-null on mounted VNodes. However, // they *should* be copied for kept-alive vnodes. So we just always copy // them since them being non-null during a mount doesn't affect the logic as // they will simply be overwritten. component: vnode.component, suspense: vnode.suspense, ssContent: vnode.ssContent && cloneVNode(vnode.ssContent), ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback), el: vnode.el, anchor: vnode.anchor, ctx: vnode.ctx, ce: vnode.ce }; if (transition && cloneTransition) { setTransitionHooks( cloned, transition.clone(cloned) ); } return cloned; } function deepCloneVNode(vnode) { const cloned = cloneVNode(vnode); if (shared.isArray(vnode.children)) { cloned.children = vnode.children.map(deepCloneVNode); } return cloned; } function createTextVNode(text = " ", flag = 0) { return createVNode(Text, null, text, flag); } function createStaticVNode(content, numberOfNodes) { const vnode = createVNode(Static, null, content); vnode.staticCount = numberOfNodes; return vnode; } function createCommentVNode(text = "", asBlock = false) { return asBlock ? (openBlock(), createBlock(Comment, null, text)) : createVNode(Comment, null, text); } function normalizeVNode(child) { if (child == null || typeof child === "boolean") { return createVNode(Comment); } else if (shared.isArray(child)) { return createVNode( Fragment, null, // #3666, avoid reference pollution when reusing vnode child.slice() ); } else if (isVNode(child)) { return cloneIfMounted(child); } else { return createVNode(Text, null, String(child)); } } function cloneIfMounted(child) { return child.el === null && child.patchFlag !== -1 || child.memo ? child : cloneVNode(child); } function normalizeChildren(vnode, children) { let type = 0; const { shapeFlag } = vnode; if (children == null) { children = null; } else if (shared.isArray(children)) { type = 16; } else if (typeof children === "object") { if (shapeFlag & (1 | 64)) { const slot = children.default; if (slot) { slot._c && (slot._d = false); normalizeChildren(vnode, slot()); slot._c && (slot._d = true); } return; } else { type = 32; const slotFlag = children._; if (!slotFlag && !isInternalObject(children)) { children._ctx = currentRenderingInstance; } else if (slotFlag === 3 && currentRenderingInstance) { if (currentRenderingInstance.slots._ === 1) { children._ = 1; } else { children._ = 2; vnode.patchFlag |= 1024; } } } } else if (shared.isFunction(children)) { children = { default: children, _ctx: currentRenderingInstance }; type = 32; } else { children = String(children); if (shapeFlag & 64) { type = 16; children = [createTextVNode(children)]; } else { type = 8; } } vnode.children = children; vnode.shapeFlag |= type; } function mergeProps(...args) { const ret = {}; for (let i = 0; i < args.length; i++) { const toMerge = args[i]; for (const key in toMerge) { if (key === "class") { if (ret.class !== toMerge.class) { ret.class = shared.normalizeClass([ret.class, toMerge.class]); } } else if (key === "style") { ret.style = shared.normalizeStyle([ret.style, toMerge.style]); } else if (shared.isOn(key)) { const existing = ret[key]; const incoming = toMerge[key]; if (incoming && existing !== incoming && !(shared.isArray(existing) && existing.includes(incoming))) { ret[key] = existing ? [].concat(existing, incoming) : incoming; } } else if (key !== "") { ret[key] = toMerge[key]; } } } return ret; } function invokeVNodeHook(hook, instance, vnode, prevVNode = null) { callWithAsyncErrorHandling(hook, instance, 7, [ vnode, prevVNode ]); } const emptyAppContext = createAppContext(); let uid = 0; function createComponentInstance(vnode, parent, suspense) { const type = vnode.type; const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext; const instance = { uid: uid++, vnode, type, parent, appContext, root: null, // to be immediately set next: null, subTree: null, // will be set synchronously right after creation effect: null, update: null, // will be set synchronously right after creation job: null, scope: new reactivity.EffectScope( true /* detached */ ), render: null, proxy: null, exposed: null, exposeProxy: null, withProxy: null, provides: parent ? parent.provides : Object.create(appContext.provides), ids: parent ? parent.ids : ["", 0, 0], accessCache: null, renderCache: [], // local resolved assets components: null, directives: null, // resolved props and emits options propsOptions: normalizePropsOptions(type, appContext), emitsOptions: normalizeEmitsOptions(type, appContext), // emit emit: null, // to be set immediately emitted: null, // props default value propsDefaults: shared.EMPTY_OBJ, // inheritAttrs inheritAttrs: type.inheritAttrs, // state ctx: shared.EMPTY_OBJ, data: shared.EMPTY_OBJ, props: shared.EMPTY_OBJ, attrs: shared.EMPTY_OBJ, slots: shared.EMPTY_OBJ, refs: shared.EMPTY_OBJ, setupState: shared.EMPTY_OBJ, setupContext: null, // suspense related suspense, suspenseId: suspense ? suspense.pendingId : 0, asyncDep: null, asyncResolved: false, // lifecycle hooks // not using enums here because it results in computed properties isMounted: false, isUnmounted: false, isDeactivated: false, bc: null, c: null, bm: null, m: null, bu: null, u: null, um: null, bum: null, da: null, a: null, rtg: null, rtc: null, ec: null, sp: null }; { instance.ctx = createDevRenderContext(instance); } instance.root = parent ? parent.root : instance; instance.emit = emit.bind(null, instance); if (vnode.ce) { vnode.ce(instance); } return instance; } let currentInstance = null; const getCurrentInstance = () => currentInstance || currentRenderingInstance; let internalSetCurrentInstance; let setInSSRSetupState; { const g = shared.getGlobalThis(); const registerGlobalSetter = (key, setter) => { let setters; if (!(setters = g[key])) setters = g[key] = []; setters.push(setter); return (v) => { if (setters.length > 1) setters.forEach((set) => set(v)); else setters[0](v); }; }; internalSetCurrentInstance = registerGlobalSetter( `__VUE_INSTANCE_SETTERS__`, (v) => currentInstance = v ); setInSSRSetupState = registerGlobalSetter( `__VUE_SSR_SETTERS__`, (v) => isInSSRComponentSetup = v ); } const setCurrentInstance = (instance) => { const prev = currentInstance; internalSetCurrentInstance(instance); instance.scope.on(); return () => { instance.scope.off(); internalSetCurrentInstance(prev); }; }; const unsetCurrentInstance = () => { currentInstance && currentInstance.scope.off(); internalSetCurrentInstance(null); }; const isBuiltInTag = /* @__PURE__ */ shared.makeMap("slot,component"); function validateComponentName(name, { isNativeTag }) { if (isBuiltInTag(name) || isNativeTag(name)) { warn$1( "Do not use built-in or reserved HTML elements as component id: " + name ); } } function isStatefulComponent(instance) { return instance.vnode.shapeFlag & 4; } let isInSSRComponentSetup = false; function setupComponent(instance, isSSR = false, optimized = false) { isSSR && setInSSRSetupState(isSSR); const { props, children } = instance.vnode; const isStateful = isStatefulComponent(instance); initProps(instance, props, isStateful, isSSR); initSlots(instance, children, optimized); const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0; isSSR && setInSSRSetupState(false); return setupResult; } function setupStatefulComponent(instance, isSSR) { var _a; const Component = instance.type; { if (Component.name) { validateComponentName(Component.name, instance.appContext.config); } if (Component.components) { const names = Object.keys(Component.components); for (let i = 0; i < names.length; i++) { validateComponentName(names[i], instance.appContext.config); } } if (Component.directives) { const names = Object.keys(Component.directives); for (let i = 0; i < names.length; i++) { validateDirectiveName(names[i]); } } if (Component.compilerOptions && isRuntimeOnly()) { warn$1( `"compilerOptions" is only supported when using a build of Vue that includes the runtime compiler. Since you are using a runtime-only build, the options should be passed via your build tool config instead.` ); } } instance.accessCache = /* @__PURE__ */ Object.create(null); instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers); { exposePropsOnRenderContext(instance); } const { setup } = Component; if (setup) { reactivity.pauseTracking(); const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null; const reset = setCurrentInstance(instance); const setupResult = callWithErrorHandling( setup, instance, 0, [ reactivity.shallowReadonly(instance.props) , setupContext ] ); const isAsyncSetup = shared.isPromise(setupResult); reactivity.resetTracking(); reset(); if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) { markAsyncBoundary(instance); } if (isAsyncSetup) { setupResult.then(unsetCurrentInstance, unsetCurrentInstance); if (isSSR) { return setupResult.then((resolvedResult) => { handleSetupResult(instance, resolvedResult, isSSR); }).catch((e) => { handleError(e, instance, 0); }); } else { instance.asyncDep = setupResult; if (!instance.suspense) { const name = (_a = Component.name) != null ? _a : "Anonymous"; warn$1( `Component <${name}>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. A component with async setup() must be nested in a <Suspense> in order to be rendered.` ); } } } else { handleSetupResult(instance, setupResult, isSSR); } } else { finishComponentSetup(instance, isSSR); } } function handleSetupResult(instance, setupResult, isSSR) { if (shared.isFunction(setupResult)) { if (instance.type.__ssrInlineRender) { instance.ssrRender = setupResult; } else { instance.render = setupResult; } } else if (shared.isObject(setupResult)) { if (isVNode(setupResult)) { warn$1( `setup() should not return VNodes directly - return a render function instead.` ); } { instance.devtoolsRawSetupState = setupResult; } instance.setupState = reactivity.proxyRefs(setupResult); { exposeSetupStateOnRenderContext(instance); } } else if (setupResult !== void 0) { warn$1( `setup() should return an object. Received: ${setupResult === null ? "null" : typeof setupResult}` ); } finishComponentSetup(instance, isSSR); } let compile; let installWithProxy; function registerRuntimeCompiler(_compile) { compile = _compile; installWithProxy = (i) => { if (i.render._rc) { i.withProxy = new Proxy(i.ctx, RuntimeCompiledPublicInstanceProxyHandlers); } }; } const isRuntimeOnly = () => !compile; function finishComponentSetup(instance, isSSR, skipOptions) { const Component = instance.type; if (!instance.render) { if (!isSSR && compile && !Component.render) { const template = Component.template || resolveMergedOptions(instance).template; if (template) { { startMeasure(instance, `compile`); } const { isCustomElement, compilerOptions } = instance.appContext.config; const { delimiters, compilerOptions: componentCompilerOptions } = Component; const finalCompilerOptions = shared.extend( shared.extend( { isCustomElement, delimiters }, compilerOptions ), componentCompilerOptions ); Component.render = compile(template, finalCompilerOptions); { endMeasure(instance, `compile`); } } } instance.render = Component.render || shared.NOOP; if (installWithProxy) { installWithProxy(instance); } } { const reset = setCurrentInstance(instance); reactivity.pauseTracking(); try { applyOptions(instance); } finally { reactivity.resetTracking(); reset(); } } if (!Component.render && instance.render === shared.NOOP && !isSSR) { if (!compile && Component.template) { warn$1( `Component provided template option but runtime compilation is not supported in this build of Vue.` + (``) ); } else { warn$1(`Component is missing template or render function: `, Component); } } } const attrsProxyHandlers = { get(target, key) { markAttrsAccessed(); reactivity.track(target, "get", ""); return target[key]; }, set() { warn$1(`setupContext.attrs is readonly.`); return false; }, deleteProperty() { warn$1(`setupContext.attrs is readonly.`); return false; } } ; function getSlotsProxy(instance) { return new Proxy(instance.slots, { get(target, key) { reactivity.track(instance, "get", "$slots"); return target[key]; } }); } function createSetupContext(instance) { const expose = (exposed) => { { if (instance.exposed) { warn$1(`expose() should be called only once per setup().`); } if (exposed != null) { let exposedType = typeof exposed; if (exposedType === "object") { if (shared.isArray(exposed)) { exposedType = "array"; } else if (reactivity.isRef(exposed)) { exposedType = "ref"; } } if (exposedType !== "object") { warn$1( `expose() should be passed a plain object, received ${exposedType}.` ); } } } instance.exposed = exposed || {}; }; { let attrsProxy; let slotsProxy; return Object.freeze({ get attrs() { return attrsProxy || (attrsProxy = new Proxy(instance.attrs, attrsProxyHandlers)); }, get slots() { return slotsProxy || (slotsProxy = getSlotsProxy(instance)); }, get emit() { return (event, ...args) => instance.emit(event, ...args); }, expose }); } } function getComponentPublicInstance(instance) { if (instance.exposed) { return instance.exposeProxy || (instance.exposeProxy = new Proxy(reactivity.proxyRefs(reactivity.markRaw(instance.exposed)), { get(target, key) { if (key in target) { return target[key]; } else if (key in publicPropertiesMap) { return publicPropertiesMap[key](instance); } }, has(target, key) { return key in target || key in publicPropertiesMap; } })); } else { return instance.proxy; } } const classifyRE = /(?:^|[-_])(\w)/g; const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, ""); function getComponentName(Component, includeInferred = true) { return shared.isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name; } function formatComponentName(instance, Component, isRoot = false) { let name = getComponentName(Component); if (!name && Component.__file) { const match = Component.__file.match(/([^/\\]+)\.\w+$/); if (match) { name = match[1]; } } if (!name && instance && instance.parent) { const inferFromRegistry = (registry) => { for (const key in registry) { if (registry[key] === Component) { return key; } } }; name = inferFromRegistry( instance.components || instance.parent.type.components ) || inferFromRegistry(instance.appContext.components); } return name ? classify(name) : isRoot ? `App` : `Anonymous`; } function isClassComponent(value) { return shared.isFunction(value) && "__vccOpts" in value; } const computed = (getterOrOptions, debugOptions) => { const c = reactivity.computed(getterOrOptions, debugOptions, isInSSRComponentSetup); { const i = getCurrentInstance(); if (i && i.appContext.config.warnRecursiveComputed) { c._warnRecursive = true; } } return c; }; function h(type, propsOrChildren, children) { const l = arguments.length; if (l === 2) { if (shared.isObject(propsOrChildren) && !shared.isArray(propsOrChildren)) { if (isVNode(propsOrChildren)) { return createVNode(type, null, [propsOrChildren]); } return createVNode(type, propsOrChildren); } else { return createVNode(type, null, propsOrChildren); } } else { if (l > 3) { children = Array.prototype.slice.call(arguments, 2); } else if (l === 3 && isVNode(children)) { children = [children]; } return createVNode(type, propsOrChildren, children); } } function initCustomFormatter() { if (typeof window === "undefined") { return; } const vueStyle = { style: "color:#3ba776" }; const numberStyle = { style: "color:#1677ff" }; const stringStyle = { style: "color:#f5222d" }; const keywordStyle = { style: "color:#eb2f96" }; const formatter = { __vue_custom_formatter: true, header(obj) { if (!shared.isObject(obj)) { return null; } if (obj.__isVue) { return ["div", vueStyle, `VueInstance`]; } else if (reactivity.isRef(obj)) { return [ "div", {}, ["span", vueStyle, genRefFlag(obj)], "<", // avoid debugger accessing value affecting behavior formatValue("_value" in obj ? obj._value : obj), `>` ]; } else if (reactivity.isReactive(obj)) { return [ "div", {}, ["span", vueStyle, reactivity.isShallow(obj) ? "ShallowReactive" : "Reactive"], "<", formatValue(obj), `>${reactivity.isReadonly(obj) ? ` (readonly)` : ``}` ]; } else if (reactivity.isReadonly(obj)) { return [ "div", {}, ["span", vueStyle, reactivity.isShallow(obj) ? "ShallowReadonly" : "Readonly"], "<", formatValue(obj), ">" ]; } return null; }, hasBody(obj) { return obj && obj.__isVue; }, body(obj) { if (obj && obj.__isVue) { return [ "div", {}, ...formatInstance(obj.$) ]; } } }; function formatInstance(instance) { const blocks = []; if (instance.type.props && instance.props) { blocks.push(createInstanceBlock("props", reactivity.toRaw(instance.props))); } if (instance.setupState !== shared.EMPTY_OBJ) { blocks.push(createInstanceBlock("setup", instance.setupState)); } if (instance.data !== shared.EMPTY_OBJ) { blocks.push(createInstanceBlock("data", reactivity.toRaw(instance.data))); } const computed = extractKeys(instance, "computed"); if (computed) { blocks.push(createInstanceBlock("computed", computed)); } const injected = extractKeys(instance, "inject"); if (injected) { blocks.push(createInstanceBlock("injected", injected)); } blocks.push([ "div", {}, [ "span", { style: keywordStyle.style + ";opacity:0.66" }, "$ (internal): " ], ["object", { object: instance }] ]); return blocks; } function createInstanceBlock(type, target) { target = shared.extend({}, target); if (!Object.keys(target).length) { return ["span", {}]; } return [ "div", { style: "line-height:1.25em;margin-bottom:0.6em" }, [ "div", { style: "color:#476582" }, type ], [ "div", { style: "padding-left:1.25em" }, ...Object.keys(target).map((key) => { return [ "div", {}, ["span", keywordStyle, key + ": "], formatValue(target[key], false) ]; }) ] ]; } function formatValue(v, asRaw = true) { if (typeof v === "number") { return ["span", numberStyle, v]; } else if (typeof v === "string") { return ["span", stringStyle, JSON.stringify(v)]; } else if (typeof v === "boolean") { return ["span", keywordStyle, v]; } else if (shared.isObject(v)) { return ["object", { object: asRaw ? reactivity.toRaw(v) : v }]; } else { return ["span", stringStyle, String(v)]; } } function extractKeys(instance, type) { const Comp = instance.type; if (shared.isFunction(Comp)) { return; } const extracted = {}; for (const key in instance.ctx) { if (isKeyOfType(Comp, key, type)) { extracted[key] = instance.ctx[key]; } } return extracted; } function isKeyOfType(Comp, key, type) { const opts = Comp[type]; if (shared.isArray(opts) && opts.includes(key) || shared.isObject(opts) && key in opts) { return true; } if (Comp.extends && isKeyOfType(Comp.extends, key, type)) { return true; } if (Comp.mixins && Comp.mixins.some((m) => isKeyOfType(m, key, type))) { return true; } } function genRefFlag(v) { if (reactivity.isShallow(v)) { return `ShallowRef`; } if (v.effect) { return `ComputedRef`; } return `Ref`; } if (window.devtoolsFormatters) { window.devtoolsFormatters.push(formatter); } else { window.devtoolsFormatters = [formatter]; } } function withMemo(memo, render, cache, index) { const cached = cache[index]; if (cached && isMemoSame(cached, memo)) { return cached; } const ret = render(); ret.memo = memo.slice(); ret.cacheIndex = index; return cache[index] = ret; } function isMemoSame(cached, memo) { const prev = cached.memo; if (prev.length != memo.length) { return false; } for (let i = 0; i < prev.length; i++) { if (shared.hasChanged(prev[i], memo[i])) { return false; } } if (isBlockTreeEnabled > 0 && currentBlock) { currentBlock.push(cached); } return true; } const version = "3.5.13"; const warn = warn$1 ; const ErrorTypeStrings = ErrorTypeStrings$1 ; const devtools = devtools$1 ; const setDevtoolsHook = setDevtoolsHook$1 ; const _ssrUtils = { createComponentInstance, setupComponent, renderComponentRoot, setCurrentRenderingInstance, isVNode: isVNode, normalizeVNode, getComponentPublicInstance, ensureValidVNode, pushWarningContext, popWarningContext }; const ssrUtils = _ssrUtils ; const resolveFilter = null; const compatUtils = null; const DeprecationTypes = null; exports.EffectScope = reactivity.EffectScope; exports.ReactiveEffect = reactivity.ReactiveEffect; exports.TrackOpTypes = reactivity.TrackOpTypes; exports.TriggerOpTypes = reactivity.TriggerOpTypes; exports.customRef = reactivity.customRef; exports.effect = reactivity.effect; exports.effectScope = reactivity.effectScope; exports.getCurrentScope = reactivity.getCurrentScope; exports.getCurrentWatcher = reactivity.getCurrentWatcher; exports.isProxy = reactivity.isProxy; exports.isReactive = reactivity.isReactive; exports.isReadonly = reactivity.isReadonly; exports.isRef = reactivity.isRef; exports.isShallow = reactivity.isShallow; exports.markRaw = reactivity.markRaw; exports.onScopeDispose = reactivity.onScopeDispose; exports.onWatcherCleanup = reactivity.onWatcherCleanup; exports.proxyRefs = reactivity.proxyRefs; exports.reactive = reactivity.reactive; exports.readonly = reactivity.readonly; exports.ref = reactivity.ref; exports.shallowReactive = reactivity.shallowReactive; exports.shallowReadonly = reactivity.shallowReadonly; exports.shallowRef = reactivity.shallowRef; exports.stop = reactivity.stop; exports.toRaw = reactivity.toRaw; exports.toRef = reactivity.toRef; exports.toRefs = reactivity.toRefs; exports.toValue = reactivity.toValue; exports.triggerRef = reactivity.triggerRef; exports.unref = reactivity.unref; exports.camelize = shared.camelize; exports.capitalize = shared.capitalize; exports.normalizeClass = shared.normalizeClass; exports.normalizeProps = shared.normalizeProps; exports.normalizeStyle = shared.normalizeStyle; exports.toDisplayString = shared.toDisplayString; exports.toHandlerKey = shared.toHandlerKey; exports.BaseTransition = BaseTransition; exports.BaseTransitionPropsValidators = BaseTransitionPropsValidators; exports.Comment = Comment; exports.DeprecationTypes = DeprecationTypes; exports.ErrorCodes = ErrorCodes; exports.ErrorTypeStrings = ErrorTypeStrings; exports.Fragment = Fragment; exports.KeepAlive = KeepAlive; exports.Static = Static; exports.Suspense = Suspense; exports.Teleport = Teleport; exports.Text = Text; exports.assertNumber = assertNumber; exports.callWithAsyncErrorHandling = callWithAsyncErrorHandling; exports.callWithErrorHandling = callWithErrorHandling; exports.cloneVNode = cloneVNode; exports.compatUtils = compatUtils; exports.computed = computed; exports.createBlock = createBlock; exports.createCommentVNode = createCommentVNode; exports.createElementBlock = createElementBlock; exports.createElementVNode = createBaseVNode; exports.createHydrationRenderer = createHydrationRenderer; exports.createPropsRestProxy = createPropsRestProxy; exports.createRenderer = createRenderer; exports.createSlots = createSlots; exports.createStaticVNode = createStaticVNode; exports.createTextVNode = createTextVNode; exports.createVNode = createVNode; exports.defineAsyncComponent = defineAsyncComponent; exports.defineComponent = defineComponent; exports.defineEmits = defineEmits; exports.defineExpose = defineExpose; exports.defineModel = defineModel; exports.defineOptions = defineOptions; exports.defineProps = defineProps; exports.defineSlots = defineSlots; exports.devtools = devtools; exports.getCurrentInstance = getCurrentInstance; exports.getTransitionRawChildren = getTransitionRawChildren; exports.guardReactiveProps = guardReactiveProps; exports.h = h; exports.handleError = handleError; exports.hasInjectionContext = hasInjectionContext; exports.hydrateOnIdle = hydrateOnIdle; exports.hydrateOnInteraction = hydrateOnInteraction; exports.hydrateOnMediaQuery = hydrateOnMediaQuery; exports.hydrateOnVisible = hydrateOnVisible; exports.initCustomFormatter = initCustomFormatter; exports.inject = inject; exports.isMemoSame = isMemoSame; exports.isRuntimeOnly = isRuntimeOnly; exports.isVNode = isVNode; exports.mergeDefaults = mergeDefaults; exports.mergeModels = mergeModels; exports.mergeProps = mergeProps; exports.nextTick = nextTick; exports.onActivated = onActivated; exports.onBeforeMount = onBeforeMount; exports.onBeforeUnmount = onBeforeUnmount; exports.onBeforeUpdate = onBeforeUpdate; exports.onDeactivated = onDeactivated; exports.onErrorCaptured = onErrorCaptured; exports.onMounted = onMounted; exports.onRenderTracked = onRenderTracked; exports.onRenderTriggered = onRenderTriggered; exports.onServerPrefetch = onServerPrefetch; exports.onUnmounted = onUnmounted; exports.onUpdated = onUpdated; exports.openBlock = openBlock; exports.popScopeId = popScopeId; exports.provide = provide; exports.pushScopeId = pushScopeId; exports.queuePostFlushCb = queuePostFlushCb; exports.registerRuntimeCompiler = registerRuntimeCompiler; exports.renderList = renderList; exports.renderSlot = renderSlot; exports.resolveComponent = resolveComponent; exports.resolveDirective = resolveDirective; exports.resolveDynamicComponent = resolveDynamicComponent; exports.resolveFilter = resolveFilter; exports.resolveTransitionHooks = resolveTransitionHooks; exports.setBlockTracking = setBlockTracking; exports.setDevtoolsHook = setDevtoolsHook; exports.setTransitionHooks = setTransitionHooks; exports.ssrContextKey = ssrContextKey; exports.ssrUtils = ssrUtils; exports.toHandlers = toHandlers; exports.transformVNodeArgs = transformVNodeArgs; exports.useAttrs = useAttrs; exports.useId = useId; exports.useModel = useModel; exports.useSSRContext = useSSRContext; exports.useSlots = useSlots; exports.useTemplateRef = useTemplateRef; exports.useTransitionState = useTransitionState; exports.version = version; exports.warn = warn; exports.watch = watch; exports.watchEffect = watchEffect; exports.watchPostEffect = watchPostEffect; exports.watchSyncEffect = watchSyncEffect; exports.withAsyncContext = withAsyncContext; exports.withCtx = withCtx; exports.withDefaults = withDefaults; exports.withDirectives = withDirectives; exports.withMemo = withMemo; exports.withScopeId = withScopeId; /***/ }), /***/ "./node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.js": /*!***************************************************************!*\ !*** ./node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.js ***! \***************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * @vue/runtime-dom v3.5.13 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/ Object.defineProperty(exports, "__esModule", ({ value: true })); var runtimeCore = __webpack_require__(/*! @vue/runtime-core */ "./node_modules/@vue/runtime-core/dist/runtime-core.cjs.js"); var shared = __webpack_require__(/*! @vue/shared */ "./node_modules/@vue/shared/dist/shared.cjs.js"); let policy = void 0; const tt = typeof window !== "undefined" && window.trustedTypes; if (tt) { try { policy = /* @__PURE__ */ tt.createPolicy("vue", { createHTML: (val) => val }); } catch (e) { runtimeCore.warn(`Error creating trusted types policy: ${e}`); } } const unsafeToTrustedHTML = policy ? (val) => policy.createHTML(val) : (val) => val; const svgNS = "http://www.w3.org/2000/svg"; const mathmlNS = "http://www.w3.org/1998/Math/MathML"; const doc = typeof document !== "undefined" ? document : null; const templateContainer = doc && /* @__PURE__ */ doc.createElement("template"); const nodeOps = { insert: (child, parent, anchor) => { parent.insertBefore(child, anchor || null); }, remove: (child) => { const parent = child.parentNode; if (parent) { parent.removeChild(child); } }, createElement: (tag, namespace, is, props) => { const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : is ? doc.createElement(tag, { is }) : doc.createElement(tag); if (tag === "select" && props && props.multiple != null) { el.setAttribute("multiple", props.multiple); } return el; }, createText: (text) => doc.createTextNode(text), createComment: (text) => doc.createComment(text), setText: (node, text) => { node.nodeValue = text; }, setElementText: (el, text) => { el.textContent = text; }, parentNode: (node) => node.parentNode, nextSibling: (node) => node.nextSibling, querySelector: (selector) => doc.querySelector(selector), setScopeId(el, id) { el.setAttribute(id, ""); }, // __UNSAFE__ // Reason: innerHTML. // Static content here can only come from compiled templates. // As long as the user only uses trusted templates, this is safe. insertStaticContent(content, parent, anchor, namespace, start, end) { const before = anchor ? anchor.previousSibling : parent.lastChild; if (start && (start === end || start.nextSibling)) { while (true) { parent.insertBefore(start.cloneNode(true), anchor); if (start === end || !(start = start.nextSibling)) break; } } else { templateContainer.innerHTML = unsafeToTrustedHTML( namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content ); const template = templateContainer.content; if (namespace === "svg" || namespace === "mathml") { const wrapper = template.firstChild; while (wrapper.firstChild) { template.appendChild(wrapper.firstChild); } template.removeChild(wrapper); } parent.insertBefore(template, anchor); } return [ // first before ? before.nextSibling : parent.firstChild, // last anchor ? anchor.previousSibling : parent.lastChild ]; } }; const TRANSITION = "transition"; const ANIMATION = "animation"; const vtcKey = Symbol("_vtc"); const DOMTransitionPropsValidators = { name: String, type: String, css: { type: Boolean, default: true }, duration: [String, Number, Object], enterFromClass: String, enterActiveClass: String, enterToClass: String, appearFromClass: String, appearActiveClass: String, appearToClass: String, leaveFromClass: String, leaveActiveClass: String, leaveToClass: String }; const TransitionPropsValidators = /* @__PURE__ */ shared.extend( {}, runtimeCore.BaseTransitionPropsValidators, DOMTransitionPropsValidators ); const decorate$1 = (t) => { t.displayName = "Transition"; t.props = TransitionPropsValidators; return t; }; const Transition = /* @__PURE__ */ decorate$1( (props, { slots }) => runtimeCore.h(runtimeCore.BaseTransition, resolveTransitionProps(props), slots) ); const callHook = (hook, args = []) => { if (shared.isArray(hook)) { hook.forEach((h2) => h2(...args)); } else if (hook) { hook(...args); } }; const hasExplicitCallback = (hook) => { return hook ? shared.isArray(hook) ? hook.some((h2) => h2.length > 1) : hook.length > 1 : false; }; function resolveTransitionProps(rawProps) { const baseProps = {}; for (const key in rawProps) { if (!(key in DOMTransitionPropsValidators)) { baseProps[key] = rawProps[key]; } } if (rawProps.css === false) { return baseProps; } const { name = "v", type, duration, enterFromClass = `${name}-enter-from`, enterActiveClass = `${name}-enter-active`, enterToClass = `${name}-enter-to`, appearFromClass = enterFromClass, appearActiveClass = enterActiveClass, appearToClass = enterToClass, leaveFromClass = `${name}-leave-from`, leaveActiveClass = `${name}-leave-active`, leaveToClass = `${name}-leave-to` } = rawProps; const durations = normalizeDuration(duration); const enterDuration = durations && durations[0]; const leaveDuration = durations && durations[1]; const { onBeforeEnter, onEnter, onEnterCancelled, onLeave, onLeaveCancelled, onBeforeAppear = onBeforeEnter, onAppear = onEnter, onAppearCancelled = onEnterCancelled } = baseProps; const finishEnter = (el, isAppear, done, isCancelled) => { el._enterCancelled = isCancelled; removeTransitionClass(el, isAppear ? appearToClass : enterToClass); removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass); done && done(); }; const finishLeave = (el, done) => { el._isLeaving = false; removeTransitionClass(el, leaveFromClass); removeTransitionClass(el, leaveToClass); removeTransitionClass(el, leaveActiveClass); done && done(); }; const makeEnterHook = (isAppear) => { return (el, done) => { const hook = isAppear ? onAppear : onEnter; const resolve = () => finishEnter(el, isAppear, done); callHook(hook, [el, resolve]); nextFrame(() => { removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass); addTransitionClass(el, isAppear ? appearToClass : enterToClass); if (!hasExplicitCallback(hook)) { whenTransitionEnds(el, type, enterDuration, resolve); } }); }; }; return shared.extend(baseProps, { onBeforeEnter(el) { callHook(onBeforeEnter, [el]); addTransitionClass(el, enterFromClass); addTransitionClass(el, enterActiveClass); }, onBeforeAppear(el) { callHook(onBeforeAppear, [el]); addTransitionClass(el, appearFromClass); addTransitionClass(el, appearActiveClass); }, onEnter: makeEnterHook(false), onAppear: makeEnterHook(true), onLeave(el, done) { el._isLeaving = true; const resolve = () => finishLeave(el, done); addTransitionClass(el, leaveFromClass); if (!el._enterCancelled) { forceReflow(); addTransitionClass(el, leaveActiveClass); } else { addTransitionClass(el, leaveActiveClass); forceReflow(); } nextFrame(() => { if (!el._isLeaving) { return; } removeTransitionClass(el, leaveFromClass); addTransitionClass(el, leaveToClass); if (!hasExplicitCallback(onLeave)) { whenTransitionEnds(el, type, leaveDuration, resolve); } }); callHook(onLeave, [el, resolve]); }, onEnterCancelled(el) { finishEnter(el, false, void 0, true); callHook(onEnterCancelled, [el]); }, onAppearCancelled(el) { finishEnter(el, true, void 0, true); callHook(onAppearCancelled, [el]); }, onLeaveCancelled(el) { finishLeave(el); callHook(onLeaveCancelled, [el]); } }); } function normalizeDuration(duration) { if (duration == null) { return null; } else if (shared.isObject(duration)) { return [NumberOf(duration.enter), NumberOf(duration.leave)]; } else { const n = NumberOf(duration); return [n, n]; } } function NumberOf(val) { const res = shared.toNumber(val); { runtimeCore.assertNumber(res, "<transition> explicit duration"); } return res; } function addTransitionClass(el, cls) { cls.split(/\s+/).forEach((c) => c && el.classList.add(c)); (el[vtcKey] || (el[vtcKey] = /* @__PURE__ */ new Set())).add(cls); } function removeTransitionClass(el, cls) { cls.split(/\s+/).forEach((c) => c && el.classList.remove(c)); const _vtc = el[vtcKey]; if (_vtc) { _vtc.delete(cls); if (!_vtc.size) { el[vtcKey] = void 0; } } } function nextFrame(cb) { requestAnimationFrame(() => { requestAnimationFrame(cb); }); } let endId = 0; function whenTransitionEnds(el, expectedType, explicitTimeout, resolve) { const id = el._endId = ++endId; const resolveIfNotStale = () => { if (id === el._endId) { resolve(); } }; if (explicitTimeout != null) { return setTimeout(resolveIfNotStale, explicitTimeout); } const { type, timeout, propCount } = getTransitionInfo(el, expectedType); if (!type) { return resolve(); } const endEvent = type + "end"; let ended = 0; const end = () => { el.removeEventListener(endEvent, onEnd); resolveIfNotStale(); }; const onEnd = (e) => { if (e.target === el && ++ended >= propCount) { end(); } }; setTimeout(() => { if (ended < propCount) { end(); } }, timeout + 1); el.addEventListener(endEvent, onEnd); } function getTransitionInfo(el, expectedType) { const styles = window.getComputedStyle(el); const getStyleProperties = (key) => (styles[key] || "").split(", "); const transitionDelays = getStyleProperties(`${TRANSITION}Delay`); const transitionDurations = getStyleProperties(`${TRANSITION}Duration`); const transitionTimeout = getTimeout(transitionDelays, transitionDurations); const animationDelays = getStyleProperties(`${ANIMATION}Delay`); const animationDurations = getStyleProperties(`${ANIMATION}Duration`); const animationTimeout = getTimeout(animationDelays, animationDurations); let type = null; let timeout = 0; let propCount = 0; if (expectedType === TRANSITION) { if (transitionTimeout > 0) { type = TRANSITION; timeout = transitionTimeout; propCount = transitionDurations.length; } } else if (expectedType === ANIMATION) { if (animationTimeout > 0) { type = ANIMATION; timeout = animationTimeout; propCount = animationDurations.length; } } else { timeout = Math.max(transitionTimeout, animationTimeout); type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null; propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0; } const hasTransform = type === TRANSITION && /\b(transform|all)(,|$)/.test( getStyleProperties(`${TRANSITION}Property`).toString() ); return { type, timeout, propCount, hasTransform }; } function getTimeout(delays, durations) { while (delays.length < durations.length) { delays = delays.concat(delays); } return Math.max(...durations.map((d, i) => toMs(d) + toMs(delays[i]))); } function toMs(s) { if (s === "auto") return 0; return Number(s.slice(0, -1).replace(",", ".")) * 1e3; } function forceReflow() { return document.body.offsetHeight; } function patchClass(el, value, isSVG) { const transitionClasses = el[vtcKey]; if (transitionClasses) { value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" "); } if (value == null) { el.removeAttribute("class"); } else if (isSVG) { el.setAttribute("class", value); } else { el.className = value; } } const vShowOriginalDisplay = Symbol("_vod"); const vShowHidden = Symbol("_vsh"); const vShow = { beforeMount(el, { value }, { transition }) { el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display; if (transition && value) { transition.beforeEnter(el); } else { setDisplay(el, value); } }, mounted(el, { value }, { transition }) { if (transition && value) { transition.enter(el); } }, updated(el, { value, oldValue }, { transition }) { if (!value === !oldValue) return; if (transition) { if (value) { transition.beforeEnter(el); setDisplay(el, true); transition.enter(el); } else { transition.leave(el, () => { setDisplay(el, false); }); } } else { setDisplay(el, value); } }, beforeUnmount(el, { value }) { setDisplay(el, value); } }; { vShow.name = "show"; } function setDisplay(el, value) { el.style.display = value ? el[vShowOriginalDisplay] : "none"; el[vShowHidden] = !value; } function initVShowForSSR() { vShow.getSSRProps = ({ value }) => { if (!value) { return { style: { display: "none" } }; } }; } const CSS_VAR_TEXT = Symbol("CSS_VAR_TEXT" ); function useCssVars(getter) { return; } const displayRE = /(^|;)\s*display\s*:/; function patchStyle(el, prev, next) { const style = el.style; const isCssString = shared.isString(next); let hasControlledDisplay = false; if (next && !isCssString) { if (prev) { if (!shared.isString(prev)) { for (const key in prev) { if (next[key] == null) { setStyle(style, key, ""); } } } else { for (const prevStyle of prev.split(";")) { const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim(); if (next[key] == null) { setStyle(style, key, ""); } } } } for (const key in next) { if (key === "display") { hasControlledDisplay = true; } setStyle(style, key, next[key]); } } else { if (isCssString) { if (prev !== next) { const cssVarText = style[CSS_VAR_TEXT]; if (cssVarText) { next += ";" + cssVarText; } style.cssText = next; hasControlledDisplay = displayRE.test(next); } } else if (prev) { el.removeAttribute("style"); } } if (vShowOriginalDisplay in el) { el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : ""; if (el[vShowHidden]) { style.display = "none"; } } } const semicolonRE = /[^\\];\s*$/; const importantRE = /\s*!important$/; function setStyle(style, name, val) { if (shared.isArray(val)) { val.forEach((v) => setStyle(style, name, v)); } else { if (val == null) val = ""; { if (semicolonRE.test(val)) { runtimeCore.warn( `Unexpected semicolon at the end of '${name}' style value: '${val}'` ); } } if (name.startsWith("--")) { style.setProperty(name, val); } else { const prefixed = autoPrefix(style, name); if (importantRE.test(val)) { style.setProperty( shared.hyphenate(prefixed), val.replace(importantRE, ""), "important" ); } else { style[prefixed] = val; } } } } const prefixes = ["Webkit", "Moz", "ms"]; const prefixCache = {}; function autoPrefix(style, rawName) { const cached = prefixCache[rawName]; if (cached) { return cached; } let name = runtimeCore.camelize(rawName); if (name !== "filter" && name in style) { return prefixCache[rawName] = name; } name = shared.capitalize(name); for (let i = 0; i < prefixes.length; i++) { const prefixed = prefixes[i] + name; if (prefixed in style) { return prefixCache[rawName] = prefixed; } } return rawName; } const xlinkNS = "http://www.w3.org/1999/xlink"; function patchAttr(el, key, value, isSVG, instance, isBoolean = shared.isSpecialBooleanAttr(key)) { if (isSVG && key.startsWith("xlink:")) { if (value == null) { el.removeAttributeNS(xlinkNS, key.slice(6, key.length)); } else { el.setAttributeNS(xlinkNS, key, value); } } else { if (value == null || isBoolean && !shared.includeBooleanAttr(value)) { el.removeAttribute(key); } else { el.setAttribute( key, isBoolean ? "" : shared.isSymbol(value) ? String(value) : value ); } } } function patchDOMProp(el, key, value, parentComponent, attrName) { if (key === "innerHTML" || key === "textContent") { if (value != null) { el[key] = key === "innerHTML" ? unsafeToTrustedHTML(value) : value; } return; } const tag = el.tagName; if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally !tag.includes("-")) { const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value; const newValue = value == null ? ( // #11647: value should be set as empty string for null and undefined, // but <input type="checkbox"> should be set as 'on'. el.type === "checkbox" ? "on" : "" ) : String(value); if (oldValue !== newValue || !("_value" in el)) { el.value = newValue; } if (value == null) { el.removeAttribute(key); } el._value = value; return; } let needRemove = false; if (value === "" || value == null) { const type = typeof el[key]; if (type === "boolean") { value = shared.includeBooleanAttr(value); } else if (value == null && type === "string") { value = ""; needRemove = true; } else if (type === "number") { value = 0; needRemove = true; } } try { el[key] = value; } catch (e) { if (!needRemove) { runtimeCore.warn( `Failed setting prop "${key}" on <${tag.toLowerCase()}>: value ${value} is invalid.`, e ); } } needRemove && el.removeAttribute(attrName || key); } function addEventListener(el, event, handler, options) { el.addEventListener(event, handler, options); } function removeEventListener(el, event, handler, options) { el.removeEventListener(event, handler, options); } const veiKey = Symbol("_vei"); function patchEvent(el, rawName, prevValue, nextValue, instance = null) { const invokers = el[veiKey] || (el[veiKey] = {}); const existingInvoker = invokers[rawName]; if (nextValue && existingInvoker) { existingInvoker.value = sanitizeEventValue(nextValue, rawName) ; } else { const [name, options] = parseName(rawName); if (nextValue) { const invoker = invokers[rawName] = createInvoker( sanitizeEventValue(nextValue, rawName) , instance ); addEventListener(el, name, invoker, options); } else if (existingInvoker) { removeEventListener(el, name, existingInvoker, options); invokers[rawName] = void 0; } } } const optionsModifierRE = /(?:Once|Passive|Capture)$/; function parseName(name) { let options; if (optionsModifierRE.test(name)) { options = {}; let m; while (m = name.match(optionsModifierRE)) { name = name.slice(0, name.length - m[0].length); options[m[0].toLowerCase()] = true; } } const event = name[2] === ":" ? name.slice(3) : shared.hyphenate(name.slice(2)); return [event, options]; } let cachedNow = 0; const p = /* @__PURE__ */ Promise.resolve(); const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now()); function createInvoker(initialValue, instance) { const invoker = (e) => { if (!e._vts) { e._vts = Date.now(); } else if (e._vts <= invoker.attached) { return; } runtimeCore.callWithAsyncErrorHandling( patchStopImmediatePropagation(e, invoker.value), instance, 5, [e] ); }; invoker.value = initialValue; invoker.attached = getNow(); return invoker; } function sanitizeEventValue(value, propName) { if (shared.isFunction(value) || shared.isArray(value)) { return value; } runtimeCore.warn( `Wrong type passed as event handler to ${propName} - did you forget @ or : in front of your prop? Expected function or array of functions, received type ${typeof value}.` ); return shared.NOOP; } function patchStopImmediatePropagation(e, value) { if (shared.isArray(value)) { const originalStop = e.stopImmediatePropagation; e.stopImmediatePropagation = () => { originalStop.call(e); e._stopped = true; }; return value.map( (fn) => (e2) => !e2._stopped && fn && fn(e2) ); } else { return value; } } const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123; const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => { const isSVG = namespace === "svg"; if (key === "class") { patchClass(el, nextValue, isSVG); } else if (key === "style") { patchStyle(el, prevValue, nextValue); } else if (shared.isOn(key)) { if (!shared.isModelListener(key)) { patchEvent(el, key, prevValue, nextValue, parentComponent); } } else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) { patchDOMProp(el, key, nextValue); if (!el.tagName.includes("-") && (key === "value" || key === "checked" || key === "selected")) { patchAttr(el, key, nextValue, isSVG, parentComponent, key !== "value"); } } else if ( // #11081 force set props for possible async custom element el._isVueCE && (/[A-Z]/.test(key) || !shared.isString(nextValue)) ) { patchDOMProp(el, shared.camelize(key), nextValue, parentComponent, key); } else { if (key === "true-value") { el._trueValue = nextValue; } else if (key === "false-value") { el._falseValue = nextValue; } patchAttr(el, key, nextValue, isSVG); } }; function shouldSetAsProp(el, key, value, isSVG) { if (isSVG) { if (key === "innerHTML" || key === "textContent") { return true; } if (key in el && isNativeOn(key) && shared.isFunction(value)) { return true; } return false; } if (key === "spellcheck" || key === "draggable" || key === "translate") { return false; } if (key === "form") { return false; } if (key === "list" && el.tagName === "INPUT") { return false; } if (key === "type" && el.tagName === "TEXTAREA") { return false; } if (key === "width" || key === "height") { const tag = el.tagName; if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") { return false; } } if (isNativeOn(key) && shared.isString(value)) { return false; } return key in el; } const REMOVAL = {}; /*! #__NO_SIDE_EFFECTS__ */ // @__NO_SIDE_EFFECTS__ function defineCustomElement(options, extraOptions, _createApp) { const Comp = runtimeCore.defineComponent(options, extraOptions); if (shared.isPlainObject(Comp)) shared.extend(Comp, extraOptions); class VueCustomElement extends VueElement { constructor(initialProps) { super(Comp, initialProps, _createApp); } } VueCustomElement.def = Comp; return VueCustomElement; } /*! #__NO_SIDE_EFFECTS__ */ const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => { return /* @__PURE__ */ defineCustomElement(options, extraOptions, createSSRApp); }; const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class { }; class VueElement extends BaseClass { constructor(_def, _props = {}, _createApp = createApp) { super(); this._def = _def; this._props = _props; this._createApp = _createApp; this._isVueCE = true; /** * @internal */ this._instance = null; /** * @internal */ this._app = null; /** * @internal */ this._nonce = this._def.nonce; this._connected = false; this._resolved = false; this._numberProps = null; this._styleChildren = /* @__PURE__ */ new WeakSet(); this._ob = null; if (this.shadowRoot && _createApp !== createApp) { this._root = this.shadowRoot; } else { if (this.shadowRoot) { runtimeCore.warn( `Custom element has pre-rendered declarative shadow root but is not defined as hydratable. Use \`defineSSRCustomElement\`.` ); } if (_def.shadowRoot !== false) { this.attachShadow({ mode: "open" }); this._root = this.shadowRoot; } else { this._root = this; } } if (!this._def.__asyncLoader) { this._resolveProps(this._def); } } connectedCallback() { if (!this.isConnected) return; if (!this.shadowRoot) { this._parseSlots(); } this._connected = true; let parent = this; while (parent = parent && (parent.parentNode || parent.host)) { if (parent instanceof VueElement) { this._parent = parent; break; } } if (!this._instance) { if (this._resolved) { this._setParent(); this._update(); } else { if (parent && parent._pendingResolve) { this._pendingResolve = parent._pendingResolve.then(() => { this._pendingResolve = void 0; this._resolveDef(); }); } else { this._resolveDef(); } } } } _setParent(parent = this._parent) { if (parent) { this._instance.parent = parent._instance; this._instance.provides = parent._instance.provides; } } disconnectedCallback() { this._connected = false; runtimeCore.nextTick(() => { if (!this._connected) { if (this._ob) { this._ob.disconnect(); this._ob = null; } this._app && this._app.unmount(); if (this._instance) this._instance.ce = void 0; this._app = this._instance = null; } }); } /** * resolve inner component definition (handle possible async component) */ _resolveDef() { if (this._pendingResolve) { return; } for (let i = 0; i < this.attributes.length; i++) { this._setAttr(this.attributes[i].name); } this._ob = new MutationObserver((mutations) => { for (const m of mutations) { this._setAttr(m.attributeName); } }); this._ob.observe(this, { attributes: true }); const resolve = (def, isAsync = false) => { this._resolved = true; this._pendingResolve = void 0; const { props, styles } = def; let numberProps; if (props && !shared.isArray(props)) { for (const key in props) { const opt = props[key]; if (opt === Number || opt && opt.type === Number) { if (key in this._props) { this._props[key] = shared.toNumber(this._props[key]); } (numberProps || (numberProps = /* @__PURE__ */ Object.create(null)))[shared.camelize(key)] = true; } } } this._numberProps = numberProps; if (isAsync) { this._resolveProps(def); } if (this.shadowRoot) { this._applyStyles(styles); } else if (styles) { runtimeCore.warn( "Custom element style injection is not supported when using shadowRoot: false" ); } this._mount(def); }; const asyncDef = this._def.__asyncLoader; if (asyncDef) { this._pendingResolve = asyncDef().then( (def) => resolve(this._def = def, true) ); } else { resolve(this._def); } } _mount(def) { if (!def.name) { def.name = "VueElement"; } this._app = this._createApp(def); if (def.configureApp) { def.configureApp(this._app); } this._app._ceVNode = this._createVNode(); this._app.mount(this._root); const exposed = this._instance && this._instance.exposed; if (!exposed) return; for (const key in exposed) { if (!shared.hasOwn(this, key)) { Object.defineProperty(this, key, { // unwrap ref to be consistent with public instance behavior get: () => runtimeCore.unref(exposed[key]) }); } else { runtimeCore.warn(`Exposed property "${key}" already exists on custom element.`); } } } _resolveProps(def) { const { props } = def; const declaredPropKeys = shared.isArray(props) ? props : Object.keys(props || {}); for (const key of Object.keys(this)) { if (key[0] !== "_" && declaredPropKeys.includes(key)) { this._setProp(key, this[key]); } } for (const key of declaredPropKeys.map(shared.camelize)) { Object.defineProperty(this, key, { get() { return this._getProp(key); }, set(val) { this._setProp(key, val, true, true); } }); } } _setAttr(key) { if (key.startsWith("data-v-")) return; const has = this.hasAttribute(key); let value = has ? this.getAttribute(key) : REMOVAL; const camelKey = shared.camelize(key); if (has && this._numberProps && this._numberProps[camelKey]) { value = shared.toNumber(value); } this._setProp(camelKey, value, false, true); } /** * @internal */ _getProp(key) { return this._props[key]; } /** * @internal */ _setProp(key, val, shouldReflect = true, shouldUpdate = false) { if (val !== this._props[key]) { if (val === REMOVAL) { delete this._props[key]; } else { this._props[key] = val; if (key === "key" && this._app) { this._app._ceVNode.key = val; } } if (shouldUpdate && this._instance) { this._update(); } if (shouldReflect) { const ob = this._ob; ob && ob.disconnect(); if (val === true) { this.setAttribute(shared.hyphenate(key), ""); } else if (typeof val === "string" || typeof val === "number") { this.setAttribute(shared.hyphenate(key), val + ""); } else if (!val) { this.removeAttribute(shared.hyphenate(key)); } ob && ob.observe(this, { attributes: true }); } } } _update() { render(this._createVNode(), this._root); } _createVNode() { const baseProps = {}; if (!this.shadowRoot) { baseProps.onVnodeMounted = baseProps.onVnodeUpdated = this._renderSlots.bind(this); } const vnode = runtimeCore.createVNode(this._def, shared.extend(baseProps, this._props)); if (!this._instance) { vnode.ce = (instance) => { this._instance = instance; instance.ce = this; instance.isCE = true; { instance.ceReload = (newStyles) => { if (this._styles) { this._styles.forEach((s) => this._root.removeChild(s)); this._styles.length = 0; } this._applyStyles(newStyles); this._instance = null; this._update(); }; } const dispatch = (event, args) => { this.dispatchEvent( new CustomEvent( event, shared.isPlainObject(args[0]) ? shared.extend({ detail: args }, args[0]) : { detail: args } ) ); }; instance.emit = (event, ...args) => { dispatch(event, args); if (shared.hyphenate(event) !== event) { dispatch(shared.hyphenate(event), args); } }; this._setParent(); }; } return vnode; } _applyStyles(styles, owner) { if (!styles) return; if (owner) { if (owner === this._def || this._styleChildren.has(owner)) { return; } this._styleChildren.add(owner); } const nonce = this._nonce; for (let i = styles.length - 1; i >= 0; i--) { const s = document.createElement("style"); if (nonce) s.setAttribute("nonce", nonce); s.textContent = styles[i]; this.shadowRoot.prepend(s); { if (owner) { if (owner.__hmrId) { if (!this._childStyles) this._childStyles = /* @__PURE__ */ new Map(); let entry = this._childStyles.get(owner.__hmrId); if (!entry) { this._childStyles.set(owner.__hmrId, entry = []); } entry.push(s); } } else { (this._styles || (this._styles = [])).push(s); } } } } /** * Only called when shadowRoot is false */ _parseSlots() { const slots = this._slots = {}; let n; while (n = this.firstChild) { const slotName = n.nodeType === 1 && n.getAttribute("slot") || "default"; (slots[slotName] || (slots[slotName] = [])).push(n); this.removeChild(n); } } /** * Only called when shadowRoot is false */ _renderSlots() { const outlets = (this._teleportTarget || this).querySelectorAll("slot"); const scopeId = this._instance.type.__scopeId; for (let i = 0; i < outlets.length; i++) { const o = outlets[i]; const slotName = o.getAttribute("name") || "default"; const content = this._slots[slotName]; const parent = o.parentNode; if (content) { for (const n of content) { if (scopeId && n.nodeType === 1) { const id = scopeId + "-s"; const walker = document.createTreeWalker(n, 1); n.setAttribute(id, ""); let child; while (child = walker.nextNode()) { child.setAttribute(id, ""); } } parent.insertBefore(n, o); } } else { while (o.firstChild) parent.insertBefore(o.firstChild, o); } parent.removeChild(o); } } /** * @internal */ _injectChildStyle(comp) { this._applyStyles(comp.styles, comp); } /** * @internal */ _removeChildStyle(comp) { { this._styleChildren.delete(comp); if (this._childStyles && comp.__hmrId) { const oldStyles = this._childStyles.get(comp.__hmrId); if (oldStyles) { oldStyles.forEach((s) => this._root.removeChild(s)); oldStyles.length = 0; } } } } } function useHost(caller) { const instance = runtimeCore.getCurrentInstance(); const el = instance && instance.ce; if (el) { return el; } else { if (!instance) { runtimeCore.warn( `${caller || "useHost"} called without an active component instance.` ); } else { runtimeCore.warn( `${caller || "useHost"} can only be used in components defined via defineCustomElement.` ); } } return null; } function useShadowRoot() { const el = useHost("useShadowRoot") ; return el && el.shadowRoot; } function useCssModule(name = "$style") { { const instance = runtimeCore.getCurrentInstance(); if (!instance) { runtimeCore.warn(`useCssModule must be called inside setup()`); return shared.EMPTY_OBJ; } const modules = instance.type.__cssModules; if (!modules) { runtimeCore.warn(`Current instance does not have CSS modules injected.`); return shared.EMPTY_OBJ; } const mod = modules[name]; if (!mod) { runtimeCore.warn(`Current instance does not have CSS module named "${name}".`); return shared.EMPTY_OBJ; } return mod; } } const positionMap = /* @__PURE__ */ new WeakMap(); const newPositionMap = /* @__PURE__ */ new WeakMap(); const moveCbKey = Symbol("_moveCb"); const enterCbKey = Symbol("_enterCb"); const decorate = (t) => { delete t.props.mode; return t; }; const TransitionGroupImpl = /* @__PURE__ */ decorate({ name: "TransitionGroup", props: /* @__PURE__ */ shared.extend({}, TransitionPropsValidators, { tag: String, moveClass: String }), setup(props, { slots }) { const instance = runtimeCore.getCurrentInstance(); const state = runtimeCore.useTransitionState(); let prevChildren; let children; runtimeCore.onUpdated(() => { if (!prevChildren.length) { return; } const moveClass = props.moveClass || `${props.name || "v"}-move`; if (!hasCSSTransform( prevChildren[0].el, instance.vnode.el, moveClass )) { return; } prevChildren.forEach(callPendingCbs); prevChildren.forEach(recordPosition); const movedChildren = prevChildren.filter(applyTranslation); forceReflow(); movedChildren.forEach((c) => { const el = c.el; const style = el.style; addTransitionClass(el, moveClass); style.transform = style.webkitTransform = style.transitionDuration = ""; const cb = el[moveCbKey] = (e) => { if (e && e.target !== el) { return; } if (!e || /transform$/.test(e.propertyName)) { el.removeEventListener("transitionend", cb); el[moveCbKey] = null; removeTransitionClass(el, moveClass); } }; el.addEventListener("transitionend", cb); }); }); return () => { const rawProps = runtimeCore.toRaw(props); const cssTransitionProps = resolveTransitionProps(rawProps); let tag = rawProps.tag || runtimeCore.Fragment; prevChildren = []; if (children) { for (let i = 0; i < children.length; i++) { const child = children[i]; if (child.el && child.el instanceof Element) { prevChildren.push(child); runtimeCore.setTransitionHooks( child, runtimeCore.resolveTransitionHooks( child, cssTransitionProps, state, instance ) ); positionMap.set( child, child.el.getBoundingClientRect() ); } } } children = slots.default ? runtimeCore.getTransitionRawChildren(slots.default()) : []; for (let i = 0; i < children.length; i++) { const child = children[i]; if (child.key != null) { runtimeCore.setTransitionHooks( child, runtimeCore.resolveTransitionHooks(child, cssTransitionProps, state, instance) ); } else if (child.type !== runtimeCore.Text) { runtimeCore.warn(`<TransitionGroup> children must be keyed.`); } } return runtimeCore.createVNode(tag, null, children); }; } }); const TransitionGroup = TransitionGroupImpl; function callPendingCbs(c) { const el = c.el; if (el[moveCbKey]) { el[moveCbKey](); } if (el[enterCbKey]) { el[enterCbKey](); } } function recordPosition(c) { newPositionMap.set(c, c.el.getBoundingClientRect()); } function applyTranslation(c) { const oldPos = positionMap.get(c); const newPos = newPositionMap.get(c); const dx = oldPos.left - newPos.left; const dy = oldPos.top - newPos.top; if (dx || dy) { const s = c.el.style; s.transform = s.webkitTransform = `translate(${dx}px,${dy}px)`; s.transitionDuration = "0s"; return c; } } function hasCSSTransform(el, root, moveClass) { const clone = el.cloneNode(); const _vtc = el[vtcKey]; if (_vtc) { _vtc.forEach((cls) => { cls.split(/\s+/).forEach((c) => c && clone.classList.remove(c)); }); } moveClass.split(/\s+/).forEach((c) => c && clone.classList.add(c)); clone.style.display = "none"; const container = root.nodeType === 1 ? root : root.parentNode; container.appendChild(clone); const { hasTransform } = getTransitionInfo(clone); container.removeChild(clone); return hasTransform; } const getModelAssigner = (vnode) => { const fn = vnode.props["onUpdate:modelValue"] || false; return shared.isArray(fn) ? (value) => shared.invokeArrayFns(fn, value) : fn; }; function onCompositionStart(e) { e.target.composing = true; } function onCompositionEnd(e) { const target = e.target; if (target.composing) { target.composing = false; target.dispatchEvent(new Event("input")); } } const assignKey = Symbol("_assign"); const vModelText = { created(el, { modifiers: { lazy, trim, number } }, vnode) { el[assignKey] = getModelAssigner(vnode); const castToNumber = number || vnode.props && vnode.props.type === "number"; addEventListener(el, lazy ? "change" : "input", (e) => { if (e.target.composing) return; let domValue = el.value; if (trim) { domValue = domValue.trim(); } if (castToNumber) { domValue = shared.looseToNumber(domValue); } el[assignKey](domValue); }); if (trim) { addEventListener(el, "change", () => { el.value = el.value.trim(); }); } if (!lazy) { addEventListener(el, "compositionstart", onCompositionStart); addEventListener(el, "compositionend", onCompositionEnd); addEventListener(el, "change", onCompositionEnd); } }, // set value on mounted so it's after min/max for type="range" mounted(el, { value }) { el.value = value == null ? "" : value; }, beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) { el[assignKey] = getModelAssigner(vnode); if (el.composing) return; const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? shared.looseToNumber(el.value) : el.value; const newValue = value == null ? "" : value; if (elValue === newValue) { return; } if (document.activeElement === el && el.type !== "range") { if (lazy && value === oldValue) { return; } if (trim && el.value.trim() === newValue) { return; } } el.value = newValue; } }; const vModelCheckbox = { // #4096 array checkboxes need to be deep traversed deep: true, created(el, _, vnode) { el[assignKey] = getModelAssigner(vnode); addEventListener(el, "change", () => { const modelValue = el._modelValue; const elementValue = getValue(el); const checked = el.checked; const assign = el[assignKey]; if (shared.isArray(modelValue)) { const index = shared.looseIndexOf(modelValue, elementValue); const found = index !== -1; if (checked && !found) { assign(modelValue.concat(elementValue)); } else if (!checked && found) { const filtered = [...modelValue]; filtered.splice(index, 1); assign(filtered); } } else if (shared.isSet(modelValue)) { const cloned = new Set(modelValue); if (checked) { cloned.add(elementValue); } else { cloned.delete(elementValue); } assign(cloned); } else { assign(getCheckboxValue(el, checked)); } }); }, // set initial checked on mount to wait for true-value/false-value mounted: setChecked, beforeUpdate(el, binding, vnode) { el[assignKey] = getModelAssigner(vnode); setChecked(el, binding, vnode); } }; function setChecked(el, { value, oldValue }, vnode) { el._modelValue = value; let checked; if (shared.isArray(value)) { checked = shared.looseIndexOf(value, vnode.props.value) > -1; } else if (shared.isSet(value)) { checked = value.has(vnode.props.value); } else { if (value === oldValue) return; checked = shared.looseEqual(value, getCheckboxValue(el, true)); } if (el.checked !== checked) { el.checked = checked; } } const vModelRadio = { created(el, { value }, vnode) { el.checked = shared.looseEqual(value, vnode.props.value); el[assignKey] = getModelAssigner(vnode); addEventListener(el, "change", () => { el[assignKey](getValue(el)); }); }, beforeUpdate(el, { value, oldValue }, vnode) { el[assignKey] = getModelAssigner(vnode); if (value !== oldValue) { el.checked = shared.looseEqual(value, vnode.props.value); } } }; const vModelSelect = { // <select multiple> value need to be deep traversed deep: true, created(el, { value, modifiers: { number } }, vnode) { const isSetModel = shared.isSet(value); addEventListener(el, "change", () => { const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map( (o) => number ? shared.looseToNumber(getValue(o)) : getValue(o) ); el[assignKey]( el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0] ); el._assigning = true; runtimeCore.nextTick(() => { el._assigning = false; }); }); el[assignKey] = getModelAssigner(vnode); }, // set value in mounted & updated because <select> relies on its children // <option>s. mounted(el, { value }) { setSelected(el, value); }, beforeUpdate(el, _binding, vnode) { el[assignKey] = getModelAssigner(vnode); }, updated(el, { value }) { if (!el._assigning) { setSelected(el, value); } } }; function setSelected(el, value) { const isMultiple = el.multiple; const isArrayValue = shared.isArray(value); if (isMultiple && !isArrayValue && !shared.isSet(value)) { runtimeCore.warn( `<select multiple v-model> expects an Array or Set value for its binding, but got ${Object.prototype.toString.call(value).slice(8, -1)}.` ); return; } for (let i = 0, l = el.options.length; i < l; i++) { const option = el.options[i]; const optionValue = getValue(option); if (isMultiple) { if (isArrayValue) { const optionType = typeof optionValue; if (optionType === "string" || optionType === "number") { option.selected = value.some((v) => String(v) === String(optionValue)); } else { option.selected = shared.looseIndexOf(value, optionValue) > -1; } } else { option.selected = value.has(optionValue); } } else if (shared.looseEqual(getValue(option), value)) { if (el.selectedIndex !== i) el.selectedIndex = i; return; } } if (!isMultiple && el.selectedIndex !== -1) { el.selectedIndex = -1; } } function getValue(el) { return "_value" in el ? el._value : el.value; } function getCheckboxValue(el, checked) { const key = checked ? "_trueValue" : "_falseValue"; return key in el ? el[key] : checked; } const vModelDynamic = { created(el, binding, vnode) { callModelHook(el, binding, vnode, null, "created"); }, mounted(el, binding, vnode) { callModelHook(el, binding, vnode, null, "mounted"); }, beforeUpdate(el, binding, vnode, prevVNode) { callModelHook(el, binding, vnode, prevVNode, "beforeUpdate"); }, updated(el, binding, vnode, prevVNode) { callModelHook(el, binding, vnode, prevVNode, "updated"); } }; function resolveDynamicModel(tagName, type) { switch (tagName) { case "SELECT": return vModelSelect; case "TEXTAREA": return vModelText; default: switch (type) { case "checkbox": return vModelCheckbox; case "radio": return vModelRadio; default: return vModelText; } } } function callModelHook(el, binding, vnode, prevVNode, hook) { const modelToUse = resolveDynamicModel( el.tagName, vnode.props && vnode.props.type ); const fn = modelToUse[hook]; fn && fn(el, binding, vnode, prevVNode); } function initVModelForSSR() { vModelText.getSSRProps = ({ value }) => ({ value }); vModelRadio.getSSRProps = ({ value }, vnode) => { if (vnode.props && shared.looseEqual(vnode.props.value, value)) { return { checked: true }; } }; vModelCheckbox.getSSRProps = ({ value }, vnode) => { if (shared.isArray(value)) { if (vnode.props && shared.looseIndexOf(value, vnode.props.value) > -1) { return { checked: true }; } } else if (shared.isSet(value)) { if (vnode.props && value.has(vnode.props.value)) { return { checked: true }; } } else if (value) { return { checked: true }; } }; vModelDynamic.getSSRProps = (binding, vnode) => { if (typeof vnode.type !== "string") { return; } const modelToUse = resolveDynamicModel( // resolveDynamicModel expects an uppercase tag name, but vnode.type is lowercase vnode.type.toUpperCase(), vnode.props && vnode.props.type ); if (modelToUse.getSSRProps) { return modelToUse.getSSRProps(binding, vnode); } }; } const systemModifiers = ["ctrl", "shift", "alt", "meta"]; const modifierGuards = { stop: (e) => e.stopPropagation(), prevent: (e) => e.preventDefault(), self: (e) => e.target !== e.currentTarget, ctrl: (e) => !e.ctrlKey, shift: (e) => !e.shiftKey, alt: (e) => !e.altKey, meta: (e) => !e.metaKey, left: (e) => "button" in e && e.button !== 0, middle: (e) => "button" in e && e.button !== 1, right: (e) => "button" in e && e.button !== 2, exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m)) }; const withModifiers = (fn, modifiers) => { const cache = fn._withMods || (fn._withMods = {}); const cacheKey = modifiers.join("."); return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => { for (let i = 0; i < modifiers.length; i++) { const guard = modifierGuards[modifiers[i]]; if (guard && guard(event, modifiers)) return; } return fn(event, ...args); }); }; const keyNames = { esc: "escape", space: " ", up: "arrow-up", left: "arrow-left", right: "arrow-right", down: "arrow-down", delete: "backspace" }; const withKeys = (fn, modifiers) => { const cache = fn._withKeys || (fn._withKeys = {}); const cacheKey = modifiers.join("."); return cache[cacheKey] || (cache[cacheKey] = (event) => { if (!("key" in event)) { return; } const eventKey = shared.hyphenate(event.key); if (modifiers.some( (k) => k === eventKey || keyNames[k] === eventKey )) { return fn(event); } }); }; const rendererOptions = /* @__PURE__ */ shared.extend({ patchProp }, nodeOps); let renderer; let enabledHydration = false; function ensureRenderer() { return renderer || (renderer = runtimeCore.createRenderer(rendererOptions)); } function ensureHydrationRenderer() { renderer = enabledHydration ? renderer : runtimeCore.createHydrationRenderer(rendererOptions); enabledHydration = true; return renderer; } const render = (...args) => { ensureRenderer().render(...args); }; const hydrate = (...args) => { ensureHydrationRenderer().hydrate(...args); }; const createApp = (...args) => { const app = ensureRenderer().createApp(...args); { injectNativeTagCheck(app); injectCompilerOptionsCheck(app); } const { mount } = app; app.mount = (containerOrSelector) => { const container = normalizeContainer(containerOrSelector); if (!container) return; const component = app._component; if (!shared.isFunction(component) && !component.render && !component.template) { component.template = container.innerHTML; } if (container.nodeType === 1) { container.textContent = ""; } const proxy = mount(container, false, resolveRootNamespace(container)); if (container instanceof Element) { container.removeAttribute("v-cloak"); container.setAttribute("data-v-app", ""); } return proxy; }; return app; }; const createSSRApp = (...args) => { const app = ensureHydrationRenderer().createApp(...args); { injectNativeTagCheck(app); injectCompilerOptionsCheck(app); } const { mount } = app; app.mount = (containerOrSelector) => { const container = normalizeContainer(containerOrSelector); if (container) { return mount(container, true, resolveRootNamespace(container)); } }; return app; }; function resolveRootNamespace(container) { if (container instanceof SVGElement) { return "svg"; } if (typeof MathMLElement === "function" && container instanceof MathMLElement) { return "mathml"; } } function injectNativeTagCheck(app) { Object.defineProperty(app.config, "isNativeTag", { value: (tag) => shared.isHTMLTag(tag) || shared.isSVGTag(tag) || shared.isMathMLTag(tag), writable: false }); } function injectCompilerOptionsCheck(app) { if (runtimeCore.isRuntimeOnly()) { const isCustomElement = app.config.isCustomElement; Object.defineProperty(app.config, "isCustomElement", { get() { return isCustomElement; }, set() { runtimeCore.warn( `The \`isCustomElement\` config option is deprecated. Use \`compilerOptions.isCustomElement\` instead.` ); } }); const compilerOptions = app.config.compilerOptions; const msg = `The \`compilerOptions\` config option is only respected when using a build of Vue.js that includes the runtime compiler (aka "full build"). Since you are using the runtime-only build, \`compilerOptions\` must be passed to \`@vue/compiler-dom\` in the build setup instead. - For vue-loader: pass it via vue-loader's \`compilerOptions\` loader option. - For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader - For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-sfc`; Object.defineProperty(app.config, "compilerOptions", { get() { runtimeCore.warn(msg); return compilerOptions; }, set() { runtimeCore.warn(msg); } }); } } function normalizeContainer(container) { if (shared.isString(container)) { const res = document.querySelector(container); if (!res) { runtimeCore.warn( `Failed to mount app: mount target selector "${container}" returned null.` ); } return res; } if (window.ShadowRoot && container instanceof window.ShadowRoot && container.mode === "closed") { runtimeCore.warn( `mounting on a ShadowRoot with \`{mode: "closed"}\` may lead to unpredictable bugs` ); } return container; } let ssrDirectiveInitialized = false; const initDirectivesForSSR = () => { if (!ssrDirectiveInitialized) { ssrDirectiveInitialized = true; initVModelForSSR(); initVShowForSSR(); } } ; exports.Transition = Transition; exports.TransitionGroup = TransitionGroup; exports.VueElement = VueElement; exports.createApp = createApp; exports.createSSRApp = createSSRApp; exports.defineCustomElement = defineCustomElement; exports.defineSSRCustomElement = defineSSRCustomElement; exports.hydrate = hydrate; exports.initDirectivesForSSR = initDirectivesForSSR; exports.render = render; exports.useCssModule = useCssModule; exports.useCssVars = useCssVars; exports.useHost = useHost; exports.useShadowRoot = useShadowRoot; exports.vModelCheckbox = vModelCheckbox; exports.vModelDynamic = vModelDynamic; exports.vModelRadio = vModelRadio; exports.vModelSelect = vModelSelect; exports.vModelText = vModelText; exports.vShow = vShow; exports.withKeys = withKeys; exports.withModifiers = withModifiers; Object.keys(runtimeCore).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = runtimeCore[k]; }); /***/ }), /***/ "./node_modules/@vue/shared/dist/shared.cjs.js": /*!*****************************************************!*\ !*** ./node_modules/@vue/shared/dist/shared.cjs.js ***! \*****************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * @vue/shared v3.5.13 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/ Object.defineProperty(exports, "__esModule", ({ value: true })); /*! #__NO_SIDE_EFFECTS__ */ // @__NO_SIDE_EFFECTS__ function makeMap(str) { const map = /* @__PURE__ */ Object.create(null); for (const key of str.split(",")) map[key] = 1; return (val) => val in map; } const EMPTY_OBJ = Object.freeze({}) ; const EMPTY_ARR = Object.freeze([]) ; const NOOP = () => { }; const NO = () => false; const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter (key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97); const isModelListener = (key) => key.startsWith("onUpdate:"); const extend = Object.assign; const remove = (arr, el) => { const i = arr.indexOf(el); if (i > -1) { arr.splice(i, 1); } }; const hasOwnProperty = Object.prototype.hasOwnProperty; const hasOwn = (val, key) => hasOwnProperty.call(val, key); const isArray = Array.isArray; const isMap = (val) => toTypeString(val) === "[object Map]"; const isSet = (val) => toTypeString(val) === "[object Set]"; const isDate = (val) => toTypeString(val) === "[object Date]"; const isRegExp = (val) => toTypeString(val) === "[object RegExp]"; const isFunction = (val) => typeof val === "function"; const isString = (val) => typeof val === "string"; const isSymbol = (val) => typeof val === "symbol"; const isObject = (val) => val !== null && typeof val === "object"; const isPromise = (val) => { return (isObject(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch); }; const objectToString = Object.prototype.toString; const toTypeString = (value) => objectToString.call(value); const toRawType = (value) => { return toTypeString(value).slice(8, -1); }; const isPlainObject = (val) => toTypeString(val) === "[object Object]"; const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key; const isReservedProp = /* @__PURE__ */ makeMap( // the leading comma is intentional so empty string "" is also included ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted" ); const isBuiltInDirective = /* @__PURE__ */ makeMap( "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo" ); const cacheStringFunction = (fn) => { const cache = /* @__PURE__ */ Object.create(null); return (str) => { const hit = cache[str]; return hit || (cache[str] = fn(str)); }; }; const camelizeRE = /-(\w)/g; const camelize = cacheStringFunction( (str) => { return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : ""); } ); const hyphenateRE = /\B([A-Z])/g; const hyphenate = cacheStringFunction( (str) => str.replace(hyphenateRE, "-$1").toLowerCase() ); const capitalize = cacheStringFunction((str) => { return str.charAt(0).toUpperCase() + str.slice(1); }); const toHandlerKey = cacheStringFunction( (str) => { const s = str ? `on${capitalize(str)}` : ``; return s; } ); const hasChanged = (value, oldValue) => !Object.is(value, oldValue); const invokeArrayFns = (fns, ...arg) => { for (let i = 0; i < fns.length; i++) { fns[i](...arg); } }; const def = (obj, key, value, writable = false) => { Object.defineProperty(obj, key, { configurable: true, enumerable: false, writable, value }); }; const looseToNumber = (val) => { const n = parseFloat(val); return isNaN(n) ? val : n; }; const toNumber = (val) => { const n = isString(val) ? Number(val) : NaN; return isNaN(n) ? val : n; }; let _globalThis; const getGlobalThis = () => { return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {}); }; const identRE = /^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/; function genPropsAccessExp(name) { return identRE.test(name) ? `__props.${name}` : `__props[${JSON.stringify(name)}]`; } function genCacheKey(source, options) { return source + JSON.stringify( options, (_, val) => typeof val === "function" ? val.toString() : val ); } const PatchFlags = { "TEXT": 1, "1": "TEXT", "CLASS": 2, "2": "CLASS", "STYLE": 4, "4": "STYLE", "PROPS": 8, "8": "PROPS", "FULL_PROPS": 16, "16": "FULL_PROPS", "NEED_HYDRATION": 32, "32": "NEED_HYDRATION", "STABLE_FRAGMENT": 64, "64": "STABLE_FRAGMENT", "KEYED_FRAGMENT": 128, "128": "KEYED_FRAGMENT", "UNKEYED_FRAGMENT": 256, "256": "UNKEYED_FRAGMENT", "NEED_PATCH": 512, "512": "NEED_PATCH", "DYNAMIC_SLOTS": 1024, "1024": "DYNAMIC_SLOTS", "DEV_ROOT_FRAGMENT": 2048, "2048": "DEV_ROOT_FRAGMENT", "CACHED": -1, "-1": "CACHED", "BAIL": -2, "-2": "BAIL" }; const PatchFlagNames = { [1]: `TEXT`, [2]: `CLASS`, [4]: `STYLE`, [8]: `PROPS`, [16]: `FULL_PROPS`, [32]: `NEED_HYDRATION`, [64]: `STABLE_FRAGMENT`, [128]: `KEYED_FRAGMENT`, [256]: `UNKEYED_FRAGMENT`, [512]: `NEED_PATCH`, [1024]: `DYNAMIC_SLOTS`, [2048]: `DEV_ROOT_FRAGMENT`, [-1]: `HOISTED`, [-2]: `BAIL` }; const ShapeFlags = { "ELEMENT": 1, "1": "ELEMENT", "FUNCTIONAL_COMPONENT": 2, "2": "FUNCTIONAL_COMPONENT", "STATEFUL_COMPONENT": 4, "4": "STATEFUL_COMPONENT", "TEXT_CHILDREN": 8, "8": "TEXT_CHILDREN", "ARRAY_CHILDREN": 16, "16": "ARRAY_CHILDREN", "SLOTS_CHILDREN": 32, "32": "SLOTS_CHILDREN", "TELEPORT": 64, "64": "TELEPORT", "SUSPENSE": 128, "128": "SUSPENSE", "COMPONENT_SHOULD_KEEP_ALIVE": 256, "256": "COMPONENT_SHOULD_KEEP_ALIVE", "COMPONENT_KEPT_ALIVE": 512, "512": "COMPONENT_KEPT_ALIVE", "COMPONENT": 6, "6": "COMPONENT" }; const SlotFlags = { "STABLE": 1, "1": "STABLE", "DYNAMIC": 2, "2": "DYNAMIC", "FORWARDED": 3, "3": "FORWARDED" }; const slotFlagsText = { [1]: "STABLE", [2]: "DYNAMIC", [3]: "FORWARDED" }; const GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol"; const isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED); const isGloballyWhitelisted = isGloballyAllowed; const range = 2; function generateCodeFrame(source, start = 0, end = source.length) { start = Math.max(0, Math.min(start, source.length)); end = Math.max(0, Math.min(end, source.length)); if (start > end) return ""; let lines = source.split(/(\r?\n)/); const newlineSequences = lines.filter((_, idx) => idx % 2 === 1); lines = lines.filter((_, idx) => idx % 2 === 0); let count = 0; const res = []; for (let i = 0; i < lines.length; i++) { count += lines[i].length + (newlineSequences[i] && newlineSequences[i].length || 0); if (count >= start) { for (let j = i - range; j <= i + range || end > count; j++) { if (j < 0 || j >= lines.length) continue; const line = j + 1; res.push( `${line}${" ".repeat(Math.max(3 - String(line).length, 0))}| ${lines[j]}` ); const lineLength = lines[j].length; const newLineSeqLength = newlineSequences[j] && newlineSequences[j].length || 0; if (j === i) { const pad = start - (count - (lineLength + newLineSeqLength)); const length = Math.max( 1, end > count ? lineLength - pad : end - start ); res.push(` | ` + " ".repeat(pad) + "^".repeat(length)); } else if (j > i) { if (end > count) { const length = Math.max(Math.min(end - count, lineLength), 1); res.push(` | ` + "^".repeat(length)); } count += lineLength + newLineSeqLength; } } break; } } return res.join("\n"); } function normalizeStyle(value) { if (isArray(value)) { const res = {}; for (let i = 0; i < value.length; i++) { const item = value[i]; const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item); if (normalized) { for (const key in normalized) { res[key] = normalized[key]; } } } return res; } else if (isString(value) || isObject(value)) { return value; } } const listDelimiterRE = /;(?![^(]*\))/g; const propertyDelimiterRE = /:([^]+)/; const styleCommentRE = /\/\*[^]*?\*\//g; function parseStringStyle(cssText) { const ret = {}; cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => { if (item) { const tmp = item.split(propertyDelimiterRE); tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim()); } }); return ret; } function stringifyStyle(styles) { if (!styles) return ""; if (isString(styles)) return styles; let ret = ""; for (const key in styles) { const value = styles[key]; if (isString(value) || typeof value === "number") { const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key); ret += `${normalizedKey}:${value};`; } } return ret; } function normalizeClass(value) { let res = ""; if (isString(value)) { res = value; } else if (isArray(value)) { for (let i = 0; i < value.length; i++) { const normalized = normalizeClass(value[i]); if (normalized) { res += normalized + " "; } } } else if (isObject(value)) { for (const name in value) { if (value[name]) { res += name + " "; } } } return res.trim(); } function normalizeProps(props) { if (!props) return null; let { class: klass, style } = props; if (klass && !isString(klass)) { props.class = normalizeClass(klass); } if (style) { props.style = normalizeStyle(style); } return props; } const HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot"; const SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view"; const MATH_TAGS = "annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics"; const VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr"; const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS); const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS); const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS); const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS); const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`; const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs); const isBooleanAttr = /* @__PURE__ */ makeMap( specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected` ); function includeBooleanAttr(value) { return !!value || value === ""; } const unsafeAttrCharRE = /[>/="'\u0009\u000a\u000c\u0020]/; const attrValidationCache = {}; function isSSRSafeAttrName(name) { if (attrValidationCache.hasOwnProperty(name)) { return attrValidationCache[name]; } const isUnsafe = unsafeAttrCharRE.test(name); if (isUnsafe) { console.error(`unsafe attribute name: ${name}`); } return attrValidationCache[name] = !isUnsafe; } const propsToAttrMap = { acceptCharset: "accept-charset", className: "class", htmlFor: "for", httpEquiv: "http-equiv" }; const isKnownHtmlAttr = /* @__PURE__ */ makeMap( `accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap` ); const isKnownSvgAttr = /* @__PURE__ */ makeMap( `xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan` ); const isKnownMathMLAttr = /* @__PURE__ */ makeMap( `accent,accentunder,actiontype,align,alignmentscope,altimg,altimg-height,altimg-valign,altimg-width,alttext,bevelled,close,columnsalign,columnlines,columnspan,denomalign,depth,dir,display,displaystyle,encoding,equalcolumns,equalrows,fence,fontstyle,fontweight,form,frame,framespacing,groupalign,height,href,id,indentalign,indentalignfirst,indentalignlast,indentshift,indentshiftfirst,indentshiftlast,indextype,justify,largetop,largeop,lquote,lspace,mathbackground,mathcolor,mathsize,mathvariant,maxsize,minlabelspacing,mode,other,overflow,position,rowalign,rowlines,rowspan,rquote,rspace,scriptlevel,scriptminsize,scriptsizemultiplier,selection,separator,separators,shift,side,src,stackalign,stretchy,subscriptshift,superscriptshift,symmetric,voffset,width,widths,xlink:href,xlink:show,xlink:type,xmlns` ); function isRenderableAttrValue(value) { if (value == null) { return false; } const type = typeof value; return type === "string" || type === "number" || type === "boolean"; } const escapeRE = /["'&<>]/; function escapeHtml(string) { const str = "" + string; const match = escapeRE.exec(str); if (!match) { return str; } let html = ""; let escaped; let index; let lastIndex = 0; for (index = match.index; index < str.length; index++) { switch (str.charCodeAt(index)) { case 34: escaped = """; break; case 38: escaped = "&"; break; case 39: escaped = "'"; break; case 60: escaped = "<"; break; case 62: escaped = ">"; break; default: continue; } if (lastIndex !== index) { html += str.slice(lastIndex, index); } lastIndex = index + 1; html += escaped; } return lastIndex !== index ? html + str.slice(lastIndex, index) : html; } const commentStripRE = /^-?>|<!--|-->|--!>|<!-$/g; function escapeHtmlComment(src) { return src.replace(commentStripRE, ""); } const cssVarNameEscapeSymbolsRE = /[ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g; function getEscapedCssVarName(key, doubleEscape) { return key.replace( cssVarNameEscapeSymbolsRE, (s) => doubleEscape ? s === '"' ? '\\\\\\"' : `\\\\${s}` : `\\${s}` ); } function looseCompareArrays(a, b) { if (a.length !== b.length) return false; let equal = true; for (let i = 0; equal && i < a.length; i++) { equal = looseEqual(a[i], b[i]); } return equal; } function looseEqual(a, b) { if (a === b) return true; let aValidType = isDate(a); let bValidType = isDate(b); if (aValidType || bValidType) { return aValidType && bValidType ? a.getTime() === b.getTime() : false; } aValidType = isSymbol(a); bValidType = isSymbol(b); if (aValidType || bValidType) { return a === b; } aValidType = isArray(a); bValidType = isArray(b); if (aValidType || bValidType) { return aValidType && bValidType ? looseCompareArrays(a, b) : false; } aValidType = isObject(a); bValidType = isObject(b); if (aValidType || bValidType) { if (!aValidType || !bValidType) { return false; } const aKeysCount = Object.keys(a).length; const bKeysCount = Object.keys(b).length; if (aKeysCount !== bKeysCount) { return false; } for (const key in a) { const aHasKey = a.hasOwnProperty(key); const bHasKey = b.hasOwnProperty(key); if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) { return false; } } } return String(a) === String(b); } function looseIndexOf(arr, val) { return arr.findIndex((item) => looseEqual(item, val)); } const isRef = (val) => { return !!(val && val["__v_isRef"] === true); }; const toDisplayString = (val) => { return isString(val) ? val : val == null ? "" : isArray(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? isRef(val) ? toDisplayString(val.value) : JSON.stringify(val, replacer, 2) : String(val); }; const replacer = (_key, val) => { if (isRef(val)) { return replacer(_key, val.value); } else if (isMap(val)) { return { [`Map(${val.size})`]: [...val.entries()].reduce( (entries, [key, val2], i) => { entries[stringifySymbol(key, i) + " =>"] = val2; return entries; }, {} ) }; } else if (isSet(val)) { return { [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v)) }; } else if (isSymbol(val)) { return stringifySymbol(val); } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) { return String(val); } return val; }; const stringifySymbol = (v, i = "") => { var _a; return ( // Symbol.description in es2019+ so we need to cast here to pass // the lib: es2016 check isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v ); }; exports.EMPTY_ARR = EMPTY_ARR; exports.EMPTY_OBJ = EMPTY_OBJ; exports.NO = NO; exports.NOOP = NOOP; exports.PatchFlagNames = PatchFlagNames; exports.PatchFlags = PatchFlags; exports.ShapeFlags = ShapeFlags; exports.SlotFlags = SlotFlags; exports.camelize = camelize; exports.capitalize = capitalize; exports.cssVarNameEscapeSymbolsRE = cssVarNameEscapeSymbolsRE; exports.def = def; exports.escapeHtml = escapeHtml; exports.escapeHtmlComment = escapeHtmlComment; exports.extend = extend; exports.genCacheKey = genCacheKey; exports.genPropsAccessExp = genPropsAccessExp; exports.generateCodeFrame = generateCodeFrame; exports.getEscapedCssVarName = getEscapedCssVarName; exports.getGlobalThis = getGlobalThis; exports.hasChanged = hasChanged; exports.hasOwn = hasOwn; exports.hyphenate = hyphenate; exports.includeBooleanAttr = includeBooleanAttr; exports.invokeArrayFns = invokeArrayFns; exports.isArray = isArray; exports.isBooleanAttr = isBooleanAttr; exports.isBuiltInDirective = isBuiltInDirective; exports.isDate = isDate; exports.isFunction = isFunction; exports.isGloballyAllowed = isGloballyAllowed; exports.isGloballyWhitelisted = isGloballyWhitelisted; exports.isHTMLTag = isHTMLTag; exports.isIntegerKey = isIntegerKey; exports.isKnownHtmlAttr = isKnownHtmlAttr; exports.isKnownMathMLAttr = isKnownMathMLAttr; exports.isKnownSvgAttr = isKnownSvgAttr; exports.isMap = isMap; exports.isMathMLTag = isMathMLTag; exports.isModelListener = isModelListener; exports.isObject = isObject; exports.isOn = isOn; exports.isPlainObject = isPlainObject; exports.isPromise = isPromise; exports.isRegExp = isRegExp; exports.isRenderableAttrValue = isRenderableAttrValue; exports.isReservedProp = isReservedProp; exports.isSSRSafeAttrName = isSSRSafeAttrName; exports.isSVGTag = isSVGTag; exports.isSet = isSet; exports.isSpecialBooleanAttr = isSpecialBooleanAttr; exports.isString = isString; exports.isSymbol = isSymbol; exports.isVoidTag = isVoidTag; exports.looseEqual = looseEqual; exports.looseIndexOf = looseIndexOf; exports.looseToNumber = looseToNumber; exports.makeMap = makeMap; exports.normalizeClass = normalizeClass; exports.normalizeProps = normalizeProps; exports.normalizeStyle = normalizeStyle; exports.objectToString = objectToString; exports.parseStringStyle = parseStringStyle; exports.propsToAttrMap = propsToAttrMap; exports.remove = remove; exports.slotFlagsText = slotFlagsText; exports.stringifyStyle = stringifyStyle; exports.toDisplayString = toDisplayString; exports.toHandlerKey = toHandlerKey; exports.toNumber = toNumber; exports.toRawType = toRawType; exports.toTypeString = toTypeString; /***/ }), /***/ "./node_modules/axios/index.js": /*!*************************************!*\ !*** ./node_modules/axios/index.js ***! \*************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { module.exports = __webpack_require__(/*! ./lib/axios */ "./node_modules/axios/lib/axios.js"); /***/ }), /***/ "./node_modules/axios/lib/adapters/xhr.js": /*!************************************************!*\ !*** ./node_modules/axios/lib/adapters/xhr.js ***! \************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); var settle = __webpack_require__(/*! ./../core/settle */ "./node_modules/axios/lib/core/settle.js"); var cookies = __webpack_require__(/*! ./../helpers/cookies */ "./node_modules/axios/lib/helpers/cookies.js"); var buildURL = __webpack_require__(/*! ./../helpers/buildURL */ "./node_modules/axios/lib/helpers/buildURL.js"); var buildFullPath = __webpack_require__(/*! ../core/buildFullPath */ "./node_modules/axios/lib/core/buildFullPath.js"); var parseHeaders = __webpack_require__(/*! ./../helpers/parseHeaders */ "./node_modules/axios/lib/helpers/parseHeaders.js"); var isURLSameOrigin = __webpack_require__(/*! ./../helpers/isURLSameOrigin */ "./node_modules/axios/lib/helpers/isURLSameOrigin.js"); var transitionalDefaults = __webpack_require__(/*! ../defaults/transitional */ "./node_modules/axios/lib/defaults/transitional.js"); var AxiosError = __webpack_require__(/*! ../core/AxiosError */ "./node_modules/axios/lib/core/AxiosError.js"); var CanceledError = __webpack_require__(/*! ../cancel/CanceledError */ "./node_modules/axios/lib/cancel/CanceledError.js"); var parseProtocol = __webpack_require__(/*! ../helpers/parseProtocol */ "./node_modules/axios/lib/helpers/parseProtocol.js"); module.exports = function xhrAdapter(config) { return new Promise(function dispatchXhrRequest(resolve, reject) { var requestData = config.data; var requestHeaders = config.headers; var responseType = config.responseType; var onCanceled; function done() { if (config.cancelToken) { config.cancelToken.unsubscribe(onCanceled); } if (config.signal) { config.signal.removeEventListener('abort', onCanceled); } } if (utils.isFormData(requestData) && utils.isStandardBrowserEnv()) { delete requestHeaders['Content-Type']; // Let the browser set it } var request = new XMLHttpRequest(); // HTTP basic authentication if (config.auth) { var username = config.auth.username || ''; var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ''; requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password); } var fullPath = buildFullPath(config.baseURL, config.url); request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); // Set the request timeout in MS request.timeout = config.timeout; function onloadend() { if (!request) { return; } // Prepare the response var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null; var responseData = !responseType || responseType === 'text' || responseType === 'json' ? request.responseText : request.response; var response = { data: responseData, status: request.status, statusText: request.statusText, headers: responseHeaders, config: config, request: request }; settle(function _resolve(value) { resolve(value); done(); }, function _reject(err) { reject(err); done(); }, response); // Clean up request request = null; } if ('onloadend' in request) { // Use onloadend if available request.onloadend = onloadend; } else { // Listen for ready state to emulate onloadend request.onreadystatechange = function handleLoad() { if (!request || request.readyState !== 4) { return; } // The request errored out and we didn't get a response, this will be // handled by onerror instead // With one exception: request that using file: protocol, most browsers // will return status as 0 even though it's a successful request if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { return; } // readystate handler is calling before onerror or ontimeout handlers, // so we should call onloadend on the next 'tick' setTimeout(onloadend); }; } // Handle browser request cancellation (as opposed to a manual cancellation) request.onabort = function handleAbort() { if (!request) { return; } reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request)); // Clean up request request = null; }; // Handle low level network errors request.onerror = function handleError() { // Real errors are hidden from us by the browser // onerror should only fire if it's a network error reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request, request)); // Clean up request request = null; }; // Handle timeout request.ontimeout = function handleTimeout() { var timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded'; var transitional = config.transitional || transitionalDefaults; if (config.timeoutErrorMessage) { timeoutErrorMessage = config.timeoutErrorMessage; } reject(new AxiosError( timeoutErrorMessage, transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, config, request)); // Clean up request request = null; }; // Add xsrf header // This is only done if running in a standard browser environment. // Specifically not if we're in a web worker, or react-native. if (utils.isStandardBrowserEnv()) { // Add xsrf header var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? cookies.read(config.xsrfCookieName) : undefined; if (xsrfValue) { requestHeaders[config.xsrfHeaderName] = xsrfValue; } } // Add headers to the request if ('setRequestHeader' in request) { utils.forEach(requestHeaders, function setRequestHeader(val, key) { if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') { // Remove Content-Type if data is undefined delete requestHeaders[key]; } else { // Otherwise add header to the request request.setRequestHeader(key, val); } }); } // Add withCredentials to request if needed if (!utils.isUndefined(config.withCredentials)) { request.withCredentials = !!config.withCredentials; } // Add responseType to request if needed if (responseType && responseType !== 'json') { request.responseType = config.responseType; } // Handle progress if needed if (typeof config.onDownloadProgress === 'function') { request.addEventListener('progress', config.onDownloadProgress); } // Not all browsers support upload events if (typeof config.onUploadProgress === 'function' && request.upload) { request.upload.addEventListener('progress', config.onUploadProgress); } if (config.cancelToken || config.signal) { // Handle cancellation // eslint-disable-next-line func-names onCanceled = function(cancel) { if (!request) { return; } reject(!cancel || (cancel && cancel.type) ? new CanceledError() : cancel); request.abort(); request = null; }; config.cancelToken && config.cancelToken.subscribe(onCanceled); if (config.signal) { config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled); } } if (!requestData) { requestData = null; } var protocol = parseProtocol(fullPath); if (protocol && [ 'http', 'https', 'file' ].indexOf(protocol) === -1) { reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config)); return; } // Send the request request.send(requestData); }); }; /***/ }), /***/ "./node_modules/axios/lib/axios.js": /*!*****************************************!*\ !*** ./node_modules/axios/lib/axios.js ***! \*****************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var utils = __webpack_require__(/*! ./utils */ "./node_modules/axios/lib/utils.js"); var bind = __webpack_require__(/*! ./helpers/bind */ "./node_modules/axios/lib/helpers/bind.js"); var Axios = __webpack_require__(/*! ./core/Axios */ "./node_modules/axios/lib/core/Axios.js"); var mergeConfig = __webpack_require__(/*! ./core/mergeConfig */ "./node_modules/axios/lib/core/mergeConfig.js"); var defaults = __webpack_require__(/*! ./defaults */ "./node_modules/axios/lib/defaults/index.js"); /** * Create an instance of Axios * * @param {Object} defaultConfig The default config for the instance * @return {Axios} A new instance of Axios */ function createInstance(defaultConfig) { var context = new Axios(defaultConfig); var instance = bind(Axios.prototype.request, context); // Copy axios.prototype to instance utils.extend(instance, Axios.prototype, context); // Copy context to instance utils.extend(instance, context); // Factory for creating new instances instance.create = function create(instanceConfig) { return createInstance(mergeConfig(defaultConfig, instanceConfig)); }; return instance; } // Create the default instance to be exported var axios = createInstance(defaults); // Expose Axios class to allow class inheritance axios.Axios = Axios; // Expose Cancel & CancelToken axios.CanceledError = __webpack_require__(/*! ./cancel/CanceledError */ "./node_modules/axios/lib/cancel/CanceledError.js"); axios.CancelToken = __webpack_require__(/*! ./cancel/CancelToken */ "./node_modules/axios/lib/cancel/CancelToken.js"); axios.isCancel = __webpack_require__(/*! ./cancel/isCancel */ "./node_modules/axios/lib/cancel/isCancel.js"); axios.VERSION = (__webpack_require__(/*! ./env/data */ "./node_modules/axios/lib/env/data.js").version); axios.toFormData = __webpack_require__(/*! ./helpers/toFormData */ "./node_modules/axios/lib/helpers/toFormData.js"); // Expose AxiosError class axios.AxiosError = __webpack_require__(/*! ../lib/core/AxiosError */ "./node_modules/axios/lib/core/AxiosError.js"); // alias for CanceledError for backward compatibility axios.Cancel = axios.CanceledError; // Expose all/spread axios.all = function all(promises) { return Promise.all(promises); }; axios.spread = __webpack_require__(/*! ./helpers/spread */ "./node_modules/axios/lib/helpers/spread.js"); // Expose isAxiosError axios.isAxiosError = __webpack_require__(/*! ./helpers/isAxiosError */ "./node_modules/axios/lib/helpers/isAxiosError.js"); module.exports = axios; // Allow use of default import syntax in TypeScript module.exports["default"] = axios; /***/ }), /***/ "./node_modules/axios/lib/cancel/CancelToken.js": /*!******************************************************!*\ !*** ./node_modules/axios/lib/cancel/CancelToken.js ***! \******************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var CanceledError = __webpack_require__(/*! ./CanceledError */ "./node_modules/axios/lib/cancel/CanceledError.js"); /** * A `CancelToken` is an object that can be used to request cancellation of an operation. * * @class * @param {Function} executor The executor function. */ function CancelToken(executor) { if (typeof executor !== 'function') { throw new TypeError('executor must be a function.'); } var resolvePromise; this.promise = new Promise(function promiseExecutor(resolve) { resolvePromise = resolve; }); var token = this; // eslint-disable-next-line func-names this.promise.then(function(cancel) { if (!token._listeners) return; var i; var l = token._listeners.length; for (i = 0; i < l; i++) { token._listeners[i](cancel); } token._listeners = null; }); // eslint-disable-next-line func-names this.promise.then = function(onfulfilled) { var _resolve; // eslint-disable-next-line func-names var promise = new Promise(function(resolve) { token.subscribe(resolve); _resolve = resolve; }).then(onfulfilled); promise.cancel = function reject() { token.unsubscribe(_resolve); }; return promise; }; executor(function cancel(message) { if (token.reason) { // Cancellation has already been requested return; } token.reason = new CanceledError(message); resolvePromise(token.reason); }); } /** * Throws a `CanceledError` if cancellation has been requested. */ CancelToken.prototype.throwIfRequested = function throwIfRequested() { if (this.reason) { throw this.reason; } }; /** * Subscribe to the cancel signal */ CancelToken.prototype.subscribe = function subscribe(listener) { if (this.reason) { listener(this.reason); return; } if (this._listeners) { this._listeners.push(listener); } else { this._listeners = [listener]; } }; /** * Unsubscribe from the cancel signal */ CancelToken.prototype.unsubscribe = function unsubscribe(listener) { if (!this._listeners) { return; } var index = this._listeners.indexOf(listener); if (index !== -1) { this._listeners.splice(index, 1); } }; /** * Returns an object that contains a new `CancelToken` and a function that, when called, * cancels the `CancelToken`. */ CancelToken.source = function source() { var cancel; var token = new CancelToken(function executor(c) { cancel = c; }); return { token: token, cancel: cancel }; }; module.exports = CancelToken; /***/ }), /***/ "./node_modules/axios/lib/cancel/CanceledError.js": /*!********************************************************!*\ !*** ./node_modules/axios/lib/cancel/CanceledError.js ***! \********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var AxiosError = __webpack_require__(/*! ../core/AxiosError */ "./node_modules/axios/lib/core/AxiosError.js"); var utils = __webpack_require__(/*! ../utils */ "./node_modules/axios/lib/utils.js"); /** * A `CanceledError` is an object that is thrown when an operation is canceled. * * @class * @param {string=} message The message. */ function CanceledError(message) { // eslint-disable-next-line no-eq-null,eqeqeq AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED); this.name = 'CanceledError'; } utils.inherits(CanceledError, AxiosError, { __CANCEL__: true }); module.exports = CanceledError; /***/ }), /***/ "./node_modules/axios/lib/cancel/isCancel.js": /*!***************************************************!*\ !*** ./node_modules/axios/lib/cancel/isCancel.js ***! \***************************************************/ /***/ ((module) => { "use strict"; module.exports = function isCancel(value) { return !!(value && value.__CANCEL__); }; /***/ }), /***/ "./node_modules/axios/lib/core/Axios.js": /*!**********************************************!*\ !*** ./node_modules/axios/lib/core/Axios.js ***! \**********************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); var buildURL = __webpack_require__(/*! ../helpers/buildURL */ "./node_modules/axios/lib/helpers/buildURL.js"); var InterceptorManager = __webpack_require__(/*! ./InterceptorManager */ "./node_modules/axios/lib/core/InterceptorManager.js"); var dispatchRequest = __webpack_require__(/*! ./dispatchRequest */ "./node_modules/axios/lib/core/dispatchRequest.js"); var mergeConfig = __webpack_require__(/*! ./mergeConfig */ "./node_modules/axios/lib/core/mergeConfig.js"); var buildFullPath = __webpack_require__(/*! ./buildFullPath */ "./node_modules/axios/lib/core/buildFullPath.js"); var validator = __webpack_require__(/*! ../helpers/validator */ "./node_modules/axios/lib/helpers/validator.js"); var validators = validator.validators; /** * Create a new instance of Axios * * @param {Object} instanceConfig The default config for the instance */ function Axios(instanceConfig) { this.defaults = instanceConfig; this.interceptors = { request: new InterceptorManager(), response: new InterceptorManager() }; } /** * Dispatch a request * * @param {Object} config The config specific for this request (merged with this.defaults) */ Axios.prototype.request = function request(configOrUrl, config) { /*eslint no-param-reassign:0*/ // Allow for axios('example/url'[, config]) a la fetch API if (typeof configOrUrl === 'string') { config = config || {}; config.url = configOrUrl; } else { config = configOrUrl || {}; } config = mergeConfig(this.defaults, config); // Set config.method if (config.method) { config.method = config.method.toLowerCase(); } else if (this.defaults.method) { config.method = this.defaults.method.toLowerCase(); } else { config.method = 'get'; } var transitional = config.transitional; if (transitional !== undefined) { validator.assertOptions(transitional, { silentJSONParsing: validators.transitional(validators.boolean), forcedJSONParsing: validators.transitional(validators.boolean), clarifyTimeoutError: validators.transitional(validators.boolean) }, false); } // filter out skipped interceptors var requestInterceptorChain = []; var synchronousRequestInterceptors = true; this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { return; } synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); }); var responseInterceptorChain = []; this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); }); var promise; if (!synchronousRequestInterceptors) { var chain = [dispatchRequest, undefined]; Array.prototype.unshift.apply(chain, requestInterceptorChain); chain = chain.concat(responseInterceptorChain); promise = Promise.resolve(config); while (chain.length) { promise = promise.then(chain.shift(), chain.shift()); } return promise; } var newConfig = config; while (requestInterceptorChain.length) { var onFulfilled = requestInterceptorChain.shift(); var onRejected = requestInterceptorChain.shift(); try { newConfig = onFulfilled(newConfig); } catch (error) { onRejected(error); break; } } try { promise = dispatchRequest(newConfig); } catch (error) { return Promise.reject(error); } while (responseInterceptorChain.length) { promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift()); } return promise; }; Axios.prototype.getUri = function getUri(config) { config = mergeConfig(this.defaults, config); var fullPath = buildFullPath(config.baseURL, config.url); return buildURL(fullPath, config.params, config.paramsSerializer); }; // Provide aliases for supported request methods utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { /*eslint func-names:0*/ Axios.prototype[method] = function(url, config) { return this.request(mergeConfig(config || {}, { method: method, url: url, data: (config || {}).data })); }; }); utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { /*eslint func-names:0*/ function generateHTTPMethod(isForm) { return function httpMethod(url, data, config) { return this.request(mergeConfig(config || {}, { method: method, headers: isForm ? { 'Content-Type': 'multipart/form-data' } : {}, url: url, data: data })); }; } Axios.prototype[method] = generateHTTPMethod(); Axios.prototype[method + 'Form'] = generateHTTPMethod(true); }); module.exports = Axios; /***/ }), /***/ "./node_modules/axios/lib/core/AxiosError.js": /*!***************************************************!*\ !*** ./node_modules/axios/lib/core/AxiosError.js ***! \***************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var utils = __webpack_require__(/*! ../utils */ "./node_modules/axios/lib/utils.js"); /** * Create an Error with the specified message, config, error code, request and response. * * @param {string} message The error message. * @param {string} [code] The error code (for example, 'ECONNABORTED'). * @param {Object} [config] The config. * @param {Object} [request] The request. * @param {Object} [response] The response. * @returns {Error} The created error. */ function AxiosError(message, code, config, request, response) { Error.call(this); this.message = message; this.name = 'AxiosError'; code && (this.code = code); config && (this.config = config); request && (this.request = request); response && (this.response = response); } utils.inherits(AxiosError, Error, { toJSON: function toJSON() { return { // Standard message: this.message, name: this.name, // Microsoft description: this.description, number: this.number, // Mozilla fileName: this.fileName, lineNumber: this.lineNumber, columnNumber: this.columnNumber, stack: this.stack, // Axios config: this.config, code: this.code, status: this.response && this.response.status ? this.response.status : null }; } }); var prototype = AxiosError.prototype; var descriptors = {}; [ 'ERR_BAD_OPTION_VALUE', 'ERR_BAD_OPTION', 'ECONNABORTED', 'ETIMEDOUT', 'ERR_NETWORK', 'ERR_FR_TOO_MANY_REDIRECTS', 'ERR_DEPRECATED', 'ERR_BAD_RESPONSE', 'ERR_BAD_REQUEST', 'ERR_CANCELED' // eslint-disable-next-line func-names ].forEach(function(code) { descriptors[code] = {value: code}; }); Object.defineProperties(AxiosError, descriptors); Object.defineProperty(prototype, 'isAxiosError', {value: true}); // eslint-disable-next-line func-names AxiosError.from = function(error, code, config, request, response, customProps) { var axiosError = Object.create(prototype); utils.toFlatObject(error, axiosError, function filter(obj) { return obj !== Error.prototype; }); AxiosError.call(axiosError, error.message, code, config, request, response); axiosError.name = error.name; customProps && Object.assign(axiosError, customProps); return axiosError; }; module.exports = AxiosError; /***/ }), /***/ "./node_modules/axios/lib/core/InterceptorManager.js": /*!***********************************************************!*\ !*** ./node_modules/axios/lib/core/InterceptorManager.js ***! \***********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); function InterceptorManager() { this.handlers = []; } /** * Add a new interceptor to the stack * * @param {Function} fulfilled The function to handle `then` for a `Promise` * @param {Function} rejected The function to handle `reject` for a `Promise` * * @return {Number} An ID used to remove interceptor later */ InterceptorManager.prototype.use = function use(fulfilled, rejected, options) { this.handlers.push({ fulfilled: fulfilled, rejected: rejected, synchronous: options ? options.synchronous : false, runWhen: options ? options.runWhen : null }); return this.handlers.length - 1; }; /** * Remove an interceptor from the stack * * @param {Number} id The ID that was returned by `use` */ InterceptorManager.prototype.eject = function eject(id) { if (this.handlers[id]) { this.handlers[id] = null; } }; /** * Iterate over all the registered interceptors * * This method is particularly useful for skipping over any * interceptors that may have become `null` calling `eject`. * * @param {Function} fn The function to call for each interceptor */ InterceptorManager.prototype.forEach = function forEach(fn) { utils.forEach(this.handlers, function forEachHandler(h) { if (h !== null) { fn(h); } }); }; module.exports = InterceptorManager; /***/ }), /***/ "./node_modules/axios/lib/core/buildFullPath.js": /*!******************************************************!*\ !*** ./node_modules/axios/lib/core/buildFullPath.js ***! \******************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var isAbsoluteURL = __webpack_require__(/*! ../helpers/isAbsoluteURL */ "./node_modules/axios/lib/helpers/isAbsoluteURL.js"); var combineURLs = __webpack_require__(/*! ../helpers/combineURLs */ "./node_modules/axios/lib/helpers/combineURLs.js"); /** * Creates a new URL by combining the baseURL with the requestedURL, * only when the requestedURL is not already an absolute URL. * If the requestURL is absolute, this function returns the requestedURL untouched. * * @param {string} baseURL The base URL * @param {string} requestedURL Absolute or relative URL to combine * @returns {string} The combined full path */ module.exports = function buildFullPath(baseURL, requestedURL) { if (baseURL && !isAbsoluteURL(requestedURL)) { return combineURLs(baseURL, requestedURL); } return requestedURL; }; /***/ }), /***/ "./node_modules/axios/lib/core/dispatchRequest.js": /*!********************************************************!*\ !*** ./node_modules/axios/lib/core/dispatchRequest.js ***! \********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); var transformData = __webpack_require__(/*! ./transformData */ "./node_modules/axios/lib/core/transformData.js"); var isCancel = __webpack_require__(/*! ../cancel/isCancel */ "./node_modules/axios/lib/cancel/isCancel.js"); var defaults = __webpack_require__(/*! ../defaults */ "./node_modules/axios/lib/defaults/index.js"); var CanceledError = __webpack_require__(/*! ../cancel/CanceledError */ "./node_modules/axios/lib/cancel/CanceledError.js"); /** * Throws a `CanceledError` if cancellation has been requested. */ function throwIfCancellationRequested(config) { if (config.cancelToken) { config.cancelToken.throwIfRequested(); } if (config.signal && config.signal.aborted) { throw new CanceledError(); } } /** * Dispatch a request to the server using the configured adapter. * * @param {object} config The config that is to be used for the request * @returns {Promise} The Promise to be fulfilled */ module.exports = function dispatchRequest(config) { throwIfCancellationRequested(config); // Ensure headers exist config.headers = config.headers || {}; // Transform request data config.data = transformData.call( config, config.data, config.headers, config.transformRequest ); // Flatten headers config.headers = utils.merge( config.headers.common || {}, config.headers[config.method] || {}, config.headers ); utils.forEach( ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], function cleanHeaderConfig(method) { delete config.headers[method]; } ); var adapter = config.adapter || defaults.adapter; return adapter(config).then(function onAdapterResolution(response) { throwIfCancellationRequested(config); // Transform response data response.data = transformData.call( config, response.data, response.headers, config.transformResponse ); return response; }, function onAdapterRejection(reason) { if (!isCancel(reason)) { throwIfCancellationRequested(config); // Transform response data if (reason && reason.response) { reason.response.data = transformData.call( config, reason.response.data, reason.response.headers, config.transformResponse ); } } return Promise.reject(reason); }); }; /***/ }), /***/ "./node_modules/axios/lib/core/mergeConfig.js": /*!****************************************************!*\ !*** ./node_modules/axios/lib/core/mergeConfig.js ***! \****************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var utils = __webpack_require__(/*! ../utils */ "./node_modules/axios/lib/utils.js"); /** * Config-specific merge-function which creates a new config-object * by merging two configuration objects together. * * @param {Object} config1 * @param {Object} config2 * @returns {Object} New object resulting from merging config2 to config1 */ module.exports = function mergeConfig(config1, config2) { // eslint-disable-next-line no-param-reassign config2 = config2 || {}; var config = {}; function getMergedValue(target, source) { if (utils.isPlainObject(target) && utils.isPlainObject(source)) { return utils.merge(target, source); } else if (utils.isPlainObject(source)) { return utils.merge({}, source); } else if (utils.isArray(source)) { return source.slice(); } return source; } // eslint-disable-next-line consistent-return function mergeDeepProperties(prop) { if (!utils.isUndefined(config2[prop])) { return getMergedValue(config1[prop], config2[prop]); } else if (!utils.isUndefined(config1[prop])) { return getMergedValue(undefined, config1[prop]); } } // eslint-disable-next-line consistent-return function valueFromConfig2(prop) { if (!utils.isUndefined(config2[prop])) { return getMergedValue(undefined, config2[prop]); } } // eslint-disable-next-line consistent-return function defaultToConfig2(prop) { if (!utils.isUndefined(config2[prop])) { return getMergedValue(undefined, config2[prop]); } else if (!utils.isUndefined(config1[prop])) { return getMergedValue(undefined, config1[prop]); } } // eslint-disable-next-line consistent-return function mergeDirectKeys(prop) { if (prop in config2) { return getMergedValue(config1[prop], config2[prop]); } else if (prop in config1) { return getMergedValue(undefined, config1[prop]); } } var mergeMap = { 'url': valueFromConfig2, 'method': valueFromConfig2, 'data': valueFromConfig2, 'baseURL': defaultToConfig2, 'transformRequest': defaultToConfig2, 'transformResponse': defaultToConfig2, 'paramsSerializer': defaultToConfig2, 'timeout': defaultToConfig2, 'timeoutMessage': defaultToConfig2, 'withCredentials': defaultToConfig2, 'adapter': defaultToConfig2, 'responseType': defaultToConfig2, 'xsrfCookieName': defaultToConfig2, 'xsrfHeaderName': defaultToConfig2, 'onUploadProgress': defaultToConfig2, 'onDownloadProgress': defaultToConfig2, 'decompress': defaultToConfig2, 'maxContentLength': defaultToConfig2, 'maxBodyLength': defaultToConfig2, 'beforeRedirect': defaultToConfig2, 'transport': defaultToConfig2, 'httpAgent': defaultToConfig2, 'httpsAgent': defaultToConfig2, 'cancelToken': defaultToConfig2, 'socketPath': defaultToConfig2, 'responseEncoding': defaultToConfig2, 'validateStatus': mergeDirectKeys }; utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) { var merge = mergeMap[prop] || mergeDeepProperties; var configValue = merge(prop); (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue); }); return config; }; /***/ }), /***/ "./node_modules/axios/lib/core/settle.js": /*!***********************************************!*\ !*** ./node_modules/axios/lib/core/settle.js ***! \***********************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var AxiosError = __webpack_require__(/*! ./AxiosError */ "./node_modules/axios/lib/core/AxiosError.js"); /** * Resolve or reject a Promise based on response status. * * @param {Function} resolve A function that resolves the promise. * @param {Function} reject A function that rejects the promise. * @param {object} response The response. */ module.exports = function settle(resolve, reject, response) { var validateStatus = response.config.validateStatus; if (!response.status || !validateStatus || validateStatus(response.status)) { resolve(response); } else { reject(new AxiosError( 'Request failed with status code ' + response.status, [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], response.config, response.request, response )); } }; /***/ }), /***/ "./node_modules/axios/lib/core/transformData.js": /*!******************************************************!*\ !*** ./node_modules/axios/lib/core/transformData.js ***! \******************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); var defaults = __webpack_require__(/*! ../defaults */ "./node_modules/axios/lib/defaults/index.js"); /** * Transform the data for a request or a response * * @param {Object|String} data The data to be transformed * @param {Array} headers The headers for the request or response * @param {Array|Function} fns A single function or Array of functions * @returns {*} The resulting transformed data */ module.exports = function transformData(data, headers, fns) { var context = this || defaults; /*eslint no-param-reassign:0*/ utils.forEach(fns, function transform(fn) { data = fn.call(context, data, headers); }); return data; }; /***/ }), /***/ "./node_modules/axios/lib/defaults/index.js": /*!**************************************************!*\ !*** ./node_modules/axios/lib/defaults/index.js ***! \**************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var utils = __webpack_require__(/*! ../utils */ "./node_modules/axios/lib/utils.js"); var normalizeHeaderName = __webpack_require__(/*! ../helpers/normalizeHeaderName */ "./node_modules/axios/lib/helpers/normalizeHeaderName.js"); var AxiosError = __webpack_require__(/*! ../core/AxiosError */ "./node_modules/axios/lib/core/AxiosError.js"); var transitionalDefaults = __webpack_require__(/*! ./transitional */ "./node_modules/axios/lib/defaults/transitional.js"); var toFormData = __webpack_require__(/*! ../helpers/toFormData */ "./node_modules/axios/lib/helpers/toFormData.js"); var DEFAULT_CONTENT_TYPE = { 'Content-Type': 'application/x-www-form-urlencoded' }; function setContentTypeIfUnset(headers, value) { if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) { headers['Content-Type'] = value; } } function getDefaultAdapter() { var adapter; if (typeof XMLHttpRequest !== 'undefined') { // For browsers use XHR adapter adapter = __webpack_require__(/*! ../adapters/xhr */ "./node_modules/axios/lib/adapters/xhr.js"); } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') { // For node use HTTP adapter adapter = __webpack_require__(/*! ../adapters/http */ "./node_modules/axios/lib/adapters/xhr.js"); } return adapter; } function stringifySafely(rawValue, parser, encoder) { if (utils.isString(rawValue)) { try { (parser || JSON.parse)(rawValue); return utils.trim(rawValue); } catch (e) { if (e.name !== 'SyntaxError') { throw e; } } } return (encoder || JSON.stringify)(rawValue); } var defaults = { transitional: transitionalDefaults, adapter: getDefaultAdapter(), transformRequest: [function transformRequest(data, headers) { normalizeHeaderName(headers, 'Accept'); normalizeHeaderName(headers, 'Content-Type'); if (utils.isFormData(data) || utils.isArrayBuffer(data) || utils.isBuffer(data) || utils.isStream(data) || utils.isFile(data) || utils.isBlob(data) ) { return data; } if (utils.isArrayBufferView(data)) { return data.buffer; } if (utils.isURLSearchParams(data)) { setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8'); return data.toString(); } var isObjectPayload = utils.isObject(data); var contentType = headers && headers['Content-Type']; var isFileList; if ((isFileList = utils.isFileList(data)) || (isObjectPayload && contentType === 'multipart/form-data')) { var _FormData = this.env && this.env.FormData; return toFormData(isFileList ? {'files[]': data} : data, _FormData && new _FormData()); } else if (isObjectPayload || contentType === 'application/json') { setContentTypeIfUnset(headers, 'application/json'); return stringifySafely(data); } return data; }], transformResponse: [function transformResponse(data) { var transitional = this.transitional || defaults.transitional; var silentJSONParsing = transitional && transitional.silentJSONParsing; var forcedJSONParsing = transitional && transitional.forcedJSONParsing; var strictJSONParsing = !silentJSONParsing && this.responseType === 'json'; if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) { try { return JSON.parse(data); } catch (e) { if (strictJSONParsing) { if (e.name === 'SyntaxError') { throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response); } throw e; } } } return data; }], /** * A timeout in milliseconds to abort a request. If set to 0 (default) a * timeout is not created. */ timeout: 0, xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, env: { FormData: __webpack_require__(/*! ./env/FormData */ "./node_modules/axios/lib/helpers/null.js") }, validateStatus: function validateStatus(status) { return status >= 200 && status < 300; }, headers: { common: { 'Accept': 'application/json, text/plain, */*' } } }; utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { defaults.headers[method] = {}; }); utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE); }); module.exports = defaults; /***/ }), /***/ "./node_modules/axios/lib/defaults/transitional.js": /*!*********************************************************!*\ !*** ./node_modules/axios/lib/defaults/transitional.js ***! \*********************************************************/ /***/ ((module) => { "use strict"; module.exports = { silentJSONParsing: true, forcedJSONParsing: true, clarifyTimeoutError: false }; /***/ }), /***/ "./node_modules/axios/lib/env/data.js": /*!********************************************!*\ !*** ./node_modules/axios/lib/env/data.js ***! \********************************************/ /***/ ((module) => { module.exports = { "version": "0.27.2" }; /***/ }), /***/ "./node_modules/axios/lib/helpers/bind.js": /*!************************************************!*\ !*** ./node_modules/axios/lib/helpers/bind.js ***! \************************************************/ /***/ ((module) => { "use strict"; module.exports = function bind(fn, thisArg) { return function wrap() { var args = new Array(arguments.length); for (var i = 0; i < args.length; i++) { args[i] = arguments[i]; } return fn.apply(thisArg, args); }; }; /***/ }), /***/ "./node_modules/axios/lib/helpers/buildURL.js": /*!****************************************************!*\ !*** ./node_modules/axios/lib/helpers/buildURL.js ***! \****************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); function encode(val) { return encodeURIComponent(val). replace(/%3A/gi, ':'). replace(/%24/g, '$'). replace(/%2C/gi, ','). replace(/%20/g, '+'). replace(/%5B/gi, '['). replace(/%5D/gi, ']'); } /** * Build a URL by appending params to the end * * @param {string} url The base of the url (e.g., http://www.google.com) * @param {object} [params] The params to be appended * @returns {string} The formatted url */ module.exports = function buildURL(url, params, paramsSerializer) { /*eslint no-param-reassign:0*/ if (!params) { return url; } var serializedParams; if (paramsSerializer) { serializedParams = paramsSerializer(params); } else if (utils.isURLSearchParams(params)) { serializedParams = params.toString(); } else { var parts = []; utils.forEach(params, function serialize(val, key) { if (val === null || typeof val === 'undefined') { return; } if (utils.isArray(val)) { key = key + '[]'; } else { val = [val]; } utils.forEach(val, function parseValue(v) { if (utils.isDate(v)) { v = v.toISOString(); } else if (utils.isObject(v)) { v = JSON.stringify(v); } parts.push(encode(key) + '=' + encode(v)); }); }); serializedParams = parts.join('&'); } if (serializedParams) { var hashmarkIndex = url.indexOf('#'); if (hashmarkIndex !== -1) { url = url.slice(0, hashmarkIndex); } url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; } return url; }; /***/ }), /***/ "./node_modules/axios/lib/helpers/combineURLs.js": /*!*******************************************************!*\ !*** ./node_modules/axios/lib/helpers/combineURLs.js ***! \*******************************************************/ /***/ ((module) => { "use strict"; /** * Creates a new URL by combining the specified URLs * * @param {string} baseURL The base URL * @param {string} relativeURL The relative URL * @returns {string} The combined URL */ module.exports = function combineURLs(baseURL, relativeURL) { return relativeURL ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') : baseURL; }; /***/ }), /***/ "./node_modules/axios/lib/helpers/cookies.js": /*!***************************************************!*\ !*** ./node_modules/axios/lib/helpers/cookies.js ***! \***************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); module.exports = ( utils.isStandardBrowserEnv() ? // Standard browser envs support document.cookie (function standardBrowserEnv() { return { write: function write(name, value, expires, path, domain, secure) { var cookie = []; cookie.push(name + '=' + encodeURIComponent(value)); if (utils.isNumber(expires)) { cookie.push('expires=' + new Date(expires).toGMTString()); } if (utils.isString(path)) { cookie.push('path=' + path); } if (utils.isString(domain)) { cookie.push('domain=' + domain); } if (secure === true) { cookie.push('secure'); } document.cookie = cookie.join('; '); }, read: function read(name) { var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); return (match ? decodeURIComponent(match[3]) : null); }, remove: function remove(name) { this.write(name, '', Date.now() - 86400000); } }; })() : // Non standard browser env (web workers, react-native) lack needed support. (function nonStandardBrowserEnv() { return { write: function write() {}, read: function read() { return null; }, remove: function remove() {} }; })() ); /***/ }), /***/ "./node_modules/axios/lib/helpers/isAbsoluteURL.js": /*!*********************************************************!*\ !*** ./node_modules/axios/lib/helpers/isAbsoluteURL.js ***! \*********************************************************/ /***/ ((module) => { "use strict"; /** * Determines whether the specified URL is absolute * * @param {string} url The URL to test * @returns {boolean} True if the specified URL is absolute, otherwise false */ module.exports = function isAbsoluteURL(url) { // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL). // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed // by any combination of letters, digits, plus, period, or hyphen. return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); }; /***/ }), /***/ "./node_modules/axios/lib/helpers/isAxiosError.js": /*!********************************************************!*\ !*** ./node_modules/axios/lib/helpers/isAxiosError.js ***! \********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); /** * Determines whether the payload is an error thrown by Axios * * @param {*} payload The value to test * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false */ module.exports = function isAxiosError(payload) { return utils.isObject(payload) && (payload.isAxiosError === true); }; /***/ }), /***/ "./node_modules/axios/lib/helpers/isURLSameOrigin.js": /*!***********************************************************!*\ !*** ./node_modules/axios/lib/helpers/isURLSameOrigin.js ***! \***********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); module.exports = ( utils.isStandardBrowserEnv() ? // Standard browser envs have full support of the APIs needed to test // whether the request URL is of the same origin as current location. (function standardBrowserEnv() { var msie = /(msie|trident)/i.test(navigator.userAgent); var urlParsingNode = document.createElement('a'); var originURL; /** * Parse a URL to discover it's components * * @param {String} url The URL to be parsed * @returns {Object} */ function resolveURL(url) { var href = url; if (msie) { // IE needs attribute set twice to normalize properties urlParsingNode.setAttribute('href', href); href = urlParsingNode.href; } urlParsingNode.setAttribute('href', href); // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils return { href: urlParsingNode.href, protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', host: urlParsingNode.host, search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', hostname: urlParsingNode.hostname, port: urlParsingNode.port, pathname: (urlParsingNode.pathname.charAt(0) === '/') ? urlParsingNode.pathname : '/' + urlParsingNode.pathname }; } originURL = resolveURL(window.location.href); /** * Determine if a URL shares the same origin as the current location * * @param {String} requestURL The URL to test * @returns {boolean} True if URL shares the same origin, otherwise false */ return function isURLSameOrigin(requestURL) { var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL; return (parsed.protocol === originURL.protocol && parsed.host === originURL.host); }; })() : // Non standard browser envs (web workers, react-native) lack needed support. (function nonStandardBrowserEnv() { return function isURLSameOrigin() { return true; }; })() ); /***/ }), /***/ "./node_modules/axios/lib/helpers/normalizeHeaderName.js": /*!***************************************************************!*\ !*** ./node_modules/axios/lib/helpers/normalizeHeaderName.js ***! \***************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var utils = __webpack_require__(/*! ../utils */ "./node_modules/axios/lib/utils.js"); module.exports = function normalizeHeaderName(headers, normalizedName) { utils.forEach(headers, function processHeader(value, name) { if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) { headers[normalizedName] = value; delete headers[name]; } }); }; /***/ }), /***/ "./node_modules/axios/lib/helpers/null.js": /*!************************************************!*\ !*** ./node_modules/axios/lib/helpers/null.js ***! \************************************************/ /***/ ((module) => { // eslint-disable-next-line strict module.exports = null; /***/ }), /***/ "./node_modules/axios/lib/helpers/parseHeaders.js": /*!********************************************************!*\ !*** ./node_modules/axios/lib/helpers/parseHeaders.js ***! \********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); // Headers whose duplicates are ignored by node // c.f. https://nodejs.org/api/http.html#http_message_headers var ignoreDuplicateOf = [ 'age', 'authorization', 'content-length', 'content-type', 'etag', 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', 'last-modified', 'location', 'max-forwards', 'proxy-authorization', 'referer', 'retry-after', 'user-agent' ]; /** * Parse headers into an object * * ``` * Date: Wed, 27 Aug 2014 08:58:49 GMT * Content-Type: application/json * Connection: keep-alive * Transfer-Encoding: chunked * ``` * * @param {String} headers Headers needing to be parsed * @returns {Object} Headers parsed into an object */ module.exports = function parseHeaders(headers) { var parsed = {}; var key; var val; var i; if (!headers) { return parsed; } utils.forEach(headers.split('\n'), function parser(line) { i = line.indexOf(':'); key = utils.trim(line.substr(0, i)).toLowerCase(); val = utils.trim(line.substr(i + 1)); if (key) { if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) { return; } if (key === 'set-cookie') { parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]); } else { parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; } } }); return parsed; }; /***/ }), /***/ "./node_modules/axios/lib/helpers/parseProtocol.js": /*!*********************************************************!*\ !*** ./node_modules/axios/lib/helpers/parseProtocol.js ***! \*********************************************************/ /***/ ((module) => { "use strict"; module.exports = function parseProtocol(url) { var match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url); return match && match[1] || ''; }; /***/ }), /***/ "./node_modules/axios/lib/helpers/spread.js": /*!**************************************************!*\ !*** ./node_modules/axios/lib/helpers/spread.js ***! \**************************************************/ /***/ ((module) => { "use strict"; /** * Syntactic sugar for invoking a function and expanding an array for arguments. * * Common use case would be to use `Function.prototype.apply`. * * ```js * function f(x, y, z) {} * var args = [1, 2, 3]; * f.apply(null, args); * ``` * * With `spread` this example can be re-written. * * ```js * spread(function(x, y, z) {})([1, 2, 3]); * ``` * * @param {Function} callback * @returns {Function} */ module.exports = function spread(callback) { return function wrap(arr) { return callback.apply(null, arr); }; }; /***/ }), /***/ "./node_modules/axios/lib/helpers/toFormData.js": /*!******************************************************!*\ !*** ./node_modules/axios/lib/helpers/toFormData.js ***! \******************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var utils = __webpack_require__(/*! ../utils */ "./node_modules/axios/lib/utils.js"); /** * Convert a data object to FormData * @param {Object} obj * @param {?Object} [formData] * @returns {Object} **/ function toFormData(obj, formData) { // eslint-disable-next-line no-param-reassign formData = formData || new FormData(); var stack = []; function convertValue(value) { if (value === null) return ''; if (utils.isDate(value)) { return value.toISOString(); } if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) { return typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value); } return value; } function build(data, parentKey) { if (utils.isPlainObject(data) || utils.isArray(data)) { if (stack.indexOf(data) !== -1) { throw Error('Circular reference detected in ' + parentKey); } stack.push(data); utils.forEach(data, function each(value, key) { if (utils.isUndefined(value)) return; var fullKey = parentKey ? parentKey + '.' + key : key; var arr; if (value && !parentKey && typeof value === 'object') { if (utils.endsWith(key, '{}')) { // eslint-disable-next-line no-param-reassign value = JSON.stringify(value); } else if (utils.endsWith(key, '[]') && (arr = utils.toArray(value))) { // eslint-disable-next-line func-names arr.forEach(function(el) { !utils.isUndefined(el) && formData.append(fullKey, convertValue(el)); }); return; } } build(value, fullKey); }); stack.pop(); } else { formData.append(parentKey, convertValue(data)); } } build(obj); return formData; } module.exports = toFormData; /***/ }), /***/ "./node_modules/axios/lib/helpers/validator.js": /*!*****************************************************!*\ !*** ./node_modules/axios/lib/helpers/validator.js ***! \*****************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var VERSION = (__webpack_require__(/*! ../env/data */ "./node_modules/axios/lib/env/data.js").version); var AxiosError = __webpack_require__(/*! ../core/AxiosError */ "./node_modules/axios/lib/core/AxiosError.js"); var validators = {}; // eslint-disable-next-line func-names ['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) { validators[type] = function validator(thing) { return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; }; }); var deprecatedWarnings = {}; /** * Transitional option validator * @param {function|boolean?} validator - set to false if the transitional option has been removed * @param {string?} version - deprecated version / removed since version * @param {string?} message - some message with additional info * @returns {function} */ validators.transitional = function transitional(validator, version, message) { function formatMessage(opt, desc) { return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); } // eslint-disable-next-line func-names return function(value, opt, opts) { if (validator === false) { throw new AxiosError( formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')), AxiosError.ERR_DEPRECATED ); } if (version && !deprecatedWarnings[opt]) { deprecatedWarnings[opt] = true; // eslint-disable-next-line no-console console.warn( formatMessage( opt, ' has been deprecated since v' + version + ' and will be removed in the near future' ) ); } return validator ? validator(value, opt, opts) : true; }; }; /** * Assert object's properties type * @param {object} options * @param {object} schema * @param {boolean?} allowUnknown */ function assertOptions(options, schema, allowUnknown) { if (typeof options !== 'object') { throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE); } var keys = Object.keys(options); var i = keys.length; while (i-- > 0) { var opt = keys[i]; var validator = schema[opt]; if (validator) { var value = options[opt]; var result = value === undefined || validator(value, opt, options); if (result !== true) { throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE); } continue; } if (allowUnknown !== true) { throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION); } } } module.exports = { assertOptions: assertOptions, validators: validators }; /***/ }), /***/ "./node_modules/axios/lib/utils.js": /*!*****************************************!*\ !*** ./node_modules/axios/lib/utils.js ***! \*****************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var bind = __webpack_require__(/*! ./helpers/bind */ "./node_modules/axios/lib/helpers/bind.js"); // utils is a library of generic helper functions non-specific to axios var toString = Object.prototype.toString; // eslint-disable-next-line func-names var kindOf = (function(cache) { // eslint-disable-next-line func-names return function(thing) { var str = toString.call(thing); return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); }; })(Object.create(null)); function kindOfTest(type) { type = type.toLowerCase(); return function isKindOf(thing) { return kindOf(thing) === type; }; } /** * Determine if a value is an Array * * @param {Object} val The value to test * @returns {boolean} True if value is an Array, otherwise false */ function isArray(val) { return Array.isArray(val); } /** * Determine if a value is undefined * * @param {Object} val The value to test * @returns {boolean} True if the value is undefined, otherwise false */ function isUndefined(val) { return typeof val === 'undefined'; } /** * Determine if a value is a Buffer * * @param {Object} val The value to test * @returns {boolean} True if value is a Buffer, otherwise false */ function isBuffer(val) { return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val); } /** * Determine if a value is an ArrayBuffer * * @function * @param {Object} val The value to test * @returns {boolean} True if value is an ArrayBuffer, otherwise false */ var isArrayBuffer = kindOfTest('ArrayBuffer'); /** * Determine if a value is a view on an ArrayBuffer * * @param {Object} val The value to test * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false */ function isArrayBufferView(val) { var result; if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { result = ArrayBuffer.isView(val); } else { result = (val) && (val.buffer) && (isArrayBuffer(val.buffer)); } return result; } /** * Determine if a value is a String * * @param {Object} val The value to test * @returns {boolean} True if value is a String, otherwise false */ function isString(val) { return typeof val === 'string'; } /** * Determine if a value is a Number * * @param {Object} val The value to test * @returns {boolean} True if value is a Number, otherwise false */ function isNumber(val) { return typeof val === 'number'; } /** * Determine if a value is an Object * * @param {Object} val The value to test * @returns {boolean} True if value is an Object, otherwise false */ function isObject(val) { return val !== null && typeof val === 'object'; } /** * Determine if a value is a plain Object * * @param {Object} val The value to test * @return {boolean} True if value is a plain Object, otherwise false */ function isPlainObject(val) { if (kindOf(val) !== 'object') { return false; } var prototype = Object.getPrototypeOf(val); return prototype === null || prototype === Object.prototype; } /** * Determine if a value is a Date * * @function * @param {Object} val The value to test * @returns {boolean} True if value is a Date, otherwise false */ var isDate = kindOfTest('Date'); /** * Determine if a value is a File * * @function * @param {Object} val The value to test * @returns {boolean} True if value is a File, otherwise false */ var isFile = kindOfTest('File'); /** * Determine if a value is a Blob * * @function * @param {Object} val The value to test * @returns {boolean} True if value is a Blob, otherwise false */ var isBlob = kindOfTest('Blob'); /** * Determine if a value is a FileList * * @function * @param {Object} val The value to test * @returns {boolean} True if value is a File, otherwise false */ var isFileList = kindOfTest('FileList'); /** * Determine if a value is a Function * * @param {Object} val The value to test * @returns {boolean} True if value is a Function, otherwise false */ function isFunction(val) { return toString.call(val) === '[object Function]'; } /** * Determine if a value is a Stream * * @param {Object} val The value to test * @returns {boolean} True if value is a Stream, otherwise false */ function isStream(val) { return isObject(val) && isFunction(val.pipe); } /** * Determine if a value is a FormData * * @param {Object} thing The value to test * @returns {boolean} True if value is an FormData, otherwise false */ function isFormData(thing) { var pattern = '[object FormData]'; return thing && ( (typeof FormData === 'function' && thing instanceof FormData) || toString.call(thing) === pattern || (isFunction(thing.toString) && thing.toString() === pattern) ); } /** * Determine if a value is a URLSearchParams object * @function * @param {Object} val The value to test * @returns {boolean} True if value is a URLSearchParams object, otherwise false */ var isURLSearchParams = kindOfTest('URLSearchParams'); /** * Trim excess whitespace off the beginning and end of a string * * @param {String} str The String to trim * @returns {String} The String freed of excess whitespace */ function trim(str) { return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, ''); } /** * Determine if we're running in a standard browser environment * * This allows axios to run in a web worker, and react-native. * Both environments support XMLHttpRequest, but not fully standard globals. * * web workers: * typeof window -> undefined * typeof document -> undefined * * react-native: * navigator.product -> 'ReactNative' * nativescript * navigator.product -> 'NativeScript' or 'NS' */ function isStandardBrowserEnv() { if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || navigator.product === 'NativeScript' || navigator.product === 'NS')) { return false; } return ( typeof window !== 'undefined' && typeof document !== 'undefined' ); } /** * Iterate over an Array or an Object invoking a function for each item. * * If `obj` is an Array callback will be called passing * the value, index, and complete array for each item. * * If 'obj' is an Object callback will be called passing * the value, key, and complete object for each property. * * @param {Object|Array} obj The object to iterate * @param {Function} fn The callback to invoke for each item */ function forEach(obj, fn) { // Don't bother if no value provided if (obj === null || typeof obj === 'undefined') { return; } // Force an array if not already something iterable if (typeof obj !== 'object') { /*eslint no-param-reassign:0*/ obj = [obj]; } if (isArray(obj)) { // Iterate over array values for (var i = 0, l = obj.length; i < l; i++) { fn.call(null, obj[i], i, obj); } } else { // Iterate over object keys for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { fn.call(null, obj[key], key, obj); } } } } /** * Accepts varargs expecting each argument to be an object, then * immutably merges the properties of each object and returns result. * * When multiple objects contain the same key the later object in * the arguments list will take precedence. * * Example: * * ```js * var result = merge({foo: 123}, {foo: 456}); * console.log(result.foo); // outputs 456 * ``` * * @param {Object} obj1 Object to merge * @returns {Object} Result of all merge properties */ function merge(/* obj1, obj2, obj3, ... */) { var result = {}; function assignValue(val, key) { if (isPlainObject(result[key]) && isPlainObject(val)) { result[key] = merge(result[key], val); } else if (isPlainObject(val)) { result[key] = merge({}, val); } else if (isArray(val)) { result[key] = val.slice(); } else { result[key] = val; } } for (var i = 0, l = arguments.length; i < l; i++) { forEach(arguments[i], assignValue); } return result; } /** * Extends object a by mutably adding to it the properties of object b. * * @param {Object} a The object to be extended * @param {Object} b The object to copy properties from * @param {Object} thisArg The object to bind function to * @return {Object} The resulting value of object a */ function extend(a, b, thisArg) { forEach(b, function assignValue(val, key) { if (thisArg && typeof val === 'function') { a[key] = bind(val, thisArg); } else { a[key] = val; } }); return a; } /** * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) * * @param {string} content with BOM * @return {string} content value without BOM */ function stripBOM(content) { if (content.charCodeAt(0) === 0xFEFF) { content = content.slice(1); } return content; } /** * Inherit the prototype methods from one constructor into another * @param {function} constructor * @param {function} superConstructor * @param {object} [props] * @param {object} [descriptors] */ function inherits(constructor, superConstructor, props, descriptors) { constructor.prototype = Object.create(superConstructor.prototype, descriptors); constructor.prototype.constructor = constructor; props && Object.assign(constructor.prototype, props); } /** * Resolve object with deep prototype chain to a flat object * @param {Object} sourceObj source object * @param {Object} [destObj] * @param {Function} [filter] * @returns {Object} */ function toFlatObject(sourceObj, destObj, filter) { var props; var i; var prop; var merged = {}; destObj = destObj || {}; do { props = Object.getOwnPropertyNames(sourceObj); i = props.length; while (i-- > 0) { prop = props[i]; if (!merged[prop]) { destObj[prop] = sourceObj[prop]; merged[prop] = true; } } sourceObj = Object.getPrototypeOf(sourceObj); } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype); return destObj; } /* * determines whether a string ends with the characters of a specified string * @param {String} str * @param {String} searchString * @param {Number} [position= 0] * @returns {boolean} */ function endsWith(str, searchString, position) { str = String(str); if (position === undefined || position > str.length) { position = str.length; } position -= searchString.length; var lastIndex = str.indexOf(searchString, position); return lastIndex !== -1 && lastIndex === position; } /** * Returns new array from array like object * @param {*} [thing] * @returns {Array} */ function toArray(thing) { if (!thing) return null; var i = thing.length; if (isUndefined(i)) return null; var arr = new Array(i); while (i-- > 0) { arr[i] = thing[i]; } return arr; } // eslint-disable-next-line func-names var isTypedArray = (function(TypedArray) { // eslint-disable-next-line func-names return function(thing) { return TypedArray && thing instanceof TypedArray; }; })(typeof Uint8Array !== 'undefined' && Object.getPrototypeOf(Uint8Array)); module.exports = { isArray: isArray, isArrayBuffer: isArrayBuffer, isBuffer: isBuffer, isFormData: isFormData, isArrayBufferView: isArrayBufferView, isString: isString, isNumber: isNumber, isObject: isObject, isPlainObject: isPlainObject, isUndefined: isUndefined, isDate: isDate, isFile: isFile, isBlob: isBlob, isFunction: isFunction, isStream: isStream, isURLSearchParams: isURLSearchParams, isStandardBrowserEnv: isStandardBrowserEnv, forEach: forEach, merge: merge, extend: extend, trim: trim, stripBOM: stripBOM, inherits: inherits, toFlatObject: toFlatObject, kindOf: kindOf, kindOfTest: kindOfTest, endsWith: endsWith, toArray: toArray, isTypedArray: isTypedArray, isFileList: isFileList }; /***/ }), /***/ "./node_modules/content-type/index.js": /*!********************************************!*\ !*** ./node_modules/content-type/index.js ***! \********************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; /*! * content-type * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed */ /** * RegExp to match *( ";" parameter ) in RFC 7231 sec 3.1.1.1 * * parameter = token "=" ( token / quoted-string ) * token = 1*tchar * tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*" * / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~" * / DIGIT / ALPHA * ; any VCHAR, except delimiters * quoted-string = DQUOTE *( qdtext / quoted-pair ) DQUOTE * qdtext = HTAB / SP / %x21 / %x23-5B / %x5D-7E / obs-text * obs-text = %x80-FF * quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text ) */ var PARAM_REGEXP = /; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g // eslint-disable-line no-control-regex var TEXT_REGEXP = /^[\u000b\u0020-\u007e\u0080-\u00ff]+$/ // eslint-disable-line no-control-regex var TOKEN_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/ /** * RegExp to match quoted-pair in RFC 7230 sec 3.2.6 * * quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text ) * obs-text = %x80-FF */ var QESC_REGEXP = /\\([\u000b\u0020-\u00ff])/g // eslint-disable-line no-control-regex /** * RegExp to match chars that must be quoted-pair in RFC 7230 sec 3.2.6 */ var QUOTE_REGEXP = /([\\"])/g /** * RegExp to match type in RFC 7231 sec 3.1.1.1 * * media-type = type "/" subtype * type = token * subtype = token */ var TYPE_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/ /** * Module exports. * @public */ exports.format = format exports.parse = parse /** * Format object to media type. * * @param {object} obj * @return {string} * @public */ function format (obj) { if (!obj || typeof obj !== 'object') { throw new TypeError('argument obj is required') } var parameters = obj.parameters var type = obj.type if (!type || !TYPE_REGEXP.test(type)) { throw new TypeError('invalid type') } var string = type // append parameters if (parameters && typeof parameters === 'object') { var param var params = Object.keys(parameters).sort() for (var i = 0; i < params.length; i++) { param = params[i] if (!TOKEN_REGEXP.test(param)) { throw new TypeError('invalid parameter name') } string += '; ' + param + '=' + qstring(parameters[param]) } } return string } /** * Parse media type to object. * * @param {string|object} string * @return {Object} * @public */ function parse (string) { if (!string) { throw new TypeError('argument string is required') } // support req/res-like objects as argument var header = typeof string === 'object' ? getcontenttype(string) : string if (typeof header !== 'string') { throw new TypeError('argument string is required to be a string') } var index = header.indexOf(';') var type = index !== -1 ? header.slice(0, index).trim() : header.trim() if (!TYPE_REGEXP.test(type)) { throw new TypeError('invalid media type') } var obj = new ContentType(type.toLowerCase()) // parse parameters if (index !== -1) { var key var match var value PARAM_REGEXP.lastIndex = index while ((match = PARAM_REGEXP.exec(header))) { if (match.index !== index) { throw new TypeError('invalid parameter format') } index += match[0].length key = match[1].toLowerCase() value = match[2] if (value.charCodeAt(0) === 0x22 /* " */) { // remove quotes value = value.slice(1, -1) // remove escapes if (value.indexOf('\\') !== -1) { value = value.replace(QESC_REGEXP, '$1') } } obj.parameters[key] = value } if (index !== header.length) { throw new TypeError('invalid parameter format') } } return obj } /** * Get content-type from req/res objects. * * @param {object} * @return {Object} * @private */ function getcontenttype (obj) { var header if (typeof obj.getHeader === 'function') { // res-like header = obj.getHeader('content-type') } else if (typeof obj.headers === 'object') { // req-like header = obj.headers && obj.headers['content-type'] } if (typeof header !== 'string') { throw new TypeError('content-type header is missing from object') } return header } /** * Quote a string if necessary. * * @param {string} val * @return {string} * @private */ function qstring (val) { var str = String(val) // no need to quote tokens if (TOKEN_REGEXP.test(str)) { return str } if (str.length > 0 && !TEXT_REGEXP.test(str)) { throw new TypeError('invalid parameter value') } return '"' + str.replace(QUOTE_REGEXP, '\\$1') + '"' } /** * Class to represent a content type. * @private */ function ContentType (type) { this.parameters = Object.create(null) this.type = type } /***/ }), /***/ "./node_modules/crypto-js/aes.js": /*!***************************************!*\ !*** ./node_modules/crypto-js/aes.js ***! \***************************************/ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./enc-base64 */ "./node_modules/crypto-js/enc-base64.js"), __webpack_require__(/*! ./md5 */ "./node_modules/crypto-js/md5.js"), __webpack_require__(/*! ./evpkdf */ "./node_modules/crypto-js/evpkdf.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); } else {} }(this, function (CryptoJS) { (function () { // Shortcuts var C = CryptoJS; var C_lib = C.lib; var BlockCipher = C_lib.BlockCipher; var C_algo = C.algo; // Lookup tables var SBOX = []; var INV_SBOX = []; var SUB_MIX_0 = []; var SUB_MIX_1 = []; var SUB_MIX_2 = []; var SUB_MIX_3 = []; var INV_SUB_MIX_0 = []; var INV_SUB_MIX_1 = []; var INV_SUB_MIX_2 = []; var INV_SUB_MIX_3 = []; // Compute lookup tables (function () { // Compute double table var d = []; for (var i = 0; i < 256; i++) { if (i < 128) { d[i] = i << 1; } else { d[i] = (i << 1) ^ 0x11b; } } // Walk GF(2^8) var x = 0; var xi = 0; for (var i = 0; i < 256; i++) { // Compute sbox var sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4); sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63; SBOX[x] = sx; INV_SBOX[sx] = x; // Compute multiplication var x2 = d[x]; var x4 = d[x2]; var x8 = d[x4]; // Compute sub bytes, mix columns tables var t = (d[sx] * 0x101) ^ (sx * 0x1010100); SUB_MIX_0[x] = (t << 24) | (t >>> 8); SUB_MIX_1[x] = (t << 16) | (t >>> 16); SUB_MIX_2[x] = (t << 8) | (t >>> 24); SUB_MIX_3[x] = t; // Compute inv sub bytes, inv mix columns tables var t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100); INV_SUB_MIX_0[sx] = (t << 24) | (t >>> 8); INV_SUB_MIX_1[sx] = (t << 16) | (t >>> 16); INV_SUB_MIX_2[sx] = (t << 8) | (t >>> 24); INV_SUB_MIX_3[sx] = t; // Compute next counter if (!x) { x = xi = 1; } else { x = x2 ^ d[d[d[x8 ^ x2]]]; xi ^= d[d[xi]]; } } }()); // Precomputed Rcon lookup var RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36]; /** * AES block cipher algorithm. */ var AES = C_algo.AES = BlockCipher.extend({ _doReset: function () { var t; // Skip reset of nRounds has been set before and key did not change if (this._nRounds && this._keyPriorReset === this._key) { return; } // Shortcuts var key = this._keyPriorReset = this._key; var keyWords = key.words; var keySize = key.sigBytes / 4; // Compute number of rounds var nRounds = this._nRounds = keySize + 6; // Compute number of key schedule rows var ksRows = (nRounds + 1) * 4; // Compute key schedule var keySchedule = this._keySchedule = []; for (var ksRow = 0; ksRow < ksRows; ksRow++) { if (ksRow < keySize) { keySchedule[ksRow] = keyWords[ksRow]; } else { t = keySchedule[ksRow - 1]; if (!(ksRow % keySize)) { // Rot word t = (t << 8) | (t >>> 24); // Sub word t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff]; // Mix Rcon t ^= RCON[(ksRow / keySize) | 0] << 24; } else if (keySize > 6 && ksRow % keySize == 4) { // Sub word t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff]; } keySchedule[ksRow] = keySchedule[ksRow - keySize] ^ t; } } // Compute inv key schedule var invKeySchedule = this._invKeySchedule = []; for (var invKsRow = 0; invKsRow < ksRows; invKsRow++) { var ksRow = ksRows - invKsRow; if (invKsRow % 4) { var t = keySchedule[ksRow]; } else { var t = keySchedule[ksRow - 4]; } if (invKsRow < 4 || ksRow <= 4) { invKeySchedule[invKsRow] = t; } else { invKeySchedule[invKsRow] = INV_SUB_MIX_0[SBOX[t >>> 24]] ^ INV_SUB_MIX_1[SBOX[(t >>> 16) & 0xff]] ^ INV_SUB_MIX_2[SBOX[(t >>> 8) & 0xff]] ^ INV_SUB_MIX_3[SBOX[t & 0xff]]; } } }, encryptBlock: function (M, offset) { this._doCryptBlock(M, offset, this._keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX); }, decryptBlock: function (M, offset) { // Swap 2nd and 4th rows var t = M[offset + 1]; M[offset + 1] = M[offset + 3]; M[offset + 3] = t; this._doCryptBlock(M, offset, this._invKeySchedule, INV_SUB_MIX_0, INV_SUB_MIX_1, INV_SUB_MIX_2, INV_SUB_MIX_3, INV_SBOX); // Inv swap 2nd and 4th rows var t = M[offset + 1]; M[offset + 1] = M[offset + 3]; M[offset + 3] = t; }, _doCryptBlock: function (M, offset, keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX) { // Shortcut var nRounds = this._nRounds; // Get input, add round key var s0 = M[offset] ^ keySchedule[0]; var s1 = M[offset + 1] ^ keySchedule[1]; var s2 = M[offset + 2] ^ keySchedule[2]; var s3 = M[offset + 3] ^ keySchedule[3]; // Key schedule row counter var ksRow = 4; // Rounds for (var round = 1; round < nRounds; round++) { // Shift rows, sub bytes, mix columns, add round key var t0 = SUB_MIX_0[s0 >>> 24] ^ SUB_MIX_1[(s1 >>> 16) & 0xff] ^ SUB_MIX_2[(s2 >>> 8) & 0xff] ^ SUB_MIX_3[s3 & 0xff] ^ keySchedule[ksRow++]; var t1 = SUB_MIX_0[s1 >>> 24] ^ SUB_MIX_1[(s2 >>> 16) & 0xff] ^ SUB_MIX_2[(s3 >>> 8) & 0xff] ^ SUB_MIX_3[s0 & 0xff] ^ keySchedule[ksRow++]; var t2 = SUB_MIX_0[s2 >>> 24] ^ SUB_MIX_1[(s3 >>> 16) & 0xff] ^ SUB_MIX_2[(s0 >>> 8) & 0xff] ^ SUB_MIX_3[s1 & 0xff] ^ keySchedule[ksRow++]; var t3 = SUB_MIX_0[s3 >>> 24] ^ SUB_MIX_1[(s0 >>> 16) & 0xff] ^ SUB_MIX_2[(s1 >>> 8) & 0xff] ^ SUB_MIX_3[s2 & 0xff] ^ keySchedule[ksRow++]; // Update state s0 = t0; s1 = t1; s2 = t2; s3 = t3; } // Shift rows, sub bytes, add round key var t0 = ((SBOX[s0 >>> 24] << 24) | (SBOX[(s1 >>> 16) & 0xff] << 16) | (SBOX[(s2 >>> 8) & 0xff] << 8) | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++]; var t1 = ((SBOX[s1 >>> 24] << 24) | (SBOX[(s2 >>> 16) & 0xff] << 16) | (SBOX[(s3 >>> 8) & 0xff] << 8) | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++]; var t2 = ((SBOX[s2 >>> 24] << 24) | (SBOX[(s3 >>> 16) & 0xff] << 16) | (SBOX[(s0 >>> 8) & 0xff] << 8) | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++]; var t3 = ((SBOX[s3 >>> 24] << 24) | (SBOX[(s0 >>> 16) & 0xff] << 16) | (SBOX[(s1 >>> 8) & 0xff] << 8) | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++]; // Set output M[offset] = t0; M[offset + 1] = t1; M[offset + 2] = t2; M[offset + 3] = t3; }, keySize: 256/32 }); /** * Shortcut functions to the cipher's object interface. * * @example * * var ciphertext = CryptoJS.AES.encrypt(message, key, cfg); * var plaintext = CryptoJS.AES.decrypt(ciphertext, key, cfg); */ C.AES = BlockCipher._createHelper(AES); }()); return CryptoJS.AES; })); /***/ }), /***/ "./node_modules/crypto-js/blowfish.js": /*!********************************************!*\ !*** ./node_modules/crypto-js/blowfish.js ***! \********************************************/ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./enc-base64 */ "./node_modules/crypto-js/enc-base64.js"), __webpack_require__(/*! ./md5 */ "./node_modules/crypto-js/md5.js"), __webpack_require__(/*! ./evpkdf */ "./node_modules/crypto-js/evpkdf.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); } else {} }(this, function (CryptoJS) { (function () { // Shortcuts var C = CryptoJS; var C_lib = C.lib; var BlockCipher = C_lib.BlockCipher; var C_algo = C.algo; const N = 16; //Origin pbox and sbox, derived from PI const ORIG_P = [ 0x243F6A88, 0x85A308D3, 0x13198A2E, 0x03707344, 0xA4093822, 0x299F31D0, 0x082EFA98, 0xEC4E6C89, 0x452821E6, 0x38D01377, 0xBE5466CF, 0x34E90C6C, 0xC0AC29B7, 0xC97C50DD, 0x3F84D5B5, 0xB5470917, 0x9216D5D9, 0x8979FB1B ]; const ORIG_S = [ [ 0xD1310BA6, 0x98DFB5AC, 0x2FFD72DB, 0xD01ADFB7, 0xB8E1AFED, 0x6A267E96, 0xBA7C9045, 0xF12C7F99, 0x24A19947, 0xB3916CF7, 0x0801F2E2, 0x858EFC16, 0x636920D8, 0x71574E69, 0xA458FEA3, 0xF4933D7E, 0x0D95748F, 0x728EB658, 0x718BCD58, 0x82154AEE, 0x7B54A41D, 0xC25A59B5, 0x9C30D539, 0x2AF26013, 0xC5D1B023, 0x286085F0, 0xCA417918, 0xB8DB38EF, 0x8E79DCB0, 0x603A180E, 0x6C9E0E8B, 0xB01E8A3E, 0xD71577C1, 0xBD314B27, 0x78AF2FDA, 0x55605C60, 0xE65525F3, 0xAA55AB94, 0x57489862, 0x63E81440, 0x55CA396A, 0x2AAB10B6, 0xB4CC5C34, 0x1141E8CE, 0xA15486AF, 0x7C72E993, 0xB3EE1411, 0x636FBC2A, 0x2BA9C55D, 0x741831F6, 0xCE5C3E16, 0x9B87931E, 0xAFD6BA33, 0x6C24CF5C, 0x7A325381, 0x28958677, 0x3B8F4898, 0x6B4BB9AF, 0xC4BFE81B, 0x66282193, 0x61D809CC, 0xFB21A991, 0x487CAC60, 0x5DEC8032, 0xEF845D5D, 0xE98575B1, 0xDC262302, 0xEB651B88, 0x23893E81, 0xD396ACC5, 0x0F6D6FF3, 0x83F44239, 0x2E0B4482, 0xA4842004, 0x69C8F04A, 0x9E1F9B5E, 0x21C66842, 0xF6E96C9A, 0x670C9C61, 0xABD388F0, 0x6A51A0D2, 0xD8542F68, 0x960FA728, 0xAB5133A3, 0x6EEF0B6C, 0x137A3BE4, 0xBA3BF050, 0x7EFB2A98, 0xA1F1651D, 0x39AF0176, 0x66CA593E, 0x82430E88, 0x8CEE8619, 0x456F9FB4, 0x7D84A5C3, 0x3B8B5EBE, 0xE06F75D8, 0x85C12073, 0x401A449F, 0x56C16AA6, 0x4ED3AA62, 0x363F7706, 0x1BFEDF72, 0x429B023D, 0x37D0D724, 0xD00A1248, 0xDB0FEAD3, 0x49F1C09B, 0x075372C9, 0x80991B7B, 0x25D479D8, 0xF6E8DEF7, 0xE3FE501A, 0xB6794C3B, 0x976CE0BD, 0x04C006BA, 0xC1A94FB6, 0x409F60C4, 0x5E5C9EC2, 0x196A2463, 0x68FB6FAF, 0x3E6C53B5, 0x1339B2EB, 0x3B52EC6F, 0x6DFC511F, 0x9B30952C, 0xCC814544, 0xAF5EBD09, 0xBEE3D004, 0xDE334AFD, 0x660F2807, 0x192E4BB3, 0xC0CBA857, 0x45C8740F, 0xD20B5F39, 0xB9D3FBDB, 0x5579C0BD, 0x1A60320A, 0xD6A100C6, 0x402C7279, 0x679F25FE, 0xFB1FA3CC, 0x8EA5E9F8, 0xDB3222F8, 0x3C7516DF, 0xFD616B15, 0x2F501EC8, 0xAD0552AB, 0x323DB5FA, 0xFD238760, 0x53317B48, 0x3E00DF82, 0x9E5C57BB, 0xCA6F8CA0, 0x1A87562E, 0xDF1769DB, 0xD542A8F6, 0x287EFFC3, 0xAC6732C6, 0x8C4F5573, 0x695B27B0, 0xBBCA58C8, 0xE1FFA35D, 0xB8F011A0, 0x10FA3D98, 0xFD2183B8, 0x4AFCB56C, 0x2DD1D35B, 0x9A53E479, 0xB6F84565, 0xD28E49BC, 0x4BFB9790, 0xE1DDF2DA, 0xA4CB7E33, 0x62FB1341, 0xCEE4C6E8, 0xEF20CADA, 0x36774C01, 0xD07E9EFE, 0x2BF11FB4, 0x95DBDA4D, 0xAE909198, 0xEAAD8E71, 0x6B93D5A0, 0xD08ED1D0, 0xAFC725E0, 0x8E3C5B2F, 0x8E7594B7, 0x8FF6E2FB, 0xF2122B64, 0x8888B812, 0x900DF01C, 0x4FAD5EA0, 0x688FC31C, 0xD1CFF191, 0xB3A8C1AD, 0x2F2F2218, 0xBE0E1777, 0xEA752DFE, 0x8B021FA1, 0xE5A0CC0F, 0xB56F74E8, 0x18ACF3D6, 0xCE89E299, 0xB4A84FE0, 0xFD13E0B7, 0x7CC43B81, 0xD2ADA8D9, 0x165FA266, 0x80957705, 0x93CC7314, 0x211A1477, 0xE6AD2065, 0x77B5FA86, 0xC75442F5, 0xFB9D35CF, 0xEBCDAF0C, 0x7B3E89A0, 0xD6411BD3, 0xAE1E7E49, 0x00250E2D, 0x2071B35E, 0x226800BB, 0x57B8E0AF, 0x2464369B, 0xF009B91E, 0x5563911D, 0x59DFA6AA, 0x78C14389, 0xD95A537F, 0x207D5BA2, 0x02E5B9C5, 0x83260376, 0x6295CFA9, 0x11C81968, 0x4E734A41, 0xB3472DCA, 0x7B14A94A, 0x1B510052, 0x9A532915, 0xD60F573F, 0xBC9BC6E4, 0x2B60A476, 0x81E67400, 0x08BA6FB5, 0x571BE91F, 0xF296EC6B, 0x2A0DD915, 0xB6636521, 0xE7B9F9B6, 0xFF34052E, 0xC5855664, 0x53B02D5D, 0xA99F8FA1, 0x08BA4799, 0x6E85076A ], [ 0x4B7A70E9, 0xB5B32944, 0xDB75092E, 0xC4192623, 0xAD6EA6B0, 0x49A7DF7D, 0x9CEE60B8, 0x8FEDB266, 0xECAA8C71, 0x699A17FF, 0x5664526C, 0xC2B19EE1, 0x193602A5, 0x75094C29, 0xA0591340, 0xE4183A3E, 0x3F54989A, 0x5B429D65, 0x6B8FE4D6, 0x99F73FD6, 0xA1D29C07, 0xEFE830F5, 0x4D2D38E6, 0xF0255DC1, 0x4CDD2086, 0x8470EB26, 0x6382E9C6, 0x021ECC5E, 0x09686B3F, 0x3EBAEFC9, 0x3C971814, 0x6B6A70A1, 0x687F3584, 0x52A0E286, 0xB79C5305, 0xAA500737, 0x3E07841C, 0x7FDEAE5C, 0x8E7D44EC, 0x5716F2B8, 0xB03ADA37, 0xF0500C0D, 0xF01C1F04, 0x0200B3FF, 0xAE0CF51A, 0x3CB574B2, 0x25837A58, 0xDC0921BD, 0xD19113F9, 0x7CA92FF6, 0x94324773, 0x22F54701, 0x3AE5E581, 0x37C2DADC, 0xC8B57634, 0x9AF3DDA7, 0xA9446146, 0x0FD0030E, 0xECC8C73E, 0xA4751E41, 0xE238CD99, 0x3BEA0E2F, 0x3280BBA1, 0x183EB331, 0x4E548B38, 0x4F6DB908, 0x6F420D03, 0xF60A04BF, 0x2CB81290, 0x24977C79, 0x5679B072, 0xBCAF89AF, 0xDE9A771F, 0xD9930810, 0xB38BAE12, 0xDCCF3F2E, 0x5512721F, 0x2E6B7124, 0x501ADDE6, 0x9F84CD87, 0x7A584718, 0x7408DA17, 0xBC9F9ABC, 0xE94B7D8C, 0xEC7AEC3A, 0xDB851DFA, 0x63094366, 0xC464C3D2, 0xEF1C1847, 0x3215D908, 0xDD433B37, 0x24C2BA16, 0x12A14D43, 0x2A65C451, 0x50940002, 0x133AE4DD, 0x71DFF89E, 0x10314E55, 0x81AC77D6, 0x5F11199B, 0x043556F1, 0xD7A3C76B, 0x3C11183B, 0x5924A509, 0xF28FE6ED, 0x97F1FBFA, 0x9EBABF2C, 0x1E153C6E, 0x86E34570, 0xEAE96FB1, 0x860E5E0A, 0x5A3E2AB3, 0x771FE71C, 0x4E3D06FA, 0x2965DCB9, 0x99E71D0F, 0x803E89D6, 0x5266C825, 0x2E4CC978, 0x9C10B36A, 0xC6150EBA, 0x94E2EA78, 0xA5FC3C53, 0x1E0A2DF4, 0xF2F74EA7, 0x361D2B3D, 0x1939260F, 0x19C27960, 0x5223A708, 0xF71312B6, 0xEBADFE6E, 0xEAC31F66, 0xE3BC4595, 0xA67BC883, 0xB17F37D1, 0x018CFF28, 0xC332DDEF, 0xBE6C5AA5, 0x65582185, 0x68AB9802, 0xEECEA50F, 0xDB2F953B, 0x2AEF7DAD, 0x5B6E2F84, 0x1521B628, 0x29076170, 0xECDD4775, 0x619F1510, 0x13CCA830, 0xEB61BD96, 0x0334FE1E, 0xAA0363CF, 0xB5735C90, 0x4C70A239, 0xD59E9E0B, 0xCBAADE14, 0xEECC86BC, 0x60622CA7, 0x9CAB5CAB, 0xB2F3846E, 0x648B1EAF, 0x19BDF0CA, 0xA02369B9, 0x655ABB50, 0x40685A32, 0x3C2AB4B3, 0x319EE9D5, 0xC021B8F7, 0x9B540B19, 0x875FA099, 0x95F7997E, 0x623D7DA8, 0xF837889A, 0x97E32D77, 0x11ED935F, 0x16681281, 0x0E358829, 0xC7E61FD6, 0x96DEDFA1, 0x7858BA99, 0x57F584A5, 0x1B227263, 0x9B83C3FF, 0x1AC24696, 0xCDB30AEB, 0x532E3054, 0x8FD948E4, 0x6DBC3128, 0x58EBF2EF, 0x34C6FFEA, 0xFE28ED61, 0xEE7C3C73, 0x5D4A14D9, 0xE864B7E3, 0x42105D14, 0x203E13E0, 0x45EEE2B6, 0xA3AAABEA, 0xDB6C4F15, 0xFACB4FD0, 0xC742F442, 0xEF6ABBB5, 0x654F3B1D, 0x41CD2105, 0xD81E799E, 0x86854DC7, 0xE44B476A, 0x3D816250, 0xCF62A1F2, 0x5B8D2646, 0xFC8883A0, 0xC1C7B6A3, 0x7F1524C3, 0x69CB7492, 0x47848A0B, 0x5692B285, 0x095BBF00, 0xAD19489D, 0x1462B174, 0x23820E00, 0x58428D2A, 0x0C55F5EA, 0x1DADF43E, 0x233F7061, 0x3372F092, 0x8D937E41, 0xD65FECF1, 0x6C223BDB, 0x7CDE3759, 0xCBEE7460, 0x4085F2A7, 0xCE77326E, 0xA6078084, 0x19F8509E, 0xE8EFD855, 0x61D99735, 0xA969A7AA, 0xC50C06C2, 0x5A04ABFC, 0x800BCADC, 0x9E447A2E, 0xC3453484, 0xFDD56705, 0x0E1E9EC9, 0xDB73DBD3, 0x105588CD, 0x675FDA79, 0xE3674340, 0xC5C43465, 0x713E38D8, 0x3D28F89E, 0xF16DFF20, 0x153E21E7, 0x8FB03D4A, 0xE6E39F2B, 0xDB83ADF7 ], [ 0xE93D5A68, 0x948140F7, 0xF64C261C, 0x94692934, 0x411520F7, 0x7602D4F7, 0xBCF46B2E, 0xD4A20068, 0xD4082471, 0x3320F46A, 0x43B7D4B7, 0x500061AF, 0x1E39F62E, 0x97244546, 0x14214F74, 0xBF8B8840, 0x4D95FC1D, 0x96B591AF, 0x70F4DDD3, 0x66A02F45, 0xBFBC09EC, 0x03BD9785, 0x7FAC6DD0, 0x31CB8504, 0x96EB27B3, 0x55FD3941, 0xDA2547E6, 0xABCA0A9A, 0x28507825, 0x530429F4, 0x0A2C86DA, 0xE9B66DFB, 0x68DC1462, 0xD7486900, 0x680EC0A4, 0x27A18DEE, 0x4F3FFEA2, 0xE887AD8C, 0xB58CE006, 0x7AF4D6B6, 0xAACE1E7C, 0xD3375FEC, 0xCE78A399, 0x406B2A42, 0x20FE9E35, 0xD9F385B9, 0xEE39D7AB, 0x3B124E8B, 0x1DC9FAF7, 0x4B6D1856, 0x26A36631, 0xEAE397B2, 0x3A6EFA74, 0xDD5B4332, 0x6841E7F7, 0xCA7820FB, 0xFB0AF54E, 0xD8FEB397, 0x454056AC, 0xBA489527, 0x55533A3A, 0x20838D87, 0xFE6BA9B7, 0xD096954B, 0x55A867BC, 0xA1159A58, 0xCCA92963, 0x99E1DB33, 0xA62A4A56, 0x3F3125F9, 0x5EF47E1C, 0x9029317C, 0xFDF8E802, 0x04272F70, 0x80BB155C, 0x05282CE3, 0x95C11548, 0xE4C66D22, 0x48C1133F, 0xC70F86DC, 0x07F9C9EE, 0x41041F0F, 0x404779A4, 0x5D886E17, 0x325F51EB, 0xD59BC0D1, 0xF2BCC18F, 0x41113564, 0x257B7834, 0x602A9C60, 0xDFF8E8A3, 0x1F636C1B, 0x0E12B4C2, 0x02E1329E, 0xAF664FD1, 0xCAD18115, 0x6B2395E0, 0x333E92E1, 0x3B240B62, 0xEEBEB922, 0x85B2A20E, 0xE6BA0D99, 0xDE720C8C, 0x2DA2F728, 0xD0127845, 0x95B794FD, 0x647D0862, 0xE7CCF5F0, 0x5449A36F, 0x877D48FA, 0xC39DFD27, 0xF33E8D1E, 0x0A476341, 0x992EFF74, 0x3A6F6EAB, 0xF4F8FD37, 0xA812DC60, 0xA1EBDDF8, 0x991BE14C, 0xDB6E6B0D, 0xC67B5510, 0x6D672C37, 0x2765D43B, 0xDCD0E804, 0xF1290DC7, 0xCC00FFA3, 0xB5390F92, 0x690FED0B, 0x667B9FFB, 0xCEDB7D9C, 0xA091CF0B, 0xD9155EA3, 0xBB132F88, 0x515BAD24, 0x7B9479BF, 0x763BD6EB, 0x37392EB3, 0xCC115979, 0x8026E297, 0xF42E312D, 0x6842ADA7, 0xC66A2B3B, 0x12754CCC, 0x782EF11C, 0x6A124237, 0xB79251E7, 0x06A1BBE6, 0x4BFB6350, 0x1A6B1018, 0x11CAEDFA, 0x3D25BDD8, 0xE2E1C3C9, 0x44421659, 0x0A121386, 0xD90CEC6E, 0xD5ABEA2A, 0x64AF674E, 0xDA86A85F, 0xBEBFE988, 0x64E4C3FE, 0x9DBC8057, 0xF0F7C086, 0x60787BF8, 0x6003604D, 0xD1FD8346, 0xF6381FB0, 0x7745AE04, 0xD736FCCC, 0x83426B33, 0xF01EAB71, 0xB0804187, 0x3C005E5F, 0x77A057BE, 0xBDE8AE24, 0x55464299, 0xBF582E61, 0x4E58F48F, 0xF2DDFDA2, 0xF474EF38, 0x8789BDC2, 0x5366F9C3, 0xC8B38E74, 0xB475F255, 0x46FCD9B9, 0x7AEB2661, 0x8B1DDF84, 0x846A0E79, 0x915F95E2, 0x466E598E, 0x20B45770, 0x8CD55591, 0xC902DE4C, 0xB90BACE1, 0xBB8205D0, 0x11A86248, 0x7574A99E, 0xB77F19B6, 0xE0A9DC09, 0x662D09A1, 0xC4324633, 0xE85A1F02, 0x09F0BE8C, 0x4A99A025, 0x1D6EFE10, 0x1AB93D1D, 0x0BA5A4DF, 0xA186F20F, 0x2868F169, 0xDCB7DA83, 0x573906FE, 0xA1E2CE9B, 0x4FCD7F52, 0x50115E01, 0xA70683FA, 0xA002B5C4, 0x0DE6D027, 0x9AF88C27, 0x773F8641, 0xC3604C06, 0x61A806B5, 0xF0177A28, 0xC0F586E0, 0x006058AA, 0x30DC7D62, 0x11E69ED7, 0x2338EA63, 0x53C2DD94, 0xC2C21634, 0xBBCBEE56, 0x90BCB6DE, 0xEBFC7DA1, 0xCE591D76, 0x6F05E409, 0x4B7C0188, 0x39720A3D, 0x7C927C24, 0x86E3725F, 0x724D9DB9, 0x1AC15BB4, 0xD39EB8FC, 0xED545578, 0x08FCA5B5, 0xD83D7CD3, 0x4DAD0FC4, 0x1E50EF5E, 0xB161E6F8, 0xA28514D9, 0x6C51133C, 0x6FD5C7E7, 0x56E14EC4, 0x362ABFCE, 0xDDC6C837, 0xD79A3234, 0x92638212, 0x670EFA8E, 0x406000E0 ], [ 0x3A39CE37, 0xD3FAF5CF, 0xABC27737, 0x5AC52D1B, 0x5CB0679E, 0x4FA33742, 0xD3822740, 0x99BC9BBE, 0xD5118E9D, 0xBF0F7315, 0xD62D1C7E, 0xC700C47B, 0xB78C1B6B, 0x21A19045, 0xB26EB1BE, 0x6A366EB4, 0x5748AB2F, 0xBC946E79, 0xC6A376D2, 0x6549C2C8, 0x530FF8EE, 0x468DDE7D, 0xD5730A1D, 0x4CD04DC6, 0x2939BBDB, 0xA9BA4650, 0xAC9526E8, 0xBE5EE304, 0xA1FAD5F0, 0x6A2D519A, 0x63EF8CE2, 0x9A86EE22, 0xC089C2B8, 0x43242EF6, 0xA51E03AA, 0x9CF2D0A4, 0x83C061BA, 0x9BE96A4D, 0x8FE51550, 0xBA645BD6, 0x2826A2F9, 0xA73A3AE1, 0x4BA99586, 0xEF5562E9, 0xC72FEFD3, 0xF752F7DA, 0x3F046F69, 0x77FA0A59, 0x80E4A915, 0x87B08601, 0x9B09E6AD, 0x3B3EE593, 0xE990FD5A, 0x9E34D797, 0x2CF0B7D9, 0x022B8B51, 0x96D5AC3A, 0x017DA67D, 0xD1CF3ED6, 0x7C7D2D28, 0x1F9F25CF, 0xADF2B89B, 0x5AD6B472, 0x5A88F54C, 0xE029AC71, 0xE019A5E6, 0x47B0ACFD, 0xED93FA9B, 0xE8D3C48D, 0x283B57CC, 0xF8D56629, 0x79132E28, 0x785F0191, 0xED756055, 0xF7960E44, 0xE3D35E8C, 0x15056DD4, 0x88F46DBA, 0x03A16125, 0x0564F0BD, 0xC3EB9E15, 0x3C9057A2, 0x97271AEC, 0xA93A072A, 0x1B3F6D9B, 0x1E6321F5, 0xF59C66FB, 0x26DCF319, 0x7533D928, 0xB155FDF5, 0x03563482, 0x8ABA3CBB, 0x28517711, 0xC20AD9F8, 0xABCC5167, 0xCCAD925F, 0x4DE81751, 0x3830DC8E, 0x379D5862, 0x9320F991, 0xEA7A90C2, 0xFB3E7BCE, 0x5121CE64, 0x774FBE32, 0xA8B6E37E, 0xC3293D46, 0x48DE5369, 0x6413E680, 0xA2AE0810, 0xDD6DB224, 0x69852DFD, 0x09072166, 0xB39A460A, 0x6445C0DD, 0x586CDECF, 0x1C20C8AE, 0x5BBEF7DD, 0x1B588D40, 0xCCD2017F, 0x6BB4E3BB, 0xDDA26A7E, 0x3A59FF45, 0x3E350A44, 0xBCB4CDD5, 0x72EACEA8, 0xFA6484BB, 0x8D6612AE, 0xBF3C6F47, 0xD29BE463, 0x542F5D9E, 0xAEC2771B, 0xF64E6370, 0x740E0D8D, 0xE75B1357, 0xF8721671, 0xAF537D5D, 0x4040CB08, 0x4EB4E2CC, 0x34D2466A, 0x0115AF84, 0xE1B00428, 0x95983A1D, 0x06B89FB4, 0xCE6EA048, 0x6F3F3B82, 0x3520AB82, 0x011A1D4B, 0x277227F8, 0x611560B1, 0xE7933FDC, 0xBB3A792B, 0x344525BD, 0xA08839E1, 0x51CE794B, 0x2F32C9B7, 0xA01FBAC9, 0xE01CC87E, 0xBCC7D1F6, 0xCF0111C3, 0xA1E8AAC7, 0x1A908749, 0xD44FBD9A, 0xD0DADECB, 0xD50ADA38, 0x0339C32A, 0xC6913667, 0x8DF9317C, 0xE0B12B4F, 0xF79E59B7, 0x43F5BB3A, 0xF2D519FF, 0x27D9459C, 0xBF97222C, 0x15E6FC2A, 0x0F91FC71, 0x9B941525, 0xFAE59361, 0xCEB69CEB, 0xC2A86459, 0x12BAA8D1, 0xB6C1075E, 0xE3056A0C, 0x10D25065, 0xCB03A442, 0xE0EC6E0E, 0x1698DB3B, 0x4C98A0BE, 0x3278E964, 0x9F1F9532, 0xE0D392DF, 0xD3A0342B, 0x8971F21E, 0x1B0A7441, 0x4BA3348C, 0xC5BE7120, 0xC37632D8, 0xDF359F8D, 0x9B992F2E, 0xE60B6F47, 0x0FE3F11D, 0xE54CDA54, 0x1EDAD891, 0xCE6279CF, 0xCD3E7E6F, 0x1618B166, 0xFD2C1D05, 0x848FD2C5, 0xF6FB2299, 0xF523F357, 0xA6327623, 0x93A83531, 0x56CCCD02, 0xACF08162, 0x5A75EBB5, 0x6E163697, 0x88D273CC, 0xDE966292, 0x81B949D0, 0x4C50901B, 0x71C65614, 0xE6C6C7BD, 0x327A140A, 0x45E1D006, 0xC3F27B9A, 0xC9AA53FD, 0x62A80F00, 0xBB25BFE2, 0x35BDD2F6, 0x71126905, 0xB2040222, 0xB6CBCF7C, 0xCD769C2B, 0x53113EC0, 0x1640E3D3, 0x38ABBD60, 0x2547ADF0, 0xBA38209C, 0xF746CE76, 0x77AFA1C5, 0x20756060, 0x85CBFE4E, 0x8AE88DD8, 0x7AAAF9B0, 0x4CF9AA7E, 0x1948C25C, 0x02FB8A8C, 0x01C36AE4, 0xD6EBE1F9, 0x90D4F869, 0xA65CDEA0, 0x3F09252D, 0xC208E69F, 0xB74E6132, 0xCE77E25B, 0x578FDFE3, 0x3AC372E6 ] ]; var BLOWFISH_CTX = { pbox: [], sbox: [] } function F(ctx, x){ let a = (x >> 24) & 0xFF; let b = (x >> 16) & 0xFF; let c = (x >> 8) & 0xFF; let d = x & 0xFF; let y = ctx.sbox[0][a] + ctx.sbox[1][b]; y = y ^ ctx.sbox[2][c]; y = y + ctx.sbox[3][d]; return y; } function BlowFish_Encrypt(ctx, left, right){ let Xl = left; let Xr = right; let temp; for(let i = 0; i < N; ++i){ Xl = Xl ^ ctx.pbox[i]; Xr = F(ctx, Xl) ^ Xr; temp = Xl; Xl = Xr; Xr = temp; } temp = Xl; Xl = Xr; Xr = temp; Xr = Xr ^ ctx.pbox[N]; Xl = Xl ^ ctx.pbox[N + 1]; return {left: Xl, right: Xr}; } function BlowFish_Decrypt(ctx, left, right){ let Xl = left; let Xr = right; let temp; for(let i = N + 1; i > 1; --i){ Xl = Xl ^ ctx.pbox[i]; Xr = F(ctx, Xl) ^ Xr; temp = Xl; Xl = Xr; Xr = temp; } temp = Xl; Xl = Xr; Xr = temp; Xr = Xr ^ ctx.pbox[1]; Xl = Xl ^ ctx.pbox[0]; return {left: Xl, right: Xr}; } /** * Initialization ctx's pbox and sbox. * * @param {Object} ctx The object has pbox and sbox. * @param {Array} key An array of 32-bit words. * @param {int} keysize The length of the key. * * @example * * BlowFishInit(BLOWFISH_CTX, key, 128/32); */ function BlowFishInit(ctx, key, keysize) { for(let Row = 0; Row < 4; Row++) { ctx.sbox[Row] = []; for(let Col = 0; Col < 256; Col++) { ctx.sbox[Row][Col] = ORIG_S[Row][Col]; } } let keyIndex = 0; for(let index = 0; index < N + 2; index++) { ctx.pbox[index] = ORIG_P[index] ^ key[keyIndex]; keyIndex++; if(keyIndex >= keysize) { keyIndex = 0; } } let Data1 = 0; let Data2 = 0; let res = 0; for(let i = 0; i < N + 2; i += 2) { res = BlowFish_Encrypt(ctx, Data1, Data2); Data1 = res.left; Data2 = res.right; ctx.pbox[i] = Data1; ctx.pbox[i + 1] = Data2; } for(let i = 0; i < 4; i++) { for(let j = 0; j < 256; j += 2) { res = BlowFish_Encrypt(ctx, Data1, Data2); Data1 = res.left; Data2 = res.right; ctx.sbox[i][j] = Data1; ctx.sbox[i][j + 1] = Data2; } } return true; } /** * Blowfish block cipher algorithm. */ var Blowfish = C_algo.Blowfish = BlockCipher.extend({ _doReset: function () { // Skip reset of nRounds has been set before and key did not change if (this._keyPriorReset === this._key) { return; } // Shortcuts var key = this._keyPriorReset = this._key; var keyWords = key.words; var keySize = key.sigBytes / 4; //Initialization pbox and sbox BlowFishInit(BLOWFISH_CTX, keyWords, keySize); }, encryptBlock: function (M, offset) { var res = BlowFish_Encrypt(BLOWFISH_CTX, M[offset], M[offset + 1]); M[offset] = res.left; M[offset + 1] = res.right; }, decryptBlock: function (M, offset) { var res = BlowFish_Decrypt(BLOWFISH_CTX, M[offset], M[offset + 1]); M[offset] = res.left; M[offset + 1] = res.right; }, blockSize: 64/32, keySize: 128/32, ivSize: 64/32 }); /** * Shortcut functions to the cipher's object interface. * * @example * * var ciphertext = CryptoJS.Blowfish.encrypt(message, key, cfg); * var plaintext = CryptoJS.Blowfish.decrypt(ciphertext, key, cfg); */ C.Blowfish = BlockCipher._createHelper(Blowfish); }()); return CryptoJS.Blowfish; })); /***/ }), /***/ "./node_modules/crypto-js/cipher-core.js": /*!***********************************************!*\ !*** ./node_modules/crypto-js/cipher-core.js ***! \***********************************************/ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./evpkdf */ "./node_modules/crypto-js/evpkdf.js")); } else {} }(this, function (CryptoJS) { /** * Cipher core components. */ CryptoJS.lib.Cipher || (function (undefined) { // Shortcuts var C = CryptoJS; var C_lib = C.lib; var Base = C_lib.Base; var WordArray = C_lib.WordArray; var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm; var C_enc = C.enc; var Utf8 = C_enc.Utf8; var Base64 = C_enc.Base64; var C_algo = C.algo; var EvpKDF = C_algo.EvpKDF; /** * Abstract base cipher template. * * @property {number} keySize This cipher's key size. Default: 4 (128 bits) * @property {number} ivSize This cipher's IV size. Default: 4 (128 bits) * @property {number} _ENC_XFORM_MODE A constant representing encryption mode. * @property {number} _DEC_XFORM_MODE A constant representing decryption mode. */ var Cipher = C_lib.Cipher = BufferedBlockAlgorithm.extend({ /** * Configuration options. * * @property {WordArray} iv The IV to use for this operation. */ cfg: Base.extend(), /** * Creates this cipher in encryption mode. * * @param {WordArray} key The key. * @param {Object} cfg (Optional) The configuration options to use for this operation. * * @return {Cipher} A cipher instance. * * @static * * @example * * var cipher = CryptoJS.algo.AES.createEncryptor(keyWordArray, { iv: ivWordArray }); */ createEncryptor: function (key, cfg) { return this.create(this._ENC_XFORM_MODE, key, cfg); }, /** * Creates this cipher in decryption mode. * * @param {WordArray} key The key. * @param {Object} cfg (Optional) The configuration options to use for this operation. * * @return {Cipher} A cipher instance. * * @static * * @example * * var cipher = CryptoJS.algo.AES.createDecryptor(keyWordArray, { iv: ivWordArray }); */ createDecryptor: function (key, cfg) { return this.create(this._DEC_XFORM_MODE, key, cfg); }, /** * Initializes a newly created cipher. * * @param {number} xformMode Either the encryption or decryption transormation mode constant. * @param {WordArray} key The key. * @param {Object} cfg (Optional) The configuration options to use for this operation. * * @example * * var cipher = CryptoJS.algo.AES.create(CryptoJS.algo.AES._ENC_XFORM_MODE, keyWordArray, { iv: ivWordArray }); */ init: function (xformMode, key, cfg) { // Apply config defaults this.cfg = this.cfg.extend(cfg); // Store transform mode and key this._xformMode = xformMode; this._key = key; // Set initial values this.reset(); }, /** * Resets this cipher to its initial state. * * @example * * cipher.reset(); */ reset: function () { // Reset data buffer BufferedBlockAlgorithm.reset.call(this); // Perform concrete-cipher logic this._doReset(); }, /** * Adds data to be encrypted or decrypted. * * @param {WordArray|string} dataUpdate The data to encrypt or decrypt. * * @return {WordArray} The data after processing. * * @example * * var encrypted = cipher.process('data'); * var encrypted = cipher.process(wordArray); */ process: function (dataUpdate) { // Append this._append(dataUpdate); // Process available blocks return this._process(); }, /** * Finalizes the encryption or decryption process. * Note that the finalize operation is effectively a destructive, read-once operation. * * @param {WordArray|string} dataUpdate The final data to encrypt or decrypt. * * @return {WordArray} The data after final processing. * * @example * * var encrypted = cipher.finalize(); * var encrypted = cipher.finalize('data'); * var encrypted = cipher.finalize(wordArray); */ finalize: function (dataUpdate) { // Final data update if (dataUpdate) { this._append(dataUpdate); } // Perform concrete-cipher logic var finalProcessedData = this._doFinalize(); return finalProcessedData; }, keySize: 128/32, ivSize: 128/32, _ENC_XFORM_MODE: 1, _DEC_XFORM_MODE: 2, /** * Creates shortcut functions to a cipher's object interface. * * @param {Cipher} cipher The cipher to create a helper for. * * @return {Object} An object with encrypt and decrypt shortcut functions. * * @static * * @example * * var AES = CryptoJS.lib.Cipher._createHelper(CryptoJS.algo.AES); */ _createHelper: (function () { function selectCipherStrategy(key) { if (typeof key == 'string') { return PasswordBasedCipher; } else { return SerializableCipher; } } return function (cipher) { return { encrypt: function (message, key, cfg) { return selectCipherStrategy(key).encrypt(cipher, message, key, cfg); }, decrypt: function (ciphertext, key, cfg) { return selectCipherStrategy(key).decrypt(cipher, ciphertext, key, cfg); } }; }; }()) }); /** * Abstract base stream cipher template. * * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 1 (32 bits) */ var StreamCipher = C_lib.StreamCipher = Cipher.extend({ _doFinalize: function () { // Process partial blocks var finalProcessedBlocks = this._process(!!'flush'); return finalProcessedBlocks; }, blockSize: 1 }); /** * Mode namespace. */ var C_mode = C.mode = {}; /** * Abstract base block cipher mode template. */ var BlockCipherMode = C_lib.BlockCipherMode = Base.extend({ /** * Creates this mode for encryption. * * @param {Cipher} cipher A block cipher instance. * @param {Array} iv The IV words. * * @static * * @example * * var mode = CryptoJS.mode.CBC.createEncryptor(cipher, iv.words); */ createEncryptor: function (cipher, iv) { return this.Encryptor.create(cipher, iv); }, /** * Creates this mode for decryption. * * @param {Cipher} cipher A block cipher instance. * @param {Array} iv The IV words. * * @static * * @example * * var mode = CryptoJS.mode.CBC.createDecryptor(cipher, iv.words); */ createDecryptor: function (cipher, iv) { return this.Decryptor.create(cipher, iv); }, /** * Initializes a newly created mode. * * @param {Cipher} cipher A block cipher instance. * @param {Array} iv The IV words. * * @example * * var mode = CryptoJS.mode.CBC.Encryptor.create(cipher, iv.words); */ init: function (cipher, iv) { this._cipher = cipher; this._iv = iv; } }); /** * Cipher Block Chaining mode. */ var CBC = C_mode.CBC = (function () { /** * Abstract base CBC mode. */ var CBC = BlockCipherMode.extend(); /** * CBC encryptor. */ CBC.Encryptor = CBC.extend({ /** * Processes the data block at offset. * * @param {Array} words The data words to operate on. * @param {number} offset The offset where the block starts. * * @example * * mode.processBlock(data.words, offset); */ processBlock: function (words, offset) { // Shortcuts var cipher = this._cipher; var blockSize = cipher.blockSize; // XOR and encrypt xorBlock.call(this, words, offset, blockSize); cipher.encryptBlock(words, offset); // Remember this block to use with next block this._prevBlock = words.slice(offset, offset + blockSize); } }); /** * CBC decryptor. */ CBC.Decryptor = CBC.extend({ /** * Processes the data block at offset. * * @param {Array} words The data words to operate on. * @param {number} offset The offset where the block starts. * * @example * * mode.processBlock(data.words, offset); */ processBlock: function (words, offset) { // Shortcuts var cipher = this._cipher; var blockSize = cipher.blockSize; // Remember this block to use with next block var thisBlock = words.slice(offset, offset + blockSize); // Decrypt and XOR cipher.decryptBlock(words, offset); xorBlock.call(this, words, offset, blockSize); // This block becomes the previous block this._prevBlock = thisBlock; } }); function xorBlock(words, offset, blockSize) { var block; // Shortcut var iv = this._iv; // Choose mixing block if (iv) { block = iv; // Remove IV for subsequent blocks this._iv = undefined; } else { block = this._prevBlock; } // XOR blocks for (var i = 0; i < blockSize; i++) { words[offset + i] ^= block[i]; } } return CBC; }()); /** * Padding namespace. */ var C_pad = C.pad = {}; /** * PKCS #5/7 padding strategy. */ var Pkcs7 = C_pad.Pkcs7 = { /** * Pads data using the algorithm defined in PKCS #5/7. * * @param {WordArray} data The data to pad. * @param {number} blockSize The multiple that the data should be padded to. * * @static * * @example * * CryptoJS.pad.Pkcs7.pad(wordArray, 4); */ pad: function (data, blockSize) { // Shortcut var blockSizeBytes = blockSize * 4; // Count padding bytes var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes; // Create padding word var paddingWord = (nPaddingBytes << 24) | (nPaddingBytes << 16) | (nPaddingBytes << 8) | nPaddingBytes; // Create padding var paddingWords = []; for (var i = 0; i < nPaddingBytes; i += 4) { paddingWords.push(paddingWord); } var padding = WordArray.create(paddingWords, nPaddingBytes); // Add padding data.concat(padding); }, /** * Unpads data that had been padded using the algorithm defined in PKCS #5/7. * * @param {WordArray} data The data to unpad. * * @static * * @example * * CryptoJS.pad.Pkcs7.unpad(wordArray); */ unpad: function (data) { // Get number of padding bytes from last byte var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff; // Remove padding data.sigBytes -= nPaddingBytes; } }; /** * Abstract base block cipher template. * * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 4 (128 bits) */ var BlockCipher = C_lib.BlockCipher = Cipher.extend({ /** * Configuration options. * * @property {Mode} mode The block mode to use. Default: CBC * @property {Padding} padding The padding strategy to use. Default: Pkcs7 */ cfg: Cipher.cfg.extend({ mode: CBC, padding: Pkcs7 }), reset: function () { var modeCreator; // Reset cipher Cipher.reset.call(this); // Shortcuts var cfg = this.cfg; var iv = cfg.iv; var mode = cfg.mode; // Reset block mode if (this._xformMode == this._ENC_XFORM_MODE) { modeCreator = mode.createEncryptor; } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ { modeCreator = mode.createDecryptor; // Keep at least one block in the buffer for unpadding this._minBufferSize = 1; } if (this._mode && this._mode.__creator == modeCreator) { this._mode.init(this, iv && iv.words); } else { this._mode = modeCreator.call(mode, this, iv && iv.words); this._mode.__creator = modeCreator; } }, _doProcessBlock: function (words, offset) { this._mode.processBlock(words, offset); }, _doFinalize: function () { var finalProcessedBlocks; // Shortcut var padding = this.cfg.padding; // Finalize if (this._xformMode == this._ENC_XFORM_MODE) { // Pad data padding.pad(this._data, this.blockSize); // Process final blocks finalProcessedBlocks = this._process(!!'flush'); } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ { // Process final blocks finalProcessedBlocks = this._process(!!'flush'); // Unpad data padding.unpad(finalProcessedBlocks); } return finalProcessedBlocks; }, blockSize: 128/32 }); /** * A collection of cipher parameters. * * @property {WordArray} ciphertext The raw ciphertext. * @property {WordArray} key The key to this ciphertext. * @property {WordArray} iv The IV used in the ciphering operation. * @property {WordArray} salt The salt used with a key derivation function. * @property {Cipher} algorithm The cipher algorithm. * @property {Mode} mode The block mode used in the ciphering operation. * @property {Padding} padding The padding scheme used in the ciphering operation. * @property {number} blockSize The block size of the cipher. * @property {Format} formatter The default formatting strategy to convert this cipher params object to a string. */ var CipherParams = C_lib.CipherParams = Base.extend({ /** * Initializes a newly created cipher params object. * * @param {Object} cipherParams An object with any of the possible cipher parameters. * * @example * * var cipherParams = CryptoJS.lib.CipherParams.create({ * ciphertext: ciphertextWordArray, * key: keyWordArray, * iv: ivWordArray, * salt: saltWordArray, * algorithm: CryptoJS.algo.AES, * mode: CryptoJS.mode.CBC, * padding: CryptoJS.pad.PKCS7, * blockSize: 4, * formatter: CryptoJS.format.OpenSSL * }); */ init: function (cipherParams) { this.mixIn(cipherParams); }, /** * Converts this cipher params object to a string. * * @param {Format} formatter (Optional) The formatting strategy to use. * * @return {string} The stringified cipher params. * * @throws Error If neither the formatter nor the default formatter is set. * * @example * * var string = cipherParams + ''; * var string = cipherParams.toString(); * var string = cipherParams.toString(CryptoJS.format.OpenSSL); */ toString: function (formatter) { return (formatter || this.formatter).stringify(this); } }); /** * Format namespace. */ var C_format = C.format = {}; /** * OpenSSL formatting strategy. */ var OpenSSLFormatter = C_format.OpenSSL = { /** * Converts a cipher params object to an OpenSSL-compatible string. * * @param {CipherParams} cipherParams The cipher params object. * * @return {string} The OpenSSL-compatible string. * * @static * * @example * * var openSSLString = CryptoJS.format.OpenSSL.stringify(cipherParams); */ stringify: function (cipherParams) { var wordArray; // Shortcuts var ciphertext = cipherParams.ciphertext; var salt = cipherParams.salt; // Format if (salt) { wordArray = WordArray.create([0x53616c74, 0x65645f5f]).concat(salt).concat(ciphertext); } else { wordArray = ciphertext; } return wordArray.toString(Base64); }, /** * Converts an OpenSSL-compatible string to a cipher params object. * * @param {string} openSSLStr The OpenSSL-compatible string. * * @return {CipherParams} The cipher params object. * * @static * * @example * * var cipherParams = CryptoJS.format.OpenSSL.parse(openSSLString); */ parse: function (openSSLStr) { var salt; // Parse base64 var ciphertext = Base64.parse(openSSLStr); // Shortcut var ciphertextWords = ciphertext.words; // Test for salt if (ciphertextWords[0] == 0x53616c74 && ciphertextWords[1] == 0x65645f5f) { // Extract salt salt = WordArray.create(ciphertextWords.slice(2, 4)); // Remove salt from ciphertext ciphertextWords.splice(0, 4); ciphertext.sigBytes -= 16; } return CipherParams.create({ ciphertext: ciphertext, salt: salt }); } }; /** * A cipher wrapper that returns ciphertext as a serializable cipher params object. */ var SerializableCipher = C_lib.SerializableCipher = Base.extend({ /** * Configuration options. * * @property {Formatter} format The formatting strategy to convert cipher param objects to and from a string. Default: OpenSSL */ cfg: Base.extend({ format: OpenSSLFormatter }), /** * Encrypts a message. * * @param {Cipher} cipher The cipher algorithm to use. * @param {WordArray|string} message The message to encrypt. * @param {WordArray} key The key. * @param {Object} cfg (Optional) The configuration options to use for this operation. * * @return {CipherParams} A cipher params object. * * @static * * @example * * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key); * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv }); * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv, format: CryptoJS.format.OpenSSL }); */ encrypt: function (cipher, message, key, cfg) { // Apply config defaults cfg = this.cfg.extend(cfg); // Encrypt var encryptor = cipher.createEncryptor(key, cfg); var ciphertext = encryptor.finalize(message); // Shortcut var cipherCfg = encryptor.cfg; // Create and return serializable cipher params return CipherParams.create({ ciphertext: ciphertext, key: key, iv: cipherCfg.iv, algorithm: cipher, mode: cipherCfg.mode, padding: cipherCfg.padding, blockSize: cipher.blockSize, formatter: cfg.format }); }, /** * Decrypts serialized ciphertext. * * @param {Cipher} cipher The cipher algorithm to use. * @param {CipherParams|string} ciphertext The ciphertext to decrypt. * @param {WordArray} key The key. * @param {Object} cfg (Optional) The configuration options to use for this operation. * * @return {WordArray} The plaintext. * * @static * * @example * * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, key, { iv: iv, format: CryptoJS.format.OpenSSL }); * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, key, { iv: iv, format: CryptoJS.format.OpenSSL }); */ decrypt: function (cipher, ciphertext, key, cfg) { // Apply config defaults cfg = this.cfg.extend(cfg); // Convert string to CipherParams ciphertext = this._parse(ciphertext, cfg.format); // Decrypt var plaintext = cipher.createDecryptor(key, cfg).finalize(ciphertext.ciphertext); return plaintext; }, /** * Converts serialized ciphertext to CipherParams, * else assumed CipherParams already and returns ciphertext unchanged. * * @param {CipherParams|string} ciphertext The ciphertext. * @param {Formatter} format The formatting strategy to use to parse serialized ciphertext. * * @return {CipherParams} The unserialized ciphertext. * * @static * * @example * * var ciphertextParams = CryptoJS.lib.SerializableCipher._parse(ciphertextStringOrParams, format); */ _parse: function (ciphertext, format) { if (typeof ciphertext == 'string') { return format.parse(ciphertext, this); } else { return ciphertext; } } }); /** * Key derivation function namespace. */ var C_kdf = C.kdf = {}; /** * OpenSSL key derivation function. */ var OpenSSLKdf = C_kdf.OpenSSL = { /** * Derives a key and IV from a password. * * @param {string} password The password to derive from. * @param {number} keySize The size in words of the key to generate. * @param {number} ivSize The size in words of the IV to generate. * @param {WordArray|string} salt (Optional) A 64-bit salt to use. If omitted, a salt will be generated randomly. * * @return {CipherParams} A cipher params object with the key, IV, and salt. * * @static * * @example * * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32); * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32, 'saltsalt'); */ execute: function (password, keySize, ivSize, salt, hasher) { // Generate random salt if (!salt) { salt = WordArray.random(64/8); } // Derive key and IV if (!hasher) { var key = EvpKDF.create({ keySize: keySize + ivSize }).compute(password, salt); } else { var key = EvpKDF.create({ keySize: keySize + ivSize, hasher: hasher }).compute(password, salt); } // Separate key and IV var iv = WordArray.create(key.words.slice(keySize), ivSize * 4); key.sigBytes = keySize * 4; // Return params return CipherParams.create({ key: key, iv: iv, salt: salt }); } }; /** * A serializable cipher wrapper that derives the key from a password, * and returns ciphertext as a serializable cipher params object. */ var PasswordBasedCipher = C_lib.PasswordBasedCipher = SerializableCipher.extend({ /** * Configuration options. * * @property {KDF} kdf The key derivation function to use to generate a key and IV from a password. Default: OpenSSL */ cfg: SerializableCipher.cfg.extend({ kdf: OpenSSLKdf }), /** * Encrypts a message using a password. * * @param {Cipher} cipher The cipher algorithm to use. * @param {WordArray|string} message The message to encrypt. * @param {string} password The password. * @param {Object} cfg (Optional) The configuration options to use for this operation. * * @return {CipherParams} A cipher params object. * * @static * * @example * * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password'); * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password', { format: CryptoJS.format.OpenSSL }); */ encrypt: function (cipher, message, password, cfg) { // Apply config defaults cfg = this.cfg.extend(cfg); // Derive key and other params var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, cfg.salt, cfg.hasher); // Add IV to config cfg.iv = derivedParams.iv; // Encrypt var ciphertext = SerializableCipher.encrypt.call(this, cipher, message, derivedParams.key, cfg); // Mix in derived params ciphertext.mixIn(derivedParams); return ciphertext; }, /** * Decrypts serialized ciphertext using a password. * * @param {Cipher} cipher The cipher algorithm to use. * @param {CipherParams|string} ciphertext The ciphertext to decrypt. * @param {string} password The password. * @param {Object} cfg (Optional) The configuration options to use for this operation. * * @return {WordArray} The plaintext. * * @static * * @example * * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, 'password', { format: CryptoJS.format.OpenSSL }); * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, 'password', { format: CryptoJS.format.OpenSSL }); */ decrypt: function (cipher, ciphertext, password, cfg) { // Apply config defaults cfg = this.cfg.extend(cfg); // Convert string to CipherParams ciphertext = this._parse(ciphertext, cfg.format); // Derive key and other params var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, ciphertext.salt, cfg.hasher); // Add IV to config cfg.iv = derivedParams.iv; // Decrypt var plaintext = SerializableCipher.decrypt.call(this, cipher, ciphertext, derivedParams.key, cfg); return plaintext; } }); }()); })); /***/ }), /***/ "./node_modules/crypto-js/core.js": /*!****************************************!*\ !*** ./node_modules/crypto-js/core.js ***! \****************************************/ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory) { if (true) { // CommonJS module.exports = exports = factory(); } else {} }(this, function () { /*globals window, global, require*/ /** * CryptoJS core components. */ var CryptoJS = CryptoJS || (function (Math, undefined) { var crypto; // Native crypto from window (Browser) if (typeof window !== 'undefined' && window.crypto) { crypto = window.crypto; } // Native crypto in web worker (Browser) if (typeof self !== 'undefined' && self.crypto) { crypto = self.crypto; } // Native crypto from worker if (typeof globalThis !== 'undefined' && globalThis.crypto) { crypto = globalThis.crypto; } // Native (experimental IE 11) crypto from window (Browser) if (!crypto && typeof window !== 'undefined' && window.msCrypto) { crypto = window.msCrypto; } // Native crypto from global (NodeJS) if (!crypto && typeof global !== 'undefined' && global.crypto) { crypto = global.crypto; } // Native crypto import via require (NodeJS) if (!crypto && "function" === 'function') { try { crypto = __webpack_require__(/*! crypto */ "crypto"); } catch (err) {} } /* * Cryptographically secure pseudorandom number generator * * As Math.random() is cryptographically not safe to use */ var cryptoSecureRandomInt = function () { if (crypto) { // Use getRandomValues method (Browser) if (typeof crypto.getRandomValues === 'function') { try { return crypto.getRandomValues(new Uint32Array(1))[0]; } catch (err) {} } // Use randomBytes method (NodeJS) if (typeof crypto.randomBytes === 'function') { try { return crypto.randomBytes(4).readInt32LE(); } catch (err) {} } } throw new Error('Native crypto module could not be used to get secure random number.'); }; /* * Local polyfill of Object.create */ var create = Object.create || (function () { function F() {} return function (obj) { var subtype; F.prototype = obj; subtype = new F(); F.prototype = null; return subtype; }; }()); /** * CryptoJS namespace. */ var C = {}; /** * Library namespace. */ var C_lib = C.lib = {}; /** * Base object for prototypal inheritance. */ var Base = C_lib.Base = (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) { // Spawn var subtype = create(this); // Augment if (overrides) { subtype.mixIn(overrides); } // Create default initializer if (!subtype.hasOwnProperty('init') || this.init === subtype.init) { subtype.init = function () { subtype.$super.init.apply(this, arguments); }; } // Initializer's prototype is the subtype object subtype.init.prototype = subtype; // Reference supertype 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]; } } // IE won't copy toString using the loop above 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); } }; }()); /** * An array of 32-bit words. * * @property {Array} words The array of 32-bit words. * @property {number} sigBytes The number of significant bytes in this word array. */ 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) { 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) { // Shortcuts var thisWords = this.words; var thatWords = wordArray.words; var thisSigBytes = this.sigBytes; var thatSigBytes = wordArray.sigBytes; // Clamp excess bits this.clamp(); // Concat if (thisSigBytes % 4) { // Copy one byte at a time for (var i = 0; i < thatSigBytes; i++) { var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8); } } else { // Copy one word at a time for (var j = 0; j < thatSigBytes; j += 4) { thisWords[(thisSigBytes + j) >>> 2] = thatWords[j >>> 2]; } } this.sigBytes += thatSigBytes; // Chainable return this; }, /** * Removes insignificant bits. * * @example * * wordArray.clamp(); */ clamp: function () { // Shortcuts var words = this.words; var sigBytes = this.sigBytes; // Clamp words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8); words.length = Math.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); } }); /** * Encoder namespace. */ var C_enc = C.enc = {}; /** * Hex encoding strategy. */ 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) { // Shortcuts var words = wordArray.words; var sigBytes = wordArray.sigBytes; // Convert var hexChars = []; for (var i = 0; i < sigBytes; i++) { var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; hexChars.push((bite >>> 4).toString(16)); hexChars.push((bite & 0x0f).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) { // Shortcut var hexStrLength = hexStr.length; // Convert 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); } }; /** * Latin1 encoding strategy. */ 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) { // Shortcuts var words = wordArray.words; var sigBytes = wordArray.sigBytes; // Convert var latin1Chars = []; for (var i = 0; i < sigBytes; i++) { var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; 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) { // Shortcut var latin1StrLength = latin1Str.length; // Convert var words = []; for (var i = 0; i < latin1StrLength; i++) { words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8); } return new WordArray.init(words, latin1StrLength); } }; /** * UTF-8 encoding strategy. */ 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))); } }; /** * Abstract buffered block algorithm template. * * The property blockSize must be implemented in a concrete subtype. * * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0 */ var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({ /** * Resets this block algorithm's data buffer to its initial state. * * @example * * bufferedBlockAlgorithm.reset(); */ reset: function () { // Initial values 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) { // Convert string to WordArray, else assume WordArray already if (typeof data == 'string') { data = Utf8.parse(data); } // Append 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; // Shortcuts var data = this._data; var dataWords = data.words; var dataSigBytes = data.sigBytes; var blockSize = this.blockSize; var blockSizeBytes = blockSize * 4; // Count blocks ready var nBlocksReady = dataSigBytes / blockSizeBytes; if (doFlush) { // Round up to include partial blocks nBlocksReady = Math.ceil(nBlocksReady); } else { // Round down to include only full blocks, // less the number of blocks that must remain in the buffer nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0); } // Count words ready var nWordsReady = nBlocksReady * blockSize; // Count bytes ready var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes); // Process blocks if (nWordsReady) { for (var offset = 0; offset < nWordsReady; offset += blockSize) { // Perform concrete-algorithm logic this._doProcessBlock(dataWords, offset); } // Remove processed words processedWords = dataWords.splice(0, nWordsReady); data.sigBytes -= nBytesReady; } // Return processed words 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 }); /** * Abstract hasher template. * * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits) */ var Hasher = 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) { // Apply config defaults this.cfg = this.cfg.extend(cfg); // Set initial values this.reset(); }, /** * Resets this hasher to its initial state. * * @example * * hasher.reset(); */ reset: function () { // Reset data buffer BufferedBlockAlgorithm.reset.call(this); // Perform concrete-hasher logic 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) { // Append this._append(messageUpdate); // Update the hash this._process(); // Chainable 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) { // Final message update if (messageUpdate) { this._append(messageUpdate); } // Perform concrete-hasher logic 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); }; } }); /** * Algorithm namespace. */ var C_algo = C.algo = {}; return C; }(Math)); return CryptoJS; })); /***/ }), /***/ "./node_modules/crypto-js/enc-base64.js": /*!**********************************************!*\ !*** ./node_modules/crypto-js/enc-base64.js ***! \**********************************************/ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); } else {} }(this, function (CryptoJS) { (function () { // Shortcuts var C = CryptoJS; var C_lib = C.lib; var WordArray = C_lib.WordArray; var C_enc = C.enc; /** * Base64 encoding strategy. */ var Base64 = C_enc.Base64 = { /** * Converts a word array to a Base64 string. * * @param {WordArray} wordArray The word array. * * @return {string} The Base64 string. * * @static * * @example * * var base64String = CryptoJS.enc.Base64.stringify(wordArray); */ stringify: function (wordArray) { // Shortcuts var words = wordArray.words; var sigBytes = wordArray.sigBytes; var map = this._map; // Clamp excess bits wordArray.clamp(); // Convert var base64Chars = []; for (var i = 0; i < sigBytes; i += 3) { var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff; var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff; var triplet = (byte1 << 16) | (byte2 << 8) | byte3; for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) { base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f)); } } // Add padding var paddingChar = map.charAt(64); if (paddingChar) { while (base64Chars.length % 4) { base64Chars.push(paddingChar); } } return base64Chars.join(''); }, /** * Converts a Base64 string to a word array. * * @param {string} base64Str The Base64 string. * * @return {WordArray} The word array. * * @static * * @example * * var wordArray = CryptoJS.enc.Base64.parse(base64String); */ parse: function (base64Str) { // Shortcuts var base64StrLength = base64Str.length; var map = this._map; var reverseMap = this._reverseMap; if (!reverseMap) { reverseMap = this._reverseMap = []; for (var j = 0; j < map.length; j++) { reverseMap[map.charCodeAt(j)] = j; } } // Ignore padding var paddingChar = map.charAt(64); if (paddingChar) { var paddingIndex = base64Str.indexOf(paddingChar); if (paddingIndex !== -1) { base64StrLength = paddingIndex; } } // Convert return parseLoop(base64Str, base64StrLength, reverseMap); }, _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=' }; function parseLoop(base64Str, base64StrLength, reverseMap) { var words = []; var nBytes = 0; for (var i = 0; i < base64StrLength; i++) { if (i % 4) { var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << ((i % 4) * 2); var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> (6 - (i % 4) * 2); var bitsCombined = bits1 | bits2; words[nBytes >>> 2] |= bitsCombined << (24 - (nBytes % 4) * 8); nBytes++; } } return WordArray.create(words, nBytes); } }()); return CryptoJS.enc.Base64; })); /***/ }), /***/ "./node_modules/crypto-js/enc-base64url.js": /*!*************************************************!*\ !*** ./node_modules/crypto-js/enc-base64url.js ***! \*************************************************/ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); } else {} }(this, function (CryptoJS) { (function () { // Shortcuts var C = CryptoJS; var C_lib = C.lib; var WordArray = C_lib.WordArray; var C_enc = C.enc; /** * Base64url encoding strategy. */ var Base64url = C_enc.Base64url = { /** * Converts a word array to a Base64url string. * * @param {WordArray} wordArray The word array. * * @param {boolean} urlSafe Whether to use url safe * * @return {string} The Base64url string. * * @static * * @example * * var base64String = CryptoJS.enc.Base64url.stringify(wordArray); */ stringify: function (wordArray, urlSafe) { if (urlSafe === undefined) { urlSafe = true } // Shortcuts var words = wordArray.words; var sigBytes = wordArray.sigBytes; var map = urlSafe ? this._safe_map : this._map; // Clamp excess bits wordArray.clamp(); // Convert var base64Chars = []; for (var i = 0; i < sigBytes; i += 3) { var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff; var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff; var triplet = (byte1 << 16) | (byte2 << 8) | byte3; for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) { base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f)); } } // Add padding var paddingChar = map.charAt(64); if (paddingChar) { while (base64Chars.length % 4) { base64Chars.push(paddingChar); } } return base64Chars.join(''); }, /** * Converts a Base64url string to a word array. * * @param {string} base64Str The Base64url string. * * @param {boolean} urlSafe Whether to use url safe * * @return {WordArray} The word array. * * @static * * @example * * var wordArray = CryptoJS.enc.Base64url.parse(base64String); */ parse: function (base64Str, urlSafe) { if (urlSafe === undefined) { urlSafe = true } // Shortcuts var base64StrLength = base64Str.length; var map = urlSafe ? this._safe_map : this._map; var reverseMap = this._reverseMap; if (!reverseMap) { reverseMap = this._reverseMap = []; for (var j = 0; j < map.length; j++) { reverseMap[map.charCodeAt(j)] = j; } } // Ignore padding var paddingChar = map.charAt(64); if (paddingChar) { var paddingIndex = base64Str.indexOf(paddingChar); if (paddingIndex !== -1) { base64StrLength = paddingIndex; } } // Convert return parseLoop(base64Str, base64StrLength, reverseMap); }, _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=', _safe_map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_', }; function parseLoop(base64Str, base64StrLength, reverseMap) { var words = []; var nBytes = 0; for (var i = 0; i < base64StrLength; i++) { if (i % 4) { var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << ((i % 4) * 2); var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> (6 - (i % 4) * 2); var bitsCombined = bits1 | bits2; words[nBytes >>> 2] |= bitsCombined << (24 - (nBytes % 4) * 8); nBytes++; } } return WordArray.create(words, nBytes); } }()); return CryptoJS.enc.Base64url; })); /***/ }), /***/ "./node_modules/crypto-js/enc-utf16.js": /*!*********************************************!*\ !*** ./node_modules/crypto-js/enc-utf16.js ***! \*********************************************/ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); } else {} }(this, function (CryptoJS) { (function () { // Shortcuts var C = CryptoJS; var C_lib = C.lib; var WordArray = C_lib.WordArray; var C_enc = C.enc; /** * UTF-16 BE encoding strategy. */ var Utf16BE = C_enc.Utf16 = C_enc.Utf16BE = { /** * Converts a word array to a UTF-16 BE string. * * @param {WordArray} wordArray The word array. * * @return {string} The UTF-16 BE string. * * @static * * @example * * var utf16String = CryptoJS.enc.Utf16.stringify(wordArray); */ stringify: function (wordArray) { // Shortcuts var words = wordArray.words; var sigBytes = wordArray.sigBytes; // Convert var utf16Chars = []; for (var i = 0; i < sigBytes; i += 2) { var codePoint = (words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff; utf16Chars.push(String.fromCharCode(codePoint)); } return utf16Chars.join(''); }, /** * Converts a UTF-16 BE string to a word array. * * @param {string} utf16Str The UTF-16 BE string. * * @return {WordArray} The word array. * * @static * * @example * * var wordArray = CryptoJS.enc.Utf16.parse(utf16String); */ parse: function (utf16Str) { // Shortcut var utf16StrLength = utf16Str.length; // Convert var words = []; for (var i = 0; i < utf16StrLength; i++) { words[i >>> 1] |= utf16Str.charCodeAt(i) << (16 - (i % 2) * 16); } return WordArray.create(words, utf16StrLength * 2); } }; /** * UTF-16 LE encoding strategy. */ C_enc.Utf16LE = { /** * Converts a word array to a UTF-16 LE string. * * @param {WordArray} wordArray The word array. * * @return {string} The UTF-16 LE string. * * @static * * @example * * var utf16Str = CryptoJS.enc.Utf16LE.stringify(wordArray); */ stringify: function (wordArray) { // Shortcuts var words = wordArray.words; var sigBytes = wordArray.sigBytes; // Convert var utf16Chars = []; for (var i = 0; i < sigBytes; i += 2) { var codePoint = swapEndian((words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff); utf16Chars.push(String.fromCharCode(codePoint)); } return utf16Chars.join(''); }, /** * Converts a UTF-16 LE string to a word array. * * @param {string} utf16Str The UTF-16 LE string. * * @return {WordArray} The word array. * * @static * * @example * * var wordArray = CryptoJS.enc.Utf16LE.parse(utf16Str); */ parse: function (utf16Str) { // Shortcut var utf16StrLength = utf16Str.length; // Convert var words = []; for (var i = 0; i < utf16StrLength; i++) { words[i >>> 1] |= swapEndian(utf16Str.charCodeAt(i) << (16 - (i % 2) * 16)); } return WordArray.create(words, utf16StrLength * 2); } }; function swapEndian(word) { return ((word << 8) & 0xff00ff00) | ((word >>> 8) & 0x00ff00ff); } }()); return CryptoJS.enc.Utf16; })); /***/ }), /***/ "./node_modules/crypto-js/evpkdf.js": /*!******************************************!*\ !*** ./node_modules/crypto-js/evpkdf.js ***! \******************************************/ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./sha1 */ "./node_modules/crypto-js/sha1.js"), __webpack_require__(/*! ./hmac */ "./node_modules/crypto-js/hmac.js")); } else {} }(this, function (CryptoJS) { (function () { // Shortcuts var C = CryptoJS; var C_lib = C.lib; var Base = C_lib.Base; var WordArray = C_lib.WordArray; var C_algo = C.algo; var MD5 = C_algo.MD5; /** * This key derivation function is meant to conform with EVP_BytesToKey. * www.openssl.org/docs/crypto/EVP_BytesToKey.html */ var EvpKDF = C_algo.EvpKDF = Base.extend({ /** * Configuration options. * * @property {number} keySize The key size in words to generate. Default: 4 (128 bits) * @property {Hasher} hasher The hash algorithm to use. Default: MD5 * @property {number} iterations The number of iterations to perform. Default: 1 */ cfg: Base.extend({ keySize: 128/32, hasher: MD5, iterations: 1 }), /** * Initializes a newly created key derivation function. * * @param {Object} cfg (Optional) The configuration options to use for the derivation. * * @example * * var kdf = CryptoJS.algo.EvpKDF.create(); * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8 }); * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8, iterations: 1000 }); */ init: function (cfg) { this.cfg = this.cfg.extend(cfg); }, /** * Derives a key from a password. * * @param {WordArray|string} password The password. * @param {WordArray|string} salt A salt. * * @return {WordArray} The derived key. * * @example * * var key = kdf.compute(password, salt); */ compute: function (password, salt) { var block; // Shortcut var cfg = this.cfg; // Init hasher var hasher = cfg.hasher.create(); // Initial values var derivedKey = WordArray.create(); // Shortcuts var derivedKeyWords = derivedKey.words; var keySize = cfg.keySize; var iterations = cfg.iterations; // Generate key while (derivedKeyWords.length < keySize) { if (block) { hasher.update(block); } block = hasher.update(password).finalize(salt); hasher.reset(); // Iterations for (var i = 1; i < iterations; i++) { block = hasher.finalize(block); hasher.reset(); } derivedKey.concat(block); } derivedKey.sigBytes = keySize * 4; return derivedKey; } }); /** * Derives a key from a password. * * @param {WordArray|string} password The password. * @param {WordArray|string} salt A salt. * @param {Object} cfg (Optional) The configuration options to use for this computation. * * @return {WordArray} The derived key. * * @static * * @example * * var key = CryptoJS.EvpKDF(password, salt); * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8 }); * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8, iterations: 1000 }); */ C.EvpKDF = function (password, salt, cfg) { return EvpKDF.create(cfg).compute(password, salt); }; }()); return CryptoJS.EvpKDF; })); /***/ }), /***/ "./node_modules/crypto-js/format-hex.js": /*!**********************************************!*\ !*** ./node_modules/crypto-js/format-hex.js ***! \**********************************************/ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); } else {} }(this, function (CryptoJS) { (function (undefined) { // Shortcuts var C = CryptoJS; var C_lib = C.lib; var CipherParams = C_lib.CipherParams; var C_enc = C.enc; var Hex = C_enc.Hex; var C_format = C.format; var HexFormatter = C_format.Hex = { /** * Converts the ciphertext of a cipher params object to a hexadecimally encoded string. * * @param {CipherParams} cipherParams The cipher params object. * * @return {string} The hexadecimally encoded string. * * @static * * @example * * var hexString = CryptoJS.format.Hex.stringify(cipherParams); */ stringify: function (cipherParams) { return cipherParams.ciphertext.toString(Hex); }, /** * Converts a hexadecimally encoded ciphertext string to a cipher params object. * * @param {string} input The hexadecimally encoded string. * * @return {CipherParams} The cipher params object. * * @static * * @example * * var cipherParams = CryptoJS.format.Hex.parse(hexString); */ parse: function (input) { var ciphertext = Hex.parse(input); return CipherParams.create({ ciphertext: ciphertext }); } }; }()); return CryptoJS.format.Hex; })); /***/ }), /***/ "./node_modules/crypto-js/hmac.js": /*!****************************************!*\ !*** ./node_modules/crypto-js/hmac.js ***! \****************************************/ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); } else {} }(this, function (CryptoJS) { (function () { // Shortcuts var C = CryptoJS; var C_lib = C.lib; var Base = C_lib.Base; var C_enc = C.enc; var Utf8 = C_enc.Utf8; var C_algo = C.algo; /** * HMAC algorithm. */ var HMAC = C_algo.HMAC = Base.extend({ /** * Initializes a newly created HMAC. * * @param {Hasher} hasher The hash algorithm to use. * @param {WordArray|string} key The secret key. * * @example * * var hmacHasher = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, key); */ init: function (hasher, key) { // Init hasher hasher = this._hasher = new hasher.init(); // Convert string to WordArray, else assume WordArray already if (typeof key == 'string') { key = Utf8.parse(key); } // Shortcuts var hasherBlockSize = hasher.blockSize; var hasherBlockSizeBytes = hasherBlockSize * 4; // Allow arbitrary length keys if (key.sigBytes > hasherBlockSizeBytes) { key = hasher.finalize(key); } // Clamp excess bits key.clamp(); // Clone key for inner and outer pads var oKey = this._oKey = key.clone(); var iKey = this._iKey = key.clone(); // Shortcuts var oKeyWords = oKey.words; var iKeyWords = iKey.words; // XOR keys with pad constants for (var i = 0; i < hasherBlockSize; i++) { oKeyWords[i] ^= 0x5c5c5c5c; iKeyWords[i] ^= 0x36363636; } oKey.sigBytes = iKey.sigBytes = hasherBlockSizeBytes; // Set initial values this.reset(); }, /** * Resets this HMAC to its initial state. * * @example * * hmacHasher.reset(); */ reset: function () { // Shortcut var hasher = this._hasher; // Reset hasher.reset(); hasher.update(this._iKey); }, /** * Updates this HMAC with a message. * * @param {WordArray|string} messageUpdate The message to append. * * @return {HMAC} This HMAC instance. * * @example * * hmacHasher.update('message'); * hmacHasher.update(wordArray); */ update: function (messageUpdate) { this._hasher.update(messageUpdate); // Chainable return this; }, /** * Finalizes the HMAC 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 HMAC. * * @example * * var hmac = hmacHasher.finalize(); * var hmac = hmacHasher.finalize('message'); * var hmac = hmacHasher.finalize(wordArray); */ finalize: function (messageUpdate) { // Shortcut var hasher = this._hasher; // Compute HMAC var innerHash = hasher.finalize(messageUpdate); hasher.reset(); var hmac = hasher.finalize(this._oKey.clone().concat(innerHash)); return hmac; } }); }()); })); /***/ }), /***/ "./node_modules/crypto-js/index.js": /*!*****************************************!*\ !*** ./node_modules/crypto-js/index.js ***! \*****************************************/ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./x64-core */ "./node_modules/crypto-js/x64-core.js"), __webpack_require__(/*! ./lib-typedarrays */ "./node_modules/crypto-js/lib-typedarrays.js"), __webpack_require__(/*! ./enc-utf16 */ "./node_modules/crypto-js/enc-utf16.js"), __webpack_require__(/*! ./enc-base64 */ "./node_modules/crypto-js/enc-base64.js"), __webpack_require__(/*! ./enc-base64url */ "./node_modules/crypto-js/enc-base64url.js"), __webpack_require__(/*! ./md5 */ "./node_modules/crypto-js/md5.js"), __webpack_require__(/*! ./sha1 */ "./node_modules/crypto-js/sha1.js"), __webpack_require__(/*! ./sha256 */ "./node_modules/crypto-js/sha256.js"), __webpack_require__(/*! ./sha224 */ "./node_modules/crypto-js/sha224.js"), __webpack_require__(/*! ./sha512 */ "./node_modules/crypto-js/sha512.js"), __webpack_require__(/*! ./sha384 */ "./node_modules/crypto-js/sha384.js"), __webpack_require__(/*! ./sha3 */ "./node_modules/crypto-js/sha3.js"), __webpack_require__(/*! ./ripemd160 */ "./node_modules/crypto-js/ripemd160.js"), __webpack_require__(/*! ./hmac */ "./node_modules/crypto-js/hmac.js"), __webpack_require__(/*! ./pbkdf2 */ "./node_modules/crypto-js/pbkdf2.js"), __webpack_require__(/*! ./evpkdf */ "./node_modules/crypto-js/evpkdf.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js"), __webpack_require__(/*! ./mode-cfb */ "./node_modules/crypto-js/mode-cfb.js"), __webpack_require__(/*! ./mode-ctr */ "./node_modules/crypto-js/mode-ctr.js"), __webpack_require__(/*! ./mode-ctr-gladman */ "./node_modules/crypto-js/mode-ctr-gladman.js"), __webpack_require__(/*! ./mode-ofb */ "./node_modules/crypto-js/mode-ofb.js"), __webpack_require__(/*! ./mode-ecb */ "./node_modules/crypto-js/mode-ecb.js"), __webpack_require__(/*! ./pad-ansix923 */ "./node_modules/crypto-js/pad-ansix923.js"), __webpack_require__(/*! ./pad-iso10126 */ "./node_modules/crypto-js/pad-iso10126.js"), __webpack_require__(/*! ./pad-iso97971 */ "./node_modules/crypto-js/pad-iso97971.js"), __webpack_require__(/*! ./pad-zeropadding */ "./node_modules/crypto-js/pad-zeropadding.js"), __webpack_require__(/*! ./pad-nopadding */ "./node_modules/crypto-js/pad-nopadding.js"), __webpack_require__(/*! ./format-hex */ "./node_modules/crypto-js/format-hex.js"), __webpack_require__(/*! ./aes */ "./node_modules/crypto-js/aes.js"), __webpack_require__(/*! ./tripledes */ "./node_modules/crypto-js/tripledes.js"), __webpack_require__(/*! ./rc4 */ "./node_modules/crypto-js/rc4.js"), __webpack_require__(/*! ./rabbit */ "./node_modules/crypto-js/rabbit.js"), __webpack_require__(/*! ./rabbit-legacy */ "./node_modules/crypto-js/rabbit-legacy.js"), __webpack_require__(/*! ./blowfish */ "./node_modules/crypto-js/blowfish.js")); } else {} }(this, function (CryptoJS) { return CryptoJS; })); /***/ }), /***/ "./node_modules/crypto-js/lib-typedarrays.js": /*!***************************************************!*\ !*** ./node_modules/crypto-js/lib-typedarrays.js ***! \***************************************************/ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); } else {} }(this, function (CryptoJS) { (function () { // Check if typed arrays are supported if (typeof ArrayBuffer != 'function') { return; } // Shortcuts var C = CryptoJS; var C_lib = C.lib; var WordArray = C_lib.WordArray; // Reference original init var superInit = WordArray.init; // Augment WordArray.init to handle typed arrays var subInit = WordArray.init = function (typedArray) { // Convert buffers to uint8 if (typedArray instanceof ArrayBuffer) { typedArray = new Uint8Array(typedArray); } // Convert other array views to uint8 if ( typedArray instanceof Int8Array || (typeof Uint8ClampedArray !== "undefined" && typedArray instanceof Uint8ClampedArray) || typedArray instanceof Int16Array || typedArray instanceof Uint16Array || typedArray instanceof Int32Array || typedArray instanceof Uint32Array || typedArray instanceof Float32Array || typedArray instanceof Float64Array ) { typedArray = new Uint8Array(typedArray.buffer, typedArray.byteOffset, typedArray.byteLength); } // Handle Uint8Array if (typedArray instanceof Uint8Array) { // Shortcut var typedArrayByteLength = typedArray.byteLength; // Extract bytes var words = []; for (var i = 0; i < typedArrayByteLength; i++) { words[i >>> 2] |= typedArray[i] << (24 - (i % 4) * 8); } // Initialize this word array superInit.call(this, words, typedArrayByteLength); } else { // Else call normal init superInit.apply(this, arguments); } }; subInit.prototype = WordArray; }()); return CryptoJS.lib.WordArray; })); /***/ }), /***/ "./node_modules/crypto-js/md5.js": /*!***************************************!*\ !*** ./node_modules/crypto-js/md5.js ***! \***************************************/ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); } else {} }(this, function (CryptoJS) { (function (Math) { // Shortcuts var C = CryptoJS; var C_lib = C.lib; var WordArray = C_lib.WordArray; var Hasher = C_lib.Hasher; var C_algo = C.algo; // Constants table var T = []; // Compute constants (function () { for (var i = 0; i < 64; i++) { T[i] = (Math.abs(Math.sin(i + 1)) * 0x100000000) | 0; } }()); /** * MD5 hash algorithm. */ var MD5 = C_algo.MD5 = Hasher.extend({ _doReset: function () { this._hash = new WordArray.init([ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476 ]); }, _doProcessBlock: function (M, offset) { // Swap endian for (var i = 0; i < 16; i++) { // Shortcuts var offset_i = offset + i; var M_offset_i = M[offset_i]; M[offset_i] = ( (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) | (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00) ); } // Shortcuts var H = this._hash.words; var M_offset_0 = M[offset + 0]; var M_offset_1 = M[offset + 1]; var M_offset_2 = M[offset + 2]; var M_offset_3 = M[offset + 3]; var M_offset_4 = M[offset + 4]; var M_offset_5 = M[offset + 5]; var M_offset_6 = M[offset + 6]; var M_offset_7 = M[offset + 7]; var M_offset_8 = M[offset + 8]; var M_offset_9 = M[offset + 9]; var M_offset_10 = M[offset + 10]; var M_offset_11 = M[offset + 11]; var M_offset_12 = M[offset + 12]; var M_offset_13 = M[offset + 13]; var M_offset_14 = M[offset + 14]; var M_offset_15 = M[offset + 15]; // Working variables var a = H[0]; var b = H[1]; var c = H[2]; var d = H[3]; // Computation 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]); // Intermediate hash value 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 () { // Shortcuts var data = this._data; var dataWords = data.words; var nBitsTotal = this._nDataBytes * 8; var nBitsLeft = data.sigBytes * 8; // Add padding dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); var nBitsTotalH = Math.floor(nBitsTotal / 0x100000000); var nBitsTotalL = nBitsTotal; dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = ( (((nBitsTotalH << 8) | (nBitsTotalH >>> 24)) & 0x00ff00ff) | (((nBitsTotalH << 24) | (nBitsTotalH >>> 8)) & 0xff00ff00) ); dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = ( (((nBitsTotalL << 8) | (nBitsTotalL >>> 24)) & 0x00ff00ff) | (((nBitsTotalL << 24) | (nBitsTotalL >>> 8)) & 0xff00ff00) ); data.sigBytes = (dataWords.length + 1) * 4; // Hash final blocks this._process(); // Shortcuts var hash = this._hash; var H = hash.words; // Swap endian for (var i = 0; i < 4; i++) { // Shortcut var H_i = H[i]; H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) | (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00); } // Return final computed hash 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; } /** * Shortcut function to the hasher's object interface. * * @param {WordArray|string} message The message to hash. * * @return {WordArray} The hash. * * @static * * @example * * var hash = CryptoJS.MD5('message'); * var hash = CryptoJS.MD5(wordArray); */ C.MD5 = Hasher._createHelper(MD5); /** * Shortcut function to the HMAC's object interface. * * @param {WordArray|string} message The message to hash. * @param {WordArray|string} key The secret key. * * @return {WordArray} The HMAC. * * @static * * @example * * var hmac = CryptoJS.HmacMD5(message, key); */ C.HmacMD5 = Hasher._createHmacHelper(MD5); }(Math)); return CryptoJS.MD5; })); /***/ }), /***/ "./node_modules/crypto-js/mode-cfb.js": /*!********************************************!*\ !*** ./node_modules/crypto-js/mode-cfb.js ***! \********************************************/ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); } else {} }(this, function (CryptoJS) { /** * Cipher Feedback block mode. */ CryptoJS.mode.CFB = (function () { var CFB = CryptoJS.lib.BlockCipherMode.extend(); CFB.Encryptor = CFB.extend({ processBlock: function (words, offset) { // Shortcuts var cipher = this._cipher; var blockSize = cipher.blockSize; generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher); // Remember this block to use with next block this._prevBlock = words.slice(offset, offset + blockSize); } }); CFB.Decryptor = CFB.extend({ processBlock: function (words, offset) { // Shortcuts var cipher = this._cipher; var blockSize = cipher.blockSize; // Remember this block to use with next block var thisBlock = words.slice(offset, offset + blockSize); generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher); // This block becomes the previous block this._prevBlock = thisBlock; } }); function generateKeystreamAndEncrypt(words, offset, blockSize, cipher) { var keystream; // Shortcut var iv = this._iv; // Generate keystream if (iv) { keystream = iv.slice(0); // Remove IV for subsequent blocks this._iv = undefined; } else { keystream = this._prevBlock; } cipher.encryptBlock(keystream, 0); // Encrypt for (var i = 0; i < blockSize; i++) { words[offset + i] ^= keystream[i]; } } return CFB; }()); return CryptoJS.mode.CFB; })); /***/ }), /***/ "./node_modules/crypto-js/mode-ctr-gladman.js": /*!****************************************************!*\ !*** ./node_modules/crypto-js/mode-ctr-gladman.js ***! \****************************************************/ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); } else {} }(this, function (CryptoJS) { /** @preserve * Counter block mode compatible with Dr Brian Gladman fileenc.c * derived from CryptoJS.mode.CTR * Jan Hruby jhruby.web@gmail.com */ CryptoJS.mode.CTRGladman = (function () { var CTRGladman = CryptoJS.lib.BlockCipherMode.extend(); function incWord(word) { if (((word >> 24) & 0xff) === 0xff) { //overflow var b1 = (word >> 16)&0xff; var b2 = (word >> 8)&0xff; var b3 = word & 0xff; if (b1 === 0xff) // overflow b1 { b1 = 0; if (b2 === 0xff) { b2 = 0; if (b3 === 0xff) { b3 = 0; } else { ++b3; } } else { ++b2; } } else { ++b1; } word = 0; word += (b1 << 16); word += (b2 << 8); word += b3; } else { word += (0x01 << 24); } return word; } function incCounter(counter) { if ((counter[0] = incWord(counter[0])) === 0) { // encr_data in fileenc.c from Dr Brian Gladman's counts only with DWORD j < 8 counter[1] = incWord(counter[1]); } return counter; } var Encryptor = CTRGladman.Encryptor = CTRGladman.extend({ processBlock: function (words, offset) { // Shortcuts var cipher = this._cipher var blockSize = cipher.blockSize; var iv = this._iv; var counter = this._counter; // Generate keystream if (iv) { counter = this._counter = iv.slice(0); // Remove IV for subsequent blocks this._iv = undefined; } incCounter(counter); var keystream = counter.slice(0); cipher.encryptBlock(keystream, 0); // Encrypt for (var i = 0; i < blockSize; i++) { words[offset + i] ^= keystream[i]; } } }); CTRGladman.Decryptor = Encryptor; return CTRGladman; }()); return CryptoJS.mode.CTRGladman; })); /***/ }), /***/ "./node_modules/crypto-js/mode-ctr.js": /*!********************************************!*\ !*** ./node_modules/crypto-js/mode-ctr.js ***! \********************************************/ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); } else {} }(this, function (CryptoJS) { /** * Counter block mode. */ CryptoJS.mode.CTR = (function () { var CTR = CryptoJS.lib.BlockCipherMode.extend(); var Encryptor = CTR.Encryptor = CTR.extend({ processBlock: function (words, offset) { // Shortcuts var cipher = this._cipher var blockSize = cipher.blockSize; var iv = this._iv; var counter = this._counter; // Generate keystream if (iv) { counter = this._counter = iv.slice(0); // Remove IV for subsequent blocks this._iv = undefined; } var keystream = counter.slice(0); cipher.encryptBlock(keystream, 0); // Increment counter counter[blockSize - 1] = (counter[blockSize - 1] + 1) | 0 // Encrypt for (var i = 0; i < blockSize; i++) { words[offset + i] ^= keystream[i]; } } }); CTR.Decryptor = Encryptor; return CTR; }()); return CryptoJS.mode.CTR; })); /***/ }), /***/ "./node_modules/crypto-js/mode-ecb.js": /*!********************************************!*\ !*** ./node_modules/crypto-js/mode-ecb.js ***! \********************************************/ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); } else {} }(this, function (CryptoJS) { /** * Electronic Codebook block mode. */ CryptoJS.mode.ECB = (function () { var ECB = CryptoJS.lib.BlockCipherMode.extend(); ECB.Encryptor = ECB.extend({ processBlock: function (words, offset) { this._cipher.encryptBlock(words, offset); } }); ECB.Decryptor = ECB.extend({ processBlock: function (words, offset) { this._cipher.decryptBlock(words, offset); } }); return ECB; }()); return CryptoJS.mode.ECB; })); /***/ }), /***/ "./node_modules/crypto-js/mode-ofb.js": /*!********************************************!*\ !*** ./node_modules/crypto-js/mode-ofb.js ***! \********************************************/ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); } else {} }(this, function (CryptoJS) { /** * Output Feedback block mode. */ CryptoJS.mode.OFB = (function () { var OFB = CryptoJS.lib.BlockCipherMode.extend(); var Encryptor = OFB.Encryptor = OFB.extend({ processBlock: function (words, offset) { // Shortcuts var cipher = this._cipher var blockSize = cipher.blockSize; var iv = this._iv; var keystream = this._keystream; // Generate keystream if (iv) { keystream = this._keystream = iv.slice(0); // Remove IV for subsequent blocks this._iv = undefined; } cipher.encryptBlock(keystream, 0); // Encrypt for (var i = 0; i < blockSize; i++) { words[offset + i] ^= keystream[i]; } } }); OFB.Decryptor = Encryptor; return OFB; }()); return CryptoJS.mode.OFB; })); /***/ }), /***/ "./node_modules/crypto-js/pad-ansix923.js": /*!************************************************!*\ !*** ./node_modules/crypto-js/pad-ansix923.js ***! \************************************************/ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); } else {} }(this, function (CryptoJS) { /** * ANSI X.923 padding strategy. */ CryptoJS.pad.AnsiX923 = { pad: function (data, blockSize) { // Shortcuts var dataSigBytes = data.sigBytes; var blockSizeBytes = blockSize * 4; // Count padding bytes var nPaddingBytes = blockSizeBytes - dataSigBytes % blockSizeBytes; // Compute last byte position var lastBytePos = dataSigBytes + nPaddingBytes - 1; // Pad data.clamp(); data.words[lastBytePos >>> 2] |= nPaddingBytes << (24 - (lastBytePos % 4) * 8); data.sigBytes += nPaddingBytes; }, unpad: function (data) { // Get number of padding bytes from last byte var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff; // Remove padding data.sigBytes -= nPaddingBytes; } }; return CryptoJS.pad.Ansix923; })); /***/ }), /***/ "./node_modules/crypto-js/pad-iso10126.js": /*!************************************************!*\ !*** ./node_modules/crypto-js/pad-iso10126.js ***! \************************************************/ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); } else {} }(this, function (CryptoJS) { /** * ISO 10126 padding strategy. */ CryptoJS.pad.Iso10126 = { pad: function (data, blockSize) { // Shortcut var blockSizeBytes = blockSize * 4; // Count padding bytes var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes; // Pad data.concat(CryptoJS.lib.WordArray.random(nPaddingBytes - 1)). concat(CryptoJS.lib.WordArray.create([nPaddingBytes << 24], 1)); }, unpad: function (data) { // Get number of padding bytes from last byte var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff; // Remove padding data.sigBytes -= nPaddingBytes; } }; return CryptoJS.pad.Iso10126; })); /***/ }), /***/ "./node_modules/crypto-js/pad-iso97971.js": /*!************************************************!*\ !*** ./node_modules/crypto-js/pad-iso97971.js ***! \************************************************/ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); } else {} }(this, function (CryptoJS) { /** * ISO/IEC 9797-1 Padding Method 2. */ CryptoJS.pad.Iso97971 = { pad: function (data, blockSize) { // Add 0x80 byte data.concat(CryptoJS.lib.WordArray.create([0x80000000], 1)); // Zero pad the rest CryptoJS.pad.ZeroPadding.pad(data, blockSize); }, unpad: function (data) { // Remove zero padding CryptoJS.pad.ZeroPadding.unpad(data); // Remove one more byte -- the 0x80 byte data.sigBytes--; } }; return CryptoJS.pad.Iso97971; })); /***/ }), /***/ "./node_modules/crypto-js/pad-nopadding.js": /*!*************************************************!*\ !*** ./node_modules/crypto-js/pad-nopadding.js ***! \*************************************************/ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); } else {} }(this, function (CryptoJS) { /** * A noop padding strategy. */ CryptoJS.pad.NoPadding = { pad: function () { }, unpad: function () { } }; return CryptoJS.pad.NoPadding; })); /***/ }), /***/ "./node_modules/crypto-js/pad-zeropadding.js": /*!***************************************************!*\ !*** ./node_modules/crypto-js/pad-zeropadding.js ***! \***************************************************/ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); } else {} }(this, function (CryptoJS) { /** * Zero padding strategy. */ CryptoJS.pad.ZeroPadding = { pad: function (data, blockSize) { // Shortcut var blockSizeBytes = blockSize * 4; // Pad data.clamp(); data.sigBytes += blockSizeBytes - ((data.sigBytes % blockSizeBytes) || blockSizeBytes); }, unpad: function (data) { // Shortcut var dataWords = data.words; // Unpad var i = data.sigBytes - 1; for (var i = data.sigBytes - 1; i >= 0; i--) { if (((dataWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff)) { data.sigBytes = i + 1; break; } } } }; return CryptoJS.pad.ZeroPadding; })); /***/ }), /***/ "./node_modules/crypto-js/pbkdf2.js": /*!******************************************!*\ !*** ./node_modules/crypto-js/pbkdf2.js ***! \******************************************/ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./sha256 */ "./node_modules/crypto-js/sha256.js"), __webpack_require__(/*! ./hmac */ "./node_modules/crypto-js/hmac.js")); } else {} }(this, function (CryptoJS) { (function () { // Shortcuts var C = CryptoJS; var C_lib = C.lib; var Base = C_lib.Base; var WordArray = C_lib.WordArray; var C_algo = C.algo; var SHA256 = C_algo.SHA256; var HMAC = C_algo.HMAC; /** * Password-Based Key Derivation Function 2 algorithm. */ var PBKDF2 = C_algo.PBKDF2 = Base.extend({ /** * Configuration options. * * @property {number} keySize The key size in words to generate. Default: 4 (128 bits) * @property {Hasher} hasher The hasher to use. Default: SHA256 * @property {number} iterations The number of iterations to perform. Default: 250000 */ cfg: Base.extend({ keySize: 128/32, hasher: SHA256, iterations: 250000 }), /** * Initializes a newly created key derivation function. * * @param {Object} cfg (Optional) The configuration options to use for the derivation. * * @example * * var kdf = CryptoJS.algo.PBKDF2.create(); * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8 }); * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8, iterations: 1000 }); */ init: function (cfg) { this.cfg = this.cfg.extend(cfg); }, /** * Computes the Password-Based Key Derivation Function 2. * * @param {WordArray|string} password The password. * @param {WordArray|string} salt A salt. * * @return {WordArray} The derived key. * * @example * * var key = kdf.compute(password, salt); */ compute: function (password, salt) { // Shortcut var cfg = this.cfg; // Init HMAC var hmac = HMAC.create(cfg.hasher, password); // Initial values var derivedKey = WordArray.create(); var blockIndex = WordArray.create([0x00000001]); // Shortcuts var derivedKeyWords = derivedKey.words; var blockIndexWords = blockIndex.words; var keySize = cfg.keySize; var iterations = cfg.iterations; // Generate key while (derivedKeyWords.length < keySize) { var block = hmac.update(salt).finalize(blockIndex); hmac.reset(); // Shortcuts var blockWords = block.words; var blockWordsLength = blockWords.length; // Iterations var intermediate = block; for (var i = 1; i < iterations; i++) { intermediate = hmac.finalize(intermediate); hmac.reset(); // Shortcut var intermediateWords = intermediate.words; // XOR intermediate with block for (var j = 0; j < blockWordsLength; j++) { blockWords[j] ^= intermediateWords[j]; } } derivedKey.concat(block); blockIndexWords[0]++; } derivedKey.sigBytes = keySize * 4; return derivedKey; } }); /** * Computes the Password-Based Key Derivation Function 2. * * @param {WordArray|string} password The password. * @param {WordArray|string} salt A salt. * @param {Object} cfg (Optional) The configuration options to use for this computation. * * @return {WordArray} The derived key. * * @static * * @example * * var key = CryptoJS.PBKDF2(password, salt); * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8 }); * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8, iterations: 1000 }); */ C.PBKDF2 = function (password, salt, cfg) { return PBKDF2.create(cfg).compute(password, salt); }; }()); return CryptoJS.PBKDF2; })); /***/ }), /***/ "./node_modules/crypto-js/rabbit-legacy.js": /*!*************************************************!*\ !*** ./node_modules/crypto-js/rabbit-legacy.js ***! \*************************************************/ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./enc-base64 */ "./node_modules/crypto-js/enc-base64.js"), __webpack_require__(/*! ./md5 */ "./node_modules/crypto-js/md5.js"), __webpack_require__(/*! ./evpkdf */ "./node_modules/crypto-js/evpkdf.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); } else {} }(this, function (CryptoJS) { (function () { // Shortcuts var C = CryptoJS; var C_lib = C.lib; var StreamCipher = C_lib.StreamCipher; var C_algo = C.algo; // Reusable objects var S = []; var C_ = []; var G = []; /** * Rabbit stream cipher algorithm. * * This is a legacy version that neglected to convert the key to little-endian. * This error doesn't affect the cipher's security, * but it does affect its compatibility with other implementations. */ var RabbitLegacy = C_algo.RabbitLegacy = StreamCipher.extend({ _doReset: function () { // Shortcuts var K = this._key.words; var iv = this.cfg.iv; // Generate initial state values var X = this._X = [ K[0], (K[3] << 16) | (K[2] >>> 16), K[1], (K[0] << 16) | (K[3] >>> 16), K[2], (K[1] << 16) | (K[0] >>> 16), K[3], (K[2] << 16) | (K[1] >>> 16) ]; // Generate initial counter values var C = this._C = [ (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff), (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff), (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff), (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff) ]; // Carry bit this._b = 0; // Iterate the system four times for (var i = 0; i < 4; i++) { nextState.call(this); } // Modify the counters for (var i = 0; i < 8; i++) { C[i] ^= X[(i + 4) & 7]; } // IV setup if (iv) { // Shortcuts var IV = iv.words; var IV_0 = IV[0]; var IV_1 = IV[1]; // Generate four subvectors var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00); var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00); var i1 = (i0 >>> 16) | (i2 & 0xffff0000); var i3 = (i2 << 16) | (i0 & 0x0000ffff); // Modify counter values C[0] ^= i0; C[1] ^= i1; C[2] ^= i2; C[3] ^= i3; C[4] ^= i0; C[5] ^= i1; C[6] ^= i2; C[7] ^= i3; // Iterate the system four times for (var i = 0; i < 4; i++) { nextState.call(this); } } }, _doProcessBlock: function (M, offset) { // Shortcut var X = this._X; // Iterate the system nextState.call(this); // Generate four keystream words S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16); S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16); S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16); S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16); for (var i = 0; i < 4; i++) { // Swap endian S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff) | (((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00); // Encrypt M[offset + i] ^= S[i]; } }, blockSize: 128/32, ivSize: 64/32 }); function nextState() { // Shortcuts var X = this._X; var C = this._C; // Save old counter values for (var i = 0; i < 8; i++) { C_[i] = C[i]; } // Calculate new counter values C[0] = (C[0] + 0x4d34d34d + this._b) | 0; C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0; C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0; C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0; C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0; C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0; C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0; C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0; this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0; // Calculate the g-values for (var i = 0; i < 8; i++) { var gx = X[i] + C[i]; // Construct high and low argument for squaring var ga = gx & 0xffff; var gb = gx >>> 16; // Calculate high and low result of squaring var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb; var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0); // High XOR low G[i] = gh ^ gl; } // Calculate new state values X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0; X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0; X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0; X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0; X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0; X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0; X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0; X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0; } /** * Shortcut functions to the cipher's object interface. * * @example * * var ciphertext = CryptoJS.RabbitLegacy.encrypt(message, key, cfg); * var plaintext = CryptoJS.RabbitLegacy.decrypt(ciphertext, key, cfg); */ C.RabbitLegacy = StreamCipher._createHelper(RabbitLegacy); }()); return CryptoJS.RabbitLegacy; })); /***/ }), /***/ "./node_modules/crypto-js/rabbit.js": /*!******************************************!*\ !*** ./node_modules/crypto-js/rabbit.js ***! \******************************************/ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./enc-base64 */ "./node_modules/crypto-js/enc-base64.js"), __webpack_require__(/*! ./md5 */ "./node_modules/crypto-js/md5.js"), __webpack_require__(/*! ./evpkdf */ "./node_modules/crypto-js/evpkdf.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); } else {} }(this, function (CryptoJS) { (function () { // Shortcuts var C = CryptoJS; var C_lib = C.lib; var StreamCipher = C_lib.StreamCipher; var C_algo = C.algo; // Reusable objects var S = []; var C_ = []; var G = []; /** * Rabbit stream cipher algorithm */ var Rabbit = C_algo.Rabbit = StreamCipher.extend({ _doReset: function () { // Shortcuts var K = this._key.words; var iv = this.cfg.iv; // Swap endian for (var i = 0; i < 4; i++) { K[i] = (((K[i] << 8) | (K[i] >>> 24)) & 0x00ff00ff) | (((K[i] << 24) | (K[i] >>> 8)) & 0xff00ff00); } // Generate initial state values var X = this._X = [ K[0], (K[3] << 16) | (K[2] >>> 16), K[1], (K[0] << 16) | (K[3] >>> 16), K[2], (K[1] << 16) | (K[0] >>> 16), K[3], (K[2] << 16) | (K[1] >>> 16) ]; // Generate initial counter values var C = this._C = [ (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff), (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff), (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff), (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff) ]; // Carry bit this._b = 0; // Iterate the system four times for (var i = 0; i < 4; i++) { nextState.call(this); } // Modify the counters for (var i = 0; i < 8; i++) { C[i] ^= X[(i + 4) & 7]; } // IV setup if (iv) { // Shortcuts var IV = iv.words; var IV_0 = IV[0]; var IV_1 = IV[1]; // Generate four subvectors var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00); var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00); var i1 = (i0 >>> 16) | (i2 & 0xffff0000); var i3 = (i2 << 16) | (i0 & 0x0000ffff); // Modify counter values C[0] ^= i0; C[1] ^= i1; C[2] ^= i2; C[3] ^= i3; C[4] ^= i0; C[5] ^= i1; C[6] ^= i2; C[7] ^= i3; // Iterate the system four times for (var i = 0; i < 4; i++) { nextState.call(this); } } }, _doProcessBlock: function (M, offset) { // Shortcut var X = this._X; // Iterate the system nextState.call(this); // Generate four keystream words S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16); S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16); S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16); S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16); for (var i = 0; i < 4; i++) { // Swap endian S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff) | (((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00); // Encrypt M[offset + i] ^= S[i]; } }, blockSize: 128/32, ivSize: 64/32 }); function nextState() { // Shortcuts var X = this._X; var C = this._C; // Save old counter values for (var i = 0; i < 8; i++) { C_[i] = C[i]; } // Calculate new counter values C[0] = (C[0] + 0x4d34d34d + this._b) | 0; C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0; C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0; C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0; C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0; C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0; C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0; C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0; this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0; // Calculate the g-values for (var i = 0; i < 8; i++) { var gx = X[i] + C[i]; // Construct high and low argument for squaring var ga = gx & 0xffff; var gb = gx >>> 16; // Calculate high and low result of squaring var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb; var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0); // High XOR low G[i] = gh ^ gl; } // Calculate new state values X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0; X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0; X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0; X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0; X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0; X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0; X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0; X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0; } /** * Shortcut functions to the cipher's object interface. * * @example * * var ciphertext = CryptoJS.Rabbit.encrypt(message, key, cfg); * var plaintext = CryptoJS.Rabbit.decrypt(ciphertext, key, cfg); */ C.Rabbit = StreamCipher._createHelper(Rabbit); }()); return CryptoJS.Rabbit; })); /***/ }), /***/ "./node_modules/crypto-js/rc4.js": /*!***************************************!*\ !*** ./node_modules/crypto-js/rc4.js ***! \***************************************/ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./enc-base64 */ "./node_modules/crypto-js/enc-base64.js"), __webpack_require__(/*! ./md5 */ "./node_modules/crypto-js/md5.js"), __webpack_require__(/*! ./evpkdf */ "./node_modules/crypto-js/evpkdf.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); } else {} }(this, function (CryptoJS) { (function () { // Shortcuts var C = CryptoJS; var C_lib = C.lib; var StreamCipher = C_lib.StreamCipher; var C_algo = C.algo; /** * RC4 stream cipher algorithm. */ var RC4 = C_algo.RC4 = StreamCipher.extend({ _doReset: function () { // Shortcuts var key = this._key; var keyWords = key.words; var keySigBytes = key.sigBytes; // Init sbox var S = this._S = []; for (var i = 0; i < 256; i++) { S[i] = i; } // Key setup for (var i = 0, j = 0; i < 256; i++) { var keyByteIndex = i % keySigBytes; var keyByte = (keyWords[keyByteIndex >>> 2] >>> (24 - (keyByteIndex % 4) * 8)) & 0xff; j = (j + S[i] + keyByte) % 256; // Swap var t = S[i]; S[i] = S[j]; S[j] = t; } // Counters this._i = this._j = 0; }, _doProcessBlock: function (M, offset) { M[offset] ^= generateKeystreamWord.call(this); }, keySize: 256/32, ivSize: 0 }); function generateKeystreamWord() { // Shortcuts var S = this._S; var i = this._i; var j = this._j; // Generate keystream word var keystreamWord = 0; for (var n = 0; n < 4; n++) { i = (i + 1) % 256; j = (j + S[i]) % 256; // Swap var t = S[i]; S[i] = S[j]; S[j] = t; keystreamWord |= S[(S[i] + S[j]) % 256] << (24 - n * 8); } // Update counters this._i = i; this._j = j; return keystreamWord; } /** * Shortcut functions to the cipher's object interface. * * @example * * var ciphertext = CryptoJS.RC4.encrypt(message, key, cfg); * var plaintext = CryptoJS.RC4.decrypt(ciphertext, key, cfg); */ C.RC4 = StreamCipher._createHelper(RC4); /** * Modified RC4 stream cipher algorithm. */ var RC4Drop = C_algo.RC4Drop = RC4.extend({ /** * Configuration options. * * @property {number} drop The number of keystream words to drop. Default 192 */ cfg: RC4.cfg.extend({ drop: 192 }), _doReset: function () { RC4._doReset.call(this); // Drop for (var i = this.cfg.drop; i > 0; i--) { generateKeystreamWord.call(this); } } }); /** * Shortcut functions to the cipher's object interface. * * @example * * var ciphertext = CryptoJS.RC4Drop.encrypt(message, key, cfg); * var plaintext = CryptoJS.RC4Drop.decrypt(ciphertext, key, cfg); */ C.RC4Drop = StreamCipher._createHelper(RC4Drop); }()); return CryptoJS.RC4; })); /***/ }), /***/ "./node_modules/crypto-js/ripemd160.js": /*!*********************************************!*\ !*** ./node_modules/crypto-js/ripemd160.js ***! \*********************************************/ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); } else {} }(this, function (CryptoJS) { /** @preserve (c) 2012 by Cédric Mesnil. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ (function (Math) { // Shortcuts var C = CryptoJS; var C_lib = C.lib; var WordArray = C_lib.WordArray; var Hasher = C_lib.Hasher; var C_algo = C.algo; // Constants table var _zl = WordArray.create([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13]); var _zr = WordArray.create([ 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11]); var _sl = WordArray.create([ 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6 ]); var _sr = WordArray.create([ 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11 ]); var _hl = WordArray.create([ 0x00000000, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E]); var _hr = WordArray.create([ 0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0x00000000]); /** * RIPEMD160 hash algorithm. */ var RIPEMD160 = C_algo.RIPEMD160 = Hasher.extend({ _doReset: function () { this._hash = WordArray.create([0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0]); }, _doProcessBlock: function (M, offset) { // Swap endian for (var i = 0; i < 16; i++) { // Shortcuts var offset_i = offset + i; var M_offset_i = M[offset_i]; // Swap M[offset_i] = ( (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) | (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00) ); } // Shortcut var H = this._hash.words; var hl = _hl.words; var hr = _hr.words; var zl = _zl.words; var zr = _zr.words; var sl = _sl.words; var sr = _sr.words; // Working variables var al, bl, cl, dl, el; var ar, br, cr, dr, er; ar = al = H[0]; br = bl = H[1]; cr = cl = H[2]; dr = dl = H[3]; er = el = H[4]; // Computation var t; for (var i = 0; i < 80; i += 1) { t = (al + M[offset+zl[i]])|0; if (i<16){ t += f1(bl,cl,dl) + hl[0]; } else if (i<32) { t += f2(bl,cl,dl) + hl[1]; } else if (i<48) { t += f3(bl,cl,dl) + hl[2]; } else if (i<64) { t += f4(bl,cl,dl) + hl[3]; } else {// if (i<80) { t += f5(bl,cl,dl) + hl[4]; } t = t|0; t = rotl(t,sl[i]); t = (t+el)|0; al = el; el = dl; dl = rotl(cl, 10); cl = bl; bl = t; t = (ar + M[offset+zr[i]])|0; if (i<16){ t += f5(br,cr,dr) + hr[0]; } else if (i<32) { t += f4(br,cr,dr) + hr[1]; } else if (i<48) { t += f3(br,cr,dr) + hr[2]; } else if (i<64) { t += f2(br,cr,dr) + hr[3]; } else {// if (i<80) { t += f1(br,cr,dr) + hr[4]; } t = t|0; t = rotl(t,sr[i]) ; t = (t+er)|0; ar = er; er = dr; dr = rotl(cr, 10); cr = br; br = t; } // Intermediate hash value t = (H[1] + cl + dr)|0; H[1] = (H[2] + dl + er)|0; H[2] = (H[3] + el + ar)|0; H[3] = (H[4] + al + br)|0; H[4] = (H[0] + bl + cr)|0; H[0] = t; }, _doFinalize: function () { // Shortcuts var data = this._data; var dataWords = data.words; var nBitsTotal = this._nDataBytes * 8; var nBitsLeft = data.sigBytes * 8; // Add padding dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = ( (((nBitsTotal << 8) | (nBitsTotal >>> 24)) & 0x00ff00ff) | (((nBitsTotal << 24) | (nBitsTotal >>> 8)) & 0xff00ff00) ); data.sigBytes = (dataWords.length + 1) * 4; // Hash final blocks this._process(); // Shortcuts var hash = this._hash; var H = hash.words; // Swap endian for (var i = 0; i < 5; i++) { // Shortcut var H_i = H[i]; // Swap H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) | (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00); } // Return final computed hash return hash; }, clone: function () { var clone = Hasher.clone.call(this); clone._hash = this._hash.clone(); return clone; } }); function f1(x, y, z) { return ((x) ^ (y) ^ (z)); } function f2(x, y, z) { return (((x)&(y)) | ((~x)&(z))); } function f3(x, y, z) { return (((x) | (~(y))) ^ (z)); } function f4(x, y, z) { return (((x) & (z)) | ((y)&(~(z)))); } function f5(x, y, z) { return ((x) ^ ((y) |(~(z)))); } function rotl(x,n) { return (x<<n) | (x>>>(32-n)); } /** * Shortcut function to the hasher's object interface. * * @param {WordArray|string} message The message to hash. * * @return {WordArray} The hash. * * @static * * @example * * var hash = CryptoJS.RIPEMD160('message'); * var hash = CryptoJS.RIPEMD160(wordArray); */ C.RIPEMD160 = Hasher._createHelper(RIPEMD160); /** * Shortcut function to the HMAC's object interface. * * @param {WordArray|string} message The message to hash. * @param {WordArray|string} key The secret key. * * @return {WordArray} The HMAC. * * @static * * @example * * var hmac = CryptoJS.HmacRIPEMD160(message, key); */ C.HmacRIPEMD160 = Hasher._createHmacHelper(RIPEMD160); }(Math)); return CryptoJS.RIPEMD160; })); /***/ }), /***/ "./node_modules/crypto-js/sha1.js": /*!****************************************!*\ !*** ./node_modules/crypto-js/sha1.js ***! \****************************************/ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); } else {} }(this, function (CryptoJS) { (function () { // Shortcuts var C = CryptoJS; var C_lib = C.lib; var WordArray = C_lib.WordArray; var Hasher = C_lib.Hasher; var C_algo = C.algo; // Reusable object var W = []; /** * SHA-1 hash algorithm. */ var SHA1 = C_algo.SHA1 = Hasher.extend({ _doReset: function () { this._hash = new WordArray.init([ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0 ]); }, _doProcessBlock: function (M, offset) { // Shortcut var H = this._hash.words; // Working variables var a = H[0]; var b = H[1]; var c = H[2]; var d = H[3]; var e = H[4]; // Computation for (var i = 0; i < 80; i++) { if (i < 16) { W[i] = M[offset + i] | 0; } else { var n = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]; W[i] = (n << 1) | (n >>> 31); } var t = ((a << 5) | (a >>> 27)) + e + W[i]; if (i < 20) { t += ((b & c) | (~b & d)) + 0x5a827999; } else if (i < 40) { t += (b ^ c ^ d) + 0x6ed9eba1; } else if (i < 60) { t += ((b & c) | (b & d) | (c & d)) - 0x70e44324; } else /* if (i < 80) */ { t += (b ^ c ^ d) - 0x359d3e2a; } e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t; } // Intermediate hash value H[0] = (H[0] + a) | 0; H[1] = (H[1] + b) | 0; H[2] = (H[2] + c) | 0; H[3] = (H[3] + d) | 0; H[4] = (H[4] + e) | 0; }, _doFinalize: function () { // Shortcuts var data = this._data; var dataWords = data.words; var nBitsTotal = this._nDataBytes * 8; var nBitsLeft = data.sigBytes * 8; // Add padding dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000); dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal; data.sigBytes = dataWords.length * 4; // Hash final blocks this._process(); // Return final computed hash return this._hash; }, clone: function () { var clone = Hasher.clone.call(this); clone._hash = this._hash.clone(); return clone; } }); /** * Shortcut function to the hasher's object interface. * * @param {WordArray|string} message The message to hash. * * @return {WordArray} The hash. * * @static * * @example * * var hash = CryptoJS.SHA1('message'); * var hash = CryptoJS.SHA1(wordArray); */ C.SHA1 = Hasher._createHelper(SHA1); /** * Shortcut function to the HMAC's object interface. * * @param {WordArray|string} message The message to hash. * @param {WordArray|string} key The secret key. * * @return {WordArray} The HMAC. * * @static * * @example * * var hmac = CryptoJS.HmacSHA1(message, key); */ C.HmacSHA1 = Hasher._createHmacHelper(SHA1); }()); return CryptoJS.SHA1; })); /***/ }), /***/ "./node_modules/crypto-js/sha224.js": /*!******************************************!*\ !*** ./node_modules/crypto-js/sha224.js ***! \******************************************/ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./sha256 */ "./node_modules/crypto-js/sha256.js")); } else {} }(this, function (CryptoJS) { (function () { // Shortcuts var C = CryptoJS; var C_lib = C.lib; var WordArray = C_lib.WordArray; var C_algo = C.algo; var SHA256 = C_algo.SHA256; /** * SHA-224 hash algorithm. */ var SHA224 = C_algo.SHA224 = SHA256.extend({ _doReset: function () { this._hash = new WordArray.init([ 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 ]); }, _doFinalize: function () { var hash = SHA256._doFinalize.call(this); hash.sigBytes -= 4; return hash; } }); /** * Shortcut function to the hasher's object interface. * * @param {WordArray|string} message The message to hash. * * @return {WordArray} The hash. * * @static * * @example * * var hash = CryptoJS.SHA224('message'); * var hash = CryptoJS.SHA224(wordArray); */ C.SHA224 = SHA256._createHelper(SHA224); /** * Shortcut function to the HMAC's object interface. * * @param {WordArray|string} message The message to hash. * @param {WordArray|string} key The secret key. * * @return {WordArray} The HMAC. * * @static * * @example * * var hmac = CryptoJS.HmacSHA224(message, key); */ C.HmacSHA224 = SHA256._createHmacHelper(SHA224); }()); return CryptoJS.SHA224; })); /***/ }), /***/ "./node_modules/crypto-js/sha256.js": /*!******************************************!*\ !*** ./node_modules/crypto-js/sha256.js ***! \******************************************/ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); } else {} }(this, function (CryptoJS) { (function (Math) { // Shortcuts var C = CryptoJS; var C_lib = C.lib; var WordArray = C_lib.WordArray; var Hasher = C_lib.Hasher; var C_algo = C.algo; // Initialization and round constants tables var H = []; var K = []; // Compute constants (function () { function isPrime(n) { var sqrtN = Math.sqrt(n); for (var factor = 2; factor <= sqrtN; factor++) { if (!(n % factor)) { return false; } } return true; } function getFractionalBits(n) { return ((n - (n | 0)) * 0x100000000) | 0; } var n = 2; var nPrime = 0; while (nPrime < 64) { if (isPrime(n)) { if (nPrime < 8) { H[nPrime] = getFractionalBits(Math.pow(n, 1 / 2)); } K[nPrime] = getFractionalBits(Math.pow(n, 1 / 3)); nPrime++; } n++; } }()); // Reusable object var W = []; /** * SHA-256 hash algorithm. */ var SHA256 = C_algo.SHA256 = Hasher.extend({ _doReset: function () { this._hash = new WordArray.init(H.slice(0)); }, _doProcessBlock: function (M, offset) { // Shortcut var H = this._hash.words; // Working variables var a = H[0]; var b = H[1]; var c = H[2]; var d = H[3]; var e = H[4]; var f = H[5]; var g = H[6]; var h = H[7]; // Computation for (var i = 0; i < 64; i++) { if (i < 16) { W[i] = M[offset + i] | 0; } else { var gamma0x = W[i - 15]; var gamma0 = ((gamma0x << 25) | (gamma0x >>> 7)) ^ ((gamma0x << 14) | (gamma0x >>> 18)) ^ (gamma0x >>> 3); var gamma1x = W[i - 2]; var gamma1 = ((gamma1x << 15) | (gamma1x >>> 17)) ^ ((gamma1x << 13) | (gamma1x >>> 19)) ^ (gamma1x >>> 10); W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]; } var ch = (e & f) ^ (~e & g); var maj = (a & b) ^ (a & c) ^ (b & c); var sigma0 = ((a << 30) | (a >>> 2)) ^ ((a << 19) | (a >>> 13)) ^ ((a << 10) | (a >>> 22)); var sigma1 = ((e << 26) | (e >>> 6)) ^ ((e << 21) | (e >>> 11)) ^ ((e << 7) | (e >>> 25)); var t1 = h + sigma1 + ch + K[i] + W[i]; var t2 = sigma0 + maj; h = g; g = f; f = e; e = (d + t1) | 0; d = c; c = b; b = a; a = (t1 + t2) | 0; } // Intermediate hash value H[0] = (H[0] + a) | 0; H[1] = (H[1] + b) | 0; H[2] = (H[2] + c) | 0; H[3] = (H[3] + d) | 0; H[4] = (H[4] + e) | 0; H[5] = (H[5] + f) | 0; H[6] = (H[6] + g) | 0; H[7] = (H[7] + h) | 0; }, _doFinalize: function () { // Shortcuts var data = this._data; var dataWords = data.words; var nBitsTotal = this._nDataBytes * 8; var nBitsLeft = data.sigBytes * 8; // Add padding dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000); dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal; data.sigBytes = dataWords.length * 4; // Hash final blocks this._process(); // Return final computed hash return this._hash; }, clone: function () { var clone = Hasher.clone.call(this); clone._hash = this._hash.clone(); return clone; } }); /** * Shortcut function to the hasher's object interface. * * @param {WordArray|string} message The message to hash. * * @return {WordArray} The hash. * * @static * * @example * * var hash = CryptoJS.SHA256('message'); * var hash = CryptoJS.SHA256(wordArray); */ C.SHA256 = Hasher._createHelper(SHA256); /** * Shortcut function to the HMAC's object interface. * * @param {WordArray|string} message The message to hash. * @param {WordArray|string} key The secret key. * * @return {WordArray} The HMAC. * * @static * * @example * * var hmac = CryptoJS.HmacSHA256(message, key); */ C.HmacSHA256 = Hasher._createHmacHelper(SHA256); }(Math)); return CryptoJS.SHA256; })); /***/ }), /***/ "./node_modules/crypto-js/sha3.js": /*!****************************************!*\ !*** ./node_modules/crypto-js/sha3.js ***! \****************************************/ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./x64-core */ "./node_modules/crypto-js/x64-core.js")); } else {} }(this, function (CryptoJS) { (function (Math) { // Shortcuts var C = CryptoJS; var C_lib = C.lib; var WordArray = C_lib.WordArray; var Hasher = C_lib.Hasher; var C_x64 = C.x64; var X64Word = C_x64.Word; var C_algo = C.algo; // Constants tables var RHO_OFFSETS = []; var PI_INDEXES = []; var ROUND_CONSTANTS = []; // Compute Constants (function () { // Compute rho offset constants var x = 1, y = 0; for (var t = 0; t < 24; t++) { RHO_OFFSETS[x + 5 * y] = ((t + 1) * (t + 2) / 2) % 64; var newX = y % 5; var newY = (2 * x + 3 * y) % 5; x = newX; y = newY; } // Compute pi index constants for (var x = 0; x < 5; x++) { for (var y = 0; y < 5; y++) { PI_INDEXES[x + 5 * y] = y + ((2 * x + 3 * y) % 5) * 5; } } // Compute round constants var LFSR = 0x01; for (var i = 0; i < 24; i++) { var roundConstantMsw = 0; var roundConstantLsw = 0; for (var j = 0; j < 7; j++) { if (LFSR & 0x01) { var bitPosition = (1 << j) - 1; if (bitPosition < 32) { roundConstantLsw ^= 1 << bitPosition; } else /* if (bitPosition >= 32) */ { roundConstantMsw ^= 1 << (bitPosition - 32); } } // Compute next LFSR if (LFSR & 0x80) { // Primitive polynomial over GF(2): x^8 + x^6 + x^5 + x^4 + 1 LFSR = (LFSR << 1) ^ 0x71; } else { LFSR <<= 1; } } ROUND_CONSTANTS[i] = X64Word.create(roundConstantMsw, roundConstantLsw); } }()); // Reusable objects for temporary values var T = []; (function () { for (var i = 0; i < 25; i++) { T[i] = X64Word.create(); } }()); /** * SHA-3 hash algorithm. */ var SHA3 = C_algo.SHA3 = Hasher.extend({ /** * Configuration options. * * @property {number} outputLength * The desired number of bits in the output hash. * Only values permitted are: 224, 256, 384, 512. * Default: 512 */ cfg: Hasher.cfg.extend({ outputLength: 512 }), _doReset: function () { var state = this._state = [] for (var i = 0; i < 25; i++) { state[i] = new X64Word.init(); } this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32; }, _doProcessBlock: function (M, offset) { // Shortcuts var state = this._state; var nBlockSizeLanes = this.blockSize / 2; // Absorb for (var i = 0; i < nBlockSizeLanes; i++) { // Shortcuts var M2i = M[offset + 2 * i]; var M2i1 = M[offset + 2 * i + 1]; // Swap endian M2i = ( (((M2i << 8) | (M2i >>> 24)) & 0x00ff00ff) | (((M2i << 24) | (M2i >>> 8)) & 0xff00ff00) ); M2i1 = ( (((M2i1 << 8) | (M2i1 >>> 24)) & 0x00ff00ff) | (((M2i1 << 24) | (M2i1 >>> 8)) & 0xff00ff00) ); // Absorb message into state var lane = state[i]; lane.high ^= M2i1; lane.low ^= M2i; } // Rounds for (var round = 0; round < 24; round++) { // Theta for (var x = 0; x < 5; x++) { // Mix column lanes var tMsw = 0, tLsw = 0; for (var y = 0; y < 5; y++) { var lane = state[x + 5 * y]; tMsw ^= lane.high; tLsw ^= lane.low; } // Temporary values var Tx = T[x]; Tx.high = tMsw; Tx.low = tLsw; } for (var x = 0; x < 5; x++) { // Shortcuts var Tx4 = T[(x + 4) % 5]; var Tx1 = T[(x + 1) % 5]; var Tx1Msw = Tx1.high; var Tx1Lsw = Tx1.low; // Mix surrounding columns var tMsw = Tx4.high ^ ((Tx1Msw << 1) | (Tx1Lsw >>> 31)); var tLsw = Tx4.low ^ ((Tx1Lsw << 1) | (Tx1Msw >>> 31)); for (var y = 0; y < 5; y++) { var lane = state[x + 5 * y]; lane.high ^= tMsw; lane.low ^= tLsw; } } // Rho Pi for (var laneIndex = 1; laneIndex < 25; laneIndex++) { var tMsw; var tLsw; // Shortcuts var lane = state[laneIndex]; var laneMsw = lane.high; var laneLsw = lane.low; var rhoOffset = RHO_OFFSETS[laneIndex]; // Rotate lanes if (rhoOffset < 32) { tMsw = (laneMsw << rhoOffset) | (laneLsw >>> (32 - rhoOffset)); tLsw = (laneLsw << rhoOffset) | (laneMsw >>> (32 - rhoOffset)); } else /* if (rhoOffset >= 32) */ { tMsw = (laneLsw << (rhoOffset - 32)) | (laneMsw >>> (64 - rhoOffset)); tLsw = (laneMsw << (rhoOffset - 32)) | (laneLsw >>> (64 - rhoOffset)); } // Transpose lanes var TPiLane = T[PI_INDEXES[laneIndex]]; TPiLane.high = tMsw; TPiLane.low = tLsw; } // Rho pi at x = y = 0 var T0 = T[0]; var state0 = state[0]; T0.high = state0.high; T0.low = state0.low; // Chi for (var x = 0; x < 5; x++) { for (var y = 0; y < 5; y++) { // Shortcuts var laneIndex = x + 5 * y; var lane = state[laneIndex]; var TLane = T[laneIndex]; var Tx1Lane = T[((x + 1) % 5) + 5 * y]; var Tx2Lane = T[((x + 2) % 5) + 5 * y]; // Mix rows lane.high = TLane.high ^ (~Tx1Lane.high & Tx2Lane.high); lane.low = TLane.low ^ (~Tx1Lane.low & Tx2Lane.low); } } // Iota var lane = state[0]; var roundConstant = ROUND_CONSTANTS[round]; lane.high ^= roundConstant.high; lane.low ^= roundConstant.low; } }, _doFinalize: function () { // Shortcuts var data = this._data; var dataWords = data.words; var nBitsTotal = this._nDataBytes * 8; var nBitsLeft = data.sigBytes * 8; var blockSizeBits = this.blockSize * 32; // Add padding dataWords[nBitsLeft >>> 5] |= 0x1 << (24 - nBitsLeft % 32); dataWords[((Math.ceil((nBitsLeft + 1) / blockSizeBits) * blockSizeBits) >>> 5) - 1] |= 0x80; data.sigBytes = dataWords.length * 4; // Hash final blocks this._process(); // Shortcuts var state = this._state; var outputLengthBytes = this.cfg.outputLength / 8; var outputLengthLanes = outputLengthBytes / 8; // Squeeze var hashWords = []; for (var i = 0; i < outputLengthLanes; i++) { // Shortcuts var lane = state[i]; var laneMsw = lane.high; var laneLsw = lane.low; // Swap endian laneMsw = ( (((laneMsw << 8) | (laneMsw >>> 24)) & 0x00ff00ff) | (((laneMsw << 24) | (laneMsw >>> 8)) & 0xff00ff00) ); laneLsw = ( (((laneLsw << 8) | (laneLsw >>> 24)) & 0x00ff00ff) | (((laneLsw << 24) | (laneLsw >>> 8)) & 0xff00ff00) ); // Squeeze state to retrieve hash hashWords.push(laneLsw); hashWords.push(laneMsw); } // Return final computed hash return new WordArray.init(hashWords, outputLengthBytes); }, clone: function () { var clone = Hasher.clone.call(this); var state = clone._state = this._state.slice(0); for (var i = 0; i < 25; i++) { state[i] = state[i].clone(); } return clone; } }); /** * Shortcut function to the hasher's object interface. * * @param {WordArray|string} message The message to hash. * * @return {WordArray} The hash. * * @static * * @example * * var hash = CryptoJS.SHA3('message'); * var hash = CryptoJS.SHA3(wordArray); */ C.SHA3 = Hasher._createHelper(SHA3); /** * Shortcut function to the HMAC's object interface. * * @param {WordArray|string} message The message to hash. * @param {WordArray|string} key The secret key. * * @return {WordArray} The HMAC. * * @static * * @example * * var hmac = CryptoJS.HmacSHA3(message, key); */ C.HmacSHA3 = Hasher._createHmacHelper(SHA3); }(Math)); return CryptoJS.SHA3; })); /***/ }), /***/ "./node_modules/crypto-js/sha384.js": /*!******************************************!*\ !*** ./node_modules/crypto-js/sha384.js ***! \******************************************/ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./x64-core */ "./node_modules/crypto-js/x64-core.js"), __webpack_require__(/*! ./sha512 */ "./node_modules/crypto-js/sha512.js")); } else {} }(this, function (CryptoJS) { (function () { // Shortcuts var C = CryptoJS; var C_x64 = C.x64; var X64Word = C_x64.Word; var X64WordArray = C_x64.WordArray; var C_algo = C.algo; var SHA512 = C_algo.SHA512; /** * SHA-384 hash algorithm. */ var SHA384 = C_algo.SHA384 = SHA512.extend({ _doReset: function () { this._hash = new X64WordArray.init([ new X64Word.init(0xcbbb9d5d, 0xc1059ed8), new X64Word.init(0x629a292a, 0x367cd507), new X64Word.init(0x9159015a, 0x3070dd17), new X64Word.init(0x152fecd8, 0xf70e5939), new X64Word.init(0x67332667, 0xffc00b31), new X64Word.init(0x8eb44a87, 0x68581511), new X64Word.init(0xdb0c2e0d, 0x64f98fa7), new X64Word.init(0x47b5481d, 0xbefa4fa4) ]); }, _doFinalize: function () { var hash = SHA512._doFinalize.call(this); hash.sigBytes -= 16; return hash; } }); /** * Shortcut function to the hasher's object interface. * * @param {WordArray|string} message The message to hash. * * @return {WordArray} The hash. * * @static * * @example * * var hash = CryptoJS.SHA384('message'); * var hash = CryptoJS.SHA384(wordArray); */ C.SHA384 = SHA512._createHelper(SHA384); /** * Shortcut function to the HMAC's object interface. * * @param {WordArray|string} message The message to hash. * @param {WordArray|string} key The secret key. * * @return {WordArray} The HMAC. * * @static * * @example * * var hmac = CryptoJS.HmacSHA384(message, key); */ C.HmacSHA384 = SHA512._createHmacHelper(SHA384); }()); return CryptoJS.SHA384; })); /***/ }), /***/ "./node_modules/crypto-js/sha512.js": /*!******************************************!*\ !*** ./node_modules/crypto-js/sha512.js ***! \******************************************/ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./x64-core */ "./node_modules/crypto-js/x64-core.js")); } else {} }(this, function (CryptoJS) { (function () { // Shortcuts var C = CryptoJS; var C_lib = C.lib; var Hasher = C_lib.Hasher; var C_x64 = C.x64; var X64Word = C_x64.Word; var X64WordArray = C_x64.WordArray; var C_algo = C.algo; function X64Word_create() { return X64Word.create.apply(X64Word, arguments); } // Constants var K = [ X64Word_create(0x428a2f98, 0xd728ae22), X64Word_create(0x71374491, 0x23ef65cd), X64Word_create(0xb5c0fbcf, 0xec4d3b2f), X64Word_create(0xe9b5dba5, 0x8189dbbc), X64Word_create(0x3956c25b, 0xf348b538), X64Word_create(0x59f111f1, 0xb605d019), X64Word_create(0x923f82a4, 0xaf194f9b), X64Word_create(0xab1c5ed5, 0xda6d8118), X64Word_create(0xd807aa98, 0xa3030242), X64Word_create(0x12835b01, 0x45706fbe), X64Word_create(0x243185be, 0x4ee4b28c), X64Word_create(0x550c7dc3, 0xd5ffb4e2), X64Word_create(0x72be5d74, 0xf27b896f), X64Word_create(0x80deb1fe, 0x3b1696b1), X64Word_create(0x9bdc06a7, 0x25c71235), X64Word_create(0xc19bf174, 0xcf692694), X64Word_create(0xe49b69c1, 0x9ef14ad2), X64Word_create(0xefbe4786, 0x384f25e3), X64Word_create(0x0fc19dc6, 0x8b8cd5b5), X64Word_create(0x240ca1cc, 0x77ac9c65), X64Word_create(0x2de92c6f, 0x592b0275), X64Word_create(0x4a7484aa, 0x6ea6e483), X64Word_create(0x5cb0a9dc, 0xbd41fbd4), X64Word_create(0x76f988da, 0x831153b5), X64Word_create(0x983e5152, 0xee66dfab), X64Word_create(0xa831c66d, 0x2db43210), X64Word_create(0xb00327c8, 0x98fb213f), X64Word_create(0xbf597fc7, 0xbeef0ee4), X64Word_create(0xc6e00bf3, 0x3da88fc2), X64Word_create(0xd5a79147, 0x930aa725), X64Word_create(0x06ca6351, 0xe003826f), X64Word_create(0x14292967, 0x0a0e6e70), X64Word_create(0x27b70a85, 0x46d22ffc), X64Word_create(0x2e1b2138, 0x5c26c926), X64Word_create(0x4d2c6dfc, 0x5ac42aed), X64Word_create(0x53380d13, 0x9d95b3df), X64Word_create(0x650a7354, 0x8baf63de), X64Word_create(0x766a0abb, 0x3c77b2a8), X64Word_create(0x81c2c92e, 0x47edaee6), X64Word_create(0x92722c85, 0x1482353b), X64Word_create(0xa2bfe8a1, 0x4cf10364), X64Word_create(0xa81a664b, 0xbc423001), X64Word_create(0xc24b8b70, 0xd0f89791), X64Word_create(0xc76c51a3, 0x0654be30), X64Word_create(0xd192e819, 0xd6ef5218), X64Word_create(0xd6990624, 0x5565a910), X64Word_create(0xf40e3585, 0x5771202a), X64Word_create(0x106aa070, 0x32bbd1b8), X64Word_create(0x19a4c116, 0xb8d2d0c8), X64Word_create(0x1e376c08, 0x5141ab53), X64Word_create(0x2748774c, 0xdf8eeb99), X64Word_create(0x34b0bcb5, 0xe19b48a8), X64Word_create(0x391c0cb3, 0xc5c95a63), X64Word_create(0x4ed8aa4a, 0xe3418acb), X64Word_create(0x5b9cca4f, 0x7763e373), X64Word_create(0x682e6ff3, 0xd6b2b8a3), X64Word_create(0x748f82ee, 0x5defb2fc), X64Word_create(0x78a5636f, 0x43172f60), X64Word_create(0x84c87814, 0xa1f0ab72), X64Word_create(0x8cc70208, 0x1a6439ec), X64Word_create(0x90befffa, 0x23631e28), X64Word_create(0xa4506ceb, 0xde82bde9), X64Word_create(0xbef9a3f7, 0xb2c67915), X64Word_create(0xc67178f2, 0xe372532b), X64Word_create(0xca273ece, 0xea26619c), X64Word_create(0xd186b8c7, 0x21c0c207), X64Word_create(0xeada7dd6, 0xcde0eb1e), X64Word_create(0xf57d4f7f, 0xee6ed178), X64Word_create(0x06f067aa, 0x72176fba), X64Word_create(0x0a637dc5, 0xa2c898a6), X64Word_create(0x113f9804, 0xbef90dae), X64Word_create(0x1b710b35, 0x131c471b), X64Word_create(0x28db77f5, 0x23047d84), X64Word_create(0x32caab7b, 0x40c72493), X64Word_create(0x3c9ebe0a, 0x15c9bebc), X64Word_create(0x431d67c4, 0x9c100d4c), X64Word_create(0x4cc5d4be, 0xcb3e42b6), X64Word_create(0x597f299c, 0xfc657e2a), X64Word_create(0x5fcb6fab, 0x3ad6faec), X64Word_create(0x6c44198c, 0x4a475817) ]; // Reusable objects var W = []; (function () { for (var i = 0; i < 80; i++) { W[i] = X64Word_create(); } }()); /** * SHA-512 hash algorithm. */ var SHA512 = C_algo.SHA512 = Hasher.extend({ _doReset: function () { this._hash = new X64WordArray.init([ new X64Word.init(0x6a09e667, 0xf3bcc908), new X64Word.init(0xbb67ae85, 0x84caa73b), new X64Word.init(0x3c6ef372, 0xfe94f82b), new X64Word.init(0xa54ff53a, 0x5f1d36f1), new X64Word.init(0x510e527f, 0xade682d1), new X64Word.init(0x9b05688c, 0x2b3e6c1f), new X64Word.init(0x1f83d9ab, 0xfb41bd6b), new X64Word.init(0x5be0cd19, 0x137e2179) ]); }, _doProcessBlock: function (M, offset) { // Shortcuts var H = this._hash.words; var H0 = H[0]; var H1 = H[1]; var H2 = H[2]; var H3 = H[3]; var H4 = H[4]; var H5 = H[5]; var H6 = H[6]; var H7 = H[7]; var H0h = H0.high; var H0l = H0.low; var H1h = H1.high; var H1l = H1.low; var H2h = H2.high; var H2l = H2.low; var H3h = H3.high; var H3l = H3.low; var H4h = H4.high; var H4l = H4.low; var H5h = H5.high; var H5l = H5.low; var H6h = H6.high; var H6l = H6.low; var H7h = H7.high; var H7l = H7.low; // Working variables var ah = H0h; var al = H0l; var bh = H1h; var bl = H1l; var ch = H2h; var cl = H2l; var dh = H3h; var dl = H3l; var eh = H4h; var el = H4l; var fh = H5h; var fl = H5l; var gh = H6h; var gl = H6l; var hh = H7h; var hl = H7l; // Rounds for (var i = 0; i < 80; i++) { var Wil; var Wih; // Shortcut var Wi = W[i]; // Extend message if (i < 16) { Wih = Wi.high = M[offset + i * 2] | 0; Wil = Wi.low = M[offset + i * 2 + 1] | 0; } else { // Gamma0 var gamma0x = W[i - 15]; var gamma0xh = gamma0x.high; var gamma0xl = gamma0x.low; var gamma0h = ((gamma0xh >>> 1) | (gamma0xl << 31)) ^ ((gamma0xh >>> 8) | (gamma0xl << 24)) ^ (gamma0xh >>> 7); var gamma0l = ((gamma0xl >>> 1) | (gamma0xh << 31)) ^ ((gamma0xl >>> 8) | (gamma0xh << 24)) ^ ((gamma0xl >>> 7) | (gamma0xh << 25)); // Gamma1 var gamma1x = W[i - 2]; var gamma1xh = gamma1x.high; var gamma1xl = gamma1x.low; var gamma1h = ((gamma1xh >>> 19) | (gamma1xl << 13)) ^ ((gamma1xh << 3) | (gamma1xl >>> 29)) ^ (gamma1xh >>> 6); var gamma1l = ((gamma1xl >>> 19) | (gamma1xh << 13)) ^ ((gamma1xl << 3) | (gamma1xh >>> 29)) ^ ((gamma1xl >>> 6) | (gamma1xh << 26)); // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16] var Wi7 = W[i - 7]; var Wi7h = Wi7.high; var Wi7l = Wi7.low; var Wi16 = W[i - 16]; var Wi16h = Wi16.high; var Wi16l = Wi16.low; Wil = gamma0l + Wi7l; Wih = gamma0h + Wi7h + ((Wil >>> 0) < (gamma0l >>> 0) ? 1 : 0); Wil = Wil + gamma1l; Wih = Wih + gamma1h + ((Wil >>> 0) < (gamma1l >>> 0) ? 1 : 0); Wil = Wil + Wi16l; Wih = Wih + Wi16h + ((Wil >>> 0) < (Wi16l >>> 0) ? 1 : 0); Wi.high = Wih; Wi.low = Wil; } var chh = (eh & fh) ^ (~eh & gh); var chl = (el & fl) ^ (~el & gl); var majh = (ah & bh) ^ (ah & ch) ^ (bh & ch); var majl = (al & bl) ^ (al & cl) ^ (bl & cl); var sigma0h = ((ah >>> 28) | (al << 4)) ^ ((ah << 30) | (al >>> 2)) ^ ((ah << 25) | (al >>> 7)); var sigma0l = ((al >>> 28) | (ah << 4)) ^ ((al << 30) | (ah >>> 2)) ^ ((al << 25) | (ah >>> 7)); var sigma1h = ((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9)); var sigma1l = ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)); // t1 = h + sigma1 + ch + K[i] + W[i] var Ki = K[i]; var Kih = Ki.high; var Kil = Ki.low; var t1l = hl + sigma1l; var t1h = hh + sigma1h + ((t1l >>> 0) < (hl >>> 0) ? 1 : 0); var t1l = t1l + chl; var t1h = t1h + chh + ((t1l >>> 0) < (chl >>> 0) ? 1 : 0); var t1l = t1l + Kil; var t1h = t1h + Kih + ((t1l >>> 0) < (Kil >>> 0) ? 1 : 0); var t1l = t1l + Wil; var t1h = t1h + Wih + ((t1l >>> 0) < (Wil >>> 0) ? 1 : 0); // t2 = sigma0 + maj var t2l = sigma0l + majl; var t2h = sigma0h + majh + ((t2l >>> 0) < (sigma0l >>> 0) ? 1 : 0); // Update working variables hh = gh; hl = gl; gh = fh; gl = fl; fh = eh; fl = el; el = (dl + t1l) | 0; eh = (dh + t1h + ((el >>> 0) < (dl >>> 0) ? 1 : 0)) | 0; dh = ch; dl = cl; ch = bh; cl = bl; bh = ah; bl = al; al = (t1l + t2l) | 0; ah = (t1h + t2h + ((al >>> 0) < (t1l >>> 0) ? 1 : 0)) | 0; } // Intermediate hash value H0l = H0.low = (H0l + al); H0.high = (H0h + ah + ((H0l >>> 0) < (al >>> 0) ? 1 : 0)); H1l = H1.low = (H1l + bl); H1.high = (H1h + bh + ((H1l >>> 0) < (bl >>> 0) ? 1 : 0)); H2l = H2.low = (H2l + cl); H2.high = (H2h + ch + ((H2l >>> 0) < (cl >>> 0) ? 1 : 0)); H3l = H3.low = (H3l + dl); H3.high = (H3h + dh + ((H3l >>> 0) < (dl >>> 0) ? 1 : 0)); H4l = H4.low = (H4l + el); H4.high = (H4h + eh + ((H4l >>> 0) < (el >>> 0) ? 1 : 0)); H5l = H5.low = (H5l + fl); H5.high = (H5h + fh + ((H5l >>> 0) < (fl >>> 0) ? 1 : 0)); H6l = H6.low = (H6l + gl); H6.high = (H6h + gh + ((H6l >>> 0) < (gl >>> 0) ? 1 : 0)); H7l = H7.low = (H7l + hl); H7.high = (H7h + hh + ((H7l >>> 0) < (hl >>> 0) ? 1 : 0)); }, _doFinalize: function () { // Shortcuts var data = this._data; var dataWords = data.words; var nBitsTotal = this._nDataBytes * 8; var nBitsLeft = data.sigBytes * 8; // Add padding dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 30] = Math.floor(nBitsTotal / 0x100000000); dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 31] = nBitsTotal; data.sigBytes = dataWords.length * 4; // Hash final blocks this._process(); // Convert hash to 32-bit word array before returning var hash = this._hash.toX32(); // Return final computed hash return hash; }, clone: function () { var clone = Hasher.clone.call(this); clone._hash = this._hash.clone(); return clone; }, blockSize: 1024/32 }); /** * Shortcut function to the hasher's object interface. * * @param {WordArray|string} message The message to hash. * * @return {WordArray} The hash. * * @static * * @example * * var hash = CryptoJS.SHA512('message'); * var hash = CryptoJS.SHA512(wordArray); */ C.SHA512 = Hasher._createHelper(SHA512); /** * Shortcut function to the HMAC's object interface. * * @param {WordArray|string} message The message to hash. * @param {WordArray|string} key The secret key. * * @return {WordArray} The HMAC. * * @static * * @example * * var hmac = CryptoJS.HmacSHA512(message, key); */ C.HmacSHA512 = Hasher._createHmacHelper(SHA512); }()); return CryptoJS.SHA512; })); /***/ }), /***/ "./node_modules/crypto-js/tripledes.js": /*!*********************************************!*\ !*** ./node_modules/crypto-js/tripledes.js ***! \*********************************************/ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./enc-base64 */ "./node_modules/crypto-js/enc-base64.js"), __webpack_require__(/*! ./md5 */ "./node_modules/crypto-js/md5.js"), __webpack_require__(/*! ./evpkdf */ "./node_modules/crypto-js/evpkdf.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js")); } else {} }(this, function (CryptoJS) { (function () { // Shortcuts var C = CryptoJS; var C_lib = C.lib; var WordArray = C_lib.WordArray; var BlockCipher = C_lib.BlockCipher; var C_algo = C.algo; // Permuted Choice 1 constants var PC1 = [ 57, 49, 41, 33, 25, 17, 9, 1, 58, 50, 42, 34, 26, 18, 10, 2, 59, 51, 43, 35, 27, 19, 11, 3, 60, 52, 44, 36, 63, 55, 47, 39, 31, 23, 15, 7, 62, 54, 46, 38, 30, 22, 14, 6, 61, 53, 45, 37, 29, 21, 13, 5, 28, 20, 12, 4 ]; // Permuted Choice 2 constants var PC2 = [ 14, 17, 11, 24, 1, 5, 3, 28, 15, 6, 21, 10, 23, 19, 12, 4, 26, 8, 16, 7, 27, 20, 13, 2, 41, 52, 31, 37, 47, 55, 30, 40, 51, 45, 33, 48, 44, 49, 39, 56, 34, 53, 46, 42, 50, 36, 29, 32 ]; // Cumulative bit shift constants var BIT_SHIFTS = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28]; // SBOXes and round permutation constants var SBOX_P = [ { 0x0: 0x808200, 0x10000000: 0x8000, 0x20000000: 0x808002, 0x30000000: 0x2, 0x40000000: 0x200, 0x50000000: 0x808202, 0x60000000: 0x800202, 0x70000000: 0x800000, 0x80000000: 0x202, 0x90000000: 0x800200, 0xa0000000: 0x8200, 0xb0000000: 0x808000, 0xc0000000: 0x8002, 0xd0000000: 0x800002, 0xe0000000: 0x0, 0xf0000000: 0x8202, 0x8000000: 0x0, 0x18000000: 0x808202, 0x28000000: 0x8202, 0x38000000: 0x8000, 0x48000000: 0x808200, 0x58000000: 0x200, 0x68000000: 0x808002, 0x78000000: 0x2, 0x88000000: 0x800200, 0x98000000: 0x8200, 0xa8000000: 0x808000, 0xb8000000: 0x800202, 0xc8000000: 0x800002, 0xd8000000: 0x8002, 0xe8000000: 0x202, 0xf8000000: 0x800000, 0x1: 0x8000, 0x10000001: 0x2, 0x20000001: 0x808200, 0x30000001: 0x800000, 0x40000001: 0x808002, 0x50000001: 0x8200, 0x60000001: 0x200, 0x70000001: 0x800202, 0x80000001: 0x808202, 0x90000001: 0x808000, 0xa0000001: 0x800002, 0xb0000001: 0x8202, 0xc0000001: 0x202, 0xd0000001: 0x800200, 0xe0000001: 0x8002, 0xf0000001: 0x0, 0x8000001: 0x808202, 0x18000001: 0x808000, 0x28000001: 0x800000, 0x38000001: 0x200, 0x48000001: 0x8000, 0x58000001: 0x800002, 0x68000001: 0x2, 0x78000001: 0x8202, 0x88000001: 0x8002, 0x98000001: 0x800202, 0xa8000001: 0x202, 0xb8000001: 0x808200, 0xc8000001: 0x800200, 0xd8000001: 0x0, 0xe8000001: 0x8200, 0xf8000001: 0x808002 }, { 0x0: 0x40084010, 0x1000000: 0x4000, 0x2000000: 0x80000, 0x3000000: 0x40080010, 0x4000000: 0x40000010, 0x5000000: 0x40084000, 0x6000000: 0x40004000, 0x7000000: 0x10, 0x8000000: 0x84000, 0x9000000: 0x40004010, 0xa000000: 0x40000000, 0xb000000: 0x84010, 0xc000000: 0x80010, 0xd000000: 0x0, 0xe000000: 0x4010, 0xf000000: 0x40080000, 0x800000: 0x40004000, 0x1800000: 0x84010, 0x2800000: 0x10, 0x3800000: 0x40004010, 0x4800000: 0x40084010, 0x5800000: 0x40000000, 0x6800000: 0x80000, 0x7800000: 0x40080010, 0x8800000: 0x80010, 0x9800000: 0x0, 0xa800000: 0x4000, 0xb800000: 0x40080000, 0xc800000: 0x40000010, 0xd800000: 0x84000, 0xe800000: 0x40084000, 0xf800000: 0x4010, 0x10000000: 0x0, 0x11000000: 0x40080010, 0x12000000: 0x40004010, 0x13000000: 0x40084000, 0x14000000: 0x40080000, 0x15000000: 0x10, 0x16000000: 0x84010, 0x17000000: 0x4000, 0x18000000: 0x4010, 0x19000000: 0x80000, 0x1a000000: 0x80010, 0x1b000000: 0x40000010, 0x1c000000: 0x84000, 0x1d000000: 0x40004000, 0x1e000000: 0x40000000, 0x1f000000: 0x40084010, 0x10800000: 0x84010, 0x11800000: 0x80000, 0x12800000: 0x40080000, 0x13800000: 0x4000, 0x14800000: 0x40004000, 0x15800000: 0x40084010, 0x16800000: 0x10, 0x17800000: 0x40000000, 0x18800000: 0x40084000, 0x19800000: 0x40000010, 0x1a800000: 0x40004010, 0x1b800000: 0x80010, 0x1c800000: 0x0, 0x1d800000: 0x4010, 0x1e800000: 0x40080010, 0x1f800000: 0x84000 }, { 0x0: 0x104, 0x100000: 0x0, 0x200000: 0x4000100, 0x300000: 0x10104, 0x400000: 0x10004, 0x500000: 0x4000004, 0x600000: 0x4010104, 0x700000: 0x4010000, 0x800000: 0x4000000, 0x900000: 0x4010100, 0xa00000: 0x10100, 0xb00000: 0x4010004, 0xc00000: 0x4000104, 0xd00000: 0x10000, 0xe00000: 0x4, 0xf00000: 0x100, 0x80000: 0x4010100, 0x180000: 0x4010004, 0x280000: 0x0, 0x380000: 0x4000100, 0x480000: 0x4000004, 0x580000: 0x10000, 0x680000: 0x10004, 0x780000: 0x104, 0x880000: 0x4, 0x980000: 0x100, 0xa80000: 0x4010000, 0xb80000: 0x10104, 0xc80000: 0x10100, 0xd80000: 0x4000104, 0xe80000: 0x4010104, 0xf80000: 0x4000000, 0x1000000: 0x4010100, 0x1100000: 0x10004, 0x1200000: 0x10000, 0x1300000: 0x4000100, 0x1400000: 0x100, 0x1500000: 0x4010104, 0x1600000: 0x4000004, 0x1700000: 0x0, 0x1800000: 0x4000104, 0x1900000: 0x4000000, 0x1a00000: 0x4, 0x1b00000: 0x10100, 0x1c00000: 0x4010000, 0x1d00000: 0x104, 0x1e00000: 0x10104, 0x1f00000: 0x4010004, 0x1080000: 0x4000000, 0x1180000: 0x104, 0x1280000: 0x4010100, 0x1380000: 0x0, 0x1480000: 0x10004, 0x1580000: 0x4000100, 0x1680000: 0x100, 0x1780000: 0x4010004, 0x1880000: 0x10000, 0x1980000: 0x4010104, 0x1a80000: 0x10104, 0x1b80000: 0x4000004, 0x1c80000: 0x4000104, 0x1d80000: 0x4010000, 0x1e80000: 0x4, 0x1f80000: 0x10100 }, { 0x0: 0x80401000, 0x10000: 0x80001040, 0x20000: 0x401040, 0x30000: 0x80400000, 0x40000: 0x0, 0x50000: 0x401000, 0x60000: 0x80000040, 0x70000: 0x400040, 0x80000: 0x80000000, 0x90000: 0x400000, 0xa0000: 0x40, 0xb0000: 0x80001000, 0xc0000: 0x80400040, 0xd0000: 0x1040, 0xe0000: 0x1000, 0xf0000: 0x80401040, 0x8000: 0x80001040, 0x18000: 0x40, 0x28000: 0x80400040, 0x38000: 0x80001000, 0x48000: 0x401000, 0x58000: 0x80401040, 0x68000: 0x0, 0x78000: 0x80400000, 0x88000: 0x1000, 0x98000: 0x80401000, 0xa8000: 0x400000, 0xb8000: 0x1040, 0xc8000: 0x80000000, 0xd8000: 0x400040, 0xe8000: 0x401040, 0xf8000: 0x80000040, 0x100000: 0x400040, 0x110000: 0x401000, 0x120000: 0x80000040, 0x130000: 0x0, 0x140000: 0x1040, 0x150000: 0x80400040, 0x160000: 0x80401000, 0x170000: 0x80001040, 0x180000: 0x80401040, 0x190000: 0x80000000, 0x1a0000: 0x80400000, 0x1b0000: 0x401040, 0x1c0000: 0x80001000, 0x1d0000: 0x400000, 0x1e0000: 0x40, 0x1f0000: 0x1000, 0x108000: 0x80400000, 0x118000: 0x80401040, 0x128000: 0x0, 0x138000: 0x401000, 0x148000: 0x400040, 0x158000: 0x80000000, 0x168000: 0x80001040, 0x178000: 0x40, 0x188000: 0x80000040, 0x198000: 0x1000, 0x1a8000: 0x80001000, 0x1b8000: 0x80400040, 0x1c8000: 0x1040, 0x1d8000: 0x80401000, 0x1e8000: 0x400000, 0x1f8000: 0x401040 }, { 0x0: 0x80, 0x1000: 0x1040000, 0x2000: 0x40000, 0x3000: 0x20000000, 0x4000: 0x20040080, 0x5000: 0x1000080, 0x6000: 0x21000080, 0x7000: 0x40080, 0x8000: 0x1000000, 0x9000: 0x20040000, 0xa000: 0x20000080, 0xb000: 0x21040080, 0xc000: 0x21040000, 0xd000: 0x0, 0xe000: 0x1040080, 0xf000: 0x21000000, 0x800: 0x1040080, 0x1800: 0x21000080, 0x2800: 0x80, 0x3800: 0x1040000, 0x4800: 0x40000, 0x5800: 0x20040080, 0x6800: 0x21040000, 0x7800: 0x20000000, 0x8800: 0x20040000, 0x9800: 0x0, 0xa800: 0x21040080, 0xb800: 0x1000080, 0xc800: 0x20000080, 0xd800: 0x21000000, 0xe800: 0x1000000, 0xf800: 0x40080, 0x10000: 0x40000, 0x11000: 0x80, 0x12000: 0x20000000, 0x13000: 0x21000080, 0x14000: 0x1000080, 0x15000: 0x21040000, 0x16000: 0x20040080, 0x17000: 0x1000000, 0x18000: 0x21040080, 0x19000: 0x21000000, 0x1a000: 0x1040000, 0x1b000: 0x20040000, 0x1c000: 0x40080, 0x1d000: 0x20000080, 0x1e000: 0x0, 0x1f000: 0x1040080, 0x10800: 0x21000080, 0x11800: 0x1000000, 0x12800: 0x1040000, 0x13800: 0x20040080, 0x14800: 0x20000000, 0x15800: 0x1040080, 0x16800: 0x80, 0x17800: 0x21040000, 0x18800: 0x40080, 0x19800: 0x21040080, 0x1a800: 0x0, 0x1b800: 0x21000000, 0x1c800: 0x1000080, 0x1d800: 0x40000, 0x1e800: 0x20040000, 0x1f800: 0x20000080 }, { 0x0: 0x10000008, 0x100: 0x2000, 0x200: 0x10200000, 0x300: 0x10202008, 0x400: 0x10002000, 0x500: 0x200000, 0x600: 0x200008, 0x700: 0x10000000, 0x800: 0x0, 0x900: 0x10002008, 0xa00: 0x202000, 0xb00: 0x8, 0xc00: 0x10200008, 0xd00: 0x202008, 0xe00: 0x2008, 0xf00: 0x10202000, 0x80: 0x10200000, 0x180: 0x10202008, 0x280: 0x8, 0x380: 0x200000, 0x480: 0x202008, 0x580: 0x10000008, 0x680: 0x10002000, 0x780: 0x2008, 0x880: 0x200008, 0x980: 0x2000, 0xa80: 0x10002008, 0xb80: 0x10200008, 0xc80: 0x0, 0xd80: 0x10202000, 0xe80: 0x202000, 0xf80: 0x10000000, 0x1000: 0x10002000, 0x1100: 0x10200008, 0x1200: 0x10202008, 0x1300: 0x2008, 0x1400: 0x200000, 0x1500: 0x10000000, 0x1600: 0x10000008, 0x1700: 0x202000, 0x1800: 0x202008, 0x1900: 0x0, 0x1a00: 0x8, 0x1b00: 0x10200000, 0x1c00: 0x2000, 0x1d00: 0x10002008, 0x1e00: 0x10202000, 0x1f00: 0x200008, 0x1080: 0x8, 0x1180: 0x202000, 0x1280: 0x200000, 0x1380: 0x10000008, 0x1480: 0x10002000, 0x1580: 0x2008, 0x1680: 0x10202008, 0x1780: 0x10200000, 0x1880: 0x10202000, 0x1980: 0x10200008, 0x1a80: 0x2000, 0x1b80: 0x202008, 0x1c80: 0x200008, 0x1d80: 0x0, 0x1e80: 0x10000000, 0x1f80: 0x10002008 }, { 0x0: 0x100000, 0x10: 0x2000401, 0x20: 0x400, 0x30: 0x100401, 0x40: 0x2100401, 0x50: 0x0, 0x60: 0x1, 0x70: 0x2100001, 0x80: 0x2000400, 0x90: 0x100001, 0xa0: 0x2000001, 0xb0: 0x2100400, 0xc0: 0x2100000, 0xd0: 0x401, 0xe0: 0x100400, 0xf0: 0x2000000, 0x8: 0x2100001, 0x18: 0x0, 0x28: 0x2000401, 0x38: 0x2100400, 0x48: 0x100000, 0x58: 0x2000001, 0x68: 0x2000000, 0x78: 0x401, 0x88: 0x100401, 0x98: 0x2000400, 0xa8: 0x2100000, 0xb8: 0x100001, 0xc8: 0x400, 0xd8: 0x2100401, 0xe8: 0x1, 0xf8: 0x100400, 0x100: 0x2000000, 0x110: 0x100000, 0x120: 0x2000401, 0x130: 0x2100001, 0x140: 0x100001, 0x150: 0x2000400, 0x160: 0x2100400, 0x170: 0x100401, 0x180: 0x401, 0x190: 0x2100401, 0x1a0: 0x100400, 0x1b0: 0x1, 0x1c0: 0x0, 0x1d0: 0x2100000, 0x1e0: 0x2000001, 0x1f0: 0x400, 0x108: 0x100400, 0x118: 0x2000401, 0x128: 0x2100001, 0x138: 0x1, 0x148: 0x2000000, 0x158: 0x100000, 0x168: 0x401, 0x178: 0x2100400, 0x188: 0x2000001, 0x198: 0x2100000, 0x1a8: 0x0, 0x1b8: 0x2100401, 0x1c8: 0x100401, 0x1d8: 0x400, 0x1e8: 0x2000400, 0x1f8: 0x100001 }, { 0x0: 0x8000820, 0x1: 0x20000, 0x2: 0x8000000, 0x3: 0x20, 0x4: 0x20020, 0x5: 0x8020820, 0x6: 0x8020800, 0x7: 0x800, 0x8: 0x8020000, 0x9: 0x8000800, 0xa: 0x20800, 0xb: 0x8020020, 0xc: 0x820, 0xd: 0x0, 0xe: 0x8000020, 0xf: 0x20820, 0x80000000: 0x800, 0x80000001: 0x8020820, 0x80000002: 0x8000820, 0x80000003: 0x8000000, 0x80000004: 0x8020000, 0x80000005: 0x20800, 0x80000006: 0x20820, 0x80000007: 0x20, 0x80000008: 0x8000020, 0x80000009: 0x820, 0x8000000a: 0x20020, 0x8000000b: 0x8020800, 0x8000000c: 0x0, 0x8000000d: 0x8020020, 0x8000000e: 0x8000800, 0x8000000f: 0x20000, 0x10: 0x20820, 0x11: 0x8020800, 0x12: 0x20, 0x13: 0x800, 0x14: 0x8000800, 0x15: 0x8000020, 0x16: 0x8020020, 0x17: 0x20000, 0x18: 0x0, 0x19: 0x20020, 0x1a: 0x8020000, 0x1b: 0x8000820, 0x1c: 0x8020820, 0x1d: 0x20800, 0x1e: 0x820, 0x1f: 0x8000000, 0x80000010: 0x20000, 0x80000011: 0x800, 0x80000012: 0x8020020, 0x80000013: 0x20820, 0x80000014: 0x20, 0x80000015: 0x8020000, 0x80000016: 0x8000000, 0x80000017: 0x8000820, 0x80000018: 0x8020820, 0x80000019: 0x8000020, 0x8000001a: 0x8000800, 0x8000001b: 0x0, 0x8000001c: 0x20800, 0x8000001d: 0x820, 0x8000001e: 0x20020, 0x8000001f: 0x8020800 } ]; // Masks that select the SBOX input var SBOX_MASK = [ 0xf8000001, 0x1f800000, 0x01f80000, 0x001f8000, 0x0001f800, 0x00001f80, 0x000001f8, 0x8000001f ]; /** * DES block cipher algorithm. */ var DES = C_algo.DES = BlockCipher.extend({ _doReset: function () { // Shortcuts var key = this._key; var keyWords = key.words; // Select 56 bits according to PC1 var keyBits = []; for (var i = 0; i < 56; i++) { var keyBitPos = PC1[i] - 1; keyBits[i] = (keyWords[keyBitPos >>> 5] >>> (31 - keyBitPos % 32)) & 1; } // Assemble 16 subkeys var subKeys = this._subKeys = []; for (var nSubKey = 0; nSubKey < 16; nSubKey++) { // Create subkey var subKey = subKeys[nSubKey] = []; // Shortcut var bitShift = BIT_SHIFTS[nSubKey]; // Select 48 bits according to PC2 for (var i = 0; i < 24; i++) { // Select from the left 28 key bits subKey[(i / 6) | 0] |= keyBits[((PC2[i] - 1) + bitShift) % 28] << (31 - i % 6); // Select from the right 28 key bits subKey[4 + ((i / 6) | 0)] |= keyBits[28 + (((PC2[i + 24] - 1) + bitShift) % 28)] << (31 - i % 6); } // Since each subkey is applied to an expanded 32-bit input, // the subkey can be broken into 8 values scaled to 32-bits, // which allows the key to be used without expansion subKey[0] = (subKey[0] << 1) | (subKey[0] >>> 31); for (var i = 1; i < 7; i++) { subKey[i] = subKey[i] >>> ((i - 1) * 4 + 3); } subKey[7] = (subKey[7] << 5) | (subKey[7] >>> 27); } // Compute inverse subkeys var invSubKeys = this._invSubKeys = []; for (var i = 0; i < 16; i++) { invSubKeys[i] = subKeys[15 - i]; } }, encryptBlock: function (M, offset) { this._doCryptBlock(M, offset, this._subKeys); }, decryptBlock: function (M, offset) { this._doCryptBlock(M, offset, this._invSubKeys); }, _doCryptBlock: function (M, offset, subKeys) { // Get input this._lBlock = M[offset]; this._rBlock = M[offset + 1]; // Initial permutation exchangeLR.call(this, 4, 0x0f0f0f0f); exchangeLR.call(this, 16, 0x0000ffff); exchangeRL.call(this, 2, 0x33333333); exchangeRL.call(this, 8, 0x00ff00ff); exchangeLR.call(this, 1, 0x55555555); // Rounds for (var round = 0; round < 16; round++) { // Shortcuts var subKey = subKeys[round]; var lBlock = this._lBlock; var rBlock = this._rBlock; // Feistel function var f = 0; for (var i = 0; i < 8; i++) { f |= SBOX_P[i][((rBlock ^ subKey[i]) & SBOX_MASK[i]) >>> 0]; } this._lBlock = rBlock; this._rBlock = lBlock ^ f; } // Undo swap from last round var t = this._lBlock; this._lBlock = this._rBlock; this._rBlock = t; // Final permutation exchangeLR.call(this, 1, 0x55555555); exchangeRL.call(this, 8, 0x00ff00ff); exchangeRL.call(this, 2, 0x33333333); exchangeLR.call(this, 16, 0x0000ffff); exchangeLR.call(this, 4, 0x0f0f0f0f); // Set output M[offset] = this._lBlock; M[offset + 1] = this._rBlock; }, keySize: 64/32, ivSize: 64/32, blockSize: 64/32 }); // Swap bits across the left and right words function exchangeLR(offset, mask) { var t = ((this._lBlock >>> offset) ^ this._rBlock) & mask; this._rBlock ^= t; this._lBlock ^= t << offset; } function exchangeRL(offset, mask) { var t = ((this._rBlock >>> offset) ^ this._lBlock) & mask; this._lBlock ^= t; this._rBlock ^= t << offset; } /** * Shortcut functions to the cipher's object interface. * * @example * * var ciphertext = CryptoJS.DES.encrypt(message, key, cfg); * var plaintext = CryptoJS.DES.decrypt(ciphertext, key, cfg); */ C.DES = BlockCipher._createHelper(DES); /** * Triple-DES block cipher algorithm. */ var TripleDES = C_algo.TripleDES = BlockCipher.extend({ _doReset: function () { // Shortcuts var key = this._key; var keyWords = key.words; // Make sure the key length is valid (64, 128 or >= 192 bit) if (keyWords.length !== 2 && keyWords.length !== 4 && keyWords.length < 6) { throw new Error('Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.'); } // Extend the key according to the keying options defined in 3DES standard var key1 = keyWords.slice(0, 2); var key2 = keyWords.length < 4 ? keyWords.slice(0, 2) : keyWords.slice(2, 4); var key3 = keyWords.length < 6 ? keyWords.slice(0, 2) : keyWords.slice(4, 6); // Create DES instances this._des1 = DES.createEncryptor(WordArray.create(key1)); this._des2 = DES.createEncryptor(WordArray.create(key2)); this._des3 = DES.createEncryptor(WordArray.create(key3)); }, encryptBlock: function (M, offset) { this._des1.encryptBlock(M, offset); this._des2.decryptBlock(M, offset); this._des3.encryptBlock(M, offset); }, decryptBlock: function (M, offset) { this._des3.decryptBlock(M, offset); this._des2.encryptBlock(M, offset); this._des1.decryptBlock(M, offset); }, keySize: 192/32, ivSize: 64/32, blockSize: 64/32 }); /** * Shortcut functions to the cipher's object interface. * * @example * * var ciphertext = CryptoJS.TripleDES.encrypt(message, key, cfg); * var plaintext = CryptoJS.TripleDES.decrypt(ciphertext, key, cfg); */ C.TripleDES = BlockCipher._createHelper(TripleDES); }()); return CryptoJS.TripleDES; })); /***/ }), /***/ "./node_modules/crypto-js/x64-core.js": /*!********************************************!*\ !*** ./node_modules/crypto-js/x64-core.js ***! \********************************************/ /***/ (function(module, exports, __webpack_require__) { ;(function (root, factory) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js")); } else {} }(this, function (CryptoJS) { (function (undefined) { // Shortcuts var C = CryptoJS; var C_lib = C.lib; var Base = C_lib.Base; var X32WordArray = C_lib.WordArray; /** * x64 namespace. */ var C_x64 = C.x64 = {}; /** * A 64-bit word. */ var X64Word = C_x64.Word = Base.extend({ /** * Initializes a newly created 64-bit word. * * @param {number} high The high 32 bits. * @param {number} low The low 32 bits. * * @example * * var x64Word = CryptoJS.x64.Word.create(0x00010203, 0x04050607); */ init: function (high, low) { this.high = high; this.low = low; } /** * Bitwise NOTs this word. * * @return {X64Word} A new x64-Word object after negating. * * @example * * var negated = x64Word.not(); */ // not: function () { // var high = ~this.high; // var low = ~this.low; // return X64Word.create(high, low); // }, /** * Bitwise ANDs this word with the passed word. * * @param {X64Word} word The x64-Word to AND with this word. * * @return {X64Word} A new x64-Word object after ANDing. * * @example * * var anded = x64Word.and(anotherX64Word); */ // and: function (word) { // var high = this.high & word.high; // var low = this.low & word.low; // return X64Word.create(high, low); // }, /** * Bitwise ORs this word with the passed word. * * @param {X64Word} word The x64-Word to OR with this word. * * @return {X64Word} A new x64-Word object after ORing. * * @example * * var ored = x64Word.or(anotherX64Word); */ // or: function (word) { // var high = this.high | word.high; // var low = this.low | word.low; // return X64Word.create(high, low); // }, /** * Bitwise XORs this word with the passed word. * * @param {X64Word} word The x64-Word to XOR with this word. * * @return {X64Word} A new x64-Word object after XORing. * * @example * * var xored = x64Word.xor(anotherX64Word); */ // xor: function (word) { // var high = this.high ^ word.high; // var low = this.low ^ word.low; // return X64Word.create(high, low); // }, /** * Shifts this word n bits to the left. * * @param {number} n The number of bits to shift. * * @return {X64Word} A new x64-Word object after shifting. * * @example * * var shifted = x64Word.shiftL(25); */ // shiftL: function (n) { // if (n < 32) { // var high = (this.high << n) | (this.low >>> (32 - n)); // var low = this.low << n; // } else { // var high = this.low << (n - 32); // var low = 0; // } // return X64Word.create(high, low); // }, /** * Shifts this word n bits to the right. * * @param {number} n The number of bits to shift. * * @return {X64Word} A new x64-Word object after shifting. * * @example * * var shifted = x64Word.shiftR(7); */ // shiftR: function (n) { // if (n < 32) { // var low = (this.low >>> n) | (this.high << (32 - n)); // var high = this.high >>> n; // } else { // var low = this.high >>> (n - 32); // var high = 0; // } // return X64Word.create(high, low); // }, /** * Rotates this word n bits to the left. * * @param {number} n The number of bits to rotate. * * @return {X64Word} A new x64-Word object after rotating. * * @example * * var rotated = x64Word.rotL(25); */ // rotL: function (n) { // return this.shiftL(n).or(this.shiftR(64 - n)); // }, /** * Rotates this word n bits to the right. * * @param {number} n The number of bits to rotate. * * @return {X64Word} A new x64-Word object after rotating. * * @example * * var rotated = x64Word.rotR(7); */ // rotR: function (n) { // return this.shiftR(n).or(this.shiftL(64 - n)); // }, /** * Adds this word with the passed word. * * @param {X64Word} word The x64-Word to add with this word. * * @return {X64Word} A new x64-Word object after adding. * * @example * * var added = x64Word.add(anotherX64Word); */ // add: function (word) { // var low = (this.low + word.low) | 0; // var carry = (low >>> 0) < (this.low >>> 0) ? 1 : 0; // var high = (this.high + word.high + carry) | 0; // return X64Word.create(high, low); // } }); /** * An array of 64-bit words. * * @property {Array} words The array of CryptoJS.x64.Word objects. * @property {number} sigBytes The number of significant bytes in this word array. */ var X64WordArray = C_x64.WordArray = Base.extend({ /** * Initializes a newly created word array. * * @param {Array} words (Optional) An array of CryptoJS.x64.Word objects. * @param {number} sigBytes (Optional) The number of significant bytes in the words. * * @example * * var wordArray = CryptoJS.x64.WordArray.create(); * * var wordArray = CryptoJS.x64.WordArray.create([ * CryptoJS.x64.Word.create(0x00010203, 0x04050607), * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f) * ]); * * var wordArray = CryptoJS.x64.WordArray.create([ * CryptoJS.x64.Word.create(0x00010203, 0x04050607), * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f) * ], 10); */ init: function (words, sigBytes) { words = this.words = words || []; if (sigBytes != undefined) { this.sigBytes = sigBytes; } else { this.sigBytes = words.length * 8; } }, /** * Converts this 64-bit word array to a 32-bit word array. * * @return {CryptoJS.lib.WordArray} This word array's data as a 32-bit word array. * * @example * * var x32WordArray = x64WordArray.toX32(); */ toX32: function () { // Shortcuts var x64Words = this.words; var x64WordsLength = x64Words.length; // Convert var x32Words = []; for (var i = 0; i < x64WordsLength; i++) { var x64Word = x64Words[i]; x32Words.push(x64Word.high); x32Words.push(x64Word.low); } return X32WordArray.create(x32Words, this.sigBytes); }, /** * Creates a copy of this word array. * * @return {X64WordArray} The clone. * * @example * * var clone = x64WordArray.clone(); */ clone: function () { var clone = Base.clone.call(this); // Clone "words" array var words = clone.words = this.words.slice(0); // Clone each X64Word object var wordsLength = words.length; for (var i = 0; i < wordsLength; i++) { words[i] = words[i].clone(); } return clone; } }); }()); return CryptoJS; })); /***/ }), /***/ "./node_modules/encoding/lib/encoding.js": /*!***********************************************!*\ !*** ./node_modules/encoding/lib/encoding.js ***! \***********************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var iconvLite = __webpack_require__(/*! iconv-lite */ "./node_modules/encoding/node_modules/iconv-lite/lib/index.js"); // Expose to the world module.exports.convert = convert; /** * Convert encoding of an UTF-8 string or a buffer * * @param {String|Buffer} str String to be converted * @param {String} to Encoding to be converted to * @param {String} [from='UTF-8'] Encoding to be converted from * @return {Buffer} Encoded string */ function convert(str, to, from) { from = checkEncoding(from || 'UTF-8'); to = checkEncoding(to || 'UTF-8'); str = str || ''; var result; if (from !== 'UTF-8' && typeof str === 'string') { str = Buffer.from(str, 'binary'); } if (from === to) { if (typeof str === 'string') { result = Buffer.from(str); } else { result = str; } } else { try { result = convertIconvLite(str, to, from); } catch (E) { console.error(E); result = str; } } if (typeof result === 'string') { result = Buffer.from(result, 'utf-8'); } return result; } /** * Convert encoding of astring with iconv-lite * * @param {String|Buffer} str String to be converted * @param {String} to Encoding to be converted to * @param {String} [from='UTF-8'] Encoding to be converted from * @return {Buffer} Encoded string */ function convertIconvLite(str, to, from) { if (to === 'UTF-8') { return iconvLite.decode(str, from); } else if (from === 'UTF-8') { return iconvLite.encode(str, to); } else { return iconvLite.encode(iconvLite.decode(str, from), to); } } /** * Converts charset name if needed * * @param {String} name Character set * @return {String} Character set name */ function checkEncoding(name) { return (name || '') .toString() .trim() .replace(/^latin[\-_]?(\d+)$/i, 'ISO-8859-$1') .replace(/^win(?:dows)?[\-_]?(\d+)$/i, 'WINDOWS-$1') .replace(/^utf[\-_]?(\d+)$/i, 'UTF-$1') .replace(/^ks_c_5601\-1987$/i, 'CP949') .replace(/^us[\-_]?ascii$/i, 'ASCII') .toUpperCase(); } /***/ }), /***/ "./node_modules/encoding/node_modules/iconv-lite/encodings/dbcs-codec.js": /*!*******************************************************************************!*\ !*** ./node_modules/encoding/node_modules/iconv-lite/encodings/dbcs-codec.js ***! \*******************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var Buffer = (__webpack_require__(/*! safer-buffer */ "./node_modules/safer-buffer/safer.js").Buffer); // Multibyte codec. In this scheme, a character is represented by 1 or more bytes. // Our codec supports UTF-16 surrogates, extensions for GB18030 and unicode sequences. // To save memory and loading time, we read table files only when requested. exports._dbcs = DBCSCodec; var UNASSIGNED = -1, GB18030_CODE = -2, SEQ_START = -10, NODE_START = -1000, UNASSIGNED_NODE = new Array(0x100), DEF_CHAR = -1; for (var i = 0; i < 0x100; i++) UNASSIGNED_NODE[i] = UNASSIGNED; // Class DBCSCodec reads and initializes mapping tables. function DBCSCodec(codecOptions, iconv) { this.encodingName = codecOptions.encodingName; if (!codecOptions) throw new Error("DBCS codec is called without the data.") if (!codecOptions.table) throw new Error("Encoding '" + this.encodingName + "' has no data."); // Load tables. var mappingTable = codecOptions.table(); // Decode tables: MBCS -> Unicode. // decodeTables is a trie, encoded as an array of arrays of integers. Internal arrays are trie nodes and all have len = 256. // Trie root is decodeTables[0]. // Values: >= 0 -> unicode character code. can be > 0xFFFF // == UNASSIGNED -> unknown/unassigned sequence. // == GB18030_CODE -> this is the end of a GB18030 4-byte sequence. // <= NODE_START -> index of the next node in our trie to process next byte. // <= SEQ_START -> index of the start of a character code sequence, in decodeTableSeq. this.decodeTables = []; this.decodeTables[0] = UNASSIGNED_NODE.slice(0); // Create root node. // Sometimes a MBCS char corresponds to a sequence of unicode chars. We store them as arrays of integers here. this.decodeTableSeq = []; // Actual mapping tables consist of chunks. Use them to fill up decode tables. for (var i = 0; i < mappingTable.length; i++) this._addDecodeChunk(mappingTable[i]); // Load & create GB18030 tables when needed. if (typeof codecOptions.gb18030 === 'function') { this.gb18030 = codecOptions.gb18030(); // Load GB18030 ranges. // Add GB18030 common decode nodes. var commonThirdByteNodeIdx = this.decodeTables.length; this.decodeTables.push(UNASSIGNED_NODE.slice(0)); var commonFourthByteNodeIdx = this.decodeTables.length; this.decodeTables.push(UNASSIGNED_NODE.slice(0)); // Fill out the tree var firstByteNode = this.decodeTables[0]; for (var i = 0x81; i <= 0xFE; i++) { var secondByteNode = this.decodeTables[NODE_START - firstByteNode[i]]; for (var j = 0x30; j <= 0x39; j++) { if (secondByteNode[j] === UNASSIGNED) { secondByteNode[j] = NODE_START - commonThirdByteNodeIdx; } else if (secondByteNode[j] > NODE_START) { throw new Error("gb18030 decode tables conflict at byte 2"); } var thirdByteNode = this.decodeTables[NODE_START - secondByteNode[j]]; for (var k = 0x81; k <= 0xFE; k++) { if (thirdByteNode[k] === UNASSIGNED) { thirdByteNode[k] = NODE_START - commonFourthByteNodeIdx; } else if (thirdByteNode[k] === NODE_START - commonFourthByteNodeIdx) { continue; } else if (thirdByteNode[k] > NODE_START) { throw new Error("gb18030 decode tables conflict at byte 3"); } var fourthByteNode = this.decodeTables[NODE_START - thirdByteNode[k]]; for (var l = 0x30; l <= 0x39; l++) { if (fourthByteNode[l] === UNASSIGNED) fourthByteNode[l] = GB18030_CODE; } } } } } this.defaultCharUnicode = iconv.defaultCharUnicode; // Encode tables: Unicode -> DBCS. // `encodeTable` is array mapping from unicode char to encoded char. All its values are integers for performance. // Because it can be sparse, it is represented as array of buckets by 256 chars each. Bucket can be null. // Values: >= 0 -> it is a normal char. Write the value (if <=256 then 1 byte, if <=65536 then 2 bytes, etc.). // == UNASSIGNED -> no conversion found. Output a default char. // <= SEQ_START -> it's an index in encodeTableSeq, see below. The character starts a sequence. this.encodeTable = []; // `encodeTableSeq` is used when a sequence of unicode characters is encoded as a single code. We use a tree of // objects where keys correspond to characters in sequence and leafs are the encoded dbcs values. A special DEF_CHAR key // means end of sequence (needed when one sequence is a strict subsequence of another). // Objects are kept separately from encodeTable to increase performance. this.encodeTableSeq = []; // Some chars can be decoded, but need not be encoded. var skipEncodeChars = {}; if (codecOptions.encodeSkipVals) for (var i = 0; i < codecOptions.encodeSkipVals.length; i++) { var val = codecOptions.encodeSkipVals[i]; if (typeof val === 'number') skipEncodeChars[val] = true; else for (var j = val.from; j <= val.to; j++) skipEncodeChars[j] = true; } // Use decode trie to recursively fill out encode tables. this._fillEncodeTable(0, 0, skipEncodeChars); // Add more encoding pairs when needed. if (codecOptions.encodeAdd) { for (var uChar in codecOptions.encodeAdd) if (Object.prototype.hasOwnProperty.call(codecOptions.encodeAdd, uChar)) this._setEncodeChar(uChar.charCodeAt(0), codecOptions.encodeAdd[uChar]); } this.defCharSB = this.encodeTable[0][iconv.defaultCharSingleByte.charCodeAt(0)]; if (this.defCharSB === UNASSIGNED) this.defCharSB = this.encodeTable[0]['?']; if (this.defCharSB === UNASSIGNED) this.defCharSB = "?".charCodeAt(0); } DBCSCodec.prototype.encoder = DBCSEncoder; DBCSCodec.prototype.decoder = DBCSDecoder; // Decoder helpers DBCSCodec.prototype._getDecodeTrieNode = function(addr) { var bytes = []; for (; addr > 0; addr >>>= 8) bytes.push(addr & 0xFF); if (bytes.length == 0) bytes.push(0); var node = this.decodeTables[0]; for (var i = bytes.length-1; i > 0; i--) { // Traverse nodes deeper into the trie. var val = node[bytes[i]]; if (val == UNASSIGNED) { // Create new node. node[bytes[i]] = NODE_START - this.decodeTables.length; this.decodeTables.push(node = UNASSIGNED_NODE.slice(0)); } else if (val <= NODE_START) { // Existing node. node = this.decodeTables[NODE_START - val]; } else throw new Error("Overwrite byte in " + this.encodingName + ", addr: " + addr.toString(16)); } return node; } DBCSCodec.prototype._addDecodeChunk = function(chunk) { // First element of chunk is the hex mbcs code where we start. var curAddr = parseInt(chunk[0], 16); // Choose the decoding node where we'll write our chars. var writeTable = this._getDecodeTrieNode(curAddr); curAddr = curAddr & 0xFF; // Write all other elements of the chunk to the table. for (var k = 1; k < chunk.length; k++) { var part = chunk[k]; if (typeof part === "string") { // String, write as-is. for (var l = 0; l < part.length;) { var code = part.charCodeAt(l++); if (0xD800 <= code && code < 0xDC00) { // Decode surrogate var codeTrail = part.charCodeAt(l++); if (0xDC00 <= codeTrail && codeTrail < 0xE000) writeTable[curAddr++] = 0x10000 + (code - 0xD800) * 0x400 + (codeTrail - 0xDC00); else throw new Error("Incorrect surrogate pair in " + this.encodingName + " at chunk " + chunk[0]); } else if (0x0FF0 < code && code <= 0x0FFF) { // Character sequence (our own encoding used) var len = 0xFFF - code + 2; var seq = []; for (var m = 0; m < len; m++) seq.push(part.charCodeAt(l++)); // Simple variation: don't support surrogates or subsequences in seq. writeTable[curAddr++] = SEQ_START - this.decodeTableSeq.length; this.decodeTableSeq.push(seq); } else writeTable[curAddr++] = code; // Basic char } } else if (typeof part === "number") { // Integer, meaning increasing sequence starting with prev character. var charCode = writeTable[curAddr - 1] + 1; for (var l = 0; l < part; l++) writeTable[curAddr++] = charCode++; } else throw new Error("Incorrect type '" + typeof part + "' given in " + this.encodingName + " at chunk " + chunk[0]); } if (curAddr > 0xFF) throw new Error("Incorrect chunk in " + this.encodingName + " at addr " + chunk[0] + ": too long" + curAddr); } // Encoder helpers DBCSCodec.prototype._getEncodeBucket = function(uCode) { var high = uCode >> 8; // This could be > 0xFF because of astral characters. if (this.encodeTable[high] === undefined) this.encodeTable[high] = UNASSIGNED_NODE.slice(0); // Create bucket on demand. return this.encodeTable[high]; } DBCSCodec.prototype._setEncodeChar = function(uCode, dbcsCode) { var bucket = this._getEncodeBucket(uCode); var low = uCode & 0xFF; if (bucket[low] <= SEQ_START) this.encodeTableSeq[SEQ_START-bucket[low]][DEF_CHAR] = dbcsCode; // There's already a sequence, set a single-char subsequence of it. else if (bucket[low] == UNASSIGNED) bucket[low] = dbcsCode; } DBCSCodec.prototype._setEncodeSequence = function(seq, dbcsCode) { // Get the root of character tree according to first character of the sequence. var uCode = seq[0]; var bucket = this._getEncodeBucket(uCode); var low = uCode & 0xFF; var node; if (bucket[low] <= SEQ_START) { // There's already a sequence with - use it. node = this.encodeTableSeq[SEQ_START-bucket[low]]; } else { // There was no sequence object - allocate a new one. node = {}; if (bucket[low] !== UNASSIGNED) node[DEF_CHAR] = bucket[low]; // If a char was set before - make it a single-char subsequence. bucket[low] = SEQ_START - this.encodeTableSeq.length; this.encodeTableSeq.push(node); } // Traverse the character tree, allocating new nodes as needed. for (var j = 1; j < seq.length-1; j++) { var oldVal = node[uCode]; if (typeof oldVal === 'object') node = oldVal; else { node = node[uCode] = {} if (oldVal !== undefined) node[DEF_CHAR] = oldVal } } // Set the leaf to given dbcsCode. uCode = seq[seq.length-1]; node[uCode] = dbcsCode; } DBCSCodec.prototype._fillEncodeTable = function(nodeIdx, prefix, skipEncodeChars) { var node = this.decodeTables[nodeIdx]; var hasValues = false; var subNodeEmpty = {}; for (var i = 0; i < 0x100; i++) { var uCode = node[i]; var mbCode = prefix + i; if (skipEncodeChars[mbCode]) continue; if (uCode >= 0) { this._setEncodeChar(uCode, mbCode); hasValues = true; } else if (uCode <= NODE_START) { var subNodeIdx = NODE_START - uCode; if (!subNodeEmpty[subNodeIdx]) { // Skip empty subtrees (they are too large in gb18030). var newPrefix = (mbCode << 8) >>> 0; // NOTE: '>>> 0' keeps 32-bit num positive. if (this._fillEncodeTable(subNodeIdx, newPrefix, skipEncodeChars)) hasValues = true; else subNodeEmpty[subNodeIdx] = true; } } else if (uCode <= SEQ_START) { this._setEncodeSequence(this.decodeTableSeq[SEQ_START - uCode], mbCode); hasValues = true; } } return hasValues; } // == Encoder ================================================================== function DBCSEncoder(options, codec) { // Encoder state this.leadSurrogate = -1; this.seqObj = undefined; // Static data this.encodeTable = codec.encodeTable; this.encodeTableSeq = codec.encodeTableSeq; this.defaultCharSingleByte = codec.defCharSB; this.gb18030 = codec.gb18030; } DBCSEncoder.prototype.write = function(str) { var newBuf = Buffer.alloc(str.length * (this.gb18030 ? 4 : 3)), leadSurrogate = this.leadSurrogate, seqObj = this.seqObj, nextChar = -1, i = 0, j = 0; while (true) { // 0. Get next character. if (nextChar === -1) { if (i == str.length) break; var uCode = str.charCodeAt(i++); } else { var uCode = nextChar; nextChar = -1; } // 1. Handle surrogates. if (0xD800 <= uCode && uCode < 0xE000) { // Char is one of surrogates. if (uCode < 0xDC00) { // We've got lead surrogate. if (leadSurrogate === -1) { leadSurrogate = uCode; continue; } else { leadSurrogate = uCode; // Double lead surrogate found. uCode = UNASSIGNED; } } else { // We've got trail surrogate. if (leadSurrogate !== -1) { uCode = 0x10000 + (leadSurrogate - 0xD800) * 0x400 + (uCode - 0xDC00); leadSurrogate = -1; } else { // Incomplete surrogate pair - only trail surrogate found. uCode = UNASSIGNED; } } } else if (leadSurrogate !== -1) { // Incomplete surrogate pair - only lead surrogate found. nextChar = uCode; uCode = UNASSIGNED; // Write an error, then current char. leadSurrogate = -1; } // 2. Convert uCode character. var dbcsCode = UNASSIGNED; if (seqObj !== undefined && uCode != UNASSIGNED) { // We are in the middle of the sequence var resCode = seqObj[uCode]; if (typeof resCode === 'object') { // Sequence continues. seqObj = resCode; continue; } else if (typeof resCode == 'number') { // Sequence finished. Write it. dbcsCode = resCode; } else if (resCode == undefined) { // Current character is not part of the sequence. // Try default character for this sequence resCode = seqObj[DEF_CHAR]; if (resCode !== undefined) { dbcsCode = resCode; // Found. Write it. nextChar = uCode; // Current character will be written too in the next iteration. } else { // TODO: What if we have no default? (resCode == undefined) // Then, we should write first char of the sequence as-is and try the rest recursively. // Didn't do it for now because no encoding has this situation yet. // Currently, just skip the sequence and write current char. } } seqObj = undefined; } else if (uCode >= 0) { // Regular character var subtable = this.encodeTable[uCode >> 8]; if (subtable !== undefined) dbcsCode = subtable[uCode & 0xFF]; if (dbcsCode <= SEQ_START) { // Sequence start seqObj = this.encodeTableSeq[SEQ_START-dbcsCode]; continue; } if (dbcsCode == UNASSIGNED && this.gb18030) { // Use GB18030 algorithm to find character(s) to write. var idx = findIdx(this.gb18030.uChars, uCode); if (idx != -1) { var dbcsCode = this.gb18030.gbChars[idx] + (uCode - this.gb18030.uChars[idx]); newBuf[j++] = 0x81 + Math.floor(dbcsCode / 12600); dbcsCode = dbcsCode % 12600; newBuf[j++] = 0x30 + Math.floor(dbcsCode / 1260); dbcsCode = dbcsCode % 1260; newBuf[j++] = 0x81 + Math.floor(dbcsCode / 10); dbcsCode = dbcsCode % 10; newBuf[j++] = 0x30 + dbcsCode; continue; } } } // 3. Write dbcsCode character. if (dbcsCode === UNASSIGNED) dbcsCode = this.defaultCharSingleByte; if (dbcsCode < 0x100) { newBuf[j++] = dbcsCode; } else if (dbcsCode < 0x10000) { newBuf[j++] = dbcsCode >> 8; // high byte newBuf[j++] = dbcsCode & 0xFF; // low byte } else if (dbcsCode < 0x1000000) { newBuf[j++] = dbcsCode >> 16; newBuf[j++] = (dbcsCode >> 8) & 0xFF; newBuf[j++] = dbcsCode & 0xFF; } else { newBuf[j++] = dbcsCode >>> 24; newBuf[j++] = (dbcsCode >>> 16) & 0xFF; newBuf[j++] = (dbcsCode >>> 8) & 0xFF; newBuf[j++] = dbcsCode & 0xFF; } } this.seqObj = seqObj; this.leadSurrogate = leadSurrogate; return newBuf.slice(0, j); } DBCSEncoder.prototype.end = function() { if (this.leadSurrogate === -1 && this.seqObj === undefined) return; // All clean. Most often case. var newBuf = Buffer.alloc(10), j = 0; if (this.seqObj) { // We're in the sequence. var dbcsCode = this.seqObj[DEF_CHAR]; if (dbcsCode !== undefined) { // Write beginning of the sequence. if (dbcsCode < 0x100) { newBuf[j++] = dbcsCode; } else { newBuf[j++] = dbcsCode >> 8; // high byte newBuf[j++] = dbcsCode & 0xFF; // low byte } } else { // See todo above. } this.seqObj = undefined; } if (this.leadSurrogate !== -1) { // Incomplete surrogate pair - only lead surrogate found. newBuf[j++] = this.defaultCharSingleByte; this.leadSurrogate = -1; } return newBuf.slice(0, j); } // Export for testing DBCSEncoder.prototype.findIdx = findIdx; // == Decoder ================================================================== function DBCSDecoder(options, codec) { // Decoder state this.nodeIdx = 0; this.prevBytes = []; // Static data this.decodeTables = codec.decodeTables; this.decodeTableSeq = codec.decodeTableSeq; this.defaultCharUnicode = codec.defaultCharUnicode; this.gb18030 = codec.gb18030; } DBCSDecoder.prototype.write = function(buf) { var newBuf = Buffer.alloc(buf.length*2), nodeIdx = this.nodeIdx, prevBytes = this.prevBytes, prevOffset = this.prevBytes.length, seqStart = -this.prevBytes.length, // idx of the start of current parsed sequence. uCode; for (var i = 0, j = 0; i < buf.length; i++) { var curByte = (i >= 0) ? buf[i] : prevBytes[i + prevOffset]; // Lookup in current trie node. var uCode = this.decodeTables[nodeIdx][curByte]; if (uCode >= 0) { // Normal character, just use it. } else if (uCode === UNASSIGNED) { // Unknown char. // TODO: Callback with seq. uCode = this.defaultCharUnicode.charCodeAt(0); i = seqStart; // Skip one byte ('i' will be incremented by the for loop) and try to parse again. } else if (uCode === GB18030_CODE) { if (i >= 3) { var ptr = (buf[i-3]-0x81)*12600 + (buf[i-2]-0x30)*1260 + (buf[i-1]-0x81)*10 + (curByte-0x30); } else { var ptr = (prevBytes[i-3+prevOffset]-0x81)*12600 + (((i-2 >= 0) ? buf[i-2] : prevBytes[i-2+prevOffset])-0x30)*1260 + (((i-1 >= 0) ? buf[i-1] : prevBytes[i-1+prevOffset])-0x81)*10 + (curByte-0x30); } var idx = findIdx(this.gb18030.gbChars, ptr); uCode = this.gb18030.uChars[idx] + ptr - this.gb18030.gbChars[idx]; } else if (uCode <= NODE_START) { // Go to next trie node. nodeIdx = NODE_START - uCode; continue; } else if (uCode <= SEQ_START) { // Output a sequence of chars. var seq = this.decodeTableSeq[SEQ_START - uCode]; for (var k = 0; k < seq.length - 1; k++) { uCode = seq[k]; newBuf[j++] = uCode & 0xFF; newBuf[j++] = uCode >> 8; } uCode = seq[seq.length-1]; } else throw new Error("iconv-lite internal error: invalid decoding table value " + uCode + " at " + nodeIdx + "/" + curByte); // Write the character to buffer, handling higher planes using surrogate pair. if (uCode >= 0x10000) { uCode -= 0x10000; var uCodeLead = 0xD800 | (uCode >> 10); newBuf[j++] = uCodeLead & 0xFF; newBuf[j++] = uCodeLead >> 8; uCode = 0xDC00 | (uCode & 0x3FF); } newBuf[j++] = uCode & 0xFF; newBuf[j++] = uCode >> 8; // Reset trie node. nodeIdx = 0; seqStart = i+1; } this.nodeIdx = nodeIdx; this.prevBytes = (seqStart >= 0) ? Array.prototype.slice.call(buf, seqStart) : prevBytes.slice(seqStart + prevOffset).concat(Array.prototype.slice.call(buf)); return newBuf.slice(0, j).toString('ucs2'); } DBCSDecoder.prototype.end = function() { var ret = ''; // Try to parse all remaining chars. while (this.prevBytes.length > 0) { // Skip 1 character in the buffer. ret += this.defaultCharUnicode; var bytesArr = this.prevBytes.slice(1); // Parse remaining as usual. this.prevBytes = []; this.nodeIdx = 0; if (bytesArr.length > 0) ret += this.write(bytesArr); } this.prevBytes = []; this.nodeIdx = 0; return ret; } // Binary search for GB18030. Returns largest i such that table[i] <= val. function findIdx(table, val) { if (table[0] > val) return -1; var l = 0, r = table.length; while (l < r-1) { // always table[l] <= val < table[r] var mid = l + ((r-l+1) >> 1); if (table[mid] <= val) l = mid; else r = mid; } return l; } /***/ }), /***/ "./node_modules/encoding/node_modules/iconv-lite/encodings/dbcs-data.js": /*!******************************************************************************!*\ !*** ./node_modules/encoding/node_modules/iconv-lite/encodings/dbcs-data.js ***! \******************************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // Description of supported double byte encodings and aliases. // Tables are not require()-d until they are needed to speed up library load. // require()-s are direct to support Browserify. module.exports = { // == Japanese/ShiftJIS ==================================================== // All japanese encodings are based on JIS X set of standards: // JIS X 0201 - Single-byte encoding of ASCII + ¥ + Kana chars at 0xA1-0xDF. // JIS X 0208 - Main set of 6879 characters, placed in 94x94 plane, to be encoded by 2 bytes. // Has several variations in 1978, 1983, 1990 and 1997. // JIS X 0212 - Supplementary plane of 6067 chars in 94x94 plane. 1990. Effectively dead. // JIS X 0213 - Extension and modern replacement of 0208 and 0212. Total chars: 11233. // 2 planes, first is superset of 0208, second - revised 0212. // Introduced in 2000, revised 2004. Some characters are in Unicode Plane 2 (0x2xxxx) // Byte encodings are: // * Shift_JIS: Compatible with 0201, uses not defined chars in top half as lead bytes for double-byte // encoding of 0208. Lead byte ranges: 0x81-0x9F, 0xE0-0xEF; Trail byte ranges: 0x40-0x7E, 0x80-0x9E, 0x9F-0xFC. // Windows CP932 is a superset of Shift_JIS. Some companies added more chars, notably KDDI. // * EUC-JP: Up to 3 bytes per character. Used mostly on *nixes. // 0x00-0x7F - lower part of 0201 // 0x8E, 0xA1-0xDF - upper part of 0201 // (0xA1-0xFE)x2 - 0208 plane (94x94). // 0x8F, (0xA1-0xFE)x2 - 0212 plane (94x94). // * JIS X 208: 7-bit, direct encoding of 0208. Byte ranges: 0x21-0x7E (94 values). Uncommon. // Used as-is in ISO2022 family. // * ISO2022-JP: Stateful encoding, with escape sequences to switch between ASCII, // 0201-1976 Roman, 0208-1978, 0208-1983. // * ISO2022-JP-1: Adds esc seq for 0212-1990. // * ISO2022-JP-2: Adds esc seq for GB2313-1980, KSX1001-1992, ISO8859-1, ISO8859-7. // * ISO2022-JP-3: Adds esc seq for 0201-1976 Kana set, 0213-2000 Planes 1, 2. // * ISO2022-JP-2004: Adds 0213-2004 Plane 1. // // After JIS X 0213 appeared, Shift_JIS-2004, EUC-JISX0213 and ISO2022-JP-2004 followed, with just changing the planes. // // Overall, it seems that it's a mess :( http://www8.plala.or.jp/tkubota1/unicode-symbols-map2.html 'shiftjis': { type: '_dbcs', table: function() { return __webpack_require__(/*! ./tables/shiftjis.json */ "./node_modules/encoding/node_modules/iconv-lite/encodings/tables/shiftjis.json") }, encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E}, encodeSkipVals: [{from: 0xED40, to: 0xF940}], }, 'csshiftjis': 'shiftjis', 'mskanji': 'shiftjis', 'sjis': 'shiftjis', 'windows31j': 'shiftjis', 'ms31j': 'shiftjis', 'xsjis': 'shiftjis', 'windows932': 'shiftjis', 'ms932': 'shiftjis', '932': 'shiftjis', 'cp932': 'shiftjis', 'eucjp': { type: '_dbcs', table: function() { return __webpack_require__(/*! ./tables/eucjp.json */ "./node_modules/encoding/node_modules/iconv-lite/encodings/tables/eucjp.json") }, encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E}, }, // TODO: KDDI extension to Shift_JIS // TODO: IBM CCSID 942 = CP932, but F0-F9 custom chars and other char changes. // TODO: IBM CCSID 943 = Shift_JIS = CP932 with original Shift_JIS lower 128 chars. // == Chinese/GBK ========================================================== // http://en.wikipedia.org/wiki/GBK // We mostly implement W3C recommendation: https://www.w3.org/TR/encoding/#gbk-encoder // Oldest GB2312 (1981, ~7600 chars) is a subset of CP936 'gb2312': 'cp936', 'gb231280': 'cp936', 'gb23121980': 'cp936', 'csgb2312': 'cp936', 'csiso58gb231280': 'cp936', 'euccn': 'cp936', // Microsoft's CP936 is a subset and approximation of GBK. 'windows936': 'cp936', 'ms936': 'cp936', '936': 'cp936', 'cp936': { type: '_dbcs', table: function() { return __webpack_require__(/*! ./tables/cp936.json */ "./node_modules/encoding/node_modules/iconv-lite/encodings/tables/cp936.json") }, }, // GBK (~22000 chars) is an extension of CP936 that added user-mapped chars and some other. 'gbk': { type: '_dbcs', table: function() { return (__webpack_require__(/*! ./tables/cp936.json */ "./node_modules/encoding/node_modules/iconv-lite/encodings/tables/cp936.json").concat)(__webpack_require__(/*! ./tables/gbk-added.json */ "./node_modules/encoding/node_modules/iconv-lite/encodings/tables/gbk-added.json")) }, }, 'xgbk': 'gbk', 'isoir58': 'gbk', // GB18030 is an algorithmic extension of GBK. // Main source: https://www.w3.org/TR/encoding/#gbk-encoder // http://icu-project.org/docs/papers/gb18030.html // http://source.icu-project.org/repos/icu/data/trunk/charset/data/xml/gb-18030-2000.xml // http://www.khngai.com/chinese/charmap/tblgbk.php?page=0 'gb18030': { type: '_dbcs', table: function() { return (__webpack_require__(/*! ./tables/cp936.json */ "./node_modules/encoding/node_modules/iconv-lite/encodings/tables/cp936.json").concat)(__webpack_require__(/*! ./tables/gbk-added.json */ "./node_modules/encoding/node_modules/iconv-lite/encodings/tables/gbk-added.json")) }, gb18030: function() { return __webpack_require__(/*! ./tables/gb18030-ranges.json */ "./node_modules/encoding/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json") }, encodeSkipVals: [0x80], encodeAdd: {'€': 0xA2E3}, }, 'chinese': 'gb18030', // == Korean =============================================================== // EUC-KR, KS_C_5601 and KS X 1001 are exactly the same. 'windows949': 'cp949', 'ms949': 'cp949', '949': 'cp949', 'cp949': { type: '_dbcs', table: function() { return __webpack_require__(/*! ./tables/cp949.json */ "./node_modules/encoding/node_modules/iconv-lite/encodings/tables/cp949.json") }, }, 'cseuckr': 'cp949', 'csksc56011987': 'cp949', 'euckr': 'cp949', 'isoir149': 'cp949', 'korean': 'cp949', 'ksc56011987': 'cp949', 'ksc56011989': 'cp949', 'ksc5601': 'cp949', // == Big5/Taiwan/Hong Kong ================================================ // There are lots of tables for Big5 and cp950. Please see the following links for history: // http://moztw.org/docs/big5/ http://www.haible.de/bruno/charsets/conversion-tables/Big5.html // Variations, in roughly number of defined chars: // * Windows CP 950: Microsoft variant of Big5. Canonical: http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP950.TXT // * Windows CP 951: Microsoft variant of Big5-HKSCS-2001. Seems to be never public. http://me.abelcheung.org/articles/research/what-is-cp951/ // * Big5-2003 (Taiwan standard) almost superset of cp950. // * Unicode-at-on (UAO) / Mozilla 1.8. Falling out of use on the Web. Not supported by other browsers. // * Big5-HKSCS (-2001, -2004, -2008). Hong Kong standard. // many unicode code points moved from PUA to Supplementary plane (U+2XXXX) over the years. // Plus, it has 4 combining sequences. // Seems that Mozilla refused to support it for 10 yrs. https://bugzilla.mozilla.org/show_bug.cgi?id=162431 https://bugzilla.mozilla.org/show_bug.cgi?id=310299 // because big5-hkscs is the only encoding to include astral characters in non-algorithmic way. // Implementations are not consistent within browsers; sometimes labeled as just big5. // MS Internet Explorer switches from big5 to big5-hkscs when a patch applied. // Great discussion & recap of what's going on https://bugzilla.mozilla.org/show_bug.cgi?id=912470#c31 // In the encoder, it might make sense to support encoding old PUA mappings to Big5 bytes seq-s. // Official spec: http://www.ogcio.gov.hk/en/business/tech_promotion/ccli/terms/doc/2003cmp_2008.txt // http://www.ogcio.gov.hk/tc/business/tech_promotion/ccli/terms/doc/hkscs-2008-big5-iso.txt // // Current understanding of how to deal with Big5(-HKSCS) is in the Encoding Standard, http://encoding.spec.whatwg.org/#big5-encoder // Unicode mapping (http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/OTHER/BIG5.TXT) is said to be wrong. 'windows950': 'cp950', 'ms950': 'cp950', '950': 'cp950', 'cp950': { type: '_dbcs', table: function() { return __webpack_require__(/*! ./tables/cp950.json */ "./node_modules/encoding/node_modules/iconv-lite/encodings/tables/cp950.json") }, }, // Big5 has many variations and is an extension of cp950. We use Encoding Standard's as a consensus. 'big5': 'big5hkscs', 'big5hkscs': { type: '_dbcs', table: function() { return (__webpack_require__(/*! ./tables/cp950.json */ "./node_modules/encoding/node_modules/iconv-lite/encodings/tables/cp950.json").concat)(__webpack_require__(/*! ./tables/big5-added.json */ "./node_modules/encoding/node_modules/iconv-lite/encodings/tables/big5-added.json")) }, encodeSkipVals: [ // Although Encoding Standard says we should avoid encoding to HKSCS area (See Step 1 of // https://encoding.spec.whatwg.org/#index-big5-pointer), we still do it to increase compatibility with ICU. // But if a single unicode point can be encoded both as HKSCS and regular Big5, we prefer the latter. 0x8e69, 0x8e6f, 0x8e7e, 0x8eab, 0x8eb4, 0x8ecd, 0x8ed0, 0x8f57, 0x8f69, 0x8f6e, 0x8fcb, 0x8ffe, 0x906d, 0x907a, 0x90c4, 0x90dc, 0x90f1, 0x91bf, 0x92af, 0x92b0, 0x92b1, 0x92b2, 0x92d1, 0x9447, 0x94ca, 0x95d9, 0x96fc, 0x9975, 0x9b76, 0x9b78, 0x9b7b, 0x9bc6, 0x9bde, 0x9bec, 0x9bf6, 0x9c42, 0x9c53, 0x9c62, 0x9c68, 0x9c6b, 0x9c77, 0x9cbc, 0x9cbd, 0x9cd0, 0x9d57, 0x9d5a, 0x9dc4, 0x9def, 0x9dfb, 0x9ea9, 0x9eef, 0x9efd, 0x9f60, 0x9fcb, 0xa077, 0xa0dc, 0xa0df, 0x8fcc, 0x92c8, 0x9644, 0x96ed, // Step 2 of https://encoding.spec.whatwg.org/#index-big5-pointer: Use last pointer for U+2550, U+255E, U+2561, U+256A, U+5341, or U+5345 0xa2a4, 0xa2a5, 0xa2a7, 0xa2a6, 0xa2cc, 0xa2ce, ], }, 'cnbig5': 'big5hkscs', 'csbig5': 'big5hkscs', 'xxbig5': 'big5hkscs', }; /***/ }), /***/ "./node_modules/encoding/node_modules/iconv-lite/encodings/index.js": /*!**************************************************************************!*\ !*** ./node_modules/encoding/node_modules/iconv-lite/encodings/index.js ***! \**************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; // Update this array if you add/rename/remove files in this directory. // We support Browserify by skipping automatic module discovery and requiring modules directly. var modules = [ __webpack_require__(/*! ./internal */ "./node_modules/encoding/node_modules/iconv-lite/encodings/internal.js"), __webpack_require__(/*! ./utf32 */ "./node_modules/encoding/node_modules/iconv-lite/encodings/utf32.js"), __webpack_require__(/*! ./utf16 */ "./node_modules/encoding/node_modules/iconv-lite/encodings/utf16.js"), __webpack_require__(/*! ./utf7 */ "./node_modules/encoding/node_modules/iconv-lite/encodings/utf7.js"), __webpack_require__(/*! ./sbcs-codec */ "./node_modules/encoding/node_modules/iconv-lite/encodings/sbcs-codec.js"), __webpack_require__(/*! ./sbcs-data */ "./node_modules/encoding/node_modules/iconv-lite/encodings/sbcs-data.js"), __webpack_require__(/*! ./sbcs-data-generated */ "./node_modules/encoding/node_modules/iconv-lite/encodings/sbcs-data-generated.js"), __webpack_require__(/*! ./dbcs-codec */ "./node_modules/encoding/node_modules/iconv-lite/encodings/dbcs-codec.js"), __webpack_require__(/*! ./dbcs-data */ "./node_modules/encoding/node_modules/iconv-lite/encodings/dbcs-data.js"), ]; // Put all encoding/alias/codec definitions to single object and export it. for (var i = 0; i < modules.length; i++) { var module = modules[i]; for (var enc in module) if (Object.prototype.hasOwnProperty.call(module, enc)) exports[enc] = module[enc]; } /***/ }), /***/ "./node_modules/encoding/node_modules/iconv-lite/encodings/internal.js": /*!*****************************************************************************!*\ !*** ./node_modules/encoding/node_modules/iconv-lite/encodings/internal.js ***! \*****************************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Buffer = (__webpack_require__(/*! safer-buffer */ "./node_modules/safer-buffer/safer.js").Buffer); // Export Node.js internal encodings. module.exports = { // Encodings utf8: { type: "_internal", bomAware: true}, cesu8: { type: "_internal", bomAware: true}, unicode11utf8: "utf8", ucs2: { type: "_internal", bomAware: true}, utf16le: "ucs2", binary: { type: "_internal" }, base64: { type: "_internal" }, hex: { type: "_internal" }, // Codec. _internal: InternalCodec, }; //------------------------------------------------------------------------------ function InternalCodec(codecOptions, iconv) { this.enc = codecOptions.encodingName; this.bomAware = codecOptions.bomAware; if (this.enc === "base64") this.encoder = InternalEncoderBase64; else if (this.enc === "cesu8") { this.enc = "utf8"; // Use utf8 for decoding. this.encoder = InternalEncoderCesu8; // Add decoder for versions of Node not supporting CESU-8 if (Buffer.from('eda0bdedb2a9', 'hex').toString() !== '💩') { this.decoder = InternalDecoderCesu8; this.defaultCharUnicode = iconv.defaultCharUnicode; } } } InternalCodec.prototype.encoder = InternalEncoder; InternalCodec.prototype.decoder = InternalDecoder; //------------------------------------------------------------------------------ // We use node.js internal decoder. Its signature is the same as ours. var StringDecoder = (__webpack_require__(/*! string_decoder */ "string_decoder").StringDecoder); if (!StringDecoder.prototype.end) // Node v0.8 doesn't have this method. StringDecoder.prototype.end = function() {}; function InternalDecoder(options, codec) { this.decoder = new StringDecoder(codec.enc); } InternalDecoder.prototype.write = function(buf) { if (!Buffer.isBuffer(buf)) { buf = Buffer.from(buf); } return this.decoder.write(buf); } InternalDecoder.prototype.end = function() { return this.decoder.end(); } //------------------------------------------------------------------------------ // Encoder is mostly trivial function InternalEncoder(options, codec) { this.enc = codec.enc; } InternalEncoder.prototype.write = function(str) { return Buffer.from(str, this.enc); } InternalEncoder.prototype.end = function() { } //------------------------------------------------------------------------------ // Except base64 encoder, which must keep its state. function InternalEncoderBase64(options, codec) { this.prevStr = ''; } InternalEncoderBase64.prototype.write = function(str) { str = this.prevStr + str; var completeQuads = str.length - (str.length % 4); this.prevStr = str.slice(completeQuads); str = str.slice(0, completeQuads); return Buffer.from(str, "base64"); } InternalEncoderBase64.prototype.end = function() { return Buffer.from(this.prevStr, "base64"); } //------------------------------------------------------------------------------ // CESU-8 encoder is also special. function InternalEncoderCesu8(options, codec) { } InternalEncoderCesu8.prototype.write = function(str) { var buf = Buffer.alloc(str.length * 3), bufIdx = 0; for (var i = 0; i < str.length; i++) { var charCode = str.charCodeAt(i); // Naive implementation, but it works because CESU-8 is especially easy // to convert from UTF-16 (which all JS strings are encoded in). if (charCode < 0x80) buf[bufIdx++] = charCode; else if (charCode < 0x800) { buf[bufIdx++] = 0xC0 + (charCode >>> 6); buf[bufIdx++] = 0x80 + (charCode & 0x3f); } else { // charCode will always be < 0x10000 in javascript. buf[bufIdx++] = 0xE0 + (charCode >>> 12); buf[bufIdx++] = 0x80 + ((charCode >>> 6) & 0x3f); buf[bufIdx++] = 0x80 + (charCode & 0x3f); } } return buf.slice(0, bufIdx); } InternalEncoderCesu8.prototype.end = function() { } //------------------------------------------------------------------------------ // CESU-8 decoder is not implemented in Node v4.0+ function InternalDecoderCesu8(options, codec) { this.acc = 0; this.contBytes = 0; this.accBytes = 0; this.defaultCharUnicode = codec.defaultCharUnicode; } InternalDecoderCesu8.prototype.write = function(buf) { var acc = this.acc, contBytes = this.contBytes, accBytes = this.accBytes, res = ''; for (var i = 0; i < buf.length; i++) { var curByte = buf[i]; if ((curByte & 0xC0) !== 0x80) { // Leading byte if (contBytes > 0) { // Previous code is invalid res += this.defaultCharUnicode; contBytes = 0; } if (curByte < 0x80) { // Single-byte code res += String.fromCharCode(curByte); } else if (curByte < 0xE0) { // Two-byte code acc = curByte & 0x1F; contBytes = 1; accBytes = 1; } else if (curByte < 0xF0) { // Three-byte code acc = curByte & 0x0F; contBytes = 2; accBytes = 1; } else { // Four or more are not supported for CESU-8. res += this.defaultCharUnicode; } } else { // Continuation byte if (contBytes > 0) { // We're waiting for it. acc = (acc << 6) | (curByte & 0x3f); contBytes--; accBytes++; if (contBytes === 0) { // Check for overlong encoding, but support Modified UTF-8 (encoding NULL as C0 80) if (accBytes === 2 && acc < 0x80 && acc > 0) res += this.defaultCharUnicode; else if (accBytes === 3 && acc < 0x800) res += this.defaultCharUnicode; else // Actually add character. res += String.fromCharCode(acc); } } else { // Unexpected continuation byte res += this.defaultCharUnicode; } } } this.acc = acc; this.contBytes = contBytes; this.accBytes = accBytes; return res; } InternalDecoderCesu8.prototype.end = function() { var res = 0; if (this.contBytes > 0) res += this.defaultCharUnicode; return res; } /***/ }), /***/ "./node_modules/encoding/node_modules/iconv-lite/encodings/sbcs-codec.js": /*!*******************************************************************************!*\ !*** ./node_modules/encoding/node_modules/iconv-lite/encodings/sbcs-codec.js ***! \*******************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var Buffer = (__webpack_require__(/*! safer-buffer */ "./node_modules/safer-buffer/safer.js").Buffer); // Single-byte codec. Needs a 'chars' string parameter that contains 256 or 128 chars that // correspond to encoded bytes (if 128 - then lower half is ASCII). exports._sbcs = SBCSCodec; function SBCSCodec(codecOptions, iconv) { if (!codecOptions) throw new Error("SBCS codec is called without the data.") // Prepare char buffer for decoding. if (!codecOptions.chars || (codecOptions.chars.length !== 128 && codecOptions.chars.length !== 256)) throw new Error("Encoding '"+codecOptions.type+"' has incorrect 'chars' (must be of len 128 or 256)"); if (codecOptions.chars.length === 128) { var asciiString = ""; for (var i = 0; i < 128; i++) asciiString += String.fromCharCode(i); codecOptions.chars = asciiString + codecOptions.chars; } this.decodeBuf = Buffer.from(codecOptions.chars, 'ucs2'); // Encoding buffer. var encodeBuf = Buffer.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0)); for (var i = 0; i < codecOptions.chars.length; i++) encodeBuf[codecOptions.chars.charCodeAt(i)] = i; this.encodeBuf = encodeBuf; } SBCSCodec.prototype.encoder = SBCSEncoder; SBCSCodec.prototype.decoder = SBCSDecoder; function SBCSEncoder(options, codec) { this.encodeBuf = codec.encodeBuf; } SBCSEncoder.prototype.write = function(str) { var buf = Buffer.alloc(str.length); for (var i = 0; i < str.length; i++) buf[i] = this.encodeBuf[str.charCodeAt(i)]; return buf; } SBCSEncoder.prototype.end = function() { } function SBCSDecoder(options, codec) { this.decodeBuf = codec.decodeBuf; } SBCSDecoder.prototype.write = function(buf) { // Strings are immutable in JS -> we use ucs2 buffer to speed up computations. var decodeBuf = this.decodeBuf; var newBuf = Buffer.alloc(buf.length*2); var idx1 = 0, idx2 = 0; for (var i = 0; i < buf.length; i++) { idx1 = buf[i]*2; idx2 = i*2; newBuf[idx2] = decodeBuf[idx1]; newBuf[idx2+1] = decodeBuf[idx1+1]; } return newBuf.toString('ucs2'); } SBCSDecoder.prototype.end = function() { } /***/ }), /***/ "./node_modules/encoding/node_modules/iconv-lite/encodings/sbcs-data-generated.js": /*!****************************************************************************************!*\ !*** ./node_modules/encoding/node_modules/iconv-lite/encodings/sbcs-data-generated.js ***! \****************************************************************************************/ /***/ ((module) => { "use strict"; // Generated data for sbcs codec. Don't edit manually. Regenerate using generation/gen-sbcs.js script. module.exports = { "437": "cp437", "737": "cp737", "775": "cp775", "850": "cp850", "852": "cp852", "855": "cp855", "856": "cp856", "857": "cp857", "858": "cp858", "860": "cp860", "861": "cp861", "862": "cp862", "863": "cp863", "864": "cp864", "865": "cp865", "866": "cp866", "869": "cp869", "874": "windows874", "922": "cp922", "1046": "cp1046", "1124": "cp1124", "1125": "cp1125", "1129": "cp1129", "1133": "cp1133", "1161": "cp1161", "1162": "cp1162", "1163": "cp1163", "1250": "windows1250", "1251": "windows1251", "1252": "windows1252", "1253": "windows1253", "1254": "windows1254", "1255": "windows1255", "1256": "windows1256", "1257": "windows1257", "1258": "windows1258", "28591": "iso88591", "28592": "iso88592", "28593": "iso88593", "28594": "iso88594", "28595": "iso88595", "28596": "iso88596", "28597": "iso88597", "28598": "iso88598", "28599": "iso88599", "28600": "iso885910", "28601": "iso885911", "28603": "iso885913", "28604": "iso885914", "28605": "iso885915", "28606": "iso885916", "windows874": { "type": "_sbcs", "chars": "€����…�����������‘’“”•–—�������� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" }, "win874": "windows874", "cp874": "windows874", "windows1250": { "type": "_sbcs", "chars": "€�‚�„…†‡�‰Š‹ŚŤŽŹ�‘’“”•–—�™š›śťžź ˇ˘Ł¤Ą¦§¨©Ş«¬­®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙" }, "win1250": "windows1250", "cp1250": "windows1250", "windows1251": { "type": "_sbcs", "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—�™љ›њќћџ ЎўЈ¤Ґ¦§Ё©Є«¬­®Ї°±Ііґµ¶·ё№є»јЅѕїАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" }, "win1251": "windows1251", "cp1251": "windows1251", "windows1252": { "type": "_sbcs", "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" }, "win1252": "windows1252", "cp1252": "windows1252", "windows1253": { "type": "_sbcs", "chars": "€�‚ƒ„…†‡�‰�‹�����‘’“”•–—�™�›���� ΅Ά£¤¥¦§¨©�«¬­®―°±²³΄µ¶·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�" }, "win1253": "windows1253", "cp1253": "windows1253", "windows1254": { "type": "_sbcs", "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ����‘’“”•–—˜™š›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ" }, "win1254": "windows1254", "cp1254": "windows1254", "windows1255": { "type": "_sbcs", "chars": "€�‚ƒ„…†‡ˆ‰�‹�����‘’“”•–—˜™�›���� ¡¢£₪¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾¿ְֱֲֳִֵֶַָֹֺֻּֽ־ֿ׀ׁׂ׃װױײ׳״�������אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�" }, "win1255": "windows1255", "cp1255": "windows1255", "windows1256": { "type": "_sbcs", "chars": "€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œ‌‍ں ،¢£¤¥¦§¨©ھ«¬­®¯°±²³´µ¶·¸¹؛»¼½¾؟ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهوçèéêëىيîïًٌٍَôُِ÷ّùْûü‎‏ے" }, "win1256": "windows1256", "cp1256": "windows1256", "windows1257": { "type": "_sbcs", "chars": "€�‚�„…†‡�‰�‹�¨ˇ¸�‘’“”•–—�™�›�¯˛� �¢£¤�¦§Ø©Ŗ«¬­®Æ°±²³´µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž˙" }, "win1257": "windows1257", "cp1257": "windows1257", "windows1258": { "type": "_sbcs", "chars": "€�‚ƒ„…†‡ˆ‰�‹Œ����‘’“”•–—˜™�›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" }, "win1258": "windows1258", "cp1258": "windows1258", "iso88591": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" }, "cp28591": "iso88591", "iso88592": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ą˘Ł¤ĽŚ§¨ŠŞŤŹ­ŽŻ°ą˛ł´ľśˇ¸šşťź˝žżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙" }, "cp28592": "iso88592", "iso88593": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ħ˘£¤�Ĥ§¨İŞĞĴ­�ݰħ²³´µĥ·¸ışğĵ½�żÀÁÂ�ÄĊĈÇÈÉÊËÌÍÎÏ�ÑÒÓÔĠÖ×ĜÙÚÛÜŬŜßàáâ�äċĉçèéêëìíîï�ñòóôġö÷ĝùúûüŭŝ˙" }, "cp28593": "iso88593", "iso88594": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĸŖ¤Ĩϧ¨ŠĒĢŦ­Ž¯°ą˛ŗ´ĩšēģŧŊžŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎĪĐŅŌĶÔÕÖרŲÚÛÜŨŪßāáâãäåæįčéęëėíîīđņōķôõö÷øųúûüũū˙" }, "cp28594": "iso88594", "iso88595": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўџ" }, "cp28595": "iso88595", "iso88596": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ���¤�������،­�������������؛���؟�ءآأؤإئابةتثجحخدذرزسشصضطظعغ�����ـفقكلمنهوىيًٌٍَُِّْ�������������" }, "cp28596": "iso88596", "iso88597": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ‘’£€₯¦§¨©ͺ«¬­�―°±²³΄΅Ά·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�" }, "cp28597": "iso88597", "iso88598": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �¢£¤¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾��������������������������������‗אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�" }, "cp28598": "iso88598", "iso88599": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ" }, "cp28599": "iso88599", "iso885910": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĒĢĪĨͧĻĐŠŦŽ­ŪŊ°ąēģīĩķ·ļđšŧž―ūŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎÏÐŅŌÓÔÕÖŨØŲÚÛÜÝÞßāáâãäåæįčéęëėíîïðņōóôõöũøųúûüýþĸ" }, "cp28600": "iso885910", "iso885911": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" }, "cp28601": "iso885911", "iso885913": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ”¢£¤„¦§Ø©Ŗ«¬­®Æ°±²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž’" }, "cp28603": "iso885913", "iso885914": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ḃḃ£ĊċḊ§Ẁ©ẂḋỲ­®ŸḞḟĠġṀṁ¶ṖẁṗẃṠỳẄẅṡÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŴÑÒÓÔÕÖṪØÙÚÛÜÝŶßàáâãäåæçèéêëìíîïŵñòóôõöṫøùúûüýŷÿ" }, "cp28604": "iso885914", "iso885915": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥Š§š©ª«¬­®¯°±²³Žµ¶·ž¹º»ŒœŸ¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" }, "cp28605": "iso885915", "iso885916": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄąŁ€„Чš©Ș«Ź­źŻ°±ČłŽ”¶·žčș»ŒœŸżÀÁÂĂÄĆÆÇÈÉÊËÌÍÎÏĐŃÒÓÔŐÖŚŰÙÚÛÜĘȚßàáâăäćæçèéêëìíîïđńòóôőöśűùúûüęțÿ" }, "cp28606": "iso885916", "cp437": { "type": "_sbcs", "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, "ibm437": "cp437", "csibm437": "cp437", "cp737": { "type": "_sbcs", "chars": "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ " }, "ibm737": "cp737", "csibm737": "cp737", "cp775": { "type": "_sbcs", "chars": "ĆüéāäģåćłēŖŗīŹÄÅÉæÆōöĢ¢ŚśÖÜø£Ø×¤ĀĪóŻżź”¦©®¬½¼Ł«»░▒▓│┤ĄČĘĖ╣║╗╝ĮŠ┐└┴┬├─┼ŲŪ╚╔╩╦╠═╬Žąčęėįšųūž┘┌█▄▌▐▀ÓßŌŃõÕµńĶķĻļņĒŅ’­±“¾¶§÷„°∙·¹³²■ " }, "ibm775": "cp775", "csibm775": "cp775", "cp850": { "type": "_sbcs", "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ " }, "ibm850": "cp850", "csibm850": "cp850", "cp852": { "type": "_sbcs", "chars": "ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁ×čáíóúĄąŽžĘ꬟Ⱥ«»░▒▓│┤ÁÂĚŞ╣║╗╝Żż┐└┴┬├─┼Ăă╚╔╩╦╠═╬¤đĐĎËďŇÍÎě┘┌█▄ŢŮ▀ÓßÔŃńňŠšŔÚŕŰýÝţ´­˝˛ˇ˘§÷¸°¨˙űŘř■ " }, "ibm852": "cp852", "csibm852": "cp852", "cp855": { "type": "_sbcs", "chars": "ђЂѓЃёЁєЄѕЅіІїЇјЈљЉњЊћЋќЌўЎџЏюЮъЪаАбБцЦдДеЕфФгГ«»░▒▓│┤хХиИ╣║╗╝йЙ┐└┴┬├─┼кК╚╔╩╦╠═╬¤лЛмМнНоОп┘┌█▄Пя▀ЯрРсСтТуУжЖвВьЬ№­ыЫзЗшШэЭщЩчЧ§■ " }, "ibm855": "cp855", "csibm855": "cp855", "cp856": { "type": "_sbcs", "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת�£�×����������®¬½¼�«»░▒▓│┤���©╣║╗╝¢¥┐└┴┬├─┼��╚╔╩╦╠═╬¤���������┘┌█▄¦�▀������µ�������¯´­±‗¾¶§÷¸°¨·¹³²■ " }, "ibm856": "cp856", "csibm856": "cp856", "cp857": { "type": "_sbcs", "chars": "ÇüéâäàåçêëèïîıÄÅÉæÆôöòûùİÖÜø£ØŞşáíóúñÑĞ𿮬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ºªÊËÈ�ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµ�×ÚÛÙìÿ¯´­±�¾¶§÷¸°¨·¹³²■ " }, "ibm857": "cp857", "csibm857": "cp857", "cp858": { "type": "_sbcs", "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈ€ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ " }, "ibm858": "cp858", "csibm858": "cp858", "cp860": { "type": "_sbcs", "chars": "ÇüéâãàÁçêÊèÍÔìÃÂÉÀÈôõòÚùÌÕÜ¢£Ù₧ÓáíóúñѪº¿Ò¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, "ibm860": "cp860", "csibm860": "cp860", "cp861": { "type": "_sbcs", "chars": "ÇüéâäàåçêëèÐðÞÄÅÉæÆôöþûÝýÖÜø£Ø₧ƒáíóúÁÍÓÚ¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, "ibm861": "cp861", "csibm861": "cp861", "cp862": { "type": "_sbcs", "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, "ibm862": "cp862", "csibm862": "cp862", "cp863": { "type": "_sbcs", "chars": "ÇüéâÂà¶çêëèïî‗À§ÉÈÊôËÏûù¤ÔÜ¢£ÙÛƒ¦´óú¨¸³¯Î⌐¬½¼¾«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, "ibm863": "cp863", "csibm863": "cp863", "cp864": { "type": "_sbcs", "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$٪&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ��ﻻﻼ� ­ﺂ£¤ﺄ��ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■�" }, "ibm864": "cp864", "csibm864": "cp864", "cp865": { "type": "_sbcs", "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, "ibm865": "cp865", "csibm865": "cp865", "cp866": { "type": "_sbcs", "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ " }, "ibm866": "cp866", "csibm866": "cp866", "cp869": { "type": "_sbcs", "chars": "������Ά�·¬¦‘’Έ―ΉΊΪΌ��ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄­±υφχ§ψ΅°¨ωϋΰώ■ " }, "ibm869": "cp869", "csibm869": "cp869", "cp922": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®‾°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŠÑÒÓÔÕÖרÙÚÛÜÝŽßàáâãäåæçèéêëìíîïšñòóôõö÷øùúûüýžÿ" }, "ibm922": "cp922", "csibm922": "cp922", "cp1046": { "type": "_sbcs", "chars": "ﺈ×÷ﹱˆ■│─┐┌└┘ﹹﹻﹽﹿﹷﺊﻰﻳﻲﻎﻏﻐﻶﻸﻺﻼ ¤ﺋﺑﺗﺛﺟﺣ،­ﺧﺳ٠١٢٣٤٥٦٧٨٩ﺷ؛ﺻﺿﻊ؟ﻋءآأؤإئابةتثجحخدذرزسشصضطﻇعغﻌﺂﺄﺎﻓـفقكلمنهوىيًٌٍَُِّْﻗﻛﻟﻵﻷﻹﻻﻣﻧﻬﻩ�" }, "ibm1046": "cp1046", "csibm1046": "cp1046", "cp1124": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂҐЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђґєѕіїјљњћќ§ўџ" }, "ibm1124": "cp1124", "csibm1124": "cp1124", "cp1125": { "type": "_sbcs", "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёҐґЄєІіЇї·√№¤■ " }, "ibm1125": "cp1125", "csibm1125": "cp1125", "cp1129": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" }, "ibm1129": "cp1129", "csibm1129": "cp1129", "cp1133": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ກຂຄງຈສຊຍດຕຖທນບປຜຝພຟມຢຣລວຫອຮ���ຯະາຳິີຶືຸູຼັົຽ���ເແໂໃໄ່້໊໋໌ໍໆ�ໜໝ₭����������������໐໑໒໓໔໕໖໗໘໙��¢¬¦�" }, "ibm1133": "cp1133", "csibm1133": "cp1133", "cp1161": { "type": "_sbcs", "chars": "��������������������������������่กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู้๊๋€฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛¢¬¦ " }, "ibm1161": "cp1161", "csibm1161": "cp1161", "cp1162": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" }, "ibm1162": "cp1162", "csibm1162": "cp1162", "cp1163": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" }, "ibm1163": "cp1163", "csibm1163": "cp1163", "maccroatian": { "type": "_sbcs", "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊�©⁄¤‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ" }, "maccyrillic": { "type": "_sbcs", "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°¢£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµ∂ЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤" }, "macgreek": { "type": "_sbcs", "chars": "Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦­ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ�" }, "maciceland": { "type": "_sbcs", "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" }, "macroman": { "type": "_sbcs", "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" }, "macromania": { "type": "_sbcs", "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂŞ∞±≤≥¥µ∂∑∏π∫ªºΩăş¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›Ţţ‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" }, "macthai": { "type": "_sbcs", "chars": "«»…“”�•‘’� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู​–—฿เแโใไๅๆ็่้๊๋์ํ™๏๐๑๒๓๔๕๖๗๘๙®©����" }, "macturkish": { "type": "_sbcs", "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙ�ˆ˜¯˘˙˚¸˝˛ˇ" }, "macukraine": { "type": "_sbcs", "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤" }, "koi8r": { "type": "_sbcs", "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" }, "koi8u": { "type": "_sbcs", "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґ╝╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪Ґ╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" }, "koi8ru": { "type": "_sbcs", "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґў╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪ҐЎ©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" }, "koi8t": { "type": "_sbcs", "chars": "қғ‚Ғ„…†‡�‰ҳ‹ҲҷҶ�Қ‘’“”•–—�™�›�����ӯӮё¤ӣ¦§���«¬­®�°±²Ё�Ӣ¶·�№�»���©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" }, "armscii8": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �և։)(»«—.՝,-֊…՜՛՞ԱաԲբԳգԴդԵեԶզԷէԸըԹթԺժԻիԼլԽխԾծԿկՀհՁձՂղՃճՄմՅյՆնՇշՈոՉչՊպՋջՌռՍսՎվՏտՐրՑցՒւՓփՔքՕօՖֆ՚�" }, "rk1048": { "type": "_sbcs", "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊҚҺЏђ‘’“”•–—�™љ›њқһџ ҰұӘ¤Ө¦§Ё©Ғ«¬­®Ү°±Ііөµ¶·ё№ғ»әҢңүАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" }, "tcvn": { "type": "_sbcs", "chars": "\u0000ÚỤ\u0003ỪỬỮ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010ỨỰỲỶỸÝỴ\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÀẢÃÁẠẶẬÈẺẼÉẸỆÌỈĨÍỊÒỎÕÓỌỘỜỞỠỚỢÙỦŨ ĂÂÊÔƠƯĐăâêôơưđẶ̀̀̉̃́àảãáạẲằẳẵắẴẮẦẨẪẤỀặầẩẫấậèỂẻẽéẹềểễếệìỉỄẾỒĩíịòỔỏõóọồổỗốộờởỡớợùỖủũúụừửữứựỳỷỹýỵỐ" }, "georgianacademy": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰჱჲჳჴჵჶçèéêëìíîïðñòóôõö÷øùúûüýþÿ" }, "georgianps": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზჱთიკლმნჲოპჟრსტჳუფქღყშჩცძწჭხჴჯჰჵæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" }, "pt154": { "type": "_sbcs", "chars": "ҖҒӮғ„…ҶҮҲүҠӢҢҚҺҸҗ‘’“”•–—ҳҷҡӣңқһҹ ЎўЈӨҘҰ§Ё©Ә«¬ӯ®Ҝ°ұІіҙө¶·ё№ә»јҪҫҝАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" }, "viscii": { "type": "_sbcs", "chars": "\u0000\u0001Ẳ\u0003\u0004ẴẪ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013Ỷ\u0015\u0016\u0017\u0018Ỹ\u001a\u001b\u001c\u001dỴ\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ẠẮẰẶẤẦẨẬẼẸẾỀỂỄỆỐỒỔỖỘỢỚỜỞỊỎỌỈỦŨỤỲÕắằặấầẩậẽẹếềểễệốồổỗỠƠộờởịỰỨỪỬơớƯÀÁÂÃẢĂẳẵÈÉÊẺÌÍĨỳĐứÒÓÔạỷừửÙÚỹỵÝỡưàáâãảăữẫèéêẻìíĩỉđựòóôõỏọụùúũủýợỮ" }, "iso646cn": { "type": "_sbcs", "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#¥%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������" }, "iso646jp": { "type": "_sbcs", "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[¥]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������" }, "hproman8": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¶¾—¼½ªº«■»±�" }, "macintosh": { "type": "_sbcs", "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" }, "ascii": { "type": "_sbcs", "chars": "��������������������������������������������������������������������������������������������������������������������������������" }, "tis620": { "type": "_sbcs", "chars": "���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" } } /***/ }), /***/ "./node_modules/encoding/node_modules/iconv-lite/encodings/sbcs-data.js": /*!******************************************************************************!*\ !*** ./node_modules/encoding/node_modules/iconv-lite/encodings/sbcs-data.js ***! \******************************************************************************/ /***/ ((module) => { "use strict"; // Manually added data to be used by sbcs codec in addition to generated one. module.exports = { // Not supported by iconv, not sure why. "10029": "maccenteuro", "maccenteuro": { "type": "_sbcs", "chars": "ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ" }, "808": "cp808", "ibm808": "cp808", "cp808": { "type": "_sbcs", "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№€■ " }, "mik": { "type": "_sbcs", "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя└┴┬├─┼╣║╚╔╩╦╠═╬┐░▒▓│┤№§╗╝┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, "cp720": { "type": "_sbcs", "chars": "\x80\x81éâ\x84à\x86çêëèïî\x8d\x8e\x8f\x90\u0651\u0652ô¤ـûùءآأؤ£إئابةتثجحخدذرزسشص«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ضطظعغفµقكلمنهوىي≡\u064b\u064c\u064d\u064e\u064f\u0650≈°∙·√ⁿ²■\u00a0" }, // Aliases of generated encodings. "ascii8bit": "ascii", "usascii": "ascii", "ansix34": "ascii", "ansix341968": "ascii", "ansix341986": "ascii", "csascii": "ascii", "cp367": "ascii", "ibm367": "ascii", "isoir6": "ascii", "iso646us": "ascii", "iso646irv": "ascii", "us": "ascii", "latin1": "iso88591", "latin2": "iso88592", "latin3": "iso88593", "latin4": "iso88594", "latin5": "iso88599", "latin6": "iso885910", "latin7": "iso885913", "latin8": "iso885914", "latin9": "iso885915", "latin10": "iso885916", "csisolatin1": "iso88591", "csisolatin2": "iso88592", "csisolatin3": "iso88593", "csisolatin4": "iso88594", "csisolatincyrillic": "iso88595", "csisolatinarabic": "iso88596", "csisolatingreek" : "iso88597", "csisolatinhebrew": "iso88598", "csisolatin5": "iso88599", "csisolatin6": "iso885910", "l1": "iso88591", "l2": "iso88592", "l3": "iso88593", "l4": "iso88594", "l5": "iso88599", "l6": "iso885910", "l7": "iso885913", "l8": "iso885914", "l9": "iso885915", "l10": "iso885916", "isoir14": "iso646jp", "isoir57": "iso646cn", "isoir100": "iso88591", "isoir101": "iso88592", "isoir109": "iso88593", "isoir110": "iso88594", "isoir144": "iso88595", "isoir127": "iso88596", "isoir126": "iso88597", "isoir138": "iso88598", "isoir148": "iso88599", "isoir157": "iso885910", "isoir166": "tis620", "isoir179": "iso885913", "isoir199": "iso885914", "isoir203": "iso885915", "isoir226": "iso885916", "cp819": "iso88591", "ibm819": "iso88591", "cyrillic": "iso88595", "arabic": "iso88596", "arabic8": "iso88596", "ecma114": "iso88596", "asmo708": "iso88596", "greek" : "iso88597", "greek8" : "iso88597", "ecma118" : "iso88597", "elot928" : "iso88597", "hebrew": "iso88598", "hebrew8": "iso88598", "turkish": "iso88599", "turkish8": "iso88599", "thai": "iso885911", "thai8": "iso885911", "celtic": "iso885914", "celtic8": "iso885914", "isoceltic": "iso885914", "tis6200": "tis620", "tis62025291": "tis620", "tis62025330": "tis620", "10000": "macroman", "10006": "macgreek", "10007": "maccyrillic", "10079": "maciceland", "10081": "macturkish", "cspc8codepage437": "cp437", "cspc775baltic": "cp775", "cspc850multilingual": "cp850", "cspcp852": "cp852", "cspc862latinhebrew": "cp862", "cpgr": "cp869", "msee": "cp1250", "mscyrl": "cp1251", "msansi": "cp1252", "msgreek": "cp1253", "msturk": "cp1254", "mshebr": "cp1255", "msarab": "cp1256", "winbaltrim": "cp1257", "cp20866": "koi8r", "20866": "koi8r", "ibm878": "koi8r", "cskoi8r": "koi8r", "cp21866": "koi8u", "21866": "koi8u", "ibm1168": "koi8u", "strk10482002": "rk1048", "tcvn5712": "tcvn", "tcvn57121": "tcvn", "gb198880": "iso646cn", "cn": "iso646cn", "csiso14jisc6220ro": "iso646jp", "jisc62201969ro": "iso646jp", "jp": "iso646jp", "cshproman8": "hproman8", "r8": "hproman8", "roman8": "hproman8", "xroman8": "hproman8", "ibm1051": "hproman8", "mac": "macintosh", "csmacintosh": "macintosh", }; /***/ }), /***/ "./node_modules/encoding/node_modules/iconv-lite/encodings/utf16.js": /*!**************************************************************************!*\ !*** ./node_modules/encoding/node_modules/iconv-lite/encodings/utf16.js ***! \**************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var Buffer = (__webpack_require__(/*! safer-buffer */ "./node_modules/safer-buffer/safer.js").Buffer); // Note: UTF16-LE (or UCS2) codec is Node.js native. See encodings/internal.js // == UTF16-BE codec. ========================================================== exports.utf16be = Utf16BECodec; function Utf16BECodec() { } Utf16BECodec.prototype.encoder = Utf16BEEncoder; Utf16BECodec.prototype.decoder = Utf16BEDecoder; Utf16BECodec.prototype.bomAware = true; // -- Encoding function Utf16BEEncoder() { } Utf16BEEncoder.prototype.write = function(str) { var buf = Buffer.from(str, 'ucs2'); for (var i = 0; i < buf.length; i += 2) { var tmp = buf[i]; buf[i] = buf[i+1]; buf[i+1] = tmp; } return buf; } Utf16BEEncoder.prototype.end = function() { } // -- Decoding function Utf16BEDecoder() { this.overflowByte = -1; } Utf16BEDecoder.prototype.write = function(buf) { if (buf.length == 0) return ''; var buf2 = Buffer.alloc(buf.length + 1), i = 0, j = 0; if (this.overflowByte !== -1) { buf2[0] = buf[0]; buf2[1] = this.overflowByte; i = 1; j = 2; } for (; i < buf.length-1; i += 2, j+= 2) { buf2[j] = buf[i+1]; buf2[j+1] = buf[i]; } this.overflowByte = (i == buf.length-1) ? buf[buf.length-1] : -1; return buf2.slice(0, j).toString('ucs2'); } Utf16BEDecoder.prototype.end = function() { this.overflowByte = -1; } // == UTF-16 codec ============================================================= // Decoder chooses automatically from UTF-16LE and UTF-16BE using BOM and space-based heuristic. // Defaults to UTF-16LE, as it's prevalent and default in Node. // http://en.wikipedia.org/wiki/UTF-16 and http://encoding.spec.whatwg.org/#utf-16le // Decoder default can be changed: iconv.decode(buf, 'utf16', {defaultEncoding: 'utf-16be'}); // Encoder uses UTF-16LE and prepends BOM (which can be overridden with addBOM: false). exports.utf16 = Utf16Codec; function Utf16Codec(codecOptions, iconv) { this.iconv = iconv; } Utf16Codec.prototype.encoder = Utf16Encoder; Utf16Codec.prototype.decoder = Utf16Decoder; // -- Encoding (pass-through) function Utf16Encoder(options, codec) { options = options || {}; if (options.addBOM === undefined) options.addBOM = true; this.encoder = codec.iconv.getEncoder('utf-16le', options); } Utf16Encoder.prototype.write = function(str) { return this.encoder.write(str); } Utf16Encoder.prototype.end = function() { return this.encoder.end(); } // -- Decoding function Utf16Decoder(options, codec) { this.decoder = null; this.initialBufs = []; this.initialBufsLen = 0; this.options = options || {}; this.iconv = codec.iconv; } Utf16Decoder.prototype.write = function(buf) { if (!this.decoder) { // Codec is not chosen yet. Accumulate initial bytes. this.initialBufs.push(buf); this.initialBufsLen += buf.length; if (this.initialBufsLen < 16) // We need more bytes to use space heuristic (see below) return ''; // We have enough bytes -> detect endianness. var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); this.decoder = this.iconv.getDecoder(encoding, this.options); var resStr = ''; for (var i = 0; i < this.initialBufs.length; i++) resStr += this.decoder.write(this.initialBufs[i]); this.initialBufs.length = this.initialBufsLen = 0; return resStr; } return this.decoder.write(buf); } Utf16Decoder.prototype.end = function() { if (!this.decoder) { var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); this.decoder = this.iconv.getDecoder(encoding, this.options); var resStr = ''; for (var i = 0; i < this.initialBufs.length; i++) resStr += this.decoder.write(this.initialBufs[i]); var trail = this.decoder.end(); if (trail) resStr += trail; this.initialBufs.length = this.initialBufsLen = 0; return resStr; } return this.decoder.end(); } function detectEncoding(bufs, defaultEncoding) { var b = []; var charsProcessed = 0; var asciiCharsLE = 0, asciiCharsBE = 0; // Number of ASCII chars when decoded as LE or BE. outer_loop: for (var i = 0; i < bufs.length; i++) { var buf = bufs[i]; for (var j = 0; j < buf.length; j++) { b.push(buf[j]); if (b.length === 2) { if (charsProcessed === 0) { // Check BOM first. if (b[0] === 0xFF && b[1] === 0xFE) return 'utf-16le'; if (b[0] === 0xFE && b[1] === 0xFF) return 'utf-16be'; } if (b[0] === 0 && b[1] !== 0) asciiCharsBE++; if (b[0] !== 0 && b[1] === 0) asciiCharsLE++; b.length = 0; charsProcessed++; if (charsProcessed >= 100) { break outer_loop; } } } } // Make decisions. // Most of the time, the content has ASCII chars (U+00**), but the opposite (U+**00) is uncommon. // So, we count ASCII as if it was LE or BE, and decide from that. if (asciiCharsBE > asciiCharsLE) return 'utf-16be'; if (asciiCharsBE < asciiCharsLE) return 'utf-16le'; // Couldn't decide (likely all zeros or not enough data). return defaultEncoding || 'utf-16le'; } /***/ }), /***/ "./node_modules/encoding/node_modules/iconv-lite/encodings/utf32.js": /*!**************************************************************************!*\ !*** ./node_modules/encoding/node_modules/iconv-lite/encodings/utf32.js ***! \**************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var Buffer = (__webpack_require__(/*! safer-buffer */ "./node_modules/safer-buffer/safer.js").Buffer); // == UTF32-LE/BE codec. ========================================================== exports._utf32 = Utf32Codec; function Utf32Codec(codecOptions, iconv) { this.iconv = iconv; this.bomAware = true; this.isLE = codecOptions.isLE; } exports.utf32le = { type: '_utf32', isLE: true }; exports.utf32be = { type: '_utf32', isLE: false }; // Aliases exports.ucs4le = 'utf32le'; exports.ucs4be = 'utf32be'; Utf32Codec.prototype.encoder = Utf32Encoder; Utf32Codec.prototype.decoder = Utf32Decoder; // -- Encoding function Utf32Encoder(options, codec) { this.isLE = codec.isLE; this.highSurrogate = 0; } Utf32Encoder.prototype.write = function(str) { var src = Buffer.from(str, 'ucs2'); var dst = Buffer.alloc(src.length * 2); var write32 = this.isLE ? dst.writeUInt32LE : dst.writeUInt32BE; var offset = 0; for (var i = 0; i < src.length; i += 2) { var code = src.readUInt16LE(i); var isHighSurrogate = (0xD800 <= code && code < 0xDC00); var isLowSurrogate = (0xDC00 <= code && code < 0xE000); if (this.highSurrogate) { if (isHighSurrogate || !isLowSurrogate) { // There shouldn't be two high surrogates in a row, nor a high surrogate which isn't followed by a low // surrogate. If this happens, keep the pending high surrogate as a stand-alone semi-invalid character // (technically wrong, but expected by some applications, like Windows file names). write32.call(dst, this.highSurrogate, offset); offset += 4; } else { // Create 32-bit value from high and low surrogates; var codepoint = (((this.highSurrogate - 0xD800) << 10) | (code - 0xDC00)) + 0x10000; write32.call(dst, codepoint, offset); offset += 4; this.highSurrogate = 0; continue; } } if (isHighSurrogate) this.highSurrogate = code; else { // Even if the current character is a low surrogate, with no previous high surrogate, we'll // encode it as a semi-invalid stand-alone character for the same reasons expressed above for // unpaired high surrogates. write32.call(dst, code, offset); offset += 4; this.highSurrogate = 0; } } if (offset < dst.length) dst = dst.slice(0, offset); return dst; }; Utf32Encoder.prototype.end = function() { // Treat any leftover high surrogate as a semi-valid independent character. if (!this.highSurrogate) return; var buf = Buffer.alloc(4); if (this.isLE) buf.writeUInt32LE(this.highSurrogate, 0); else buf.writeUInt32BE(this.highSurrogate, 0); this.highSurrogate = 0; return buf; }; // -- Decoding function Utf32Decoder(options, codec) { this.isLE = codec.isLE; this.badChar = codec.iconv.defaultCharUnicode.charCodeAt(0); this.overflow = []; } Utf32Decoder.prototype.write = function(src) { if (src.length === 0) return ''; var i = 0; var codepoint = 0; var dst = Buffer.alloc(src.length + 4); var offset = 0; var isLE = this.isLE; var overflow = this.overflow; var badChar = this.badChar; if (overflow.length > 0) { for (; i < src.length && overflow.length < 4; i++) overflow.push(src[i]); if (overflow.length === 4) { // NOTE: codepoint is a signed int32 and can be negative. // NOTE: We copied this block from below to help V8 optimize it (it works with array, not buffer). if (isLE) { codepoint = overflow[i] | (overflow[i+1] << 8) | (overflow[i+2] << 16) | (overflow[i+3] << 24); } else { codepoint = overflow[i+3] | (overflow[i+2] << 8) | (overflow[i+1] << 16) | (overflow[i] << 24); } overflow.length = 0; offset = _writeCodepoint(dst, offset, codepoint, badChar); } } // Main loop. Should be as optimized as possible. for (; i < src.length - 3; i += 4) { // NOTE: codepoint is a signed int32 and can be negative. if (isLE) { codepoint = src[i] | (src[i+1] << 8) | (src[i+2] << 16) | (src[i+3] << 24); } else { codepoint = src[i+3] | (src[i+2] << 8) | (src[i+1] << 16) | (src[i] << 24); } offset = _writeCodepoint(dst, offset, codepoint, badChar); } // Keep overflowing bytes. for (; i < src.length; i++) { overflow.push(src[i]); } return dst.slice(0, offset).toString('ucs2'); }; function _writeCodepoint(dst, offset, codepoint, badChar) { // NOTE: codepoint is signed int32 and can be negative. We keep it that way to help V8 with optimizations. if (codepoint < 0 || codepoint > 0x10FFFF) { // Not a valid Unicode codepoint codepoint = badChar; } // Ephemeral Planes: Write high surrogate. if (codepoint >= 0x10000) { codepoint -= 0x10000; var high = 0xD800 | (codepoint >> 10); dst[offset++] = high & 0xff; dst[offset++] = high >> 8; // Low surrogate is written below. var codepoint = 0xDC00 | (codepoint & 0x3FF); } // Write BMP char or low surrogate. dst[offset++] = codepoint & 0xff; dst[offset++] = codepoint >> 8; return offset; }; Utf32Decoder.prototype.end = function() { this.overflow.length = 0; }; // == UTF-32 Auto codec ============================================================= // Decoder chooses automatically from UTF-32LE and UTF-32BE using BOM and space-based heuristic. // Defaults to UTF-32LE. http://en.wikipedia.org/wiki/UTF-32 // Encoder/decoder default can be changed: iconv.decode(buf, 'utf32', {defaultEncoding: 'utf-32be'}); // Encoder prepends BOM (which can be overridden with (addBOM: false}). exports.utf32 = Utf32AutoCodec; exports.ucs4 = 'utf32'; function Utf32AutoCodec(options, iconv) { this.iconv = iconv; } Utf32AutoCodec.prototype.encoder = Utf32AutoEncoder; Utf32AutoCodec.prototype.decoder = Utf32AutoDecoder; // -- Encoding function Utf32AutoEncoder(options, codec) { options = options || {}; if (options.addBOM === undefined) options.addBOM = true; this.encoder = codec.iconv.getEncoder(options.defaultEncoding || 'utf-32le', options); } Utf32AutoEncoder.prototype.write = function(str) { return this.encoder.write(str); }; Utf32AutoEncoder.prototype.end = function() { return this.encoder.end(); }; // -- Decoding function Utf32AutoDecoder(options, codec) { this.decoder = null; this.initialBufs = []; this.initialBufsLen = 0; this.options = options || {}; this.iconv = codec.iconv; } Utf32AutoDecoder.prototype.write = function(buf) { if (!this.decoder) { // Codec is not chosen yet. Accumulate initial bytes. this.initialBufs.push(buf); this.initialBufsLen += buf.length; if (this.initialBufsLen < 32) // We need more bytes to use space heuristic (see below) return ''; // We have enough bytes -> detect endianness. var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); this.decoder = this.iconv.getDecoder(encoding, this.options); var resStr = ''; for (var i = 0; i < this.initialBufs.length; i++) resStr += this.decoder.write(this.initialBufs[i]); this.initialBufs.length = this.initialBufsLen = 0; return resStr; } return this.decoder.write(buf); }; Utf32AutoDecoder.prototype.end = function() { if (!this.decoder) { var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); this.decoder = this.iconv.getDecoder(encoding, this.options); var resStr = ''; for (var i = 0; i < this.initialBufs.length; i++) resStr += this.decoder.write(this.initialBufs[i]); var trail = this.decoder.end(); if (trail) resStr += trail; this.initialBufs.length = this.initialBufsLen = 0; return resStr; } return this.decoder.end(); }; function detectEncoding(bufs, defaultEncoding) { var b = []; var charsProcessed = 0; var invalidLE = 0, invalidBE = 0; // Number of invalid chars when decoded as LE or BE. var bmpCharsLE = 0, bmpCharsBE = 0; // Number of BMP chars when decoded as LE or BE. outer_loop: for (var i = 0; i < bufs.length; i++) { var buf = bufs[i]; for (var j = 0; j < buf.length; j++) { b.push(buf[j]); if (b.length === 4) { if (charsProcessed === 0) { // Check BOM first. if (b[0] === 0xFF && b[1] === 0xFE && b[2] === 0 && b[3] === 0) { return 'utf-32le'; } if (b[0] === 0 && b[1] === 0 && b[2] === 0xFE && b[3] === 0xFF) { return 'utf-32be'; } } if (b[0] !== 0 || b[1] > 0x10) invalidBE++; if (b[3] !== 0 || b[2] > 0x10) invalidLE++; if (b[0] === 0 && b[1] === 0 && (b[2] !== 0 || b[3] !== 0)) bmpCharsBE++; if ((b[0] !== 0 || b[1] !== 0) && b[2] === 0 && b[3] === 0) bmpCharsLE++; b.length = 0; charsProcessed++; if (charsProcessed >= 100) { break outer_loop; } } } } // Make decisions. if (bmpCharsBE - invalidBE > bmpCharsLE - invalidLE) return 'utf-32be'; if (bmpCharsBE - invalidBE < bmpCharsLE - invalidLE) return 'utf-32le'; // Couldn't decide (likely all zeros or not enough data). return defaultEncoding || 'utf-32le'; } /***/ }), /***/ "./node_modules/encoding/node_modules/iconv-lite/encodings/utf7.js": /*!*************************************************************************!*\ !*** ./node_modules/encoding/node_modules/iconv-lite/encodings/utf7.js ***! \*************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var Buffer = (__webpack_require__(/*! safer-buffer */ "./node_modules/safer-buffer/safer.js").Buffer); // UTF-7 codec, according to https://tools.ietf.org/html/rfc2152 // See also below a UTF-7-IMAP codec, according to http://tools.ietf.org/html/rfc3501#section-5.1.3 exports.utf7 = Utf7Codec; exports.unicode11utf7 = 'utf7'; // Alias UNICODE-1-1-UTF-7 function Utf7Codec(codecOptions, iconv) { this.iconv = iconv; }; Utf7Codec.prototype.encoder = Utf7Encoder; Utf7Codec.prototype.decoder = Utf7Decoder; Utf7Codec.prototype.bomAware = true; // -- Encoding var nonDirectChars = /[^A-Za-z0-9'\(\),-\.\/:\? \n\r\t]+/g; function Utf7Encoder(options, codec) { this.iconv = codec.iconv; } Utf7Encoder.prototype.write = function(str) { // Naive implementation. // Non-direct chars are encoded as "+<base64>-"; single "+" char is encoded as "+-". return Buffer.from(str.replace(nonDirectChars, function(chunk) { return "+" + (chunk === '+' ? '' : this.iconv.encode(chunk, 'utf16-be').toString('base64').replace(/=+$/, '')) + "-"; }.bind(this))); } Utf7Encoder.prototype.end = function() { } // -- Decoding function Utf7Decoder(options, codec) { this.iconv = codec.iconv; this.inBase64 = false; this.base64Accum = ''; } var base64Regex = /[A-Za-z0-9\/+]/; var base64Chars = []; for (var i = 0; i < 256; i++) base64Chars[i] = base64Regex.test(String.fromCharCode(i)); var plusChar = '+'.charCodeAt(0), minusChar = '-'.charCodeAt(0), andChar = '&'.charCodeAt(0); Utf7Decoder.prototype.write = function(buf) { var res = "", lastI = 0, inBase64 = this.inBase64, base64Accum = this.base64Accum; // The decoder is more involved as we must handle chunks in stream. for (var i = 0; i < buf.length; i++) { if (!inBase64) { // We're in direct mode. // Write direct chars until '+' if (buf[i] == plusChar) { res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars. lastI = i+1; inBase64 = true; } } else { // We decode base64. if (!base64Chars[buf[i]]) { // Base64 ended. if (i == lastI && buf[i] == minusChar) {// "+-" -> "+" res += "+"; } else { var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), "ascii"); res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); } if (buf[i] != minusChar) // Minus is absorbed after base64. i--; lastI = i+1; inBase64 = false; base64Accum = ''; } } } if (!inBase64) { res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars. } else { var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii"); var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future. b64str = b64str.slice(0, canBeDecoded); res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); } this.inBase64 = inBase64; this.base64Accum = base64Accum; return res; } Utf7Decoder.prototype.end = function() { var res = ""; if (this.inBase64 && this.base64Accum.length > 0) res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be"); this.inBase64 = false; this.base64Accum = ''; return res; } // UTF-7-IMAP codec. // RFC3501 Sec. 5.1.3 Modified UTF-7 (http://tools.ietf.org/html/rfc3501#section-5.1.3) // Differences: // * Base64 part is started by "&" instead of "+" // * Direct characters are 0x20-0x7E, except "&" (0x26) // * In Base64, "," is used instead of "/" // * Base64 must not be used to represent direct characters. // * No implicit shift back from Base64 (should always end with '-') // * String must end in non-shifted position. // * "-&" while in base64 is not allowed. exports.utf7imap = Utf7IMAPCodec; function Utf7IMAPCodec(codecOptions, iconv) { this.iconv = iconv; }; Utf7IMAPCodec.prototype.encoder = Utf7IMAPEncoder; Utf7IMAPCodec.prototype.decoder = Utf7IMAPDecoder; Utf7IMAPCodec.prototype.bomAware = true; // -- Encoding function Utf7IMAPEncoder(options, codec) { this.iconv = codec.iconv; this.inBase64 = false; this.base64Accum = Buffer.alloc(6); this.base64AccumIdx = 0; } Utf7IMAPEncoder.prototype.write = function(str) { var inBase64 = this.inBase64, base64Accum = this.base64Accum, base64AccumIdx = this.base64AccumIdx, buf = Buffer.alloc(str.length*5 + 10), bufIdx = 0; for (var i = 0; i < str.length; i++) { var uChar = str.charCodeAt(i); if (0x20 <= uChar && uChar <= 0x7E) { // Direct character or '&'. if (inBase64) { if (base64AccumIdx > 0) { bufIdx += buf.write(base64Accum.slice(0, base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx); base64AccumIdx = 0; } buf[bufIdx++] = minusChar; // Write '-', then go to direct mode. inBase64 = false; } if (!inBase64) { buf[bufIdx++] = uChar; // Write direct character if (uChar === andChar) // Ampersand -> '&-' buf[bufIdx++] = minusChar; } } else { // Non-direct character if (!inBase64) { buf[bufIdx++] = andChar; // Write '&', then go to base64 mode. inBase64 = true; } if (inBase64) { base64Accum[base64AccumIdx++] = uChar >> 8; base64Accum[base64AccumIdx++] = uChar & 0xFF; if (base64AccumIdx == base64Accum.length) { bufIdx += buf.write(base64Accum.toString('base64').replace(/\//g, ','), bufIdx); base64AccumIdx = 0; } } } } this.inBase64 = inBase64; this.base64AccumIdx = base64AccumIdx; return buf.slice(0, bufIdx); } Utf7IMAPEncoder.prototype.end = function() { var buf = Buffer.alloc(10), bufIdx = 0; if (this.inBase64) { if (this.base64AccumIdx > 0) { bufIdx += buf.write(this.base64Accum.slice(0, this.base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx); this.base64AccumIdx = 0; } buf[bufIdx++] = minusChar; // Write '-', then go to direct mode. this.inBase64 = false; } return buf.slice(0, bufIdx); } // -- Decoding function Utf7IMAPDecoder(options, codec) { this.iconv = codec.iconv; this.inBase64 = false; this.base64Accum = ''; } var base64IMAPChars = base64Chars.slice(); base64IMAPChars[','.charCodeAt(0)] = true; Utf7IMAPDecoder.prototype.write = function(buf) { var res = "", lastI = 0, inBase64 = this.inBase64, base64Accum = this.base64Accum; // The decoder is more involved as we must handle chunks in stream. // It is forgiving, closer to standard UTF-7 (for example, '-' is optional at the end). for (var i = 0; i < buf.length; i++) { if (!inBase64) { // We're in direct mode. // Write direct chars until '&' if (buf[i] == andChar) { res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars. lastI = i+1; inBase64 = true; } } else { // We decode base64. if (!base64IMAPChars[buf[i]]) { // Base64 ended. if (i == lastI && buf[i] == minusChar) { // "&-" -> "&" res += "&"; } else { var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), "ascii").replace(/,/g, '/'); res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); } if (buf[i] != minusChar) // Minus may be absorbed after base64. i--; lastI = i+1; inBase64 = false; base64Accum = ''; } } } if (!inBase64) { res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars. } else { var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii").replace(/,/g, '/'); var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future. b64str = b64str.slice(0, canBeDecoded); res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); } this.inBase64 = inBase64; this.base64Accum = base64Accum; return res; } Utf7IMAPDecoder.prototype.end = function() { var res = ""; if (this.inBase64 && this.base64Accum.length > 0) res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be"); this.inBase64 = false; this.base64Accum = ''; return res; } /***/ }), /***/ "./node_modules/encoding/node_modules/iconv-lite/lib/bom-handling.js": /*!***************************************************************************!*\ !*** ./node_modules/encoding/node_modules/iconv-lite/lib/bom-handling.js ***! \***************************************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; var BOMChar = '\uFEFF'; exports.PrependBOM = PrependBOMWrapper function PrependBOMWrapper(encoder, options) { this.encoder = encoder; this.addBOM = true; } PrependBOMWrapper.prototype.write = function(str) { if (this.addBOM) { str = BOMChar + str; this.addBOM = false; } return this.encoder.write(str); } PrependBOMWrapper.prototype.end = function() { return this.encoder.end(); } //------------------------------------------------------------------------------ exports.StripBOM = StripBOMWrapper; function StripBOMWrapper(decoder, options) { this.decoder = decoder; this.pass = false; this.options = options || {}; } StripBOMWrapper.prototype.write = function(buf) { var res = this.decoder.write(buf); if (this.pass || !res) return res; if (res[0] === BOMChar) { res = res.slice(1); if (typeof this.options.stripBOM === 'function') this.options.stripBOM(); } this.pass = true; return res; } StripBOMWrapper.prototype.end = function() { return this.decoder.end(); } /***/ }), /***/ "./node_modules/encoding/node_modules/iconv-lite/lib/index.js": /*!********************************************************************!*\ !*** ./node_modules/encoding/node_modules/iconv-lite/lib/index.js ***! \********************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Buffer = (__webpack_require__(/*! safer-buffer */ "./node_modules/safer-buffer/safer.js").Buffer); var bomHandling = __webpack_require__(/*! ./bom-handling */ "./node_modules/encoding/node_modules/iconv-lite/lib/bom-handling.js"), iconv = module.exports; // All codecs and aliases are kept here, keyed by encoding name/alias. // They are lazy loaded in `iconv.getCodec` from `encodings/index.js`. iconv.encodings = null; // Characters emitted in case of error. iconv.defaultCharUnicode = '�'; iconv.defaultCharSingleByte = '?'; // Public API. iconv.encode = function encode(str, encoding, options) { str = "" + (str || ""); // Ensure string. var encoder = iconv.getEncoder(encoding, options); var res = encoder.write(str); var trail = encoder.end(); return (trail && trail.length > 0) ? Buffer.concat([res, trail]) : res; } iconv.decode = function decode(buf, encoding, options) { if (typeof buf === 'string') { if (!iconv.skipDecodeWarning) { console.error('Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding'); iconv.skipDecodeWarning = true; } buf = Buffer.from("" + (buf || ""), "binary"); // Ensure buffer. } var decoder = iconv.getDecoder(encoding, options); var res = decoder.write(buf); var trail = decoder.end(); return trail ? (res + trail) : res; } iconv.encodingExists = function encodingExists(enc) { try { iconv.getCodec(enc); return true; } catch (e) { return false; } } // Legacy aliases to convert functions iconv.toEncoding = iconv.encode; iconv.fromEncoding = iconv.decode; // Search for a codec in iconv.encodings. Cache codec data in iconv._codecDataCache. iconv._codecDataCache = {}; iconv.getCodec = function getCodec(encoding) { if (!iconv.encodings) iconv.encodings = __webpack_require__(/*! ../encodings */ "./node_modules/encoding/node_modules/iconv-lite/encodings/index.js"); // Lazy load all encoding definitions. // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. var enc = iconv._canonicalizeEncoding(encoding); // Traverse iconv.encodings to find actual codec. var codecOptions = {}; while (true) { var codec = iconv._codecDataCache[enc]; if (codec) return codec; var codecDef = iconv.encodings[enc]; switch (typeof codecDef) { case "string": // Direct alias to other encoding. enc = codecDef; break; case "object": // Alias with options. Can be layered. for (var key in codecDef) codecOptions[key] = codecDef[key]; if (!codecOptions.encodingName) codecOptions.encodingName = enc; enc = codecDef.type; break; case "function": // Codec itself. if (!codecOptions.encodingName) codecOptions.encodingName = enc; // The codec function must load all tables and return object with .encoder and .decoder methods. // It'll be called only once (for each different options object). codec = new codecDef(codecOptions, iconv); iconv._codecDataCache[codecOptions.encodingName] = codec; // Save it to be reused later. return codec; default: throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '"+enc+"')"); } } } iconv._canonicalizeEncoding = function(encoding) { // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. return (''+encoding).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g, ""); } iconv.getEncoder = function getEncoder(encoding, options) { var codec = iconv.getCodec(encoding), encoder = new codec.encoder(options, codec); if (codec.bomAware && options && options.addBOM) encoder = new bomHandling.PrependBOM(encoder, options); return encoder; } iconv.getDecoder = function getDecoder(encoding, options) { var codec = iconv.getCodec(encoding), decoder = new codec.decoder(options, codec); if (codec.bomAware && !(options && options.stripBOM === false)) decoder = new bomHandling.StripBOM(decoder, options); return decoder; } // Streaming API // NOTE: Streaming API naturally depends on 'stream' module from Node.js. Unfortunately in browser environments this module can add // up to 100Kb to the output bundle. To avoid unnecessary code bloat, we don't enable Streaming API in browser by default. // If you would like to enable it explicitly, please add the following code to your app: // > iconv.enableStreamingAPI(require('stream')); iconv.enableStreamingAPI = function enableStreamingAPI(stream_module) { if (iconv.supportsStreams) return; // Dependency-inject stream module to create IconvLite stream classes. var streams = __webpack_require__(/*! ./streams */ "./node_modules/encoding/node_modules/iconv-lite/lib/streams.js")(stream_module); // Not public API yet, but expose the stream classes. iconv.IconvLiteEncoderStream = streams.IconvLiteEncoderStream; iconv.IconvLiteDecoderStream = streams.IconvLiteDecoderStream; // Streaming API. iconv.encodeStream = function encodeStream(encoding, options) { return new iconv.IconvLiteEncoderStream(iconv.getEncoder(encoding, options), options); } iconv.decodeStream = function decodeStream(encoding, options) { return new iconv.IconvLiteDecoderStream(iconv.getDecoder(encoding, options), options); } iconv.supportsStreams = true; } // Enable Streaming API automatically if 'stream' module is available and non-empty (the majority of environments). var stream_module; try { stream_module = __webpack_require__(/*! stream */ "stream"); } catch (e) {} if (stream_module && stream_module.Transform) { iconv.enableStreamingAPI(stream_module); } else { // In rare cases where 'stream' module is not available by default, throw a helpful exception. iconv.encodeStream = iconv.decodeStream = function() { throw new Error("iconv-lite Streaming API is not enabled. Use iconv.enableStreamingAPI(require('stream')); to enable it."); }; } if (false) {} /***/ }), /***/ "./node_modules/encoding/node_modules/iconv-lite/lib/streams.js": /*!**********************************************************************!*\ !*** ./node_modules/encoding/node_modules/iconv-lite/lib/streams.js ***! \**********************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var Buffer = (__webpack_require__(/*! safer-buffer */ "./node_modules/safer-buffer/safer.js").Buffer); // NOTE: Due to 'stream' module being pretty large (~100Kb, significant in browser environments), // we opt to dependency-inject it instead of creating a hard dependency. module.exports = function(stream_module) { var Transform = stream_module.Transform; // == Encoder stream ======================================================= function IconvLiteEncoderStream(conv, options) { this.conv = conv; options = options || {}; options.decodeStrings = false; // We accept only strings, so we don't need to decode them. Transform.call(this, options); } IconvLiteEncoderStream.prototype = Object.create(Transform.prototype, { constructor: { value: IconvLiteEncoderStream } }); IconvLiteEncoderStream.prototype._transform = function(chunk, encoding, done) { if (typeof chunk != 'string') return done(new Error("Iconv encoding stream needs strings as its input.")); try { var res = this.conv.write(chunk); if (res && res.length) this.push(res); done(); } catch (e) { done(e); } } IconvLiteEncoderStream.prototype._flush = function(done) { try { var res = this.conv.end(); if (res && res.length) this.push(res); done(); } catch (e) { done(e); } } IconvLiteEncoderStream.prototype.collect = function(cb) { var chunks = []; this.on('error', cb); this.on('data', function(chunk) { chunks.push(chunk); }); this.on('end', function() { cb(null, Buffer.concat(chunks)); }); return this; } // == Decoder stream ======================================================= function IconvLiteDecoderStream(conv, options) { this.conv = conv; options = options || {}; options.encoding = this.encoding = 'utf8'; // We output strings. Transform.call(this, options); } IconvLiteDecoderStream.prototype = Object.create(Transform.prototype, { constructor: { value: IconvLiteDecoderStream } }); IconvLiteDecoderStream.prototype._transform = function(chunk, encoding, done) { if (!Buffer.isBuffer(chunk) && !(chunk instanceof Uint8Array)) return done(new Error("Iconv decoding stream needs buffers as its input.")); try { var res = this.conv.write(chunk); if (res && res.length) this.push(res, this.encoding); done(); } catch (e) { done(e); } } IconvLiteDecoderStream.prototype._flush = function(done) { try { var res = this.conv.end(); if (res && res.length) this.push(res, this.encoding); done(); } catch (e) { done(e); } } IconvLiteDecoderStream.prototype.collect = function(cb) { var res = ''; this.on('error', cb); this.on('data', function(chunk) { res += chunk; }); this.on('end', function() { cb(null, res); }); return this; } return { IconvLiteEncoderStream: IconvLiteEncoderStream, IconvLiteDecoderStream: IconvLiteDecoderStream, }; }; /***/ }), /***/ "./node_modules/entities/lib/decode.js": /*!*********************************************!*\ !*** ./node_modules/entities/lib/decode.js ***! \*********************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.decodeXML = exports.decodeHTMLStrict = exports.decodeHTMLAttribute = exports.decodeHTML = exports.determineBranch = exports.EntityDecoder = exports.DecodingMode = exports.BinTrieFlags = exports.fromCodePoint = exports.replaceCodePoint = exports.decodeCodePoint = exports.xmlDecodeTree = exports.htmlDecodeTree = void 0; var decode_data_html_js_1 = __importDefault(__webpack_require__(/*! ./generated/decode-data-html.js */ "./node_modules/entities/lib/generated/decode-data-html.js")); exports.htmlDecodeTree = decode_data_html_js_1.default; var decode_data_xml_js_1 = __importDefault(__webpack_require__(/*! ./generated/decode-data-xml.js */ "./node_modules/entities/lib/generated/decode-data-xml.js")); exports.xmlDecodeTree = decode_data_xml_js_1.default; var decode_codepoint_js_1 = __importStar(__webpack_require__(/*! ./decode_codepoint.js */ "./node_modules/entities/lib/decode_codepoint.js")); exports.decodeCodePoint = decode_codepoint_js_1.default; var decode_codepoint_js_2 = __webpack_require__(/*! ./decode_codepoint.js */ "./node_modules/entities/lib/decode_codepoint.js"); Object.defineProperty(exports, "replaceCodePoint", ({ enumerable: true, get: function () { return decode_codepoint_js_2.replaceCodePoint; } })); Object.defineProperty(exports, "fromCodePoint", ({ enumerable: true, get: function () { return decode_codepoint_js_2.fromCodePoint; } })); var CharCodes; (function (CharCodes) { CharCodes[CharCodes["NUM"] = 35] = "NUM"; CharCodes[CharCodes["SEMI"] = 59] = "SEMI"; CharCodes[CharCodes["EQUALS"] = 61] = "EQUALS"; CharCodes[CharCodes["ZERO"] = 48] = "ZERO"; CharCodes[CharCodes["NINE"] = 57] = "NINE"; CharCodes[CharCodes["LOWER_A"] = 97] = "LOWER_A"; CharCodes[CharCodes["LOWER_F"] = 102] = "LOWER_F"; CharCodes[CharCodes["LOWER_X"] = 120] = "LOWER_X"; CharCodes[CharCodes["LOWER_Z"] = 122] = "LOWER_Z"; CharCodes[CharCodes["UPPER_A"] = 65] = "UPPER_A"; CharCodes[CharCodes["UPPER_F"] = 70] = "UPPER_F"; CharCodes[CharCodes["UPPER_Z"] = 90] = "UPPER_Z"; })(CharCodes || (CharCodes = {})); /** Bit that needs to be set to convert an upper case ASCII character to lower case */ var TO_LOWER_BIT = 32; var BinTrieFlags; (function (BinTrieFlags) { BinTrieFlags[BinTrieFlags["VALUE_LENGTH"] = 49152] = "VALUE_LENGTH"; BinTrieFlags[BinTrieFlags["BRANCH_LENGTH"] = 16256] = "BRANCH_LENGTH"; BinTrieFlags[BinTrieFlags["JUMP_TABLE"] = 127] = "JUMP_TABLE"; })(BinTrieFlags = exports.BinTrieFlags || (exports.BinTrieFlags = {})); function isNumber(code) { return code >= CharCodes.ZERO && code <= CharCodes.NINE; } function isHexadecimalCharacter(code) { return ((code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_F) || (code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_F)); } function isAsciiAlphaNumeric(code) { return ((code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_Z) || (code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_Z) || isNumber(code)); } /** * Checks if the given character is a valid end character for an entity in an attribute. * * Attribute values that aren't terminated properly aren't parsed, and shouldn't lead to a parser error. * See the example in https://html.spec.whatwg.org/multipage/parsing.html#named-character-reference-state */ function isEntityInAttributeInvalidEnd(code) { return code === CharCodes.EQUALS || isAsciiAlphaNumeric(code); } var EntityDecoderState; (function (EntityDecoderState) { EntityDecoderState[EntityDecoderState["EntityStart"] = 0] = "EntityStart"; EntityDecoderState[EntityDecoderState["NumericStart"] = 1] = "NumericStart"; EntityDecoderState[EntityDecoderState["NumericDecimal"] = 2] = "NumericDecimal"; EntityDecoderState[EntityDecoderState["NumericHex"] = 3] = "NumericHex"; EntityDecoderState[EntityDecoderState["NamedEntity"] = 4] = "NamedEntity"; })(EntityDecoderState || (EntityDecoderState = {})); var DecodingMode; (function (DecodingMode) { /** Entities in text nodes that can end with any character. */ DecodingMode[DecodingMode["Legacy"] = 0] = "Legacy"; /** Only allow entities terminated with a semicolon. */ DecodingMode[DecodingMode["Strict"] = 1] = "Strict"; /** Entities in attributes have limitations on ending characters. */ DecodingMode[DecodingMode["Attribute"] = 2] = "Attribute"; })(DecodingMode = exports.DecodingMode || (exports.DecodingMode = {})); /** * Token decoder with support of writing partial entities. */ var EntityDecoder = /** @class */ (function () { function EntityDecoder( /** The tree used to decode entities. */ decodeTree, /** * The function that is called when a codepoint is decoded. * * For multi-byte named entities, this will be called multiple times, * with the second codepoint, and the same `consumed` value. * * @param codepoint The decoded codepoint. * @param consumed The number of bytes consumed by the decoder. */ emitCodePoint, /** An object that is used to produce errors. */ errors) { this.decodeTree = decodeTree; this.emitCodePoint = emitCodePoint; this.errors = errors; /** The current state of the decoder. */ this.state = EntityDecoderState.EntityStart; /** Characters that were consumed while parsing an entity. */ this.consumed = 1; /** * The result of the entity. * * Either the result index of a numeric entity, or the codepoint of a * numeric entity. */ this.result = 0; /** The current index in the decode tree. */ this.treeIndex = 0; /** The number of characters that were consumed in excess. */ this.excess = 1; /** The mode in which the decoder is operating. */ this.decodeMode = DecodingMode.Strict; } /** Resets the instance to make it reusable. */ EntityDecoder.prototype.startEntity = function (decodeMode) { this.decodeMode = decodeMode; this.state = EntityDecoderState.EntityStart; this.result = 0; this.treeIndex = 0; this.excess = 1; this.consumed = 1; }; /** * Write an entity to the decoder. This can be called multiple times with partial entities. * If the entity is incomplete, the decoder will return -1. * * Mirrors the implementation of `getDecoder`, but with the ability to stop decoding if the * entity is incomplete, and resume when the next string is written. * * @param string The string containing the entity (or a continuation of the entity). * @param offset The offset at which the entity begins. Should be 0 if this is not the first call. * @returns The number of characters that were consumed, or -1 if the entity is incomplete. */ EntityDecoder.prototype.write = function (str, offset) { switch (this.state) { case EntityDecoderState.EntityStart: { if (str.charCodeAt(offset) === CharCodes.NUM) { this.state = EntityDecoderState.NumericStart; this.consumed += 1; return this.stateNumericStart(str, offset + 1); } this.state = EntityDecoderState.NamedEntity; return this.stateNamedEntity(str, offset); } case EntityDecoderState.NumericStart: { return this.stateNumericStart(str, offset); } case EntityDecoderState.NumericDecimal: { return this.stateNumericDecimal(str, offset); } case EntityDecoderState.NumericHex: { return this.stateNumericHex(str, offset); } case EntityDecoderState.NamedEntity: { return this.stateNamedEntity(str, offset); } } }; /** * Switches between the numeric decimal and hexadecimal states. * * Equivalent to the `Numeric character reference state` in the HTML spec. * * @param str The string containing the entity (or a continuation of the entity). * @param offset The current offset. * @returns The number of characters that were consumed, or -1 if the entity is incomplete. */ EntityDecoder.prototype.stateNumericStart = function (str, offset) { if (offset >= str.length) { return -1; } if ((str.charCodeAt(offset) | TO_LOWER_BIT) === CharCodes.LOWER_X) { this.state = EntityDecoderState.NumericHex; this.consumed += 1; return this.stateNumericHex(str, offset + 1); } this.state = EntityDecoderState.NumericDecimal; return this.stateNumericDecimal(str, offset); }; EntityDecoder.prototype.addToNumericResult = function (str, start, end, base) { if (start !== end) { var digitCount = end - start; this.result = this.result * Math.pow(base, digitCount) + parseInt(str.substr(start, digitCount), base); this.consumed += digitCount; } }; /** * Parses a hexadecimal numeric entity. * * Equivalent to the `Hexademical character reference state` in the HTML spec. * * @param str The string containing the entity (or a continuation of the entity). * @param offset The current offset. * @returns The number of characters that were consumed, or -1 if the entity is incomplete. */ EntityDecoder.prototype.stateNumericHex = function (str, offset) { var startIdx = offset; while (offset < str.length) { var char = str.charCodeAt(offset); if (isNumber(char) || isHexadecimalCharacter(char)) { offset += 1; } else { this.addToNumericResult(str, startIdx, offset, 16); return this.emitNumericEntity(char, 3); } } this.addToNumericResult(str, startIdx, offset, 16); return -1; }; /** * Parses a decimal numeric entity. * * Equivalent to the `Decimal character reference state` in the HTML spec. * * @param str The string containing the entity (or a continuation of the entity). * @param offset The current offset. * @returns The number of characters that were consumed, or -1 if the entity is incomplete. */ EntityDecoder.prototype.stateNumericDecimal = function (str, offset) { var startIdx = offset; while (offset < str.length) { var char = str.charCodeAt(offset); if (isNumber(char)) { offset += 1; } else { this.addToNumericResult(str, startIdx, offset, 10); return this.emitNumericEntity(char, 2); } } this.addToNumericResult(str, startIdx, offset, 10); return -1; }; /** * Validate and emit a numeric entity. * * Implements the logic from the `Hexademical character reference start * state` and `Numeric character reference end state` in the HTML spec. * * @param lastCp The last code point of the entity. Used to see if the * entity was terminated with a semicolon. * @param expectedLength The minimum number of characters that should be * consumed. Used to validate that at least one digit * was consumed. * @returns The number of characters that were consumed. */ EntityDecoder.prototype.emitNumericEntity = function (lastCp, expectedLength) { var _a; // Ensure we consumed at least one digit. if (this.consumed <= expectedLength) { (_a = this.errors) === null || _a === void 0 ? void 0 : _a.absenceOfDigitsInNumericCharacterReference(this.consumed); return 0; } // Figure out if this is a legit end of the entity if (lastCp === CharCodes.SEMI) { this.consumed += 1; } else if (this.decodeMode === DecodingMode.Strict) { return 0; } this.emitCodePoint((0, decode_codepoint_js_1.replaceCodePoint)(this.result), this.consumed); if (this.errors) { if (lastCp !== CharCodes.SEMI) { this.errors.missingSemicolonAfterCharacterReference(); } this.errors.validateNumericCharacterReference(this.result); } return this.consumed; }; /** * Parses a named entity. * * Equivalent to the `Named character reference state` in the HTML spec. * * @param str The string containing the entity (or a continuation of the entity). * @param offset The current offset. * @returns The number of characters that were consumed, or -1 if the entity is incomplete. */ EntityDecoder.prototype.stateNamedEntity = function (str, offset) { var decodeTree = this.decodeTree; var current = decodeTree[this.treeIndex]; // The mask is the number of bytes of the value, including the current byte. var valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14; for (; offset < str.length; offset++, this.excess++) { var char = str.charCodeAt(offset); this.treeIndex = determineBranch(decodeTree, current, this.treeIndex + Math.max(1, valueLength), char); if (this.treeIndex < 0) { return this.result === 0 || // If we are parsing an attribute (this.decodeMode === DecodingMode.Attribute && // We shouldn't have consumed any characters after the entity, (valueLength === 0 || // And there should be no invalid characters. isEntityInAttributeInvalidEnd(char))) ? 0 : this.emitNotTerminatedNamedEntity(); } current = decodeTree[this.treeIndex]; valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14; // If the branch is a value, store it and continue if (valueLength !== 0) { // If the entity is terminated by a semicolon, we are done. if (char === CharCodes.SEMI) { return this.emitNamedEntityData(this.treeIndex, valueLength, this.consumed + this.excess); } // If we encounter a non-terminated (legacy) entity while parsing strictly, then ignore it. if (this.decodeMode !== DecodingMode.Strict) { this.result = this.treeIndex; this.consumed += this.excess; this.excess = 0; } } } return -1; }; /** * Emit a named entity that was not terminated with a semicolon. * * @returns The number of characters consumed. */ EntityDecoder.prototype.emitNotTerminatedNamedEntity = function () { var _a; var _b = this, result = _b.result, decodeTree = _b.decodeTree; var valueLength = (decodeTree[result] & BinTrieFlags.VALUE_LENGTH) >> 14; this.emitNamedEntityData(result, valueLength, this.consumed); (_a = this.errors) === null || _a === void 0 ? void 0 : _a.missingSemicolonAfterCharacterReference(); return this.consumed; }; /** * Emit a named entity. * * @param result The index of the entity in the decode tree. * @param valueLength The number of bytes in the entity. * @param consumed The number of characters consumed. * * @returns The number of characters consumed. */ EntityDecoder.prototype.emitNamedEntityData = function (result, valueLength, consumed) { var decodeTree = this.decodeTree; this.emitCodePoint(valueLength === 1 ? decodeTree[result] & ~BinTrieFlags.VALUE_LENGTH : decodeTree[result + 1], consumed); if (valueLength === 3) { // For multi-byte values, we need to emit the second byte. this.emitCodePoint(decodeTree[result + 2], consumed); } return consumed; }; /** * Signal to the parser that the end of the input was reached. * * Remaining data will be emitted and relevant errors will be produced. * * @returns The number of characters consumed. */ EntityDecoder.prototype.end = function () { var _a; switch (this.state) { case EntityDecoderState.NamedEntity: { // Emit a named entity if we have one. return this.result !== 0 && (this.decodeMode !== DecodingMode.Attribute || this.result === this.treeIndex) ? this.emitNotTerminatedNamedEntity() : 0; } // Otherwise, emit a numeric entity if we have one. case EntityDecoderState.NumericDecimal: { return this.emitNumericEntity(0, 2); } case EntityDecoderState.NumericHex: { return this.emitNumericEntity(0, 3); } case EntityDecoderState.NumericStart: { (_a = this.errors) === null || _a === void 0 ? void 0 : _a.absenceOfDigitsInNumericCharacterReference(this.consumed); return 0; } case EntityDecoderState.EntityStart: { // Return 0 if we have no entity. return 0; } } }; return EntityDecoder; }()); exports.EntityDecoder = EntityDecoder; /** * Creates a function that decodes entities in a string. * * @param decodeTree The decode tree. * @returns A function that decodes entities in a string. */ function getDecoder(decodeTree) { var ret = ""; var decoder = new EntityDecoder(decodeTree, function (str) { return (ret += (0, decode_codepoint_js_1.fromCodePoint)(str)); }); return function decodeWithTrie(str, decodeMode) { var lastIndex = 0; var offset = 0; while ((offset = str.indexOf("&", offset)) >= 0) { ret += str.slice(lastIndex, offset); decoder.startEntity(decodeMode); var len = decoder.write(str, // Skip the "&" offset + 1); if (len < 0) { lastIndex = offset + decoder.end(); break; } lastIndex = offset + len; // If `len` is 0, skip the current `&` and continue. offset = len === 0 ? lastIndex + 1 : lastIndex; } var result = ret + str.slice(lastIndex); // Make sure we don't keep a reference to the final string. ret = ""; return result; }; } /** * Determines the branch of the current node that is taken given the current * character. This function is used to traverse the trie. * * @param decodeTree The trie. * @param current The current node. * @param nodeIdx The index right after the current node and its value. * @param char The current character. * @returns The index of the next node, or -1 if no branch is taken. */ function determineBranch(decodeTree, current, nodeIdx, char) { var branchCount = (current & BinTrieFlags.BRANCH_LENGTH) >> 7; var jumpOffset = current & BinTrieFlags.JUMP_TABLE; // Case 1: Single branch encoded in jump offset if (branchCount === 0) { return jumpOffset !== 0 && char === jumpOffset ? nodeIdx : -1; } // Case 2: Multiple branches encoded in jump table if (jumpOffset) { var value = char - jumpOffset; return value < 0 || value >= branchCount ? -1 : decodeTree[nodeIdx + value] - 1; } // Case 3: Multiple branches encoded in dictionary // Binary search for the character. var lo = nodeIdx; var hi = lo + branchCount - 1; while (lo <= hi) { var mid = (lo + hi) >>> 1; var midVal = decodeTree[mid]; if (midVal < char) { lo = mid + 1; } else if (midVal > char) { hi = mid - 1; } else { return decodeTree[mid + branchCount]; } } return -1; } exports.determineBranch = determineBranch; var htmlDecoder = getDecoder(decode_data_html_js_1.default); var xmlDecoder = getDecoder(decode_data_xml_js_1.default); /** * Decodes an HTML string. * * @param str The string to decode. * @param mode The decoding mode. * @returns The decoded string. */ function decodeHTML(str, mode) { if (mode === void 0) { mode = DecodingMode.Legacy; } return htmlDecoder(str, mode); } exports.decodeHTML = decodeHTML; /** * Decodes an HTML string in an attribute. * * @param str The string to decode. * @returns The decoded string. */ function decodeHTMLAttribute(str) { return htmlDecoder(str, DecodingMode.Attribute); } exports.decodeHTMLAttribute = decodeHTMLAttribute; /** * Decodes an HTML string, requiring all entities to be terminated by a semicolon. * * @param str The string to decode. * @returns The decoded string. */ function decodeHTMLStrict(str) { return htmlDecoder(str, DecodingMode.Strict); } exports.decodeHTMLStrict = decodeHTMLStrict; /** * Decodes an XML string, requiring all entities to be terminated by a semicolon. * * @param str The string to decode. * @returns The decoded string. */ function decodeXML(str) { return xmlDecoder(str, DecodingMode.Strict); } exports.decodeXML = decodeXML; //# sourceMappingURL=decode.js.map /***/ }), /***/ "./node_modules/entities/lib/decode_codepoint.js": /*!*******************************************************!*\ !*** ./node_modules/entities/lib/decode_codepoint.js ***! \*******************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; // Adapted from https://github.com/mathiasbynens/he/blob/36afe179392226cf1b6ccdb16ebbb7a5a844d93a/src/he.js#L106-L134 var _a; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.replaceCodePoint = exports.fromCodePoint = void 0; var decodeMap = new Map([ [0, 65533], // C1 Unicode control character reference replacements [128, 8364], [130, 8218], [131, 402], [132, 8222], [133, 8230], [134, 8224], [135, 8225], [136, 710], [137, 8240], [138, 352], [139, 8249], [140, 338], [142, 381], [145, 8216], [146, 8217], [147, 8220], [148, 8221], [149, 8226], [150, 8211], [151, 8212], [152, 732], [153, 8482], [154, 353], [155, 8250], [156, 339], [158, 382], [159, 376], ]); /** * Polyfill for `String.fromCodePoint`. It is used to create a string from a Unicode code point. */ exports.fromCodePoint = // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, node/no-unsupported-features/es-builtins (_a = String.fromCodePoint) !== null && _a !== void 0 ? _a : function (codePoint) { var output = ""; if (codePoint > 0xffff) { codePoint -= 0x10000; output += String.fromCharCode(((codePoint >>> 10) & 0x3ff) | 0xd800); codePoint = 0xdc00 | (codePoint & 0x3ff); } output += String.fromCharCode(codePoint); return output; }; /** * Replace the given code point with a replacement character if it is a * surrogate or is outside the valid range. Otherwise return the code * point unchanged. */ function replaceCodePoint(codePoint) { var _a; if ((codePoint >= 0xd800 && codePoint <= 0xdfff) || codePoint > 0x10ffff) { return 0xfffd; } return (_a = decodeMap.get(codePoint)) !== null && _a !== void 0 ? _a : codePoint; } exports.replaceCodePoint = replaceCodePoint; /** * Replace the code point if relevant, then convert it to a string. * * @deprecated Use `fromCodePoint(replaceCodePoint(codePoint))` instead. * @param codePoint The code point to decode. * @returns The decoded code point. */ function decodeCodePoint(codePoint) { return (0, exports.fromCodePoint)(replaceCodePoint(codePoint)); } exports["default"] = decodeCodePoint; //# sourceMappingURL=decode_codepoint.js.map /***/ }), /***/ "./node_modules/entities/lib/generated/decode-data-html.js": /*!*****************************************************************!*\ !*** ./node_modules/entities/lib/generated/decode-data-html.js ***! \*****************************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; // Generated using scripts/write-decode-map.ts Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = new Uint16Array( // prettier-ignore "\u1d41<\xd5\u0131\u028a\u049d\u057b\u05d0\u0675\u06de\u07a2\u07d6\u080f\u0a4a\u0a91\u0da1\u0e6d\u0f09\u0f26\u10ca\u1228\u12e1\u1415\u149d\u14c3\u14df\u1525\0\0\0\0\0\0\u156b\u16cd\u198d\u1c12\u1ddd\u1f7e\u2060\u21b0\u228d\u23c0\u23fb\u2442\u2824\u2912\u2d08\u2e48\u2fce\u3016\u32ba\u3639\u37ac\u38fe\u3a28\u3a71\u3ae0\u3b2e\u0800EMabcfglmnoprstu\\bfms\x7f\x84\x8b\x90\x95\x98\xa6\xb3\xb9\xc8\xcflig\u803b\xc6\u40c6P\u803b&\u4026cute\u803b\xc1\u40c1reve;\u4102\u0100iyx}rc\u803b\xc2\u40c2;\u4410r;\uc000\ud835\udd04rave\u803b\xc0\u40c0pha;\u4391acr;\u4100d;\u6a53\u0100gp\x9d\xa1on;\u4104f;\uc000\ud835\udd38plyFunction;\u6061ing\u803b\xc5\u40c5\u0100cs\xbe\xc3r;\uc000\ud835\udc9cign;\u6254ilde\u803b\xc3\u40c3ml\u803b\xc4\u40c4\u0400aceforsu\xe5\xfb\xfe\u0117\u011c\u0122\u0127\u012a\u0100cr\xea\xf2kslash;\u6216\u0176\xf6\xf8;\u6ae7ed;\u6306y;\u4411\u0180crt\u0105\u010b\u0114ause;\u6235noullis;\u612ca;\u4392r;\uc000\ud835\udd05pf;\uc000\ud835\udd39eve;\u42d8c\xf2\u0113mpeq;\u624e\u0700HOacdefhilorsu\u014d\u0151\u0156\u0180\u019e\u01a2\u01b5\u01b7\u01ba\u01dc\u0215\u0273\u0278\u027ecy;\u4427PY\u803b\xa9\u40a9\u0180cpy\u015d\u0162\u017aute;\u4106\u0100;i\u0167\u0168\u62d2talDifferentialD;\u6145leys;\u612d\u0200aeio\u0189\u018e\u0194\u0198ron;\u410cdil\u803b\xc7\u40c7rc;\u4108nint;\u6230ot;\u410a\u0100dn\u01a7\u01adilla;\u40b8terDot;\u40b7\xf2\u017fi;\u43a7rcle\u0200DMPT\u01c7\u01cb\u01d1\u01d6ot;\u6299inus;\u6296lus;\u6295imes;\u6297o\u0100cs\u01e2\u01f8kwiseContourIntegral;\u6232eCurly\u0100DQ\u0203\u020foubleQuote;\u601duote;\u6019\u0200lnpu\u021e\u0228\u0247\u0255on\u0100;e\u0225\u0226\u6237;\u6a74\u0180git\u022f\u0236\u023aruent;\u6261nt;\u622fourIntegral;\u622e\u0100fr\u024c\u024e;\u6102oduct;\u6210nterClockwiseContourIntegral;\u6233oss;\u6a2fcr;\uc000\ud835\udc9ep\u0100;C\u0284\u0285\u62d3ap;\u624d\u0580DJSZacefios\u02a0\u02ac\u02b0\u02b4\u02b8\u02cb\u02d7\u02e1\u02e6\u0333\u048d\u0100;o\u0179\u02a5trahd;\u6911cy;\u4402cy;\u4405cy;\u440f\u0180grs\u02bf\u02c4\u02c7ger;\u6021r;\u61a1hv;\u6ae4\u0100ay\u02d0\u02d5ron;\u410e;\u4414l\u0100;t\u02dd\u02de\u6207a;\u4394r;\uc000\ud835\udd07\u0100af\u02eb\u0327\u0100cm\u02f0\u0322ritical\u0200ADGT\u0300\u0306\u0316\u031ccute;\u40b4o\u0174\u030b\u030d;\u42d9bleAcute;\u42ddrave;\u4060ilde;\u42dcond;\u62c4ferentialD;\u6146\u0470\u033d\0\0\0\u0342\u0354\0\u0405f;\uc000\ud835\udd3b\u0180;DE\u0348\u0349\u034d\u40a8ot;\u60dcqual;\u6250ble\u0300CDLRUV\u0363\u0372\u0382\u03cf\u03e2\u03f8ontourIntegra\xec\u0239o\u0274\u0379\0\0\u037b\xbb\u0349nArrow;\u61d3\u0100eo\u0387\u03a4ft\u0180ART\u0390\u0396\u03a1rrow;\u61d0ightArrow;\u61d4e\xe5\u02cang\u0100LR\u03ab\u03c4eft\u0100AR\u03b3\u03b9rrow;\u67f8ightArrow;\u67faightArrow;\u67f9ight\u0100AT\u03d8\u03derrow;\u61d2ee;\u62a8p\u0241\u03e9\0\0\u03efrrow;\u61d1ownArrow;\u61d5erticalBar;\u6225n\u0300ABLRTa\u0412\u042a\u0430\u045e\u047f\u037crrow\u0180;BU\u041d\u041e\u0422\u6193ar;\u6913pArrow;\u61f5reve;\u4311eft\u02d2\u043a\0\u0446\0\u0450ightVector;\u6950eeVector;\u695eector\u0100;B\u0459\u045a\u61bdar;\u6956ight\u01d4\u0467\0\u0471eeVector;\u695fector\u0100;B\u047a\u047b\u61c1ar;\u6957ee\u0100;A\u0486\u0487\u62a4rrow;\u61a7\u0100ct\u0492\u0497r;\uc000\ud835\udc9frok;\u4110\u0800NTacdfglmopqstux\u04bd\u04c0\u04c4\u04cb\u04de\u04e2\u04e7\u04ee\u04f5\u0521\u052f\u0536\u0552\u055d\u0560\u0565G;\u414aH\u803b\xd0\u40d0cute\u803b\xc9\u40c9\u0180aiy\u04d2\u04d7\u04dcron;\u411arc\u803b\xca\u40ca;\u442dot;\u4116r;\uc000\ud835\udd08rave\u803b\xc8\u40c8ement;\u6208\u0100ap\u04fa\u04fecr;\u4112ty\u0253\u0506\0\0\u0512mallSquare;\u65fberySmallSquare;\u65ab\u0100gp\u0526\u052aon;\u4118f;\uc000\ud835\udd3csilon;\u4395u\u0100ai\u053c\u0549l\u0100;T\u0542\u0543\u6a75ilde;\u6242librium;\u61cc\u0100ci\u0557\u055ar;\u6130m;\u6a73a;\u4397ml\u803b\xcb\u40cb\u0100ip\u056a\u056fsts;\u6203onentialE;\u6147\u0280cfios\u0585\u0588\u058d\u05b2\u05ccy;\u4424r;\uc000\ud835\udd09lled\u0253\u0597\0\0\u05a3mallSquare;\u65fcerySmallSquare;\u65aa\u0370\u05ba\0\u05bf\0\0\u05c4f;\uc000\ud835\udd3dAll;\u6200riertrf;\u6131c\xf2\u05cb\u0600JTabcdfgorst\u05e8\u05ec\u05ef\u05fa\u0600\u0612\u0616\u061b\u061d\u0623\u066c\u0672cy;\u4403\u803b>\u403emma\u0100;d\u05f7\u05f8\u4393;\u43dcreve;\u411e\u0180eiy\u0607\u060c\u0610dil;\u4122rc;\u411c;\u4413ot;\u4120r;\uc000\ud835\udd0a;\u62d9pf;\uc000\ud835\udd3eeater\u0300EFGLST\u0635\u0644\u064e\u0656\u065b\u0666qual\u0100;L\u063e\u063f\u6265ess;\u62dbullEqual;\u6267reater;\u6aa2ess;\u6277lantEqual;\u6a7eilde;\u6273cr;\uc000\ud835\udca2;\u626b\u0400Aacfiosu\u0685\u068b\u0696\u069b\u069e\u06aa\u06be\u06caRDcy;\u442a\u0100ct\u0690\u0694ek;\u42c7;\u405eirc;\u4124r;\u610clbertSpace;\u610b\u01f0\u06af\0\u06b2f;\u610dizontalLine;\u6500\u0100ct\u06c3\u06c5\xf2\u06a9rok;\u4126mp\u0144\u06d0\u06d8ownHum\xf0\u012fqual;\u624f\u0700EJOacdfgmnostu\u06fa\u06fe\u0703\u0707\u070e\u071a\u071e\u0721\u0728\u0744\u0778\u078b\u078f\u0795cy;\u4415lig;\u4132cy;\u4401cute\u803b\xcd\u40cd\u0100iy\u0713\u0718rc\u803b\xce\u40ce;\u4418ot;\u4130r;\u6111rave\u803b\xcc\u40cc\u0180;ap\u0720\u072f\u073f\u0100cg\u0734\u0737r;\u412ainaryI;\u6148lie\xf3\u03dd\u01f4\u0749\0\u0762\u0100;e\u074d\u074e\u622c\u0100gr\u0753\u0758ral;\u622bsection;\u62c2isible\u0100CT\u076c\u0772omma;\u6063imes;\u6062\u0180gpt\u077f\u0783\u0788on;\u412ef;\uc000\ud835\udd40a;\u4399cr;\u6110ilde;\u4128\u01eb\u079a\0\u079ecy;\u4406l\u803b\xcf\u40cf\u0280cfosu\u07ac\u07b7\u07bc\u07c2\u07d0\u0100iy\u07b1\u07b5rc;\u4134;\u4419r;\uc000\ud835\udd0dpf;\uc000\ud835\udd41\u01e3\u07c7\0\u07ccr;\uc000\ud835\udca5rcy;\u4408kcy;\u4404\u0380HJacfos\u07e4\u07e8\u07ec\u07f1\u07fd\u0802\u0808cy;\u4425cy;\u440cppa;\u439a\u0100ey\u07f6\u07fbdil;\u4136;\u441ar;\uc000\ud835\udd0epf;\uc000\ud835\udd42cr;\uc000\ud835\udca6\u0580JTaceflmost\u0825\u0829\u082c\u0850\u0863\u09b3\u09b8\u09c7\u09cd\u0a37\u0a47cy;\u4409\u803b<\u403c\u0280cmnpr\u0837\u083c\u0841\u0844\u084dute;\u4139bda;\u439bg;\u67ealacetrf;\u6112r;\u619e\u0180aey\u0857\u085c\u0861ron;\u413ddil;\u413b;\u441b\u0100fs\u0868\u0970t\u0500ACDFRTUVar\u087e\u08a9\u08b1\u08e0\u08e6\u08fc\u092f\u095b\u0390\u096a\u0100nr\u0883\u088fgleBracket;\u67e8row\u0180;BR\u0899\u089a\u089e\u6190ar;\u61e4ightArrow;\u61c6eiling;\u6308o\u01f5\u08b7\0\u08c3bleBracket;\u67e6n\u01d4\u08c8\0\u08d2eeVector;\u6961ector\u0100;B\u08db\u08dc\u61c3ar;\u6959loor;\u630aight\u0100AV\u08ef\u08f5rrow;\u6194ector;\u694e\u0100er\u0901\u0917e\u0180;AV\u0909\u090a\u0910\u62a3rrow;\u61a4ector;\u695aiangle\u0180;BE\u0924\u0925\u0929\u62b2ar;\u69cfqual;\u62b4p\u0180DTV\u0937\u0942\u094cownVector;\u6951eeVector;\u6960ector\u0100;B\u0956\u0957\u61bfar;\u6958ector\u0100;B\u0965\u0966\u61bcar;\u6952ight\xe1\u039cs\u0300EFGLST\u097e\u098b\u0995\u099d\u09a2\u09adqualGreater;\u62daullEqual;\u6266reater;\u6276ess;\u6aa1lantEqual;\u6a7dilde;\u6272r;\uc000\ud835\udd0f\u0100;e\u09bd\u09be\u62d8ftarrow;\u61daidot;\u413f\u0180npw\u09d4\u0a16\u0a1bg\u0200LRlr\u09de\u09f7\u0a02\u0a10eft\u0100AR\u09e6\u09ecrrow;\u67f5ightArrow;\u67f7ightArrow;\u67f6eft\u0100ar\u03b3\u0a0aight\xe1\u03bfight\xe1\u03caf;\uc000\ud835\udd43er\u0100LR\u0a22\u0a2ceftArrow;\u6199ightArrow;\u6198\u0180cht\u0a3e\u0a40\u0a42\xf2\u084c;\u61b0rok;\u4141;\u626a\u0400acefiosu\u0a5a\u0a5d\u0a60\u0a77\u0a7c\u0a85\u0a8b\u0a8ep;\u6905y;\u441c\u0100dl\u0a65\u0a6fiumSpace;\u605flintrf;\u6133r;\uc000\ud835\udd10nusPlus;\u6213pf;\uc000\ud835\udd44c\xf2\u0a76;\u439c\u0480Jacefostu\u0aa3\u0aa7\u0aad\u0ac0\u0b14\u0b19\u0d91\u0d97\u0d9ecy;\u440acute;\u4143\u0180aey\u0ab4\u0ab9\u0aberon;\u4147dil;\u4145;\u441d\u0180gsw\u0ac7\u0af0\u0b0eative\u0180MTV\u0ad3\u0adf\u0ae8ediumSpace;\u600bhi\u0100cn\u0ae6\u0ad8\xeb\u0ad9eryThi\xee\u0ad9ted\u0100GL\u0af8\u0b06reaterGreate\xf2\u0673essLes\xf3\u0a48Line;\u400ar;\uc000\ud835\udd11\u0200Bnpt\u0b22\u0b28\u0b37\u0b3areak;\u6060BreakingSpace;\u40a0f;\u6115\u0680;CDEGHLNPRSTV\u0b55\u0b56\u0b6a\u0b7c\u0ba1\u0beb\u0c04\u0c5e\u0c84\u0ca6\u0cd8\u0d61\u0d85\u6aec\u0100ou\u0b5b\u0b64ngruent;\u6262pCap;\u626doubleVerticalBar;\u6226\u0180lqx\u0b83\u0b8a\u0b9bement;\u6209ual\u0100;T\u0b92\u0b93\u6260ilde;\uc000\u2242\u0338ists;\u6204reater\u0380;EFGLST\u0bb6\u0bb7\u0bbd\u0bc9\u0bd3\u0bd8\u0be5\u626fqual;\u6271ullEqual;\uc000\u2267\u0338reater;\uc000\u226b\u0338ess;\u6279lantEqual;\uc000\u2a7e\u0338ilde;\u6275ump\u0144\u0bf2\u0bfdownHump;\uc000\u224e\u0338qual;\uc000\u224f\u0338e\u0100fs\u0c0a\u0c27tTriangle\u0180;BE\u0c1a\u0c1b\u0c21\u62eaar;\uc000\u29cf\u0338qual;\u62ecs\u0300;EGLST\u0c35\u0c36\u0c3c\u0c44\u0c4b\u0c58\u626equal;\u6270reater;\u6278ess;\uc000\u226a\u0338lantEqual;\uc000\u2a7d\u0338ilde;\u6274ested\u0100GL\u0c68\u0c79reaterGreater;\uc000\u2aa2\u0338essLess;\uc000\u2aa1\u0338recedes\u0180;ES\u0c92\u0c93\u0c9b\u6280qual;\uc000\u2aaf\u0338lantEqual;\u62e0\u0100ei\u0cab\u0cb9verseElement;\u620cghtTriangle\u0180;BE\u0ccb\u0ccc\u0cd2\u62ebar;\uc000\u29d0\u0338qual;\u62ed\u0100qu\u0cdd\u0d0cuareSu\u0100bp\u0ce8\u0cf9set\u0100;E\u0cf0\u0cf3\uc000\u228f\u0338qual;\u62e2erset\u0100;E\u0d03\u0d06\uc000\u2290\u0338qual;\u62e3\u0180bcp\u0d13\u0d24\u0d4eset\u0100;E\u0d1b\u0d1e\uc000\u2282\u20d2qual;\u6288ceeds\u0200;EST\u0d32\u0d33\u0d3b\u0d46\u6281qual;\uc000\u2ab0\u0338lantEqual;\u62e1ilde;\uc000\u227f\u0338erset\u0100;E\u0d58\u0d5b\uc000\u2283\u20d2qual;\u6289ilde\u0200;EFT\u0d6e\u0d6f\u0d75\u0d7f\u6241qual;\u6244ullEqual;\u6247ilde;\u6249erticalBar;\u6224cr;\uc000\ud835\udca9ilde\u803b\xd1\u40d1;\u439d\u0700Eacdfgmoprstuv\u0dbd\u0dc2\u0dc9\u0dd5\u0ddb\u0de0\u0de7\u0dfc\u0e02\u0e20\u0e22\u0e32\u0e3f\u0e44lig;\u4152cute\u803b\xd3\u40d3\u0100iy\u0dce\u0dd3rc\u803b\xd4\u40d4;\u441eblac;\u4150r;\uc000\ud835\udd12rave\u803b\xd2\u40d2\u0180aei\u0dee\u0df2\u0df6cr;\u414cga;\u43a9cron;\u439fpf;\uc000\ud835\udd46enCurly\u0100DQ\u0e0e\u0e1aoubleQuote;\u601cuote;\u6018;\u6a54\u0100cl\u0e27\u0e2cr;\uc000\ud835\udcaaash\u803b\xd8\u40d8i\u016c\u0e37\u0e3cde\u803b\xd5\u40d5es;\u6a37ml\u803b\xd6\u40d6er\u0100BP\u0e4b\u0e60\u0100ar\u0e50\u0e53r;\u603eac\u0100ek\u0e5a\u0e5c;\u63deet;\u63b4arenthesis;\u63dc\u0480acfhilors\u0e7f\u0e87\u0e8a\u0e8f\u0e92\u0e94\u0e9d\u0eb0\u0efcrtialD;\u6202y;\u441fr;\uc000\ud835\udd13i;\u43a6;\u43a0usMinus;\u40b1\u0100ip\u0ea2\u0eadncareplan\xe5\u069df;\u6119\u0200;eio\u0eb9\u0eba\u0ee0\u0ee4\u6abbcedes\u0200;EST\u0ec8\u0ec9\u0ecf\u0eda\u627aqual;\u6aaflantEqual;\u627cilde;\u627eme;\u6033\u0100dp\u0ee9\u0eeeuct;\u620fortion\u0100;a\u0225\u0ef9l;\u621d\u0100ci\u0f01\u0f06r;\uc000\ud835\udcab;\u43a8\u0200Ufos\u0f11\u0f16\u0f1b\u0f1fOT\u803b\"\u4022r;\uc000\ud835\udd14pf;\u611acr;\uc000\ud835\udcac\u0600BEacefhiorsu\u0f3e\u0f43\u0f47\u0f60\u0f73\u0fa7\u0faa\u0fad\u1096\u10a9\u10b4\u10bearr;\u6910G\u803b\xae\u40ae\u0180cnr\u0f4e\u0f53\u0f56ute;\u4154g;\u67ebr\u0100;t\u0f5c\u0f5d\u61a0l;\u6916\u0180aey\u0f67\u0f6c\u0f71ron;\u4158dil;\u4156;\u4420\u0100;v\u0f78\u0f79\u611cerse\u0100EU\u0f82\u0f99\u0100lq\u0f87\u0f8eement;\u620builibrium;\u61cbpEquilibrium;\u696fr\xbb\u0f79o;\u43a1ght\u0400ACDFTUVa\u0fc1\u0feb\u0ff3\u1022\u1028\u105b\u1087\u03d8\u0100nr\u0fc6\u0fd2gleBracket;\u67e9row\u0180;BL\u0fdc\u0fdd\u0fe1\u6192ar;\u61e5eftArrow;\u61c4eiling;\u6309o\u01f5\u0ff9\0\u1005bleBracket;\u67e7n\u01d4\u100a\0\u1014eeVector;\u695dector\u0100;B\u101d\u101e\u61c2ar;\u6955loor;\u630b\u0100er\u102d\u1043e\u0180;AV\u1035\u1036\u103c\u62a2rrow;\u61a6ector;\u695biangle\u0180;BE\u1050\u1051\u1055\u62b3ar;\u69d0qual;\u62b5p\u0180DTV\u1063\u106e\u1078ownVector;\u694feeVector;\u695cector\u0100;B\u1082\u1083\u61bear;\u6954ector\u0100;B\u1091\u1092\u61c0ar;\u6953\u0100pu\u109b\u109ef;\u611dndImplies;\u6970ightarrow;\u61db\u0100ch\u10b9\u10bcr;\u611b;\u61b1leDelayed;\u69f4\u0680HOacfhimoqstu\u10e4\u10f1\u10f7\u10fd\u1119\u111e\u1151\u1156\u1161\u1167\u11b5\u11bb\u11bf\u0100Cc\u10e9\u10eeHcy;\u4429y;\u4428FTcy;\u442ccute;\u415a\u0280;aeiy\u1108\u1109\u110e\u1113\u1117\u6abcron;\u4160dil;\u415erc;\u415c;\u4421r;\uc000\ud835\udd16ort\u0200DLRU\u112a\u1134\u113e\u1149ownArrow\xbb\u041eeftArrow\xbb\u089aightArrow\xbb\u0fddpArrow;\u6191gma;\u43a3allCircle;\u6218pf;\uc000\ud835\udd4a\u0272\u116d\0\0\u1170t;\u621aare\u0200;ISU\u117b\u117c\u1189\u11af\u65a1ntersection;\u6293u\u0100bp\u118f\u119eset\u0100;E\u1197\u1198\u628fqual;\u6291erset\u0100;E\u11a8\u11a9\u6290qual;\u6292nion;\u6294cr;\uc000\ud835\udcaear;\u62c6\u0200bcmp\u11c8\u11db\u1209\u120b\u0100;s\u11cd\u11ce\u62d0et\u0100;E\u11cd\u11d5qual;\u6286\u0100ch\u11e0\u1205eeds\u0200;EST\u11ed\u11ee\u11f4\u11ff\u627bqual;\u6ab0lantEqual;\u627dilde;\u627fTh\xe1\u0f8c;\u6211\u0180;es\u1212\u1213\u1223\u62d1rset\u0100;E\u121c\u121d\u6283qual;\u6287et\xbb\u1213\u0580HRSacfhiors\u123e\u1244\u1249\u1255\u125e\u1271\u1276\u129f\u12c2\u12c8\u12d1ORN\u803b\xde\u40deADE;\u6122\u0100Hc\u124e\u1252cy;\u440by;\u4426\u0100bu\u125a\u125c;\u4009;\u43a4\u0180aey\u1265\u126a\u126fron;\u4164dil;\u4162;\u4422r;\uc000\ud835\udd17\u0100ei\u127b\u1289\u01f2\u1280\0\u1287efore;\u6234a;\u4398\u0100cn\u128e\u1298kSpace;\uc000\u205f\u200aSpace;\u6009lde\u0200;EFT\u12ab\u12ac\u12b2\u12bc\u623cqual;\u6243ullEqual;\u6245ilde;\u6248pf;\uc000\ud835\udd4bipleDot;\u60db\u0100ct\u12d6\u12dbr;\uc000\ud835\udcafrok;\u4166\u0ae1\u12f7\u130e\u131a\u1326\0\u132c\u1331\0\0\0\0\0\u1338\u133d\u1377\u1385\0\u13ff\u1404\u140a\u1410\u0100cr\u12fb\u1301ute\u803b\xda\u40dar\u0100;o\u1307\u1308\u619fcir;\u6949r\u01e3\u1313\0\u1316y;\u440eve;\u416c\u0100iy\u131e\u1323rc\u803b\xdb\u40db;\u4423blac;\u4170r;\uc000\ud835\udd18rave\u803b\xd9\u40d9acr;\u416a\u0100di\u1341\u1369er\u0100BP\u1348\u135d\u0100ar\u134d\u1350r;\u405fac\u0100ek\u1357\u1359;\u63dfet;\u63b5arenthesis;\u63ddon\u0100;P\u1370\u1371\u62c3lus;\u628e\u0100gp\u137b\u137fon;\u4172f;\uc000\ud835\udd4c\u0400ADETadps\u1395\u13ae\u13b8\u13c4\u03e8\u13d2\u13d7\u13f3rrow\u0180;BD\u1150\u13a0\u13a4ar;\u6912ownArrow;\u61c5ownArrow;\u6195quilibrium;\u696eee\u0100;A\u13cb\u13cc\u62a5rrow;\u61a5own\xe1\u03f3er\u0100LR\u13de\u13e8eftArrow;\u6196ightArrow;\u6197i\u0100;l\u13f9\u13fa\u43d2on;\u43a5ing;\u416ecr;\uc000\ud835\udcb0ilde;\u4168ml\u803b\xdc\u40dc\u0480Dbcdefosv\u1427\u142c\u1430\u1433\u143e\u1485\u148a\u1490\u1496ash;\u62abar;\u6aeby;\u4412ash\u0100;l\u143b\u143c\u62a9;\u6ae6\u0100er\u1443\u1445;\u62c1\u0180bty\u144c\u1450\u147aar;\u6016\u0100;i\u144f\u1455cal\u0200BLST\u1461\u1465\u146a\u1474ar;\u6223ine;\u407ceparator;\u6758ilde;\u6240ThinSpace;\u600ar;\uc000\ud835\udd19pf;\uc000\ud835\udd4dcr;\uc000\ud835\udcb1dash;\u62aa\u0280cefos\u14a7\u14ac\u14b1\u14b6\u14bcirc;\u4174dge;\u62c0r;\uc000\ud835\udd1apf;\uc000\ud835\udd4ecr;\uc000\ud835\udcb2\u0200fios\u14cb\u14d0\u14d2\u14d8r;\uc000\ud835\udd1b;\u439epf;\uc000\ud835\udd4fcr;\uc000\ud835\udcb3\u0480AIUacfosu\u14f1\u14f5\u14f9\u14fd\u1504\u150f\u1514\u151a\u1520cy;\u442fcy;\u4407cy;\u442ecute\u803b\xdd\u40dd\u0100iy\u1509\u150drc;\u4176;\u442br;\uc000\ud835\udd1cpf;\uc000\ud835\udd50cr;\uc000\ud835\udcb4ml;\u4178\u0400Hacdefos\u1535\u1539\u153f\u154b\u154f\u155d\u1560\u1564cy;\u4416cute;\u4179\u0100ay\u1544\u1549ron;\u417d;\u4417ot;\u417b\u01f2\u1554\0\u155boWidt\xe8\u0ad9a;\u4396r;\u6128pf;\u6124cr;\uc000\ud835\udcb5\u0be1\u1583\u158a\u1590\0\u15b0\u15b6\u15bf\0\0\0\0\u15c6\u15db\u15eb\u165f\u166d\0\u1695\u169b\u16b2\u16b9\0\u16becute\u803b\xe1\u40e1reve;\u4103\u0300;Ediuy\u159c\u159d\u15a1\u15a3\u15a8\u15ad\u623e;\uc000\u223e\u0333;\u623frc\u803b\xe2\u40e2te\u80bb\xb4\u0306;\u4430lig\u803b\xe6\u40e6\u0100;r\xb2\u15ba;\uc000\ud835\udd1erave\u803b\xe0\u40e0\u0100ep\u15ca\u15d6\u0100fp\u15cf\u15d4sym;\u6135\xe8\u15d3ha;\u43b1\u0100ap\u15dfc\u0100cl\u15e4\u15e7r;\u4101g;\u6a3f\u0264\u15f0\0\0\u160a\u0280;adsv\u15fa\u15fb\u15ff\u1601\u1607\u6227nd;\u6a55;\u6a5clope;\u6a58;\u6a5a\u0380;elmrsz\u1618\u1619\u161b\u161e\u163f\u164f\u1659\u6220;\u69a4e\xbb\u1619sd\u0100;a\u1625\u1626\u6221\u0461\u1630\u1632\u1634\u1636\u1638\u163a\u163c\u163e;\u69a8;\u69a9;\u69aa;\u69ab;\u69ac;\u69ad;\u69ae;\u69aft\u0100;v\u1645\u1646\u621fb\u0100;d\u164c\u164d\u62be;\u699d\u0100pt\u1654\u1657h;\u6222\xbb\xb9arr;\u637c\u0100gp\u1663\u1667on;\u4105f;\uc000\ud835\udd52\u0380;Eaeiop\u12c1\u167b\u167d\u1682\u1684\u1687\u168a;\u6a70cir;\u6a6f;\u624ad;\u624bs;\u4027rox\u0100;e\u12c1\u1692\xf1\u1683ing\u803b\xe5\u40e5\u0180cty\u16a1\u16a6\u16a8r;\uc000\ud835\udcb6;\u402amp\u0100;e\u12c1\u16af\xf1\u0288ilde\u803b\xe3\u40e3ml\u803b\xe4\u40e4\u0100ci\u16c2\u16c8onin\xf4\u0272nt;\u6a11\u0800Nabcdefiklnoprsu\u16ed\u16f1\u1730\u173c\u1743\u1748\u1778\u177d\u17e0\u17e6\u1839\u1850\u170d\u193d\u1948\u1970ot;\u6aed\u0100cr\u16f6\u171ek\u0200ceps\u1700\u1705\u170d\u1713ong;\u624cpsilon;\u43f6rime;\u6035im\u0100;e\u171a\u171b\u623dq;\u62cd\u0176\u1722\u1726ee;\u62bded\u0100;g\u172c\u172d\u6305e\xbb\u172drk\u0100;t\u135c\u1737brk;\u63b6\u0100oy\u1701\u1741;\u4431quo;\u601e\u0280cmprt\u1753\u175b\u1761\u1764\u1768aus\u0100;e\u010a\u0109ptyv;\u69b0s\xe9\u170cno\xf5\u0113\u0180ahw\u176f\u1771\u1773;\u43b2;\u6136een;\u626cr;\uc000\ud835\udd1fg\u0380costuvw\u178d\u179d\u17b3\u17c1\u17d5\u17db\u17de\u0180aiu\u1794\u1796\u179a\xf0\u0760rc;\u65efp\xbb\u1371\u0180dpt\u17a4\u17a8\u17adot;\u6a00lus;\u6a01imes;\u6a02\u0271\u17b9\0\0\u17becup;\u6a06ar;\u6605riangle\u0100du\u17cd\u17d2own;\u65bdp;\u65b3plus;\u6a04e\xe5\u1444\xe5\u14adarow;\u690d\u0180ako\u17ed\u1826\u1835\u0100cn\u17f2\u1823k\u0180lst\u17fa\u05ab\u1802ozenge;\u69ebriangle\u0200;dlr\u1812\u1813\u1818\u181d\u65b4own;\u65beeft;\u65c2ight;\u65b8k;\u6423\u01b1\u182b\0\u1833\u01b2\u182f\0\u1831;\u6592;\u65914;\u6593ck;\u6588\u0100eo\u183e\u184d\u0100;q\u1843\u1846\uc000=\u20e5uiv;\uc000\u2261\u20e5t;\u6310\u0200ptwx\u1859\u185e\u1867\u186cf;\uc000\ud835\udd53\u0100;t\u13cb\u1863om\xbb\u13cctie;\u62c8\u0600DHUVbdhmptuv\u1885\u1896\u18aa\u18bb\u18d7\u18db\u18ec\u18ff\u1905\u190a\u1910\u1921\u0200LRlr\u188e\u1890\u1892\u1894;\u6557;\u6554;\u6556;\u6553\u0280;DUdu\u18a1\u18a2\u18a4\u18a6\u18a8\u6550;\u6566;\u6569;\u6564;\u6567\u0200LRlr\u18b3\u18b5\u18b7\u18b9;\u655d;\u655a;\u655c;\u6559\u0380;HLRhlr\u18ca\u18cb\u18cd\u18cf\u18d1\u18d3\u18d5\u6551;\u656c;\u6563;\u6560;\u656b;\u6562;\u655fox;\u69c9\u0200LRlr\u18e4\u18e6\u18e8\u18ea;\u6555;\u6552;\u6510;\u650c\u0280;DUdu\u06bd\u18f7\u18f9\u18fb\u18fd;\u6565;\u6568;\u652c;\u6534inus;\u629flus;\u629eimes;\u62a0\u0200LRlr\u1919\u191b\u191d\u191f;\u655b;\u6558;\u6518;\u6514\u0380;HLRhlr\u1930\u1931\u1933\u1935\u1937\u1939\u193b\u6502;\u656a;\u6561;\u655e;\u653c;\u6524;\u651c\u0100ev\u0123\u1942bar\u803b\xa6\u40a6\u0200ceio\u1951\u1956\u195a\u1960r;\uc000\ud835\udcb7mi;\u604fm\u0100;e\u171a\u171cl\u0180;bh\u1968\u1969\u196b\u405c;\u69c5sub;\u67c8\u016c\u1974\u197el\u0100;e\u1979\u197a\u6022t\xbb\u197ap\u0180;Ee\u012f\u1985\u1987;\u6aae\u0100;q\u06dc\u06db\u0ce1\u19a7\0\u19e8\u1a11\u1a15\u1a32\0\u1a37\u1a50\0\0\u1ab4\0\0\u1ac1\0\0\u1b21\u1b2e\u1b4d\u1b52\0\u1bfd\0\u1c0c\u0180cpr\u19ad\u19b2\u19ddute;\u4107\u0300;abcds\u19bf\u19c0\u19c4\u19ca\u19d5\u19d9\u6229nd;\u6a44rcup;\u6a49\u0100au\u19cf\u19d2p;\u6a4bp;\u6a47ot;\u6a40;\uc000\u2229\ufe00\u0100eo\u19e2\u19e5t;\u6041\xee\u0693\u0200aeiu\u19f0\u19fb\u1a01\u1a05\u01f0\u19f5\0\u19f8s;\u6a4don;\u410ddil\u803b\xe7\u40e7rc;\u4109ps\u0100;s\u1a0c\u1a0d\u6a4cm;\u6a50ot;\u410b\u0180dmn\u1a1b\u1a20\u1a26il\u80bb\xb8\u01adptyv;\u69b2t\u8100\xa2;e\u1a2d\u1a2e\u40a2r\xe4\u01b2r;\uc000\ud835\udd20\u0180cei\u1a3d\u1a40\u1a4dy;\u4447ck\u0100;m\u1a47\u1a48\u6713ark\xbb\u1a48;\u43c7r\u0380;Ecefms\u1a5f\u1a60\u1a62\u1a6b\u1aa4\u1aaa\u1aae\u65cb;\u69c3\u0180;el\u1a69\u1a6a\u1a6d\u42c6q;\u6257e\u0261\u1a74\0\0\u1a88rrow\u0100lr\u1a7c\u1a81eft;\u61baight;\u61bb\u0280RSacd\u1a92\u1a94\u1a96\u1a9a\u1a9f\xbb\u0f47;\u64c8st;\u629birc;\u629aash;\u629dnint;\u6a10id;\u6aefcir;\u69c2ubs\u0100;u\u1abb\u1abc\u6663it\xbb\u1abc\u02ec\u1ac7\u1ad4\u1afa\0\u1b0aon\u0100;e\u1acd\u1ace\u403a\u0100;q\xc7\xc6\u026d\u1ad9\0\0\u1ae2a\u0100;t\u1ade\u1adf\u402c;\u4040\u0180;fl\u1ae8\u1ae9\u1aeb\u6201\xee\u1160e\u0100mx\u1af1\u1af6ent\xbb\u1ae9e\xf3\u024d\u01e7\u1afe\0\u1b07\u0100;d\u12bb\u1b02ot;\u6a6dn\xf4\u0246\u0180fry\u1b10\u1b14\u1b17;\uc000\ud835\udd54o\xe4\u0254\u8100\xa9;s\u0155\u1b1dr;\u6117\u0100ao\u1b25\u1b29rr;\u61b5ss;\u6717\u0100cu\u1b32\u1b37r;\uc000\ud835\udcb8\u0100bp\u1b3c\u1b44\u0100;e\u1b41\u1b42\u6acf;\u6ad1\u0100;e\u1b49\u1b4a\u6ad0;\u6ad2dot;\u62ef\u0380delprvw\u1b60\u1b6c\u1b77\u1b82\u1bac\u1bd4\u1bf9arr\u0100lr\u1b68\u1b6a;\u6938;\u6935\u0270\u1b72\0\0\u1b75r;\u62dec;\u62dfarr\u0100;p\u1b7f\u1b80\u61b6;\u693d\u0300;bcdos\u1b8f\u1b90\u1b96\u1ba1\u1ba5\u1ba8\u622arcap;\u6a48\u0100au\u1b9b\u1b9ep;\u6a46p;\u6a4aot;\u628dr;\u6a45;\uc000\u222a\ufe00\u0200alrv\u1bb5\u1bbf\u1bde\u1be3rr\u0100;m\u1bbc\u1bbd\u61b7;\u693cy\u0180evw\u1bc7\u1bd4\u1bd8q\u0270\u1bce\0\0\u1bd2re\xe3\u1b73u\xe3\u1b75ee;\u62ceedge;\u62cfen\u803b\xa4\u40a4earrow\u0100lr\u1bee\u1bf3eft\xbb\u1b80ight\xbb\u1bbde\xe4\u1bdd\u0100ci\u1c01\u1c07onin\xf4\u01f7nt;\u6231lcty;\u632d\u0980AHabcdefhijlorstuwz\u1c38\u1c3b\u1c3f\u1c5d\u1c69\u1c75\u1c8a\u1c9e\u1cac\u1cb7\u1cfb\u1cff\u1d0d\u1d7b\u1d91\u1dab\u1dbb\u1dc6\u1dcdr\xf2\u0381ar;\u6965\u0200glrs\u1c48\u1c4d\u1c52\u1c54ger;\u6020eth;\u6138\xf2\u1133h\u0100;v\u1c5a\u1c5b\u6010\xbb\u090a\u016b\u1c61\u1c67arow;\u690fa\xe3\u0315\u0100ay\u1c6e\u1c73ron;\u410f;\u4434\u0180;ao\u0332\u1c7c\u1c84\u0100gr\u02bf\u1c81r;\u61catseq;\u6a77\u0180glm\u1c91\u1c94\u1c98\u803b\xb0\u40b0ta;\u43b4ptyv;\u69b1\u0100ir\u1ca3\u1ca8sht;\u697f;\uc000\ud835\udd21ar\u0100lr\u1cb3\u1cb5\xbb\u08dc\xbb\u101e\u0280aegsv\u1cc2\u0378\u1cd6\u1cdc\u1ce0m\u0180;os\u0326\u1cca\u1cd4nd\u0100;s\u0326\u1cd1uit;\u6666amma;\u43ddin;\u62f2\u0180;io\u1ce7\u1ce8\u1cf8\u40f7de\u8100\xf7;o\u1ce7\u1cf0ntimes;\u62c7n\xf8\u1cf7cy;\u4452c\u026f\u1d06\0\0\u1d0arn;\u631eop;\u630d\u0280lptuw\u1d18\u1d1d\u1d22\u1d49\u1d55lar;\u4024f;\uc000\ud835\udd55\u0280;emps\u030b\u1d2d\u1d37\u1d3d\u1d42q\u0100;d\u0352\u1d33ot;\u6251inus;\u6238lus;\u6214quare;\u62a1blebarwedg\xe5\xfan\u0180adh\u112e\u1d5d\u1d67ownarrow\xf3\u1c83arpoon\u0100lr\u1d72\u1d76ef\xf4\u1cb4igh\xf4\u1cb6\u0162\u1d7f\u1d85karo\xf7\u0f42\u026f\u1d8a\0\0\u1d8ern;\u631fop;\u630c\u0180cot\u1d98\u1da3\u1da6\u0100ry\u1d9d\u1da1;\uc000\ud835\udcb9;\u4455l;\u69f6rok;\u4111\u0100dr\u1db0\u1db4ot;\u62f1i\u0100;f\u1dba\u1816\u65bf\u0100ah\u1dc0\u1dc3r\xf2\u0429a\xf2\u0fa6angle;\u69a6\u0100ci\u1dd2\u1dd5y;\u445fgrarr;\u67ff\u0900Dacdefglmnopqrstux\u1e01\u1e09\u1e19\u1e38\u0578\u1e3c\u1e49\u1e61\u1e7e\u1ea5\u1eaf\u1ebd\u1ee1\u1f2a\u1f37\u1f44\u1f4e\u1f5a\u0100Do\u1e06\u1d34o\xf4\u1c89\u0100cs\u1e0e\u1e14ute\u803b\xe9\u40e9ter;\u6a6e\u0200aioy\u1e22\u1e27\u1e31\u1e36ron;\u411br\u0100;c\u1e2d\u1e2e\u6256\u803b\xea\u40ealon;\u6255;\u444dot;\u4117\u0100Dr\u1e41\u1e45ot;\u6252;\uc000\ud835\udd22\u0180;rs\u1e50\u1e51\u1e57\u6a9aave\u803b\xe8\u40e8\u0100;d\u1e5c\u1e5d\u6a96ot;\u6a98\u0200;ils\u1e6a\u1e6b\u1e72\u1e74\u6a99nters;\u63e7;\u6113\u0100;d\u1e79\u1e7a\u6a95ot;\u6a97\u0180aps\u1e85\u1e89\u1e97cr;\u4113ty\u0180;sv\u1e92\u1e93\u1e95\u6205et\xbb\u1e93p\u01001;\u1e9d\u1ea4\u0133\u1ea1\u1ea3;\u6004;\u6005\u6003\u0100gs\u1eaa\u1eac;\u414bp;\u6002\u0100gp\u1eb4\u1eb8on;\u4119f;\uc000\ud835\udd56\u0180als\u1ec4\u1ece\u1ed2r\u0100;s\u1eca\u1ecb\u62d5l;\u69e3us;\u6a71i\u0180;lv\u1eda\u1edb\u1edf\u43b5on\xbb\u1edb;\u43f5\u0200csuv\u1eea\u1ef3\u1f0b\u1f23\u0100io\u1eef\u1e31rc\xbb\u1e2e\u0269\u1ef9\0\0\u1efb\xed\u0548ant\u0100gl\u1f02\u1f06tr\xbb\u1e5dess\xbb\u1e7a\u0180aei\u1f12\u1f16\u1f1als;\u403dst;\u625fv\u0100;D\u0235\u1f20D;\u6a78parsl;\u69e5\u0100Da\u1f2f\u1f33ot;\u6253rr;\u6971\u0180cdi\u1f3e\u1f41\u1ef8r;\u612fo\xf4\u0352\u0100ah\u1f49\u1f4b;\u43b7\u803b\xf0\u40f0\u0100mr\u1f53\u1f57l\u803b\xeb\u40ebo;\u60ac\u0180cip\u1f61\u1f64\u1f67l;\u4021s\xf4\u056e\u0100eo\u1f6c\u1f74ctatio\xee\u0559nential\xe5\u0579\u09e1\u1f92\0\u1f9e\0\u1fa1\u1fa7\0\0\u1fc6\u1fcc\0\u1fd3\0\u1fe6\u1fea\u2000\0\u2008\u205allingdotse\xf1\u1e44y;\u4444male;\u6640\u0180ilr\u1fad\u1fb3\u1fc1lig;\u8000\ufb03\u0269\u1fb9\0\0\u1fbdg;\u8000\ufb00ig;\u8000\ufb04;\uc000\ud835\udd23lig;\u8000\ufb01lig;\uc000fj\u0180alt\u1fd9\u1fdc\u1fe1t;\u666dig;\u8000\ufb02ns;\u65b1of;\u4192\u01f0\u1fee\0\u1ff3f;\uc000\ud835\udd57\u0100ak\u05bf\u1ff7\u0100;v\u1ffc\u1ffd\u62d4;\u6ad9artint;\u6a0d\u0100ao\u200c\u2055\u0100cs\u2011\u2052\u03b1\u201a\u2030\u2038\u2045\u2048\0\u2050\u03b2\u2022\u2025\u2027\u202a\u202c\0\u202e\u803b\xbd\u40bd;\u6153\u803b\xbc\u40bc;\u6155;\u6159;\u615b\u01b3\u2034\0\u2036;\u6154;\u6156\u02b4\u203e\u2041\0\0\u2043\u803b\xbe\u40be;\u6157;\u615c5;\u6158\u01b6\u204c\0\u204e;\u615a;\u615d8;\u615el;\u6044wn;\u6322cr;\uc000\ud835\udcbb\u0880Eabcdefgijlnorstv\u2082\u2089\u209f\u20a5\u20b0\u20b4\u20f0\u20f5\u20fa\u20ff\u2103\u2112\u2138\u0317\u213e\u2152\u219e\u0100;l\u064d\u2087;\u6a8c\u0180cmp\u2090\u2095\u209dute;\u41f5ma\u0100;d\u209c\u1cda\u43b3;\u6a86reve;\u411f\u0100iy\u20aa\u20aerc;\u411d;\u4433ot;\u4121\u0200;lqs\u063e\u0642\u20bd\u20c9\u0180;qs\u063e\u064c\u20c4lan\xf4\u0665\u0200;cdl\u0665\u20d2\u20d5\u20e5c;\u6aa9ot\u0100;o\u20dc\u20dd\u6a80\u0100;l\u20e2\u20e3\u6a82;\u6a84\u0100;e\u20ea\u20ed\uc000\u22db\ufe00s;\u6a94r;\uc000\ud835\udd24\u0100;g\u0673\u061bmel;\u6137cy;\u4453\u0200;Eaj\u065a\u210c\u210e\u2110;\u6a92;\u6aa5;\u6aa4\u0200Eaes\u211b\u211d\u2129\u2134;\u6269p\u0100;p\u2123\u2124\u6a8arox\xbb\u2124\u0100;q\u212e\u212f\u6a88\u0100;q\u212e\u211bim;\u62e7pf;\uc000\ud835\udd58\u0100ci\u2143\u2146r;\u610am\u0180;el\u066b\u214e\u2150;\u6a8e;\u6a90\u8300>;cdlqr\u05ee\u2160\u216a\u216e\u2173\u2179\u0100ci\u2165\u2167;\u6aa7r;\u6a7aot;\u62d7Par;\u6995uest;\u6a7c\u0280adels\u2184\u216a\u2190\u0656\u219b\u01f0\u2189\0\u218epro\xf8\u209er;\u6978q\u0100lq\u063f\u2196les\xf3\u2088i\xed\u066b\u0100en\u21a3\u21adrtneqq;\uc000\u2269\ufe00\xc5\u21aa\u0500Aabcefkosy\u21c4\u21c7\u21f1\u21f5\u21fa\u2218\u221d\u222f\u2268\u227dr\xf2\u03a0\u0200ilmr\u21d0\u21d4\u21d7\u21dbrs\xf0\u1484f\xbb\u2024il\xf4\u06a9\u0100dr\u21e0\u21e4cy;\u444a\u0180;cw\u08f4\u21eb\u21efir;\u6948;\u61adar;\u610firc;\u4125\u0180alr\u2201\u220e\u2213rts\u0100;u\u2209\u220a\u6665it\xbb\u220alip;\u6026con;\u62b9r;\uc000\ud835\udd25s\u0100ew\u2223\u2229arow;\u6925arow;\u6926\u0280amopr\u223a\u223e\u2243\u225e\u2263rr;\u61fftht;\u623bk\u0100lr\u2249\u2253eftarrow;\u61a9ightarrow;\u61aaf;\uc000\ud835\udd59bar;\u6015\u0180clt\u226f\u2274\u2278r;\uc000\ud835\udcbdas\xe8\u21f4rok;\u4127\u0100bp\u2282\u2287ull;\u6043hen\xbb\u1c5b\u0ae1\u22a3\0\u22aa\0\u22b8\u22c5\u22ce\0\u22d5\u22f3\0\0\u22f8\u2322\u2367\u2362\u237f\0\u2386\u23aa\u23b4cute\u803b\xed\u40ed\u0180;iy\u0771\u22b0\u22b5rc\u803b\xee\u40ee;\u4438\u0100cx\u22bc\u22bfy;\u4435cl\u803b\xa1\u40a1\u0100fr\u039f\u22c9;\uc000\ud835\udd26rave\u803b\xec\u40ec\u0200;ino\u073e\u22dd\u22e9\u22ee\u0100in\u22e2\u22e6nt;\u6a0ct;\u622dfin;\u69dcta;\u6129lig;\u4133\u0180aop\u22fe\u231a\u231d\u0180cgt\u2305\u2308\u2317r;\u412b\u0180elp\u071f\u230f\u2313in\xe5\u078ear\xf4\u0720h;\u4131f;\u62b7ed;\u41b5\u0280;cfot\u04f4\u232c\u2331\u233d\u2341are;\u6105in\u0100;t\u2338\u2339\u621eie;\u69dddo\xf4\u2319\u0280;celp\u0757\u234c\u2350\u235b\u2361al;\u62ba\u0100gr\u2355\u2359er\xf3\u1563\xe3\u234darhk;\u6a17rod;\u6a3c\u0200cgpt\u236f\u2372\u2376\u237by;\u4451on;\u412ff;\uc000\ud835\udd5aa;\u43b9uest\u803b\xbf\u40bf\u0100ci\u238a\u238fr;\uc000\ud835\udcben\u0280;Edsv\u04f4\u239b\u239d\u23a1\u04f3;\u62f9ot;\u62f5\u0100;v\u23a6\u23a7\u62f4;\u62f3\u0100;i\u0777\u23aelde;\u4129\u01eb\u23b8\0\u23bccy;\u4456l\u803b\xef\u40ef\u0300cfmosu\u23cc\u23d7\u23dc\u23e1\u23e7\u23f5\u0100iy\u23d1\u23d5rc;\u4135;\u4439r;\uc000\ud835\udd27ath;\u4237pf;\uc000\ud835\udd5b\u01e3\u23ec\0\u23f1r;\uc000\ud835\udcbfrcy;\u4458kcy;\u4454\u0400acfghjos\u240b\u2416\u2422\u2427\u242d\u2431\u2435\u243bppa\u0100;v\u2413\u2414\u43ba;\u43f0\u0100ey\u241b\u2420dil;\u4137;\u443ar;\uc000\ud835\udd28reen;\u4138cy;\u4445cy;\u445cpf;\uc000\ud835\udd5ccr;\uc000\ud835\udcc0\u0b80ABEHabcdefghjlmnoprstuv\u2470\u2481\u2486\u248d\u2491\u250e\u253d\u255a\u2580\u264e\u265e\u2665\u2679\u267d\u269a\u26b2\u26d8\u275d\u2768\u278b\u27c0\u2801\u2812\u0180art\u2477\u247a\u247cr\xf2\u09c6\xf2\u0395ail;\u691barr;\u690e\u0100;g\u0994\u248b;\u6a8bar;\u6962\u0963\u24a5\0\u24aa\0\u24b1\0\0\0\0\0\u24b5\u24ba\0\u24c6\u24c8\u24cd\0\u24f9ute;\u413amptyv;\u69b4ra\xee\u084cbda;\u43bbg\u0180;dl\u088e\u24c1\u24c3;\u6991\xe5\u088e;\u6a85uo\u803b\xab\u40abr\u0400;bfhlpst\u0899\u24de\u24e6\u24e9\u24eb\u24ee\u24f1\u24f5\u0100;f\u089d\u24e3s;\u691fs;\u691d\xeb\u2252p;\u61abl;\u6939im;\u6973l;\u61a2\u0180;ae\u24ff\u2500\u2504\u6aabil;\u6919\u0100;s\u2509\u250a\u6aad;\uc000\u2aad\ufe00\u0180abr\u2515\u2519\u251drr;\u690crk;\u6772\u0100ak\u2522\u252cc\u0100ek\u2528\u252a;\u407b;\u405b\u0100es\u2531\u2533;\u698bl\u0100du\u2539\u253b;\u698f;\u698d\u0200aeuy\u2546\u254b\u2556\u2558ron;\u413e\u0100di\u2550\u2554il;\u413c\xec\u08b0\xe2\u2529;\u443b\u0200cqrs\u2563\u2566\u256d\u257da;\u6936uo\u0100;r\u0e19\u1746\u0100du\u2572\u2577har;\u6967shar;\u694bh;\u61b2\u0280;fgqs\u258b\u258c\u0989\u25f3\u25ff\u6264t\u0280ahlrt\u2598\u25a4\u25b7\u25c2\u25e8rrow\u0100;t\u0899\u25a1a\xe9\u24f6arpoon\u0100du\u25af\u25b4own\xbb\u045ap\xbb\u0966eftarrows;\u61c7ight\u0180ahs\u25cd\u25d6\u25derrow\u0100;s\u08f4\u08a7arpoon\xf3\u0f98quigarro\xf7\u21f0hreetimes;\u62cb\u0180;qs\u258b\u0993\u25falan\xf4\u09ac\u0280;cdgs\u09ac\u260a\u260d\u261d\u2628c;\u6aa8ot\u0100;o\u2614\u2615\u6a7f\u0100;r\u261a\u261b\u6a81;\u6a83\u0100;e\u2622\u2625\uc000\u22da\ufe00s;\u6a93\u0280adegs\u2633\u2639\u263d\u2649\u264bppro\xf8\u24c6ot;\u62d6q\u0100gq\u2643\u2645\xf4\u0989gt\xf2\u248c\xf4\u099bi\xed\u09b2\u0180ilr\u2655\u08e1\u265asht;\u697c;\uc000\ud835\udd29\u0100;E\u099c\u2663;\u6a91\u0161\u2669\u2676r\u0100du\u25b2\u266e\u0100;l\u0965\u2673;\u696alk;\u6584cy;\u4459\u0280;acht\u0a48\u2688\u268b\u2691\u2696r\xf2\u25c1orne\xf2\u1d08ard;\u696bri;\u65fa\u0100io\u269f\u26a4dot;\u4140ust\u0100;a\u26ac\u26ad\u63b0che\xbb\u26ad\u0200Eaes\u26bb\u26bd\u26c9\u26d4;\u6268p\u0100;p\u26c3\u26c4\u6a89rox\xbb\u26c4\u0100;q\u26ce\u26cf\u6a87\u0100;q\u26ce\u26bbim;\u62e6\u0400abnoptwz\u26e9\u26f4\u26f7\u271a\u272f\u2741\u2747\u2750\u0100nr\u26ee\u26f1g;\u67ecr;\u61fdr\xeb\u08c1g\u0180lmr\u26ff\u270d\u2714eft\u0100ar\u09e6\u2707ight\xe1\u09f2apsto;\u67fcight\xe1\u09fdparrow\u0100lr\u2725\u2729ef\xf4\u24edight;\u61ac\u0180afl\u2736\u2739\u273dr;\u6985;\uc000\ud835\udd5dus;\u6a2dimes;\u6a34\u0161\u274b\u274fst;\u6217\xe1\u134e\u0180;ef\u2757\u2758\u1800\u65cange\xbb\u2758ar\u0100;l\u2764\u2765\u4028t;\u6993\u0280achmt\u2773\u2776\u277c\u2785\u2787r\xf2\u08a8orne\xf2\u1d8car\u0100;d\u0f98\u2783;\u696d;\u600eri;\u62bf\u0300achiqt\u2798\u279d\u0a40\u27a2\u27ae\u27bbquo;\u6039r;\uc000\ud835\udcc1m\u0180;eg\u09b2\u27aa\u27ac;\u6a8d;\u6a8f\u0100bu\u252a\u27b3o\u0100;r\u0e1f\u27b9;\u601arok;\u4142\u8400<;cdhilqr\u082b\u27d2\u2639\u27dc\u27e0\u27e5\u27ea\u27f0\u0100ci\u27d7\u27d9;\u6aa6r;\u6a79re\xe5\u25f2mes;\u62c9arr;\u6976uest;\u6a7b\u0100Pi\u27f5\u27f9ar;\u6996\u0180;ef\u2800\u092d\u181b\u65c3r\u0100du\u2807\u280dshar;\u694ahar;\u6966\u0100en\u2817\u2821rtneqq;\uc000\u2268\ufe00\xc5\u281e\u0700Dacdefhilnopsu\u2840\u2845\u2882\u288e\u2893\u28a0\u28a5\u28a8\u28da\u28e2\u28e4\u0a83\u28f3\u2902Dot;\u623a\u0200clpr\u284e\u2852\u2863\u287dr\u803b\xaf\u40af\u0100et\u2857\u2859;\u6642\u0100;e\u285e\u285f\u6720se\xbb\u285f\u0100;s\u103b\u2868to\u0200;dlu\u103b\u2873\u2877\u287bow\xee\u048cef\xf4\u090f\xf0\u13d1ker;\u65ae\u0100oy\u2887\u288cmma;\u6a29;\u443cash;\u6014asuredangle\xbb\u1626r;\uc000\ud835\udd2ao;\u6127\u0180cdn\u28af\u28b4\u28c9ro\u803b\xb5\u40b5\u0200;acd\u1464\u28bd\u28c0\u28c4s\xf4\u16a7ir;\u6af0ot\u80bb\xb7\u01b5us\u0180;bd\u28d2\u1903\u28d3\u6212\u0100;u\u1d3c\u28d8;\u6a2a\u0163\u28de\u28e1p;\u6adb\xf2\u2212\xf0\u0a81\u0100dp\u28e9\u28eeels;\u62a7f;\uc000\ud835\udd5e\u0100ct\u28f8\u28fdr;\uc000\ud835\udcc2pos\xbb\u159d\u0180;lm\u2909\u290a\u290d\u43bctimap;\u62b8\u0c00GLRVabcdefghijlmoprstuvw\u2942\u2953\u297e\u2989\u2998\u29da\u29e9\u2a15\u2a1a\u2a58\u2a5d\u2a83\u2a95\u2aa4\u2aa8\u2b04\u2b07\u2b44\u2b7f\u2bae\u2c34\u2c67\u2c7c\u2ce9\u0100gt\u2947\u294b;\uc000\u22d9\u0338\u0100;v\u2950\u0bcf\uc000\u226b\u20d2\u0180elt\u295a\u2972\u2976ft\u0100ar\u2961\u2967rrow;\u61cdightarrow;\u61ce;\uc000\u22d8\u0338\u0100;v\u297b\u0c47\uc000\u226a\u20d2ightarrow;\u61cf\u0100Dd\u298e\u2993ash;\u62afash;\u62ae\u0280bcnpt\u29a3\u29a7\u29ac\u29b1\u29ccla\xbb\u02deute;\u4144g;\uc000\u2220\u20d2\u0280;Eiop\u0d84\u29bc\u29c0\u29c5\u29c8;\uc000\u2a70\u0338d;\uc000\u224b\u0338s;\u4149ro\xf8\u0d84ur\u0100;a\u29d3\u29d4\u666el\u0100;s\u29d3\u0b38\u01f3\u29df\0\u29e3p\u80bb\xa0\u0b37mp\u0100;e\u0bf9\u0c00\u0280aeouy\u29f4\u29fe\u2a03\u2a10\u2a13\u01f0\u29f9\0\u29fb;\u6a43on;\u4148dil;\u4146ng\u0100;d\u0d7e\u2a0aot;\uc000\u2a6d\u0338p;\u6a42;\u443dash;\u6013\u0380;Aadqsx\u0b92\u2a29\u2a2d\u2a3b\u2a41\u2a45\u2a50rr;\u61d7r\u0100hr\u2a33\u2a36k;\u6924\u0100;o\u13f2\u13f0ot;\uc000\u2250\u0338ui\xf6\u0b63\u0100ei\u2a4a\u2a4ear;\u6928\xed\u0b98ist\u0100;s\u0ba0\u0b9fr;\uc000\ud835\udd2b\u0200Eest\u0bc5\u2a66\u2a79\u2a7c\u0180;qs\u0bbc\u2a6d\u0be1\u0180;qs\u0bbc\u0bc5\u2a74lan\xf4\u0be2i\xed\u0bea\u0100;r\u0bb6\u2a81\xbb\u0bb7\u0180Aap\u2a8a\u2a8d\u2a91r\xf2\u2971rr;\u61aear;\u6af2\u0180;sv\u0f8d\u2a9c\u0f8c\u0100;d\u2aa1\u2aa2\u62fc;\u62facy;\u445a\u0380AEadest\u2ab7\u2aba\u2abe\u2ac2\u2ac5\u2af6\u2af9r\xf2\u2966;\uc000\u2266\u0338rr;\u619ar;\u6025\u0200;fqs\u0c3b\u2ace\u2ae3\u2aeft\u0100ar\u2ad4\u2ad9rro\xf7\u2ac1ightarro\xf7\u2a90\u0180;qs\u0c3b\u2aba\u2aealan\xf4\u0c55\u0100;s\u0c55\u2af4\xbb\u0c36i\xed\u0c5d\u0100;r\u0c35\u2afei\u0100;e\u0c1a\u0c25i\xe4\u0d90\u0100pt\u2b0c\u2b11f;\uc000\ud835\udd5f\u8180\xac;in\u2b19\u2b1a\u2b36\u40acn\u0200;Edv\u0b89\u2b24\u2b28\u2b2e;\uc000\u22f9\u0338ot;\uc000\u22f5\u0338\u01e1\u0b89\u2b33\u2b35;\u62f7;\u62f6i\u0100;v\u0cb8\u2b3c\u01e1\u0cb8\u2b41\u2b43;\u62fe;\u62fd\u0180aor\u2b4b\u2b63\u2b69r\u0200;ast\u0b7b\u2b55\u2b5a\u2b5flle\xec\u0b7bl;\uc000\u2afd\u20e5;\uc000\u2202\u0338lint;\u6a14\u0180;ce\u0c92\u2b70\u2b73u\xe5\u0ca5\u0100;c\u0c98\u2b78\u0100;e\u0c92\u2b7d\xf1\u0c98\u0200Aait\u2b88\u2b8b\u2b9d\u2ba7r\xf2\u2988rr\u0180;cw\u2b94\u2b95\u2b99\u619b;\uc000\u2933\u0338;\uc000\u219d\u0338ghtarrow\xbb\u2b95ri\u0100;e\u0ccb\u0cd6\u0380chimpqu\u2bbd\u2bcd\u2bd9\u2b04\u0b78\u2be4\u2bef\u0200;cer\u0d32\u2bc6\u0d37\u2bc9u\xe5\u0d45;\uc000\ud835\udcc3ort\u026d\u2b05\0\0\u2bd6ar\xe1\u2b56m\u0100;e\u0d6e\u2bdf\u0100;q\u0d74\u0d73su\u0100bp\u2beb\u2bed\xe5\u0cf8\xe5\u0d0b\u0180bcp\u2bf6\u2c11\u2c19\u0200;Ees\u2bff\u2c00\u0d22\u2c04\u6284;\uc000\u2ac5\u0338et\u0100;e\u0d1b\u2c0bq\u0100;q\u0d23\u2c00c\u0100;e\u0d32\u2c17\xf1\u0d38\u0200;Ees\u2c22\u2c23\u0d5f\u2c27\u6285;\uc000\u2ac6\u0338et\u0100;e\u0d58\u2c2eq\u0100;q\u0d60\u2c23\u0200gilr\u2c3d\u2c3f\u2c45\u2c47\xec\u0bd7lde\u803b\xf1\u40f1\xe7\u0c43iangle\u0100lr\u2c52\u2c5ceft\u0100;e\u0c1a\u2c5a\xf1\u0c26ight\u0100;e\u0ccb\u2c65\xf1\u0cd7\u0100;m\u2c6c\u2c6d\u43bd\u0180;es\u2c74\u2c75\u2c79\u4023ro;\u6116p;\u6007\u0480DHadgilrs\u2c8f\u2c94\u2c99\u2c9e\u2ca3\u2cb0\u2cb6\u2cd3\u2ce3ash;\u62adarr;\u6904p;\uc000\u224d\u20d2ash;\u62ac\u0100et\u2ca8\u2cac;\uc000\u2265\u20d2;\uc000>\u20d2nfin;\u69de\u0180Aet\u2cbd\u2cc1\u2cc5rr;\u6902;\uc000\u2264\u20d2\u0100;r\u2cca\u2ccd\uc000<\u20d2ie;\uc000\u22b4\u20d2\u0100At\u2cd8\u2cdcrr;\u6903rie;\uc000\u22b5\u20d2im;\uc000\u223c\u20d2\u0180Aan\u2cf0\u2cf4\u2d02rr;\u61d6r\u0100hr\u2cfa\u2cfdk;\u6923\u0100;o\u13e7\u13e5ear;\u6927\u1253\u1a95\0\0\0\0\0\0\0\0\0\0\0\0\0\u2d2d\0\u2d38\u2d48\u2d60\u2d65\u2d72\u2d84\u1b07\0\0\u2d8d\u2dab\0\u2dc8\u2dce\0\u2ddc\u2e19\u2e2b\u2e3e\u2e43\u0100cs\u2d31\u1a97ute\u803b\xf3\u40f3\u0100iy\u2d3c\u2d45r\u0100;c\u1a9e\u2d42\u803b\xf4\u40f4;\u443e\u0280abios\u1aa0\u2d52\u2d57\u01c8\u2d5alac;\u4151v;\u6a38old;\u69bclig;\u4153\u0100cr\u2d69\u2d6dir;\u69bf;\uc000\ud835\udd2c\u036f\u2d79\0\0\u2d7c\0\u2d82n;\u42dbave\u803b\xf2\u40f2;\u69c1\u0100bm\u2d88\u0df4ar;\u69b5\u0200acit\u2d95\u2d98\u2da5\u2da8r\xf2\u1a80\u0100ir\u2d9d\u2da0r;\u69beoss;\u69bbn\xe5\u0e52;\u69c0\u0180aei\u2db1\u2db5\u2db9cr;\u414dga;\u43c9\u0180cdn\u2dc0\u2dc5\u01cdron;\u43bf;\u69b6pf;\uc000\ud835\udd60\u0180ael\u2dd4\u2dd7\u01d2r;\u69b7rp;\u69b9\u0380;adiosv\u2dea\u2deb\u2dee\u2e08\u2e0d\u2e10\u2e16\u6228r\xf2\u1a86\u0200;efm\u2df7\u2df8\u2e02\u2e05\u6a5dr\u0100;o\u2dfe\u2dff\u6134f\xbb\u2dff\u803b\xaa\u40aa\u803b\xba\u40bagof;\u62b6r;\u6a56lope;\u6a57;\u6a5b\u0180clo\u2e1f\u2e21\u2e27\xf2\u2e01ash\u803b\xf8\u40f8l;\u6298i\u016c\u2e2f\u2e34de\u803b\xf5\u40f5es\u0100;a\u01db\u2e3as;\u6a36ml\u803b\xf6\u40f6bar;\u633d\u0ae1\u2e5e\0\u2e7d\0\u2e80\u2e9d\0\u2ea2\u2eb9\0\0\u2ecb\u0e9c\0\u2f13\0\0\u2f2b\u2fbc\0\u2fc8r\u0200;ast\u0403\u2e67\u2e72\u0e85\u8100\xb6;l\u2e6d\u2e6e\u40b6le\xec\u0403\u0269\u2e78\0\0\u2e7bm;\u6af3;\u6afdy;\u443fr\u0280cimpt\u2e8b\u2e8f\u2e93\u1865\u2e97nt;\u4025od;\u402eil;\u6030enk;\u6031r;\uc000\ud835\udd2d\u0180imo\u2ea8\u2eb0\u2eb4\u0100;v\u2ead\u2eae\u43c6;\u43d5ma\xf4\u0a76ne;\u660e\u0180;tv\u2ebf\u2ec0\u2ec8\u43c0chfork\xbb\u1ffd;\u43d6\u0100au\u2ecf\u2edfn\u0100ck\u2ed5\u2eddk\u0100;h\u21f4\u2edb;\u610e\xf6\u21f4s\u0480;abcdemst\u2ef3\u2ef4\u1908\u2ef9\u2efd\u2f04\u2f06\u2f0a\u2f0e\u402bcir;\u6a23ir;\u6a22\u0100ou\u1d40\u2f02;\u6a25;\u6a72n\u80bb\xb1\u0e9dim;\u6a26wo;\u6a27\u0180ipu\u2f19\u2f20\u2f25ntint;\u6a15f;\uc000\ud835\udd61nd\u803b\xa3\u40a3\u0500;Eaceinosu\u0ec8\u2f3f\u2f41\u2f44\u2f47\u2f81\u2f89\u2f92\u2f7e\u2fb6;\u6ab3p;\u6ab7u\xe5\u0ed9\u0100;c\u0ece\u2f4c\u0300;acens\u0ec8\u2f59\u2f5f\u2f66\u2f68\u2f7eppro\xf8\u2f43urlye\xf1\u0ed9\xf1\u0ece\u0180aes\u2f6f\u2f76\u2f7approx;\u6ab9qq;\u6ab5im;\u62e8i\xed\u0edfme\u0100;s\u2f88\u0eae\u6032\u0180Eas\u2f78\u2f90\u2f7a\xf0\u2f75\u0180dfp\u0eec\u2f99\u2faf\u0180als\u2fa0\u2fa5\u2faalar;\u632eine;\u6312urf;\u6313\u0100;t\u0efb\u2fb4\xef\u0efbrel;\u62b0\u0100ci\u2fc0\u2fc5r;\uc000\ud835\udcc5;\u43c8ncsp;\u6008\u0300fiopsu\u2fda\u22e2\u2fdf\u2fe5\u2feb\u2ff1r;\uc000\ud835\udd2epf;\uc000\ud835\udd62rime;\u6057cr;\uc000\ud835\udcc6\u0180aeo\u2ff8\u3009\u3013t\u0100ei\u2ffe\u3005rnion\xf3\u06b0nt;\u6a16st\u0100;e\u3010\u3011\u403f\xf1\u1f19\xf4\u0f14\u0a80ABHabcdefhilmnoprstux\u3040\u3051\u3055\u3059\u30e0\u310e\u312b\u3147\u3162\u3172\u318e\u3206\u3215\u3224\u3229\u3258\u326e\u3272\u3290\u32b0\u32b7\u0180art\u3047\u304a\u304cr\xf2\u10b3\xf2\u03ddail;\u691car\xf2\u1c65ar;\u6964\u0380cdenqrt\u3068\u3075\u3078\u307f\u308f\u3094\u30cc\u0100eu\u306d\u3071;\uc000\u223d\u0331te;\u4155i\xe3\u116emptyv;\u69b3g\u0200;del\u0fd1\u3089\u308b\u308d;\u6992;\u69a5\xe5\u0fd1uo\u803b\xbb\u40bbr\u0580;abcfhlpstw\u0fdc\u30ac\u30af\u30b7\u30b9\u30bc\u30be\u30c0\u30c3\u30c7\u30cap;\u6975\u0100;f\u0fe0\u30b4s;\u6920;\u6933s;\u691e\xeb\u225d\xf0\u272el;\u6945im;\u6974l;\u61a3;\u619d\u0100ai\u30d1\u30d5il;\u691ao\u0100;n\u30db\u30dc\u6236al\xf3\u0f1e\u0180abr\u30e7\u30ea\u30eer\xf2\u17e5rk;\u6773\u0100ak\u30f3\u30fdc\u0100ek\u30f9\u30fb;\u407d;\u405d\u0100es\u3102\u3104;\u698cl\u0100du\u310a\u310c;\u698e;\u6990\u0200aeuy\u3117\u311c\u3127\u3129ron;\u4159\u0100di\u3121\u3125il;\u4157\xec\u0ff2\xe2\u30fa;\u4440\u0200clqs\u3134\u3137\u313d\u3144a;\u6937dhar;\u6969uo\u0100;r\u020e\u020dh;\u61b3\u0180acg\u314e\u315f\u0f44l\u0200;ips\u0f78\u3158\u315b\u109cn\xe5\u10bbar\xf4\u0fa9t;\u65ad\u0180ilr\u3169\u1023\u316esht;\u697d;\uc000\ud835\udd2f\u0100ao\u3177\u3186r\u0100du\u317d\u317f\xbb\u047b\u0100;l\u1091\u3184;\u696c\u0100;v\u318b\u318c\u43c1;\u43f1\u0180gns\u3195\u31f9\u31fcht\u0300ahlrst\u31a4\u31b0\u31c2\u31d8\u31e4\u31eerrow\u0100;t\u0fdc\u31ada\xe9\u30c8arpoon\u0100du\u31bb\u31bfow\xee\u317ep\xbb\u1092eft\u0100ah\u31ca\u31d0rrow\xf3\u0feaarpoon\xf3\u0551ightarrows;\u61c9quigarro\xf7\u30cbhreetimes;\u62ccg;\u42daingdotse\xf1\u1f32\u0180ahm\u320d\u3210\u3213r\xf2\u0feaa\xf2\u0551;\u600foust\u0100;a\u321e\u321f\u63b1che\xbb\u321fmid;\u6aee\u0200abpt\u3232\u323d\u3240\u3252\u0100nr\u3237\u323ag;\u67edr;\u61fer\xeb\u1003\u0180afl\u3247\u324a\u324er;\u6986;\uc000\ud835\udd63us;\u6a2eimes;\u6a35\u0100ap\u325d\u3267r\u0100;g\u3263\u3264\u4029t;\u6994olint;\u6a12ar\xf2\u31e3\u0200achq\u327b\u3280\u10bc\u3285quo;\u603ar;\uc000\ud835\udcc7\u0100bu\u30fb\u328ao\u0100;r\u0214\u0213\u0180hir\u3297\u329b\u32a0re\xe5\u31f8mes;\u62cai\u0200;efl\u32aa\u1059\u1821\u32ab\u65b9tri;\u69celuhar;\u6968;\u611e\u0d61\u32d5\u32db\u32df\u332c\u3338\u3371\0\u337a\u33a4\0\0\u33ec\u33f0\0\u3428\u3448\u345a\u34ad\u34b1\u34ca\u34f1\0\u3616\0\0\u3633cute;\u415bqu\xef\u27ba\u0500;Eaceinpsy\u11ed\u32f3\u32f5\u32ff\u3302\u330b\u330f\u331f\u3326\u3329;\u6ab4\u01f0\u32fa\0\u32fc;\u6ab8on;\u4161u\xe5\u11fe\u0100;d\u11f3\u3307il;\u415frc;\u415d\u0180Eas\u3316\u3318\u331b;\u6ab6p;\u6abaim;\u62e9olint;\u6a13i\xed\u1204;\u4441ot\u0180;be\u3334\u1d47\u3335\u62c5;\u6a66\u0380Aacmstx\u3346\u334a\u3357\u335b\u335e\u3363\u336drr;\u61d8r\u0100hr\u3350\u3352\xeb\u2228\u0100;o\u0a36\u0a34t\u803b\xa7\u40a7i;\u403bwar;\u6929m\u0100in\u3369\xf0nu\xf3\xf1t;\u6736r\u0100;o\u3376\u2055\uc000\ud835\udd30\u0200acoy\u3382\u3386\u3391\u33a0rp;\u666f\u0100hy\u338b\u338fcy;\u4449;\u4448rt\u026d\u3399\0\0\u339ci\xe4\u1464ara\xec\u2e6f\u803b\xad\u40ad\u0100gm\u33a8\u33b4ma\u0180;fv\u33b1\u33b2\u33b2\u43c3;\u43c2\u0400;deglnpr\u12ab\u33c5\u33c9\u33ce\u33d6\u33de\u33e1\u33e6ot;\u6a6a\u0100;q\u12b1\u12b0\u0100;E\u33d3\u33d4\u6a9e;\u6aa0\u0100;E\u33db\u33dc\u6a9d;\u6a9fe;\u6246lus;\u6a24arr;\u6972ar\xf2\u113d\u0200aeit\u33f8\u3408\u340f\u3417\u0100ls\u33fd\u3404lsetm\xe9\u336ahp;\u6a33parsl;\u69e4\u0100dl\u1463\u3414e;\u6323\u0100;e\u341c\u341d\u6aaa\u0100;s\u3422\u3423\u6aac;\uc000\u2aac\ufe00\u0180flp\u342e\u3433\u3442tcy;\u444c\u0100;b\u3438\u3439\u402f\u0100;a\u343e\u343f\u69c4r;\u633ff;\uc000\ud835\udd64a\u0100dr\u344d\u0402es\u0100;u\u3454\u3455\u6660it\xbb\u3455\u0180csu\u3460\u3479\u349f\u0100au\u3465\u346fp\u0100;s\u1188\u346b;\uc000\u2293\ufe00p\u0100;s\u11b4\u3475;\uc000\u2294\ufe00u\u0100bp\u347f\u348f\u0180;es\u1197\u119c\u3486et\u0100;e\u1197\u348d\xf1\u119d\u0180;es\u11a8\u11ad\u3496et\u0100;e\u11a8\u349d\xf1\u11ae\u0180;af\u117b\u34a6\u05b0r\u0165\u34ab\u05b1\xbb\u117car\xf2\u1148\u0200cemt\u34b9\u34be\u34c2\u34c5r;\uc000\ud835\udcc8tm\xee\xf1i\xec\u3415ar\xe6\u11be\u0100ar\u34ce\u34d5r\u0100;f\u34d4\u17bf\u6606\u0100an\u34da\u34edight\u0100ep\u34e3\u34eapsilo\xee\u1ee0h\xe9\u2eafs\xbb\u2852\u0280bcmnp\u34fb\u355e\u1209\u358b\u358e\u0480;Edemnprs\u350e\u350f\u3511\u3515\u351e\u3523\u352c\u3531\u3536\u6282;\u6ac5ot;\u6abd\u0100;d\u11da\u351aot;\u6ac3ult;\u6ac1\u0100Ee\u3528\u352a;\u6acb;\u628alus;\u6abfarr;\u6979\u0180eiu\u353d\u3552\u3555t\u0180;en\u350e\u3545\u354bq\u0100;q\u11da\u350feq\u0100;q\u352b\u3528m;\u6ac7\u0100bp\u355a\u355c;\u6ad5;\u6ad3c\u0300;acens\u11ed\u356c\u3572\u3579\u357b\u3326ppro\xf8\u32faurlye\xf1\u11fe\xf1\u11f3\u0180aes\u3582\u3588\u331bppro\xf8\u331aq\xf1\u3317g;\u666a\u0680123;Edehlmnps\u35a9\u35ac\u35af\u121c\u35b2\u35b4\u35c0\u35c9\u35d5\u35da\u35df\u35e8\u35ed\u803b\xb9\u40b9\u803b\xb2\u40b2\u803b\xb3\u40b3;\u6ac6\u0100os\u35b9\u35bct;\u6abeub;\u6ad8\u0100;d\u1222\u35c5ot;\u6ac4s\u0100ou\u35cf\u35d2l;\u67c9b;\u6ad7arr;\u697bult;\u6ac2\u0100Ee\u35e4\u35e6;\u6acc;\u628blus;\u6ac0\u0180eiu\u35f4\u3609\u360ct\u0180;en\u121c\u35fc\u3602q\u0100;q\u1222\u35b2eq\u0100;q\u35e7\u35e4m;\u6ac8\u0100bp\u3611\u3613;\u6ad4;\u6ad6\u0180Aan\u361c\u3620\u362drr;\u61d9r\u0100hr\u3626\u3628\xeb\u222e\u0100;o\u0a2b\u0a29war;\u692alig\u803b\xdf\u40df\u0be1\u3651\u365d\u3660\u12ce\u3673\u3679\0\u367e\u36c2\0\0\0\0\0\u36db\u3703\0\u3709\u376c\0\0\0\u3787\u0272\u3656\0\0\u365bget;\u6316;\u43c4r\xeb\u0e5f\u0180aey\u3666\u366b\u3670ron;\u4165dil;\u4163;\u4442lrec;\u6315r;\uc000\ud835\udd31\u0200eiko\u3686\u369d\u36b5\u36bc\u01f2\u368b\0\u3691e\u01004f\u1284\u1281a\u0180;sv\u3698\u3699\u369b\u43b8ym;\u43d1\u0100cn\u36a2\u36b2k\u0100as\u36a8\u36aeppro\xf8\u12c1im\xbb\u12acs\xf0\u129e\u0100as\u36ba\u36ae\xf0\u12c1rn\u803b\xfe\u40fe\u01ec\u031f\u36c6\u22e7es\u8180\xd7;bd\u36cf\u36d0\u36d8\u40d7\u0100;a\u190f\u36d5r;\u6a31;\u6a30\u0180eps\u36e1\u36e3\u3700\xe1\u2a4d\u0200;bcf\u0486\u36ec\u36f0\u36f4ot;\u6336ir;\u6af1\u0100;o\u36f9\u36fc\uc000\ud835\udd65rk;\u6ada\xe1\u3362rime;\u6034\u0180aip\u370f\u3712\u3764d\xe5\u1248\u0380adempst\u3721\u374d\u3740\u3751\u3757\u375c\u375fngle\u0280;dlqr\u3730\u3731\u3736\u3740\u3742\u65b5own\xbb\u1dbbeft\u0100;e\u2800\u373e\xf1\u092e;\u625cight\u0100;e\u32aa\u374b\xf1\u105aot;\u65ecinus;\u6a3alus;\u6a39b;\u69cdime;\u6a3bezium;\u63e2\u0180cht\u3772\u377d\u3781\u0100ry\u3777\u377b;\uc000\ud835\udcc9;\u4446cy;\u445brok;\u4167\u0100io\u378b\u378ex\xf4\u1777head\u0100lr\u3797\u37a0eftarro\xf7\u084fightarrow\xbb\u0f5d\u0900AHabcdfghlmoprstuw\u37d0\u37d3\u37d7\u37e4\u37f0\u37fc\u380e\u381c\u3823\u3834\u3851\u385d\u386b\u38a9\u38cc\u38d2\u38ea\u38f6r\xf2\u03edar;\u6963\u0100cr\u37dc\u37e2ute\u803b\xfa\u40fa\xf2\u1150r\u01e3\u37ea\0\u37edy;\u445eve;\u416d\u0100iy\u37f5\u37farc\u803b\xfb\u40fb;\u4443\u0180abh\u3803\u3806\u380br\xf2\u13adlac;\u4171a\xf2\u13c3\u0100ir\u3813\u3818sht;\u697e;\uc000\ud835\udd32rave\u803b\xf9\u40f9\u0161\u3827\u3831r\u0100lr\u382c\u382e\xbb\u0957\xbb\u1083lk;\u6580\u0100ct\u3839\u384d\u026f\u383f\0\0\u384arn\u0100;e\u3845\u3846\u631cr\xbb\u3846op;\u630fri;\u65f8\u0100al\u3856\u385acr;\u416b\u80bb\xa8\u0349\u0100gp\u3862\u3866on;\u4173f;\uc000\ud835\udd66\u0300adhlsu\u114b\u3878\u387d\u1372\u3891\u38a0own\xe1\u13b3arpoon\u0100lr\u3888\u388cef\xf4\u382digh\xf4\u382fi\u0180;hl\u3899\u389a\u389c\u43c5\xbb\u13faon\xbb\u389aparrows;\u61c8\u0180cit\u38b0\u38c4\u38c8\u026f\u38b6\0\0\u38c1rn\u0100;e\u38bc\u38bd\u631dr\xbb\u38bdop;\u630eng;\u416fri;\u65f9cr;\uc000\ud835\udcca\u0180dir\u38d9\u38dd\u38e2ot;\u62f0lde;\u4169i\u0100;f\u3730\u38e8\xbb\u1813\u0100am\u38ef\u38f2r\xf2\u38a8l\u803b\xfc\u40fcangle;\u69a7\u0780ABDacdeflnoprsz\u391c\u391f\u3929\u392d\u39b5\u39b8\u39bd\u39df\u39e4\u39e8\u39f3\u39f9\u39fd\u3a01\u3a20r\xf2\u03f7ar\u0100;v\u3926\u3927\u6ae8;\u6ae9as\xe8\u03e1\u0100nr\u3932\u3937grt;\u699c\u0380eknprst\u34e3\u3946\u394b\u3952\u395d\u3964\u3996app\xe1\u2415othin\xe7\u1e96\u0180hir\u34eb\u2ec8\u3959op\xf4\u2fb5\u0100;h\u13b7\u3962\xef\u318d\u0100iu\u3969\u396dgm\xe1\u33b3\u0100bp\u3972\u3984setneq\u0100;q\u397d\u3980\uc000\u228a\ufe00;\uc000\u2acb\ufe00setneq\u0100;q\u398f\u3992\uc000\u228b\ufe00;\uc000\u2acc\ufe00\u0100hr\u399b\u399fet\xe1\u369ciangle\u0100lr\u39aa\u39afeft\xbb\u0925ight\xbb\u1051y;\u4432ash\xbb\u1036\u0180elr\u39c4\u39d2\u39d7\u0180;be\u2dea\u39cb\u39cfar;\u62bbq;\u625alip;\u62ee\u0100bt\u39dc\u1468a\xf2\u1469r;\uc000\ud835\udd33tr\xe9\u39aesu\u0100bp\u39ef\u39f1\xbb\u0d1c\xbb\u0d59pf;\uc000\ud835\udd67ro\xf0\u0efbtr\xe9\u39b4\u0100cu\u3a06\u3a0br;\uc000\ud835\udccb\u0100bp\u3a10\u3a18n\u0100Ee\u3980\u3a16\xbb\u397en\u0100Ee\u3992\u3a1e\xbb\u3990igzag;\u699a\u0380cefoprs\u3a36\u3a3b\u3a56\u3a5b\u3a54\u3a61\u3a6airc;\u4175\u0100di\u3a40\u3a51\u0100bg\u3a45\u3a49ar;\u6a5fe\u0100;q\u15fa\u3a4f;\u6259erp;\u6118r;\uc000\ud835\udd34pf;\uc000\ud835\udd68\u0100;e\u1479\u3a66at\xe8\u1479cr;\uc000\ud835\udccc\u0ae3\u178e\u3a87\0\u3a8b\0\u3a90\u3a9b\0\0\u3a9d\u3aa8\u3aab\u3aaf\0\0\u3ac3\u3ace\0\u3ad8\u17dc\u17dftr\xe9\u17d1r;\uc000\ud835\udd35\u0100Aa\u3a94\u3a97r\xf2\u03c3r\xf2\u09f6;\u43be\u0100Aa\u3aa1\u3aa4r\xf2\u03b8r\xf2\u09eba\xf0\u2713is;\u62fb\u0180dpt\u17a4\u3ab5\u3abe\u0100fl\u3aba\u17a9;\uc000\ud835\udd69im\xe5\u17b2\u0100Aa\u3ac7\u3acar\xf2\u03cer\xf2\u0a01\u0100cq\u3ad2\u17b8r;\uc000\ud835\udccd\u0100pt\u17d6\u3adcr\xe9\u17d4\u0400acefiosu\u3af0\u3afd\u3b08\u3b0c\u3b11\u3b15\u3b1b\u3b21c\u0100uy\u3af6\u3afbte\u803b\xfd\u40fd;\u444f\u0100iy\u3b02\u3b06rc;\u4177;\u444bn\u803b\xa5\u40a5r;\uc000\ud835\udd36cy;\u4457pf;\uc000\ud835\udd6acr;\uc000\ud835\udcce\u0100cm\u3b26\u3b29y;\u444el\u803b\xff\u40ff\u0500acdefhiosw\u3b42\u3b48\u3b54\u3b58\u3b64\u3b69\u3b6d\u3b74\u3b7a\u3b80cute;\u417a\u0100ay\u3b4d\u3b52ron;\u417e;\u4437ot;\u417c\u0100et\u3b5d\u3b61tr\xe6\u155fa;\u43b6r;\uc000\ud835\udd37cy;\u4436grarr;\u61ddpf;\uc000\ud835\udd6bcr;\uc000\ud835\udccf\u0100jn\u3b85\u3b87;\u600dj;\u600c" .split("") .map(function (c) { return c.charCodeAt(0); })); //# sourceMappingURL=decode-data-html.js.map /***/ }), /***/ "./node_modules/entities/lib/generated/decode-data-xml.js": /*!****************************************************************!*\ !*** ./node_modules/entities/lib/generated/decode-data-xml.js ***! \****************************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; // Generated using scripts/write-decode-map.ts Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = new Uint16Array( // prettier-ignore "\u0200aglq\t\x15\x18\x1b\u026d\x0f\0\0\x12p;\u4026os;\u4027t;\u403et;\u403cuot;\u4022" .split("") .map(function (c) { return c.charCodeAt(0); })); //# sourceMappingURL=decode-data-xml.js.map /***/ }), /***/ "./node_modules/form-data/lib/browser.js": /*!***********************************************!*\ !*** ./node_modules/form-data/lib/browser.js ***! \***********************************************/ /***/ ((module) => { /* eslint-env browser */ module.exports = typeof self == 'object' ? self.FormData : window.FormData; /***/ }), /***/ "./node_modules/fs-extra/lib/copy/copy-sync.js": /*!*****************************************************!*\ !*** ./node_modules/fs-extra/lib/copy/copy-sync.js ***! \*****************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const fs = __webpack_require__(/*! graceful-fs */ "./node_modules/graceful-fs/graceful-fs.js") const path = __webpack_require__(/*! path */ "path") const mkdirsSync = (__webpack_require__(/*! ../mkdirs */ "./node_modules/fs-extra/lib/mkdirs/index.js").mkdirsSync) const utimesMillisSync = (__webpack_require__(/*! ../util/utimes */ "./node_modules/fs-extra/lib/util/utimes.js").utimesMillisSync) const stat = __webpack_require__(/*! ../util/stat */ "./node_modules/fs-extra/lib/util/stat.js") function copySync (src, dest, opts) { if (typeof opts === 'function') { opts = { filter: opts } } opts = opts || {} opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber // Warn about using preserveTimestamps on 32-bit node if (opts.preserveTimestamps && process.arch === 'ia32') { process.emitWarning( 'Using the preserveTimestamps option in 32-bit node is not recommended;\n\n' + '\tsee https://github.com/jprichardson/node-fs-extra/issues/269', 'Warning', 'fs-extra-WARN0002' ) } const { srcStat, destStat } = stat.checkPathsSync(src, dest, 'copy', opts) stat.checkParentPathsSync(src, srcStat, dest, 'copy') return handleFilterAndCopy(destStat, src, dest, opts) } function handleFilterAndCopy (destStat, src, dest, opts) { if (opts.filter && !opts.filter(src, dest)) return const destParent = path.dirname(dest) if (!fs.existsSync(destParent)) mkdirsSync(destParent) return getStats(destStat, src, dest, opts) } function startCopy (destStat, src, dest, opts) { if (opts.filter && !opts.filter(src, dest)) return return getStats(destStat, src, dest, opts) } function getStats (destStat, src, dest, opts) { const statSync = opts.dereference ? fs.statSync : fs.lstatSync const srcStat = statSync(src) if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts) else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts) else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts) else if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`) else if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`) throw new Error(`Unknown file: ${src}`) } function onFile (srcStat, destStat, src, dest, opts) { if (!destStat) return copyFile(srcStat, src, dest, opts) return mayCopyFile(srcStat, src, dest, opts) } function mayCopyFile (srcStat, src, dest, opts) { if (opts.overwrite) { fs.unlinkSync(dest) return copyFile(srcStat, src, dest, opts) } else if (opts.errorOnExist) { throw new Error(`'${dest}' already exists`) } } function copyFile (srcStat, src, dest, opts) { fs.copyFileSync(src, dest) if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest) return setDestMode(dest, srcStat.mode) } function handleTimestamps (srcMode, src, dest) { // Make sure the file is writable before setting the timestamp // otherwise open fails with EPERM when invoked with 'r+' // (through utimes call) if (fileIsNotWritable(srcMode)) makeFileWritable(dest, srcMode) return setDestTimestamps(src, dest) } function fileIsNotWritable (srcMode) { return (srcMode & 0o200) === 0 } function makeFileWritable (dest, srcMode) { return setDestMode(dest, srcMode | 0o200) } function setDestMode (dest, srcMode) { return fs.chmodSync(dest, srcMode) } function setDestTimestamps (src, dest) { // The initial srcStat.atime cannot be trusted // because it is modified by the read(2) system call // (See https://nodejs.org/api/fs.html#fs_stat_time_values) const updatedSrcStat = fs.statSync(src) return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime) } function onDir (srcStat, destStat, src, dest, opts) { if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts) return copyDir(src, dest, opts) } function mkDirAndCopy (srcMode, src, dest, opts) { fs.mkdirSync(dest) copyDir(src, dest, opts) return setDestMode(dest, srcMode) } function copyDir (src, dest, opts) { fs.readdirSync(src).forEach(item => copyDirItem(item, src, dest, opts)) } function copyDirItem (item, src, dest, opts) { const srcItem = path.join(src, item) const destItem = path.join(dest, item) const { destStat } = stat.checkPathsSync(srcItem, destItem, 'copy', opts) return startCopy(destStat, srcItem, destItem, opts) } function onLink (destStat, src, dest, opts) { let resolvedSrc = fs.readlinkSync(src) if (opts.dereference) { resolvedSrc = path.resolve(process.cwd(), resolvedSrc) } if (!destStat) { return fs.symlinkSync(resolvedSrc, dest) } else { let resolvedDest try { resolvedDest = fs.readlinkSync(dest) } catch (err) { // dest exists and is a regular file or directory, // Windows may throw UNKNOWN error. If dest already exists, // fs throws error anyway, so no need to guard against it here. if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return fs.symlinkSync(resolvedSrc, dest) throw err } if (opts.dereference) { resolvedDest = path.resolve(process.cwd(), resolvedDest) } if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) { throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`) } // prevent copy if src is a subdir of dest since unlinking // dest in this case would result in removing src contents // and therefore a broken symlink would be created. if (fs.statSync(dest).isDirectory() && stat.isSrcSubdir(resolvedDest, resolvedSrc)) { throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`) } return copyLink(resolvedSrc, dest) } } function copyLink (resolvedSrc, dest) { fs.unlinkSync(dest) return fs.symlinkSync(resolvedSrc, dest) } module.exports = copySync /***/ }), /***/ "./node_modules/fs-extra/lib/copy/copy.js": /*!************************************************!*\ !*** ./node_modules/fs-extra/lib/copy/copy.js ***! \************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const fs = __webpack_require__(/*! graceful-fs */ "./node_modules/graceful-fs/graceful-fs.js") const path = __webpack_require__(/*! path */ "path") const mkdirs = (__webpack_require__(/*! ../mkdirs */ "./node_modules/fs-extra/lib/mkdirs/index.js").mkdirs) const pathExists = (__webpack_require__(/*! ../path-exists */ "./node_modules/fs-extra/lib/path-exists/index.js").pathExists) const utimesMillis = (__webpack_require__(/*! ../util/utimes */ "./node_modules/fs-extra/lib/util/utimes.js").utimesMillis) const stat = __webpack_require__(/*! ../util/stat */ "./node_modules/fs-extra/lib/util/stat.js") function copy (src, dest, opts, cb) { if (typeof opts === 'function' && !cb) { cb = opts opts = {} } else if (typeof opts === 'function') { opts = { filter: opts } } cb = cb || function () {} opts = opts || {} opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber // Warn about using preserveTimestamps on 32-bit node if (opts.preserveTimestamps && process.arch === 'ia32') { process.emitWarning( 'Using the preserveTimestamps option in 32-bit node is not recommended;\n\n' + '\tsee https://github.com/jprichardson/node-fs-extra/issues/269', 'Warning', 'fs-extra-WARN0001' ) } stat.checkPaths(src, dest, 'copy', opts, (err, stats) => { if (err) return cb(err) const { srcStat, destStat } = stats stat.checkParentPaths(src, srcStat, dest, 'copy', err => { if (err) return cb(err) if (opts.filter) return handleFilter(checkParentDir, destStat, src, dest, opts, cb) return checkParentDir(destStat, src, dest, opts, cb) }) }) } function checkParentDir (destStat, src, dest, opts, cb) { const destParent = path.dirname(dest) pathExists(destParent, (err, dirExists) => { if (err) return cb(err) if (dirExists) return getStats(destStat, src, dest, opts, cb) mkdirs(destParent, err => { if (err) return cb(err) return getStats(destStat, src, dest, opts, cb) }) }) } function handleFilter (onInclude, destStat, src, dest, opts, cb) { Promise.resolve(opts.filter(src, dest)).then(include => { if (include) return onInclude(destStat, src, dest, opts, cb) return cb() }, error => cb(error)) } function startCopy (destStat, src, dest, opts, cb) { if (opts.filter) return handleFilter(getStats, destStat, src, dest, opts, cb) return getStats(destStat, src, dest, opts, cb) } function getStats (destStat, src, dest, opts, cb) { const stat = opts.dereference ? fs.stat : fs.lstat stat(src, (err, srcStat) => { if (err) return cb(err) if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts, cb) else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts, cb) else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts, cb) else if (srcStat.isSocket()) return cb(new Error(`Cannot copy a socket file: ${src}`)) else if (srcStat.isFIFO()) return cb(new Error(`Cannot copy a FIFO pipe: ${src}`)) return cb(new Error(`Unknown file: ${src}`)) }) } function onFile (srcStat, destStat, src, dest, opts, cb) { if (!destStat) return copyFile(srcStat, src, dest, opts, cb) return mayCopyFile(srcStat, src, dest, opts, cb) } function mayCopyFile (srcStat, src, dest, opts, cb) { if (opts.overwrite) { fs.unlink(dest, err => { if (err) return cb(err) return copyFile(srcStat, src, dest, opts, cb) }) } else if (opts.errorOnExist) { return cb(new Error(`'${dest}' already exists`)) } else return cb() } function copyFile (srcStat, src, dest, opts, cb) { fs.copyFile(src, dest, err => { if (err) return cb(err) if (opts.preserveTimestamps) return handleTimestampsAndMode(srcStat.mode, src, dest, cb) return setDestMode(dest, srcStat.mode, cb) }) } function handleTimestampsAndMode (srcMode, src, dest, cb) { // Make sure the file is writable before setting the timestamp // otherwise open fails with EPERM when invoked with 'r+' // (through utimes call) if (fileIsNotWritable(srcMode)) { return makeFileWritable(dest, srcMode, err => { if (err) return cb(err) return setDestTimestampsAndMode(srcMode, src, dest, cb) }) } return setDestTimestampsAndMode(srcMode, src, dest, cb) } function fileIsNotWritable (srcMode) { return (srcMode & 0o200) === 0 } function makeFileWritable (dest, srcMode, cb) { return setDestMode(dest, srcMode | 0o200, cb) } function setDestTimestampsAndMode (srcMode, src, dest, cb) { setDestTimestamps(src, dest, err => { if (err) return cb(err) return setDestMode(dest, srcMode, cb) }) } function setDestMode (dest, srcMode, cb) { return fs.chmod(dest, srcMode, cb) } function setDestTimestamps (src, dest, cb) { // The initial srcStat.atime cannot be trusted // because it is modified by the read(2) system call // (See https://nodejs.org/api/fs.html#fs_stat_time_values) fs.stat(src, (err, updatedSrcStat) => { if (err) return cb(err) return utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime, cb) }) } function onDir (srcStat, destStat, src, dest, opts, cb) { if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts, cb) return copyDir(src, dest, opts, cb) } function mkDirAndCopy (srcMode, src, dest, opts, cb) { fs.mkdir(dest, err => { if (err) return cb(err) copyDir(src, dest, opts, err => { if (err) return cb(err) return setDestMode(dest, srcMode, cb) }) }) } function copyDir (src, dest, opts, cb) { fs.readdir(src, (err, items) => { if (err) return cb(err) return copyDirItems(items, src, dest, opts, cb) }) } function copyDirItems (items, src, dest, opts, cb) { const item = items.pop() if (!item) return cb() return copyDirItem(items, item, src, dest, opts, cb) } function copyDirItem (items, item, src, dest, opts, cb) { const srcItem = path.join(src, item) const destItem = path.join(dest, item) stat.checkPaths(srcItem, destItem, 'copy', opts, (err, stats) => { if (err) return cb(err) const { destStat } = stats startCopy(destStat, srcItem, destItem, opts, err => { if (err) return cb(err) return copyDirItems(items, src, dest, opts, cb) }) }) } function onLink (destStat, src, dest, opts, cb) { fs.readlink(src, (err, resolvedSrc) => { if (err) return cb(err) if (opts.dereference) { resolvedSrc = path.resolve(process.cwd(), resolvedSrc) } if (!destStat) { return fs.symlink(resolvedSrc, dest, cb) } else { fs.readlink(dest, (err, resolvedDest) => { if (err) { // dest exists and is a regular file or directory, // Windows may throw UNKNOWN error. If dest already exists, // fs throws error anyway, so no need to guard against it here. if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return fs.symlink(resolvedSrc, dest, cb) return cb(err) } if (opts.dereference) { resolvedDest = path.resolve(process.cwd(), resolvedDest) } if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) { return cb(new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`)) } // do not copy if src is a subdir of dest since unlinking // dest in this case would result in removing src contents // and therefore a broken symlink would be created. if (destStat.isDirectory() && stat.isSrcSubdir(resolvedDest, resolvedSrc)) { return cb(new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`)) } return copyLink(resolvedSrc, dest, cb) }) } }) } function copyLink (resolvedSrc, dest, cb) { fs.unlink(dest, err => { if (err) return cb(err) return fs.symlink(resolvedSrc, dest, cb) }) } module.exports = copy /***/ }), /***/ "./node_modules/fs-extra/lib/copy/index.js": /*!*************************************************!*\ !*** ./node_modules/fs-extra/lib/copy/index.js ***! \*************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const u = (__webpack_require__(/*! universalify */ "./node_modules/universalify/index.js").fromCallback) module.exports = { copy: u(__webpack_require__(/*! ./copy */ "./node_modules/fs-extra/lib/copy/copy.js")), copySync: __webpack_require__(/*! ./copy-sync */ "./node_modules/fs-extra/lib/copy/copy-sync.js") } /***/ }), /***/ "./node_modules/fs-extra/lib/empty/index.js": /*!**************************************************!*\ !*** ./node_modules/fs-extra/lib/empty/index.js ***! \**************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const u = (__webpack_require__(/*! universalify */ "./node_modules/universalify/index.js").fromPromise) const fs = __webpack_require__(/*! ../fs */ "./node_modules/fs-extra/lib/fs/index.js") const path = __webpack_require__(/*! path */ "path") const mkdir = __webpack_require__(/*! ../mkdirs */ "./node_modules/fs-extra/lib/mkdirs/index.js") const remove = __webpack_require__(/*! ../remove */ "./node_modules/fs-extra/lib/remove/index.js") const emptyDir = u(async function emptyDir (dir) { let items try { items = await fs.readdir(dir) } catch { return mkdir.mkdirs(dir) } return Promise.all(items.map(item => remove.remove(path.join(dir, item)))) }) function emptyDirSync (dir) { let items try { items = fs.readdirSync(dir) } catch { return mkdir.mkdirsSync(dir) } items.forEach(item => { item = path.join(dir, item) remove.removeSync(item) }) } module.exports = { emptyDirSync, emptydirSync: emptyDirSync, emptyDir, emptydir: emptyDir } /***/ }), /***/ "./node_modules/fs-extra/lib/ensure/file.js": /*!**************************************************!*\ !*** ./node_modules/fs-extra/lib/ensure/file.js ***! \**************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const u = (__webpack_require__(/*! universalify */ "./node_modules/universalify/index.js").fromCallback) const path = __webpack_require__(/*! path */ "path") const fs = __webpack_require__(/*! graceful-fs */ "./node_modules/graceful-fs/graceful-fs.js") const mkdir = __webpack_require__(/*! ../mkdirs */ "./node_modules/fs-extra/lib/mkdirs/index.js") function createFile (file, callback) { function makeFile () { fs.writeFile(file, '', err => { if (err) return callback(err) callback() }) } fs.stat(file, (err, stats) => { // eslint-disable-line handle-callback-err if (!err && stats.isFile()) return callback() const dir = path.dirname(file) fs.stat(dir, (err, stats) => { if (err) { // if the directory doesn't exist, make it if (err.code === 'ENOENT') { return mkdir.mkdirs(dir, err => { if (err) return callback(err) makeFile() }) } return callback(err) } if (stats.isDirectory()) makeFile() else { // parent is not a directory // This is just to cause an internal ENOTDIR error to be thrown fs.readdir(dir, err => { if (err) return callback(err) }) } }) }) } function createFileSync (file) { let stats try { stats = fs.statSync(file) } catch {} if (stats && stats.isFile()) return const dir = path.dirname(file) try { if (!fs.statSync(dir).isDirectory()) { // parent is not a directory // This is just to cause an internal ENOTDIR error to be thrown fs.readdirSync(dir) } } catch (err) { // If the stat call above failed because the directory doesn't exist, create it if (err && err.code === 'ENOENT') mkdir.mkdirsSync(dir) else throw err } fs.writeFileSync(file, '') } module.exports = { createFile: u(createFile), createFileSync } /***/ }), /***/ "./node_modules/fs-extra/lib/ensure/index.js": /*!***************************************************!*\ !*** ./node_modules/fs-extra/lib/ensure/index.js ***! \***************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const { createFile, createFileSync } = __webpack_require__(/*! ./file */ "./node_modules/fs-extra/lib/ensure/file.js") const { createLink, createLinkSync } = __webpack_require__(/*! ./link */ "./node_modules/fs-extra/lib/ensure/link.js") const { createSymlink, createSymlinkSync } = __webpack_require__(/*! ./symlink */ "./node_modules/fs-extra/lib/ensure/symlink.js") module.exports = { // file createFile, createFileSync, ensureFile: createFile, ensureFileSync: createFileSync, // link createLink, createLinkSync, ensureLink: createLink, ensureLinkSync: createLinkSync, // symlink createSymlink, createSymlinkSync, ensureSymlink: createSymlink, ensureSymlinkSync: createSymlinkSync } /***/ }), /***/ "./node_modules/fs-extra/lib/ensure/link.js": /*!**************************************************!*\ !*** ./node_modules/fs-extra/lib/ensure/link.js ***! \**************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const u = (__webpack_require__(/*! universalify */ "./node_modules/universalify/index.js").fromCallback) const path = __webpack_require__(/*! path */ "path") const fs = __webpack_require__(/*! graceful-fs */ "./node_modules/graceful-fs/graceful-fs.js") const mkdir = __webpack_require__(/*! ../mkdirs */ "./node_modules/fs-extra/lib/mkdirs/index.js") const pathExists = (__webpack_require__(/*! ../path-exists */ "./node_modules/fs-extra/lib/path-exists/index.js").pathExists) const { areIdentical } = __webpack_require__(/*! ../util/stat */ "./node_modules/fs-extra/lib/util/stat.js") function createLink (srcpath, dstpath, callback) { function makeLink (srcpath, dstpath) { fs.link(srcpath, dstpath, err => { if (err) return callback(err) callback(null) }) } fs.lstat(dstpath, (_, dstStat) => { fs.lstat(srcpath, (err, srcStat) => { if (err) { err.message = err.message.replace('lstat', 'ensureLink') return callback(err) } if (dstStat && areIdentical(srcStat, dstStat)) return callback(null) const dir = path.dirname(dstpath) pathExists(dir, (err, dirExists) => { if (err) return callback(err) if (dirExists) return makeLink(srcpath, dstpath) mkdir.mkdirs(dir, err => { if (err) return callback(err) makeLink(srcpath, dstpath) }) }) }) }) } function createLinkSync (srcpath, dstpath) { let dstStat try { dstStat = fs.lstatSync(dstpath) } catch {} try { const srcStat = fs.lstatSync(srcpath) if (dstStat && areIdentical(srcStat, dstStat)) return } catch (err) { err.message = err.message.replace('lstat', 'ensureLink') throw err } const dir = path.dirname(dstpath) const dirExists = fs.existsSync(dir) if (dirExists) return fs.linkSync(srcpath, dstpath) mkdir.mkdirsSync(dir) return fs.linkSync(srcpath, dstpath) } module.exports = { createLink: u(createLink), createLinkSync } /***/ }), /***/ "./node_modules/fs-extra/lib/ensure/symlink-paths.js": /*!***********************************************************!*\ !*** ./node_modules/fs-extra/lib/ensure/symlink-paths.js ***! \***********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const path = __webpack_require__(/*! path */ "path") const fs = __webpack_require__(/*! graceful-fs */ "./node_modules/graceful-fs/graceful-fs.js") const pathExists = (__webpack_require__(/*! ../path-exists */ "./node_modules/fs-extra/lib/path-exists/index.js").pathExists) /** * Function that returns two types of paths, one relative to symlink, and one * relative to the current working directory. Checks if path is absolute or * relative. If the path is relative, this function checks if the path is * relative to symlink or relative to current working directory. This is an * initiative to find a smarter `srcpath` to supply when building symlinks. * This allows you to determine which path to use out of one of three possible * types of source paths. The first is an absolute path. This is detected by * `path.isAbsolute()`. When an absolute path is provided, it is checked to * see if it exists. If it does it's used, if not an error is returned * (callback)/ thrown (sync). The other two options for `srcpath` are a * relative url. By default Node's `fs.symlink` works by creating a symlink * using `dstpath` and expects the `srcpath` to be relative to the newly * created symlink. If you provide a `srcpath` that does not exist on the file * system it results in a broken symlink. To minimize this, the function * checks to see if the 'relative to symlink' source file exists, and if it * does it will use it. If it does not, it checks if there's a file that * exists that is relative to the current working directory, if does its used. * This preserves the expectations of the original fs.symlink spec and adds * the ability to pass in `relative to current working direcotry` paths. */ function symlinkPaths (srcpath, dstpath, callback) { if (path.isAbsolute(srcpath)) { return fs.lstat(srcpath, (err) => { if (err) { err.message = err.message.replace('lstat', 'ensureSymlink') return callback(err) } return callback(null, { toCwd: srcpath, toDst: srcpath }) }) } else { const dstdir = path.dirname(dstpath) const relativeToDst = path.join(dstdir, srcpath) return pathExists(relativeToDst, (err, exists) => { if (err) return callback(err) if (exists) { return callback(null, { toCwd: relativeToDst, toDst: srcpath }) } else { return fs.lstat(srcpath, (err) => { if (err) { err.message = err.message.replace('lstat', 'ensureSymlink') return callback(err) } return callback(null, { toCwd: srcpath, toDst: path.relative(dstdir, srcpath) }) }) } }) } } function symlinkPathsSync (srcpath, dstpath) { let exists if (path.isAbsolute(srcpath)) { exists = fs.existsSync(srcpath) if (!exists) throw new Error('absolute srcpath does not exist') return { toCwd: srcpath, toDst: srcpath } } else { const dstdir = path.dirname(dstpath) const relativeToDst = path.join(dstdir, srcpath) exists = fs.existsSync(relativeToDst) if (exists) { return { toCwd: relativeToDst, toDst: srcpath } } else { exists = fs.existsSync(srcpath) if (!exists) throw new Error('relative srcpath does not exist') return { toCwd: srcpath, toDst: path.relative(dstdir, srcpath) } } } } module.exports = { symlinkPaths, symlinkPathsSync } /***/ }), /***/ "./node_modules/fs-extra/lib/ensure/symlink-type.js": /*!**********************************************************!*\ !*** ./node_modules/fs-extra/lib/ensure/symlink-type.js ***! \**********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const fs = __webpack_require__(/*! graceful-fs */ "./node_modules/graceful-fs/graceful-fs.js") function symlinkType (srcpath, type, callback) { callback = (typeof type === 'function') ? type : callback type = (typeof type === 'function') ? false : type if (type) return callback(null, type) fs.lstat(srcpath, (err, stats) => { if (err) return callback(null, 'file') type = (stats && stats.isDirectory()) ? 'dir' : 'file' callback(null, type) }) } function symlinkTypeSync (srcpath, type) { let stats if (type) return type try { stats = fs.lstatSync(srcpath) } catch { return 'file' } return (stats && stats.isDirectory()) ? 'dir' : 'file' } module.exports = { symlinkType, symlinkTypeSync } /***/ }), /***/ "./node_modules/fs-extra/lib/ensure/symlink.js": /*!*****************************************************!*\ !*** ./node_modules/fs-extra/lib/ensure/symlink.js ***! \*****************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const u = (__webpack_require__(/*! universalify */ "./node_modules/universalify/index.js").fromCallback) const path = __webpack_require__(/*! path */ "path") const fs = __webpack_require__(/*! ../fs */ "./node_modules/fs-extra/lib/fs/index.js") const _mkdirs = __webpack_require__(/*! ../mkdirs */ "./node_modules/fs-extra/lib/mkdirs/index.js") const mkdirs = _mkdirs.mkdirs const mkdirsSync = _mkdirs.mkdirsSync const _symlinkPaths = __webpack_require__(/*! ./symlink-paths */ "./node_modules/fs-extra/lib/ensure/symlink-paths.js") const symlinkPaths = _symlinkPaths.symlinkPaths const symlinkPathsSync = _symlinkPaths.symlinkPathsSync const _symlinkType = __webpack_require__(/*! ./symlink-type */ "./node_modules/fs-extra/lib/ensure/symlink-type.js") const symlinkType = _symlinkType.symlinkType const symlinkTypeSync = _symlinkType.symlinkTypeSync const pathExists = (__webpack_require__(/*! ../path-exists */ "./node_modules/fs-extra/lib/path-exists/index.js").pathExists) const { areIdentical } = __webpack_require__(/*! ../util/stat */ "./node_modules/fs-extra/lib/util/stat.js") function createSymlink (srcpath, dstpath, type, callback) { callback = (typeof type === 'function') ? type : callback type = (typeof type === 'function') ? false : type fs.lstat(dstpath, (err, stats) => { if (!err && stats.isSymbolicLink()) { Promise.all([ fs.stat(srcpath), fs.stat(dstpath) ]).then(([srcStat, dstStat]) => { if (areIdentical(srcStat, dstStat)) return callback(null) _createSymlink(srcpath, dstpath, type, callback) }) } else _createSymlink(srcpath, dstpath, type, callback) }) } function _createSymlink (srcpath, dstpath, type, callback) { symlinkPaths(srcpath, dstpath, (err, relative) => { if (err) return callback(err) srcpath = relative.toDst symlinkType(relative.toCwd, type, (err, type) => { if (err) return callback(err) const dir = path.dirname(dstpath) pathExists(dir, (err, dirExists) => { if (err) return callback(err) if (dirExists) return fs.symlink(srcpath, dstpath, type, callback) mkdirs(dir, err => { if (err) return callback(err) fs.symlink(srcpath, dstpath, type, callback) }) }) }) }) } function createSymlinkSync (srcpath, dstpath, type) { let stats try { stats = fs.lstatSync(dstpath) } catch {} if (stats && stats.isSymbolicLink()) { const srcStat = fs.statSync(srcpath) const dstStat = fs.statSync(dstpath) if (areIdentical(srcStat, dstStat)) return } const relative = symlinkPathsSync(srcpath, dstpath) srcpath = relative.toDst type = symlinkTypeSync(relative.toCwd, type) const dir = path.dirname(dstpath) const exists = fs.existsSync(dir) if (exists) return fs.symlinkSync(srcpath, dstpath, type) mkdirsSync(dir) return fs.symlinkSync(srcpath, dstpath, type) } module.exports = { createSymlink: u(createSymlink), createSymlinkSync } /***/ }), /***/ "./node_modules/fs-extra/lib/fs/index.js": /*!***********************************************!*\ !*** ./node_modules/fs-extra/lib/fs/index.js ***! \***********************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; // This is adapted from https://github.com/normalize/mz // Copyright (c) 2014-2016 Jonathan Ong me@jongleberry.com and Contributors const u = (__webpack_require__(/*! universalify */ "./node_modules/universalify/index.js").fromCallback) const fs = __webpack_require__(/*! graceful-fs */ "./node_modules/graceful-fs/graceful-fs.js") const api = [ 'access', 'appendFile', 'chmod', 'chown', 'close', 'copyFile', 'fchmod', 'fchown', 'fdatasync', 'fstat', 'fsync', 'ftruncate', 'futimes', 'lchmod', 'lchown', 'link', 'lstat', 'mkdir', 'mkdtemp', 'open', 'opendir', 'readdir', 'readFile', 'readlink', 'realpath', 'rename', 'rm', 'rmdir', 'stat', 'symlink', 'truncate', 'unlink', 'utimes', 'writeFile' ].filter(key => { // Some commands are not available on some systems. Ex: // fs.opendir was added in Node.js v12.12.0 // fs.rm was added in Node.js v14.14.0 // fs.lchown is not available on at least some Linux return typeof fs[key] === 'function' }) // Export cloned fs: Object.assign(exports, fs) // Universalify async methods: api.forEach(method => { exports[method] = u(fs[method]) }) // We differ from mz/fs in that we still ship the old, broken, fs.exists() // since we are a drop-in replacement for the native module exports.exists = function (filename, callback) { if (typeof callback === 'function') { return fs.exists(filename, callback) } return new Promise(resolve => { return fs.exists(filename, resolve) }) } // fs.read(), fs.write(), & fs.writev() need special treatment due to multiple callback args exports.read = function (fd, buffer, offset, length, position, callback) { if (typeof callback === 'function') { return fs.read(fd, buffer, offset, length, position, callback) } return new Promise((resolve, reject) => { fs.read(fd, buffer, offset, length, position, (err, bytesRead, buffer) => { if (err) return reject(err) resolve({ bytesRead, buffer }) }) }) } // Function signature can be // fs.write(fd, buffer[, offset[, length[, position]]], callback) // OR // fs.write(fd, string[, position[, encoding]], callback) // We need to handle both cases, so we use ...args exports.write = function (fd, buffer, ...args) { if (typeof args[args.length - 1] === 'function') { return fs.write(fd, buffer, ...args) } return new Promise((resolve, reject) => { fs.write(fd, buffer, ...args, (err, bytesWritten, buffer) => { if (err) return reject(err) resolve({ bytesWritten, buffer }) }) }) } // fs.writev only available in Node v12.9.0+ if (typeof fs.writev === 'function') { // Function signature is // s.writev(fd, buffers[, position], callback) // We need to handle the optional arg, so we use ...args exports.writev = function (fd, buffers, ...args) { if (typeof args[args.length - 1] === 'function') { return fs.writev(fd, buffers, ...args) } return new Promise((resolve, reject) => { fs.writev(fd, buffers, ...args, (err, bytesWritten, buffers) => { if (err) return reject(err) resolve({ bytesWritten, buffers }) }) }) } } // fs.realpath.native sometimes not available if fs is monkey-patched if (typeof fs.realpath.native === 'function') { exports.realpath.native = u(fs.realpath.native) } else { process.emitWarning( 'fs.realpath.native is not a function. Is fs being monkey-patched?', 'Warning', 'fs-extra-WARN0003' ) } /***/ }), /***/ "./node_modules/fs-extra/lib/index.js": /*!********************************************!*\ !*** ./node_modules/fs-extra/lib/index.js ***! \********************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; module.exports = { // Export promiseified graceful-fs: ...__webpack_require__(/*! ./fs */ "./node_modules/fs-extra/lib/fs/index.js"), // Export extra methods: ...__webpack_require__(/*! ./copy */ "./node_modules/fs-extra/lib/copy/index.js"), ...__webpack_require__(/*! ./empty */ "./node_modules/fs-extra/lib/empty/index.js"), ...__webpack_require__(/*! ./ensure */ "./node_modules/fs-extra/lib/ensure/index.js"), ...__webpack_require__(/*! ./json */ "./node_modules/fs-extra/lib/json/index.js"), ...__webpack_require__(/*! ./mkdirs */ "./node_modules/fs-extra/lib/mkdirs/index.js"), ...__webpack_require__(/*! ./move */ "./node_modules/fs-extra/lib/move/index.js"), ...__webpack_require__(/*! ./output-file */ "./node_modules/fs-extra/lib/output-file/index.js"), ...__webpack_require__(/*! ./path-exists */ "./node_modules/fs-extra/lib/path-exists/index.js"), ...__webpack_require__(/*! ./remove */ "./node_modules/fs-extra/lib/remove/index.js") } /***/ }), /***/ "./node_modules/fs-extra/lib/json/index.js": /*!*************************************************!*\ !*** ./node_modules/fs-extra/lib/json/index.js ***! \*************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const u = (__webpack_require__(/*! universalify */ "./node_modules/universalify/index.js").fromPromise) const jsonFile = __webpack_require__(/*! ./jsonfile */ "./node_modules/fs-extra/lib/json/jsonfile.js") jsonFile.outputJson = u(__webpack_require__(/*! ./output-json */ "./node_modules/fs-extra/lib/json/output-json.js")) jsonFile.outputJsonSync = __webpack_require__(/*! ./output-json-sync */ "./node_modules/fs-extra/lib/json/output-json-sync.js") // aliases jsonFile.outputJSON = jsonFile.outputJson jsonFile.outputJSONSync = jsonFile.outputJsonSync jsonFile.writeJSON = jsonFile.writeJson jsonFile.writeJSONSync = jsonFile.writeJsonSync jsonFile.readJSON = jsonFile.readJson jsonFile.readJSONSync = jsonFile.readJsonSync module.exports = jsonFile /***/ }), /***/ "./node_modules/fs-extra/lib/json/jsonfile.js": /*!****************************************************!*\ !*** ./node_modules/fs-extra/lib/json/jsonfile.js ***! \****************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const jsonFile = __webpack_require__(/*! jsonfile */ "./node_modules/jsonfile/index.js") module.exports = { // jsonfile exports readJson: jsonFile.readFile, readJsonSync: jsonFile.readFileSync, writeJson: jsonFile.writeFile, writeJsonSync: jsonFile.writeFileSync } /***/ }), /***/ "./node_modules/fs-extra/lib/json/output-json-sync.js": /*!************************************************************!*\ !*** ./node_modules/fs-extra/lib/json/output-json-sync.js ***! \************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const { stringify } = __webpack_require__(/*! jsonfile/utils */ "./node_modules/jsonfile/utils.js") const { outputFileSync } = __webpack_require__(/*! ../output-file */ "./node_modules/fs-extra/lib/output-file/index.js") function outputJsonSync (file, data, options) { const str = stringify(data, options) outputFileSync(file, str, options) } module.exports = outputJsonSync /***/ }), /***/ "./node_modules/fs-extra/lib/json/output-json.js": /*!*******************************************************!*\ !*** ./node_modules/fs-extra/lib/json/output-json.js ***! \*******************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const { stringify } = __webpack_require__(/*! jsonfile/utils */ "./node_modules/jsonfile/utils.js") const { outputFile } = __webpack_require__(/*! ../output-file */ "./node_modules/fs-extra/lib/output-file/index.js") async function outputJson (file, data, options = {}) { const str = stringify(data, options) await outputFile(file, str, options) } module.exports = outputJson /***/ }), /***/ "./node_modules/fs-extra/lib/mkdirs/index.js": /*!***************************************************!*\ !*** ./node_modules/fs-extra/lib/mkdirs/index.js ***! \***************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const u = (__webpack_require__(/*! universalify */ "./node_modules/universalify/index.js").fromPromise) const { makeDir: _makeDir, makeDirSync } = __webpack_require__(/*! ./make-dir */ "./node_modules/fs-extra/lib/mkdirs/make-dir.js") const makeDir = u(_makeDir) module.exports = { mkdirs: makeDir, mkdirsSync: makeDirSync, // alias mkdirp: makeDir, mkdirpSync: makeDirSync, ensureDir: makeDir, ensureDirSync: makeDirSync } /***/ }), /***/ "./node_modules/fs-extra/lib/mkdirs/make-dir.js": /*!******************************************************!*\ !*** ./node_modules/fs-extra/lib/mkdirs/make-dir.js ***! \******************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const fs = __webpack_require__(/*! ../fs */ "./node_modules/fs-extra/lib/fs/index.js") const { checkPath } = __webpack_require__(/*! ./utils */ "./node_modules/fs-extra/lib/mkdirs/utils.js") const getMode = options => { const defaults = { mode: 0o777 } if (typeof options === 'number') return options return ({ ...defaults, ...options }).mode } module.exports.makeDir = async (dir, options) => { checkPath(dir) return fs.mkdir(dir, { mode: getMode(options), recursive: true }) } module.exports.makeDirSync = (dir, options) => { checkPath(dir) return fs.mkdirSync(dir, { mode: getMode(options), recursive: true }) } /***/ }), /***/ "./node_modules/fs-extra/lib/mkdirs/utils.js": /*!***************************************************!*\ !*** ./node_modules/fs-extra/lib/mkdirs/utils.js ***! \***************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // Adapted from https://github.com/sindresorhus/make-dir // Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com) // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. const path = __webpack_require__(/*! path */ "path") // https://github.com/nodejs/node/issues/8987 // https://github.com/libuv/libuv/pull/1088 module.exports.checkPath = function checkPath (pth) { if (process.platform === 'win32') { const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, '')) if (pathHasInvalidWinCharacters) { const error = new Error(`Path contains invalid characters: ${pth}`) error.code = 'EINVAL' throw error } } } /***/ }), /***/ "./node_modules/fs-extra/lib/move/index.js": /*!*************************************************!*\ !*** ./node_modules/fs-extra/lib/move/index.js ***! \*************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const u = (__webpack_require__(/*! universalify */ "./node_modules/universalify/index.js").fromCallback) module.exports = { move: u(__webpack_require__(/*! ./move */ "./node_modules/fs-extra/lib/move/move.js")), moveSync: __webpack_require__(/*! ./move-sync */ "./node_modules/fs-extra/lib/move/move-sync.js") } /***/ }), /***/ "./node_modules/fs-extra/lib/move/move-sync.js": /*!*****************************************************!*\ !*** ./node_modules/fs-extra/lib/move/move-sync.js ***! \*****************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const fs = __webpack_require__(/*! graceful-fs */ "./node_modules/graceful-fs/graceful-fs.js") const path = __webpack_require__(/*! path */ "path") const copySync = (__webpack_require__(/*! ../copy */ "./node_modules/fs-extra/lib/copy/index.js").copySync) const removeSync = (__webpack_require__(/*! ../remove */ "./node_modules/fs-extra/lib/remove/index.js").removeSync) const mkdirpSync = (__webpack_require__(/*! ../mkdirs */ "./node_modules/fs-extra/lib/mkdirs/index.js").mkdirpSync) const stat = __webpack_require__(/*! ../util/stat */ "./node_modules/fs-extra/lib/util/stat.js") function moveSync (src, dest, opts) { opts = opts || {} const overwrite = opts.overwrite || opts.clobber || false const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, 'move', opts) stat.checkParentPathsSync(src, srcStat, dest, 'move') if (!isParentRoot(dest)) mkdirpSync(path.dirname(dest)) return doRename(src, dest, overwrite, isChangingCase) } function isParentRoot (dest) { const parent = path.dirname(dest) const parsedPath = path.parse(parent) return parsedPath.root === parent } function doRename (src, dest, overwrite, isChangingCase) { if (isChangingCase) return rename(src, dest, overwrite) if (overwrite) { removeSync(dest) return rename(src, dest, overwrite) } if (fs.existsSync(dest)) throw new Error('dest already exists.') return rename(src, dest, overwrite) } function rename (src, dest, overwrite) { try { fs.renameSync(src, dest) } catch (err) { if (err.code !== 'EXDEV') throw err return moveAcrossDevice(src, dest, overwrite) } } function moveAcrossDevice (src, dest, overwrite) { const opts = { overwrite, errorOnExist: true } copySync(src, dest, opts) return removeSync(src) } module.exports = moveSync /***/ }), /***/ "./node_modules/fs-extra/lib/move/move.js": /*!************************************************!*\ !*** ./node_modules/fs-extra/lib/move/move.js ***! \************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const fs = __webpack_require__(/*! graceful-fs */ "./node_modules/graceful-fs/graceful-fs.js") const path = __webpack_require__(/*! path */ "path") const copy = (__webpack_require__(/*! ../copy */ "./node_modules/fs-extra/lib/copy/index.js").copy) const remove = (__webpack_require__(/*! ../remove */ "./node_modules/fs-extra/lib/remove/index.js").remove) const mkdirp = (__webpack_require__(/*! ../mkdirs */ "./node_modules/fs-extra/lib/mkdirs/index.js").mkdirp) const pathExists = (__webpack_require__(/*! ../path-exists */ "./node_modules/fs-extra/lib/path-exists/index.js").pathExists) const stat = __webpack_require__(/*! ../util/stat */ "./node_modules/fs-extra/lib/util/stat.js") function move (src, dest, opts, cb) { if (typeof opts === 'function') { cb = opts opts = {} } opts = opts || {} const overwrite = opts.overwrite || opts.clobber || false stat.checkPaths(src, dest, 'move', opts, (err, stats) => { if (err) return cb(err) const { srcStat, isChangingCase = false } = stats stat.checkParentPaths(src, srcStat, dest, 'move', err => { if (err) return cb(err) if (isParentRoot(dest)) return doRename(src, dest, overwrite, isChangingCase, cb) mkdirp(path.dirname(dest), err => { if (err) return cb(err) return doRename(src, dest, overwrite, isChangingCase, cb) }) }) }) } function isParentRoot (dest) { const parent = path.dirname(dest) const parsedPath = path.parse(parent) return parsedPath.root === parent } function doRename (src, dest, overwrite, isChangingCase, cb) { if (isChangingCase) return rename(src, dest, overwrite, cb) if (overwrite) { return remove(dest, err => { if (err) return cb(err) return rename(src, dest, overwrite, cb) }) } pathExists(dest, (err, destExists) => { if (err) return cb(err) if (destExists) return cb(new Error('dest already exists.')) return rename(src, dest, overwrite, cb) }) } function rename (src, dest, overwrite, cb) { fs.rename(src, dest, err => { if (!err) return cb() if (err.code !== 'EXDEV') return cb(err) return moveAcrossDevice(src, dest, overwrite, cb) }) } function moveAcrossDevice (src, dest, overwrite, cb) { const opts = { overwrite, errorOnExist: true } copy(src, dest, opts, err => { if (err) return cb(err) return remove(src, cb) }) } module.exports = move /***/ }), /***/ "./node_modules/fs-extra/lib/output-file/index.js": /*!********************************************************!*\ !*** ./node_modules/fs-extra/lib/output-file/index.js ***! \********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const u = (__webpack_require__(/*! universalify */ "./node_modules/universalify/index.js").fromCallback) const fs = __webpack_require__(/*! graceful-fs */ "./node_modules/graceful-fs/graceful-fs.js") const path = __webpack_require__(/*! path */ "path") const mkdir = __webpack_require__(/*! ../mkdirs */ "./node_modules/fs-extra/lib/mkdirs/index.js") const pathExists = (__webpack_require__(/*! ../path-exists */ "./node_modules/fs-extra/lib/path-exists/index.js").pathExists) function outputFile (file, data, encoding, callback) { if (typeof encoding === 'function') { callback = encoding encoding = 'utf8' } const dir = path.dirname(file) pathExists(dir, (err, itDoes) => { if (err) return callback(err) if (itDoes) return fs.writeFile(file, data, encoding, callback) mkdir.mkdirs(dir, err => { if (err) return callback(err) fs.writeFile(file, data, encoding, callback) }) }) } function outputFileSync (file, ...args) { const dir = path.dirname(file) if (fs.existsSync(dir)) { return fs.writeFileSync(file, ...args) } mkdir.mkdirsSync(dir) fs.writeFileSync(file, ...args) } module.exports = { outputFile: u(outputFile), outputFileSync } /***/ }), /***/ "./node_modules/fs-extra/lib/path-exists/index.js": /*!********************************************************!*\ !*** ./node_modules/fs-extra/lib/path-exists/index.js ***! \********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const u = (__webpack_require__(/*! universalify */ "./node_modules/universalify/index.js").fromPromise) const fs = __webpack_require__(/*! ../fs */ "./node_modules/fs-extra/lib/fs/index.js") function pathExists (path) { return fs.access(path).then(() => true).catch(() => false) } module.exports = { pathExists: u(pathExists), pathExistsSync: fs.existsSync } /***/ }), /***/ "./node_modules/fs-extra/lib/remove/index.js": /*!***************************************************!*\ !*** ./node_modules/fs-extra/lib/remove/index.js ***! \***************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const fs = __webpack_require__(/*! graceful-fs */ "./node_modules/graceful-fs/graceful-fs.js") const u = (__webpack_require__(/*! universalify */ "./node_modules/universalify/index.js").fromCallback) const rimraf = __webpack_require__(/*! ./rimraf */ "./node_modules/fs-extra/lib/remove/rimraf.js") function remove (path, callback) { // Node 14.14.0+ if (fs.rm) return fs.rm(path, { recursive: true, force: true }, callback) rimraf(path, callback) } function removeSync (path) { // Node 14.14.0+ if (fs.rmSync) return fs.rmSync(path, { recursive: true, force: true }) rimraf.sync(path) } module.exports = { remove: u(remove), removeSync } /***/ }), /***/ "./node_modules/fs-extra/lib/remove/rimraf.js": /*!****************************************************!*\ !*** ./node_modules/fs-extra/lib/remove/rimraf.js ***! \****************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const fs = __webpack_require__(/*! graceful-fs */ "./node_modules/graceful-fs/graceful-fs.js") const path = __webpack_require__(/*! path */ "path") const assert = __webpack_require__(/*! assert */ "assert") const isWindows = (process.platform === 'win32') function defaults (options) { const methods = [ 'unlink', 'chmod', 'stat', 'lstat', 'rmdir', 'readdir' ] methods.forEach(m => { options[m] = options[m] || fs[m] m = m + 'Sync' options[m] = options[m] || fs[m] }) options.maxBusyTries = options.maxBusyTries || 3 } function rimraf (p, options, cb) { let busyTries = 0 if (typeof options === 'function') { cb = options options = {} } assert(p, 'rimraf: missing path') assert.strictEqual(typeof p, 'string', 'rimraf: path should be a string') assert.strictEqual(typeof cb, 'function', 'rimraf: callback function required') assert(options, 'rimraf: invalid options argument provided') assert.strictEqual(typeof options, 'object', 'rimraf: options should be object') defaults(options) rimraf_(p, options, function CB (er) { if (er) { if ((er.code === 'EBUSY' || er.code === 'ENOTEMPTY' || er.code === 'EPERM') && busyTries < options.maxBusyTries) { busyTries++ const time = busyTries * 100 // try again, with the same exact callback as this one. return setTimeout(() => rimraf_(p, options, CB), time) } // already gone if (er.code === 'ENOENT') er = null } cb(er) }) } // Two possible strategies. // 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR // 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR // // Both result in an extra syscall when you guess wrong. However, there // are likely far more normal files in the world than directories. This // is based on the assumption that a the average number of files per // directory is >= 1. // // If anyone ever complains about this, then I guess the strategy could // be made configurable somehow. But until then, YAGNI. function rimraf_ (p, options, cb) { assert(p) assert(options) assert(typeof cb === 'function') // sunos lets the root user unlink directories, which is... weird. // so we have to lstat here and make sure it's not a dir. options.lstat(p, (er, st) => { if (er && er.code === 'ENOENT') { return cb(null) } // Windows can EPERM on stat. Life is suffering. if (er && er.code === 'EPERM' && isWindows) { return fixWinEPERM(p, options, er, cb) } if (st && st.isDirectory()) { return rmdir(p, options, er, cb) } options.unlink(p, er => { if (er) { if (er.code === 'ENOENT') { return cb(null) } if (er.code === 'EPERM') { return (isWindows) ? fixWinEPERM(p, options, er, cb) : rmdir(p, options, er, cb) } if (er.code === 'EISDIR') { return rmdir(p, options, er, cb) } } return cb(er) }) }) } function fixWinEPERM (p, options, er, cb) { assert(p) assert(options) assert(typeof cb === 'function') options.chmod(p, 0o666, er2 => { if (er2) { cb(er2.code === 'ENOENT' ? null : er) } else { options.stat(p, (er3, stats) => { if (er3) { cb(er3.code === 'ENOENT' ? null : er) } else if (stats.isDirectory()) { rmdir(p, options, er, cb) } else { options.unlink(p, cb) } }) } }) } function fixWinEPERMSync (p, options, er) { let stats assert(p) assert(options) try { options.chmodSync(p, 0o666) } catch (er2) { if (er2.code === 'ENOENT') { return } else { throw er } } try { stats = options.statSync(p) } catch (er3) { if (er3.code === 'ENOENT') { return } else { throw er } } if (stats.isDirectory()) { rmdirSync(p, options, er) } else { options.unlinkSync(p) } } function rmdir (p, options, originalEr, cb) { assert(p) assert(options) assert(typeof cb === 'function') // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) // if we guessed wrong, and it's not a directory, then // raise the original error. options.rmdir(p, er => { if (er && (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM')) { rmkids(p, options, cb) } else if (er && er.code === 'ENOTDIR') { cb(originalEr) } else { cb(er) } }) } function rmkids (p, options, cb) { assert(p) assert(options) assert(typeof cb === 'function') options.readdir(p, (er, files) => { if (er) return cb(er) let n = files.length let errState if (n === 0) return options.rmdir(p, cb) files.forEach(f => { rimraf(path.join(p, f), options, er => { if (errState) { return } if (er) return cb(errState = er) if (--n === 0) { options.rmdir(p, cb) } }) }) }) } // this looks simpler, and is strictly *faster*, but will // tie up the JavaScript thread and fail on excessively // deep directory trees. function rimrafSync (p, options) { let st options = options || {} defaults(options) assert(p, 'rimraf: missing path') assert.strictEqual(typeof p, 'string', 'rimraf: path should be a string') assert(options, 'rimraf: missing options') assert.strictEqual(typeof options, 'object', 'rimraf: options should be object') try { st = options.lstatSync(p) } catch (er) { if (er.code === 'ENOENT') { return } // Windows can EPERM on stat. Life is suffering. if (er.code === 'EPERM' && isWindows) { fixWinEPERMSync(p, options, er) } } try { // sunos lets the root user unlink directories, which is... weird. if (st && st.isDirectory()) { rmdirSync(p, options, null) } else { options.unlinkSync(p) } } catch (er) { if (er.code === 'ENOENT') { return } else if (er.code === 'EPERM') { return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er) } else if (er.code !== 'EISDIR') { throw er } rmdirSync(p, options, er) } } function rmdirSync (p, options, originalEr) { assert(p) assert(options) try { options.rmdirSync(p) } catch (er) { if (er.code === 'ENOTDIR') { throw originalEr } else if (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM') { rmkidsSync(p, options) } else if (er.code !== 'ENOENT') { throw er } } } function rmkidsSync (p, options) { assert(p) assert(options) options.readdirSync(p).forEach(f => rimrafSync(path.join(p, f), options)) if (isWindows) { // We only end up here once we got ENOTEMPTY at least once, and // at this point, we are guaranteed to have removed all the kids. // So, we know that it won't be ENOENT or ENOTDIR or anything else. // try really hard to delete stuff on windows, because it has a // PROFOUNDLY annoying habit of not closing handles promptly when // files are deleted, resulting in spurious ENOTEMPTY errors. const startTime = Date.now() do { try { const ret = options.rmdirSync(p, options) return ret } catch {} } while (Date.now() - startTime < 500) // give up after 500ms } else { const ret = options.rmdirSync(p, options) return ret } } module.exports = rimraf rimraf.sync = rimrafSync /***/ }), /***/ "./node_modules/fs-extra/lib/util/stat.js": /*!************************************************!*\ !*** ./node_modules/fs-extra/lib/util/stat.js ***! \************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const fs = __webpack_require__(/*! ../fs */ "./node_modules/fs-extra/lib/fs/index.js") const path = __webpack_require__(/*! path */ "path") const util = __webpack_require__(/*! util */ "util") function getStats (src, dest, opts) { const statFunc = opts.dereference ? (file) => fs.stat(file, { bigint: true }) : (file) => fs.lstat(file, { bigint: true }) return Promise.all([ statFunc(src), statFunc(dest).catch(err => { if (err.code === 'ENOENT') return null throw err }) ]).then(([srcStat, destStat]) => ({ srcStat, destStat })) } function getStatsSync (src, dest, opts) { let destStat const statFunc = opts.dereference ? (file) => fs.statSync(file, { bigint: true }) : (file) => fs.lstatSync(file, { bigint: true }) const srcStat = statFunc(src) try { destStat = statFunc(dest) } catch (err) { if (err.code === 'ENOENT') return { srcStat, destStat: null } throw err } return { srcStat, destStat } } function checkPaths (src, dest, funcName, opts, cb) { util.callbackify(getStats)(src, dest, opts, (err, stats) => { if (err) return cb(err) const { srcStat, destStat } = stats if (destStat) { if (areIdentical(srcStat, destStat)) { const srcBaseName = path.basename(src) const destBaseName = path.basename(dest) if (funcName === 'move' && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) { return cb(null, { srcStat, destStat, isChangingCase: true }) } return cb(new Error('Source and destination must not be the same.')) } if (srcStat.isDirectory() && !destStat.isDirectory()) { return cb(new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`)) } if (!srcStat.isDirectory() && destStat.isDirectory()) { return cb(new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`)) } } if (srcStat.isDirectory() && isSrcSubdir(src, dest)) { return cb(new Error(errMsg(src, dest, funcName))) } return cb(null, { srcStat, destStat }) }) } function checkPathsSync (src, dest, funcName, opts) { const { srcStat, destStat } = getStatsSync(src, dest, opts) if (destStat) { if (areIdentical(srcStat, destStat)) { const srcBaseName = path.basename(src) const destBaseName = path.basename(dest) if (funcName === 'move' && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) { return { srcStat, destStat, isChangingCase: true } } throw new Error('Source and destination must not be the same.') } if (srcStat.isDirectory() && !destStat.isDirectory()) { throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`) } if (!srcStat.isDirectory() && destStat.isDirectory()) { throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`) } } if (srcStat.isDirectory() && isSrcSubdir(src, dest)) { throw new Error(errMsg(src, dest, funcName)) } return { srcStat, destStat } } // recursively check if dest parent is a subdirectory of src. // It works for all file types including symlinks since it // checks the src and dest inodes. It starts from the deepest // parent and stops once it reaches the src parent or the root path. function checkParentPaths (src, srcStat, dest, funcName, cb) { const srcParent = path.resolve(path.dirname(src)) const destParent = path.resolve(path.dirname(dest)) if (destParent === srcParent || destParent === path.parse(destParent).root) return cb() fs.stat(destParent, { bigint: true }, (err, destStat) => { if (err) { if (err.code === 'ENOENT') return cb() return cb(err) } if (areIdentical(srcStat, destStat)) { return cb(new Error(errMsg(src, dest, funcName))) } return checkParentPaths(src, srcStat, destParent, funcName, cb) }) } function checkParentPathsSync (src, srcStat, dest, funcName) { const srcParent = path.resolve(path.dirname(src)) const destParent = path.resolve(path.dirname(dest)) if (destParent === srcParent || destParent === path.parse(destParent).root) return let destStat try { destStat = fs.statSync(destParent, { bigint: true }) } catch (err) { if (err.code === 'ENOENT') return throw err } if (areIdentical(srcStat, destStat)) { throw new Error(errMsg(src, dest, funcName)) } return checkParentPathsSync(src, srcStat, destParent, funcName) } function areIdentical (srcStat, destStat) { return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev } // return true if dest is a subdir of src, otherwise false. // It only checks the path strings. function isSrcSubdir (src, dest) { const srcArr = path.resolve(src).split(path.sep).filter(i => i) const destArr = path.resolve(dest).split(path.sep).filter(i => i) return srcArr.reduce((acc, cur, i) => acc && destArr[i] === cur, true) } function errMsg (src, dest, funcName) { return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.` } module.exports = { checkPaths, checkPathsSync, checkParentPaths, checkParentPathsSync, isSrcSubdir, areIdentical } /***/ }), /***/ "./node_modules/fs-extra/lib/util/utimes.js": /*!**************************************************!*\ !*** ./node_modules/fs-extra/lib/util/utimes.js ***! \**************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const fs = __webpack_require__(/*! graceful-fs */ "./node_modules/graceful-fs/graceful-fs.js") function utimesMillis (path, atime, mtime, callback) { // if (!HAS_MILLIS_RES) return fs.utimes(path, atime, mtime, callback) fs.open(path, 'r+', (err, fd) => { if (err) return callback(err) fs.futimes(fd, atime, mtime, futimesErr => { fs.close(fd, closeErr => { if (callback) callback(futimesErr || closeErr) }) }) }) } function utimesMillisSync (path, atime, mtime) { const fd = fs.openSync(path, 'r+') fs.futimesSync(fd, atime, mtime) return fs.closeSync(fd) } module.exports = { utimesMillis, utimesMillisSync } /***/ }), /***/ "./node_modules/gettext-parser/index.js": /*!**********************************************!*\ !*** ./node_modules/gettext-parser/index.js ***! \**********************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { parse, stream } = __webpack_require__(/*! ./lib/poparser */ "./node_modules/gettext-parser/lib/poparser.js"); module.exports.po = { parse, createParseStream: stream, compile: __webpack_require__(/*! ./lib/pocompiler */ "./node_modules/gettext-parser/lib/pocompiler.js") }; module.exports.mo = { parse: __webpack_require__(/*! ./lib/moparser */ "./node_modules/gettext-parser/lib/moparser.js"), compile: __webpack_require__(/*! ./lib/mocompiler */ "./node_modules/gettext-parser/lib/mocompiler.js") }; /***/ }), /***/ "./node_modules/gettext-parser/lib/mocompiler.js": /*!*******************************************************!*\ !*** ./node_modules/gettext-parser/lib/mocompiler.js ***! \*******************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { Buffer } = __webpack_require__(/*! safe-buffer */ "./node_modules/safe-buffer/index.js"); const encoding = __webpack_require__(/*! encoding */ "./node_modules/encoding/lib/encoding.js"); const sharedFuncs = __webpack_require__(/*! ./shared */ "./node_modules/gettext-parser/lib/shared.js"); const contentType = __webpack_require__(/*! content-type */ "./node_modules/content-type/index.js"); /** * Exposes general compiler function. Takes a translation * object as a parameter and returns binary MO object * * @param {Object} table Translation object * @return {Buffer} Compiled binary MO object */ module.exports = function (table) { const compiler = new Compiler(table); return compiler.compile(); }; /** * Creates a MO compiler object. * * @constructor * @param {Object} table Translation table as defined in the README */ function Compiler (table = {}) { this._table = table; let { headers = {}, translations = {} } = this._table; headers = Object.keys(headers).reduce((result, key) => { const lowerKey = key.toLowerCase(); if (sharedFuncs.HEADERS.has(lowerKey)) { // POT-Creation-Date is removed in MO (see https://savannah.gnu.org/bugs/?49654) if (lowerKey !== 'pot-creation-date') { result[sharedFuncs.HEADERS.get(lowerKey)] = headers[key]; } } else { result[key] = headers[key]; } return result; }, {}); // filter out empty translations translations = Object.keys(translations).reduce((result, msgctxt) => { const context = translations[msgctxt]; const msgs = Object.keys(context).reduce((result, msgid) => { const hasTranslation = context[msgid].msgstr.some(item => !!item.length); if (hasTranslation) { result[msgid] = context[msgid]; } return result; }, {}); if (Object.keys(msgs).length) { result[msgctxt] = msgs; } return result; }, {}); this._table.translations = translations; this._table.headers = headers; this._translations = []; this._writeFunc = 'writeUInt32LE'; this._handleCharset(); } /** * Magic bytes for the generated binary data */ Compiler.prototype.MAGIC = 0x950412de; /** * Handles header values, replaces or adds (if needed) a charset property */ Compiler.prototype._handleCharset = function () { const ct = contentType.parse(this._table.headers['Content-Type'] || 'text/plain'); const charset = sharedFuncs.formatCharset(this._table.charset || ct.parameters.charset || 'utf-8'); // clean up content-type charset independently using fallback if missing if (ct.parameters.charset) { ct.parameters.charset = sharedFuncs.formatCharset(ct.parameters.charset); } this._table.charset = charset; this._table.headers['Content-Type'] = contentType.format(ct); }; /** * Generates an array of translation strings * in the form of [{msgid:... , msgstr:...}] * * @return {Array} Translation strings array */ Compiler.prototype._generateList = function () { const list = []; list.push({ msgid: Buffer.alloc(0), msgstr: encoding.convert(sharedFuncs.generateHeader(this._table.headers), this._table.charset) }); Object.keys(this._table.translations).forEach(msgctxt => { if (typeof this._table.translations[msgctxt] !== 'object') { return; } Object.keys(this._table.translations[msgctxt]).forEach(msgid => { if (typeof this._table.translations[msgctxt][msgid] !== 'object') { return; } if (msgctxt === '' && msgid === '') { return; } const msgidPlural = this._table.translations[msgctxt][msgid].msgid_plural; let key = msgid; if (msgctxt) { key = msgctxt + '\u0004' + key; } if (msgidPlural) { key += '\u0000' + msgidPlural; } const value = [].concat(this._table.translations[msgctxt][msgid].msgstr || []).join('\u0000'); list.push({ msgid: encoding.convert(key, this._table.charset), msgstr: encoding.convert(value, this._table.charset) }); }); }); return list; }; /** * Calculate buffer size for the final binary object * * @param {Array} list An array of translation strings from _generateList * @return {Object} Size data of {msgid, msgstr, total} */ Compiler.prototype._calculateSize = function (list) { let msgidLength = 0; let msgstrLength = 0; let totalLength = 0; list.forEach(translation => { msgidLength += translation.msgid.length + 1; // + extra 0x00 msgstrLength += translation.msgstr.length + 1; // + extra 0x00 }); totalLength = 4 + // magic number 4 + // revision 4 + // string count 4 + // original string table offset 4 + // translation string table offset 4 + // hash table size 4 + // hash table offset (4 + 4) * list.length + // original string table (4 + 4) * list.length + // translations string table msgidLength + // originals msgstrLength; // translations return { msgid: msgidLength, msgstr: msgstrLength, total: totalLength }; }; /** * Generates the binary MO object from the translation list * * @param {Array} list translation list * @param {Object} size Byte size information * @return {Buffer} Compiled MO object */ Compiler.prototype._build = function (list, size) { const returnBuffer = Buffer.alloc(size.total); let curPosition = 0; let i; let len; // magic returnBuffer[this._writeFunc](this.MAGIC, 0); // revision returnBuffer[this._writeFunc](0, 4); // string count returnBuffer[this._writeFunc](list.length, 8); // original string table offset returnBuffer[this._writeFunc](28, 12); // translation string table offset returnBuffer[this._writeFunc](28 + (4 + 4) * list.length, 16); // hash table size returnBuffer[this._writeFunc](0, 20); // hash table offset returnBuffer[this._writeFunc](28 + (4 + 4) * list.length * 2, 24); // build originals table curPosition = 28 + 2 * (4 + 4) * list.length; for (i = 0, len = list.length; i < len; i++) { list[i].msgid.copy(returnBuffer, curPosition); returnBuffer[this._writeFunc](list[i].msgid.length, 28 + i * 8); returnBuffer[this._writeFunc](curPosition, 28 + i * 8 + 4); returnBuffer[curPosition + list[i].msgid.length] = 0x00; curPosition += list[i].msgid.length + 1; } // build translations table for (i = 0, len = list.length; i < len; i++) { list[i].msgstr.copy(returnBuffer, curPosition); returnBuffer[this._writeFunc](list[i].msgstr.length, 28 + (4 + 4) * list.length + i * 8); returnBuffer[this._writeFunc](curPosition, 28 + (4 + 4) * list.length + i * 8 + 4); returnBuffer[curPosition + list[i].msgstr.length] = 0x00; curPosition += list[i].msgstr.length + 1; } return returnBuffer; }; /** * Compiles translation object into a binary MO object * * @return {Buffer} Compiled MO object */ Compiler.prototype.compile = function () { const list = this._generateList(); const size = this._calculateSize(list); list.sort(sharedFuncs.compareMsgid); return this._build(list, size); }; /***/ }), /***/ "./node_modules/gettext-parser/lib/moparser.js": /*!*****************************************************!*\ !*** ./node_modules/gettext-parser/lib/moparser.js ***! \*****************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const encoding = __webpack_require__(/*! encoding */ "./node_modules/encoding/lib/encoding.js"); const sharedFuncs = __webpack_require__(/*! ./shared */ "./node_modules/gettext-parser/lib/shared.js"); /** * Parses a binary MO object into translation table * * @param {Buffer} buffer Binary MO object * @param {String} [defaultCharset] Default charset to use * @return {Object} Translation object */ module.exports = function (buffer, defaultCharset) { const parser = new Parser(buffer, defaultCharset); return parser.parse(); }; /** * Creates a MO parser object. * * @constructor * @param {Buffer} fileContents Binary MO object * @param {String} [defaultCharset] Default charset to use */ function Parser (fileContents, defaultCharset = 'iso-8859-1') { this._fileContents = fileContents; /** * Method name for writing int32 values, default littleendian */ this._writeFunc = 'writeUInt32LE'; /** * Method name for reading int32 values, default littleendian */ this._readFunc = 'readUInt32LE'; this._charset = defaultCharset; this._table = { charset: this._charset, headers: undefined, translations: {} }; } /** * Magic constant to check the endianness of the input file */ Parser.prototype.MAGIC = 0x950412de; /** * Checks if number values in the input file are in big- or littleendian format. * * @return {Boolean} Return true if magic was detected */ Parser.prototype._checkMagick = function () { if (this._fileContents.readUInt32LE(0) === this.MAGIC) { this._readFunc = 'readUInt32LE'; this._writeFunc = 'writeUInt32LE'; return true; } else if (this._fileContents.readUInt32BE(0) === this.MAGIC) { this._readFunc = 'readUInt32BE'; this._writeFunc = 'writeUInt32BE'; return true; } return false; }; /** * Read the original strings and translations from the input MO file. Use the * first translation string in the file as the header. */ Parser.prototype._loadTranslationTable = function () { let offsetOriginals = this._offsetOriginals; let offsetTranslations = this._offsetTranslations; let position; let length; let msgid; let msgstr; for (let i = 0; i < this._total; i++) { // msgid string length = this._fileContents[this._readFunc](offsetOriginals); offsetOriginals += 4; position = this._fileContents[this._readFunc](offsetOriginals); offsetOriginals += 4; msgid = this._fileContents.slice(position, position + length); // matching msgstr length = this._fileContents[this._readFunc](offsetTranslations); offsetTranslations += 4; position = this._fileContents[this._readFunc](offsetTranslations); offsetTranslations += 4; msgstr = this._fileContents.slice(position, position + length); if (!i && !msgid.toString()) { this._handleCharset(msgstr); } msgid = encoding.convert(msgid, 'utf-8', this._charset) .toString('utf8'); msgstr = encoding.convert(msgstr, 'utf-8', this._charset) .toString('utf8'); this._addString(msgid, msgstr); } // dump the file contents object this._fileContents = null; }; /** * Detects charset for MO strings from the header * * @param {Buffer} headers Header value */ Parser.prototype._handleCharset = function (headers) { const headersStr = headers.toString(); let match; if ((match = headersStr.match(/[; ]charset\s*=\s*([\w-]+)/i))) { this._charset = this._table.charset = sharedFuncs.formatCharset(match[1], this._charset); } headers = encoding.convert(headers, 'utf-8', this._charset) .toString('utf8'); this._table.headers = sharedFuncs.parseHeader(headers); }; /** * Adds a translation to the translation object * * @param {String} msgid Original string * @params {String} msgstr Translation for the original string */ Parser.prototype._addString = function (msgid, msgstr) { const translation = {}; let msgctxt; let msgidPlural; msgid = msgid.split('\u0004'); if (msgid.length > 1) { msgctxt = msgid.shift(); translation.msgctxt = msgctxt; } else { msgctxt = ''; } msgid = msgid.join('\u0004'); const parts = msgid.split('\u0000'); msgid = parts.shift(); translation.msgid = msgid; if ((msgidPlural = parts.join('\u0000'))) { translation.msgid_plural = msgidPlural; } msgstr = msgstr.split('\u0000'); translation.msgstr = [].concat(msgstr || []); if (!this._table.translations[msgctxt]) { this._table.translations[msgctxt] = {}; } this._table.translations[msgctxt][msgid] = translation; }; /** * Parses the MO object and returns translation table * * @return {Object} Translation table */ Parser.prototype.parse = function () { if (!this._checkMagick()) { return false; } /** * GetText revision nr, usually 0 */ this._revision = this._fileContents[this._readFunc](4); /** * Total count of translated strings */ this._total = this._fileContents[this._readFunc](8); /** * Offset position for original strings table */ this._offsetOriginals = this._fileContents[this._readFunc](12); /** * Offset position for translation strings table */ this._offsetTranslations = this._fileContents[this._readFunc](16); // Load translations into this._translationTable this._loadTranslationTable(); return this._table; }; /***/ }), /***/ "./node_modules/gettext-parser/lib/pocompiler.js": /*!*******************************************************!*\ !*** ./node_modules/gettext-parser/lib/pocompiler.js ***! \*******************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const { Buffer } = __webpack_require__(/*! safe-buffer */ "./node_modules/safe-buffer/index.js"); const encoding = __webpack_require__(/*! encoding */ "./node_modules/encoding/lib/encoding.js"); const sharedFuncs = __webpack_require__(/*! ./shared */ "./node_modules/gettext-parser/lib/shared.js"); const contentType = __webpack_require__(/*! content-type */ "./node_modules/content-type/index.js"); /** * Exposes general compiler function. Takes a translation * object as a parameter and returns PO object * * @param {Object} table Translation object * @return {Buffer} Compiled PO object */ module.exports = function (table, options) { const compiler = new Compiler(table, options); return compiler.compile(); }; /** * Creates a PO compiler object. * * @constructor * @param {Object} table Translation table to be compiled */ function Compiler (table = {}, options = {}) { this._table = table; this._options = options; this._table.translations = this._table.translations || {}; let { headers = {} } = this._table; headers = Object.keys(headers).reduce((result, key) => { const lowerKey = key.toLowerCase(); if (sharedFuncs.HEADERS.has(lowerKey)) { result[sharedFuncs.HEADERS.get(lowerKey)] = headers[key]; } else { result[key] = headers[key]; } return result; }, {}); this._table.headers = headers; if (!('foldLength' in this._options)) { this._options.foldLength = 76; } if (!('escapeCharacters' in this._options)) { this._options.escapeCharacters = true; } if (!('sort' in this._options)) { this._options.sort = false; } if (!('eol' in this._options)) { this._options.eol = '\n'; } this._translations = []; this._handleCharset(); } /** * Converts a comments object to a comment string. The comment object is * in the form of {translator:'', reference: '', extracted: '', flag: '', previous:''} * * @param {Object} comments A comments object * @return {String} A comment string for the PO file */ Compiler.prototype._drawComments = function (comments) { const lines = []; const types = [{ key: 'translator', prefix: '# ' }, { key: 'reference', prefix: '#: ' }, { key: 'extracted', prefix: '#. ' }, { key: 'flag', prefix: '#, ' }, { key: 'previous', prefix: '#| ' }]; types.forEach(type => { if (!comments[type.key]) { return; } comments[type.key].split(/\r?\n|\r/).forEach(line => { lines.push(`${type.prefix}${line}`); }); }); return lines.join(this._options.eol); }; /** * Builds a PO string for a single translation object * * @param {Object} block Translation object * @param {Object} [override] Properties of this object will override `block` properties * @param {boolean} [obsolete] Block is obsolete and must be commented out * @return {String} Translation string for a single object */ Compiler.prototype._drawBlock = function (block, override = {}, obsolete = false) { const response = []; const msgctxt = override.msgctxt || block.msgctxt; const msgid = override.msgid || block.msgid; const msgidPlural = override.msgid_plural || block.msgid_plural; const msgstr = [].concat(override.msgstr || block.msgstr); let comments = override.comments || block.comments; // add comments if (comments && (comments = this._drawComments(comments))) { response.push(comments); } if (msgctxt) { response.push(this._addPOString('msgctxt', msgctxt, obsolete)); } response.push(this._addPOString('msgid', msgid || '', obsolete)); if (msgidPlural) { response.push(this._addPOString('msgid_plural', msgidPlural, obsolete)); msgstr.forEach((msgstr, i) => { response.push(this._addPOString(`msgstr[${i}]`, msgstr || '', obsolete)); }); } else { response.push(this._addPOString('msgstr', msgstr[0] || '', obsolete)); } return response.join(this._options.eol); }; /** * Escapes and joins a key and a value for the PO string * * @param {String} key Key name * @param {String} value Key value * @param {boolean} [obsolete] PO string is obsolete and must be commented out * @return {String} Joined and escaped key-value pair */ Compiler.prototype._addPOString = function (key = '', value = '', obsolete = false) { key = key.toString(); if (obsolete) { key = '#~ ' + key; } let { foldLength, eol, escapeCharacters } = this._options; // escape newlines and quotes if (escapeCharacters) { value = value.toString() .replace(/\\/g, '\\\\') .replace(/"/g, '\\"') .replace(/\t/g, '\\t') .replace(/\r/g, '\\r'); } value = value.replace(/\n/g, '\\n'); // need to escape new line characters regardless let lines = [value]; if (obsolete) { eol = eol + '#~ '; } if (foldLength > 0) { lines = sharedFuncs.foldLine(value, foldLength); } else { // split only on new lines if (escapeCharacters) { lines = value.split(/\\n/g); for (let i = 0; i < lines.length - 1; i++) { lines[i] = `${lines[i]}\\n`; } if (lines.length && lines[lines.length - 1] === '') { lines.splice(-1, 1); } } } if (lines.length < 2) { return `${key} "${lines.shift() || ''}"`; } return `${key} ""${eol}"${lines.join(`"${eol}"`)}"`; }; /** * Handles header values, replaces or adds (if needed) a charset property */ Compiler.prototype._handleCharset = function () { const ct = contentType.parse(this._table.headers['Content-Type'] || 'text/plain'); const charset = sharedFuncs.formatCharset(this._table.charset || ct.parameters.charset || 'utf-8'); // clean up content-type charset independently using fallback if missing if (ct.parameters.charset) { ct.parameters.charset = sharedFuncs.formatCharset(ct.parameters.charset); } this._table.charset = charset; this._table.headers['Content-Type'] = contentType.format(ct); }; /** * Flatten and sort translations object * * @param {Object} section Object to be prepared (translations or obsolete) * @returns {Array} Prepared array */ Compiler.prototype._prepareSection = function (section) { let response = []; Object.keys(section).forEach(msgctxt => { if (typeof section[msgctxt] !== 'object') { return; } Object.keys(section[msgctxt]).forEach(msgid => { if (typeof section[msgctxt][msgid] !== 'object') { return; } if (msgctxt === '' && msgid === '') { return; } response.push(section[msgctxt][msgid]); }); }); const { sort } = this._options; if (sort !== false) { if (typeof sort === 'function') { response = response.sort(sort); } else { response = response.sort(sharedFuncs.compareMsgid); } } return response; }; /** * Compiles translation object into a PO object * * @return {Buffer} Compiled PO object */ Compiler.prototype.compile = function () { const headerBlock = (this._table.translations[''] && this._table.translations['']['']) || {}; let response = []; const translations = this._prepareSection(this._table.translations); response = translations.map(r => this._drawBlock(r)); if (typeof this._table.obsolete === 'object') { const obsolete = this._prepareSection(this._table.obsolete); if (obsolete.length) { response = response.concat(obsolete.map(r => this._drawBlock(r, {}, true))); } } const { eol } = this._options; response.unshift(this._drawBlock(headerBlock, { msgstr: sharedFuncs.generateHeader(this._table.headers) })); if (this._table.charset === 'utf-8' || this._table.charset === 'ascii') { return Buffer.from(response.join(eol + eol), 'utf-8'); } return encoding.convert(response.join(eol + eol), this._table.charset); }; /***/ }), /***/ "./node_modules/gettext-parser/lib/poparser.js": /*!*****************************************************!*\ !*** ./node_modules/gettext-parser/lib/poparser.js ***! \*****************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const encoding = __webpack_require__(/*! encoding */ "./node_modules/encoding/lib/encoding.js"); const sharedFuncs = __webpack_require__(/*! ./shared */ "./node_modules/gettext-parser/lib/shared.js"); const Transform = (__webpack_require__(/*! readable-stream */ "./node_modules/readable-stream/readable-browser.js").Transform); const util = __webpack_require__(/*! util */ "util"); /** * Parses a PO object into translation table * * @param {Buffer|String} buffer PO object * @param {String} [defaultCharset] Default charset to use * @return {Object} Translation object */ module.exports.parse = function (buffer, defaultCharset) { const parser = new Parser(buffer, defaultCharset); return parser.parse(); }; /** * Parses a PO stream, emits translation table in object mode * * @param {String} [defaultCharset] Default charset to use * @param {String} [options] Stream options * @return {Stream} Transform stream */ module.exports.stream = function (defaultCharset, options) { return new PoParserTransform(defaultCharset, options); }; /** * Creates a PO parser object. If PO object is a string, * UTF-8 will be used as the charset * * @constructor * @param {Buffer|String} fileContents PO object * @param {String} [defaultCharset] Default charset to use */ function Parser (fileContents, defaultCharset = 'iso-8859-1') { this._charset = defaultCharset; this._lex = []; this._escaped = false; this._node = {}; this._state = this.states.none; this._lineNumber = 1; if (typeof fileContents === 'string') { this._charset = 'utf-8'; this._fileContents = fileContents; } else { this._fileContents = this._handleCharset(fileContents); } } /** * Parses the PO object and returns translation table * * @return {Object} Translation table */ Parser.prototype.parse = function () { this._lexer(this._fileContents); return this._finalize(this._lex); }; /** * Detects charset for PO strings from the header * * @param {Buffer} headers Header value */ Parser.prototype._handleCharset = function (buf = '') { const str = buf.toString(); let pos; let headers = ''; let match; if ((pos = str.search(/^\s*msgid/im)) >= 0) { pos = pos + str.substr(pos + 5).search(/^\s*(msgid|msgctxt)/im); headers = str.substr(0, pos >= 0 ? pos + 5 : str.length); } if ((match = headers.match(/[; ]charset\s*=\s*([\w-]+)(?:[\s;]|\\n)*"\s*$/mi))) { this._charset = sharedFuncs.formatCharset(match[1], this._charset); } if (this._charset === 'utf-8') { return str; } return this._toString(buf); }; Parser.prototype._toString = function (buf) { return encoding.convert(buf, 'utf-8', this._charset).toString('utf-8'); }; /** * State constants for parsing FSM */ Parser.prototype.states = { none: 0x01, comments: 0x02, key: 0x03, string: 0x04, obsolete: 0x05 }; /** * Value types for lexer */ Parser.prototype.types = { comments: 0x01, key: 0x02, string: 0x03, obsolete: 0x04 }; /** * String matches for lexer */ Parser.prototype.symbols = { quotes: /["']/, comments: /#/, whitespace: /\s/, key: /[\w\-[\]]/, keyNames: /^(?:msgctxt|msgid(?:_plural)?|msgstr(?:\[\d+])?)$/ }; /** * Token parser. Parsed state can be found from this._lex * * @param {String} chunk String */ Parser.prototype._lexer = function (chunk) { let chr; for (let i = 0, len = chunk.length; i < len; i++) { chr = chunk.charAt(i); if (chr === '\n') { this._lineNumber += 1; } switch (this._state) { case this.states.none: case this.states.obsolete: if (chr.match(this.symbols.quotes)) { this._node = { type: this.types.string, value: '', quote: chr }; this._lex.push(this._node); this._state = this.states.string; } else if (chr.match(this.symbols.comments)) { this._node = { type: this.types.comments, value: '' }; this._lex.push(this._node); this._state = this.states.comments; } else if (!chr.match(this.symbols.whitespace)) { this._node = { type: this.types.key, value: chr }; if (this._state === this.states.obsolete) { this._node.obsolete = true; } this._lex.push(this._node); this._state = this.states.key; } break; case this.states.comments: if (chr === '\n') { this._state = this.states.none; } else if (chr === '~' && this._node.value === '') { this._node.value += chr; this._state = this.states.obsolete; } else if (chr !== '\r') { this._node.value += chr; } break; case this.states.string: if (this._escaped) { switch (chr) { case 't': this._node.value += '\t'; break; case 'n': this._node.value += '\n'; break; case 'r': this._node.value += '\r'; break; default: this._node.value += chr; } this._escaped = false; } else { if (chr === this._node.quote) { this._state = this.states.none; } else if (chr === '\\') { this._escaped = true; break; } else { this._node.value += chr; } this._escaped = false; } break; case this.states.key: if (!chr.match(this.symbols.key)) { if (!this._node.value.match(this.symbols.keyNames)) { const err = new SyntaxError(`Error parsing PO data: Invalid key name "${this._node.value}" at line ${this._lineNumber}. This can be caused by an unescaped quote character in a msgid or msgstr value.`); err.lineNumber = this._lineNumber; throw err; } this._state = this.states.none; i--; } else { this._node.value += chr; } break; } } }; /** * Join multi line strings * * @param {Object} tokens Parsed tokens * @return {Object} Parsed tokens, with multi line strings joined into one */ Parser.prototype._joinStringValues = function (tokens) { const response = []; let lastNode; for (let i = 0, len = tokens.length; i < len; i++) { if (lastNode && tokens[i].type === this.types.string && lastNode.type === this.types.string) { lastNode.value += tokens[i].value; } else if (lastNode && tokens[i].type === this.types.comments && lastNode.type === this.types.comments) { lastNode.value += '\n' + tokens[i].value; } else { response.push(tokens[i]); lastNode = tokens[i]; } } return response; }; /** * Parse comments into separate comment blocks * * @param {Object} tokens Parsed tokens */ Parser.prototype._parseComments = function (tokens) { // parse comments tokens.forEach(node => { let comment; let lines; if (node && node.type === this.types.comments) { comment = { translator: [], extracted: [], reference: [], flag: [], previous: [] }; lines = (node.value || '').split(/\n/); lines.forEach(line => { switch (line.charAt(0) || '') { case ':': comment.reference.push(line.substr(1).trim()); break; case '.': comment.extracted.push(line.substr(1).replace(/^\s+/, '')); break; case ',': comment.flag.push(line.substr(1).replace(/^\s+/, '')); break; case '|': comment.previous.push(line.substr(1).replace(/^\s+/, '')); break; case '~': break; default: comment.translator.push(line.replace(/^\s+/, '')); } }); node.value = {}; Object.keys(comment).forEach(key => { if (comment[key] && comment[key].length) { node.value[key] = comment[key].join('\n'); } }); } }); }; /** * Join gettext keys with values * * @param {Object} tokens Parsed tokens * @return {Object} Tokens */ Parser.prototype._handleKeys = function (tokens) { const response = []; let lastNode; for (let i = 0, len = tokens.length; i < len; i++) { if (tokens[i].type === this.types.key) { lastNode = { key: tokens[i].value }; if (tokens[i].obsolete) { lastNode.obsolete = true; } if (i && tokens[i - 1].type === this.types.comments) { lastNode.comments = tokens[i - 1].value; } lastNode.value = ''; response.push(lastNode); } else if (tokens[i].type === this.types.string && lastNode) { lastNode.value += tokens[i].value; } } return response; }; /** * Separate different values into individual translation objects * * @param {Object} tokens Parsed tokens * @return {Object} Tokens */ Parser.prototype._handleValues = function (tokens) { const response = []; let lastNode; let curContext; let curComments; for (let i = 0, len = tokens.length; i < len; i++) { if (tokens[i].key.toLowerCase() === 'msgctxt') { curContext = tokens[i].value; curComments = tokens[i].comments; } else if (tokens[i].key.toLowerCase() === 'msgid') { lastNode = { msgid: tokens[i].value }; if (tokens[i].obsolete) { lastNode.obsolete = true; } if (curContext) { lastNode.msgctxt = curContext; } if (curComments) { lastNode.comments = curComments; } if (tokens[i].comments && !lastNode.comments) { lastNode.comments = tokens[i].comments; } curContext = false; curComments = false; response.push(lastNode); } else if (tokens[i].key.toLowerCase() === 'msgid_plural') { if (lastNode) { lastNode.msgid_plural = tokens[i].value; } if (tokens[i].comments && !lastNode.comments) { lastNode.comments = tokens[i].comments; } curContext = false; curComments = false; } else if (tokens[i].key.substr(0, 6).toLowerCase() === 'msgstr') { if (lastNode) { lastNode.msgstr = (lastNode.msgstr || []).concat(tokens[i].value); } if (tokens[i].comments && !lastNode.comments) { lastNode.comments = tokens[i].comments; } curContext = false; curComments = false; } } return response; }; /** * Compose a translation table from tokens object * * @param {Object} tokens Parsed tokens * @return {Object} Translation table */ Parser.prototype._normalize = function (tokens) { const table = { charset: this._charset, headers: undefined, translations: {} }; let msgctxt; for (let i = 0, len = tokens.length; i < len; i++) { msgctxt = tokens[i].msgctxt || ''; if (tokens[i].obsolete) { if (!table.obsolete) { table.obsolete = {}; } if (!table.obsolete[msgctxt]) { table.obsolete[msgctxt] = {}; } delete tokens[i].obsolete; table.obsolete[msgctxt][tokens[i].msgid] = tokens[i]; continue; } if (!table.translations[msgctxt]) { table.translations[msgctxt] = {}; } if (!table.headers && !msgctxt && !tokens[i].msgid) { table.headers = sharedFuncs.parseHeader(tokens[i].msgstr[0]); } table.translations[msgctxt][tokens[i].msgid] = tokens[i]; } return table; }; /** * Converts parsed tokens to a translation table * * @param {Object} tokens Parsed tokens * @returns {Object} Translation table */ Parser.prototype._finalize = function (tokens) { let data = this._joinStringValues(tokens); this._parseComments(data); data = this._handleKeys(data); data = this._handleValues(data); return this._normalize(data); }; /** * Creates a transform stream for parsing PO input * * @constructor * @param {String} [defaultCharset] Default charset to use * @param {String} [options] Stream options */ function PoParserTransform (defaultCharset, options) { if (!options && defaultCharset && typeof defaultCharset === 'object') { options = defaultCharset; defaultCharset = undefined; } this.defaultCharset = defaultCharset; this._parser = false; this._tokens = {}; this._cache = []; this._cacheSize = 0; this.initialTreshold = options.initialTreshold || 2 * 1024; Transform.call(this, options); this._writableState.objectMode = false; this._readableState.objectMode = true; } util.inherits(PoParserTransform, Transform); /** * Processes a chunk of the input stream */ PoParserTransform.prototype._transform = function (chunk, encoding, done) { let i; let len = 0; if (!chunk || !chunk.length) { return done(); } if (!this._parser) { this._cache.push(chunk); this._cacheSize += chunk.length; // wait until the first 1kb before parsing headers for charset if (this._cacheSize < this.initialTreshold) { return setImmediate(done); } else if (this._cacheSize) { chunk = Buffer.concat(this._cache, this._cacheSize); this._cacheSize = 0; this._cache = []; } this._parser = new Parser(chunk, this.defaultCharset); } else if (this._cacheSize) { // this only happens if we had an uncompleted 8bit sequence from the last iteration this._cache.push(chunk); this._cacheSize += chunk.length; chunk = Buffer.concat(this._cache, this._cacheSize); this._cacheSize = 0; this._cache = []; } // cache 8bit bytes from the end of the chunk // helps if the chunk ends in the middle of an utf-8 sequence for (i = chunk.length - 1; i >= 0; i--) { if (chunk[i] >= 0x80) { len++; continue; } break; } // it seems we found some 8bit bytes from the end of the string, so let's cache these if (len) { this._cache = [chunk.slice(chunk.length - len)]; this._cacheSize = this._cache[0].length; chunk = chunk.slice(0, chunk.length - len); } // chunk might be empty if it only continued of 8bit bytes and these were all cached if (chunk.length) { try { this._parser._lexer(this._parser._toString(chunk)); } catch (error) { setImmediate(() => { done(error); }); return; } } setImmediate(done); }; /** * Once all input has been processed emit the parsed translation table as an object */ PoParserTransform.prototype._flush = function (done) { let chunk; if (this._cacheSize) { chunk = Buffer.concat(this._cache, this._cacheSize); } if (!this._parser && chunk) { this._parser = new Parser(chunk, this.defaultCharset); } if (chunk) { try { this._parser._lexer(this._parser._toString(chunk)); } catch (error) { setImmediate(() => { done(error); }); return; } } if (this._parser) { this.push(this._parser._finalize(this._parser._lex)); } setImmediate(done); }; /***/ }), /***/ "./node_modules/gettext-parser/lib/shared.js": /*!***************************************************!*\ !*** ./node_modules/gettext-parser/lib/shared.js ***! \***************************************************/ /***/ ((module) => { module.exports.parseHeader = parseHeader; module.exports.generateHeader = generateHeader; module.exports.formatCharset = formatCharset; module.exports.foldLine = foldLine; module.exports.compareMsgid = compareMsgid; // see https://www.gnu.org/software/gettext/manual/html_node/Header-Entry.html const HEADERS = new Map([ ['project-id-version', 'Project-Id-Version'], ['report-msgid-bugs-to', 'Report-Msgid-Bugs-To'], ['pot-creation-date', 'POT-Creation-Date'], ['po-revision-date', 'PO-Revision-Date'], ['last-translator', 'Last-Translator'], ['language-team', 'Language-Team'], ['language', 'Language'], ['content-type', 'Content-Type'], ['content-transfer-encoding', 'Content-Transfer-Encoding'], ['plural-forms', 'Plural-Forms'] ]); module.exports.HEADERS = HEADERS; /** * Parses a header string into an object of key-value pairs * * @param {String} str Header string * @return {Object} An object of key-value pairs */ function parseHeader (str = '') { return str.split('\n') .reduce((headers, line) => { const parts = line.split(':'); let key = (parts.shift() || '').trim(); if (key) { const value = parts.join(':').trim(); key = HEADERS.get(key.toLowerCase()) || key; headers[key] = value; } return headers; }, {}); } /** * Joins a header object of key value pairs into a header string * * @param {Object} header Object of key value pairs * @return {String} Header string */ function generateHeader (header = {}) { const keys = Object.keys(header) .filter(key => !!key); if (!keys.length) { return ''; } return keys.map(key => `${key}: ${(header[key] || '').trim()}` ) .join('\n') + '\n'; } /** * Normalizes charset name. Converts utf8 to utf-8, WIN1257 to windows-1257 etc. * * @param {String} charset Charset name * @return {String} Normalized charset name */ function formatCharset (charset = 'iso-8859-1', defaultCharset = 'iso-8859-1') { return charset.toString() .toLowerCase() .replace(/^utf[-_]?(\d+)$/, 'utf-$1') .replace(/^win(?:dows)?[-_]?(\d+)$/, 'windows-$1') .replace(/^latin[-_]?(\d+)$/, 'iso-8859-$1') .replace(/^(us[-_]?)?ascii$/, 'ascii') .replace(/^charset$/, defaultCharset) .trim(); } /** * Folds long lines according to PO format * * @param {String} str PO formatted string to be folded * @param {Number} [maxLen=76] Maximum allowed length for folded lines * @return {Array} An array of lines */ function foldLine (str, maxLen = 76) { const lines = []; const len = str.length; let curLine = ''; let pos = 0; let match; while (pos < len) { curLine = str.substr(pos, maxLen); // ensure that the line never ends with a partial escaping // make longer lines if needed while (curLine.substr(-1) === '\\' && pos + curLine.length < len) { curLine += str.charAt(pos + curLine.length); } // ensure that if possible, line breaks are done at reasonable places if ((match = /.*?\\n/.exec(curLine))) { // use everything before and including the first line break curLine = match[0]; } else if (pos + curLine.length < len) { // if we're not at the end if ((match = /.*\s+/.exec(curLine)) && /[^\s]/.test(match[0])) { // use everything before and including the last white space character (if anything) curLine = match[0]; } else if ((match = /.*[\x21-\x2f0-9\x5b-\x60\x7b-\x7e]+/.exec(curLine)) && /[^\x21-\x2f0-9\x5b-\x60\x7b-\x7e]/.test(match[0])) { // use everything before and including the last "special" character (if anything) curLine = match[0]; } } lines.push(curLine); pos += curLine.length; } return lines; } /** * Comparator function for comparing msgid * @param {Object} object with msgid prev * @param {Object} object with msgid next * @returns {number} comparator index */ function compareMsgid ({ msgid: left }, { msgid: right }) { if (left < right) { return -1; } if (left > right) { return 1; } return 0; } /***/ }), /***/ "./node_modules/graceful-fs/clone.js": /*!*******************************************!*\ !*** ./node_modules/graceful-fs/clone.js ***! \*******************************************/ /***/ ((module) => { "use strict"; module.exports = clone var getPrototypeOf = Object.getPrototypeOf || function (obj) { return obj.__proto__ } function clone (obj) { if (obj === null || typeof obj !== 'object') return obj if (obj instanceof Object) var copy = { __proto__: getPrototypeOf(obj) } else var copy = Object.create(null) Object.getOwnPropertyNames(obj).forEach(function (key) { Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)) }) return copy } /***/ }), /***/ "./node_modules/graceful-fs/graceful-fs.js": /*!*************************************************!*\ !*** ./node_modules/graceful-fs/graceful-fs.js ***! \*************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var fs = __webpack_require__(/*! fs */ "fs") var polyfills = __webpack_require__(/*! ./polyfills.js */ "./node_modules/graceful-fs/polyfills.js") var legacy = __webpack_require__(/*! ./legacy-streams.js */ "./node_modules/graceful-fs/legacy-streams.js") var clone = __webpack_require__(/*! ./clone.js */ "./node_modules/graceful-fs/clone.js") var util = __webpack_require__(/*! util */ "util") /* istanbul ignore next - node 0.x polyfill */ var gracefulQueue var previousSymbol /* istanbul ignore else - node 0.x polyfill */ if (typeof Symbol === 'function' && typeof Symbol.for === 'function') { gracefulQueue = Symbol.for('graceful-fs.queue') // This is used in testing by future versions previousSymbol = Symbol.for('graceful-fs.previous') } else { gracefulQueue = '___graceful-fs.queue' previousSymbol = '___graceful-fs.previous' } function noop () {} function publishQueue(context, queue) { Object.defineProperty(context, gracefulQueue, { get: function() { return queue } }) } var debug = noop if (util.debuglog) debug = util.debuglog('gfs4') else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) debug = function() { var m = util.format.apply(util, arguments) m = 'GFS4: ' + m.split(/\n/).join('\nGFS4: ') console.error(m) } // Once time initialization if (!fs[gracefulQueue]) { // This queue can be shared by multiple loaded instances var queue = global[gracefulQueue] || [] publishQueue(fs, queue) // Patch fs.close/closeSync to shared queue version, because we need // to retry() whenever a close happens *anywhere* in the program. // This is essential when multiple graceful-fs instances are // in play at the same time. fs.close = (function (fs$close) { function close (fd, cb) { return fs$close.call(fs, fd, function (err) { // This function uses the graceful-fs shared queue if (!err) { resetQueue() } if (typeof cb === 'function') cb.apply(this, arguments) }) } Object.defineProperty(close, previousSymbol, { value: fs$close }) return close })(fs.close) fs.closeSync = (function (fs$closeSync) { function closeSync (fd) { // This function uses the graceful-fs shared queue fs$closeSync.apply(fs, arguments) resetQueue() } Object.defineProperty(closeSync, previousSymbol, { value: fs$closeSync }) return closeSync })(fs.closeSync) if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) { process.on('exit', function() { debug(fs[gracefulQueue]) __webpack_require__(/*! assert */ "assert").equal(fs[gracefulQueue].length, 0) }) } } if (!global[gracefulQueue]) { publishQueue(global, fs[gracefulQueue]); } module.exports = patch(clone(fs)) if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) { module.exports = patch(fs) fs.__patched = true; } function patch (fs) { // Everything that references the open() function needs to be in here polyfills(fs) fs.gracefulify = patch fs.createReadStream = createReadStream fs.createWriteStream = createWriteStream var fs$readFile = fs.readFile fs.readFile = readFile function readFile (path, options, cb) { if (typeof options === 'function') cb = options, options = null return go$readFile(path, options, cb) function go$readFile (path, options, cb, startTime) { return fs$readFile(path, options, function (err) { if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([go$readFile, [path, options, cb], err, startTime || Date.now(), Date.now()]) else { if (typeof cb === 'function') cb.apply(this, arguments) } }) } } var fs$writeFile = fs.writeFile fs.writeFile = writeFile function writeFile (path, data, options, cb) { if (typeof options === 'function') cb = options, options = null return go$writeFile(path, data, options, cb) function go$writeFile (path, data, options, cb, startTime) { return fs$writeFile(path, data, options, function (err) { if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([go$writeFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()]) else { if (typeof cb === 'function') cb.apply(this, arguments) } }) } } var fs$appendFile = fs.appendFile if (fs$appendFile) fs.appendFile = appendFile function appendFile (path, data, options, cb) { if (typeof options === 'function') cb = options, options = null return go$appendFile(path, data, options, cb) function go$appendFile (path, data, options, cb, startTime) { return fs$appendFile(path, data, options, function (err) { if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([go$appendFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()]) else { if (typeof cb === 'function') cb.apply(this, arguments) } }) } } var fs$copyFile = fs.copyFile if (fs$copyFile) fs.copyFile = copyFile function copyFile (src, dest, flags, cb) { if (typeof flags === 'function') { cb = flags flags = 0 } return go$copyFile(src, dest, flags, cb) function go$copyFile (src, dest, flags, cb, startTime) { return fs$copyFile(src, dest, flags, function (err) { if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([go$copyFile, [src, dest, flags, cb], err, startTime || Date.now(), Date.now()]) else { if (typeof cb === 'function') cb.apply(this, arguments) } }) } } var fs$readdir = fs.readdir fs.readdir = readdir var noReaddirOptionVersions = /^v[0-5]\./ function readdir (path, options, cb) { if (typeof options === 'function') cb = options, options = null var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir (path, options, cb, startTime) { return fs$readdir(path, fs$readdirCallback( path, options, cb, startTime )) } : function go$readdir (path, options, cb, startTime) { return fs$readdir(path, options, fs$readdirCallback( path, options, cb, startTime )) } return go$readdir(path, options, cb) function fs$readdirCallback (path, options, cb, startTime) { return function (err, files) { if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([ go$readdir, [path, options, cb], err, startTime || Date.now(), Date.now() ]) else { if (files && files.sort) files.sort() if (typeof cb === 'function') cb.call(this, err, files) } } } } if (process.version.substr(0, 4) === 'v0.8') { var legStreams = legacy(fs) ReadStream = legStreams.ReadStream WriteStream = legStreams.WriteStream } var fs$ReadStream = fs.ReadStream if (fs$ReadStream) { ReadStream.prototype = Object.create(fs$ReadStream.prototype) ReadStream.prototype.open = ReadStream$open } var fs$WriteStream = fs.WriteStream if (fs$WriteStream) { WriteStream.prototype = Object.create(fs$WriteStream.prototype) WriteStream.prototype.open = WriteStream$open } Object.defineProperty(fs, 'ReadStream', { get: function () { return ReadStream }, set: function (val) { ReadStream = val }, enumerable: true, configurable: true }) Object.defineProperty(fs, 'WriteStream', { get: function () { return WriteStream }, set: function (val) { WriteStream = val }, enumerable: true, configurable: true }) // legacy names var FileReadStream = ReadStream Object.defineProperty(fs, 'FileReadStream', { get: function () { return FileReadStream }, set: function (val) { FileReadStream = val }, enumerable: true, configurable: true }) var FileWriteStream = WriteStream Object.defineProperty(fs, 'FileWriteStream', { get: function () { return FileWriteStream }, set: function (val) { FileWriteStream = val }, enumerable: true, configurable: true }) function ReadStream (path, options) { if (this instanceof ReadStream) return fs$ReadStream.apply(this, arguments), this else return ReadStream.apply(Object.create(ReadStream.prototype), arguments) } function ReadStream$open () { var that = this open(that.path, that.flags, that.mode, function (err, fd) { if (err) { if (that.autoClose) that.destroy() that.emit('error', err) } else { that.fd = fd that.emit('open', fd) that.read() } }) } function WriteStream (path, options) { if (this instanceof WriteStream) return fs$WriteStream.apply(this, arguments), this else return WriteStream.apply(Object.create(WriteStream.prototype), arguments) } function WriteStream$open () { var that = this open(that.path, that.flags, that.mode, function (err, fd) { if (err) { that.destroy() that.emit('error', err) } else { that.fd = fd that.emit('open', fd) } }) } function createReadStream (path, options) { return new fs.ReadStream(path, options) } function createWriteStream (path, options) { return new fs.WriteStream(path, options) } var fs$open = fs.open fs.open = open function open (path, flags, mode, cb) { if (typeof mode === 'function') cb = mode, mode = null return go$open(path, flags, mode, cb) function go$open (path, flags, mode, cb, startTime) { return fs$open(path, flags, mode, function (err, fd) { if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([go$open, [path, flags, mode, cb], err, startTime || Date.now(), Date.now()]) else { if (typeof cb === 'function') cb.apply(this, arguments) } }) } } return fs } function enqueue (elem) { debug('ENQUEUE', elem[0].name, elem[1]) fs[gracefulQueue].push(elem) retry() } // keep track of the timeout between retry() calls var retryTimer // reset the startTime and lastTime to now // this resets the start of the 60 second overall timeout as well as the // delay between attempts so that we'll retry these jobs sooner function resetQueue () { var now = Date.now() for (var i = 0; i < fs[gracefulQueue].length; ++i) { // entries that are only a length of 2 are from an older version, don't // bother modifying those since they'll be retried anyway. if (fs[gracefulQueue][i].length > 2) { fs[gracefulQueue][i][3] = now // startTime fs[gracefulQueue][i][4] = now // lastTime } } // call retry to make sure we're actively processing the queue retry() } function retry () { // clear the timer and remove it to help prevent unintended concurrency clearTimeout(retryTimer) retryTimer = undefined if (fs[gracefulQueue].length === 0) return var elem = fs[gracefulQueue].shift() var fn = elem[0] var args = elem[1] // these items may be unset if they were added by an older graceful-fs var err = elem[2] var startTime = elem[3] var lastTime = elem[4] // if we don't have a startTime we have no way of knowing if we've waited // long enough, so go ahead and retry this item now if (startTime === undefined) { debug('RETRY', fn.name, args) fn.apply(null, args) } else if (Date.now() - startTime >= 60000) { // it's been more than 60 seconds total, bail now debug('TIMEOUT', fn.name, args) var cb = args.pop() if (typeof cb === 'function') cb.call(null, err) } else { // the amount of time between the last attempt and right now var sinceAttempt = Date.now() - lastTime // the amount of time between when we first tried, and when we last tried // rounded up to at least 1 var sinceStart = Math.max(lastTime - startTime, 1) // backoff. wait longer than the total time we've been retrying, but only // up to a maximum of 100ms var desiredDelay = Math.min(sinceStart * 1.2, 100) // it's been long enough since the last retry, do it again if (sinceAttempt >= desiredDelay) { debug('RETRY', fn.name, args) fn.apply(null, args.concat([startTime])) } else { // if we can't do this job yet, push it to the end of the queue // and let the next iteration check again fs[gracefulQueue].push(elem) } } // schedule our next run if one isn't already scheduled if (retryTimer === undefined) { retryTimer = setTimeout(retry, 0) } } /***/ }), /***/ "./node_modules/graceful-fs/legacy-streams.js": /*!****************************************************!*\ !*** ./node_modules/graceful-fs/legacy-streams.js ***! \****************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var Stream = (__webpack_require__(/*! stream */ "stream").Stream) module.exports = legacy function legacy (fs) { return { ReadStream: ReadStream, WriteStream: WriteStream } function ReadStream (path, options) { if (!(this instanceof ReadStream)) return new ReadStream(path, options); Stream.call(this); var self = this; this.path = path; this.fd = null; this.readable = true; this.paused = false; this.flags = 'r'; this.mode = 438; /*=0666*/ this.bufferSize = 64 * 1024; options = options || {}; // Mixin options into this var keys = Object.keys(options); for (var index = 0, length = keys.length; index < length; index++) { var key = keys[index]; this[key] = options[key]; } if (this.encoding) this.setEncoding(this.encoding); if (this.start !== undefined) { if ('number' !== typeof this.start) { throw TypeError('start must be a Number'); } if (this.end === undefined) { this.end = Infinity; } else if ('number' !== typeof this.end) { throw TypeError('end must be a Number'); } if (this.start > this.end) { throw new Error('start must be <= end'); } this.pos = this.start; } if (this.fd !== null) { process.nextTick(function() { self._read(); }); return; } fs.open(this.path, this.flags, this.mode, function (err, fd) { if (err) { self.emit('error', err); self.readable = false; return; } self.fd = fd; self.emit('open', fd); self._read(); }) } function WriteStream (path, options) { if (!(this instanceof WriteStream)) return new WriteStream(path, options); Stream.call(this); this.path = path; this.fd = null; this.writable = true; this.flags = 'w'; this.encoding = 'binary'; this.mode = 438; /*=0666*/ this.bytesWritten = 0; options = options || {}; // Mixin options into this var keys = Object.keys(options); for (var index = 0, length = keys.length; index < length; index++) { var key = keys[index]; this[key] = options[key]; } if (this.start !== undefined) { if ('number' !== typeof this.start) { throw TypeError('start must be a Number'); } if (this.start < 0) { throw new Error('start must be >= zero'); } this.pos = this.start; } this.busy = false; this._queue = []; if (this.fd === null) { this._open = fs.open; this._queue.push([this._open, this.path, this.flags, this.mode, undefined]); this.flush(); } } } /***/ }), /***/ "./node_modules/graceful-fs/polyfills.js": /*!***********************************************!*\ !*** ./node_modules/graceful-fs/polyfills.js ***! \***********************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var constants = __webpack_require__(/*! constants */ "constants") var origCwd = process.cwd var cwd = null var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform process.cwd = function() { if (!cwd) cwd = origCwd.call(process) return cwd } try { process.cwd() } catch (er) {} // This check is needed until node.js 12 is required if (typeof process.chdir === 'function') { var chdir = process.chdir process.chdir = function (d) { cwd = null chdir.call(process, d) } if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir) } module.exports = patch function patch (fs) { // (re-)implement some things that are known busted or missing. // lchmod, broken prior to 0.6.2 // back-port the fix here. if (constants.hasOwnProperty('O_SYMLINK') && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { patchLchmod(fs) } // lutimes implementation, or no-op if (!fs.lutimes) { patchLutimes(fs) } // https://github.com/isaacs/node-graceful-fs/issues/4 // Chown should not fail on einval or eperm if non-root. // It should not fail on enosys ever, as this just indicates // that a fs doesn't support the intended operation. fs.chown = chownFix(fs.chown) fs.fchown = chownFix(fs.fchown) fs.lchown = chownFix(fs.lchown) fs.chmod = chmodFix(fs.chmod) fs.fchmod = chmodFix(fs.fchmod) fs.lchmod = chmodFix(fs.lchmod) fs.chownSync = chownFixSync(fs.chownSync) fs.fchownSync = chownFixSync(fs.fchownSync) fs.lchownSync = chownFixSync(fs.lchownSync) fs.chmodSync = chmodFixSync(fs.chmodSync) fs.fchmodSync = chmodFixSync(fs.fchmodSync) fs.lchmodSync = chmodFixSync(fs.lchmodSync) fs.stat = statFix(fs.stat) fs.fstat = statFix(fs.fstat) fs.lstat = statFix(fs.lstat) fs.statSync = statFixSync(fs.statSync) fs.fstatSync = statFixSync(fs.fstatSync) fs.lstatSync = statFixSync(fs.lstatSync) // if lchmod/lchown do not exist, then make them no-ops if (fs.chmod && !fs.lchmod) { fs.lchmod = function (path, mode, cb) { if (cb) process.nextTick(cb) } fs.lchmodSync = function () {} } if (fs.chown && !fs.lchown) { fs.lchown = function (path, uid, gid, cb) { if (cb) process.nextTick(cb) } fs.lchownSync = function () {} } // on Windows, A/V software can lock the directory, causing this // to fail with an EACCES or EPERM if the directory contains newly // created files. Try again on failure, for up to 60 seconds. // Set the timeout this long because some Windows Anti-Virus, such as Parity // bit9, may lock files for up to a minute, causing npm package install // failures. Also, take care to yield the scheduler. Windows scheduling gives // CPU to a busy looping process, which can cause the program causing the lock // contention to be starved of CPU by node, so the contention doesn't resolve. if (platform === "win32") { fs.rename = typeof fs.rename !== 'function' ? fs.rename : (function (fs$rename) { function rename (from, to, cb) { var start = Date.now() var backoff = 0; fs$rename(from, to, function CB (er) { if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 60000) { setTimeout(function() { fs.stat(to, function (stater, st) { if (stater && stater.code === "ENOENT") fs$rename(from, to, CB); else cb(er) }) }, backoff) if (backoff < 100) backoff += 10; return; } if (cb) cb(er) }) } if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename) return rename })(fs.rename) } // if read() returns EAGAIN, then just try it again. fs.read = typeof fs.read !== 'function' ? fs.read : (function (fs$read) { function read (fd, buffer, offset, length, position, callback_) { var callback if (callback_ && typeof callback_ === 'function') { var eagCounter = 0 callback = function (er, _, __) { if (er && er.code === 'EAGAIN' && eagCounter < 10) { eagCounter ++ return fs$read.call(fs, fd, buffer, offset, length, position, callback) } callback_.apply(this, arguments) } } return fs$read.call(fs, fd, buffer, offset, length, position, callback) } // This ensures `util.promisify` works as it does for native `fs.read`. if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read) return read })(fs.read) fs.readSync = typeof fs.readSync !== 'function' ? fs.readSync : (function (fs$readSync) { return function (fd, buffer, offset, length, position) { var eagCounter = 0 while (true) { try { return fs$readSync.call(fs, fd, buffer, offset, length, position) } catch (er) { if (er.code === 'EAGAIN' && eagCounter < 10) { eagCounter ++ continue } throw er } } }})(fs.readSync) function patchLchmod (fs) { fs.lchmod = function (path, mode, callback) { fs.open( path , constants.O_WRONLY | constants.O_SYMLINK , mode , function (err, fd) { if (err) { if (callback) callback(err) return } // prefer to return the chmod error, if one occurs, // but still try to close, and report closing errors if they occur. fs.fchmod(fd, mode, function (err) { fs.close(fd, function(err2) { if (callback) callback(err || err2) }) }) }) } fs.lchmodSync = function (path, mode) { var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode) // prefer to return the chmod error, if one occurs, // but still try to close, and report closing errors if they occur. var threw = true var ret try { ret = fs.fchmodSync(fd, mode) threw = false } finally { if (threw) { try { fs.closeSync(fd) } catch (er) {} } else { fs.closeSync(fd) } } return ret } } function patchLutimes (fs) { if (constants.hasOwnProperty("O_SYMLINK") && fs.futimes) { fs.lutimes = function (path, at, mt, cb) { fs.open(path, constants.O_SYMLINK, function (er, fd) { if (er) { if (cb) cb(er) return } fs.futimes(fd, at, mt, function (er) { fs.close(fd, function (er2) { if (cb) cb(er || er2) }) }) }) } fs.lutimesSync = function (path, at, mt) { var fd = fs.openSync(path, constants.O_SYMLINK) var ret var threw = true try { ret = fs.futimesSync(fd, at, mt) threw = false } finally { if (threw) { try { fs.closeSync(fd) } catch (er) {} } else { fs.closeSync(fd) } } return ret } } else if (fs.futimes) { fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) } fs.lutimesSync = function () {} } } function chmodFix (orig) { if (!orig) return orig return function (target, mode, cb) { return orig.call(fs, target, mode, function (er) { if (chownErOk(er)) er = null if (cb) cb.apply(this, arguments) }) } } function chmodFixSync (orig) { if (!orig) return orig return function (target, mode) { try { return orig.call(fs, target, mode) } catch (er) { if (!chownErOk(er)) throw er } } } function chownFix (orig) { if (!orig) return orig return function (target, uid, gid, cb) { return orig.call(fs, target, uid, gid, function (er) { if (chownErOk(er)) er = null if (cb) cb.apply(this, arguments) }) } } function chownFixSync (orig) { if (!orig) return orig return function (target, uid, gid) { try { return orig.call(fs, target, uid, gid) } catch (er) { if (!chownErOk(er)) throw er } } } function statFix (orig) { if (!orig) return orig // Older versions of Node erroneously returned signed integers for // uid + gid. return function (target, options, cb) { if (typeof options === 'function') { cb = options options = null } function callback (er, stats) { if (stats) { if (stats.uid < 0) stats.uid += 0x100000000 if (stats.gid < 0) stats.gid += 0x100000000 } if (cb) cb.apply(this, arguments) } return options ? orig.call(fs, target, options, callback) : orig.call(fs, target, callback) } } function statFixSync (orig) { if (!orig) return orig // Older versions of Node erroneously returned signed integers for // uid + gid. return function (target, options) { var stats = options ? orig.call(fs, target, options) : orig.call(fs, target) if (stats) { if (stats.uid < 0) stats.uid += 0x100000000 if (stats.gid < 0) stats.gid += 0x100000000 } return stats; } } // ENOSYS means that the fs doesn't support the op. Just ignore // that, because it doesn't matter. // // if there's no getuid, or if getuid() is something other // than 0, and the error is EINVAL or EPERM, then just ignore // it. // // This specific case is a silent failure in cp, install, tar, // and most other unix tools that manage permissions. // // When running as root, or if other types of errors are // encountered, then it's strict. function chownErOk (er) { if (!er) return true if (er.code === "ENOSYS") return true var nonroot = !process.getuid || process.getuid() !== 0 if (nonroot) { if (er.code === "EINVAL" || er.code === "EPERM") return true } return false } } /***/ }), /***/ "./node_modules/inherits/inherits_browser.js": /*!***************************************************!*\ !*** ./node_modules/inherits/inherits_browser.js ***! \***************************************************/ /***/ ((module) => { if (typeof Object.create === 'function') { // implementation from standard node.js 'util' module module.exports = function inherits(ctor, superCtor) { if (superCtor) { ctor.super_ = superCtor ctor.prototype = Object.create(superCtor.prototype, { constructor: { value: ctor, enumerable: false, writable: true, configurable: true } }) } }; } else { // old school shim for old browsers module.exports = function inherits(ctor, superCtor) { if (superCtor) { ctor.super_ = superCtor var TempCtor = function () {} TempCtor.prototype = superCtor.prototype ctor.prototype = new TempCtor() ctor.prototype.constructor = ctor } } } /***/ }), /***/ "./node_modules/jsonfile/index.js": /*!****************************************!*\ !*** ./node_modules/jsonfile/index.js ***! \****************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { let _fs try { _fs = __webpack_require__(/*! graceful-fs */ "./node_modules/graceful-fs/graceful-fs.js") } catch (_) { _fs = __webpack_require__(/*! fs */ "fs") } const universalify = __webpack_require__(/*! universalify */ "./node_modules/universalify/index.js") const { stringify, stripBom } = __webpack_require__(/*! ./utils */ "./node_modules/jsonfile/utils.js") async function _readFile (file, options = {}) { if (typeof options === 'string') { options = { encoding: options } } const fs = options.fs || _fs const shouldThrow = 'throws' in options ? options.throws : true let data = await universalify.fromCallback(fs.readFile)(file, options) data = stripBom(data) let obj try { obj = JSON.parse(data, options ? options.reviver : null) } catch (err) { if (shouldThrow) { err.message = `${file}: ${err.message}` throw err } else { return null } } return obj } const readFile = universalify.fromPromise(_readFile) function readFileSync (file, options = {}) { if (typeof options === 'string') { options = { encoding: options } } const fs = options.fs || _fs const shouldThrow = 'throws' in options ? options.throws : true try { let content = fs.readFileSync(file, options) content = stripBom(content) return JSON.parse(content, options.reviver) } catch (err) { if (shouldThrow) { err.message = `${file}: ${err.message}` throw err } else { return null } } } async function _writeFile (file, obj, options = {}) { const fs = options.fs || _fs const str = stringify(obj, options) await universalify.fromCallback(fs.writeFile)(file, str, options) } const writeFile = universalify.fromPromise(_writeFile) function writeFileSync (file, obj, options = {}) { const fs = options.fs || _fs const str = stringify(obj, options) // not sure if fs.writeFileSync returns anything, but just in case return fs.writeFileSync(file, str, options) } const jsonfile = { readFile, readFileSync, writeFile, writeFileSync } module.exports = jsonfile /***/ }), /***/ "./node_modules/jsonfile/utils.js": /*!****************************************!*\ !*** ./node_modules/jsonfile/utils.js ***! \****************************************/ /***/ ((module) => { function stringify (obj, { EOL = '\n', finalEOL = true, replacer = null, spaces } = {}) { const EOF = finalEOL ? EOL : '' const str = JSON.stringify(obj, replacer, spaces) return str.replace(/\n/g, EOL) + EOF } function stripBom (content) { // we do this because JSON.parse would convert it to a utf8 string if encoding wasn't specified if (Buffer.isBuffer(content)) content = content.toString('utf8') return content.replace(/^\uFEFF/, '') } module.exports = { stringify, stripBom } /***/ }), /***/ "./node_modules/raw-loader/dist/cjs.js!./node_modules/less-loader/dist/cjs.js!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/share/ui/m-process.vue?vue&type=style&index=0&id=6dcd75ec&scoped=true&lang=less": /*!************************************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/raw-loader/dist/cjs.js!./node_modules/less-loader/dist/cjs.js!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/share/ui/m-process.vue?vue&type=style&index=0&id=6dcd75ec&scoped=true&lang=less ***! \************************************************************************************************************************************************************************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (""); /***/ }), /***/ "./src/panel/default/component/default-app.less": /*!******************************************************!*\ !*** ./src/panel/default/component/default-app.less ***! \******************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ("ui-button > ui-label {\n height: 100%;\n line-height: 24px;\n}\nui-label {\n line-height: 20px;\n font-size: 12px;\n font-weight: 400;\n word-break: keep-all;\n font: \"PingFang SC\";\n /* 使用 source han sans cn 字体*/\n}\nui-label:not([color]) {\n color: #cccccc;\n}\nui-label.normalFont {\n font-family: \"Source Han Sans CN\";\n}\nui-label.red {\n color: #d85f6f;\n}\nui-label.weakGray {\n color: #525252;\n}\nui-label.weakWhite {\n color: #8f8f8f;\n}\nui-label.bitWeakWhite {\n color: #a3a3a3;\n}\nui-label.weakerWhite {\n color: #707070;\n}\nui-label.strongWhite {\n color: #fafafa;\n}\nui-label.yellow {\n color: #f1a348;\n}\nui-label.selectable {\n user-select: text;\n}\nui-label.link:hover {\n text-decoration: underline;\n cursor: pointer;\n}\nui-button.button {\n height: 24px;\n border: 1px solid inherit;\n}\nui-button.button[disabled] {\n opacity: 1;\n}\nui-button.button[color='blue'] {\n background-color: #40aaca;\n color: #40aaca;\n border-color: #40aaca;\n}\nui-button.button[color='blue']:hover {\n color: #fafafa;\n background-color: #227f9b;\n}\nui-button.button[color='blue']:active {\n color: #fafafa;\n background-color: #65bdd7;\n}\nui-button.button[color='blue'][disabled] {\n border-color: #135c73;\n background-color: #227f9b;\n color: #135c73;\n}\nui-button.button[color='blue'][disabled][transparent] {\n background-color: transparent;\n}\nui-button.button[color='blue'][disabled][transparent]:not([border=true]) {\n border-color: transparent;\n}\nui-button.button[color='white'] {\n border-color: #3d3d3d;\n color: #cccccc;\n}\nui-button.button[color='white']:hover {\n background-color: #525252;\n}\nui-button.button[color='white']:active {\n background-color: #707070;\n}\nui-button.button[color='white'][disabled] {\n background-color: #3d3d3d;\n color: #525252;\n border-color: #3d3d3d;\n}\nui-button.button[color='white'][disabled][transparent] {\n background-color: transparent;\n}\nui-button.button[color='white'][disabled][transparent]:not([border=true]) {\n border-color: transparent;\n}\nui-button.button[transparent] {\n background-color: transparent;\n}\nui-button.button[border='false'] {\n border-color: transparent;\n}\ndiv.mFile {\n display: flex;\n align-items: center;\n height: 16px;\n}\ndiv.mFile > .mInput {\n flex: 1;\n}\ndiv.mFile > div.label {\n min-width: 200px;\n}\ndiv.mIcon {\n user-select: none;\n font-size: 12px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 4px;\n color: #a3a3a3;\n border: 1px solid;\n width: 16px;\n height: 16px;\n}\ndiv.mIcon:hover {\n background-color: #525252;\n border-color: #525252;\n cursor: pointer;\n}\ndiv.mIcon:active {\n background-color: #707070;\n border-color: #707070;\n cursor: pointer;\n}\ndiv.mIcon[disabled=\"true\"] {\n background-color: #2b2b2b;\n color: #525252;\n}\ndiv.mIcon[background=\"false\"] {\n background-color: transparent;\n}\ndiv.mIcon[border=\"false\"] {\n border-color: transparent;\n}\ndiv.mInput {\n background-color: #141414;\n min-height: 16px;\n border: 1px solid transparent;\n border-radius: 2px;\n display: flex;\n align-items: center;\n padding: 2px 4px;\n cursor: text;\n color: #cccccc;\n}\ndiv.mInput[disabled=\"true\"] {\n color: #a3a3a3;\n pointer-events: none;\n}\ndiv.mInput[noVerticalPadding] {\n padding: 0px 4px;\n}\ndiv.mInput:hover {\n border-color: #227f9b;\n}\ndiv.mInput:focus-within {\n background-color: #141414;\n border-color: #40aaca;\n}\ndiv.mInput[readonly] {\n background-color: transparent;\n}\ndiv.mInput > ui-label,\ndiv.mInput > input {\n text-overflow: ellipsis;\n}\ndiv.mInput > input,\ndiv.mInput > textarea {\n overflow: hidden;\n flex: 1;\n background: none;\n border: none;\n outline: none;\n line-height: 16px;\n font-size: 12px;\n width: 0px;\n font-weight: 400;\n font-family: \"PingFang SC\";\n caret-color: #cccccc;\n resize: none;\n color: inherit;\n}\ndiv.mInput > input::selection,\ndiv.mInput > textarea::selection {\n background-color: #3faac9;\n}\ndiv.mInput > input[type=\"number\"],\ndiv.mInput > textarea[type=\"number\"] {\n -moz-appearance: textfield;\n}\ndiv.mInput > input[type=\"number\"]::-webkit-outer-spin-button,\ndiv.mInput > textarea[type=\"number\"]::-webkit-outer-spin-button,\ndiv.mInput > input[type=\"number\"]::-webkit-inner-spin-button,\ndiv.mInput > textarea[type=\"number\"]::-webkit-inner-spin-button {\n -webkit-appearance: none;\n}\ndiv.mInput > textarea {\n padding-top: 0px;\n padding-bottom: 0px;\n}\ndiv.mInput > ui-label {\n line-height: 16px;\n color: #cccccc;\n}\ndiv.mInput.focus {\n border-color: #227f9b;\n}\ndiv.mInput > .icon {\n line-height: 16px;\n height: 16px;\n min-width: 0px;\n}\ndiv.mInput[error=\"true\"] {\n border-color: #d85f6f;\n}\ndiv.mProcess {\n height: 4px;\n background-color: #525252;\n border-radius: 12px;\n}\ndiv.mProcess > div.content {\n height: 100%;\n border-radius: 12px;\n}\ndiv.mProcess > div.content[color=\"pink\"] {\n background-color: #d85f6f;\n}\ndiv.mProcess > div.content[color=\"blue\"] {\n background-color: #40aaca;\n}\ndiv.mProcess > div.content[color=\"yellow\"] {\n background-color: #f1a348;\n}\ndiv.mSection > div.header {\n display: flex;\n cursor: pointer;\n padding-top: 2px;\n padding-bottom: 2px;\n align-items: center;\n}\ndiv.mSection > div.header > .icon:not([upside-down=\"true\"]) {\n transform: rotate(-90deg);\n}\ndiv.mSection > div.header > .icon {\n transform: rotate(0deg);\n}\ndiv.mSection > div.content {\n padding-left: 14px;\n}\ndiv.mMenu {\n position: absolute;\n border-radius: 4px;\n border: 1px solid #000000;\n background: #1f1f1f;\n box-shadow: 0 4px 8px 0 #000000;\n padding: 4px 4px 2px 4px;\n min-width: 120px;\n}\ndiv.mMenu > div {\n height: 24;\n padding-left: 6px;\n margin-bottom: 2px;\n}\ndiv.mMenu > div > ui-label {\n line-height: 24px;\n}\ndiv.mMenu > div:hover {\n background-color: #3d3d3d;\n cursor: pointer;\n}\ndiv.fallback {\n background-color: #141414;\n width: 100%;\n height: 100%;\n position: absolute;\n display: flex;\n}\ndiv.fallback > ui-loading {\n left: 0;\n right: 0;\n margin: auto;\n text-align: center;\n}\ndiv > div.mask {\n z-index: 999;\n align-items: center;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: rgba(0, 0, 0, 0.6);\n display: flex;\n flex-wrap: nowrap;\n justify-content: center;\n align-content: center;\n}\ndiv > div.mask > div.mask-bg {\n display: flex;\n flex-wrap: nowrap;\n text-align: center;\n justify-content: center;\n width: 350px;\n height: 150px;\n flex-direction: column;\n align-content: center;\n background-color: #000000;\n}\ndiv div.home {\n position: absolute;\n width: 100%;\n height: 100%;\n background-color: #141414;\n overflow-y: auto;\n overflow-x: auto;\n}\ndiv div.home ui-input {\n line-height: 20px;\n}\ndiv div.home > .body {\n display: flex;\n margin: auto;\n}\ndiv div.home > .body ui-select {\n line-height: 20px;\n}\ndiv div.home > .body ui-label {\n white-space: nowrap;\n}\ndiv div.home > .body .mProcess {\n width: 200px;\n}\ndiv div.home > .body m-section > :not(*[slot='header']) {\n margin-top: -10px;\n}\ndiv div.home > .body *.ball {\n height: 7px;\n width: 7px;\n border-radius: 50%;\n background-color: #cccccc;\n}\ndiv div.home > .body *.ball.shadow {\n box-shadow: 1px 0 4px 0 rgba(255, 255, 255, 0.8);\n}\ndiv div.home > .body *.container {\n display: flex;\n flex-direction: row;\n align-items: center;\n padding-top: 2px;\n padding-bottom: 2px;\n}\ndiv div.home > .body *.container > .mFile {\n flex: 1;\n}\ndiv div.home > .body *.container > .mFile > .label > span.parent {\n display: flex;\n justify-content: space-between;\n}\ndiv div.home > .body *.gray {\n border-radius: 2px;\n background-color: #2b2b2b;\n padding: 16px;\n}\ndiv div.home > .body *.frame {\n padding: 10px 16px;\n border: 1px solid #3d3d3d;\n}\ndiv div.home > .body *.frame:hover {\n border-color: #525252;\n}\ndiv div.home > .body *.frame.mSection {\n padding: 8px 16px;\n}\ndiv div.home > .body > div.mask {\n position: fixed;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.6);\n z-index: 999;\n display: flex;\n align-items: center;\n}\ndiv div.home > .body > div.mask > div {\n margin-left: auto;\n margin-right: auto;\n display: flex;\n flex-direction: column;\n align-items: center;\n}\ndiv div.home > .body > div.mask > div > ui-label {\n margin-bottom: 20px;\n line-height: 22px;\n font-size: 14px;\n font-weight: 400;\n color: #cccccc;\n display: block;\n font-family: \"Source Han Sans CN\";\n}\ndiv div.home > .body > div.mask > div > ui-button {\n padding-top: 4px 24px 4px 24px;\n border-radius: 4px;\n}\ndiv div.home > .body > div.mask > div > ui-button > ui-label {\n font-weight: 400;\n font-size: 12px;\n font-family: \"PingFang SC\";\n text-align: center;\n line-height: 12px;\n}\ndiv div.home > .body > div.main {\n left: 0px;\n right: 0px;\n margin-left: auto;\n margin-right: auto;\n}\ndiv div.home > .body > div.main > div.title {\n display: flex;\n align-items: center;\n margin-bottom: 36px;\n margin-top: 32px;\n}\ndiv div.home > .body > div.main > div.title > ui-label {\n font-family: \"PingFang SC\";\n text-align: left;\n font-size: 20px;\n font-weight: 700;\n line-height: 26px;\n letter-spacing: 2px;\n}\ndiv div.home > .body > div.main div.container {\n min-height: 24px;\n}\ndiv div.home > .body > div.main div.container > *:not(:last-child) {\n margin-right: 8px;\n}\ndiv div.home > .body > div.main > div.container > div.ball {\n margin-right: 8px;\n}\ndiv div.home > .body > div.main > div.gray div.container > .left {\n min-width: 70px;\n}\ndiv div.home > .body > div.main > div.gray.service {\n padding: 16px;\n margin-top: 8px;\n margin-bottom: 32px;\n}\ndiv div.home > .body > div.main > div.gray.service > div.container > .left > ui-label {\n margin: 0;\n}\ndiv div.home > .body > div.main > div.gray.service > div.container > .mInput {\n width: 360px;\n height: 20px;\n line-height: 20px;\n}\ndiv div.home > .body > div.main > div.gray.service > div.container > ui-select {\n width: 262px;\n}\ndiv div.home > .body > div.main > div.gray.service > div.footer {\n display: flex;\n flex-direction: row-reverse;\n}\ndiv div.home > .body > div.main > div.gray.collect {\n margin-top: 8px;\n margin-bottom: 32px;\n}\ndiv div.home > .body > div.main > div.gray.collect > div.mSection > .header:hover > .mIcon {\n visibility: visible;\n}\ndiv div.home > .body > div.main > div.gray.collect > div.mSection > .header > .mIcon {\n visibility: hidden;\n}\ndiv div.home > .body > div.main > div.gray.collect > div.mSection:first {\n margin-top: 4px;\n}\ndiv div.home > .body > div.main > div.gray.collect div.content > .mSection {\n margin-top: 4px;\n}\ndiv div.home > .body > div.main > div.gray.collect div.content > .mSection > .header > ui-button {\n padding: 0px;\n}\ndiv div.home > .body > div.main > div.gray.collect div.content > .mSection > .content > div.container {\n height: 24px;\n position: relative;\n padding-left: 6px;\n}\ndiv div.home > .body > div.main > div.gray.collect div.content > .mSection > .content > div.container > .mFile > ui-prop > .mIcon {\n position: absolute;\n top: 0px;\n left: -15px;\n}\ndiv div.home > .body > div.main > div.gray.collect div.content > .mSection > .content > div.container:hover > .mIcon,\ndiv div.home > .body > div.main > div.gray.collect div.content > .mSection > .content > div.container :focus-within > .mIcon {\n visibility: visible;\n}\ndiv div.home > .body > div.main > div.gray.collect div.content > .mSection > .content > div.container > .mIcon {\n visibility: hidden;\n}\ndiv div.home > .body > div.main > div.gray.collect > div.container > ui-select {\n width: 243px;\n}\ndiv div.home > .body > div.main > div.gray.language {\n margin-top: 8px;\n margin-bottom: 300px;\n}\ndiv div.home > .body > div.main > div.gray.language > div.container > ui-select {\n width: 258px;\n}\ndiv div.home > .body > div.main > div.gray.language > table {\n width: 100%;\n}\ndiv div.home > .body > div.main > div.gray.language > table,\ndiv div.home > .body > div.main > div.gray.language > table > tr,\ndiv div.home > .body > div.main > div.gray.language > table > tr > td,\ndiv div.home > .body > div.main > div.gray.language > table > tr > th {\n border: 1px solid #3d3d3d;\n border-collapse: collapse;\n}\ndiv div.home > .body > div.main > div.gray.language > table ui-select,\ndiv div.home > .body > div.main > div.gray.language > table > tr ui-select,\ndiv div.home > .body > div.main > div.gray.language > table > tr > td ui-select,\ndiv div.home > .body > div.main > div.gray.language > table > tr > th ui-select {\n min-width: 140px;\n}\ndiv div.home > .body > div.main > div.gray.language > table > tr > th {\n padding-left: 16px;\n padding-right: 16px;\n text-align: left;\n height: 30px;\n}\ndiv div.home > .body > div.main > div.gray.language > table > tr > td {\n width: 198px;\n padding: 8px 16px;\n}\ndiv div.home > .body > div.main > div.gray.language > table > tr > td:last-child {\n padding-left: 4px;\n white-space: nowrap;\n}\ndiv div.home > .body > div.main > div.gray.language > table > tr > td:last-child > ui-button {\n padding-left: 12px;\n padding-right: 12px;\n}\ndiv div.home > .body > div.main > div.gray.language > table > tr > td > div > .mProcess {\n width: 88px;\n}\ndiv div.home > .body > div.main > div.gray.language > table > tr > td > ui-select {\n margin-top: 8px;\n}\ndiv div.home > .body > div.main > div.gray.language > table > tr > td > .mButton {\n width: 36px;\n}\ndiv div.translate {\n overflow-x: auto;\n background-color: #141414;\n display: flex;\n position: absolute;\n width: 100%;\n height: 100%;\n flex-direction: column;\n}\ndiv div.translate .table {\n flex: 1;\n overflow-y: scroll;\n}\ndiv div.translate .table .tr {\n display: flex;\n align-items: center;\n}\ndiv div.translate .table .tr.head {\n position: sticky;\n background-color: #2b2b2b;\n top: 0px;\n z-index: 2;\n}\ndiv div.translate .table .tr:not(:first-child):hover,\ndiv div.translate .table .tr:not(:first-child):focus,\ndiv div.translate .table .tr:not(:first-child):focus-within {\n background-color: #3d3d3d !important;\n}\ndiv div.translate .table .tr:last-child {\n border-bottom: 1px solid #3d3d3d;\n}\ndiv div.translate .table .tr:nth-child(2n) {\n background-color: #1f1f1f;\n}\ndiv div.translate .table .tr > .th {\n border: 1px solid #3d3d3d;\n}\ndiv div.translate .table .tr > .th > div {\n display: flex;\n justify-content: left;\n padding: 4px 16px;\n}\ndiv div.translate .table .tr > .th > div > div.container {\n padding: 2px 0px;\n}\ndiv div.translate .table .tr > .th > div > div.container > ui-label {\n height: 20px;\n margin-right: 8px;\n}\ndiv div.translate .table .tr > .td {\n border-right: 1px solid #3d3d3d;\n border-left: 1px solid #3d3d3d;\n border-top: 1px solid transparent;\n border-bottom: 1px solid transparent;\n}\ndiv div.translate .table .tr > .td:focus-within,\ndiv div.translate .table .tr > .td:focus {\n border-color: #227f9b;\n}\ndiv div.translate .table .tr > .td:focus-within div > .mInput[isediting='true'],\ndiv div.translate .table .tr > .td:focus div > .mInput[isediting='true'] {\n background-color: #141414;\n}\ndiv div.translate .table .tr > .td:focus-within div > .mInput[isediting='true'] > .icon > ui-button,\ndiv div.translate .table .tr > .td:focus div > .mInput[isediting='true'] > .icon > ui-button {\n visibility: hidden;\n}\ndiv div.translate .table .tr > .td > div:not(:hover) > .mInput > .icon > ui-button.import {\n visibility: hidden;\n}\ndiv div.translate .table .tr > .td > div > .mInput > textarea,\ndiv div.translate .table .tr > .td > div > .mInput > .icon {\n line-height: 24px;\n height: 24px;\n}\ndiv div.translate .table .tr > .td,\ndiv div.translate .table .tr > .th {\n flex: 1;\n}\ndiv div.translate .table .tr > .td div.mInput,\ndiv div.translate .table .tr > .th div.mInput {\n background-color: transparent;\n border-radius: 0px;\n border: transparent;\n padding: 4px 16px;\n}\ndiv div.translate .table .tr > .td > div > :first-child,\ndiv div.translate .table .tr > .th > div > :first-child {\n flex: 1;\n}\ndiv div.translate .table .tr > .td > div > .mInput > .icon > ui-button,\ndiv div.translate .table .tr > .th > div > .mInput > .icon > ui-button {\n height: 24px;\n line-height: 24px;\n}\ndiv div.translate .table .tr > .td > div > .mInput > .icon > ui-button > ui-label,\ndiv div.translate .table .tr > .th > div > .mInput > .icon > ui-button > ui-label {\n line-height: 24px;\n}\ndiv div.translate ui-label {\n font: \"Source Han Sans CN\";\n}\ndiv div.translate ui-label::selection {\n background-color: #3faac9;\n}\ndiv div.translate head {\n display: block;\n overflow: hidden;\n}\ndiv div.translate head > div.toolbar {\n padding: 2px 16px;\n background-color: #2b2b2b;\n}\ndiv div.translate body {\n flex: 1;\n display: flex;\n flex-direction: column;\n padding: 16px 16px 0px 16px;\n background-color: #141414;\n overflow: hidden;\n}\ndiv div.translate body > div.tabs > div.tab {\n padding: 4px 16px;\n cursor: pointer;\n color: #a3a3a3;\n}\ndiv div.translate body > div.tabs > div.tab:hover {\n background-color: #525252;\n}\ndiv div.translate body > div.tabs > div.tab:active {\n background-color: #707070;\n}\ndiv div.translate body > div.tabs > div.tab.selected {\n background-color: #2b2b2b;\n color: #cccccc;\n}\ndiv div.translate body > div.div {\n background-color: #2b2b2b;\n padding: 16px 8px 0px 16px;\n overflow-y: hidden;\n flex: 1;\n display: flex;\n flex-direction: column;\n}\ndiv div.translate footer {\n overflow: hidden;\n padding: 16px 48px;\n overflow-y: auto;\n min-height: 76px;\n height: 76px;\n background-color: #1f1f1f;\n}\ndiv div.translate footer > div > ui-label {\n margin-right: 16px;\n}\ndiv div.translate div.container {\n display: flex;\n}\ndiv div.translate div.container.row {\n flex-direction: row;\n}\ndiv div.translate div.container.row > .fill {\n flex: 1;\n}\ndiv div.translate > div.dialog {\n position: absolute;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 4;\n overflow: hidden;\n}\ndiv div.translate > div.dialog > div.content {\n box-shadow: 0 0 30px 0 rgba(0, 0, 0, 0.8);\n overflow: hidden;\n background-color: #141414;\n display: flex;\n flex-direction: column;\n}\ndiv div.translate > div.dialog > div.content > div.header {\n background-color: #2b2b2b;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 40px;\n flex-shrink: 0;\n}\ndiv div.translate > div.dialog > div.content > div.body {\n padding: 16px 16px 0 16px;\n flex: 1;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n margin-bottom: 8px;\n}\ndiv div.translate > div.dialog > div.content > div.body > ui-label {\n flex-shrink: 0;\n}\ndiv div.translate > div.dialog > div.content > div.body > div {\n margin-top: 16px;\n padding: 16px calc((16 - var(--size-normal-font)) * 1px) 16px 16px;\n flex: 1;\n display: flex;\n flex-direction: column;\n background-color: #2b2b2b;\n overflow: hidden;\n}\ndiv div.translate > div.dialog > div.content > div.body > div > div.container.row {\n height: 20px;\n margin-bottom: 20px;\n margin-right: calc(var(--size-normal-font) * 1px);\n}\ndiv div.translate > div.dialog > div.content > div.body > div > div.container.row > :first-child {\n margin-right: 8px;\n}\ndiv div.translate > div.dialog > div.content > div.body > div > div.table {\n flex: 1;\n overflow-y: scroll;\n}\ndiv div.translate > div.dialog > div.content > div.body > div > div.table div.tr > div.th,\ndiv div.translate > div.dialog > div.content > div.body > div > div.table div.tr > div.td {\n padding-left: 16px;\n display: flex;\n align-items: center;\n height: 32px;\n}\ndiv div.translate > div.dialog > div.content > div.body > div > div.table div.tr > div.th:first-child,\ndiv div.translate > div.dialog > div.content > div.body > div > div.table div.tr > div.td:first-child {\n max-width: 48px;\n justify-content: center;\n padding-left: 0px;\n}\ndiv div.translate > div.dialog > div.content > div.body > div > div.table div.tr > div.th.hideOverFlow,\ndiv div.translate > div.dialog > div.content > div.body > div > div.table div.tr > div.td.hideOverFlow {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\ndiv div.translate > div.dialog > div.content > div.footer {\n flex-shrink: 0;\n height: 72px;\n display: flex;\n flex-direction: row-reverse;\n align-items: center;\n}\ndiv div.translate > div.dialog > div.content > div.footer > ui-button {\n margin-right: 16px;\n}\ndiv div.translate > div.variants {\n position: absolute;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n}\ndiv div.translate > div.variants > div {\n background-color: #1f1f1f;\n width: 465px;\n min-width: 465px;\n overflow: hidden;\n box-shadow: 0 0 30px 0 rgba(0, 0, 0, 0.8);\n display: flex;\n flex-direction: column;\n}\ndiv div.translate > div.variants > div > .header {\n display: flex;\n justify-content: center;\n height: 40px;\n}\ndiv div.translate > div.variants > div > .header > ui-label {\n line-height: 40px;\n}\ndiv div.translate > div.variants > div > .body {\n flex: 1;\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n padding: 16px;\n background-color: #2b2b2b;\n background-color: #141414;\n}\ndiv div.translate > div.variants > div > .body > div {\n padding: 16px 4px 16px 16px;\n background-color: #2b2b2b;\n}\ndiv div.translate > div.variants > div > .footer {\n height: 80px;\n background-color: #141414;\n padding: 0px 16px;\n}\ndiv div.translate > div.variants > div > .footer > div {\n display: flex;\n justify-content: space-around;\n align-items: center;\n height: 100%;\n}\ndiv div.translate > div.variants > div > .table {\n left: 0;\n right: 0;\n margin: auto;\n width: 400px;\n}\ndiv div.translate > div.save-mask {\n position: absolute;\n z-index: 999;\n align-items: center;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: rgba(0, 0, 0, 0);\n text-align: center;\n display: flex;\n flex-wrap: nowrap;\n justify-content: center;\n align-content: center;\n flex-direction: row;\n}\ndiv div.translate > div.save-mask > div.mask-bg {\n display: flex;\n flex-wrap: nowrap;\n align-items: center;\n text-align: center;\n justify-content: center;\n align-content: center;\n flex-direction: row;\n width: 350px;\n height: 150px;\n background-color: #000000;\n}\ndiv div.mask {\n z-index: 999;\n align-items: center;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: rgba(0, 0, 0, 0.6);\n display: flex;\n}\ndiv div.mask > div {\n margin-left: auto;\n margin-right: auto;\n display: flex;\n flex-direction: column;\n align-items: center;\n}\ndiv div.mask > div > ui-label {\n margin-bottom: 20px;\n line-height: 22px;\n font-size: 14px;\n font-weight: 400;\n color: #cccccc;\n display: block;\n font-family: \"Source Han Sans CN\";\n}\ndiv div.mask > div > ui-button {\n padding-top: 4px 24px 4px 24px;\n border-radius: 4px;\n}\ndiv div.mask > div > ui-button > ui-label {\n font-weight: 400;\n font-size: 12px;\n font-family: \"PingFang SC\";\n text-align: center;\n line-height: 12px;\n}\n"); /***/ }), /***/ "./node_modules/readable-stream/errors-browser.js": /*!********************************************************!*\ !*** ./node_modules/readable-stream/errors-browser.js ***! \********************************************************/ /***/ ((module) => { "use strict"; function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } var codes = {}; function createErrorType(code, message, Base) { if (!Base) { Base = Error; } function getMessage(arg1, arg2, arg3) { if (typeof message === 'string') { return message; } else { return message(arg1, arg2, arg3); } } var NodeError = /*#__PURE__*/ function (_Base) { _inheritsLoose(NodeError, _Base); function NodeError(arg1, arg2, arg3) { return _Base.call(this, getMessage(arg1, arg2, arg3)) || this; } return NodeError; }(Base); NodeError.prototype.name = Base.name; NodeError.prototype.code = code; codes[code] = NodeError; } // https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js function oneOf(expected, thing) { if (Array.isArray(expected)) { var len = expected.length; expected = expected.map(function (i) { return String(i); }); if (len > 2) { return "one of ".concat(thing, " ").concat(expected.slice(0, len - 1).join(', '), ", or ") + expected[len - 1]; } else if (len === 2) { return "one of ".concat(thing, " ").concat(expected[0], " or ").concat(expected[1]); } else { return "of ".concat(thing, " ").concat(expected[0]); } } else { return "of ".concat(thing, " ").concat(String(expected)); } } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith function startsWith(str, search, pos) { return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search; } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith function endsWith(str, search, this_len) { if (this_len === undefined || this_len > str.length) { this_len = str.length; } return str.substring(this_len - search.length, this_len) === search; } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes function includes(str, search, start) { if (typeof start !== 'number') { start = 0; } if (start + search.length > str.length) { return false; } else { return str.indexOf(search, start) !== -1; } } createErrorType('ERR_INVALID_OPT_VALUE', function (name, value) { return 'The value "' + value + '" is invalid for option "' + name + '"'; }, TypeError); createErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) { // determiner: 'must be' or 'must not be' var determiner; if (typeof expected === 'string' && startsWith(expected, 'not ')) { determiner = 'must not be'; expected = expected.replace(/^not /, ''); } else { determiner = 'must be'; } var msg; if (endsWith(name, ' argument')) { // For cases like 'first argument' msg = "The ".concat(name, " ").concat(determiner, " ").concat(oneOf(expected, 'type')); } else { var type = includes(name, '.') ? 'property' : 'argument'; msg = "The \"".concat(name, "\" ").concat(type, " ").concat(determiner, " ").concat(oneOf(expected, 'type')); } msg += ". Received type ".concat(typeof actual); return msg; }, TypeError); createErrorType('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF'); createErrorType('ERR_METHOD_NOT_IMPLEMENTED', function (name) { return 'The ' + name + ' method is not implemented'; }); createErrorType('ERR_STREAM_PREMATURE_CLOSE', 'Premature close'); createErrorType('ERR_STREAM_DESTROYED', function (name) { return 'Cannot call ' + name + ' after a stream was destroyed'; }); createErrorType('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times'); createErrorType('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable'); createErrorType('ERR_STREAM_WRITE_AFTER_END', 'write after end'); createErrorType('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError); createErrorType('ERR_UNKNOWN_ENCODING', function (arg) { return 'Unknown encoding: ' + arg; }, TypeError); createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event'); module.exports.codes = codes; /***/ }), /***/ "./node_modules/readable-stream/lib/_stream_duplex.js": /*!************************************************************!*\ !*** ./node_modules/readable-stream/lib/_stream_duplex.js ***! \************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // a duplex stream is just a stream that is both readable and writable. // Since JS doesn't have multiple prototypal inheritance, this class // prototypally inherits from Readable, and then parasitically from // Writable. /*<replacement>*/ var objectKeys = Object.keys || function (obj) { var keys = []; for (var key in obj) keys.push(key); return keys; }; /*</replacement>*/ module.exports = Duplex; var Readable = __webpack_require__(/*! ./_stream_readable */ "./node_modules/readable-stream/lib/_stream_readable.js"); var Writable = __webpack_require__(/*! ./_stream_writable */ "./node_modules/readable-stream/lib/_stream_writable.js"); __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js")(Duplex, Readable); { // Allow the keys array to be GC'ed. var keys = objectKeys(Writable.prototype); for (var v = 0; v < keys.length; v++) { var method = keys[v]; if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; } } function Duplex(options) { if (!(this instanceof Duplex)) return new Duplex(options); Readable.call(this, options); Writable.call(this, options); this.allowHalfOpen = true; if (options) { if (options.readable === false) this.readable = false; if (options.writable === false) this.writable = false; if (options.allowHalfOpen === false) { this.allowHalfOpen = false; this.once('end', onend); } } } Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._writableState.highWaterMark; } }); Object.defineProperty(Duplex.prototype, 'writableBuffer', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._writableState && this._writableState.getBuffer(); } }); Object.defineProperty(Duplex.prototype, 'writableLength', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._writableState.length; } }); // the no-half-open enforcer function onend() { // If the writable side ended, then we're ok. if (this._writableState.ended) return; // no more data can be written. // But allow more writes to happen in this tick. process.nextTick(onEndNT, this); } function onEndNT(self) { self.end(); } Object.defineProperty(Duplex.prototype, 'destroyed', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { if (this._readableState === undefined || this._writableState === undefined) { return false; } return this._readableState.destroyed && this._writableState.destroyed; }, set: function set(value) { // we ignore the value if the stream // has not been initialized yet if (this._readableState === undefined || this._writableState === undefined) { return; } // backward compatibility, the user is explicitly // managing destroyed this._readableState.destroyed = value; this._writableState.destroyed = value; } }); /***/ }), /***/ "./node_modules/readable-stream/lib/_stream_passthrough.js": /*!*****************************************************************!*\ !*** ./node_modules/readable-stream/lib/_stream_passthrough.js ***! \*****************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // a passthrough stream. // basically just the most minimal sort of Transform stream. // Every written chunk gets output as-is. module.exports = PassThrough; var Transform = __webpack_require__(/*! ./_stream_transform */ "./node_modules/readable-stream/lib/_stream_transform.js"); __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js")(PassThrough, Transform); function PassThrough(options) { if (!(this instanceof PassThrough)) return new PassThrough(options); Transform.call(this, options); } PassThrough.prototype._transform = function (chunk, encoding, cb) { cb(null, chunk); }; /***/ }), /***/ "./node_modules/readable-stream/lib/_stream_readable.js": /*!**************************************************************!*\ !*** ./node_modules/readable-stream/lib/_stream_readable.js ***! \**************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. module.exports = Readable; /*<replacement>*/ var Duplex; /*</replacement>*/ Readable.ReadableState = ReadableState; /*<replacement>*/ var EE = (__webpack_require__(/*! events */ "events").EventEmitter); var EElistenerCount = function EElistenerCount(emitter, type) { return emitter.listeners(type).length; }; /*</replacement>*/ /*<replacement>*/ var Stream = __webpack_require__(/*! ./internal/streams/stream */ "./node_modules/readable-stream/lib/internal/streams/stream-browser.js"); /*</replacement>*/ var Buffer = (__webpack_require__(/*! buffer */ "buffer").Buffer); var OurUint8Array = (typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {}; function _uint8ArrayToBuffer(chunk) { return Buffer.from(chunk); } function _isUint8Array(obj) { return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; } /*<replacement>*/ var debugUtil = __webpack_require__(/*! util */ "util"); var debug; if (debugUtil && debugUtil.debuglog) { debug = debugUtil.debuglog('stream'); } else { debug = function debug() {}; } /*</replacement>*/ var BufferList = __webpack_require__(/*! ./internal/streams/buffer_list */ "./node_modules/readable-stream/lib/internal/streams/buffer_list.js"); var destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ "./node_modules/readable-stream/lib/internal/streams/destroy.js"); var _require = __webpack_require__(/*! ./internal/streams/state */ "./node_modules/readable-stream/lib/internal/streams/state.js"), getHighWaterMark = _require.getHighWaterMark; var _require$codes = (__webpack_require__(/*! ../errors */ "./node_modules/readable-stream/errors-browser.js").codes), ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; // Lazy loaded to improve the startup performance. var StringDecoder; var createReadableStreamAsyncIterator; var from; __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js")(Readable, Stream); var errorOrDestroy = destroyImpl.errorOrDestroy; var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; function prependListener(emitter, event, fn) { // Sadly this is not cacheable as some libraries bundle their own // event emitter implementation with them. if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); // This is a hack to make sure that our error handler is attached before any // userland ones. NEVER DO THIS. This is here only because this code needs // to continue to work with older versions of Node.js that do not include // the prependListener() method. The goal is to eventually remove this hack. if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; } function ReadableState(options, stream, isDuplex) { Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ "./node_modules/readable-stream/lib/_stream_duplex.js"); options = options || {}; // Duplex streams are both readable and writable, but share // the same options object. // However, some cases require setting options to different // values for the readable and the writable sides of the duplex stream. // These options can be provided separately as readableXXX and writableXXX. if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; // object stream flag. Used to make read(n) ignore n and to // make all the buffer merging and length checks go away this.objectMode = !!options.objectMode; if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; // the point at which it stops calling _read() to fill the buffer // Note: 0 is a valid value, means "don't call _read preemptively ever" this.highWaterMark = getHighWaterMark(this, options, 'readableHighWaterMark', isDuplex); // A linked list is used to store data chunks instead of an array because the // linked list can remove elements from the beginning faster than // array.shift() this.buffer = new BufferList(); this.length = 0; this.pipes = null; this.pipesCount = 0; this.flowing = null; this.ended = false; this.endEmitted = false; this.reading = false; // a flag to be able to tell if the event 'readable'/'data' is emitted // immediately, or on a later tick. We set this to true at first, because // any actions that shouldn't happen until "later" should generally also // not happen before the first read call. this.sync = true; // whenever we return null, then we set a flag to say // that we're awaiting a 'readable' event emission. this.needReadable = false; this.emittedReadable = false; this.readableListening = false; this.resumeScheduled = false; this.paused = true; // Should close be emitted on destroy. Defaults to true. this.emitClose = options.emitClose !== false; // Should .destroy() be called after 'end' (and potentially 'finish') this.autoDestroy = !!options.autoDestroy; // has it been destroyed this.destroyed = false; // Crypto is kind of old and crusty. Historically, its default string // encoding is 'binary' so we have to make this configurable. // Everything else in the universe uses 'utf8', though. this.defaultEncoding = options.defaultEncoding || 'utf8'; // the number of writers that are awaiting a drain event in .pipe()s this.awaitDrain = 0; // if true, a maybeReadMore has been scheduled this.readingMore = false; this.decoder = null; this.encoding = null; if (options.encoding) { if (!StringDecoder) StringDecoder = (__webpack_require__(/*! string_decoder/ */ "./node_modules/string_decoder/lib/string_decoder.js").StringDecoder); this.decoder = new StringDecoder(options.encoding); this.encoding = options.encoding; } } function Readable(options) { Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ "./node_modules/readable-stream/lib/_stream_duplex.js"); if (!(this instanceof Readable)) return new Readable(options); // Checking for a Stream.Duplex instance is faster here instead of inside // the ReadableState constructor, at least with V8 6.5 var isDuplex = this instanceof Duplex; this._readableState = new ReadableState(options, this, isDuplex); // legacy this.readable = true; if (options) { if (typeof options.read === 'function') this._read = options.read; if (typeof options.destroy === 'function') this._destroy = options.destroy; } Stream.call(this); } Object.defineProperty(Readable.prototype, 'destroyed', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { if (this._readableState === undefined) { return false; } return this._readableState.destroyed; }, set: function set(value) { // we ignore the value if the stream // has not been initialized yet if (!this._readableState) { return; } // backward compatibility, the user is explicitly // managing destroyed this._readableState.destroyed = value; } }); Readable.prototype.destroy = destroyImpl.destroy; Readable.prototype._undestroy = destroyImpl.undestroy; Readable.prototype._destroy = function (err, cb) { cb(err); }; // Manually shove something into the read() buffer. // This returns true if the highWaterMark has not been hit yet, // similar to how Writable.write() returns true if you should // write() some more. Readable.prototype.push = function (chunk, encoding) { var state = this._readableState; var skipChunkCheck; if (!state.objectMode) { if (typeof chunk === 'string') { encoding = encoding || state.defaultEncoding; if (encoding !== state.encoding) { chunk = Buffer.from(chunk, encoding); encoding = ''; } skipChunkCheck = true; } } else { skipChunkCheck = true; } return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); }; // Unshift should *always* be something directly out of read() Readable.prototype.unshift = function (chunk) { return readableAddChunk(this, chunk, null, true, false); }; function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { debug('readableAddChunk', chunk); var state = stream._readableState; if (chunk === null) { state.reading = false; onEofChunk(stream, state); } else { var er; if (!skipChunkCheck) er = chunkInvalid(state, chunk); if (er) { errorOrDestroy(stream, er); } else if (state.objectMode || chunk && chunk.length > 0) { if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { chunk = _uint8ArrayToBuffer(chunk); } if (addToFront) { if (state.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());else addChunk(stream, state, chunk, true); } else if (state.ended) { errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF()); } else if (state.destroyed) { return false; } else { state.reading = false; if (state.decoder && !encoding) { chunk = state.decoder.write(chunk); if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state); } else { addChunk(stream, state, chunk, false); } } } else if (!addToFront) { state.reading = false; maybeReadMore(stream, state); } } // We can push more data if we are below the highWaterMark. // Also, if we have no data yet, we can stand some more bytes. // This is to work around cases where hwm=0, such as the repl. return !state.ended && (state.length < state.highWaterMark || state.length === 0); } function addChunk(stream, state, chunk, addToFront) { if (state.flowing && state.length === 0 && !state.sync) { state.awaitDrain = 0; stream.emit('data', chunk); } else { // update the buffer info. state.length += state.objectMode ? 1 : chunk.length; if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); if (state.needReadable) emitReadable(stream); } maybeReadMore(stream, state); } function chunkInvalid(state, chunk) { var er; if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk); } return er; } Readable.prototype.isPaused = function () { return this._readableState.flowing === false; }; // backwards compatibility. Readable.prototype.setEncoding = function (enc) { if (!StringDecoder) StringDecoder = (__webpack_require__(/*! string_decoder/ */ "./node_modules/string_decoder/lib/string_decoder.js").StringDecoder); var decoder = new StringDecoder(enc); this._readableState.decoder = decoder; // If setEncoding(null), decoder.encoding equals utf8 this._readableState.encoding = this._readableState.decoder.encoding; // Iterate over current buffer to convert already stored Buffers: var p = this._readableState.buffer.head; var content = ''; while (p !== null) { content += decoder.write(p.data); p = p.next; } this._readableState.buffer.clear(); if (content !== '') this._readableState.buffer.push(content); this._readableState.length = content.length; return this; }; // Don't raise the hwm > 1GB var MAX_HWM = 0x40000000; function computeNewHighWaterMark(n) { if (n >= MAX_HWM) { // TODO(ronag): Throw ERR_VALUE_OUT_OF_RANGE. n = MAX_HWM; } else { // Get the next highest power of 2 to prevent increasing hwm excessively in // tiny amounts n--; n |= n >>> 1; n |= n >>> 2; n |= n >>> 4; n |= n >>> 8; n |= n >>> 16; n++; } return n; } // This function is designed to be inlinable, so please take care when making // changes to the function body. function howMuchToRead(n, state) { if (n <= 0 || state.length === 0 && state.ended) return 0; if (state.objectMode) return 1; if (n !== n) { // Only flow one buffer at a time if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; } // If we're asking for more than the current hwm, then raise the hwm. if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); if (n <= state.length) return n; // Don't have enough if (!state.ended) { state.needReadable = true; return 0; } return state.length; } // you can override either this method, or the async _read(n) below. Readable.prototype.read = function (n) { debug('read', n); n = parseInt(n, 10); var state = this._readableState; var nOrig = n; if (n !== 0) state.emittedReadable = false; // if we're doing read(0) to trigger a readable event, but we // already have a bunch of data in the buffer, then just trigger // the 'readable' event and move on. if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) { debug('read: emitReadable', state.length, state.ended); if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); return null; } n = howMuchToRead(n, state); // if we've ended, and we're now clear, then finish it up. if (n === 0 && state.ended) { if (state.length === 0) endReadable(this); return null; } // All the actual chunk generation logic needs to be // *below* the call to _read. The reason is that in certain // synthetic stream cases, such as passthrough streams, _read // may be a completely synchronous operation which may change // the state of the read buffer, providing enough data when // before there was *not* enough. // // So, the steps are: // 1. Figure out what the state of things will be after we do // a read from the buffer. // // 2. If that resulting state will trigger a _read, then call _read. // Note that this may be asynchronous, or synchronous. Yes, it is // deeply ugly to write APIs this way, but that still doesn't mean // that the Readable class should behave improperly, as streams are // designed to be sync/async agnostic. // Take note if the _read call is sync or async (ie, if the read call // has returned yet), so that we know whether or not it's safe to emit // 'readable' etc. // // 3. Actually pull the requested chunks out of the buffer and return. // if we need a readable event, then we need to do some reading. var doRead = state.needReadable; debug('need readable', doRead); // if we currently have less than the highWaterMark, then also read some if (state.length === 0 || state.length - n < state.highWaterMark) { doRead = true; debug('length less than watermark', doRead); } // however, if we've ended, then there's no point, and if we're already // reading, then it's unnecessary. if (state.ended || state.reading) { doRead = false; debug('reading or ended', doRead); } else if (doRead) { debug('do read'); state.reading = true; state.sync = true; // if the length is currently zero, then we *need* a readable event. if (state.length === 0) state.needReadable = true; // call internal read method this._read(state.highWaterMark); state.sync = false; // If _read pushed data synchronously, then `reading` will be false, // and we need to re-evaluate how much data we can return to the user. if (!state.reading) n = howMuchToRead(nOrig, state); } var ret; if (n > 0) ret = fromList(n, state);else ret = null; if (ret === null) { state.needReadable = state.length <= state.highWaterMark; n = 0; } else { state.length -= n; state.awaitDrain = 0; } if (state.length === 0) { // If we have nothing in the buffer, then we want to know // as soon as we *do* get something into the buffer. if (!state.ended) state.needReadable = true; // If we tried to read() past the EOF, then emit end on the next tick. if (nOrig !== n && state.ended) endReadable(this); } if (ret !== null) this.emit('data', ret); return ret; }; function onEofChunk(stream, state) { debug('onEofChunk'); if (state.ended) return; if (state.decoder) { var chunk = state.decoder.end(); if (chunk && chunk.length) { state.buffer.push(chunk); state.length += state.objectMode ? 1 : chunk.length; } } state.ended = true; if (state.sync) { // if we are sync, wait until next tick to emit the data. // Otherwise we risk emitting data in the flow() // the readable code triggers during a read() call emitReadable(stream); } else { // emit 'readable' now to make sure it gets picked up. state.needReadable = false; if (!state.emittedReadable) { state.emittedReadable = true; emitReadable_(stream); } } } // Don't emit readable right away in sync mode, because this can trigger // another read() call => stack overflow. This way, it might trigger // a nextTick recursion warning, but that's not so bad. function emitReadable(stream) { var state = stream._readableState; debug('emitReadable', state.needReadable, state.emittedReadable); state.needReadable = false; if (!state.emittedReadable) { debug('emitReadable', state.flowing); state.emittedReadable = true; process.nextTick(emitReadable_, stream); } } function emitReadable_(stream) { var state = stream._readableState; debug('emitReadable_', state.destroyed, state.length, state.ended); if (!state.destroyed && (state.length || state.ended)) { stream.emit('readable'); state.emittedReadable = false; } // The stream needs another readable event if // 1. It is not flowing, as the flow mechanism will take // care of it. // 2. It is not ended. // 3. It is below the highWaterMark, so we can schedule // another readable later. state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark; flow(stream); } // at this point, the user has presumably seen the 'readable' event, // and called read() to consume some data. that may have triggered // in turn another _read(n) call, in which case reading = true if // it's in progress. // However, if we're not ended, or reading, and the length < hwm, // then go ahead and try to read some more preemptively. function maybeReadMore(stream, state) { if (!state.readingMore) { state.readingMore = true; process.nextTick(maybeReadMore_, stream, state); } } function maybeReadMore_(stream, state) { // Attempt to read more data if we should. // // The conditions for reading more data are (one of): // - Not enough data buffered (state.length < state.highWaterMark). The loop // is responsible for filling the buffer with enough data if such data // is available. If highWaterMark is 0 and we are not in the flowing mode // we should _not_ attempt to buffer any extra data. We'll get more data // when the stream consumer calls read() instead. // - No data in the buffer, and the stream is in flowing mode. In this mode // the loop below is responsible for ensuring read() is called. Failing to // call read here would abort the flow and there's no other mechanism for // continuing the flow if the stream consumer has just subscribed to the // 'data' event. // // In addition to the above conditions to keep reading data, the following // conditions prevent the data from being read: // - The stream has ended (state.ended). // - There is already a pending 'read' operation (state.reading). This is a // case where the the stream has called the implementation defined _read() // method, but they are processing the call asynchronously and have _not_ // called push() with new data. In this case we skip performing more // read()s. The execution ends in this method again after the _read() ends // up calling push() with more data. while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) { var len = state.length; debug('maybeReadMore read 0'); stream.read(0); if (len === state.length) // didn't get any data, stop spinning. break; } state.readingMore = false; } // abstract method. to be overridden in specific implementation classes. // call cb(er, data) where data is <= n in length. // for virtual (non-string, non-buffer) streams, "length" is somewhat // arbitrary, and perhaps not very meaningful. Readable.prototype._read = function (n) { errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED('_read()')); }; Readable.prototype.pipe = function (dest, pipeOpts) { var src = this; var state = this._readableState; switch (state.pipesCount) { case 0: state.pipes = dest; break; case 1: state.pipes = [state.pipes, dest]; break; default: state.pipes.push(dest); break; } state.pipesCount += 1; debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; var endFn = doEnd ? onend : unpipe; if (state.endEmitted) process.nextTick(endFn);else src.once('end', endFn); dest.on('unpipe', onunpipe); function onunpipe(readable, unpipeInfo) { debug('onunpipe'); if (readable === src) { if (unpipeInfo && unpipeInfo.hasUnpiped === false) { unpipeInfo.hasUnpiped = true; cleanup(); } } } function onend() { debug('onend'); dest.end(); } // when the dest drains, it reduces the awaitDrain counter // on the source. This would be more elegant with a .once() // handler in flow(), but adding and removing repeatedly is // too slow. var ondrain = pipeOnDrain(src); dest.on('drain', ondrain); var cleanedUp = false; function cleanup() { debug('cleanup'); // cleanup event handlers once the pipe is broken dest.removeListener('close', onclose); dest.removeListener('finish', onfinish); dest.removeListener('drain', ondrain); dest.removeListener('error', onerror); dest.removeListener('unpipe', onunpipe); src.removeListener('end', onend); src.removeListener('end', unpipe); src.removeListener('data', ondata); cleanedUp = true; // if the reader is waiting for a drain event from this // specific writer, then it would cause it to never start // flowing again. // So, if this is awaiting a drain, then we just call it now. // If we don't know, then assume that we are waiting for one. if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); } src.on('data', ondata); function ondata(chunk) { debug('ondata'); var ret = dest.write(chunk); debug('dest.write', ret); if (ret === false) { // If the user unpiped during `dest.write()`, it is possible // to get stuck in a permanently paused state if that write // also returned false. // => Check whether `dest` is still a piping destination. if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { debug('false write response, pause', state.awaitDrain); state.awaitDrain++; } src.pause(); } } // if the dest has an error, then stop piping into it. // however, don't suppress the throwing behavior for this. function onerror(er) { debug('onerror', er); unpipe(); dest.removeListener('error', onerror); if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er); } // Make sure our error handler is attached before userland ones. prependListener(dest, 'error', onerror); // Both close and finish should trigger unpipe, but only once. function onclose() { dest.removeListener('finish', onfinish); unpipe(); } dest.once('close', onclose); function onfinish() { debug('onfinish'); dest.removeListener('close', onclose); unpipe(); } dest.once('finish', onfinish); function unpipe() { debug('unpipe'); src.unpipe(dest); } // tell the dest that it's being piped to dest.emit('pipe', src); // start the flow if it hasn't been started already. if (!state.flowing) { debug('pipe resume'); src.resume(); } return dest; }; function pipeOnDrain(src) { return function pipeOnDrainFunctionResult() { var state = src._readableState; debug('pipeOnDrain', state.awaitDrain); if (state.awaitDrain) state.awaitDrain--; if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { state.flowing = true; flow(src); } }; } Readable.prototype.unpipe = function (dest) { var state = this._readableState; var unpipeInfo = { hasUnpiped: false }; // if we're not piping anywhere, then do nothing. if (state.pipesCount === 0) return this; // just one destination. most common case. if (state.pipesCount === 1) { // passed in one, but it's not the right one. if (dest && dest !== state.pipes) return this; if (!dest) dest = state.pipes; // got a match. state.pipes = null; state.pipesCount = 0; state.flowing = false; if (dest) dest.emit('unpipe', this, unpipeInfo); return this; } // slow case. multiple pipe destinations. if (!dest) { // remove all. var dests = state.pipes; var len = state.pipesCount; state.pipes = null; state.pipesCount = 0; state.flowing = false; for (var i = 0; i < len; i++) dests[i].emit('unpipe', this, { hasUnpiped: false }); return this; } // try to find the right one. var index = indexOf(state.pipes, dest); if (index === -1) return this; state.pipes.splice(index, 1); state.pipesCount -= 1; if (state.pipesCount === 1) state.pipes = state.pipes[0]; dest.emit('unpipe', this, unpipeInfo); return this; }; // set up data events if they are asked for // Ensure readable listeners eventually get something Readable.prototype.on = function (ev, fn) { var res = Stream.prototype.on.call(this, ev, fn); var state = this._readableState; if (ev === 'data') { // update readableListening so that resume() may be a no-op // a few lines down. This is needed to support once('readable'). state.readableListening = this.listenerCount('readable') > 0; // Try start flowing on next tick if stream isn't explicitly paused if (state.flowing !== false) this.resume(); } else if (ev === 'readable') { if (!state.endEmitted && !state.readableListening) { state.readableListening = state.needReadable = true; state.flowing = false; state.emittedReadable = false; debug('on readable', state.length, state.reading); if (state.length) { emitReadable(this); } else if (!state.reading) { process.nextTick(nReadingNextTick, this); } } } return res; }; Readable.prototype.addListener = Readable.prototype.on; Readable.prototype.removeListener = function (ev, fn) { var res = Stream.prototype.removeListener.call(this, ev, fn); if (ev === 'readable') { // We need to check if there is someone still listening to // readable and reset the state. However this needs to happen // after readable has been emitted but before I/O (nextTick) to // support once('readable', fn) cycles. This means that calling // resume within the same tick will have no // effect. process.nextTick(updateReadableListening, this); } return res; }; Readable.prototype.removeAllListeners = function (ev) { var res = Stream.prototype.removeAllListeners.apply(this, arguments); if (ev === 'readable' || ev === undefined) { // We need to check if there is someone still listening to // readable and reset the state. However this needs to happen // after readable has been emitted but before I/O (nextTick) to // support once('readable', fn) cycles. This means that calling // resume within the same tick will have no // effect. process.nextTick(updateReadableListening, this); } return res; }; function updateReadableListening(self) { var state = self._readableState; state.readableListening = self.listenerCount('readable') > 0; if (state.resumeScheduled && !state.paused) { // flowing needs to be set to true now, otherwise // the upcoming resume will not flow. state.flowing = true; // crude way to check if we should resume } else if (self.listenerCount('data') > 0) { self.resume(); } } function nReadingNextTick(self) { debug('readable nexttick read 0'); self.read(0); } // pause() and resume() are remnants of the legacy readable stream API // If the user uses them, then switch into old mode. Readable.prototype.resume = function () { var state = this._readableState; if (!state.flowing) { debug('resume'); // we flow only if there is no one listening // for readable, but we still have to call // resume() state.flowing = !state.readableListening; resume(this, state); } state.paused = false; return this; }; function resume(stream, state) { if (!state.resumeScheduled) { state.resumeScheduled = true; process.nextTick(resume_, stream, state); } } function resume_(stream, state) { debug('resume', state.reading); if (!state.reading) { stream.read(0); } state.resumeScheduled = false; stream.emit('resume'); flow(stream); if (state.flowing && !state.reading) stream.read(0); } Readable.prototype.pause = function () { debug('call pause flowing=%j', this._readableState.flowing); if (this._readableState.flowing !== false) { debug('pause'); this._readableState.flowing = false; this.emit('pause'); } this._readableState.paused = true; return this; }; function flow(stream) { var state = stream._readableState; debug('flow', state.flowing); while (state.flowing && stream.read() !== null); } // wrap an old-style stream as the async data source. // This is *not* part of the readable stream interface. // It is an ugly unfortunate mess of history. Readable.prototype.wrap = function (stream) { var _this = this; var state = this._readableState; var paused = false; stream.on('end', function () { debug('wrapped end'); if (state.decoder && !state.ended) { var chunk = state.decoder.end(); if (chunk && chunk.length) _this.push(chunk); } _this.push(null); }); stream.on('data', function (chunk) { debug('wrapped data'); if (state.decoder) chunk = state.decoder.write(chunk); // don't skip over falsy values in objectMode if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; var ret = _this.push(chunk); if (!ret) { paused = true; stream.pause(); } }); // proxy all the other methods. // important when wrapping filters and duplexes. for (var i in stream) { if (this[i] === undefined && typeof stream[i] === 'function') { this[i] = function methodWrap(method) { return function methodWrapReturnFunction() { return stream[method].apply(stream, arguments); }; }(i); } } // proxy certain important events. for (var n = 0; n < kProxyEvents.length; n++) { stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); } // when we try to consume some more bytes, simply unpause the // underlying stream. this._read = function (n) { debug('wrapped _read', n); if (paused) { paused = false; stream.resume(); } }; return this; }; if (typeof Symbol === 'function') { Readable.prototype[Symbol.asyncIterator] = function () { if (createReadableStreamAsyncIterator === undefined) { createReadableStreamAsyncIterator = __webpack_require__(/*! ./internal/streams/async_iterator */ "./node_modules/readable-stream/lib/internal/streams/async_iterator.js"); } return createReadableStreamAsyncIterator(this); }; } Object.defineProperty(Readable.prototype, 'readableHighWaterMark', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._readableState.highWaterMark; } }); Object.defineProperty(Readable.prototype, 'readableBuffer', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._readableState && this._readableState.buffer; } }); Object.defineProperty(Readable.prototype, 'readableFlowing', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._readableState.flowing; }, set: function set(state) { if (this._readableState) { this._readableState.flowing = state; } } }); // exposed for testing purposes only. Readable._fromList = fromList; Object.defineProperty(Readable.prototype, 'readableLength', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._readableState.length; } }); // Pluck off n bytes from an array of buffers. // Length is the combined lengths of all the buffers in the list. // This function is designed to be inlinable, so please take care when making // changes to the function body. function fromList(n, state) { // nothing buffered if (state.length === 0) return null; var ret; if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { // read it all, truncate the list if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.first();else ret = state.buffer.concat(state.length); state.buffer.clear(); } else { // read part of list ret = state.buffer.consume(n, state.decoder); } return ret; } function endReadable(stream) { var state = stream._readableState; debug('endReadable', state.endEmitted); if (!state.endEmitted) { state.ended = true; process.nextTick(endReadableNT, state, stream); } } function endReadableNT(state, stream) { debug('endReadableNT', state.endEmitted, state.length); // Check that we didn't get one last unshift. if (!state.endEmitted && state.length === 0) { state.endEmitted = true; stream.readable = false; stream.emit('end'); if (state.autoDestroy) { // In case of duplex streams we need a way to detect // if the writable side is ready for autoDestroy as well var wState = stream._writableState; if (!wState || wState.autoDestroy && wState.finished) { stream.destroy(); } } } } if (typeof Symbol === 'function') { Readable.from = function (iterable, opts) { if (from === undefined) { from = __webpack_require__(/*! ./internal/streams/from */ "./node_modules/readable-stream/lib/internal/streams/from-browser.js"); } return from(Readable, iterable, opts); }; } function indexOf(xs, x) { for (var i = 0, l = xs.length; i < l; i++) { if (xs[i] === x) return i; } return -1; } /***/ }), /***/ "./node_modules/readable-stream/lib/_stream_transform.js": /*!***************************************************************!*\ !*** ./node_modules/readable-stream/lib/_stream_transform.js ***! \***************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // a transform stream is a readable/writable stream where you do // something with the data. Sometimes it's called a "filter", // but that's not a great name for it, since that implies a thing where // some bits pass through, and others are simply ignored. (That would // be a valid example of a transform, of course.) // // While the output is causally related to the input, it's not a // necessarily symmetric or synchronous transformation. For example, // a zlib stream might take multiple plain-text writes(), and then // emit a single compressed chunk some time in the future. // // Here's how this works: // // The Transform stream has all the aspects of the readable and writable // stream classes. When you write(chunk), that calls _write(chunk,cb) // internally, and returns false if there's a lot of pending writes // buffered up. When you call read(), that calls _read(n) until // there's enough pending readable data buffered up. // // In a transform stream, the written data is placed in a buffer. When // _read(n) is called, it transforms the queued up data, calling the // buffered _write cb's as it consumes chunks. If consuming a single // written chunk would result in multiple output chunks, then the first // outputted bit calls the readcb, and subsequent chunks just go into // the read buffer, and will cause it to emit 'readable' if necessary. // // This way, back-pressure is actually determined by the reading side, // since _read has to be called to start processing a new chunk. However, // a pathological inflate type of transform can cause excessive buffering // here. For example, imagine a stream where every byte of input is // interpreted as an integer from 0-255, and then results in that many // bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in // 1kb of data being output. In this case, you could write a very small // amount of input, and end up with a very large amount of output. In // such a pathological inflating mechanism, there'd be no way to tell // the system to stop doing the transform. A single 4MB write could // cause the system to run out of memory. // // However, even in such a pathological case, only a single written chunk // would be consumed, and then the rest would wait (un-transformed) until // the results of the previous transformed chunk were consumed. module.exports = Transform; var _require$codes = (__webpack_require__(/*! ../errors */ "./node_modules/readable-stream/errors-browser.js").codes), ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING, ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0; var Duplex = __webpack_require__(/*! ./_stream_duplex */ "./node_modules/readable-stream/lib/_stream_duplex.js"); __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js")(Transform, Duplex); function afterTransform(er, data) { var ts = this._transformState; ts.transforming = false; var cb = ts.writecb; if (cb === null) { return this.emit('error', new ERR_MULTIPLE_CALLBACK()); } ts.writechunk = null; ts.writecb = null; if (data != null) // single equals check for both `null` and `undefined` this.push(data); cb(er); var rs = this._readableState; rs.reading = false; if (rs.needReadable || rs.length < rs.highWaterMark) { this._read(rs.highWaterMark); } } function Transform(options) { if (!(this instanceof Transform)) return new Transform(options); Duplex.call(this, options); this._transformState = { afterTransform: afterTransform.bind(this), needTransform: false, transforming: false, writecb: null, writechunk: null, writeencoding: null }; // start out asking for a readable event once data is transformed. this._readableState.needReadable = true; // we have implemented the _read method, and done the other things // that Readable wants before the first _read call, so unset the // sync guard flag. this._readableState.sync = false; if (options) { if (typeof options.transform === 'function') this._transform = options.transform; if (typeof options.flush === 'function') this._flush = options.flush; } // When the writable side finishes, then flush out anything remaining. this.on('prefinish', prefinish); } function prefinish() { var _this = this; if (typeof this._flush === 'function' && !this._readableState.destroyed) { this._flush(function (er, data) { done(_this, er, data); }); } else { done(this, null, null); } } Transform.prototype.push = function (chunk, encoding) { this._transformState.needTransform = false; return Duplex.prototype.push.call(this, chunk, encoding); }; // This is the part where you do stuff! // override this function in implementation classes. // 'chunk' is an input chunk. // // Call `push(newChunk)` to pass along transformed output // to the readable side. You may call 'push' zero or more times. // // Call `cb(err)` when you are done with this chunk. If you pass // an error, then that'll put the hurt on the whole operation. If you // never call cb(), then you'll never get another chunk. Transform.prototype._transform = function (chunk, encoding, cb) { cb(new ERR_METHOD_NOT_IMPLEMENTED('_transform()')); }; Transform.prototype._write = function (chunk, encoding, cb) { var ts = this._transformState; ts.writecb = cb; ts.writechunk = chunk; ts.writeencoding = encoding; if (!ts.transforming) { var rs = this._readableState; if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); } }; // Doesn't matter what the args are here. // _transform does all the work. // That we got here means that the readable side wants more data. Transform.prototype._read = function (n) { var ts = this._transformState; if (ts.writechunk !== null && !ts.transforming) { ts.transforming = true; this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); } else { // mark that we need a transform, so that any data that comes in // will get processed, now that we've asked for it. ts.needTransform = true; } }; Transform.prototype._destroy = function (err, cb) { Duplex.prototype._destroy.call(this, err, function (err2) { cb(err2); }); }; function done(stream, er, data) { if (er) return stream.emit('error', er); if (data != null) // single equals check for both `null` and `undefined` stream.push(data); // TODO(BridgeAR): Write a test for these two error cases // if there's nothing in the write buffer, then that means // that nothing more will ever be provided if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0(); if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING(); return stream.push(null); } /***/ }), /***/ "./node_modules/readable-stream/lib/_stream_writable.js": /*!**************************************************************!*\ !*** ./node_modules/readable-stream/lib/_stream_writable.js ***! \**************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // A bit simpler than readable streams. // Implement an async ._write(chunk, encoding, cb), and it'll handle all // the drain event emission and buffering. module.exports = Writable; /* <replacement> */ function WriteReq(chunk, encoding, cb) { this.chunk = chunk; this.encoding = encoding; this.callback = cb; this.next = null; } // It seems a linked list but it is not // there will be only 2 of these for each stream function CorkedRequest(state) { var _this = this; this.next = null; this.entry = null; this.finish = function () { onCorkedFinish(_this, state); }; } /* </replacement> */ /*<replacement>*/ var Duplex; /*</replacement>*/ Writable.WritableState = WritableState; /*<replacement>*/ var internalUtil = { deprecate: __webpack_require__(/*! util-deprecate */ "./node_modules/util-deprecate/browser.js") }; /*</replacement>*/ /*<replacement>*/ var Stream = __webpack_require__(/*! ./internal/streams/stream */ "./node_modules/readable-stream/lib/internal/streams/stream-browser.js"); /*</replacement>*/ var Buffer = (__webpack_require__(/*! buffer */ "buffer").Buffer); var OurUint8Array = (typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {}; function _uint8ArrayToBuffer(chunk) { return Buffer.from(chunk); } function _isUint8Array(obj) { return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; } var destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ "./node_modules/readable-stream/lib/internal/streams/destroy.js"); var _require = __webpack_require__(/*! ./internal/streams/state */ "./node_modules/readable-stream/lib/internal/streams/state.js"), getHighWaterMark = _require.getHighWaterMark; var _require$codes = (__webpack_require__(/*! ../errors */ "./node_modules/readable-stream/errors-browser.js").codes), ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE, ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED, ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES, ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END, ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING; var errorOrDestroy = destroyImpl.errorOrDestroy; __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js")(Writable, Stream); function nop() {} function WritableState(options, stream, isDuplex) { Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ "./node_modules/readable-stream/lib/_stream_duplex.js"); options = options || {}; // Duplex streams are both readable and writable, but share // the same options object. // However, some cases require setting options to different // values for the readable and the writable sides of the duplex stream, // e.g. options.readableObjectMode vs. options.writableObjectMode, etc. if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; // object stream flag to indicate whether or not this stream // contains buffers or objects. this.objectMode = !!options.objectMode; if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; // the point at which write() starts returning false // Note: 0 is a valid value, means that we always return false if // the entire buffer is not flushed immediately on write() this.highWaterMark = getHighWaterMark(this, options, 'writableHighWaterMark', isDuplex); // if _final has been called this.finalCalled = false; // drain event flag. this.needDrain = false; // at the start of calling end() this.ending = false; // when end() has been called, and returned this.ended = false; // when 'finish' is emitted this.finished = false; // has it been destroyed this.destroyed = false; // should we decode strings into buffers before passing to _write? // this is here so that some node-core streams can optimize string // handling at a lower level. var noDecode = options.decodeStrings === false; this.decodeStrings = !noDecode; // Crypto is kind of old and crusty. Historically, its default string // encoding is 'binary' so we have to make this configurable. // Everything else in the universe uses 'utf8', though. this.defaultEncoding = options.defaultEncoding || 'utf8'; // not an actual buffer we keep track of, but a measurement // of how much we're waiting to get pushed to some underlying // socket or file. this.length = 0; // a flag to see when we're in the middle of a write. this.writing = false; // when true all writes will be buffered until .uncork() call this.corked = 0; // a flag to be able to tell if the onwrite cb is called immediately, // or on a later tick. We set this to true at first, because any // actions that shouldn't happen until "later" should generally also // not happen before the first write call. this.sync = true; // a flag to know if we're processing previously buffered items, which // may call the _write() callback in the same tick, so that we don't // end up in an overlapped onwrite situation. this.bufferProcessing = false; // the callback that's passed to _write(chunk,cb) this.onwrite = function (er) { onwrite(stream, er); }; // the callback that the user supplies to write(chunk,encoding,cb) this.writecb = null; // the amount that is being written when _write is called. this.writelen = 0; this.bufferedRequest = null; this.lastBufferedRequest = null; // number of pending user-supplied write callbacks // this must be 0 before 'finish' can be emitted this.pendingcb = 0; // emit prefinish if the only thing we're waiting for is _write cbs // This is relevant for synchronous Transform streams this.prefinished = false; // True if the error was already emitted and should not be thrown again this.errorEmitted = false; // Should close be emitted on destroy. Defaults to true. this.emitClose = options.emitClose !== false; // Should .destroy() be called after 'finish' (and potentially 'end') this.autoDestroy = !!options.autoDestroy; // count buffered requests this.bufferedRequestCount = 0; // allocate the first CorkedRequest, there is always // one allocated and free to use, and we maintain at most two this.corkedRequestsFree = new CorkedRequest(this); } WritableState.prototype.getBuffer = function getBuffer() { var current = this.bufferedRequest; var out = []; while (current) { out.push(current); current = current.next; } return out; }; (function () { try { Object.defineProperty(WritableState.prototype, 'buffer', { get: internalUtil.deprecate(function writableStateBufferGetter() { return this.getBuffer(); }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') }); } catch (_) {} })(); // Test _writableState for inheritance to account for Duplex streams, // whose prototype chain only points to Readable. var realHasInstance; if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { realHasInstance = Function.prototype[Symbol.hasInstance]; Object.defineProperty(Writable, Symbol.hasInstance, { value: function value(object) { if (realHasInstance.call(this, object)) return true; if (this !== Writable) return false; return object && object._writableState instanceof WritableState; } }); } else { realHasInstance = function realHasInstance(object) { return object instanceof this; }; } function Writable(options) { Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ "./node_modules/readable-stream/lib/_stream_duplex.js"); // Writable ctor is applied to Duplexes, too. // `realHasInstance` is necessary because using plain `instanceof` // would return false, as no `_writableState` property is attached. // Trying to use the custom `instanceof` for Writable here will also break the // Node.js LazyTransform implementation, which has a non-trivial getter for // `_writableState` that would lead to infinite recursion. // Checking for a Stream.Duplex instance is faster here instead of inside // the WritableState constructor, at least with V8 6.5 var isDuplex = this instanceof Duplex; if (!isDuplex && !realHasInstance.call(Writable, this)) return new Writable(options); this._writableState = new WritableState(options, this, isDuplex); // legacy. this.writable = true; if (options) { if (typeof options.write === 'function') this._write = options.write; if (typeof options.writev === 'function') this._writev = options.writev; if (typeof options.destroy === 'function') this._destroy = options.destroy; if (typeof options.final === 'function') this._final = options.final; } Stream.call(this); } // Otherwise people can pipe Writable streams, which is just wrong. Writable.prototype.pipe = function () { errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE()); }; function writeAfterEnd(stream, cb) { var er = new ERR_STREAM_WRITE_AFTER_END(); // TODO: defer error events consistently everywhere, not just the cb errorOrDestroy(stream, er); process.nextTick(cb, er); } // Checks that a user-supplied chunk is valid, especially for the particular // mode the stream is in. Currently this means that `null` is never accepted // and undefined/non-string values are only allowed in object mode. function validChunk(stream, state, chunk, cb) { var er; if (chunk === null) { er = new ERR_STREAM_NULL_VALUES(); } else if (typeof chunk !== 'string' && !state.objectMode) { er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer'], chunk); } if (er) { errorOrDestroy(stream, er); process.nextTick(cb, er); return false; } return true; } Writable.prototype.write = function (chunk, encoding, cb) { var state = this._writableState; var ret = false; var isBuf = !state.objectMode && _isUint8Array(chunk); if (isBuf && !Buffer.isBuffer(chunk)) { chunk = _uint8ArrayToBuffer(chunk); } if (typeof encoding === 'function') { cb = encoding; encoding = null; } if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; if (typeof cb !== 'function') cb = nop; if (state.ending) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { state.pendingcb++; ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); } return ret; }; Writable.prototype.cork = function () { this._writableState.corked++; }; Writable.prototype.uncork = function () { var state = this._writableState; if (state.corked) { state.corked--; if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); } }; Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { // node::ParseEncoding() requires lower case. if (typeof encoding === 'string') encoding = encoding.toLowerCase(); if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new ERR_UNKNOWN_ENCODING(encoding); this._writableState.defaultEncoding = encoding; return this; }; Object.defineProperty(Writable.prototype, 'writableBuffer', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._writableState && this._writableState.getBuffer(); } }); function decodeChunk(state, chunk, encoding) { if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { chunk = Buffer.from(chunk, encoding); } return chunk; } Object.defineProperty(Writable.prototype, 'writableHighWaterMark', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._writableState.highWaterMark; } }); // if we're already writing something, then just put this // in the queue, and wait our turn. Otherwise, call _write // If we return false, then we need a drain event, so set that flag. function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { if (!isBuf) { var newChunk = decodeChunk(state, chunk, encoding); if (chunk !== newChunk) { isBuf = true; encoding = 'buffer'; chunk = newChunk; } } var len = state.objectMode ? 1 : chunk.length; state.length += len; var ret = state.length < state.highWaterMark; // we must ensure that previous needDrain will not be reset to false. if (!ret) state.needDrain = true; if (state.writing || state.corked) { var last = state.lastBufferedRequest; state.lastBufferedRequest = { chunk: chunk, encoding: encoding, isBuf: isBuf, callback: cb, next: null }; if (last) { last.next = state.lastBufferedRequest; } else { state.bufferedRequest = state.lastBufferedRequest; } state.bufferedRequestCount += 1; } else { doWrite(stream, state, false, len, chunk, encoding, cb); } return ret; } function doWrite(stream, state, writev, len, chunk, encoding, cb) { state.writelen = len; state.writecb = cb; state.writing = true; state.sync = true; if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED('write'));else if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); state.sync = false; } function onwriteError(stream, state, sync, er, cb) { --state.pendingcb; if (sync) { // defer the callback if we are being called synchronously // to avoid piling up things on the stack process.nextTick(cb, er); // this can emit finish, and it will always happen // after error process.nextTick(finishMaybe, stream, state); stream._writableState.errorEmitted = true; errorOrDestroy(stream, er); } else { // the caller expect this to happen before if // it is async cb(er); stream._writableState.errorEmitted = true; errorOrDestroy(stream, er); // this can emit finish, but finish must // always follow error finishMaybe(stream, state); } } function onwriteStateUpdate(state) { state.writing = false; state.writecb = null; state.length -= state.writelen; state.writelen = 0; } function onwrite(stream, er) { var state = stream._writableState; var sync = state.sync; var cb = state.writecb; if (typeof cb !== 'function') throw new ERR_MULTIPLE_CALLBACK(); onwriteStateUpdate(state); if (er) onwriteError(stream, state, sync, er, cb);else { // Check if we're actually ready to finish, but don't emit yet var finished = needFinish(state) || stream.destroyed; if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { clearBuffer(stream, state); } if (sync) { process.nextTick(afterWrite, stream, state, finished, cb); } else { afterWrite(stream, state, finished, cb); } } } function afterWrite(stream, state, finished, cb) { if (!finished) onwriteDrain(stream, state); state.pendingcb--; cb(); finishMaybe(stream, state); } // Must force callback to be called on nextTick, so that we don't // emit 'drain' before the write() consumer gets the 'false' return // value, and has a chance to attach a 'drain' listener. function onwriteDrain(stream, state) { if (state.length === 0 && state.needDrain) { state.needDrain = false; stream.emit('drain'); } } // if there's something in the buffer waiting, then process it function clearBuffer(stream, state) { state.bufferProcessing = true; var entry = state.bufferedRequest; if (stream._writev && entry && entry.next) { // Fast case, write everything using _writev() var l = state.bufferedRequestCount; var buffer = new Array(l); var holder = state.corkedRequestsFree; holder.entry = entry; var count = 0; var allBuffers = true; while (entry) { buffer[count] = entry; if (!entry.isBuf) allBuffers = false; entry = entry.next; count += 1; } buffer.allBuffers = allBuffers; doWrite(stream, state, true, state.length, buffer, '', holder.finish); // doWrite is almost always async, defer these to save a bit of time // as the hot path ends with doWrite state.pendingcb++; state.lastBufferedRequest = null; if (holder.next) { state.corkedRequestsFree = holder.next; holder.next = null; } else { state.corkedRequestsFree = new CorkedRequest(state); } state.bufferedRequestCount = 0; } else { // Slow case, write chunks one-by-one while (entry) { var chunk = entry.chunk; var encoding = entry.encoding; var cb = entry.callback; var len = state.objectMode ? 1 : chunk.length; doWrite(stream, state, false, len, chunk, encoding, cb); entry = entry.next; state.bufferedRequestCount--; // if we didn't call the onwrite immediately, then // it means that we need to wait until it does. // also, that means that the chunk and cb are currently // being processed, so move the buffer counter past them. if (state.writing) { break; } } if (entry === null) state.lastBufferedRequest = null; } state.bufferedRequest = entry; state.bufferProcessing = false; } Writable.prototype._write = function (chunk, encoding, cb) { cb(new ERR_METHOD_NOT_IMPLEMENTED('_write()')); }; Writable.prototype._writev = null; Writable.prototype.end = function (chunk, encoding, cb) { var state = this._writableState; if (typeof chunk === 'function') { cb = chunk; chunk = null; encoding = null; } else if (typeof encoding === 'function') { cb = encoding; encoding = null; } if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); // .end() fully uncorks if (state.corked) { state.corked = 1; this.uncork(); } // ignore unnecessary end() calls. if (!state.ending) endWritable(this, state, cb); return this; }; Object.defineProperty(Writable.prototype, 'writableLength', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._writableState.length; } }); function needFinish(state) { return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; } function callFinal(stream, state) { stream._final(function (err) { state.pendingcb--; if (err) { errorOrDestroy(stream, err); } state.prefinished = true; stream.emit('prefinish'); finishMaybe(stream, state); }); } function prefinish(stream, state) { if (!state.prefinished && !state.finalCalled) { if (typeof stream._final === 'function' && !state.destroyed) { state.pendingcb++; state.finalCalled = true; process.nextTick(callFinal, stream, state); } else { state.prefinished = true; stream.emit('prefinish'); } } } function finishMaybe(stream, state) { var need = needFinish(state); if (need) { prefinish(stream, state); if (state.pendingcb === 0) { state.finished = true; stream.emit('finish'); if (state.autoDestroy) { // In case of duplex streams we need a way to detect // if the readable side is ready for autoDestroy as well var rState = stream._readableState; if (!rState || rState.autoDestroy && rState.endEmitted) { stream.destroy(); } } } } return need; } function endWritable(stream, state, cb) { state.ending = true; finishMaybe(stream, state); if (cb) { if (state.finished) process.nextTick(cb);else stream.once('finish', cb); } state.ended = true; stream.writable = false; } function onCorkedFinish(corkReq, state, err) { var entry = corkReq.entry; corkReq.entry = null; while (entry) { var cb = entry.callback; state.pendingcb--; cb(err); entry = entry.next; } // reuse the free corkReq. state.corkedRequestsFree.next = corkReq; } Object.defineProperty(Writable.prototype, 'destroyed', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { if (this._writableState === undefined) { return false; } return this._writableState.destroyed; }, set: function set(value) { // we ignore the value if the stream // has not been initialized yet if (!this._writableState) { return; } // backward compatibility, the user is explicitly // managing destroyed this._writableState.destroyed = value; } }); Writable.prototype.destroy = destroyImpl.destroy; Writable.prototype._undestroy = destroyImpl.undestroy; Writable.prototype._destroy = function (err, cb) { cb(err); }; /***/ }), /***/ "./node_modules/readable-stream/lib/internal/streams/async_iterator.js": /*!*****************************************************************************!*\ !*** ./node_modules/readable-stream/lib/internal/streams/async_iterator.js ***! \*****************************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var _Object$setPrototypeO; function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); } function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } var finished = __webpack_require__(/*! ./end-of-stream */ "./node_modules/readable-stream/lib/internal/streams/end-of-stream.js"); var kLastResolve = Symbol('lastResolve'); var kLastReject = Symbol('lastReject'); var kError = Symbol('error'); var kEnded = Symbol('ended'); var kLastPromise = Symbol('lastPromise'); var kHandlePromise = Symbol('handlePromise'); var kStream = Symbol('stream'); function createIterResult(value, done) { return { value: value, done: done }; } function readAndResolve(iter) { var resolve = iter[kLastResolve]; if (resolve !== null) { var data = iter[kStream].read(); // we defer if data is null // we can be expecting either 'end' or // 'error' if (data !== null) { iter[kLastPromise] = null; iter[kLastResolve] = null; iter[kLastReject] = null; resolve(createIterResult(data, false)); } } } function onReadable(iter) { // we wait for the next tick, because it might // emit an error with process.nextTick process.nextTick(readAndResolve, iter); } function wrapForNext(lastPromise, iter) { return function (resolve, reject) { lastPromise.then(function () { if (iter[kEnded]) { resolve(createIterResult(undefined, true)); return; } iter[kHandlePromise](resolve, reject); }, reject); }; } var AsyncIteratorPrototype = Object.getPrototypeOf(function () {}); var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = { get stream() { return this[kStream]; }, next: function next() { var _this = this; // if we have detected an error in the meanwhile // reject straight away var error = this[kError]; if (error !== null) { return Promise.reject(error); } if (this[kEnded]) { return Promise.resolve(createIterResult(undefined, true)); } if (this[kStream].destroyed) { // We need to defer via nextTick because if .destroy(err) is // called, the error will be emitted via nextTick, and // we cannot guarantee that there is no error lingering around // waiting to be emitted. return new Promise(function (resolve, reject) { process.nextTick(function () { if (_this[kError]) { reject(_this[kError]); } else { resolve(createIterResult(undefined, true)); } }); }); } // if we have multiple next() calls // we will wait for the previous Promise to finish // this logic is optimized to support for await loops, // where next() is only called once at a time var lastPromise = this[kLastPromise]; var promise; if (lastPromise) { promise = new Promise(wrapForNext(lastPromise, this)); } else { // fast path needed to support multiple this.push() // without triggering the next() queue var data = this[kStream].read(); if (data !== null) { return Promise.resolve(createIterResult(data, false)); } promise = new Promise(this[kHandlePromise]); } this[kLastPromise] = promise; return promise; } }, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function () { return this; }), _defineProperty(_Object$setPrototypeO, "return", function _return() { var _this2 = this; // destroy(err, cb) is a private API // we can guarantee we have that here, because we control the // Readable class this is attached to return new Promise(function (resolve, reject) { _this2[kStream].destroy(null, function (err) { if (err) { reject(err); return; } resolve(createIterResult(undefined, true)); }); }); }), _Object$setPrototypeO), AsyncIteratorPrototype); var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator(stream) { var _Object$create; var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, { value: stream, writable: true }), _defineProperty(_Object$create, kLastResolve, { value: null, writable: true }), _defineProperty(_Object$create, kLastReject, { value: null, writable: true }), _defineProperty(_Object$create, kError, { value: null, writable: true }), _defineProperty(_Object$create, kEnded, { value: stream._readableState.endEmitted, writable: true }), _defineProperty(_Object$create, kHandlePromise, { value: function value(resolve, reject) { var data = iterator[kStream].read(); if (data) { iterator[kLastPromise] = null; iterator[kLastResolve] = null; iterator[kLastReject] = null; resolve(createIterResult(data, false)); } else { iterator[kLastResolve] = resolve; iterator[kLastReject] = reject; } }, writable: true }), _Object$create)); iterator[kLastPromise] = null; finished(stream, function (err) { if (err && err.code !== 'ERR_STREAM_PREMATURE_CLOSE') { var reject = iterator[kLastReject]; // reject if we are waiting for data in the Promise // returned by next() and store the error if (reject !== null) { iterator[kLastPromise] = null; iterator[kLastResolve] = null; iterator[kLastReject] = null; reject(err); } iterator[kError] = err; return; } var resolve = iterator[kLastResolve]; if (resolve !== null) { iterator[kLastPromise] = null; iterator[kLastResolve] = null; iterator[kLastReject] = null; resolve(createIterResult(undefined, true)); } iterator[kEnded] = true; }); stream.on('readable', onReadable.bind(null, iterator)); return iterator; }; module.exports = createReadableStreamAsyncIterator; /***/ }), /***/ "./node_modules/readable-stream/lib/internal/streams/buffer_list.js": /*!**************************************************************************!*\ !*** ./node_modules/readable-stream/lib/internal/streams/buffer_list.js ***! \**************************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); } function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } var _require = __webpack_require__(/*! buffer */ "buffer"), Buffer = _require.Buffer; var _require2 = __webpack_require__(/*! util */ "util"), inspect = _require2.inspect; var custom = inspect && inspect.custom || 'inspect'; function copyBuffer(src, target, offset) { Buffer.prototype.copy.call(src, target, offset); } module.exports = /*#__PURE__*/function () { function BufferList() { _classCallCheck(this, BufferList); this.head = null; this.tail = null; this.length = 0; } _createClass(BufferList, [{ key: "push", value: function push(v) { var entry = { data: v, next: null }; if (this.length > 0) this.tail.next = entry;else this.head = entry; this.tail = entry; ++this.length; } }, { key: "unshift", value: function unshift(v) { var entry = { data: v, next: this.head }; if (this.length === 0) this.tail = entry; this.head = entry; ++this.length; } }, { key: "shift", value: function shift() { if (this.length === 0) return; var ret = this.head.data; if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; --this.length; return ret; } }, { key: "clear", value: function clear() { this.head = this.tail = null; this.length = 0; } }, { key: "join", value: function join(s) { if (this.length === 0) return ''; var p = this.head; var ret = '' + p.data; while (p = p.next) ret += s + p.data; return ret; } }, { key: "concat", value: function concat(n) { if (this.length === 0) return Buffer.alloc(0); var ret = Buffer.allocUnsafe(n >>> 0); var p = this.head; var i = 0; while (p) { copyBuffer(p.data, ret, i); i += p.data.length; p = p.next; } return ret; } // Consumes a specified amount of bytes or characters from the buffered data. }, { key: "consume", value: function consume(n, hasStrings) { var ret; if (n < this.head.data.length) { // `slice` is the same for buffers and strings. ret = this.head.data.slice(0, n); this.head.data = this.head.data.slice(n); } else if (n === this.head.data.length) { // First chunk is a perfect match. ret = this.shift(); } else { // Result spans more than one buffer. ret = hasStrings ? this._getString(n) : this._getBuffer(n); } return ret; } }, { key: "first", value: function first() { return this.head.data; } // Consumes a specified amount of characters from the buffered data. }, { key: "_getString", value: function _getString(n) { var p = this.head; var c = 1; var ret = p.data; n -= ret.length; while (p = p.next) { var str = p.data; var nb = n > str.length ? str.length : n; if (nb === str.length) ret += str;else ret += str.slice(0, n); n -= nb; if (n === 0) { if (nb === str.length) { ++c; if (p.next) this.head = p.next;else this.head = this.tail = null; } else { this.head = p; p.data = str.slice(nb); } break; } ++c; } this.length -= c; return ret; } // Consumes a specified amount of bytes from the buffered data. }, { key: "_getBuffer", value: function _getBuffer(n) { var ret = Buffer.allocUnsafe(n); var p = this.head; var c = 1; p.data.copy(ret); n -= p.data.length; while (p = p.next) { var buf = p.data; var nb = n > buf.length ? buf.length : n; buf.copy(ret, ret.length - n, 0, nb); n -= nb; if (n === 0) { if (nb === buf.length) { ++c; if (p.next) this.head = p.next;else this.head = this.tail = null; } else { this.head = p; p.data = buf.slice(nb); } break; } ++c; } this.length -= c; return ret; } // Make sure the linked list only shows the minimal necessary information. }, { key: custom, value: function value(_, options) { return inspect(this, _objectSpread(_objectSpread({}, options), {}, { // Only inspect one level. depth: 0, // It should not recurse. customInspect: false })); } }]); return BufferList; }(); /***/ }), /***/ "./node_modules/readable-stream/lib/internal/streams/destroy.js": /*!**********************************************************************!*\ !*** ./node_modules/readable-stream/lib/internal/streams/destroy.js ***! \**********************************************************************/ /***/ ((module) => { "use strict"; // undocumented cb() API, needed for core, not for public API function destroy(err, cb) { var _this = this; var readableDestroyed = this._readableState && this._readableState.destroyed; var writableDestroyed = this._writableState && this._writableState.destroyed; if (readableDestroyed || writableDestroyed) { if (cb) { cb(err); } else if (err) { if (!this._writableState) { process.nextTick(emitErrorNT, this, err); } else if (!this._writableState.errorEmitted) { this._writableState.errorEmitted = true; process.nextTick(emitErrorNT, this, err); } } return this; } // we set destroyed to true before firing error callbacks in order // to make it re-entrance safe in case destroy() is called within callbacks if (this._readableState) { this._readableState.destroyed = true; } // if this is a duplex stream mark the writable part as destroyed as well if (this._writableState) { this._writableState.destroyed = true; } this._destroy(err || null, function (err) { if (!cb && err) { if (!_this._writableState) { process.nextTick(emitErrorAndCloseNT, _this, err); } else if (!_this._writableState.errorEmitted) { _this._writableState.errorEmitted = true; process.nextTick(emitErrorAndCloseNT, _this, err); } else { process.nextTick(emitCloseNT, _this); } } else if (cb) { process.nextTick(emitCloseNT, _this); cb(err); } else { process.nextTick(emitCloseNT, _this); } }); return this; } function emitErrorAndCloseNT(self, err) { emitErrorNT(self, err); emitCloseNT(self); } function emitCloseNT(self) { if (self._writableState && !self._writableState.emitClose) return; if (self._readableState && !self._readableState.emitClose) return; self.emit('close'); } function undestroy() { if (this._readableState) { this._readableState.destroyed = false; this._readableState.reading = false; this._readableState.ended = false; this._readableState.endEmitted = false; } if (this._writableState) { this._writableState.destroyed = false; this._writableState.ended = false; this._writableState.ending = false; this._writableState.finalCalled = false; this._writableState.prefinished = false; this._writableState.finished = false; this._writableState.errorEmitted = false; } } function emitErrorNT(self, err) { self.emit('error', err); } function errorOrDestroy(stream, err) { // We have tests that rely on errors being emitted // in the same tick, so changing this is semver major. // For now when you opt-in to autoDestroy we allow // the error to be emitted nextTick. In a future // semver major update we should change the default to this. var rState = stream._readableState; var wState = stream._writableState; if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err);else stream.emit('error', err); } module.exports = { destroy: destroy, undestroy: undestroy, errorOrDestroy: errorOrDestroy }; /***/ }), /***/ "./node_modules/readable-stream/lib/internal/streams/end-of-stream.js": /*!****************************************************************************!*\ !*** ./node_modules/readable-stream/lib/internal/streams/end-of-stream.js ***! \****************************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // Ported from https://github.com/mafintosh/end-of-stream with // permission from the author, Mathias Buus (@mafintosh). var ERR_STREAM_PREMATURE_CLOSE = (__webpack_require__(/*! ../../../errors */ "./node_modules/readable-stream/errors-browser.js").codes).ERR_STREAM_PREMATURE_CLOSE; function once(callback) { var called = false; return function () { if (called) return; called = true; for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } callback.apply(this, args); }; } function noop() {} function isRequest(stream) { return stream.setHeader && typeof stream.abort === 'function'; } function eos(stream, opts, callback) { if (typeof opts === 'function') return eos(stream, null, opts); if (!opts) opts = {}; callback = once(callback || noop); var readable = opts.readable || opts.readable !== false && stream.readable; var writable = opts.writable || opts.writable !== false && stream.writable; var onlegacyfinish = function onlegacyfinish() { if (!stream.writable) onfinish(); }; var writableEnded = stream._writableState && stream._writableState.finished; var onfinish = function onfinish() { writable = false; writableEnded = true; if (!readable) callback.call(stream); }; var readableEnded = stream._readableState && stream._readableState.endEmitted; var onend = function onend() { readable = false; readableEnded = true; if (!writable) callback.call(stream); }; var onerror = function onerror(err) { callback.call(stream, err); }; var onclose = function onclose() { var err; if (readable && !readableEnded) { if (!stream._readableState || !stream._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); return callback.call(stream, err); } if (writable && !writableEnded) { if (!stream._writableState || !stream._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); return callback.call(stream, err); } }; var onrequest = function onrequest() { stream.req.on('finish', onfinish); }; if (isRequest(stream)) { stream.on('complete', onfinish); stream.on('abort', onclose); if (stream.req) onrequest();else stream.on('request', onrequest); } else if (writable && !stream._writableState) { // legacy streams stream.on('end', onlegacyfinish); stream.on('close', onlegacyfinish); } stream.on('end', onend); stream.on('finish', onfinish); if (opts.error !== false) stream.on('error', onerror); stream.on('close', onclose); return function () { stream.removeListener('complete', onfinish); stream.removeListener('abort', onclose); stream.removeListener('request', onrequest); if (stream.req) stream.req.removeListener('finish', onfinish); stream.removeListener('end', onlegacyfinish); stream.removeListener('close', onlegacyfinish); stream.removeListener('finish', onfinish); stream.removeListener('end', onend); stream.removeListener('error', onerror); stream.removeListener('close', onclose); }; } module.exports = eos; /***/ }), /***/ "./node_modules/readable-stream/lib/internal/streams/from-browser.js": /*!***************************************************************************!*\ !*** ./node_modules/readable-stream/lib/internal/streams/from-browser.js ***! \***************************************************************************/ /***/ ((module) => { module.exports = function () { throw new Error('Readable.from is not available in the browser') }; /***/ }), /***/ "./node_modules/readable-stream/lib/internal/streams/pipeline.js": /*!***********************************************************************!*\ !*** ./node_modules/readable-stream/lib/internal/streams/pipeline.js ***! \***********************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // Ported from https://github.com/mafintosh/pump with // permission from the author, Mathias Buus (@mafintosh). var eos; function once(callback) { var called = false; return function () { if (called) return; called = true; callback.apply(void 0, arguments); }; } var _require$codes = (__webpack_require__(/*! ../../../errors */ "./node_modules/readable-stream/errors-browser.js").codes), ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED; function noop(err) { // Rethrow the error if it exists to avoid swallowing it if (err) throw err; } function isRequest(stream) { return stream.setHeader && typeof stream.abort === 'function'; } function destroyer(stream, reading, writing, callback) { callback = once(callback); var closed = false; stream.on('close', function () { closed = true; }); if (eos === undefined) eos = __webpack_require__(/*! ./end-of-stream */ "./node_modules/readable-stream/lib/internal/streams/end-of-stream.js"); eos(stream, { readable: reading, writable: writing }, function (err) { if (err) return callback(err); closed = true; callback(); }); var destroyed = false; return function (err) { if (closed) return; if (destroyed) return; destroyed = true; // request.destroy just do .end - .abort is what we want if (isRequest(stream)) return stream.abort(); if (typeof stream.destroy === 'function') return stream.destroy(); callback(err || new ERR_STREAM_DESTROYED('pipe')); }; } function call(fn) { fn(); } function pipe(from, to) { return from.pipe(to); } function popCallback(streams) { if (!streams.length) return noop; if (typeof streams[streams.length - 1] !== 'function') return noop; return streams.pop(); } function pipeline() { for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) { streams[_key] = arguments[_key]; } var callback = popCallback(streams); if (Array.isArray(streams[0])) streams = streams[0]; if (streams.length < 2) { throw new ERR_MISSING_ARGS('streams'); } var error; var destroys = streams.map(function (stream, i) { var reading = i < streams.length - 1; var writing = i > 0; return destroyer(stream, reading, writing, function (err) { if (!error) error = err; if (err) destroys.forEach(call); if (reading) return; destroys.forEach(call); callback(error); }); }); return streams.reduce(pipe); } module.exports = pipeline; /***/ }), /***/ "./node_modules/readable-stream/lib/internal/streams/state.js": /*!********************************************************************!*\ !*** ./node_modules/readable-stream/lib/internal/streams/state.js ***! \********************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var ERR_INVALID_OPT_VALUE = (__webpack_require__(/*! ../../../errors */ "./node_modules/readable-stream/errors-browser.js").codes).ERR_INVALID_OPT_VALUE; function highWaterMarkFrom(options, isDuplex, duplexKey) { return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null; } function getHighWaterMark(state, options, duplexKey, isDuplex) { var hwm = highWaterMarkFrom(options, isDuplex, duplexKey); if (hwm != null) { if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) { var name = isDuplex ? duplexKey : 'highWaterMark'; throw new ERR_INVALID_OPT_VALUE(name, hwm); } return Math.floor(hwm); } // Default value return state.objectMode ? 16 : 16 * 1024; } module.exports = { getHighWaterMark: getHighWaterMark }; /***/ }), /***/ "./node_modules/readable-stream/lib/internal/streams/stream-browser.js": /*!*****************************************************************************!*\ !*** ./node_modules/readable-stream/lib/internal/streams/stream-browser.js ***! \*****************************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { module.exports = __webpack_require__(/*! events */ "events").EventEmitter; /***/ }), /***/ "./node_modules/readable-stream/readable-browser.js": /*!**********************************************************!*\ !*** ./node_modules/readable-stream/readable-browser.js ***! \**********************************************************/ /***/ ((module, exports, __webpack_require__) => { exports = module.exports = __webpack_require__(/*! ./lib/_stream_readable.js */ "./node_modules/readable-stream/lib/_stream_readable.js"); exports.Stream = exports; exports.Readable = exports; exports.Writable = __webpack_require__(/*! ./lib/_stream_writable.js */ "./node_modules/readable-stream/lib/_stream_writable.js"); exports.Duplex = __webpack_require__(/*! ./lib/_stream_duplex.js */ "./node_modules/readable-stream/lib/_stream_duplex.js"); exports.Transform = __webpack_require__(/*! ./lib/_stream_transform.js */ "./node_modules/readable-stream/lib/_stream_transform.js"); exports.PassThrough = __webpack_require__(/*! ./lib/_stream_passthrough.js */ "./node_modules/readable-stream/lib/_stream_passthrough.js"); exports.finished = __webpack_require__(/*! ./lib/internal/streams/end-of-stream.js */ "./node_modules/readable-stream/lib/internal/streams/end-of-stream.js"); exports.pipeline = __webpack_require__(/*! ./lib/internal/streams/pipeline.js */ "./node_modules/readable-stream/lib/internal/streams/pipeline.js"); /***/ }), /***/ "./node_modules/reflect-metadata/Reflect.js": /*!**************************************************!*\ !*** ./node_modules/reflect-metadata/Reflect.js ***! \**************************************************/ /***/ (() => { /*! ***************************************************************************** Copyright (C) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ var Reflect; (function (Reflect) { // Metadata Proposal // https://rbuckton.github.io/reflect-metadata/ (function (factory) { var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : Function("return this;")(); var exporter = makeExporter(Reflect); if (typeof root.Reflect === "undefined") { root.Reflect = Reflect; } else { exporter = makeExporter(root.Reflect, exporter); } factory(exporter); function makeExporter(target, previous) { return function (key, value) { if (typeof target[key] !== "function") { Object.defineProperty(target, key, { configurable: true, writable: true, value: value }); } if (previous) previous(key, value); }; } })(function (exporter) { var hasOwn = Object.prototype.hasOwnProperty; // feature test for Symbol support var supportsSymbol = typeof Symbol === "function"; var toPrimitiveSymbol = supportsSymbol && typeof Symbol.toPrimitive !== "undefined" ? Symbol.toPrimitive : "@@toPrimitive"; var iteratorSymbol = supportsSymbol && typeof Symbol.iterator !== "undefined" ? Symbol.iterator : "@@iterator"; var supportsCreate = typeof Object.create === "function"; // feature test for Object.create support var supportsProto = { __proto__: [] } instanceof Array; // feature test for __proto__ support var downLevel = !supportsCreate && !supportsProto; var HashMap = { // create an object in dictionary mode (a.k.a. "slow" mode in v8) create: supportsCreate ? function () { return MakeDictionary(Object.create(null)); } : supportsProto ? function () { return MakeDictionary({ __proto__: null }); } : function () { return MakeDictionary({}); }, has: downLevel ? function (map, key) { return hasOwn.call(map, key); } : function (map, key) { return key in map; }, get: downLevel ? function (map, key) { return hasOwn.call(map, key) ? map[key] : undefined; } : function (map, key) { return map[key]; }, }; // Load global or shim versions of Map, Set, and WeakMap var functionPrototype = Object.getPrototypeOf(Function); var usePolyfill = typeof process === "object" && process["env" + ""] && process["env" + ""]["REFLECT_METADATA_USE_MAP_POLYFILL"] === "true"; var _Map = !usePolyfill && typeof Map === "function" && typeof Map.prototype.entries === "function" ? Map : CreateMapPolyfill(); var _Set = !usePolyfill && typeof Set === "function" && typeof Set.prototype.entries === "function" ? Set : CreateSetPolyfill(); var _WeakMap = !usePolyfill && typeof WeakMap === "function" ? WeakMap : CreateWeakMapPolyfill(); // [[Metadata]] internal slot // https://rbuckton.github.io/reflect-metadata/#ordinary-object-internal-methods-and-internal-slots var Metadata = new _WeakMap(); /** * Applies a set of decorators to a property of a target object. * @param decorators An array of decorators. * @param target The target object. * @param propertyKey (Optional) The property key to decorate. * @param attributes (Optional) The property descriptor for the target key. * @remarks Decorators are applied in reverse order. * @example * * class Example { * // property declarations are not part of ES6, though they are valid in TypeScript: * // static staticProperty; * // property; * * constructor(p) { } * static staticMethod(p) { } * method(p) { } * } * * // constructor * Example = Reflect.decorate(decoratorsArray, Example); * * // property (on constructor) * Reflect.decorate(decoratorsArray, Example, "staticProperty"); * * // property (on prototype) * Reflect.decorate(decoratorsArray, Example.prototype, "property"); * * // method (on constructor) * Object.defineProperty(Example, "staticMethod", * Reflect.decorate(decoratorsArray, Example, "staticMethod", * Object.getOwnPropertyDescriptor(Example, "staticMethod"))); * * // method (on prototype) * Object.defineProperty(Example.prototype, "method", * Reflect.decorate(decoratorsArray, Example.prototype, "method", * Object.getOwnPropertyDescriptor(Example.prototype, "method"))); * */ function decorate(decorators, target, propertyKey, attributes) { if (!IsUndefined(propertyKey)) { if (!IsArray(decorators)) throw new TypeError(); if (!IsObject(target)) throw new TypeError(); if (!IsObject(attributes) && !IsUndefined(attributes) && !IsNull(attributes)) throw new TypeError(); if (IsNull(attributes)) attributes = undefined; propertyKey = ToPropertyKey(propertyKey); return DecorateProperty(decorators, target, propertyKey, attributes); } else { if (!IsArray(decorators)) throw new TypeError(); if (!IsConstructor(target)) throw new TypeError(); return DecorateConstructor(decorators, target); } } exporter("decorate", decorate); // 4.1.2 Reflect.metadata(metadataKey, metadataValue) // https://rbuckton.github.io/reflect-metadata/#reflect.metadata /** * A default metadata decorator factory that can be used on a class, class member, or parameter. * @param metadataKey The key for the metadata entry. * @param metadataValue The value for the metadata entry. * @returns A decorator function. * @remarks * If `metadataKey` is already defined for the target and target key, the * metadataValue for that key will be overwritten. * @example * * // constructor * @Reflect.metadata(key, value) * class Example { * } * * // property (on constructor, TypeScript only) * class Example { * @Reflect.metadata(key, value) * static staticProperty; * } * * // property (on prototype, TypeScript only) * class Example { * @Reflect.metadata(key, value) * property; * } * * // method (on constructor) * class Example { * @Reflect.metadata(key, value) * static staticMethod() { } * } * * // method (on prototype) * class Example { * @Reflect.metadata(key, value) * method() { } * } * */ function metadata(metadataKey, metadataValue) { function decorator(target, propertyKey) { if (!IsObject(target)) throw new TypeError(); if (!IsUndefined(propertyKey) && !IsPropertyKey(propertyKey)) throw new TypeError(); OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey); } return decorator; } exporter("metadata", metadata); /** * Define a unique metadata entry on the target. * @param metadataKey A key used to store and retrieve metadata. * @param metadataValue A value that contains attached metadata. * @param target The target object on which to define metadata. * @param propertyKey (Optional) The property key for the target. * @example * * class Example { * // property declarations are not part of ES6, though they are valid in TypeScript: * // static staticProperty; * // property; * * constructor(p) { } * static staticMethod(p) { } * method(p) { } * } * * // constructor * Reflect.defineMetadata("custom:annotation", options, Example); * * // property (on constructor) * Reflect.defineMetadata("custom:annotation", options, Example, "staticProperty"); * * // property (on prototype) * Reflect.defineMetadata("custom:annotation", options, Example.prototype, "property"); * * // method (on constructor) * Reflect.defineMetadata("custom:annotation", options, Example, "staticMethod"); * * // method (on prototype) * Reflect.defineMetadata("custom:annotation", options, Example.prototype, "method"); * * // decorator factory as metadata-producing annotation. * function MyAnnotation(options): Decorator { * return (target, key?) => Reflect.defineMetadata("custom:annotation", options, target, key); * } * */ function defineMetadata(metadataKey, metadataValue, target, propertyKey) { if (!IsObject(target)) throw new TypeError(); if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey); return OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey); } exporter("defineMetadata", defineMetadata); /** * Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined. * @param metadataKey A key used to store and retrieve metadata. * @param target The target object on which the metadata is defined. * @param propertyKey (Optional) The property key for the target. * @returns `true` if the metadata key was defined on the target object or its prototype chain; otherwise, `false`. * @example * * class Example { * // property declarations are not part of ES6, though they are valid in TypeScript: * // static staticProperty; * // property; * * constructor(p) { } * static staticMethod(p) { } * method(p) { } * } * * // constructor * result = Reflect.hasMetadata("custom:annotation", Example); * * // property (on constructor) * result = Reflect.hasMetadata("custom:annotation", Example, "staticProperty"); * * // property (on prototype) * result = Reflect.hasMetadata("custom:annotation", Example.prototype, "property"); * * // method (on constructor) * result = Reflect.hasMetadata("custom:annotation", Example, "staticMethod"); * * // method (on prototype) * result = Reflect.hasMetadata("custom:annotation", Example.prototype, "method"); * */ function hasMetadata(metadataKey, target, propertyKey) { if (!IsObject(target)) throw new TypeError(); if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey); return OrdinaryHasMetadata(metadataKey, target, propertyKey); } exporter("hasMetadata", hasMetadata); /** * Gets a value indicating whether the target object has the provided metadata key defined. * @param metadataKey A key used to store and retrieve metadata. * @param target The target object on which the metadata is defined. * @param propertyKey (Optional) The property key for the target. * @returns `true` if the metadata key was defined on the target object; otherwise, `false`. * @example * * class Example { * // property declarations are not part of ES6, though they are valid in TypeScript: * // static staticProperty; * // property; * * constructor(p) { } * static staticMethod(p) { } * method(p) { } * } * * // constructor * result = Reflect.hasOwnMetadata("custom:annotation", Example); * * // property (on constructor) * result = Reflect.hasOwnMetadata("custom:annotation", Example, "staticProperty"); * * // property (on prototype) * result = Reflect.hasOwnMetadata("custom:annotation", Example.prototype, "property"); * * // method (on constructor) * result = Reflect.hasOwnMetadata("custom:annotation", Example, "staticMethod"); * * // method (on prototype) * result = Reflect.hasOwnMetadata("custom:annotation", Example.prototype, "method"); * */ function hasOwnMetadata(metadataKey, target, propertyKey) { if (!IsObject(target)) throw new TypeError(); if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey); return OrdinaryHasOwnMetadata(metadataKey, target, propertyKey); } exporter("hasOwnMetadata", hasOwnMetadata); /** * Gets the metadata value for the provided metadata key on the target object or its prototype chain. * @param metadataKey A key used to store and retrieve metadata. * @param target The target object on which the metadata is defined. * @param propertyKey (Optional) The property key for the target. * @returns The metadata value for the metadata key if found; otherwise, `undefined`. * @example * * class Example { * // property declarations are not part of ES6, though they are valid in TypeScript: * // static staticProperty; * // property; * * constructor(p) { } * static staticMethod(p) { } * method(p) { } * } * * // constructor * result = Reflect.getMetadata("custom:annotation", Example); * * // property (on constructor) * result = Reflect.getMetadata("custom:annotation", Example, "staticProperty"); * * // property (on prototype) * result = Reflect.getMetadata("custom:annotation", Example.prototype, "property"); * * // method (on constructor) * result = Reflect.getMetadata("custom:annotation", Example, "staticMethod"); * * // method (on prototype) * result = Reflect.getMetadata("custom:annotation", Example.prototype, "method"); * */ function getMetadata(metadataKey, target, propertyKey) { if (!IsObject(target)) throw new TypeError(); if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey); return OrdinaryGetMetadata(metadataKey, target, propertyKey); } exporter("getMetadata", getMetadata); /** * Gets the metadata value for the provided metadata key on the target object. * @param metadataKey A key used to store and retrieve metadata. * @param target The target object on which the metadata is defined. * @param propertyKey (Optional) The property key for the target. * @returns The metadata value for the metadata key if found; otherwise, `undefined`. * @example * * class Example { * // property declarations are not part of ES6, though they are valid in TypeScript: * // static staticProperty; * // property; * * constructor(p) { } * static staticMethod(p) { } * method(p) { } * } * * // constructor * result = Reflect.getOwnMetadata("custom:annotation", Example); * * // property (on constructor) * result = Reflect.getOwnMetadata("custom:annotation", Example, "staticProperty"); * * // property (on prototype) * result = Reflect.getOwnMetadata("custom:annotation", Example.prototype, "property"); * * // method (on constructor) * result = Reflect.getOwnMetadata("custom:annotation", Example, "staticMethod"); * * // method (on prototype) * result = Reflect.getOwnMetadata("custom:annotation", Example.prototype, "method"); * */ function getOwnMetadata(metadataKey, target, propertyKey) { if (!IsObject(target)) throw new TypeError(); if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey); return OrdinaryGetOwnMetadata(metadataKey, target, propertyKey); } exporter("getOwnMetadata", getOwnMetadata); /** * Gets the metadata keys defined on the target object or its prototype chain. * @param target The target object on which the metadata is defined. * @param propertyKey (Optional) The property key for the target. * @returns An array of unique metadata keys. * @example * * class Example { * // property declarations are not part of ES6, though they are valid in TypeScript: * // static staticProperty; * // property; * * constructor(p) { } * static staticMethod(p) { } * method(p) { } * } * * // constructor * result = Reflect.getMetadataKeys(Example); * * // property (on constructor) * result = Reflect.getMetadataKeys(Example, "staticProperty"); * * // property (on prototype) * result = Reflect.getMetadataKeys(Example.prototype, "property"); * * // method (on constructor) * result = Reflect.getMetadataKeys(Example, "staticMethod"); * * // method (on prototype) * result = Reflect.getMetadataKeys(Example.prototype, "method"); * */ function getMetadataKeys(target, propertyKey) { if (!IsObject(target)) throw new TypeError(); if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey); return OrdinaryMetadataKeys(target, propertyKey); } exporter("getMetadataKeys", getMetadataKeys); /** * Gets the unique metadata keys defined on the target object. * @param target The target object on which the metadata is defined. * @param propertyKey (Optional) The property key for the target. * @returns An array of unique metadata keys. * @example * * class Example { * // property declarations are not part of ES6, though they are valid in TypeScript: * // static staticProperty; * // property; * * constructor(p) { } * static staticMethod(p) { } * method(p) { } * } * * // constructor * result = Reflect.getOwnMetadataKeys(Example); * * // property (on constructor) * result = Reflect.getOwnMetadataKeys(Example, "staticProperty"); * * // property (on prototype) * result = Reflect.getOwnMetadataKeys(Example.prototype, "property"); * * // method (on constructor) * result = Reflect.getOwnMetadataKeys(Example, "staticMethod"); * * // method (on prototype) * result = Reflect.getOwnMetadataKeys(Example.prototype, "method"); * */ function getOwnMetadataKeys(target, propertyKey) { if (!IsObject(target)) throw new TypeError(); if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey); return OrdinaryOwnMetadataKeys(target, propertyKey); } exporter("getOwnMetadataKeys", getOwnMetadataKeys); /** * Deletes the metadata entry from the target object with the provided key. * @param metadataKey A key used to store and retrieve metadata. * @param target The target object on which the metadata is defined. * @param propertyKey (Optional) The property key for the target. * @returns `true` if the metadata entry was found and deleted; otherwise, false. * @example * * class Example { * // property declarations are not part of ES6, though they are valid in TypeScript: * // static staticProperty; * // property; * * constructor(p) { } * static staticMethod(p) { } * method(p) { } * } * * // constructor * result = Reflect.deleteMetadata("custom:annotation", Example); * * // property (on constructor) * result = Reflect.deleteMetadata("custom:annotation", Example, "staticProperty"); * * // property (on prototype) * result = Reflect.deleteMetadata("custom:annotation", Example.prototype, "property"); * * // method (on constructor) * result = Reflect.deleteMetadata("custom:annotation", Example, "staticMethod"); * * // method (on prototype) * result = Reflect.deleteMetadata("custom:annotation", Example.prototype, "method"); * */ function deleteMetadata(metadataKey, target, propertyKey) { if (!IsObject(target)) throw new TypeError(); if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey); var metadataMap = GetOrCreateMetadataMap(target, propertyKey, /*Create*/ false); if (IsUndefined(metadataMap)) return false; if (!metadataMap.delete(metadataKey)) return false; if (metadataMap.size > 0) return true; var targetMetadata = Metadata.get(target); targetMetadata.delete(propertyKey); if (targetMetadata.size > 0) return true; Metadata.delete(target); return true; } exporter("deleteMetadata", deleteMetadata); function DecorateConstructor(decorators, target) { for (var i = decorators.length - 1; i >= 0; --i) { var decorator = decorators[i]; var decorated = decorator(target); if (!IsUndefined(decorated) && !IsNull(decorated)) { if (!IsConstructor(decorated)) throw new TypeError(); target = decorated; } } return target; } function DecorateProperty(decorators, target, propertyKey, descriptor) { for (var i = decorators.length - 1; i >= 0; --i) { var decorator = decorators[i]; var decorated = decorator(target, propertyKey, descriptor); if (!IsUndefined(decorated) && !IsNull(decorated)) { if (!IsObject(decorated)) throw new TypeError(); descriptor = decorated; } } return descriptor; } function GetOrCreateMetadataMap(O, P, Create) { var targetMetadata = Metadata.get(O); if (IsUndefined(targetMetadata)) { if (!Create) return undefined; targetMetadata = new _Map(); Metadata.set(O, targetMetadata); } var metadataMap = targetMetadata.get(P); if (IsUndefined(metadataMap)) { if (!Create) return undefined; metadataMap = new _Map(); targetMetadata.set(P, metadataMap); } return metadataMap; } // 3.1.1.1 OrdinaryHasMetadata(MetadataKey, O, P) // https://rbuckton.github.io/reflect-metadata/#ordinaryhasmetadata function OrdinaryHasMetadata(MetadataKey, O, P) { var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P); if (hasOwn) return true; var parent = OrdinaryGetPrototypeOf(O); if (!IsNull(parent)) return OrdinaryHasMetadata(MetadataKey, parent, P); return false; } // 3.1.2.1 OrdinaryHasOwnMetadata(MetadataKey, O, P) // https://rbuckton.github.io/reflect-metadata/#ordinaryhasownmetadata function OrdinaryHasOwnMetadata(MetadataKey, O, P) { var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ false); if (IsUndefined(metadataMap)) return false; return ToBoolean(metadataMap.has(MetadataKey)); } // 3.1.3.1 OrdinaryGetMetadata(MetadataKey, O, P) // https://rbuckton.github.io/reflect-metadata/#ordinarygetmetadata function OrdinaryGetMetadata(MetadataKey, O, P) { var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P); if (hasOwn) return OrdinaryGetOwnMetadata(MetadataKey, O, P); var parent = OrdinaryGetPrototypeOf(O); if (!IsNull(parent)) return OrdinaryGetMetadata(MetadataKey, parent, P); return undefined; } // 3.1.4.1 OrdinaryGetOwnMetadata(MetadataKey, O, P) // https://rbuckton.github.io/reflect-metadata/#ordinarygetownmetadata function OrdinaryGetOwnMetadata(MetadataKey, O, P) { var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ false); if (IsUndefined(metadataMap)) return undefined; return metadataMap.get(MetadataKey); } // 3.1.5.1 OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) // https://rbuckton.github.io/reflect-metadata/#ordinarydefineownmetadata function OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) { var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ true); metadataMap.set(MetadataKey, MetadataValue); } // 3.1.6.1 OrdinaryMetadataKeys(O, P) // https://rbuckton.github.io/reflect-metadata/#ordinarymetadatakeys function OrdinaryMetadataKeys(O, P) { var ownKeys = OrdinaryOwnMetadataKeys(O, P); var parent = OrdinaryGetPrototypeOf(O); if (parent === null) return ownKeys; var parentKeys = OrdinaryMetadataKeys(parent, P); if (parentKeys.length <= 0) return ownKeys; if (ownKeys.length <= 0) return parentKeys; var set = new _Set(); var keys = []; for (var _i = 0, ownKeys_1 = ownKeys; _i < ownKeys_1.length; _i++) { var key = ownKeys_1[_i]; var hasKey = set.has(key); if (!hasKey) { set.add(key); keys.push(key); } } for (var _a = 0, parentKeys_1 = parentKeys; _a < parentKeys_1.length; _a++) { var key = parentKeys_1[_a]; var hasKey = set.has(key); if (!hasKey) { set.add(key); keys.push(key); } } return keys; } // 3.1.7.1 OrdinaryOwnMetadataKeys(O, P) // https://rbuckton.github.io/reflect-metadata/#ordinaryownmetadatakeys function OrdinaryOwnMetadataKeys(O, P) { var keys = []; var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ false); if (IsUndefined(metadataMap)) return keys; var keysObj = metadataMap.keys(); var iterator = GetIterator(keysObj); var k = 0; while (true) { var next = IteratorStep(iterator); if (!next) { keys.length = k; return keys; } var nextValue = IteratorValue(next); try { keys[k] = nextValue; } catch (e) { try { IteratorClose(iterator); } finally { throw e; } } k++; } } // 6 ECMAScript Data Typ0es and Values // https://tc39.github.io/ecma262/#sec-ecmascript-data-types-and-values function Type(x) { if (x === null) return 1 /* Null */; switch (typeof x) { case "undefined": return 0 /* Undefined */; case "boolean": return 2 /* Boolean */; case "string": return 3 /* String */; case "symbol": return 4 /* Symbol */; case "number": return 5 /* Number */; case "object": return x === null ? 1 /* Null */ : 6 /* Object */; default: return 6 /* Object */; } } // 6.1.1 The Undefined Type // https://tc39.github.io/ecma262/#sec-ecmascript-language-types-undefined-type function IsUndefined(x) { return x === undefined; } // 6.1.2 The Null Type // https://tc39.github.io/ecma262/#sec-ecmascript-language-types-null-type function IsNull(x) { return x === null; } // 6.1.5 The Symbol Type // https://tc39.github.io/ecma262/#sec-ecmascript-language-types-symbol-type function IsSymbol(x) { return typeof x === "symbol"; } // 6.1.7 The Object Type // https://tc39.github.io/ecma262/#sec-object-type function IsObject(x) { return typeof x === "object" ? x !== null : typeof x === "function"; } // 7.1 Type Conversion // https://tc39.github.io/ecma262/#sec-type-conversion // 7.1.1 ToPrimitive(input [, PreferredType]) // https://tc39.github.io/ecma262/#sec-toprimitive function ToPrimitive(input, PreferredType) { switch (Type(input)) { case 0 /* Undefined */: return input; case 1 /* Null */: return input; case 2 /* Boolean */: return input; case 3 /* String */: return input; case 4 /* Symbol */: return input; case 5 /* Number */: return input; } var hint = PreferredType === 3 /* String */ ? "string" : PreferredType === 5 /* Number */ ? "number" : "default"; var exoticToPrim = GetMethod(input, toPrimitiveSymbol); if (exoticToPrim !== undefined) { var result = exoticToPrim.call(input, hint); if (IsObject(result)) throw new TypeError(); return result; } return OrdinaryToPrimitive(input, hint === "default" ? "number" : hint); } // 7.1.1.1 OrdinaryToPrimitive(O, hint) // https://tc39.github.io/ecma262/#sec-ordinarytoprimitive function OrdinaryToPrimitive(O, hint) { if (hint === "string") { var toString_1 = O.toString; if (IsCallable(toString_1)) { var result = toString_1.call(O); if (!IsObject(result)) return result; } var valueOf = O.valueOf; if (IsCallable(valueOf)) { var result = valueOf.call(O); if (!IsObject(result)) return result; } } else { var valueOf = O.valueOf; if (IsCallable(valueOf)) { var result = valueOf.call(O); if (!IsObject(result)) return result; } var toString_2 = O.toString; if (IsCallable(toString_2)) { var result = toString_2.call(O); if (!IsObject(result)) return result; } } throw new TypeError(); } // 7.1.2 ToBoolean(argument) // https://tc39.github.io/ecma262/2016/#sec-toboolean function ToBoolean(argument) { return !!argument; } // 7.1.12 ToString(argument) // https://tc39.github.io/ecma262/#sec-tostring function ToString(argument) { return "" + argument; } // 7.1.14 ToPropertyKey(argument) // https://tc39.github.io/ecma262/#sec-topropertykey function ToPropertyKey(argument) { var key = ToPrimitive(argument, 3 /* String */); if (IsSymbol(key)) return key; return ToString(key); } // 7.2 Testing and Comparison Operations // https://tc39.github.io/ecma262/#sec-testing-and-comparison-operations // 7.2.2 IsArray(argument) // https://tc39.github.io/ecma262/#sec-isarray function IsArray(argument) { return Array.isArray ? Array.isArray(argument) : argument instanceof Object ? argument instanceof Array : Object.prototype.toString.call(argument) === "[object Array]"; } // 7.2.3 IsCallable(argument) // https://tc39.github.io/ecma262/#sec-iscallable function IsCallable(argument) { // NOTE: This is an approximation as we cannot check for [[Call]] internal method. return typeof argument === "function"; } // 7.2.4 IsConstructor(argument) // https://tc39.github.io/ecma262/#sec-isconstructor function IsConstructor(argument) { // NOTE: This is an approximation as we cannot check for [[Construct]] internal method. return typeof argument === "function"; } // 7.2.7 IsPropertyKey(argument) // https://tc39.github.io/ecma262/#sec-ispropertykey function IsPropertyKey(argument) { switch (Type(argument)) { case 3 /* String */: return true; case 4 /* Symbol */: return true; default: return false; } } // 7.3 Operations on Objects // https://tc39.github.io/ecma262/#sec-operations-on-objects // 7.3.9 GetMethod(V, P) // https://tc39.github.io/ecma262/#sec-getmethod function GetMethod(V, P) { var func = V[P]; if (func === undefined || func === null) return undefined; if (!IsCallable(func)) throw new TypeError(); return func; } // 7.4 Operations on Iterator Objects // https://tc39.github.io/ecma262/#sec-operations-on-iterator-objects function GetIterator(obj) { var method = GetMethod(obj, iteratorSymbol); if (!IsCallable(method)) throw new TypeError(); // from Call var iterator = method.call(obj); if (!IsObject(iterator)) throw new TypeError(); return iterator; } // 7.4.4 IteratorValue(iterResult) // https://tc39.github.io/ecma262/2016/#sec-iteratorvalue function IteratorValue(iterResult) { return iterResult.value; } // 7.4.5 IteratorStep(iterator) // https://tc39.github.io/ecma262/#sec-iteratorstep function IteratorStep(iterator) { var result = iterator.next(); return result.done ? false : result; } // 7.4.6 IteratorClose(iterator, completion) // https://tc39.github.io/ecma262/#sec-iteratorclose function IteratorClose(iterator) { var f = iterator["return"]; if (f) f.call(iterator); } // 9.1 Ordinary Object Internal Methods and Internal Slots // https://tc39.github.io/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots // 9.1.1.1 OrdinaryGetPrototypeOf(O) // https://tc39.github.io/ecma262/#sec-ordinarygetprototypeof function OrdinaryGetPrototypeOf(O) { var proto = Object.getPrototypeOf(O); if (typeof O !== "function" || O === functionPrototype) return proto; // TypeScript doesn't set __proto__ in ES5, as it's non-standard. // Try to determine the superclass constructor. Compatible implementations // must either set __proto__ on a subclass constructor to the superclass constructor, // or ensure each class has a valid `constructor` property on its prototype that // points back to the constructor. // If this is not the same as Function.[[Prototype]], then this is definately inherited. // This is the case when in ES6 or when using __proto__ in a compatible browser. if (proto !== functionPrototype) return proto; // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage. var prototype = O.prototype; var prototypeProto = prototype && Object.getPrototypeOf(prototype); if (prototypeProto == null || prototypeProto === Object.prototype) return proto; // If the constructor was not a function, then we cannot determine the heritage. var constructor = prototypeProto.constructor; if (typeof constructor !== "function") return proto; // If we have some kind of self-reference, then we cannot determine the heritage. if (constructor === O) return proto; // we have a pretty good guess at the heritage. return constructor; } // naive Map shim function CreateMapPolyfill() { var cacheSentinel = {}; var arraySentinel = []; var MapIterator = /** @class */ (function () { function MapIterator(keys, values, selector) { this._index = 0; this._keys = keys; this._values = values; this._selector = selector; } MapIterator.prototype["@@iterator"] = function () { return this; }; MapIterator.prototype[iteratorSymbol] = function () { return this; }; MapIterator.prototype.next = function () { var index = this._index; if (index >= 0 && index < this._keys.length) { var result = this._selector(this._keys[index], this._values[index]); if (index + 1 >= this._keys.length) { this._index = -1; this._keys = arraySentinel; this._values = arraySentinel; } else { this._index++; } return { value: result, done: false }; } return { value: undefined, done: true }; }; MapIterator.prototype.throw = function (error) { if (this._index >= 0) { this._index = -1; this._keys = arraySentinel; this._values = arraySentinel; } throw error; }; MapIterator.prototype.return = function (value) { if (this._index >= 0) { this._index = -1; this._keys = arraySentinel; this._values = arraySentinel; } return { value: value, done: true }; }; return MapIterator; }()); return /** @class */ (function () { function Map() { this._keys = []; this._values = []; this._cacheKey = cacheSentinel; this._cacheIndex = -2; } Object.defineProperty(Map.prototype, "size", { get: function () { return this._keys.length; }, enumerable: true, configurable: true }); Map.prototype.has = function (key) { return this._find(key, /*insert*/ false) >= 0; }; Map.prototype.get = function (key) { var index = this._find(key, /*insert*/ false); return index >= 0 ? this._values[index] : undefined; }; Map.prototype.set = function (key, value) { var index = this._find(key, /*insert*/ true); this._values[index] = value; return this; }; Map.prototype.delete = function (key) { var index = this._find(key, /*insert*/ false); if (index >= 0) { var size = this._keys.length; for (var i = index + 1; i < size; i++) { this._keys[i - 1] = this._keys[i]; this._values[i - 1] = this._values[i]; } this._keys.length--; this._values.length--; if (key === this._cacheKey) { this._cacheKey = cacheSentinel; this._cacheIndex = -2; } return true; } return false; }; Map.prototype.clear = function () { this._keys.length = 0; this._values.length = 0; this._cacheKey = cacheSentinel; this._cacheIndex = -2; }; Map.prototype.keys = function () { return new MapIterator(this._keys, this._values, getKey); }; Map.prototype.values = function () { return new MapIterator(this._keys, this._values, getValue); }; Map.prototype.entries = function () { return new MapIterator(this._keys, this._values, getEntry); }; Map.prototype["@@iterator"] = function () { return this.entries(); }; Map.prototype[iteratorSymbol] = function () { return this.entries(); }; Map.prototype._find = function (key, insert) { if (this._cacheKey !== key) { this._cacheIndex = this._keys.indexOf(this._cacheKey = key); } if (this._cacheIndex < 0 && insert) { this._cacheIndex = this._keys.length; this._keys.push(key); this._values.push(undefined); } return this._cacheIndex; }; return Map; }()); function getKey(key, _) { return key; } function getValue(_, value) { return value; } function getEntry(key, value) { return [key, value]; } } // naive Set shim function CreateSetPolyfill() { return /** @class */ (function () { function Set() { this._map = new _Map(); } Object.defineProperty(Set.prototype, "size", { get: function () { return this._map.size; }, enumerable: true, configurable: true }); Set.prototype.has = function (value) { return this._map.has(value); }; Set.prototype.add = function (value) { return this._map.set(value, value), this; }; Set.prototype.delete = function (value) { return this._map.delete(value); }; Set.prototype.clear = function () { this._map.clear(); }; Set.prototype.keys = function () { return this._map.keys(); }; Set.prototype.values = function () { return this._map.values(); }; Set.prototype.entries = function () { return this._map.entries(); }; Set.prototype["@@iterator"] = function () { return this.keys(); }; Set.prototype[iteratorSymbol] = function () { return this.keys(); }; return Set; }()); } // naive WeakMap shim function CreateWeakMapPolyfill() { var UUID_SIZE = 16; var keys = HashMap.create(); var rootKey = CreateUniqueKey(); return /** @class */ (function () { function WeakMap() { this._key = CreateUniqueKey(); } WeakMap.prototype.has = function (target) { var table = GetOrCreateWeakMapTable(target, /*create*/ false); return table !== undefined ? HashMap.has(table, this._key) : false; }; WeakMap.prototype.get = function (target) { var table = GetOrCreateWeakMapTable(target, /*create*/ false); return table !== undefined ? HashMap.get(table, this._key) : undefined; }; WeakMap.prototype.set = function (target, value) { var table = GetOrCreateWeakMapTable(target, /*create*/ true); table[this._key] = value; return this; }; WeakMap.prototype.delete = function (target) { var table = GetOrCreateWeakMapTable(target, /*create*/ false); return table !== undefined ? delete table[this._key] : false; }; WeakMap.prototype.clear = function () { // NOTE: not a real clear, just makes the previous data unreachable this._key = CreateUniqueKey(); }; return WeakMap; }()); function CreateUniqueKey() { var key; do key = "@@WeakMap@@" + CreateUUID(); while (HashMap.has(keys, key)); keys[key] = true; return key; } function GetOrCreateWeakMapTable(target, create) { if (!hasOwn.call(target, rootKey)) { if (!create) return undefined; Object.defineProperty(target, rootKey, { value: HashMap.create() }); } return target[rootKey]; } function FillRandomBytes(buffer, size) { for (var i = 0; i < size; ++i) buffer[i] = Math.random() * 0xff | 0; return buffer; } function GenRandomBytes(size) { if (typeof Uint8Array === "function") { if (typeof crypto !== "undefined") return crypto.getRandomValues(new Uint8Array(size)); if (typeof msCrypto !== "undefined") return msCrypto.getRandomValues(new Uint8Array(size)); return FillRandomBytes(new Uint8Array(size), size); } return FillRandomBytes(new Array(size), size); } function CreateUUID() { var data = GenRandomBytes(UUID_SIZE); // mark as random - RFC 4122 § 4.4 data[6] = data[6] & 0x4f | 0x40; data[8] = data[8] & 0xbf | 0x80; var result = ""; for (var offset = 0; offset < UUID_SIZE; ++offset) { var byte = data[offset]; if (offset === 4 || offset === 6 || offset === 8) result += "-"; if (byte < 16) result += "0"; result += byte.toString(16).toLowerCase(); } return result; } } // uses a heuristic used by v8 and chakra to force an object into dictionary mode. function MakeDictionary(obj) { obj.__ = undefined; delete obj.__; return obj; } }); })(Reflect || (Reflect = {})); /***/ }), /***/ "./node_modules/safe-buffer/index.js": /*!*******************************************!*\ !*** ./node_modules/safe-buffer/index.js ***! \*******************************************/ /***/ ((module, exports, __webpack_require__) => { /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */ /* eslint-disable node/no-deprecated-api */ var buffer = __webpack_require__(/*! buffer */ "buffer") var Buffer = buffer.Buffer // alternative to using Object.keys for old browsers function copyProps (src, dst) { for (var key in src) { dst[key] = src[key] } } if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { module.exports = buffer } else { // Copy properties from require('buffer') copyProps(buffer, exports) exports.Buffer = SafeBuffer } function SafeBuffer (arg, encodingOrOffset, length) { return Buffer(arg, encodingOrOffset, length) } SafeBuffer.prototype = Object.create(Buffer.prototype) // Copy static methods from Buffer copyProps(Buffer, SafeBuffer) SafeBuffer.from = function (arg, encodingOrOffset, length) { if (typeof arg === 'number') { throw new TypeError('Argument must not be a number') } return Buffer(arg, encodingOrOffset, length) } SafeBuffer.alloc = function (size, fill, encoding) { if (typeof size !== 'number') { throw new TypeError('Argument must be a number') } var buf = Buffer(size) if (fill !== undefined) { if (typeof encoding === 'string') { buf.fill(fill, encoding) } else { buf.fill(fill) } } else { buf.fill(0) } return buf } SafeBuffer.allocUnsafe = function (size) { if (typeof size !== 'number') { throw new TypeError('Argument must be a number') } return Buffer(size) } SafeBuffer.allocUnsafeSlow = function (size) { if (typeof size !== 'number') { throw new TypeError('Argument must be a number') } return buffer.SlowBuffer(size) } /***/ }), /***/ "./node_modules/safer-buffer/safer.js": /*!********************************************!*\ !*** ./node_modules/safer-buffer/safer.js ***! \********************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /* eslint-disable node/no-deprecated-api */ var buffer = __webpack_require__(/*! buffer */ "buffer") var Buffer = buffer.Buffer var safer = {} var key for (key in buffer) { if (!buffer.hasOwnProperty(key)) continue if (key === 'SlowBuffer' || key === 'Buffer') continue safer[key] = buffer[key] } var Safer = safer.Buffer = {} for (key in Buffer) { if (!Buffer.hasOwnProperty(key)) continue if (key === 'allocUnsafe' || key === 'allocUnsafeSlow') continue Safer[key] = Buffer[key] } safer.Buffer.prototype = Buffer.prototype if (!Safer.from || Safer.from === Uint8Array.from) { Safer.from = function (value, encodingOrOffset, length) { if (typeof value === 'number') { throw new TypeError('The "value" argument must not be of type number. Received type ' + typeof value) } if (value && typeof value.length === 'undefined') { throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type ' + typeof value) } return Buffer(value, encodingOrOffset, length) } } if (!Safer.alloc) { Safer.alloc = function (size, fill, encoding) { if (typeof size !== 'number') { throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size) } if (size < 0 || size >= 2 * (1 << 30)) { throw new RangeError('The value "' + size + '" is invalid for option "size"') } var buf = Buffer(size) if (!fill || fill.length === 0) { buf.fill(0) } else if (typeof encoding === 'string') { buf.fill(fill, encoding) } else { buf.fill(fill) } return buf } } if (!safer.kStringMaxLength) { try { safer.kStringMaxLength = process.binding('buffer').kStringMaxLength } catch (e) { // we can't determine kStringMaxLength in environments where process.binding // is unsupported, so let's not set it } } if (!safer.constants) { safer.constants = { MAX_LENGTH: safer.kMaxLength } if (safer.kStringMaxLength) { safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength } } module.exports = safer /***/ }), /***/ "./node_modules/source-map-js/lib/array-set.js": /*!*****************************************************!*\ !*** ./node_modules/source-map-js/lib/array-set.js ***! \*****************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause */ var util = __webpack_require__(/*! ./util */ "./node_modules/source-map-js/lib/util.js"); var has = Object.prototype.hasOwnProperty; var hasNativeMap = typeof Map !== "undefined"; /** * A data structure which is a combination of an array and a set. Adding a new * member is O(1), testing for membership is O(1), and finding the index of an * element is O(1). Removing elements from the set is not supported. Only * strings are supported for membership. */ function ArraySet() { this._array = []; this._set = hasNativeMap ? new Map() : Object.create(null); } /** * Static method for creating ArraySet instances from an existing array. */ ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { var set = new ArraySet(); for (var i = 0, len = aArray.length; i < len; i++) { set.add(aArray[i], aAllowDuplicates); } return set; }; /** * Return how many unique items are in this ArraySet. If duplicates have been * added, than those do not count towards the size. * * @returns Number */ ArraySet.prototype.size = function ArraySet_size() { return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length; }; /** * Add the given string to this set. * * @param String aStr */ ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { var sStr = hasNativeMap ? aStr : util.toSetString(aStr); var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr); var idx = this._array.length; if (!isDuplicate || aAllowDuplicates) { this._array.push(aStr); } if (!isDuplicate) { if (hasNativeMap) { this._set.set(aStr, idx); } else { this._set[sStr] = idx; } } }; /** * Is the given string a member of this set? * * @param String aStr */ ArraySet.prototype.has = function ArraySet_has(aStr) { if (hasNativeMap) { return this._set.has(aStr); } else { var sStr = util.toSetString(aStr); return has.call(this._set, sStr); } }; /** * What is the index of the given string in the array? * * @param String aStr */ ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { if (hasNativeMap) { var idx = this._set.get(aStr); if (idx >= 0) { return idx; } } else { var sStr = util.toSetString(aStr); if (has.call(this._set, sStr)) { return this._set[sStr]; } } throw new Error('"' + aStr + '" is not in the set.'); }; /** * What is the element at the given index? * * @param Number aIdx */ ArraySet.prototype.at = function ArraySet_at(aIdx) { if (aIdx >= 0 && aIdx < this._array.length) { return this._array[aIdx]; } throw new Error('No element indexed by ' + aIdx); }; /** * Returns the array representation of this set (which has the proper indices * indicated by indexOf). Note that this is a copy of the internal array used * for storing the members so that no one can mess with internal state. */ ArraySet.prototype.toArray = function ArraySet_toArray() { return this._array.slice(); }; exports.ArraySet = ArraySet; /***/ }), /***/ "./node_modules/source-map-js/lib/base64-vlq.js": /*!******************************************************!*\ !*** ./node_modules/source-map-js/lib/base64-vlq.js ***! \******************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause * * Based on the Base 64 VLQ implementation in Closure Compiler: * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java * * Copyright 2011 The Closure Compiler Authors. All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ var base64 = __webpack_require__(/*! ./base64 */ "./node_modules/source-map-js/lib/base64.js"); // A single base 64 digit can contain 6 bits of data. For the base 64 variable // length quantities we use in the source map spec, the first bit is the sign, // the next four bits are the actual value, and the 6th bit is the // continuation bit. The continuation bit tells us whether there are more // digits in this value following this digit. // // Continuation // | Sign // | | // V V // 101011 var VLQ_BASE_SHIFT = 5; // binary: 100000 var VLQ_BASE = 1 << VLQ_BASE_SHIFT; // binary: 011111 var VLQ_BASE_MASK = VLQ_BASE - 1; // binary: 100000 var VLQ_CONTINUATION_BIT = VLQ_BASE; /** * Converts from a two-complement value to a value where the sign bit is * placed in the least significant bit. For example, as decimals: * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) */ function toVLQSigned(aValue) { return aValue < 0 ? ((-aValue) << 1) + 1 : (aValue << 1) + 0; } /** * Converts to a two-complement value from a value where the sign bit is * placed in the least significant bit. For example, as decimals: * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 */ function fromVLQSigned(aValue) { var isNegative = (aValue & 1) === 1; var shifted = aValue >> 1; return isNegative ? -shifted : shifted; } /** * Returns the base 64 VLQ encoded value. */ exports.encode = function base64VLQ_encode(aValue) { var encoded = ""; var digit; var vlq = toVLQSigned(aValue); do { digit = vlq & VLQ_BASE_MASK; vlq >>>= VLQ_BASE_SHIFT; if (vlq > 0) { // There are still more digits in this value, so we must make sure the // continuation bit is marked. digit |= VLQ_CONTINUATION_BIT; } encoded += base64.encode(digit); } while (vlq > 0); return encoded; }; /** * Decodes the next base 64 VLQ value from the given string and returns the * value and the rest of the string via the out parameter. */ exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) { var strLen = aStr.length; var result = 0; var shift = 0; var continuation, digit; do { if (aIndex >= strLen) { throw new Error("Expected more digits in base 64 VLQ value."); } digit = base64.decode(aStr.charCodeAt(aIndex++)); if (digit === -1) { throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1)); } continuation = !!(digit & VLQ_CONTINUATION_BIT); digit &= VLQ_BASE_MASK; result = result + (digit << shift); shift += VLQ_BASE_SHIFT; } while (continuation); aOutParam.value = fromVLQSigned(result); aOutParam.rest = aIndex; }; /***/ }), /***/ "./node_modules/source-map-js/lib/base64.js": /*!**************************************************!*\ !*** ./node_modules/source-map-js/lib/base64.js ***! \**************************************************/ /***/ ((__unused_webpack_module, exports) => { /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause */ var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); /** * Encode an integer in the range of 0 to 63 to a single base 64 digit. */ exports.encode = function (number) { if (0 <= number && number < intToCharMap.length) { return intToCharMap[number]; } throw new TypeError("Must be between 0 and 63: " + number); }; /** * Decode a single base 64 character code digit to an integer. Returns -1 on * failure. */ exports.decode = function (charCode) { var bigA = 65; // 'A' var bigZ = 90; // 'Z' var littleA = 97; // 'a' var littleZ = 122; // 'z' var zero = 48; // '0' var nine = 57; // '9' var plus = 43; // '+' var slash = 47; // '/' var littleOffset = 26; var numberOffset = 52; // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ if (bigA <= charCode && charCode <= bigZ) { return (charCode - bigA); } // 26 - 51: abcdefghijklmnopqrstuvwxyz if (littleA <= charCode && charCode <= littleZ) { return (charCode - littleA + littleOffset); } // 52 - 61: 0123456789 if (zero <= charCode && charCode <= nine) { return (charCode - zero + numberOffset); } // 62: + if (charCode == plus) { return 62; } // 63: / if (charCode == slash) { return 63; } // Invalid base64 digit. return -1; }; /***/ }), /***/ "./node_modules/source-map-js/lib/binary-search.js": /*!*********************************************************!*\ !*** ./node_modules/source-map-js/lib/binary-search.js ***! \*********************************************************/ /***/ ((__unused_webpack_module, exports) => { /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause */ exports.GREATEST_LOWER_BOUND = 1; exports.LEAST_UPPER_BOUND = 2; /** * Recursive implementation of binary search. * * @param aLow Indices here and lower do not contain the needle. * @param aHigh Indices here and higher do not contain the needle. * @param aNeedle The element being searched for. * @param aHaystack The non-empty array being searched. * @param aCompare Function which takes two elements and returns -1, 0, or 1. * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the * closest element that is smaller than or greater than the one we are * searching for, respectively, if the exact element cannot be found. */ function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { // This function terminates when one of the following is true: // // 1. We find the exact element we are looking for. // // 2. We did not find the exact element, but we can return the index of // the next-closest element. // // 3. We did not find the exact element, and there is no next-closest // element than the one we are searching for, so we return -1. var mid = Math.floor((aHigh - aLow) / 2) + aLow; var cmp = aCompare(aNeedle, aHaystack[mid], true); if (cmp === 0) { // Found the element we are looking for. return mid; } else if (cmp > 0) { // Our needle is greater than aHaystack[mid]. if (aHigh - mid > 1) { // The element is in the upper half. return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias); } // The exact needle element was not found in this haystack. Determine if // we are in termination case (3) or (2) and return the appropriate thing. if (aBias == exports.LEAST_UPPER_BOUND) { return aHigh < aHaystack.length ? aHigh : -1; } else { return mid; } } else { // Our needle is less than aHaystack[mid]. if (mid - aLow > 1) { // The element is in the lower half. return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); } // we are in termination case (3) or (2) and return the appropriate thing. if (aBias == exports.LEAST_UPPER_BOUND) { return mid; } else { return aLow < 0 ? -1 : aLow; } } } /** * This is an implementation of binary search which will always try and return * the index of the closest element if there is no exact hit. This is because * mappings between original and generated line/col pairs are single points, * and there is an implicit region between each of them, so a miss just means * that you aren't on the very start of a region. * * @param aNeedle The element you are looking for. * @param aHaystack The array that is being searched. * @param aCompare A function which takes the needle and an element in the * array and returns -1, 0, or 1 depending on whether the needle is less * than, equal to, or greater than the element, respectively. * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the * closest element that is smaller than or greater than the one we are * searching for, respectively, if the exact element cannot be found. * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'. */ exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { if (aHaystack.length === 0) { return -1; } var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, aCompare, aBias || exports.GREATEST_LOWER_BOUND); if (index < 0) { return -1; } // We have found either the exact element, or the next-closest element than // the one we are searching for. However, there may be more than one such // element. Make sure we always return the smallest of these. while (index - 1 >= 0) { if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) { break; } --index; } return index; }; /***/ }), /***/ "./node_modules/source-map-js/lib/mapping-list.js": /*!********************************************************!*\ !*** ./node_modules/source-map-js/lib/mapping-list.js ***! \********************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2014 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause */ var util = __webpack_require__(/*! ./util */ "./node_modules/source-map-js/lib/util.js"); /** * Determine whether mappingB is after mappingA with respect to generated * position. */ function generatedPositionAfter(mappingA, mappingB) { // Optimized for most common case var lineA = mappingA.generatedLine; var lineB = mappingB.generatedLine; var columnA = mappingA.generatedColumn; var columnB = mappingB.generatedColumn; return lineB > lineA || lineB == lineA && columnB >= columnA || util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; } /** * A data structure to provide a sorted view of accumulated mappings in a * performance conscious manner. It trades a neglibable overhead in general * case for a large speedup in case of mappings being added in order. */ function MappingList() { this._array = []; this._sorted = true; // Serves as infimum this._last = {generatedLine: -1, generatedColumn: 0}; } /** * Iterate through internal items. This method takes the same arguments that * `Array.prototype.forEach` takes. * * NOTE: The order of the mappings is NOT guaranteed. */ MappingList.prototype.unsortedForEach = function MappingList_forEach(aCallback, aThisArg) { this._array.forEach(aCallback, aThisArg); }; /** * Add the given source mapping. * * @param Object aMapping */ MappingList.prototype.add = function MappingList_add(aMapping) { if (generatedPositionAfter(this._last, aMapping)) { this._last = aMapping; this._array.push(aMapping); } else { this._sorted = false; this._array.push(aMapping); } }; /** * Returns the flat, sorted array of mappings. The mappings are sorted by * generated position. * * WARNING: This method returns internal data without copying, for * performance. The return value must NOT be mutated, and should be treated as * an immutable borrow. If you want to take ownership, you must make your own * copy. */ MappingList.prototype.toArray = function MappingList_toArray() { if (!this._sorted) { this._array.sort(util.compareByGeneratedPositionsInflated); this._sorted = true; } return this._array; }; exports.MappingList = MappingList; /***/ }), /***/ "./node_modules/source-map-js/lib/quick-sort.js": /*!******************************************************!*\ !*** ./node_modules/source-map-js/lib/quick-sort.js ***! \******************************************************/ /***/ ((__unused_webpack_module, exports) => { /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause */ // It turns out that some (most?) JavaScript engines don't self-host // `Array.prototype.sort`. This makes sense because C++ will likely remain // faster than JS when doing raw CPU-intensive sorting. However, when using a // custom comparator function, calling back and forth between the VM's C++ and // JIT'd JS is rather slow *and* loses JIT type information, resulting in // worse generated code for the comparator function than would be optimal. In // fact, when sorting with a comparator, these costs outweigh the benefits of // sorting in C++. By using our own JS-implemented Quick Sort (below), we get // a ~3500ms mean speed-up in `bench/bench.html`. function SortTemplate(comparator) { /** * Swap the elements indexed by `x` and `y` in the array `ary`. * * @param {Array} ary * The array. * @param {Number} x * The index of the first item. * @param {Number} y * The index of the second item. */ function swap(ary, x, y) { var temp = ary[x]; ary[x] = ary[y]; ary[y] = temp; } /** * Returns a random integer within the range `low .. high` inclusive. * * @param {Number} low * The lower bound on the range. * @param {Number} high * The upper bound on the range. */ function randomIntInRange(low, high) { return Math.round(low + (Math.random() * (high - low))); } /** * The Quick Sort algorithm. * * @param {Array} ary * An array to sort. * @param {function} comparator * Function to use to compare two items. * @param {Number} p * Start index of the array * @param {Number} r * End index of the array */ function doQuickSort(ary, comparator, p, r) { // If our lower bound is less than our upper bound, we (1) partition the // array into two pieces and (2) recurse on each half. If it is not, this is // the empty array and our base case. if (p < r) { // (1) Partitioning. // // The partitioning chooses a pivot between `p` and `r` and moves all // elements that are less than or equal to the pivot to the before it, and // all the elements that are greater than it after it. The effect is that // once partition is done, the pivot is in the exact place it will be when // the array is put in sorted order, and it will not need to be moved // again. This runs in O(n) time. // Always choose a random pivot so that an input array which is reverse // sorted does not cause O(n^2) running time. var pivotIndex = randomIntInRange(p, r); var i = p - 1; swap(ary, pivotIndex, r); var pivot = ary[r]; // Immediately after `j` is incremented in this loop, the following hold // true: // // * Every element in `ary[p .. i]` is less than or equal to the pivot. // // * Every element in `ary[i+1 .. j-1]` is greater than the pivot. for (var j = p; j < r; j++) { if (comparator(ary[j], pivot, false) <= 0) { i += 1; swap(ary, i, j); } } swap(ary, i + 1, j); var q = i + 1; // (2) Recurse on each half. doQuickSort(ary, comparator, p, q - 1); doQuickSort(ary, comparator, q + 1, r); } } return doQuickSort; } function cloneSort(comparator) { let template = SortTemplate.toString(); let templateFn = new Function(`return ${template}`)(); return templateFn(comparator); } /** * Sort the given array in-place with the given comparator function. * * @param {Array} ary * An array to sort. * @param {function} comparator * Function to use to compare two items. */ let sortCache = new WeakMap(); exports.quickSort = function (ary, comparator, start = 0) { let doQuickSort = sortCache.get(comparator); if (doQuickSort === void 0) { doQuickSort = cloneSort(comparator); sortCache.set(comparator, doQuickSort); } doQuickSort(ary, comparator, start, ary.length - 1); }; /***/ }), /***/ "./node_modules/source-map-js/lib/source-map-consumer.js": /*!***************************************************************!*\ !*** ./node_modules/source-map-js/lib/source-map-consumer.js ***! \***************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause */ var util = __webpack_require__(/*! ./util */ "./node_modules/source-map-js/lib/util.js"); var binarySearch = __webpack_require__(/*! ./binary-search */ "./node_modules/source-map-js/lib/binary-search.js"); var ArraySet = (__webpack_require__(/*! ./array-set */ "./node_modules/source-map-js/lib/array-set.js").ArraySet); var base64VLQ = __webpack_require__(/*! ./base64-vlq */ "./node_modules/source-map-js/lib/base64-vlq.js"); var quickSort = (__webpack_require__(/*! ./quick-sort */ "./node_modules/source-map-js/lib/quick-sort.js").quickSort); function SourceMapConsumer(aSourceMap, aSourceMapURL) { var sourceMap = aSourceMap; if (typeof aSourceMap === 'string') { sourceMap = util.parseSourceMapInput(aSourceMap); } return sourceMap.sections != null ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) : new BasicSourceMapConsumer(sourceMap, aSourceMapURL); } SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) { return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL); } /** * The version of the source mapping spec that we are consuming. */ SourceMapConsumer.prototype._version = 3; // `__generatedMappings` and `__originalMappings` are arrays that hold the // parsed mapping coordinates from the source map's "mappings" attribute. They // are lazily instantiated, accessed via the `_generatedMappings` and // `_originalMappings` getters respectively, and we only parse the mappings // and create these arrays once queried for a source location. We jump through // these hoops because there can be many thousands of mappings, and parsing // them is expensive, so we only want to do it if we must. // // Each object in the arrays is of the form: // // { // generatedLine: The line number in the generated code, // generatedColumn: The column number in the generated code, // source: The path to the original source file that generated this // chunk of code, // originalLine: The line number in the original source that // corresponds to this chunk of generated code, // originalColumn: The column number in the original source that // corresponds to this chunk of generated code, // name: The name of the original symbol which generated this chunk of // code. // } // // All properties except for `generatedLine` and `generatedColumn` can be // `null`. // // `_generatedMappings` is ordered by the generated positions. // // `_originalMappings` is ordered by the original positions. SourceMapConsumer.prototype.__generatedMappings = null; Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', { configurable: true, enumerable: true, get: function () { if (!this.__generatedMappings) { this._parseMappings(this._mappings, this.sourceRoot); } return this.__generatedMappings; } }); SourceMapConsumer.prototype.__originalMappings = null; Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', { configurable: true, enumerable: true, get: function () { if (!this.__originalMappings) { this._parseMappings(this._mappings, this.sourceRoot); } return this.__originalMappings; } }); SourceMapConsumer.prototype._charIsMappingSeparator = function SourceMapConsumer_charIsMappingSeparator(aStr, index) { var c = aStr.charAt(index); return c === ";" || c === ","; }; /** * Parse the mappings in a string in to a data structure which we can easily * query (the ordered arrays in the `this.__generatedMappings` and * `this.__originalMappings` properties). */ SourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { throw new Error("Subclasses must implement _parseMappings"); }; SourceMapConsumer.GENERATED_ORDER = 1; SourceMapConsumer.ORIGINAL_ORDER = 2; SourceMapConsumer.GREATEST_LOWER_BOUND = 1; SourceMapConsumer.LEAST_UPPER_BOUND = 2; /** * Iterate over each mapping between an original source/line/column and a * generated line/column in this source map. * * @param Function aCallback * The function that is called with each mapping. * @param Object aContext * Optional. If specified, this object will be the value of `this` every * time that `aCallback` is called. * @param aOrder * Either `SourceMapConsumer.GENERATED_ORDER` or * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to * iterate over the mappings sorted by the generated file's line/column * order or the original's source/line/column order, respectively. Defaults to * `SourceMapConsumer.GENERATED_ORDER`. */ SourceMapConsumer.prototype.eachMapping = function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { var context = aContext || null; var order = aOrder || SourceMapConsumer.GENERATED_ORDER; var mappings; switch (order) { case SourceMapConsumer.GENERATED_ORDER: mappings = this._generatedMappings; break; case SourceMapConsumer.ORIGINAL_ORDER: mappings = this._originalMappings; break; default: throw new Error("Unknown order of iteration."); } var sourceRoot = this.sourceRoot; var boundCallback = aCallback.bind(context); var names = this._names; var sources = this._sources; var sourceMapURL = this._sourceMapURL; for (var i = 0, n = mappings.length; i < n; i++) { var mapping = mappings[i]; var source = mapping.source === null ? null : sources.at(mapping.source); if(source !== null) { source = util.computeSourceURL(sourceRoot, source, sourceMapURL); } boundCallback({ source: source, generatedLine: mapping.generatedLine, generatedColumn: mapping.generatedColumn, originalLine: mapping.originalLine, originalColumn: mapping.originalColumn, name: mapping.name === null ? null : names.at(mapping.name) }); } }; /** * Returns all generated line and column information for the original source, * line, and column provided. If no column is provided, returns all mappings * corresponding to a either the line we are searching for or the next * closest line that has any mappings. Otherwise, returns all mappings * corresponding to the given line and either the column we are searching for * or the next closest column that has any offsets. * * The only argument is an object with the following properties: * * - source: The filename of the original source. * - line: The line number in the original source. The line number is 1-based. * - column: Optional. the column number in the original source. * The column number is 0-based. * * and an array of objects is returned, each with the following properties: * * - line: The line number in the generated source, or null. The * line number is 1-based. * - column: The column number in the generated source, or null. * The column number is 0-based. */ SourceMapConsumer.prototype.allGeneratedPositionsFor = function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { var line = util.getArg(aArgs, 'line'); // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping // returns the index of the closest mapping less than the needle. By // setting needle.originalColumn to 0, we thus find the last mapping for // the given line, provided such a mapping exists. var needle = { source: util.getArg(aArgs, 'source'), originalLine: line, originalColumn: util.getArg(aArgs, 'column', 0) }; needle.source = this._findSourceIndex(needle.source); if (needle.source < 0) { return []; } var mappings = []; var index = this._findMapping(needle, this._originalMappings, "originalLine", "originalColumn", util.compareByOriginalPositions, binarySearch.LEAST_UPPER_BOUND); if (index >= 0) { var mapping = this._originalMappings[index]; if (aArgs.column === undefined) { var originalLine = mapping.originalLine; // Iterate until either we run out of mappings, or we run into // a mapping for a different line than the one we found. Since // mappings are sorted, this is guaranteed to find all mappings for // the line we found. while (mapping && mapping.originalLine === originalLine) { mappings.push({ line: util.getArg(mapping, 'generatedLine', null), column: util.getArg(mapping, 'generatedColumn', null), lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) }); mapping = this._originalMappings[++index]; } } else { var originalColumn = mapping.originalColumn; // Iterate until either we run out of mappings, or we run into // a mapping for a different line than the one we were searching for. // Since mappings are sorted, this is guaranteed to find all mappings for // the line we are searching for. while (mapping && mapping.originalLine === line && mapping.originalColumn == originalColumn) { mappings.push({ line: util.getArg(mapping, 'generatedLine', null), column: util.getArg(mapping, 'generatedColumn', null), lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) }); mapping = this._originalMappings[++index]; } } } return mappings; }; exports.SourceMapConsumer = SourceMapConsumer; /** * A BasicSourceMapConsumer instance represents a parsed source map which we can * query for information about the original file positions by giving it a file * position in the generated source. * * The first parameter is the raw source map (either as a JSON string, or * already parsed to an object). According to the spec, source maps have the * following attributes: * * - version: Which version of the source map spec this map is following. * - sources: An array of URLs to the original source files. * - names: An array of identifiers which can be referrenced by individual mappings. * - sourceRoot: Optional. The URL root from which all sources are relative. * - sourcesContent: Optional. An array of contents of the original source files. * - mappings: A string of base64 VLQs which contain the actual mappings. * - file: Optional. The generated file this source map is associated with. * * Here is an example source map, taken from the source map spec[0]: * * { * version : 3, * file: "out.js", * sourceRoot : "", * sources: ["foo.js", "bar.js"], * names: ["src", "maps", "are", "fun"], * mappings: "AA,AB;;ABCDE;" * } * * The second parameter, if given, is a string whose value is the URL * at which the source map was found. This URL is used to compute the * sources array. * * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# */ function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) { var sourceMap = aSourceMap; if (typeof aSourceMap === 'string') { sourceMap = util.parseSourceMapInput(aSourceMap); } var version = util.getArg(sourceMap, 'version'); var sources = util.getArg(sourceMap, 'sources'); // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which // requires the array) to play nice here. var names = util.getArg(sourceMap, 'names', []); var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null); var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null); var mappings = util.getArg(sourceMap, 'mappings'); var file = util.getArg(sourceMap, 'file', null); // Once again, Sass deviates from the spec and supplies the version as a // string rather than a number, so we use loose equality checking here. if (version != this._version) { throw new Error('Unsupported version: ' + version); } if (sourceRoot) { sourceRoot = util.normalize(sourceRoot); } sources = sources .map(String) // Some source maps produce relative source paths like "./foo.js" instead of // "foo.js". Normalize these first so that future comparisons will succeed. // See bugzil.la/1090768. .map(util.normalize) // Always ensure that absolute sources are internally stored relative to // the source root, if the source root is absolute. Not doing this would // be particularly problematic when the source root is a prefix of the // source (valid, but why??). See github issue #199 and bugzil.la/1188982. .map(function (source) { return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) ? util.relative(sourceRoot, source) : source; }); // Pass `true` below to allow duplicate names and sources. While source maps // are intended to be compressed and deduplicated, the TypeScript compiler // sometimes generates source maps with duplicates in them. See Github issue // #72 and bugzil.la/889492. this._names = ArraySet.fromArray(names.map(String), true); this._sources = ArraySet.fromArray(sources, true); this._absoluteSources = this._sources.toArray().map(function (s) { return util.computeSourceURL(sourceRoot, s, aSourceMapURL); }); this.sourceRoot = sourceRoot; this.sourcesContent = sourcesContent; this._mappings = mappings; this._sourceMapURL = aSourceMapURL; this.file = file; } BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; /** * Utility function to find the index of a source. Returns -1 if not * found. */ BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) { var relativeSource = aSource; if (this.sourceRoot != null) { relativeSource = util.relative(this.sourceRoot, relativeSource); } if (this._sources.has(relativeSource)) { return this._sources.indexOf(relativeSource); } // Maybe aSource is an absolute URL as returned by |sources|. In // this case we can't simply undo the transform. var i; for (i = 0; i < this._absoluteSources.length; ++i) { if (this._absoluteSources[i] == aSource) { return i; } } return -1; }; /** * Create a BasicSourceMapConsumer from a SourceMapGenerator. * * @param SourceMapGenerator aSourceMap * The source map that will be consumed. * @param String aSourceMapURL * The URL at which the source map can be found (optional) * @returns BasicSourceMapConsumer */ BasicSourceMapConsumer.fromSourceMap = function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) { var smc = Object.create(BasicSourceMapConsumer.prototype); var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); smc.sourceRoot = aSourceMap._sourceRoot; smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), smc.sourceRoot); smc.file = aSourceMap._file; smc._sourceMapURL = aSourceMapURL; smc._absoluteSources = smc._sources.toArray().map(function (s) { return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL); }); // Because we are modifying the entries (by converting string sources and // names to indices into the sources and names ArraySets), we have to make // a copy of the entry or else bad things happen. Shared mutable state // strikes again! See github issue #191. var generatedMappings = aSourceMap._mappings.toArray().slice(); var destGeneratedMappings = smc.__generatedMappings = []; var destOriginalMappings = smc.__originalMappings = []; for (var i = 0, length = generatedMappings.length; i < length; i++) { var srcMapping = generatedMappings[i]; var destMapping = new Mapping; destMapping.generatedLine = srcMapping.generatedLine; destMapping.generatedColumn = srcMapping.generatedColumn; if (srcMapping.source) { destMapping.source = sources.indexOf(srcMapping.source); destMapping.originalLine = srcMapping.originalLine; destMapping.originalColumn = srcMapping.originalColumn; if (srcMapping.name) { destMapping.name = names.indexOf(srcMapping.name); } destOriginalMappings.push(destMapping); } destGeneratedMappings.push(destMapping); } quickSort(smc.__originalMappings, util.compareByOriginalPositions); return smc; }; /** * The version of the source mapping spec that we are consuming. */ BasicSourceMapConsumer.prototype._version = 3; /** * The list of original sources. */ Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', { get: function () { return this._absoluteSources.slice(); } }); /** * Provide the JIT with a nice shape / hidden class. */ function Mapping() { this.generatedLine = 0; this.generatedColumn = 0; this.source = null; this.originalLine = null; this.originalColumn = null; this.name = null; } /** * Parse the mappings in a string in to a data structure which we can easily * query (the ordered arrays in the `this.__generatedMappings` and * `this.__originalMappings` properties). */ const compareGenerated = util.compareByGeneratedPositionsDeflatedNoLine; function sortGenerated(array, start) { let l = array.length; let n = array.length - start; if (n <= 1) { return; } else if (n == 2) { let a = array[start]; let b = array[start + 1]; if (compareGenerated(a, b) > 0) { array[start] = b; array[start + 1] = a; } } else if (n < 20) { for (let i = start; i < l; i++) { for (let j = i; j > start; j--) { let a = array[j - 1]; let b = array[j]; if (compareGenerated(a, b) <= 0) { break; } array[j - 1] = b; array[j] = a; } } } else { quickSort(array, compareGenerated, start); } } BasicSourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { var generatedLine = 1; var previousGeneratedColumn = 0; var previousOriginalLine = 0; var previousOriginalColumn = 0; var previousSource = 0; var previousName = 0; var length = aStr.length; var index = 0; var cachedSegments = {}; var temp = {}; var originalMappings = []; var generatedMappings = []; var mapping, str, segment, end, value; let subarrayStart = 0; while (index < length) { if (aStr.charAt(index) === ';') { generatedLine++; index++; previousGeneratedColumn = 0; sortGenerated(generatedMappings, subarrayStart); subarrayStart = generatedMappings.length; } else if (aStr.charAt(index) === ',') { index++; } else { mapping = new Mapping(); mapping.generatedLine = generatedLine; for (end = index; end < length; end++) { if (this._charIsMappingSeparator(aStr, end)) { break; } } str = aStr.slice(index, end); segment = []; while (index < end) { base64VLQ.decode(aStr, index, temp); value = temp.value; index = temp.rest; segment.push(value); } if (segment.length === 2) { throw new Error('Found a source, but no line and column'); } if (segment.length === 3) { throw new Error('Found a source and line, but no column'); } // Generated column. mapping.generatedColumn = previousGeneratedColumn + segment[0]; previousGeneratedColumn = mapping.generatedColumn; if (segment.length > 1) { // Original source. mapping.source = previousSource + segment[1]; previousSource += segment[1]; // Original line. mapping.originalLine = previousOriginalLine + segment[2]; previousOriginalLine = mapping.originalLine; // Lines are stored 0-based mapping.originalLine += 1; // Original column. mapping.originalColumn = previousOriginalColumn + segment[3]; previousOriginalColumn = mapping.originalColumn; if (segment.length > 4) { // Original name. mapping.name = previousName + segment[4]; previousName += segment[4]; } } generatedMappings.push(mapping); if (typeof mapping.originalLine === 'number') { let currentSource = mapping.source; while (originalMappings.length <= currentSource) { originalMappings.push(null); } if (originalMappings[currentSource] === null) { originalMappings[currentSource] = []; } originalMappings[currentSource].push(mapping); } } } sortGenerated(generatedMappings, subarrayStart); this.__generatedMappings = generatedMappings; for (var i = 0; i < originalMappings.length; i++) { if (originalMappings[i] != null) { quickSort(originalMappings[i], util.compareByOriginalPositionsNoSource); } } this.__originalMappings = [].concat(...originalMappings); }; /** * Find the mapping that best matches the hypothetical "needle" mapping that * we are searching for in the given "haystack" of mappings. */ BasicSourceMapConsumer.prototype._findMapping = function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, aColumnName, aComparator, aBias) { // To return the position we are searching for, we must first find the // mapping for the given position and then return the opposite position it // points to. Because the mappings are sorted, we can use binary search to // find the best mapping. if (aNeedle[aLineName] <= 0) { throw new TypeError('Line must be greater than or equal to 1, got ' + aNeedle[aLineName]); } if (aNeedle[aColumnName] < 0) { throw new TypeError('Column must be greater than or equal to 0, got ' + aNeedle[aColumnName]); } return binarySearch.search(aNeedle, aMappings, aComparator, aBias); }; /** * Compute the last column for each generated mapping. The last column is * inclusive. */ BasicSourceMapConsumer.prototype.computeColumnSpans = function SourceMapConsumer_computeColumnSpans() { for (var index = 0; index < this._generatedMappings.length; ++index) { var mapping = this._generatedMappings[index]; // Mappings do not contain a field for the last generated columnt. We // can come up with an optimistic estimate, however, by assuming that // mappings are contiguous (i.e. given two consecutive mappings, the // first mapping ends where the second one starts). if (index + 1 < this._generatedMappings.length) { var nextMapping = this._generatedMappings[index + 1]; if (mapping.generatedLine === nextMapping.generatedLine) { mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; continue; } } // The last mapping for each line spans the entire line. mapping.lastGeneratedColumn = Infinity; } }; /** * Returns the original source, line, and column information for the generated * source's line and column positions provided. The only argument is an object * with the following properties: * * - line: The line number in the generated source. The line number * is 1-based. * - column: The column number in the generated source. The column * number is 0-based. * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the * closest element that is smaller than or greater than the one we are * searching for, respectively, if the exact element cannot be found. * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. * * and an object is returned with the following properties: * * - source: The original source file, or null. * - line: The line number in the original source, or null. The * line number is 1-based. * - column: The column number in the original source, or null. The * column number is 0-based. * - name: The original identifier, or null. */ BasicSourceMapConsumer.prototype.originalPositionFor = function SourceMapConsumer_originalPositionFor(aArgs) { var needle = { generatedLine: util.getArg(aArgs, 'line'), generatedColumn: util.getArg(aArgs, 'column') }; var index = this._findMapping( needle, this._generatedMappings, "generatedLine", "generatedColumn", util.compareByGeneratedPositionsDeflated, util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) ); if (index >= 0) { var mapping = this._generatedMappings[index]; if (mapping.generatedLine === needle.generatedLine) { var source = util.getArg(mapping, 'source', null); if (source !== null) { source = this._sources.at(source); source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL); } var name = util.getArg(mapping, 'name', null); if (name !== null) { name = this._names.at(name); } return { source: source, line: util.getArg(mapping, 'originalLine', null), column: util.getArg(mapping, 'originalColumn', null), name: name }; } } return { source: null, line: null, column: null, name: null }; }; /** * Return true if we have the source content for every source in the source * map, false otherwise. */ BasicSourceMapConsumer.prototype.hasContentsOfAllSources = function BasicSourceMapConsumer_hasContentsOfAllSources() { if (!this.sourcesContent) { return false; } return this.sourcesContent.length >= this._sources.size() && !this.sourcesContent.some(function (sc) { return sc == null; }); }; /** * Returns the original source content. The only argument is the url of the * original source file. Returns null if no original source content is * available. */ BasicSourceMapConsumer.prototype.sourceContentFor = function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { if (!this.sourcesContent) { return null; } var index = this._findSourceIndex(aSource); if (index >= 0) { return this.sourcesContent[index]; } var relativeSource = aSource; if (this.sourceRoot != null) { relativeSource = util.relative(this.sourceRoot, relativeSource); } var url; if (this.sourceRoot != null && (url = util.urlParse(this.sourceRoot))) { // XXX: file:// URIs and absolute paths lead to unexpected behavior for // many users. We can help them out when they expect file:// URIs to // behave like it would if they were running a local HTTP server. See // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. var fileUriAbsPath = relativeSource.replace(/^file:\/\//, ""); if (url.scheme == "file" && this._sources.has(fileUriAbsPath)) { return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)] } if ((!url.path || url.path == "/") && this._sources.has("/" + relativeSource)) { return this.sourcesContent[this._sources.indexOf("/" + relativeSource)]; } } // This function is used recursively from // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we // don't want to throw if we can't find the source - we just want to // return null, so we provide a flag to exit gracefully. if (nullOnMissing) { return null; } else { throw new Error('"' + relativeSource + '" is not in the SourceMap.'); } }; /** * Returns the generated line and column information for the original source, * line, and column positions provided. The only argument is an object with * the following properties: * * - source: The filename of the original source. * - line: The line number in the original source. The line number * is 1-based. * - column: The column number in the original source. The column * number is 0-based. * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the * closest element that is smaller than or greater than the one we are * searching for, respectively, if the exact element cannot be found. * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. * * and an object is returned with the following properties: * * - line: The line number in the generated source, or null. The * line number is 1-based. * - column: The column number in the generated source, or null. * The column number is 0-based. */ BasicSourceMapConsumer.prototype.generatedPositionFor = function SourceMapConsumer_generatedPositionFor(aArgs) { var source = util.getArg(aArgs, 'source'); source = this._findSourceIndex(source); if (source < 0) { return { line: null, column: null, lastColumn: null }; } var needle = { source: source, originalLine: util.getArg(aArgs, 'line'), originalColumn: util.getArg(aArgs, 'column') }; var index = this._findMapping( needle, this._originalMappings, "originalLine", "originalColumn", util.compareByOriginalPositions, util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) ); if (index >= 0) { var mapping = this._originalMappings[index]; if (mapping.source === needle.source) { return { line: util.getArg(mapping, 'generatedLine', null), column: util.getArg(mapping, 'generatedColumn', null), lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) }; } } return { line: null, column: null, lastColumn: null }; }; exports.BasicSourceMapConsumer = BasicSourceMapConsumer; /** * An IndexedSourceMapConsumer instance represents a parsed source map which * we can query for information. It differs from BasicSourceMapConsumer in * that it takes "indexed" source maps (i.e. ones with a "sections" field) as * input. * * The first parameter is a raw source map (either as a JSON string, or already * parsed to an object). According to the spec for indexed source maps, they * have the following attributes: * * - version: Which version of the source map spec this map is following. * - file: Optional. The generated file this source map is associated with. * - sections: A list of section definitions. * * Each value under the "sections" field has two fields: * - offset: The offset into the original specified at which this section * begins to apply, defined as an object with a "line" and "column" * field. * - map: A source map definition. This source map could also be indexed, * but doesn't have to be. * * Instead of the "map" field, it's also possible to have a "url" field * specifying a URL to retrieve a source map from, but that's currently * unsupported. * * Here's an example source map, taken from the source map spec[0], but * modified to omit a section which uses the "url" field. * * { * version : 3, * file: "app.js", * sections: [{ * offset: {line:100, column:10}, * map: { * version : 3, * file: "section.js", * sources: ["foo.js", "bar.js"], * names: ["src", "maps", "are", "fun"], * mappings: "AAAA,E;;ABCDE;" * } * }], * } * * The second parameter, if given, is a string whose value is the URL * at which the source map was found. This URL is used to compute the * sources array. * * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt */ function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) { var sourceMap = aSourceMap; if (typeof aSourceMap === 'string') { sourceMap = util.parseSourceMapInput(aSourceMap); } var version = util.getArg(sourceMap, 'version'); var sections = util.getArg(sourceMap, 'sections'); if (version != this._version) { throw new Error('Unsupported version: ' + version); } this._sources = new ArraySet(); this._names = new ArraySet(); var lastOffset = { line: -1, column: 0 }; this._sections = sections.map(function (s) { if (s.url) { // The url field will require support for asynchronicity. // See https://github.com/mozilla/source-map/issues/16 throw new Error('Support for url field in sections not implemented.'); } var offset = util.getArg(s, 'offset'); var offsetLine = util.getArg(offset, 'line'); var offsetColumn = util.getArg(offset, 'column'); if (offsetLine < lastOffset.line || (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) { throw new Error('Section offsets must be ordered and non-overlapping.'); } lastOffset = offset; return { generatedOffset: { // The offset fields are 0-based, but we use 1-based indices when // encoding/decoding from VLQ. generatedLine: offsetLine + 1, generatedColumn: offsetColumn + 1 }, consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL) } }); } IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer; /** * The version of the source mapping spec that we are consuming. */ IndexedSourceMapConsumer.prototype._version = 3; /** * The list of original sources. */ Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', { get: function () { var sources = []; for (var i = 0; i < this._sections.length; i++) { for (var j = 0; j < this._sections[i].consumer.sources.length; j++) { sources.push(this._sections[i].consumer.sources[j]); } } return sources; } }); /** * Returns the original source, line, and column information for the generated * source's line and column positions provided. The only argument is an object * with the following properties: * * - line: The line number in the generated source. The line number * is 1-based. * - column: The column number in the generated source. The column * number is 0-based. * * and an object is returned with the following properties: * * - source: The original source file, or null. * - line: The line number in the original source, or null. The * line number is 1-based. * - column: The column number in the original source, or null. The * column number is 0-based. * - name: The original identifier, or null. */ IndexedSourceMapConsumer.prototype.originalPositionFor = function IndexedSourceMapConsumer_originalPositionFor(aArgs) { var needle = { generatedLine: util.getArg(aArgs, 'line'), generatedColumn: util.getArg(aArgs, 'column') }; // Find the section containing the generated position we're trying to map // to an original position. var sectionIndex = binarySearch.search(needle, this._sections, function(needle, section) { var cmp = needle.generatedLine - section.generatedOffset.generatedLine; if (cmp) { return cmp; } return (needle.generatedColumn - section.generatedOffset.generatedColumn); }); var section = this._sections[sectionIndex]; if (!section) { return { source: null, line: null, column: null, name: null }; } return section.consumer.originalPositionFor({ line: needle.generatedLine - (section.generatedOffset.generatedLine - 1), column: needle.generatedColumn - (section.generatedOffset.generatedLine === needle.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0), bias: aArgs.bias }); }; /** * Return true if we have the source content for every source in the source * map, false otherwise. */ IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = function IndexedSourceMapConsumer_hasContentsOfAllSources() { return this._sections.every(function (s) { return s.consumer.hasContentsOfAllSources(); }); }; /** * Returns the original source content. The only argument is the url of the * original source file. Returns null if no original source content is * available. */ IndexedSourceMapConsumer.prototype.sourceContentFor = function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { for (var i = 0; i < this._sections.length; i++) { var section = this._sections[i]; var content = section.consumer.sourceContentFor(aSource, true); if (content || content === '') { return content; } } if (nullOnMissing) { return null; } else { throw new Error('"' + aSource + '" is not in the SourceMap.'); } }; /** * Returns the generated line and column information for the original source, * line, and column positions provided. The only argument is an object with * the following properties: * * - source: The filename of the original source. * - line: The line number in the original source. The line number * is 1-based. * - column: The column number in the original source. The column * number is 0-based. * * and an object is returned with the following properties: * * - line: The line number in the generated source, or null. The * line number is 1-based. * - column: The column number in the generated source, or null. * The column number is 0-based. */ IndexedSourceMapConsumer.prototype.generatedPositionFor = function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { for (var i = 0; i < this._sections.length; i++) { var section = this._sections[i]; // Only consider this section if the requested source is in the list of // sources of the consumer. if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) { continue; } var generatedPosition = section.consumer.generatedPositionFor(aArgs); if (generatedPosition) { var ret = { line: generatedPosition.line + (section.generatedOffset.generatedLine - 1), column: generatedPosition.column + (section.generatedOffset.generatedLine === generatedPosition.line ? section.generatedOffset.generatedColumn - 1 : 0) }; return ret; } } return { line: null, column: null }; }; /** * Parse the mappings in a string in to a data structure which we can easily * query (the ordered arrays in the `this.__generatedMappings` and * `this.__originalMappings` properties). */ IndexedSourceMapConsumer.prototype._parseMappings = function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) { this.__generatedMappings = []; this.__originalMappings = []; for (var i = 0; i < this._sections.length; i++) { var section = this._sections[i]; var sectionMappings = section.consumer._generatedMappings; for (var j = 0; j < sectionMappings.length; j++) { var mapping = sectionMappings[j]; var source = section.consumer._sources.at(mapping.source); if(source !== null) { source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL); } this._sources.add(source); source = this._sources.indexOf(source); var name = null; if (mapping.name) { name = section.consumer._names.at(mapping.name); this._names.add(name); name = this._names.indexOf(name); } // The mappings coming from the consumer for the section have // generated positions relative to the start of the section, so we // need to offset them to be relative to the start of the concatenated // generated file. var adjustedMapping = { source: source, generatedLine: mapping.generatedLine + (section.generatedOffset.generatedLine - 1), generatedColumn: mapping.generatedColumn + (section.generatedOffset.generatedLine === mapping.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0), originalLine: mapping.originalLine, originalColumn: mapping.originalColumn, name: name }; this.__generatedMappings.push(adjustedMapping); if (typeof adjustedMapping.originalLine === 'number') { this.__originalMappings.push(adjustedMapping); } } } quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated); quickSort(this.__originalMappings, util.compareByOriginalPositions); }; exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer; /***/ }), /***/ "./node_modules/source-map-js/lib/source-map-generator.js": /*!****************************************************************!*\ !*** ./node_modules/source-map-js/lib/source-map-generator.js ***! \****************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause */ var base64VLQ = __webpack_require__(/*! ./base64-vlq */ "./node_modules/source-map-js/lib/base64-vlq.js"); var util = __webpack_require__(/*! ./util */ "./node_modules/source-map-js/lib/util.js"); var ArraySet = (__webpack_require__(/*! ./array-set */ "./node_modules/source-map-js/lib/array-set.js").ArraySet); var MappingList = (__webpack_require__(/*! ./mapping-list */ "./node_modules/source-map-js/lib/mapping-list.js").MappingList); /** * An instance of the SourceMapGenerator represents a source map which is * being built incrementally. You may pass an object with the following * properties: * * - file: The filename of the generated source. * - sourceRoot: A root for all relative URLs in this source map. */ function SourceMapGenerator(aArgs) { if (!aArgs) { aArgs = {}; } this._file = util.getArg(aArgs, 'file', null); this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); this._skipValidation = util.getArg(aArgs, 'skipValidation', false); this._ignoreInvalidMapping = util.getArg(aArgs, 'ignoreInvalidMapping', false); this._sources = new ArraySet(); this._names = new ArraySet(); this._mappings = new MappingList(); this._sourcesContents = null; } SourceMapGenerator.prototype._version = 3; /** * Creates a new SourceMapGenerator based on a SourceMapConsumer * * @param aSourceMapConsumer The SourceMap. */ SourceMapGenerator.fromSourceMap = function SourceMapGenerator_fromSourceMap(aSourceMapConsumer, generatorOps) { var sourceRoot = aSourceMapConsumer.sourceRoot; var generator = new SourceMapGenerator(Object.assign(generatorOps || {}, { file: aSourceMapConsumer.file, sourceRoot: sourceRoot })); aSourceMapConsumer.eachMapping(function (mapping) { var newMapping = { generated: { line: mapping.generatedLine, column: mapping.generatedColumn } }; if (mapping.source != null) { newMapping.source = mapping.source; if (sourceRoot != null) { newMapping.source = util.relative(sourceRoot, newMapping.source); } newMapping.original = { line: mapping.originalLine, column: mapping.originalColumn }; if (mapping.name != null) { newMapping.name = mapping.name; } } generator.addMapping(newMapping); }); aSourceMapConsumer.sources.forEach(function (sourceFile) { var sourceRelative = sourceFile; if (sourceRoot !== null) { sourceRelative = util.relative(sourceRoot, sourceFile); } if (!generator._sources.has(sourceRelative)) { generator._sources.add(sourceRelative); } var content = aSourceMapConsumer.sourceContentFor(sourceFile); if (content != null) { generator.setSourceContent(sourceFile, content); } }); return generator; }; /** * Add a single mapping from original source line and column to the generated * source's line and column for this source map being created. The mapping * object should have the following properties: * * - generated: An object with the generated line and column positions. * - original: An object with the original line and column positions. * - source: The original source file (relative to the sourceRoot). * - name: An optional original token name for this mapping. */ SourceMapGenerator.prototype.addMapping = function SourceMapGenerator_addMapping(aArgs) { var generated = util.getArg(aArgs, 'generated'); var original = util.getArg(aArgs, 'original', null); var source = util.getArg(aArgs, 'source', null); var name = util.getArg(aArgs, 'name', null); if (!this._skipValidation) { if (this._validateMapping(generated, original, source, name) === false) { return; } } if (source != null) { source = String(source); if (!this._sources.has(source)) { this._sources.add(source); } } if (name != null) { name = String(name); if (!this._names.has(name)) { this._names.add(name); } } this._mappings.add({ generatedLine: generated.line, generatedColumn: generated.column, originalLine: original != null && original.line, originalColumn: original != null && original.column, source: source, name: name }); }; /** * Set the source content for a source file. */ SourceMapGenerator.prototype.setSourceContent = function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { var source = aSourceFile; if (this._sourceRoot != null) { source = util.relative(this._sourceRoot, source); } if (aSourceContent != null) { // Add the source content to the _sourcesContents map. // Create a new _sourcesContents map if the property is null. if (!this._sourcesContents) { this._sourcesContents = Object.create(null); } this._sourcesContents[util.toSetString(source)] = aSourceContent; } else if (this._sourcesContents) { // Remove the source file from the _sourcesContents map. // If the _sourcesContents map is empty, set the property to null. delete this._sourcesContents[util.toSetString(source)]; if (Object.keys(this._sourcesContents).length === 0) { this._sourcesContents = null; } } }; /** * Applies the mappings of a sub-source-map for a specific source file to the * source map being generated. Each mapping to the supplied source file is * rewritten using the supplied source map. Note: The resolution for the * resulting mappings is the minimium of this map and the supplied map. * * @param aSourceMapConsumer The source map to be applied. * @param aSourceFile Optional. The filename of the source file. * If omitted, SourceMapConsumer's file property will be used. * @param aSourceMapPath Optional. The dirname of the path to the source map * to be applied. If relative, it is relative to the SourceMapConsumer. * This parameter is needed when the two source maps aren't in the same * directory, and the source map to be applied contains relative source * paths. If so, those relative source paths need to be rewritten * relative to the SourceMapGenerator. */ SourceMapGenerator.prototype.applySourceMap = function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { var sourceFile = aSourceFile; // If aSourceFile is omitted, we will use the file property of the SourceMap if (aSourceFile == null) { if (aSourceMapConsumer.file == null) { throw new Error( 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' + 'or the source map\'s "file" property. Both were omitted.' ); } sourceFile = aSourceMapConsumer.file; } var sourceRoot = this._sourceRoot; // Make "sourceFile" relative if an absolute Url is passed. if (sourceRoot != null) { sourceFile = util.relative(sourceRoot, sourceFile); } // Applying the SourceMap can add and remove items from the sources and // the names array. var newSources = new ArraySet(); var newNames = new ArraySet(); // Find mappings for the "sourceFile" this._mappings.unsortedForEach(function (mapping) { if (mapping.source === sourceFile && mapping.originalLine != null) { // Check if it can be mapped by the source map, then update the mapping. var original = aSourceMapConsumer.originalPositionFor({ line: mapping.originalLine, column: mapping.originalColumn }); if (original.source != null) { // Copy mapping mapping.source = original.source; if (aSourceMapPath != null) { mapping.source = util.join(aSourceMapPath, mapping.source) } if (sourceRoot != null) { mapping.source = util.relative(sourceRoot, mapping.source); } mapping.originalLine = original.line; mapping.originalColumn = original.column; if (original.name != null) { mapping.name = original.name; } } } var source = mapping.source; if (source != null && !newSources.has(source)) { newSources.add(source); } var name = mapping.name; if (name != null && !newNames.has(name)) { newNames.add(name); } }, this); this._sources = newSources; this._names = newNames; // Copy sourcesContents of applied map. aSourceMapConsumer.sources.forEach(function (sourceFile) { var content = aSourceMapConsumer.sourceContentFor(sourceFile); if (content != null) { if (aSourceMapPath != null) { sourceFile = util.join(aSourceMapPath, sourceFile); } if (sourceRoot != null) { sourceFile = util.relative(sourceRoot, sourceFile); } this.setSourceContent(sourceFile, content); } }, this); }; /** * A mapping can have one of the three levels of data: * * 1. Just the generated position. * 2. The Generated position, original position, and original source. * 3. Generated and original position, original source, as well as a name * token. * * To maintain consistency, we validate that any new mapping being added falls * in to one of these categories. */ SourceMapGenerator.prototype._validateMapping = function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, aName) { // When aOriginal is truthy but has empty values for .line and .column, // it is most likely a programmer error. In this case we throw a very // specific error message to try to guide them the right way. // For example: https://github.com/Polymer/polymer-bundler/pull/519 if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') { var message = 'original.line and original.column are not numbers -- you probably meant to omit ' + 'the original mapping entirely and only map the generated position. If so, pass ' + 'null for the original mapping instead of an object with empty or null values.' if (this._ignoreInvalidMapping) { if (typeof console !== 'undefined' && console.warn) { console.warn(message); } return false; } else { throw new Error(message); } } if (aGenerated && 'line' in aGenerated && 'column' in aGenerated && aGenerated.line > 0 && aGenerated.column >= 0 && !aOriginal && !aSource && !aName) { // Case 1. return; } else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated && aOriginal && 'line' in aOriginal && 'column' in aOriginal && aGenerated.line > 0 && aGenerated.column >= 0 && aOriginal.line > 0 && aOriginal.column >= 0 && aSource) { // Cases 2 and 3. return; } else { var message = 'Invalid mapping: ' + JSON.stringify({ generated: aGenerated, source: aSource, original: aOriginal, name: aName }); if (this._ignoreInvalidMapping) { if (typeof console !== 'undefined' && console.warn) { console.warn(message); } return false; } else { throw new Error(message) } } }; /** * Serialize the accumulated mappings in to the stream of base 64 VLQs * specified by the source map format. */ SourceMapGenerator.prototype._serializeMappings = function SourceMapGenerator_serializeMappings() { var previousGeneratedColumn = 0; var previousGeneratedLine = 1; var previousOriginalColumn = 0; var previousOriginalLine = 0; var previousName = 0; var previousSource = 0; var result = ''; var next; var mapping; var nameIdx; var sourceIdx; var mappings = this._mappings.toArray(); for (var i = 0, len = mappings.length; i < len; i++) { mapping = mappings[i]; next = '' if (mapping.generatedLine !== previousGeneratedLine) { previousGeneratedColumn = 0; while (mapping.generatedLine !== previousGeneratedLine) { next += ';'; previousGeneratedLine++; } } else { if (i > 0) { if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { continue; } next += ','; } } next += base64VLQ.encode(mapping.generatedColumn - previousGeneratedColumn); previousGeneratedColumn = mapping.generatedColumn; if (mapping.source != null) { sourceIdx = this._sources.indexOf(mapping.source); next += base64VLQ.encode(sourceIdx - previousSource); previousSource = sourceIdx; // lines are stored 0-based in SourceMap spec version 3 next += base64VLQ.encode(mapping.originalLine - 1 - previousOriginalLine); previousOriginalLine = mapping.originalLine - 1; next += base64VLQ.encode(mapping.originalColumn - previousOriginalColumn); previousOriginalColumn = mapping.originalColumn; if (mapping.name != null) { nameIdx = this._names.indexOf(mapping.name); next += base64VLQ.encode(nameIdx - previousName); previousName = nameIdx; } } result += next; } return result; }; SourceMapGenerator.prototype._generateSourcesContent = function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { return aSources.map(function (source) { if (!this._sourcesContents) { return null; } if (aSourceRoot != null) { source = util.relative(aSourceRoot, source); } var key = util.toSetString(source); return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) ? this._sourcesContents[key] : null; }, this); }; /** * Externalize the source map. */ SourceMapGenerator.prototype.toJSON = function SourceMapGenerator_toJSON() { var map = { version: this._version, sources: this._sources.toArray(), names: this._names.toArray(), mappings: this._serializeMappings() }; if (this._file != null) { map.file = this._file; } if (this._sourceRoot != null) { map.sourceRoot = this._sourceRoot; } if (this._sourcesContents) { map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); } return map; }; /** * Render the source map being generated to a string. */ SourceMapGenerator.prototype.toString = function SourceMapGenerator_toString() { return JSON.stringify(this.toJSON()); }; exports.SourceMapGenerator = SourceMapGenerator; /***/ }), /***/ "./node_modules/source-map-js/lib/source-node.js": /*!*******************************************************!*\ !*** ./node_modules/source-map-js/lib/source-node.js ***! \*******************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause */ var SourceMapGenerator = (__webpack_require__(/*! ./source-map-generator */ "./node_modules/source-map-js/lib/source-map-generator.js").SourceMapGenerator); var util = __webpack_require__(/*! ./util */ "./node_modules/source-map-js/lib/util.js"); // Matches a Windows-style `\r\n` newline or a `\n` newline used by all other // operating systems these days (capturing the result). var REGEX_NEWLINE = /(\r?\n)/; // Newline character code for charCodeAt() comparisons var NEWLINE_CODE = 10; // Private symbol for identifying `SourceNode`s when multiple versions of // the source-map library are loaded. This MUST NOT CHANGE across // versions! var isSourceNode = "$$$isSourceNode$$$"; /** * SourceNodes provide a way to abstract over interpolating/concatenating * snippets of generated JavaScript source code while maintaining the line and * column information associated with the original source code. * * @param aLine The original line number. * @param aColumn The original column number. * @param aSource The original source's filename. * @param aChunks Optional. An array of strings which are snippets of * generated JS, or other SourceNodes. * @param aName The original identifier. */ function SourceNode(aLine, aColumn, aSource, aChunks, aName) { this.children = []; this.sourceContents = {}; this.line = aLine == null ? null : aLine; this.column = aColumn == null ? null : aColumn; this.source = aSource == null ? null : aSource; this.name = aName == null ? null : aName; this[isSourceNode] = true; if (aChunks != null) this.add(aChunks); } /** * Creates a SourceNode from generated code and a SourceMapConsumer. * * @param aGeneratedCode The generated code * @param aSourceMapConsumer The SourceMap for the generated code * @param aRelativePath Optional. The path that relative sources in the * SourceMapConsumer should be relative to. */ SourceNode.fromStringWithSourceMap = function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { // The SourceNode we want to fill with the generated code // and the SourceMap var node = new SourceNode(); // All even indices of this array are one line of the generated code, // while all odd indices are the newlines between two adjacent lines // (since `REGEX_NEWLINE` captures its match). // Processed fragments are accessed by calling `shiftNextLine`. var remainingLines = aGeneratedCode.split(REGEX_NEWLINE); var remainingLinesIndex = 0; var shiftNextLine = function() { var lineContents = getNextLine(); // The last line of a file might not have a newline. var newLine = getNextLine() || ""; return lineContents + newLine; function getNextLine() { return remainingLinesIndex < remainingLines.length ? remainingLines[remainingLinesIndex++] : undefined; } }; // We need to remember the position of "remainingLines" var lastGeneratedLine = 1, lastGeneratedColumn = 0; // The generate SourceNodes we need a code range. // To extract it current and last mapping is used. // Here we store the last mapping. var lastMapping = null; aSourceMapConsumer.eachMapping(function (mapping) { if (lastMapping !== null) { // We add the code from "lastMapping" to "mapping": // First check if there is a new line in between. if (lastGeneratedLine < mapping.generatedLine) { // Associate first line with "lastMapping" addMappingWithCode(lastMapping, shiftNextLine()); lastGeneratedLine++; lastGeneratedColumn = 0; // The remaining code is added without mapping } else { // There is no new line in between. // Associate the code between "lastGeneratedColumn" and // "mapping.generatedColumn" with "lastMapping" var nextLine = remainingLines[remainingLinesIndex] || ''; var code = nextLine.substr(0, mapping.generatedColumn - lastGeneratedColumn); remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - lastGeneratedColumn); lastGeneratedColumn = mapping.generatedColumn; addMappingWithCode(lastMapping, code); // No more remaining code, continue lastMapping = mapping; return; } } // We add the generated code until the first mapping // to the SourceNode without any mapping. // Each line is added as separate string. while (lastGeneratedLine < mapping.generatedLine) { node.add(shiftNextLine()); lastGeneratedLine++; } if (lastGeneratedColumn < mapping.generatedColumn) { var nextLine = remainingLines[remainingLinesIndex] || ''; node.add(nextLine.substr(0, mapping.generatedColumn)); remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn); lastGeneratedColumn = mapping.generatedColumn; } lastMapping = mapping; }, this); // We have processed all mappings. if (remainingLinesIndex < remainingLines.length) { if (lastMapping) { // Associate the remaining code in the current line with "lastMapping" addMappingWithCode(lastMapping, shiftNextLine()); } // and add the remaining lines without any mapping node.add(remainingLines.splice(remainingLinesIndex).join("")); } // Copy sourcesContent into SourceNode aSourceMapConsumer.sources.forEach(function (sourceFile) { var content = aSourceMapConsumer.sourceContentFor(sourceFile); if (content != null) { if (aRelativePath != null) { sourceFile = util.join(aRelativePath, sourceFile); } node.setSourceContent(sourceFile, content); } }); return node; function addMappingWithCode(mapping, code) { if (mapping === null || mapping.source === undefined) { node.add(code); } else { var source = aRelativePath ? util.join(aRelativePath, mapping.source) : mapping.source; node.add(new SourceNode(mapping.originalLine, mapping.originalColumn, source, code, mapping.name)); } } }; /** * Add a chunk of generated JS to this source node. * * @param aChunk A string snippet of generated JS code, another instance of * SourceNode, or an array where each member is one of those things. */ SourceNode.prototype.add = function SourceNode_add(aChunk) { if (Array.isArray(aChunk)) { aChunk.forEach(function (chunk) { this.add(chunk); }, this); } else if (aChunk[isSourceNode] || typeof aChunk === "string") { if (aChunk) { this.children.push(aChunk); } } else { throw new TypeError( "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk ); } return this; }; /** * Add a chunk of generated JS to the beginning of this source node. * * @param aChunk A string snippet of generated JS code, another instance of * SourceNode, or an array where each member is one of those things. */ SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { if (Array.isArray(aChunk)) { for (var i = aChunk.length-1; i >= 0; i--) { this.prepend(aChunk[i]); } } else if (aChunk[isSourceNode] || typeof aChunk === "string") { this.children.unshift(aChunk); } else { throw new TypeError( "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk ); } return this; }; /** * Walk over the tree of JS snippets in this node and its children. The * walking function is called once for each snippet of JS and is passed that * snippet and the its original associated source's line/column location. * * @param aFn The traversal function. */ SourceNode.prototype.walk = function SourceNode_walk(aFn) { var chunk; for (var i = 0, len = this.children.length; i < len; i++) { chunk = this.children[i]; if (chunk[isSourceNode]) { chunk.walk(aFn); } else { if (chunk !== '') { aFn(chunk, { source: this.source, line: this.line, column: this.column, name: this.name }); } } } }; /** * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between * each of `this.children`. * * @param aSep The separator. */ SourceNode.prototype.join = function SourceNode_join(aSep) { var newChildren; var i; var len = this.children.length; if (len > 0) { newChildren = []; for (i = 0; i < len-1; i++) { newChildren.push(this.children[i]); newChildren.push(aSep); } newChildren.push(this.children[i]); this.children = newChildren; } return this; }; /** * Call String.prototype.replace on the very right-most source snippet. Useful * for trimming whitespace from the end of a source node, etc. * * @param aPattern The pattern to replace. * @param aReplacement The thing to replace the pattern with. */ SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { var lastChild = this.children[this.children.length - 1]; if (lastChild[isSourceNode]) { lastChild.replaceRight(aPattern, aReplacement); } else if (typeof lastChild === 'string') { this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); } else { this.children.push(''.replace(aPattern, aReplacement)); } return this; }; /** * Set the source content for a source file. This will be added to the SourceMapGenerator * in the sourcesContent field. * * @param aSourceFile The filename of the source file * @param aSourceContent The content of the source file */ SourceNode.prototype.setSourceContent = function SourceNode_setSourceContent(aSourceFile, aSourceContent) { this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; }; /** * Walk over the tree of SourceNodes. The walking function is called for each * source file content and is passed the filename and source content. * * @param aFn The traversal function. */ SourceNode.prototype.walkSourceContents = function SourceNode_walkSourceContents(aFn) { for (var i = 0, len = this.children.length; i < len; i++) { if (this.children[i][isSourceNode]) { this.children[i].walkSourceContents(aFn); } } var sources = Object.keys(this.sourceContents); for (var i = 0, len = sources.length; i < len; i++) { aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); } }; /** * Return the string representation of this source node. Walks over the tree * and concatenates all the various snippets together to one string. */ SourceNode.prototype.toString = function SourceNode_toString() { var str = ""; this.walk(function (chunk) { str += chunk; }); return str; }; /** * Returns the string representation of this source node along with a source * map. */ SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { var generated = { code: "", line: 1, column: 0 }; var map = new SourceMapGenerator(aArgs); var sourceMappingActive = false; var lastOriginalSource = null; var lastOriginalLine = null; var lastOriginalColumn = null; var lastOriginalName = null; this.walk(function (chunk, original) { generated.code += chunk; if (original.source !== null && original.line !== null && original.column !== null) { if(lastOriginalSource !== original.source || lastOriginalLine !== original.line || lastOriginalColumn !== original.column || lastOriginalName !== original.name) { map.addMapping({ source: original.source, original: { line: original.line, column: original.column }, generated: { line: generated.line, column: generated.column }, name: original.name }); } lastOriginalSource = original.source; lastOriginalLine = original.line; lastOriginalColumn = original.column; lastOriginalName = original.name; sourceMappingActive = true; } else if (sourceMappingActive) { map.addMapping({ generated: { line: generated.line, column: generated.column } }); lastOriginalSource = null; sourceMappingActive = false; } for (var idx = 0, length = chunk.length; idx < length; idx++) { if (chunk.charCodeAt(idx) === NEWLINE_CODE) { generated.line++; generated.column = 0; // Mappings end at eol if (idx + 1 === length) { lastOriginalSource = null; sourceMappingActive = false; } else if (sourceMappingActive) { map.addMapping({ source: original.source, original: { line: original.line, column: original.column }, generated: { line: generated.line, column: generated.column }, name: original.name }); } } else { generated.column++; } } }); this.walkSourceContents(function (sourceFile, sourceContent) { map.setSourceContent(sourceFile, sourceContent); }); return { code: generated.code, map: map }; }; exports.SourceNode = SourceNode; /***/ }), /***/ "./node_modules/source-map-js/lib/util.js": /*!************************************************!*\ !*** ./node_modules/source-map-js/lib/util.js ***! \************************************************/ /***/ ((__unused_webpack_module, exports) => { /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause */ /** * This is a helper function for getting values from parameter/options * objects. * * @param args The object we are extracting values from * @param name The name of the property we are getting. * @param defaultValue An optional value to return if the property is missing * from the object. If this is not specified and the property is missing, an * error will be thrown. */ function getArg(aArgs, aName, aDefaultValue) { if (aName in aArgs) { return aArgs[aName]; } else if (arguments.length === 3) { return aDefaultValue; } else { throw new Error('"' + aName + '" is a required argument.'); } } exports.getArg = getArg; var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/; var dataUrlRegexp = /^data:.+\,.+$/; function urlParse(aUrl) { var match = aUrl.match(urlRegexp); if (!match) { return null; } return { scheme: match[1], auth: match[2], host: match[3], port: match[4], path: match[5] }; } exports.urlParse = urlParse; function urlGenerate(aParsedUrl) { var url = ''; if (aParsedUrl.scheme) { url += aParsedUrl.scheme + ':'; } url += '//'; if (aParsedUrl.auth) { url += aParsedUrl.auth + '@'; } if (aParsedUrl.host) { url += aParsedUrl.host; } if (aParsedUrl.port) { url += ":" + aParsedUrl.port } if (aParsedUrl.path) { url += aParsedUrl.path; } return url; } exports.urlGenerate = urlGenerate; var MAX_CACHED_INPUTS = 32; /** * Takes some function `f(input) -> result` and returns a memoized version of * `f`. * * We keep at most `MAX_CACHED_INPUTS` memoized results of `f` alive. The * memoization is a dumb-simple, linear least-recently-used cache. */ function lruMemoize(f) { var cache = []; return function(input) { for (var i = 0; i < cache.length; i++) { if (cache[i].input === input) { var temp = cache[0]; cache[0] = cache[i]; cache[i] = temp; return cache[0].result; } } var result = f(input); cache.unshift({ input, result, }); if (cache.length > MAX_CACHED_INPUTS) { cache.pop(); } return result; }; } /** * Normalizes a path, or the path portion of a URL: * * - Replaces consecutive slashes with one slash. * - Removes unnecessary '.' parts. * - Removes unnecessary '<dir>/..' parts. * * Based on code in the Node.js 'path' core module. * * @param aPath The path or url to normalize. */ var normalize = lruMemoize(function normalize(aPath) { var path = aPath; var url = urlParse(aPath); if (url) { if (!url.path) { return aPath; } path = url.path; } var isAbsolute = exports.isAbsolute(path); // Split the path into parts between `/` characters. This is much faster than // using `.split(/\/+/g)`. var parts = []; var start = 0; var i = 0; while (true) { start = i; i = path.indexOf("/", start); if (i === -1) { parts.push(path.slice(start)); break; } else { parts.push(path.slice(start, i)); while (i < path.length && path[i] === "/") { i++; } } } for (var part, up = 0, i = parts.length - 1; i >= 0; i--) { part = parts[i]; if (part === '.') { parts.splice(i, 1); } else if (part === '..') { up++; } else if (up > 0) { if (part === '') { // The first part is blank if the path is absolute. Trying to go // above the root is a no-op. Therefore we can remove all '..' parts // directly after the root. parts.splice(i + 1, up); up = 0; } else { parts.splice(i, 2); up--; } } } path = parts.join('/'); if (path === '') { path = isAbsolute ? '/' : '.'; } if (url) { url.path = path; return urlGenerate(url); } return path; }); exports.normalize = normalize; /** * Joins two paths/URLs. * * @param aRoot The root path or URL. * @param aPath The path or URL to be joined with the root. * * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a * scheme-relative URL: Then the scheme of aRoot, if any, is prepended * first. * - Otherwise aPath is a path. If aRoot is a URL, then its path portion * is updated with the result and aRoot is returned. Otherwise the result * is returned. * - If aPath is absolute, the result is aPath. * - Otherwise the two paths are joined with a slash. * - Joining for example 'http://' and 'www.example.com' is also supported. */ function join(aRoot, aPath) { if (aRoot === "") { aRoot = "."; } if (aPath === "") { aPath = "."; } var aPathUrl = urlParse(aPath); var aRootUrl = urlParse(aRoot); if (aRootUrl) { aRoot = aRootUrl.path || '/'; } // `join(foo, '//www.example.org')` if (aPathUrl && !aPathUrl.scheme) { if (aRootUrl) { aPathUrl.scheme = aRootUrl.scheme; } return urlGenerate(aPathUrl); } if (aPathUrl || aPath.match(dataUrlRegexp)) { return aPath; } // `join('http://', 'www.example.com')` if (aRootUrl && !aRootUrl.host && !aRootUrl.path) { aRootUrl.host = aPath; return urlGenerate(aRootUrl); } var joined = aPath.charAt(0) === '/' ? aPath : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath); if (aRootUrl) { aRootUrl.path = joined; return urlGenerate(aRootUrl); } return joined; } exports.join = join; exports.isAbsolute = function (aPath) { return aPath.charAt(0) === '/' || urlRegexp.test(aPath); }; /** * Make a path relative to a URL or another path. * * @param aRoot The root path or URL. * @param aPath The path or URL to be made relative to aRoot. */ function relative(aRoot, aPath) { if (aRoot === "") { aRoot = "."; } aRoot = aRoot.replace(/\/$/, ''); // It is possible for the path to be above the root. In this case, simply // checking whether the root is a prefix of the path won't work. Instead, we // need to remove components from the root one by one, until either we find // a prefix that fits, or we run out of components to remove. var level = 0; while (aPath.indexOf(aRoot + '/') !== 0) { var index = aRoot.lastIndexOf("/"); if (index < 0) { return aPath; } // If the only part of the root that is left is the scheme (i.e. http://, // file:///, etc.), one or more slashes (/), or simply nothing at all, we // have exhausted all components, so the path is not relative to the root. aRoot = aRoot.slice(0, index); if (aRoot.match(/^([^\/]+:\/)?\/*$/)) { return aPath; } ++level; } // Make sure we add a "../" for each component we removed from the root. return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1); } exports.relative = relative; var supportsNullProto = (function () { var obj = Object.create(null); return !('__proto__' in obj); }()); function identity (s) { return s; } /** * Because behavior goes wacky when you set `__proto__` on objects, we * have to prefix all the strings in our set with an arbitrary character. * * See https://github.com/mozilla/source-map/pull/31 and * https://github.com/mozilla/source-map/issues/30 * * @param String aStr */ function toSetString(aStr) { if (isProtoString(aStr)) { return '$' + aStr; } return aStr; } exports.toSetString = supportsNullProto ? identity : toSetString; function fromSetString(aStr) { if (isProtoString(aStr)) { return aStr.slice(1); } return aStr; } exports.fromSetString = supportsNullProto ? identity : fromSetString; function isProtoString(s) { if (!s) { return false; } var length = s.length; if (length < 9 /* "__proto__".length */) { return false; } if (s.charCodeAt(length - 1) !== 95 /* '_' */ || s.charCodeAt(length - 2) !== 95 /* '_' */ || s.charCodeAt(length - 3) !== 111 /* 'o' */ || s.charCodeAt(length - 4) !== 116 /* 't' */ || s.charCodeAt(length - 5) !== 111 /* 'o' */ || s.charCodeAt(length - 6) !== 114 /* 'r' */ || s.charCodeAt(length - 7) !== 112 /* 'p' */ || s.charCodeAt(length - 8) !== 95 /* '_' */ || s.charCodeAt(length - 9) !== 95 /* '_' */) { return false; } for (var i = length - 10; i >= 0; i--) { if (s.charCodeAt(i) !== 36 /* '$' */) { return false; } } return true; } /** * Comparator between two mappings where the original positions are compared. * * Optionally pass in `true` as `onlyCompareGenerated` to consider two * mappings with the same original source/line/column, but different generated * line and column the same. Useful when searching for a mapping with a * stubbed out mapping. */ function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { var cmp = strcmp(mappingA.source, mappingB.source); if (cmp !== 0) { return cmp; } cmp = mappingA.originalLine - mappingB.originalLine; if (cmp !== 0) { return cmp; } cmp = mappingA.originalColumn - mappingB.originalColumn; if (cmp !== 0 || onlyCompareOriginal) { return cmp; } cmp = mappingA.generatedColumn - mappingB.generatedColumn; if (cmp !== 0) { return cmp; } cmp = mappingA.generatedLine - mappingB.generatedLine; if (cmp !== 0) { return cmp; } return strcmp(mappingA.name, mappingB.name); } exports.compareByOriginalPositions = compareByOriginalPositions; function compareByOriginalPositionsNoSource(mappingA, mappingB, onlyCompareOriginal) { var cmp cmp = mappingA.originalLine - mappingB.originalLine; if (cmp !== 0) { return cmp; } cmp = mappingA.originalColumn - mappingB.originalColumn; if (cmp !== 0 || onlyCompareOriginal) { return cmp; } cmp = mappingA.generatedColumn - mappingB.generatedColumn; if (cmp !== 0) { return cmp; } cmp = mappingA.generatedLine - mappingB.generatedLine; if (cmp !== 0) { return cmp; } return strcmp(mappingA.name, mappingB.name); } exports.compareByOriginalPositionsNoSource = compareByOriginalPositionsNoSource; /** * Comparator between two mappings with deflated source and name indices where * the generated positions are compared. * * Optionally pass in `true` as `onlyCompareGenerated` to consider two * mappings with the same generated line and column, but different * source/name/original line and column the same. Useful when searching for a * mapping with a stubbed out mapping. */ function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) { var cmp = mappingA.generatedLine - mappingB.generatedLine; if (cmp !== 0) { return cmp; } cmp = mappingA.generatedColumn - mappingB.generatedColumn; if (cmp !== 0 || onlyCompareGenerated) { return cmp; } cmp = strcmp(mappingA.source, mappingB.source); if (cmp !== 0) { return cmp; } cmp = mappingA.originalLine - mappingB.originalLine; if (cmp !== 0) { return cmp; } cmp = mappingA.originalColumn - mappingB.originalColumn; if (cmp !== 0) { return cmp; } return strcmp(mappingA.name, mappingB.name); } exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated; function compareByGeneratedPositionsDeflatedNoLine(mappingA, mappingB, onlyCompareGenerated) { var cmp = mappingA.generatedColumn - mappingB.generatedColumn; if (cmp !== 0 || onlyCompareGenerated) { return cmp; } cmp = strcmp(mappingA.source, mappingB.source); if (cmp !== 0) { return cmp; } cmp = mappingA.originalLine - mappingB.originalLine; if (cmp !== 0) { return cmp; } cmp = mappingA.originalColumn - mappingB.originalColumn; if (cmp !== 0) { return cmp; } return strcmp(mappingA.name, mappingB.name); } exports.compareByGeneratedPositionsDeflatedNoLine = compareByGeneratedPositionsDeflatedNoLine; function strcmp(aStr1, aStr2) { if (aStr1 === aStr2) { return 0; } if (aStr1 === null) { return 1; // aStr2 !== null } if (aStr2 === null) { return -1; // aStr1 !== null } if (aStr1 > aStr2) { return 1; } return -1; } /** * Comparator between two mappings with inflated source and name strings where * the generated positions are compared. */ function compareByGeneratedPositionsInflated(mappingA, mappingB) { var cmp = mappingA.generatedLine - mappingB.generatedLine; if (cmp !== 0) { return cmp; } cmp = mappingA.generatedColumn - mappingB.generatedColumn; if (cmp !== 0) { return cmp; } cmp = strcmp(mappingA.source, mappingB.source); if (cmp !== 0) { return cmp; } cmp = mappingA.originalLine - mappingB.originalLine; if (cmp !== 0) { return cmp; } cmp = mappingA.originalColumn - mappingB.originalColumn; if (cmp !== 0) { return cmp; } return strcmp(mappingA.name, mappingB.name); } exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated; /** * Strip any JSON XSSI avoidance prefix from the string (as documented * in the source maps specification), and then parse the string as * JSON. */ function parseSourceMapInput(str) { return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, '')); } exports.parseSourceMapInput = parseSourceMapInput; /** * Compute the URL of a source given the the source root, the source's * URL, and the source map's URL. */ function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) { sourceURL = sourceURL || ''; if (sourceRoot) { // This follows what Chrome does. if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') { sourceRoot += '/'; } // The spec says: // Line 4: An optional source root, useful for relocating source // files on a server or removing repeated values in the // “sources” entry. This value is prepended to the individual // entries in the “source” field. sourceURL = sourceRoot + sourceURL; } // Historically, SourceMapConsumer did not take the sourceMapURL as // a parameter. This mode is still somewhat supported, which is why // this code block is conditional. However, it's preferable to pass // the source map URL to SourceMapConsumer, so that this function // can implement the source URL resolution algorithm as outlined in // the spec. This block is basically the equivalent of: // new URL(sourceURL, sourceMapURL).toString() // ... except it avoids using URL, which wasn't available in the // older releases of node still supported by this library. // // The spec says: // If the sources are not absolute URLs after prepending of the // “sourceRoot”, the sources are resolved relative to the // SourceMap (like resolving script src in a html document). if (sourceMapURL) { var parsed = urlParse(sourceMapURL); if (!parsed) { throw new Error("sourceMapURL could not be parsed"); } if (parsed.path) { // Strip the last path component, but keep the "/". var index = parsed.path.lastIndexOf('/'); if (index >= 0) { parsed.path = parsed.path.substring(0, index + 1); } } sourceURL = join(urlGenerate(parsed), sourceURL); } return normalize(sourceURL); } exports.computeSourceURL = computeSourceURL; /***/ }), /***/ "./node_modules/source-map-js/source-map.js": /*!**************************************************!*\ !*** ./node_modules/source-map-js/source-map.js ***! \**************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { /* * Copyright 2009-2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE.txt or: * http://opensource.org/licenses/BSD-3-Clause */ exports.SourceMapGenerator = __webpack_require__(/*! ./lib/source-map-generator */ "./node_modules/source-map-js/lib/source-map-generator.js").SourceMapGenerator; exports.SourceMapConsumer = __webpack_require__(/*! ./lib/source-map-consumer */ "./node_modules/source-map-js/lib/source-map-consumer.js").SourceMapConsumer; exports.SourceNode = __webpack_require__(/*! ./lib/source-node */ "./node_modules/source-map-js/lib/source-node.js").SourceNode; /***/ }), /***/ "./node_modules/string_decoder/lib/string_decoder.js": /*!***********************************************************!*\ !*** ./node_modules/string_decoder/lib/string_decoder.js ***! \***********************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. /*<replacement>*/ var Buffer = (__webpack_require__(/*! safe-buffer */ "./node_modules/safe-buffer/index.js").Buffer); /*</replacement>*/ var isEncoding = Buffer.isEncoding || function (encoding) { encoding = '' + encoding; switch (encoding && encoding.toLowerCase()) { case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw': return true; default: return false; } }; function _normalizeEncoding(enc) { if (!enc) return 'utf8'; var retried; while (true) { switch (enc) { case 'utf8': case 'utf-8': return 'utf8'; case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return 'utf16le'; case 'latin1': case 'binary': return 'latin1'; case 'base64': case 'ascii': case 'hex': return enc; default: if (retried) return; // undefined enc = ('' + enc).toLowerCase(); retried = true; } } }; // Do not cache `Buffer.isEncoding` when checking encoding names as some // modules monkey-patch it to support additional encodings function normalizeEncoding(enc) { var nenc = _normalizeEncoding(enc); if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc); return nenc || enc; } // StringDecoder provides an interface for efficiently splitting a series of // buffers into a series of JS strings without breaking apart multi-byte // characters. exports.StringDecoder = StringDecoder; function StringDecoder(encoding) { this.encoding = normalizeEncoding(encoding); var nb; switch (this.encoding) { case 'utf16le': this.text = utf16Text; this.end = utf16End; nb = 4; break; case 'utf8': this.fillLast = utf8FillLast; nb = 4; break; case 'base64': this.text = base64Text; this.end = base64End; nb = 3; break; default: this.write = simpleWrite; this.end = simpleEnd; return; } this.lastNeed = 0; this.lastTotal = 0; this.lastChar = Buffer.allocUnsafe(nb); } StringDecoder.prototype.write = function (buf) { if (buf.length === 0) return ''; var r; var i; if (this.lastNeed) { r = this.fillLast(buf); if (r === undefined) return ''; i = this.lastNeed; this.lastNeed = 0; } else { i = 0; } if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i); return r || ''; }; StringDecoder.prototype.end = utf8End; // Returns only complete characters in a Buffer StringDecoder.prototype.text = utf8Text; // Attempts to complete a partial non-UTF-8 character using bytes from a Buffer StringDecoder.prototype.fillLast = function (buf) { if (this.lastNeed <= buf.length) { buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); return this.lastChar.toString(this.encoding, 0, this.lastTotal); } buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); this.lastNeed -= buf.length; }; // Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a // continuation byte. If an invalid byte is detected, -2 is returned. function utf8CheckByte(byte) { if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4; return byte >> 6 === 0x02 ? -1 : -2; } // Checks at most 3 bytes at the end of a Buffer in order to detect an // incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4) // needed to complete the UTF-8 character (if applicable) are returned. function utf8CheckIncomplete(self, buf, i) { var j = buf.length - 1; if (j < i) return 0; var nb = utf8CheckByte(buf[j]); if (nb >= 0) { if (nb > 0) self.lastNeed = nb - 1; return nb; } if (--j < i || nb === -2) return 0; nb = utf8CheckByte(buf[j]); if (nb >= 0) { if (nb > 0) self.lastNeed = nb - 2; return nb; } if (--j < i || nb === -2) return 0; nb = utf8CheckByte(buf[j]); if (nb >= 0) { if (nb > 0) { if (nb === 2) nb = 0;else self.lastNeed = nb - 3; } return nb; } return 0; } // Validates as many continuation bytes for a multi-byte UTF-8 character as // needed or are available. If we see a non-continuation byte where we expect // one, we "replace" the validated continuation bytes we've seen so far with // a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding // behavior. The continuation byte check is included three times in the case // where all of the continuation bytes for a character exist in the same buffer. // It is also done this way as a slight performance increase instead of using a // loop. function utf8CheckExtraBytes(self, buf, p) { if ((buf[0] & 0xC0) !== 0x80) { self.lastNeed = 0; return '\ufffd'; } if (self.lastNeed > 1 && buf.length > 1) { if ((buf[1] & 0xC0) !== 0x80) { self.lastNeed = 1; return '\ufffd'; } if (self.lastNeed > 2 && buf.length > 2) { if ((buf[2] & 0xC0) !== 0x80) { self.lastNeed = 2; return '\ufffd'; } } } } // Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer. function utf8FillLast(buf) { var p = this.lastTotal - this.lastNeed; var r = utf8CheckExtraBytes(this, buf, p); if (r !== undefined) return r; if (this.lastNeed <= buf.length) { buf.copy(this.lastChar, p, 0, this.lastNeed); return this.lastChar.toString(this.encoding, 0, this.lastTotal); } buf.copy(this.lastChar, p, 0, buf.length); this.lastNeed -= buf.length; } // Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a // partial character, the character's bytes are buffered until the required // number of bytes are available. function utf8Text(buf, i) { var total = utf8CheckIncomplete(this, buf, i); if (!this.lastNeed) return buf.toString('utf8', i); this.lastTotal = total; var end = buf.length - (total - this.lastNeed); buf.copy(this.lastChar, 0, end); return buf.toString('utf8', i, end); } // For UTF-8, a replacement character is added when ending on a partial // character. function utf8End(buf) { var r = buf && buf.length ? this.write(buf) : ''; if (this.lastNeed) return r + '\ufffd'; return r; } // UTF-16LE typically needs two bytes per character, but even if we have an even // number of bytes available, we need to check if we end on a leading/high // surrogate. In that case, we need to wait for the next two bytes in order to // decode the last character properly. function utf16Text(buf, i) { if ((buf.length - i) % 2 === 0) { var r = buf.toString('utf16le', i); if (r) { var c = r.charCodeAt(r.length - 1); if (c >= 0xD800 && c <= 0xDBFF) { this.lastNeed = 2; this.lastTotal = 4; this.lastChar[0] = buf[buf.length - 2]; this.lastChar[1] = buf[buf.length - 1]; return r.slice(0, -1); } } return r; } this.lastNeed = 1; this.lastTotal = 2; this.lastChar[0] = buf[buf.length - 1]; return buf.toString('utf16le', i, buf.length - 1); } // For UTF-16LE we do not explicitly append special replacement characters if we // end on a partial character, we simply let v8 handle that. function utf16End(buf) { var r = buf && buf.length ? this.write(buf) : ''; if (this.lastNeed) { var end = this.lastTotal - this.lastNeed; return r + this.lastChar.toString('utf16le', 0, end); } return r; } function base64Text(buf, i) { var n = (buf.length - i) % 3; if (n === 0) return buf.toString('base64', i); this.lastNeed = 3 - n; this.lastTotal = 3; if (n === 1) { this.lastChar[0] = buf[buf.length - 1]; } else { this.lastChar[0] = buf[buf.length - 2]; this.lastChar[1] = buf[buf.length - 1]; } return buf.toString('base64', i, buf.length - n); } function base64End(buf) { var r = buf && buf.length ? this.write(buf) : ''; if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed); return r; } // Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex) function simpleWrite(buf) { return buf.toString(this.encoding); } function simpleEnd(buf) { return buf && buf.length ? this.write(buf) : ''; } /***/ }), /***/ "./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/default/component/default-app.vue?vue&type=script&lang=ts": /*!********************************************************************************************************************************************************************************************!*\ !*** ./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/default/component/default-app.vue?vue&type=script&lang=ts ***! \********************************************************************************************************************************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "default", ({ enumerable: true, get: function() { return _default; } })); __webpack_require__(/*! reflect-metadata */ "./node_modules/reflect-metadata/Reflect.js"); var _defaulthomevue = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ./panel/default-home.vue */ "./src/panel/default/component/panel/default-home.vue")); var _vue = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.cjs.js"); var _defaulttranslatevue = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ./panel/default-translate.vue */ "./src/panel/default/component/panel/default-translate.vue")); var _tsyringe = __webpack_require__(/*! tsyringe */ "./node_modules/tsyringe/dist/esm5/index.js"); var _EventBusService = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ../../../lib/core/service/util/EventBusService */ "./src/lib/core/service/util/EventBusService.ts")); var _defaultmaskvue = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ./panel/default-mask.vue */ "./src/panel/default/component/panel/default-mask.vue")); var _WrapperMainIPC = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ../../../lib/core/ipc/WrapperMainIPC */ "./src/lib/core/ipc/WrapperMainIPC.ts")); var _global = __webpack_require__(/*! ../../../lib/core/service/util/global */ "./src/lib/core/service/util/global.ts"); function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _async_to_generator(fn) { return function() { var self = this, args = arguments; return new Promise(function(resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } function _interop_require_default(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _ts_generator(thisArg, body) { var f, y, t, g, _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }; 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(_)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 }; } } var eventBus = _tsyringe.container.resolve(_EventBusService.default); var wrapper = _tsyringe.container.resolve(_WrapperMainIPC.default); var _default = { components: { Home: _defaulthomevue.default, Translate: _defaulttranslatevue.default, DefaultMask: _defaultmaskvue.default }, setup: function setup() { (0, _vue.onMounted)(function() { eventBus.on('onCustomError', onError); }); (0, _vue.onUnmounted)(function() { eventBus.off('onCustomError', onError); }); var isLocalizationEditorEnable = (0, _vue.ref)(true); var showMask = (0, _vue.ref)(false); var targetLocale = (0, _vue.ref)(''); var tabIndex = (0, _vue.ref)(0); function onError(customError) { Editor.Dialog.error(customError.message, { buttons: [ Editor.I18n.t(_global.MainName + '.confirm') ] }); console.error(customError); } wrapper.getEnable().then(function(r) { isLocalizationEditorEnable.value = r; }); return { MainName: _global.MainName, onToggle: function onToggle(enable) { return _async_to_generator(function() { return _ts_generator(this, function(_state) { isLocalizationEditorEnable.value = enable; return [ 2 ]; }); })(); }, onMaskConfirm: function onMaskConfirm() { return _async_to_generator(function() { return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, wrapper.toggle() ]; case 1: isLocalizationEditorEnable.value = _state.sent(); return [ 2 ]; } }); })(); }, isLocalizationEditorEnable: isLocalizationEditorEnable, tabIndex: tabIndex, targetLocale: targetLocale, showMask: showMask, onTranslateClick: function onTranslateClick(language) { targetLocale.value = language; tabIndex.value = 1; showMask.value = true; }, onTranslateInitialized: function onTranslateInitialized() { showMask.value = false; }, onHomeClick: function onHomeClick() { eventBus.emit('updateAllLanguageConfig'); tabIndex.value = 0; } }; } }; /***/ }), /***/ "./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/default/component/panel/default-home.vue?vue&type=script&lang=ts": /*!***************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/default/component/panel/default-home.vue?vue&type=script&lang=ts ***! \***************************************************************************************************************************************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "default", ({ enumerable: true, get: function() { return _default; } })); var _fs = __webpack_require__(/*! fs */ "fs"); var _path = __webpack_require__(/*! path */ "path"); var _vue = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.cjs.js"); var _tsyringe = __webpack_require__(/*! tsyringe */ "./node_modules/tsyringe/dist/esm5/index.js"); var _WrapperMainIPC = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ../../../../lib/core/ipc/WrapperMainIPC */ "./src/lib/core/ipc/WrapperMainIPC.ts")); var _EventBusService = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ../../../../lib/core/service/util/EventBusService */ "./src/lib/core/service/util/EventBusService.ts")); var _global = __webpack_require__(/*! ../../../../lib/core/service/util/global */ "./src/lib/core/service/util/global.ts"); var _type = __webpack_require__(/*! ../../../../lib/core/type/type */ "./src/lib/core/type/type.ts"); var _Iterator = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ../../../share/scripts/Iterator */ "./src/panel/share/scripts/Iterator.ts")); var _languageMap = __webpack_require__(/*! ../../../share/scripts/libs/languageMap */ "./src/panel/share/scripts/libs/languageMap.ts"); var _menu = __webpack_require__(/*! ../../../share/scripts/menu */ "./src/panel/share/scripts/menu.ts"); var _utils = __webpack_require__(/*! ../../../share/scripts/utils */ "./src/panel/share/scripts/utils.ts"); var _mbuttonvue = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ../../../share/ui/m-button.vue */ "./src/panel/share/ui/m-button.vue")); var _mfilevue = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ../../../share/ui/m-file.vue */ "./src/panel/share/ui/m-file.vue")); var _miconvue = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ../../../share/ui/m-icon.vue */ "./src/panel/share/ui/m-icon.vue")); var _minputvue = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ../../../share/ui/m-input.vue */ "./src/panel/share/ui/m-input.vue")); var _mmenuvue = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ../../../share/ui/m-menu.vue */ "./src/panel/share/ui/m-menu.vue")); var _mprocessvue = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ../../../share/ui/m-process.vue */ "./src/panel/share/ui/m-process.vue")); var _msectionvue = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ../../../share/ui/m-section.vue */ "./src/panel/share/ui/m-section.vue")); var _Errors = __webpack_require__(/*! ../../../../lib/core/error/Errors */ "./src/lib/core/error/Errors.ts"); var _MainMessage = __webpack_require__(/*! ../../../../lib/core/entity/messages/MainMessage */ "./src/lib/core/entity/messages/MainMessage.ts"); function _array_like_to_array(arr, len) { if (len == null || len > arr.length) len = arr.length; for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i]; return arr2; } function _array_with_holes(arr) { if (Array.isArray(arr)) return arr; } function _array_without_holes(arr) { if (Array.isArray(arr)) return _array_like_to_array(arr); } function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _async_to_generator(fn) { return function() { var self = this, args = arguments; return new Promise(function(resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } function _class_call_check(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _define_property(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _interop_require_default(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _iterable_to_array(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _iterable_to_array_limit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){ _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally{ try { if (!_n && _i["return"] != null) _i["return"](); } finally{ if (_d) throw _e; } } return _arr; } function _non_iterable_rest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _non_iterable_spread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _sliced_to_array(arr, i) { return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest(); } function _to_consumable_array(arr) { return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread(); } function _unsupported_iterable_to_array(o, minLen) { if (!o) return; if (typeof o === "string") return _array_like_to_array(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen); } function _ts_generator(thisArg, body) { var f, y, t, g, _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }; 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(_)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 }; } } var remote = __webpack_require__(/*! @electron/remote */ "./node_modules/@electron/remote/renderer/index.js"); var eventBus = _tsyringe.container.resolve(_EventBusService.default); var wrapper = _tsyringe.container.resolve(_WrapperMainIPC.default); var Collection = function Collection(expanded, /** 多个搜索的目录 */ dirs, exts, excludes) { "use strict"; _class_call_check(this, Collection); _define_property(this, "expanded", void 0); _define_property(this, "dirs", void 0); _define_property(this, "exts", void 0); _define_property(this, "excludes", void 0); this.expanded = expanded; this.dirs = dirs; this.exts = exts; this.excludes = excludes; }; var _default = { components: { 'm-input': _minputvue.default, 'm-file': _mfilevue.default, 'm-process': _mprocessvue.default, 'm-icon': _miconvue.default, 'm-button': _mbuttonvue.default, 'm-section': _msectionvue.default, 'm-menu': _mmenuvue.default }, emits: [ 'translate', 'toggle' ], setup: function setup(props, param) { var emit = param.emit; return _async_to_generator(function() { var _currentService_value, currentLanguageDisplayName, currentCollectCount, supportedServices, isCurrentServiceLoading, isCurrentServiceDirty, currentService, providerLanguages, hasService, isCurrentServiceDisabled, scanOptions, collections, collectionProgress, isCollecting, isCollectingHasWrongDir, isCollectionDisabled, importedPOfiles, panelTranslateDataList, currentLanguage, panelProfileKey, lastFileProfileKey, lastDirProfileKey, isShowExportMenus, exportAllMenus, exportButton, menuPosition, i18nMainName; function onScanning(finish, total) { collectionProgress.value = total && finish / total; currentCollectCount.value = finish; } function updateAllLanguageConfig() { return _updateAllLanguageConfig.apply(this, arguments); } function _updateAllLanguageConfig() { _updateAllLanguageConfig = /** 更新所有语言配置 */ _async_to_generator(function() { return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, wrapper.getAllLanguageConfigs() ]; case 1: panelTranslateDataList.value = _state.sent().map(function(data) { return new _Iterator.default(data); }); return [ 4, wrapper.getLocalLanguageConfig() ]; case 2: currentLanguage.value = _state.sent(); return [ 2 ]; } }); }); return _updateAllLanguageConfig.apply(this, arguments); } function onAppKeyUpdate(value) { if (currentService.value) { isCurrentServiceDirty.value = true; currentService.value.appKey = value; } } function onAppSecretUpdate(value) { if (currentService.value) { isCurrentServiceDirty.value = true; currentService.value.appSecret = value; } } function onSetCurrentTranslateProvider(event) { return _onSetCurrentTranslateProvider.apply(this, arguments); } function _onSetCurrentTranslateProvider() { _onSetCurrentTranslateProvider = /** 当服务商被选择后 */ _async_to_generator(function(event) { var name, _ref; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: name = event.target.value; if (!(name === 'None')) return [ 3, 2 ]; return [ 4, wrapper.clearTranslateProvider() ]; case 1: _state.sent(); currentService.value = undefined; hasService.value = false; return [ 3, 4 ]; case 2: return [ 4, wrapper.getTranslateProvider(name) ]; case 3: currentService.value = (_ref = _state.sent()) !== null && _ref !== void 0 ? _ref : { appKey: '', appSecret: '', name: name, qps: 0, url: '' }; _state.label = 4; case 4: isCurrentServiceDirty.value = true; return [ 2 ]; } }); }); return _onSetCurrentTranslateProvider.apply(this, arguments); } function onProviderLanguageSelect(event, index) { return _onProviderLanguageSelect.apply(this, arguments); } function _onProviderLanguageSelect() { _onProviderLanguageSelect = /** 为某个语言配置服务商使用的语言 */ _async_to_generator(function(event, index) { var _Object_entries_find, displayName, providerTag, config; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: displayName = event.target.value; providerTag = (_Object_entries_find = Object.entries(providerLanguages.value).find(function(param) { var _param = _sliced_to_array(param, 2), key = _param[0], value = _param[1]; return value === displayName; })) === null || _Object_entries_find === void 0 ? void 0 : _Object_entries_find[0]; if (!providerTag) return [ 3, 2 ]; config = panelTranslateDataList.value[index].value; config.providerTag = providerTag; return [ 4, wrapper.setLanguageConfig(config) ]; case 1: _state.sent(); _state.label = 2; case 2: return [ 2 ]; } }); }); return _onProviderLanguageSelect.apply(this, arguments); } function onProviderSummitClick() { return _onProviderSummitClick.apply(this, arguments); } function _onProviderSummitClick() { _onProviderSummitClick = /** 点击服务商的提交按钮 */ _async_to_generator(function() { var _currentService_value; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: if (!currentService.value) return [ 3, 3 ]; isCurrentServiceLoading.value = true; return [ 4, wrapper.setCurrentTranslateProvider(currentService.value) ]; case 1: _state.sent(); isCurrentServiceLoading.value = false; isCurrentServiceDirty.value = false; hasService.value = true; return [ 4, wrapper.getProviderLanguages((_currentService_value = currentService.value) === null || _currentService_value === void 0 ? void 0 : _currentService_value.name) ]; case 2: providerLanguages.value = _state.sent(); updateAllLanguageConfig(); _state.label = 3; case 3: return [ 2 ]; } }); }); return _onProviderSummitClick.apply(this, arguments); } /** 移除一个收集组 */ function onRemoveCollectionClick(collectionIndex) { collections.value.splice(collectionIndex, 1); } /** 添加一个收集组 */ function onAddCollectionClick() { collections.value.push(new _Iterator.default(new Collection(true, { expanded: true, items: [ new _Iterator.default('') ] }, { expanded: true, items: [] }, { expanded: true, items: [] }))); } function onSelectCollectionDirClick(collectionIndex, dirIndex) { return _onSelectCollectionDirClick.apply(this, arguments); } function _onSelectCollectionDirClick() { _onSelectCollectionDirClick = /** 为一个收集组选择某个包含目录 */ _async_to_generator(function(collectionIndex, dirIndex) { var resourcesPath, result, dir; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: resourcesPath = (0, _path.join)(Editor.Project.path, 'assets'); return [ 4, Editor.Dialog.select({ multi: false, type: 'directory', path: resourcesPath }) ]; case 1: result = _state.sent(); if (!result.canceled) { dir = (0, _path.relative)(_global.ProjectAssetPath, result.filePaths[0]); // todo 提示别选这个以外的目录 if (!collections.value[collectionIndex].value.dirs.items.find(function(item) { return item.value === dir; })) { collections.value[collectionIndex].value.dirs.items[dirIndex].value = dir; } return [ 2, result ]; } return [ 2 ]; } }); }); return _onSelectCollectionDirClick.apply(this, arguments); } function onSelectExcludeDirClick(collectionIndex, dirIndex) { return _onSelectExcludeDirClick.apply(this, arguments); } function _onSelectExcludeDirClick() { _onSelectExcludeDirClick = /** 为一个收集组选择某个排除目录 */ _async_to_generator(function(collectionIndex, dirIndex) { var resourcesPath, result, dir; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: resourcesPath = (0, _path.join)(Editor.Project.path, 'assets'); return [ 4, Editor.Dialog.select({ multi: false, type: 'directory', path: resourcesPath }) ]; case 1: result = _state.sent(); if (!result.canceled) { dir = (0, _path.relative)(_global.ProjectAssetPath, result.filePaths[0]); // todo 提示别选这个以外的目录 if (!collections.value[collectionIndex].value.excludes.items.find(function(item) { return item.value === dir; })) { collections.value[collectionIndex].value.excludes.items[dirIndex].value = dir; } return [ 2, result ]; } return [ 2 ]; } }); }); return _onSelectExcludeDirClick.apply(this, arguments); } /** 添加到收集组的某一项 */ function onAddToCollectionClick(collectionIndex, key) { collections.value[collectionIndex].value[key].items.push(new _Iterator.default('')); collections.value[collectionIndex].value[key].expanded = true; } /** 移除收集组的某一项 */ function onRemoveFromCollectionClick(collectionIndex, index, key) { collections.value[collectionIndex].value[key].items.splice(index, 1); } function onScanClick() { return _onScanClick.apply(this, arguments); } function _onScanClick() { _onScanClick = /** 点击扫描并统计 */ _async_to_generator(function() { return _ts_generator(this, function(_state) { switch(_state.label){ case 0: isCollecting.value = true; currentCollectCount.value = 0; collectionProgress.value = 0; return [ 4, wrapper.scan(collections.value.map(function(item) { return { dirs: item.value.dirs.items.map(function(item) { return item.value; }), extNames: item.value.exts.items.map(function(item) { return item.value; }), excludes: item.value.excludes.items.map(function(item) { return item.value; }) }; })) ]; case 1: _state.sent(); collectionProgress.value = -1; isCollecting.value = false; // 扫描结束后更新语言配置 return [ 2, updateAllLanguageConfig() ]; } }); }); return _onScanClick.apply(this, arguments); } function onImportPOClick() { return _onImportPOClick.apply(this, arguments); } function _onImportPOClick() { _onImportPOClick = /** 点击导入 po 文件 */ _async_to_generator(function() { var result, _importedPOfiles_value, files; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, Editor.Dialog.select({ extensions: 'po' }) ]; case 1: result = _state.sent(); if (!result.canceled) { ; files = result.filePaths.filter(function(file) { return !importedPOfiles.value.find(function(item) { return item.value === file; }); }); (_importedPOfiles_value = importedPOfiles.value).push.apply(_importedPOfiles_value, _to_consumable_array(files.map(function(file) { return new _Iterator.default(file); }))); } return [ 2 ]; } }); }); return _onImportPOClick.apply(this, arguments); } /** 移除 po 文件 */ function onRemovePOClick(index) { importedPOfiles.value.splice(index, 1); } function onTranslateClick(index) { return _onTranslateClick.apply(this, arguments); } function _onTranslateClick() { _onTranslateClick = /** 语言编译面板点击了翻译 */ _async_to_generator(function(index) { var panelTranslateData; return _ts_generator(this, function(_state) { panelTranslateData = panelTranslateDataList.value[index].value; if (!(panelTranslateData === null || panelTranslateData === void 0 ? void 0 : panelTranslateData.providerTag)) { eventBus.emit('onCustomError', new _Errors.CustomError(_MainMessage.MessageCode.PROVIDER_TAG_NOT_FOUND)); return [ 2 ]; } emit('translate', panelTranslateData.bcp47Tag); return [ 2 ]; }); }); return _onTranslateClick.apply(this, arguments); } function onPreviewClick(index) { return _onPreviewClick.apply(this, arguments); } function _onPreviewClick() { _onPreviewClick = /** 语言编译面板点击了预览*/ _async_to_generator(function(index) { var locale; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: locale = panelTranslateDataList.value[index].value.bcp47Tag; return [ 4, wrapper.previewBy(locale) ]; case 1: _state.sent(); return [ 4, Editor.Panel.focus('scene') ]; case 2: _state.sent(); return [ 2 ]; } }); }); return _onPreviewClick.apply(this, arguments); } function onDeleteClick(index) { return _onDeleteClick.apply(this, arguments); } function _onDeleteClick() { _onDeleteClick = /** 语言编译面板点击了删除 */ _async_to_generator(function(index) { var result; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, wrapper.removeLanguage(panelTranslateDataList.value[index].value.bcp47Tag) ]; case 1: result = _state.sent(); if (!(result !== false)) return [ 3, 3 ]; return [ 4, updateAllLanguageConfig() ]; case 2: _state.sent(); _state.label = 3; case 3: return [ 2 ]; } }); }); return _onDeleteClick.apply(this, arguments); } function onExportClick(index) { return _onExportClick.apply(this, arguments); } function _onExportClick() { _onExportClick = /** 导出按钮被点击 */ _async_to_generator(function(index) { var filePath, translateFileType, locale, lastFile, lastExt, path, result; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: locale = panelTranslateDataList.value[index].value.bcp47Tag; return [ 4, getLastDialogFilePath() ]; case 1: lastFile = _state.sent(); lastExt = (0, _path.extname)(lastFile); path = (0, _path.join)((0, _path.dirname)(lastFile), "".concat(locale).concat(lastExt || '.po')); return [ 4, Editor.Dialog.save({ filters: [ { name: Editor.I18n.t("".concat(_global.MainName, ".home.po_name")), extensions: [ 'po' ] }, { name: Editor.I18n.t("".concat(_global.MainName, ".home.csv_name")), extensions: [ 'csv' ] }, { name: Editor.I18n.t("".concat(_global.MainName, ".home.xlsx_name")), extensions: [ 'xlsx' ] } ], path: path }) ]; case 2: result = _state.sent(); if (!(!result.canceled && result.filePath)) return [ 3, 4 ]; filePath = result.filePath; setLastDialogFilePath(filePath); translateFileType = (0, _utils.getTranslateFileType)(filePath); return [ 4, wrapper.exportTranslateFile(filePath, translateFileType, locale) ]; case 3: _state.sent(); remote.shell.showItemInFolder(filePath); _state.label = 4; case 4: return [ 2 ]; } }); }); return _onExportClick.apply(this, arguments); } function getLastDialogFilePath() { return _getLastDialogFilePath.apply(this, arguments); } function _getLastDialogFilePath() { _getLastDialogFilePath = /** 获取上次保存的文件的路径 */ _async_to_generator(function() { return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, Editor.Profile.getTemp(_global.MainName, lastFileProfileKey) ]; case 1: return [ 2, _state.sent() || '' ]; } }); }); return _getLastDialogFilePath.apply(this, arguments); } function getLastDialogDirPath() { return _getLastDialogDirPath.apply(this, arguments); } function _getLastDialogDirPath() { _getLastDialogDirPath = /** 获取上次保存的目录的路径 */ _async_to_generator(function() { return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, Editor.Profile.getTemp(_global.MainName, lastDirProfileKey) ]; case 1: return [ 2, _state.sent() || '' ]; } }); }); return _getLastDialogDirPath.apply(this, arguments); } /** 设置最后保存的文件的路径 */ function setLastDialogFilePath(path) { Editor.Profile.setTemp(_global.MainName, lastFileProfileKey, path); } /** 设置最后保存的目录的路径 */ function setLastDialogDirPath(path) { Editor.Profile.setTemp(_global.MainName, lastDirProfileKey, path); } function selectDirectory() { return _selectDirectory.apply(this, arguments); } function _selectDirectory() { _selectDirectory = _async_to_generator(function() { var result, _, _1, _tmp, path; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: _1 = (_ = Editor.Dialog).select; _tmp = { type: 'directory', multi: false }; return [ 4, getLastDialogDirPath() ]; case 1: return [ 4, _1.apply(_, [ (_tmp.path = _state.sent(), _tmp) ]) ]; case 2: result = _state.sent(); if (!result.canceled) { path = result.filePaths[0]; setLastDialogDirPath(path); return [ 2, path ]; } return [ 2, '' ]; } }); }); return _selectDirectory.apply(this, arguments); } function exportAll(dir, translateFileType) { return _exportAll.apply(this, arguments); } function _exportAll() { _exportAll = _async_to_generator(function(dir, translateFileType) { var firstFile; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, Promise.all(panelTranslateDataList.value.map(/*#__PURE__*/ function() { var _ref = _async_to_generator(function(item) { var ext, filePath; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: ext = (0, _utils.getFileExtNameOfTranslateFileType)(translateFileType); filePath = (0, _path.join)(dir, "".concat(item.value.bcp47Tag).concat(ext)); if (!firstFile) { firstFile = filePath; } return [ 4, wrapper.exportTranslateFile(filePath, translateFileType, item.value.bcp47Tag) ]; case 1: return [ 2, _state.sent() ]; } }); }); return function(item) { return _ref.apply(this, arguments); }; }())) ]; case 1: _state.sent(); if (firstFile) { remote.shell.showItemInFolder(firstFile); } return [ 2 ]; } }); }); return _exportAll.apply(this, arguments); } /** 选择了新的语言 */ function onSelectNewLanguageClick() { (0, _menu.popupLanguage)(/*#__PURE__*/ function() { var _ref = _async_to_generator(function(str, displayName) { return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, wrapper.addTargetLanguage(str) ]; case 1: _state.sent(); return [ 4, updateAllLanguageConfig() ]; case 2: _state.sent(); return [ 2 ]; } }); }); return function(str, displayName) { return _ref.apply(this, arguments); }; }(), panelTranslateDataList.value.map(function(item) { return item.value.bcp47Tag; })); } /** 选择本地开发使用的语言 */ function onSelectLocalClick() { var _currentLanguage_value; var _currentLanguage_value_bcp47Tag; (0, _menu.popupLanguage)(/*#__PURE__*/ function() { var _ref = _async_to_generator(function(str) { return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, wrapper.setLocalLanguage(str) ]; case 1: _state.sent(); return [ 4, updateAllLanguageConfig() ]; case 2: _state.sent(); return [ 2 ]; } }); }); return function(str) { return _ref.apply(this, arguments); }; }(), [ (_currentLanguage_value_bcp47Tag = currentLanguage === null || currentLanguage === void 0 ? void 0 : (_currentLanguage_value = currentLanguage.value) === null || _currentLanguage_value === void 0 ? void 0 : _currentLanguage_value.bcp47Tag) !== null && _currentLanguage_value_bcp47Tag !== void 0 ? _currentLanguage_value_bcp47Tag : '' ]); } function getTranslateProcess(item) { var _currentLanguage_value; if (!((_currentLanguage_value = currentLanguage.value) === null || _currentLanguage_value === void 0 ? void 0 : _currentLanguage_value.translateTotal)) { return 0; } return item.value.translateFinished / currentLanguage.value.translateTotal; } function getTranslateProcessDescription(item) { if (!currentLanguage.value) { return '0%'; } return "".concat(currentLanguage.value.translateTotal && Math.floor(item.value.translateFinished * 100 / currentLanguage.value.translateTotal), "%(").concat(wrapper.numberFormat(item.value.translateFinished), "/").concat(wrapper.numberFormat(currentLanguage.value.translateTotal), ")"); } function onLinkClick(where) { var language = Editor.I18n.getLanguage() === 'zh' ? 'zh' : 'en'; if (where === 'i18n') { remote.shell.openExternal("https://docs.cocos.com/creator/manual/".concat(language, "/editor/l10n/overview.html")); } else { remote.shell.openExternal("https://docs.cocos.com/creator/manual/".concat(language, "/editor/l10n/collect-and-count.html")); } } function onMenuClick() { Editor.Menu.popup({ menu: [ { label: Editor.I18n.t('localization-editor.home.delete_data'), click: function click() { return _async_to_generator(function() { var cancel, result; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: cancel = 0; return [ 4, Editor.Dialog.warn(Editor.I18n.t('localization-editor.home.delete_data_warning'), { 'buttons': [ Editor.I18n.t('localization-editor.cancel'), Editor.I18n.t('localization-editor.confirm') ], cancel: cancel, default: 0 }) ]; case 1: result = _state.sent(); if (!(result.response !== cancel)) return [ 3, 4 ]; return [ 4, wrapper.removeAllLanguage() ]; case 2: _state.sent(); return [ 4, updateAllLanguageConfig() ]; case 3: _state.sent(); _state.label = 4; case 4: return [ 2 ]; } }); })(); } }, { label: Editor.I18n.t('localization-editor.home.turn_off'), click: function click() { return _async_to_generator(function() { var dirty, _tmp, cancel, result; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, Editor.Message.request('scene', 'query-dirty') ]; case 1: _tmp = _state.sent(); if (_tmp) return [ 3, 3 ]; return [ 4, wrapper.getDirty() ]; case 2: _tmp = _state.sent(); _state.label = 3; case 3: dirty = _tmp; if (dirty) { eventBus.emit('onCustomError', new _Errors.CustomError(_MainMessage.MessageCode.EDITOR_DIRTY)); return [ 2 ]; } cancel = 0; return [ 4, Editor.Dialog.warn(Editor.I18n.t('localization-editor.home.turn_off_warning'), { 'buttons': [ Editor.I18n.t('localization-editor.cancel'), Editor.I18n.t('localization-editor.confirm') ], default: 0, cancel: 0 }) ]; case 4: result = _state.sent(); if (!(result.response !== cancel)) return [ 3, 6 ]; return [ 4, wrapper.uninstall() ]; case 5: _state.sent(); // 因为 toggle 会关闭 L10nEnable,导致脚本被移除,需要延迟到下一帧,才能确保正常卸载 requestAnimationFrame(/*#__PURE__*/ _async_to_generator(function() { return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, Editor.Message.request('asset-db', 'refresh-asset', 'db://assets') ]; case 1: _state.sent(); return [ 4, toggle() ]; case 2: _state.sent(); Editor.Message.send('scene', 'soft-reload'); return [ 4, wrapper.closePanel() ]; case 3: _state.sent(); return [ 2 ]; } }); })); _state.label = 6; case 6: return [ 2 ]; } }); })(); } } ] }); } function onShowExportMenu() { if (exportButton.value) { var el = exportButton.value.$el; var rect = el.getBoundingClientRect(); menuPosition.value.y = rect.height; } isShowExportMenus.value = true; } function toggle() { return _toggle.apply(this, arguments); } function _toggle() { _toggle = _async_to_generator(function() { var _tmp; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: _tmp = [ 'toggle' ]; return [ 4, wrapper.toggle() ]; case 1: emit.apply(void 0, _tmp.concat([ _state.sent() ])); return [ 2 ]; } }); }); return _toggle.apply(this, arguments); } return _ts_generator(this, function(_state) { switch(_state.label){ case 0: (0, _vue.onMounted)(function() { eventBus.on('scanProgress', onScanning); eventBus.on('updateAllLanguageConfig', updateAllLanguageConfig); }); (0, _vue.onUnmounted)(function() { eventBus.off('scanProgress', onScanning); eventBus.off('updateAllLanguageConfig', updateAllLanguageConfig); }); /** 当前语言显示的名称 */ currentLanguageDisplayName = (0, _vue.computed)(function() { var _currentLanguage_value; var _getLanguageDisplayName; return (_getLanguageDisplayName = (0, _languageMap.getLanguageDisplayName)((_currentLanguage_value = currentLanguage.value) === null || _currentLanguage_value === void 0 ? void 0 : _currentLanguage_value.bcp47Tag, 'none')) !== null && _getLanguageDisplayName !== void 0 ? _getLanguageDisplayName : ''; }); /** 现在临时收集到的统计数据 */ currentCollectCount = (0, _vue.ref)(-1); return [ 4, wrapper.getTranslateProviders() ]; case 1: supportedServices = _vue.ref.apply(void 0, [ _state.sent() ]); /** 是否正在保存服务商 */ isCurrentServiceLoading = (0, _vue.ref)(false); /** 服务商是否修改了数据 */ isCurrentServiceDirty = (0, _vue.ref)(false); return [ 4, wrapper.getCurrentTranslateProvider() ]; case 2: currentService = _vue.ref.apply(void 0, [ _state.sent() ]); return [ 4, wrapper.getProviderLanguages((_currentService_value = currentService.value) === null || _currentService_value === void 0 ? void 0 : _currentService_value.name) ]; case 3: providerLanguages = _vue.ref.apply(void 0, [ _state.sent() ]); hasService = (0, _vue.ref)(!!currentService.value); isCurrentServiceDisabled = (0, _vue.computed)(function() { var _currentService_value, _currentService_value1; return !((_currentService_value = currentService.value) === null || _currentService_value === void 0 ? void 0 : _currentService_value.appKey) || !((_currentService_value1 = currentService.value) === null || _currentService_value1 === void 0 ? void 0 : _currentService_value1.appSecret) || !isCurrentServiceDirty.value; }); return [ 4, wrapper.getScanOptions() ]; case 4: scanOptions = _state.sent(); if (scanOptions.length === 0) { scanOptions.push({ dirs: [ '' ], excludes: [], extNames: [] }); } /** 数据集 */ collections = (0, _vue.ref)(scanOptions.map(function(item) { return new _Iterator.default(new Collection(true, { expanded: true, items: item.dirs.map(function(dir) { return new _Iterator.default(dir); }) }, { expanded: true, items: item.extNames.map(function(ext) { return new _Iterator.default(ext); }) }, { expanded: true, items: item.excludes.map(function(exclude) { return new _Iterator.default(exclude); }) })); })); /** 收集的进度信息 */ collectionProgress = (0, _vue.ref)(-1); /** 是否正在扫描 */ isCollecting = (0, _vue.ref)(false); isCollectingHasWrongDir = (0, _vue.computed)(function() { return collections.value.some(function(item) { return item.value.dirs.items.some(function(item) { return !Editor.Utils.Path.contains(_global.ProjectAssetPath, (0, _path.join)(_global.ProjectAssetPath, item.value)) || !(0, _fs.existsSync)((0, _path.join)(_global.ProjectAssetPath, item.value)); }); }); }); /** 是否禁用点击扫描与统计 */ isCollectionDisabled = (0, _vue.computed)(function() { return isCollectingHasWrongDir.value || isCollecting.value || !collections.value.length || !currentLanguage.value; }); /** 导入的 po 文件组 */ importedPOfiles = (0, _vue.ref)([]); return [ 4, wrapper.getAllLanguageConfigs() ]; case 5: panelTranslateDataList = _vue.ref.apply(void 0, [ _state.sent().map(function(data) { return new _Iterator.default(data); }) ]); console.debug('All language data', panelTranslateDataList); return [ 4, wrapper.getLocalLanguageConfig() ]; case 6: currentLanguage = _vue.ref.apply(void 0, [ _state.sent() ]); console.debug('Data for the current language', currentLanguage); panelProfileKey = 'panel.default-home'; lastFileProfileKey = "".concat(panelProfileKey, ".lastFile"); lastDirProfileKey = "".concat(panelProfileKey, ".lastDir"); isShowExportMenus = (0, _vue.ref)(false); exportAllMenus = (0, _vue.ref)([ { label: 'po', click: function click() { return _async_to_generator(function() { var dir; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, selectDirectory() ]; case 1: dir = _state.sent(); if (!dir) return [ 3, 3 ]; return [ 4, exportAll(dir, _type.TranslateFileType.PO) ]; case 2: _state.sent(); _state.label = 3; case 3: return [ 2 ]; } }); })(); } }, { label: 'csv', click: function click() { return _async_to_generator(function() { var dir; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, selectDirectory() ]; case 1: dir = _state.sent(); if (!dir) return [ 3, 3 ]; return [ 4, exportAll(dir, _type.TranslateFileType.CSV) ]; case 2: _state.sent(); _state.label = 3; case 3: return [ 2 ]; } }); })(); } }, { label: 'xlsx', click: function click() { return _async_to_generator(function() { var dir; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, selectDirectory() ]; case 1: dir = _state.sent(); if (!dir) return [ 3, 3 ]; return [ 4, exportAll(dir, _type.TranslateFileType.XLSX) ]; case 2: _state.sent(); _state.label = 3; case 3: return [ 2 ]; } }); })(); } } ]); exportButton = (0, _vue.ref)(null); menuPosition = (0, _vue.ref)({ x: 0, y: 0 }); i18nMainName = 'i18n:' + _global.MainName; return [ 2, { onShowExportMenu: onShowExportMenu, exportButton: exportButton, menuPosition: menuPosition, isShowExportMenus: isShowExportMenus, exportAllMenus: exportAllMenus, onMenuClick: onMenuClick, currentCollectCount: currentCollectCount, isCurrentServiceDirty: isCurrentServiceDirty, isCurrentServiceLoading: isCurrentServiceLoading, onAppKeyUpdate: onAppKeyUpdate, onAppSecretUpdate: onAppSecretUpdate, onLinkClick: onLinkClick, onSelectNewLanguageClick: onSelectNewLanguageClick, hasService: hasService, isCurrentServiceDisabled: isCurrentServiceDisabled, getTranslateProcessDescription: getTranslateProcessDescription, isCollecting: isCollecting, isCollectingHasWrongDir: isCollectingHasWrongDir, isCollectionDisabled: isCollectionDisabled, collectionProgress: collectionProgress, projectAssetPath: (0, _vue.ref)('db://assets/'), onSelectExcludeDirClick: onSelectExcludeDirClick, onSelectLocalClick: onSelectLocalClick, onScanClick: onScanClick, currentService: currentService, onProviderSummitClick: onProviderSummitClick, onSetCurrentTranslateProvider: onSetCurrentTranslateProvider, currentLanguage: currentLanguage, onAddCollectionClick: onAddCollectionClick, onRemoveCollectionClick: onRemoveCollectionClick, collections: collections, onAddToCollectionClick: onAddToCollectionClick, onSelectCollectionDirClick: onSelectCollectionDirClick, onRemoveFromCollectionClick: onRemoveFromCollectionClick, i18nMainName: i18nMainName, importedPOfiles: importedPOfiles, onImportPOClick: onImportPOClick, onRemovePOClick: onRemovePOClick, panelTranslateDataList: panelTranslateDataList, providerLanguages: providerLanguages, supportedServices: supportedServices, onTranslateClick: onTranslateClick, onPreviewClick: onPreviewClick, onDeleteClick: onDeleteClick, onExportClick: onExportClick, onProviderLanguageSelect: onProviderLanguageSelect, t: Editor.I18n.t, currentLanguageDisplayName: currentLanguageDisplayName, numberFormat: wrapper.numberFormat.bind(wrapper), getTranslateProcess: getTranslateProcess } ]; } }); })(); } }; /***/ }), /***/ "./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/default/component/panel/default-mask.vue?vue&type=script&lang=ts": /*!***************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/default/component/panel/default-mask.vue?vue&type=script&lang=ts ***! \***************************************************************************************************************************************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "default", ({ enumerable: true, get: function() { return _default; } })); var _global = __webpack_require__(/*! ../../../../lib/core/service/util/global */ "./src/lib/core/service/util/global.ts"); var _default = { emits: [ 'confirm' ], setup: function setup(props, param) { var emit = param.emit; return { onButtonClick: function onButtonClick() { emit('confirm'); }, PKGName: "i18n:".concat(_global.MainName) }; } }; /***/ }), /***/ "./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/default/component/panel/default-translate.vue?vue&type=script&lang=ts": /*!********************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/default/component/panel/default-translate.vue?vue&type=script&lang=ts ***! \********************************************************************************************************************************************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "default", ({ enumerable: true, get: function() { return _default; } })); var _path = __webpack_require__(/*! path */ "path"); __webpack_require__(/*! reflect-metadata */ "./node_modules/reflect-metadata/Reflect.js"); var _vue = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.cjs.js"); var _mbuttonvue = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ../../../share/ui/m-button.vue */ "./src/panel/share/ui/m-button.vue")); var _minputvue = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ../../../share/ui/m-input.vue */ "./src/panel/share/ui/m-input.vue")); var _WrapperTranslateItem = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ../../../../lib/core/entity/translate/WrapperTranslateItem */ "./src/lib/core/entity/translate/WrapperTranslateItem.ts")); var _Iterator = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ../../../share/scripts/Iterator */ "./src/panel/share/scripts/Iterator.ts")); var _TranslateItemType = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ../../../../lib/core/entity/translate/TranslateItemType */ "./src/lib/core/entity/translate/TranslateItemType.ts")); var _global = __webpack_require__(/*! ../../../../lib/core/service/util/global */ "./src/lib/core/service/util/global.ts"); var _utils = __webpack_require__(/*! ../../../share/scripts/utils */ "./src/panel/share/scripts/utils.ts"); var _tsyringe = __webpack_require__(/*! tsyringe */ "./node_modules/tsyringe/dist/esm5/index.js"); var _WrapperMainIPC = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ../../../../lib/core/ipc/WrapperMainIPC */ "./src/lib/core/ipc/WrapperMainIPC.ts")); var _PanelTranslateData = __webpack_require__(/*! ../../../share/scripts/PanelTranslateData */ "./src/panel/share/scripts/PanelTranslateData.ts"); function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _async_to_generator(fn) { return function() { var self = this, args = arguments; return new Promise(function(resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } function _instanceof(left, right) { if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) { return !!right[Symbol.hasInstance](left); } else { return left instanceof right; } } function _interop_require_default(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _ts_generator(thisArg, body) { var f, y, t, g, _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }; 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(_)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 }; } } var pluralRules = _tsyringe.container.resolve('PluralRules'); var Tab = [ 'untranslated', 'translated', 'imported' ]; var wrapper = _tsyringe.container.resolve(_WrapperMainIPC.default); var _default = { components: { 'm-button': _mbuttonvue.default, 'm-input': _minputvue.default }, props: { /** 目标语言 */ targetLocale: { type: String, required: true } }, emits: [ 'home', 'initialized' ], setup: function setup(props, param) { var emit = param.emit; return _async_to_generator(function() { var isCN, hasTranslateProvider, isSameLanguage, currentTranslateDataItems, indexData, untranslatedTranslateDataItems, translatedTranslateDataItems, currentTab, changedTranslateItemMap, currentVariantsItem, localPanelTranslateData, saving, replaceVariant, conflictItemsBetweenImportedFilesAndTranslatedFiles, selectedConflictItemIndexSet, isConflictSelectAll, targetPanelTranslateData, _pluralRules_targetPanelTranslateData_value_bcp47Tag_split_, variantKeys, currentSelectedItem, isTargetTranslateDataHasEmptyMedia, blurTimeout, isLockItem, importedTranslateItemMap, panelProfileKey, importFileProfileKey, isShowImportAll, importAllFrom, importAllTo, translateItemHeight, translateVisibleItems, translateStartIndex, translatePaddingTop, translateScrollTop, translateTotalHeight, translateTable, conflictItemHeight, conflictContainerHeight, conflictVisibleItems, conflictStartIndex, conflictPaddingTop, conflictScrollTop, conflictTotalHeight, conflictTable; function updateLanguage() { isCN.value = Editor.I18n.getLanguage() === 'zh'; } function updateChangedTranslateItemMap(sourceItem, value, displayName, assetInfo, variants) { var associations = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : []; var _changedTranslateItemMap_value, _sourceItem_key; var _; var item = (_ = (_changedTranslateItemMap_value = changedTranslateItemMap.value)[_sourceItem_key = sourceItem.key]) !== null && _ !== void 0 ? _ : _changedTranslateItemMap_value[_sourceItem_key] = new _WrapperTranslateItem.default(sourceItem.key, value, sourceItem.type, displayName, assetInfo, associations, variants); item.value = value; if (typeof displayName === 'string') { item.displayName = displayName; } if (assetInfo) { item.assetInfo = assetInfo; } if (variants) { item._variants = variants; } if (associations) { item.associations = associations; } } function updateLocalPanelTranslateData() { return _updateLocalPanelTranslateData.apply(this, arguments); } function _updateLocalPanelTranslateData() { _updateLocalPanelTranslateData = _async_to_generator(function() { return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, _PanelTranslateData.PanelTranslateData.getPanelTranslateData() ]; case 1: localPanelTranslateData.value = _state.sent(); return [ 2 ]; } }); }); return _updateLocalPanelTranslateData.apply(this, arguments); } function isDirty() { return Object.keys(changedTranslateItemMap.value).length; } function onSaveClick() { return _onSaveClick.apply(this, arguments); } function _onSaveClick() { _onSaveClick = _async_to_generator(function() { return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, save() ]; case 1: _state.sent(); return [ 2 ]; } }); }); return _onSaveClick.apply(this, arguments); } function _doSave(items, options) { return __doSave.apply(this, arguments); } function __doSave() { __doSave = _async_to_generator(function(items, options) { var _options, _mergeOptions; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: options !== null && options !== void 0 ? options : options = {}; (_mergeOptions = (_options = options).mergeOptions) !== null && _mergeOptions !== void 0 ? _mergeOptions : _options.mergeOptions = { replaceVariant: replaceVariant }; if (![ 'untranslated', 'translated' ].includes(currentTab.value)) return [ 3, 2 ]; return [ 4, saveInTranslate(items, options) ]; case 1: _state.sent(); return [ 3, 6 ]; case 2: if (!isDirty()) return [ 3, 4 ]; return [ 4, saveInTranslate() ]; case 3: _state.sent(); _state.label = 4; case 4: return [ 4, saveInImportedFile(items, options) ]; case 5: _state.sent(); _state.label = 6; case 6: return [ 2 ]; } }); }); return __doSave.apply(this, arguments); } function save(items, options) { return _save.apply(this, arguments); } function _save() { _save = _async_to_generator(function(items, options) { return _ts_generator(this, function(_state) { return [ 2, new Promise(function(resolve, reject) { saving.value = true; setTimeout(/*#__PURE__*/ _async_to_generator(function() { return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, _doSave(items, options) ]; case 1: _state.sent(); saving.value = false; // 点击保存后需要立即刷新场景的显示效果 return [ 4, wrapper.previewBy(props.targetLocale) ]; case 2: _state.sent(); resolve(true); return [ 2 ]; } }); })); }) ]; }); }); return _save.apply(this, arguments); } function saveInTranslate(items, options) { return _saveInTranslate.apply(this, arguments); } function _saveInTranslate() { _saveInTranslate = /** 在翻译界面以及未翻译界面点击保存的回调 */ _async_to_generator(function(items, options) { var index, item; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: items !== null && items !== void 0 ? items : items = changedTranslateItemMap.value; console.debug('onSaveClick', items); if (items === changedTranslateItemMap.value) { changedTranslateItemMap.value = {}; } else { if (_instanceof(items, Array)) { for(index = 0; index < items.length; index++){ item = items[index]; delete changedTranslateItemMap.value[item.key]; } } } replaceVariant = false; return [ 4, wrapper.saveTranslateData(props.targetLocale, items, options === null || options === void 0 ? void 0 : options.mergeOptions) ]; case 1: _state.sent(); return [ 4, updateTargetTranslateData() ]; case 2: _state.sent(); return [ 2 ]; } }); }); return _saveInTranslate.apply(this, arguments); } function onConflictItemClick(value, index) { if (value) { selectedConflictItemIndexSet.value.add(index); } else { selectedConflictItemIndexSet.value.delete(index); } } function onConflictItemSelectAllClick(value) { isConflictSelectAll.value = value; } function _saveImportedFile(items, options) { wrapper.saveTranslateData(props.targetLocale, items, options === null || options === void 0 ? void 0 : options.mergeOptions).then(function(r) { updateTargetTranslateData(); updateLocalPanelTranslateData(); }); // 如果是在非本地语言导入则需要额外地往本地语言更新新的条目 if (!isSameLanguage.value) { var localTranslateItems = Object.values(localPanelTranslateData.value.items); var newTranslateItems = items.filter(function(item) { return !localTranslateItems.some(function(it) { return (it === null || it === void 0 ? void 0 : it.key) === item.key; }); }); if (newTranslateItems.length) { wrapper.saveTranslateData(localPanelTranslateData.value.bcp47Tag, newTranslateItems, options === null || options === void 0 ? void 0 : options.mergeOptions).then(function(r) { updateLocalPanelTranslateData(); }); } } for(var index = 0; index < items.length; index++){ var item = items[index]; delete importedTranslateItemMap.value[item.key]; } replaceVariant = false; } function saveInImportedFile(items, options) { return _saveInImportedFile.apply(this, arguments); } function _saveInImportedFile() { _saveInImportedFile = _async_to_generator(function(items, options) { var targetTranslateItems, noConflictItems; return _ts_generator(this, function(_state) { items !== null && items !== void 0 ? items : items = Object.values(importedTranslateItemMap.value); if (items) { targetTranslateItems = Object.values(targetPanelTranslateData.value.items); conflictItemsBetweenImportedFilesAndTranslatedFiles.value = items.filter(function(item) { return targetTranslateItems.some(function(it) { return (it === null || it === void 0 ? void 0 : it.key) === item.key; }); }); conflictScrollTop.value = 0; noConflictItems = items.filter(function(item) { return !targetTranslateItems.some(function(it) { return (it === null || it === void 0 ? void 0 : it.key) === item.key; }); }); // 未冲突部分的处理 if (noConflictItems.length) { _saveImportedFile(noConflictItems, options); } // 冲突部分的处理 if (options === null || options === void 0 ? void 0 : options.force) { _saveImportedFile(items, options); selectedConflictItemIndexSet.value.clear(); conflictItemsBetweenImportedFilesAndTranslatedFiles.value = []; } } return [ 2 ]; }); }); return _saveInImportedFile.apply(this, arguments); } function updateTargetTranslateData(translateResult) { return _updateTargetTranslateData.apply(this, arguments); } function _updateTargetTranslateData() { _updateTargetTranslateData = _async_to_generator(function(translateResult) { var index, item, oldItem; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: if (!translateResult) return [ 3, 1 ]; console.debug('translateResult', translateResult); for(index = 0; index < translateResult.length; index++){ item = translateResult[index]; oldItem = changedTranslateItemMap.value[item.key] || targetPanelTranslateData.value.items[item.key]; changedTranslateItemMap.value[item.key] = new _WrapperTranslateItem.default(item.key, item.value, item.type, item.displayName || _WrapperTranslateItem.default.getDisplayName({ item: item, assetInfo: (oldItem === null || oldItem === void 0 ? void 0 : oldItem.assetInfo) || item.assetInfo }), oldItem === null || oldItem === void 0 ? void 0 : oldItem.assetInfo, item.associations); } return [ 3, 3 ]; case 1: console.debug('update target translate data get translate data'); return [ 4, _PanelTranslateData.PanelTranslateData.getPanelTranslateData(props.targetLocale) ]; case 2: targetPanelTranslateData.value = _state.sent(); _state.label = 3; case 3: return [ 2 ]; } }); }); return _updateTargetTranslateData.apply(this, arguments); } function executeCallbackWithOutDirty(callBack) { return _executeCallbackWithOutDirty.apply(this, arguments); } function _executeCallbackWithOutDirty() { _executeCallbackWithOutDirty = /** 查询是否愿意清除 */ _async_to_generator(function(callBack) { var cancel, result; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: if (!isDirty()) return [ 3, 3 ]; cancel = 0; return [ 4, Editor.Dialog.info(Editor.I18n.t(_global.MainName + '.translate.unsaved_warning'), { buttons: [ Editor.I18n.t(_global.MainName + '.translate.cancel'), Editor.I18n.t(_global.MainName + '.translate.confirm') ], cancel: cancel, default: 1 }) ]; case 1: result = _state.sent(); if (result.response === cancel) { return [ 2, false ]; } return [ 4, save(undefined, { force: true }) ]; case 2: _state.sent(); _state.label = 3; case 3: return [ 4, callBack() ]; case 4: _state.sent(); return [ 2, true ]; } }); }); return _executeCallbackWithOutDirty.apply(this, arguments); } function onItemMouseDown(item, isLocalLanguage) { isLockItem.value = false; if (blurTimeout.value) { clearTimeout(blurTimeout.value); } if (isLocalLanguage) { currentSelectedItem.value = item; } else { if (currentTab.value === 'imported') { var _importedTranslateItemMap_value_item_key; currentSelectedItem.value = (_importedTranslateItemMap_value_item_key = importedTranslateItemMap.value[item.key]) !== null && _importedTranslateItemMap_value_item_key !== void 0 ? _importedTranslateItemMap_value_item_key : item; } else { var _targetPanelTranslateData_value; var _changedTranslateItemMap_value_item_key, _ref; currentSelectedItem.value = (_ref = (_changedTranslateItemMap_value_item_key = changedTranslateItemMap.value[item.key]) !== null && _changedTranslateItemMap_value_item_key !== void 0 ? _changedTranslateItemMap_value_item_key : (_targetPanelTranslateData_value = targetPanelTranslateData.value) === null || _targetPanelTranslateData_value === void 0 ? void 0 : _targetPanelTranslateData_value.items[item.key]) !== null && _ref !== void 0 ? _ref : item; } } } function onCancelItemBlur() { isLockItem.value = true; } function onItemBlur() { if (!isLockItem.value) { blurTimeout.value = setTimeout(function() { clearSelected(); }, 400); } } function clearSelected() { currentSelectedItem.value = null; } function getLastImportedFileProfile() { return _getLastImportedFileProfile.apply(this, arguments); } function _getLastImportedFileProfile() { _getLastImportedFileProfile = _async_to_generator(function() { return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, Editor.Profile.getTemp(_global.MainName, importFileProfileKey) ]; case 1: return [ 2, _state.sent() || '' ]; } }); }); return _getLastImportedFileProfile.apply(this, arguments); } function setLastImportedFileProfile(file) { Editor.Profile.setTemp(_global.MainName, importFileProfileKey, file); } function onTabClick(index) { if (currentTab.value !== Tab[index]) { switch(index){ case 0: case 1: case 2: currentTab.value = Tab[index]; translateScrollTop.value = 0; break; default: currentTab.value = Tab[0]; break; } } } function onPositionInfoClick(uuid) { return _onPositionInfoClick.apply(this, arguments); } function _onPositionInfoClick() { _onPositionInfoClick = _async_to_generator(function(uuid) { return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, Editor.Panel.focus('assets') ]; case 1: _state.sent(); Editor.Message.send('assets', 'twinkle', uuid, 'shake'); return [ 2 ]; } }); }); return _onPositionInfoClick.apply(this, arguments); } /** 翻译表格滚动得回调 */ function onTranslateScroll(event) { translateScrollTop.value = event.target.scrollTop; } /** 冲突表格滚动得回调 */ function onConflictScroll(event) { conflictScrollTop.value = event.target.scrollTop; } return _ts_generator(this, function(_state) { switch(_state.label){ case 0: isCN = (0, _vue.ref)(Editor.I18n.getLanguage() === 'zh'); (0, _vue.onMounted)(function() { var addBroadcastListener = Editor.Message.__protected__ ? Editor.Message.__protected__.addBroadcastListener : Editor.Message.addBroadcastListener; addBroadcastListener('i18n:change', updateLanguage); }); (0, _vue.onUnmounted)(function() { var removeBroadcastListener = Editor.Message.__protected__ ? Editor.Message.__protected__.removeBroadcastListener : Editor.Message.removeBroadcastListener; removeBroadcastListener('i18n:change', updateLanguage); }); return [ 4, wrapper.getCurrentTranslateProvider() ]; case 1: hasTranslateProvider = !!_state.sent(); isSameLanguage = (0, _vue.computed)(function() { var _localPanelTranslateData_value; var result = ((_localPanelTranslateData_value = localPanelTranslateData.value) === null || _localPanelTranslateData_value === void 0 ? void 0 : _localPanelTranslateData_value.locale) === props.targetLocale; return result; }); currentTranslateDataItems = (0, _vue.computed)(function() { if (currentTab.value === 'untranslated') { return untranslatedTranslateDataItems.value; } if (currentTab.value === 'translated') { return translatedTranslateDataItems.value; } if (currentTab.value === 'imported') { return Object.values(importedTranslateItemMap.value); } return []; }); return [ 4, wrapper.getIndexData() ]; case 2: indexData = _state.sent(); /** 未翻译的数据 */ untranslatedTranslateDataItems = (0, _vue.computed)(function() { var _targetPanelTranslateData_value, _localPanelTranslateData_value; var _targetPanelTranslateData_value_items; var targetDataItems = (_targetPanelTranslateData_value_items = (_targetPanelTranslateData_value = targetPanelTranslateData.value) === null || _targetPanelTranslateData_value === void 0 ? void 0 : _targetPanelTranslateData_value.items) !== null && _targetPanelTranslateData_value_items !== void 0 ? _targetPanelTranslateData_value_items : {}; var _localPanelTranslateData_value_items; var localDataItems = (_localPanelTranslateData_value_items = (_localPanelTranslateData_value = localPanelTranslateData.value) === null || _localPanelTranslateData_value === void 0 ? void 0 : _localPanelTranslateData_value.items) !== null && _localPanelTranslateData_value_items !== void 0 ? _localPanelTranslateData_value_items : {}; var targetDataItemsKeys = Object.keys(targetDataItems); if (isSameLanguage.value) { return Object.values(targetDataItems).filter(function(item) { return item && !item.value; }); } return Object.keys(localDataItems).filter(function(key) { var _localDataItems_key; return !targetDataItemsKeys.includes(key) && ((_localDataItems_key = localDataItems[key]) === null || _localDataItems_key === void 0 ? void 0 : _localDataItems_key.value); }).map(function(key) { return localDataItems[key]; }); }); /** 已翻译的数据 */ translatedTranslateDataItems = (0, _vue.computed)(function() { var _targetPanelTranslateData_value, _localPanelTranslateData_value; var _targetPanelTranslateData_value_items; var targetDataItems = (_targetPanelTranslateData_value_items = (_targetPanelTranslateData_value = targetPanelTranslateData.value) === null || _targetPanelTranslateData_value === void 0 ? void 0 : _targetPanelTranslateData_value.items) !== null && _targetPanelTranslateData_value_items !== void 0 ? _targetPanelTranslateData_value_items : {}; var _localPanelTranslateData_value_items; var localDataItems = (_localPanelTranslateData_value_items = (_localPanelTranslateData_value = localPanelTranslateData.value) === null || _localPanelTranslateData_value === void 0 ? void 0 : _localPanelTranslateData_value.items) !== null && _localPanelTranslateData_value_items !== void 0 ? _localPanelTranslateData_value_items : {}; var targetDataItemsKeys = Object.keys(targetDataItems).reverse(); if (isSameLanguage.value) { return Object.values(targetDataItems).filter(function(item) { return item === null || item === void 0 ? void 0 : item.value; }); } return targetDataItemsKeys.filter(function(key) { var _localDataItems_key; return (_localDataItems_key = localDataItems[key]) === null || _localDataItems_key === void 0 ? void 0 : _localDataItems_key.value; }).map(function(key) { return localDataItems[key]; }); }); // 要记录修改的内容,仅仅发送修改的内容给主进程 currentTab = (0, _vue.ref)('untranslated'); changedTranslateItemMap = (0, _vue.ref)({}); currentVariantsItem = (0, _vue.ref)(null); return [ 4, _PanelTranslateData.PanelTranslateData.getPanelTranslateData() ]; case 3: localPanelTranslateData = _vue.ref.apply(void 0, [ _state.sent() ]); saving = (0, _vue.ref)(false); /** 通过这个变量控制是否为变体 */ replaceVariant = false; /** * 导入的文件与翻译数据的冲突,这个数组一旦有内容,则会显示弹窗页面 */ conflictItemsBetweenImportedFilesAndTranslatedFiles = (0, _vue.ref)([]); selectedConflictItemIndexSet = (0, _vue.ref)(new Set()); isConflictSelectAll = (0, _vue.computed)({ get: function get() { var length = conflictItemsBetweenImportedFilesAndTranslatedFiles.value.length; var set = selectedConflictItemIndexSet.value; return set.size === length; }, set: function set(value) { if (value) { for(var index = 0; index < conflictItemsBetweenImportedFilesAndTranslatedFiles.value.length; index++){ selectedConflictItemIndexSet.value.add(index); } } else { selectedConflictItemIndexSet.value.clear(); } } }); return [ 4, _PanelTranslateData.PanelTranslateData.getPanelTranslateData(props.targetLocale) ]; case 4: targetPanelTranslateData = _vue.ref.apply(void 0, [ _state.sent() ]); variantKeys = (0, _vue.ref)((_pluralRules_targetPanelTranslateData_value_bcp47Tag_split_ = pluralRules[targetPanelTranslateData.value.bcp47Tag.split('-')[0]]) !== null && _pluralRules_targetPanelTranslateData_value_bcp47Tag_split_ !== void 0 ? _pluralRules_targetPanelTranslateData_value_bcp47Tag_split_ : [ 'other' ]); currentSelectedItem = (0, _vue.ref)(null); isTargetTranslateDataHasEmptyMedia = (0, _vue.computed)(function() { var items = Object.values(localPanelTranslateData.value.items).filter(function(item) { return item && item.type === _TranslateItemType.default.Media; }); if (items.length === 0) { return false; } var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined; try { for(var _iterator = items[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){ var item = _step.value; var _changedTranslateItemMap_value_item_key; var tempItem = (_changedTranslateItemMap_value_item_key = changedTranslateItemMap.value[item.key]) !== null && _changedTranslateItemMap_value_item_key !== void 0 ? _changedTranslateItemMap_value_item_key : targetPanelTranslateData.value.items[item.key]; if (!(tempItem === null || tempItem === void 0 ? void 0 : tempItem.value)) { return true; } } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally{ try { if (!_iteratorNormalCompletion && _iterator.return != null) { _iterator.return(); } } finally{ if (_didIteratorError) { throw _iteratorError; } } } return false; }); blurTimeout = (0, _vue.ref)(null); // eslint-disable-line no-undef isLockItem = (0, _vue.ref)(false); importedTranslateItemMap = (0, _vue.ref)({}); panelProfileKey = 'default-translate'; importFileProfileKey = "".concat(panelProfileKey, ".importFile"); isShowImportAll = (0, _vue.ref)(false); /** 智能导入时替换的源关键字 */ importAllFrom = (0, _vue.ref)(localPanelTranslateData.value.locale); /** 智能导入时替换的结果 */ importAllTo = (0, _vue.ref)(props.targetLocale); // 本来此处应该可以使用 m-container 组件优化列表的,但是由于滚动条样式有特殊的产品需求,得自己实现优化列表 /** 翻译条目的高度 */ translateItemHeight = 24; /** 视野内翻译条目 */ translateVisibleItems = (0, _vue.computed)(function() { var _translateTable_value; var _translateTable_value_clientHeight; var containerHeight = (_translateTable_value_clientHeight = (_translateTable_value = translateTable.value) === null || _translateTable_value === void 0 ? void 0 : _translateTable_value.clientHeight) !== null && _translateTable_value_clientHeight !== void 0 ? _translateTable_value_clientHeight : 0; var endIndex = Math.min(translateStartIndex.value + Math.ceil(containerHeight / translateItemHeight), currentTranslateDataItems.value.length); return currentTranslateDataItems.value.slice(translateStartIndex.value, endIndex); }); /** 翻译表格中起始项 */ translateStartIndex = (0, _vue.computed)(function() { return Math.floor(translateScrollTop.value / translateItemHeight); }); /** 翻译表格中顶部的 Padding */ translatePaddingTop = (0, _vue.computed)(function() { return translateStartIndex.value * translateItemHeight; }); /** 翻译表格中滚动值,每次重新展示列表都要置零,否则会有显示错误 */ translateScrollTop = (0, _vue.ref)(0); /** 翻译表格中总高度 */ translateTotalHeight = (0, _vue.computed)(function() { return currentTranslateDataItems.value.length * translateItemHeight - translatePaddingTop.value; }); /** 翻译表格 */ translateTable = (0, _vue.ref)(null); // 这里唯二的大量数据的表格,处理翻译于导入文件冲突的情况 /** 冲突条目的高度 */ conflictItemHeight = 34; /** 冲突表格的高度 */ conflictContainerHeight = (0, _vue.ref)(460); /** 视野内冲突条目 */ conflictVisibleItems = (0, _vue.computed)(function() { var containerHeight = conflictContainerHeight.value; var endIndex = Math.min(conflictStartIndex.value + Math.ceil(containerHeight / conflictItemHeight), conflictItemsBetweenImportedFilesAndTranslatedFiles.value.length); return conflictItemsBetweenImportedFilesAndTranslatedFiles.value.slice(conflictStartIndex.value, endIndex); }); /** 冲突表格中起始项 */ conflictStartIndex = (0, _vue.computed)(function() { return Math.floor(conflictScrollTop.value / conflictItemHeight); }); /** 冲突表格中顶部的 Padding */ conflictPaddingTop = (0, _vue.computed)(function() { return conflictStartIndex.value * conflictItemHeight; }); /** 冲突表格中滚动值,每次展示冲突列表都要置零,否则会有显示错误 */ conflictScrollTop = (0, _vue.ref)(0); /** 冲突表格中所有条目总高度 */ conflictTotalHeight = (0, _vue.computed)(function() { return Math.max(conflictItemsBetweenImportedFilesAndTranslatedFiles.value.length * conflictItemHeight - conflictPaddingTop.value, conflictContainerHeight.value); }); conflictTable = (0, _vue.ref)(null); emit('initialized'); /** 冲突表格 */ return [ 2, { conflictContainerHeight: conflictContainerHeight, conflictTable: conflictTable, conflictPaddingTop: conflictPaddingTop, conflictVisibleItems: conflictVisibleItems, onConflictScroll: onConflictScroll, conflictScrollTop: conflictScrollTop, conflictTotalHeight: conflictTotalHeight, translateTable: translateTable, translatePaddingTop: translatePaddingTop, translateVisibleItems: translateVisibleItems, onTranslateScroll: onTranslateScroll, translateScrollTop: translateScrollTop, translateTotalHeight: translateTotalHeight, isCN: isCN, importAllFrom: importAllFrom, importAllTo: importAllTo, isShowImportAll: isShowImportAll, clearSelected: clearSelected, isLockItem: isLockItem, onPositionInfoClick: onPositionInfoClick, onCancelItemBlur: onCancelItemBlur, isConflictSelectAll: isConflictSelectAll, onConflictItemClick: onConflictItemClick, onConflictItemSelectAllClick: onConflictItemSelectAllClick, selectedConflictItemIndexSet: selectedConflictItemIndexSet, conflictItemsBetweenImportedFilesAndTranslatedFiles: conflictItemsBetweenImportedFilesAndTranslatedFiles, importedTranslateItemMap: importedTranslateItemMap, MainName: _global.MainName, hasTranslateProvider: hasTranslateProvider, onItemBlur: onItemBlur, onItemMouseDown: onItemMouseDown, isTargetTranslateDataHasEmptyMedia: isTargetTranslateDataHasEmptyMedia, currentTranslateDataItems: currentTranslateDataItems, currentSelectedItem: currentSelectedItem, isSameLanguage: isSameLanguage, untranslatedTranslateDataItems: untranslatedTranslateDataItems, translatedTranslateDataItems: translatedTranslateDataItems, /** * 获取表格右侧的译文的显示名称 */ getDisplayNameOfTargetItem: function getDisplayNameOfTargetItem(key) { var localItem; if (currentTab.value === 'imported') { localItem = importedTranslateItemMap.value[key]; } else { var _targetPanelTranslateData_value; var changedItem = changedTranslateItemMap.value[key]; var targetItem = (_targetPanelTranslateData_value = targetPanelTranslateData.value) === null || _targetPanelTranslateData_value === void 0 ? void 0 : _targetPanelTranslateData_value.items[key]; localItem = changedItem !== null && changedItem !== void 0 ? changedItem : targetItem; } if (!localItem) { return ''; } if (localItem.type === _TranslateItemType.default.Media) { var _localItem_displayName; return (_localItem_displayName = localItem === null || localItem === void 0 ? void 0 : localItem.displayName) !== null && _localItem_displayName !== void 0 ? _localItem_displayName : key; } var _localItem_value; return (_localItem_value = localItem === null || localItem === void 0 ? void 0 : localItem.value) !== null && _localItem_value !== void 0 ? _localItem_value : ''; }, /** 获取表格左侧的显示名称 */ getDisplayNameOfLocalItem: function getDisplayNameOfLocalItem(key) { var item; if (currentTab.value === 'imported') { var _localPanelTranslateData_value; var _localPanelTranslateData_value_items_key; item = (_localPanelTranslateData_value_items_key = (_localPanelTranslateData_value = localPanelTranslateData.value) === null || _localPanelTranslateData_value === void 0 ? void 0 : _localPanelTranslateData_value.items[key]) !== null && _localPanelTranslateData_value_items_key !== void 0 ? _localPanelTranslateData_value_items_key : importedTranslateItemMap.value[key]; return item.value; } else { var _localPanelTranslateData_value1; item = (_localPanelTranslateData_value1 = localPanelTranslateData.value) === null || _localPanelTranslateData_value1 === void 0 ? void 0 : _localPanelTranslateData_value1.items[key]; } if ((item === null || item === void 0 ? void 0 : item.type) === _TranslateItemType.default.Media) { return item.displayName || key; } if (isSameLanguage.value) { return key; } else { return (item === null || item === void 0 ? void 0 : item.displayName) || ''; } }, positionInfoOfAssociation: (0, _vue.computed)(function() { if (!currentSelectedItem.value) { return []; } var indexDataElement = indexData.find(function(item) { return item.key === currentSelectedItem.value.key; }); if (!indexDataElement) { return []; } var items = indexDataElement.associations.filter(function(it) { return it.assetInfo; }).map(function(it) { return { path: (0, _path.relative)(Editor.Project.path, it.assetInfo.file), uuid: it.assetInfo.uuid }; }); return Array.from(new Set(items)).map(function(it) { return new _Iterator.default(it); }); }), nodeUuidOfAssociation: (0, _vue.computed)(function() { if (!currentSelectedItem.value) { return []; } var indexDataElement = indexData.find(function(item) { return item.key === currentSelectedItem.value.key; }); if (!indexDataElement) { return []; } return Array.from(new Set(indexDataElement.associations.filter(function(it) { return it.nodeUuid; }).map(function(it) { return it.nodeUuid; }))).map(function(it) { return new _Iterator.default(it); }); }), saving: saving, onSaveClick: onSaveClick, targetPanelTranslateData: targetPanelTranslateData, localPanelTranslateData: localPanelTranslateData, currentVariantsItem: currentVariantsItem, /** 有修改行为的资源 */ changedTranslateItemMap: changedTranslateItemMap, TranslateItemType: (0, _vue.ref)(_TranslateItemType.default), onTabClick: onTabClick, /** 导入的 po 文件里的数据集 */ importedTranslateData: (0, _vue.ref)([]), /** 当前选择的标签 */ currentTab: currentTab, Tab: (0, _vue.ref)(Tab), onInputChanged: /** 输入框被写入了内容 */ function onInputChanged(key, value) { return _async_to_generator(function() { var item, item1, _targetPanelTranslateData_value, _localPanelTranslateData_value, _changedTranslateItemMap_value_key, _ref, _localPanelTranslateData_value1, originItem, info; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: if (currentTab.value === 'imported') { item1 = importedTranslateItemMap.value[key]; item1.value = value; return [ 2 ]; } else { ; ; item = (_ref = (_changedTranslateItemMap_value_key = changedTranslateItemMap.value[key]) !== null && _changedTranslateItemMap_value_key !== void 0 ? _changedTranslateItemMap_value_key : (_targetPanelTranslateData_value = targetPanelTranslateData.value) === null || _targetPanelTranslateData_value === void 0 ? void 0 : _targetPanelTranslateData_value.items[key]) !== null && _ref !== void 0 ? _ref : (_localPanelTranslateData_value = localPanelTranslateData.value) === null || _localPanelTranslateData_value === void 0 ? void 0 : _localPanelTranslateData_value.items[key]; } if (!item) { console.error("cannot find item with key ".concat(key)); return [ 2 ]; } if (!(item.type === _TranslateItemType.default.Media)) return [ 3, 4 ]; if (!(value === '')) return [ 3, 1 ]; updateChangedTranslateItemMap(item, '', '', undefined, item._variants, item.associations); return [ 3, 3 ]; case 1: originItem = (_localPanelTranslateData_value1 = localPanelTranslateData.value) === null || _localPanelTranslateData_value1 === void 0 ? void 0 : _localPanelTranslateData_value1.items[key]; if (!originItem) { console.error("cannot find item with key ".concat(key, " from local")); return [ 2 ]; } return [ 4, wrapper.getFileInfoByUUIDOrPath((0, _path.join)(_global.ProjectAssetPath, value)) ]; case 2: info = _state.sent(); if (info && (0, _path.extname)(originItem.displayName || '') === (0, _path.extname)(value)) { updateChangedTranslateItemMap(item, info.uuid, _WrapperTranslateItem.default.getDisplayName({ item: item, assetInfo: info }), info, item._variants, item.associations); } _state.label = 3; case 3: return [ 3, 5 ]; case 4: updateChangedTranslateItemMap(item, value, _WrapperTranslateItem.default.getDisplayName({ item: item, value: value }), null, item._variants, item.associations); _state.label = 5; case 5: return [ 2 ]; } }); })(); }, onTranslateClick: /** 点击翻译按钮 */ function onTranslateClick() { return _async_to_generator(function() { return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, executeCallbackWithOutDirty(/*#__PURE__*/ _async_to_generator(function() { return _ts_generator(this, function(_state) { saving.value = true; setTimeout(/*#__PURE__*/ _async_to_generator(function() { return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, wrapper.autoTranslate(targetPanelTranslateData.value.locale) ]; case 1: return [ 4, updateTargetTranslateData.apply(void 0, [ _state.sent() ]) ]; case 2: _state.sent(); saving.value = false; return [ 2 ]; } }); })); return [ 2 ]; }); })) ]; case 1: _state.sent(); return [ 2 ]; } }); })(); }, variantKeys: variantKeys, /** 打开变体 */ onVariantsClick: function onVariantsClick(key) { var _loop = function(index) { var variantkey = variantKeys.value[index]; var itemKey = "".concat(key, "_").concat(variantkey); var oldItem = targetItem === null || targetItem === void 0 ? void 0 : targetItem._variants.find(function(item) { return item.key === itemKey; }); if (!oldItem) { currentVariantsItem.value._variants.push(new _WrapperTranslateItem.default(itemKey, '', currentVariantsItem.value.type, '', null, undefined, undefined, true)); } }; var _targetPanelTranslateData_value; var targetItem = (_targetPanelTranslateData_value = targetPanelTranslateData.value) === null || _targetPanelTranslateData_value === void 0 ? void 0 : _targetPanelTranslateData_value['items'][key]; var changedItem = changedTranslateItemMap.value[key]; var importedItem = importedTranslateItemMap.value[key]; if (currentTab.value === 'imported' && importedItem) { currentVariantsItem.value = _WrapperTranslateItem.default.parse(importedItem); } else if (changedItem) { currentVariantsItem.value = _WrapperTranslateItem.default.parse(changedItem); } else if (targetItem) { currentVariantsItem.value = _WrapperTranslateItem.default.parse(targetItem); } else { console.error('An item that does not have a value should not be able to set variations', "key:".concat(key)); return; } for(var index = 0; index < variantKeys.value.length; index++)_loop(index); function getIndexFromVariants(key) { var arr = key.split('_'); if (arr.length) { var ext = arr[arr.length - 1]; return variantKeys.value.findIndex(function(item) { return item === ext; }); } else { return -1; } } currentVariantsItem.value._variants = currentVariantsItem.value._variants.sort(function(a, b) { return getIndexFromVariants(a.key) - getIndexFromVariants(b.key); }); }, /** 保存变体 */ onVariantsConfirm: function onVariantsConfirm() { if (!currentVariantsItem.value) { console.error("save variants error: currentVariantsItem.value is ".concat(currentVariantsItem.value)); return; } currentVariantsItem.value._variants = currentVariantsItem.value._variants.filter(function(item) { return item.value; }); replaceVariant = true; save([ currentVariantsItem.value ], { mergeOptions: { replaceVariant: true } }); currentVariantsItem.value = null; }, /** 取消设置变体 */ onVariantsCancel: function onVariantsCancel() { if (!currentVariantsItem.value) { console.error("save variants error: currentVariantsItem.value is ".concat(currentVariantsItem.value)); return; } currentVariantsItem.value = null; }, onVariantsDelete: /** 删除当前变体 */ function onVariantsDelete() { return _async_to_generator(function() { var result; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: if (!currentVariantsItem.value) { console.error("save variants error: currentVariantsItem.value is ".concat(currentVariantsItem.value)); return [ 2 ]; } return [ 4, Editor.Dialog.info(Editor.I18n.t(_global.MainName + '.translate.delete_warning'), { buttons: [ Editor.I18n.t(_global.MainName + '.translate.cancel'), Editor.I18n.t(_global.MainName + '.translate.confirm') ], cancel: 0, default: 1 }) ]; case 1: result = _state.sent(); if (!(result.response === 1)) return [ 3, 3 ]; currentVariantsItem.value._variants = []; replaceVariant = true; return [ 4, save([ currentVariantsItem.value ]) ]; case 2: _state.sent(); _state.label = 3; case 3: currentVariantsItem.value = null; return [ 2 ]; } }); })(); }, /** 条目是否禁用变体 */ isVariantsDisable: function isVariantsDisable(key) { if (currentTab.value === 'imported') { return false; } else { var _targetPanelTranslateData_value; var changedItem = changedTranslateItemMap.value[key]; var targetItem = (_targetPanelTranslateData_value = targetPanelTranslateData.value) === null || _targetPanelTranslateData_value === void 0 ? void 0 : _targetPanelTranslateData_value['items'][key]; return (changedItem === null || changedItem === void 0 ? void 0 : changedItem.value) === '' || !changedItem && !(targetItem === null || targetItem === void 0 ? void 0 : targetItem.value); } }, /** 是否可以点击删除变体 */ isDeleteVariantsDisable: (0, _vue.computed)(function() { var _currentVariantsItem_value; if ((_currentVariantsItem_value = currentVariantsItem.value) === null || _currentVariantsItem_value === void 0 ? void 0 : _currentVariantsItem_value._variants.some(function(item) { return item.value; })) { return false; } return true; }), onImportAllClick: /** * 点击导入全部的按钮 */ function onImportAllClick() { return _async_to_generator(function() { return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, executeCallbackWithOutDirty(/*#__PURE__*/ _async_to_generator(function() { return _ts_generator(this, function(_state) { isShowImportAll.value = true; return [ 2 ]; }); })) ]; case 1: _state.sent(); return [ 2 ]; } }); })(); }, onImportAllConfirm: function onImportAllConfirm() { return _async_to_generator(function() { var mediaLength, title, result, items; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: mediaLength = untranslatedTranslateDataItems.value.filter(function(item) { return (item === null || item === void 0 ? void 0 : item.type) === _TranslateItemType.default.Media; }).length; title = Editor.I18n.t(_global.MainName + '.translate.auto_import_warning').replace('{length}', mediaLength.toString()).replace('{localLocale}', importAllFrom.value).replace('{targetLocale}', importAllTo.value); return [ 4, Editor.Dialog.info(title, { buttons: [ Editor.I18n.t(_global.MainName + '.translate.cancel'), Editor.I18n.t(_global.MainName + '.translate.confirm') ], cancel: 0, default: 1 }) ]; case 1: result = _state.sent(); if (!result.response) return [ 3, 3 ]; return [ 4, wrapper.importFilesFromDirectory(props.targetLocale, importAllFrom.value, importAllTo.value) ]; case 2: items = _state.sent(); updateTargetTranslateData(items); _state.label = 3; case 3: isShowImportAll.value = false; return [ 2 ]; } }); })(); }, onImportAllCancel: function onImportAllCancel() { return _async_to_generator(function() { return _ts_generator(this, function(_state) { isShowImportAll.value = false; return [ 2 ]; }); })(); }, onFileInputClick: /** * 点击导入某个外部文件 */ function onFileInputClick() { return _async_to_generator(function() { return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, executeCallbackWithOutDirty(/*#__PURE__*/ _async_to_generator(function() { var result, _, _1, _tmp, filePath, translateFileType, locale, importResult, conflictItems, cancel, dialogResult, response, index, result1; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: onTabClick(2); _1 = (_ = Editor.Dialog).select; _tmp = { extensions: 'po,csv,xlsx', multi: false }; return [ 4, getLastImportedFileProfile() ]; case 1: return [ 4, _1.apply(_, [ (_tmp.path = _state.sent(), _tmp) ]) ]; case 2: result = _state.sent(); if (!!result.canceled) return [ 3, 6 ]; filePath = result.filePaths[0]; setLastImportedFileProfile(filePath); translateFileType = (0, _utils.getTranslateFileType)(filePath); locale = targetPanelTranslateData.value.bcp47Tag; return [ 4, wrapper.importTranslateFile(filePath, translateFileType, locale) ]; case 3: importResult = _state.sent(); /** * 新导入的文件中冲突的内容 */ conflictItems = importResult.filter(function(item) { return importedTranslateItemMap.value[item.key]; }); if (!conflictItems.length) return [ 3, 5 ]; cancel = 2; return [ 4, Editor.Dialog.warn(Editor.I18n.t(_global.MainName + '.translate.import_file_conflicts_with_file_warning').replace('{num}', conflictItems.length.toString()), { buttons: [ Editor.I18n.t(_global.MainName + '.translate.jump'), Editor.I18n.t(_global.MainName + '.translate.cover'), Editor.I18n.t(_global.MainName + '.translate.cancel') ], cancel: cancel }) ]; case 4: dialogResult = _state.sent(); response = dialogResult.response; if (response === 0) { importResult = importResult.filter(function(item) { return !conflictItems.includes(item); }); } else if (response === 1) {} else if (response === 2) { return [ 2 ]; } _state.label = 5; case 5: for(index = 0; index < importResult.length; index++){ result1 = importResult[index]; importedTranslateItemMap.value[result1.key] = result1; } _state.label = 6; case 6: return [ 2 ]; } }); })) ]; case 1: _state.sent(); return [ 2 ]; } }); })(); }, onImportClick: /** * 点击单个导入,导入某个文件 */ function onImportClick(key) { return _async_to_generator(function() { var _targetPanelTranslateData_value, _localPanelTranslateData_value_items_key, _ref, item, extName, result, assetInfo, value, displayName; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: item = (_ref = (_localPanelTranslateData_value_items_key = localPanelTranslateData.value.items[key]) !== null && _localPanelTranslateData_value_items_key !== void 0 ? _localPanelTranslateData_value_items_key : changedTranslateItemMap.value[key]) !== null && _ref !== void 0 ? _ref : (_targetPanelTranslateData_value = targetPanelTranslateData.value) === null || _targetPanelTranslateData_value === void 0 ? void 0 : _targetPanelTranslateData_value.items[key]; if (!(item === null || item === void 0 ? void 0 : item.assetInfo)) { console.error("[".concat(_global.MainName, "]: item has not assetInfo"), item); return [ 2 ]; } if (item.assetInfo.type === 'cc.ImageAsset') { // copy from cc.ImageAsset['extnames'] extName = 'png,jpg,jpeg,bmp,webp,pvr,pkm,astc'; } else { extName = (0, _path.extname)(item.assetInfo.file).replace('.', ''); } return [ 4, Editor.Dialog.select({ multi: false, path: _global.ProjectAssetPath, type: 'file', extensions: extName }) ]; case 1: result = _state.sent(); if (!!result.canceled) return [ 3, 3 ]; return [ 4, wrapper.getFileInfoByUUIDOrPath(result.filePaths[0]) ]; case 2: assetInfo = _state.sent(); if (assetInfo) { value = assetInfo.uuid; displayName = _WrapperTranslateItem.default.getDisplayName({ assetInfo: assetInfo }); updateChangedTranslateItemMap(item, value, displayName, assetInfo, item._variants, item.associations); } else { console.error('A non-project resource was selected,please select another resource.'); } _state.label = 3; case 3: return [ 2 ]; } }); })(); }, /** 点击文件与原文冲突的取消按钮 */ onConflictCancelClick: function onConflictCancelClick() { conflictItemsBetweenImportedFilesAndTranslatedFiles.value = []; selectedConflictItemIndexSet.value.clear(); replaceVariant = false; }, onConflictConfirmClick: /** 点击文件与原文冲突的覆盖按钮 */ function onConflictConfirmClick() { return _async_to_generator(function() { var items; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: items = Array.from(selectedConflictItemIndexSet.value).map(function(item) { return conflictItemsBetweenImportedFilesAndTranslatedFiles.value[item]; }); return [ 4, save(items, { force: true }) ]; case 1: _state.sent(); return [ 2 ]; } }); })(); }, onHomeClick: function onHomeClick() { return _async_to_generator(function() { var result; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: if (!(Object.keys(changedTranslateItemMap.value).length > 0)) return [ 3, 2 ]; return [ 4, Editor.Dialog.warn(Editor.I18n.t(_global.MainName + '.translate.quit_warning'), { buttons: [ Editor.I18n.t(_global.MainName + '.translate.cancel'), Editor.I18n.t(_global.MainName + '.translate.confirm') ], cancel: 0, default: 0 }) ]; case 1: result = _state.sent(); if (result.response === 1) { emit('home'); } return [ 3, 3 ]; case 2: emit('home'); _state.label = 3; case 3: return [ 2 ]; } }); })(); } } ]; } }); })(); } }; /***/ }), /***/ "./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/share/ui/m-button.vue?vue&type=script&lang=ts": /*!********************************************************************************************************************************************************************************!*\ !*** ./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/share/ui/m-button.vue?vue&type=script&lang=ts ***! \********************************************************************************************************************************************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "default", ({ enumerable: true, get: function() { return _default; } })); var _default = { props: { transparent: { type: Boolean, required: false, default: true }, hasBorder: { type: Boolean, required: false, default: false }, color: { type: String, required: false, default: 'white' }, disabled: { type: Boolean, required: false, default: false } } }; /***/ }), /***/ "./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/share/ui/m-file.vue?vue&type=script&lang=ts": /*!******************************************************************************************************************************************************************************!*\ !*** ./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/share/ui/m-file.vue?vue&type=script&lang=ts ***! \******************************************************************************************************************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "default", ({ enumerable: true, get: function() { return _default; } })); var _path = __webpack_require__(/*! path */ "path"); var _vue = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.cjs.js"); var _minputvue = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ./m-input.vue */ "./src/panel/share/ui/m-input.vue")); var _fsextra = __webpack_require__(/*! fs-extra */ "./node_modules/fs-extra/lib/index.js"); var _global = __webpack_require__(/*! ../../../lib/core/service/util/global */ "./src/lib/core/service/util/global.ts"); function _interop_require_default(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var _default = { components: { 'm-input': _minputvue.default }, props: { modelValue: String, checkFileExist: Boolean, checkEmpty: Boolean, placeholder: String }, emits: [ 'blur', 'update:modelValue' ], setup: function(props, param) { var emit = param.emit; var onModelUpdate = function onModelUpdate(value) { emit('update:modelValue', value); }; var onBlur = function onBlur(event) { if (props.checkFileExist) { var _props_modelValue; isFileExist.value = (0, _fsextra.existsSync)((0, _path.join)(_global.ProjectAssetPath, (_props_modelValue = props.modelValue) !== null && _props_modelValue !== void 0 ? _props_modelValue : '')); } }; var _props_modelValue; var isFileExist = (0, _vue.ref)(!props.checkFileExist || (0, _fsextra.existsSync)((0, _path.join)(_global.ProjectAssetPath, (_props_modelValue = props.modelValue) !== null && _props_modelValue !== void 0 ? _props_modelValue : ''))); return { isFileExist: isFileExist, onModelUpdate: onModelUpdate, onBlur: onBlur }; }, computed: { showIcon: function showIcon() { return this.checkEmpty && this.modelValue === '' || this.checkFileExist && !this.isFileExist; }, tooltip: function tooltip() { if (this.modelValue === '' && this.checkEmpty) { return 'i18n:' + _global.MainName + '.cannot_empty'; } else { return 'i18n:' + _global.MainName + '.file_no_exist'; } } } }; /***/ }), /***/ "./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/share/ui/m-input.vue?vue&type=script&lang=ts": /*!*******************************************************************************************************************************************************************************!*\ !*** ./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/share/ui/m-input.vue?vue&type=script&lang=ts ***! \*******************************************************************************************************************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "default", ({ enumerable: true, get: function() { return _default; } })); var _vue = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.cjs.js"); var _default = { props: { modelValue: String, readonly: Boolean, type: String, isTextarea: Boolean, placeholder: String, error: Boolean, placeHolder: String, disabled: Boolean }, emits: [ 'blur', 'update:modelValue' ], setup: function(props, param) { var emit = param.emit; var onClick = function onClick(event) { if (!isSelected.value) { isSelected.value = true; } else { isEditing.value = true; focus(); } }; var onInput = function onInput(event) { if (props.isTextarea && textareaElement.value) { textareaElement.value.style.height = '16px'; textareaElement.value.style.height = textareaElement.value.scrollHeight + 'px'; } emit('update:modelValue', event.target.value); }; var onFocus = function onFocus() { if (blurTimeout) { clearTimeout(blurTimeout); } }; var focus = function focus() { if (props.isTextarea) { var _textareaElement_value; (_textareaElement_value = textareaElement.value) === null || _textareaElement_value === void 0 ? void 0 : _textareaElement_value.focus(); } else { var _inputElement_value; (_inputElement_value = inputElement.value) === null || _inputElement_value === void 0 ? void 0 : _inputElement_value.focus(); } }; var updatePlaceHolder = function updatePlaceHolder() { var _props_placeHolder; if ((_props_placeHolder = props.placeHolder) === null || _props_placeHolder === void 0 ? void 0 : _props_placeHolder.startsWith('i18n:')) { translatedPlaceHolder.value = Editor.I18n.t(props.placeHolder.slice('i18n:'.length)); } }; var isReadOnly = (0, _vue.computed)(function() { if (props.isTextarea) { return props.readonly || !isEditing.value; } else { return props.readonly; } }); var isSelected = (0, _vue.ref)(false); var isEditing = (0, _vue.ref)(false); var inputElement = (0, _vue.ref)(null); var textareaElement = (0, _vue.ref)(null); var labelElement = (0, _vue.ref)(null); var translatedPlaceHolder = (0, _vue.ref)(props.placeHolder); var blurTimeout = null; // eslint-disable-line no-undef var onBlur = function(event) { emit('blur'); blurTimeout = setTimeout(function() { isSelected.value = false; isEditing.value = false; }, 100); }; (0, _vue.onMounted)(function() { updatePlaceHolder(); var addBroadcastListener = Editor.Message.__protected__ ? Editor.Message.__protected__.addBroadcastListener : Editor.Message.addBroadcastListener; addBroadcastListener('i18n:change', updatePlaceHolder); }); (0, _vue.onUnmounted)(function() { var addBroadcastListener = Editor.Message.__protected__ ? Editor.Message.__protected__.removeBroadcastListener : Editor.Message.removeBroadcastListener; Editor.Message.__protected__.removeBroadcastListener('i18n:change', updatePlaceHolder); }); return { translatedPlaceHolder: translatedPlaceHolder, focus: focus, onFocus: onFocus, onBlur: onBlur, onInput: onInput, inputElement: inputElement, textareaElement: textareaElement, labelElement: labelElement, isSelected: isSelected, onClick: onClick, isEditing: isEditing, isReadOnly: isReadOnly }; } }; /***/ }), /***/ "./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/share/ui/m-menu.vue?vue&type=script&lang=ts": /*!******************************************************************************************************************************************************************************!*\ !*** ./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/share/ui/m-menu.vue?vue&type=script&lang=ts ***! \******************************************************************************************************************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "default", ({ enumerable: true, get: function() { return _default; } })); var _vue = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.cjs.js"); var _default = { props: { x: { required: true, type: Number }, y: { required: true, type: Number }, menus: { required: true, type: Array } }, setup: function setup() { var root = (0, _vue.ref)(null); var onClick = function onClick(menu) { menu.click(); root.value.style.display = 'none'; }; return { root: root, onClick: onClick }; } }; /***/ }), /***/ "./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/share/ui/m-process.vue?vue&type=script&lang=ts": /*!*********************************************************************************************************************************************************************************!*\ !*** ./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/share/ui/m-process.vue?vue&type=script&lang=ts ***! \*********************************************************************************************************************************************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "default", ({ enumerable: true, get: function() { return _default; } })); var _default = { props: { value: Number, color: { type: String, default: 'blue' } } }; /***/ }), /***/ "./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/share/ui/m-section.vue?vue&type=script&lang=ts": /*!*********************************************************************************************************************************************************************************!*\ !*** ./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/share/ui/m-section.vue?vue&type=script&lang=ts ***! \*********************************************************************************************************************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "default", ({ enumerable: true, get: function() { return _default; } })); var _miconvue = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ./m-icon.vue */ "./src/panel/share/ui/m-icon.vue")); function _interop_require_default(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var _default = { components: { 'm-icon': _miconvue.default }, props: { /** 是否展开 */ modelValue: Boolean }, setup: function setup(props, param) { var emit = param.emit; function clickIcon() { emit('update:modelValue', !props.modelValue); } return { clickIcon: clickIcon }; } }; /***/ }), /***/ "./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/default/component/default-app.vue?vue&type=template&id=792ce910&ts=true": /*!********************************************************************************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/default/component/default-app.vue?vue&type=template&id=792ce910&ts=true ***! \********************************************************************************************************************************************************************************************************************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "render", ({ enumerable: true, get: function() { return render; } })); var _vue = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.cjs.js"); var _hoisted_1 = { class: "mask" }; var _hoisted_2 = { class: "mask-bg" }; var _hoisted_3 = [ "value" ]; function render(_ctx, _cache, $props, $setup, $data, $options) { var _component_DefaultMask = (0, _vue.resolveComponent)("DefaultMask"); var _component_Home = (0, _vue.resolveComponent)("Home"); var _component_Translate = (0, _vue.resolveComponent)("Translate"); return (0, _vue.openBlock)(), (0, _vue.createBlock)(_vue.Suspense, null, { default: (0, _vue.withCtx)(function() { return [ (0, _vue.createElementVNode)("div", null, [ (0, _vue.withDirectives)((0, _vue.createVNode)(_component_DefaultMask, { onConfirm: _cache[0] || (_cache[0] = function($event) { return $setup.onMaskConfirm(); }) }, null, 512), [ [ _vue.vShow, !$setup.isLocalizationEditorEnable ] ]), (0, _vue.withDirectives)((0, _vue.createVNode)(_component_Home, { onTranslate: $setup.onTranslateClick, onToggle: $setup.onToggle }, null, 8, [ "onTranslate", "onToggle" ]), [ [ _vue.vShow, $setup.tabIndex === 0 ] ]), $setup.tabIndex === 1 ? ((0, _vue.openBlock)(), (0, _vue.createBlock)(_component_Translate, { key: 0, "target-locale": $setup.targetLocale, onHome: $setup.onHomeClick, onInitialized: $setup.onTranslateInitialized }, null, 8, [ "target-locale", "onHome", "onInitialized" ])) : (0, _vue.createCommentVNode)("", true), (0, _vue.withDirectives)((0, _vue.createElementVNode)("div", _hoisted_1, [ (0, _vue.createElementVNode)("div", _hoisted_2, [ (0, _vue.createElementVNode)("ui-label", { value: "i18n:".concat($setup.MainName, ".loading_tips") }, null, 8, _hoisted_3), _cache[1] || (_cache[1] = (0, _vue.createElementVNode)("ui-loading", null, null, -1)) ]) ], 512), [ [ _vue.vShow, $setup.showMask ] ]) ]) ]; }), fallback: (0, _vue.withCtx)(function() { return _cache[2] || (_cache[2] = [ (0, _vue.createElementVNode)("div", { class: "fallback" }, [ (0, _vue.createElementVNode)("ui-loading") ], -1) ]); }), _: 1 }); } /***/ }), /***/ "./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/default/component/panel/default-home.vue?vue&type=template&id=4f5c9af6&ts=true": /*!***************************************************************************************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/default/component/panel/default-home.vue?vue&type=template&id=4f5c9af6&ts=true ***! \***************************************************************************************************************************************************************************************************************************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "render", ({ enumerable: true, get: function() { return render; } })); var _vue = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.cjs.js"); function _array_like_to_array(arr, len) { if (len == null || len > arr.length) len = arr.length; for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i]; return arr2; } function _array_without_holes(arr) { if (Array.isArray(arr)) return _array_like_to_array(arr); } function _iterable_to_array(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _non_iterable_spread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _to_consumable_array(arr) { return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread(); } function _unsupported_iterable_to_array(o, minLen) { if (!o) return; if (typeof o === "string") return _array_like_to_array(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen); } var _hoisted_1 = { ref: "rootElement", class: "home" }; var _hoisted_2 = { ref: "bodyElement", class: "body" }; var _hoisted_3 = { class: "main" }; var _hoisted_4 = { class: "title" }; var _hoisted_5 = { ref: "serviceElement", class: "container service" }; var _hoisted_6 = [ "value" ]; var _hoisted_7 = { class: "gray service" }; var _hoisted_8 = { class: "container" }; var _hoisted_9 = { class: "left container" }; var _hoisted_10 = [ "value" ]; var _hoisted_11 = [ "value" ]; var _hoisted_12 = [ "value" ]; var _hoisted_13 = { key: 0, class: "container" }; var _hoisted_14 = { key: 1, class: "container" }; var _hoisted_15 = { key: 0, style: { "margin-top": "3px" } }; var _hoisted_16 = [ "value" ]; var _hoisted_17 = [ "value" ]; var _hoisted_18 = [ "value" ]; var _hoisted_19 = { ref: "collectionElement", class: "container collect" }; var _hoisted_20 = [ "value" ]; var _hoisted_21 = { class: "gray collect" }; var _hoisted_22 = { class: "container", style: { "margin-bottom": "20px" } }; var _hoisted_23 = [ "value" ]; var _hoisted_24 = [ "placeholder" ]; var _hoisted_25 = [ "value" ]; var _hoisted_26 = { class: "container", style: { "margin-bottom": "5px" } }; var _hoisted_27 = { style: { "flex": "1" }, class: "container" }; var _hoisted_28 = [ "value" ]; var _hoisted_29 = [ "value" ]; var _hoisted_30 = { style: { "flex": "1" } }; var _hoisted_31 = [ "value" ]; var _hoisted_32 = [ "value" ]; var _hoisted_33 = { class: "parent" }; var _hoisted_34 = [ "value" ]; var _hoisted_35 = { class: "weakWhite", style: { "margin-right": "28px" } }; var _hoisted_36 = { class: "weakWhite", style: { "margin-right": "8px" } }; var _hoisted_37 = [ "value" ]; var _hoisted_38 = { class: "parent" }; var _hoisted_39 = [ "value" ]; var _hoisted_40 = { class: "weakWhite", style: { "margin-right": "28px" } }; var _hoisted_41 = [ "value" ]; var _hoisted_42 = { class: "parent" }; var _hoisted_43 = [ "value" ]; var _hoisted_44 = { class: "weakWhite", style: { "margin-right": "28px" } }; var _hoisted_45 = { class: "weakWhite", style: { "margin-right": "8px" } }; var _hoisted_46 = { class: "container", style: { "margin-top": "62px" } }; var _hoisted_47 = [ "value" ]; var _hoisted_48 = [ "value" ]; var _hoisted_49 = [ "value" ]; var _hoisted_50 = [ "value" ]; var _hoisted_51 = [ "value" ]; var _hoisted_52 = [ "value" ]; var _hoisted_53 = { ref: "languageElement", class: "container language" }; var _hoisted_54 = [ "value" ]; var _hoisted_55 = { class: "gray language" }; var _hoisted_56 = { class: "container", style: { "margin-bottom": "16px" } }; var _hoisted_57 = [ "value" ]; var _hoisted_58 = [ "disabled" ]; var _hoisted_59 = [ "value" ]; var _hoisted_60 = [ "value" ]; var _hoisted_61 = [ "value" ]; var _hoisted_62 = [ "value" ]; var _hoisted_63 = [ "value" ]; var _hoisted_64 = [ "value" ]; var _hoisted_65 = [ "value" ]; var _hoisted_66 = [ "value" ]; var _hoisted_67 = { key: 0 }; var _hoisted_68 = [ "placeholder", "value", "onConfirm" ]; var _hoisted_69 = { key: 1 }; var _hoisted_70 = { class: "container" }; var _hoisted_71 = [ "tooltip", "value" ]; var _hoisted_72 = [ "value" ]; var _hoisted_73 = [ "value" ]; var _hoisted_74 = [ "value" ]; var _hoisted_75 = [ "value" ]; var _hoisted_76 = [ "value" ]; var _hoisted_77 = [ "value" ]; var _hoisted_78 = [ "placeholder" ]; var _hoisted_79 = { class: "container" }; var _hoisted_80 = { class: "container", style: { "flex-direction": "row-reverse", "margin-top": "32px" } }; var _hoisted_81 = [ "value" ]; function render(_ctx, _cache, $props, $setup, $data, $options) { var _$setup, _$setup1, _$setup2; var _$setup_currentService, _$setup_currentLanguage, _$setup_currentLanguage1, _$setup_currentLanguage2, _$setup_currentLanguage3; var _component_m_icon = (0, _vue.resolveComponent)("m-icon"); var _component_m_input = (0, _vue.resolveComponent)("m-input"); var _component_m_button = (0, _vue.resolveComponent)("m-button"); var _component_m_file = (0, _vue.resolveComponent)("m-file"); var _component_m_section = (0, _vue.resolveComponent)("m-section"); var _component_m_process = (0, _vue.resolveComponent)("m-process"); var _component_m_menu = (0, _vue.resolveComponent)("m-menu"); return (0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", _hoisted_1, [ (0, _vue.createElementVNode)("div", _hoisted_2, [ (0, _vue.createElementVNode)("div", _hoisted_3, [ (0, _vue.createElementVNode)("div", _hoisted_4, [ _cache[15] || (_cache[15] = (0, _vue.createElementVNode)("ui-label", { class: "strongWhite" }, " L10N ", -1)), (0, _vue.createVNode)(_component_m_icon, { style: { "margin-left": "5.5px", "display": "inline-flex" }, value: 'help', onClick: _cache[0] || (_cache[0] = function($event) { return $setup.onLinkClick('i18n'); }) }), (0, _vue.createVNode)(_component_m_icon, { value: "menu", style: { "margin-left": "auto" }, onClick: _cache[1] || (_cache[1] = function($event) { return $setup.onMenuClick(); }) }) ]), (0, _vue.createElementVNode)("div", _hoisted_5, [ _cache[16] || (_cache[16] = (0, _vue.createElementVNode)("div", { class: "ball shadow" }, null, -1)), (0, _vue.createElementVNode)("ui-label", { class: "strongWhite", value: "".concat($setup.i18nMainName, ".service_provider") }, null, 8, _hoisted_6) ], 512), (0, _vue.createElementVNode)("div", _hoisted_7, [ (0, _vue.createElementVNode)("div", _hoisted_8, [ (0, _vue.createElementVNode)("div", _hoisted_9, [ (0, _vue.createElementVNode)("ui-label", { value: "".concat($setup.i18nMainName, ".service_provider") }, null, 8, _hoisted_10), _cache[17] || (_cache[17] = (0, _vue.createElementVNode)("span", null, ":", -1)) ]), (0, _vue.createElementVNode)("ui-select", { value: ((_$setup_currentService = $setup.currentService) === null || _$setup_currentService === void 0 ? void 0 : _$setup_currentService.name) || 'None', onConfirm: _cache[2] || (_cache[2] = //@ts-ignore function() { for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){ args[_key] = arguments[_key]; } return $setup.onSetCurrentTranslateProvider && (_$setup = $setup).onSetCurrentTranslateProvider.apply(_$setup, _to_consumable_array(args)); }) }, [ ((0, _vue.openBlock)(true), (0, _vue.createElementBlock)(_vue.Fragment, null, (0, _vue.renderList)($setup.supportedServices, function(item) { return (0, _vue.openBlock)(), (0, _vue.createElementBlock)("option", { key: item }, (0, _vue.toDisplayString)(item), 1); }), 128)), _cache[18] || (_cache[18] = (0, _vue.createElementVNode)("option", null, "None", -1)) ], 40, _hoisted_11), (0, _vue.withDirectives)((0, _vue.createElementVNode)("ui-label", { style: { "margin-left": "16px" }, class: "weakGray", value: "".concat($setup.i18nMainName, ".unselect_service_tip") }, null, 8, _hoisted_12), [ [ _vue.vShow, !$setup.currentService ] ]) ]), $setup.currentService ? ((0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", _hoisted_13, [ _cache[19] || (_cache[19] = (0, _vue.createElementVNode)("ui-label", { class: "left" }, " AppKey: ", -1)), (0, _vue.createVNode)(_component_m_input, { "no-vertical-padding": "", i18n: "", "model-value": $setup.currentService.appKey, "onUpdate:modelValue": _cache[3] || (_cache[3] = function($event) { return $setup.onAppKeyUpdate($event); }) }, null, 8, [ "model-value" ]) ])) : (0, _vue.createCommentVNode)("", true), $setup.currentService ? ((0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", _hoisted_14, [ _cache[20] || (_cache[20] = (0, _vue.createElementVNode)("ui-label", { class: "left" }, " AppSecret: ", -1)), (0, _vue.createVNode)(_component_m_input, { "no-vertical-padding": "", i18n: "", "model-value": $setup.currentService.appSecret, "onUpdate:modelValue": _cache[4] || (_cache[4] = function($event) { return $setup.onAppSecretUpdate($event); }) }, null, 8, [ "model-value" ]) ])) : (0, _vue.createCommentVNode)("", true), $setup.currentService ? ((0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", { key: 2, class: "footer", onConfirm: _cache[5] || (_cache[5] = //@ts-ignore function() { for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){ args[_key] = arguments[_key]; } return $setup.onProviderSummitClick && (_$setup1 = $setup).onProviderSummitClick.apply(_$setup1, _to_consumable_array(args)); }) }, [ (0, _vue.createVNode)(_component_m_button, { "has-border": true, color: 'blue', disabled: $setup.isCurrentServiceDisabled }, { default: (0, _vue.withCtx)(function() { return [ $setup.isCurrentServiceLoading ? ((0, _vue.openBlock)(), (0, _vue.createElementBlock)("ui-loading", _hoisted_15)) : $setup.isCurrentServiceDirty ? ((0, _vue.openBlock)(), (0, _vue.createElementBlock)("ui-label", { key: 1, color: "", value: "".concat($setup.i18nMainName, ".home.save") }, null, 8, _hoisted_16)) : $setup.hasService ? ((0, _vue.openBlock)(), (0, _vue.createElementBlock)("ui-label", { key: 2, value: "".concat($setup.i18nMainName, ".home.complete"), color: "" }, null, 8, _hoisted_17)) : ((0, _vue.openBlock)(), (0, _vue.createElementBlock)("ui-label", { key: 3, value: "".concat($setup.i18nMainName, ".home.save"), color: "" }, null, 8, _hoisted_18)) ]; }), _: 1 }, 8, [ "disabled" ]) ], 32)) : (0, _vue.createCommentVNode)("", true) ]), (0, _vue.createElementVNode)("div", _hoisted_19, [ _cache[21] || (_cache[21] = (0, _vue.createElementVNode)("div", { class: "ball shadow" }, null, -1)), (0, _vue.createElementVNode)("ui-label", { class: "strongWhite", value: "".concat($setup.i18nMainName, ".collection") }, null, 8, _hoisted_20) ], 512), (0, _vue.createElementVNode)("div", _hoisted_21, [ (0, _vue.createElementVNode)("div", _hoisted_22, [ _cache[22] || (_cache[22] = (0, _vue.createElementVNode)("ui-label", { class: "red", style: { "margin-right": "0px" } }, " * ", -1)), (0, _vue.createElementVNode)("ui-label", { value: "".concat($setup.i18nMainName, ".local_language") }, null, 8, _hoisted_23), (0, _vue.createElementVNode)("ui-select", { placeholder: $setup.currentLanguageDisplayName || "".concat($setup.i18nMainName, ".home.select"), style: { "margin-right": "17px" }, onMousedown: _cache[6] || (_cache[6] = (0, _vue.withModifiers)(//@ts-ignore function() { for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){ args[_key] = arguments[_key]; } return $setup.onSelectLocalClick && (_$setup2 = $setup).onSelectLocalClick.apply(_$setup2, _to_consumable_array(args)); }, [ "prevent" ])) }, null, 40, _hoisted_24), (0, _vue.withDirectives)((0, _vue.createElementVNode)("ui-label", { class: "red", value: "".concat($setup.i18nMainName, ".home.required") }, null, 8, _hoisted_25), [ [ _vue.vShow, !$setup.currentLanguage ] ]) ]), (0, _vue.createElementVNode)("div", _hoisted_26, [ (0, _vue.createElementVNode)("div", _hoisted_27, [ (0, _vue.createElementVNode)("ui-label", { value: "".concat($setup.i18nMainName, ".collected_from_resource_files") }, null, 8, _hoisted_28), (0, _vue.createVNode)(_component_m_icon, { value: 'help', onClick: _cache[7] || (_cache[7] = function($event) { return $setup.onLinkClick('collection'); }) }) ]), (0, _vue.createElementVNode)("ui-button", { onClick: _cache[8] || (_cache[8] = (0, _vue.withModifiers)(function() {}, [ "stop" ])), onConfirm: _cache[9] || (_cache[9] = function($event) { return $setup.onAddCollectionClick(); }) }, [ (0, _vue.createElementVNode)("ui-label", { color: "", value: "".concat($setup.i18nMainName, ".home.add") }, null, 8, _hoisted_29) ], 32) ]), ((0, _vue.openBlock)(true), (0, _vue.createElementBlock)(_vue.Fragment, null, (0, _vue.renderList)($setup.collections, function(collection, i) { return (0, _vue.openBlock)(), (0, _vue.createBlock)(_component_m_section, { key: collection.__key, modelValue: collection.value.expanded, "onUpdate:modelValue": function($event) { return collection.value.expanded = $event; }, class: "frame", style: { "padding-right": "15px" } }, { header: (0, _vue.withCtx)(function() { return [ (0, _vue.createElementVNode)("div", _hoisted_30, [ (0, _vue.createElementVNode)("ui-label", { value: "".concat($setup.i18nMainName, ".home.collect_group") }, null, 8, _hoisted_31), (0, _vue.createElementVNode)("ui-label", null, (0, _vue.toDisplayString)(i + 1), 1) ]), (0, _vue.createVNode)(_component_m_icon, { value: "del", onClick: (0, _vue.withModifiers)(function($event) { return $setup.onRemoveCollectionClick(i); }, [ "stop" ]) }, null, 8, [ "onClick" ]) ]; }), content: (0, _vue.withCtx)(function() { return [ (0, _vue.createVNode)(_component_m_section, { modelValue: collection.value.dirs.expanded, "onUpdate:modelValue": function($event) { return collection.value.dirs.expanded = $event; } }, { header: (0, _vue.withCtx)(function() { return [ (0, _vue.createElementVNode)("ui-label", { style: { "flex": "1" }, value: "".concat($setup.i18nMainName, ".home.search_dir") }, null, 8, _hoisted_32), (0, _vue.createVNode)(_component_m_icon, { onClick: [ _cache[10] || (_cache[10] = (0, _vue.withModifiers)(function() {}, [ "stop" ])), function($event) { return $setup.onAddToCollectionClick(i, 'dirs'); } ] }, { default: (0, _vue.withCtx)(function() { return _cache[23] || (_cache[23] = [ (0, _vue.createTextVNode)(" + ") ]); }), _: 2 }, 1032, [ "onClick" ]) ]; }), content: (0, _vue.withCtx)(function() { return [ ((0, _vue.openBlock)(true), (0, _vue.createElementBlock)(_vue.Fragment, null, (0, _vue.renderList)(collection.value.dirs.items, function(item, j) { return (0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", { key: item.__key, class: "container" }, [ (0, _vue.createVNode)(_component_m_file, { modelValue: item.value, "onUpdate:modelValue": function($event) { return item.value = $event; }, "check-file-exist": true, style: {} }, { icon: (0, _vue.withCtx)(function() { return [ (0, _vue.createVNode)(_component_m_icon, { color: "true", value: "warn-triangle" }) ]; }), label: (0, _vue.withCtx)(function() { return [ (0, _vue.createElementVNode)("span", _hoisted_33, [ (0, _vue.createElementVNode)("span", null, [ (0, _vue.createElementVNode)("ui-label", { class: "weakWhite", value: "".concat($setup.i18nMainName, ".home.dir") }, null, 8, _hoisted_34), (0, _vue.createElementVNode)("ui-label", _hoisted_35, (0, _vue.toDisplayString)(j + 1), 1) ]), (0, _vue.createElementVNode)("ui-label", _hoisted_36, (0, _vue.toDisplayString)($setup.projectAssetPath), 1) ]) ]; }), inputIcon: (0, _vue.withCtx)(function() { return [ (0, _vue.createVNode)(_component_m_icon, { value: "folder-open", onClick: function($event) { return $setup.onSelectCollectionDirClick(i, j); } }, null, 8, [ "onClick" ]) ]; }), _: 2 }, 1032, [ "modelValue", "onUpdate:modelValue" ]), (0, _vue.createVNode)(_component_m_icon, { style: (0, _vue.normalizeStyle)({ visibility: collection.value.dirs.items.length >= 2 ? undefined : 'hidden' }), value: "del", onClick: function($event) { return $setup.onRemoveFromCollectionClick(i, j, 'dirs'); } }, null, 8, [ "style", "onClick" ]) ]); }), 128)) ]; }), _: 2 }, 1032, [ "modelValue", "onUpdate:modelValue" ]), (0, _vue.createVNode)(_component_m_section, { modelValue: collection.value.exts.expanded, "onUpdate:modelValue": function($event) { return collection.value.exts.expanded = $event; } }, { header: (0, _vue.withCtx)(function() { return [ (0, _vue.createElementVNode)("ui-label", { style: { "flex": "1" }, value: "".concat($setup.i18nMainName, ".home.extname") }, null, 8, _hoisted_37), (0, _vue.createVNode)(_component_m_icon, { onClick: [ _cache[11] || (_cache[11] = (0, _vue.withModifiers)(function() {}, [ "stop" ])), function($event) { return $setup.onAddToCollectionClick(i, 'exts'); } ] }, { default: (0, _vue.withCtx)(function() { return _cache[24] || (_cache[24] = [ (0, _vue.createTextVNode)(" + ") ]); }), _: 2 }, 1032, [ "onClick" ]) ]; }), content: (0, _vue.withCtx)(function() { return [ ((0, _vue.openBlock)(true), (0, _vue.createElementBlock)(_vue.Fragment, null, (0, _vue.renderList)(collection.value.exts.items, function(item, j) { return (0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", { key: item.__key, class: "container" }, [ (0, _vue.createVNode)(_component_m_file, { modelValue: item.value, "onUpdate:modelValue": function($event) { return item.value = $event; }, "check-empty": true }, { icon: (0, _vue.withCtx)(function() { return [ (0, _vue.createVNode)(_component_m_icon, { color: "true", value: "warn-triangle", style: { "margin-right": "2px" } }) ]; }), label: (0, _vue.withCtx)(function() { return [ (0, _vue.createElementVNode)("span", _hoisted_38, [ (0, _vue.createElementVNode)("span", null, [ (0, _vue.createElementVNode)("ui-label", { class: "weakWhite", value: "".concat($setup.i18nMainName, ".home.extname") }, null, 8, _hoisted_39), (0, _vue.createElementVNode)("ui-label", _hoisted_40, (0, _vue.toDisplayString)(j + 1), 1) ]), _cache[25] || (_cache[25] = (0, _vue.createElementVNode)("ui-label", { style: { "margin-right": "8px" } }, " *. ", -1)) ]) ]; }), _: 2 }, 1032, [ "modelValue", "onUpdate:modelValue" ]), (0, _vue.createVNode)(_component_m_icon, { value: "del", onClick: function($event) { return $setup.onRemoveFromCollectionClick(i, j, 'exts'); } }, null, 8, [ "onClick" ]) ]); }), 128)) ]; }), _: 2 }, 1032, [ "modelValue", "onUpdate:modelValue" ]), (0, _vue.createVNode)(_component_m_section, { modelValue: collection.value.excludes.expanded, "onUpdate:modelValue": function($event) { return collection.value.excludes.expanded = $event; } }, { header: (0, _vue.withCtx)(function() { return [ (0, _vue.createElementVNode)("ui-label", { style: { "flex": "1" }, value: "".concat($setup.i18nMainName, ".home.exclude_path") }, null, 8, _hoisted_41), (0, _vue.createVNode)(_component_m_icon, { onClick: [ _cache[12] || (_cache[12] = (0, _vue.withModifiers)(function() {}, [ "stop" ])), function($event) { return $setup.onAddToCollectionClick(i, 'excludes'); } ] }, { default: (0, _vue.withCtx)(function() { return _cache[26] || (_cache[26] = [ (0, _vue.createTextVNode)(" + ") ]); }), _: 2 }, 1032, [ "onClick" ]) ]; }), content: (0, _vue.withCtx)(function() { return [ ((0, _vue.openBlock)(true), (0, _vue.createElementBlock)(_vue.Fragment, null, (0, _vue.renderList)(collection.value.excludes.items, function(item, j) { return (0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", { key: item.__key, class: "container" }, [ (0, _vue.createVNode)(_component_m_file, { modelValue: item.value, "onUpdate:modelValue": function($event) { return item.value = $event; }, "check-file-exist": true }, { icon: (0, _vue.withCtx)(function() { return [ (0, _vue.createVNode)(_component_m_icon, { color: "true", value: "warn-triangle" }) ]; }), label: (0, _vue.withCtx)(function() { return [ (0, _vue.createElementVNode)("span", _hoisted_42, [ (0, _vue.createElementVNode)("span", null, [ (0, _vue.createElementVNode)("ui-label", { class: "weakWhite", value: "".concat($setup.i18nMainName, ".home.exclude_path") }, null, 8, _hoisted_43), (0, _vue.createElementVNode)("ui-label", _hoisted_44, (0, _vue.toDisplayString)(j + 1), 1) ]), (0, _vue.createElementVNode)("ui-label", _hoisted_45, (0, _vue.toDisplayString)($setup.projectAssetPath), 1) ]) ]; }), inputIcon: (0, _vue.withCtx)(function() { return [ (0, _vue.createVNode)(_component_m_icon, { value: "folder-open", onClick: function($event) { return $setup.onSelectExcludeDirClick(i, j); } }, null, 8, [ "onClick" ]) ]; }), _: 2 }, 1032, [ "modelValue", "onUpdate:modelValue" ]), (0, _vue.createVNode)(_component_m_icon, { value: "del", onClick: function($event) { return $setup.onRemoveFromCollectionClick(i, j, 'excludes'); } }, null, 8, [ "onClick" ]) ]); }), 128)) ]; }), _: 2 }, 1032, [ "modelValue", "onUpdate:modelValue" ]) ]; }), _: 2 }, 1032, [ "modelValue", "onUpdate:modelValue" ]); }), 128)), (0, _vue.createElementVNode)("div", _hoisted_46, [ (0, _vue.createElementVNode)("ui-label", { class: "weakWhite", value: "".concat($setup.i18nMainName, ".home.count") }, null, 8, _hoisted_47), (0, _vue.withDirectives)((0, _vue.createVNode)(_component_m_process, { value: $setup.collectionProgress }, null, 8, [ "value" ]), [ [ _vue.vShow, $setup.collectionProgress !== -1 ] ]), (0, _vue.withDirectives)((0, _vue.createElementVNode)("ui-label", { style: { "flex": "1" }, value: $setup.numberFormat($setup.currentCollectCount) }, null, 8, _hoisted_48), [ [ _vue.vShow, $setup.currentCollectCount !== -1 ] ]), (0, _vue.withDirectives)((0, _vue.createElementVNode)("ui-label", { style: { "flex": "1" }, value: ((_$setup_currentLanguage = $setup.currentLanguage) === null || _$setup_currentLanguage === void 0 ? void 0 : _$setup_currentLanguage.translateTotal) ? $setup.numberFormat((_$setup_currentLanguage1 = $setup.currentLanguage) === null || _$setup_currentLanguage1 === void 0 ? void 0 : _$setup_currentLanguage1.translateTotal) : '' }, null, 8, _hoisted_49), [ [ _vue.vShow, $setup.currentCollectCount === -1 && ((_$setup_currentLanguage2 = $setup.currentLanguage) === null || _$setup_currentLanguage2 === void 0 ? void 0 : _$setup_currentLanguage2.translateTotal) ] ]), (0, _vue.withDirectives)((0, _vue.createElementVNode)("ui-label", { style: { "flex": "1" }, class: "weakGray", value: "".concat($setup.i18nMainName, ".home.not_recorded") }, null, 8, _hoisted_50), [ [ _vue.vShow, $setup.currentCollectCount === -1 && !((_$setup_currentLanguage3 = $setup.currentLanguage) === null || _$setup_currentLanguage3 === void 0 ? void 0 : _$setup_currentLanguage3.translateTotal) ] ]), (0, _vue.createVNode)(_component_m_button, { color: 'blue', disabled: $setup.isCollectionDisabled, "has-border": true, onConfirm: $setup.onScanClick }, { default: (0, _vue.withCtx)(function() { return [ (0, _vue.withDirectives)((0, _vue.createElementVNode)("ui-label", { color: "", value: "".concat($setup.i18nMainName, ".home.collecting") }, null, 8, _hoisted_51), [ [ _vue.vShow, $setup.isCollecting ] ]), (0, _vue.withDirectives)((0, _vue.createElementVNode)("ui-label", { color: "", value: "".concat($setup.i18nMainName, ".home.collect_and_count") }, null, 8, _hoisted_52), [ [ _vue.vShow, !$setup.isCollecting ] ]) ]; }), _: 1 }, 8, [ "disabled", "onConfirm" ]) ]) ]), (0, _vue.createElementVNode)("div", _hoisted_53, [ _cache[27] || (_cache[27] = (0, _vue.createElementVNode)("div", { class: "ball shadow" }, null, -1)), (0, _vue.createElementVNode)("ui-label", { class: "strongWhite", value: "".concat($setup.i18nMainName, ".language_compilation") }, null, 8, _hoisted_54) ], 512), (0, _vue.createElementVNode)("div", _hoisted_55, [ (0, _vue.createElementVNode)("div", _hoisted_56, [ (0, _vue.createElementVNode)("ui-label", { value: "".concat($setup.i18nMainName, ".home.language:"), style: { "margin-right": "8px" } }, null, 8, _hoisted_57), (0, _vue.createElementVNode)("ui-button", { disabled: !$setup.currentLanguage, onConfirm: _cache[13] || (_cache[13] = function($event) { return $setup.onSelectNewLanguageClick(); }) }, [ (0, _vue.createElementVNode)("ui-label", { color: "", value: "".concat($setup.i18nMainName, ".home.add_new_language") }, null, 8, _hoisted_59) ], 40, _hoisted_58) ]), (0, _vue.createElementVNode)("table", null, [ (0, _vue.createElementVNode)("tr", null, [ (0, _vue.createElementVNode)("th", null, [ (0, _vue.createElementVNode)("ui-label", { class: "weakWhite", value: "".concat($setup.i18nMainName, ".home.language") }, null, 8, _hoisted_60) ]), (0, _vue.createElementVNode)("th", null, [ (0, _vue.createElementVNode)("ui-label", { class: "weakWhite", value: "".concat($setup.i18nMainName, ".home.language_for_service_provider") }, null, 8, _hoisted_61) ]), (0, _vue.createElementVNode)("th", null, [ (0, _vue.createElementVNode)("ui-label", { class: "weakWhite", value: "".concat($setup.i18nMainName, ".home.translate_process") }, null, 8, _hoisted_62) ]), (0, _vue.createElementVNode)("th", null, [ (0, _vue.createElementVNode)("ui-label", { class: "weakWhite", value: "".concat($setup.i18nMainName, ".home.operation") }, null, 8, _hoisted_63) ]) ]), ((0, _vue.openBlock)(true), (0, _vue.createElementBlock)(_vue.Fragment, null, (0, _vue.renderList)($setup.panelTranslateDataList, function(item, i) { var _$setup_currentLanguage, _$setup_currentLanguage1; return (0, _vue.withDirectives)(((0, _vue.openBlock)(), (0, _vue.createElementBlock)("tr", { key: item.value.bcp47Tag }, [ (0, _vue.createElementVNode)("td", null, [ (0, _vue.createElementVNode)("ui-label", { value: item.value.displayName }, null, 8, _hoisted_64), (0, _vue.createElementVNode)("ui-label", { class: "weakWhite", value: "(".concat(item.value.bcp47Tag, ")") }, null, 8, _hoisted_65), (0, _vue.withDirectives)((0, _vue.createElementVNode)("ui-label", { style: { "display": "block" }, class: "weakWhite", value: "".concat($setup.i18nMainName, ".home.local_language") }, null, 8, _hoisted_66), [ [ _vue.vShow, item.value.bcp47Tag === ((_$setup_currentLanguage = $setup.currentLanguage) === null || _$setup_currentLanguage === void 0 ? void 0 : _$setup_currentLanguage.bcp47Tag) ] ]) ]), $setup.hasService ? ((0, _vue.openBlock)(), (0, _vue.createElementBlock)("td", _hoisted_67, [ (0, _vue.createElementVNode)("ui-select", { placeholder: item.value.providerTag && $setup.providerLanguages[item.value.providerTag] ? '' : "".concat($setup.i18nMainName, ".home.select"), value: item.value.providerTag && $setup.providerLanguages[item.value.providerTag], onConfirm: function($event) { return $setup.onProviderLanguageSelect($event, i); } }, [ ((0, _vue.openBlock)(true), (0, _vue.createElementBlock)(_vue.Fragment, null, (0, _vue.renderList)($setup.providerLanguages, function(value, key) { return (0, _vue.openBlock)(), (0, _vue.createElementBlock)("option", { key: key }, (0, _vue.toDisplayString)(value), 1); }), 128)) ], 40, _hoisted_68) ])) : ((0, _vue.openBlock)(), (0, _vue.createElementBlock)("td", _hoisted_69, _cache[28] || (_cache[28] = [ (0, _vue.createElementVNode)("ui-select", { disabled: "" }, null, -1) ]))), (0, _vue.createElementVNode)("td", null, [ (0, _vue.createElementVNode)("div", _hoisted_70, [ (0, _vue.createVNode)(_component_m_process, { value: $setup.getTranslateProcess(item), color: 'blue' }, null, 8, [ "value" ]), (0, _vue.createElementVNode)("ui-label", { tooltip: "".concat($setup.i18nMainName, ".home.combine_tooltip"), value: $setup.getTranslateProcessDescription(item) }, null, 8, _hoisted_71) ]) ]), (0, _vue.createElementVNode)("td", null, [ (0, _vue.createVNode)(_component_m_button, { color: 'blue', onConfirm: function($event) { return $setup.onTranslateClick(i); } }, { default: (0, _vue.withCtx)(function() { var _$setup_currentLanguage, _$setup_currentLanguage1; return [ (0, _vue.withDirectives)((0, _vue.createElementVNode)("ui-label", { color: "", value: "".concat($setup.i18nMainName, ".home.complement") }, null, 8, _hoisted_72), [ [ _vue.vShow, item.value.bcp47Tag === ((_$setup_currentLanguage = $setup.currentLanguage) === null || _$setup_currentLanguage === void 0 ? void 0 : _$setup_currentLanguage.bcp47Tag) ] ]), (0, _vue.withDirectives)((0, _vue.createElementVNode)("ui-label", { color: "", value: "".concat($setup.i18nMainName, ".home.translate") }, null, 8, _hoisted_73), [ [ _vue.vShow, item.value.bcp47Tag !== ((_$setup_currentLanguage1 = $setup.currentLanguage) === null || _$setup_currentLanguage1 === void 0 ? void 0 : _$setup_currentLanguage1.bcp47Tag) ] ]) ]; }), _: 2 }, 1032, [ "onConfirm" ]), (0, _vue.createVNode)(_component_m_button, { color: 'blue', disabled: !item.value.translateFinished, onConfirm: function($event) { return $setup.onPreviewClick(i); } }, { default: (0, _vue.withCtx)(function() { return [ (0, _vue.createElementVNode)("ui-label", { color: "", value: "".concat($setup.i18nMainName, ".home.preview") }, null, 8, _hoisted_74) ]; }), _: 2 }, 1032, [ "disabled", "onConfirm" ]), (0, _vue.createVNode)(_component_m_button, { color: 'blue', disabled: !item.value.translateFinished, onConfirm: function($event) { return $setup.onExportClick(i); } }, { default: (0, _vue.withCtx)(function() { return [ (0, _vue.createElementVNode)("ui-label", { color: "", value: "".concat($setup.i18nMainName, ".home.export") }, null, 8, _hoisted_75) ]; }), _: 2 }, 1032, [ "disabled", "onConfirm" ]), (0, _vue.createVNode)(_component_m_button, { color: 'blue', disabled: item.value.bcp47Tag === ((_$setup_currentLanguage1 = $setup.currentLanguage) === null || _$setup_currentLanguage1 === void 0 ? void 0 : _$setup_currentLanguage1.bcp47Tag), onConfirm: function($event) { return $setup.onDeleteClick(i); } }, { default: (0, _vue.withCtx)(function() { return [ (0, _vue.createElementVNode)("ui-label", { color: "", value: "".concat($setup.i18nMainName, ".home.delete") }, null, 8, _hoisted_76) ]; }), _: 2 }, 1032, [ "disabled", "onConfirm" ]) ]) ])), [ [ _vue.vShow, $setup.currentLanguage ] ]); }), 128)), (0, _vue.withDirectives)((0, _vue.createElementVNode)("tr", null, [ (0, _vue.createElementVNode)("td", null, [ (0, _vue.createElementVNode)("ui-label", { class: "weakGray", value: "".concat($setup.i18nMainName, ".home.unselect") }, null, 8, _hoisted_77) ]), (0, _vue.createElementVNode)("td", null, [ (0, _vue.createElementVNode)("ui-select", { disabled: "", placeholder: "".concat($setup.i18nMainName, ".home.select") }, null, 8, _hoisted_78) ]), (0, _vue.createElementVNode)("td", null, [ (0, _vue.createElementVNode)("div", _hoisted_79, [ (0, _vue.createVNode)(_component_m_process, { value: 0 }) ]) ]), _cache[29] || (_cache[29] = (0, _vue.createElementVNode)("td", null, [ (0, _vue.createElementVNode)("ui-label", { style: { "margin-left": "16px" }, class: "weakGray" }, " - ") ], -1)) ], 512), [ [ _vue.vShow, !$setup.currentLanguage ] ]) ]), (0, _vue.createElementVNode)("div", _hoisted_80, [ (0, _vue.createElementVNode)("div", { class: "container", style: { "flex-direction": "column", "position": "relative", "padding": "0px" }, onMouseleave: _cache[14] || (_cache[14] = function($event) { return $setup.isShowExportMenus = false; }) }, [ (0, _vue.createVNode)(_component_m_button, { ref: "exportButton", color: 'blue', transparent: true, "has-border": true, disabled: !$setup.currentLanguage, style: { "margin-right": "0px" }, onMouseenter: $setup.onShowExportMenu }, { default: (0, _vue.withCtx)(function() { return [ (0, _vue.createElementVNode)("ui-label", { color: "", value: "".concat($setup.i18nMainName, ".home.export_all") }, null, 8, _hoisted_81) ]; }), _: 1 }, 8, [ "disabled", "onMouseenter" ]), (0, _vue.withDirectives)((0, _vue.createVNode)(_component_m_menu, { x: $setup.menuPosition.x, y: $setup.menuPosition.y, menus: $setup.exportAllMenus }, null, 8, [ "x", "y", "menus" ]), [ [ _vue.vShow, $setup.isShowExportMenus ] ]) ], 32) ]), _cache[30] || (_cache[30] = (0, _vue.createElementVNode)("div", null, null, -1)) ]) ]) ], 512) ], 512); } /***/ }), /***/ "./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/default/component/panel/default-mask.vue?vue&type=template&id=0b323694&ts=true": /*!***************************************************************************************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/default/component/panel/default-mask.vue?vue&type=template&id=0b323694&ts=true ***! \***************************************************************************************************************************************************************************************************************************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "render", ({ enumerable: true, get: function() { return render; } })); var _vue = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.cjs.js"); var _hoisted_1 = { class: "mask" }; var _hoisted_2 = [ "value" ]; var _hoisted_3 = [ "value" ]; function render(_ctx, _cache, $props, $setup, $data, $options) { return (0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", _hoisted_1, [ (0, _vue.createElementVNode)("div", null, [ (0, _vue.createElementVNode)("ui-label", { value: "".concat($setup.PKGName, ".home.turn_on_tip") }, null, 8, _hoisted_2), (0, _vue.createElementVNode)("ui-button", { onConfirm: _cache[0] || (_cache[0] = function($event) { return $setup.onButtonClick(); }) }, [ (0, _vue.createElementVNode)("ui-label", { color: "", value: "".concat($setup.PKGName, ".home.turn_on") }, null, 8, _hoisted_3) ], 32) ]) ]); } /***/ }), /***/ "./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/default/component/panel/default-translate.vue?vue&type=template&id=46070b16&ts=true": /*!********************************************************************************************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/default/component/panel/default-translate.vue?vue&type=template&id=46070b16&ts=true ***! \********************************************************************************************************************************************************************************************************************************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "render", ({ enumerable: true, get: function() { return render; } })); var _vue = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.cjs.js"); function _array_like_to_array(arr, len) { if (len == null || len > arr.length) len = arr.length; for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i]; return arr2; } function _array_without_holes(arr) { if (Array.isArray(arr)) return _array_like_to_array(arr); } function _iterable_to_array(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _non_iterable_spread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _to_consumable_array(arr) { return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread(); } function _unsupported_iterable_to_array(o, minLen) { if (!o) return; if (typeof o === "string") return _array_like_to_array(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen); } var _hoisted_1 = { class: "translate" }; var _hoisted_2 = { class: "toolbar container" }; var _hoisted_3 = [ "value" ]; var _hoisted_4 = [ "value" ]; var _hoisted_5 = { class: "tabs container" }; var _hoisted_6 = [ "value" ]; var _hoisted_7 = [ "value" ]; var _hoisted_8 = [ "value" ]; var _hoisted_9 = [ "value" ]; var _hoisted_10 = [ "value" ]; var _hoisted_11 = { class: "div" }; var _hoisted_12 = [ "scrollTop" ]; var _hoisted_13 = { class: "tr head" }; var _hoisted_14 = { class: "th" }; var _hoisted_15 = { tabindex: "0" }; var _hoisted_16 = { class: "container" }; var _hoisted_17 = [ "value" ]; var _hoisted_18 = [ "value" ]; var _hoisted_19 = { class: "th" }; var _hoisted_20 = { tabindex: "0" }; var _hoisted_21 = { class: "container" }; var _hoisted_22 = [ "value" ]; var _hoisted_23 = [ "value" ]; var _hoisted_24 = [ "value" ]; var _hoisted_25 = [ "value" ]; var _hoisted_26 = { class: "td", tabindex: "0" }; var _hoisted_27 = { class: "td" }; var _hoisted_28 = { class: "container" }; var _hoisted_29 = [ "value" ]; var _hoisted_30 = [ "value" ]; var _hoisted_31 = [ "value" ]; var _hoisted_32 = [ "value" ]; var _hoisted_33 = [ "value" ]; var _hoisted_34 = [ "value", "onClick" ]; var _hoisted_35 = [ "value" ]; var _hoisted_36 = [ "value" ]; var _hoisted_37 = { key: 0, class: "variants" }; var _hoisted_38 = { class: "header" }; var _hoisted_39 = [ "value" ]; var _hoisted_40 = { class: "body" }; var _hoisted_41 = { class: "tr" }; var _hoisted_42 = { class: "th" }; var _hoisted_43 = { tabindex: "0" }; var _hoisted_44 = [ "value" ]; var _hoisted_45 = { class: "th" }; var _hoisted_46 = { tabindex: "0", class: "container" }; var _hoisted_47 = [ "value" ]; var _hoisted_48 = { class: "td" }; var _hoisted_49 = { class: "td" }; var _hoisted_50 = { class: "container" }; var _hoisted_51 = { class: "footer" }; var _hoisted_52 = { class: "container" }; var _hoisted_53 = { style: { "flex": "1" } }; var _hoisted_54 = [ "value" ]; var _hoisted_55 = [ "value" ]; var _hoisted_56 = [ "value" ]; var _hoisted_57 = { class: "dialog" }; var _hoisted_58 = { class: "content", style: { "width": "933px", "min-width": "933px", "min-height": "366px", "max-height": "686px" } }; var _hoisted_59 = { class: "header" }; var _hoisted_60 = [ "value" ]; var _hoisted_61 = { class: "body" }; var _hoisted_62 = [ "value" ]; var _hoisted_63 = { class: "tr head" }; var _hoisted_64 = { class: "th" }; var _hoisted_65 = [ "value" ]; var _hoisted_66 = { class: "th" }; var _hoisted_67 = [ "value" ]; var _hoisted_68 = { class: "th" }; var _hoisted_69 = [ "value" ]; var _hoisted_70 = { class: "th" }; var _hoisted_71 = [ "value" ]; var _hoisted_72 = { class: "td hideOverFlow" }; var _hoisted_73 = [ "value", "onChange" ]; var _hoisted_74 = { class: "td hideOverFlow" }; var _hoisted_75 = [ "value", "tooltip" ]; var _hoisted_76 = { class: "td hideOverFlow" }; var _hoisted_77 = [ "value", "tooltip" ]; var _hoisted_78 = { class: "td hideOverFlow" }; var _hoisted_79 = [ "value", "tooltip" ]; var _hoisted_80 = { class: "footer" }; var _hoisted_81 = [ "value" ]; var _hoisted_82 = [ "value" ]; var _hoisted_83 = { class: "dialog" }; var _hoisted_84 = { class: "content", style: { "width": "524px", "height": "272px" } }; var _hoisted_85 = { class: "header" }; var _hoisted_86 = [ "value" ]; var _hoisted_87 = { class: "body container" }; var _hoisted_88 = { class: "container row" }; var _hoisted_89 = [ "value" ]; var _hoisted_90 = { class: "container row" }; var _hoisted_91 = [ "value" ]; var _hoisted_92 = { class: "footer" }; var _hoisted_93 = [ "value" ]; var _hoisted_94 = [ "value" ]; var _hoisted_95 = { class: "save-mask" }; var _hoisted_96 = { class: "mask-bg" }; var _hoisted_97 = [ "value" ]; function render(_ctx, _cache, $props, $setup, $data, $options) { var _$setup, _$setup1, _$setup2; var _$setup_currentSelectedItem; var _component_m_button = (0, _vue.resolveComponent)("m-button"); var _component_m_input = (0, _vue.resolveComponent)("m-input"); return (0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", _hoisted_1, [ (0, _vue.createElementVNode)("head", null, [ (0, _vue.createElementVNode)("div", _hoisted_2, [ (0, _vue.createVNode)(_component_m_button, { onConfirm: $setup.onHomeClick }, { default: (0, _vue.withCtx)(function() { return _cache[11] || (_cache[11] = [ (0, _vue.createElementVNode)("ui-icon", { value: "arrow-triangle", style: { "transform": "rotate(90deg)" } }, null, -1) ]); }), _: 1 }, 8, [ "onConfirm" ]), (0, _vue.createVNode)(_component_m_button, { onConfirm: $setup.onFileInputClick }, { default: (0, _vue.withCtx)(function() { return [ _cache[12] || (_cache[12] = (0, _vue.createElementVNode)("ui-icon", { value: "import" }, null, -1)), (0, _vue.createElementVNode)("ui-label", { color: "", value: "i18n:".concat($setup.MainName, ".translate.import_file") }, null, 8, _hoisted_3) ]; }), _: 1 }, 8, [ "onConfirm" ]), (0, _vue.createVNode)(_component_m_button, { onConfirm: $setup.onSaveClick }, { default: (0, _vue.withCtx)(function() { return [ _cache[13] || (_cache[13] = (0, _vue.createElementVNode)("ui-icon", { style: { "display": "inline-block", "margin-right": "4px" }, value: 'save' }, null, -1)), (0, _vue.createElementVNode)("ui-label", { color: "", value: "i18n:".concat($setup.MainName, ".translate.save") }, null, 8, _hoisted_4) ]; }), _: 1 }, 8, [ "onConfirm" ]) ]) ]), (0, _vue.createElementVNode)("body", null, [ (0, _vue.createElementVNode)("div", _hoisted_5, [ (0, _vue.createElementVNode)("div", { class: (0, _vue.normalizeClass)([ "tab", { selected: $setup.currentTab === $setup.Tab[0] } ]), onClick: _cache[0] || (_cache[0] = function($event) { return $setup.onTabClick(0); }) }, [ (0, _vue.withDirectives)((0, _vue.createElementVNode)("ui-label", { color: "", value: "i18n:".concat($setup.MainName, ".translate.unfilled") }, null, 8, _hoisted_6), [ [ _vue.vShow, $setup.isSameLanguage ] ]), (0, _vue.withDirectives)((0, _vue.createElementVNode)("ui-label", { color: "", value: "i18n:".concat($setup.MainName, ".translate.untranslated") }, null, 8, _hoisted_7), [ [ _vue.vShow, !$setup.isSameLanguage ] ]) ], 2), (0, _vue.createElementVNode)("div", { class: (0, _vue.normalizeClass)([ "tab", { selected: $setup.currentTab === $setup.Tab[1] } ]), onClick: _cache[1] || (_cache[1] = function($event) { return $setup.onTabClick(1); }) }, [ (0, _vue.withDirectives)((0, _vue.createElementVNode)("ui-label", { color: "", value: "i18n:".concat($setup.MainName, ".translate.filled") }, null, 8, _hoisted_8), [ [ _vue.vShow, $setup.isSameLanguage ] ]), (0, _vue.withDirectives)((0, _vue.createElementVNode)("ui-label", { color: "", value: "i18n:".concat($setup.MainName, ".translate.translated") }, null, 8, _hoisted_9), [ [ _vue.vShow, !$setup.isSameLanguage ] ]) ], 2), (0, _vue.createElementVNode)("div", { class: (0, _vue.normalizeClass)([ "tab", { selected: $setup.currentTab === $setup.Tab[2] } ]), onClick: _cache[2] || (_cache[2] = function($event) { return $setup.onTabClick(2); }) }, [ (0, _vue.createElementVNode)("ui-label", { color: "", value: "i18n:".concat($setup.MainName, ".translate.import_tab_title") }, null, 8, _hoisted_10) ], 2) ]), (0, _vue.createElementVNode)("div", _hoisted_11, [ (0, _vue.createElementVNode)("div", { ref: "translateTable", class: "table", tabindex: "1", scrollTop: $setup.translateScrollTop, onScroll: _cache[3] || (_cache[3] = //@ts-ignore function() { for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){ args[_key] = arguments[_key]; } return $setup.onTranslateScroll && (_$setup = $setup).onTranslateScroll.apply(_$setup, _to_consumable_array(args)); }), onClick: _cache[4] || (_cache[4] = function($event) { return $setup.isLockItem && $setup.clearSelected(); }) }, [ (0, _vue.createElementVNode)("div", _hoisted_13, [ (0, _vue.createElementVNode)("div", _hoisted_14, [ (0, _vue.createElementVNode)("div", _hoisted_15, [ (0, _vue.createElementVNode)("div", _hoisted_16, [ $setup.currentTab === 'imported' || !$setup.isSameLanguage ? ((0, _vue.openBlock)(), (0, _vue.createElementBlock)("ui-label", { key: 0, class: "weakWhite", value: $setup.localPanelTranslateData.displayName }, null, 8, _hoisted_17)) : $setup.isSameLanguage ? ((0, _vue.openBlock)(), (0, _vue.createElementBlock)("ui-label", { key: 1, class: "weakWhite", value: "i18n:".concat($setup.MainName, ".translate.key") }, null, 8, _hoisted_18)) : (0, _vue.createCommentVNode)("", true) ]) ]) ]), (0, _vue.createElementVNode)("div", _hoisted_19, [ (0, _vue.createElementVNode)("div", _hoisted_20, [ (0, _vue.createElementVNode)("div", _hoisted_21, [ $setup.currentTab === 'imported' || !$setup.isSameLanguage ? ((0, _vue.openBlock)(), (0, _vue.createElementBlock)("ui-label", { key: 0, class: "weakWhite", value: $setup.targetPanelTranslateData.displayName }, null, 8, _hoisted_22)) : $setup.isSameLanguage ? ((0, _vue.openBlock)(), (0, _vue.createElementBlock)("ui-label", { key: 1, class: "weakWhite", value: "i18n:".concat($setup.MainName, ".translate.origin") }, null, 8, _hoisted_23)) : (0, _vue.createCommentVNode)("", true) ]), (0, _vue.withDirectives)((0, _vue.createVNode)(_component_m_button, { color: 'blue', disabled: !$setup.hasTranslateProvider, onConfirm: $setup.onTranslateClick }, { default: (0, _vue.withCtx)(function() { return [ (0, _vue.createElementVNode)("ui-label", { color: "", value: "i18n:".concat($setup.MainName, ".translate.translate") }, null, 8, _hoisted_24) ]; }), _: 1 }, 8, [ "disabled", "onConfirm" ]), [ [ _vue.vShow, !$setup.isSameLanguage && $setup.currentTab === $setup.Tab[0] ] ]), (0, _vue.withDirectives)((0, _vue.createVNode)(_component_m_button, { color: 'blue', disabled: !$setup.isTargetTranslateDataHasEmptyMedia, onConfirm: $setup.onImportAllClick }, { default: (0, _vue.withCtx)(function() { return [ (0, _vue.createElementVNode)("ui-label", { color: "", value: "i18n:".concat($setup.MainName, ".translate.import_all") }, null, 8, _hoisted_25) ]; }), _: 1 }, 8, [ "disabled", "onConfirm" ]), [ [ _vue.vShow, $setup.currentTab === $setup.Tab[0] && !$setup.isSameLanguage ] ]) ]) ]) ]), (0, _vue.createElementVNode)("div", { style: (0, _vue.normalizeStyle)({ height: $setup.translateTotalHeight + 'px', paddingTop: $setup.translatePaddingTop + 'px' }) }, [ ((0, _vue.openBlock)(true), (0, _vue.createElementBlock)(_vue.Fragment, null, (0, _vue.renderList)($setup.translateVisibleItems, function(item) { return (0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", { key: item.key, class: "tr" }, [ (0, _vue.createElementVNode)("div", _hoisted_26, [ (0, _vue.createElementVNode)("div", null, [ (0, _vue.createVNode)(_component_m_input, { style: { "flex": "1" }, "is-textarea": true, "model-value": $setup.getDisplayNameOfLocalItem(item.key), readonly: true, onClick: function($event) { return $setup.onItemMouseDown(item, true); }, onBlur: $setup.onItemBlur }, null, 8, [ "model-value", "onClick", "onBlur" ]) ]) ]), (0, _vue.createElementVNode)("div", _hoisted_27, [ (0, _vue.createElementVNode)("div", _hoisted_28, [ (0, _vue.createVNode)(_component_m_input, { "is-textarea": true, "model-value": $setup.getDisplayNameOfTargetItem(item.key), readonly: $setup.isSameLanguage && item.type === $setup.TranslateItemType.Media, onBlur: $setup.onItemBlur, onClick: function($event) { return $setup.onItemMouseDown(item, false); }, "onUpdate:modelValue": function($event) { return $setup.onInputChanged(item.key, $event); } }, { default: (0, _vue.withCtx)(function() { return [ item.type === $setup.TranslateItemType.Media && !$setup.isSameLanguage ? ((0, _vue.openBlock)(), (0, _vue.createBlock)(_component_m_button, { key: 0, class: "import", color: 'blue', onConfirm: function($event) { return $setup.onImportClick(item.key); } }, { default: (0, _vue.withCtx)(function() { return [ (0, _vue.createElementVNode)("ui-label", { color: "", value: "i18n:".concat($setup.MainName, ".translate.import") }, null, 8, _hoisted_29) ]; }), _: 2 }, 1032, [ "onConfirm" ])) : (0, _vue.createCommentVNode)("", true), item.type !== $setup.TranslateItemType.Media ? ((0, _vue.openBlock)(), (0, _vue.createBlock)(_component_m_button, { key: 1, color: 'blue', disabled: $setup.isVariantsDisable(item.key), onConfirm: function($event) { return $setup.onVariantsClick(item.key); } }, { default: (0, _vue.withCtx)(function() { return [ (0, _vue.createElementVNode)("ui-label", { color: "", value: "i18n:".concat($setup.MainName, ".translate.variant") }, null, 8, _hoisted_30) ]; }), _: 2 }, 1032, [ "disabled", "onConfirm" ])) : (0, _vue.createCommentVNode)("", true) ]; }), _: 2 }, 1032, [ "model-value", "readonly", "onBlur", "onClick", "onUpdate:modelValue" ]) ]) ]) ]); }), 128)) ], 4) ], 40, _hoisted_12) ]) ]), (0, _vue.createElementVNode)("footer", { tabindex: "1", onMousedown: _cache[5] || (_cache[5] = //@ts-ignore function() { for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){ args[_key] = arguments[_key]; } return $setup.onCancelItemBlur && (_$setup1 = $setup).onCancelItemBlur.apply(_$setup1, _to_consumable_array(args)); }) }, [ (0, _vue.createElementVNode)("div", null, [ (0, _vue.createElementVNode)("ui-label", { class: "weakWhite", value: "i18n:".concat($setup.MainName, ".translate.key:") }, null, 8, _hoisted_31), (0, _vue.createElementVNode)("ui-label", { class: "selectable", value: ((_$setup_currentSelectedItem = $setup.currentSelectedItem) === null || _$setup_currentSelectedItem === void 0 ? void 0 : _$setup_currentSelectedItem.key) || '' }, null, 8, _hoisted_32) ]), (0, _vue.createElementVNode)("div", null, [ (0, _vue.createElementVNode)("ui-label", { class: "weakWhite", value: "i18n:".concat($setup.MainName, ".translate.position:") }, null, 8, _hoisted_33), ((0, _vue.openBlock)(true), (0, _vue.createElementBlock)(_vue.Fragment, null, (0, _vue.renderList)($setup.positionInfoOfAssociation, function(item) { return (0, _vue.openBlock)(), (0, _vue.createElementBlock)("ui-label", { key: item.__key, class: "selectable link", value: item.value.path, onClick: function($event) { return $setup.onPositionInfoClick(item.value.uuid); } }, null, 8, _hoisted_34); }), 128)) ]), (0, _vue.createElementVNode)("div", null, [ (0, _vue.createElementVNode)("ui-label", { class: "weakWhite", value: "i18n:".concat($setup.MainName, ".translate.reference_uuid") }, null, 8, _hoisted_35), ((0, _vue.openBlock)(true), (0, _vue.createElementBlock)(_vue.Fragment, null, (0, _vue.renderList)($setup.nodeUuidOfAssociation, function(item) { return (0, _vue.openBlock)(), (0, _vue.createElementBlock)("ui-label", { key: item.__key, class: "selectable", value: item.value }, null, 8, _hoisted_36); }), 128)) ]) ], 32), $setup.currentVariantsItem ? ((0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", _hoisted_37, [ (0, _vue.createElementVNode)("div", null, [ (0, _vue.createElementVNode)("div", _hoisted_38, [ (0, _vue.createElementVNode)("ui-label", { value: "i18n:".concat($setup.MainName, ".translate.variant") }, null, 8, _hoisted_39) ]), (0, _vue.createElementVNode)("div", _hoisted_40, [ (0, _vue.createElementVNode)("div", null, [ (0, _vue.createElementVNode)("div", { class: "table", onClick: _cache[6] || (_cache[6] = (0, _vue.withModifiers)(function() {}, [ "stop" ])) }, [ (0, _vue.createElementVNode)("div", _hoisted_41, [ (0, _vue.createElementVNode)("div", _hoisted_42, [ (0, _vue.createElementVNode)("div", _hoisted_43, [ (0, _vue.createElementVNode)("ui-label", { value: "i18n:".concat($setup.MainName, ".translate.standard"), class: "weakWhite" }, null, 8, _hoisted_44) ]) ]), (0, _vue.createElementVNode)("div", _hoisted_45, [ (0, _vue.createElementVNode)("div", _hoisted_46, [ (0, _vue.createElementVNode)("ui-label", { value: "i18n:".concat($setup.MainName, ".translate.after_variant"), class: "weakWhite", style: { "flex": "1" } }, null, 8, _hoisted_47) ]) ]) ]), ((0, _vue.openBlock)(true), (0, _vue.createElementBlock)(_vue.Fragment, null, (0, _vue.renderList)($setup.currentVariantsItem._variants, function(item, index) { return (0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", { key: item.key, class: "tr" }, [ (0, _vue.createElementVNode)("div", _hoisted_48, [ (0, _vue.createElementVNode)("div", null, [ (0, _vue.createVNode)(_component_m_input, { "model-value": $setup.variantKeys[index], readonly: true }, null, 8, [ "model-value" ]) ]) ]), (0, _vue.createElementVNode)("div", _hoisted_49, [ (0, _vue.createElementVNode)("div", _hoisted_50, [ (0, _vue.createVNode)(_component_m_input, { modelValue: item.value, "onUpdate:modelValue": function($event) { return item.value = $event; }, "is-textarea": true }, null, 8, [ "modelValue", "onUpdate:modelValue" ]) ]) ]) ]); }), 128)) ]) ]) ]), (0, _vue.createElementVNode)("div", _hoisted_51, [ (0, _vue.createElementVNode)("div", _hoisted_52, [ (0, _vue.createElementVNode)("div", _hoisted_53, [ (0, _vue.createVNode)(_component_m_button, { color: 'blue', disabled: $setup.isDeleteVariantsDisable, onConfirm: $setup.onVariantsDelete }, { default: (0, _vue.withCtx)(function() { return [ (0, _vue.createElementVNode)("ui-label", { color: "", value: "i18n:".concat($setup.MainName, ".translate.delete_variant") }, null, 8, _hoisted_54) ]; }), _: 1 }, 8, [ "disabled", "onConfirm" ]) ]), (0, _vue.createElementVNode)("div", null, [ (0, _vue.createVNode)(_component_m_button, { "has-border": true, onConfirm: $setup.onVariantsCancel }, { default: (0, _vue.withCtx)(function() { return [ (0, _vue.createElementVNode)("ui-label", { color: "", value: "i18n:".concat($setup.MainName, ".translate.cancel") }, null, 8, _hoisted_55) ]; }), _: 1 }, 8, [ "onConfirm" ]), (0, _vue.createVNode)(_component_m_button, { "has-border": true, style: { "margin-left": "16px" }, onConfirm: $setup.onVariantsConfirm }, { default: (0, _vue.withCtx)(function() { return [ (0, _vue.createElementVNode)("ui-label", { color: "", value: "i18n:".concat($setup.MainName, ".translate.confirm") }, null, 8, _hoisted_56) ]; }), _: 1 }, 8, [ "onConfirm" ]) ]) ]) ]) ]) ])) : (0, _vue.createCommentVNode)("", true), (0, _vue.withDirectives)((0, _vue.createElementVNode)("div", _hoisted_57, [ (0, _vue.createElementVNode)("div", _hoisted_58, [ (0, _vue.createElementVNode)("div", _hoisted_59, [ (0, _vue.createElementVNode)("ui-label", { value: "i18n:".concat($setup.MainName, ".translate.save") }, null, 8, _hoisted_60) ]), (0, _vue.createElementVNode)("div", _hoisted_61, [ (0, _vue.createElementVNode)("ui-label", { value: "i18n:".concat($setup.MainName, ".translate.conflict_dialog_content") }, null, 8, _hoisted_62), (0, _vue.createElementVNode)("div", null, [ (0, _vue.createElementVNode)("div", { ref: "conflictTable", class: "table", style: (0, _vue.normalizeStyle)({ height: $setup.conflictContainerHeight + 'px' }), onScroll: _cache[8] || (_cache[8] = //@ts-ignore function() { for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){ args[_key] = arguments[_key]; } return $setup.onConflictScroll && (_$setup2 = $setup).onConflictScroll.apply(_$setup2, _to_consumable_array(args)); }) }, [ (0, _vue.createElementVNode)("div", _hoisted_63, [ (0, _vue.createElementVNode)("div", _hoisted_64, [ (0, _vue.createElementVNode)("ui-checkbox", { value: $setup.isConflictSelectAll, onChange: _cache[7] || (_cache[7] = function($event) { return $setup.onConflictItemSelectAllClick($event.target.value); }) }, null, 40, _hoisted_65) ]), (0, _vue.createElementVNode)("div", _hoisted_66, [ (0, _vue.createElementVNode)("ui-label", { class: "weakWhite", value: "i18n:".concat($setup.MainName, ".translate.key") }, null, 8, _hoisted_67) ]), (0, _vue.createElementVNode)("div", _hoisted_68, [ (0, _vue.createElementVNode)("ui-label", { class: "weakWhite", value: "i18n:".concat($setup.MainName, ".translate.old_value") }, null, 8, _hoisted_69) ]), (0, _vue.createElementVNode)("div", _hoisted_70, [ (0, _vue.createElementVNode)("ui-label", { class: "weakWhite", value: "i18n:".concat($setup.MainName, ".translate.new_value") }, null, 8, _hoisted_71) ]) ]), (0, _vue.createElementVNode)("div", { style: (0, _vue.normalizeStyle)({ paddingTop: $setup.conflictPaddingTop + 'px', height: $setup.conflictTotalHeight + 'px' }) }, [ ((0, _vue.openBlock)(true), (0, _vue.createElementBlock)(_vue.Fragment, null, (0, _vue.renderList)($setup.conflictVisibleItems, function(item, index) { var _$setup_targetPanelTranslateData_items_item_key, _$setup_targetPanelTranslateData, _$setup_targetPanelTranslateData_items_item_key1, _$setup_targetPanelTranslateData1; var _$setup_targetPanelTranslateData_items_item_key_value, _$setup_targetPanelTranslateData_items_item_key_value1; return (0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", { key: item.key, class: "tr" }, [ (0, _vue.createElementVNode)("div", _hoisted_72, [ (0, _vue.createElementVNode)("ui-checkbox", { value: $setup.selectedConflictItemIndexSet.has(index), onChange: function($event) { return $setup.onConflictItemClick($event.target.value, index); } }, null, 40, _hoisted_73) ]), (0, _vue.createElementVNode)("div", _hoisted_74, [ (0, _vue.createElementVNode)("ui-label", { value: item.key, tooltip: item.key }, null, 8, _hoisted_75) ]), (0, _vue.createElementVNode)("div", _hoisted_76, [ (0, _vue.createElementVNode)("ui-label", { value: (_$setup_targetPanelTranslateData_items_item_key_value = (_$setup_targetPanelTranslateData = $setup.targetPanelTranslateData) === null || _$setup_targetPanelTranslateData === void 0 ? void 0 : (_$setup_targetPanelTranslateData_items_item_key = _$setup_targetPanelTranslateData.items[item.key]) === null || _$setup_targetPanelTranslateData_items_item_key === void 0 ? void 0 : _$setup_targetPanelTranslateData_items_item_key.value) !== null && _$setup_targetPanelTranslateData_items_item_key_value !== void 0 ? _$setup_targetPanelTranslateData_items_item_key_value : item.value, tooltip: (_$setup_targetPanelTranslateData_items_item_key_value1 = (_$setup_targetPanelTranslateData1 = $setup.targetPanelTranslateData) === null || _$setup_targetPanelTranslateData1 === void 0 ? void 0 : (_$setup_targetPanelTranslateData_items_item_key1 = _$setup_targetPanelTranslateData1.items[item.key]) === null || _$setup_targetPanelTranslateData_items_item_key1 === void 0 ? void 0 : _$setup_targetPanelTranslateData_items_item_key1.value) !== null && _$setup_targetPanelTranslateData_items_item_key_value1 !== void 0 ? _$setup_targetPanelTranslateData_items_item_key_value1 : item.value }, null, 8, _hoisted_77) ]), (0, _vue.createElementVNode)("div", _hoisted_78, [ (0, _vue.createElementVNode)("ui-label", { value: $setup.importedTranslateItemMap[item.key].value, tooltip: $setup.importedTranslateItemMap[item.key].value }, null, 8, _hoisted_79) ]) ]); }), 128)) ], 4) ], 36) ]) ]), (0, _vue.createElementVNode)("div", _hoisted_80, [ (0, _vue.createVNode)(_component_m_button, { "has-border": true, transparent: true, disabled: $setup.selectedConflictItemIndexSet.size === 0, onConfirm: $setup.onConflictConfirmClick }, { default: (0, _vue.withCtx)(function() { return [ (0, _vue.createElementVNode)("ui-label", { color: "", value: "i18n:".concat($setup.MainName, ".translate.cover") }, null, 8, _hoisted_81) ]; }), _: 1 }, 8, [ "disabled", "onConfirm" ]), (0, _vue.createVNode)(_component_m_button, { "has-border": true, transparent: true, onConfirm: $setup.onConflictCancelClick }, { default: (0, _vue.withCtx)(function() { return [ (0, _vue.createElementVNode)("ui-label", { color: "", value: "i18n:".concat($setup.MainName, ".translate.cancel") }, null, 8, _hoisted_82) ]; }), _: 1 }, 8, [ "onConfirm" ]) ]) ]) ], 512), [ [ _vue.vShow, $setup.conflictItemsBetweenImportedFilesAndTranslatedFiles.length ] ]), (0, _vue.withDirectives)((0, _vue.createElementVNode)("div", _hoisted_83, [ (0, _vue.createElementVNode)("div", _hoisted_84, [ (0, _vue.createElementVNode)("div", _hoisted_85, [ (0, _vue.createElementVNode)("ui-label", { value: "i18n:".concat($setup.MainName, ".translate.import_all") }, null, 8, _hoisted_86) ]), (0, _vue.createElementVNode)("div", _hoisted_87, [ (0, _vue.createElementVNode)("div", null, [ (0, _vue.createElementVNode)("div", _hoisted_88, [ (0, _vue.createElementVNode)("ui-label", { value: "i18n:".concat($setup.MainName, ".translate.source_string"), style: (0, _vue.normalizeStyle)({ 'min-width': $setup.isCN ? '60px' : '93px' }) }, null, 12, _hoisted_89), (0, _vue.createVNode)(_component_m_input, { modelValue: $setup.importAllFrom, "onUpdate:modelValue": _cache[9] || (_cache[9] = function($event) { return $setup.importAllFrom = $event; }), "place-holder": "i18n:".concat($setup.MainName, ".translate.source_string_placeholder"), class: "fill" }, null, 8, [ "modelValue", "place-holder" ]) ]), (0, _vue.createElementVNode)("div", _hoisted_90, [ (0, _vue.createElementVNode)("ui-label", { value: "i18n:".concat($setup.MainName, ".translate.dist_string"), style: (0, _vue.normalizeStyle)({ 'min-width': $setup.isCN ? '60px' : '93px' }) }, null, 12, _hoisted_91), (0, _vue.createVNode)(_component_m_input, { modelValue: $setup.importAllTo, "onUpdate:modelValue": _cache[10] || (_cache[10] = function($event) { return $setup.importAllTo = $event; }), class: "fill", "place-holder": "i18n:".concat($setup.MainName, ".translate.dist_string_placeholder") }, null, 8, [ "modelValue", "place-holder" ]) ]) ]) ]), (0, _vue.createElementVNode)("div", _hoisted_92, [ (0, _vue.createVNode)(_component_m_button, { "has-border": true, transparent: true, onConfirm: $setup.onImportAllConfirm }, { default: (0, _vue.withCtx)(function() { return [ (0, _vue.createElementVNode)("ui-label", { color: "", value: "i18n:".concat($setup.MainName, ".translate.confirm") }, null, 8, _hoisted_93) ]; }), _: 1 }, 8, [ "onConfirm" ]), (0, _vue.createVNode)(_component_m_button, { "has-border": true, transparent: true, onConfirm: $setup.onImportAllCancel }, { default: (0, _vue.withCtx)(function() { return [ (0, _vue.createElementVNode)("ui-label", { color: "", value: "i18n:".concat($setup.MainName, ".translate.cancel") }, null, 8, _hoisted_94) ]; }), _: 1 }, 8, [ "onConfirm" ]) ]) ]) ], 512), [ [ _vue.vShow, $setup.isShowImportAll ] ]), (0, _vue.withDirectives)((0, _vue.createElementVNode)("div", _hoisted_95, [ (0, _vue.createElementVNode)("div", _hoisted_96, [ (0, _vue.createElementVNode)("ui-label", { value: "i18n:".concat($setup.MainName, ".translate.saving_tips") }, null, 8, _hoisted_97), _cache[14] || (_cache[14] = (0, _vue.createElementVNode)("ui-loading", null, null, -1)) ]) ], 512), [ [ _vue.vShow, $setup.saving ] ]) ]); } /***/ }), /***/ "./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/share/ui/m-button.vue?vue&type=template&id=01e423b1&ts=true": /*!********************************************************************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/share/ui/m-button.vue?vue&type=template&id=01e423b1&ts=true ***! \********************************************************************************************************************************************************************************************************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "render", ({ enumerable: true, get: function() { return render; } })); var _vue = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.cjs.js"); var _hoisted_1 = [ "transparent", "border", "color", "disabled" ]; function render(_ctx, _cache, $props, $setup, $data, $options) { return (0, _vue.openBlock)(), (0, _vue.createElementBlock)("ui-button", { class: "button", transparent: $props.transparent, border: $props.hasBorder, color: $props.color, disabled: $props.disabled }, [ (0, _vue.renderSlot)(_ctx.$slots, "default") ], 8, _hoisted_1); } /***/ }), /***/ "./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/share/ui/m-file.vue?vue&type=template&id=7126b95b&ts=true": /*!******************************************************************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/share/ui/m-file.vue?vue&type=template&id=7126b95b&ts=true ***! \******************************************************************************************************************************************************************************************************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "render", ({ enumerable: true, get: function() { return render; } })); var _vue = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.cjs.js"); var _hoisted_1 = { class: "mFile" }; var _hoisted_2 = [ "tooltip" ]; var _hoisted_3 = { class: "label" }; function render(_ctx, _cache, $props, $setup, $data, $options) { var _component_m_input = (0, _vue.resolveComponent)("m-input"); return (0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", _hoisted_1, [ (0, _vue.withDirectives)((0, _vue.createElementVNode)("ui-prop", { style: { "width": "0px" }, tooltip: $options.tooltip }, [ (0, _vue.renderSlot)(_ctx.$slots, "icon", {}, function() { return [ _cache[0] || (_cache[0] = (0, _vue.createTextVNode)(" ! ")) ]; }) ], 8, _hoisted_2), [ [ _vue.vShow, $options.showIcon ] ]), (0, _vue.createElementVNode)("div", _hoisted_3, [ (0, _vue.renderSlot)(_ctx.$slots, "label") ]), (0, _vue.createVNode)(_component_m_input, { "no-vertical-padding": "", class: "mInput", placeholder: $props.placeholder, "model-value": $props.modelValue, onBlur: _ctx.onBlur, "onUpdate:modelValue": _ctx.onModelUpdate }, { default: (0, _vue.withCtx)(function() { return [ (0, _vue.renderSlot)(_ctx.$slots, "inputIcon") ]; }), _: 3 }, 8, [ "placeholder", "model-value", "onBlur", "onUpdate:modelValue" ]) ]); } /***/ }), /***/ "./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/share/ui/m-input.vue?vue&type=template&id=9a1792d6&ts=true": /*!*******************************************************************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/share/ui/m-input.vue?vue&type=template&id=9a1792d6&ts=true ***! \*******************************************************************************************************************************************************************************************************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "render", ({ enumerable: true, get: function() { return render; } })); var _vue = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.cjs.js"); function _array_like_to_array(arr, len) { if (len == null || len > arr.length) len = arr.length; for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i]; return arr2; } function _array_without_holes(arr) { if (Array.isArray(arr)) return _array_like_to_array(arr); } function _iterable_to_array(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _non_iterable_spread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _to_consumable_array(arr) { return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread(); } function _unsupported_iterable_to_array(o, minLen) { if (!o) return; if (typeof o === "string") return _array_like_to_array(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen); } var _hoisted_1 = [ "readonly", "isSelected", "error", "isEditing", "disabled" ]; var _hoisted_2 = [ "placeholder", "value", "readonly", "type" ]; var _hoisted_3 = [ "placeholder", "value", "readonly", "type" ]; var _hoisted_4 = { class: "icon" }; function render(_ctx, _cache, $props, $setup, $data, $options) { var _$_ctx, _$_ctx1, _$_ctx2, _$_ctx3, _$_ctx4, _$_ctx5, _$_ctx6, _$_ctx7, _$_ctx8; return (0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", { class: "mInput", readonly: _ctx.isReadOnly, tabindex: "0", isSelected: _ctx.isSelected, error: $props.error, isEditing: _ctx.isEditing, disabled: $props.disabled, onBlur: _cache[6] || (_cache[6] = //@ts-ignore function() { for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){ args[_key] = arguments[_key]; } return _ctx.onBlur && (_$_ctx = _ctx).onBlur.apply(_$_ctx, _to_consumable_array(args)); }), onFocus: _cache[7] || (_cache[7] = //@ts-ignore function() { for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){ args[_key] = arguments[_key]; } return _ctx.onFocus && (_$_ctx1 = _ctx).onFocus.apply(_$_ctx1, _to_consumable_array(args)); }), onClick: _cache[8] || (_cache[8] = //@ts-ignore function() { for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){ args[_key] = arguments[_key]; } return _ctx.onClick && (_$_ctx2 = _ctx).onClick.apply(_$_ctx2, _to_consumable_array(args)); }) }, [ (0, _vue.withDirectives)((0, _vue.createElementVNode)("input", { ref: "inputElement", placeholder: _ctx.translatedPlaceHolder, value: $props.modelValue, readonly: _ctx.isReadOnly, type: $props.type, onInput: _cache[0] || (_cache[0] = //@ts-ignore function() { for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){ args[_key] = arguments[_key]; } return _ctx.onInput && (_$_ctx3 = _ctx).onInput.apply(_$_ctx3, _to_consumable_array(args)); }), onFocus: _cache[1] || (_cache[1] = //@ts-ignore function() { for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){ args[_key] = arguments[_key]; } return _ctx.onFocus && (_$_ctx4 = _ctx).onFocus.apply(_$_ctx4, _to_consumable_array(args)); }), onBlur: _cache[2] || (_cache[2] = //@ts-ignore function() { for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){ args[_key] = arguments[_key]; } return _ctx.onBlur && (_$_ctx5 = _ctx).onBlur.apply(_$_ctx5, _to_consumable_array(args)); }) }, null, 40, _hoisted_2), [ [ _vue.vShow, !$props.isTextarea ] ]), (0, _vue.withDirectives)((0, _vue.createElementVNode)("textarea", { ref: "textareaElement", placeholder: _ctx.translatedPlaceHolder, value: $props.modelValue, rows: "1", readonly: _ctx.isReadOnly, type: $props.type, onFocus: _cache[3] || (_cache[3] = //@ts-ignore function() { for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){ args[_key] = arguments[_key]; } return _ctx.onFocus && (_$_ctx6 = _ctx).onFocus.apply(_$_ctx6, _to_consumable_array(args)); }), onInput: _cache[4] || (_cache[4] = //@ts-ignore function() { for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){ args[_key] = arguments[_key]; } return _ctx.onInput && (_$_ctx7 = _ctx).onInput.apply(_$_ctx7, _to_consumable_array(args)); }), onBlur: _cache[5] || (_cache[5] = //@ts-ignore function() { for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){ args[_key] = arguments[_key]; } return _ctx.onBlur && (_$_ctx8 = _ctx).onBlur.apply(_$_ctx8, _to_consumable_array(args)); }) }, " ", 40, _hoisted_3), [ [ _vue.vShow, $props.isTextarea ] ]), (0, _vue.createElementVNode)("div", _hoisted_4, [ (0, _vue.renderSlot)(_ctx.$slots, "default") ]) ], 40, _hoisted_1); } /***/ }), /***/ "./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/share/ui/m-menu.vue?vue&type=template&id=00a526aa&ts=true": /*!******************************************************************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/share/ui/m-menu.vue?vue&type=template&id=00a526aa&ts=true ***! \******************************************************************************************************************************************************************************************************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "render", ({ enumerable: true, get: function() { return render; } })); var _vue = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.cjs.js"); var _hoisted_1 = [ "onClick" ]; var _hoisted_2 = [ "value" ]; function render(_ctx, _cache, $props, $setup, $data, $options) { return (0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", { ref: "root", class: "mMenu", style: (0, _vue.normalizeStyle)({ left: $props.x + 'px', top: $props.y + 'px' }) }, [ ((0, _vue.openBlock)(true), (0, _vue.createElementBlock)(_vue.Fragment, null, (0, _vue.renderList)($props.menus, function(menu) { return (0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", { key: menu.label, onClick: function($event) { return $setup.onClick(menu); } }, [ (0, _vue.createElementVNode)("ui-label", { value: menu.label }, null, 8, _hoisted_2) ], 8, _hoisted_1); }), 128)) ], 4); } /***/ }), /***/ "./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/share/ui/m-process.vue?vue&type=template&id=6dcd75ec&scoped=true&ts=true": /*!*********************************************************************************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/share/ui/m-process.vue?vue&type=template&id=6dcd75ec&scoped=true&ts=true ***! \*********************************************************************************************************************************************************************************************************************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "render", ({ enumerable: true, get: function() { return render; } })); var _vue = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.cjs.js"); var _hoisted_1 = { class: "mProcess" }; var _hoisted_2 = [ "color" ]; function render(_ctx, _cache, $props, $setup, $data, $options) { return (0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", _hoisted_1, [ (0, _vue.createElementVNode)("div", { class: "content", style: (0, _vue.normalizeStyle)({ width: $props.value * 100 + '%' }), color: $props.color }, null, 12, _hoisted_2) ]); } /***/ }), /***/ "./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/share/ui/m-section.vue?vue&type=template&id=1ec691a4&ts=true": /*!*********************************************************************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/share/ui/m-section.vue?vue&type=template&id=1ec691a4&ts=true ***! \*********************************************************************************************************************************************************************************************************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "render", ({ enumerable: true, get: function() { return render; } })); var _vue = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.cjs.js"); function _array_like_to_array(arr, len) { if (len == null || len > arr.length) len = arr.length; for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i]; return arr2; } function _array_without_holes(arr) { if (Array.isArray(arr)) return _array_like_to_array(arr); } function _iterable_to_array(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _non_iterable_spread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _to_consumable_array(arr) { return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread(); } function _unsupported_iterable_to_array(o, minLen) { if (!o) return; if (typeof o === "string") return _array_like_to_array(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen); } var _hoisted_1 = { class: "mSection" }; var _hoisted_2 = { class: "content" }; function render(_ctx, _cache, $props, $setup, $data, $options) { var _$setup; var _component_m_icon = (0, _vue.resolveComponent)("m-icon"); return (0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", _hoisted_1, [ (0, _vue.createElementVNode)("div", { class: "header", onClick: _cache[0] || (_cache[0] = //@ts-ignore function() { for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){ args[_key] = arguments[_key]; } return $setup.clickIcon && (_$setup = $setup).clickIcon.apply(_$setup, _to_consumable_array(args)); }) }, [ (0, _vue.createVNode)(_component_m_icon, { style: { "margin-right": "2px" }, class: "icon", background: false, value: 'arrow-triangle', "upside-down": $props.modelValue }, null, 8, [ "upside-down" ]), (0, _vue.renderSlot)(_ctx.$slots, "header") ]), (0, _vue.withDirectives)((0, _vue.createElementVNode)("div", _hoisted_2, [ (0, _vue.renderSlot)(_ctx.$slots, "content") ], 512), [ [ _vue.vShow, $props.modelValue ] ]) ]); } /***/ }), /***/ "./src/lib/core/container-registry.ts": /*!********************************************!*\ !*** ./src/lib/core/container-registry.ts ***! \********************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); var _path = __webpack_require__(/*! path */ "path"); var _tsyringe = __webpack_require__(/*! tsyringe */ "./node_modules/tsyringe/dist/esm5/index.js"); var _POWriter = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ./writer/POWriter */ "./src/lib/core/writer/POWriter.ts")); var _CSVWriter = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ./writer/CSVWriter */ "./src/lib/core/writer/CSVWriter.ts")); var _XLSXWriter = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ./writer/XLSXWriter */ "./src/lib/core/writer/XLSXWriter.ts")); var _POReader = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ./reader/POReader */ "./src/lib/core/reader/POReader.ts")); var _CSVReader = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ./reader/CSVReader */ "./src/lib/core/reader/CSVReader.ts")); var _fsextra = __webpack_require__(/*! fs-extra */ "./node_modules/fs-extra/lib/index.js"); var _YouDaoRepository = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ./repository/translate/YouDaoRepository */ "./src/lib/core/repository/translate/YouDaoRepository.ts")); var _XLSXReader = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ./reader/XLSXReader */ "./src/lib/core/reader/XLSXReader.ts")); function _interop_require_default(obj) { return obj && obj.__esModule ? obj : { default: obj }; } _tsyringe.container.register('PluralRules', { useValue: function() { return (0, _fsextra.readJSONSync)((0, _path.join)(__dirname, '..', '..', 'static', 'plural-rules', 'plural-rules.json')); }() }); _tsyringe.container.register('Writer', { useClass: _POWriter.default }); _tsyringe.container.register('Writer', { useClass: _CSVWriter.default }); _tsyringe.container.register('Writer', { useClass: _XLSXWriter.default }); _tsyringe.container.register('Reader', { useClass: _POReader.default }); _tsyringe.container.register('Reader', { useClass: _CSVReader.default }); _tsyringe.container.register('Reader', { useClass: _XLSXReader.default }); _tsyringe.container.register('TranslateRepository', { useClass: _YouDaoRepository.default }); /***/ }), /***/ "./src/lib/core/entity/config/TranslateProviderConfig.ts": /*!***************************************************************!*\ !*** ./src/lib/core/entity/config/TranslateProviderConfig.ts ***! \***************************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "default", ({ enumerable: true, get: function() { return TranslateProviderConfig; } })); function _class_call_check(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for(var i = 0; i < props.length; i++){ var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _create_class(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _define_property(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var TranslateProviderConfig = /*#__PURE__*/ function() { "use strict"; function TranslateProviderConfig(name, url, appKey, appSecret, qps) { _class_call_check(this, TranslateProviderConfig); _define_property(this, "name", void 0); _define_property(this, "url", void 0); _define_property(this, "appKey", void 0); _define_property(this, "appSecret", void 0); _define_property(this, "qps", void 0); this.name = name; this.url = url; this.appKey = appKey; this.appSecret = appSecret; this.qps = qps; } _create_class(TranslateProviderConfig, [ { key: "clone", value: function clone() { return new TranslateProviderConfig(this.name, this.url, this.appKey, this.appSecret, this.qps); } } ], [ { key: "parse", value: function parse(config) { return new TranslateProviderConfig(config.name, config.url, config.appKey, config.appSecret, config.qps); } } ]); return TranslateProviderConfig; }(); /***/ }), /***/ "./src/lib/core/entity/gettext/PoHeader.ts": /*!*************************************************!*\ !*** ./src/lib/core/entity/gettext/PoHeader.ts ***! \*************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "default", ({ enumerable: true, get: function() { return PoHeader; } })); function _class_call_check(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _define_property(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var PoHeader = function PoHeader(language, languageTeam, lastTranslator, poRevisionDate, potCreationDate, pluralForms, projectIdVersion) { "use strict"; _class_call_check(this, PoHeader); _define_property(this, 'Content-Transfer-Encoding', '8bit'); _define_property(this, 'Content-Type', 'text/plain; charset=UTF-8'); _define_property(this, 'MIME-Version', '1.0'); _define_property(this, 'Language-Team', void 0); _define_property(this, 'Last-Translator', void 0); _define_property(this, 'PO-Revision-Date', void 0); _define_property(this, 'POT-Creation-Date', void 0); _define_property(this, 'Plural-Forms', void 0); _define_property(this, 'Project-Id-Version', void 0); _define_property(this, 'Language', void 0); this['Language'] = language; this['Language-Team'] = languageTeam; this['Last-Translator'] = lastTranslator; this['PO-Revision-Date'] = poRevisionDate; this['POT-Creation-Date'] = potCreationDate; this['Plural-Forms'] = pluralForms; this['Project-Id-Version'] = projectIdVersion; }; /***/ }), /***/ "./src/lib/core/entity/messages/MainMessage.ts": /*!*****************************************************!*\ !*** ./src/lib/core/entity/messages/MainMessage.ts ***! \*****************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); function _export(target, all) { for(var name in all)Object.defineProperty(target, name, { enumerable: true, get: all[name] }); } _export(exports, { MessageCode: function() { return MessageCode; }, MessageMap: function() { return MessageMap; } }); var _global = __webpack_require__(/*! ../../service/util/global */ "./src/lib/core/service/util/global.ts"); var MessageCode = /*#__PURE__*/ function(MessageCode) { MessageCode[MessageCode["SUCCESS"] = 200] = "SUCCESS"; // 编辑器问题3xx MessageCode[MessageCode["EDITOR_DIRTY"] = 300] = "EDITOR_DIRTY"; // 插件前端请求参数问题4xx MessageCode[MessageCode["TRANSLATE_API_ERROR"] = 400] = "TRANSLATE_API_ERROR"; MessageCode[MessageCode["UNKNOWN_FILE_TYPE"] = 401] = "UNKNOWN_FILE_TYPE"; MessageCode[MessageCode["VARIANT_NOT_FOUND"] = 402] = "VARIANT_NOT_FOUND"; MessageCode[MessageCode["TARGET_TRANSLATE_DATA_NOT_FOUND"] = 403] = "TARGET_TRANSLATE_DATA_NOT_FOUND"; MessageCode[MessageCode["TARGET_TRANSLATE_DATA_EXIST"] = 404] = "TARGET_TRANSLATE_DATA_EXIST"; MessageCode[MessageCode["LOCAL_LANGUAGE_NOT_SET"] = 405] = "LOCAL_LANGUAGE_NOT_SET"; MessageCode[MessageCode["TRANSLATE_PROVIDER_CONFIG_NOT_FOUND"] = 406] = "TRANSLATE_PROVIDER_CONFIG_NOT_FOUND"; MessageCode[MessageCode["PROVIDER_TAG_NOT_FOUND"] = 407] = "PROVIDER_TAG_NOT_FOUND"; MessageCode[MessageCode["TRANSLATE_ITEM_NOT_FOUND"] = 408] = "TRANSLATE_ITEM_NOT_FOUND"; MessageCode[MessageCode["SCAN_OPTION_EMPTY"] = 409] = "SCAN_OPTION_EMPTY"; MessageCode[MessageCode["PROVIDER_INPUT_ERROR"] = 410] = "PROVIDER_INPUT_ERROR"; MessageCode[MessageCode["AUTO_TRANSLATE_NETWORK_ERROR"] = 411] = "AUTO_TRANSLATE_NETWORK_ERROR"; MessageCode[MessageCode["PO_FILE_LANGUAGE_NOT_EQUAL"] = 412] = "PO_FILE_LANGUAGE_NOT_EQUAL"; MessageCode[MessageCode["UNAVAILABLE_CSV_FILE"] = 413] = "UNAVAILABLE_CSV_FILE"; MessageCode[MessageCode["UNAVAILABLE_XLSX_FILE"] = 414] = "UNAVAILABLE_XLSX_FILE"; // 插件后端问题5xx MessageCode[MessageCode["UNKNOWN_ERROR"] = 500] = "UNKNOWN_ERROR"; MessageCode[MessageCode["MERGE_DIFFERENT_KEY"] = 501] = "MERGE_DIFFERENT_KEY"; MessageCode[MessageCode["INDEX_TRANSLATE_DATA_NOT_FOUND"] = 502] = "INDEX_TRANSLATE_DATA_NOT_FOUND"; MessageCode[MessageCode["SCENE_ERROR"] = 503] = "SCENE_ERROR"; MessageCode[MessageCode["INVALID_TRANSLATE_DATA"] = 504] = "INVALID_TRANSLATE_DATA"; MessageCode[MessageCode["INVALID_TRANSLATE_FILE_CONTENT"] = 505] = "INVALID_TRANSLATE_FILE_CONTENT"; return MessageCode; }({}); var MessageMap = new Map([ [ 200, function() { return ''; } ], [ 300, function() { return Editor.I18n.t(_global.MainName + '.error.editor_dirty'); } ], [ 400, function() { return Editor.I18n.t(_global.MainName + '.error.editor_dirty'); } ], [ 401, function() { return Editor.I18n.t(_global.MainName + '.error.unknown_file_type'); } ], [ 403, function() { return Editor.I18n.t(_global.MainName + '.error.target_translate_data_not_found'); } ], [ 404, function() { return Editor.I18n.t(_global.MainName + '.error.target_translate_data_exist'); } ], [ 405, function() { return Editor.I18n.t(_global.MainName + '.error.local_language_not_set'); } ], [ 406, function() { return Editor.I18n.t(_global.MainName + '.error.tanslate_provider_config_not_found'); } ], [ 407, function() { return Editor.I18n.t(_global.MainName + '.error.provider_tag_not_found'); } ], [ 408, function() { return Editor.I18n.t(_global.MainName + '.error.translate_item_not_found'); } ], [ 409, function() { return Editor.I18n.t(_global.MainName + '.error.scan_option_empty'); } ], [ 410, function() { return Editor.I18n.t(_global.MainName + '.error.provider_input_error'); } ], [ 411, function() { return Editor.I18n.t(_global.MainName + '.error.auto_translate_network_error'); } ], [ 412, function() { return Editor.I18n.t(_global.MainName + '.error.po_file_language_not_equal'); } ], [ 413, function() { return Editor.I18n.t(_global.MainName + '.error.unavailable_csv_file'); } ], [ 414, function() { return Editor.I18n.t(_global.MainName + '.error.unavailable_xlsx_file'); } ], [ 500, function() { return Editor.I18n.t(_global.MainName + '.error.unknown_error'); } ], [ 501, function() { return Editor.I18n.t(_global.MainName + '.error.merge_different_key'); } ], [ 502, function() { return Editor.I18n.t(_global.MainName + '.error.index_translate_data_not_found'); } ], [ 503, function() { return Editor.I18n.t(_global.MainName + '.error.scene_error'); } ], [ 504, function() { return Editor.I18n.t(_global.MainName + '.error.invalid_translate_data'); } ], [ 505, function() { return Editor.I18n.t(_global.MainName + '.error.invalid_translate_file_content'); } ] ]); /***/ }), /***/ "./src/lib/core/entity/translate/Association.ts": /*!******************************************************!*\ !*** ./src/lib/core/entity/translate/Association.ts ***! \******************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "default", ({ enumerable: true, get: function() { return Association; } })); function _class_call_check(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for(var i = 0; i < props.length; i++){ var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _create_class(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _define_property(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var Association = /*#__PURE__*/ function() { "use strict"; function Association(/* 引用的场景的 uuid */ sceneUuid, /* 引用的节点的 uuid */ nodeUuid, /* 文件路径 */ reference) { _class_call_check(this, Association); _define_property(this, "sceneUuid", void 0); _define_property(this, "nodeUuid", void 0); _define_property(this, "reference", void 0); this.sceneUuid = sceneUuid; this.nodeUuid = nodeUuid; this.reference = reference; } _create_class(Association, [ { key: "clone", value: function clone() { return new Association(this.sceneUuid, this.nodeUuid, this.reference); } }, { key: "equals", value: function equals(association) { return association.sceneUuid === this.sceneUuid && association.nodeUuid === this.nodeUuid && association.reference === this.reference; } } ], [ { key: "create", value: function create(option) { return new Association(option.sceneUuid, option.nodeUuid, option.reference); } }, { key: "parse", value: function parse(association) { return new Association(association.sceneUuid, association.nodeUuid, association.reference); } } ]); return Association; }(); /***/ }), /***/ "./src/lib/core/entity/translate/LanguageConfig.ts": /*!*********************************************************!*\ !*** ./src/lib/core/entity/translate/LanguageConfig.ts ***! \*********************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "default", ({ enumerable: true, get: function() { return LanguageConfig; } })); function _class_call_check(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for(var i = 0; i < props.length; i++){ var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _create_class(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _define_property(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var LanguageConfig = /*#__PURE__*/ function() { "use strict"; function LanguageConfig(bcp47Tag, providerTag) { var translateFinished = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0, translateTotal = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 0, compileFinished = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : 0, compileTotal = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : 0; _class_call_check(this, LanguageConfig); _define_property(this, "bcp47Tag", void 0); _define_property(this, "providerTag", void 0); _define_property(this, "translateFinished", void 0); _define_property(this, "translateTotal", void 0); _define_property(this, "compileFinished", void 0); _define_property(this, "compileTotal", void 0); this.bcp47Tag = bcp47Tag; this.providerTag = providerTag; this.translateFinished = translateFinished; this.translateTotal = translateTotal; this.compileFinished = compileFinished; this.compileTotal = compileTotal; } _create_class(LanguageConfig, [ { key: "equals", value: function equals(other) { return this.bcp47Tag === other.bcp47Tag && this.providerTag === other.providerTag && this.translateFinished === other.translateFinished && this.translateTotal === other.translateTotal && this.compileFinished === other.compileFinished && this.compileTotal === other.compileTotal; } }, { key: "assign", value: function assign(other) { this.bcp47Tag = other.bcp47Tag; this.providerTag = other.providerTag; this.translateFinished = other.translateFinished; this.translateTotal = other.translateTotal; this.compileFinished = other.compileFinished; this.compileTotal = other.compileTotal; } }, { key: "clone", value: function clone() { return new LanguageConfig(this.bcp47Tag, this.providerTag, this.translateFinished, this.translateTotal, this.compileFinished, this.compileTotal); } } ], [ { key: "parse", value: function parse(config) { return new LanguageConfig(config.bcp47Tag, config.providerTag, config.translateFinished, config.translateTotal, config.compileFinished, config.compileTotal); } } ]); return LanguageConfig; }(); /***/ }), /***/ "./src/lib/core/entity/translate/TranslateData.ts": /*!********************************************************!*\ !*** ./src/lib/core/entity/translate/TranslateData.ts ***! \********************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "default", ({ enumerable: true, get: function() { return TranslateData; } })); __webpack_require__(/*! reflect-metadata */ "./node_modules/reflect-metadata/Reflect.js"); var _LanguageConfig = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ./LanguageConfig */ "./src/lib/core/entity/translate/LanguageConfig.ts")); var _TranslateItem = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ./TranslateItem */ "./src/lib/core/entity/translate/TranslateItem.ts")); var _TranslateItemType = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ./TranslateItemType */ "./src/lib/core/entity/translate/TranslateItemType.ts")); function _array_like_to_array(arr, len) { if (len == null || len > arr.length) len = arr.length; for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i]; return arr2; } function _array_with_holes(arr) { if (Array.isArray(arr)) return arr; } function _class_call_check(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for(var i = 0; i < props.length; i++){ var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _create_class(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _define_property(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _interop_require_default(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _iterable_to_array_limit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){ _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally{ try { if (!_n && _i["return"] != null) _i["return"](); } finally{ if (_d) throw _e; } } return _arr; } function _non_iterable_rest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _sliced_to_array(arr, i) { return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest(); } function _unsupported_iterable_to_array(o, minLen) { if (!o) return; if (typeof o === "string") return _array_like_to_array(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen); } var TranslateData = /*#__PURE__*/ function() { "use strict"; function TranslateData() { var locale = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : TranslateData.INDEX_LOCALE; _class_call_check(this, TranslateData); _define_property(this, "locale", void 0); _define_property(this, "items", void 0); _define_property(this, "languageConfig", void 0); this.locale = locale; this.items = new Map(); this.languageConfig = new _LanguageConfig.default(locale); } _create_class(TranslateData, [ { key: "clone", value: function clone() { var result = new TranslateData(this.locale); result.languageConfig = this.languageConfig.clone(); var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined; try { for(var _iterator = this.items.entries()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){ var _step_value = _sliced_to_array(_step.value, 2), key = _step_value[0], value = _step_value[1]; result.items.set(key, value.clone()); } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally{ try { if (!_iteratorNormalCompletion && _iterator.return != null) { _iterator.return(); } } finally{ if (_didIteratorError) { throw _iteratorError; } } } return result; } }, { key: "toObject", value: function toObject() { return { locale: this.locale, languageConfig: this.languageConfig, items: Object.fromEntries(this.items) }; } }, { key: "transformToValueMap", value: function transformToValueMap() { var valueMap = new Map(); var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined; try { for(var _iterator = this.items.values()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){ var item = _step.value; if (item.type !== _TranslateItemType.default.Media && item.value.length > 0) { valueMap.set(item.value, item); } } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally{ try { if (!_iteratorNormalCompletion && _iterator.return != null) { _iterator.return(); } } finally{ if (_didIteratorError) { throw _iteratorError; } } } return valueMap; } }, { key: "statisticsFinished", value: function statisticsFinished(localLanguageData) { var translateFinished = 0; var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined; try { for(var _iterator = localLanguageData.items.entries()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){ var _step_value = _sliced_to_array(_step.value, 2), key = _step_value[0], value = _step_value[1]; if (this.items.has(key)) { translateFinished += value.length; } } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally{ try { if (!_iteratorNormalCompletion && _iterator.return != null) { _iterator.return(); } } finally{ if (_didIteratorError) { throw _iteratorError; } } } this.languageConfig.translateFinished = translateFinished; return translateFinished; } }, { key: "statisticsTotal", value: function statisticsTotal() { var translateTotal = 0; this.items.forEach(function(item) { translateTotal += item.length; }); this.languageConfig.compileTotal = this.items.size; this.languageConfig.translateTotal = translateTotal; } } ], [ { key: "parse", value: function parse(data) { var result = new TranslateData(data.locale); if (data.languageConfig) { result.languageConfig = _LanguageConfig.default.parse(data.languageConfig); } if (Array.isArray(data.items)) { var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined; try { // items 是 Map,存的时候,需要转成数组 for(var _iterator = data.items[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){ var item = _step.value; result.items.set(item[0], _TranslateItem.default.parse(item[1])); } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally{ try { if (!_iteratorNormalCompletion && _iterator.return != null) { _iterator.return(); } } finally{ if (_didIteratorError) { throw _iteratorError; } } } } else { for(var key in data.items){ // @ts-ignore var value = data.items[key]; result.items.set(key, _TranslateItem.default.parse(value)); } } return result; } }, { key: "fromObject", value: function fromObject(data) { return TranslateData.parse(data); } } ]); return TranslateData; }(); _define_property(TranslateData, "INDEX_LOCALE", 'index'); /***/ }), /***/ "./src/lib/core/entity/translate/TranslateItem.ts": /*!********************************************************!*\ !*** ./src/lib/core/entity/translate/TranslateItem.ts ***! \********************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "default", ({ enumerable: true, get: function() { return TranslateItem; } })); var _Association = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ./Association */ "./src/lib/core/entity/translate/Association.ts")); var _TranslateItemType = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ./TranslateItemType */ "./src/lib/core/entity/translate/TranslateItemType.ts")); var _cryptojs = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! crypto-js */ "./node_modules/crypto-js/index.js")); function _class_call_check(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for(var i = 0; i < props.length; i++){ var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _create_class(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _define_property(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _interop_require_default(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var TranslateItem = /*#__PURE__*/ function() { "use strict"; function TranslateItem(key, value, type) { var isVariant = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false, associations = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : [], _variants = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : []; _class_call_check(this, TranslateItem); _define_property(this, "key", void 0); _define_property(this, "value", void 0); _define_property(this, "type", void 0); _define_property(this, "isVariant", void 0); _define_property(this, "associations", void 0); _define_property(this, "_variants", void 0); this.key = key; this.value = value; this.type = type; this.isVariant = isVariant; this.associations = associations; this._variants = _variants; // 检查是否为字符串类型,如果不是则转换为字符串 if (typeof key !== 'string') { this.key = key + ''; } if (typeof value !== 'string') { this.value = value + ''; } } _create_class(TranslateItem, [ { key: "variants", get: function get() { return this._variants; } }, { key: "addVariant", value: function addVariant(variant) { variant.isVariant = true; this._variants.push(variant); return this; } }, { key: "clone", value: function clone() { var newItem = new TranslateItem(this.key, this.value, this.type); newItem.isVariant = this.isVariant; newItem._variants = this._variants.map(function(variant) { return variant.clone(); }); newItem.associations = this.associations.map(function(association) { return association.clone(); }); return newItem; } }, { key: "clearValue", value: function clearValue() { this.value = ''; return this; } }, { key: "clearAssociation", value: function clearAssociation() { this.associations.length = 0; return this; } }, { key: "clearVariant", value: function clearVariant() { this._variants.length = 0; return this; } }, { key: "removeAssociation", value: function removeAssociation(index) { var associationIndex; if (typeof index === 'number') { associationIndex = index; } else { associationIndex = this.associations.findIndex(function(it) { return it.equals(index); }); } var result = this.associations[associationIndex]; for(var i = associationIndex + 1; i < this.associations.length; i++){ this.associations[i - 1] = this.associations[i]; } if (this.associations.length > 0) { this.associations.length -= 1; } return result; } }, { key: "equals", value: function equals(value) { return this.key === value.key && this.value === value.value && this.type === value.type && this.isVariant === value.isVariant && this.associations.length === value.associations.length && this._variants.length === value._variants.length; } }, { key: "merge", value: function merge(value) { var _ref = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, _ref_replaceVariant = _ref.replaceVariant, replaceVariant = _ref_replaceVariant === void 0 ? false : _ref_replaceVariant, _ref_replaceValue = _ref.replaceValue, replaceValue = _ref_replaceValue === void 0 ? true : _ref_replaceValue, _ref_replaceKey = _ref.replaceKey, replaceKey = _ref_replaceKey === void 0 ? false : _ref_replaceKey, _ref_replaceAssociation = _ref.replaceAssociation, replaceAssociation = _ref_replaceAssociation === void 0 ? false : _ref_replaceAssociation; if (replaceKey) { this.key = value.key; } if (replaceValue) { this.value = value.value; } if (this.type === _TranslateItemType.default.Media) { // clear associations this.associations.length = 0; } if (replaceAssociation) { this.associations = value.associations; } else { var associationKeys = new Set(this.associations.map(function(association) { return JSON.stringify(association); })); var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined; try { for(var _iterator = value.associations[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){ var association = _step.value; if (associationKeys.has(JSON.stringify(association))) { continue; } this.associations.push(association); } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally{ try { if (!_iteratorNormalCompletion && _iterator.return != null) { _iterator.return(); } } finally{ if (_didIteratorError) { throw _iteratorError; } } } } if (replaceVariant) { this._variants = value._variants; } else { var variantKeys = new Set(this._variants.map(function(variant) { return JSON.stringify(variant); })); var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined; try { for(var _iterator1 = value._variants[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){ var variant = _step1.value; if (variantKeys.has(JSON.stringify(variant))) { continue; } this._variants.push(variant); } } catch (err) { _didIteratorError1 = true; _iteratorError1 = err; } finally{ try { if (!_iteratorNormalCompletion1 && _iterator1.return != null) { _iterator1.return(); } } finally{ if (_didIteratorError1) { throw _iteratorError1; } } } } return this; } }, { key: "length", get: function get() { switch(this.type){ case _TranslateItemType.default.Text: case _TranslateItemType.default.Script: return this.value.length; case _TranslateItemType.default.Media: return 1; default: return 0; } } }, { key: "base64Encode", value: function base64Encode() { var str = JSON.stringify(this); var encodedWord = _cryptojs.default.enc.Utf8.parse(str); return _cryptojs.default.enc.Base64.stringify(encodedWord); } } ], [ { key: "parse", value: function parse(value) { return new TranslateItem(value.key, value.value, value.type, value.isVariant, value.associations.map(function(association) { return _Association.default.parse(association); }), value._variants.map(function(variant) { return TranslateItem.parse(variant); })); } }, { key: "base64Decode", value: function base64Decode(encoded) { var decodedWord = _cryptojs.default.enc.Base64.parse(encoded); var decoded = _cryptojs.default.enc.Utf8.stringify(decodedWord); try { return TranslateItem.parse(JSON.parse(decoded)); } catch (e) { return undefined; } } } ]); return TranslateItem; }(); /***/ }), /***/ "./src/lib/core/entity/translate/TranslateItemType.ts": /*!************************************************************!*\ !*** ./src/lib/core/entity/translate/TranslateItemType.ts ***! \************************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "default", ({ enumerable: true, get: function() { return _default; } })); var TranslateItemType = /*#__PURE__*/ function(TranslateItemType) { TranslateItemType[TranslateItemType["Script"] = 0] = "Script"; TranslateItemType[TranslateItemType["Media"] = 1] = "Media"; TranslateItemType[TranslateItemType["Text"] = 2] = "Text"; TranslateItemType[TranslateItemType["Font"] = 3] = "Font"; TranslateItemType[TranslateItemType["External"] = 4] = "External"; return TranslateItemType; }(TranslateItemType || {}); var _default = TranslateItemType; /***/ }), /***/ "./src/lib/core/entity/translate/WrapperTranslateItem.ts": /*!***************************************************************!*\ !*** ./src/lib/core/entity/translate/WrapperTranslateItem.ts ***! \***************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "default", ({ enumerable: true, get: function() { return WrapperTranslateItem; } })); var _path = __webpack_require__(/*! path */ "path"); var _Association = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ./Association */ "./src/lib/core/entity/translate/Association.ts")); var _TranslateItemType = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ./TranslateItemType */ "./src/lib/core/entity/translate/TranslateItemType.ts")); var _global = __webpack_require__(/*! ../../service/util/global */ "./src/lib/core/service/util/global.ts"); function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _async_to_generator(fn) { return function() { var self = this, args = arguments; return new Promise(function(resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } function _class_call_check(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for(var i = 0; i < props.length; i++){ var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _create_class(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _define_property(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _interop_require_default(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _ts_generator(thisArg, body) { var f, y, t, g, _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }; 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(_)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 }; } } var WrapperTranslateItem = /*#__PURE__*/ function() { "use strict"; function WrapperTranslateItem(key, value, type, displayName, assetInfo) { var associations = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : [], _variants = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : [], isVariant = arguments.length > 7 && arguments[7] !== void 0 ? arguments[7] : false, locale = arguments.length > 8 ? arguments[8] : void 0; _class_call_check(this, WrapperTranslateItem); _define_property(this, "key", void 0); _define_property(this, "value", void 0); _define_property(this, "type", void 0); _define_property(this, "displayName", void 0); _define_property(this, "assetInfo", void 0); _define_property(this, "associations", void 0); _define_property(this, "_variants", void 0); _define_property(this, "isVariant", void 0); _define_property(this, "locale", void 0); this.key = key; this.value = value; this.type = type; this.displayName = displayName; this.assetInfo = assetInfo; this.associations = associations; this._variants = _variants; this.isVariant = isVariant; this.locale = locale; } _create_class(WrapperTranslateItem, null, [ { key: "getDisplayName", value: /** 获取一个翻译数据在表格中显示的命称 */ function getDisplayName(info) { if (info.assetInfo) { return (0, _path.relative)(_global.ProjectAssetPath, info.assetInfo.file); } if (info.item) { var _info_value; return (_info_value = info.value) !== null && _info_value !== void 0 ? _info_value : info.item.value; } return ''; } }, { key: "parse", value: function parse(item) { return new WrapperTranslateItem(item.key, item.value, item.type, item.displayName, item.assetInfo, item.associations.map(function(association) { return _Association.default.parse(association); }), item._variants.map(function(it) { return WrapperTranslateItem.parse(it); }), item.isVariant, item.locale); } }, { key: "toSerialize", value: /** 将一个 ITranslateItem 构造成 SerializableTranslateItem */ function toSerialize(item) { return _async_to_generator(function() { var assetInfo; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: assetInfo = null; if (!(item.type === _TranslateItemType.default.Media)) return [ 3, 2 ]; return [ 4, Editor.Message.request('asset-db', 'query-asset-info', item.value || item.key) ]; case 1: assetInfo = _state.sent(); _state.label = 2; case 2: return [ 2, new WrapperTranslateItem(item.key, item.value, item.type, WrapperTranslateItem.getDisplayName({ item: item, assetInfo: assetInfo }), assetInfo, item.associations, item._variants, item.isVariant) ]; } }); })(); } } ]); return WrapperTranslateItem; }(); /***/ }), /***/ "./src/lib/core/error/Errors.ts": /*!**************************************!*\ !*** ./src/lib/core/error/Errors.ts ***! \**************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "CustomError", ({ enumerable: true, get: function() { return CustomError; } })); var _MainMessage = __webpack_require__(/*! ../entity/messages/MainMessage */ "./src/lib/core/entity/messages/MainMessage.ts"); function _assert_this_initialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _call_super(_this, derived, args) { derived = _get_prototype_of(derived); return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args)); } function _class_call_check(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _construct(Parent, args, Class) { if (_is_native_reflect_construct()) { _construct = Reflect.construct; } else { _construct = function construct(Parent, args, Class) { var a = [ null ]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _set_prototype_of(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); } function _define_property(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _get_prototype_of(o) { _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _get_prototype_of(o); } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _set_prototype_of(subClass, superClass); } function _is_native_function(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; } function _possible_constructor_return(self, call) { if (call && (_type_of(call) === "object" || typeof call === "function")) { return call; } return _assert_this_initialized(self); } function _set_prototype_of(o, p) { _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _set_prototype_of(o, p); } function _type_of(obj) { "@swc/helpers - typeof"; return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj; } function _wrap_native_super(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrap_native_super = function wrapNativeSuper(Class) { if (Class === null || !_is_native_function(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _get_prototype_of(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _set_prototype_of(Wrapper, Class); }; return _wrap_native_super(Class); } function _is_native_reflect_construct() { try { var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); } catch (_) {} return (_is_native_reflect_construct = function() { return !!result; })(); } var CustomError = /*#__PURE__*/ function(Error1) { "use strict"; _inherits(CustomError, Error1); function CustomError(status) { for(var _len = arguments.length, messages = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){ messages[_key - 1] = arguments[_key]; } _class_call_check(this, CustomError); var _this; var message; try { var elements = _MainMessage.MessageMap.get(status)().split('{}'); message = elements.pop(); var _messages_pop; message += " ".concat((_messages_pop = messages.pop()) !== null && _messages_pop !== void 0 ? _messages_pop : '', " "); var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined; try { for(var _iterator = elements[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){ var element = _step.value; message += element; var _messages_pop1; message += " ".concat((_messages_pop1 = messages.pop()) !== null && _messages_pop1 !== void 0 ? _messages_pop1 : '', " "); } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally{ try { if (!_iteratorNormalCompletion && _iterator.return != null) { _iterator.return(); } } finally{ if (_didIteratorError) { throw _iteratorError; } } } } catch (e) { message = _MainMessage.MessageMap.get(status)(); } _this = _call_super(this, CustomError, [ message ]), _define_property(_this, "status", void 0), _this.status = status; return _this; } return CustomError; }(_wrap_native_super(Error)); _define_property(CustomError, "NAME", 'CustomError'); /***/ }), /***/ "./src/lib/core/ipc/MainIPC.ts": /*!*************************************!*\ !*** ./src/lib/core/ipc/MainIPC.ts ***! \*************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* eslint-disable prefer-rest-params */ Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "default", ({ enumerable: true, get: function() { return MainIPC; } })); var _tsyringe = __webpack_require__(/*! tsyringe */ "./node_modules/tsyringe/dist/esm5/index.js"); var _global = __webpack_require__(/*! ../service/util/global */ "./src/lib/core/service/util/global.ts"); function _array_like_to_array(arr, len) { if (len == null || len > arr.length) len = arr.length; for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i]; return arr2; } function _array_without_holes(arr) { if (Array.isArray(arr)) return _array_like_to_array(arr); } function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _async_to_generator(fn) { return function() { var self = this, args = arguments; return new Promise(function(resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } function _class_call_check(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for(var i = 0; i < props.length; i++){ var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _create_class(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _iterable_to_array(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _non_iterable_spread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _to_consumable_array(arr) { return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread(); } function _unsupported_iterable_to_array(o, minLen) { if (!o) return; if (typeof o === "string") return _array_like_to_array(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen); } function _ts_decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; } function _ts_generator(thisArg, body) { var f, y, t, g, _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }; 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(_)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 }; } } var MainIPC = /*#__PURE__*/ function() { "use strict"; function MainIPC() { _class_call_check(this, MainIPC); } _create_class(MainIPC, [ { key: "executeMainScript", value: function executeMainScript(method) { for(var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){ args[_key - 1] = arguments[_key]; } return _async_to_generator(function() { var _Editor_Message; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, (_Editor_Message = Editor.Message).request.apply(_Editor_Message, [ _global.MainName, method ].concat(_to_consumable_array(args))) ]; case 1: return [ 2, _state.sent() ]; } }); })(); } }, { key: "getDirty", value: function getDirty() { var _this = this; return _async_to_generator(function() { return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, _this.executeMainScript('get-dirty') ]; case 1: return [ 2, !!_state.sent() ]; } }); })(); } }, { key: "setDirty", value: function setDirty(dirty) { var _this = this; return _async_to_generator(function() { return _ts_generator(this, function(_state) { return [ 2, _this.executeMainScript('set-dirty', dirty) ]; }); })(); } }, { key: "toggle", value: function toggle() { var _this = this, _arguments = arguments; return _async_to_generator(function() { return _ts_generator(this, function(_state) { return [ 2, _this.executeMainScript.apply(_this, [ 'toggle' ].concat(_to_consumable_array(_arguments))) ]; }); })(); } }, { key: "enableChanged", value: function enableChanged() { var _this = this, _arguments = arguments; return _async_to_generator(function() { return _ts_generator(this, function(_state) { return [ 2, _this.executeMainScript.apply(_this, [ 'enable-changed' ].concat(_to_consumable_array(_arguments))) ]; }); })(); } }, { key: "getEnable", value: function getEnable() { var _this = this, _arguments = arguments; return _async_to_generator(function() { return _ts_generator(this, function(_state) { return [ 2, _this.executeMainScript.apply(_this, [ 'get-enable' ].concat(_to_consumable_array(_arguments))) ]; }); })(); } }, { key: "openPanel", value: function openPanel() { var _this = this, _arguments = arguments; return _async_to_generator(function() { return _ts_generator(this, function(_state) { return [ 2, _this.executeMainScript.apply(_this, [ 'open-panel' ].concat(_to_consumable_array(_arguments))) ]; }); })(); } }, { key: "closePanel", value: function closePanel() { var _this = this, _arguments = arguments; return _async_to_generator(function() { return _ts_generator(this, function(_state) { return [ 2, _this.executeMainScript.apply(_this, [ 'close-panel' ].concat(_to_consumable_array(_arguments))) ]; }); })(); } }, { key: "previewBy", value: function previewBy(locale) { var _this = this, _arguments = arguments; return _async_to_generator(function() { return _ts_generator(this, function(_state) { return [ 2, _this.executeMainScript.apply(_this, [ 'preview-by' ].concat(_to_consumable_array(_arguments))) ]; }); })(); } }, { key: "scan", value: function scan(scanOptions) { var _this = this, _arguments = arguments; return _async_to_generator(function() { return _ts_generator(this, function(_state) { return [ 2, _this.executeMainScript.apply(_this, [ 'scan' ].concat(_to_consumable_array(_arguments))) ]; }); })(); } }, { key: "uninstall", value: function uninstall() { var _this = this, _arguments = arguments; return _async_to_generator(function() { return _ts_generator(this, function(_state) { return [ 2, _this.executeMainScript.apply(_this, [ 'uninstall' ].concat(_to_consumable_array(_arguments))) ]; }); })(); } }, { key: "readConfig", value: function readConfig() { var _this = this, _arguments = arguments; return _async_to_generator(function() { return _ts_generator(this, function(_state) { return [ 2, _this.executeMainScript.apply(_this, [ 'read-config' ].concat(_to_consumable_array(_arguments))) ]; }); })(); } }, { key: "getIndexData", value: function getIndexData() { var _this = this, _arguments = arguments; return _async_to_generator(function() { return _ts_generator(this, function(_state) { return [ 2, _this.executeMainScript.apply(_this, [ 'get-index-data' ].concat(_to_consumable_array(_arguments))) ]; }); })(); } }, { key: "getLocalLanguage", value: function getLocalLanguage() { var _this = this, _arguments = arguments; return _async_to_generator(function() { return _ts_generator(this, function(_state) { return [ 2, _this.executeMainScript.apply(_this, [ 'get-local-language' ].concat(_to_consumable_array(_arguments))) ]; }); })(); } }, { key: "getTranslateData", value: function getTranslateData(locale) { var _this = this, _arguments = arguments; return _async_to_generator(function() { return _ts_generator(this, function(_state) { return [ 2, _this.executeMainScript.apply(_this, [ 'get-translate-data' ].concat(_to_consumable_array(_arguments))) ]; }); })(); } }, { key: "getTranslateDataObject", value: function getTranslateDataObject(locale) { var _this = this, _arguments = arguments; return _async_to_generator(function() { return _ts_generator(this, function(_state) { return [ 2, _this.executeMainScript.apply(_this, [ 'get-translate-data-object' ].concat(_to_consumable_array(_arguments))) ]; }); })(); } }, { key: "saveTranslateData", value: function saveTranslateData(locale, translateItems, mergeOption) { var _this = this, _arguments = arguments; return _async_to_generator(function() { return _ts_generator(this, function(_state) { return [ 2, _this.executeMainScript.apply(_this, [ 'save-translate-data' ].concat(_to_consumable_array(_arguments))) ]; }); })(); } }, { key: "clearTranslateData", value: function clearTranslateData() { var _this = this, _arguments = arguments; return _async_to_generator(function() { return _ts_generator(this, function(_state) { return [ 2, _this.executeMainScript.apply(_this, [ 'clear-translate-data' ].concat(_to_consumable_array(_arguments))) ]; }); })(); } }, { key: "setLocalLanguageLocale", value: function setLocalLanguageLocale(locale) { var _this = this, _arguments = arguments; return _async_to_generator(function() { return _ts_generator(this, function(_state) { return [ 2, _this.executeMainScript.apply(_this, [ 'set-local-language-locale' ].concat(_to_consumable_array(_arguments))) ]; }); })(); } }, { key: "setLanguageConfig", value: function setLanguageConfig(languageConfig) { var _this = this, _arguments = arguments; return _async_to_generator(function() { return _ts_generator(this, function(_state) { return [ 2, _this.executeMainScript.apply(_this, [ 'set-language-config' ].concat(_to_consumable_array(_arguments))) ]; }); })(); } }, { key: "getLanguageConfig", value: function getLanguageConfig(locale) { var _this = this, _arguments = arguments; return _async_to_generator(function() { return _ts_generator(this, function(_state) { return [ 2, _this.executeMainScript.apply(_this, [ 'get-language-config' ].concat(_to_consumable_array(_arguments))) ]; }); })(); } }, { key: "getAllLanguageConfigs", value: function getAllLanguageConfigs() { var _this = this, _arguments = arguments; return _async_to_generator(function() { return _ts_generator(this, function(_state) { return [ 2, _this.executeMainScript.apply(_this, [ 'get-all-language-configs' ].concat(_to_consumable_array(_arguments))) ]; }); })(); } }, { key: "addTargetLanguage", value: function addTargetLanguage(locale) { var _this = this, _arguments = arguments; return _async_to_generator(function() { return _ts_generator(this, function(_state) { return [ 2, _this.executeMainScript.apply(_this, [ 'add-target-language' ].concat(_to_consumable_array(_arguments))) ]; }); })(); } }, { key: "removeTargetLanguage", value: function removeTargetLanguage(locale) { var _this = this, _arguments = arguments; return _async_to_generator(function() { return _ts_generator(this, function(_state) { return [ 2, _this.executeMainScript.apply(_this, [ 'remove-target-language' ].concat(_to_consumable_array(_arguments))) ]; }); })(); } }, { key: "getTranslateProviders", value: function getTranslateProviders() { var _this = this, _arguments = arguments; return _async_to_generator(function() { return _ts_generator(this, function(_state) { return [ 2, _this.executeMainScript.apply(_this, [ 'get-translate-providers' ].concat(_to_consumable_array(_arguments))) ]; }); })(); } }, { key: "getTranslateProviderSupportedLanguages", value: function getTranslateProviderSupportedLanguages(provider) { var _this = this, _arguments = arguments; return _async_to_generator(function() { return _ts_generator(this, function(_state) { return [ 2, _this.executeMainScript.apply(_this, [ 'get-translate-provider-supported-languages' ].concat(_to_consumable_array(_arguments))) ]; }); })(); } }, { key: "getCurrentTranslateProvider", value: function getCurrentTranslateProvider() { var _this = this, _arguments = arguments; return _async_to_generator(function() { return _ts_generator(this, function(_state) { return [ 2, _this.executeMainScript.apply(_this, [ 'get-current-translate-provider' ].concat(_to_consumable_array(_arguments))) ]; }); })(); } }, { key: "getTranslateProvider", value: function getTranslateProvider(configType) { var _this = this, _arguments = arguments; return _async_to_generator(function() { return _ts_generator(this, function(_state) { return [ 2, _this.executeMainScript.apply(_this, [ 'get-translate-provider' ].concat(_to_consumable_array(_arguments))) ]; }); })(); } }, { key: "setCurrentTranslateProvider", value: function setCurrentTranslateProvider(providerConfig) { var _this = this, _arguments = arguments; return _async_to_generator(function() { return _ts_generator(this, function(_state) { return [ 2, _this.executeMainScript.apply(_this, [ 'set-current-translate-provider' ].concat(_to_consumable_array(_arguments))) ]; }); })(); } }, { key: "clearTranslateProvider", value: function clearTranslateProvider() { var _this = this, _arguments = arguments; return _async_to_generator(function() { return _ts_generator(this, function(_state) { return [ 2, _this.executeMainScript.apply(_this, [ 'clear-translate-provider' ].concat(_to_consumable_array(_arguments))) ]; }); })(); } }, { key: "changeValue", value: function changeValue(locale, key, value) { var _this = this, _arguments = arguments; return _async_to_generator(function() { return _ts_generator(this, function(_state) { return [ 2, _this.executeMainScript.apply(_this, [ 'change-value' ].concat(_to_consumable_array(_arguments))) ]; }); })(); } }, { key: "getScanOptions", value: function getScanOptions() { var _this = this, _arguments = arguments; return _async_to_generator(function() { return _ts_generator(this, function(_state) { return [ 2, _this.executeMainScript.apply(_this, [ 'get-scan-options' ].concat(_to_consumable_array(_arguments))) ]; }); })(); } }, { key: "autoTranslate", value: function autoTranslate(toTag) { var _this = this, _arguments = arguments; return _async_to_generator(function() { return _ts_generator(this, function(_state) { return [ 2, _this.executeMainScript.apply(_this, [ 'auto-translate' ].concat(_to_consumable_array(_arguments))) ]; }); })(); } }, { key: "importMediaFiles", value: function importMediaFiles(toTag, fromPattern, toPattern) { var _this = this, _arguments = arguments; return _async_to_generator(function() { return _ts_generator(this, function(_state) { return [ 2, _this.executeMainScript.apply(_this, [ 'import-media-files' ].concat(_to_consumable_array(_arguments))) ]; }); })(); } }, { key: "compile", value: function compile(locales) { var _this = this, _arguments = arguments; return _async_to_generator(function() { return _ts_generator(this, function(_state) { return [ 2, _this.executeMainScript.apply(_this, [ 'compile' ].concat(_to_consumable_array(_arguments))) ]; }); })(); } }, { key: "addAssociation", value: function addAssociation(key, association) { var _this = this, _arguments = arguments; return _async_to_generator(function() { return _ts_generator(this, function(_state) { return [ 2, _this.executeMainScript.apply(_this, [ 'add-association' ].concat(_to_consumable_array(_arguments))) ]; }); })(); } }, { key: "removeAssociation", value: function removeAssociation(key, association) { var _this = this, _arguments = arguments; return _async_to_generator(function() { return _ts_generator(this, function(_state) { return [ 2, _this.executeMainScript.apply(_this, [ 'remove-association' ].concat(_to_consumable_array(_arguments))) ]; }); })(); } }, { key: "getResourceList", value: function getResourceList() { var _this = this, _arguments = arguments; return _async_to_generator(function() { return _ts_generator(this, function(_state) { return [ 2, _this.executeMainScript.apply(_this, [ 'get-resource-list' ].concat(_to_consumable_array(_arguments))) ]; }); })(); } }, { key: "getResourceBundle", value: function getResourceBundle(locals) { var _this = this, _arguments = arguments; return _async_to_generator(function() { return _ts_generator(this, function(_state) { return [ 2, _this.executeMainScript.apply(_this, [ 'get-resource-bundle' ].concat(_to_consumable_array(_arguments))) ]; }); })(); } }, { key: "importTranslateFile", value: function importTranslateFile(filePath, translateFileType, locale) { var _this = this, _arguments = arguments; return _async_to_generator(function() { return _ts_generator(this, function(_state) { return [ 2, _this.executeMainScript.apply(_this, [ 'import-translate-file' ].concat(_to_consumable_array(_arguments))) ]; }); })(); } }, { key: "exportTranslateFile", value: function exportTranslateFile(filePath, translateFileType, locale) { var _this = this, _arguments = arguments; return _async_to_generator(function() { return _ts_generator(this, function(_state) { return [ 2, _this.executeMainScript.apply(_this, [ 'export-translate-file' ].concat(_to_consumable_array(_arguments))) ]; }); })(); } } ]); return MainIPC; }(); MainIPC = _ts_decorate([ (0, _tsyringe.singleton)() ], MainIPC); /***/ }), /***/ "./src/lib/core/ipc/WrapperMainIPC.ts": /*!********************************************!*\ !*** ./src/lib/core/ipc/WrapperMainIPC.ts ***! \********************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "default", ({ enumerable: true, get: function() { return WrapperMainIPC; } })); __webpack_require__(/*! reflect-metadata */ "./node_modules/reflect-metadata/Reflect.js"); var _tsyringe = __webpack_require__(/*! tsyringe */ "./node_modules/tsyringe/dist/esm5/index.js"); var _TranslateProviderConfig = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ../entity/config/TranslateProviderConfig */ "./src/lib/core/entity/config/TranslateProviderConfig.ts")); var _LanguageConfig = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ../entity/translate/LanguageConfig */ "./src/lib/core/entity/translate/LanguageConfig.ts")); var _TranslateData = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ../entity/translate/TranslateData */ "./src/lib/core/entity/translate/TranslateData.ts")); var _TranslateItem = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ../entity/translate/TranslateItem */ "./src/lib/core/entity/translate/TranslateItem.ts")); var _WrapperTranslateItem = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ../entity/translate/WrapperTranslateItem */ "./src/lib/core/entity/translate/WrapperTranslateItem.ts")); var _EventBusService = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ../service/util/EventBusService */ "./src/lib/core/service/util/EventBusService.ts")); var _global = __webpack_require__(/*! ../service/util/global */ "./src/lib/core/service/util/global.ts"); var _EditorMessageService = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ../service/EditorMessageService */ "./src/lib/core/service/EditorMessageService.ts")); var _MainIPC = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ./MainIPC */ "./src/lib/core/ipc/MainIPC.ts")); function _array_like_to_array(arr, len) { if (len == null || len > arr.length) len = arr.length; for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i]; return arr2; } function _array_without_holes(arr) { if (Array.isArray(arr)) return _array_like_to_array(arr); } function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _async_to_generator(fn) { return function() { var self = this, args = arguments; return new Promise(function(resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } function _class_call_check(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for(var i = 0; i < props.length; i++){ var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _create_class(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _define_property(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _instanceof(left, right) { if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) { return !!right[Symbol.hasInstance](left); } else { return left instanceof right; } } function _interop_require_default(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _iterable_to_array(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _non_iterable_spread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _object_spread(target) { for(var i = 1; i < arguments.length; i++){ var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === "function") { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function(key) { _define_property(target, key, source[key]); }); } return target; } function _to_consumable_array(arr) { return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread(); } function _unsupported_iterable_to_array(o, minLen) { if (!o) return; if (typeof o === "string") return _array_like_to_array(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen); } function _ts_decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; } function _ts_generator(thisArg, body) { var f, y, t, g, _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }; 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(_)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 }; } } function _ts_metadata(k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); } function _ts_values(o) { var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; if (m) return m.call(o); if (o && typeof o.length === "number") return { next: function() { if (o && i >= o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); } var WrapperMainIPC = /*#__PURE__*/ function() { "use strict"; function WrapperMainIPC(editorMessageService, eventBus, mainIPC) { _class_call_check(this, WrapperMainIPC); _define_property(this, "editorMessageService", void 0); _define_property(this, "eventBus", void 0); _define_property(this, "mainIPC", void 0); _define_property(this, "formatter", void 0); this.editorMessageService = editorMessageService; this.eventBus = eventBus; this.mainIPC = mainIPC; this.formatter = Intl.NumberFormat('en', { notation: 'compact' }); } _create_class(WrapperMainIPC, [ { key: "setDirty", value: function setDirty(dirty) { return this.requestMainMethod('setDirty', dirty); } }, { key: "getDirty", value: function getDirty() { var _this = this; return _async_to_generator(function() { return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, _this.requestMainMethod('getDirty') ]; case 1: return [ 2, !!_state.sent() ]; } }); })(); } }, { key: "uninstall", value: function uninstall() { var _this = this; return _async_to_generator(function() { return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, _this.requestMainMethod('uninstall') ]; case 1: return [ 2, !!_state.sent() ]; } }); })(); } }, { key: "closePanel", value: function closePanel() { var _this = this; return _async_to_generator(function() { return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, _this.requestMainMethod('closePanel') ]; case 1: return [ 2, !!_state.sent() ]; } }); })(); } }, { key: "toggle", value: function toggle() { var _this = this; return _async_to_generator(function() { return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, _this.requestMainMethod('toggle') ]; case 1: return [ 2, !!_state.sent() ]; } }); })(); } }, { key: "getEnable", value: function getEnable() { var _this = this; return _async_to_generator(function() { return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, _this.requestMainMethod('getEnable') ]; case 1: return [ 2, !!_state.sent() ]; } }); })(); } }, { key: "getAllLanguageTranslationDataList", value: function getAllLanguageTranslationDataList() { var _this = this; return _async_to_generator(function() { var _loop, allConfig, arr, index; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: _loop = function(index) { var _arr, config, _ref, items; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: config = allConfig[index]; return [ 4, _this.getTranslateData(config.bcp47Tag) ]; case 1: items = (_ref = _state.sent()) !== null && _ref !== void 0 ? _ref : []; items.forEach(function(item) { return item.locale = config.bcp47Tag; }); (_arr = arr).push.apply(_arr, _to_consumable_array(items)); return [ 2 ]; } }); }; return [ 4, _this.getAllLanguageConfigs() ]; case 1: allConfig = _state.sent(); arr = []; index = 0; _state.label = 2; case 2: if (!(index < allConfig.length)) return [ 3, 5 ]; return [ 5, _ts_values(_loop(index)) ]; case 3: _state.sent(); _state.label = 4; case 4: index++; return [ 3, 2 ]; case 5: return [ 2, arr ]; } }); })(); } }, { /** * 获取当前服务商 */ key: "getCurrentTranslateProvider", value: function getCurrentTranslateProvider() { return this.requestMainMethod('getCurrentTranslateProvider'); } }, { key: "getTranslateProvider", value: function getTranslateProvider(configType) { return this.requestMainMethod('getTranslateProvider', configType); } }, { /** * 设置当前服务商 */ key: "setCurrentTranslateProvider", value: function setCurrentTranslateProvider(service) { return this.requestMainMethod('setCurrentTranslateProvider', _TranslateProviderConfig.default.parse(service)); } }, { /** * 去除当前服务商 * @returns */ key: "clearTranslateProvider", value: function clearTranslateProvider() { return this.requestMainMethod('clearTranslateProvider'); } }, { key: "getProviderLanguages", value: /** 获取服务商支持的所有语言 */ function getProviderLanguages(provider) { var _this = this; return _async_to_generator(function() { var _ref, languages, value; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: if (!provider) return [ 3, 2 ]; return [ 4, _this.requestMainMethod('getTranslateProviderSupportedLanguages', provider) ]; case 1: languages = (_ref = _state.sent()) !== null && _ref !== void 0 ? _ref : []; value = {}; languages.forEach(function(item) { value[item] = _this.getDisplayNameOfLanguage(item, 'none') || Editor.I18n.t("".concat(_global.MainName, ".").concat(provider, ".").concat(item)) || item; }); return [ 2, value ]; case 2: return [ 2, {} ]; case 3: return [ 2 ]; } }); })(); } }, { key: "setLanguageConfig", value: function setLanguageConfig(languageConfig) { return this.requestMainMethod('setLanguageConfig', _LanguageConfig.default.parse(languageConfig)); } }, { key: "getTranslateProviders", value: /** * * @returns 当前翻译商的数组 */ function getTranslateProviders() { var _this = this; return _async_to_generator(function() { var _ref; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, _this.requestMainMethod('getTranslateProviders') ]; case 1: return [ 2, (_ref = _state.sent()) !== null && _ref !== void 0 ? _ref : [] ]; } }); })(); } }, { key: "getLocalLanguageConfig", value: /** * 获取本地开发语言的配置 */ function getLocalLanguageConfig() { var _this = this; return _async_to_generator(function() { return _ts_generator(this, function(_state) { return [ 2, _this.getLanguageConfig() ]; }); })(); } }, { key: "getLanguageConfig", value: function getLanguageConfig(locale) { var _this = this; return _async_to_generator(function() { var currentLanguage, config; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, _this.getLocalLanguage() ]; case 1: currentLanguage = _state.sent(); if (!currentLanguage) { return [ 2, null ]; } return [ 4, _this.requestMainMethod('getLanguageConfig', locale) ]; case 2: config = _state.sent(); if (config) { if (config.bcp47Tag === currentLanguage) { config.translateFinished = config.translateTotal; } return [ 2, _object_spread({ displayName: _this.getDisplayNameOfLanguage(config.bcp47Tag) }, config) ]; } return [ 2, null ]; } }); })(); } }, { key: "getIndexData", value: function getIndexData() { var _this = this; return _async_to_generator(function() { var _ref, result, arr, index, translateItem, wrapperTranslateItem, index1, association, assetInfo; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, _this.requestMainMethod('getIndexData') ]; case 1: result = (_ref = _state.sent()) !== null && _ref !== void 0 ? _ref : []; arr = []; if (!(result === null || result === void 0 ? void 0 : result.length)) return [ 3, 9 ]; index = 0; _state.label = 2; case 2: if (!(index < result.length)) return [ 3, 9 ]; translateItem = result[index]; return [ 4, _WrapperTranslateItem.default.toSerialize(translateItem) ]; case 3: wrapperTranslateItem = _state.sent(); index1 = 0; _state.label = 4; case 4: if (!(index1 < wrapperTranslateItem.associations.length)) return [ 3, 7 ]; association = wrapperTranslateItem.associations[index1]; if (!association.reference) return [ 3, 6 ]; return [ 4, _this.editorMessageService.queryAssetInfo(association.reference) ]; case 5: assetInfo = _state.sent(); if (assetInfo) { association.assetInfo = assetInfo; } _state.label = 6; case 6: index1++; return [ 3, 4 ]; case 7: arr.push(wrapperTranslateItem); _state.label = 8; case 8: index++; return [ 3, 2 ]; case 9: return [ 2, arr ]; } }); })(); } }, { key: "getAllLanguageConfigs", value: /** 得到本地语言和所有其他语言 */ function getAllLanguageConfigs() { var _this = this; return _async_to_generator(function() { var currentLanguage, local, _ref, configs; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, _this.getLocalLanguage() ]; case 1: currentLanguage = _state.sent(); if (!currentLanguage) { return [ 2, [] ]; } return [ 4, _this.getLocalLanguageConfig() ]; case 2: local = _state.sent(); return [ 4, _this.requestMainMethod('getAllLanguageConfigs') ]; case 3: configs = ((_ref = _state.sent()) !== null && _ref !== void 0 ? _ref : []).filter(function(item) { return item.bcp47Tag !== _TranslateData.default.INDEX_LOCALE; }).map(function(config) { return _object_spread({ displayName: _this.getDisplayNameOfLanguage(config.bcp47Tag) }, config); }); return [ 2, local ? [ local ].concat(_to_consumable_array(configs)) : configs ]; } }); })(); } }, { /** * 设置当前本地开发语言语言 */ key: "setLocalLanguage", value: function setLocalLanguage(locale) { return this.requestMainMethod('setLocalLanguageLocale', locale); } }, { key: "removeLanguage", value: /** * 移除某个语言的配置文件 * @param language * @returns 删除是否成功 */ function removeLanguage(language) { var _this = this; return _async_to_generator(function() { var result; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, Editor.Dialog.info(Editor.I18n.t(_global.MainName + '.ask_delete'), { buttons: [ Editor.I18n.t(_global.MainName + '.cancel'), Editor.I18n.t(_global.MainName + '.confirm') ], cancel: 0, default: 1 }) ]; case 1: result = _state.sent(); if (!result.response) return [ 3, 3 ]; return [ 4, _this.requestMainMethod('removeTargetLanguage', language) ]; case 2: return [ 2, !!_state.sent() ]; case 3: return [ 2, false ]; } }); })(); } }, { key: "removeAllLanguage", value: /** * 移除所有语言的配置文件 */ function removeAllLanguage() { var _this = this; return _async_to_generator(function() { var localLanguageConfig, configs, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, config, err, e; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: _state.trys.push([ 0, 11, , 12 ]); return [ 4, _this.getLocalLanguageConfig() ]; case 1: localLanguageConfig = _state.sent(); return [ 4, _this.getAllLanguageConfigs() ]; case 2: configs = _state.sent(); _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined; _state.label = 3; case 3: _state.trys.push([ 3, 8, 9, 10 ]); _iterator = configs[Symbol.iterator](); _state.label = 4; case 4: if (!!(_iteratorNormalCompletion = (_step = _iterator.next()).done)) return [ 3, 7 ]; config = _step.value; if (!(localLanguageConfig && localLanguageConfig.bcp47Tag !== config.bcp47Tag)) return [ 3, 6 ]; return [ 4, _this.requestMainMethod('removeTargetLanguage', config.bcp47Tag) ]; case 5: _state.sent(); _state.label = 6; case 6: _iteratorNormalCompletion = true; return [ 3, 4 ]; case 7: return [ 3, 10 ]; case 8: err = _state.sent(); _didIteratorError = true; _iteratorError = err; return [ 3, 10 ]; case 9: try { if (!_iteratorNormalCompletion && _iterator.return != null) { _iterator.return(); } } finally{ if (_didIteratorError) { throw _iteratorError; } } return [ 7 ]; case 10: return [ 2, true ]; case 11: e = _state.sent(); console.log(e); return [ 2, false ]; case 12: return [ 2 ]; } }); })(); } }, { key: "importFilesFromDirectory", value: /** * 传入一个路径自动导入文件 * @param locale * @param path */ function importFilesFromDirectory(toTag, fromPattern, toPattern) { var _this = this; return _async_to_generator(function() { var _ref, result, items, index, translateItem, _; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, _this.requestMainMethod('importMediaFiles', toTag, fromPattern, toPattern) ]; case 1: result = (_ref = _state.sent()) !== null && _ref !== void 0 ? _ref : []; items = []; index = 0; _state.label = 2; case 2: if (!(index < result.length)) return [ 3, 5 ]; translateItem = result[index]; _ = items.push; return [ 4, _WrapperTranslateItem.default.toSerialize(translateItem) ]; case 3: _.apply(items, [ _state.sent() ]); _state.label = 4; case 4: index++; return [ 3, 2 ]; case 5: return [ 2, items ]; } }); })(); } }, { /** * 增加并保存更新需要持久化的数据 * @param data * @returns */ key: "saveTranslateData", value: function saveTranslateData(locale, data, mergeTranslateOption) { var items; if (_instanceof(data, Array)) { items = data.map(_TranslateItem.default.parse); } else { items = Object.values(data).map(function(item) { return item && _TranslateItem.default.parse(item); }).filter(Boolean); } return this.requestMainMethod('saveTranslateData', locale, items, mergeTranslateOption); } }, { key: "compile", value: function compile(locales) { return this.requestMainMethod('compile', locales); } }, { key: "previewBy", value: function previewBy(locale) { return this.requestMainMethod('previewBy', locale); } }, { key: "autoTranslate", value: /** * 自动翻译 * 目标语言 */ function autoTranslate(targetLocale) { var _this = this; return _async_to_generator(function() { var _ref, results, items, index, translateItem, _; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, _this.requestMainMethod('autoTranslate', targetLocale) ]; case 1: results = (_ref = _state.sent()) !== null && _ref !== void 0 ? _ref : []; items = []; index = 0; _state.label = 2; case 2: if (!(index < results.length)) return [ 3, 5 ]; translateItem = results[index]; _ = items.push; return [ 4, _WrapperTranslateItem.default.toSerialize(translateItem) ]; case 3: _.apply(items, [ _state.sent() ]); _state.label = 4; case 4: index++; return [ 3, 2 ]; case 5: return [ 2, items ]; } }); })(); } }, { /** * 将数字格式化 * 例如 2000 -> 2k * @param num */ key: "numberFormat", value: function numberFormat(num) { return this.formatter.format(num); } }, { key: "getTranslateData", value: /** 获取语言的配置 */ function getTranslateData(language) { var _this = this; return _async_to_generator(function() { var _ref, targetLocalItems, localLanguage, _loop, _ref1, emptyValueItems, index, arr, index1, item, _; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, _this.requestMainMethod('getTranslateData', language) ]; case 1: targetLocalItems = (_ref = _state.sent()) !== null && _ref !== void 0 ? _ref : []; return [ 4, _this.getLocalLanguage() ]; case 2: localLanguage = _state.sent(); if (!(!language || localLanguage === language)) return [ 3, 4 ]; _loop = function(index) { var emptyItem = emptyValueItems[index]; if (!targetLocalItems.some(function(item) { return item.key === emptyItem.key; })) { targetLocalItems.push(emptyItem); } }; return [ 4, _this.requestMainMethod('getIndexData') ]; case 3: emptyValueItems = (_ref1 = _state.sent()) !== null && _ref1 !== void 0 ? _ref1 : []; for(index = 0; index < emptyValueItems.length; index++)_loop(index); _state.label = 4; case 4: arr = []; if (!targetLocalItems) return [ 3, 8 ]; index1 = 0; _state.label = 5; case 5: if (!(index1 < targetLocalItems.length)) return [ 3, 8 ]; item = targetLocalItems[index1]; _ = arr.push; return [ 4, _WrapperTranslateItem.default.toSerialize(item) ]; case 6: _.apply(arr, [ _state.sent() ]); _state.label = 7; case 7: index1++; return [ 3, 5 ]; case 8: return [ 2, arr ]; } }); })(); } }, { key: "getLocalLanguage", value: /** 获取当前使用的语言 */ function getLocalLanguage() { var _this = this; return _async_to_generator(function() { return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, _this.requestMainMethod('getLocalLanguage') ]; case 1: return [ 2, _state.sent() || '' ]; } }); })(); } }, { key: "getScanOptions", value: /** 获取扫描与统计的记录 */ function getScanOptions() { var _this = this; return _async_to_generator(function() { var _ref; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, _this.requestMainMethod('getScanOptions') ]; case 1: return [ 2, (_ref = _state.sent()) !== null && _ref !== void 0 ? _ref : [] ]; } }); })(); } }, { /** * 统计与扫描 */ key: "scan", value: function scan(scanOptions) { return this.requestMainMethod('scan', scanOptions); } }, { /** * 通过 uuid 获取资源的信息 * @param uuidOrPath */ key: "getFileInfoByUUIDOrPath", value: function getFileInfoByUUIDOrPath(uuidOrPath) { // eslint-disable-next-line @typescript-eslint/no-unsafe-return return Editor.Message.request('asset-db', 'query-asset-info', uuidOrPath); } }, { /** * * @param code * @param fallback default is code * @returns */ key: "getDisplayNameOfLanguage", value: function getDisplayNameOfLanguage(code) { var fallback = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 'code'; var result = Editor.I18n.t("".concat(_global.MainName, ".language_code.").concat(code)); if (!result && fallback === 'none') { return result; } return result !== null && result !== void 0 ? result : code; } }, { /** 添加语言 */ key: "addTargetLanguage", value: function addTargetLanguage(locale) { return this.requestMainMethod('addTargetLanguage', locale); } }, { key: "requestMainMethod", value: /** 执行主进程的方法 */ function requestMainMethod(method) { for(var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){ args[_key - 1] = arguments[_key]; } var _this = this; return _async_to_generator(function() { var _this_mainIPC, result, error, customError; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: _state.trys.push([ 0, 2, , 3 ]); return [ 4, (_this_mainIPC = _this.mainIPC)[method].apply(_this_mainIPC, _to_consumable_array(args)) ]; case 1: result = _state.sent(); // eslint-disable-next-line @typescript-eslint/no-unsafe-return return [ 2, result ]; case 2: error = _state.sent(); customError = error; _this.eventBus.emit('onCustomError', customError); return [ 2, undefined ]; case 3: return [ 2 ]; } }); })(); } }, { key: "addAssociation", value: function addAssociation(key, association) { return this.requestMainMethod('addAssociation', key, association); } }, { key: "removeAssociation", value: function removeAssociation(key, association) { return this.requestMainMethod('removeAssociation', key, association); } }, { key: "importTranslateFile", value: function importTranslateFile(filePath, translateFileType, locale) { var _this = this; return _async_to_generator(function() { var _ref; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, _this.requestMainMethod('importTranslateFile', filePath, translateFileType, locale) ]; case 1: return [ 2, (_ref = _state.sent()) !== null && _ref !== void 0 ? _ref : [] ]; } }); })(); } }, { key: "exportTranslateFile", value: function exportTranslateFile(filePath, translateFileType, locale) { var _this = this; return _async_to_generator(function() { return _ts_generator(this, function(_state) { return [ 2, _this.requestMainMethod('exportTranslateFile', filePath, translateFileType, locale) ]; }); })(); } } ]); return WrapperMainIPC; }(); WrapperMainIPC = _ts_decorate([ (0, _tsyringe.singleton)(), _ts_metadata("design:type", Function), _ts_metadata("design:paramtypes", [ typeof _EditorMessageService.default === "undefined" ? Object : _EditorMessageService.default, typeof _EventBusService.default === "undefined" ? Object : _EventBusService.default, typeof _MainIPC.default === "undefined" ? Object : _MainIPC.default ]) ], WrapperMainIPC); /***/ }), /***/ "./src/lib/core/reader/CSVReader.ts": /*!******************************************!*\ !*** ./src/lib/core/reader/CSVReader.ts ***! \******************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* eslint-disable @typescript-eslint/no-non-null-assertion */ Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "default", ({ enumerable: true, get: function() { return CSVReader; } })); var _tsyringe = __webpack_require__(/*! tsyringe */ "./node_modules/tsyringe/dist/esm5/index.js"); var _type = __webpack_require__(/*! ../type/type */ "./src/lib/core/type/type.ts"); var _TranslateData = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ../entity/translate/TranslateData */ "./src/lib/core/entity/translate/TranslateData.ts")); var _fsextra = __webpack_require__(/*! fs-extra */ "./node_modules/fs-extra/lib/index.js"); var _sync = __webpack_require__(/*! csv-parse/sync */ "./node_modules/csv-parse/dist/cjs/sync.cjs"); var _CSVWriter = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ../writer/CSVWriter */ "./src/lib/core/writer/CSVWriter.ts")); var _Errors = __webpack_require__(/*! ../error/Errors */ "./src/lib/core/error/Errors.ts"); var _MainMessage = __webpack_require__(/*! ../entity/messages/MainMessage */ "./src/lib/core/entity/messages/MainMessage.ts"); var _TranslateItem = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ../entity/translate/TranslateItem */ "./src/lib/core/entity/translate/TranslateItem.ts")); var _TranslateItemType = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ../entity/translate/TranslateItemType */ "./src/lib/core/entity/translate/TranslateItemType.ts")); var _UUIDService = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ../service/util/UUIDService */ "./src/lib/core/service/util/UUIDService.ts")); function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _async_to_generator(fn) { return function() { var self = this, args = arguments; return new Promise(function(resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } function _class_call_check(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for(var i = 0; i < props.length; i++){ var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _create_class(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _define_property(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _interop_require_default(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _ts_decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; } function _ts_generator(thisArg, body) { var f, y, t, g, _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }; 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(_)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 }; } } function _ts_metadata(k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); } function _ts_param(paramIndex, decorator) { return function(target, key) { decorator(target, key, paramIndex); }; } var CSVReader = /*#__PURE__*/ function() { "use strict"; function CSVReader(pluralRules, uuidService) { _class_call_check(this, CSVReader); _define_property(this, "pluralRules", void 0); _define_property(this, "uuidService", void 0); _define_property(this, "type", void 0); this.pluralRules = pluralRules; this.uuidService = uuidService; this.type = _type.TranslateFileType.CSV; } _create_class(CSVReader, [ { key: "read", value: function read(filePath) { var _this = this; return _async_to_generator(function() { var csvFileBuffer, csvTranslateItems; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, (0, _fsextra.readFile)(filePath) ]; case 1: csvFileBuffer = _state.sent(); csvTranslateItems = (0, _sync.parse)(csvFileBuffer).map(function(it) { return { key: it[0], sourceValue: it[1], targetValue: it[2] }; }); csvTranslateItems.shift(); return [ 2, _this.generateTranslateData(csvTranslateItems) ]; } }); })(); } }, { key: "generateTranslateData", value: function generateTranslateData(csvTranslateItems) { if (csvTranslateItems.length < 1 || csvTranslateItems[0].key !== _CSVWriter.default.LocaleKey) { throw new _Errors.CustomError(_MainMessage.MessageCode.UNAVAILABLE_CSV_FILE, "file not found ".concat(_CSVWriter.default.LocaleKey)); } var translateData = new _TranslateData.default(csvTranslateItems[0].targetValue); var _this_pluralRules__language; var plurals = (_this_pluralRules__language = this.pluralRules[new Intl.Locale(translateData.locale).language]) !== null && _this_pluralRules__language !== void 0 ? _this_pluralRules__language : [ 'other' ]; csvTranslateItems.shift(); var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined; try { for(var _iterator = csvTranslateItems[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){ var csvItem = _step.value; var originItem = void 0; // 检查是否为字符串类型,如果不是则转换为字符串 var targetValue = csvItem.targetValue + ''; if (this.checkVariant(plurals, csvItem)) { var originKey = this.trimPluralRule(plurals, csvItem); var _translateData_items_get; originItem = (_translateData_items_get = translateData.items.get(originKey)) !== null && _translateData_items_get !== void 0 ? _translateData_items_get : new _TranslateItem.default(originKey, '', _TranslateItemType.default.External); originItem.addVariant(new _TranslateItem.default(csvItem.key, targetValue, _TranslateItemType.default.External)); } else { var _translateData_items_get1; originItem = (_translateData_items_get1 = translateData.items.get(csvItem.key)) !== null && _translateData_items_get1 !== void 0 ? _translateData_items_get1 : new _TranslateItem.default(csvItem.key, targetValue, _TranslateItemType.default.External); originItem.value = targetValue; } translateData.items.set(originItem.key, originItem); } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally{ try { if (!_iteratorNormalCompletion && _iterator.return != null) { _iterator.return(); } } finally{ if (_didIteratorError) { throw _iteratorError; } } } return translateData; } }, { key: "checkVariant", value: function checkVariant(plurals, csvItem) { return plurals.find(function(plural) { return csvItem.key.endsWith(plural); }); } }, { key: "trimPluralRule", value: function trimPluralRule(plurals, csvItem) { var plural = this.checkVariant(plurals, csvItem); var trimKey = csvItem.key.replace(new RegExp("_".concat(plural, "$")), ''); trimKey = trimKey.length > 0 ? trimKey : this.uuidService.v4(); return trimKey; } } ]); return CSVReader; }(); CSVReader = _ts_decorate([ (0, _tsyringe.singleton)(), _ts_param(0, (0, _tsyringe.inject)('PluralRules')), _ts_metadata("design:type", Function), _ts_metadata("design:paramtypes", [ typeof _type.PluralRules === "undefined" ? Object : _type.PluralRules, typeof _UUIDService.default === "undefined" ? Object : _UUIDService.default ]) ], CSVReader); /***/ }), /***/ "./src/lib/core/reader/POReader.ts": /*!*****************************************!*\ !*** ./src/lib/core/reader/POReader.ts ***! \*****************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "default", ({ enumerable: true, get: function() { return POReader; } })); var _type = __webpack_require__(/*! ../type/type */ "./src/lib/core/type/type.ts"); var _TranslateData = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ../entity/translate/TranslateData */ "./src/lib/core/entity/translate/TranslateData.ts")); var _fsextra = __webpack_require__(/*! fs-extra */ "./node_modules/fs-extra/lib/index.js"); var _gettextparser = __webpack_require__(/*! gettext-parser */ "./node_modules/gettext-parser/index.js"); var _TranslateItem = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ../entity/translate/TranslateItem */ "./src/lib/core/entity/translate/TranslateItem.ts")); var _tsyringe = __webpack_require__(/*! tsyringe */ "./node_modules/tsyringe/dist/esm5/index.js"); var _TranslateItemType = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ../entity/translate/TranslateItemType */ "./src/lib/core/entity/translate/TranslateItemType.ts")); var _UUIDService = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ../service/util/UUIDService */ "./src/lib/core/service/util/UUIDService.ts")); function _array_like_to_array(arr, len) { if (len == null || len > arr.length) len = arr.length; for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i]; return arr2; } function _array_with_holes(arr) { if (Array.isArray(arr)) return arr; } function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _async_to_generator(fn) { return function() { var self = this, args = arguments; return new Promise(function(resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } function _class_call_check(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for(var i = 0; i < props.length; i++){ var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _create_class(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _define_property(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _interop_require_default(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _iterable_to_array_limit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){ _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally{ try { if (!_n && _i["return"] != null) _i["return"](); } finally{ if (_d) throw _e; } } return _arr; } function _non_iterable_rest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _sliced_to_array(arr, i) { return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest(); } function _unsupported_iterable_to_array(o, minLen) { if (!o) return; if (typeof o === "string") return _array_like_to_array(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen); } function _ts_decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; } function _ts_generator(thisArg, body) { var f, y, t, g, _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }; 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(_)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 }; } } function _ts_metadata(k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); } function _ts_param(paramIndex, decorator) { return function(target, key) { decorator(target, key, paramIndex); }; } var POReader = /*#__PURE__*/ function() { "use strict"; function POReader(pluralRules, uuidService) { _class_call_check(this, POReader); _define_property(this, "pluralRules", void 0); _define_property(this, "uuidService", void 0); _define_property(this, "type", void 0); this.pluralRules = pluralRules; this.uuidService = uuidService; this.type = _type.TranslateFileType.PO; } _create_class(POReader, [ { key: "read", value: function read(filePath) { var _this = this; return _async_to_generator(function() { var fileBuffer, gettextTranslations, translations, translateData, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, _step_value, key, value, item; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, (0, _fsextra.readFile)(filePath) ]; case 1: fileBuffer = _state.sent(); gettextTranslations = _gettextparser.po.parse(fileBuffer, 'utf-8'); translations = gettextTranslations.translations['']; translateData = new _TranslateData.default(gettextTranslations.headers['Language']); _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined; try { for(_iterator = Object.entries(translations)[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){ _step_value = _sliced_to_array(_step.value, 2), key = _step_value[0], value = _step_value[1]; if (!key) continue; item = _this.transform(value, translateData.locale); if (item) { translateData.items.set(item.key, item); } } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally{ try { if (!_iteratorNormalCompletion && _iterator.return != null) { _iterator.return(); } } finally{ if (_didIteratorError) { throw _iteratorError; } } } return [ 2, translateData ]; } }); })(); } }, { key: "transform", value: function transform(translation, locale) { var _translation_comments_reference; var item = new _TranslateItem.default((_translation_comments_reference = translation.comments.reference) !== null && _translation_comments_reference !== void 0 ? _translation_comments_reference : this.uuidService.v4(), '', _TranslateItemType.default.External); if (translation.msgid_plural) { item.value = translation.msgid_plural; var _this_pluralRules__language; var plurals = (_this_pluralRules__language = this.pluralRules[new Intl.Locale(locale).language]) !== null && _this_pluralRules__language !== void 0 ? _this_pluralRules__language : [ 'other' ]; var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined; try { for(var _iterator = plurals.entries()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){ var _step_value = _sliced_to_array(_step.value, 2), i = _step_value[0], plural = _step_value[1]; var variant = new _TranslateItem.default("".concat(item.key, "_").concat(plural), translation.msgstr[i], item.type, true); item.addVariant(variant); } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally{ try { if (!_iteratorNormalCompletion && _iterator.return != null) { _iterator.return(); } } finally{ if (_didIteratorError) { throw _iteratorError; } } } } else { item.value = translation.msgstr[0]; } if (item.value) { return item; } else { return undefined; } } } ]); return POReader; }(); POReader = _ts_decorate([ (0, _tsyringe.singleton)(), _ts_param(0, (0, _tsyringe.inject)('PluralRules')), _ts_metadata("design:type", Function), _ts_metadata("design:paramtypes", [ typeof _type.PluralRules === "undefined" ? Object : _type.PluralRules, typeof _UUIDService.default === "undefined" ? Object : _UUIDService.default ]) ], POReader); /***/ }), /***/ "./src/lib/core/reader/XLSXReader.ts": /*!*******************************************!*\ !*** ./src/lib/core/reader/XLSXReader.ts ***! \*******************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "default", ({ enumerable: true, get: function() { return XLSXReader; } })); var _CSVReader = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ./CSVReader */ "./src/lib/core/reader/CSVReader.ts")); var _tsyringe = __webpack_require__(/*! tsyringe */ "./node_modules/tsyringe/dist/esm5/index.js"); var _xlsx = __webpack_require__(/*! xlsx */ "./node_modules/xlsx/xlsx.mjs"); var _Errors = __webpack_require__(/*! ../error/Errors */ "./src/lib/core/error/Errors.ts"); var _MainMessage = __webpack_require__(/*! ../entity/messages/MainMessage */ "./src/lib/core/entity/messages/MainMessage.ts"); var _type = __webpack_require__(/*! ../type/type */ "./src/lib/core/type/type.ts"); var _fsextra = __webpack_require__(/*! fs-extra */ "./node_modules/fs-extra/lib/index.js"); function _assert_this_initialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _async_to_generator(fn) { return function() { var self = this, args = arguments; return new Promise(function(resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } function _call_super(_this, derived, args) { derived = _get_prototype_of(derived); return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args)); } function _class_call_check(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for(var i = 0; i < props.length; i++){ var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _create_class(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _define_property(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _get_prototype_of(o) { _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _get_prototype_of(o); } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _set_prototype_of(subClass, superClass); } function _interop_require_default(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _possible_constructor_return(self, call) { if (call && (_type_of(call) === "object" || typeof call === "function")) { return call; } return _assert_this_initialized(self); } function _set_prototype_of(o, p) { _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _set_prototype_of(o, p); } function _type_of(obj) { "@swc/helpers - typeof"; return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj; } function _is_native_reflect_construct() { try { var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); } catch (_) {} return (_is_native_reflect_construct = function() { return !!result; })(); } function _ts_decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; } function _ts_generator(thisArg, body) { var f, y, t, g, _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }; 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(_)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 }; } } var XLSXReader = /*#__PURE__*/ function(CSVReader) { "use strict"; _inherits(XLSXReader, CSVReader); function XLSXReader() { _class_call_check(this, XLSXReader); var _this; _this = _call_super(this, XLSXReader, arguments), _define_property(_this, "type", _type.TranslateFileType.XLSX); return _this; } _create_class(XLSXReader, [ { key: "read", value: function read(filePath) { var _this = this; return _async_to_generator(function() { var data, workbook, worksheet, csvTranslateItems; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, (0, _fsextra.readFile)(filePath) ]; case 1: data = _state.sent(); workbook = (0, _xlsx.read)(data.buffer, { type: 'string' }); if (workbook.SheetNames.length < 1) { throw new _Errors.CustomError(_MainMessage.MessageCode.UNAVAILABLE_XLSX_FILE, 'no worksheets'); } worksheet = workbook.Sheets[workbook.SheetNames[0]]; csvTranslateItems = _xlsx.utils.sheet_to_json(worksheet); return [ 2, _this.generateTranslateData(csvTranslateItems) ]; } }); })(); } } ]); return XLSXReader; }(_CSVReader.default); XLSXReader = _ts_decorate([ (0, _tsyringe.singleton)() ], XLSXReader); /***/ }), /***/ "./src/lib/core/repository/translate/TranslateRepository.ts": /*!******************************************************************!*\ !*** ./src/lib/core/repository/translate/TranslateRepository.ts ***! \******************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); function _export(target, all) { for(var name in all)Object.defineProperty(target, name, { enumerable: true, get: all[name] }); } _export(exports, { TranslateRepository: function() { return TranslateRepository; }, TranslateRepositoryTransform: function() { return TranslateRepositoryTransform; } }); var _axios = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! axios */ "./node_modules/axios/index.js")); function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _async_to_generator(fn) { return function() { var self = this, args = arguments; return new Promise(function(resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } function _class_call_check(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for(var i = 0; i < props.length; i++){ var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _create_class(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _interop_require_default(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _ts_generator(thisArg, body) { var f, y, t, g, _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }; 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(_)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 }; } } var TranslateRepository = /*#__PURE__*/ function() { "use strict"; function TranslateRepository() { _class_call_check(this, TranslateRepository); } _create_class(TranslateRepository, [ { key: "translate", value: function translate(translateRequest) { var _this = this; return _async_to_generator(function() { var request, response, e, _e_status, _e_code, _e_response; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: request = _this.transformTranslateRequestConfig(translateRequest); response = {}; _state.label = 1; case 1: _state.trys.push([ 1, 3, , 4 ]); return [ 4, _axios.default.request(request) ]; case 2: response = _state.sent(); return [ 3, 4 ]; case 3: e = _state.sent(); response = (_e_response = e.response) !== null && _e_response !== void 0 ? _e_response : { status: (_e_status = e.status) !== null && _e_status !== void 0 ? _e_status : -1, statusText: (_e_code = e.code) !== null && _e_code !== void 0 ? _e_code : e }; return [ 3, 4 ]; case 4: return [ 2, _this.transformTranslateResponse(response) ]; } }); })(); } } ]); return TranslateRepository; }(); var TranslateRepositoryTransform = /*#__PURE__*/ function() { "use strict"; function TranslateRepositoryTransform() { _class_call_check(this, TranslateRepositoryTransform); } _create_class(TranslateRepositoryTransform, [ { key: "transform", value: function transform(incoming, args) { var map = new Map(); incoming.forEach(function(item) { map.set(item.name, item); }); return map; } } ]); return TranslateRepositoryTransform; }(); /***/ }), /***/ "./src/lib/core/repository/translate/YouDaoRepository.ts": /*!***************************************************************!*\ !*** ./src/lib/core/repository/translate/YouDaoRepository.ts ***! \***************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "default", ({ enumerable: true, get: function() { return YouDaoRepository; } })); var _tsyringe = __webpack_require__(/*! tsyringe */ "./node_modules/tsyringe/dist/esm5/index.js"); var _cryptojs = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! crypto-js */ "./node_modules/crypto-js/index.js")); var _formdata = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! form-data */ "./node_modules/form-data/lib/browser.js")); var _UUIDService = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ../../service/util/UUIDService */ "./src/lib/core/service/util/UUIDService.ts")); var _TranslateRepository = __webpack_require__(/*! ./TranslateRepository */ "./src/lib/core/repository/translate/TranslateRepository.ts"); var _Errors = __webpack_require__(/*! ../../error/Errors */ "./src/lib/core/error/Errors.ts"); var _MainMessage = __webpack_require__(/*! ../../entity/messages/MainMessage */ "./src/lib/core/entity/messages/MainMessage.ts"); var _global = __webpack_require__(/*! ../../service/util/global */ "./src/lib/core/service/util/global.ts"); function _array_like_to_array(arr, len) { if (len == null || len > arr.length) len = arr.length; for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i]; return arr2; } function _array_with_holes(arr) { if (Array.isArray(arr)) return arr; } function _assert_this_initialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _call_super(_this, derived, args) { derived = _get_prototype_of(derived); return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args)); } function _class_call_check(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for(var i = 0; i < props.length; i++){ var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _create_class(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _define_property(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _get_prototype_of(o) { _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _get_prototype_of(o); } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _set_prototype_of(subClass, superClass); } function _interop_require_default(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _iterable_to_array_limit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){ _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally{ try { if (!_n && _i["return"] != null) _i["return"](); } finally{ if (_d) throw _e; } } return _arr; } function _non_iterable_rest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _possible_constructor_return(self, call) { if (call && (_type_of(call) === "object" || typeof call === "function")) { return call; } return _assert_this_initialized(self); } function _set_prototype_of(o, p) { _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _set_prototype_of(o, p); } function _sliced_to_array(arr, i) { return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest(); } function _type_of(obj) { "@swc/helpers - typeof"; return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj; } function _unsupported_iterable_to_array(o, minLen) { if (!o) return; if (typeof o === "string") return _array_like_to_array(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen); } function _is_native_reflect_construct() { try { var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); } catch (_) {} return (_is_native_reflect_construct = function() { return !!result; })(); } function _ts_decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; } function _ts_metadata(k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); } var YouDaoRepository = /*#__PURE__*/ function(TranslateRepository) { "use strict"; _inherits(YouDaoRepository, TranslateRepository); function YouDaoRepository(uuidService) { _class_call_check(this, YouDaoRepository); var _this; _this = _call_super(this, YouDaoRepository), _define_property(_this, "uuidService", void 0), _define_property(_this, "name", void 0), /** * @see https://ai.youdao.com/DOCSIRMA/html/%E8%87%AA%E7%84%B6%E8%AF%AD%E8%A8%80%E7%BF%BB%E8%AF%91/API%E6%96%87%E6%A1%A3/%E6%96%87%E6%9C%AC%E7%BF%BB%E8%AF%91%E6%9C%8D%E5%8A%A1/%E6%96%87%E6%9C%AC%E7%BF%BB%E8%AF%91%E6%9C%8D%E5%8A%A1-API%E6%96%87%E6%A1%A3.html */ _define_property(_this, "shouldCatchErrorCode", void 0), _this.uuidService = uuidService, _this.name = 'YOUDAO', _this.shouldCatchErrorCode = new Map([ [ '207', Editor.I18n.t("".concat(_global.MainName, ".YOUDAO.207")) ], [ '301', Editor.I18n.t("".concat(_global.MainName, ".YOUDAO.301")) ], [ '302', Editor.I18n.t("".concat(_global.MainName, ".YOUDAO.302")) ], [ '1412', Editor.I18n.t("".concat(_global.MainName, ".YOUDAO.1412")) ], [ '2004', Editor.I18n.t("".concat(_global.MainName, ".YOUDAO.2004")) ], [ '2412', Editor.I18n.t("".concat(_global.MainName, ".YOUDAO.2412")) ], [ '3412', Editor.I18n.t("".concat(_global.MainName, ".YOUDAO.3412")) ] ]); return _this; } _create_class(YouDaoRepository, [ { key: "transformTranslateRequestConfig", value: function transformTranslateRequestConfig(translateRequest) { var salt = this.uuidService.v4(); var curtime = Math.round(new Date().getTime() / 1000); var query = translateRequest.query.filter(function(it) { return it && it.length > 0; }).join('\n').trim(); var sign = this.generateSign(translateRequest.appKey, translateRequest.appSecret, this.truncate(query), salt, curtime.toString()); var request = { q: query, from: translateRequest.from, to: translateRequest.to, appKey: translateRequest.appKey, salt: salt, sign: sign, signType: 'v3', curtime: curtime }; var formData = new _formdata.default(); var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined; try { for(var _iterator = Object.entries(request)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){ var _step_value = _sliced_to_array(_step.value, 2), key = _step_value[0], value = _step_value[1]; formData.append(key, value); } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally{ try { if (!_iteratorNormalCompletion && _iterator.return != null) { _iterator.return(); } } finally{ if (_didIteratorError) { throw _iteratorError; } } } return { url: translateRequest.url, method: 'post', data: formData, headers: formData.getHeaders() }; } }, { key: "transformTranslateResponse", value: function transformTranslateResponse(response) { if (response.status !== 200) { throw new _Errors.CustomError(_MainMessage.MessageCode.AUTO_TRANSLATE_NETWORK_ERROR, "".concat(response === null || response === void 0 ? void 0 : response.status, " ").concat(response === null || response === void 0 ? void 0 : response.statusText)); } if (this.shouldCatchErrorCode.has(response.data.errorCode)) { throw new _Errors.CustomError(_MainMessage.MessageCode.PROVIDER_INPUT_ERROR, Editor.I18n.t("".concat(_global.MainName, ".error.YOUDAO.error"), { errorCode: response.data.errorCode, message: this.shouldCatchErrorCode.get(response.data.errorCode) || '' })); } if (response.data.errorCode !== '0') { throw new _Errors.CustomError(_MainMessage.MessageCode.PROVIDER_INPUT_ERROR, Editor.I18n.t("".concat(_global.MainName, ".error.YOUDAO.errorCode"), { errorCode: response.data.errorCode })); } var translateResponse = response.data; return { translation: translateResponse.translation[0].split('\n'), status: parseInt(translateResponse.errorCode) }; } }, { /** * 生成有道翻译API的请求签名 */ key: "generateSign", value: function generateSign(appKey, appSecret, query, salt, curtime) { var str = "".concat(appKey).concat(query).concat(salt).concat(curtime).concat(appSecret); return _cryptojs.default.SHA256(str).toString(_cryptojs.default.enc.Hex); } }, { key: "truncate", value: function truncate(str) { var len = str.length; if (len <= 20) return str; else return "".concat(str.substring(0, 10)).concat(len).concat(str.substring(len - 10, len)); } } ]); return YouDaoRepository; }(_TranslateRepository.TranslateRepository); YouDaoRepository = _ts_decorate([ (0, _tsyringe.singleton)(), _ts_metadata("design:type", Function), _ts_metadata("design:paramtypes", [ typeof _UUIDService.default === "undefined" ? Object : _UUIDService.default ]) ], YouDaoRepository); /***/ }), /***/ "./src/lib/core/service/EditorMessageService.ts": /*!******************************************************!*\ !*** ./src/lib/core/service/EditorMessageService.ts ***! \******************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* eslint-disable prefer-rest-params */ Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "default", ({ enumerable: true, get: function() { return EditorMessageService; } })); var _tsyringe = __webpack_require__(/*! tsyringe */ "./node_modules/tsyringe/dist/esm5/index.js"); var _global = __webpack_require__(/*! ./util/global */ "./src/lib/core/service/util/global.ts"); function _array_like_to_array(arr, len) { if (len == null || len > arr.length) len = arr.length; for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i]; return arr2; } function _array_without_holes(arr) { if (Array.isArray(arr)) return _array_like_to_array(arr); } function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _async_to_generator(fn) { return function() { var self = this, args = arguments; return new Promise(function(resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } function _class_call_check(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for(var i = 0; i < props.length; i++){ var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _create_class(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _iterable_to_array(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _non_iterable_spread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _to_consumable_array(arr) { return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread(); } function _unsupported_iterable_to_array(o, minLen) { if (!o) return; if (typeof o === "string") return _array_like_to_array(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen); } function _ts_decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; } function _ts_generator(thisArg, body) { var f, y, t, g, _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }; 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(_)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 }; } } var EditorMessageService = /*#__PURE__*/ function() { "use strict"; function EditorMessageService() { _class_call_check(this, EditorMessageService); } _create_class(EditorMessageService, [ { key: "refreshPreview", value: function refreshPreview() { return _async_to_generator(function() { return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, Editor.Message.request('preview', 'reload-terminal') ]; case 1: return [ 2, _state.sent() ]; } }); })(); } }, { key: "queryUUID", value: function queryUUID(url) { return _async_to_generator(function() { return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, Editor.Message.request('asset-db', 'query-uuid', url) ]; case 1: return [ 2, _state.sent() ]; } }); })(); } }, { key: "queryAssets", value: function queryAssets(options) { return _async_to_generator(function() { return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, Editor.Message.request('asset-db', 'query-assets', options) ]; case 1: return [ 2, _state.sent() ]; } }); })(); } }, { key: "queryAssetInfo", value: function queryAssetInfo(filePath) { return _async_to_generator(function() { return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, Editor.Message.request('asset-db', 'query-asset-info', filePath) ]; case 1: return [ 2, _state.sent() ]; } }); })(); } }, { key: "executePanelMethod", value: function executePanelMethod(method) { for(var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){ args[_key - 1] = arguments[_key]; } var _Editor_Message; (_Editor_Message = Editor.Message).send.apply(_Editor_Message, [ _global.MainName, 'execute-panel-method', method ].concat(_to_consumable_array(args))); } }, { key: "scanProgress", value: function scanProgress(finished, total) { this.executePanelMethod.apply(this, [ 'scanProgress' ].concat(Array.prototype.slice.call(arguments))); } }, { key: "translateProgress", value: function translateProgress(finished, total, locale) { this.executePanelMethod.apply(this, [ 'translateProgress' ].concat(Array.prototype.slice.call(arguments))); } }, { key: "compileProgress", value: function compileProgress(finished, total, locale) { this.executePanelMethod.apply(this, [ 'compileProgress' ].concat(Array.prototype.slice.call(arguments))); } }, { key: "importProgress", value: function importProgress(finished, total, locale) { this.executePanelMethod.apply(this, [ 'importProgress' ].concat(Array.prototype.slice.call(arguments))); } }, { key: "queryDirty", value: function queryDirty() { return _async_to_generator(function() { return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, Editor.Message.request('scene', 'query-dirty') ]; case 1: return [ 2, _state.sent() ]; } }); })(); } }, { key: "deleteAsset", value: function deleteAsset(url) { return _async_to_generator(function() { var e; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: if (url && !url.startsWith('db://')) { url = "db://".concat(url); } _state.label = 1; case 1: _state.trys.push([ 1, 3, , 4 ]); return [ 4, Editor.Message.request('asset-db', 'delete-asset', url) ]; case 2: return [ 2, _state.sent() ]; case 3: e = _state.sent(); return [ 2, undefined ]; case 4: return [ 2 ]; } }); })(); } }, { key: "refreshAssets", value: function refreshAssets(url) { return _async_to_generator(function() { return _ts_generator(this, function(_state) { switch(_state.label){ case 0: if (url && !url.startsWith('db://')) { url = "db://".concat(url); } return [ 4, Editor.Message.request('asset-db', 'refresh-asset', url !== null && url !== void 0 ? url : 'db://assets') ]; case 1: _state.sent(); return [ 2 ]; } }); })(); } }, { key: "softReload", value: function softReload() { Editor.Message.send('scene', 'soft-reload'); } }, { key: "reImport", value: function reImport(url) { Editor.Message.send('asset-db', 'reimport-asset', url); } }, { key: "openPanel", value: function openPanel() { Editor.Panel.open(_global.MainName); } }, { key: "closePanel", value: function closePanel() { Editor.Panel.close(_global.MainName); } }, { key: "queryIsReady", value: function queryIsReady() { return _async_to_generator(function() { return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, Editor.Message.request('scene', 'query-is-ready') ]; case 1: return [ 2, _state.sent() ]; } }); })(); } }, { key: "queryCurrentScene", value: function queryCurrentScene() { return _async_to_generator(function() { return _ts_generator(this, function(_state) { switch(_state.label){ case 0: return [ 4, Editor.Message.request('scene', 'query-current-scene') ]; case 1: return [ 2, _state.sent() ]; } }); })(); } } ]); return EditorMessageService; }(); EditorMessageService = _ts_decorate([ (0, _tsyringe.singleton)() ], EditorMessageService); /***/ }), /***/ "./src/lib/core/service/util/EventBusService.ts": /*!******************************************************!*\ !*** ./src/lib/core/service/util/EventBusService.ts ***! \******************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "default", ({ enumerable: true, get: function() { return EventBusService; } })); var _events = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! events */ "events")); var _tsyringe = __webpack_require__(/*! tsyringe */ "./node_modules/tsyringe/dist/esm5/index.js"); function _array_like_to_array(arr, len) { if (len == null || len > arr.length) len = arr.length; for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i]; return arr2; } function _array_without_holes(arr) { if (Array.isArray(arr)) return _array_like_to_array(arr); } function _assert_this_initialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _call_super(_this, derived, args) { derived = _get_prototype_of(derived); return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args)); } function _class_call_check(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for(var i = 0; i < props.length; i++){ var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _create_class(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function get(target, property, receiver) { var base = _super_prop_base(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver || target); } return desc.value; }; } return _get(target, property, receiver || target); } function _get_prototype_of(o) { _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _get_prototype_of(o); } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _set_prototype_of(subClass, superClass); } function _interop_require_default(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _iterable_to_array(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _non_iterable_spread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _possible_constructor_return(self, call) { if (call && (_type_of(call) === "object" || typeof call === "function")) { return call; } return _assert_this_initialized(self); } function _set_prototype_of(o, p) { _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _set_prototype_of(o, p); } function _super_prop_base(object, property) { while(!Object.prototype.hasOwnProperty.call(object, property)){ object = _get_prototype_of(object); if (object === null) break; } return object; } function _to_consumable_array(arr) { return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread(); } function _type_of(obj) { "@swc/helpers - typeof"; return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj; } function _unsupported_iterable_to_array(o, minLen) { if (!o) return; if (typeof o === "string") return _array_like_to_array(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen); } function _is_native_reflect_construct() { try { var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); } catch (_) {} return (_is_native_reflect_construct = function() { return !!result; })(); } function _ts_decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; } var EventBusService = /*#__PURE__*/ function(EventEmitter) { "use strict"; _inherits(EventBusService, EventEmitter); function EventBusService() { _class_call_check(this, EventBusService); return _call_super(this, EventBusService, arguments); } _create_class(EventBusService, [ { key: "on", value: function on(eventName, listener) { return _get(_get_prototype_of(EventBusService.prototype), "on", this).call(this, eventName, listener); } }, { key: "once", value: function once(eventName, listener) { return _get(_get_prototype_of(EventBusService.prototype), "once", this).call(this, eventName, listener); } }, { key: "off", value: function off(eventName, listener) { return _get(_get_prototype_of(EventBusService.prototype), "off", this).call(this, eventName, listener); } }, { key: "emit", value: function emit(eventName) { for(var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){ args[_key - 1] = arguments[_key]; } var _$_get; return (_$_get = _get(_get_prototype_of(EventBusService.prototype), "emit", this)).call.apply(_$_get, [ this, eventName ].concat(_to_consumable_array(args))); } } ]); return EventBusService; }(_events.default); EventBusService = _ts_decorate([ (0, _tsyringe.singleton)() ], EventBusService); /***/ }), /***/ "./src/lib/core/service/util/UUIDService.ts": /*!**************************************************!*\ !*** ./src/lib/core/service/util/UUIDService.ts ***! \**************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "default", ({ enumerable: true, get: function() { return UUIDService; } })); var _tsyringe = __webpack_require__(/*! tsyringe */ "./node_modules/tsyringe/dist/esm5/index.js"); function _class_call_check(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for(var i = 0; i < props.length; i++){ var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _create_class(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _ts_decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; } var UUIDService = /*#__PURE__*/ function() { "use strict"; function UUIDService() { _class_call_check(this, UUIDService); } _create_class(UUIDService, [ { key: "v4", value: /** * Generate a version 4 UUID */ function v4() { var v4 = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { var r = Math.random() * 16 | 0; var v = c === 'x' ? r : r & 0x3 | 0x8; return v.toString(16); }); return this.compress(v4); } }, { key: "compress", value: /** * compress a UUID to a short string */ function compress(uuid) { if (typeof Editor !== 'undefined') { return Editor.Utils.UUID.compressUUID(uuid, false); } else { return uuid; } } } ]); return UUIDService; }(); UUIDService = _ts_decorate([ (0, _tsyringe.singleton)() ], UUIDService); /***/ }), /***/ "./src/lib/core/service/util/global.ts": /*!*********************************************!*\ !*** ./src/lib/core/service/util/global.ts ***! \*********************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); function _export(target, all) { for(var name in all)Object.defineProperty(target, name, { enumerable: true, get: all[name] }); } _export(exports, { ALLOW_NAMESPACE: function() { return ALLOW_NAMESPACE; }, ASSET_NAMESPACE: function() { return ASSET_NAMESPACE; }, DEFAULT_NAMESPACE: function() { return DEFAULT_NAMESPACE; }, MainName: function() { return MainName; }, ProjectAssetPath: function() { return ProjectAssetPath; }, RuntimeBundleName: function() { return RuntimeBundleName; }, resourceBundlePath: function() { return resourceBundlePath; }, resourceListPath: function() { return resourceListPath; } }); var _path = __webpack_require__(/*! path */ "path"); var MainName = 'localization-editor'; var ProjectAssetPath = (0, _path.join)(Editor.Project.path, 'assets'); var RuntimeBundleName = 'l10n'; var resourceListPath = 'resource-list'; var resourceBundlePath = 'resource-bundle'; var DEFAULT_NAMESPACE = 'translation'; var ASSET_NAMESPACE = 'asset'; var ALLOW_NAMESPACE = [ DEFAULT_NAMESPACE, ASSET_NAMESPACE ]; /***/ }), /***/ "./src/lib/core/type/type.ts": /*!***********************************!*\ !*** ./src/lib/core/type/type.ts ***! \***********************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "TranslateFileType", ({ enumerable: true, get: function() { return TranslateFileType; } })); var TranslateFileType = /*#__PURE__*/ function(TranslateFileType) { TranslateFileType[TranslateFileType["PO"] = 0] = "PO"; TranslateFileType[TranslateFileType["CSV"] = 1] = "CSV"; TranslateFileType[TranslateFileType["XLSX"] = 2] = "XLSX"; return TranslateFileType; }({}); /***/ }), /***/ "./src/lib/core/writer/CSVWriter.ts": /*!******************************************!*\ !*** ./src/lib/core/writer/CSVWriter.ts ***! \******************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "default", ({ enumerable: true, get: function() { return CSVWriter; } })); var _type = __webpack_require__(/*! ../type/type */ "./src/lib/core/type/type.ts"); var _tsyringe = __webpack_require__(/*! tsyringe */ "./node_modules/tsyringe/dist/esm5/index.js"); var _sync = __webpack_require__(/*! csv-stringify/sync */ "./node_modules/csv-stringify/dist/cjs/sync.cjs"); var _fsextra = __webpack_require__(/*! fs-extra */ "./node_modules/fs-extra/lib/index.js"); var _TranslateItemType = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ../entity/translate/TranslateItemType */ "./src/lib/core/entity/translate/TranslateItemType.ts")); function _array_like_to_array(arr, len) { if (len == null || len > arr.length) len = arr.length; for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i]; return arr2; } function _array_with_holes(arr) { if (Array.isArray(arr)) return arr; } function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _async_to_generator(fn) { return function() { var self = this, args = arguments; return new Promise(function(resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } function _class_call_check(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for(var i = 0; i < props.length; i++){ var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _create_class(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _define_property(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _interop_require_default(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _iterable_to_array_limit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){ _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally{ try { if (!_n && _i["return"] != null) _i["return"](); } finally{ if (_d) throw _e; } } return _arr; } function _non_iterable_rest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _sliced_to_array(arr, i) { return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest(); } function _unsupported_iterable_to_array(o, minLen) { if (!o) return; if (typeof o === "string") return _array_like_to_array(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen); } function _ts_decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; } function _ts_generator(thisArg, body) { var f, y, t, g, _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }; 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(_)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 }; } } function _ts_metadata(k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); } function _ts_param(paramIndex, decorator) { return function(target, key) { decorator(target, key, paramIndex); }; } var CSVWriter = /*#__PURE__*/ function() { "use strict"; function CSVWriter(pluralRules) { _class_call_check(this, CSVWriter); _define_property(this, "pluralRules", void 0); _define_property(this, "type", void 0); this.pluralRules = pluralRules; this.type = _type.TranslateFileType.CSV; } _create_class(CSVWriter, [ { key: "write", value: function write(filePath, data, local) { var _this = this; return _async_to_generator(function() { var csvTranslateItems, content; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: csvTranslateItems = _this.generateCsvTranslateItems(local, data); content = (0, _sync.stringify)(csvTranslateItems, { header: true, columns: [ 'key', 'sourceValue', 'targetValue' ] }); return [ 4, (0, _fsextra.writeFile)(filePath, content, 'utf-8') ]; case 1: _state.sent(); return [ 2 ]; } }); })(); } }, { key: "generateCsvTranslateItems", value: function generateCsvTranslateItems(source, target) { var csvTranslateItems = [ { key: CSVWriter.LocaleKey, sourceValue: source.locale, targetValue: target.locale } ]; var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined; try { for(var _iterator = source.items.entries()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){ var _step_value = _sliced_to_array(_step.value, 2), key = _step_value[0], sourceItem = _step_value[1]; var targetItem = target.items.get(key); if (sourceItem.type === _TranslateItemType.default.Media) { continue; } var _targetItem_value; csvTranslateItems.push({ key: key, sourceValue: sourceItem.value, targetValue: (_targetItem_value = targetItem === null || targetItem === void 0 ? void 0 : targetItem.value) !== null && _targetItem_value !== void 0 ? _targetItem_value : '' }); var _targetItem_variants_length; if (sourceItem.variants.length > 0 || ((_targetItem_variants_length = targetItem === null || targetItem === void 0 ? void 0 : targetItem.variants.length) !== null && _targetItem_variants_length !== void 0 ? _targetItem_variants_length : 0) > 0) { var _this_pluralRules__language; var plurals = (_this_pluralRules__language = this.pluralRules[new Intl.Locale(target.locale).language]) !== null && _this_pluralRules__language !== void 0 ? _this_pluralRules__language : [ 'other' ]; var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined; try { var _loop = function() { var plural = _step1.value; var _targetItem_variants; var variant = targetItem === null || targetItem === void 0 ? void 0 : (_targetItem_variants = targetItem.variants) === null || _targetItem_variants === void 0 ? void 0 : _targetItem_variants.find(function(it) { return it.key.endsWith(plural); }); var _variant_key, _variant_value; csvTranslateItems.push({ key: (_variant_key = variant === null || variant === void 0 ? void 0 : variant.key) !== null && _variant_key !== void 0 ? _variant_key : "".concat(key, "_").concat(plural), sourceValue: '', targetValue: (_variant_value = variant === null || variant === void 0 ? void 0 : variant.value) !== null && _variant_value !== void 0 ? _variant_value : '' }); }; for(var _iterator1 = plurals[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true)_loop(); } catch (err) { _didIteratorError1 = true; _iteratorError1 = err; } finally{ try { if (!_iteratorNormalCompletion1 && _iterator1.return != null) { _iterator1.return(); } } finally{ if (_didIteratorError1) { throw _iteratorError1; } } } } } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally{ try { if (!_iteratorNormalCompletion && _iterator.return != null) { _iterator.return(); } } finally{ if (_didIteratorError) { throw _iteratorError; } } } return csvTranslateItems; } } ]); return CSVWriter; }(); _define_property(CSVWriter, "LocaleKey", 'LanguageTag'); CSVWriter = _ts_decorate([ (0, _tsyringe.singleton)(), _ts_param(0, (0, _tsyringe.inject)('PluralRules')), _ts_metadata("design:type", Function), _ts_metadata("design:paramtypes", [ typeof _type.PluralRules === "undefined" ? Object : _type.PluralRules ]) ], CSVWriter); /***/ }), /***/ "./src/lib/core/writer/POWriter.ts": /*!*****************************************!*\ !*** ./src/lib/core/writer/POWriter.ts ***! \*****************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "default", ({ enumerable: true, get: function() { return POWriter; } })); var _tsyringe = __webpack_require__(/*! tsyringe */ "./node_modules/tsyringe/dist/esm5/index.js"); var _PoHeader = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ../entity/gettext/PoHeader */ "./src/lib/core/entity/gettext/PoHeader.ts")); var _gettextparser = __webpack_require__(/*! gettext-parser */ "./node_modules/gettext-parser/index.js"); var _fsextra = __webpack_require__(/*! fs-extra */ "./node_modules/fs-extra/lib/index.js"); var _TranslateItemType = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ../entity/translate/TranslateItemType */ "./src/lib/core/entity/translate/TranslateItemType.ts")); var _type = __webpack_require__(/*! ../type/type */ "./src/lib/core/type/type.ts"); function _array_like_to_array(arr, len) { if (len == null || len > arr.length) len = arr.length; for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i]; return arr2; } function _array_with_holes(arr) { if (Array.isArray(arr)) return arr; } function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _async_to_generator(fn) { return function() { var self = this, args = arguments; return new Promise(function(resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } function _class_call_check(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for(var i = 0; i < props.length; i++){ var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _create_class(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _define_property(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _interop_require_default(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _iterable_to_array_limit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){ _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally{ try { if (!_n && _i["return"] != null) _i["return"](); } finally{ if (_d) throw _e; } } return _arr; } function _non_iterable_rest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _sliced_to_array(arr, i) { return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest(); } function _unsupported_iterable_to_array(o, minLen) { if (!o) return; if (typeof o === "string") return _array_like_to_array(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen); } function _ts_decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; } function _ts_generator(thisArg, body) { var f, y, t, g, _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }; 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(_)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 }; } } function _ts_metadata(k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); } function _ts_param(paramIndex, decorator) { return function(target, key) { decorator(target, key, paramIndex); }; } var POWriter = /*#__PURE__*/ function() { "use strict"; function POWriter(pluralRules) { _class_call_check(this, POWriter); _define_property(this, "pluralRules", void 0); _define_property(this, "type", void 0); this.pluralRules = pluralRules; this.type = _type.TranslateFileType.PO; } _create_class(POWriter, [ { key: "write", value: function write(filePath, data, local) { var _this = this; return _async_to_generator(function() { var header, translations, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, _step_value, key, item, gettextTranslations, poContentBuffer; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: header = new _PoHeader.default(data.locale, 'CocosCreator', 'cocosCreator', new Date().toUTCString(), new Date().toUTCString(), '', ''); translations = {}; _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined; try { for(_iterator = local.items.entries()[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){ _step_value = _sliced_to_array(_step.value, 2), key = _step_value[0], item = _step_value[1]; if (item.type === _TranslateItemType.default.Media) { continue; } translations[key] = _this.transform(item, data.locale, data.items.get(key)); } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally{ try { if (!_iteratorNormalCompletion && _iterator.return != null) { _iterator.return(); } } finally{ if (_didIteratorError) { throw _iteratorError; } } } gettextTranslations = { charset: 'utf-8', headers: header, translations: { '': translations } }; poContentBuffer = _gettextparser.po.compile(gettextTranslations, { escapeCharacters: true }); return [ 4, (0, _fsextra.writeFile)(filePath, poContentBuffer, 'utf-8') ]; case 1: _state.sent(); return [ 2 ]; } }); })(); } }, { key: "transform", value: function transform(localItem, locale, item) { var _this = this; var comment = { extracted: '', flag: '', previous: '', reference: localItem.key, translator: '' }; return { comments: comment, msgid: localItem.value, msgid_plural: function() { if (item && item.variants.length > 0) { return item.value; } if (localItem.variants.length > 0) { return localItem.value; } return undefined; }(), msgstr: function() { if (localItem.variants.length > 0) { var _this_pluralRules__language; var plurals = (_this_pluralRules__language = _this.pluralRules[new Intl.Locale(locale).language]) !== null && _this_pluralRules__language !== void 0 ? _this_pluralRules__language : [ 'other' ]; return plurals.map(function(plural) { var variant = item === null || item === void 0 ? void 0 : item.variants.find(function(it) { return it.key.endsWith(plural); }); var _variant_value; return (_variant_value = variant === null || variant === void 0 ? void 0 : variant.value) !== null && _variant_value !== void 0 ? _variant_value : ''; }); } else { var _item_value; return [ (_item_value = item === null || item === void 0 ? void 0 : item.value) !== null && _item_value !== void 0 ? _item_value : '' ]; } }() }; } } ]); return POWriter; }(); POWriter = _ts_decorate([ (0, _tsyringe.singleton)(), _ts_param(0, (0, _tsyringe.inject)('PluralRules')), _ts_metadata("design:type", Function), _ts_metadata("design:paramtypes", [ typeof _type.PluralRules === "undefined" ? Object : _type.PluralRules ]) ], POWriter); /***/ }), /***/ "./src/lib/core/writer/XLSXWriter.ts": /*!*******************************************!*\ !*** ./src/lib/core/writer/XLSXWriter.ts ***! \*******************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "default", ({ enumerable: true, get: function() { return XLSXWriter; } })); var _CSVWriter = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ./CSVWriter */ "./src/lib/core/writer/CSVWriter.ts")); var _tsyringe = __webpack_require__(/*! tsyringe */ "./node_modules/tsyringe/dist/esm5/index.js"); var _type = __webpack_require__(/*! ../type/type */ "./src/lib/core/type/type.ts"); var _xlsx = __webpack_require__(/*! xlsx */ "./node_modules/xlsx/xlsx.mjs"); var _fsextra = __webpack_require__(/*! fs-extra */ "./node_modules/fs-extra/lib/index.js"); function _assert_this_initialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _async_to_generator(fn) { return function() { var self = this, args = arguments; return new Promise(function(resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } function _call_super(_this, derived, args) { derived = _get_prototype_of(derived); return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args)); } function _class_call_check(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for(var i = 0; i < props.length; i++){ var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _create_class(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _define_property(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _get_prototype_of(o) { _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _get_prototype_of(o); } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _set_prototype_of(subClass, superClass); } function _interop_require_default(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _possible_constructor_return(self, call) { if (call && (_type_of(call) === "object" || typeof call === "function")) { return call; } return _assert_this_initialized(self); } function _set_prototype_of(o, p) { _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _set_prototype_of(o, p); } function _type_of(obj) { "@swc/helpers - typeof"; return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj; } function _is_native_reflect_construct() { try { var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); } catch (_) {} return (_is_native_reflect_construct = function() { return !!result; })(); } function _ts_decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; } function _ts_generator(thisArg, body) { var f, y, t, g, _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }; 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(_)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 }; } } var XLSXWriter = /*#__PURE__*/ function(CSVWriter) { "use strict"; _inherits(XLSXWriter, CSVWriter); function XLSXWriter() { _class_call_check(this, XLSXWriter); var _this; _this = _call_super(this, XLSXWriter, arguments), _define_property(_this, "type", _type.TranslateFileType.XLSX); return _this; } _create_class(XLSXWriter, [ { key: "write", value: function write(filePath, data, local) { var _this = this; return _async_to_generator(function() { var csvTranslateItems, header, worksheet, workbook, maxWidths, buffer; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: csvTranslateItems = _this.generateCsvTranslateItems(local, data); header = [ 'key', 'sourceValue', 'targetValue' ]; worksheet = _xlsx.utils.json_to_sheet(csvTranslateItems, { header: header }); workbook = _xlsx.utils.book_new(); _xlsx.utils.book_append_sheet(workbook, worksheet, data.locale); maxWidths = header.map(function(head) { return csvTranslateItems.reduce(function(max, item) { return Math.max(max, item[head].length); }, head.length); }); worksheet['!cols'] = maxWidths.map(function(maxWidth) { return { wch: maxWidth }; }); buffer = (0, _xlsx.write)(workbook, { type: 'buffer', bookType: 'xlsx' }); return [ 4, (0, _fsextra.writeFile)(filePath, buffer, { encoding: 'utf-8' }) ]; case 1: _state.sent(); return [ 2 ]; } }); })(); } } ]); return XLSXWriter; }(_CSVWriter.default); XLSXWriter = _ts_decorate([ (0, _tsyringe.singleton)() ], XLSXWriter); /***/ }), /***/ "./src/panel/default/index.ts": /*!************************************!*\ !*** ./src/panel/default/index.ts ***! \************************************/ /***/ ((module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); function _export(target, all) { for(var name in all)Object.defineProperty(target, name, { enumerable: true, get: all[name] }); } _export(exports, { PanelTranslateData: function() { return _PanelTranslateData.PanelTranslateData; }, pluralRules: function() { return pluralRules; } }); __webpack_require__(/*! reflect-metadata */ "./node_modules/reflect-metadata/Reflect.js"); __webpack_require__(/*! ../../lib/core/container-registry */ "./src/lib/core/container-registry.ts"); var _vue = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.cjs.js"); var _defaultappvue = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ./component/default-app.vue */ "./src/panel/default/component/default-app.vue")); var _tsyringe = __webpack_require__(/*! tsyringe */ "./node_modules/tsyringe/dist/esm5/index.js"); var _EventBusService = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ../../lib/core/service/util/EventBusService */ "./src/lib/core/service/util/EventBusService.ts")); var _defaultappless = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ./component/default-app.less */ "./src/panel/default/component/default-app.less")); var _PanelTranslateData = __webpack_require__(/*! ../share/scripts/PanelTranslateData */ "./src/panel/share/scripts/PanelTranslateData.ts"); function _array_like_to_array(arr, len) { if (len == null || len > arr.length) len = arr.length; for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i]; return arr2; } function _array_without_holes(arr) { if (Array.isArray(arr)) return _array_like_to_array(arr); } function _interop_require_default(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _iterable_to_array(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _non_iterable_spread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _to_consumable_array(arr) { return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread(); } function _unsupported_iterable_to_array(o, minLen) { if (!o) return; if (typeof o === "string") return _array_like_to_array(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen); } var pluralRules = _tsyringe.container.resolve('PluralRules'); var eventBusService = _tsyringe.container.resolve(_EventBusService.default); var weakMap = new WeakMap(); module.exports = Editor.Panel.define({ listeners: { show: function show() {}, hide: function hide() {} }, template: '<div id="app"></div>', style: _defaultappless.default, $: { app: '#app' }, ready: function ready() { // 使用 data if (this.$.app) { // @ts-ignore var app = (0, _vue.createApp)(_defaultappvue.default); app.mount(this.$.app); weakMap.set(this, app); } }, methods: { executePanelMethod: function executePanelMethod(method) { for(var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){ args[_key - 1] = arguments[_key]; } var // @ts-ignore _eventBusService; (_eventBusService = eventBusService).emit.apply(_eventBusService, [ method ].concat(_to_consumable_array(args))); } }, beforeClose: function beforeClose() {}, close: function close() { var app = weakMap.get(this); if (app) { app.unmount(); } } }); /***/ }), /***/ "./src/panel/share/scripts/Iterator.ts": /*!*********************************************!*\ !*** ./src/panel/share/scripts/Iterator.ts ***! \*********************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * 能够被面板索引的数组的每一项 */ Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "default", ({ enumerable: true, get: function() { return Iterator; } })); function _class_call_check(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _define_property(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var Iterator = function Iterator(value) { "use strict"; _class_call_check(this, Iterator); _define_property(this, "value", void 0); _define_property(this, "__key", void 0); this.value = value; this.__key = "".concat(Date.now().toString(), "-").concat(Math.random()); }; /***/ }), /***/ "./src/panel/share/scripts/PanelTranslateData.ts": /*!*******************************************************!*\ !*** ./src/panel/share/scripts/PanelTranslateData.ts ***! \*******************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "PanelTranslateData", ({ enumerable: true, get: function() { return PanelTranslateData; } })); var _languageMap = __webpack_require__(/*! ./libs/languageMap */ "./src/panel/share/scripts/libs/languageMap.ts"); var _tsyringe = __webpack_require__(/*! tsyringe */ "./node_modules/tsyringe/dist/esm5/index.js"); var _WrapperMainIPC = /*#__PURE__*/ _interop_require_default(__webpack_require__(/*! ../../../lib/core/ipc/WrapperMainIPC */ "./src/lib/core/ipc/WrapperMainIPC.ts")); function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _async_to_generator(fn) { return function() { var self = this, args = arguments; return new Promise(function(resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } function _class_call_check(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for(var i = 0; i < props.length; i++){ var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _create_class(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _define_property(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _interop_require_default(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _ts_generator(thisArg, body) { var f, y, t, g, _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }; 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(_)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 }; } } var PanelTranslateData = /*#__PURE__*/ function() { "use strict"; function PanelTranslateData(bcp47Tag, displayName, /** 语言的字体的名称 */ fontName, /** 原始语言的字体的名称 */ localFontName, /** 翻译数据 key 为原文的 key 值为当前语言的值 */ items) { _class_call_check(this, PanelTranslateData); _define_property(this, "bcp47Tag", void 0); _define_property(this, "displayName", void 0); _define_property(this, "fontName", void 0); _define_property(this, "localFontName", void 0); _define_property(this, "items", void 0); this.bcp47Tag = bcp47Tag; this.displayName = displayName; this.fontName = fontName; this.localFontName = localFontName; this.items = items; } _create_class(PanelTranslateData, [ { key: "locale", get: function get() { return this.bcp47Tag; } } ], [ { key: "getPanelTranslateData", value: /** * 获取单个翻译数据 * @param language 如果没有指定语言则返回当前的本地的语言的数据 */ function getPanelTranslateData(language) { return _async_to_generator(function() { var wrapper, items, targetConfig, localLanguage, wrapperTranslateItemMap, index, item; return _ts_generator(this, function(_state) { switch(_state.label){ case 0: wrapper = _tsyringe.container.resolve(_WrapperMainIPC.default); return [ 4, wrapper.getTranslateData(language) ]; case 1: items = _state.sent(); return [ 4, wrapper.getLanguageConfig(language) ]; case 2: targetConfig = _state.sent(); return [ 4, wrapper.getLocalLanguage() ]; case 3: localLanguage = _state.sent(); if (!targetConfig || !localLanguage) { return [ 2, null ]; } wrapperTranslateItemMap = {}; for(index = 0; index < items.length; index++){ item = items[index]; wrapperTranslateItemMap[item.key] = item; } return [ 2, new PanelTranslateData(targetConfig.bcp47Tag, (0, _languageMap.getLanguageDisplayName)(targetConfig.bcp47Tag), '', '', wrapperTranslateItemMap) ]; } }); })(); } } ]); return PanelTranslateData; }(); /***/ }), /***/ "./src/panel/share/scripts/libs/languageMap.ts": /*!*****************************************************!*\ !*** ./src/panel/share/scripts/libs/languageMap.ts ***! \*****************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); function _export(target, all) { for(var name in all)Object.defineProperty(target, name, { enumerable: true, get: all[name] }); } _export(exports, { getLanguageDisplayName: function() { return getLanguageDisplayName; }, languageMap: function() { return languageMap; } }); var _global = __webpack_require__(/*! ../../../../lib/core/service/util/global */ "./src/lib/core/service/util/global.ts"); var languageMap = { 'af': [ 'af-ZA', 'af-NA' ], 'agq': [ 'agq-CM', 'agq' ], 'ak': [ 'ak-GH', 'ak' ], 'am': [ 'am-ET', 'am' ], 'ar': [ 'ar-YE', 'ar-TN', 'ar-TD', 'ar-SY', 'ar-SS', 'ar-SO', 'ar-SD', 'ar-SA', 'ar-QA', 'ar-PS', 'ar-OM', 'ar-MR', 'ar-MA', 'ar-LY', 'ar-LB', 'ar-KW', 'ar-KM', 'ar-JO', 'ar-IQ', 'ar-IL', 'ar-ER', 'ar-EH', 'ar-EG', 'ar-DZ', 'ar-DJ', 'ar-BH', 'ar-AE', 'ar-001', 'ar' ], 'as': [ 'as-IN', 'as' ], 'asa': [ 'asa-TZ', 'asa' ], 'ast': [ 'ast-ES', 'ast' ], 'az': [ 'az-Latn-AZ', 'az-Latn', 'az-Cyrl-AZ', 'az-Cyrl', 'az' ], 'bas': [ 'bas-CM', 'bas' ], 'be': [ 'be-TARASK', 'be-BY', 'be' ], 'bem': [ 'bem-ZM', 'bem' ], 'bez': [ 'bez-TZ', 'bez' ], 'bg': [ 'bg-BG', 'bg' ], 'bm': [ 'bm-ML', 'bm' ], 'bn': [ 'bn-IN', 'bn-BD', 'bn' ], 'br': [ 'br-FR', 'br' ], 'brx': [ 'brx-IN', 'brx' ], 'bs': [ 'bs-Latn-BA', 'bs-Latn', 'bs-Cyrl-BA', 'bs-Cyrl', 'bs' ], 'ca': [ 'ca-IT', 'ca-FR', 'ca-ES-VALENCIA', 'ca-ES', 'ca-AD', 'ca' ], 'ccp': [ 'ccp-IN', 'ccp-BD', 'ccp' ], 'ce': [ 'ce-RU', 'ce' ], 'ceb': [ 'ceb-PH', 'ceb' ], 'cgg': [ 'cgg-UG', 'cgg' ], 'chr': [ 'chr-US', 'chr' ], 'ckb': [ 'ckb-IR', 'ckb-IQ', 'ckb' ], 'cs': [ 'cs-CZ', 'cs' ], 'cy': [ 'cy-GB', 'cy' ], 'da': [ 'da-GL', 'da-DK', 'da' ], 'dav': [ 'dav-KE', 'dav' ], 'de': [ 'de-LU', 'de-LI', 'de-IT', 'de-DE', 'de-CH', 'de-BE', 'de-AT', 'de' ], 'dje': [ 'dje-NE', 'dje' ], 'doi': [ 'doi-IN', 'doi' ], 'dsb': [ 'dsb-DE', 'dsb' ], 'dua': [ 'dua-CM', 'dua' ], 'dyo': [ 'dyo-SN', 'dyo' ], 'dz': [ 'dz-BT', 'dz' ], 'ebu': [ 'ebu-KE', 'ebu' ], 'ee': [ 'ee-TG', 'ee-GH', 'ee' ], 'el': [ 'el-GR', 'el-CY', 'el' ], 'en': [ 'en-ZW', 'en-ZM', 'en-ZA', 'en-WS', 'en-VU', 'en-VI', 'en-VG', 'en-VC', 'en-US-POSIX', 'en-US', 'en-UM', 'en-UG', 'en-TZ', 'en-TV', 'en-TT', 'en-TO', 'en-TK', 'en-TC', 'en-SZ', 'en-SX', 'en-SS', 'en-SL', 'en-SI', 'en-SH', 'en-SG', 'en-SE', 'en-SD', 'en-SC', 'en-SB', 'en-RW', 'en-PW', 'en-PR', 'en-PN', 'en-PK', 'en-PH', 'en-PG', 'en-NZ', 'en-NU', 'en-NR', 'en-NL', 'en-NG', 'en-NF', 'en-NA', 'en-MY', 'en-MW', 'en-MV', 'en-MU', 'en-MT', 'en-MS', 'en-MP', 'en-MO', 'en-MH', 'en-MG', 'en-LS', 'en-LR', 'en-LC', 'en-KY', 'en-KN', 'en-KI', 'en-KE', 'en-JM', 'en-JE', 'en-IO', 'en-IN', 'en-IM', 'en-IL', 'en-IE', 'en-HK', 'en-GY', 'en-GU', 'en-GM', 'en-GI', 'en-GH', 'en-GG', 'en-GD', 'en-GB', 'en-FM', 'en-FK', 'en-FJ', 'en-FI', 'en-ER', 'en-DM', 'en-DK', 'en-DG', 'en-DE', 'en-CY', 'en-CX', 'en-CM', 'en-CK', 'en-CH', 'en-CC', 'en-CA', 'en-BZ', 'en-BW', 'en-BS', 'en-BM', 'en-BI', 'en-BE', 'en-BB', 'en-AU', 'en-AT', 'en-AS', 'en-AI', 'en-AG', 'en-AE', 'en-150', 'en-001', 'en' ], 'eo': [ 'eo-001', 'eo' ], 'es': [ 'es-VE', 'es-UY', 'es-US', 'es-SV', 'es-PY', 'es-PR', 'es-PH', 'es-PE', 'es-PA', 'es-NI', 'es-MX', 'es-IC', 'es-HN', 'es-GT', 'es-GQ', 'es-ES', 'es-EC', 'es-EA', 'es-DO', 'es-CU', 'es-CR', 'es-CO', 'es-CL', 'es-BZ', 'es-BR', 'es-BO', 'es-AR', 'es-419', 'es' ], 'et': [ 'et-EE', 'et' ], 'eu': [ 'eu-ES', 'eu' ], 'ewo': [ 'ewo-CM', 'ewo' ], 'fa': [ 'fa-IR', 'fa-AF', 'fa' ], 'ff': [ 'ff-Latn-SN', 'ff-Latn-SL', 'ff-Latn-NG', 'ff-Latn-NE', 'ff-Latn-MR', 'ff-Latn-LR', 'ff-Latn-GW', 'ff-Latn-GN', 'ff-Latn-GM', 'ff-Latn-GH', 'ff-Latn-CM', 'ff-Latn-BF', 'ff-Latn', 'ff-Adlm-SN', 'ff-Adlm-SL', 'ff-Adlm-NG', 'ff-Adlm-NE', 'ff-Adlm-MR', 'ff-Adlm-LR', 'ff-Adlm-GW', 'ff-Adlm-GN', 'ff-Adlm-GM', 'ff-Adlm-GH', 'ff-Adlm-CM', 'ff-Adlm-BF', 'ff-Adlm', 'ff' ], 'fi': [ 'fi-FI', 'fi' ], 'fil': [ 'fil-PH', 'fil' ], 'fo': [ 'fo-FO', 'fo-DK', 'fo' ], 'fr': [ 'fr-YT', 'fr-WF', 'fr-VU', 'fr-TN', 'fr-TG', 'fr-TD', 'fr-SY', 'fr-SN', 'fr-SC', 'fr-RW', 'fr-RE', 'fr-PM', 'fr-PF', 'fr-NE', 'fr-NC', 'fr-MU', 'fr-MR', 'fr-MQ', 'fr-ML', 'fr-MG', 'fr-MF', 'fr-MC', 'fr-MA', 'fr-LU', 'fr-KM', 'fr-HT', 'fr-GQ', 'fr-GP', 'fr-GN', 'fr-GF', 'fr-GA', 'fr-FR', 'fr-DZ', 'fr-DJ', 'fr-CM', 'fr-CI', 'fr-CH', 'fr-CG', 'fr-CF', 'fr-CD', 'fr-CA', 'fr-BL', 'fr-BJ', 'fr-BI', 'fr-BF', 'fr-BE', 'fr' ], 'fur': [ 'fur-IT', 'fur' ], 'fy': [ 'fy-NL', 'fy' ], 'ga': [ 'ga-IE', 'ga-GB', 'ga' ], 'gd': [ 'gd-GB', 'gd' ], 'gl': [ 'gl-ES', 'gl' ], 'gsw': [ 'gsw-LI', 'gsw-FR', 'gsw-CH', 'gsw' ], 'gu': [ 'gu-IN', 'gu' ], 'guz': [ 'guz-KE', 'guz' ], 'gv': [ 'gv-IM', 'gv' ], 'ha': [ 'ha-NG', 'ha-NE', 'ha-GH', 'ha' ], 'haw': [ 'haw-US', 'haw' ], 'he': [ 'he-IL', 'he' ], 'hi': [ 'hi-Latn-IN', 'hi-Latn', 'hi-IN', 'hi' ], 'hr': [ 'hr-HR', 'hr-BA', 'hr' ], 'hsb': [ 'hsb-DE', 'hsb' ], 'hu': [ 'hu-HU', 'hu' ], 'hy': [ 'hy-AM', 'hy' ], 'ia': [ 'ia-001', 'ia' ], 'id': [ 'id-ID', 'id' ], 'ig': [ 'ig-NG', 'ig' ], 'is': [ 'is-IS', 'is' ], 'it': [ 'it-VA', 'it-SM', 'it-IT', 'it-CH', 'it' ], 'ja': [ 'ja-JP', 'ja' ], 'jgo': [ 'jgo-CM', 'jgo' ], 'jmc': [ 'jmc-TZ', 'jmc' ], 'jv': [ 'jv-ID', 'jv' ], 'ka': [ 'ka-GE', 'ka' ], 'kab': [ 'kab-DZ', 'kab' ], 'kam': [ 'kam-KE', 'kam' ], 'kde': [ 'kde-TZ', 'kde' ], 'kea': [ 'kea-CV', 'kea' ], 'kgp': [ 'kgp-BR', 'kgp' ], 'khq': [ 'khq-ML', 'khq' ], 'ki': [ 'ki-KE', 'ki' ], 'kk': [ 'kk-KZ', 'kk' ], 'kkj': [ 'kkj-CM', 'kkj' ], 'kl': [ 'kl-GL', 'kl' ], 'kln': [ 'kln-KE', 'kln' ], 'km': [ 'km-KH', 'km' ], 'kn': [ 'kn-IN', 'kn' ], 'ko': [ 'ko-KR', 'ko-KP', 'ko' ], 'kok': [ 'kok-IN', 'kok' ], 'ks': [ 'ks-Deva-IN', 'ks-Deva', 'ks-Arab-IN', 'ks-Arab', 'ks' ], 'ksb': [ 'ksb-TZ', 'ksb' ], 'ksf': [ 'ksf-CM', 'ksf' ], 'ksh': [ 'ksh-DE', 'ksh' ], 'ku': [ 'ku-TR', 'ku' ], 'kw': [ 'kw-GB', 'kw' ], 'ky': [ 'ky-KG', 'ky' ], 'lag': [ 'lag-TZ', 'lag' ], 'lb': [ 'lb-LU', 'lb' ], 'lg': [ 'lg-UG', 'lg' ], 'lkt': [ 'lkt-US', 'lkt' ], 'ln': [ 'ln-CG', 'ln-CF', 'ln-CD', 'ln-AO', 'ln' ], 'lo': [ 'lo-LA', 'lo' ], 'lrc': [ 'lrc-IR', 'lrc-IQ', 'lrc' ], 'lt': [ 'lt-LT', 'lt' ], 'lu': [ 'lu-CD', 'lu' ], 'luo': [ 'luo-KE', 'luo' ], 'luy': [ 'luy-KE', 'luy' ], 'lv': [ 'lv-LV', 'lv' ], 'mai': [ 'mai-IN', 'mai' ], 'mas': [ 'mas-TZ', 'mas-KE', 'mas' ], 'mer': [ 'mer-KE', 'mer' ], 'mfe': [ 'mfe-MU', 'mfe' ], 'mg': [ 'mg-MG', 'mg' ], 'mgh': [ 'mgh-MZ', 'mgh' ], 'mgo': [ 'mgo-CM', 'mgo' ], 'mi': [ 'mi-NZ', 'mi' ], 'mk': [ 'mk-MK', 'mk' ], 'ml': [ 'ml-IN', 'ml' ], 'mn': [ 'mn-MN', 'mn' ], 'mni': [ 'mni-Beng-IN', 'mni-Beng', 'mni' ], 'mr': [ 'mr-IN', 'mr' ], 'ms': [ 'ms-SG', 'ms-MY', 'ms-ID', 'ms-BN', 'ms' ], 'mt': [ 'mt-MT', 'mt' ], 'mua': [ 'mua-CM', 'mua' ], 'my': [ 'my-MM', 'my' ], 'mzn': [ 'mzn-IR', 'mzn' ], 'naq': [ 'naq-NA', 'naq' ], 'nb': [ 'nb-SJ', 'nb-NO', 'nb' ], 'nd': [ 'nd-ZW', 'nd' ], 'nds': [ 'nds-NL', 'nds-DE', 'nds' ], 'ne': [ 'ne-NP', 'ne-IN', 'ne' ], 'nl': [ 'nl-SX', 'nl-SR', 'nl-NL', 'nl-CW', 'nl-BQ', 'nl-BE', 'nl-AW', 'nl' ], 'nmg': [ 'nmg-CM', 'nmg' ], 'nn': [ 'nn-NO', 'nn' ], 'nnh': [ 'nnh-CM', 'nnh' ], 'no': [ 'no' ], 'nus': [ 'nus-SS', 'nus' ], 'nyn': [ 'nyn-UG', 'nyn' ], 'om': [ 'om-KE', 'om-ET', 'om' ], 'or': [ 'or-IN', 'or' ], 'os': [ 'os-RU', 'os-GE', 'os' ], 'pa': [ 'pa-Guru-IN', 'pa-Guru', 'pa-Arab-PK', 'pa-Arab', 'pa' ], 'pcm': [ 'pcm-NG', 'pcm' ], 'pl': [ 'pl-PL', 'pl' ], 'ps': [ 'ps-PK', 'ps-AF', 'ps' ], 'pt': [ 'pt-TL', 'pt-ST', 'pt-PT', 'pt-MZ', 'pt-MO', 'pt-LU', 'pt-GW', 'pt-GQ', 'pt-CV', 'pt-CH', 'pt-BR', 'pt-AO', 'pt' ], 'qu': [ 'qu-PE', 'qu-EC', 'qu-BO', 'qu' ], 'rm': [ 'rm-CH', 'rm' ], 'rn': [ 'rn-BI', 'rn' ], 'ro': [ 'ro-RO', 'ro-MD', 'ro' ], 'rof': [ 'rof-TZ', 'rof' ], 'ru': [ 'ru-UA', 'ru-RU', 'ru-MD', 'ru-KZ', 'ru-KG', 'ru-BY', 'ru' ], 'rw': [ 'rw-RW', 'rw' ], 'rwk': [ 'rwk-TZ', 'rwk' ], 'sa': [ 'sa-IN', 'sa' ], 'sah': [ 'sah-RU', 'sah' ], 'saq': [ 'saq-KE', 'saq' ], 'sat': [ 'sat-Olck-IN', 'sat-Olck', 'sat' ], 'sbp': [ 'sbp-TZ', 'sbp' ], 'sc': [ 'sc-IT', 'sc' ], 'sd': [ 'sd-Deva-IN', 'sd-Deva', 'sd-Arab-PK', 'sd-Arab', 'sd' ], 'se': [ 'se-SE', 'se-NO', 'se-FI', 'se' ], 'seh': [ 'seh-MZ', 'seh' ], 'ses': [ 'ses-ML', 'ses' ], 'sg': [ 'sg-CF', 'sg' ], 'shi': [ 'shi-Tfng-MA', 'shi-Tfng', 'shi-Latn-MA', 'shi-Latn', 'shi' ], 'si': [ 'si-LK', 'si' ], 'sk': [ 'sk-SK', 'sk' ], 'sl': [ 'sl-SI', 'sl' ], 'smn': [ 'smn-FI', 'smn' ], 'sn': [ 'sn-ZW', 'sn' ], 'so': [ 'so-SO', 'so-KE', 'so-ET', 'so-DJ', 'so' ], 'sq': [ 'sq-XK', 'sq-MK', 'sq-AL', 'sq' ], 'sr': [ 'sr-Latn-XK', 'sr-Latn-RS', 'sr-Latn-ME', 'sr-Latn-BA', 'sr-Latn', 'sr-Cyrl-XK', 'sr-Cyrl-RS', 'sr-Cyrl-ME', 'sr-Cyrl-BA', 'sr-Cyrl', 'sr' ], 'su': [ 'su-Latn-ID', 'su-Latn', 'su' ], 'sv': [ 'sv-SE', 'sv-FI', 'sv-AX', 'sv' ], 'sw': [ 'sw-UG', 'sw-TZ', 'sw-KE', 'sw-CD', 'sw' ], 'ta': [ 'ta-SG', 'ta-MY', 'ta-LK', 'ta-IN', 'ta' ], 'te': [ 'te-IN', 'te' ], 'teo': [ 'teo-UG', 'teo-KE', 'teo' ], 'tg': [ 'tg-TJ', 'tg' ], 'th': [ 'th-TH', 'th' ], 'ti': [ 'ti-ET', 'ti-ER', 'ti' ], 'tk': [ 'tk-TM', 'tk' ], 'to': [ 'to-TO', 'to' ], 'tr': [ 'tr-TR', 'tr-CY', 'tr' ], 'tt': [ 'tt-RU', 'tt' ], 'twq': [ 'twq-NE', 'twq' ], 'tzm': [ 'tzm-MA', 'tzm' ], 'ug': [ 'ug-CN', 'ug' ], 'uk': [ 'uk-UA', 'uk' ], 'ur': [ 'ur-PK', 'ur-IN', 'ur' ], 'uz': [ 'uz-Latn-UZ', 'uz-Latn', 'uz-Cyrl-UZ', 'uz-Cyrl', 'uz-Arab-AF', 'uz-Arab', 'uz' ], 'vai': [ 'vai-Vaii-LR', 'vai-Vaii', 'vai-Latn-LR', 'vai-Latn', 'vai' ], 'vi': [ 'vi-VN', 'vi' ], 'vun': [ 'vun-TZ', 'vun' ], 'wae': [ 'wae-CH', 'wae' ], 'wo': [ 'wo-SN', 'wo' ], 'xh': [ 'xh-ZA', 'xh' ], 'xog': [ 'xog-UG', 'xog' ], 'yav': [ 'yav-CM', 'yav' ], 'yi': [ 'yi-001', 'yi' ], 'yo': [ 'yo-NG', 'yo-BJ', 'yo' ], 'yrl': [ 'yrl-VE', 'yrl-CO', 'yrl-BR', 'yrl' ], 'zgh': [ 'zgh-MA', 'zgh' ], 'zh': [ 'zh-Hans-CN', 'zh-Hans-HK', 'zh-Hans-MO', 'zh-Hans-SG', 'zh-Hans', 'zh-Hant-TW', 'zh-Hant-MO', 'zh-Hant-HK', 'zh-Hant', 'zh' ], 'zu': [ 'zu-ZA', 'zu' ] }; function getLanguageDisplayName(code) { var fallback = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 'code'; var result = Editor.I18n.t("".concat(_global.MainName, ".language_code.").concat(code)); if (!result && fallback === 'none') { return result; } return result || code; } /***/ }), /***/ "./src/panel/share/scripts/menu.ts": /*!*****************************************!*\ !*** ./src/panel/share/scripts/menu.ts ***! \*****************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "popupLanguage", ({ enumerable: true, get: function() { return popupLanguage; } })); var _languageMap = __webpack_require__(/*! ./libs/languageMap */ "./src/panel/share/scripts/libs/languageMap.ts"); var _global = __webpack_require__(/*! ../../../lib/core/service/util/global */ "./src/lib/core/service/util/global.ts"); function _array_like_to_array(arr, len) { if (len == null || len > arr.length) len = arr.length; for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i]; return arr2; } function _array_without_holes(arr) { if (Array.isArray(arr)) return _array_like_to_array(arr); } function _iterable_to_array(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _non_iterable_spread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _to_consumable_array(arr) { return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread(); } function _unsupported_iterable_to_array(o, minLen) { if (!o) return; if (typeof o === "string") return _array_like_to_array(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen); } function popupLanguage(callback) { var excludes = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : []; var languageMapKeys = Object.keys(_languageMap.languageMap); var manualLocales = [ 'zh', 'en', 'fr', 'ru', 'ja', 'ko', 'es', 'ar' ]; var manualLocalesDisplayNames = manualLocales.map(function(locale) { return (0, _languageMap.getLanguageDisplayName)(locale); }); var tempMenus = languageMapKeys.map(function(key) { var menu = { label: (0, _languageMap.getLanguageDisplayName)(key), sublabel: key === manualLocales[manualLocales.length - 1] ? Editor.I18n.t(_global.MainName + '.common_languages') : undefined, submenu: _languageMap.languageMap[key].map(function(locale) { var displayName = (0, _languageMap.getLanguageDisplayName)(locale); var menu = { label: displayName, click: function() { callback(locale, displayName !== null && displayName !== void 0 ? displayName : locale); }, enabled: !excludes.includes(locale) }; return menu; }).filter(Boolean) }; return menu; }).filter(Boolean); var manualMenus = tempMenus.filter(function(item) { return manualLocalesDisplayNames.includes(item.label); }).sort(function(a, b) { return manualLocalesDisplayNames.indexOf(a.label) - manualLocalesDisplayNames.indexOf(b.label); }); var translatedMenus = tempMenus.filter(function(item) { return !languageMapKeys.find(function(key) { return item.label === key; }) && !manualMenus.includes(item); }).sort(function(a, b) { var _a_label, _b_label; return ((_a_label = a.label) !== null && _a_label !== void 0 ? _a_label : '').localeCompare((_b_label = b.label) !== null && _b_label !== void 0 ? _b_label : ''); }); var unTranslatedMenus = tempMenus.filter(function(item) { return languageMapKeys.find(function(key) { return item.label === key; }) && !manualMenus.includes(item); }).sort(); Editor.Menu.popup({ menu: _to_consumable_array(manualMenus).concat([ { type: 'separator' } ], _to_consumable_array(translatedMenus), _to_consumable_array(unTranslatedMenus)) }); } /***/ }), /***/ "./src/panel/share/scripts/utils.ts": /*!******************************************!*\ !*** ./src/panel/share/scripts/utils.ts ***! \******************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); function _export(target, all) { for(var name in all)Object.defineProperty(target, name, { enumerable: true, get: all[name] }); } _export(exports, { getFileExtNameOfTranslateFileType: function() { return getFileExtNameOfTranslateFileType; }, getTranslateFileType: function() { return getTranslateFileType; } }); var _path = __webpack_require__(/*! path */ "path"); var _global = __webpack_require__(/*! ../../../lib/core/service/util/global */ "./src/lib/core/service/util/global.ts"); var _type = __webpack_require__(/*! ../../../lib/core/type/type */ "./src/lib/core/type/type.ts"); function getTranslateFileType(filePath) { var translateFileType; var ext = (0, _path.extname)(filePath); if (ext === '.po') { translateFileType = _type.TranslateFileType.PO; } else if (ext === '.csv') { translateFileType = _type.TranslateFileType.CSV; } else if (ext === '.xlsx') { translateFileType = _type.TranslateFileType.XLSX; } else { throw new Error("[".concat(_global.MainName, "]: cannot get TranslateFileType of ").concat(filePath)); } return translateFileType; } function getFileExtNameOfTranslateFileType(translateFileType) { if (translateFileType === _type.TranslateFileType.PO) { return '.po'; } else if (translateFileType === _type.TranslateFileType.CSV) { return '.csv'; } else if (translateFileType === _type.TranslateFileType.XLSX) { return '.xlsx'; } else { throw new Error("[".concat(_global.MainName, "]: cannot get ExtName of ").concat(translateFileType)); } } /***/ }), /***/ "./node_modules/tsyringe/dist/esm5/decorators/auto-injectable.js": /*!***********************************************************************!*\ !*** ./node_modules/tsyringe/dist/esm5/decorators/auto-injectable.js ***! \***********************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! tslib */ "./node_modules/tsyringe/node_modules/tslib/tslib.es6.js"); /* harmony import */ var _reflection_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../reflection-helpers */ "./node_modules/tsyringe/dist/esm5/reflection-helpers.js"); /* harmony import */ var _dependency_container__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../dependency-container */ "./node_modules/tsyringe/dist/esm5/dependency-container.js"); /* harmony import */ var _providers_injection_token__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../providers/injection-token */ "./node_modules/tsyringe/dist/esm5/providers/injection-token.js"); /* harmony import */ var _error_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../error-helpers */ "./node_modules/tsyringe/dist/esm5/error-helpers.js"); function autoInjectable() { return function (target) { var paramInfo = (0,_reflection_helpers__WEBPACK_IMPORTED_MODULE_0__.getParamInfo)(target); return (function (_super) { (0,tslib__WEBPACK_IMPORTED_MODULE_4__.__extends)(class_1, _super); function class_1() { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } return _super.apply(this, (0,tslib__WEBPACK_IMPORTED_MODULE_4__.__spread)(args.concat(paramInfo.slice(args.length).map(function (type, index) { var _a, _b, _c; try { if ((0,_providers_injection_token__WEBPACK_IMPORTED_MODULE_2__.isTokenDescriptor)(type)) { if ((0,_providers_injection_token__WEBPACK_IMPORTED_MODULE_2__.isTransformDescriptor)(type)) { return type.multiple ? (_a = _dependency_container__WEBPACK_IMPORTED_MODULE_1__.instance .resolve(type.transform)).transform.apply(_a, (0,tslib__WEBPACK_IMPORTED_MODULE_4__.__spread)([_dependency_container__WEBPACK_IMPORTED_MODULE_1__.instance.resolveAll(type.token)], type.transformArgs)) : (_b = _dependency_container__WEBPACK_IMPORTED_MODULE_1__.instance .resolve(type.transform)).transform.apply(_b, (0,tslib__WEBPACK_IMPORTED_MODULE_4__.__spread)([_dependency_container__WEBPACK_IMPORTED_MODULE_1__.instance.resolve(type.token)], type.transformArgs)); } else { return type.multiple ? _dependency_container__WEBPACK_IMPORTED_MODULE_1__.instance.resolveAll(type.token) : _dependency_container__WEBPACK_IMPORTED_MODULE_1__.instance.resolve(type.token); } } else if ((0,_providers_injection_token__WEBPACK_IMPORTED_MODULE_2__.isTransformDescriptor)(type)) { return (_c = _dependency_container__WEBPACK_IMPORTED_MODULE_1__.instance .resolve(type.transform)).transform.apply(_c, (0,tslib__WEBPACK_IMPORTED_MODULE_4__.__spread)([_dependency_container__WEBPACK_IMPORTED_MODULE_1__.instance.resolve(type.token)], type.transformArgs)); } return _dependency_container__WEBPACK_IMPORTED_MODULE_1__.instance.resolve(type); } catch (e) { var argIndex = index + args.length; throw new Error((0,_error_helpers__WEBPACK_IMPORTED_MODULE_3__.formatErrorCtor)(target, argIndex, e)); } })))) || this; } return class_1; }(target)); }; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (autoInjectable); /***/ }), /***/ "./node_modules/tsyringe/dist/esm5/decorators/index.js": /*!*************************************************************!*\ !*** ./node_modules/tsyringe/dist/esm5/decorators/index.js ***! \*************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ autoInjectable: () => (/* reexport safe */ _auto_injectable__WEBPACK_IMPORTED_MODULE_0__["default"]), /* harmony export */ inject: () => (/* reexport safe */ _inject__WEBPACK_IMPORTED_MODULE_1__["default"]), /* harmony export */ injectAll: () => (/* reexport safe */ _inject_all__WEBPACK_IMPORTED_MODULE_5__["default"]), /* harmony export */ injectAllWithTransform: () => (/* reexport safe */ _inject_all_with_transform__WEBPACK_IMPORTED_MODULE_6__["default"]), /* harmony export */ injectWithTransform: () => (/* reexport safe */ _inject_with_transform__WEBPACK_IMPORTED_MODULE_7__["default"]), /* harmony export */ injectable: () => (/* reexport safe */ _injectable__WEBPACK_IMPORTED_MODULE_2__["default"]), /* harmony export */ registry: () => (/* reexport safe */ _registry__WEBPACK_IMPORTED_MODULE_3__["default"]), /* harmony export */ scoped: () => (/* reexport safe */ _scoped__WEBPACK_IMPORTED_MODULE_8__["default"]), /* harmony export */ singleton: () => (/* reexport safe */ _singleton__WEBPACK_IMPORTED_MODULE_4__["default"]) /* harmony export */ }); /* harmony import */ var _auto_injectable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./auto-injectable */ "./node_modules/tsyringe/dist/esm5/decorators/auto-injectable.js"); /* harmony import */ var _inject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./inject */ "./node_modules/tsyringe/dist/esm5/decorators/inject.js"); /* harmony import */ var _injectable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./injectable */ "./node_modules/tsyringe/dist/esm5/decorators/injectable.js"); /* harmony import */ var _registry__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./registry */ "./node_modules/tsyringe/dist/esm5/decorators/registry.js"); /* harmony import */ var _singleton__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./singleton */ "./node_modules/tsyringe/dist/esm5/decorators/singleton.js"); /* harmony import */ var _inject_all__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./inject-all */ "./node_modules/tsyringe/dist/esm5/decorators/inject-all.js"); /* harmony import */ var _inject_all_with_transform__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./inject-all-with-transform */ "./node_modules/tsyringe/dist/esm5/decorators/inject-all-with-transform.js"); /* harmony import */ var _inject_with_transform__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./inject-with-transform */ "./node_modules/tsyringe/dist/esm5/decorators/inject-with-transform.js"); /* harmony import */ var _scoped__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./scoped */ "./node_modules/tsyringe/dist/esm5/decorators/scoped.js"); /***/ }), /***/ "./node_modules/tsyringe/dist/esm5/decorators/inject-all-with-transform.js": /*!*********************************************************************************!*\ !*** ./node_modules/tsyringe/dist/esm5/decorators/inject-all-with-transform.js ***! \*********************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _reflection_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../reflection-helpers */ "./node_modules/tsyringe/dist/esm5/reflection-helpers.js"); function injectAllWithTransform(token, transformer) { var args = []; for (var _i = 2; _i < arguments.length; _i++) { args[_i - 2] = arguments[_i]; } var data = { token: token, multiple: true, transform: transformer, transformArgs: args }; return (0,_reflection_helpers__WEBPACK_IMPORTED_MODULE_0__.defineInjectionTokenMetadata)(data); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (injectAllWithTransform); /***/ }), /***/ "./node_modules/tsyringe/dist/esm5/decorators/inject-all.js": /*!******************************************************************!*\ !*** ./node_modules/tsyringe/dist/esm5/decorators/inject-all.js ***! \******************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _reflection_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../reflection-helpers */ "./node_modules/tsyringe/dist/esm5/reflection-helpers.js"); function injectAll(token) { var data = { token: token, multiple: true }; return (0,_reflection_helpers__WEBPACK_IMPORTED_MODULE_0__.defineInjectionTokenMetadata)(data); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (injectAll); /***/ }), /***/ "./node_modules/tsyringe/dist/esm5/decorators/inject-with-transform.js": /*!*****************************************************************************!*\ !*** ./node_modules/tsyringe/dist/esm5/decorators/inject-with-transform.js ***! \*****************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _reflection_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../reflection-helpers */ "./node_modules/tsyringe/dist/esm5/reflection-helpers.js"); function injectWithTransform(token, transformer) { var args = []; for (var _i = 2; _i < arguments.length; _i++) { args[_i - 2] = arguments[_i]; } return (0,_reflection_helpers__WEBPACK_IMPORTED_MODULE_0__.defineInjectionTokenMetadata)(token, { transformToken: transformer, args: args }); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (injectWithTransform); /***/ }), /***/ "./node_modules/tsyringe/dist/esm5/decorators/inject.js": /*!**************************************************************!*\ !*** ./node_modules/tsyringe/dist/esm5/decorators/inject.js ***! \**************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _reflection_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../reflection-helpers */ "./node_modules/tsyringe/dist/esm5/reflection-helpers.js"); function inject(token) { return (0,_reflection_helpers__WEBPACK_IMPORTED_MODULE_0__.defineInjectionTokenMetadata)(token); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (inject); /***/ }), /***/ "./node_modules/tsyringe/dist/esm5/decorators/injectable.js": /*!******************************************************************!*\ !*** ./node_modules/tsyringe/dist/esm5/decorators/injectable.js ***! \******************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _reflection_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../reflection-helpers */ "./node_modules/tsyringe/dist/esm5/reflection-helpers.js"); /* harmony import */ var _dependency_container__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../dependency-container */ "./node_modules/tsyringe/dist/esm5/dependency-container.js"); function injectable() { return function (target) { _dependency_container__WEBPACK_IMPORTED_MODULE_1__.typeInfo.set(target, (0,_reflection_helpers__WEBPACK_IMPORTED_MODULE_0__.getParamInfo)(target)); }; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (injectable); /***/ }), /***/ "./node_modules/tsyringe/dist/esm5/decorators/registry.js": /*!****************************************************************!*\ !*** ./node_modules/tsyringe/dist/esm5/decorators/registry.js ***! \****************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! tslib */ "./node_modules/tsyringe/node_modules/tslib/tslib.es6.js"); /* harmony import */ var _dependency_container__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../dependency-container */ "./node_modules/tsyringe/dist/esm5/dependency-container.js"); function registry(registrations) { if (registrations === void 0) { registrations = []; } return function (target) { registrations.forEach(function (_a) { var token = _a.token, options = _a.options, provider = (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__rest)(_a, ["token", "options"]); return _dependency_container__WEBPACK_IMPORTED_MODULE_0__.instance.register(token, provider, options); }); return target; }; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (registry); /***/ }), /***/ "./node_modules/tsyringe/dist/esm5/decorators/scoped.js": /*!**************************************************************!*\ !*** ./node_modules/tsyringe/dist/esm5/decorators/scoped.js ***! \**************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ scoped) /* harmony export */ }); /* harmony import */ var _injectable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./injectable */ "./node_modules/tsyringe/dist/esm5/decorators/injectable.js"); /* harmony import */ var _dependency_container__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../dependency-container */ "./node_modules/tsyringe/dist/esm5/dependency-container.js"); function scoped(lifecycle, token) { return function (target) { (0,_injectable__WEBPACK_IMPORTED_MODULE_0__["default"])()(target); _dependency_container__WEBPACK_IMPORTED_MODULE_1__.instance.register(token || target, target, { lifecycle: lifecycle }); }; } /***/ }), /***/ "./node_modules/tsyringe/dist/esm5/decorators/singleton.js": /*!*****************************************************************!*\ !*** ./node_modules/tsyringe/dist/esm5/decorators/singleton.js ***! \*****************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _injectable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./injectable */ "./node_modules/tsyringe/dist/esm5/decorators/injectable.js"); /* harmony import */ var _dependency_container__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../dependency-container */ "./node_modules/tsyringe/dist/esm5/dependency-container.js"); function singleton() { return function (target) { (0,_injectable__WEBPACK_IMPORTED_MODULE_0__["default"])()(target); _dependency_container__WEBPACK_IMPORTED_MODULE_1__.instance.registerSingleton(target); }; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (singleton); /***/ }), /***/ "./node_modules/tsyringe/dist/esm5/dependency-container.js": /*!*****************************************************************!*\ !*** ./node_modules/tsyringe/dist/esm5/dependency-container.js ***! \*****************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), /* harmony export */ instance: () => (/* binding */ instance), /* harmony export */ typeInfo: () => (/* binding */ typeInfo) /* harmony export */ }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! tslib */ "./node_modules/tsyringe/node_modules/tslib/tslib.es6.js"); /* harmony import */ var _providers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./providers */ "./node_modules/tsyringe/dist/esm5/providers/index.js"); /* harmony import */ var _providers_provider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./providers/provider */ "./node_modules/tsyringe/dist/esm5/providers/provider.js"); /* harmony import */ var _providers_injection_token__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./providers/injection-token */ "./node_modules/tsyringe/dist/esm5/providers/injection-token.js"); /* harmony import */ var _registry__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./registry */ "./node_modules/tsyringe/dist/esm5/registry.js"); /* harmony import */ var _types_lifecycle__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./types/lifecycle */ "./node_modules/tsyringe/dist/esm5/types/lifecycle.js"); /* harmony import */ var _resolution_context__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./resolution-context */ "./node_modules/tsyringe/dist/esm5/resolution-context.js"); /* harmony import */ var _error_helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./error-helpers */ "./node_modules/tsyringe/dist/esm5/error-helpers.js"); /* harmony import */ var _lazy_helpers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./lazy-helpers */ "./node_modules/tsyringe/dist/esm5/lazy-helpers.js"); /* harmony import */ var _types_disposable__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./types/disposable */ "./node_modules/tsyringe/dist/esm5/types/disposable.js"); /* harmony import */ var _interceptors__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./interceptors */ "./node_modules/tsyringe/dist/esm5/interceptors.js"); var typeInfo = new Map(); var InternalDependencyContainer = (function () { function InternalDependencyContainer(parent) { this.parent = parent; this._registry = new _registry__WEBPACK_IMPORTED_MODULE_3__["default"](); this.interceptors = new _interceptors__WEBPACK_IMPORTED_MODULE_9__["default"](); this.disposed = false; this.disposables = new Set(); } InternalDependencyContainer.prototype.register = function (token, providerOrConstructor, options) { if (options === void 0) { options = { lifecycle: _types_lifecycle__WEBPACK_IMPORTED_MODULE_4__["default"].Transient }; } this.ensureNotDisposed(); var provider; if (!(0,_providers_provider__WEBPACK_IMPORTED_MODULE_1__.isProvider)(providerOrConstructor)) { provider = { useClass: providerOrConstructor }; } else { provider = providerOrConstructor; } if ((0,_providers__WEBPACK_IMPORTED_MODULE_0__.isTokenProvider)(provider)) { var path = [token]; var tokenProvider = provider; while (tokenProvider != null) { var currentToken = tokenProvider.useToken; if (path.includes(currentToken)) { throw new Error("Token registration cycle detected! " + (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__spread)(path, [currentToken]).join(" -> ")); } path.push(currentToken); var registration = this._registry.get(currentToken); if (registration && (0,_providers__WEBPACK_IMPORTED_MODULE_0__.isTokenProvider)(registration.provider)) { tokenProvider = registration.provider; } else { tokenProvider = null; } } } if (options.lifecycle === _types_lifecycle__WEBPACK_IMPORTED_MODULE_4__["default"].Singleton || options.lifecycle == _types_lifecycle__WEBPACK_IMPORTED_MODULE_4__["default"].ContainerScoped || options.lifecycle == _types_lifecycle__WEBPACK_IMPORTED_MODULE_4__["default"].ResolutionScoped) { if ((0,_providers__WEBPACK_IMPORTED_MODULE_0__.isValueProvider)(provider) || (0,_providers__WEBPACK_IMPORTED_MODULE_0__.isFactoryProvider)(provider)) { throw new Error("Cannot use lifecycle \"" + _types_lifecycle__WEBPACK_IMPORTED_MODULE_4__["default"][options.lifecycle] + "\" with ValueProviders or FactoryProviders"); } } this._registry.set(token, { provider: provider, options: options }); return this; }; InternalDependencyContainer.prototype.registerType = function (from, to) { this.ensureNotDisposed(); if ((0,_providers__WEBPACK_IMPORTED_MODULE_0__.isNormalToken)(to)) { return this.register(from, { useToken: to }); } return this.register(from, { useClass: to }); }; InternalDependencyContainer.prototype.registerInstance = function (token, instance) { this.ensureNotDisposed(); return this.register(token, { useValue: instance }); }; InternalDependencyContainer.prototype.registerSingleton = function (from, to) { this.ensureNotDisposed(); if ((0,_providers__WEBPACK_IMPORTED_MODULE_0__.isNormalToken)(from)) { if ((0,_providers__WEBPACK_IMPORTED_MODULE_0__.isNormalToken)(to)) { return this.register(from, { useToken: to }, { lifecycle: _types_lifecycle__WEBPACK_IMPORTED_MODULE_4__["default"].Singleton }); } else if (to) { return this.register(from, { useClass: to }, { lifecycle: _types_lifecycle__WEBPACK_IMPORTED_MODULE_4__["default"].Singleton }); } throw new Error('Cannot register a type name as a singleton without a "to" token'); } var useClass = from; if (to && !(0,_providers__WEBPACK_IMPORTED_MODULE_0__.isNormalToken)(to)) { useClass = to; } return this.register(from, { useClass: useClass }, { lifecycle: _types_lifecycle__WEBPACK_IMPORTED_MODULE_4__["default"].Singleton }); }; InternalDependencyContainer.prototype.resolve = function (token, context) { if (context === void 0) { context = new _resolution_context__WEBPACK_IMPORTED_MODULE_5__["default"](); } this.ensureNotDisposed(); var registration = this.getRegistration(token); if (!registration && (0,_providers__WEBPACK_IMPORTED_MODULE_0__.isNormalToken)(token)) { throw new Error("Attempted to resolve unregistered dependency token: \"" + token.toString() + "\""); } this.executePreResolutionInterceptor(token, "Single"); if (registration) { var result = this.resolveRegistration(registration, context); this.executePostResolutionInterceptor(token, result, "Single"); return result; } if ((0,_providers_injection_token__WEBPACK_IMPORTED_MODULE_2__.isConstructorToken)(token)) { var result = this.construct(token, context); this.executePostResolutionInterceptor(token, result, "Single"); return result; } throw new Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function."); }; InternalDependencyContainer.prototype.executePreResolutionInterceptor = function (token, resolutionType) { var e_1, _a; if (this.interceptors.preResolution.has(token)) { var remainingInterceptors = []; try { for (var _b = (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__values)(this.interceptors.preResolution.getAll(token)), _c = _b.next(); !_c.done; _c = _b.next()) { var interceptor = _c.value; if (interceptor.options.frequency != "Once") { remainingInterceptors.push(interceptor); } interceptor.callback(token, resolutionType); } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return)) _a.call(_b); } finally { if (e_1) throw e_1.error; } } this.interceptors.preResolution.setAll(token, remainingInterceptors); } }; InternalDependencyContainer.prototype.executePostResolutionInterceptor = function (token, result, resolutionType) { var e_2, _a; if (this.interceptors.postResolution.has(token)) { var remainingInterceptors = []; try { for (var _b = (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__values)(this.interceptors.postResolution.getAll(token)), _c = _b.next(); !_c.done; _c = _b.next()) { var interceptor = _c.value; if (interceptor.options.frequency != "Once") { remainingInterceptors.push(interceptor); } interceptor.callback(token, result, resolutionType); } } catch (e_2_1) { e_2 = { error: e_2_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return)) _a.call(_b); } finally { if (e_2) throw e_2.error; } } this.interceptors.postResolution.setAll(token, remainingInterceptors); } }; InternalDependencyContainer.prototype.resolveRegistration = function (registration, context) { this.ensureNotDisposed(); if (registration.options.lifecycle === _types_lifecycle__WEBPACK_IMPORTED_MODULE_4__["default"].ResolutionScoped && context.scopedResolutions.has(registration)) { return context.scopedResolutions.get(registration); } var isSingleton = registration.options.lifecycle === _types_lifecycle__WEBPACK_IMPORTED_MODULE_4__["default"].Singleton; var isContainerScoped = registration.options.lifecycle === _types_lifecycle__WEBPACK_IMPORTED_MODULE_4__["default"].ContainerScoped; var returnInstance = isSingleton || isContainerScoped; var resolved; if ((0,_providers__WEBPACK_IMPORTED_MODULE_0__.isValueProvider)(registration.provider)) { resolved = registration.provider.useValue; } else if ((0,_providers__WEBPACK_IMPORTED_MODULE_0__.isTokenProvider)(registration.provider)) { resolved = returnInstance ? registration.instance || (registration.instance = this.resolve(registration.provider.useToken, context)) : this.resolve(registration.provider.useToken, context); } else if ((0,_providers__WEBPACK_IMPORTED_MODULE_0__.isClassProvider)(registration.provider)) { resolved = returnInstance ? registration.instance || (registration.instance = this.construct(registration.provider.useClass, context)) : this.construct(registration.provider.useClass, context); } else if ((0,_providers__WEBPACK_IMPORTED_MODULE_0__.isFactoryProvider)(registration.provider)) { resolved = registration.provider.useFactory(this); } else { resolved = this.construct(registration.provider, context); } if (registration.options.lifecycle === _types_lifecycle__WEBPACK_IMPORTED_MODULE_4__["default"].ResolutionScoped) { context.scopedResolutions.set(registration, resolved); } return resolved; }; InternalDependencyContainer.prototype.resolveAll = function (token, context) { var _this = this; if (context === void 0) { context = new _resolution_context__WEBPACK_IMPORTED_MODULE_5__["default"](); } this.ensureNotDisposed(); var registrations = this.getAllRegistrations(token); if (!registrations && (0,_providers__WEBPACK_IMPORTED_MODULE_0__.isNormalToken)(token)) { throw new Error("Attempted to resolve unregistered dependency token: \"" + token.toString() + "\""); } this.executePreResolutionInterceptor(token, "All"); if (registrations) { var result_1 = registrations.map(function (item) { return _this.resolveRegistration(item, context); }); this.executePostResolutionInterceptor(token, result_1, "All"); return result_1; } var result = [this.construct(token, context)]; this.executePostResolutionInterceptor(token, result, "All"); return result; }; InternalDependencyContainer.prototype.isRegistered = function (token, recursive) { if (recursive === void 0) { recursive = false; } this.ensureNotDisposed(); return (this._registry.has(token) || (recursive && (this.parent || false) && this.parent.isRegistered(token, true))); }; InternalDependencyContainer.prototype.reset = function () { this.ensureNotDisposed(); this._registry.clear(); this.interceptors.preResolution.clear(); this.interceptors.postResolution.clear(); }; InternalDependencyContainer.prototype.clearInstances = function () { var e_3, _a; this.ensureNotDisposed(); try { for (var _b = (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__values)(this._registry.entries()), _c = _b.next(); !_c.done; _c = _b.next()) { var _d = (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__read)(_c.value, 2), token = _d[0], registrations = _d[1]; this._registry.setAll(token, registrations .filter(function (registration) { return !(0,_providers__WEBPACK_IMPORTED_MODULE_0__.isValueProvider)(registration.provider); }) .map(function (registration) { registration.instance = undefined; return registration; })); } } catch (e_3_1) { e_3 = { error: e_3_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return)) _a.call(_b); } finally { if (e_3) throw e_3.error; } } }; InternalDependencyContainer.prototype.createChildContainer = function () { var e_4, _a; this.ensureNotDisposed(); var childContainer = new InternalDependencyContainer(this); try { for (var _b = (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__values)(this._registry.entries()), _c = _b.next(); !_c.done; _c = _b.next()) { var _d = (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__read)(_c.value, 2), token = _d[0], registrations = _d[1]; if (registrations.some(function (_a) { var options = _a.options; return options.lifecycle === _types_lifecycle__WEBPACK_IMPORTED_MODULE_4__["default"].ContainerScoped; })) { childContainer._registry.setAll(token, registrations.map(function (registration) { if (registration.options.lifecycle === _types_lifecycle__WEBPACK_IMPORTED_MODULE_4__["default"].ContainerScoped) { return { provider: registration.provider, options: registration.options }; } return registration; })); } } } catch (e_4_1) { e_4 = { error: e_4_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return)) _a.call(_b); } finally { if (e_4) throw e_4.error; } } return childContainer; }; InternalDependencyContainer.prototype.beforeResolution = function (token, callback, options) { if (options === void 0) { options = { frequency: "Always" }; } this.interceptors.preResolution.set(token, { callback: callback, options: options }); }; InternalDependencyContainer.prototype.afterResolution = function (token, callback, options) { if (options === void 0) { options = { frequency: "Always" }; } this.interceptors.postResolution.set(token, { callback: callback, options: options }); }; InternalDependencyContainer.prototype.dispose = function () { return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__awaiter)(this, void 0, void 0, function () { var promises; return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__generator)(this, function (_a) { switch (_a.label) { case 0: this.disposed = true; promises = []; this.disposables.forEach(function (disposable) { var maybePromise = disposable.dispose(); if (maybePromise) { promises.push(maybePromise); } }); return [4, Promise.all(promises)]; case 1: _a.sent(); return [2]; } }); }); }; InternalDependencyContainer.prototype.getRegistration = function (token) { if (this.isRegistered(token)) { return this._registry.get(token); } if (this.parent) { return this.parent.getRegistration(token); } return null; }; InternalDependencyContainer.prototype.getAllRegistrations = function (token) { if (this.isRegistered(token)) { return this._registry.getAll(token); } if (this.parent) { return this.parent.getAllRegistrations(token); } return null; }; InternalDependencyContainer.prototype.construct = function (ctor, context) { var _this = this; if (ctor instanceof _lazy_helpers__WEBPACK_IMPORTED_MODULE_7__.DelayedConstructor) { return ctor.createProxy(function (target) { return _this.resolve(target, context); }); } var instance = (function () { var paramInfo = typeInfo.get(ctor); if (!paramInfo || paramInfo.length === 0) { if (ctor.length === 0) { return new ctor(); } else { throw new Error("TypeInfo not known for \"" + ctor.name + "\""); } } var params = paramInfo.map(_this.resolveParams(context, ctor)); return new (ctor.bind.apply(ctor, (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__spread)([void 0], params)))(); })(); if ((0,_types_disposable__WEBPACK_IMPORTED_MODULE_8__.isDisposable)(instance)) { this.disposables.add(instance); } return instance; }; InternalDependencyContainer.prototype.resolveParams = function (context, ctor) { var _this = this; return function (param, idx) { var _a, _b, _c; try { if ((0,_providers_injection_token__WEBPACK_IMPORTED_MODULE_2__.isTokenDescriptor)(param)) { if ((0,_providers_injection_token__WEBPACK_IMPORTED_MODULE_2__.isTransformDescriptor)(param)) { return param.multiple ? (_a = _this.resolve(param.transform)).transform.apply(_a, (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__spread)([_this.resolveAll(param.token)], param.transformArgs)) : (_b = _this.resolve(param.transform)).transform.apply(_b, (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__spread)([_this.resolve(param.token, context)], param.transformArgs)); } else { return param.multiple ? _this.resolveAll(param.token) : _this.resolve(param.token, context); } } else if ((0,_providers_injection_token__WEBPACK_IMPORTED_MODULE_2__.isTransformDescriptor)(param)) { return (_c = _this.resolve(param.transform, context)).transform.apply(_c, (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__spread)([_this.resolve(param.token, context)], param.transformArgs)); } return _this.resolve(param, context); } catch (e) { throw new Error((0,_error_helpers__WEBPACK_IMPORTED_MODULE_6__.formatErrorCtor)(ctor, idx, e)); } }; }; InternalDependencyContainer.prototype.ensureNotDisposed = function () { if (this.disposed) { throw new Error("This container has been disposed, you cannot interact with a disposed container"); } }; return InternalDependencyContainer; }()); var instance = new InternalDependencyContainer(); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (instance); /***/ }), /***/ "./node_modules/tsyringe/dist/esm5/error-helpers.js": /*!**********************************************************!*\ !*** ./node_modules/tsyringe/dist/esm5/error-helpers.js ***! \**********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ formatErrorCtor: () => (/* binding */ formatErrorCtor) /* harmony export */ }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tsyringe/node_modules/tslib/tslib.es6.js"); function formatDependency(params, idx) { if (params === null) { return "at position #" + idx; } var argName = params.split(",")[idx].trim(); return "\"" + argName + "\" at position #" + idx; } function composeErrorMessage(msg, e, indent) { if (indent === void 0) { indent = " "; } return (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__spread)([msg], e.message.split("\n").map(function (l) { return indent + l; })).join("\n"); } function formatErrorCtor(ctor, paramIdx, error) { var _a = (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__read)(ctor.toString().match(/constructor\(([\w, ]+)\)/) || [], 2), _b = _a[1], params = _b === void 0 ? null : _b; var dep = formatDependency(params, paramIdx); return composeErrorMessage("Cannot inject the dependency " + dep + " of \"" + ctor.name + "\" constructor. Reason:", error); } /***/ }), /***/ "./node_modules/tsyringe/dist/esm5/factories/index.js": /*!************************************************************!*\ !*** ./node_modules/tsyringe/dist/esm5/factories/index.js ***! \************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ instanceCachingFactory: () => (/* reexport safe */ _instance_caching_factory__WEBPACK_IMPORTED_MODULE_0__["default"]), /* harmony export */ instancePerContainerCachingFactory: () => (/* reexport safe */ _instance_per_container_caching_factory__WEBPACK_IMPORTED_MODULE_1__["default"]), /* harmony export */ predicateAwareClassFactory: () => (/* reexport safe */ _predicate_aware_class_factory__WEBPACK_IMPORTED_MODULE_2__["default"]) /* harmony export */ }); /* harmony import */ var _instance_caching_factory__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./instance-caching-factory */ "./node_modules/tsyringe/dist/esm5/factories/instance-caching-factory.js"); /* harmony import */ var _instance_per_container_caching_factory__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./instance-per-container-caching-factory */ "./node_modules/tsyringe/dist/esm5/factories/instance-per-container-caching-factory.js"); /* harmony import */ var _predicate_aware_class_factory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./predicate-aware-class-factory */ "./node_modules/tsyringe/dist/esm5/factories/predicate-aware-class-factory.js"); /***/ }), /***/ "./node_modules/tsyringe/dist/esm5/factories/instance-caching-factory.js": /*!*******************************************************************************!*\ !*** ./node_modules/tsyringe/dist/esm5/factories/instance-caching-factory.js ***! \*******************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ instanceCachingFactory) /* harmony export */ }); function instanceCachingFactory(factoryFunc) { var instance; return function (dependencyContainer) { if (instance == undefined) { instance = factoryFunc(dependencyContainer); } return instance; }; } /***/ }), /***/ "./node_modules/tsyringe/dist/esm5/factories/instance-per-container-caching-factory.js": /*!*********************************************************************************************!*\ !*** ./node_modules/tsyringe/dist/esm5/factories/instance-per-container-caching-factory.js ***! \*********************************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ instancePerContainerCachingFactory) /* harmony export */ }); function instancePerContainerCachingFactory(factoryFunc) { var cache = new WeakMap(); return function (dependencyContainer) { var instance = cache.get(dependencyContainer); if (instance == undefined) { instance = factoryFunc(dependencyContainer); cache.set(dependencyContainer, instance); } return instance; }; } /***/ }), /***/ "./node_modules/tsyringe/dist/esm5/factories/predicate-aware-class-factory.js": /*!************************************************************************************!*\ !*** ./node_modules/tsyringe/dist/esm5/factories/predicate-aware-class-factory.js ***! \************************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ predicateAwareClassFactory) /* harmony export */ }); function predicateAwareClassFactory(predicate, trueConstructor, falseConstructor, useCaching) { if (useCaching === void 0) { useCaching = true; } var instance; var previousPredicate; return function (dependencyContainer) { var currentPredicate = predicate(dependencyContainer); if (!useCaching || previousPredicate !== currentPredicate) { if ((previousPredicate = currentPredicate)) { instance = dependencyContainer.resolve(trueConstructor); } else { instance = dependencyContainer.resolve(falseConstructor); } } return instance; }; } /***/ }), /***/ "./node_modules/tsyringe/dist/esm5/index.js": /*!**************************************************!*\ !*** ./node_modules/tsyringe/dist/esm5/index.js ***! \**************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Lifecycle: () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_0__.Lifecycle), /* harmony export */ autoInjectable: () => (/* reexport safe */ _decorators__WEBPACK_IMPORTED_MODULE_1__.autoInjectable), /* harmony export */ container: () => (/* reexport safe */ _dependency_container__WEBPACK_IMPORTED_MODULE_5__.instance), /* harmony export */ delay: () => (/* reexport safe */ _lazy_helpers__WEBPACK_IMPORTED_MODULE_4__.delay), /* harmony export */ inject: () => (/* reexport safe */ _decorators__WEBPACK_IMPORTED_MODULE_1__.inject), /* harmony export */ injectAll: () => (/* reexport safe */ _decorators__WEBPACK_IMPORTED_MODULE_1__.injectAll), /* harmony export */ injectAllWithTransform: () => (/* reexport safe */ _decorators__WEBPACK_IMPORTED_MODULE_1__.injectAllWithTransform), /* harmony export */ injectWithTransform: () => (/* reexport safe */ _decorators__WEBPACK_IMPORTED_MODULE_1__.injectWithTransform), /* harmony export */ injectable: () => (/* reexport safe */ _decorators__WEBPACK_IMPORTED_MODULE_1__.injectable), /* harmony export */ instanceCachingFactory: () => (/* reexport safe */ _factories__WEBPACK_IMPORTED_MODULE_2__.instanceCachingFactory), /* harmony export */ instancePerContainerCachingFactory: () => (/* reexport safe */ _factories__WEBPACK_IMPORTED_MODULE_2__.instancePerContainerCachingFactory), /* harmony export */ isClassProvider: () => (/* reexport safe */ _providers__WEBPACK_IMPORTED_MODULE_3__.isClassProvider), /* harmony export */ isFactoryProvider: () => (/* reexport safe */ _providers__WEBPACK_IMPORTED_MODULE_3__.isFactoryProvider), /* harmony export */ isNormalToken: () => (/* reexport safe */ _providers__WEBPACK_IMPORTED_MODULE_3__.isNormalToken), /* harmony export */ isTokenProvider: () => (/* reexport safe */ _providers__WEBPACK_IMPORTED_MODULE_3__.isTokenProvider), /* harmony export */ isValueProvider: () => (/* reexport safe */ _providers__WEBPACK_IMPORTED_MODULE_3__.isValueProvider), /* harmony export */ predicateAwareClassFactory: () => (/* reexport safe */ _factories__WEBPACK_IMPORTED_MODULE_2__.predicateAwareClassFactory), /* harmony export */ registry: () => (/* reexport safe */ _decorators__WEBPACK_IMPORTED_MODULE_1__.registry), /* harmony export */ scoped: () => (/* reexport safe */ _decorators__WEBPACK_IMPORTED_MODULE_1__.scoped), /* harmony export */ singleton: () => (/* reexport safe */ _decorators__WEBPACK_IMPORTED_MODULE_1__.singleton) /* harmony export */ }); /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types */ "./node_modules/tsyringe/dist/esm5/types/index.js"); /* harmony import */ var _decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./decorators */ "./node_modules/tsyringe/dist/esm5/decorators/index.js"); /* harmony import */ var _factories__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./factories */ "./node_modules/tsyringe/dist/esm5/factories/index.js"); /* harmony import */ var _providers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./providers */ "./node_modules/tsyringe/dist/esm5/providers/index.js"); /* harmony import */ var _lazy_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./lazy-helpers */ "./node_modules/tsyringe/dist/esm5/lazy-helpers.js"); /* harmony import */ var _dependency_container__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./dependency-container */ "./node_modules/tsyringe/dist/esm5/dependency-container.js"); if (typeof Reflect === "undefined" || !Reflect.getMetadata) { throw new Error("tsyringe requires a reflect polyfill. Please add 'import \"reflect-metadata\"' to the top of your entry point."); } /***/ }), /***/ "./node_modules/tsyringe/dist/esm5/interceptors.js": /*!*********************************************************!*\ !*** ./node_modules/tsyringe/dist/esm5/interceptors.js ***! \*********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ PostResolutionInterceptors: () => (/* binding */ PostResolutionInterceptors), /* harmony export */ PreResolutionInterceptors: () => (/* binding */ PreResolutionInterceptors), /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! tslib */ "./node_modules/tsyringe/node_modules/tslib/tslib.es6.js"); /* harmony import */ var _registry_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./registry-base */ "./node_modules/tsyringe/dist/esm5/registry-base.js"); var PreResolutionInterceptors = (function (_super) { (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__extends)(PreResolutionInterceptors, _super); function PreResolutionInterceptors() { return _super !== null && _super.apply(this, arguments) || this; } return PreResolutionInterceptors; }(_registry_base__WEBPACK_IMPORTED_MODULE_0__["default"])); var PostResolutionInterceptors = (function (_super) { (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__extends)(PostResolutionInterceptors, _super); function PostResolutionInterceptors() { return _super !== null && _super.apply(this, arguments) || this; } return PostResolutionInterceptors; }(_registry_base__WEBPACK_IMPORTED_MODULE_0__["default"])); var Interceptors = (function () { function Interceptors() { this.preResolution = new PreResolutionInterceptors(); this.postResolution = new PostResolutionInterceptors(); } return Interceptors; }()); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Interceptors); /***/ }), /***/ "./node_modules/tsyringe/dist/esm5/lazy-helpers.js": /*!*********************************************************!*\ !*** ./node_modules/tsyringe/dist/esm5/lazy-helpers.js ***! \*********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ DelayedConstructor: () => (/* binding */ DelayedConstructor), /* harmony export */ delay: () => (/* binding */ delay) /* harmony export */ }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tsyringe/node_modules/tslib/tslib.es6.js"); var DelayedConstructor = (function () { function DelayedConstructor(wrap) { this.wrap = wrap; this.reflectMethods = [ "get", "getPrototypeOf", "setPrototypeOf", "getOwnPropertyDescriptor", "defineProperty", "has", "set", "deleteProperty", "apply", "construct", "ownKeys" ]; } DelayedConstructor.prototype.createProxy = function (createObject) { var _this = this; var target = {}; var init = false; var value; var delayedObject = function () { if (!init) { value = createObject(_this.wrap()); init = true; } return value; }; return new Proxy(target, this.createHandler(delayedObject)); }; DelayedConstructor.prototype.createHandler = function (delayedObject) { var handler = {}; var install = function (name) { handler[name] = function () { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } args[0] = delayedObject(); var method = Reflect[name]; return method.apply(void 0, (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__spread)(args)); }; }; this.reflectMethods.forEach(install); return handler; }; return DelayedConstructor; }()); function delay(wrappedConstructor) { if (typeof wrappedConstructor === "undefined") { throw new Error("Attempt to `delay` undefined. Constructor must be wrapped in a callback"); } return new DelayedConstructor(wrappedConstructor); } /***/ }), /***/ "./node_modules/tsyringe/dist/esm5/providers/class-provider.js": /*!*********************************************************************!*\ !*** ./node_modules/tsyringe/dist/esm5/providers/class-provider.js ***! \*********************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ isClassProvider: () => (/* binding */ isClassProvider) /* harmony export */ }); function isClassProvider(provider) { return !!provider.useClass; } /***/ }), /***/ "./node_modules/tsyringe/dist/esm5/providers/factory-provider.js": /*!***********************************************************************!*\ !*** ./node_modules/tsyringe/dist/esm5/providers/factory-provider.js ***! \***********************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ isFactoryProvider: () => (/* binding */ isFactoryProvider) /* harmony export */ }); function isFactoryProvider(provider) { return !!provider.useFactory; } /***/ }), /***/ "./node_modules/tsyringe/dist/esm5/providers/index.js": /*!************************************************************!*\ !*** ./node_modules/tsyringe/dist/esm5/providers/index.js ***! \************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ isClassProvider: () => (/* reexport safe */ _class_provider__WEBPACK_IMPORTED_MODULE_0__.isClassProvider), /* harmony export */ isFactoryProvider: () => (/* reexport safe */ _factory_provider__WEBPACK_IMPORTED_MODULE_1__.isFactoryProvider), /* harmony export */ isNormalToken: () => (/* reexport safe */ _injection_token__WEBPACK_IMPORTED_MODULE_2__.isNormalToken), /* harmony export */ isTokenProvider: () => (/* reexport safe */ _token_provider__WEBPACK_IMPORTED_MODULE_3__.isTokenProvider), /* harmony export */ isValueProvider: () => (/* reexport safe */ _value_provider__WEBPACK_IMPORTED_MODULE_4__.isValueProvider) /* harmony export */ }); /* harmony import */ var _class_provider__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./class-provider */ "./node_modules/tsyringe/dist/esm5/providers/class-provider.js"); /* harmony import */ var _factory_provider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./factory-provider */ "./node_modules/tsyringe/dist/esm5/providers/factory-provider.js"); /* harmony import */ var _injection_token__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./injection-token */ "./node_modules/tsyringe/dist/esm5/providers/injection-token.js"); /* harmony import */ var _token_provider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./token-provider */ "./node_modules/tsyringe/dist/esm5/providers/token-provider.js"); /* harmony import */ var _value_provider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./value-provider */ "./node_modules/tsyringe/dist/esm5/providers/value-provider.js"); /***/ }), /***/ "./node_modules/tsyringe/dist/esm5/providers/injection-token.js": /*!**********************************************************************!*\ !*** ./node_modules/tsyringe/dist/esm5/providers/injection-token.js ***! \**********************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ isConstructorToken: () => (/* binding */ isConstructorToken), /* harmony export */ isNormalToken: () => (/* binding */ isNormalToken), /* harmony export */ isTokenDescriptor: () => (/* binding */ isTokenDescriptor), /* harmony export */ isTransformDescriptor: () => (/* binding */ isTransformDescriptor) /* harmony export */ }); /* harmony import */ var _lazy_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../lazy-helpers */ "./node_modules/tsyringe/dist/esm5/lazy-helpers.js"); function isNormalToken(token) { return typeof token === "string" || typeof token === "symbol"; } function isTokenDescriptor(descriptor) { return (typeof descriptor === "object" && "token" in descriptor && "multiple" in descriptor); } function isTransformDescriptor(descriptor) { return (typeof descriptor === "object" && "token" in descriptor && "transform" in descriptor); } function isConstructorToken(token) { return typeof token === "function" || token instanceof _lazy_helpers__WEBPACK_IMPORTED_MODULE_0__.DelayedConstructor; } /***/ }), /***/ "./node_modules/tsyringe/dist/esm5/providers/provider.js": /*!***************************************************************!*\ !*** ./node_modules/tsyringe/dist/esm5/providers/provider.js ***! \***************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ isProvider: () => (/* binding */ isProvider) /* harmony export */ }); /* harmony import */ var _class_provider__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./class-provider */ "./node_modules/tsyringe/dist/esm5/providers/class-provider.js"); /* harmony import */ var _value_provider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./value-provider */ "./node_modules/tsyringe/dist/esm5/providers/value-provider.js"); /* harmony import */ var _token_provider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./token-provider */ "./node_modules/tsyringe/dist/esm5/providers/token-provider.js"); /* harmony import */ var _factory_provider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./factory-provider */ "./node_modules/tsyringe/dist/esm5/providers/factory-provider.js"); function isProvider(provider) { return ((0,_class_provider__WEBPACK_IMPORTED_MODULE_0__.isClassProvider)(provider) || (0,_value_provider__WEBPACK_IMPORTED_MODULE_1__.isValueProvider)(provider) || (0,_token_provider__WEBPACK_IMPORTED_MODULE_2__.isTokenProvider)(provider) || (0,_factory_provider__WEBPACK_IMPORTED_MODULE_3__.isFactoryProvider)(provider)); } /***/ }), /***/ "./node_modules/tsyringe/dist/esm5/providers/token-provider.js": /*!*********************************************************************!*\ !*** ./node_modules/tsyringe/dist/esm5/providers/token-provider.js ***! \*********************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ isTokenProvider: () => (/* binding */ isTokenProvider) /* harmony export */ }); function isTokenProvider(provider) { return !!provider.useToken; } /***/ }), /***/ "./node_modules/tsyringe/dist/esm5/providers/value-provider.js": /*!*********************************************************************!*\ !*** ./node_modules/tsyringe/dist/esm5/providers/value-provider.js ***! \*********************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ isValueProvider: () => (/* binding */ isValueProvider) /* harmony export */ }); function isValueProvider(provider) { return provider.useValue != undefined; } /***/ }), /***/ "./node_modules/tsyringe/dist/esm5/reflection-helpers.js": /*!***************************************************************!*\ !*** ./node_modules/tsyringe/dist/esm5/reflection-helpers.js ***! \***************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ INJECTION_TOKEN_METADATA_KEY: () => (/* binding */ INJECTION_TOKEN_METADATA_KEY), /* harmony export */ defineInjectionTokenMetadata: () => (/* binding */ defineInjectionTokenMetadata), /* harmony export */ getParamInfo: () => (/* binding */ getParamInfo) /* harmony export */ }); var INJECTION_TOKEN_METADATA_KEY = "injectionTokens"; function getParamInfo(target) { var params = Reflect.getMetadata("design:paramtypes", target) || []; var injectionTokens = Reflect.getOwnMetadata(INJECTION_TOKEN_METADATA_KEY, target) || {}; Object.keys(injectionTokens).forEach(function (key) { params[+key] = injectionTokens[key]; }); return params; } function defineInjectionTokenMetadata(data, transform) { return function (target, _propertyKey, parameterIndex) { var descriptors = Reflect.getOwnMetadata(INJECTION_TOKEN_METADATA_KEY, target) || {}; descriptors[parameterIndex] = transform ? { token: data, transform: transform.transformToken, transformArgs: transform.args || [] } : data; Reflect.defineMetadata(INJECTION_TOKEN_METADATA_KEY, descriptors, target); }; } /***/ }), /***/ "./node_modules/tsyringe/dist/esm5/registry-base.js": /*!**********************************************************!*\ !*** ./node_modules/tsyringe/dist/esm5/registry-base.js ***! \**********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); var RegistryBase = (function () { function RegistryBase() { this._registryMap = new Map(); } RegistryBase.prototype.entries = function () { return this._registryMap.entries(); }; RegistryBase.prototype.getAll = function (key) { this.ensure(key); return this._registryMap.get(key); }; RegistryBase.prototype.get = function (key) { this.ensure(key); var value = this._registryMap.get(key); return value[value.length - 1] || null; }; RegistryBase.prototype.set = function (key, value) { this.ensure(key); this._registryMap.get(key).push(value); }; RegistryBase.prototype.setAll = function (key, value) { this._registryMap.set(key, value); }; RegistryBase.prototype.has = function (key) { this.ensure(key); return this._registryMap.get(key).length > 0; }; RegistryBase.prototype.clear = function () { this._registryMap.clear(); }; RegistryBase.prototype.ensure = function (key) { if (!this._registryMap.has(key)) { this._registryMap.set(key, []); } }; return RegistryBase; }()); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (RegistryBase); /***/ }), /***/ "./node_modules/tsyringe/dist/esm5/registry.js": /*!*****************************************************!*\ !*** ./node_modules/tsyringe/dist/esm5/registry.js ***! \*****************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! tslib */ "./node_modules/tsyringe/node_modules/tslib/tslib.es6.js"); /* harmony import */ var _registry_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./registry-base */ "./node_modules/tsyringe/dist/esm5/registry-base.js"); var Registry = (function (_super) { (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__extends)(Registry, _super); function Registry() { return _super !== null && _super.apply(this, arguments) || this; } return Registry; }(_registry_base__WEBPACK_IMPORTED_MODULE_0__["default"])); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Registry); /***/ }), /***/ "./node_modules/tsyringe/dist/esm5/resolution-context.js": /*!***************************************************************!*\ !*** ./node_modules/tsyringe/dist/esm5/resolution-context.js ***! \***************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); var ResolutionContext = (function () { function ResolutionContext() { this.scopedResolutions = new Map(); } return ResolutionContext; }()); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ResolutionContext); /***/ }), /***/ "./node_modules/tsyringe/dist/esm5/types/disposable.js": /*!*************************************************************!*\ !*** ./node_modules/tsyringe/dist/esm5/types/disposable.js ***! \*************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ isDisposable: () => (/* binding */ isDisposable) /* harmony export */ }); function isDisposable(value) { if (typeof value.dispose !== "function") return false; var disposeFun = value.dispose; if (disposeFun.length > 0) { return false; } return true; } /***/ }), /***/ "./node_modules/tsyringe/dist/esm5/types/index.js": /*!********************************************************!*\ !*** ./node_modules/tsyringe/dist/esm5/types/index.js ***! \********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Lifecycle: () => (/* reexport safe */ _lifecycle__WEBPACK_IMPORTED_MODULE_0__["default"]) /* harmony export */ }); /* harmony import */ var _lifecycle__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lifecycle */ "./node_modules/tsyringe/dist/esm5/types/lifecycle.js"); /***/ }), /***/ "./node_modules/tsyringe/dist/esm5/types/lifecycle.js": /*!************************************************************!*\ !*** ./node_modules/tsyringe/dist/esm5/types/lifecycle.js ***! \************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); var Lifecycle; (function (Lifecycle) { Lifecycle[Lifecycle["Transient"] = 0] = "Transient"; Lifecycle[Lifecycle["Singleton"] = 1] = "Singleton"; Lifecycle[Lifecycle["ResolutionScoped"] = 2] = "ResolutionScoped"; Lifecycle[Lifecycle["ContainerScoped"] = 3] = "ContainerScoped"; })(Lifecycle || (Lifecycle = {})); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Lifecycle); /***/ }), /***/ "./node_modules/tsyringe/node_modules/tslib/tslib.es6.js": /*!***************************************************************!*\ !*** ./node_modules/tsyringe/node_modules/tslib/tslib.es6.js ***! \***************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ __assign: () => (/* binding */ __assign), /* harmony export */ __asyncDelegator: () => (/* binding */ __asyncDelegator), /* harmony export */ __asyncGenerator: () => (/* binding */ __asyncGenerator), /* harmony export */ __asyncValues: () => (/* binding */ __asyncValues), /* harmony export */ __await: () => (/* binding */ __await), /* harmony export */ __awaiter: () => (/* binding */ __awaiter), /* harmony export */ __classPrivateFieldGet: () => (/* binding */ __classPrivateFieldGet), /* harmony export */ __classPrivateFieldSet: () => (/* binding */ __classPrivateFieldSet), /* harmony export */ __createBinding: () => (/* binding */ __createBinding), /* harmony export */ __decorate: () => (/* binding */ __decorate), /* harmony export */ __exportStar: () => (/* binding */ __exportStar), /* harmony export */ __extends: () => (/* binding */ __extends), /* harmony export */ __generator: () => (/* binding */ __generator), /* harmony export */ __importDefault: () => (/* binding */ __importDefault), /* harmony export */ __importStar: () => (/* binding */ __importStar), /* harmony export */ __makeTemplateObject: () => (/* binding */ __makeTemplateObject), /* harmony export */ __metadata: () => (/* binding */ __metadata), /* harmony export */ __param: () => (/* binding */ __param), /* harmony export */ __read: () => (/* binding */ __read), /* harmony export */ __rest: () => (/* binding */ __rest), /* harmony export */ __spread: () => (/* binding */ __spread), /* harmony export */ __spreadArrays: () => (/* binding */ __spreadArrays), /* harmony export */ __values: () => (/* binding */ __values) /* harmony export */ }); /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ /* global Reflect, Promise */ var extendStatics = function(d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; function __extends(d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); } var __assign = function() { __assign = Object.assign || function __assign(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 __rest(s, e) { var t = {}; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; } return t; } function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; } function __param(paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } } function __metadata(metadataKey, metadataValue) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); } 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, _arguments || [])).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 (_) 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 }; } } function __createBinding(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; } function __exportStar(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p]; } function __values(o) { var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; if (m) return m.call(o); if (o && typeof o.length === "number") return { next: function () { if (o && i >= o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); } function __read(o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; } function __spread() { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); return ar; } function __spreadArrays() { for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j]; return r; }; function __await(v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } function __asyncGenerator(thisArg, _arguments, generator) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var g = generator.apply(thisArg, _arguments || []), i, q = []; return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } function fulfill(value) { resume("next", value); } function reject(value) { resume("throw", value); } function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } } function __asyncDelegator(o) { var i, p; return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } } function __asyncValues(o) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var m = o[Symbol.asyncIterator], i; return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } } function __makeTemplateObject(cooked, raw) { if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } return cooked; }; function __importStar(mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result.default = mod; return result; } function __importDefault(mod) { return (mod && mod.__esModule) ? mod : { default: mod }; } function __classPrivateFieldGet(receiver, privateMap) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return privateMap.get(receiver); } function __classPrivateFieldSet(receiver, privateMap, value) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to set private field on non-instance"); } privateMap.set(receiver, value); return value; } /***/ }), /***/ "./node_modules/universalify/index.js": /*!********************************************!*\ !*** ./node_modules/universalify/index.js ***! \********************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; exports.fromCallback = function (fn) { return Object.defineProperty(function (...args) { if (typeof args[args.length - 1] === 'function') fn.apply(this, args) else { return new Promise((resolve, reject) => { args.push((err, res) => (err != null) ? reject(err) : resolve(res)) fn.apply(this, args) }) } }, 'name', { value: fn.name }) } exports.fromPromise = function (fn) { return Object.defineProperty(function (...args) { const cb = args[args.length - 1] if (typeof cb !== 'function') return fn.apply(this, args) else { args.pop() fn.apply(this, args).then(r => cb(null, r), cb) } }, 'name', { value: fn.name }) } /***/ }), /***/ "./node_modules/util-deprecate/browser.js": /*!************************************************!*\ !*** ./node_modules/util-deprecate/browser.js ***! \************************************************/ /***/ ((module) => { /** * Module exports. */ module.exports = deprecate; /** * Mark that a method should not be used. * Returns a modified function which warns once by default. * * If `localStorage.noDeprecation = true` is set, then it is a no-op. * * If `localStorage.throwDeprecation = true` is set, then deprecated functions * will throw an Error when invoked. * * If `localStorage.traceDeprecation = true` is set, then deprecated functions * will invoke `console.trace()` instead of `console.error()`. * * @param {Function} fn - the function to deprecate * @param {String} msg - the string to print to the console when `fn` is invoked * @returns {Function} a new "deprecated" version of `fn` * @api public */ function deprecate (fn, msg) { if (config('noDeprecation')) { return fn; } var warned = false; function deprecated() { if (!warned) { if (config('throwDeprecation')) { throw new Error(msg); } else if (config('traceDeprecation')) { console.trace(msg); } else { console.warn(msg); } warned = true; } return fn.apply(this, arguments); } return deprecated; } /** * Checks `localStorage` for boolean values for the given `name`. * * @param {String} name * @returns {Boolean} * @api private */ function config (name) { // accessing global.localStorage can trigger a DOMException in sandboxed iframes try { if (!global.localStorage) return false; } catch (_) { return false; } var val = global.localStorage[name]; if (null == val) return false; return String(val).toLowerCase() === 'true'; } /***/ }), /***/ "./node_modules/vue-loader/dist/exportHelper.js": /*!******************************************************!*\ !*** ./node_modules/vue-loader/dist/exportHelper.js ***! \******************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); // runtime helper for setting properties on components // in a tree-shakable way exports["default"] = (sfc, props) => { const target = sfc.__vccOpts || sfc; for (const [key, val] of props) { target[key] = val; } return target; }; /***/ }), /***/ "./src/panel/default/component/default-app.vue": /*!*****************************************************!*\ !*** ./src/panel/default/component/default-app.vue ***! \*****************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ __esModule: () => (/* reexport safe */ _default_app_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_1__.__esModule), /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _default_app_vue_vue_type_template_id_792ce910_ts_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./default-app.vue?vue&type=template&id=792ce910&ts=true */ "./src/panel/default/component/default-app.vue?vue&type=template&id=792ce910&ts=true"); /* harmony import */ var _default_app_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./default-app.vue?vue&type=script&lang=ts */ "./src/panel/default/component/default-app.vue?vue&type=script&lang=ts"); /* harmony import */ var _node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js"); ; const __exports__ = /*#__PURE__*/(0,_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_default_app_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_default_app_vue_vue_type_template_id_792ce910_ts_true__WEBPACK_IMPORTED_MODULE_0__.render]]) /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__); /***/ }), /***/ "./src/panel/default/component/panel/default-home.vue": /*!************************************************************!*\ !*** ./src/panel/default/component/panel/default-home.vue ***! \************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ __esModule: () => (/* reexport safe */ _default_home_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_1__.__esModule), /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _default_home_vue_vue_type_template_id_4f5c9af6_ts_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./default-home.vue?vue&type=template&id=4f5c9af6&ts=true */ "./src/panel/default/component/panel/default-home.vue?vue&type=template&id=4f5c9af6&ts=true"); /* harmony import */ var _default_home_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./default-home.vue?vue&type=script&lang=ts */ "./src/panel/default/component/panel/default-home.vue?vue&type=script&lang=ts"); /* harmony import */ var _node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../../node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js"); ; const __exports__ = /*#__PURE__*/(0,_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_default_home_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_default_home_vue_vue_type_template_id_4f5c9af6_ts_true__WEBPACK_IMPORTED_MODULE_0__.render]]) /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__); /***/ }), /***/ "./src/panel/default/component/panel/default-mask.vue": /*!************************************************************!*\ !*** ./src/panel/default/component/panel/default-mask.vue ***! \************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ __esModule: () => (/* reexport safe */ _default_mask_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_1__.__esModule), /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _default_mask_vue_vue_type_template_id_0b323694_ts_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./default-mask.vue?vue&type=template&id=0b323694&ts=true */ "./src/panel/default/component/panel/default-mask.vue?vue&type=template&id=0b323694&ts=true"); /* harmony import */ var _default_mask_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./default-mask.vue?vue&type=script&lang=ts */ "./src/panel/default/component/panel/default-mask.vue?vue&type=script&lang=ts"); /* harmony import */ var _node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../../node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js"); ; const __exports__ = /*#__PURE__*/(0,_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_default_mask_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_default_mask_vue_vue_type_template_id_0b323694_ts_true__WEBPACK_IMPORTED_MODULE_0__.render]]) /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__); /***/ }), /***/ "./src/panel/default/component/panel/default-translate.vue": /*!*****************************************************************!*\ !*** ./src/panel/default/component/panel/default-translate.vue ***! \*****************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ __esModule: () => (/* reexport safe */ _default_translate_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_1__.__esModule), /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _default_translate_vue_vue_type_template_id_46070b16_ts_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./default-translate.vue?vue&type=template&id=46070b16&ts=true */ "./src/panel/default/component/panel/default-translate.vue?vue&type=template&id=46070b16&ts=true"); /* harmony import */ var _default_translate_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./default-translate.vue?vue&type=script&lang=ts */ "./src/panel/default/component/panel/default-translate.vue?vue&type=script&lang=ts"); /* harmony import */ var _node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../../node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js"); ; const __exports__ = /*#__PURE__*/(0,_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_default_translate_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_default_translate_vue_vue_type_template_id_46070b16_ts_true__WEBPACK_IMPORTED_MODULE_0__.render]]) /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__); /***/ }), /***/ "./src/panel/share/ui/m-button.vue": /*!*****************************************!*\ !*** ./src/panel/share/ui/m-button.vue ***! \*****************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ __esModule: () => (/* reexport safe */ _m_button_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_1__.__esModule), /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _m_button_vue_vue_type_template_id_01e423b1_ts_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./m-button.vue?vue&type=template&id=01e423b1&ts=true */ "./src/panel/share/ui/m-button.vue?vue&type=template&id=01e423b1&ts=true"); /* harmony import */ var _m_button_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./m-button.vue?vue&type=script&lang=ts */ "./src/panel/share/ui/m-button.vue?vue&type=script&lang=ts"); /* harmony import */ var _node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js"); ; const __exports__ = /*#__PURE__*/(0,_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_m_button_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_m_button_vue_vue_type_template_id_01e423b1_ts_true__WEBPACK_IMPORTED_MODULE_0__.render]]) /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__); /***/ }), /***/ "./src/panel/share/ui/m-file.vue": /*!***************************************!*\ !*** ./src/panel/share/ui/m-file.vue ***! \***************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ __esModule: () => (/* reexport safe */ _m_file_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_1__.__esModule), /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _m_file_vue_vue_type_template_id_7126b95b_ts_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./m-file.vue?vue&type=template&id=7126b95b&ts=true */ "./src/panel/share/ui/m-file.vue?vue&type=template&id=7126b95b&ts=true"); /* harmony import */ var _m_file_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./m-file.vue?vue&type=script&lang=ts */ "./src/panel/share/ui/m-file.vue?vue&type=script&lang=ts"); /* harmony import */ var _node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js"); ; const __exports__ = /*#__PURE__*/(0,_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_m_file_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_m_file_vue_vue_type_template_id_7126b95b_ts_true__WEBPACK_IMPORTED_MODULE_0__.render]]) /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__); /***/ }), /***/ "./src/panel/share/ui/m-icon.vue": /*!***************************************!*\ !*** ./src/panel/share/ui/m-icon.vue ***! \***************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _m_icon_vue_vue_type_template_id_48c80458__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./m-icon.vue?vue&type=template&id=48c80458 */ "./src/panel/share/ui/m-icon.vue?vue&type=template&id=48c80458"); /* harmony import */ var _m_icon_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./m-icon.vue?vue&type=script&lang=js */ "./src/panel/share/ui/m-icon.vue?vue&type=script&lang=js"); /* harmony import */ var _node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js"); ; const __exports__ = /*#__PURE__*/(0,_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_m_icon_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_m_icon_vue_vue_type_template_id_48c80458__WEBPACK_IMPORTED_MODULE_0__.render]]) /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__); /***/ }), /***/ "./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/share/ui/m-icon.vue?vue&type=script&lang=js": /*!*******************************************************************************************************************!*\ !*** ./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/share/ui/m-icon.vue?vue&type=script&lang=js ***! \*******************************************************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ props: { value: { type: String, required: false, }, hasBorder: { type: Boolean, required: false, default: false, }, background: { type: Boolean, required: false, default: true, }, }, }); /***/ }), /***/ "./src/panel/share/ui/m-input.vue": /*!****************************************!*\ !*** ./src/panel/share/ui/m-input.vue ***! \****************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ __esModule: () => (/* reexport safe */ _m_input_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_1__.__esModule), /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _m_input_vue_vue_type_template_id_9a1792d6_ts_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./m-input.vue?vue&type=template&id=9a1792d6&ts=true */ "./src/panel/share/ui/m-input.vue?vue&type=template&id=9a1792d6&ts=true"); /* harmony import */ var _m_input_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./m-input.vue?vue&type=script&lang=ts */ "./src/panel/share/ui/m-input.vue?vue&type=script&lang=ts"); /* harmony import */ var _node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js"); ; const __exports__ = /*#__PURE__*/(0,_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_m_input_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_m_input_vue_vue_type_template_id_9a1792d6_ts_true__WEBPACK_IMPORTED_MODULE_0__.render]]) /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__); /***/ }), /***/ "./src/panel/share/ui/m-menu.vue": /*!***************************************!*\ !*** ./src/panel/share/ui/m-menu.vue ***! \***************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ __esModule: () => (/* reexport safe */ _m_menu_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_1__.__esModule), /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _m_menu_vue_vue_type_template_id_00a526aa_ts_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./m-menu.vue?vue&type=template&id=00a526aa&ts=true */ "./src/panel/share/ui/m-menu.vue?vue&type=template&id=00a526aa&ts=true"); /* harmony import */ var _m_menu_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./m-menu.vue?vue&type=script&lang=ts */ "./src/panel/share/ui/m-menu.vue?vue&type=script&lang=ts"); /* harmony import */ var _node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js"); ; const __exports__ = /*#__PURE__*/(0,_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_m_menu_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_m_menu_vue_vue_type_template_id_00a526aa_ts_true__WEBPACK_IMPORTED_MODULE_0__.render]]) /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__); /***/ }), /***/ "./src/panel/share/ui/m-process.vue": /*!******************************************!*\ !*** ./src/panel/share/ui/m-process.vue ***! \******************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ __esModule: () => (/* reexport safe */ _m_process_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_1__.__esModule), /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _m_process_vue_vue_type_template_id_6dcd75ec_scoped_true_ts_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./m-process.vue?vue&type=template&id=6dcd75ec&scoped=true&ts=true */ "./src/panel/share/ui/m-process.vue?vue&type=template&id=6dcd75ec&scoped=true&ts=true"); /* harmony import */ var _m_process_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./m-process.vue?vue&type=script&lang=ts */ "./src/panel/share/ui/m-process.vue?vue&type=script&lang=ts"); /* harmony import */ var _m_process_vue_vue_type_style_index_0_id_6dcd75ec_scoped_true_lang_less__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./m-process.vue?vue&type=style&index=0&id=6dcd75ec&scoped=true&lang=less */ "./src/panel/share/ui/m-process.vue?vue&type=style&index=0&id=6dcd75ec&scoped=true&lang=less"); /* harmony import */ var _node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js"); ; const __exports__ = /*#__PURE__*/(0,_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_m_process_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_m_process_vue_vue_type_template_id_6dcd75ec_scoped_true_ts_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-6dcd75ec"]]) /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__); /***/ }), /***/ "./src/panel/share/ui/m-section.vue": /*!******************************************!*\ !*** ./src/panel/share/ui/m-section.vue ***! \******************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ __esModule: () => (/* reexport safe */ _m_section_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_1__.__esModule), /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _m_section_vue_vue_type_template_id_1ec691a4_ts_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./m-section.vue?vue&type=template&id=1ec691a4&ts=true */ "./src/panel/share/ui/m-section.vue?vue&type=template&id=1ec691a4&ts=true"); /* harmony import */ var _m_section_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./m-section.vue?vue&type=script&lang=ts */ "./src/panel/share/ui/m-section.vue?vue&type=script&lang=ts"); /* harmony import */ var _node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js"); ; const __exports__ = /*#__PURE__*/(0,_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_m_section_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_m_section_vue_vue_type_template_id_1ec691a4_ts_true__WEBPACK_IMPORTED_MODULE_0__.render]]) /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__); /***/ }), /***/ "./src/panel/share/ui/m-process.vue?vue&type=style&index=0&id=6dcd75ec&scoped=true&lang=less": /*!***************************************************************************************************!*\ !*** ./src/panel/share/ui/m-process.vue?vue&type=style&index=0&id=6dcd75ec&scoped=true&lang=less ***! \***************************************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* reexport safe */ _node_modules_raw_loader_dist_cjs_js_node_modules_less_loader_dist_cjs_js_node_modules_vue_loader_dist_index_js_ruleSet_0_m_process_vue_vue_type_style_index_0_id_6dcd75ec_scoped_true_lang_less__WEBPACK_IMPORTED_MODULE_0__["default"]) /* harmony export */ }); /* harmony import */ var _node_modules_raw_loader_dist_cjs_js_node_modules_less_loader_dist_cjs_js_node_modules_vue_loader_dist_index_js_ruleSet_0_m_process_vue_vue_type_style_index_0_id_6dcd75ec_scoped_true_lang_less__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/raw-loader/dist/cjs.js!../../../../node_modules/less-loader/dist/cjs.js!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0]!./m-process.vue?vue&type=style&index=0&id=6dcd75ec&scoped=true&lang=less */ "./node_modules/raw-loader/dist/cjs.js!./node_modules/less-loader/dist/cjs.js!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/share/ui/m-process.vue?vue&type=style&index=0&id=6dcd75ec&scoped=true&lang=less"); /***/ }), /***/ "./src/panel/default/component/default-app.vue?vue&type=script&lang=ts": /*!*****************************************************************************!*\ !*** ./src/panel/default/component/default-app.vue?vue&type=script&lang=ts ***! \*****************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ __esModule: () => (/* reexport safe */ _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_index_js_ruleSet_0_default_app_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_0__.__esModule), /* harmony export */ "default": () => (/* reexport safe */ _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_index_js_ruleSet_0_default_app_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_0__["default"]) /* harmony export */ }); /* harmony import */ var _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_index_js_ruleSet_0_default_app_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/swc-loader/src/index.js!../../../../pre-swc-loader.js!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0]!./default-app.vue?vue&type=script&lang=ts */ "./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/default/component/default-app.vue?vue&type=script&lang=ts"); /***/ }), /***/ "./src/panel/default/component/panel/default-home.vue?vue&type=script&lang=ts": /*!************************************************************************************!*\ !*** ./src/panel/default/component/panel/default-home.vue?vue&type=script&lang=ts ***! \************************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ __esModule: () => (/* reexport safe */ _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_index_js_ruleSet_0_default_home_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_0__.__esModule), /* harmony export */ "default": () => (/* reexport safe */ _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_index_js_ruleSet_0_default_home_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_0__["default"]) /* harmony export */ }); /* harmony import */ var _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_index_js_ruleSet_0_default_home_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/swc-loader/src/index.js!../../../../../pre-swc-loader.js!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0]!./default-home.vue?vue&type=script&lang=ts */ "./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/default/component/panel/default-home.vue?vue&type=script&lang=ts"); /***/ }), /***/ "./src/panel/default/component/panel/default-mask.vue?vue&type=script&lang=ts": /*!************************************************************************************!*\ !*** ./src/panel/default/component/panel/default-mask.vue?vue&type=script&lang=ts ***! \************************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ __esModule: () => (/* reexport safe */ _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_index_js_ruleSet_0_default_mask_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_0__.__esModule), /* harmony export */ "default": () => (/* reexport safe */ _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_index_js_ruleSet_0_default_mask_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_0__["default"]) /* harmony export */ }); /* harmony import */ var _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_index_js_ruleSet_0_default_mask_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/swc-loader/src/index.js!../../../../../pre-swc-loader.js!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0]!./default-mask.vue?vue&type=script&lang=ts */ "./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/default/component/panel/default-mask.vue?vue&type=script&lang=ts"); /***/ }), /***/ "./src/panel/default/component/panel/default-translate.vue?vue&type=script&lang=ts": /*!*****************************************************************************************!*\ !*** ./src/panel/default/component/panel/default-translate.vue?vue&type=script&lang=ts ***! \*****************************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ __esModule: () => (/* reexport safe */ _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_index_js_ruleSet_0_default_translate_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_0__.__esModule), /* harmony export */ "default": () => (/* reexport safe */ _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_index_js_ruleSet_0_default_translate_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_0__["default"]) /* harmony export */ }); /* harmony import */ var _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_index_js_ruleSet_0_default_translate_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/swc-loader/src/index.js!../../../../../pre-swc-loader.js!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0]!./default-translate.vue?vue&type=script&lang=ts */ "./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/default/component/panel/default-translate.vue?vue&type=script&lang=ts"); /***/ }), /***/ "./src/panel/share/ui/m-button.vue?vue&type=script&lang=ts": /*!*****************************************************************!*\ !*** ./src/panel/share/ui/m-button.vue?vue&type=script&lang=ts ***! \*****************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ __esModule: () => (/* reexport safe */ _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_index_js_ruleSet_0_m_button_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_0__.__esModule), /* harmony export */ "default": () => (/* reexport safe */ _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_index_js_ruleSet_0_m_button_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_0__["default"]) /* harmony export */ }); /* harmony import */ var _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_index_js_ruleSet_0_m_button_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/swc-loader/src/index.js!../../../../pre-swc-loader.js!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0]!./m-button.vue?vue&type=script&lang=ts */ "./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/share/ui/m-button.vue?vue&type=script&lang=ts"); /***/ }), /***/ "./src/panel/share/ui/m-file.vue?vue&type=script&lang=ts": /*!***************************************************************!*\ !*** ./src/panel/share/ui/m-file.vue?vue&type=script&lang=ts ***! \***************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ __esModule: () => (/* reexport safe */ _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_index_js_ruleSet_0_m_file_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_0__.__esModule), /* harmony export */ "default": () => (/* reexport safe */ _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_index_js_ruleSet_0_m_file_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_0__["default"]) /* harmony export */ }); /* harmony import */ var _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_index_js_ruleSet_0_m_file_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/swc-loader/src/index.js!../../../../pre-swc-loader.js!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0]!./m-file.vue?vue&type=script&lang=ts */ "./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/share/ui/m-file.vue?vue&type=script&lang=ts"); /***/ }), /***/ "./src/panel/share/ui/m-input.vue?vue&type=script&lang=ts": /*!****************************************************************!*\ !*** ./src/panel/share/ui/m-input.vue?vue&type=script&lang=ts ***! \****************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ __esModule: () => (/* reexport safe */ _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_index_js_ruleSet_0_m_input_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_0__.__esModule), /* harmony export */ "default": () => (/* reexport safe */ _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_index_js_ruleSet_0_m_input_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_0__["default"]) /* harmony export */ }); /* harmony import */ var _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_index_js_ruleSet_0_m_input_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/swc-loader/src/index.js!../../../../pre-swc-loader.js!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0]!./m-input.vue?vue&type=script&lang=ts */ "./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/share/ui/m-input.vue?vue&type=script&lang=ts"); /***/ }), /***/ "./src/panel/share/ui/m-menu.vue?vue&type=script&lang=ts": /*!***************************************************************!*\ !*** ./src/panel/share/ui/m-menu.vue?vue&type=script&lang=ts ***! \***************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ __esModule: () => (/* reexport safe */ _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_index_js_ruleSet_0_m_menu_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_0__.__esModule), /* harmony export */ "default": () => (/* reexport safe */ _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_index_js_ruleSet_0_m_menu_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_0__["default"]) /* harmony export */ }); /* harmony import */ var _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_index_js_ruleSet_0_m_menu_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/swc-loader/src/index.js!../../../../pre-swc-loader.js!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0]!./m-menu.vue?vue&type=script&lang=ts */ "./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/share/ui/m-menu.vue?vue&type=script&lang=ts"); /***/ }), /***/ "./src/panel/share/ui/m-process.vue?vue&type=script&lang=ts": /*!******************************************************************!*\ !*** ./src/panel/share/ui/m-process.vue?vue&type=script&lang=ts ***! \******************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ __esModule: () => (/* reexport safe */ _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_index_js_ruleSet_0_m_process_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_0__.__esModule), /* harmony export */ "default": () => (/* reexport safe */ _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_index_js_ruleSet_0_m_process_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_0__["default"]) /* harmony export */ }); /* harmony import */ var _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_index_js_ruleSet_0_m_process_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/swc-loader/src/index.js!../../../../pre-swc-loader.js!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0]!./m-process.vue?vue&type=script&lang=ts */ "./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/share/ui/m-process.vue?vue&type=script&lang=ts"); /***/ }), /***/ "./src/panel/share/ui/m-section.vue?vue&type=script&lang=ts": /*!******************************************************************!*\ !*** ./src/panel/share/ui/m-section.vue?vue&type=script&lang=ts ***! \******************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ __esModule: () => (/* reexport safe */ _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_index_js_ruleSet_0_m_section_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_0__.__esModule), /* harmony export */ "default": () => (/* reexport safe */ _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_index_js_ruleSet_0_m_section_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_0__["default"]) /* harmony export */ }); /* harmony import */ var _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_index_js_ruleSet_0_m_section_vue_vue_type_script_lang_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/swc-loader/src/index.js!../../../../pre-swc-loader.js!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0]!./m-section.vue?vue&type=script&lang=ts */ "./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/share/ui/m-section.vue?vue&type=script&lang=ts"); /***/ }), /***/ "./src/panel/default/component/default-app.vue?vue&type=template&id=792ce910&ts=true": /*!*******************************************************************************************!*\ !*** ./src/panel/default/component/default-app.vue?vue&type=template&id=792ce910&ts=true ***! \*******************************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ __esModule: () => (/* reexport safe */ _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_default_app_vue_vue_type_template_id_792ce910_ts_true__WEBPACK_IMPORTED_MODULE_0__.__esModule), /* harmony export */ render: () => (/* reexport safe */ _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_default_app_vue_vue_type_template_id_792ce910_ts_true__WEBPACK_IMPORTED_MODULE_0__.render) /* harmony export */ }); /* harmony import */ var _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_default_app_vue_vue_type_template_id_792ce910_ts_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/swc-loader/src/index.js!../../../../pre-swc-loader.js!../../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0]!./default-app.vue?vue&type=template&id=792ce910&ts=true */ "./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/default/component/default-app.vue?vue&type=template&id=792ce910&ts=true"); /***/ }), /***/ "./src/panel/default/component/panel/default-home.vue?vue&type=template&id=4f5c9af6&ts=true": /*!**************************************************************************************************!*\ !*** ./src/panel/default/component/panel/default-home.vue?vue&type=template&id=4f5c9af6&ts=true ***! \**************************************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ __esModule: () => (/* reexport safe */ _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_default_home_vue_vue_type_template_id_4f5c9af6_ts_true__WEBPACK_IMPORTED_MODULE_0__.__esModule), /* harmony export */ render: () => (/* reexport safe */ _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_default_home_vue_vue_type_template_id_4f5c9af6_ts_true__WEBPACK_IMPORTED_MODULE_0__.render) /* harmony export */ }); /* harmony import */ var _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_default_home_vue_vue_type_template_id_4f5c9af6_ts_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/swc-loader/src/index.js!../../../../../pre-swc-loader.js!../../../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0]!./default-home.vue?vue&type=template&id=4f5c9af6&ts=true */ "./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/default/component/panel/default-home.vue?vue&type=template&id=4f5c9af6&ts=true"); /***/ }), /***/ "./src/panel/default/component/panel/default-mask.vue?vue&type=template&id=0b323694&ts=true": /*!**************************************************************************************************!*\ !*** ./src/panel/default/component/panel/default-mask.vue?vue&type=template&id=0b323694&ts=true ***! \**************************************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ __esModule: () => (/* reexport safe */ _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_default_mask_vue_vue_type_template_id_0b323694_ts_true__WEBPACK_IMPORTED_MODULE_0__.__esModule), /* harmony export */ render: () => (/* reexport safe */ _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_default_mask_vue_vue_type_template_id_0b323694_ts_true__WEBPACK_IMPORTED_MODULE_0__.render) /* harmony export */ }); /* harmony import */ var _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_default_mask_vue_vue_type_template_id_0b323694_ts_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/swc-loader/src/index.js!../../../../../pre-swc-loader.js!../../../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0]!./default-mask.vue?vue&type=template&id=0b323694&ts=true */ "./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/default/component/panel/default-mask.vue?vue&type=template&id=0b323694&ts=true"); /***/ }), /***/ "./src/panel/default/component/panel/default-translate.vue?vue&type=template&id=46070b16&ts=true": /*!*******************************************************************************************************!*\ !*** ./src/panel/default/component/panel/default-translate.vue?vue&type=template&id=46070b16&ts=true ***! \*******************************************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ __esModule: () => (/* reexport safe */ _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_default_translate_vue_vue_type_template_id_46070b16_ts_true__WEBPACK_IMPORTED_MODULE_0__.__esModule), /* harmony export */ render: () => (/* reexport safe */ _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_default_translate_vue_vue_type_template_id_46070b16_ts_true__WEBPACK_IMPORTED_MODULE_0__.render) /* harmony export */ }); /* harmony import */ var _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_default_translate_vue_vue_type_template_id_46070b16_ts_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/swc-loader/src/index.js!../../../../../pre-swc-loader.js!../../../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0]!./default-translate.vue?vue&type=template&id=46070b16&ts=true */ "./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/default/component/panel/default-translate.vue?vue&type=template&id=46070b16&ts=true"); /***/ }), /***/ "./src/panel/share/ui/m-button.vue?vue&type=template&id=01e423b1&ts=true": /*!*******************************************************************************!*\ !*** ./src/panel/share/ui/m-button.vue?vue&type=template&id=01e423b1&ts=true ***! \*******************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ __esModule: () => (/* reexport safe */ _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_m_button_vue_vue_type_template_id_01e423b1_ts_true__WEBPACK_IMPORTED_MODULE_0__.__esModule), /* harmony export */ render: () => (/* reexport safe */ _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_m_button_vue_vue_type_template_id_01e423b1_ts_true__WEBPACK_IMPORTED_MODULE_0__.render) /* harmony export */ }); /* harmony import */ var _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_m_button_vue_vue_type_template_id_01e423b1_ts_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/swc-loader/src/index.js!../../../../pre-swc-loader.js!../../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0]!./m-button.vue?vue&type=template&id=01e423b1&ts=true */ "./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/share/ui/m-button.vue?vue&type=template&id=01e423b1&ts=true"); /***/ }), /***/ "./src/panel/share/ui/m-file.vue?vue&type=template&id=7126b95b&ts=true": /*!*****************************************************************************!*\ !*** ./src/panel/share/ui/m-file.vue?vue&type=template&id=7126b95b&ts=true ***! \*****************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ __esModule: () => (/* reexport safe */ _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_m_file_vue_vue_type_template_id_7126b95b_ts_true__WEBPACK_IMPORTED_MODULE_0__.__esModule), /* harmony export */ render: () => (/* reexport safe */ _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_m_file_vue_vue_type_template_id_7126b95b_ts_true__WEBPACK_IMPORTED_MODULE_0__.render) /* harmony export */ }); /* harmony import */ var _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_m_file_vue_vue_type_template_id_7126b95b_ts_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/swc-loader/src/index.js!../../../../pre-swc-loader.js!../../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0]!./m-file.vue?vue&type=template&id=7126b95b&ts=true */ "./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/share/ui/m-file.vue?vue&type=template&id=7126b95b&ts=true"); /***/ }), /***/ "./src/panel/share/ui/m-input.vue?vue&type=template&id=9a1792d6&ts=true": /*!******************************************************************************!*\ !*** ./src/panel/share/ui/m-input.vue?vue&type=template&id=9a1792d6&ts=true ***! \******************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ __esModule: () => (/* reexport safe */ _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_m_input_vue_vue_type_template_id_9a1792d6_ts_true__WEBPACK_IMPORTED_MODULE_0__.__esModule), /* harmony export */ render: () => (/* reexport safe */ _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_m_input_vue_vue_type_template_id_9a1792d6_ts_true__WEBPACK_IMPORTED_MODULE_0__.render) /* harmony export */ }); /* harmony import */ var _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_m_input_vue_vue_type_template_id_9a1792d6_ts_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/swc-loader/src/index.js!../../../../pre-swc-loader.js!../../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0]!./m-input.vue?vue&type=template&id=9a1792d6&ts=true */ "./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/share/ui/m-input.vue?vue&type=template&id=9a1792d6&ts=true"); /***/ }), /***/ "./src/panel/share/ui/m-menu.vue?vue&type=template&id=00a526aa&ts=true": /*!*****************************************************************************!*\ !*** ./src/panel/share/ui/m-menu.vue?vue&type=template&id=00a526aa&ts=true ***! \*****************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ __esModule: () => (/* reexport safe */ _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_m_menu_vue_vue_type_template_id_00a526aa_ts_true__WEBPACK_IMPORTED_MODULE_0__.__esModule), /* harmony export */ render: () => (/* reexport safe */ _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_m_menu_vue_vue_type_template_id_00a526aa_ts_true__WEBPACK_IMPORTED_MODULE_0__.render) /* harmony export */ }); /* harmony import */ var _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_m_menu_vue_vue_type_template_id_00a526aa_ts_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/swc-loader/src/index.js!../../../../pre-swc-loader.js!../../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0]!./m-menu.vue?vue&type=template&id=00a526aa&ts=true */ "./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/share/ui/m-menu.vue?vue&type=template&id=00a526aa&ts=true"); /***/ }), /***/ "./src/panel/share/ui/m-process.vue?vue&type=template&id=6dcd75ec&scoped=true&ts=true": /*!********************************************************************************************!*\ !*** ./src/panel/share/ui/m-process.vue?vue&type=template&id=6dcd75ec&scoped=true&ts=true ***! \********************************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ __esModule: () => (/* reexport safe */ _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_m_process_vue_vue_type_template_id_6dcd75ec_scoped_true_ts_true__WEBPACK_IMPORTED_MODULE_0__.__esModule), /* harmony export */ render: () => (/* reexport safe */ _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_m_process_vue_vue_type_template_id_6dcd75ec_scoped_true_ts_true__WEBPACK_IMPORTED_MODULE_0__.render) /* harmony export */ }); /* harmony import */ var _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_m_process_vue_vue_type_template_id_6dcd75ec_scoped_true_ts_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/swc-loader/src/index.js!../../../../pre-swc-loader.js!../../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0]!./m-process.vue?vue&type=template&id=6dcd75ec&scoped=true&ts=true */ "./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/share/ui/m-process.vue?vue&type=template&id=6dcd75ec&scoped=true&ts=true"); /***/ }), /***/ "./src/panel/share/ui/m-section.vue?vue&type=template&id=1ec691a4&ts=true": /*!********************************************************************************!*\ !*** ./src/panel/share/ui/m-section.vue?vue&type=template&id=1ec691a4&ts=true ***! \********************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ __esModule: () => (/* reexport safe */ _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_m_section_vue_vue_type_template_id_1ec691a4_ts_true__WEBPACK_IMPORTED_MODULE_0__.__esModule), /* harmony export */ render: () => (/* reexport safe */ _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_m_section_vue_vue_type_template_id_1ec691a4_ts_true__WEBPACK_IMPORTED_MODULE_0__.render) /* harmony export */ }); /* harmony import */ var _node_modules_swc_loader_src_index_js_pre_swc_loader_js_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_m_section_vue_vue_type_template_id_1ec691a4_ts_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/swc-loader/src/index.js!../../../../pre-swc-loader.js!../../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0]!./m-section.vue?vue&type=template&id=1ec691a4&ts=true */ "./node_modules/swc-loader/src/index.js!./pre-swc-loader.js!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/share/ui/m-section.vue?vue&type=template&id=1ec691a4&ts=true"); /***/ }), /***/ "./src/panel/share/ui/m-icon.vue?vue&type=script&lang=js": /*!***************************************************************!*\ !*** ./src/panel/share/ui/m-icon.vue?vue&type=script&lang=js ***! \***************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* reexport safe */ _node_modules_vue_loader_dist_index_js_ruleSet_0_m_icon_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"]) /* harmony export */ }); /* harmony import */ var _node_modules_vue_loader_dist_index_js_ruleSet_0_m_icon_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0]!./m-icon.vue?vue&type=script&lang=js */ "./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/share/ui/m-icon.vue?vue&type=script&lang=js"); /***/ }), /***/ "./src/panel/share/ui/m-icon.vue?vue&type=template&id=48c80458": /*!*********************************************************************!*\ !*** ./src/panel/share/ui/m-icon.vue?vue&type=template&id=48c80458 ***! \*********************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ render: () => (/* reexport safe */ _node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_m_icon_vue_vue_type_template_id_48c80458__WEBPACK_IMPORTED_MODULE_0__.render) /* harmony export */ }); /* harmony import */ var _node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_m_icon_vue_vue_type_template_id_48c80458__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0]!./m-icon.vue?vue&type=template&id=48c80458 */ "./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/share/ui/m-icon.vue?vue&type=template&id=48c80458"); /***/ }), /***/ "./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/share/ui/m-icon.vue?vue&type=template&id=48c80458": /*!***********************************************************************************************************************************************************************************************!*\ !*** ./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/panel/share/ui/m-icon.vue?vue&type=template&id=48c80458 ***! \***********************************************************************************************************************************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ render: () => (/* binding */ render) /* harmony export */ }); /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/index.mjs"); const _hoisted_1 = ["border", "background"] const _hoisted_2 = ["value"] function render(_ctx, _cache, $props, $setup, $data, $options) { return ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", { class: "mIcon", border: $props.hasBorder, background: $props.background }, [ (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, "default", {}, () => [ (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("ui-icon", { value: $props.value }, null, 8, _hoisted_2) ]) ], 8, _hoisted_1)) } /***/ }), /***/ "./node_modules/vue/dist/vue.cjs.js": /*!******************************************!*\ !*** ./node_modules/vue/dist/vue.cjs.js ***! \******************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * vue v3.5.13 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/ Object.defineProperty(exports, "__esModule", ({ value: true })); var compilerDom = __webpack_require__(/*! @vue/compiler-dom */ "./node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.js"); var runtimeDom = __webpack_require__(/*! @vue/runtime-dom */ "./node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.js"); var shared = __webpack_require__(/*! @vue/shared */ "./node_modules/@vue/shared/dist/shared.cjs.js"); function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { for (var k in e) { n[k] = e[k]; } } n.default = e; return Object.freeze(n); } var runtimeDom__namespace = /*#__PURE__*/_interopNamespaceDefault(runtimeDom); const compileCache = /* @__PURE__ */ Object.create(null); function compileToFunction(template, options) { if (!shared.isString(template)) { if (template.nodeType) { template = template.innerHTML; } else { runtimeDom.warn(`invalid template option: `, template); return shared.NOOP; } } const key = shared.genCacheKey(template, options); const cached = compileCache[key]; if (cached) { return cached; } if (template[0] === "#") { const el = document.querySelector(template); if (!el) { runtimeDom.warn(`Template element not found or is empty: ${template}`); } template = el ? el.innerHTML : ``; } const opts = shared.extend( { hoistStatic: true, onError: onError , onWarn: (e) => onError(e, true) }, options ); if (!opts.isCustomElement && typeof customElements !== "undefined") { opts.isCustomElement = (tag) => !!customElements.get(tag); } const { code } = compilerDom.compile(template, opts); function onError(err, asWarning = false) { const message = asWarning ? err.message : `Template compilation error: ${err.message}`; const codeFrame = err.loc && shared.generateCodeFrame( template, err.loc.start.offset, err.loc.end.offset ); runtimeDom.warn(codeFrame ? `${message} ${codeFrame}` : message); } const render = new Function("Vue", code)(runtimeDom__namespace); render._rc = true; return compileCache[key] = render; } runtimeDom.registerRuntimeCompiler(compileToFunction); exports.compile = compileToFunction; Object.keys(runtimeDom).forEach(function (k) { if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = runtimeDom[k]; }); /***/ }), /***/ "./node_modules/vue/index.js": /*!***********************************!*\ !*** ./node_modules/vue/index.js ***! \***********************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; if (false) {} else { module.exports = __webpack_require__(/*! ./dist/vue.cjs.js */ "./node_modules/vue/dist/vue.cjs.js") } /***/ }), /***/ "assert": /*!*************************!*\ !*** external "assert" ***! \*************************/ /***/ ((module) => { "use strict"; module.exports = require("assert"); /***/ }), /***/ "buffer": /*!*************************!*\ !*** external "buffer" ***! \*************************/ /***/ ((module) => { "use strict"; module.exports = require("buffer"); /***/ }), /***/ "constants": /*!****************************!*\ !*** external "constants" ***! \****************************/ /***/ ((module) => { "use strict"; module.exports = require("constants"); /***/ }), /***/ "crypto": /*!*************************!*\ !*** external "crypto" ***! \*************************/ /***/ ((module) => { "use strict"; module.exports = require("crypto"); /***/ }), /***/ "electron": /*!***************************!*\ !*** external "electron" ***! \***************************/ /***/ ((module) => { "use strict"; module.exports = require("electron"); /***/ }), /***/ "events": /*!*************************!*\ !*** external "events" ***! \*************************/ /***/ ((module) => { "use strict"; module.exports = require("events"); /***/ }), /***/ "fs": /*!*********************!*\ !*** external "fs" ***! \*********************/ /***/ ((module) => { "use strict"; module.exports = require("fs"); /***/ }), /***/ "path": /*!***********************!*\ !*** external "path" ***! \***********************/ /***/ ((module) => { "use strict"; module.exports = require("path"); /***/ }), /***/ "stream": /*!*************************!*\ !*** external "stream" ***! \*************************/ /***/ ((module) => { "use strict"; module.exports = require("stream"); /***/ }), /***/ "string_decoder": /*!*********************************!*\ !*** external "string_decoder" ***! \*********************************/ /***/ ((module) => { "use strict"; module.exports = require("string_decoder"); /***/ }), /***/ "util": /*!***********************!*\ !*** external "util" ***! \***********************/ /***/ ((module) => { "use strict"; module.exports = require("util"); /***/ }), /***/ "./node_modules/@babel/parser/lib/index.js": /*!*************************************************!*\ !*** ./node_modules/@babel/parser/lib/index.js ***! \*************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; } class Position { constructor(line, col, index) { this.line = void 0; this.column = void 0; this.index = void 0; this.line = line; this.column = col; this.index = index; } } class SourceLocation { constructor(start, end) { this.start = void 0; this.end = void 0; this.filename = void 0; this.identifierName = void 0; this.start = start; this.end = end; } } function createPositionWithColumnOffset(position, columnOffset) { const { line, column, index } = position; return new Position(line, column + columnOffset, index + columnOffset); } const code = "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED"; var ModuleErrors = { ImportMetaOutsideModule: { message: `import.meta may appear only with 'sourceType: "module"'`, code }, ImportOutsideModule: { message: `'import' and 'export' may appear only with 'sourceType: "module"'`, code } }; const NodeDescriptions = { ArrayPattern: "array destructuring pattern", AssignmentExpression: "assignment expression", AssignmentPattern: "assignment expression", ArrowFunctionExpression: "arrow function expression", ConditionalExpression: "conditional expression", CatchClause: "catch clause", ForOfStatement: "for-of statement", ForInStatement: "for-in statement", ForStatement: "for-loop", FormalParameters: "function parameter list", Identifier: "identifier", ImportSpecifier: "import specifier", ImportDefaultSpecifier: "import default specifier", ImportNamespaceSpecifier: "import namespace specifier", ObjectPattern: "object destructuring pattern", ParenthesizedExpression: "parenthesized expression", RestElement: "rest element", UpdateExpression: { true: "prefix operation", false: "postfix operation" }, VariableDeclarator: "variable declaration", YieldExpression: "yield expression" }; const toNodeDescription = node => node.type === "UpdateExpression" ? NodeDescriptions.UpdateExpression[`${node.prefix}`] : NodeDescriptions[node.type]; var StandardErrors = { AccessorIsGenerator: ({ kind }) => `A ${kind}ter cannot be a generator.`, ArgumentsInClass: "'arguments' is only allowed in functions and class methods.", AsyncFunctionInSingleStatementContext: "Async functions can only be declared at the top level or inside a block.", AwaitBindingIdentifier: "Can not use 'await' as identifier inside an async function.", AwaitBindingIdentifierInStaticBlock: "Can not use 'await' as identifier inside a static block.", AwaitExpressionFormalParameter: "'await' is not allowed in async function parameters.", AwaitUsingNotInAsyncContext: "'await using' is only allowed within async functions and at the top levels of modules.", AwaitNotInAsyncContext: "'await' is only allowed within async functions and at the top levels of modules.", AwaitNotInAsyncFunction: "'await' is only allowed within async functions.", BadGetterArity: "A 'get' accessor must not have any formal parameters.", BadSetterArity: "A 'set' accessor must have exactly one formal parameter.", BadSetterRestParameter: "A 'set' accessor function argument must not be a rest parameter.", ConstructorClassField: "Classes may not have a field named 'constructor'.", ConstructorClassPrivateField: "Classes may not have a private field named '#constructor'.", ConstructorIsAccessor: "Class constructor may not be an accessor.", ConstructorIsAsync: "Constructor can't be an async function.", ConstructorIsGenerator: "Constructor can't be a generator.", DeclarationMissingInitializer: ({ kind }) => `Missing initializer in ${kind} declaration.`, DecoratorArgumentsOutsideParentheses: "Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.", DecoratorBeforeExport: "Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.", DecoratorsBeforeAfterExport: "Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.", DecoratorConstructor: "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?", DecoratorExportClass: "Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.", DecoratorSemicolon: "Decorators must not be followed by a semicolon.", DecoratorStaticBlock: "Decorators can't be used with a static block.", DeferImportRequiresNamespace: 'Only `import defer * as x from "./module"` is valid.', DeletePrivateField: "Deleting a private field is not allowed.", DestructureNamedImport: "ES2015 named imports do not destructure. Use another statement for destructuring after the import.", DuplicateConstructor: "Duplicate constructor in the same class.", DuplicateDefaultExport: "Only one default export allowed per module.", DuplicateExport: ({ exportName }) => `\`${exportName}\` has already been exported. Exported identifiers must be unique.`, DuplicateProto: "Redefinition of __proto__ property.", DuplicateRegExpFlags: "Duplicate regular expression flag.", DynamicImportPhaseRequiresImportExpressions: ({ phase }) => `'import.${phase}(...)' can only be parsed when using the 'createImportExpressions' option.`, ElementAfterRest: "Rest element must be last element.", EscapedCharNotAnIdentifier: "Invalid Unicode escape.", ExportBindingIsString: ({ localName, exportName }) => `A string literal cannot be used as an exported binding without \`from\`.\n- Did you mean \`export { '${localName}' as '${exportName}' } from 'some-module'\`?`, ExportDefaultFromAsIdentifier: "'from' is not allowed as an identifier after 'export default'.", ForInOfLoopInitializer: ({ type }) => `'${type === "ForInStatement" ? "for-in" : "for-of"}' loop variable declaration may not have an initializer.`, ForInUsing: "For-in loop may not start with 'using' declaration.", ForOfAsync: "The left-hand side of a for-of loop may not be 'async'.", ForOfLet: "The left-hand side of a for-of loop may not start with 'let'.", GeneratorInSingleStatementContext: "Generators can only be declared at the top level or inside a block.", IllegalBreakContinue: ({ type }) => `Unsyntactic ${type === "BreakStatement" ? "break" : "continue"}.`, IllegalLanguageModeDirective: "Illegal 'use strict' directive in function with non-simple parameter list.", IllegalReturn: "'return' outside of function.", ImportAttributesUseAssert: "The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedImportAssert` parser plugin to suppress this error.", ImportBindingIsString: ({ importName }) => `A string literal cannot be used as an imported binding.\n- Did you mean \`import { "${importName}" as foo }\`?`, ImportCallArity: `\`import()\` requires exactly one or two arguments.`, ImportCallNotNewExpression: "Cannot use new with import(...).", ImportCallSpreadArgument: "`...` is not allowed in `import()`.", ImportJSONBindingNotDefault: "A JSON module can only be imported with `default`.", ImportReflectionHasAssertion: "`import module x` cannot have assertions.", ImportReflectionNotBinding: 'Only `import module x from "./module"` is valid.', IncompatibleRegExpUVFlags: "The 'u' and 'v' regular expression flags cannot be enabled at the same time.", InvalidBigIntLiteral: "Invalid BigIntLiteral.", InvalidCodePoint: "Code point out of bounds.", InvalidCoverInitializedName: "Invalid shorthand property initializer.", InvalidDecimal: "Invalid decimal.", InvalidDigit: ({ radix }) => `Expected number in radix ${radix}.`, InvalidEscapeSequence: "Bad character escape sequence.", InvalidEscapeSequenceTemplate: "Invalid escape sequence in template.", InvalidEscapedReservedWord: ({ reservedWord }) => `Escape sequence in keyword ${reservedWord}.`, InvalidIdentifier: ({ identifierName }) => `Invalid identifier ${identifierName}.`, InvalidLhs: ({ ancestor }) => `Invalid left-hand side in ${toNodeDescription(ancestor)}.`, InvalidLhsBinding: ({ ancestor }) => `Binding invalid left-hand side in ${toNodeDescription(ancestor)}.`, InvalidLhsOptionalChaining: ({ ancestor }) => `Invalid optional chaining in the left-hand side of ${toNodeDescription(ancestor)}.`, InvalidNumber: "Invalid number.", InvalidOrMissingExponent: "Floating-point numbers require a valid exponent after the 'e'.", InvalidOrUnexpectedToken: ({ unexpected }) => `Unexpected character '${unexpected}'.`, InvalidParenthesizedAssignment: "Invalid parenthesized assignment pattern.", InvalidPrivateFieldResolution: ({ identifierName }) => `Private name #${identifierName} is not defined.`, InvalidPropertyBindingPattern: "Binding member expression.", InvalidRecordProperty: "Only properties and spread elements are allowed in record definitions.", InvalidRestAssignmentPattern: "Invalid rest operator's argument.", LabelRedeclaration: ({ labelName }) => `Label '${labelName}' is already declared.`, LetInLexicalBinding: "'let' is disallowed as a lexically bound name.", LineTerminatorBeforeArrow: "No line break is allowed before '=>'.", MalformedRegExpFlags: "Invalid regular expression flag.", MissingClassName: "A class name is required.", MissingEqInAssignment: "Only '=' operator can be used for specifying default value.", MissingSemicolon: "Missing semicolon.", MissingPlugin: ({ missingPlugin }) => `This experimental syntax requires enabling the parser plugin: ${missingPlugin.map(name => JSON.stringify(name)).join(", ")}.`, MissingOneOfPlugins: ({ missingPlugin }) => `This experimental syntax requires enabling one of the following parser plugin(s): ${missingPlugin.map(name => JSON.stringify(name)).join(", ")}.`, MissingUnicodeEscape: "Expecting Unicode escape sequence \\uXXXX.", MixingCoalesceWithLogical: "Nullish coalescing operator(??) requires parens when mixing with logical operators.", ModuleAttributeDifferentFromType: "The only accepted module attribute is `type`.", ModuleAttributeInvalidValue: "Only string literals are allowed as module attribute values.", ModuleAttributesWithDuplicateKeys: ({ key }) => `Duplicate key "${key}" is not allowed in module attributes.`, ModuleExportNameHasLoneSurrogate: ({ surrogateCharCode }) => `An export name cannot include a lone surrogate, found '\\u${surrogateCharCode.toString(16)}'.`, ModuleExportUndefined: ({ localName }) => `Export '${localName}' is not defined.`, MultipleDefaultsInSwitch: "Multiple default clauses.", NewlineAfterThrow: "Illegal newline after throw.", NoCatchOrFinally: "Missing catch or finally clause.", NumberIdentifier: "Identifier directly after number.", NumericSeparatorInEscapeSequence: "Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.", ObsoleteAwaitStar: "'await*' has been removed from the async functions proposal. Use Promise.all() instead.", OptionalChainingNoNew: "Constructors in/after an Optional Chain are not allowed.", OptionalChainingNoTemplate: "Tagged Template Literals are not allowed in optionalChain.", OverrideOnConstructor: "'override' modifier cannot appear on a constructor declaration.", ParamDupe: "Argument name clash.", PatternHasAccessor: "Object pattern can't contain getter or setter.", PatternHasMethod: "Object pattern can't contain methods.", PrivateInExpectedIn: ({ identifierName }) => `Private names are only allowed in property accesses (\`obj.#${identifierName}\`) or in \`in\` expressions (\`#${identifierName} in obj\`).`, PrivateNameRedeclaration: ({ identifierName }) => `Duplicate private name #${identifierName}.`, RecordExpressionBarIncorrectEndSyntaxType: "Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.", RecordExpressionBarIncorrectStartSyntaxType: "Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.", RecordExpressionHashIncorrectStartSyntaxType: "Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.", RecordNoProto: "'__proto__' is not allowed in Record expressions.", RestTrailingComma: "Unexpected trailing comma after rest element.", SloppyFunction: "In non-strict mode code, functions can only be declared at top level or inside a block.", SloppyFunctionAnnexB: "In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.", SourcePhaseImportRequiresDefault: 'Only `import source x from "./module"` is valid.', StaticPrototype: "Classes may not have static property named prototype.", SuperNotAllowed: "`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?", SuperPrivateField: "Private fields can't be accessed on super.", TrailingDecorator: "Decorators must be attached to a class element.", TupleExpressionBarIncorrectEndSyntaxType: "Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.", TupleExpressionBarIncorrectStartSyntaxType: "Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.", TupleExpressionHashIncorrectStartSyntaxType: "Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.", UnexpectedArgumentPlaceholder: "Unexpected argument placeholder.", UnexpectedAwaitAfterPipelineBody: 'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.', UnexpectedDigitAfterHash: "Unexpected digit after hash token.", UnexpectedImportExport: "'import' and 'export' may only appear at the top level.", UnexpectedKeyword: ({ keyword }) => `Unexpected keyword '${keyword}'.`, UnexpectedLeadingDecorator: "Leading decorators must be attached to a class declaration.", UnexpectedLexicalDeclaration: "Lexical declaration cannot appear in a single-statement context.", UnexpectedNewTarget: "`new.target` can only be used in functions or class properties.", UnexpectedNumericSeparator: "A numeric separator is only allowed between two digits.", UnexpectedPrivateField: "Unexpected private name.", UnexpectedReservedWord: ({ reservedWord }) => `Unexpected reserved word '${reservedWord}'.`, UnexpectedSuper: "'super' is only allowed in object methods and classes.", UnexpectedToken: ({ expected, unexpected }) => `Unexpected token${unexpected ? ` '${unexpected}'.` : ""}${expected ? `, expected "${expected}"` : ""}`, UnexpectedTokenUnaryExponentiation: "Illegal expression. Wrap left hand side or entire exponentiation in parentheses.", UnexpectedUsingDeclaration: "Using declaration cannot appear in the top level when source type is `script`.", UnsupportedBind: "Binding should be performed on object property.", UnsupportedDecoratorExport: "A decorated export must export a class declaration.", UnsupportedDefaultExport: "Only expressions, functions or classes are allowed as the `default` export.", UnsupportedImport: "`import` can only be used in `import()` or `import.meta`.", UnsupportedMetaProperty: ({ target, onlyValidPropertyName }) => `The only valid meta property for ${target} is ${target}.${onlyValidPropertyName}.`, UnsupportedParameterDecorator: "Decorators cannot be used to decorate parameters.", UnsupportedPropertyDecorator: "Decorators cannot be used to decorate object literal properties.", UnsupportedSuper: "'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).", UnterminatedComment: "Unterminated comment.", UnterminatedRegExp: "Unterminated regular expression.", UnterminatedString: "Unterminated string constant.", UnterminatedTemplate: "Unterminated template.", UsingDeclarationExport: "Using declaration cannot be exported.", UsingDeclarationHasBindingPattern: "Using declaration cannot have destructuring patterns.", VarRedeclaration: ({ identifierName }) => `Identifier '${identifierName}' has already been declared.`, YieldBindingIdentifier: "Can not use 'yield' as identifier inside a generator.", YieldInParameter: "Yield expression is not allowed in formal parameters.", ZeroDigitNumericSeparator: "Numeric separator can not be used after leading 0." }; var StrictModeErrors = { StrictDelete: "Deleting local variable in strict mode.", StrictEvalArguments: ({ referenceName }) => `Assigning to '${referenceName}' in strict mode.`, StrictEvalArgumentsBinding: ({ bindingName }) => `Binding '${bindingName}' in strict mode.`, StrictFunction: "In strict mode code, functions can only be declared at top level or inside a block.", StrictNumericEscape: "The only valid numeric escape in strict mode is '\\0'.", StrictOctalLiteral: "Legacy octal literals are not allowed in strict mode.", StrictWith: "'with' in strict mode." }; const UnparenthesizedPipeBodyDescriptions = new Set(["ArrowFunctionExpression", "AssignmentExpression", "ConditionalExpression", "YieldExpression"]); var PipelineOperatorErrors = { PipeBodyIsTighter: "Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.", PipeTopicRequiresHackPipes: 'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.', PipeTopicUnbound: "Topic reference is unbound; it must be inside a pipe body.", PipeTopicUnconfiguredToken: ({ token }) => `Invalid topic token ${token}. In order to use ${token} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${token}" }.`, PipeTopicUnused: "Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.", PipeUnparenthesizedBody: ({ type }) => `Hack-style pipe body cannot be an unparenthesized ${toNodeDescription({ type })}; please wrap it in parentheses.`, PipelineBodyNoArrow: 'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.', PipelineBodySequenceExpression: "Pipeline body may not be a comma-separated sequence expression.", PipelineHeadSequenceExpression: "Pipeline head should not be a comma-separated sequence expression.", PipelineTopicUnused: "Pipeline is in topic style but does not use topic reference.", PrimaryTopicNotAllowed: "Topic reference was used in a lexical context without topic binding.", PrimaryTopicRequiresSmartPipeline: 'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.' }; const _excluded = ["message"]; function defineHidden(obj, key, value) { Object.defineProperty(obj, key, { enumerable: false, configurable: true, value }); } function toParseErrorConstructor({ toMessage, code, reasonCode, syntaxPlugin }) { const hasMissingPlugin = reasonCode === "MissingPlugin" || reasonCode === "MissingOneOfPlugins"; { const oldReasonCodes = { AccessorCannotDeclareThisParameter: "AccesorCannotDeclareThisParameter", AccessorCannotHaveTypeParameters: "AccesorCannotHaveTypeParameters", ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference: "ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference", SetAccessorCannotHaveOptionalParameter: "SetAccesorCannotHaveOptionalParameter", SetAccessorCannotHaveRestParameter: "SetAccesorCannotHaveRestParameter", SetAccessorCannotHaveReturnType: "SetAccesorCannotHaveReturnType" }; if (oldReasonCodes[reasonCode]) { reasonCode = oldReasonCodes[reasonCode]; } } return function constructor(loc, details) { const error = new SyntaxError(); error.code = code; error.reasonCode = reasonCode; error.loc = loc; error.pos = loc.index; error.syntaxPlugin = syntaxPlugin; if (hasMissingPlugin) { error.missingPlugin = details.missingPlugin; } defineHidden(error, "clone", function clone(overrides = {}) { var _overrides$loc; const { line, column, index } = (_overrides$loc = overrides.loc) != null ? _overrides$loc : loc; return constructor(new Position(line, column, index), Object.assign({}, details, overrides.details)); }); defineHidden(error, "details", details); Object.defineProperty(error, "message", { configurable: true, get() { const message = `${toMessage(details)} (${loc.line}:${loc.column})`; this.message = message; return message; }, set(value) { Object.defineProperty(this, "message", { value, writable: true }); } }); return error; }; } function ParseErrorEnum(argument, syntaxPlugin) { if (Array.isArray(argument)) { return parseErrorTemplates => ParseErrorEnum(parseErrorTemplates, argument[0]); } const ParseErrorConstructors = {}; for (const reasonCode of Object.keys(argument)) { const template = argument[reasonCode]; const _ref = typeof template === "string" ? { message: () => template } : typeof template === "function" ? { message: template } : template, { message } = _ref, rest = _objectWithoutPropertiesLoose(_ref, _excluded); const toMessage = typeof message === "string" ? () => message : message; ParseErrorConstructors[reasonCode] = toParseErrorConstructor(Object.assign({ code: "BABEL_PARSER_SYNTAX_ERROR", reasonCode, toMessage }, syntaxPlugin ? { syntaxPlugin } : {}, rest)); } return ParseErrorConstructors; } const Errors = Object.assign({}, ParseErrorEnum(ModuleErrors), ParseErrorEnum(StandardErrors), ParseErrorEnum(StrictModeErrors), ParseErrorEnum`pipelineOperator`(PipelineOperatorErrors)); const { defineProperty } = Object; const toUnenumerable = (object, key) => { if (object) { defineProperty(object, key, { enumerable: false, value: object[key] }); } }; function toESTreeLocation(node) { toUnenumerable(node.loc.start, "index"); toUnenumerable(node.loc.end, "index"); return node; } var estree = superClass => class ESTreeParserMixin extends superClass { parse() { const file = toESTreeLocation(super.parse()); if (this.options.tokens) { file.tokens = file.tokens.map(toESTreeLocation); } return file; } parseRegExpLiteral({ pattern, flags }) { let regex = null; try { regex = new RegExp(pattern, flags); } catch (_) {} const node = this.estreeParseLiteral(regex); node.regex = { pattern, flags }; return node; } parseBigIntLiteral(value) { let bigInt; try { bigInt = BigInt(value); } catch (_unused) { bigInt = null; } const node = this.estreeParseLiteral(bigInt); node.bigint = String(node.value || value); return node; } parseDecimalLiteral(value) { const decimal = null; const node = this.estreeParseLiteral(decimal); node.decimal = String(node.value || value); return node; } estreeParseLiteral(value) { return this.parseLiteral(value, "Literal"); } parseStringLiteral(value) { return this.estreeParseLiteral(value); } parseNumericLiteral(value) { return this.estreeParseLiteral(value); } parseNullLiteral() { return this.estreeParseLiteral(null); } parseBooleanLiteral(value) { return this.estreeParseLiteral(value); } directiveToStmt(directive) { const expression = directive.value; delete directive.value; expression.type = "Literal"; expression.raw = expression.extra.raw; expression.value = expression.extra.expressionValue; const stmt = directive; stmt.type = "ExpressionStatement"; stmt.expression = expression; stmt.directive = expression.extra.rawValue; delete expression.extra; return stmt; } initFunction(node, isAsync) { super.initFunction(node, isAsync); node.expression = false; } checkDeclaration(node) { if (node != null && this.isObjectProperty(node)) { this.checkDeclaration(node.value); } else { super.checkDeclaration(node); } } getObjectOrClassMethodParams(method) { return method.value.params; } isValidDirective(stmt) { var _stmt$expression$extr; return stmt.type === "ExpressionStatement" && stmt.expression.type === "Literal" && typeof stmt.expression.value === "string" && !((_stmt$expression$extr = stmt.expression.extra) != null && _stmt$expression$extr.parenthesized); } parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse) { super.parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse); const directiveStatements = node.directives.map(d => this.directiveToStmt(d)); node.body = directiveStatements.concat(node.body); delete node.directives; } pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, "ClassMethod", true); if (method.typeParameters) { method.value.typeParameters = method.typeParameters; delete method.typeParameters; } classBody.body.push(method); } parsePrivateName() { const node = super.parsePrivateName(); { if (!this.getPluginOption("estree", "classFeatures")) { return node; } } return this.convertPrivateNameToPrivateIdentifier(node); } convertPrivateNameToPrivateIdentifier(node) { const name = super.getPrivateNameSV(node); node = node; delete node.id; node.name = name; node.type = "PrivateIdentifier"; return node; } isPrivateName(node) { { if (!this.getPluginOption("estree", "classFeatures")) { return super.isPrivateName(node); } } return node.type === "PrivateIdentifier"; } getPrivateNameSV(node) { { if (!this.getPluginOption("estree", "classFeatures")) { return super.getPrivateNameSV(node); } } return node.name; } parseLiteral(value, type) { const node = super.parseLiteral(value, type); node.raw = node.extra.raw; delete node.extra; return node; } parseFunctionBody(node, allowExpression, isMethod = false) { super.parseFunctionBody(node, allowExpression, isMethod); node.expression = node.body.type !== "BlockStatement"; } parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) { let funcNode = this.startNode(); funcNode.kind = node.kind; funcNode = super.parseMethod(funcNode, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope); funcNode.type = "FunctionExpression"; delete funcNode.kind; node.value = funcNode; if (type === "ClassPrivateMethod") { node.computed = false; } return this.finishNode(node, "MethodDefinition"); } nameIsConstructor(key) { if (key.type === "Literal") return key.value === "constructor"; return super.nameIsConstructor(key); } parseClassProperty(...args) { const propertyNode = super.parseClassProperty(...args); { if (!this.getPluginOption("estree", "classFeatures")) { return propertyNode; } } propertyNode.type = "PropertyDefinition"; return propertyNode; } parseClassPrivateProperty(...args) { const propertyNode = super.parseClassPrivateProperty(...args); { if (!this.getPluginOption("estree", "classFeatures")) { return propertyNode; } } propertyNode.type = "PropertyDefinition"; propertyNode.computed = false; return propertyNode; } parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) { const node = super.parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor); if (node) { node.type = "Property"; if (node.kind === "method") { node.kind = "init"; } node.shorthand = false; } return node; } parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors) { const node = super.parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors); if (node) { node.kind = "init"; node.type = "Property"; } return node; } isValidLVal(type, isUnparenthesizedInAssign, binding) { return type === "Property" ? "value" : super.isValidLVal(type, isUnparenthesizedInAssign, binding); } isAssignable(node, isBinding) { if (node != null && this.isObjectProperty(node)) { return this.isAssignable(node.value, isBinding); } return super.isAssignable(node, isBinding); } toAssignable(node, isLHS = false) { if (node != null && this.isObjectProperty(node)) { const { key, value } = node; if (this.isPrivateName(key)) { this.classScope.usePrivateName(this.getPrivateNameSV(key), key.loc.start); } this.toAssignable(value, isLHS); } else { super.toAssignable(node, isLHS); } } toAssignableObjectExpressionProp(prop, isLast, isLHS) { if (prop.type === "Property" && (prop.kind === "get" || prop.kind === "set")) { this.raise(Errors.PatternHasAccessor, prop.key); } else if (prop.type === "Property" && prop.method) { this.raise(Errors.PatternHasMethod, prop.key); } else { super.toAssignableObjectExpressionProp(prop, isLast, isLHS); } } finishCallExpression(unfinished, optional) { const node = super.finishCallExpression(unfinished, optional); if (node.callee.type === "Import") { var _ref, _ref2; node.type = "ImportExpression"; node.source = node.arguments[0]; node.options = (_ref = node.arguments[1]) != null ? _ref : null; node.attributes = (_ref2 = node.arguments[1]) != null ? _ref2 : null; delete node.arguments; delete node.callee; } return node; } toReferencedArguments(node) { if (node.type === "ImportExpression") { return; } super.toReferencedArguments(node); } parseExport(unfinished, decorators) { const exportStartLoc = this.state.lastTokStartLoc; const node = super.parseExport(unfinished, decorators); switch (node.type) { case "ExportAllDeclaration": node.exported = null; break; case "ExportNamedDeclaration": if (node.specifiers.length === 1 && node.specifiers[0].type === "ExportNamespaceSpecifier") { node.type = "ExportAllDeclaration"; node.exported = node.specifiers[0].exported; delete node.specifiers; } case "ExportDefaultDeclaration": { var _declaration$decorato; const { declaration } = node; if ((declaration == null ? void 0 : declaration.type) === "ClassDeclaration" && ((_declaration$decorato = declaration.decorators) == null ? void 0 : _declaration$decorato.length) > 0 && declaration.start === node.start) { this.resetStartLocation(node, exportStartLoc); } } break; } return node; } parseSubscript(base, startLoc, noCalls, state) { const node = super.parseSubscript(base, startLoc, noCalls, state); if (state.optionalChainMember) { if (node.type === "OptionalMemberExpression" || node.type === "OptionalCallExpression") { node.type = node.type.substring(8); } if (state.stop) { const chain = this.startNodeAtNode(node); chain.expression = node; return this.finishNode(chain, "ChainExpression"); } } else if (node.type === "MemberExpression" || node.type === "CallExpression") { node.optional = false; } return node; } isOptionalMemberExpression(node) { if (node.type === "ChainExpression") { return node.expression.type === "MemberExpression"; } return super.isOptionalMemberExpression(node); } hasPropertyAsPrivateName(node) { if (node.type === "ChainExpression") { node = node.expression; } return super.hasPropertyAsPrivateName(node); } isObjectProperty(node) { return node.type === "Property" && node.kind === "init" && !node.method; } isObjectMethod(node) { return node.type === "Property" && (node.method || node.kind === "get" || node.kind === "set"); } finishNodeAt(node, type, endLoc) { return toESTreeLocation(super.finishNodeAt(node, type, endLoc)); } resetStartLocation(node, startLoc) { super.resetStartLocation(node, startLoc); toESTreeLocation(node); } resetEndLocation(node, endLoc = this.state.lastTokEndLoc) { super.resetEndLocation(node, endLoc); toESTreeLocation(node); } }; class TokContext { constructor(token, preserveSpace) { this.token = void 0; this.preserveSpace = void 0; this.token = token; this.preserveSpace = !!preserveSpace; } } const types = { brace: new TokContext("{"), j_oTag: new TokContext("<tag"), j_cTag: new TokContext("</tag"), j_expr: new TokContext("<tag>...</tag>", true) }; { types.template = new TokContext("`", true); } const beforeExpr = true; const startsExpr = true; const isLoop = true; const isAssign = true; const prefix = true; const postfix = true; class ExportedTokenType { constructor(label, conf = {}) { this.label = void 0; this.keyword = void 0; this.beforeExpr = void 0; this.startsExpr = void 0; this.rightAssociative = void 0; this.isLoop = void 0; this.isAssign = void 0; this.prefix = void 0; this.postfix = void 0; this.binop = void 0; this.label = label; this.keyword = conf.keyword; this.beforeExpr = !!conf.beforeExpr; this.startsExpr = !!conf.startsExpr; this.rightAssociative = !!conf.rightAssociative; this.isLoop = !!conf.isLoop; this.isAssign = !!conf.isAssign; this.prefix = !!conf.prefix; this.postfix = !!conf.postfix; this.binop = conf.binop != null ? conf.binop : null; { this.updateContext = null; } } } const keywords$1 = new Map(); function createKeyword(name, options = {}) { options.keyword = name; const token = createToken(name, options); keywords$1.set(name, token); return token; } function createBinop(name, binop) { return createToken(name, { beforeExpr, binop }); } let tokenTypeCounter = -1; const tokenTypes = []; const tokenLabels = []; const tokenBinops = []; const tokenBeforeExprs = []; const tokenStartsExprs = []; const tokenPrefixes = []; function createToken(name, options = {}) { var _options$binop, _options$beforeExpr, _options$startsExpr, _options$prefix; ++tokenTypeCounter; tokenLabels.push(name); tokenBinops.push((_options$binop = options.binop) != null ? _options$binop : -1); tokenBeforeExprs.push((_options$beforeExpr = options.beforeExpr) != null ? _options$beforeExpr : false); tokenStartsExprs.push((_options$startsExpr = options.startsExpr) != null ? _options$startsExpr : false); tokenPrefixes.push((_options$prefix = options.prefix) != null ? _options$prefix : false); tokenTypes.push(new ExportedTokenType(name, options)); return tokenTypeCounter; } function createKeywordLike(name, options = {}) { var _options$binop2, _options$beforeExpr2, _options$startsExpr2, _options$prefix2; ++tokenTypeCounter; keywords$1.set(name, tokenTypeCounter); tokenLabels.push(name); tokenBinops.push((_options$binop2 = options.binop) != null ? _options$binop2 : -1); tokenBeforeExprs.push((_options$beforeExpr2 = options.beforeExpr) != null ? _options$beforeExpr2 : false); tokenStartsExprs.push((_options$startsExpr2 = options.startsExpr) != null ? _options$startsExpr2 : false); tokenPrefixes.push((_options$prefix2 = options.prefix) != null ? _options$prefix2 : false); tokenTypes.push(new ExportedTokenType("name", options)); return tokenTypeCounter; } const tt = { bracketL: createToken("[", { beforeExpr, startsExpr }), bracketHashL: createToken("#[", { beforeExpr, startsExpr }), bracketBarL: createToken("[|", { beforeExpr, startsExpr }), bracketR: createToken("]"), bracketBarR: createToken("|]"), braceL: createToken("{", { beforeExpr, startsExpr }), braceBarL: createToken("{|", { beforeExpr, startsExpr }), braceHashL: createToken("#{", { beforeExpr, startsExpr }), braceR: createToken("}"), braceBarR: createToken("|}"), parenL: createToken("(", { beforeExpr, startsExpr }), parenR: createToken(")"), comma: createToken(",", { beforeExpr }), semi: createToken(";", { beforeExpr }), colon: createToken(":", { beforeExpr }), doubleColon: createToken("::", { beforeExpr }), dot: createToken("."), question: createToken("?", { beforeExpr }), questionDot: createToken("?."), arrow: createToken("=>", { beforeExpr }), template: createToken("template"), ellipsis: createToken("...", { beforeExpr }), backQuote: createToken("`", { startsExpr }), dollarBraceL: createToken("${", { beforeExpr, startsExpr }), templateTail: createToken("...`", { startsExpr }), templateNonTail: createToken("...${", { beforeExpr, startsExpr }), at: createToken("@"), hash: createToken("#", { startsExpr }), interpreterDirective: createToken("#!..."), eq: createToken("=", { beforeExpr, isAssign }), assign: createToken("_=", { beforeExpr, isAssign }), slashAssign: createToken("_=", { beforeExpr, isAssign }), xorAssign: createToken("_=", { beforeExpr, isAssign }), moduloAssign: createToken("_=", { beforeExpr, isAssign }), incDec: createToken("++/--", { prefix, postfix, startsExpr }), bang: createToken("!", { beforeExpr, prefix, startsExpr }), tilde: createToken("~", { beforeExpr, prefix, startsExpr }), doubleCaret: createToken("^^", { startsExpr }), doubleAt: createToken("@@", { startsExpr }), pipeline: createBinop("|>", 0), nullishCoalescing: createBinop("??", 1), logicalOR: createBinop("||", 1), logicalAND: createBinop("&&", 2), bitwiseOR: createBinop("|", 3), bitwiseXOR: createBinop("^", 4), bitwiseAND: createBinop("&", 5), equality: createBinop("==/!=/===/!==", 6), lt: createBinop("</>/<=/>=", 7), gt: createBinop("</>/<=/>=", 7), relational: createBinop("</>/<=/>=", 7), bitShift: createBinop("<</>>/>>>", 8), bitShiftL: createBinop("<</>>/>>>", 8), bitShiftR: createBinop("<</>>/>>>", 8), plusMin: createToken("+/-", { beforeExpr, binop: 9, prefix, startsExpr }), modulo: createToken("%", { binop: 10, startsExpr }), star: createToken("*", { binop: 10 }), slash: createBinop("/", 10), exponent: createToken("**", { beforeExpr, binop: 11, rightAssociative: true }), _in: createKeyword("in", { beforeExpr, binop: 7 }), _instanceof: createKeyword("instanceof", { beforeExpr, binop: 7 }), _break: createKeyword("break"), _case: createKeyword("case", { beforeExpr }), _catch: createKeyword("catch"), _continue: createKeyword("continue"), _debugger: createKeyword("debugger"), _default: createKeyword("default", { beforeExpr }), _else: createKeyword("else", { beforeExpr }), _finally: createKeyword("finally"), _function: createKeyword("function", { startsExpr }), _if: createKeyword("if"), _return: createKeyword("return", { beforeExpr }), _switch: createKeyword("switch"), _throw: createKeyword("throw", { beforeExpr, prefix, startsExpr }), _try: createKeyword("try"), _var: createKeyword("var"), _const: createKeyword("const"), _with: createKeyword("with"), _new: createKeyword("new", { beforeExpr, startsExpr }), _this: createKeyword("this", { startsExpr }), _super: createKeyword("super", { startsExpr }), _class: createKeyword("class", { startsExpr }), _extends: createKeyword("extends", { beforeExpr }), _export: createKeyword("export"), _import: createKeyword("import", { startsExpr }), _null: createKeyword("null", { startsExpr }), _true: createKeyword("true", { startsExpr }), _false: createKeyword("false", { startsExpr }), _typeof: createKeyword("typeof", { beforeExpr, prefix, startsExpr }), _void: createKeyword("void", { beforeExpr, prefix, startsExpr }), _delete: createKeyword("delete", { beforeExpr, prefix, startsExpr }), _do: createKeyword("do", { isLoop, beforeExpr }), _for: createKeyword("for", { isLoop }), _while: createKeyword("while", { isLoop }), _as: createKeywordLike("as", { startsExpr }), _assert: createKeywordLike("assert", { startsExpr }), _async: createKeywordLike("async", { startsExpr }), _await: createKeywordLike("await", { startsExpr }), _defer: createKeywordLike("defer", { startsExpr }), _from: createKeywordLike("from", { startsExpr }), _get: createKeywordLike("get", { startsExpr }), _let: createKeywordLike("let", { startsExpr }), _meta: createKeywordLike("meta", { startsExpr }), _of: createKeywordLike("of", { startsExpr }), _sent: createKeywordLike("sent", { startsExpr }), _set: createKeywordLike("set", { startsExpr }), _source: createKeywordLike("source", { startsExpr }), _static: createKeywordLike("static", { startsExpr }), _using: createKeywordLike("using", { startsExpr }), _yield: createKeywordLike("yield", { startsExpr }), _asserts: createKeywordLike("asserts", { startsExpr }), _checks: createKeywordLike("checks", { startsExpr }), _exports: createKeywordLike("exports", { startsExpr }), _global: createKeywordLike("global", { startsExpr }), _implements: createKeywordLike("implements", { startsExpr }), _intrinsic: createKeywordLike("intrinsic", { startsExpr }), _infer: createKeywordLike("infer", { startsExpr }), _is: createKeywordLike("is", { startsExpr }), _mixins: createKeywordLike("mixins", { startsExpr }), _proto: createKeywordLike("proto", { startsExpr }), _require: createKeywordLike("require", { startsExpr }), _satisfies: createKeywordLike("satisfies", { startsExpr }), _keyof: createKeywordLike("keyof", { startsExpr }), _readonly: createKeywordLike("readonly", { startsExpr }), _unique: createKeywordLike("unique", { startsExpr }), _abstract: createKeywordLike("abstract", { startsExpr }), _declare: createKeywordLike("declare", { startsExpr }), _enum: createKeywordLike("enum", { startsExpr }), _module: createKeywordLike("module", { startsExpr }), _namespace: createKeywordLike("namespace", { startsExpr }), _interface: createKeywordLike("interface", { startsExpr }), _type: createKeywordLike("type", { startsExpr }), _opaque: createKeywordLike("opaque", { startsExpr }), name: createToken("name", { startsExpr }), placeholder: createToken("%%", { startsExpr: true }), string: createToken("string", { startsExpr }), num: createToken("num", { startsExpr }), bigint: createToken("bigint", { startsExpr }), decimal: createToken("decimal", { startsExpr }), regexp: createToken("regexp", { startsExpr }), privateName: createToken("#name", { startsExpr }), eof: createToken("eof"), jsxName: createToken("jsxName"), jsxText: createToken("jsxText", { beforeExpr: true }), jsxTagStart: createToken("jsxTagStart", { startsExpr: true }), jsxTagEnd: createToken("jsxTagEnd") }; function tokenIsIdentifier(token) { return token >= 93 && token <= 133; } function tokenKeywordOrIdentifierIsKeyword(token) { return token <= 92; } function tokenIsKeywordOrIdentifier(token) { return token >= 58 && token <= 133; } function tokenIsLiteralPropertyName(token) { return token >= 58 && token <= 137; } function tokenComesBeforeExpression(token) { return tokenBeforeExprs[token]; } function tokenCanStartExpression(token) { return tokenStartsExprs[token]; } function tokenIsAssignment(token) { return token >= 29 && token <= 33; } function tokenIsFlowInterfaceOrTypeOrOpaque(token) { return token >= 129 && token <= 131; } function tokenIsLoop(token) { return token >= 90 && token <= 92; } function tokenIsKeyword(token) { return token >= 58 && token <= 92; } function tokenIsOperator(token) { return token >= 39 && token <= 59; } function tokenIsPostfix(token) { return token === 34; } function tokenIsPrefix(token) { return tokenPrefixes[token]; } function tokenIsTSTypeOperator(token) { return token >= 121 && token <= 123; } function tokenIsTSDeclarationStart(token) { return token >= 124 && token <= 130; } function tokenLabelName(token) { return tokenLabels[token]; } function tokenOperatorPrecedence(token) { return tokenBinops[token]; } function tokenIsRightAssociative(token) { return token === 57; } function tokenIsTemplate(token) { return token >= 24 && token <= 25; } function getExportedToken(token) { return tokenTypes[token]; } { tokenTypes[8].updateContext = context => { context.pop(); }; tokenTypes[5].updateContext = tokenTypes[7].updateContext = tokenTypes[23].updateContext = context => { context.push(types.brace); }; tokenTypes[22].updateContext = context => { if (context[context.length - 1] === types.template) { context.pop(); } else { context.push(types.template); } }; tokenTypes[143].updateContext = context => { context.push(types.j_expr, types.j_oTag); }; } let nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\u088e\u08a0-\u08c9\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u1711\u171f-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4c\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c8a\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7cd\ua7d0\ua7d1\ua7d3\ua7d5-\ua7dc\ua7f2-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; let nonASCIIidentifierChars = "\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0897-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0cf3\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ece\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1ace\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\u30fb\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f\uff65"; const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; const astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 4, 51, 13, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 39, 27, 10, 22, 251, 41, 7, 1, 17, 2, 60, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 31, 9, 2, 0, 3, 0, 2, 37, 2, 0, 26, 0, 2, 0, 45, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 200, 32, 32, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 26, 3994, 6, 582, 6842, 29, 1763, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 433, 44, 212, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 42, 9, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 229, 29, 3, 0, 496, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 4191]; const astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 7, 9, 32, 4, 318, 1, 80, 3, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 68, 8, 2, 0, 3, 0, 2, 3, 2, 4, 2, 0, 15, 1, 83, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 7, 19, 58, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 343, 9, 54, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 10, 5350, 0, 7, 14, 11465, 27, 2343, 9, 87, 9, 39, 4, 60, 6, 26, 9, 535, 9, 470, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4178, 9, 519, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 245, 1, 2, 9, 726, 6, 110, 6, 6, 9, 4759, 9, 787719, 239]; function isInAstralSet(code, set) { let pos = 0x10000; for (let i = 0, length = set.length; i < length; i += 2) { pos += set[i]; if (pos > code) return false; pos += set[i + 1]; if (pos >= code) return true; } return false; } function isIdentifierStart(code) { if (code < 65) return code === 36; if (code <= 90) return true; if (code < 97) return code === 95; if (code <= 122) return true; if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)); } return isInAstralSet(code, astralIdentifierStartCodes); } function isIdentifierChar(code) { if (code < 48) return code === 36; if (code < 58) return true; if (code < 65) return false; if (code <= 90) return true; if (code < 97) return code === 95; if (code <= 122) return true; if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)); } return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes); } const reservedWords = { keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"], strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"], strictBind: ["eval", "arguments"] }; const keywords = new Set(reservedWords.keyword); const reservedWordsStrictSet = new Set(reservedWords.strict); const reservedWordsStrictBindSet = new Set(reservedWords.strictBind); function isReservedWord(word, inModule) { return inModule && word === "await" || word === "enum"; } function isStrictReservedWord(word, inModule) { return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word); } function isStrictBindOnlyReservedWord(word) { return reservedWordsStrictBindSet.has(word); } function isStrictBindReservedWord(word, inModule) { return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word); } function isKeyword(word) { return keywords.has(word); } function isIteratorStart(current, next, next2) { return current === 64 && next === 64 && isIdentifierStart(next2); } const reservedWordLikeSet = new Set(["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete", "implements", "interface", "let", "package", "private", "protected", "public", "static", "yield", "eval", "arguments", "enum", "await"]); function canBeReservedWord(word) { return reservedWordLikeSet.has(word); } class Scope { constructor(flags) { this.flags = 0; this.names = new Map(); this.firstLexicalName = ""; this.flags = flags; } } class ScopeHandler { constructor(parser, inModule) { this.parser = void 0; this.scopeStack = []; this.inModule = void 0; this.undefinedExports = new Map(); this.parser = parser; this.inModule = inModule; } get inTopLevel() { return (this.currentScope().flags & 1) > 0; } get inFunction() { return (this.currentVarScopeFlags() & 2) > 0; } get allowSuper() { return (this.currentThisScopeFlags() & 16) > 0; } get allowDirectSuper() { return (this.currentThisScopeFlags() & 32) > 0; } get inClass() { return (this.currentThisScopeFlags() & 64) > 0; } get inClassAndNotInNonArrowFunction() { const flags = this.currentThisScopeFlags(); return (flags & 64) > 0 && (flags & 2) === 0; } get inStaticBlock() { for (let i = this.scopeStack.length - 1;; i--) { const { flags } = this.scopeStack[i]; if (flags & 128) { return true; } if (flags & (387 | 64)) { return false; } } } get inNonArrowFunction() { return (this.currentThisScopeFlags() & 2) > 0; } get treatFunctionsAsVar() { return this.treatFunctionsAsVarInScope(this.currentScope()); } createScope(flags) { return new Scope(flags); } enter(flags) { this.scopeStack.push(this.createScope(flags)); } exit() { const scope = this.scopeStack.pop(); return scope.flags; } treatFunctionsAsVarInScope(scope) { return !!(scope.flags & (2 | 128) || !this.parser.inModule && scope.flags & 1); } declareName(name, bindingType, loc) { let scope = this.currentScope(); if (bindingType & 8 || bindingType & 16) { this.checkRedeclarationInScope(scope, name, bindingType, loc); let type = scope.names.get(name) || 0; if (bindingType & 16) { type = type | 4; } else { if (!scope.firstLexicalName) { scope.firstLexicalName = name; } type = type | 2; } scope.names.set(name, type); if (bindingType & 8) { this.maybeExportDefined(scope, name); } } else if (bindingType & 4) { for (let i = this.scopeStack.length - 1; i >= 0; --i) { scope = this.scopeStack[i]; this.checkRedeclarationInScope(scope, name, bindingType, loc); scope.names.set(name, (scope.names.get(name) || 0) | 1); this.maybeExportDefined(scope, name); if (scope.flags & 387) break; } } if (this.parser.inModule && scope.flags & 1) { this.undefinedExports.delete(name); } } maybeExportDefined(scope, name) { if (this.parser.inModule && scope.flags & 1) { this.undefinedExports.delete(name); } } checkRedeclarationInScope(scope, name, bindingType, loc) { if (this.isRedeclaredInScope(scope, name, bindingType)) { this.parser.raise(Errors.VarRedeclaration, loc, { identifierName: name }); } } isRedeclaredInScope(scope, name, bindingType) { if (!(bindingType & 1)) return false; if (bindingType & 8) { return scope.names.has(name); } const type = scope.names.get(name); if (bindingType & 16) { return (type & 2) > 0 || !this.treatFunctionsAsVarInScope(scope) && (type & 1) > 0; } return (type & 2) > 0 && !(scope.flags & 8 && scope.firstLexicalName === name) || !this.treatFunctionsAsVarInScope(scope) && (type & 4) > 0; } checkLocalExport(id) { const { name } = id; const topLevelScope = this.scopeStack[0]; if (!topLevelScope.names.has(name)) { this.undefinedExports.set(name, id.loc.start); } } currentScope() { return this.scopeStack[this.scopeStack.length - 1]; } currentVarScopeFlags() { for (let i = this.scopeStack.length - 1;; i--) { const { flags } = this.scopeStack[i]; if (flags & 387) { return flags; } } } currentThisScopeFlags() { for (let i = this.scopeStack.length - 1;; i--) { const { flags } = this.scopeStack[i]; if (flags & (387 | 64) && !(flags & 4)) { return flags; } } } } class FlowScope extends Scope { constructor(...args) { super(...args); this.declareFunctions = new Set(); } } class FlowScopeHandler extends ScopeHandler { createScope(flags) { return new FlowScope(flags); } declareName(name, bindingType, loc) { const scope = this.currentScope(); if (bindingType & 2048) { this.checkRedeclarationInScope(scope, name, bindingType, loc); this.maybeExportDefined(scope, name); scope.declareFunctions.add(name); return; } super.declareName(name, bindingType, loc); } isRedeclaredInScope(scope, name, bindingType) { if (super.isRedeclaredInScope(scope, name, bindingType)) return true; if (bindingType & 2048 && !scope.declareFunctions.has(name)) { const type = scope.names.get(name); return (type & 4) > 0 || (type & 2) > 0; } return false; } checkLocalExport(id) { if (!this.scopeStack[0].declareFunctions.has(id.name)) { super.checkLocalExport(id); } } } class BaseParser { constructor() { this.sawUnambiguousESM = false; this.ambiguousScriptDifferentAst = false; } sourceToOffsetPos(sourcePos) { return sourcePos + this.startIndex; } offsetToSourcePos(offsetPos) { return offsetPos - this.startIndex; } hasPlugin(pluginConfig) { if (typeof pluginConfig === "string") { return this.plugins.has(pluginConfig); } else { const [pluginName, pluginOptions] = pluginConfig; if (!this.hasPlugin(pluginName)) { return false; } const actualOptions = this.plugins.get(pluginName); for (const key of Object.keys(pluginOptions)) { if ((actualOptions == null ? void 0 : actualOptions[key]) !== pluginOptions[key]) { return false; } } return true; } } getPluginOption(plugin, name) { var _this$plugins$get; return (_this$plugins$get = this.plugins.get(plugin)) == null ? void 0 : _this$plugins$get[name]; } } function setTrailingComments(node, comments) { if (node.trailingComments === undefined) { node.trailingComments = comments; } else { node.trailingComments.unshift(...comments); } } function setLeadingComments(node, comments) { if (node.leadingComments === undefined) { node.leadingComments = comments; } else { node.leadingComments.unshift(...comments); } } function setInnerComments(node, comments) { if (node.innerComments === undefined) { node.innerComments = comments; } else { node.innerComments.unshift(...comments); } } function adjustInnerComments(node, elements, commentWS) { let lastElement = null; let i = elements.length; while (lastElement === null && i > 0) { lastElement = elements[--i]; } if (lastElement === null || lastElement.start > commentWS.start) { setInnerComments(node, commentWS.comments); } else { setTrailingComments(lastElement, commentWS.comments); } } class CommentsParser extends BaseParser { addComment(comment) { if (this.filename) comment.loc.filename = this.filename; const { commentsLen } = this.state; if (this.comments.length !== commentsLen) { this.comments.length = commentsLen; } this.comments.push(comment); this.state.commentsLen++; } processComment(node) { const { commentStack } = this.state; const commentStackLength = commentStack.length; if (commentStackLength === 0) return; let i = commentStackLength - 1; const lastCommentWS = commentStack[i]; if (lastCommentWS.start === node.end) { lastCommentWS.leadingNode = node; i--; } const { start: nodeStart } = node; for (; i >= 0; i--) { const commentWS = commentStack[i]; const commentEnd = commentWS.end; if (commentEnd > nodeStart) { commentWS.containingNode = node; this.finalizeComment(commentWS); commentStack.splice(i, 1); } else { if (commentEnd === nodeStart) { commentWS.trailingNode = node; } break; } } } finalizeComment(commentWS) { const { comments } = commentWS; if (commentWS.leadingNode !== null || commentWS.trailingNode !== null) { if (commentWS.leadingNode !== null) { setTrailingComments(commentWS.leadingNode, comments); } if (commentWS.trailingNode !== null) { setLeadingComments(commentWS.trailingNode, comments); } } else { const { containingNode: node, start: commentStart } = commentWS; if (this.input.charCodeAt(this.offsetToSourcePos(commentStart) - 1) === 44) { switch (node.type) { case "ObjectExpression": case "ObjectPattern": case "RecordExpression": adjustInnerComments(node, node.properties, commentWS); break; case "CallExpression": case "OptionalCallExpression": adjustInnerComments(node, node.arguments, commentWS); break; case "FunctionDeclaration": case "FunctionExpression": case "ArrowFunctionExpression": case "ObjectMethod": case "ClassMethod": case "ClassPrivateMethod": adjustInnerComments(node, node.params, commentWS); break; case "ArrayExpression": case "ArrayPattern": case "TupleExpression": adjustInnerComments(node, node.elements, commentWS); break; case "ExportNamedDeclaration": case "ImportDeclaration": adjustInnerComments(node, node.specifiers, commentWS); break; default: { setInnerComments(node, comments); } } } else { setInnerComments(node, comments); } } } finalizeRemainingComments() { const { commentStack } = this.state; for (let i = commentStack.length - 1; i >= 0; i--) { this.finalizeComment(commentStack[i]); } this.state.commentStack = []; } resetPreviousNodeTrailingComments(node) { const { commentStack } = this.state; const { length } = commentStack; if (length === 0) return; const commentWS = commentStack[length - 1]; if (commentWS.leadingNode === node) { commentWS.leadingNode = null; } } resetPreviousIdentifierLeadingComments(node) { const { commentStack } = this.state; const { length } = commentStack; if (length === 0) return; if (commentStack[length - 1].trailingNode === node) { commentStack[length - 1].trailingNode = null; } else if (length >= 2 && commentStack[length - 2].trailingNode === node) { commentStack[length - 2].trailingNode = null; } } takeSurroundingComments(node, start, end) { const { commentStack } = this.state; const commentStackLength = commentStack.length; if (commentStackLength === 0) return; let i = commentStackLength - 1; for (; i >= 0; i--) { const commentWS = commentStack[i]; const commentEnd = commentWS.end; const commentStart = commentWS.start; if (commentStart === end) { commentWS.leadingNode = node; } else if (commentEnd === start) { commentWS.trailingNode = node; } else if (commentEnd < start) { break; } } } } const lineBreak = /\r\n|[\r\n\u2028\u2029]/; const lineBreakG = new RegExp(lineBreak.source, "g"); function isNewLine(code) { switch (code) { case 10: case 13: case 8232: case 8233: return true; default: return false; } } function hasNewLine(input, start, end) { for (let i = start; i < end; i++) { if (isNewLine(input.charCodeAt(i))) { return true; } } return false; } const skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; const skipWhiteSpaceInLine = /(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g; function isWhitespace(code) { switch (code) { case 0x0009: case 0x000b: case 0x000c: case 32: case 160: case 5760: case 0x2000: case 0x2001: case 0x2002: case 0x2003: case 0x2004: case 0x2005: case 0x2006: case 0x2007: case 0x2008: case 0x2009: case 0x200a: case 0x202f: case 0x205f: case 0x3000: case 0xfeff: return true; default: return false; } } class State { constructor() { this.flags = 1024; this.startIndex = void 0; this.curLine = void 0; this.lineStart = void 0; this.startLoc = void 0; this.endLoc = void 0; this.errors = []; this.potentialArrowAt = -1; this.noArrowAt = []; this.noArrowParamsConversionAt = []; this.topicContext = { maxNumOfResolvableTopics: 0, maxTopicIndex: null }; this.labels = []; this.commentsLen = 0; this.commentStack = []; this.pos = 0; this.type = 140; this.value = null; this.start = 0; this.end = 0; this.lastTokEndLoc = null; this.lastTokStartLoc = null; this.context = [types.brace]; this.firstInvalidTemplateEscapePos = null; this.strictErrors = new Map(); this.tokensLength = 0; } get strict() { return (this.flags & 1) > 0; } set strict(v) { if (v) this.flags |= 1;else this.flags &= -2; } init({ strictMode, sourceType, startIndex, startLine, startColumn }) { this.strict = strictMode === false ? false : strictMode === true ? true : sourceType === "module"; this.startIndex = startIndex; this.curLine = startLine; this.lineStart = -startColumn; this.startLoc = this.endLoc = new Position(startLine, startColumn, startIndex); } get maybeInArrowParameters() { return (this.flags & 2) > 0; } set maybeInArrowParameters(v) { if (v) this.flags |= 2;else this.flags &= -3; } get inType() { return (this.flags & 4) > 0; } set inType(v) { if (v) this.flags |= 4;else this.flags &= -5; } get noAnonFunctionType() { return (this.flags & 8) > 0; } set noAnonFunctionType(v) { if (v) this.flags |= 8;else this.flags &= -9; } get hasFlowComment() { return (this.flags & 16) > 0; } set hasFlowComment(v) { if (v) this.flags |= 16;else this.flags &= -17; } get isAmbientContext() { return (this.flags & 32) > 0; } set isAmbientContext(v) { if (v) this.flags |= 32;else this.flags &= -33; } get inAbstractClass() { return (this.flags & 64) > 0; } set inAbstractClass(v) { if (v) this.flags |= 64;else this.flags &= -65; } get inDisallowConditionalTypesContext() { return (this.flags & 128) > 0; } set inDisallowConditionalTypesContext(v) { if (v) this.flags |= 128;else this.flags &= -129; } get soloAwait() { return (this.flags & 256) > 0; } set soloAwait(v) { if (v) this.flags |= 256;else this.flags &= -257; } get inFSharpPipelineDirectBody() { return (this.flags & 512) > 0; } set inFSharpPipelineDirectBody(v) { if (v) this.flags |= 512;else this.flags &= -513; } get canStartJSXElement() { return (this.flags & 1024) > 0; } set canStartJSXElement(v) { if (v) this.flags |= 1024;else this.flags &= -1025; } get containsEsc() { return (this.flags & 2048) > 0; } set containsEsc(v) { if (v) this.flags |= 2048;else this.flags &= -2049; } get hasTopLevelAwait() { return (this.flags & 4096) > 0; } set hasTopLevelAwait(v) { if (v) this.flags |= 4096;else this.flags &= -4097; } curPosition() { return new Position(this.curLine, this.pos - this.lineStart, this.pos + this.startIndex); } clone() { const state = new State(); state.flags = this.flags; state.startIndex = this.startIndex; state.curLine = this.curLine; state.lineStart = this.lineStart; state.startLoc = this.startLoc; state.endLoc = this.endLoc; state.errors = this.errors.slice(); state.potentialArrowAt = this.potentialArrowAt; state.noArrowAt = this.noArrowAt.slice(); state.noArrowParamsConversionAt = this.noArrowParamsConversionAt.slice(); state.topicContext = this.topicContext; state.labels = this.labels.slice(); state.commentsLen = this.commentsLen; state.commentStack = this.commentStack.slice(); state.pos = this.pos; state.type = this.type; state.value = this.value; state.start = this.start; state.end = this.end; state.lastTokEndLoc = this.lastTokEndLoc; state.lastTokStartLoc = this.lastTokStartLoc; state.context = this.context.slice(); state.firstInvalidTemplateEscapePos = this.firstInvalidTemplateEscapePos; state.strictErrors = this.strictErrors; state.tokensLength = this.tokensLength; return state; } } var _isDigit = function isDigit(code) { return code >= 48 && code <= 57; }; const forbiddenNumericSeparatorSiblings = { decBinOct: new Set([46, 66, 69, 79, 95, 98, 101, 111]), hex: new Set([46, 88, 95, 120]) }; const isAllowedNumericSeparatorSibling = { bin: ch => ch === 48 || ch === 49, oct: ch => ch >= 48 && ch <= 55, dec: ch => ch >= 48 && ch <= 57, hex: ch => ch >= 48 && ch <= 57 || ch >= 65 && ch <= 70 || ch >= 97 && ch <= 102 }; function readStringContents(type, input, pos, lineStart, curLine, errors) { const initialPos = pos; const initialLineStart = lineStart; const initialCurLine = curLine; let out = ""; let firstInvalidLoc = null; let chunkStart = pos; const { length } = input; for (;;) { if (pos >= length) { errors.unterminated(initialPos, initialLineStart, initialCurLine); out += input.slice(chunkStart, pos); break; } const ch = input.charCodeAt(pos); if (isStringEnd(type, ch, input, pos)) { out += input.slice(chunkStart, pos); break; } if (ch === 92) { out += input.slice(chunkStart, pos); const res = readEscapedChar(input, pos, lineStart, curLine, type === "template", errors); if (res.ch === null && !firstInvalidLoc) { firstInvalidLoc = { pos, lineStart, curLine }; } else { out += res.ch; } ({ pos, lineStart, curLine } = res); chunkStart = pos; } else if (ch === 8232 || ch === 8233) { ++pos; ++curLine; lineStart = pos; } else if (ch === 10 || ch === 13) { if (type === "template") { out += input.slice(chunkStart, pos) + "\n"; ++pos; if (ch === 13 && input.charCodeAt(pos) === 10) { ++pos; } ++curLine; chunkStart = lineStart = pos; } else { errors.unterminated(initialPos, initialLineStart, initialCurLine); } } else { ++pos; } } return { pos, str: out, firstInvalidLoc, lineStart, curLine, containsInvalid: !!firstInvalidLoc }; } function isStringEnd(type, ch, input, pos) { if (type === "template") { return ch === 96 || ch === 36 && input.charCodeAt(pos + 1) === 123; } return ch === (type === "double" ? 34 : 39); } function readEscapedChar(input, pos, lineStart, curLine, inTemplate, errors) { const throwOnInvalid = !inTemplate; pos++; const res = ch => ({ pos, ch, lineStart, curLine }); const ch = input.charCodeAt(pos++); switch (ch) { case 110: return res("\n"); case 114: return res("\r"); case 120: { let code; ({ code, pos } = readHexChar(input, pos, lineStart, curLine, 2, false, throwOnInvalid, errors)); return res(code === null ? null : String.fromCharCode(code)); } case 117: { let code; ({ code, pos } = readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors)); return res(code === null ? null : String.fromCodePoint(code)); } case 116: return res("\t"); case 98: return res("\b"); case 118: return res("\u000b"); case 102: return res("\f"); case 13: if (input.charCodeAt(pos) === 10) { ++pos; } case 10: lineStart = pos; ++curLine; case 8232: case 8233: return res(""); case 56: case 57: if (inTemplate) { return res(null); } else { errors.strictNumericEscape(pos - 1, lineStart, curLine); } default: if (ch >= 48 && ch <= 55) { const startPos = pos - 1; const match = /^[0-7]+/.exec(input.slice(startPos, pos + 2)); let octalStr = match[0]; let octal = parseInt(octalStr, 8); if (octal > 255) { octalStr = octalStr.slice(0, -1); octal = parseInt(octalStr, 8); } pos += octalStr.length - 1; const next = input.charCodeAt(pos); if (octalStr !== "0" || next === 56 || next === 57) { if (inTemplate) { return res(null); } else { errors.strictNumericEscape(startPos, lineStart, curLine); } } return res(String.fromCharCode(octal)); } return res(String.fromCharCode(ch)); } } function readHexChar(input, pos, lineStart, curLine, len, forceLen, throwOnInvalid, errors) { const initialPos = pos; let n; ({ n, pos } = readInt(input, pos, lineStart, curLine, 16, len, forceLen, false, errors, !throwOnInvalid)); if (n === null) { if (throwOnInvalid) { errors.invalidEscapeSequence(initialPos, lineStart, curLine); } else { pos = initialPos - 1; } } return { code: n, pos }; } function readInt(input, pos, lineStart, curLine, radix, len, forceLen, allowNumSeparator, errors, bailOnError) { const start = pos; const forbiddenSiblings = radix === 16 ? forbiddenNumericSeparatorSiblings.hex : forbiddenNumericSeparatorSiblings.decBinOct; const isAllowedSibling = radix === 16 ? isAllowedNumericSeparatorSibling.hex : radix === 10 ? isAllowedNumericSeparatorSibling.dec : radix === 8 ? isAllowedNumericSeparatorSibling.oct : isAllowedNumericSeparatorSibling.bin; let invalid = false; let total = 0; for (let i = 0, e = len == null ? Infinity : len; i < e; ++i) { const code = input.charCodeAt(pos); let val; if (code === 95 && allowNumSeparator !== "bail") { const prev = input.charCodeAt(pos - 1); const next = input.charCodeAt(pos + 1); if (!allowNumSeparator) { if (bailOnError) return { n: null, pos }; errors.numericSeparatorInEscapeSequence(pos, lineStart, curLine); } else if (Number.isNaN(next) || !isAllowedSibling(next) || forbiddenSiblings.has(prev) || forbiddenSiblings.has(next)) { if (bailOnError) return { n: null, pos }; errors.unexpectedNumericSeparator(pos, lineStart, curLine); } ++pos; continue; } if (code >= 97) { val = code - 97 + 10; } else if (code >= 65) { val = code - 65 + 10; } else if (_isDigit(code)) { val = code - 48; } else { val = Infinity; } if (val >= radix) { if (val <= 9 && bailOnError) { return { n: null, pos }; } else if (val <= 9 && errors.invalidDigit(pos, lineStart, curLine, radix)) { val = 0; } else if (forceLen) { val = 0; invalid = true; } else { break; } } ++pos; total = total * radix + val; } if (pos === start || len != null && pos - start !== len || invalid) { return { n: null, pos }; } return { n: total, pos }; } function readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors) { const ch = input.charCodeAt(pos); let code; if (ch === 123) { ++pos; ({ code, pos } = readHexChar(input, pos, lineStart, curLine, input.indexOf("}", pos) - pos, true, throwOnInvalid, errors)); ++pos; if (code !== null && code > 0x10ffff) { if (throwOnInvalid) { errors.invalidCodePoint(pos, lineStart, curLine); } else { return { code: null, pos }; } } } else { ({ code, pos } = readHexChar(input, pos, lineStart, curLine, 4, false, throwOnInvalid, errors)); } return { code, pos }; } function buildPosition(pos, lineStart, curLine) { return new Position(curLine, pos - lineStart, pos); } const VALID_REGEX_FLAGS = new Set([103, 109, 115, 105, 121, 117, 100, 118]); class Token { constructor(state) { const startIndex = state.startIndex || 0; this.type = state.type; this.value = state.value; this.start = startIndex + state.start; this.end = startIndex + state.end; this.loc = new SourceLocation(state.startLoc, state.endLoc); } } class Tokenizer extends CommentsParser { constructor(options, input) { super(); this.isLookahead = void 0; this.tokens = []; this.errorHandlers_readInt = { invalidDigit: (pos, lineStart, curLine, radix) => { if (!this.options.errorRecovery) return false; this.raise(Errors.InvalidDigit, buildPosition(pos, lineStart, curLine), { radix }); return true; }, numericSeparatorInEscapeSequence: this.errorBuilder(Errors.NumericSeparatorInEscapeSequence), unexpectedNumericSeparator: this.errorBuilder(Errors.UnexpectedNumericSeparator) }; this.errorHandlers_readCodePoint = Object.assign({}, this.errorHandlers_readInt, { invalidEscapeSequence: this.errorBuilder(Errors.InvalidEscapeSequence), invalidCodePoint: this.errorBuilder(Errors.InvalidCodePoint) }); this.errorHandlers_readStringContents_string = Object.assign({}, this.errorHandlers_readCodePoint, { strictNumericEscape: (pos, lineStart, curLine) => { this.recordStrictModeErrors(Errors.StrictNumericEscape, buildPosition(pos, lineStart, curLine)); }, unterminated: (pos, lineStart, curLine) => { throw this.raise(Errors.UnterminatedString, buildPosition(pos - 1, lineStart, curLine)); } }); this.errorHandlers_readStringContents_template = Object.assign({}, this.errorHandlers_readCodePoint, { strictNumericEscape: this.errorBuilder(Errors.StrictNumericEscape), unterminated: (pos, lineStart, curLine) => { throw this.raise(Errors.UnterminatedTemplate, buildPosition(pos, lineStart, curLine)); } }); this.state = new State(); this.state.init(options); this.input = input; this.length = input.length; this.comments = []; this.isLookahead = false; } pushToken(token) { this.tokens.length = this.state.tokensLength; this.tokens.push(token); ++this.state.tokensLength; } next() { this.checkKeywordEscapes(); if (this.options.tokens) { this.pushToken(new Token(this.state)); } this.state.lastTokEndLoc = this.state.endLoc; this.state.lastTokStartLoc = this.state.startLoc; this.nextToken(); } eat(type) { if (this.match(type)) { this.next(); return true; } else { return false; } } match(type) { return this.state.type === type; } createLookaheadState(state) { return { pos: state.pos, value: null, type: state.type, start: state.start, end: state.end, context: [this.curContext()], inType: state.inType, startLoc: state.startLoc, lastTokEndLoc: state.lastTokEndLoc, curLine: state.curLine, lineStart: state.lineStart, curPosition: state.curPosition }; } lookahead() { const old = this.state; this.state = this.createLookaheadState(old); this.isLookahead = true; this.nextToken(); this.isLookahead = false; const curr = this.state; this.state = old; return curr; } nextTokenStart() { return this.nextTokenStartSince(this.state.pos); } nextTokenStartSince(pos) { skipWhiteSpace.lastIndex = pos; return skipWhiteSpace.test(this.input) ? skipWhiteSpace.lastIndex : pos; } lookaheadCharCode() { return this.input.charCodeAt(this.nextTokenStart()); } nextTokenInLineStart() { return this.nextTokenInLineStartSince(this.state.pos); } nextTokenInLineStartSince(pos) { skipWhiteSpaceInLine.lastIndex = pos; return skipWhiteSpaceInLine.test(this.input) ? skipWhiteSpaceInLine.lastIndex : pos; } lookaheadInLineCharCode() { return this.input.charCodeAt(this.nextTokenInLineStart()); } codePointAtPos(pos) { let cp = this.input.charCodeAt(pos); if ((cp & 0xfc00) === 0xd800 && ++pos < this.input.length) { const trail = this.input.charCodeAt(pos); if ((trail & 0xfc00) === 0xdc00) { cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff); } } return cp; } setStrict(strict) { this.state.strict = strict; if (strict) { this.state.strictErrors.forEach(([toParseError, at]) => this.raise(toParseError, at)); this.state.strictErrors.clear(); } } curContext() { return this.state.context[this.state.context.length - 1]; } nextToken() { this.skipSpace(); this.state.start = this.state.pos; if (!this.isLookahead) this.state.startLoc = this.state.curPosition(); if (this.state.pos >= this.length) { this.finishToken(140); return; } this.getTokenFromCode(this.codePointAtPos(this.state.pos)); } skipBlockComment(commentEnd) { let startLoc; if (!this.isLookahead) startLoc = this.state.curPosition(); const start = this.state.pos; const end = this.input.indexOf(commentEnd, start + 2); if (end === -1) { throw this.raise(Errors.UnterminatedComment, this.state.curPosition()); } this.state.pos = end + commentEnd.length; lineBreakG.lastIndex = start + 2; while (lineBreakG.test(this.input) && lineBreakG.lastIndex <= end) { ++this.state.curLine; this.state.lineStart = lineBreakG.lastIndex; } if (this.isLookahead) return; const comment = { type: "CommentBlock", value: this.input.slice(start + 2, end), start: this.sourceToOffsetPos(start), end: this.sourceToOffsetPos(end + commentEnd.length), loc: new SourceLocation(startLoc, this.state.curPosition()) }; if (this.options.tokens) this.pushToken(comment); return comment; } skipLineComment(startSkip) { const start = this.state.pos; let startLoc; if (!this.isLookahead) startLoc = this.state.curPosition(); let ch = this.input.charCodeAt(this.state.pos += startSkip); if (this.state.pos < this.length) { while (!isNewLine(ch) && ++this.state.pos < this.length) { ch = this.input.charCodeAt(this.state.pos); } } if (this.isLookahead) return; const end = this.state.pos; const value = this.input.slice(start + startSkip, end); const comment = { type: "CommentLine", value, start: this.sourceToOffsetPos(start), end: this.sourceToOffsetPos(end), loc: new SourceLocation(startLoc, this.state.curPosition()) }; if (this.options.tokens) this.pushToken(comment); return comment; } skipSpace() { const spaceStart = this.state.pos; const comments = []; loop: while (this.state.pos < this.length) { const ch = this.input.charCodeAt(this.state.pos); switch (ch) { case 32: case 160: case 9: ++this.state.pos; break; case 13: if (this.input.charCodeAt(this.state.pos + 1) === 10) { ++this.state.pos; } case 10: case 8232: case 8233: ++this.state.pos; ++this.state.curLine; this.state.lineStart = this.state.pos; break; case 47: switch (this.input.charCodeAt(this.state.pos + 1)) { case 42: { const comment = this.skipBlockComment("*/"); if (comment !== undefined) { this.addComment(comment); if (this.options.attachComment) comments.push(comment); } break; } case 47: { const comment = this.skipLineComment(2); if (comment !== undefined) { this.addComment(comment); if (this.options.attachComment) comments.push(comment); } break; } default: break loop; } break; default: if (isWhitespace(ch)) { ++this.state.pos; } else if (ch === 45 && !this.inModule && this.options.annexB) { const pos = this.state.pos; if (this.input.charCodeAt(pos + 1) === 45 && this.input.charCodeAt(pos + 2) === 62 && (spaceStart === 0 || this.state.lineStart > spaceStart)) { const comment = this.skipLineComment(3); if (comment !== undefined) { this.addComment(comment); if (this.options.attachComment) comments.push(comment); } } else { break loop; } } else if (ch === 60 && !this.inModule && this.options.annexB) { const pos = this.state.pos; if (this.input.charCodeAt(pos + 1) === 33 && this.input.charCodeAt(pos + 2) === 45 && this.input.charCodeAt(pos + 3) === 45) { const comment = this.skipLineComment(4); if (comment !== undefined) { this.addComment(comment); if (this.options.attachComment) comments.push(comment); } } else { break loop; } } else { break loop; } } } if (comments.length > 0) { const end = this.state.pos; const commentWhitespace = { start: this.sourceToOffsetPos(spaceStart), end: this.sourceToOffsetPos(end), comments, leadingNode: null, trailingNode: null, containingNode: null }; this.state.commentStack.push(commentWhitespace); } } finishToken(type, val) { this.state.end = this.state.pos; this.state.endLoc = this.state.curPosition(); const prevType = this.state.type; this.state.type = type; this.state.value = val; if (!this.isLookahead) { this.updateContext(prevType); } } replaceToken(type) { this.state.type = type; this.updateContext(); } readToken_numberSign() { if (this.state.pos === 0 && this.readToken_interpreter()) { return; } const nextPos = this.state.pos + 1; const next = this.codePointAtPos(nextPos); if (next >= 48 && next <= 57) { throw this.raise(Errors.UnexpectedDigitAfterHash, this.state.curPosition()); } if (next === 123 || next === 91 && this.hasPlugin("recordAndTuple")) { this.expectPlugin("recordAndTuple"); if (this.getPluginOption("recordAndTuple", "syntaxType") === "bar") { throw this.raise(next === 123 ? Errors.RecordExpressionHashIncorrectStartSyntaxType : Errors.TupleExpressionHashIncorrectStartSyntaxType, this.state.curPosition()); } this.state.pos += 2; if (next === 123) { this.finishToken(7); } else { this.finishToken(1); } } else if (isIdentifierStart(next)) { ++this.state.pos; this.finishToken(139, this.readWord1(next)); } else if (next === 92) { ++this.state.pos; this.finishToken(139, this.readWord1()); } else { this.finishOp(27, 1); } } readToken_dot() { const next = this.input.charCodeAt(this.state.pos + 1); if (next >= 48 && next <= 57) { this.readNumber(true); return; } if (next === 46 && this.input.charCodeAt(this.state.pos + 2) === 46) { this.state.pos += 3; this.finishToken(21); } else { ++this.state.pos; this.finishToken(16); } } readToken_slash() { const next = this.input.charCodeAt(this.state.pos + 1); if (next === 61) { this.finishOp(31, 2); } else { this.finishOp(56, 1); } } readToken_interpreter() { if (this.state.pos !== 0 || this.length < 2) return false; let ch = this.input.charCodeAt(this.state.pos + 1); if (ch !== 33) return false; const start = this.state.pos; this.state.pos += 1; while (!isNewLine(ch) && ++this.state.pos < this.length) { ch = this.input.charCodeAt(this.state.pos); } const value = this.input.slice(start + 2, this.state.pos); this.finishToken(28, value); return true; } readToken_mult_modulo(code) { let type = code === 42 ? 55 : 54; let width = 1; let next = this.input.charCodeAt(this.state.pos + 1); if (code === 42 && next === 42) { width++; next = this.input.charCodeAt(this.state.pos + 2); type = 57; } if (next === 61 && !this.state.inType) { width++; type = code === 37 ? 33 : 30; } this.finishOp(type, width); } readToken_pipe_amp(code) { const next = this.input.charCodeAt(this.state.pos + 1); if (next === code) { if (this.input.charCodeAt(this.state.pos + 2) === 61) { this.finishOp(30, 3); } else { this.finishOp(code === 124 ? 41 : 42, 2); } return; } if (code === 124) { if (next === 62) { this.finishOp(39, 2); return; } if (this.hasPlugin("recordAndTuple") && next === 125) { if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") { throw this.raise(Errors.RecordExpressionBarIncorrectEndSyntaxType, this.state.curPosition()); } this.state.pos += 2; this.finishToken(9); return; } if (this.hasPlugin("recordAndTuple") && next === 93) { if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") { throw this.raise(Errors.TupleExpressionBarIncorrectEndSyntaxType, this.state.curPosition()); } this.state.pos += 2; this.finishToken(4); return; } } if (next === 61) { this.finishOp(30, 2); return; } this.finishOp(code === 124 ? 43 : 45, 1); } readToken_caret() { const next = this.input.charCodeAt(this.state.pos + 1); if (next === 61 && !this.state.inType) { this.finishOp(32, 2); } else if (next === 94 && this.hasPlugin(["pipelineOperator", { proposal: "hack", topicToken: "^^" }])) { this.finishOp(37, 2); const lookaheadCh = this.input.codePointAt(this.state.pos); if (lookaheadCh === 94) { this.unexpected(); } } else { this.finishOp(44, 1); } } readToken_atSign() { const next = this.input.charCodeAt(this.state.pos + 1); if (next === 64 && this.hasPlugin(["pipelineOperator", { proposal: "hack", topicToken: "@@" }])) { this.finishOp(38, 2); } else { this.finishOp(26, 1); } } readToken_plus_min(code) { const next = this.input.charCodeAt(this.state.pos + 1); if (next === code) { this.finishOp(34, 2); return; } if (next === 61) { this.finishOp(30, 2); } else { this.finishOp(53, 1); } } readToken_lt() { const { pos } = this.state; const next = this.input.charCodeAt(pos + 1); if (next === 60) { if (this.input.charCodeAt(pos + 2) === 61) { this.finishOp(30, 3); return; } this.finishOp(51, 2); return; } if (next === 61) { this.finishOp(49, 2); return; } this.finishOp(47, 1); } readToken_gt() { const { pos } = this.state; const next = this.input.charCodeAt(pos + 1); if (next === 62) { const size = this.input.charCodeAt(pos + 2) === 62 ? 3 : 2; if (this.input.charCodeAt(pos + size) === 61) { this.finishOp(30, size + 1); return; } this.finishOp(52, size); return; } if (next === 61) { this.finishOp(49, 2); return; } this.finishOp(48, 1); } readToken_eq_excl(code) { const next = this.input.charCodeAt(this.state.pos + 1); if (next === 61) { this.finishOp(46, this.input.charCodeAt(this.state.pos + 2) === 61 ? 3 : 2); return; } if (code === 61 && next === 62) { this.state.pos += 2; this.finishToken(19); return; } this.finishOp(code === 61 ? 29 : 35, 1); } readToken_question() { const next = this.input.charCodeAt(this.state.pos + 1); const next2 = this.input.charCodeAt(this.state.pos + 2); if (next === 63) { if (next2 === 61) { this.finishOp(30, 3); } else { this.finishOp(40, 2); } } else if (next === 46 && !(next2 >= 48 && next2 <= 57)) { this.state.pos += 2; this.finishToken(18); } else { ++this.state.pos; this.finishToken(17); } } getTokenFromCode(code) { switch (code) { case 46: this.readToken_dot(); return; case 40: ++this.state.pos; this.finishToken(10); return; case 41: ++this.state.pos; this.finishToken(11); return; case 59: ++this.state.pos; this.finishToken(13); return; case 44: ++this.state.pos; this.finishToken(12); return; case 91: if (this.hasPlugin("recordAndTuple") && this.input.charCodeAt(this.state.pos + 1) === 124) { if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") { throw this.raise(Errors.TupleExpressionBarIncorrectStartSyntaxType, this.state.curPosition()); } this.state.pos += 2; this.finishToken(2); } else { ++this.state.pos; this.finishToken(0); } return; case 93: ++this.state.pos; this.finishToken(3); return; case 123: if (this.hasPlugin("recordAndTuple") && this.input.charCodeAt(this.state.pos + 1) === 124) { if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") { throw this.raise(Errors.RecordExpressionBarIncorrectStartSyntaxType, this.state.curPosition()); } this.state.pos += 2; this.finishToken(6); } else { ++this.state.pos; this.finishToken(5); } return; case 125: ++this.state.pos; this.finishToken(8); return; case 58: if (this.hasPlugin("functionBind") && this.input.charCodeAt(this.state.pos + 1) === 58) { this.finishOp(15, 2); } else { ++this.state.pos; this.finishToken(14); } return; case 63: this.readToken_question(); return; case 96: this.readTemplateToken(); return; case 48: { const next = this.input.charCodeAt(this.state.pos + 1); if (next === 120 || next === 88) { this.readRadixNumber(16); return; } if (next === 111 || next === 79) { this.readRadixNumber(8); return; } if (next === 98 || next === 66) { this.readRadixNumber(2); return; } } case 49: case 50: case 51: case 52: case 53: case 54: case 55: case 56: case 57: this.readNumber(false); return; case 34: case 39: this.readString(code); return; case 47: this.readToken_slash(); return; case 37: case 42: this.readToken_mult_modulo(code); return; case 124: case 38: this.readToken_pipe_amp(code); return; case 94: this.readToken_caret(); return; case 43: case 45: this.readToken_plus_min(code); return; case 60: this.readToken_lt(); return; case 62: this.readToken_gt(); return; case 61: case 33: this.readToken_eq_excl(code); return; case 126: this.finishOp(36, 1); return; case 64: this.readToken_atSign(); return; case 35: this.readToken_numberSign(); return; case 92: this.readWord(); return; default: if (isIdentifierStart(code)) { this.readWord(code); return; } } throw this.raise(Errors.InvalidOrUnexpectedToken, this.state.curPosition(), { unexpected: String.fromCodePoint(code) }); } finishOp(type, size) { const str = this.input.slice(this.state.pos, this.state.pos + size); this.state.pos += size; this.finishToken(type, str); } readRegexp() { const startLoc = this.state.startLoc; const start = this.state.start + 1; let escaped, inClass; let { pos } = this.state; for (;; ++pos) { if (pos >= this.length) { throw this.raise(Errors.UnterminatedRegExp, createPositionWithColumnOffset(startLoc, 1)); } const ch = this.input.charCodeAt(pos); if (isNewLine(ch)) { throw this.raise(Errors.UnterminatedRegExp, createPositionWithColumnOffset(startLoc, 1)); } if (escaped) { escaped = false; } else { if (ch === 91) { inClass = true; } else if (ch === 93 && inClass) { inClass = false; } else if (ch === 47 && !inClass) { break; } escaped = ch === 92; } } const content = this.input.slice(start, pos); ++pos; let mods = ""; const nextPos = () => createPositionWithColumnOffset(startLoc, pos + 2 - start); while (pos < this.length) { const cp = this.codePointAtPos(pos); const char = String.fromCharCode(cp); if (VALID_REGEX_FLAGS.has(cp)) { if (cp === 118) { if (mods.includes("u")) { this.raise(Errors.IncompatibleRegExpUVFlags, nextPos()); } } else if (cp === 117) { if (mods.includes("v")) { this.raise(Errors.IncompatibleRegExpUVFlags, nextPos()); } } if (mods.includes(char)) { this.raise(Errors.DuplicateRegExpFlags, nextPos()); } } else if (isIdentifierChar(cp) || cp === 92) { this.raise(Errors.MalformedRegExpFlags, nextPos()); } else { break; } ++pos; mods += char; } this.state.pos = pos; this.finishToken(138, { pattern: content, flags: mods }); } readInt(radix, len, forceLen = false, allowNumSeparator = true) { const { n, pos } = readInt(this.input, this.state.pos, this.state.lineStart, this.state.curLine, radix, len, forceLen, allowNumSeparator, this.errorHandlers_readInt, false); this.state.pos = pos; return n; } readRadixNumber(radix) { const start = this.state.pos; const startLoc = this.state.curPosition(); let isBigInt = false; this.state.pos += 2; const val = this.readInt(radix); if (val == null) { this.raise(Errors.InvalidDigit, createPositionWithColumnOffset(startLoc, 2), { radix }); } const next = this.input.charCodeAt(this.state.pos); if (next === 110) { ++this.state.pos; isBigInt = true; } else if (next === 109) { throw this.raise(Errors.InvalidDecimal, startLoc); } if (isIdentifierStart(this.codePointAtPos(this.state.pos))) { throw this.raise(Errors.NumberIdentifier, this.state.curPosition()); } if (isBigInt) { const str = this.input.slice(start, this.state.pos).replace(/[_n]/g, ""); this.finishToken(136, str); return; } this.finishToken(135, val); } readNumber(startsWithDot) { const start = this.state.pos; const startLoc = this.state.curPosition(); let isFloat = false; let isBigInt = false; let hasExponent = false; let isOctal = false; if (!startsWithDot && this.readInt(10) === null) { this.raise(Errors.InvalidNumber, this.state.curPosition()); } const hasLeadingZero = this.state.pos - start >= 2 && this.input.charCodeAt(start) === 48; if (hasLeadingZero) { const integer = this.input.slice(start, this.state.pos); this.recordStrictModeErrors(Errors.StrictOctalLiteral, startLoc); if (!this.state.strict) { const underscorePos = integer.indexOf("_"); if (underscorePos > 0) { this.raise(Errors.ZeroDigitNumericSeparator, createPositionWithColumnOffset(startLoc, underscorePos)); } } isOctal = hasLeadingZero && !/[89]/.test(integer); } let next = this.input.charCodeAt(this.state.pos); if (next === 46 && !isOctal) { ++this.state.pos; this.readInt(10); isFloat = true; next = this.input.charCodeAt(this.state.pos); } if ((next === 69 || next === 101) && !isOctal) { next = this.input.charCodeAt(++this.state.pos); if (next === 43 || next === 45) { ++this.state.pos; } if (this.readInt(10) === null) { this.raise(Errors.InvalidOrMissingExponent, startLoc); } isFloat = true; hasExponent = true; next = this.input.charCodeAt(this.state.pos); } if (next === 110) { if (isFloat || hasLeadingZero) { this.raise(Errors.InvalidBigIntLiteral, startLoc); } ++this.state.pos; isBigInt = true; } if (next === 109) { this.expectPlugin("decimal", this.state.curPosition()); if (hasExponent || hasLeadingZero) { this.raise(Errors.InvalidDecimal, startLoc); } ++this.state.pos; var isDecimal = true; } if (isIdentifierStart(this.codePointAtPos(this.state.pos))) { throw this.raise(Errors.NumberIdentifier, this.state.curPosition()); } const str = this.input.slice(start, this.state.pos).replace(/[_mn]/g, ""); if (isBigInt) { this.finishToken(136, str); return; } if (isDecimal) { this.finishToken(137, str); return; } const val = isOctal ? parseInt(str, 8) : parseFloat(str); this.finishToken(135, val); } readCodePoint(throwOnInvalid) { const { code, pos } = readCodePoint(this.input, this.state.pos, this.state.lineStart, this.state.curLine, throwOnInvalid, this.errorHandlers_readCodePoint); this.state.pos = pos; return code; } readString(quote) { const { str, pos, curLine, lineStart } = readStringContents(quote === 34 ? "double" : "single", this.input, this.state.pos + 1, this.state.lineStart, this.state.curLine, this.errorHandlers_readStringContents_string); this.state.pos = pos + 1; this.state.lineStart = lineStart; this.state.curLine = curLine; this.finishToken(134, str); } readTemplateContinuation() { if (!this.match(8)) { this.unexpected(null, 8); } this.state.pos--; this.readTemplateToken(); } readTemplateToken() { const opening = this.input[this.state.pos]; const { str, firstInvalidLoc, pos, curLine, lineStart } = readStringContents("template", this.input, this.state.pos + 1, this.state.lineStart, this.state.curLine, this.errorHandlers_readStringContents_template); this.state.pos = pos + 1; this.state.lineStart = lineStart; this.state.curLine = curLine; if (firstInvalidLoc) { this.state.firstInvalidTemplateEscapePos = new Position(firstInvalidLoc.curLine, firstInvalidLoc.pos - firstInvalidLoc.lineStart, this.sourceToOffsetPos(firstInvalidLoc.pos)); } if (this.input.codePointAt(pos) === 96) { this.finishToken(24, firstInvalidLoc ? null : opening + str + "`"); } else { this.state.pos++; this.finishToken(25, firstInvalidLoc ? null : opening + str + "${"); } } recordStrictModeErrors(toParseError, at) { const index = at.index; if (this.state.strict && !this.state.strictErrors.has(index)) { this.raise(toParseError, at); } else { this.state.strictErrors.set(index, [toParseError, at]); } } readWord1(firstCode) { this.state.containsEsc = false; let word = ""; const start = this.state.pos; let chunkStart = this.state.pos; if (firstCode !== undefined) { this.state.pos += firstCode <= 0xffff ? 1 : 2; } while (this.state.pos < this.length) { const ch = this.codePointAtPos(this.state.pos); if (isIdentifierChar(ch)) { this.state.pos += ch <= 0xffff ? 1 : 2; } else if (ch === 92) { this.state.containsEsc = true; word += this.input.slice(chunkStart, this.state.pos); const escStart = this.state.curPosition(); const identifierCheck = this.state.pos === start ? isIdentifierStart : isIdentifierChar; if (this.input.charCodeAt(++this.state.pos) !== 117) { this.raise(Errors.MissingUnicodeEscape, this.state.curPosition()); chunkStart = this.state.pos - 1; continue; } ++this.state.pos; const esc = this.readCodePoint(true); if (esc !== null) { if (!identifierCheck(esc)) { this.raise(Errors.EscapedCharNotAnIdentifier, escStart); } word += String.fromCodePoint(esc); } chunkStart = this.state.pos; } else { break; } } return word + this.input.slice(chunkStart, this.state.pos); } readWord(firstCode) { const word = this.readWord1(firstCode); const type = keywords$1.get(word); if (type !== undefined) { this.finishToken(type, tokenLabelName(type)); } else { this.finishToken(132, word); } } checkKeywordEscapes() { const { type } = this.state; if (tokenIsKeyword(type) && this.state.containsEsc) { this.raise(Errors.InvalidEscapedReservedWord, this.state.startLoc, { reservedWord: tokenLabelName(type) }); } } raise(toParseError, at, details = {}) { const loc = at instanceof Position ? at : at.loc.start; const error = toParseError(loc, details); if (!this.options.errorRecovery) throw error; if (!this.isLookahead) this.state.errors.push(error); return error; } raiseOverwrite(toParseError, at, details = {}) { const loc = at instanceof Position ? at : at.loc.start; const pos = loc.index; const errors = this.state.errors; for (let i = errors.length - 1; i >= 0; i--) { const error = errors[i]; if (error.loc.index === pos) { return errors[i] = toParseError(loc, details); } if (error.loc.index < pos) break; } return this.raise(toParseError, at, details); } updateContext(prevType) {} unexpected(loc, type) { throw this.raise(Errors.UnexpectedToken, loc != null ? loc : this.state.startLoc, { expected: type ? tokenLabelName(type) : null }); } expectPlugin(pluginName, loc) { if (this.hasPlugin(pluginName)) { return true; } throw this.raise(Errors.MissingPlugin, loc != null ? loc : this.state.startLoc, { missingPlugin: [pluginName] }); } expectOnePlugin(pluginNames) { if (!pluginNames.some(name => this.hasPlugin(name))) { throw this.raise(Errors.MissingOneOfPlugins, this.state.startLoc, { missingPlugin: pluginNames }); } } errorBuilder(error) { return (pos, lineStart, curLine) => { this.raise(error, buildPosition(pos, lineStart, curLine)); }; } } class ClassScope { constructor() { this.privateNames = new Set(); this.loneAccessors = new Map(); this.undefinedPrivateNames = new Map(); } } class ClassScopeHandler { constructor(parser) { this.parser = void 0; this.stack = []; this.undefinedPrivateNames = new Map(); this.parser = parser; } current() { return this.stack[this.stack.length - 1]; } enter() { this.stack.push(new ClassScope()); } exit() { const oldClassScope = this.stack.pop(); const current = this.current(); for (const [name, loc] of Array.from(oldClassScope.undefinedPrivateNames)) { if (current) { if (!current.undefinedPrivateNames.has(name)) { current.undefinedPrivateNames.set(name, loc); } } else { this.parser.raise(Errors.InvalidPrivateFieldResolution, loc, { identifierName: name }); } } } declarePrivateName(name, elementType, loc) { const { privateNames, loneAccessors, undefinedPrivateNames } = this.current(); let redefined = privateNames.has(name); if (elementType & 3) { const accessor = redefined && loneAccessors.get(name); if (accessor) { const oldStatic = accessor & 4; const newStatic = elementType & 4; const oldKind = accessor & 3; const newKind = elementType & 3; redefined = oldKind === newKind || oldStatic !== newStatic; if (!redefined) loneAccessors.delete(name); } else if (!redefined) { loneAccessors.set(name, elementType); } } if (redefined) { this.parser.raise(Errors.PrivateNameRedeclaration, loc, { identifierName: name }); } privateNames.add(name); undefinedPrivateNames.delete(name); } usePrivateName(name, loc) { let classScope; for (classScope of this.stack) { if (classScope.privateNames.has(name)) return; } if (classScope) { classScope.undefinedPrivateNames.set(name, loc); } else { this.parser.raise(Errors.InvalidPrivateFieldResolution, loc, { identifierName: name }); } } } class ExpressionScope { constructor(type = 0) { this.type = type; } canBeArrowParameterDeclaration() { return this.type === 2 || this.type === 1; } isCertainlyParameterDeclaration() { return this.type === 3; } } class ArrowHeadParsingScope extends ExpressionScope { constructor(type) { super(type); this.declarationErrors = new Map(); } recordDeclarationError(ParsingErrorClass, at) { const index = at.index; this.declarationErrors.set(index, [ParsingErrorClass, at]); } clearDeclarationError(index) { this.declarationErrors.delete(index); } iterateErrors(iterator) { this.declarationErrors.forEach(iterator); } } class ExpressionScopeHandler { constructor(parser) { this.parser = void 0; this.stack = [new ExpressionScope()]; this.parser = parser; } enter(scope) { this.stack.push(scope); } exit() { this.stack.pop(); } recordParameterInitializerError(toParseError, node) { const origin = node.loc.start; const { stack } = this; let i = stack.length - 1; let scope = stack[i]; while (!scope.isCertainlyParameterDeclaration()) { if (scope.canBeArrowParameterDeclaration()) { scope.recordDeclarationError(toParseError, origin); } else { return; } scope = stack[--i]; } this.parser.raise(toParseError, origin); } recordArrowParameterBindingError(error, node) { const { stack } = this; const scope = stack[stack.length - 1]; const origin = node.loc.start; if (scope.isCertainlyParameterDeclaration()) { this.parser.raise(error, origin); } else if (scope.canBeArrowParameterDeclaration()) { scope.recordDeclarationError(error, origin); } else { return; } } recordAsyncArrowParametersError(at) { const { stack } = this; let i = stack.length - 1; let scope = stack[i]; while (scope.canBeArrowParameterDeclaration()) { if (scope.type === 2) { scope.recordDeclarationError(Errors.AwaitBindingIdentifier, at); } scope = stack[--i]; } } validateAsPattern() { const { stack } = this; const currentScope = stack[stack.length - 1]; if (!currentScope.canBeArrowParameterDeclaration()) return; currentScope.iterateErrors(([toParseError, loc]) => { this.parser.raise(toParseError, loc); let i = stack.length - 2; let scope = stack[i]; while (scope.canBeArrowParameterDeclaration()) { scope.clearDeclarationError(loc.index); scope = stack[--i]; } }); } } function newParameterDeclarationScope() { return new ExpressionScope(3); } function newArrowHeadScope() { return new ArrowHeadParsingScope(1); } function newAsyncArrowScope() { return new ArrowHeadParsingScope(2); } function newExpressionScope() { return new ExpressionScope(); } class ProductionParameterHandler { constructor() { this.stacks = []; } enter(flags) { this.stacks.push(flags); } exit() { this.stacks.pop(); } currentFlags() { return this.stacks[this.stacks.length - 1]; } get hasAwait() { return (this.currentFlags() & 2) > 0; } get hasYield() { return (this.currentFlags() & 1) > 0; } get hasReturn() { return (this.currentFlags() & 4) > 0; } get hasIn() { return (this.currentFlags() & 8) > 0; } } function functionFlags(isAsync, isGenerator) { return (isAsync ? 2 : 0) | (isGenerator ? 1 : 0); } class UtilParser extends Tokenizer { addExtra(node, key, value, enumerable = true) { if (!node) return; let { extra } = node; if (extra == null) { extra = {}; node.extra = extra; } if (enumerable) { extra[key] = value; } else { Object.defineProperty(extra, key, { enumerable, value }); } } isContextual(token) { return this.state.type === token && !this.state.containsEsc; } isUnparsedContextual(nameStart, name) { const nameEnd = nameStart + name.length; if (this.input.slice(nameStart, nameEnd) === name) { const nextCh = this.input.charCodeAt(nameEnd); return !(isIdentifierChar(nextCh) || (nextCh & 0xfc00) === 0xd800); } return false; } isLookaheadContextual(name) { const next = this.nextTokenStart(); return this.isUnparsedContextual(next, name); } eatContextual(token) { if (this.isContextual(token)) { this.next(); return true; } return false; } expectContextual(token, toParseError) { if (!this.eatContextual(token)) { if (toParseError != null) { throw this.raise(toParseError, this.state.startLoc); } this.unexpected(null, token); } } canInsertSemicolon() { return this.match(140) || this.match(8) || this.hasPrecedingLineBreak(); } hasPrecedingLineBreak() { return hasNewLine(this.input, this.offsetToSourcePos(this.state.lastTokEndLoc.index), this.state.start); } hasFollowingLineBreak() { return hasNewLine(this.input, this.state.end, this.nextTokenStart()); } isLineTerminator() { return this.eat(13) || this.canInsertSemicolon(); } semicolon(allowAsi = true) { if (allowAsi ? this.isLineTerminator() : this.eat(13)) return; this.raise(Errors.MissingSemicolon, this.state.lastTokEndLoc); } expect(type, loc) { if (!this.eat(type)) { this.unexpected(loc, type); } } tryParse(fn, oldState = this.state.clone()) { const abortSignal = { node: null }; try { const node = fn((node = null) => { abortSignal.node = node; throw abortSignal; }); if (this.state.errors.length > oldState.errors.length) { const failState = this.state; this.state = oldState; this.state.tokensLength = failState.tokensLength; return { node, error: failState.errors[oldState.errors.length], thrown: false, aborted: false, failState }; } return { node, error: null, thrown: false, aborted: false, failState: null }; } catch (error) { const failState = this.state; this.state = oldState; if (error instanceof SyntaxError) { return { node: null, error, thrown: true, aborted: false, failState }; } if (error === abortSignal) { return { node: abortSignal.node, error: null, thrown: false, aborted: true, failState }; } throw error; } } checkExpressionErrors(refExpressionErrors, andThrow) { if (!refExpressionErrors) return false; const { shorthandAssignLoc, doubleProtoLoc, privateKeyLoc, optionalParametersLoc } = refExpressionErrors; const hasErrors = !!shorthandAssignLoc || !!doubleProtoLoc || !!optionalParametersLoc || !!privateKeyLoc; if (!andThrow) { return hasErrors; } if (shorthandAssignLoc != null) { this.raise(Errors.InvalidCoverInitializedName, shorthandAssignLoc); } if (doubleProtoLoc != null) { this.raise(Errors.DuplicateProto, doubleProtoLoc); } if (privateKeyLoc != null) { this.raise(Errors.UnexpectedPrivateField, privateKeyLoc); } if (optionalParametersLoc != null) { this.unexpected(optionalParametersLoc); } } isLiteralPropertyName() { return tokenIsLiteralPropertyName(this.state.type); } isPrivateName(node) { return node.type === "PrivateName"; } getPrivateNameSV(node) { return node.id.name; } hasPropertyAsPrivateName(node) { return (node.type === "MemberExpression" || node.type === "OptionalMemberExpression") && this.isPrivateName(node.property); } isObjectProperty(node) { return node.type === "ObjectProperty"; } isObjectMethod(node) { return node.type === "ObjectMethod"; } initializeScopes(inModule = this.options.sourceType === "module") { const oldLabels = this.state.labels; this.state.labels = []; const oldExportedIdentifiers = this.exportedIdentifiers; this.exportedIdentifiers = new Set(); const oldInModule = this.inModule; this.inModule = inModule; const oldScope = this.scope; const ScopeHandler = this.getScopeHandler(); this.scope = new ScopeHandler(this, inModule); const oldProdParam = this.prodParam; this.prodParam = new ProductionParameterHandler(); const oldClassScope = this.classScope; this.classScope = new ClassScopeHandler(this); const oldExpressionScope = this.expressionScope; this.expressionScope = new ExpressionScopeHandler(this); return () => { this.state.labels = oldLabels; this.exportedIdentifiers = oldExportedIdentifiers; this.inModule = oldInModule; this.scope = oldScope; this.prodParam = oldProdParam; this.classScope = oldClassScope; this.expressionScope = oldExpressionScope; }; } enterInitialScopes() { let paramFlags = 0; if (this.inModule) { paramFlags |= 2; } this.scope.enter(1); this.prodParam.enter(paramFlags); } checkDestructuringPrivate(refExpressionErrors) { const { privateKeyLoc } = refExpressionErrors; if (privateKeyLoc !== null) { this.expectPlugin("destructuringPrivate", privateKeyLoc); } } } class ExpressionErrors { constructor() { this.shorthandAssignLoc = null; this.doubleProtoLoc = null; this.privateKeyLoc = null; this.optionalParametersLoc = null; } } class Node { constructor(parser, pos, loc) { this.type = ""; this.start = pos; this.end = 0; this.loc = new SourceLocation(loc); if (parser != null && parser.options.ranges) this.range = [pos, 0]; if (parser != null && parser.filename) this.loc.filename = parser.filename; } } const NodePrototype = Node.prototype; { NodePrototype.__clone = function () { const newNode = new Node(undefined, this.start, this.loc.start); const keys = Object.keys(this); for (let i = 0, length = keys.length; i < length; i++) { const key = keys[i]; if (key !== "leadingComments" && key !== "trailingComments" && key !== "innerComments") { newNode[key] = this[key]; } } return newNode; }; } function clonePlaceholder(node) { return cloneIdentifier(node); } function cloneIdentifier(node) { const { type, start, end, loc, range, extra, name } = node; const cloned = Object.create(NodePrototype); cloned.type = type; cloned.start = start; cloned.end = end; cloned.loc = loc; cloned.range = range; cloned.extra = extra; cloned.name = name; if (type === "Placeholder") { cloned.expectedNode = node.expectedNode; } return cloned; } function cloneStringLiteral(node) { const { type, start, end, loc, range, extra } = node; if (type === "Placeholder") { return clonePlaceholder(node); } const cloned = Object.create(NodePrototype); cloned.type = type; cloned.start = start; cloned.end = end; cloned.loc = loc; cloned.range = range; if (node.raw !== undefined) { cloned.raw = node.raw; } else { cloned.extra = extra; } cloned.value = node.value; return cloned; } class NodeUtils extends UtilParser { startNode() { const loc = this.state.startLoc; return new Node(this, loc.index, loc); } startNodeAt(loc) { return new Node(this, loc.index, loc); } startNodeAtNode(type) { return this.startNodeAt(type.loc.start); } finishNode(node, type) { return this.finishNodeAt(node, type, this.state.lastTokEndLoc); } finishNodeAt(node, type, endLoc) { node.type = type; node.end = endLoc.index; node.loc.end = endLoc; if (this.options.ranges) node.range[1] = endLoc.index; if (this.options.attachComment) this.processComment(node); return node; } resetStartLocation(node, startLoc) { node.start = startLoc.index; node.loc.start = startLoc; if (this.options.ranges) node.range[0] = startLoc.index; } resetEndLocation(node, endLoc = this.state.lastTokEndLoc) { node.end = endLoc.index; node.loc.end = endLoc; if (this.options.ranges) node.range[1] = endLoc.index; } resetStartLocationFromNode(node, locationNode) { this.resetStartLocation(node, locationNode.loc.start); } } const reservedTypes = new Set(["_", "any", "bool", "boolean", "empty", "extends", "false", "interface", "mixed", "null", "number", "static", "string", "true", "typeof", "void"]); const FlowErrors = ParseErrorEnum`flow`({ AmbiguousConditionalArrow: "Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.", AmbiguousDeclareModuleKind: "Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.", AssignReservedType: ({ reservedType }) => `Cannot overwrite reserved type ${reservedType}.`, DeclareClassElement: "The `declare` modifier can only appear on class fields.", DeclareClassFieldInitializer: "Initializers are not allowed in fields with the `declare` modifier.", DuplicateDeclareModuleExports: "Duplicate `declare module.exports` statement.", EnumBooleanMemberNotInitialized: ({ memberName, enumName }) => `Boolean enum members need to be initialized. Use either \`${memberName} = true,\` or \`${memberName} = false,\` in enum \`${enumName}\`.`, EnumDuplicateMemberName: ({ memberName, enumName }) => `Enum member names need to be unique, but the name \`${memberName}\` has already been used before in enum \`${enumName}\`.`, EnumInconsistentMemberValues: ({ enumName }) => `Enum \`${enumName}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`, EnumInvalidExplicitType: ({ invalidEnumType, enumName }) => `Enum type \`${invalidEnumType}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${enumName}\`.`, EnumInvalidExplicitTypeUnknownSupplied: ({ enumName }) => `Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${enumName}\`.`, EnumInvalidMemberInitializerPrimaryType: ({ enumName, memberName, explicitType }) => `Enum \`${enumName}\` has type \`${explicitType}\`, so the initializer of \`${memberName}\` needs to be a ${explicitType} literal.`, EnumInvalidMemberInitializerSymbolType: ({ enumName, memberName }) => `Symbol enum members cannot be initialized. Use \`${memberName},\` in enum \`${enumName}\`.`, EnumInvalidMemberInitializerUnknownType: ({ enumName, memberName }) => `The enum member initializer for \`${memberName}\` needs to be a literal (either a boolean, number, or string) in enum \`${enumName}\`.`, EnumInvalidMemberName: ({ enumName, memberName, suggestion }) => `Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${memberName}\`, consider using \`${suggestion}\`, in enum \`${enumName}\`.`, EnumNumberMemberNotInitialized: ({ enumName, memberName }) => `Number enum members need to be initialized, e.g. \`${memberName} = 1\` in enum \`${enumName}\`.`, EnumStringMemberInconsistentlyInitialized: ({ enumName }) => `String enum members need to consistently either all use initializers, or use no initializers, in enum \`${enumName}\`.`, GetterMayNotHaveThisParam: "A getter cannot have a `this` parameter.", ImportReflectionHasImportType: "An `import module` declaration can not use `type` or `typeof` keyword.", ImportTypeShorthandOnlyInPureImport: "The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.", InexactInsideExact: "Explicit inexact syntax cannot appear inside an explicit exact object type.", InexactInsideNonObject: "Explicit inexact syntax cannot appear in class or interface definitions.", InexactVariance: "Explicit inexact syntax cannot have variance.", InvalidNonTypeImportInDeclareModule: "Imports within a `declare module` body must always be `import type` or `import typeof`.", MissingTypeParamDefault: "Type parameter declaration needs a default, since a preceding type parameter declaration has a default.", NestedDeclareModule: "`declare module` cannot be used inside another `declare module`.", NestedFlowComment: "Cannot have a flow comment inside another flow comment.", PatternIsOptional: Object.assign({ message: "A binding pattern parameter cannot be optional in an implementation signature." }, { reasonCode: "OptionalBindingPattern" }), SetterMayNotHaveThisParam: "A setter cannot have a `this` parameter.", SpreadVariance: "Spread properties cannot have variance.", ThisParamAnnotationRequired: "A type annotation is required for the `this` parameter.", ThisParamBannedInConstructor: "Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.", ThisParamMayNotBeOptional: "The `this` parameter cannot be optional.", ThisParamMustBeFirst: "The `this` parameter must be the first function parameter.", ThisParamNoDefault: "The `this` parameter may not have a default value.", TypeBeforeInitializer: "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.", TypeCastInPattern: "The type cast expression is expected to be wrapped with parenthesis.", UnexpectedExplicitInexactInObject: "Explicit inexact syntax must appear at the end of an inexact object.", UnexpectedReservedType: ({ reservedType }) => `Unexpected reserved type ${reservedType}.`, UnexpectedReservedUnderscore: "`_` is only allowed as a type argument to call or new.", UnexpectedSpaceBetweenModuloChecks: "Spaces between `%` and `checks` are not allowed here.", UnexpectedSpreadType: "Spread operator cannot appear in class or interface definitions.", UnexpectedSubtractionOperand: 'Unexpected token, expected "number" or "bigint".', UnexpectedTokenAfterTypeParameter: "Expected an arrow function after this type parameter declaration.", UnexpectedTypeParameterBeforeAsyncArrowFunction: "Type parameters must come after the async keyword, e.g. instead of `<T> async () => {}`, use `async <T>() => {}`.", UnsupportedDeclareExportKind: ({ unsupportedExportKind, suggestion }) => `\`declare export ${unsupportedExportKind}\` is not supported. Use \`${suggestion}\` instead.`, UnsupportedStatementInDeclareModule: "Only declares and type imports are allowed inside declare module.", UnterminatedFlowComment: "Unterminated flow-comment." }); function isEsModuleType(bodyElement) { return bodyElement.type === "DeclareExportAllDeclaration" || bodyElement.type === "DeclareExportDeclaration" && (!bodyElement.declaration || bodyElement.declaration.type !== "TypeAlias" && bodyElement.declaration.type !== "InterfaceDeclaration"); } function hasTypeImportKind(node) { return node.importKind === "type" || node.importKind === "typeof"; } const exportSuggestions = { const: "declare export var", let: "declare export var", type: "export type", interface: "export interface" }; function partition(list, test) { const list1 = []; const list2 = []; for (let i = 0; i < list.length; i++) { (test(list[i], i, list) ? list1 : list2).push(list[i]); } return [list1, list2]; } const FLOW_PRAGMA_REGEX = /\*?\s*@((?:no)?flow)\b/; var flow = superClass => class FlowParserMixin extends superClass { constructor(...args) { super(...args); this.flowPragma = undefined; } getScopeHandler() { return FlowScopeHandler; } shouldParseTypes() { return this.getPluginOption("flow", "all") || this.flowPragma === "flow"; } finishToken(type, val) { if (type !== 134 && type !== 13 && type !== 28) { if (this.flowPragma === undefined) { this.flowPragma = null; } } super.finishToken(type, val); } addComment(comment) { if (this.flowPragma === undefined) { const matches = FLOW_PRAGMA_REGEX.exec(comment.value); if (!matches) ;else if (matches[1] === "flow") { this.flowPragma = "flow"; } else if (matches[1] === "noflow") { this.flowPragma = "noflow"; } else { throw new Error("Unexpected flow pragma"); } } super.addComment(comment); } flowParseTypeInitialiser(tok) { const oldInType = this.state.inType; this.state.inType = true; this.expect(tok || 14); const type = this.flowParseType(); this.state.inType = oldInType; return type; } flowParsePredicate() { const node = this.startNode(); const moduloLoc = this.state.startLoc; this.next(); this.expectContextual(110); if (this.state.lastTokStartLoc.index > moduloLoc.index + 1) { this.raise(FlowErrors.UnexpectedSpaceBetweenModuloChecks, moduloLoc); } if (this.eat(10)) { node.value = super.parseExpression(); this.expect(11); return this.finishNode(node, "DeclaredPredicate"); } else { return this.finishNode(node, "InferredPredicate"); } } flowParseTypeAndPredicateInitialiser() { const oldInType = this.state.inType; this.state.inType = true; this.expect(14); let type = null; let predicate = null; if (this.match(54)) { this.state.inType = oldInType; predicate = this.flowParsePredicate(); } else { type = this.flowParseType(); this.state.inType = oldInType; if (this.match(54)) { predicate = this.flowParsePredicate(); } } return [type, predicate]; } flowParseDeclareClass(node) { this.next(); this.flowParseInterfaceish(node, true); return this.finishNode(node, "DeclareClass"); } flowParseDeclareFunction(node) { this.next(); const id = node.id = this.parseIdentifier(); const typeNode = this.startNode(); const typeContainer = this.startNode(); if (this.match(47)) { typeNode.typeParameters = this.flowParseTypeParameterDeclaration(); } else { typeNode.typeParameters = null; } this.expect(10); const tmp = this.flowParseFunctionTypeParams(); typeNode.params = tmp.params; typeNode.rest = tmp.rest; typeNode.this = tmp._this; this.expect(11); [typeNode.returnType, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); typeContainer.typeAnnotation = this.finishNode(typeNode, "FunctionTypeAnnotation"); id.typeAnnotation = this.finishNode(typeContainer, "TypeAnnotation"); this.resetEndLocation(id); this.semicolon(); this.scope.declareName(node.id.name, 2048, node.id.loc.start); return this.finishNode(node, "DeclareFunction"); } flowParseDeclare(node, insideModule) { if (this.match(80)) { return this.flowParseDeclareClass(node); } else if (this.match(68)) { return this.flowParseDeclareFunction(node); } else if (this.match(74)) { return this.flowParseDeclareVariable(node); } else if (this.eatContextual(127)) { if (this.match(16)) { return this.flowParseDeclareModuleExports(node); } else { if (insideModule) { this.raise(FlowErrors.NestedDeclareModule, this.state.lastTokStartLoc); } return this.flowParseDeclareModule(node); } } else if (this.isContextual(130)) { return this.flowParseDeclareTypeAlias(node); } else if (this.isContextual(131)) { return this.flowParseDeclareOpaqueType(node); } else if (this.isContextual(129)) { return this.flowParseDeclareInterface(node); } else if (this.match(82)) { return this.flowParseDeclareExportDeclaration(node, insideModule); } else { this.unexpected(); } } flowParseDeclareVariable(node) { this.next(); node.id = this.flowParseTypeAnnotatableIdentifier(true); this.scope.declareName(node.id.name, 5, node.id.loc.start); this.semicolon(); return this.finishNode(node, "DeclareVariable"); } flowParseDeclareModule(node) { this.scope.enter(0); if (this.match(134)) { node.id = super.parseExprAtom(); } else { node.id = this.parseIdentifier(); } const bodyNode = node.body = this.startNode(); const body = bodyNode.body = []; this.expect(5); while (!this.match(8)) { let bodyNode = this.startNode(); if (this.match(83)) { this.next(); if (!this.isContextual(130) && !this.match(87)) { this.raise(FlowErrors.InvalidNonTypeImportInDeclareModule, this.state.lastTokStartLoc); } super.parseImport(bodyNode); } else { this.expectContextual(125, FlowErrors.UnsupportedStatementInDeclareModule); bodyNode = this.flowParseDeclare(bodyNode, true); } body.push(bodyNode); } this.scope.exit(); this.expect(8); this.finishNode(bodyNode, "BlockStatement"); let kind = null; let hasModuleExport = false; body.forEach(bodyElement => { if (isEsModuleType(bodyElement)) { if (kind === "CommonJS") { this.raise(FlowErrors.AmbiguousDeclareModuleKind, bodyElement); } kind = "ES"; } else if (bodyElement.type === "DeclareModuleExports") { if (hasModuleExport) { this.raise(FlowErrors.DuplicateDeclareModuleExports, bodyElement); } if (kind === "ES") { this.raise(FlowErrors.AmbiguousDeclareModuleKind, bodyElement); } kind = "CommonJS"; hasModuleExport = true; } }); node.kind = kind || "CommonJS"; return this.finishNode(node, "DeclareModule"); } flowParseDeclareExportDeclaration(node, insideModule) { this.expect(82); if (this.eat(65)) { if (this.match(68) || this.match(80)) { node.declaration = this.flowParseDeclare(this.startNode()); } else { node.declaration = this.flowParseType(); this.semicolon(); } node.default = true; return this.finishNode(node, "DeclareExportDeclaration"); } else { if (this.match(75) || this.isLet() || (this.isContextual(130) || this.isContextual(129)) && !insideModule) { const label = this.state.value; throw this.raise(FlowErrors.UnsupportedDeclareExportKind, this.state.startLoc, { unsupportedExportKind: label, suggestion: exportSuggestions[label] }); } if (this.match(74) || this.match(68) || this.match(80) || this.isContextual(131)) { node.declaration = this.flowParseDeclare(this.startNode()); node.default = false; return this.finishNode(node, "DeclareExportDeclaration"); } else if (this.match(55) || this.match(5) || this.isContextual(129) || this.isContextual(130) || this.isContextual(131)) { node = this.parseExport(node, null); if (node.type === "ExportNamedDeclaration") { node.type = "ExportDeclaration"; node.default = false; delete node.exportKind; } node.type = "Declare" + node.type; return node; } } this.unexpected(); } flowParseDeclareModuleExports(node) { this.next(); this.expectContextual(111); node.typeAnnotation = this.flowParseTypeAnnotation(); this.semicolon(); return this.finishNode(node, "DeclareModuleExports"); } flowParseDeclareTypeAlias(node) { this.next(); const finished = this.flowParseTypeAlias(node); finished.type = "DeclareTypeAlias"; return finished; } flowParseDeclareOpaqueType(node) { this.next(); const finished = this.flowParseOpaqueType(node, true); finished.type = "DeclareOpaqueType"; return finished; } flowParseDeclareInterface(node) { this.next(); this.flowParseInterfaceish(node, false); return this.finishNode(node, "DeclareInterface"); } flowParseInterfaceish(node, isClass) { node.id = this.flowParseRestrictedIdentifier(!isClass, true); this.scope.declareName(node.id.name, isClass ? 17 : 8201, node.id.loc.start); if (this.match(47)) { node.typeParameters = this.flowParseTypeParameterDeclaration(); } else { node.typeParameters = null; } node.extends = []; if (this.eat(81)) { do { node.extends.push(this.flowParseInterfaceExtends()); } while (!isClass && this.eat(12)); } if (isClass) { node.implements = []; node.mixins = []; if (this.eatContextual(117)) { do { node.mixins.push(this.flowParseInterfaceExtends()); } while (this.eat(12)); } if (this.eatContextual(113)) { do { node.implements.push(this.flowParseInterfaceExtends()); } while (this.eat(12)); } } node.body = this.flowParseObjectType({ allowStatic: isClass, allowExact: false, allowSpread: false, allowProto: isClass, allowInexact: false }); } flowParseInterfaceExtends() { const node = this.startNode(); node.id = this.flowParseQualifiedTypeIdentifier(); if (this.match(47)) { node.typeParameters = this.flowParseTypeParameterInstantiation(); } else { node.typeParameters = null; } return this.finishNode(node, "InterfaceExtends"); } flowParseInterface(node) { this.flowParseInterfaceish(node, false); return this.finishNode(node, "InterfaceDeclaration"); } checkNotUnderscore(word) { if (word === "_") { this.raise(FlowErrors.UnexpectedReservedUnderscore, this.state.startLoc); } } checkReservedType(word, startLoc, declaration) { if (!reservedTypes.has(word)) return; this.raise(declaration ? FlowErrors.AssignReservedType : FlowErrors.UnexpectedReservedType, startLoc, { reservedType: word }); } flowParseRestrictedIdentifier(liberal, declaration) { this.checkReservedType(this.state.value, this.state.startLoc, declaration); return this.parseIdentifier(liberal); } flowParseTypeAlias(node) { node.id = this.flowParseRestrictedIdentifier(false, true); this.scope.declareName(node.id.name, 8201, node.id.loc.start); if (this.match(47)) { node.typeParameters = this.flowParseTypeParameterDeclaration(); } else { node.typeParameters = null; } node.right = this.flowParseTypeInitialiser(29); this.semicolon(); return this.finishNode(node, "TypeAlias"); } flowParseOpaqueType(node, declare) { this.expectContextual(130); node.id = this.flowParseRestrictedIdentifier(true, true); this.scope.declareName(node.id.name, 8201, node.id.loc.start); if (this.match(47)) { node.typeParameters = this.flowParseTypeParameterDeclaration(); } else { node.typeParameters = null; } node.supertype = null; if (this.match(14)) { node.supertype = this.flowParseTypeInitialiser(14); } node.impltype = null; if (!declare) { node.impltype = this.flowParseTypeInitialiser(29); } this.semicolon(); return this.finishNode(node, "OpaqueType"); } flowParseTypeParameter(requireDefault = false) { const nodeStartLoc = this.state.startLoc; const node = this.startNode(); const variance = this.flowParseVariance(); const ident = this.flowParseTypeAnnotatableIdentifier(); node.name = ident.name; node.variance = variance; node.bound = ident.typeAnnotation; if (this.match(29)) { this.eat(29); node.default = this.flowParseType(); } else { if (requireDefault) { this.raise(FlowErrors.MissingTypeParamDefault, nodeStartLoc); } } return this.finishNode(node, "TypeParameter"); } flowParseTypeParameterDeclaration() { const oldInType = this.state.inType; const node = this.startNode(); node.params = []; this.state.inType = true; if (this.match(47) || this.match(143)) { this.next(); } else { this.unexpected(); } let defaultRequired = false; do { const typeParameter = this.flowParseTypeParameter(defaultRequired); node.params.push(typeParameter); if (typeParameter.default) { defaultRequired = true; } if (!this.match(48)) { this.expect(12); } } while (!this.match(48)); this.expect(48); this.state.inType = oldInType; return this.finishNode(node, "TypeParameterDeclaration"); } flowParseTypeParameterInstantiation() { const node = this.startNode(); const oldInType = this.state.inType; node.params = []; this.state.inType = true; this.expect(47); const oldNoAnonFunctionType = this.state.noAnonFunctionType; this.state.noAnonFunctionType = false; while (!this.match(48)) { node.params.push(this.flowParseType()); if (!this.match(48)) { this.expect(12); } } this.state.noAnonFunctionType = oldNoAnonFunctionType; this.expect(48); this.state.inType = oldInType; return this.finishNode(node, "TypeParameterInstantiation"); } flowParseTypeParameterInstantiationCallOrNew() { const node = this.startNode(); const oldInType = this.state.inType; node.params = []; this.state.inType = true; this.expect(47); while (!this.match(48)) { node.params.push(this.flowParseTypeOrImplicitInstantiation()); if (!this.match(48)) { this.expect(12); } } this.expect(48); this.state.inType = oldInType; return this.finishNode(node, "TypeParameterInstantiation"); } flowParseInterfaceType() { const node = this.startNode(); this.expectContextual(129); node.extends = []; if (this.eat(81)) { do { node.extends.push(this.flowParseInterfaceExtends()); } while (this.eat(12)); } node.body = this.flowParseObjectType({ allowStatic: false, allowExact: false, allowSpread: false, allowProto: false, allowInexact: false }); return this.finishNode(node, "InterfaceTypeAnnotation"); } flowParseObjectPropertyKey() { return this.match(135) || this.match(134) ? super.parseExprAtom() : this.parseIdentifier(true); } flowParseObjectTypeIndexer(node, isStatic, variance) { node.static = isStatic; if (this.lookahead().type === 14) { node.id = this.flowParseObjectPropertyKey(); node.key = this.flowParseTypeInitialiser(); } else { node.id = null; node.key = this.flowParseType(); } this.expect(3); node.value = this.flowParseTypeInitialiser(); node.variance = variance; return this.finishNode(node, "ObjectTypeIndexer"); } flowParseObjectTypeInternalSlot(node, isStatic) { node.static = isStatic; node.id = this.flowParseObjectPropertyKey(); this.expect(3); this.expect(3); if (this.match(47) || this.match(10)) { node.method = true; node.optional = false; node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.loc.start)); } else { node.method = false; if (this.eat(17)) { node.optional = true; } node.value = this.flowParseTypeInitialiser(); } return this.finishNode(node, "ObjectTypeInternalSlot"); } flowParseObjectTypeMethodish(node) { node.params = []; node.rest = null; node.typeParameters = null; node.this = null; if (this.match(47)) { node.typeParameters = this.flowParseTypeParameterDeclaration(); } this.expect(10); if (this.match(78)) { node.this = this.flowParseFunctionTypeParam(true); node.this.name = null; if (!this.match(11)) { this.expect(12); } } while (!this.match(11) && !this.match(21)) { node.params.push(this.flowParseFunctionTypeParam(false)); if (!this.match(11)) { this.expect(12); } } if (this.eat(21)) { node.rest = this.flowParseFunctionTypeParam(false); } this.expect(11); node.returnType = this.flowParseTypeInitialiser(); return this.finishNode(node, "FunctionTypeAnnotation"); } flowParseObjectTypeCallProperty(node, isStatic) { const valueNode = this.startNode(); node.static = isStatic; node.value = this.flowParseObjectTypeMethodish(valueNode); return this.finishNode(node, "ObjectTypeCallProperty"); } flowParseObjectType({ allowStatic, allowExact, allowSpread, allowProto, allowInexact }) { const oldInType = this.state.inType; this.state.inType = true; const nodeStart = this.startNode(); nodeStart.callProperties = []; nodeStart.properties = []; nodeStart.indexers = []; nodeStart.internalSlots = []; let endDelim; let exact; let inexact = false; if (allowExact && this.match(6)) { this.expect(6); endDelim = 9; exact = true; } else { this.expect(5); endDelim = 8; exact = false; } nodeStart.exact = exact; while (!this.match(endDelim)) { let isStatic = false; let protoStartLoc = null; let inexactStartLoc = null; const node = this.startNode(); if (allowProto && this.isContextual(118)) { const lookahead = this.lookahead(); if (lookahead.type !== 14 && lookahead.type !== 17) { this.next(); protoStartLoc = this.state.startLoc; allowStatic = false; } } if (allowStatic && this.isContextual(106)) { const lookahead = this.lookahead(); if (lookahead.type !== 14 && lookahead.type !== 17) { this.next(); isStatic = true; } } const variance = this.flowParseVariance(); if (this.eat(0)) { if (protoStartLoc != null) { this.unexpected(protoStartLoc); } if (this.eat(0)) { if (variance) { this.unexpected(variance.loc.start); } nodeStart.internalSlots.push(this.flowParseObjectTypeInternalSlot(node, isStatic)); } else { nodeStart.indexers.push(this.flowParseObjectTypeIndexer(node, isStatic, variance)); } } else if (this.match(10) || this.match(47)) { if (protoStartLoc != null) { this.unexpected(protoStartLoc); } if (variance) { this.unexpected(variance.loc.start); } nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node, isStatic)); } else { let kind = "init"; if (this.isContextual(99) || this.isContextual(104)) { const lookahead = this.lookahead(); if (tokenIsLiteralPropertyName(lookahead.type)) { kind = this.state.value; this.next(); } } const propOrInexact = this.flowParseObjectTypeProperty(node, isStatic, protoStartLoc, variance, kind, allowSpread, allowInexact != null ? allowInexact : !exact); if (propOrInexact === null) { inexact = true; inexactStartLoc = this.state.lastTokStartLoc; } else { nodeStart.properties.push(propOrInexact); } } this.flowObjectTypeSemicolon(); if (inexactStartLoc && !this.match(8) && !this.match(9)) { this.raise(FlowErrors.UnexpectedExplicitInexactInObject, inexactStartLoc); } } this.expect(endDelim); if (allowSpread) { nodeStart.inexact = inexact; } const out = this.finishNode(nodeStart, "ObjectTypeAnnotation"); this.state.inType = oldInType; return out; } flowParseObjectTypeProperty(node, isStatic, protoStartLoc, variance, kind, allowSpread, allowInexact) { if (this.eat(21)) { const isInexactToken = this.match(12) || this.match(13) || this.match(8) || this.match(9); if (isInexactToken) { if (!allowSpread) { this.raise(FlowErrors.InexactInsideNonObject, this.state.lastTokStartLoc); } else if (!allowInexact) { this.raise(FlowErrors.InexactInsideExact, this.state.lastTokStartLoc); } if (variance) { this.raise(FlowErrors.InexactVariance, variance); } return null; } if (!allowSpread) { this.raise(FlowErrors.UnexpectedSpreadType, this.state.lastTokStartLoc); } if (protoStartLoc != null) { this.unexpected(protoStartLoc); } if (variance) { this.raise(FlowErrors.SpreadVariance, variance); } node.argument = this.flowParseType(); return this.finishNode(node, "ObjectTypeSpreadProperty"); } else { node.key = this.flowParseObjectPropertyKey(); node.static = isStatic; node.proto = protoStartLoc != null; node.kind = kind; let optional = false; if (this.match(47) || this.match(10)) { node.method = true; if (protoStartLoc != null) { this.unexpected(protoStartLoc); } if (variance) { this.unexpected(variance.loc.start); } node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.loc.start)); if (kind === "get" || kind === "set") { this.flowCheckGetterSetterParams(node); } if (!allowSpread && node.key.name === "constructor" && node.value.this) { this.raise(FlowErrors.ThisParamBannedInConstructor, node.value.this); } } else { if (kind !== "init") this.unexpected(); node.method = false; if (this.eat(17)) { optional = true; } node.value = this.flowParseTypeInitialiser(); node.variance = variance; } node.optional = optional; return this.finishNode(node, "ObjectTypeProperty"); } } flowCheckGetterSetterParams(property) { const paramCount = property.kind === "get" ? 0 : 1; const length = property.value.params.length + (property.value.rest ? 1 : 0); if (property.value.this) { this.raise(property.kind === "get" ? FlowErrors.GetterMayNotHaveThisParam : FlowErrors.SetterMayNotHaveThisParam, property.value.this); } if (length !== paramCount) { this.raise(property.kind === "get" ? Errors.BadGetterArity : Errors.BadSetterArity, property); } if (property.kind === "set" && property.value.rest) { this.raise(Errors.BadSetterRestParameter, property); } } flowObjectTypeSemicolon() { if (!this.eat(13) && !this.eat(12) && !this.match(8) && !this.match(9)) { this.unexpected(); } } flowParseQualifiedTypeIdentifier(startLoc, id) { var _startLoc; (_startLoc = startLoc) != null ? _startLoc : startLoc = this.state.startLoc; let node = id || this.flowParseRestrictedIdentifier(true); while (this.eat(16)) { const node2 = this.startNodeAt(startLoc); node2.qualification = node; node2.id = this.flowParseRestrictedIdentifier(true); node = this.finishNode(node2, "QualifiedTypeIdentifier"); } return node; } flowParseGenericType(startLoc, id) { const node = this.startNodeAt(startLoc); node.typeParameters = null; node.id = this.flowParseQualifiedTypeIdentifier(startLoc, id); if (this.match(47)) { node.typeParameters = this.flowParseTypeParameterInstantiation(); } return this.finishNode(node, "GenericTypeAnnotation"); } flowParseTypeofType() { const node = this.startNode(); this.expect(87); node.argument = this.flowParsePrimaryType(); return this.finishNode(node, "TypeofTypeAnnotation"); } flowParseTupleType() { const node = this.startNode(); node.types = []; this.expect(0); while (this.state.pos < this.length && !this.match(3)) { node.types.push(this.flowParseType()); if (this.match(3)) break; this.expect(12); } this.expect(3); return this.finishNode(node, "TupleTypeAnnotation"); } flowParseFunctionTypeParam(first) { let name = null; let optional = false; let typeAnnotation = null; const node = this.startNode(); const lh = this.lookahead(); const isThis = this.state.type === 78; if (lh.type === 14 || lh.type === 17) { if (isThis && !first) { this.raise(FlowErrors.ThisParamMustBeFirst, node); } name = this.parseIdentifier(isThis); if (this.eat(17)) { optional = true; if (isThis) { this.raise(FlowErrors.ThisParamMayNotBeOptional, node); } } typeAnnotation = this.flowParseTypeInitialiser(); } else { typeAnnotation = this.flowParseType(); } node.name = name; node.optional = optional; node.typeAnnotation = typeAnnotation; return this.finishNode(node, "FunctionTypeParam"); } reinterpretTypeAsFunctionTypeParam(type) { const node = this.startNodeAt(type.loc.start); node.name = null; node.optional = false; node.typeAnnotation = type; return this.finishNode(node, "FunctionTypeParam"); } flowParseFunctionTypeParams(params = []) { let rest = null; let _this = null; if (this.match(78)) { _this = this.flowParseFunctionTypeParam(true); _this.name = null; if (!this.match(11)) { this.expect(12); } } while (!this.match(11) && !this.match(21)) { params.push(this.flowParseFunctionTypeParam(false)); if (!this.match(11)) { this.expect(12); } } if (this.eat(21)) { rest = this.flowParseFunctionTypeParam(false); } return { params, rest, _this }; } flowIdentToTypeAnnotation(startLoc, node, id) { switch (id.name) { case "any": return this.finishNode(node, "AnyTypeAnnotation"); case "bool": case "boolean": return this.finishNode(node, "BooleanTypeAnnotation"); case "mixed": return this.finishNode(node, "MixedTypeAnnotation"); case "empty": return this.finishNode(node, "EmptyTypeAnnotation"); case "number": return this.finishNode(node, "NumberTypeAnnotation"); case "string": return this.finishNode(node, "StringTypeAnnotation"); case "symbol": return this.finishNode(node, "SymbolTypeAnnotation"); default: this.checkNotUnderscore(id.name); return this.flowParseGenericType(startLoc, id); } } flowParsePrimaryType() { const startLoc = this.state.startLoc; const node = this.startNode(); let tmp; let type; let isGroupedType = false; const oldNoAnonFunctionType = this.state.noAnonFunctionType; switch (this.state.type) { case 5: return this.flowParseObjectType({ allowStatic: false, allowExact: false, allowSpread: true, allowProto: false, allowInexact: true }); case 6: return this.flowParseObjectType({ allowStatic: false, allowExact: true, allowSpread: true, allowProto: false, allowInexact: false }); case 0: this.state.noAnonFunctionType = false; type = this.flowParseTupleType(); this.state.noAnonFunctionType = oldNoAnonFunctionType; return type; case 47: { const node = this.startNode(); node.typeParameters = this.flowParseTypeParameterDeclaration(); this.expect(10); tmp = this.flowParseFunctionTypeParams(); node.params = tmp.params; node.rest = tmp.rest; node.this = tmp._this; this.expect(11); this.expect(19); node.returnType = this.flowParseType(); return this.finishNode(node, "FunctionTypeAnnotation"); } case 10: { const node = this.startNode(); this.next(); if (!this.match(11) && !this.match(21)) { if (tokenIsIdentifier(this.state.type) || this.match(78)) { const token = this.lookahead().type; isGroupedType = token !== 17 && token !== 14; } else { isGroupedType = true; } } if (isGroupedType) { this.state.noAnonFunctionType = false; type = this.flowParseType(); this.state.noAnonFunctionType = oldNoAnonFunctionType; if (this.state.noAnonFunctionType || !(this.match(12) || this.match(11) && this.lookahead().type === 19)) { this.expect(11); return type; } else { this.eat(12); } } if (type) { tmp = this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(type)]); } else { tmp = this.flowParseFunctionTypeParams(); } node.params = tmp.params; node.rest = tmp.rest; node.this = tmp._this; this.expect(11); this.expect(19); node.returnType = this.flowParseType(); node.typeParameters = null; return this.finishNode(node, "FunctionTypeAnnotation"); } case 134: return this.parseLiteral(this.state.value, "StringLiteralTypeAnnotation"); case 85: case 86: node.value = this.match(85); this.next(); return this.finishNode(node, "BooleanLiteralTypeAnnotation"); case 53: if (this.state.value === "-") { this.next(); if (this.match(135)) { return this.parseLiteralAtNode(-this.state.value, "NumberLiteralTypeAnnotation", node); } if (this.match(136)) { return this.parseLiteralAtNode(-this.state.value, "BigIntLiteralTypeAnnotation", node); } throw this.raise(FlowErrors.UnexpectedSubtractionOperand, this.state.startLoc); } this.unexpected(); return; case 135: return this.parseLiteral(this.state.value, "NumberLiteralTypeAnnotation"); case 136: return this.parseLiteral(this.state.value, "BigIntLiteralTypeAnnotation"); case 88: this.next(); return this.finishNode(node, "VoidTypeAnnotation"); case 84: this.next(); return this.finishNode(node, "NullLiteralTypeAnnotation"); case 78: this.next(); return this.finishNode(node, "ThisTypeAnnotation"); case 55: this.next(); return this.finishNode(node, "ExistsTypeAnnotation"); case 87: return this.flowParseTypeofType(); default: if (tokenIsKeyword(this.state.type)) { const label = tokenLabelName(this.state.type); this.next(); return super.createIdentifier(node, label); } else if (tokenIsIdentifier(this.state.type)) { if (this.isContextual(129)) { return this.flowParseInterfaceType(); } return this.flowIdentToTypeAnnotation(startLoc, node, this.parseIdentifier()); } } this.unexpected(); } flowParsePostfixType() { const startLoc = this.state.startLoc; let type = this.flowParsePrimaryType(); let seenOptionalIndexedAccess = false; while ((this.match(0) || this.match(18)) && !this.canInsertSemicolon()) { const node = this.startNodeAt(startLoc); const optional = this.eat(18); seenOptionalIndexedAccess = seenOptionalIndexedAccess || optional; this.expect(0); if (!optional && this.match(3)) { node.elementType = type; this.next(); type = this.finishNode(node, "ArrayTypeAnnotation"); } else { node.objectType = type; node.indexType = this.flowParseType(); this.expect(3); if (seenOptionalIndexedAccess) { node.optional = optional; type = this.finishNode(node, "OptionalIndexedAccessType"); } else { type = this.finishNode(node, "IndexedAccessType"); } } } return type; } flowParsePrefixType() { const node = this.startNode(); if (this.eat(17)) { node.typeAnnotation = this.flowParsePrefixType(); return this.finishNode(node, "NullableTypeAnnotation"); } else { return this.flowParsePostfixType(); } } flowParseAnonFunctionWithoutParens() { const param = this.flowParsePrefixType(); if (!this.state.noAnonFunctionType && this.eat(19)) { const node = this.startNodeAt(param.loc.start); node.params = [this.reinterpretTypeAsFunctionTypeParam(param)]; node.rest = null; node.this = null; node.returnType = this.flowParseType(); node.typeParameters = null; return this.finishNode(node, "FunctionTypeAnnotation"); } return param; } flowParseIntersectionType() { const node = this.startNode(); this.eat(45); const type = this.flowParseAnonFunctionWithoutParens(); node.types = [type]; while (this.eat(45)) { node.types.push(this.flowParseAnonFunctionWithoutParens()); } return node.types.length === 1 ? type : this.finishNode(node, "IntersectionTypeAnnotation"); } flowParseUnionType() { const node = this.startNode(); this.eat(43); const type = this.flowParseIntersectionType(); node.types = [type]; while (this.eat(43)) { node.types.push(this.flowParseIntersectionType()); } return node.types.length === 1 ? type : this.finishNode(node, "UnionTypeAnnotation"); } flowParseType() { const oldInType = this.state.inType; this.state.inType = true; const type = this.flowParseUnionType(); this.state.inType = oldInType; return type; } flowParseTypeOrImplicitInstantiation() { if (this.state.type === 132 && this.state.value === "_") { const startLoc = this.state.startLoc; const node = this.parseIdentifier(); return this.flowParseGenericType(startLoc, node); } else { return this.flowParseType(); } } flowParseTypeAnnotation() { const node = this.startNode(); node.typeAnnotation = this.flowParseTypeInitialiser(); return this.finishNode(node, "TypeAnnotation"); } flowParseTypeAnnotatableIdentifier(allowPrimitiveOverride) { const ident = allowPrimitiveOverride ? this.parseIdentifier() : this.flowParseRestrictedIdentifier(); if (this.match(14)) { ident.typeAnnotation = this.flowParseTypeAnnotation(); this.resetEndLocation(ident); } return ident; } typeCastToParameter(node) { node.expression.typeAnnotation = node.typeAnnotation; this.resetEndLocation(node.expression, node.typeAnnotation.loc.end); return node.expression; } flowParseVariance() { let variance = null; if (this.match(53)) { variance = this.startNode(); if (this.state.value === "+") { variance.kind = "plus"; } else { variance.kind = "minus"; } this.next(); return this.finishNode(variance, "Variance"); } return variance; } parseFunctionBody(node, allowExpressionBody, isMethod = false) { if (allowExpressionBody) { this.forwardNoArrowParamsConversionAt(node, () => super.parseFunctionBody(node, true, isMethod)); return; } super.parseFunctionBody(node, false, isMethod); } parseFunctionBodyAndFinish(node, type, isMethod = false) { if (this.match(14)) { const typeNode = this.startNode(); [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); node.returnType = typeNode.typeAnnotation ? this.finishNode(typeNode, "TypeAnnotation") : null; } return super.parseFunctionBodyAndFinish(node, type, isMethod); } parseStatementLike(flags) { if (this.state.strict && this.isContextual(129)) { const lookahead = this.lookahead(); if (tokenIsKeywordOrIdentifier(lookahead.type)) { const node = this.startNode(); this.next(); return this.flowParseInterface(node); } } else if (this.isContextual(126)) { const node = this.startNode(); this.next(); return this.flowParseEnumDeclaration(node); } const stmt = super.parseStatementLike(flags); if (this.flowPragma === undefined && !this.isValidDirective(stmt)) { this.flowPragma = null; } return stmt; } parseExpressionStatement(node, expr, decorators) { if (expr.type === "Identifier") { if (expr.name === "declare") { if (this.match(80) || tokenIsIdentifier(this.state.type) || this.match(68) || this.match(74) || this.match(82)) { return this.flowParseDeclare(node); } } else if (tokenIsIdentifier(this.state.type)) { if (expr.name === "interface") { return this.flowParseInterface(node); } else if (expr.name === "type") { return this.flowParseTypeAlias(node); } else if (expr.name === "opaque") { return this.flowParseOpaqueType(node, false); } } } return super.parseExpressionStatement(node, expr, decorators); } shouldParseExportDeclaration() { const { type } = this.state; if (type === 126 || tokenIsFlowInterfaceOrTypeOrOpaque(type)) { return !this.state.containsEsc; } return super.shouldParseExportDeclaration(); } isExportDefaultSpecifier() { const { type } = this.state; if (type === 126 || tokenIsFlowInterfaceOrTypeOrOpaque(type)) { return this.state.containsEsc; } return super.isExportDefaultSpecifier(); } parseExportDefaultExpression() { if (this.isContextual(126)) { const node = this.startNode(); this.next(); return this.flowParseEnumDeclaration(node); } return super.parseExportDefaultExpression(); } parseConditional(expr, startLoc, refExpressionErrors) { if (!this.match(17)) return expr; if (this.state.maybeInArrowParameters) { const nextCh = this.lookaheadCharCode(); if (nextCh === 44 || nextCh === 61 || nextCh === 58 || nextCh === 41) { this.setOptionalParametersError(refExpressionErrors); return expr; } } this.expect(17); const state = this.state.clone(); const originalNoArrowAt = this.state.noArrowAt; const node = this.startNodeAt(startLoc); let { consequent, failed } = this.tryParseConditionalConsequent(); let [valid, invalid] = this.getArrowLikeExpressions(consequent); if (failed || invalid.length > 0) { const noArrowAt = [...originalNoArrowAt]; if (invalid.length > 0) { this.state = state; this.state.noArrowAt = noArrowAt; for (let i = 0; i < invalid.length; i++) { noArrowAt.push(invalid[i].start); } ({ consequent, failed } = this.tryParseConditionalConsequent()); [valid, invalid] = this.getArrowLikeExpressions(consequent); } if (failed && valid.length > 1) { this.raise(FlowErrors.AmbiguousConditionalArrow, state.startLoc); } if (failed && valid.length === 1) { this.state = state; noArrowAt.push(valid[0].start); this.state.noArrowAt = noArrowAt; ({ consequent, failed } = this.tryParseConditionalConsequent()); } } this.getArrowLikeExpressions(consequent, true); this.state.noArrowAt = originalNoArrowAt; this.expect(14); node.test = expr; node.consequent = consequent; node.alternate = this.forwardNoArrowParamsConversionAt(node, () => this.parseMaybeAssign(undefined, undefined)); return this.finishNode(node, "ConditionalExpression"); } tryParseConditionalConsequent() { this.state.noArrowParamsConversionAt.push(this.state.start); const consequent = this.parseMaybeAssignAllowIn(); const failed = !this.match(14); this.state.noArrowParamsConversionAt.pop(); return { consequent, failed }; } getArrowLikeExpressions(node, disallowInvalid) { const stack = [node]; const arrows = []; while (stack.length !== 0) { const node = stack.pop(); if (node.type === "ArrowFunctionExpression" && node.body.type !== "BlockStatement") { if (node.typeParameters || !node.returnType) { this.finishArrowValidation(node); } else { arrows.push(node); } stack.push(node.body); } else if (node.type === "ConditionalExpression") { stack.push(node.consequent); stack.push(node.alternate); } } if (disallowInvalid) { arrows.forEach(node => this.finishArrowValidation(node)); return [arrows, []]; } return partition(arrows, node => node.params.every(param => this.isAssignable(param, true))); } finishArrowValidation(node) { var _node$extra; this.toAssignableList(node.params, (_node$extra = node.extra) == null ? void 0 : _node$extra.trailingCommaLoc, false); this.scope.enter(2 | 4); super.checkParams(node, false, true); this.scope.exit(); } forwardNoArrowParamsConversionAt(node, parse) { let result; if (this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(node.start))) { this.state.noArrowParamsConversionAt.push(this.state.start); result = parse(); this.state.noArrowParamsConversionAt.pop(); } else { result = parse(); } return result; } parseParenItem(node, startLoc) { const newNode = super.parseParenItem(node, startLoc); if (this.eat(17)) { newNode.optional = true; this.resetEndLocation(node); } if (this.match(14)) { const typeCastNode = this.startNodeAt(startLoc); typeCastNode.expression = newNode; typeCastNode.typeAnnotation = this.flowParseTypeAnnotation(); return this.finishNode(typeCastNode, "TypeCastExpression"); } return newNode; } assertModuleNodeAllowed(node) { if (node.type === "ImportDeclaration" && (node.importKind === "type" || node.importKind === "typeof") || node.type === "ExportNamedDeclaration" && node.exportKind === "type" || node.type === "ExportAllDeclaration" && node.exportKind === "type") { return; } super.assertModuleNodeAllowed(node); } parseExportDeclaration(node) { if (this.isContextual(130)) { node.exportKind = "type"; const declarationNode = this.startNode(); this.next(); if (this.match(5)) { node.specifiers = this.parseExportSpecifiers(true); super.parseExportFrom(node); return null; } else { return this.flowParseTypeAlias(declarationNode); } } else if (this.isContextual(131)) { node.exportKind = "type"; const declarationNode = this.startNode(); this.next(); return this.flowParseOpaqueType(declarationNode, false); } else if (this.isContextual(129)) { node.exportKind = "type"; const declarationNode = this.startNode(); this.next(); return this.flowParseInterface(declarationNode); } else if (this.isContextual(126)) { node.exportKind = "value"; const declarationNode = this.startNode(); this.next(); return this.flowParseEnumDeclaration(declarationNode); } else { return super.parseExportDeclaration(node); } } eatExportStar(node) { if (super.eatExportStar(node)) return true; if (this.isContextual(130) && this.lookahead().type === 55) { node.exportKind = "type"; this.next(); this.next(); return true; } return false; } maybeParseExportNamespaceSpecifier(node) { const { startLoc } = this.state; const hasNamespace = super.maybeParseExportNamespaceSpecifier(node); if (hasNamespace && node.exportKind === "type") { this.unexpected(startLoc); } return hasNamespace; } parseClassId(node, isStatement, optionalId) { super.parseClassId(node, isStatement, optionalId); if (this.match(47)) { node.typeParameters = this.flowParseTypeParameterDeclaration(); } } parseClassMember(classBody, member, state) { const { startLoc } = this.state; if (this.isContextual(125)) { if (super.parseClassMemberFromModifier(classBody, member)) { return; } member.declare = true; } super.parseClassMember(classBody, member, state); if (member.declare) { if (member.type !== "ClassProperty" && member.type !== "ClassPrivateProperty" && member.type !== "PropertyDefinition") { this.raise(FlowErrors.DeclareClassElement, startLoc); } else if (member.value) { this.raise(FlowErrors.DeclareClassFieldInitializer, member.value); } } } isIterator(word) { return word === "iterator" || word === "asyncIterator"; } readIterator() { const word = super.readWord1(); const fullWord = "@@" + word; if (!this.isIterator(word) || !this.state.inType) { this.raise(Errors.InvalidIdentifier, this.state.curPosition(), { identifierName: fullWord }); } this.finishToken(132, fullWord); } getTokenFromCode(code) { const next = this.input.charCodeAt(this.state.pos + 1); if (code === 123 && next === 124) { this.finishOp(6, 2); } else if (this.state.inType && (code === 62 || code === 60)) { this.finishOp(code === 62 ? 48 : 47, 1); } else if (this.state.inType && code === 63) { if (next === 46) { this.finishOp(18, 2); } else { this.finishOp(17, 1); } } else if (isIteratorStart(code, next, this.input.charCodeAt(this.state.pos + 2))) { this.state.pos += 2; this.readIterator(); } else { super.getTokenFromCode(code); } } isAssignable(node, isBinding) { if (node.type === "TypeCastExpression") { return this.isAssignable(node.expression, isBinding); } else { return super.isAssignable(node, isBinding); } } toAssignable(node, isLHS = false) { if (!isLHS && node.type === "AssignmentExpression" && node.left.type === "TypeCastExpression") { node.left = this.typeCastToParameter(node.left); } super.toAssignable(node, isLHS); } toAssignableList(exprList, trailingCommaLoc, isLHS) { for (let i = 0; i < exprList.length; i++) { const expr = exprList[i]; if ((expr == null ? void 0 : expr.type) === "TypeCastExpression") { exprList[i] = this.typeCastToParameter(expr); } } super.toAssignableList(exprList, trailingCommaLoc, isLHS); } toReferencedList(exprList, isParenthesizedExpr) { for (let i = 0; i < exprList.length; i++) { var _expr$extra; const expr = exprList[i]; if (expr && expr.type === "TypeCastExpression" && !((_expr$extra = expr.extra) != null && _expr$extra.parenthesized) && (exprList.length > 1 || !isParenthesizedExpr)) { this.raise(FlowErrors.TypeCastInPattern, expr.typeAnnotation); } } return exprList; } parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) { const node = super.parseArrayLike(close, canBePattern, isTuple, refExpressionErrors); if (canBePattern && !this.state.maybeInArrowParameters) { this.toReferencedList(node.elements); } return node; } isValidLVal(type, isParenthesized, binding) { return type === "TypeCastExpression" || super.isValidLVal(type, isParenthesized, binding); } parseClassProperty(node) { if (this.match(14)) { node.typeAnnotation = this.flowParseTypeAnnotation(); } return super.parseClassProperty(node); } parseClassPrivateProperty(node) { if (this.match(14)) { node.typeAnnotation = this.flowParseTypeAnnotation(); } return super.parseClassPrivateProperty(node); } isClassMethod() { return this.match(47) || super.isClassMethod(); } isClassProperty() { return this.match(14) || super.isClassProperty(); } isNonstaticConstructor(method) { return !this.match(14) && super.isNonstaticConstructor(method); } pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { if (method.variance) { this.unexpected(method.variance.loc.start); } delete method.variance; if (this.match(47)) { method.typeParameters = this.flowParseTypeParameterDeclaration(); } super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper); if (method.params && isConstructor) { const params = method.params; if (params.length > 0 && this.isThisParam(params[0])) { this.raise(FlowErrors.ThisParamBannedInConstructor, method); } } else if (method.type === "MethodDefinition" && isConstructor && method.value.params) { const params = method.value.params; if (params.length > 0 && this.isThisParam(params[0])) { this.raise(FlowErrors.ThisParamBannedInConstructor, method); } } } pushClassPrivateMethod(classBody, method, isGenerator, isAsync) { if (method.variance) { this.unexpected(method.variance.loc.start); } delete method.variance; if (this.match(47)) { method.typeParameters = this.flowParseTypeParameterDeclaration(); } super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync); } parseClassSuper(node) { super.parseClassSuper(node); if (node.superClass && this.match(47)) { node.superTypeParameters = this.flowParseTypeParameterInstantiation(); } if (this.isContextual(113)) { this.next(); const implemented = node.implements = []; do { const node = this.startNode(); node.id = this.flowParseRestrictedIdentifier(true); if (this.match(47)) { node.typeParameters = this.flowParseTypeParameterInstantiation(); } else { node.typeParameters = null; } implemented.push(this.finishNode(node, "ClassImplements")); } while (this.eat(12)); } } checkGetterSetterParams(method) { super.checkGetterSetterParams(method); const params = this.getObjectOrClassMethodParams(method); if (params.length > 0) { const param = params[0]; if (this.isThisParam(param) && method.kind === "get") { this.raise(FlowErrors.GetterMayNotHaveThisParam, param); } else if (this.isThisParam(param)) { this.raise(FlowErrors.SetterMayNotHaveThisParam, param); } } } parsePropertyNamePrefixOperator(node) { node.variance = this.flowParseVariance(); } parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) { if (prop.variance) { this.unexpected(prop.variance.loc.start); } delete prop.variance; let typeParameters; if (this.match(47) && !isAccessor) { typeParameters = this.flowParseTypeParameterDeclaration(); if (!this.match(10)) this.unexpected(); } const result = super.parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors); if (typeParameters) { (result.value || result).typeParameters = typeParameters; } return result; } parseFunctionParamType(param) { if (this.eat(17)) { if (param.type !== "Identifier") { this.raise(FlowErrors.PatternIsOptional, param); } if (this.isThisParam(param)) { this.raise(FlowErrors.ThisParamMayNotBeOptional, param); } param.optional = true; } if (this.match(14)) { param.typeAnnotation = this.flowParseTypeAnnotation(); } else if (this.isThisParam(param)) { this.raise(FlowErrors.ThisParamAnnotationRequired, param); } if (this.match(29) && this.isThisParam(param)) { this.raise(FlowErrors.ThisParamNoDefault, param); } this.resetEndLocation(param); return param; } parseMaybeDefault(startLoc, left) { const node = super.parseMaybeDefault(startLoc, left); if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) { this.raise(FlowErrors.TypeBeforeInitializer, node.typeAnnotation); } return node; } checkImportReflection(node) { super.checkImportReflection(node); if (node.module && node.importKind !== "value") { this.raise(FlowErrors.ImportReflectionHasImportType, node.specifiers[0].loc.start); } } parseImportSpecifierLocal(node, specifier, type) { specifier.local = hasTypeImportKind(node) ? this.flowParseRestrictedIdentifier(true, true) : this.parseIdentifier(); node.specifiers.push(this.finishImportSpecifier(specifier, type)); } isPotentialImportPhase(isExport) { if (super.isPotentialImportPhase(isExport)) return true; if (this.isContextual(130)) { if (!isExport) return true; const ch = this.lookaheadCharCode(); return ch === 123 || ch === 42; } return !isExport && this.isContextual(87); } applyImportPhase(node, isExport, phase, loc) { super.applyImportPhase(node, isExport, phase, loc); if (isExport) { if (!phase && this.match(65)) { return; } node.exportKind = phase === "type" ? phase : "value"; } else { if (phase === "type" && this.match(55)) this.unexpected(); node.importKind = phase === "type" || phase === "typeof" ? phase : "value"; } } parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, bindingType) { const firstIdent = specifier.imported; let specifierTypeKind = null; if (firstIdent.type === "Identifier") { if (firstIdent.name === "type") { specifierTypeKind = "type"; } else if (firstIdent.name === "typeof") { specifierTypeKind = "typeof"; } } let isBinding = false; if (this.isContextual(93) && !this.isLookaheadContextual("as")) { const as_ident = this.parseIdentifier(true); if (specifierTypeKind !== null && !tokenIsKeywordOrIdentifier(this.state.type)) { specifier.imported = as_ident; specifier.importKind = specifierTypeKind; specifier.local = cloneIdentifier(as_ident); } else { specifier.imported = firstIdent; specifier.importKind = null; specifier.local = this.parseIdentifier(); } } else { if (specifierTypeKind !== null && tokenIsKeywordOrIdentifier(this.state.type)) { specifier.imported = this.parseIdentifier(true); specifier.importKind = specifierTypeKind; } else { if (importedIsString) { throw this.raise(Errors.ImportBindingIsString, specifier, { importName: firstIdent.value }); } specifier.imported = firstIdent; specifier.importKind = null; } if (this.eatContextual(93)) { specifier.local = this.parseIdentifier(); } else { isBinding = true; specifier.local = cloneIdentifier(specifier.imported); } } const specifierIsTypeImport = hasTypeImportKind(specifier); if (isInTypeOnlyImport && specifierIsTypeImport) { this.raise(FlowErrors.ImportTypeShorthandOnlyInPureImport, specifier); } if (isInTypeOnlyImport || specifierIsTypeImport) { this.checkReservedType(specifier.local.name, specifier.local.loc.start, true); } if (isBinding && !isInTypeOnlyImport && !specifierIsTypeImport) { this.checkReservedWord(specifier.local.name, specifier.loc.start, true, true); } return this.finishImportSpecifier(specifier, "ImportSpecifier"); } parseBindingAtom() { switch (this.state.type) { case 78: return this.parseIdentifier(true); default: return super.parseBindingAtom(); } } parseFunctionParams(node, isConstructor) { const kind = node.kind; if (kind !== "get" && kind !== "set" && this.match(47)) { node.typeParameters = this.flowParseTypeParameterDeclaration(); } super.parseFunctionParams(node, isConstructor); } parseVarId(decl, kind) { super.parseVarId(decl, kind); if (this.match(14)) { decl.id.typeAnnotation = this.flowParseTypeAnnotation(); this.resetEndLocation(decl.id); } } parseAsyncArrowFromCallExpression(node, call) { if (this.match(14)) { const oldNoAnonFunctionType = this.state.noAnonFunctionType; this.state.noAnonFunctionType = true; node.returnType = this.flowParseTypeAnnotation(); this.state.noAnonFunctionType = oldNoAnonFunctionType; } return super.parseAsyncArrowFromCallExpression(node, call); } shouldParseAsyncArrow() { return this.match(14) || super.shouldParseAsyncArrow(); } parseMaybeAssign(refExpressionErrors, afterLeftParse) { var _jsx; let state = null; let jsx; if (this.hasPlugin("jsx") && (this.match(143) || this.match(47))) { state = this.state.clone(); jsx = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state); if (!jsx.error) return jsx.node; const { context } = this.state; const currentContext = context[context.length - 1]; if (currentContext === types.j_oTag || currentContext === types.j_expr) { context.pop(); } } if ((_jsx = jsx) != null && _jsx.error || this.match(47)) { var _jsx2, _jsx3; state = state || this.state.clone(); let typeParameters; const arrow = this.tryParse(abort => { var _arrowExpression$extr; typeParameters = this.flowParseTypeParameterDeclaration(); const arrowExpression = this.forwardNoArrowParamsConversionAt(typeParameters, () => { const result = super.parseMaybeAssign(refExpressionErrors, afterLeftParse); this.resetStartLocationFromNode(result, typeParameters); return result; }); if ((_arrowExpression$extr = arrowExpression.extra) != null && _arrowExpression$extr.parenthesized) abort(); const expr = this.maybeUnwrapTypeCastExpression(arrowExpression); if (expr.type !== "ArrowFunctionExpression") abort(); expr.typeParameters = typeParameters; this.resetStartLocationFromNode(expr, typeParameters); return arrowExpression; }, state); let arrowExpression = null; if (arrow.node && this.maybeUnwrapTypeCastExpression(arrow.node).type === "ArrowFunctionExpression") { if (!arrow.error && !arrow.aborted) { if (arrow.node.async) { this.raise(FlowErrors.UnexpectedTypeParameterBeforeAsyncArrowFunction, typeParameters); } return arrow.node; } arrowExpression = arrow.node; } if ((_jsx2 = jsx) != null && _jsx2.node) { this.state = jsx.failState; return jsx.node; } if (arrowExpression) { this.state = arrow.failState; return arrowExpression; } if ((_jsx3 = jsx) != null && _jsx3.thrown) throw jsx.error; if (arrow.thrown) throw arrow.error; throw this.raise(FlowErrors.UnexpectedTokenAfterTypeParameter, typeParameters); } return super.parseMaybeAssign(refExpressionErrors, afterLeftParse); } parseArrow(node) { if (this.match(14)) { const result = this.tryParse(() => { const oldNoAnonFunctionType = this.state.noAnonFunctionType; this.state.noAnonFunctionType = true; const typeNode = this.startNode(); [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); this.state.noAnonFunctionType = oldNoAnonFunctionType; if (this.canInsertSemicolon()) this.unexpected(); if (!this.match(19)) this.unexpected(); return typeNode; }); if (result.thrown) return null; if (result.error) this.state = result.failState; node.returnType = result.node.typeAnnotation ? this.finishNode(result.node, "TypeAnnotation") : null; } return super.parseArrow(node); } shouldParseArrow(params) { return this.match(14) || super.shouldParseArrow(params); } setArrowFunctionParameters(node, params) { if (this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(node.start))) { node.params = params; } else { super.setArrowFunctionParameters(node, params); } } checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged = true) { if (isArrowFunction && this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(node.start))) { return; } for (let i = 0; i < node.params.length; i++) { if (this.isThisParam(node.params[i]) && i > 0) { this.raise(FlowErrors.ThisParamMustBeFirst, node.params[i]); } } super.checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged); } parseParenAndDistinguishExpression(canBeArrow) { return super.parseParenAndDistinguishExpression(canBeArrow && !this.state.noArrowAt.includes(this.sourceToOffsetPos(this.state.start))); } parseSubscripts(base, startLoc, noCalls) { if (base.type === "Identifier" && base.name === "async" && this.state.noArrowAt.includes(startLoc.index)) { this.next(); const node = this.startNodeAt(startLoc); node.callee = base; node.arguments = super.parseCallExpressionArguments(11); base = this.finishNode(node, "CallExpression"); } else if (base.type === "Identifier" && base.name === "async" && this.match(47)) { const state = this.state.clone(); const arrow = this.tryParse(abort => this.parseAsyncArrowWithTypeParameters(startLoc) || abort(), state); if (!arrow.error && !arrow.aborted) return arrow.node; const result = this.tryParse(() => super.parseSubscripts(base, startLoc, noCalls), state); if (result.node && !result.error) return result.node; if (arrow.node) { this.state = arrow.failState; return arrow.node; } if (result.node) { this.state = result.failState; return result.node; } throw arrow.error || result.error; } return super.parseSubscripts(base, startLoc, noCalls); } parseSubscript(base, startLoc, noCalls, subscriptState) { if (this.match(18) && this.isLookaheadToken_lt()) { subscriptState.optionalChainMember = true; if (noCalls) { subscriptState.stop = true; return base; } this.next(); const node = this.startNodeAt(startLoc); node.callee = base; node.typeArguments = this.flowParseTypeParameterInstantiation(); this.expect(10); node.arguments = this.parseCallExpressionArguments(11); node.optional = true; return this.finishCallExpression(node, true); } else if (!noCalls && this.shouldParseTypes() && this.match(47)) { const node = this.startNodeAt(startLoc); node.callee = base; const result = this.tryParse(() => { node.typeArguments = this.flowParseTypeParameterInstantiationCallOrNew(); this.expect(10); node.arguments = super.parseCallExpressionArguments(11); if (subscriptState.optionalChainMember) { node.optional = false; } return this.finishCallExpression(node, subscriptState.optionalChainMember); }); if (result.node) { if (result.error) this.state = result.failState; return result.node; } } return super.parseSubscript(base, startLoc, noCalls, subscriptState); } parseNewCallee(node) { super.parseNewCallee(node); let targs = null; if (this.shouldParseTypes() && this.match(47)) { targs = this.tryParse(() => this.flowParseTypeParameterInstantiationCallOrNew()).node; } node.typeArguments = targs; } parseAsyncArrowWithTypeParameters(startLoc) { const node = this.startNodeAt(startLoc); this.parseFunctionParams(node, false); if (!this.parseArrow(node)) return; return super.parseArrowExpression(node, undefined, true); } readToken_mult_modulo(code) { const next = this.input.charCodeAt(this.state.pos + 1); if (code === 42 && next === 47 && this.state.hasFlowComment) { this.state.hasFlowComment = false; this.state.pos += 2; this.nextToken(); return; } super.readToken_mult_modulo(code); } readToken_pipe_amp(code) { const next = this.input.charCodeAt(this.state.pos + 1); if (code === 124 && next === 125) { this.finishOp(9, 2); return; } super.readToken_pipe_amp(code); } parseTopLevel(file, program) { const fileNode = super.parseTopLevel(file, program); if (this.state.hasFlowComment) { this.raise(FlowErrors.UnterminatedFlowComment, this.state.curPosition()); } return fileNode; } skipBlockComment() { if (this.hasPlugin("flowComments") && this.skipFlowComment()) { if (this.state.hasFlowComment) { throw this.raise(FlowErrors.NestedFlowComment, this.state.startLoc); } this.hasFlowCommentCompletion(); const commentSkip = this.skipFlowComment(); if (commentSkip) { this.state.pos += commentSkip; this.state.hasFlowComment = true; } return; } return super.skipBlockComment(this.state.hasFlowComment ? "*-/" : "*/"); } skipFlowComment() { const { pos } = this.state; let shiftToFirstNonWhiteSpace = 2; while ([32, 9].includes(this.input.charCodeAt(pos + shiftToFirstNonWhiteSpace))) { shiftToFirstNonWhiteSpace++; } const ch2 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos); const ch3 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos + 1); if (ch2 === 58 && ch3 === 58) { return shiftToFirstNonWhiteSpace + 2; } if (this.input.slice(shiftToFirstNonWhiteSpace + pos, shiftToFirstNonWhiteSpace + pos + 12) === "flow-include") { return shiftToFirstNonWhiteSpace + 12; } if (ch2 === 58 && ch3 !== 58) { return shiftToFirstNonWhiteSpace; } return false; } hasFlowCommentCompletion() { const end = this.input.indexOf("*/", this.state.pos); if (end === -1) { throw this.raise(Errors.UnterminatedComment, this.state.curPosition()); } } flowEnumErrorBooleanMemberNotInitialized(loc, { enumName, memberName }) { this.raise(FlowErrors.EnumBooleanMemberNotInitialized, loc, { memberName, enumName }); } flowEnumErrorInvalidMemberInitializer(loc, enumContext) { return this.raise(!enumContext.explicitType ? FlowErrors.EnumInvalidMemberInitializerUnknownType : enumContext.explicitType === "symbol" ? FlowErrors.EnumInvalidMemberInitializerSymbolType : FlowErrors.EnumInvalidMemberInitializerPrimaryType, loc, enumContext); } flowEnumErrorNumberMemberNotInitialized(loc, details) { this.raise(FlowErrors.EnumNumberMemberNotInitialized, loc, details); } flowEnumErrorStringMemberInconsistentlyInitialized(node, details) { this.raise(FlowErrors.EnumStringMemberInconsistentlyInitialized, node, details); } flowEnumMemberInit() { const startLoc = this.state.startLoc; const endOfInit = () => this.match(12) || this.match(8); switch (this.state.type) { case 135: { const literal = this.parseNumericLiteral(this.state.value); if (endOfInit()) { return { type: "number", loc: literal.loc.start, value: literal }; } return { type: "invalid", loc: startLoc }; } case 134: { const literal = this.parseStringLiteral(this.state.value); if (endOfInit()) { return { type: "string", loc: literal.loc.start, value: literal }; } return { type: "invalid", loc: startLoc }; } case 85: case 86: { const literal = this.parseBooleanLiteral(this.match(85)); if (endOfInit()) { return { type: "boolean", loc: literal.loc.start, value: literal }; } return { type: "invalid", loc: startLoc }; } default: return { type: "invalid", loc: startLoc }; } } flowEnumMemberRaw() { const loc = this.state.startLoc; const id = this.parseIdentifier(true); const init = this.eat(29) ? this.flowEnumMemberInit() : { type: "none", loc }; return { id, init }; } flowEnumCheckExplicitTypeMismatch(loc, context, expectedType) { const { explicitType } = context; if (explicitType === null) { return; } if (explicitType !== expectedType) { this.flowEnumErrorInvalidMemberInitializer(loc, context); } } flowEnumMembers({ enumName, explicitType }) { const seenNames = new Set(); const members = { booleanMembers: [], numberMembers: [], stringMembers: [], defaultedMembers: [] }; let hasUnknownMembers = false; while (!this.match(8)) { if (this.eat(21)) { hasUnknownMembers = true; break; } const memberNode = this.startNode(); const { id, init } = this.flowEnumMemberRaw(); const memberName = id.name; if (memberName === "") { continue; } if (/^[a-z]/.test(memberName)) { this.raise(FlowErrors.EnumInvalidMemberName, id, { memberName, suggestion: memberName[0].toUpperCase() + memberName.slice(1), enumName }); } if (seenNames.has(memberName)) { this.raise(FlowErrors.EnumDuplicateMemberName, id, { memberName, enumName }); } seenNames.add(memberName); const context = { enumName, explicitType, memberName }; memberNode.id = id; switch (init.type) { case "boolean": { this.flowEnumCheckExplicitTypeMismatch(init.loc, context, "boolean"); memberNode.init = init.value; members.booleanMembers.push(this.finishNode(memberNode, "EnumBooleanMember")); break; } case "number": { this.flowEnumCheckExplicitTypeMismatch(init.loc, context, "number"); memberNode.init = init.value; members.numberMembers.push(this.finishNode(memberNode, "EnumNumberMember")); break; } case "string": { this.flowEnumCheckExplicitTypeMismatch(init.loc, context, "string"); memberNode.init = init.value; members.stringMembers.push(this.finishNode(memberNode, "EnumStringMember")); break; } case "invalid": { throw this.flowEnumErrorInvalidMemberInitializer(init.loc, context); } case "none": { switch (explicitType) { case "boolean": this.flowEnumErrorBooleanMemberNotInitialized(init.loc, context); break; case "number": this.flowEnumErrorNumberMemberNotInitialized(init.loc, context); break; default: members.defaultedMembers.push(this.finishNode(memberNode, "EnumDefaultedMember")); } } } if (!this.match(8)) { this.expect(12); } } return { members, hasUnknownMembers }; } flowEnumStringMembers(initializedMembers, defaultedMembers, { enumName }) { if (initializedMembers.length === 0) { return defaultedMembers; } else if (defaultedMembers.length === 0) { return initializedMembers; } else if (defaultedMembers.length > initializedMembers.length) { for (const member of initializedMembers) { this.flowEnumErrorStringMemberInconsistentlyInitialized(member, { enumName }); } return defaultedMembers; } else { for (const member of defaultedMembers) { this.flowEnumErrorStringMemberInconsistentlyInitialized(member, { enumName }); } return initializedMembers; } } flowEnumParseExplicitType({ enumName }) { if (!this.eatContextual(102)) return null; if (!tokenIsIdentifier(this.state.type)) { throw this.raise(FlowErrors.EnumInvalidExplicitTypeUnknownSupplied, this.state.startLoc, { enumName }); } const { value } = this.state; this.next(); if (value !== "boolean" && value !== "number" && value !== "string" && value !== "symbol") { this.raise(FlowErrors.EnumInvalidExplicitType, this.state.startLoc, { enumName, invalidEnumType: value }); } return value; } flowEnumBody(node, id) { const enumName = id.name; const nameLoc = id.loc.start; const explicitType = this.flowEnumParseExplicitType({ enumName }); this.expect(5); const { members, hasUnknownMembers } = this.flowEnumMembers({ enumName, explicitType }); node.hasUnknownMembers = hasUnknownMembers; switch (explicitType) { case "boolean": node.explicitType = true; node.members = members.booleanMembers; this.expect(8); return this.finishNode(node, "EnumBooleanBody"); case "number": node.explicitType = true; node.members = members.numberMembers; this.expect(8); return this.finishNode(node, "EnumNumberBody"); case "string": node.explicitType = true; node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, { enumName }); this.expect(8); return this.finishNode(node, "EnumStringBody"); case "symbol": node.members = members.defaultedMembers; this.expect(8); return this.finishNode(node, "EnumSymbolBody"); default: { const empty = () => { node.members = []; this.expect(8); return this.finishNode(node, "EnumStringBody"); }; node.explicitType = false; const boolsLen = members.booleanMembers.length; const numsLen = members.numberMembers.length; const strsLen = members.stringMembers.length; const defaultedLen = members.defaultedMembers.length; if (!boolsLen && !numsLen && !strsLen && !defaultedLen) { return empty(); } else if (!boolsLen && !numsLen) { node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, { enumName }); this.expect(8); return this.finishNode(node, "EnumStringBody"); } else if (!numsLen && !strsLen && boolsLen >= defaultedLen) { for (const member of members.defaultedMembers) { this.flowEnumErrorBooleanMemberNotInitialized(member.loc.start, { enumName, memberName: member.id.name }); } node.members = members.booleanMembers; this.expect(8); return this.finishNode(node, "EnumBooleanBody"); } else if (!boolsLen && !strsLen && numsLen >= defaultedLen) { for (const member of members.defaultedMembers) { this.flowEnumErrorNumberMemberNotInitialized(member.loc.start, { enumName, memberName: member.id.name }); } node.members = members.numberMembers; this.expect(8); return this.finishNode(node, "EnumNumberBody"); } else { this.raise(FlowErrors.EnumInconsistentMemberValues, nameLoc, { enumName }); return empty(); } } } } flowParseEnumDeclaration(node) { const id = this.parseIdentifier(); node.id = id; node.body = this.flowEnumBody(this.startNode(), id); return this.finishNode(node, "EnumDeclaration"); } isLookaheadToken_lt() { const next = this.nextTokenStart(); if (this.input.charCodeAt(next) === 60) { const afterNext = this.input.charCodeAt(next + 1); return afterNext !== 60 && afterNext !== 61; } return false; } maybeUnwrapTypeCastExpression(node) { return node.type === "TypeCastExpression" ? node.expression : node; } }; const entities = { __proto__: null, quot: "\u0022", amp: "&", apos: "\u0027", lt: "<", gt: ">", nbsp: "\u00A0", iexcl: "\u00A1", cent: "\u00A2", pound: "\u00A3", curren: "\u00A4", yen: "\u00A5", brvbar: "\u00A6", sect: "\u00A7", uml: "\u00A8", copy: "\u00A9", ordf: "\u00AA", laquo: "\u00AB", not: "\u00AC", shy: "\u00AD", reg: "\u00AE", macr: "\u00AF", deg: "\u00B0", plusmn: "\u00B1", sup2: "\u00B2", sup3: "\u00B3", acute: "\u00B4", micro: "\u00B5", para: "\u00B6", middot: "\u00B7", cedil: "\u00B8", sup1: "\u00B9", ordm: "\u00BA", raquo: "\u00BB", frac14: "\u00BC", frac12: "\u00BD", frac34: "\u00BE", iquest: "\u00BF", Agrave: "\u00C0", Aacute: "\u00C1", Acirc: "\u00C2", Atilde: "\u00C3", Auml: "\u00C4", Aring: "\u00C5", AElig: "\u00C6", Ccedil: "\u00C7", Egrave: "\u00C8", Eacute: "\u00C9", Ecirc: "\u00CA", Euml: "\u00CB", Igrave: "\u00CC", Iacute: "\u00CD", Icirc: "\u00CE", Iuml: "\u00CF", ETH: "\u00D0", Ntilde: "\u00D1", Ograve: "\u00D2", Oacute: "\u00D3", Ocirc: "\u00D4", Otilde: "\u00D5", Ouml: "\u00D6", times: "\u00D7", Oslash: "\u00D8", Ugrave: "\u00D9", Uacute: "\u00DA", Ucirc: "\u00DB", Uuml: "\u00DC", Yacute: "\u00DD", THORN: "\u00DE", szlig: "\u00DF", agrave: "\u00E0", aacute: "\u00E1", acirc: "\u00E2", atilde: "\u00E3", auml: "\u00E4", aring: "\u00E5", aelig: "\u00E6", ccedil: "\u00E7", egrave: "\u00E8", eacute: "\u00E9", ecirc: "\u00EA", euml: "\u00EB", igrave: "\u00EC", iacute: "\u00ED", icirc: "\u00EE", iuml: "\u00EF", eth: "\u00F0", ntilde: "\u00F1", ograve: "\u00F2", oacute: "\u00F3", ocirc: "\u00F4", otilde: "\u00F5", ouml: "\u00F6", divide: "\u00F7", oslash: "\u00F8", ugrave: "\u00F9", uacute: "\u00FA", ucirc: "\u00FB", uuml: "\u00FC", yacute: "\u00FD", thorn: "\u00FE", yuml: "\u00FF", OElig: "\u0152", oelig: "\u0153", Scaron: "\u0160", scaron: "\u0161", Yuml: "\u0178", fnof: "\u0192", circ: "\u02C6", tilde: "\u02DC", Alpha: "\u0391", Beta: "\u0392", Gamma: "\u0393", Delta: "\u0394", Epsilon: "\u0395", Zeta: "\u0396", Eta: "\u0397", Theta: "\u0398", Iota: "\u0399", Kappa: "\u039A", Lambda: "\u039B", Mu: "\u039C", Nu: "\u039D", Xi: "\u039E", Omicron: "\u039F", Pi: "\u03A0", Rho: "\u03A1", Sigma: "\u03A3", Tau: "\u03A4", Upsilon: "\u03A5", Phi: "\u03A6", Chi: "\u03A7", Psi: "\u03A8", Omega: "\u03A9", alpha: "\u03B1", beta: "\u03B2", gamma: "\u03B3", delta: "\u03B4", epsilon: "\u03B5", zeta: "\u03B6", eta: "\u03B7", theta: "\u03B8", iota: "\u03B9", kappa: "\u03BA", lambda: "\u03BB", mu: "\u03BC", nu: "\u03BD", xi: "\u03BE", omicron: "\u03BF", pi: "\u03C0", rho: "\u03C1", sigmaf: "\u03C2", sigma: "\u03C3", tau: "\u03C4", upsilon: "\u03C5", phi: "\u03C6", chi: "\u03C7", psi: "\u03C8", omega: "\u03C9", thetasym: "\u03D1", upsih: "\u03D2", piv: "\u03D6", ensp: "\u2002", emsp: "\u2003", thinsp: "\u2009", zwnj: "\u200C", zwj: "\u200D", lrm: "\u200E", rlm: "\u200F", ndash: "\u2013", mdash: "\u2014", lsquo: "\u2018", rsquo: "\u2019", sbquo: "\u201A", ldquo: "\u201C", rdquo: "\u201D", bdquo: "\u201E", dagger: "\u2020", Dagger: "\u2021", bull: "\u2022", hellip: "\u2026", permil: "\u2030", prime: "\u2032", Prime: "\u2033", lsaquo: "\u2039", rsaquo: "\u203A", oline: "\u203E", frasl: "\u2044", euro: "\u20AC", image: "\u2111", weierp: "\u2118", real: "\u211C", trade: "\u2122", alefsym: "\u2135", larr: "\u2190", uarr: "\u2191", rarr: "\u2192", darr: "\u2193", harr: "\u2194", crarr: "\u21B5", lArr: "\u21D0", uArr: "\u21D1", rArr: "\u21D2", dArr: "\u21D3", hArr: "\u21D4", forall: "\u2200", part: "\u2202", exist: "\u2203", empty: "\u2205", nabla: "\u2207", isin: "\u2208", notin: "\u2209", ni: "\u220B", prod: "\u220F", sum: "\u2211", minus: "\u2212", lowast: "\u2217", radic: "\u221A", prop: "\u221D", infin: "\u221E", ang: "\u2220", and: "\u2227", or: "\u2228", cap: "\u2229", cup: "\u222A", int: "\u222B", there4: "\u2234", sim: "\u223C", cong: "\u2245", asymp: "\u2248", ne: "\u2260", equiv: "\u2261", le: "\u2264", ge: "\u2265", sub: "\u2282", sup: "\u2283", nsub: "\u2284", sube: "\u2286", supe: "\u2287", oplus: "\u2295", otimes: "\u2297", perp: "\u22A5", sdot: "\u22C5", lceil: "\u2308", rceil: "\u2309", lfloor: "\u230A", rfloor: "\u230B", lang: "\u2329", rang: "\u232A", loz: "\u25CA", spades: "\u2660", clubs: "\u2663", hearts: "\u2665", diams: "\u2666" }; const JsxErrors = ParseErrorEnum`jsx`({ AttributeIsEmpty: "JSX attributes must only be assigned a non-empty expression.", MissingClosingTagElement: ({ openingTagName }) => `Expected corresponding JSX closing tag for <${openingTagName}>.`, MissingClosingTagFragment: "Expected corresponding JSX closing tag for <>.", UnexpectedSequenceExpression: "Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?", UnexpectedToken: ({ unexpected, HTMLEntity }) => `Unexpected token \`${unexpected}\`. Did you mean \`${HTMLEntity}\` or \`{'${unexpected}'}\`?`, UnsupportedJsxValue: "JSX value should be either an expression or a quoted JSX text.", UnterminatedJsxContent: "Unterminated JSX contents.", UnwrappedAdjacentJSXElements: "Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?" }); function isFragment(object) { return object ? object.type === "JSXOpeningFragment" || object.type === "JSXClosingFragment" : false; } function getQualifiedJSXName(object) { if (object.type === "JSXIdentifier") { return object.name; } if (object.type === "JSXNamespacedName") { return object.namespace.name + ":" + object.name.name; } if (object.type === "JSXMemberExpression") { return getQualifiedJSXName(object.object) + "." + getQualifiedJSXName(object.property); } throw new Error("Node had unexpected type: " + object.type); } var jsx = superClass => class JSXParserMixin extends superClass { jsxReadToken() { let out = ""; let chunkStart = this.state.pos; for (;;) { if (this.state.pos >= this.length) { throw this.raise(JsxErrors.UnterminatedJsxContent, this.state.startLoc); } const ch = this.input.charCodeAt(this.state.pos); switch (ch) { case 60: case 123: if (this.state.pos === this.state.start) { if (ch === 60 && this.state.canStartJSXElement) { ++this.state.pos; this.finishToken(143); } else { super.getTokenFromCode(ch); } return; } out += this.input.slice(chunkStart, this.state.pos); this.finishToken(142, out); return; case 38: out += this.input.slice(chunkStart, this.state.pos); out += this.jsxReadEntity(); chunkStart = this.state.pos; break; case 62: case 125: default: if (isNewLine(ch)) { out += this.input.slice(chunkStart, this.state.pos); out += this.jsxReadNewLine(true); chunkStart = this.state.pos; } else { ++this.state.pos; } } } } jsxReadNewLine(normalizeCRLF) { const ch = this.input.charCodeAt(this.state.pos); let out; ++this.state.pos; if (ch === 13 && this.input.charCodeAt(this.state.pos) === 10) { ++this.state.pos; out = normalizeCRLF ? "\n" : "\r\n"; } else { out = String.fromCharCode(ch); } ++this.state.curLine; this.state.lineStart = this.state.pos; return out; } jsxReadString(quote) { let out = ""; let chunkStart = ++this.state.pos; for (;;) { if (this.state.pos >= this.length) { throw this.raise(Errors.UnterminatedString, this.state.startLoc); } const ch = this.input.charCodeAt(this.state.pos); if (ch === quote) break; if (ch === 38) { out += this.input.slice(chunkStart, this.state.pos); out += this.jsxReadEntity(); chunkStart = this.state.pos; } else if (isNewLine(ch)) { out += this.input.slice(chunkStart, this.state.pos); out += this.jsxReadNewLine(false); chunkStart = this.state.pos; } else { ++this.state.pos; } } out += this.input.slice(chunkStart, this.state.pos++); this.finishToken(134, out); } jsxReadEntity() { const startPos = ++this.state.pos; if (this.codePointAtPos(this.state.pos) === 35) { ++this.state.pos; let radix = 10; if (this.codePointAtPos(this.state.pos) === 120) { radix = 16; ++this.state.pos; } const codePoint = this.readInt(radix, undefined, false, "bail"); if (codePoint !== null && this.codePointAtPos(this.state.pos) === 59) { ++this.state.pos; return String.fromCodePoint(codePoint); } } else { let count = 0; let semi = false; while (count++ < 10 && this.state.pos < this.length && !(semi = this.codePointAtPos(this.state.pos) === 59)) { ++this.state.pos; } if (semi) { const desc = this.input.slice(startPos, this.state.pos); const entity = entities[desc]; ++this.state.pos; if (entity) { return entity; } } } this.state.pos = startPos; return "&"; } jsxReadWord() { let ch; const start = this.state.pos; do { ch = this.input.charCodeAt(++this.state.pos); } while (isIdentifierChar(ch) || ch === 45); this.finishToken(141, this.input.slice(start, this.state.pos)); } jsxParseIdentifier() { const node = this.startNode(); if (this.match(141)) { node.name = this.state.value; } else if (tokenIsKeyword(this.state.type)) { node.name = tokenLabelName(this.state.type); } else { this.unexpected(); } this.next(); return this.finishNode(node, "JSXIdentifier"); } jsxParseNamespacedName() { const startLoc = this.state.startLoc; const name = this.jsxParseIdentifier(); if (!this.eat(14)) return name; const node = this.startNodeAt(startLoc); node.namespace = name; node.name = this.jsxParseIdentifier(); return this.finishNode(node, "JSXNamespacedName"); } jsxParseElementName() { const startLoc = this.state.startLoc; let node = this.jsxParseNamespacedName(); if (node.type === "JSXNamespacedName") { return node; } while (this.eat(16)) { const newNode = this.startNodeAt(startLoc); newNode.object = node; newNode.property = this.jsxParseIdentifier(); node = this.finishNode(newNode, "JSXMemberExpression"); } return node; } jsxParseAttributeValue() { let node; switch (this.state.type) { case 5: node = this.startNode(); this.setContext(types.brace); this.next(); node = this.jsxParseExpressionContainer(node, types.j_oTag); if (node.expression.type === "JSXEmptyExpression") { this.raise(JsxErrors.AttributeIsEmpty, node); } return node; case 143: case 134: return this.parseExprAtom(); default: throw this.raise(JsxErrors.UnsupportedJsxValue, this.state.startLoc); } } jsxParseEmptyExpression() { const node = this.startNodeAt(this.state.lastTokEndLoc); return this.finishNodeAt(node, "JSXEmptyExpression", this.state.startLoc); } jsxParseSpreadChild(node) { this.next(); node.expression = this.parseExpression(); this.setContext(types.j_expr); this.state.canStartJSXElement = true; this.expect(8); return this.finishNode(node, "JSXSpreadChild"); } jsxParseExpressionContainer(node, previousContext) { if (this.match(8)) { node.expression = this.jsxParseEmptyExpression(); } else { const expression = this.parseExpression(); node.expression = expression; } this.setContext(previousContext); this.state.canStartJSXElement = true; this.expect(8); return this.finishNode(node, "JSXExpressionContainer"); } jsxParseAttribute() { const node = this.startNode(); if (this.match(5)) { this.setContext(types.brace); this.next(); this.expect(21); node.argument = this.parseMaybeAssignAllowIn(); this.setContext(types.j_oTag); this.state.canStartJSXElement = true; this.expect(8); return this.finishNode(node, "JSXSpreadAttribute"); } node.name = this.jsxParseNamespacedName(); node.value = this.eat(29) ? this.jsxParseAttributeValue() : null; return this.finishNode(node, "JSXAttribute"); } jsxParseOpeningElementAt(startLoc) { const node = this.startNodeAt(startLoc); if (this.eat(144)) { return this.finishNode(node, "JSXOpeningFragment"); } node.name = this.jsxParseElementName(); return this.jsxParseOpeningElementAfterName(node); } jsxParseOpeningElementAfterName(node) { const attributes = []; while (!this.match(56) && !this.match(144)) { attributes.push(this.jsxParseAttribute()); } node.attributes = attributes; node.selfClosing = this.eat(56); this.expect(144); return this.finishNode(node, "JSXOpeningElement"); } jsxParseClosingElementAt(startLoc) { const node = this.startNodeAt(startLoc); if (this.eat(144)) { return this.finishNode(node, "JSXClosingFragment"); } node.name = this.jsxParseElementName(); this.expect(144); return this.finishNode(node, "JSXClosingElement"); } jsxParseElementAt(startLoc) { const node = this.startNodeAt(startLoc); const children = []; const openingElement = this.jsxParseOpeningElementAt(startLoc); let closingElement = null; if (!openingElement.selfClosing) { contents: for (;;) { switch (this.state.type) { case 143: startLoc = this.state.startLoc; this.next(); if (this.eat(56)) { closingElement = this.jsxParseClosingElementAt(startLoc); break contents; } children.push(this.jsxParseElementAt(startLoc)); break; case 142: children.push(this.parseLiteral(this.state.value, "JSXText")); break; case 5: { const node = this.startNode(); this.setContext(types.brace); this.next(); if (this.match(21)) { children.push(this.jsxParseSpreadChild(node)); } else { children.push(this.jsxParseExpressionContainer(node, types.j_expr)); } break; } default: this.unexpected(); } } if (isFragment(openingElement) && !isFragment(closingElement) && closingElement !== null) { this.raise(JsxErrors.MissingClosingTagFragment, closingElement); } else if (!isFragment(openingElement) && isFragment(closingElement)) { this.raise(JsxErrors.MissingClosingTagElement, closingElement, { openingTagName: getQualifiedJSXName(openingElement.name) }); } else if (!isFragment(openingElement) && !isFragment(closingElement)) { if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) { this.raise(JsxErrors.MissingClosingTagElement, closingElement, { openingTagName: getQualifiedJSXName(openingElement.name) }); } } } if (isFragment(openingElement)) { node.openingFragment = openingElement; node.closingFragment = closingElement; } else { node.openingElement = openingElement; node.closingElement = closingElement; } node.children = children; if (this.match(47)) { throw this.raise(JsxErrors.UnwrappedAdjacentJSXElements, this.state.startLoc); } return isFragment(openingElement) ? this.finishNode(node, "JSXFragment") : this.finishNode(node, "JSXElement"); } jsxParseElement() { const startLoc = this.state.startLoc; this.next(); return this.jsxParseElementAt(startLoc); } setContext(newContext) { const { context } = this.state; context[context.length - 1] = newContext; } parseExprAtom(refExpressionErrors) { if (this.match(143)) { return this.jsxParseElement(); } else if (this.match(47) && this.input.charCodeAt(this.state.pos) !== 33) { this.replaceToken(143); return this.jsxParseElement(); } else { return super.parseExprAtom(refExpressionErrors); } } skipSpace() { const curContext = this.curContext(); if (!curContext.preserveSpace) super.skipSpace(); } getTokenFromCode(code) { const context = this.curContext(); if (context === types.j_expr) { this.jsxReadToken(); return; } if (context === types.j_oTag || context === types.j_cTag) { if (isIdentifierStart(code)) { this.jsxReadWord(); return; } if (code === 62) { ++this.state.pos; this.finishToken(144); return; } if ((code === 34 || code === 39) && context === types.j_oTag) { this.jsxReadString(code); return; } } if (code === 60 && this.state.canStartJSXElement && this.input.charCodeAt(this.state.pos + 1) !== 33) { ++this.state.pos; this.finishToken(143); return; } super.getTokenFromCode(code); } updateContext(prevType) { const { context, type } = this.state; if (type === 56 && prevType === 143) { context.splice(-2, 2, types.j_cTag); this.state.canStartJSXElement = false; } else if (type === 143) { context.push(types.j_oTag); } else if (type === 144) { const out = context[context.length - 1]; if (out === types.j_oTag && prevType === 56 || out === types.j_cTag) { context.pop(); this.state.canStartJSXElement = context[context.length - 1] === types.j_expr; } else { this.setContext(types.j_expr); this.state.canStartJSXElement = true; } } else { this.state.canStartJSXElement = tokenComesBeforeExpression(type); } } }; class TypeScriptScope extends Scope { constructor(...args) { super(...args); this.tsNames = new Map(); } } class TypeScriptScopeHandler extends ScopeHandler { constructor(...args) { super(...args); this.importsStack = []; } createScope(flags) { this.importsStack.push(new Set()); return new TypeScriptScope(flags); } enter(flags) { if (flags === 256) { this.importsStack.push(new Set()); } super.enter(flags); } exit() { const flags = super.exit(); if (flags === 256) { this.importsStack.pop(); } return flags; } hasImport(name, allowShadow) { const len = this.importsStack.length; if (this.importsStack[len - 1].has(name)) { return true; } if (!allowShadow && len > 1) { for (let i = 0; i < len - 1; i++) { if (this.importsStack[i].has(name)) return true; } } return false; } declareName(name, bindingType, loc) { if (bindingType & 4096) { if (this.hasImport(name, true)) { this.parser.raise(Errors.VarRedeclaration, loc, { identifierName: name }); } this.importsStack[this.importsStack.length - 1].add(name); return; } const scope = this.currentScope(); let type = scope.tsNames.get(name) || 0; if (bindingType & 1024) { this.maybeExportDefined(scope, name); scope.tsNames.set(name, type | 16); return; } super.declareName(name, bindingType, loc); if (bindingType & 2) { if (!(bindingType & 1)) { this.checkRedeclarationInScope(scope, name, bindingType, loc); this.maybeExportDefined(scope, name); } type = type | 1; } if (bindingType & 256) { type = type | 2; } if (bindingType & 512) { type = type | 4; } if (bindingType & 128) { type = type | 8; } if (type) scope.tsNames.set(name, type); } isRedeclaredInScope(scope, name, bindingType) { const type = scope.tsNames.get(name); if ((type & 2) > 0) { if (bindingType & 256) { const isConst = !!(bindingType & 512); const wasConst = (type & 4) > 0; return isConst !== wasConst; } return true; } if (bindingType & 128 && (type & 8) > 0) { if (scope.names.get(name) & 2) { return !!(bindingType & 1); } else { return false; } } if (bindingType & 2 && (type & 1) > 0) { return true; } return super.isRedeclaredInScope(scope, name, bindingType); } checkLocalExport(id) { const { name } = id; if (this.hasImport(name)) return; const len = this.scopeStack.length; for (let i = len - 1; i >= 0; i--) { const scope = this.scopeStack[i]; const type = scope.tsNames.get(name); if ((type & 1) > 0 || (type & 16) > 0) { return; } } super.checkLocalExport(id); } } const unwrapParenthesizedExpression = node => { return node.type === "ParenthesizedExpression" ? unwrapParenthesizedExpression(node.expression) : node; }; class LValParser extends NodeUtils { toAssignable(node, isLHS = false) { var _node$extra, _node$extra3; let parenthesized = undefined; if (node.type === "ParenthesizedExpression" || (_node$extra = node.extra) != null && _node$extra.parenthesized) { parenthesized = unwrapParenthesizedExpression(node); if (isLHS) { if (parenthesized.type === "Identifier") { this.expressionScope.recordArrowParameterBindingError(Errors.InvalidParenthesizedAssignment, node); } else if (parenthesized.type !== "MemberExpression" && !this.isOptionalMemberExpression(parenthesized)) { this.raise(Errors.InvalidParenthesizedAssignment, node); } } else { this.raise(Errors.InvalidParenthesizedAssignment, node); } } switch (node.type) { case "Identifier": case "ObjectPattern": case "ArrayPattern": case "AssignmentPattern": case "RestElement": break; case "ObjectExpression": node.type = "ObjectPattern"; for (let i = 0, length = node.properties.length, last = length - 1; i < length; i++) { var _node$extra2; const prop = node.properties[i]; const isLast = i === last; this.toAssignableObjectExpressionProp(prop, isLast, isLHS); if (isLast && prop.type === "RestElement" && (_node$extra2 = node.extra) != null && _node$extra2.trailingCommaLoc) { this.raise(Errors.RestTrailingComma, node.extra.trailingCommaLoc); } } break; case "ObjectProperty": { const { key, value } = node; if (this.isPrivateName(key)) { this.classScope.usePrivateName(this.getPrivateNameSV(key), key.loc.start); } this.toAssignable(value, isLHS); break; } case "SpreadElement": { throw new Error("Internal @babel/parser error (this is a bug, please report it)." + " SpreadElement should be converted by .toAssignable's caller."); } case "ArrayExpression": node.type = "ArrayPattern"; this.toAssignableList(node.elements, (_node$extra3 = node.extra) == null ? void 0 : _node$extra3.trailingCommaLoc, isLHS); break; case "AssignmentExpression": if (node.operator !== "=") { this.raise(Errors.MissingEqInAssignment, node.left.loc.end); } node.type = "AssignmentPattern"; delete node.operator; this.toAssignable(node.left, isLHS); break; case "ParenthesizedExpression": this.toAssignable(parenthesized, isLHS); break; } } toAssignableObjectExpressionProp(prop, isLast, isLHS) { if (prop.type === "ObjectMethod") { this.raise(prop.kind === "get" || prop.kind === "set" ? Errors.PatternHasAccessor : Errors.PatternHasMethod, prop.key); } else if (prop.type === "SpreadElement") { prop.type = "RestElement"; const arg = prop.argument; this.checkToRestConversion(arg, false); this.toAssignable(arg, isLHS); if (!isLast) { this.raise(Errors.RestTrailingComma, prop); } } else { this.toAssignable(prop, isLHS); } } toAssignableList(exprList, trailingCommaLoc, isLHS) { const end = exprList.length - 1; for (let i = 0; i <= end; i++) { const elt = exprList[i]; if (!elt) continue; if (elt.type === "SpreadElement") { elt.type = "RestElement"; const arg = elt.argument; this.checkToRestConversion(arg, true); this.toAssignable(arg, isLHS); } else { this.toAssignable(elt, isLHS); } if (elt.type === "RestElement") { if (i < end) { this.raise(Errors.RestTrailingComma, elt); } else if (trailingCommaLoc) { this.raise(Errors.RestTrailingComma, trailingCommaLoc); } } } } isAssignable(node, isBinding) { switch (node.type) { case "Identifier": case "ObjectPattern": case "ArrayPattern": case "AssignmentPattern": case "RestElement": return true; case "ObjectExpression": { const last = node.properties.length - 1; return node.properties.every((prop, i) => { return prop.type !== "ObjectMethod" && (i === last || prop.type !== "SpreadElement") && this.isAssignable(prop); }); } case "ObjectProperty": return this.isAssignable(node.value); case "SpreadElement": return this.isAssignable(node.argument); case "ArrayExpression": return node.elements.every(element => element === null || this.isAssignable(element)); case "AssignmentExpression": return node.operator === "="; case "ParenthesizedExpression": return this.isAssignable(node.expression); case "MemberExpression": case "OptionalMemberExpression": return !isBinding; default: return false; } } toReferencedList(exprList, isParenthesizedExpr) { return exprList; } toReferencedListDeep(exprList, isParenthesizedExpr) { this.toReferencedList(exprList, isParenthesizedExpr); for (const expr of exprList) { if ((expr == null ? void 0 : expr.type) === "ArrayExpression") { this.toReferencedListDeep(expr.elements); } } } parseSpread(refExpressionErrors) { const node = this.startNode(); this.next(); node.argument = this.parseMaybeAssignAllowIn(refExpressionErrors, undefined); return this.finishNode(node, "SpreadElement"); } parseRestBinding() { const node = this.startNode(); this.next(); node.argument = this.parseBindingAtom(); return this.finishNode(node, "RestElement"); } parseBindingAtom() { switch (this.state.type) { case 0: { const node = this.startNode(); this.next(); node.elements = this.parseBindingList(3, 93, 1); return this.finishNode(node, "ArrayPattern"); } case 5: return this.parseObjectLike(8, true); } return this.parseIdentifier(); } parseBindingList(close, closeCharCode, flags) { const allowEmpty = flags & 1; const elts = []; let first = true; while (!this.eat(close)) { if (first) { first = false; } else { this.expect(12); } if (allowEmpty && this.match(12)) { elts.push(null); } else if (this.eat(close)) { break; } else if (this.match(21)) { let rest = this.parseRestBinding(); if (this.hasPlugin("flow") || flags & 2) { rest = this.parseFunctionParamType(rest); } elts.push(rest); if (!this.checkCommaAfterRest(closeCharCode)) { this.expect(close); break; } } else { const decorators = []; if (this.match(26) && this.hasPlugin("decorators")) { this.raise(Errors.UnsupportedParameterDecorator, this.state.startLoc); } while (this.match(26)) { decorators.push(this.parseDecorator()); } elts.push(this.parseAssignableListItem(flags, decorators)); } } return elts; } parseBindingRestProperty(prop) { this.next(); prop.argument = this.parseIdentifier(); this.checkCommaAfterRest(125); return this.finishNode(prop, "RestElement"); } parseBindingProperty() { const { type, startLoc } = this.state; if (type === 21) { return this.parseBindingRestProperty(this.startNode()); } const prop = this.startNode(); if (type === 139) { this.expectPlugin("destructuringPrivate", startLoc); this.classScope.usePrivateName(this.state.value, startLoc); prop.key = this.parsePrivateName(); } else { this.parsePropertyName(prop); } prop.method = false; return this.parseObjPropValue(prop, startLoc, false, false, true, false); } parseAssignableListItem(flags, decorators) { const left = this.parseMaybeDefault(); if (this.hasPlugin("flow") || flags & 2) { this.parseFunctionParamType(left); } const elt = this.parseMaybeDefault(left.loc.start, left); if (decorators.length) { left.decorators = decorators; } return elt; } parseFunctionParamType(param) { return param; } parseMaybeDefault(startLoc, left) { var _startLoc, _left; (_startLoc = startLoc) != null ? _startLoc : startLoc = this.state.startLoc; left = (_left = left) != null ? _left : this.parseBindingAtom(); if (!this.eat(29)) return left; const node = this.startNodeAt(startLoc); node.left = left; node.right = this.parseMaybeAssignAllowIn(); return this.finishNode(node, "AssignmentPattern"); } isValidLVal(type, isUnparenthesizedInAssign, binding) { switch (type) { case "AssignmentPattern": return "left"; case "RestElement": return "argument"; case "ObjectProperty": return "value"; case "ParenthesizedExpression": return "expression"; case "ArrayPattern": return "elements"; case "ObjectPattern": return "properties"; } return false; } isOptionalMemberExpression(expression) { return expression.type === "OptionalMemberExpression"; } checkLVal(expression, ancestor, binding = 64, checkClashes = false, strictModeChanged = false, hasParenthesizedAncestor = false) { var _expression$extra; const type = expression.type; if (this.isObjectMethod(expression)) return; const isOptionalMemberExpression = this.isOptionalMemberExpression(expression); if (isOptionalMemberExpression || type === "MemberExpression") { if (isOptionalMemberExpression) { this.expectPlugin("optionalChainingAssign", expression.loc.start); if (ancestor.type !== "AssignmentExpression") { this.raise(Errors.InvalidLhsOptionalChaining, expression, { ancestor }); } } if (binding !== 64) { this.raise(Errors.InvalidPropertyBindingPattern, expression); } return; } if (type === "Identifier") { this.checkIdentifier(expression, binding, strictModeChanged); const { name } = expression; if (checkClashes) { if (checkClashes.has(name)) { this.raise(Errors.ParamDupe, expression); } else { checkClashes.add(name); } } return; } const validity = this.isValidLVal(type, !(hasParenthesizedAncestor || (_expression$extra = expression.extra) != null && _expression$extra.parenthesized) && ancestor.type === "AssignmentExpression", binding); if (validity === true) return; if (validity === false) { const ParseErrorClass = binding === 64 ? Errors.InvalidLhs : Errors.InvalidLhsBinding; this.raise(ParseErrorClass, expression, { ancestor }); return; } let key, isParenthesizedExpression; if (typeof validity === "string") { key = validity; isParenthesizedExpression = type === "ParenthesizedExpression"; } else { [key, isParenthesizedExpression] = validity; } const nextAncestor = type === "ArrayPattern" || type === "ObjectPattern" ? { type } : ancestor; const val = expression[key]; if (Array.isArray(val)) { for (const child of val) { if (child) { this.checkLVal(child, nextAncestor, binding, checkClashes, strictModeChanged, isParenthesizedExpression); } } } else if (val) { this.checkLVal(val, nextAncestor, binding, checkClashes, strictModeChanged, isParenthesizedExpression); } } checkIdentifier(at, bindingType, strictModeChanged = false) { if (this.state.strict && (strictModeChanged ? isStrictBindReservedWord(at.name, this.inModule) : isStrictBindOnlyReservedWord(at.name))) { if (bindingType === 64) { this.raise(Errors.StrictEvalArguments, at, { referenceName: at.name }); } else { this.raise(Errors.StrictEvalArgumentsBinding, at, { bindingName: at.name }); } } if (bindingType & 8192 && at.name === "let") { this.raise(Errors.LetInLexicalBinding, at); } if (!(bindingType & 64)) { this.declareNameFromIdentifier(at, bindingType); } } declareNameFromIdentifier(identifier, binding) { this.scope.declareName(identifier.name, binding, identifier.loc.start); } checkToRestConversion(node, allowPattern) { switch (node.type) { case "ParenthesizedExpression": this.checkToRestConversion(node.expression, allowPattern); break; case "Identifier": case "MemberExpression": break; case "ArrayExpression": case "ObjectExpression": if (allowPattern) break; default: this.raise(Errors.InvalidRestAssignmentPattern, node); } } checkCommaAfterRest(close) { if (!this.match(12)) { return false; } this.raise(this.lookaheadCharCode() === close ? Errors.RestTrailingComma : Errors.ElementAfterRest, this.state.startLoc); return true; } } function nonNull(x) { if (x == null) { throw new Error(`Unexpected ${x} value.`); } return x; } function assert(x) { if (!x) { throw new Error("Assert fail"); } } const TSErrors = ParseErrorEnum`typescript`({ AbstractMethodHasImplementation: ({ methodName }) => `Method '${methodName}' cannot have an implementation because it is marked abstract.`, AbstractPropertyHasInitializer: ({ propertyName }) => `Property '${propertyName}' cannot have an initializer because it is marked abstract.`, AccessorCannotBeOptional: "An 'accessor' property cannot be declared optional.", AccessorCannotDeclareThisParameter: "'get' and 'set' accessors cannot declare 'this' parameters.", AccessorCannotHaveTypeParameters: "An accessor cannot have type parameters.", ClassMethodHasDeclare: "Class methods cannot have the 'declare' modifier.", ClassMethodHasReadonly: "Class methods cannot have the 'readonly' modifier.", ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference: "A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.", ConstructorHasTypeParameters: "Type parameters cannot appear on a constructor declaration.", DeclareAccessor: ({ kind }) => `'declare' is not allowed in ${kind}ters.`, DeclareClassFieldHasInitializer: "Initializers are not allowed in ambient contexts.", DeclareFunctionHasImplementation: "An implementation cannot be declared in ambient contexts.", DuplicateAccessibilityModifier: ({ modifier }) => `Accessibility modifier already seen.`, DuplicateModifier: ({ modifier }) => `Duplicate modifier: '${modifier}'.`, EmptyHeritageClauseType: ({ token }) => `'${token}' list cannot be empty.`, EmptyTypeArguments: "Type argument list cannot be empty.", EmptyTypeParameters: "Type parameter list cannot be empty.", ExpectedAmbientAfterExportDeclare: "'export declare' must be followed by an ambient declaration.", ImportAliasHasImportType: "An import alias can not use 'import type'.", ImportReflectionHasImportType: "An `import module` declaration can not use `type` modifier", IncompatibleModifiers: ({ modifiers }) => `'${modifiers[0]}' modifier cannot be used with '${modifiers[1]}' modifier.`, IndexSignatureHasAbstract: "Index signatures cannot have the 'abstract' modifier.", IndexSignatureHasAccessibility: ({ modifier }) => `Index signatures cannot have an accessibility modifier ('${modifier}').`, IndexSignatureHasDeclare: "Index signatures cannot have the 'declare' modifier.", IndexSignatureHasOverride: "'override' modifier cannot appear on an index signature.", IndexSignatureHasStatic: "Index signatures cannot have the 'static' modifier.", InitializerNotAllowedInAmbientContext: "Initializers are not allowed in ambient contexts.", InvalidModifierOnTypeMember: ({ modifier }) => `'${modifier}' modifier cannot appear on a type member.`, InvalidModifierOnTypeParameter: ({ modifier }) => `'${modifier}' modifier cannot appear on a type parameter.`, InvalidModifierOnTypeParameterPositions: ({ modifier }) => `'${modifier}' modifier can only appear on a type parameter of a class, interface or type alias.`, InvalidModifiersOrder: ({ orderedModifiers }) => `'${orderedModifiers[0]}' modifier must precede '${orderedModifiers[1]}' modifier.`, InvalidPropertyAccessAfterInstantiationExpression: "Invalid property access after an instantiation expression. " + "You can either wrap the instantiation expression in parentheses, or delete the type arguments.", InvalidTupleMemberLabel: "Tuple members must be labeled with a simple identifier.", MissingInterfaceName: "'interface' declarations must be followed by an identifier.", NonAbstractClassHasAbstractMethod: "Abstract methods can only appear within an abstract class.", NonClassMethodPropertyHasAbstractModifer: "'abstract' modifier can only appear on a class, method, or property declaration.", OptionalTypeBeforeRequired: "A required element cannot follow an optional element.", OverrideNotInSubClass: "This member cannot have an 'override' modifier because its containing class does not extend another class.", PatternIsOptional: "A binding pattern parameter cannot be optional in an implementation signature.", PrivateElementHasAbstract: "Private elements cannot have the 'abstract' modifier.", PrivateElementHasAccessibility: ({ modifier }) => `Private elements cannot have an accessibility modifier ('${modifier}').`, ReadonlyForMethodSignature: "'readonly' modifier can only appear on a property declaration or index signature.", ReservedArrowTypeParam: "This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `<T,>() => ...`.", ReservedTypeAssertion: "This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.", SetAccessorCannotHaveOptionalParameter: "A 'set' accessor cannot have an optional parameter.", SetAccessorCannotHaveRestParameter: "A 'set' accessor cannot have rest parameter.", SetAccessorCannotHaveReturnType: "A 'set' accessor cannot have a return type annotation.", SingleTypeParameterWithoutTrailingComma: ({ typeParameterName }) => `Single type parameter ${typeParameterName} should have a trailing comma. Example usage: <${typeParameterName},>.`, StaticBlockCannotHaveModifier: "Static class blocks cannot have any modifier.", TupleOptionalAfterType: "A labeled tuple optional element must be declared using a question mark after the name and before the colon (`name?: type`), rather than after the type (`name: type?`).", TypeAnnotationAfterAssign: "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.", TypeImportCannotSpecifyDefaultAndNamed: "A type-only import can specify a default import or named bindings, but not both.", TypeModifierIsUsedInTypeExports: "The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.", TypeModifierIsUsedInTypeImports: "The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.", UnexpectedParameterModifier: "A parameter property is only allowed in a constructor implementation.", UnexpectedReadonly: "'readonly' type modifier is only permitted on array and tuple literal types.", UnexpectedTypeAnnotation: "Did not expect a type annotation here.", UnexpectedTypeCastInParameter: "Unexpected type cast in parameter position.", UnsupportedImportTypeArgument: "Argument in a type import must be a string literal.", UnsupportedParameterPropertyKind: "A parameter property may not be declared using a binding pattern.", UnsupportedSignatureParameterKind: ({ type }) => `Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${type}.` }); function keywordTypeFromName(value) { switch (value) { case "any": return "TSAnyKeyword"; case "boolean": return "TSBooleanKeyword"; case "bigint": return "TSBigIntKeyword"; case "never": return "TSNeverKeyword"; case "number": return "TSNumberKeyword"; case "object": return "TSObjectKeyword"; case "string": return "TSStringKeyword"; case "symbol": return "TSSymbolKeyword"; case "undefined": return "TSUndefinedKeyword"; case "unknown": return "TSUnknownKeyword"; default: return undefined; } } function tsIsAccessModifier(modifier) { return modifier === "private" || modifier === "public" || modifier === "protected"; } function tsIsVarianceAnnotations(modifier) { return modifier === "in" || modifier === "out"; } var typescript = superClass => class TypeScriptParserMixin extends superClass { constructor(...args) { super(...args); this.tsParseInOutModifiers = this.tsParseModifiers.bind(this, { allowedModifiers: ["in", "out"], disallowedModifiers: ["const", "public", "private", "protected", "readonly", "declare", "abstract", "override"], errorTemplate: TSErrors.InvalidModifierOnTypeParameter }); this.tsParseConstModifier = this.tsParseModifiers.bind(this, { allowedModifiers: ["const"], disallowedModifiers: ["in", "out"], errorTemplate: TSErrors.InvalidModifierOnTypeParameterPositions }); this.tsParseInOutConstModifiers = this.tsParseModifiers.bind(this, { allowedModifiers: ["in", "out", "const"], disallowedModifiers: ["public", "private", "protected", "readonly", "declare", "abstract", "override"], errorTemplate: TSErrors.InvalidModifierOnTypeParameter }); } getScopeHandler() { return TypeScriptScopeHandler; } tsIsIdentifier() { return tokenIsIdentifier(this.state.type); } tsTokenCanFollowModifier() { return this.match(0) || this.match(5) || this.match(55) || this.match(21) || this.match(139) || this.isLiteralPropertyName(); } tsNextTokenOnSameLineAndCanFollowModifier() { this.next(); if (this.hasPrecedingLineBreak()) { return false; } return this.tsTokenCanFollowModifier(); } tsNextTokenCanFollowModifier() { if (this.match(106)) { this.next(); return this.tsTokenCanFollowModifier(); } return this.tsNextTokenOnSameLineAndCanFollowModifier(); } tsParseModifier(allowedModifiers, stopOnStartOfClassStaticBlock) { if (!tokenIsIdentifier(this.state.type) && this.state.type !== 58 && this.state.type !== 75) { return undefined; } const modifier = this.state.value; if (allowedModifiers.includes(modifier)) { if (stopOnStartOfClassStaticBlock && this.tsIsStartOfStaticBlocks()) { return undefined; } if (this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this))) { return modifier; } } return undefined; } tsParseModifiers({ allowedModifiers, disallowedModifiers, stopOnStartOfClassStaticBlock, errorTemplate = TSErrors.InvalidModifierOnTypeMember }, modified) { const enforceOrder = (loc, modifier, before, after) => { if (modifier === before && modified[after]) { this.raise(TSErrors.InvalidModifiersOrder, loc, { orderedModifiers: [before, after] }); } }; const incompatible = (loc, modifier, mod1, mod2) => { if (modified[mod1] && modifier === mod2 || modified[mod2] && modifier === mod1) { this.raise(TSErrors.IncompatibleModifiers, loc, { modifiers: [mod1, mod2] }); } }; for (;;) { const { startLoc } = this.state; const modifier = this.tsParseModifier(allowedModifiers.concat(disallowedModifiers != null ? disallowedModifiers : []), stopOnStartOfClassStaticBlock); if (!modifier) break; if (tsIsAccessModifier(modifier)) { if (modified.accessibility) { this.raise(TSErrors.DuplicateAccessibilityModifier, startLoc, { modifier }); } else { enforceOrder(startLoc, modifier, modifier, "override"); enforceOrder(startLoc, modifier, modifier, "static"); enforceOrder(startLoc, modifier, modifier, "readonly"); modified.accessibility = modifier; } } else if (tsIsVarianceAnnotations(modifier)) { if (modified[modifier]) { this.raise(TSErrors.DuplicateModifier, startLoc, { modifier }); } modified[modifier] = true; enforceOrder(startLoc, modifier, "in", "out"); } else { if (hasOwnProperty.call(modified, modifier)) { this.raise(TSErrors.DuplicateModifier, startLoc, { modifier }); } else { enforceOrder(startLoc, modifier, "static", "readonly"); enforceOrder(startLoc, modifier, "static", "override"); enforceOrder(startLoc, modifier, "override", "readonly"); enforceOrder(startLoc, modifier, "abstract", "override"); incompatible(startLoc, modifier, "declare", "override"); incompatible(startLoc, modifier, "static", "abstract"); } modified[modifier] = true; } if (disallowedModifiers != null && disallowedModifiers.includes(modifier)) { this.raise(errorTemplate, startLoc, { modifier }); } } } tsIsListTerminator(kind) { switch (kind) { case "EnumMembers": case "TypeMembers": return this.match(8); case "HeritageClauseElement": return this.match(5); case "TupleElementTypes": return this.match(3); case "TypeParametersOrArguments": return this.match(48); } } tsParseList(kind, parseElement) { const result = []; while (!this.tsIsListTerminator(kind)) { result.push(parseElement()); } return result; } tsParseDelimitedList(kind, parseElement, refTrailingCommaPos) { return nonNull(this.tsParseDelimitedListWorker(kind, parseElement, true, refTrailingCommaPos)); } tsParseDelimitedListWorker(kind, parseElement, expectSuccess, refTrailingCommaPos) { const result = []; let trailingCommaPos = -1; for (;;) { if (this.tsIsListTerminator(kind)) { break; } trailingCommaPos = -1; const element = parseElement(); if (element == null) { return undefined; } result.push(element); if (this.eat(12)) { trailingCommaPos = this.state.lastTokStartLoc.index; continue; } if (this.tsIsListTerminator(kind)) { break; } if (expectSuccess) { this.expect(12); } return undefined; } if (refTrailingCommaPos) { refTrailingCommaPos.value = trailingCommaPos; } return result; } tsParseBracketedList(kind, parseElement, bracket, skipFirstToken, refTrailingCommaPos) { if (!skipFirstToken) { if (bracket) { this.expect(0); } else { this.expect(47); } } const result = this.tsParseDelimitedList(kind, parseElement, refTrailingCommaPos); if (bracket) { this.expect(3); } else { this.expect(48); } return result; } tsParseImportType() { const node = this.startNode(); this.expect(83); this.expect(10); if (!this.match(134)) { this.raise(TSErrors.UnsupportedImportTypeArgument, this.state.startLoc); } node.argument = super.parseExprAtom(); if (this.eat(12) && !this.match(11)) { node.options = super.parseMaybeAssignAllowIn(); this.eat(12); } else { node.options = null; } this.expect(11); if (this.eat(16)) { node.qualifier = this.tsParseEntityName(); } if (this.match(47)) { node.typeParameters = this.tsParseTypeArguments(); } return this.finishNode(node, "TSImportType"); } tsParseEntityName(allowReservedWords = true) { let entity = this.parseIdentifier(allowReservedWords); while (this.eat(16)) { const node = this.startNodeAtNode(entity); node.left = entity; node.right = this.parseIdentifier(allowReservedWords); entity = this.finishNode(node, "TSQualifiedName"); } return entity; } tsParseTypeReference() { const node = this.startNode(); node.typeName = this.tsParseEntityName(); if (!this.hasPrecedingLineBreak() && this.match(47)) { node.typeParameters = this.tsParseTypeArguments(); } return this.finishNode(node, "TSTypeReference"); } tsParseThisTypePredicate(lhs) { this.next(); const node = this.startNodeAtNode(lhs); node.parameterName = lhs; node.typeAnnotation = this.tsParseTypeAnnotation(false); node.asserts = false; return this.finishNode(node, "TSTypePredicate"); } tsParseThisTypeNode() { const node = this.startNode(); this.next(); return this.finishNode(node, "TSThisType"); } tsParseTypeQuery() { const node = this.startNode(); this.expect(87); if (this.match(83)) { node.exprName = this.tsParseImportType(); } else { node.exprName = this.tsParseEntityName(); } if (!this.hasPrecedingLineBreak() && this.match(47)) { node.typeParameters = this.tsParseTypeArguments(); } return this.finishNode(node, "TSTypeQuery"); } tsParseTypeParameter(parseModifiers) { const node = this.startNode(); parseModifiers(node); node.name = this.tsParseTypeParameterName(); node.constraint = this.tsEatThenParseType(81); node.default = this.tsEatThenParseType(29); return this.finishNode(node, "TSTypeParameter"); } tsTryParseTypeParameters(parseModifiers) { if (this.match(47)) { return this.tsParseTypeParameters(parseModifiers); } } tsParseTypeParameters(parseModifiers) { const node = this.startNode(); if (this.match(47) || this.match(143)) { this.next(); } else { this.unexpected(); } const refTrailingCommaPos = { value: -1 }; node.params = this.tsParseBracketedList("TypeParametersOrArguments", this.tsParseTypeParameter.bind(this, parseModifiers), false, true, refTrailingCommaPos); if (node.params.length === 0) { this.raise(TSErrors.EmptyTypeParameters, node); } if (refTrailingCommaPos.value !== -1) { this.addExtra(node, "trailingComma", refTrailingCommaPos.value); } return this.finishNode(node, "TSTypeParameterDeclaration"); } tsFillSignature(returnToken, signature) { const returnTokenRequired = returnToken === 19; const paramsKey = "parameters"; const returnTypeKey = "typeAnnotation"; signature.typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier); this.expect(10); signature[paramsKey] = this.tsParseBindingListForSignature(); if (returnTokenRequired) { signature[returnTypeKey] = this.tsParseTypeOrTypePredicateAnnotation(returnToken); } else if (this.match(returnToken)) { signature[returnTypeKey] = this.tsParseTypeOrTypePredicateAnnotation(returnToken); } } tsParseBindingListForSignature() { const list = super.parseBindingList(11, 41, 2); for (const pattern of list) { const { type } = pattern; if (type === "AssignmentPattern" || type === "TSParameterProperty") { this.raise(TSErrors.UnsupportedSignatureParameterKind, pattern, { type }); } } return list; } tsParseTypeMemberSemicolon() { if (!this.eat(12) && !this.isLineTerminator()) { this.expect(13); } } tsParseSignatureMember(kind, node) { this.tsFillSignature(14, node); this.tsParseTypeMemberSemicolon(); return this.finishNode(node, kind); } tsIsUnambiguouslyIndexSignature() { this.next(); if (tokenIsIdentifier(this.state.type)) { this.next(); return this.match(14); } return false; } tsTryParseIndexSignature(node) { if (!(this.match(0) && this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this)))) { return; } this.expect(0); const id = this.parseIdentifier(); id.typeAnnotation = this.tsParseTypeAnnotation(); this.resetEndLocation(id); this.expect(3); node.parameters = [id]; const type = this.tsTryParseTypeAnnotation(); if (type) node.typeAnnotation = type; this.tsParseTypeMemberSemicolon(); return this.finishNode(node, "TSIndexSignature"); } tsParsePropertyOrMethodSignature(node, readonly) { if (this.eat(17)) node.optional = true; const nodeAny = node; if (this.match(10) || this.match(47)) { if (readonly) { this.raise(TSErrors.ReadonlyForMethodSignature, node); } const method = nodeAny; if (method.kind && this.match(47)) { this.raise(TSErrors.AccessorCannotHaveTypeParameters, this.state.curPosition()); } this.tsFillSignature(14, method); this.tsParseTypeMemberSemicolon(); const paramsKey = "parameters"; const returnTypeKey = "typeAnnotation"; if (method.kind === "get") { if (method[paramsKey].length > 0) { this.raise(Errors.BadGetterArity, this.state.curPosition()); if (this.isThisParam(method[paramsKey][0])) { this.raise(TSErrors.AccessorCannotDeclareThisParameter, this.state.curPosition()); } } } else if (method.kind === "set") { if (method[paramsKey].length !== 1) { this.raise(Errors.BadSetterArity, this.state.curPosition()); } else { const firstParameter = method[paramsKey][0]; if (this.isThisParam(firstParameter)) { this.raise(TSErrors.AccessorCannotDeclareThisParameter, this.state.curPosition()); } if (firstParameter.type === "Identifier" && firstParameter.optional) { this.raise(TSErrors.SetAccessorCannotHaveOptionalParameter, this.state.curPosition()); } if (firstParameter.type === "RestElement") { this.raise(TSErrors.SetAccessorCannotHaveRestParameter, this.state.curPosition()); } } if (method[returnTypeKey]) { this.raise(TSErrors.SetAccessorCannotHaveReturnType, method[returnTypeKey]); } } else { method.kind = "method"; } return this.finishNode(method, "TSMethodSignature"); } else { const property = nodeAny; if (readonly) property.readonly = true; const type = this.tsTryParseTypeAnnotation(); if (type) property.typeAnnotation = type; this.tsParseTypeMemberSemicolon(); return this.finishNode(property, "TSPropertySignature"); } } tsParseTypeMember() { const node = this.startNode(); if (this.match(10) || this.match(47)) { return this.tsParseSignatureMember("TSCallSignatureDeclaration", node); } if (this.match(77)) { const id = this.startNode(); this.next(); if (this.match(10) || this.match(47)) { return this.tsParseSignatureMember("TSConstructSignatureDeclaration", node); } else { node.key = this.createIdentifier(id, "new"); return this.tsParsePropertyOrMethodSignature(node, false); } } this.tsParseModifiers({ allowedModifiers: ["readonly"], disallowedModifiers: ["declare", "abstract", "private", "protected", "public", "static", "override"] }, node); const idx = this.tsTryParseIndexSignature(node); if (idx) { return idx; } super.parsePropertyName(node); if (!node.computed && node.key.type === "Identifier" && (node.key.name === "get" || node.key.name === "set") && this.tsTokenCanFollowModifier()) { node.kind = node.key.name; super.parsePropertyName(node); } return this.tsParsePropertyOrMethodSignature(node, !!node.readonly); } tsParseTypeLiteral() { const node = this.startNode(); node.members = this.tsParseObjectTypeMembers(); return this.finishNode(node, "TSTypeLiteral"); } tsParseObjectTypeMembers() { this.expect(5); const members = this.tsParseList("TypeMembers", this.tsParseTypeMember.bind(this)); this.expect(8); return members; } tsIsStartOfMappedType() { this.next(); if (this.eat(53)) { return this.isContextual(122); } if (this.isContextual(122)) { this.next(); } if (!this.match(0)) { return false; } this.next(); if (!this.tsIsIdentifier()) { return false; } this.next(); return this.match(58); } tsParseMappedType() { const node = this.startNode(); this.expect(5); if (this.match(53)) { node.readonly = this.state.value; this.next(); this.expectContextual(122); } else if (this.eatContextual(122)) { node.readonly = true; } this.expect(0); { const typeParameter = this.startNode(); typeParameter.name = this.tsParseTypeParameterName(); typeParameter.constraint = this.tsExpectThenParseType(58); node.typeParameter = this.finishNode(typeParameter, "TSTypeParameter"); } node.nameType = this.eatContextual(93) ? this.tsParseType() : null; this.expect(3); if (this.match(53)) { node.optional = this.state.value; this.next(); this.expect(17); } else if (this.eat(17)) { node.optional = true; } node.typeAnnotation = this.tsTryParseType(); this.semicolon(); this.expect(8); return this.finishNode(node, "TSMappedType"); } tsParseTupleType() { const node = this.startNode(); node.elementTypes = this.tsParseBracketedList("TupleElementTypes", this.tsParseTupleElementType.bind(this), true, false); let seenOptionalElement = false; node.elementTypes.forEach(elementNode => { const { type } = elementNode; if (seenOptionalElement && type !== "TSRestType" && type !== "TSOptionalType" && !(type === "TSNamedTupleMember" && elementNode.optional)) { this.raise(TSErrors.OptionalTypeBeforeRequired, elementNode); } seenOptionalElement || (seenOptionalElement = type === "TSNamedTupleMember" && elementNode.optional || type === "TSOptionalType"); }); return this.finishNode(node, "TSTupleType"); } tsParseTupleElementType() { const { startLoc } = this.state; const rest = this.eat(21); let labeled; let label; let optional; let type; const isWord = tokenIsKeywordOrIdentifier(this.state.type); const chAfterWord = isWord ? this.lookaheadCharCode() : null; if (chAfterWord === 58) { labeled = true; optional = false; label = this.parseIdentifier(true); this.expect(14); type = this.tsParseType(); } else if (chAfterWord === 63) { optional = true; const startLoc = this.state.startLoc; const wordName = this.state.value; const typeOrLabel = this.tsParseNonArrayType(); if (this.lookaheadCharCode() === 58) { labeled = true; label = this.createIdentifier(this.startNodeAt(startLoc), wordName); this.expect(17); this.expect(14); type = this.tsParseType(); } else { labeled = false; type = typeOrLabel; this.expect(17); } } else { type = this.tsParseType(); optional = this.eat(17); labeled = this.eat(14); } if (labeled) { let labeledNode; if (label) { labeledNode = this.startNodeAtNode(label); labeledNode.optional = optional; labeledNode.label = label; labeledNode.elementType = type; if (this.eat(17)) { labeledNode.optional = true; this.raise(TSErrors.TupleOptionalAfterType, this.state.lastTokStartLoc); } } else { labeledNode = this.startNodeAtNode(type); labeledNode.optional = optional; this.raise(TSErrors.InvalidTupleMemberLabel, type); labeledNode.label = type; labeledNode.elementType = this.tsParseType(); } type = this.finishNode(labeledNode, "TSNamedTupleMember"); } else if (optional) { const optionalTypeNode = this.startNodeAtNode(type); optionalTypeNode.typeAnnotation = type; type = this.finishNode(optionalTypeNode, "TSOptionalType"); } if (rest) { const restNode = this.startNodeAt(startLoc); restNode.typeAnnotation = type; type = this.finishNode(restNode, "TSRestType"); } return type; } tsParseParenthesizedType() { const node = this.startNode(); this.expect(10); node.typeAnnotation = this.tsParseType(); this.expect(11); return this.finishNode(node, "TSParenthesizedType"); } tsParseFunctionOrConstructorType(type, abstract) { const node = this.startNode(); if (type === "TSConstructorType") { node.abstract = !!abstract; if (abstract) this.next(); this.next(); } this.tsInAllowConditionalTypesContext(() => this.tsFillSignature(19, node)); return this.finishNode(node, type); } tsParseLiteralTypeNode() { const node = this.startNode(); switch (this.state.type) { case 135: case 136: case 134: case 85: case 86: node.literal = super.parseExprAtom(); break; default: this.unexpected(); } return this.finishNode(node, "TSLiteralType"); } tsParseTemplateLiteralType() { const node = this.startNode(); node.literal = super.parseTemplate(false); return this.finishNode(node, "TSLiteralType"); } parseTemplateSubstitution() { if (this.state.inType) return this.tsParseType(); return super.parseTemplateSubstitution(); } tsParseThisTypeOrThisTypePredicate() { const thisKeyword = this.tsParseThisTypeNode(); if (this.isContextual(116) && !this.hasPrecedingLineBreak()) { return this.tsParseThisTypePredicate(thisKeyword); } else { return thisKeyword; } } tsParseNonArrayType() { switch (this.state.type) { case 134: case 135: case 136: case 85: case 86: return this.tsParseLiteralTypeNode(); case 53: if (this.state.value === "-") { const node = this.startNode(); const nextToken = this.lookahead(); if (nextToken.type !== 135 && nextToken.type !== 136) { this.unexpected(); } node.literal = this.parseMaybeUnary(); return this.finishNode(node, "TSLiteralType"); } break; case 78: return this.tsParseThisTypeOrThisTypePredicate(); case 87: return this.tsParseTypeQuery(); case 83: return this.tsParseImportType(); case 5: return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this)) ? this.tsParseMappedType() : this.tsParseTypeLiteral(); case 0: return this.tsParseTupleType(); case 10: return this.tsParseParenthesizedType(); case 25: case 24: return this.tsParseTemplateLiteralType(); default: { const { type } = this.state; if (tokenIsIdentifier(type) || type === 88 || type === 84) { const nodeType = type === 88 ? "TSVoidKeyword" : type === 84 ? "TSNullKeyword" : keywordTypeFromName(this.state.value); if (nodeType !== undefined && this.lookaheadCharCode() !== 46) { const node = this.startNode(); this.next(); return this.finishNode(node, nodeType); } return this.tsParseTypeReference(); } } } this.unexpected(); } tsParseArrayTypeOrHigher() { let type = this.tsParseNonArrayType(); while (!this.hasPrecedingLineBreak() && this.eat(0)) { if (this.match(3)) { const node = this.startNodeAtNode(type); node.elementType = type; this.expect(3); type = this.finishNode(node, "TSArrayType"); } else { const node = this.startNodeAtNode(type); node.objectType = type; node.indexType = this.tsParseType(); this.expect(3); type = this.finishNode(node, "TSIndexedAccessType"); } } return type; } tsParseTypeOperator() { const node = this.startNode(); const operator = this.state.value; this.next(); node.operator = operator; node.typeAnnotation = this.tsParseTypeOperatorOrHigher(); if (operator === "readonly") { this.tsCheckTypeAnnotationForReadOnly(node); } return this.finishNode(node, "TSTypeOperator"); } tsCheckTypeAnnotationForReadOnly(node) { switch (node.typeAnnotation.type) { case "TSTupleType": case "TSArrayType": return; default: this.raise(TSErrors.UnexpectedReadonly, node); } } tsParseInferType() { const node = this.startNode(); this.expectContextual(115); const typeParameter = this.startNode(); typeParameter.name = this.tsParseTypeParameterName(); typeParameter.constraint = this.tsTryParse(() => this.tsParseConstraintForInferType()); node.typeParameter = this.finishNode(typeParameter, "TSTypeParameter"); return this.finishNode(node, "TSInferType"); } tsParseConstraintForInferType() { if (this.eat(81)) { const constraint = this.tsInDisallowConditionalTypesContext(() => this.tsParseType()); if (this.state.inDisallowConditionalTypesContext || !this.match(17)) { return constraint; } } } tsParseTypeOperatorOrHigher() { const isTypeOperator = tokenIsTSTypeOperator(this.state.type) && !this.state.containsEsc; return isTypeOperator ? this.tsParseTypeOperator() : this.isContextual(115) ? this.tsParseInferType() : this.tsInAllowConditionalTypesContext(() => this.tsParseArrayTypeOrHigher()); } tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) { const node = this.startNode(); const hasLeadingOperator = this.eat(operator); const types = []; do { types.push(parseConstituentType()); } while (this.eat(operator)); if (types.length === 1 && !hasLeadingOperator) { return types[0]; } node.types = types; return this.finishNode(node, kind); } tsParseIntersectionTypeOrHigher() { return this.tsParseUnionOrIntersectionType("TSIntersectionType", this.tsParseTypeOperatorOrHigher.bind(this), 45); } tsParseUnionTypeOrHigher() { return this.tsParseUnionOrIntersectionType("TSUnionType", this.tsParseIntersectionTypeOrHigher.bind(this), 43); } tsIsStartOfFunctionType() { if (this.match(47)) { return true; } return this.match(10) && this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this)); } tsSkipParameterStart() { if (tokenIsIdentifier(this.state.type) || this.match(78)) { this.next(); return true; } if (this.match(5)) { const { errors } = this.state; const previousErrorCount = errors.length; try { this.parseObjectLike(8, true); return errors.length === previousErrorCount; } catch (_unused) { return false; } } if (this.match(0)) { this.next(); const { errors } = this.state; const previousErrorCount = errors.length; try { super.parseBindingList(3, 93, 1); return errors.length === previousErrorCount; } catch (_unused2) { return false; } } return false; } tsIsUnambiguouslyStartOfFunctionType() { this.next(); if (this.match(11) || this.match(21)) { return true; } if (this.tsSkipParameterStart()) { if (this.match(14) || this.match(12) || this.match(17) || this.match(29)) { return true; } if (this.match(11)) { this.next(); if (this.match(19)) { return true; } } } return false; } tsParseTypeOrTypePredicateAnnotation(returnToken) { return this.tsInType(() => { const t = this.startNode(); this.expect(returnToken); const node = this.startNode(); const asserts = !!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this)); if (asserts && this.match(78)) { let thisTypePredicate = this.tsParseThisTypeOrThisTypePredicate(); if (thisTypePredicate.type === "TSThisType") { node.parameterName = thisTypePredicate; node.asserts = true; node.typeAnnotation = null; thisTypePredicate = this.finishNode(node, "TSTypePredicate"); } else { this.resetStartLocationFromNode(thisTypePredicate, node); thisTypePredicate.asserts = true; } t.typeAnnotation = thisTypePredicate; return this.finishNode(t, "TSTypeAnnotation"); } const typePredicateVariable = this.tsIsIdentifier() && this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this)); if (!typePredicateVariable) { if (!asserts) { return this.tsParseTypeAnnotation(false, t); } node.parameterName = this.parseIdentifier(); node.asserts = asserts; node.typeAnnotation = null; t.typeAnnotation = this.finishNode(node, "TSTypePredicate"); return this.finishNode(t, "TSTypeAnnotation"); } const type = this.tsParseTypeAnnotation(false); node.parameterName = typePredicateVariable; node.typeAnnotation = type; node.asserts = asserts; t.typeAnnotation = this.finishNode(node, "TSTypePredicate"); return this.finishNode(t, "TSTypeAnnotation"); }); } tsTryParseTypeOrTypePredicateAnnotation() { if (this.match(14)) { return this.tsParseTypeOrTypePredicateAnnotation(14); } } tsTryParseTypeAnnotation() { if (this.match(14)) { return this.tsParseTypeAnnotation(); } } tsTryParseType() { return this.tsEatThenParseType(14); } tsParseTypePredicatePrefix() { const id = this.parseIdentifier(); if (this.isContextual(116) && !this.hasPrecedingLineBreak()) { this.next(); return id; } } tsParseTypePredicateAsserts() { if (this.state.type !== 109) { return false; } const containsEsc = this.state.containsEsc; this.next(); if (!tokenIsIdentifier(this.state.type) && !this.match(78)) { return false; } if (containsEsc) { this.raise(Errors.InvalidEscapedReservedWord, this.state.lastTokStartLoc, { reservedWord: "asserts" }); } return true; } tsParseTypeAnnotation(eatColon = true, t = this.startNode()) { this.tsInType(() => { if (eatColon) this.expect(14); t.typeAnnotation = this.tsParseType(); }); return this.finishNode(t, "TSTypeAnnotation"); } tsParseType() { assert(this.state.inType); const type = this.tsParseNonConditionalType(); if (this.state.inDisallowConditionalTypesContext || this.hasPrecedingLineBreak() || !this.eat(81)) { return type; } const node = this.startNodeAtNode(type); node.checkType = type; node.extendsType = this.tsInDisallowConditionalTypesContext(() => this.tsParseNonConditionalType()); this.expect(17); node.trueType = this.tsInAllowConditionalTypesContext(() => this.tsParseType()); this.expect(14); node.falseType = this.tsInAllowConditionalTypesContext(() => this.tsParseType()); return this.finishNode(node, "TSConditionalType"); } isAbstractConstructorSignature() { return this.isContextual(124) && this.lookahead().type === 77; } tsParseNonConditionalType() { if (this.tsIsStartOfFunctionType()) { return this.tsParseFunctionOrConstructorType("TSFunctionType"); } if (this.match(77)) { return this.tsParseFunctionOrConstructorType("TSConstructorType"); } else if (this.isAbstractConstructorSignature()) { return this.tsParseFunctionOrConstructorType("TSConstructorType", true); } return this.tsParseUnionTypeOrHigher(); } tsParseTypeAssertion() { if (this.getPluginOption("typescript", "disallowAmbiguousJSXLike")) { this.raise(TSErrors.ReservedTypeAssertion, this.state.startLoc); } const node = this.startNode(); node.typeAnnotation = this.tsInType(() => { this.next(); return this.match(75) ? this.tsParseTypeReference() : this.tsParseType(); }); this.expect(48); node.expression = this.parseMaybeUnary(); return this.finishNode(node, "TSTypeAssertion"); } tsParseHeritageClause(token) { const originalStartLoc = this.state.startLoc; const delimitedList = this.tsParseDelimitedList("HeritageClauseElement", () => { const node = this.startNode(); node.expression = this.tsParseEntityName(); if (this.match(47)) { node.typeParameters = this.tsParseTypeArguments(); } return this.finishNode(node, "TSExpressionWithTypeArguments"); }); if (!delimitedList.length) { this.raise(TSErrors.EmptyHeritageClauseType, originalStartLoc, { token }); } return delimitedList; } tsParseInterfaceDeclaration(node, properties = {}) { if (this.hasFollowingLineBreak()) return null; this.expectContextual(129); if (properties.declare) node.declare = true; if (tokenIsIdentifier(this.state.type)) { node.id = this.parseIdentifier(); this.checkIdentifier(node.id, 130); } else { node.id = null; this.raise(TSErrors.MissingInterfaceName, this.state.startLoc); } node.typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers); if (this.eat(81)) { node.extends = this.tsParseHeritageClause("extends"); } const body = this.startNode(); body.body = this.tsInType(this.tsParseObjectTypeMembers.bind(this)); node.body = this.finishNode(body, "TSInterfaceBody"); return this.finishNode(node, "TSInterfaceDeclaration"); } tsParseTypeAliasDeclaration(node) { node.id = this.parseIdentifier(); this.checkIdentifier(node.id, 2); node.typeAnnotation = this.tsInType(() => { node.typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutModifiers); this.expect(29); if (this.isContextual(114) && this.lookahead().type !== 16) { const node = this.startNode(); this.next(); return this.finishNode(node, "TSIntrinsicKeyword"); } return this.tsParseType(); }); this.semicolon(); return this.finishNode(node, "TSTypeAliasDeclaration"); } tsInNoContext(cb) { const oldContext = this.state.context; this.state.context = [oldContext[0]]; try { return cb(); } finally { this.state.context = oldContext; } } tsInType(cb) { const oldInType = this.state.inType; this.state.inType = true; try { return cb(); } finally { this.state.inType = oldInType; } } tsInDisallowConditionalTypesContext(cb) { const oldInDisallowConditionalTypesContext = this.state.inDisallowConditionalTypesContext; this.state.inDisallowConditionalTypesContext = true; try { return cb(); } finally { this.state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext; } } tsInAllowConditionalTypesContext(cb) { const oldInDisallowConditionalTypesContext = this.state.inDisallowConditionalTypesContext; this.state.inDisallowConditionalTypesContext = false; try { return cb(); } finally { this.state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext; } } tsEatThenParseType(token) { if (this.match(token)) { return this.tsNextThenParseType(); } } tsExpectThenParseType(token) { return this.tsInType(() => { this.expect(token); return this.tsParseType(); }); } tsNextThenParseType() { return this.tsInType(() => { this.next(); return this.tsParseType(); }); } tsParseEnumMember() { const node = this.startNode(); node.id = this.match(134) ? super.parseStringLiteral(this.state.value) : this.parseIdentifier(true); if (this.eat(29)) { node.initializer = super.parseMaybeAssignAllowIn(); } return this.finishNode(node, "TSEnumMember"); } tsParseEnumDeclaration(node, properties = {}) { if (properties.const) node.const = true; if (properties.declare) node.declare = true; this.expectContextual(126); node.id = this.parseIdentifier(); this.checkIdentifier(node.id, node.const ? 8971 : 8459); this.expect(5); node.members = this.tsParseDelimitedList("EnumMembers", this.tsParseEnumMember.bind(this)); this.expect(8); return this.finishNode(node, "TSEnumDeclaration"); } tsParseModuleBlock() { const node = this.startNode(); this.scope.enter(0); this.expect(5); super.parseBlockOrModuleBlockBody(node.body = [], undefined, true, 8); this.scope.exit(); return this.finishNode(node, "TSModuleBlock"); } tsParseModuleOrNamespaceDeclaration(node, nested = false) { node.id = this.parseIdentifier(); if (!nested) { this.checkIdentifier(node.id, 1024); } if (this.eat(16)) { const inner = this.startNode(); this.tsParseModuleOrNamespaceDeclaration(inner, true); node.body = inner; } else { this.scope.enter(256); this.prodParam.enter(0); node.body = this.tsParseModuleBlock(); this.prodParam.exit(); this.scope.exit(); } return this.finishNode(node, "TSModuleDeclaration"); } tsParseAmbientExternalModuleDeclaration(node) { if (this.isContextual(112)) { node.kind = "global"; node.global = true; node.id = this.parseIdentifier(); } else if (this.match(134)) { node.kind = "module"; node.id = super.parseStringLiteral(this.state.value); } else { this.unexpected(); } if (this.match(5)) { this.scope.enter(256); this.prodParam.enter(0); node.body = this.tsParseModuleBlock(); this.prodParam.exit(); this.scope.exit(); } else { this.semicolon(); } return this.finishNode(node, "TSModuleDeclaration"); } tsParseImportEqualsDeclaration(node, maybeDefaultIdentifier, isExport) { node.isExport = isExport || false; node.id = maybeDefaultIdentifier || this.parseIdentifier(); this.checkIdentifier(node.id, 4096); this.expect(29); const moduleReference = this.tsParseModuleReference(); if (node.importKind === "type" && moduleReference.type !== "TSExternalModuleReference") { this.raise(TSErrors.ImportAliasHasImportType, moduleReference); } node.moduleReference = moduleReference; this.semicolon(); return this.finishNode(node, "TSImportEqualsDeclaration"); } tsIsExternalModuleReference() { return this.isContextual(119) && this.lookaheadCharCode() === 40; } tsParseModuleReference() { return this.tsIsExternalModuleReference() ? this.tsParseExternalModuleReference() : this.tsParseEntityName(false); } tsParseExternalModuleReference() { const node = this.startNode(); this.expectContextual(119); this.expect(10); if (!this.match(134)) { this.unexpected(); } node.expression = super.parseExprAtom(); this.expect(11); this.sawUnambiguousESM = true; return this.finishNode(node, "TSExternalModuleReference"); } tsLookAhead(f) { const state = this.state.clone(); const res = f(); this.state = state; return res; } tsTryParseAndCatch(f) { const result = this.tryParse(abort => f() || abort()); if (result.aborted || !result.node) return; if (result.error) this.state = result.failState; return result.node; } tsTryParse(f) { const state = this.state.clone(); const result = f(); if (result !== undefined && result !== false) { return result; } this.state = state; } tsTryParseDeclare(nany) { if (this.isLineTerminator()) { return; } let startType = this.state.type; let kind; if (this.isContextual(100)) { startType = 74; kind = "let"; } return this.tsInAmbientContext(() => { switch (startType) { case 68: nany.declare = true; return super.parseFunctionStatement(nany, false, false); case 80: nany.declare = true; return this.parseClass(nany, true, false); case 126: return this.tsParseEnumDeclaration(nany, { declare: true }); case 112: return this.tsParseAmbientExternalModuleDeclaration(nany); case 75: case 74: if (!this.match(75) || !this.isLookaheadContextual("enum")) { nany.declare = true; return this.parseVarStatement(nany, kind || this.state.value, true); } this.expect(75); return this.tsParseEnumDeclaration(nany, { const: true, declare: true }); case 129: { const result = this.tsParseInterfaceDeclaration(nany, { declare: true }); if (result) return result; } default: if (tokenIsIdentifier(startType)) { return this.tsParseDeclaration(nany, this.state.value, true, null); } } }); } tsTryParseExportDeclaration() { return this.tsParseDeclaration(this.startNode(), this.state.value, true, null); } tsParseExpressionStatement(node, expr, decorators) { switch (expr.name) { case "declare": { const declaration = this.tsTryParseDeclare(node); if (declaration) { declaration.declare = true; } return declaration; } case "global": if (this.match(5)) { this.scope.enter(256); this.prodParam.enter(0); const mod = node; mod.kind = "global"; mod.global = true; mod.id = expr; mod.body = this.tsParseModuleBlock(); this.scope.exit(); this.prodParam.exit(); return this.finishNode(mod, "TSModuleDeclaration"); } break; default: return this.tsParseDeclaration(node, expr.name, false, decorators); } } tsParseDeclaration(node, value, next, decorators) { switch (value) { case "abstract": if (this.tsCheckLineTerminator(next) && (this.match(80) || tokenIsIdentifier(this.state.type))) { return this.tsParseAbstractDeclaration(node, decorators); } break; case "module": if (this.tsCheckLineTerminator(next)) { if (this.match(134)) { return this.tsParseAmbientExternalModuleDeclaration(node); } else if (tokenIsIdentifier(this.state.type)) { node.kind = "module"; return this.tsParseModuleOrNamespaceDeclaration(node); } } break; case "namespace": if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.state.type)) { node.kind = "namespace"; return this.tsParseModuleOrNamespaceDeclaration(node); } break; case "type": if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.state.type)) { return this.tsParseTypeAliasDeclaration(node); } break; } } tsCheckLineTerminator(next) { if (next) { if (this.hasFollowingLineBreak()) return false; this.next(); return true; } return !this.isLineTerminator(); } tsTryParseGenericAsyncArrowFunction(startLoc) { if (!this.match(47)) return; const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; this.state.maybeInArrowParameters = true; const res = this.tsTryParseAndCatch(() => { const node = this.startNodeAt(startLoc); node.typeParameters = this.tsParseTypeParameters(this.tsParseConstModifier); super.parseFunctionParams(node); node.returnType = this.tsTryParseTypeOrTypePredicateAnnotation(); this.expect(19); return node; }); this.state.maybeInArrowParameters = oldMaybeInArrowParameters; if (!res) return; return super.parseArrowExpression(res, null, true); } tsParseTypeArgumentsInExpression() { if (this.reScan_lt() !== 47) return; return this.tsParseTypeArguments(); } tsParseTypeArguments() { const node = this.startNode(); node.params = this.tsInType(() => this.tsInNoContext(() => { this.expect(47); return this.tsParseDelimitedList("TypeParametersOrArguments", this.tsParseType.bind(this)); })); if (node.params.length === 0) { this.raise(TSErrors.EmptyTypeArguments, node); } else if (!this.state.inType && this.curContext() === types.brace) { this.reScan_lt_gt(); } this.expect(48); return this.finishNode(node, "TSTypeParameterInstantiation"); } tsIsDeclarationStart() { return tokenIsTSDeclarationStart(this.state.type); } isExportDefaultSpecifier() { if (this.tsIsDeclarationStart()) return false; return super.isExportDefaultSpecifier(); } parseAssignableListItem(flags, decorators) { const startLoc = this.state.startLoc; const modified = {}; this.tsParseModifiers({ allowedModifiers: ["public", "private", "protected", "override", "readonly"] }, modified); const accessibility = modified.accessibility; const override = modified.override; const readonly = modified.readonly; if (!(flags & 4) && (accessibility || readonly || override)) { this.raise(TSErrors.UnexpectedParameterModifier, startLoc); } const left = this.parseMaybeDefault(); if (flags & 2) { this.parseFunctionParamType(left); } const elt = this.parseMaybeDefault(left.loc.start, left); if (accessibility || readonly || override) { const pp = this.startNodeAt(startLoc); if (decorators.length) { pp.decorators = decorators; } if (accessibility) pp.accessibility = accessibility; if (readonly) pp.readonly = readonly; if (override) pp.override = override; if (elt.type !== "Identifier" && elt.type !== "AssignmentPattern") { this.raise(TSErrors.UnsupportedParameterPropertyKind, pp); } pp.parameter = elt; return this.finishNode(pp, "TSParameterProperty"); } if (decorators.length) { left.decorators = decorators; } return elt; } isSimpleParameter(node) { return node.type === "TSParameterProperty" && super.isSimpleParameter(node.parameter) || super.isSimpleParameter(node); } tsDisallowOptionalPattern(node) { for (const param of node.params) { if (param.type !== "Identifier" && param.optional && !this.state.isAmbientContext) { this.raise(TSErrors.PatternIsOptional, param); } } } setArrowFunctionParameters(node, params, trailingCommaLoc) { super.setArrowFunctionParameters(node, params, trailingCommaLoc); this.tsDisallowOptionalPattern(node); } parseFunctionBodyAndFinish(node, type, isMethod = false) { if (this.match(14)) { node.returnType = this.tsParseTypeOrTypePredicateAnnotation(14); } const bodilessType = type === "FunctionDeclaration" ? "TSDeclareFunction" : type === "ClassMethod" || type === "ClassPrivateMethod" ? "TSDeclareMethod" : undefined; if (bodilessType && !this.match(5) && this.isLineTerminator()) { return this.finishNode(node, bodilessType); } if (bodilessType === "TSDeclareFunction" && this.state.isAmbientContext) { this.raise(TSErrors.DeclareFunctionHasImplementation, node); if (node.declare) { return super.parseFunctionBodyAndFinish(node, bodilessType, isMethod); } } this.tsDisallowOptionalPattern(node); return super.parseFunctionBodyAndFinish(node, type, isMethod); } registerFunctionStatementId(node) { if (!node.body && node.id) { this.checkIdentifier(node.id, 1024); } else { super.registerFunctionStatementId(node); } } tsCheckForInvalidTypeCasts(items) { items.forEach(node => { if ((node == null ? void 0 : node.type) === "TSTypeCastExpression") { this.raise(TSErrors.UnexpectedTypeAnnotation, node.typeAnnotation); } }); } toReferencedList(exprList, isInParens) { this.tsCheckForInvalidTypeCasts(exprList); return exprList; } parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) { const node = super.parseArrayLike(close, canBePattern, isTuple, refExpressionErrors); if (node.type === "ArrayExpression") { this.tsCheckForInvalidTypeCasts(node.elements); } return node; } parseSubscript(base, startLoc, noCalls, state) { if (!this.hasPrecedingLineBreak() && this.match(35)) { this.state.canStartJSXElement = false; this.next(); const nonNullExpression = this.startNodeAt(startLoc); nonNullExpression.expression = base; return this.finishNode(nonNullExpression, "TSNonNullExpression"); } let isOptionalCall = false; if (this.match(18) && this.lookaheadCharCode() === 60) { if (noCalls) { state.stop = true; return base; } state.optionalChainMember = isOptionalCall = true; this.next(); } if (this.match(47) || this.match(51)) { let missingParenErrorLoc; const result = this.tsTryParseAndCatch(() => { if (!noCalls && this.atPossibleAsyncArrow(base)) { const asyncArrowFn = this.tsTryParseGenericAsyncArrowFunction(startLoc); if (asyncArrowFn) { return asyncArrowFn; } } const typeArguments = this.tsParseTypeArgumentsInExpression(); if (!typeArguments) return; if (isOptionalCall && !this.match(10)) { missingParenErrorLoc = this.state.curPosition(); return; } if (tokenIsTemplate(this.state.type)) { const result = super.parseTaggedTemplateExpression(base, startLoc, state); result.typeParameters = typeArguments; return result; } if (!noCalls && this.eat(10)) { const node = this.startNodeAt(startLoc); node.callee = base; node.arguments = this.parseCallExpressionArguments(11); this.tsCheckForInvalidTypeCasts(node.arguments); node.typeParameters = typeArguments; if (state.optionalChainMember) { node.optional = isOptionalCall; } return this.finishCallExpression(node, state.optionalChainMember); } const tokenType = this.state.type; if (tokenType === 48 || tokenType === 52 || tokenType !== 10 && tokenCanStartExpression(tokenType) && !this.hasPrecedingLineBreak()) { return; } const node = this.startNodeAt(startLoc); node.expression = base; node.typeParameters = typeArguments; return this.finishNode(node, "TSInstantiationExpression"); }); if (missingParenErrorLoc) { this.unexpected(missingParenErrorLoc, 10); } if (result) { if (result.type === "TSInstantiationExpression" && (this.match(16) || this.match(18) && this.lookaheadCharCode() !== 40)) { this.raise(TSErrors.InvalidPropertyAccessAfterInstantiationExpression, this.state.startLoc); } return result; } } return super.parseSubscript(base, startLoc, noCalls, state); } parseNewCallee(node) { var _callee$extra; super.parseNewCallee(node); const { callee } = node; if (callee.type === "TSInstantiationExpression" && !((_callee$extra = callee.extra) != null && _callee$extra.parenthesized)) { node.typeParameters = callee.typeParameters; node.callee = callee.expression; } } parseExprOp(left, leftStartLoc, minPrec) { let isSatisfies; if (tokenOperatorPrecedence(58) > minPrec && !this.hasPrecedingLineBreak() && (this.isContextual(93) || (isSatisfies = this.isContextual(120)))) { const node = this.startNodeAt(leftStartLoc); node.expression = left; node.typeAnnotation = this.tsInType(() => { this.next(); if (this.match(75)) { if (isSatisfies) { this.raise(Errors.UnexpectedKeyword, this.state.startLoc, { keyword: "const" }); } return this.tsParseTypeReference(); } return this.tsParseType(); }); this.finishNode(node, isSatisfies ? "TSSatisfiesExpression" : "TSAsExpression"); this.reScan_lt_gt(); return this.parseExprOp(node, leftStartLoc, minPrec); } return super.parseExprOp(left, leftStartLoc, minPrec); } checkReservedWord(word, startLoc, checkKeywords, isBinding) { if (!this.state.isAmbientContext) { super.checkReservedWord(word, startLoc, checkKeywords, isBinding); } } checkImportReflection(node) { super.checkImportReflection(node); if (node.module && node.importKind !== "value") { this.raise(TSErrors.ImportReflectionHasImportType, node.specifiers[0].loc.start); } } checkDuplicateExports() {} isPotentialImportPhase(isExport) { if (super.isPotentialImportPhase(isExport)) return true; if (this.isContextual(130)) { const ch = this.lookaheadCharCode(); return isExport ? ch === 123 || ch === 42 : ch !== 61; } return !isExport && this.isContextual(87); } applyImportPhase(node, isExport, phase, loc) { super.applyImportPhase(node, isExport, phase, loc); if (isExport) { node.exportKind = phase === "type" ? "type" : "value"; } else { node.importKind = phase === "type" || phase === "typeof" ? phase : "value"; } } parseImport(node) { if (this.match(134)) { node.importKind = "value"; return super.parseImport(node); } let importNode; if (tokenIsIdentifier(this.state.type) && this.lookaheadCharCode() === 61) { node.importKind = "value"; return this.tsParseImportEqualsDeclaration(node); } else if (this.isContextual(130)) { const maybeDefaultIdentifier = this.parseMaybeImportPhase(node, false); if (this.lookaheadCharCode() === 61) { return this.tsParseImportEqualsDeclaration(node, maybeDefaultIdentifier); } else { importNode = super.parseImportSpecifiersAndAfter(node, maybeDefaultIdentifier); } } else { importNode = super.parseImport(node); } if (importNode.importKind === "type" && importNode.specifiers.length > 1 && importNode.specifiers[0].type === "ImportDefaultSpecifier") { this.raise(TSErrors.TypeImportCannotSpecifyDefaultAndNamed, importNode); } return importNode; } parseExport(node, decorators) { if (this.match(83)) { this.next(); const nodeImportEquals = node; let maybeDefaultIdentifier = null; if (this.isContextual(130) && this.isPotentialImportPhase(false)) { maybeDefaultIdentifier = this.parseMaybeImportPhase(nodeImportEquals, false); } else { nodeImportEquals.importKind = "value"; } return this.tsParseImportEqualsDeclaration(nodeImportEquals, maybeDefaultIdentifier, true); } else if (this.eat(29)) { const assign = node; assign.expression = super.parseExpression(); this.semicolon(); this.sawUnambiguousESM = true; return this.finishNode(assign, "TSExportAssignment"); } else if (this.eatContextual(93)) { const decl = node; this.expectContextual(128); decl.id = this.parseIdentifier(); this.semicolon(); return this.finishNode(decl, "TSNamespaceExportDeclaration"); } else { return super.parseExport(node, decorators); } } isAbstractClass() { return this.isContextual(124) && this.lookahead().type === 80; } parseExportDefaultExpression() { if (this.isAbstractClass()) { const cls = this.startNode(); this.next(); cls.abstract = true; return this.parseClass(cls, true, true); } if (this.match(129)) { const result = this.tsParseInterfaceDeclaration(this.startNode()); if (result) return result; } return super.parseExportDefaultExpression(); } parseVarStatement(node, kind, allowMissingInitializer = false) { const { isAmbientContext } = this.state; const declaration = super.parseVarStatement(node, kind, allowMissingInitializer || isAmbientContext); if (!isAmbientContext) return declaration; for (const { id, init } of declaration.declarations) { if (!init) continue; if (kind !== "const" || !!id.typeAnnotation) { this.raise(TSErrors.InitializerNotAllowedInAmbientContext, init); } else if (!isValidAmbientConstInitializer(init, this.hasPlugin("estree"))) { this.raise(TSErrors.ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference, init); } } return declaration; } parseStatementContent(flags, decorators) { if (this.match(75) && this.isLookaheadContextual("enum")) { const node = this.startNode(); this.expect(75); return this.tsParseEnumDeclaration(node, { const: true }); } if (this.isContextual(126)) { return this.tsParseEnumDeclaration(this.startNode()); } if (this.isContextual(129)) { const result = this.tsParseInterfaceDeclaration(this.startNode()); if (result) return result; } return super.parseStatementContent(flags, decorators); } parseAccessModifier() { return this.tsParseModifier(["public", "protected", "private"]); } tsHasSomeModifiers(member, modifiers) { return modifiers.some(modifier => { if (tsIsAccessModifier(modifier)) { return member.accessibility === modifier; } return !!member[modifier]; }); } tsIsStartOfStaticBlocks() { return this.isContextual(106) && this.lookaheadCharCode() === 123; } parseClassMember(classBody, member, state) { const modifiers = ["declare", "private", "public", "protected", "override", "abstract", "readonly", "static"]; this.tsParseModifiers({ allowedModifiers: modifiers, disallowedModifiers: ["in", "out"], stopOnStartOfClassStaticBlock: true, errorTemplate: TSErrors.InvalidModifierOnTypeParameterPositions }, member); const callParseClassMemberWithIsStatic = () => { if (this.tsIsStartOfStaticBlocks()) { this.next(); this.next(); if (this.tsHasSomeModifiers(member, modifiers)) { this.raise(TSErrors.StaticBlockCannotHaveModifier, this.state.curPosition()); } super.parseClassStaticBlock(classBody, member); } else { this.parseClassMemberWithIsStatic(classBody, member, state, !!member.static); } }; if (member.declare) { this.tsInAmbientContext(callParseClassMemberWithIsStatic); } else { callParseClassMemberWithIsStatic(); } } parseClassMemberWithIsStatic(classBody, member, state, isStatic) { const idx = this.tsTryParseIndexSignature(member); if (idx) { classBody.body.push(idx); if (member.abstract) { this.raise(TSErrors.IndexSignatureHasAbstract, member); } if (member.accessibility) { this.raise(TSErrors.IndexSignatureHasAccessibility, member, { modifier: member.accessibility }); } if (member.declare) { this.raise(TSErrors.IndexSignatureHasDeclare, member); } if (member.override) { this.raise(TSErrors.IndexSignatureHasOverride, member); } return; } if (!this.state.inAbstractClass && member.abstract) { this.raise(TSErrors.NonAbstractClassHasAbstractMethod, member); } if (member.override) { if (!state.hadSuperClass) { this.raise(TSErrors.OverrideNotInSubClass, member); } } super.parseClassMemberWithIsStatic(classBody, member, state, isStatic); } parsePostMemberNameModifiers(methodOrProp) { const optional = this.eat(17); if (optional) methodOrProp.optional = true; if (methodOrProp.readonly && this.match(10)) { this.raise(TSErrors.ClassMethodHasReadonly, methodOrProp); } if (methodOrProp.declare && this.match(10)) { this.raise(TSErrors.ClassMethodHasDeclare, methodOrProp); } } parseExpressionStatement(node, expr, decorators) { const decl = expr.type === "Identifier" ? this.tsParseExpressionStatement(node, expr, decorators) : undefined; return decl || super.parseExpressionStatement(node, expr, decorators); } shouldParseExportDeclaration() { if (this.tsIsDeclarationStart()) return true; return super.shouldParseExportDeclaration(); } parseConditional(expr, startLoc, refExpressionErrors) { if (!this.state.maybeInArrowParameters || !this.match(17)) { return super.parseConditional(expr, startLoc, refExpressionErrors); } const result = this.tryParse(() => super.parseConditional(expr, startLoc)); if (!result.node) { if (result.error) { super.setOptionalParametersError(refExpressionErrors, result.error); } return expr; } if (result.error) this.state = result.failState; return result.node; } parseParenItem(node, startLoc) { const newNode = super.parseParenItem(node, startLoc); if (this.eat(17)) { newNode.optional = true; this.resetEndLocation(node); } if (this.match(14)) { const typeCastNode = this.startNodeAt(startLoc); typeCastNode.expression = node; typeCastNode.typeAnnotation = this.tsParseTypeAnnotation(); return this.finishNode(typeCastNode, "TSTypeCastExpression"); } return node; } parseExportDeclaration(node) { if (!this.state.isAmbientContext && this.isContextual(125)) { return this.tsInAmbientContext(() => this.parseExportDeclaration(node)); } const startLoc = this.state.startLoc; const isDeclare = this.eatContextual(125); if (isDeclare && (this.isContextual(125) || !this.shouldParseExportDeclaration())) { throw this.raise(TSErrors.ExpectedAmbientAfterExportDeclare, this.state.startLoc); } const isIdentifier = tokenIsIdentifier(this.state.type); const declaration = isIdentifier && this.tsTryParseExportDeclaration() || super.parseExportDeclaration(node); if (!declaration) return null; if (declaration.type === "TSInterfaceDeclaration" || declaration.type === "TSTypeAliasDeclaration" || isDeclare) { node.exportKind = "type"; } if (isDeclare) { this.resetStartLocation(declaration, startLoc); declaration.declare = true; } return declaration; } parseClassId(node, isStatement, optionalId, bindingType) { if ((!isStatement || optionalId) && this.isContextual(113)) { return; } super.parseClassId(node, isStatement, optionalId, node.declare ? 1024 : 8331); const typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers); if (typeParameters) node.typeParameters = typeParameters; } parseClassPropertyAnnotation(node) { if (!node.optional) { if (this.eat(35)) { node.definite = true; } else if (this.eat(17)) { node.optional = true; } } const type = this.tsTryParseTypeAnnotation(); if (type) node.typeAnnotation = type; } parseClassProperty(node) { this.parseClassPropertyAnnotation(node); if (this.state.isAmbientContext && !(node.readonly && !node.typeAnnotation) && this.match(29)) { this.raise(TSErrors.DeclareClassFieldHasInitializer, this.state.startLoc); } if (node.abstract && this.match(29)) { const { key } = node; this.raise(TSErrors.AbstractPropertyHasInitializer, this.state.startLoc, { propertyName: key.type === "Identifier" && !node.computed ? key.name : `[${this.input.slice(this.offsetToSourcePos(key.start), this.offsetToSourcePos(key.end))}]` }); } return super.parseClassProperty(node); } parseClassPrivateProperty(node) { if (node.abstract) { this.raise(TSErrors.PrivateElementHasAbstract, node); } if (node.accessibility) { this.raise(TSErrors.PrivateElementHasAccessibility, node, { modifier: node.accessibility }); } this.parseClassPropertyAnnotation(node); return super.parseClassPrivateProperty(node); } parseClassAccessorProperty(node) { this.parseClassPropertyAnnotation(node); if (node.optional) { this.raise(TSErrors.AccessorCannotBeOptional, node); } return super.parseClassAccessorProperty(node); } pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier); if (typeParameters && isConstructor) { this.raise(TSErrors.ConstructorHasTypeParameters, typeParameters); } const { declare = false, kind } = method; if (declare && (kind === "get" || kind === "set")) { this.raise(TSErrors.DeclareAccessor, method, { kind }); } if (typeParameters) method.typeParameters = typeParameters; super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper); } pushClassPrivateMethod(classBody, method, isGenerator, isAsync) { const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier); if (typeParameters) method.typeParameters = typeParameters; super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync); } declareClassPrivateMethodInScope(node, kind) { if (node.type === "TSDeclareMethod") return; if (node.type === "MethodDefinition" && !hasOwnProperty.call(node.value, "body")) { return; } super.declareClassPrivateMethodInScope(node, kind); } parseClassSuper(node) { super.parseClassSuper(node); if (node.superClass && (this.match(47) || this.match(51))) { node.superTypeParameters = this.tsParseTypeArgumentsInExpression(); } if (this.eatContextual(113)) { node.implements = this.tsParseHeritageClause("implements"); } } parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) { const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier); if (typeParameters) prop.typeParameters = typeParameters; return super.parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors); } parseFunctionParams(node, isConstructor) { const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier); if (typeParameters) node.typeParameters = typeParameters; super.parseFunctionParams(node, isConstructor); } parseVarId(decl, kind) { super.parseVarId(decl, kind); if (decl.id.type === "Identifier" && !this.hasPrecedingLineBreak() && this.eat(35)) { decl.definite = true; } const type = this.tsTryParseTypeAnnotation(); if (type) { decl.id.typeAnnotation = type; this.resetEndLocation(decl.id); } } parseAsyncArrowFromCallExpression(node, call) { if (this.match(14)) { node.returnType = this.tsParseTypeAnnotation(); } return super.parseAsyncArrowFromCallExpression(node, call); } parseMaybeAssign(refExpressionErrors, afterLeftParse) { var _jsx, _jsx2, _typeCast, _jsx3, _typeCast2; let state; let jsx; let typeCast; if (this.hasPlugin("jsx") && (this.match(143) || this.match(47))) { state = this.state.clone(); jsx = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state); if (!jsx.error) return jsx.node; const { context } = this.state; const currentContext = context[context.length - 1]; if (currentContext === types.j_oTag || currentContext === types.j_expr) { context.pop(); } } if (!((_jsx = jsx) != null && _jsx.error) && !this.match(47)) { return super.parseMaybeAssign(refExpressionErrors, afterLeftParse); } if (!state || state === this.state) state = this.state.clone(); let typeParameters; const arrow = this.tryParse(abort => { var _expr$extra, _typeParameters; typeParameters = this.tsParseTypeParameters(this.tsParseConstModifier); const expr = super.parseMaybeAssign(refExpressionErrors, afterLeftParse); if (expr.type !== "ArrowFunctionExpression" || (_expr$extra = expr.extra) != null && _expr$extra.parenthesized) { abort(); } if (((_typeParameters = typeParameters) == null ? void 0 : _typeParameters.params.length) !== 0) { this.resetStartLocationFromNode(expr, typeParameters); } expr.typeParameters = typeParameters; return expr; }, state); if (!arrow.error && !arrow.aborted) { if (typeParameters) this.reportReservedArrowTypeParam(typeParameters); return arrow.node; } if (!jsx) { assert(!this.hasPlugin("jsx")); typeCast = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state); if (!typeCast.error) return typeCast.node; } if ((_jsx2 = jsx) != null && _jsx2.node) { this.state = jsx.failState; return jsx.node; } if (arrow.node) { this.state = arrow.failState; if (typeParameters) this.reportReservedArrowTypeParam(typeParameters); return arrow.node; } if ((_typeCast = typeCast) != null && _typeCast.node) { this.state = typeCast.failState; return typeCast.node; } throw ((_jsx3 = jsx) == null ? void 0 : _jsx3.error) || arrow.error || ((_typeCast2 = typeCast) == null ? void 0 : _typeCast2.error); } reportReservedArrowTypeParam(node) { var _node$extra; if (node.params.length === 1 && !node.params[0].constraint && !((_node$extra = node.extra) != null && _node$extra.trailingComma) && this.getPluginOption("typescript", "disallowAmbiguousJSXLike")) { this.raise(TSErrors.ReservedArrowTypeParam, node); } } parseMaybeUnary(refExpressionErrors, sawUnary) { if (!this.hasPlugin("jsx") && this.match(47)) { return this.tsParseTypeAssertion(); } return super.parseMaybeUnary(refExpressionErrors, sawUnary); } parseArrow(node) { if (this.match(14)) { const result = this.tryParse(abort => { const returnType = this.tsParseTypeOrTypePredicateAnnotation(14); if (this.canInsertSemicolon() || !this.match(19)) abort(); return returnType; }); if (result.aborted) return; if (!result.thrown) { if (result.error) this.state = result.failState; node.returnType = result.node; } } return super.parseArrow(node); } parseFunctionParamType(param) { if (this.eat(17)) { param.optional = true; } const type = this.tsTryParseTypeAnnotation(); if (type) param.typeAnnotation = type; this.resetEndLocation(param); return param; } isAssignable(node, isBinding) { switch (node.type) { case "TSTypeCastExpression": return this.isAssignable(node.expression, isBinding); case "TSParameterProperty": return true; default: return super.isAssignable(node, isBinding); } } toAssignable(node, isLHS = false) { switch (node.type) { case "ParenthesizedExpression": this.toAssignableParenthesizedExpression(node, isLHS); break; case "TSAsExpression": case "TSSatisfiesExpression": case "TSNonNullExpression": case "TSTypeAssertion": if (isLHS) { this.expressionScope.recordArrowParameterBindingError(TSErrors.UnexpectedTypeCastInParameter, node); } else { this.raise(TSErrors.UnexpectedTypeCastInParameter, node); } this.toAssignable(node.expression, isLHS); break; case "AssignmentExpression": if (!isLHS && node.left.type === "TSTypeCastExpression") { node.left = this.typeCastToParameter(node.left); } default: super.toAssignable(node, isLHS); } } toAssignableParenthesizedExpression(node, isLHS) { switch (node.expression.type) { case "TSAsExpression": case "TSSatisfiesExpression": case "TSNonNullExpression": case "TSTypeAssertion": case "ParenthesizedExpression": this.toAssignable(node.expression, isLHS); break; default: super.toAssignable(node, isLHS); } } checkToRestConversion(node, allowPattern) { switch (node.type) { case "TSAsExpression": case "TSSatisfiesExpression": case "TSTypeAssertion": case "TSNonNullExpression": this.checkToRestConversion(node.expression, false); break; default: super.checkToRestConversion(node, allowPattern); } } isValidLVal(type, isUnparenthesizedInAssign, binding) { switch (type) { case "TSTypeCastExpression": return true; case "TSParameterProperty": return "parameter"; case "TSNonNullExpression": case "TSInstantiationExpression": return "expression"; case "TSAsExpression": case "TSSatisfiesExpression": case "TSTypeAssertion": return (binding !== 64 || !isUnparenthesizedInAssign) && ["expression", true]; default: return super.isValidLVal(type, isUnparenthesizedInAssign, binding); } } parseBindingAtom() { if (this.state.type === 78) { return this.parseIdentifier(true); } return super.parseBindingAtom(); } parseMaybeDecoratorArguments(expr) { if (this.match(47) || this.match(51)) { const typeArguments = this.tsParseTypeArgumentsInExpression(); if (this.match(10)) { const call = super.parseMaybeDecoratorArguments(expr); call.typeParameters = typeArguments; return call; } this.unexpected(null, 10); } return super.parseMaybeDecoratorArguments(expr); } checkCommaAfterRest(close) { if (this.state.isAmbientContext && this.match(12) && this.lookaheadCharCode() === close) { this.next(); return false; } return super.checkCommaAfterRest(close); } isClassMethod() { return this.match(47) || super.isClassMethod(); } isClassProperty() { return this.match(35) || this.match(14) || super.isClassProperty(); } parseMaybeDefault(startLoc, left) { const node = super.parseMaybeDefault(startLoc, left); if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) { this.raise(TSErrors.TypeAnnotationAfterAssign, node.typeAnnotation); } return node; } getTokenFromCode(code) { if (this.state.inType) { if (code === 62) { this.finishOp(48, 1); return; } if (code === 60) { this.finishOp(47, 1); return; } } super.getTokenFromCode(code); } reScan_lt_gt() { const { type } = this.state; if (type === 47) { this.state.pos -= 1; this.readToken_lt(); } else if (type === 48) { this.state.pos -= 1; this.readToken_gt(); } } reScan_lt() { const { type } = this.state; if (type === 51) { this.state.pos -= 2; this.finishOp(47, 1); return 47; } return type; } toAssignableList(exprList, trailingCommaLoc, isLHS) { for (let i = 0; i < exprList.length; i++) { const expr = exprList[i]; if ((expr == null ? void 0 : expr.type) === "TSTypeCastExpression") { exprList[i] = this.typeCastToParameter(expr); } } super.toAssignableList(exprList, trailingCommaLoc, isLHS); } typeCastToParameter(node) { node.expression.typeAnnotation = node.typeAnnotation; this.resetEndLocation(node.expression, node.typeAnnotation.loc.end); return node.expression; } shouldParseArrow(params) { if (this.match(14)) { return params.every(expr => this.isAssignable(expr, true)); } return super.shouldParseArrow(params); } shouldParseAsyncArrow() { return this.match(14) || super.shouldParseAsyncArrow(); } canHaveLeadingDecorator() { return super.canHaveLeadingDecorator() || this.isAbstractClass(); } jsxParseOpeningElementAfterName(node) { if (this.match(47) || this.match(51)) { const typeArguments = this.tsTryParseAndCatch(() => this.tsParseTypeArgumentsInExpression()); if (typeArguments) node.typeParameters = typeArguments; } return super.jsxParseOpeningElementAfterName(node); } getGetterSetterExpectedParamCount(method) { const baseCount = super.getGetterSetterExpectedParamCount(method); const params = this.getObjectOrClassMethodParams(method); const firstParam = params[0]; const hasContextParam = firstParam && this.isThisParam(firstParam); return hasContextParam ? baseCount + 1 : baseCount; } parseCatchClauseParam() { const param = super.parseCatchClauseParam(); const type = this.tsTryParseTypeAnnotation(); if (type) { param.typeAnnotation = type; this.resetEndLocation(param); } return param; } tsInAmbientContext(cb) { const { isAmbientContext: oldIsAmbientContext, strict: oldStrict } = this.state; this.state.isAmbientContext = true; this.state.strict = false; try { return cb(); } finally { this.state.isAmbientContext = oldIsAmbientContext; this.state.strict = oldStrict; } } parseClass(node, isStatement, optionalId) { const oldInAbstractClass = this.state.inAbstractClass; this.state.inAbstractClass = !!node.abstract; try { return super.parseClass(node, isStatement, optionalId); } finally { this.state.inAbstractClass = oldInAbstractClass; } } tsParseAbstractDeclaration(node, decorators) { if (this.match(80)) { node.abstract = true; return this.maybeTakeDecorators(decorators, this.parseClass(node, true, false)); } else if (this.isContextual(129)) { if (!this.hasFollowingLineBreak()) { node.abstract = true; this.raise(TSErrors.NonClassMethodPropertyHasAbstractModifer, node); return this.tsParseInterfaceDeclaration(node); } } else { this.unexpected(null, 80); } } parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope) { const method = super.parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope); if (method.abstract) { const hasBody = this.hasPlugin("estree") ? !!method.value.body : !!method.body; if (hasBody) { const { key } = method; this.raise(TSErrors.AbstractMethodHasImplementation, method, { methodName: key.type === "Identifier" && !method.computed ? key.name : `[${this.input.slice(this.offsetToSourcePos(key.start), this.offsetToSourcePos(key.end))}]` }); } } return method; } tsParseTypeParameterName() { const typeName = this.parseIdentifier(); return typeName.name; } shouldParseAsAmbientContext() { return !!this.getPluginOption("typescript", "dts"); } parse() { if (this.shouldParseAsAmbientContext()) { this.state.isAmbientContext = true; } return super.parse(); } getExpression() { if (this.shouldParseAsAmbientContext()) { this.state.isAmbientContext = true; } return super.getExpression(); } parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly) { if (!isString && isMaybeTypeOnly) { this.parseTypeOnlyImportExportSpecifier(node, false, isInTypeExport); return this.finishNode(node, "ExportSpecifier"); } node.exportKind = "value"; return super.parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly); } parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, bindingType) { if (!importedIsString && isMaybeTypeOnly) { this.parseTypeOnlyImportExportSpecifier(specifier, true, isInTypeOnlyImport); return this.finishNode(specifier, "ImportSpecifier"); } specifier.importKind = "value"; return super.parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, isInTypeOnlyImport ? 4098 : 4096); } parseTypeOnlyImportExportSpecifier(node, isImport, isInTypeOnlyImportExport) { const leftOfAsKey = isImport ? "imported" : "local"; const rightOfAsKey = isImport ? "local" : "exported"; let leftOfAs = node[leftOfAsKey]; let rightOfAs; let hasTypeSpecifier = false; let canParseAsKeyword = true; const loc = leftOfAs.loc.start; if (this.isContextual(93)) { const firstAs = this.parseIdentifier(); if (this.isContextual(93)) { const secondAs = this.parseIdentifier(); if (tokenIsKeywordOrIdentifier(this.state.type)) { hasTypeSpecifier = true; leftOfAs = firstAs; rightOfAs = isImport ? this.parseIdentifier() : this.parseModuleExportName(); canParseAsKeyword = false; } else { rightOfAs = secondAs; canParseAsKeyword = false; } } else if (tokenIsKeywordOrIdentifier(this.state.type)) { canParseAsKeyword = false; rightOfAs = isImport ? this.parseIdentifier() : this.parseModuleExportName(); } else { hasTypeSpecifier = true; leftOfAs = firstAs; } } else if (tokenIsKeywordOrIdentifier(this.state.type)) { hasTypeSpecifier = true; if (isImport) { leftOfAs = this.parseIdentifier(true); if (!this.isContextual(93)) { this.checkReservedWord(leftOfAs.name, leftOfAs.loc.start, true, true); } } else { leftOfAs = this.parseModuleExportName(); } } if (hasTypeSpecifier && isInTypeOnlyImportExport) { this.raise(isImport ? TSErrors.TypeModifierIsUsedInTypeImports : TSErrors.TypeModifierIsUsedInTypeExports, loc); } node[leftOfAsKey] = leftOfAs; node[rightOfAsKey] = rightOfAs; const kindKey = isImport ? "importKind" : "exportKind"; node[kindKey] = hasTypeSpecifier ? "type" : "value"; if (canParseAsKeyword && this.eatContextual(93)) { node[rightOfAsKey] = isImport ? this.parseIdentifier() : this.parseModuleExportName(); } if (!node[rightOfAsKey]) { node[rightOfAsKey] = cloneIdentifier(node[leftOfAsKey]); } if (isImport) { this.checkIdentifier(node[rightOfAsKey], hasTypeSpecifier ? 4098 : 4096); } } }; function isPossiblyLiteralEnum(expression) { if (expression.type !== "MemberExpression") return false; const { computed, property } = expression; if (computed && property.type !== "StringLiteral" && (property.type !== "TemplateLiteral" || property.expressions.length > 0)) { return false; } return isUncomputedMemberExpressionChain(expression.object); } function isValidAmbientConstInitializer(expression, estree) { var _expression$extra; const { type } = expression; if ((_expression$extra = expression.extra) != null && _expression$extra.parenthesized) { return false; } if (estree) { if (type === "Literal") { const { value } = expression; if (typeof value === "string" || typeof value === "boolean") { return true; } } } else { if (type === "StringLiteral" || type === "BooleanLiteral") { return true; } } if (isNumber(expression, estree) || isNegativeNumber(expression, estree)) { return true; } if (type === "TemplateLiteral" && expression.expressions.length === 0) { return true; } if (isPossiblyLiteralEnum(expression)) { return true; } return false; } function isNumber(expression, estree) { if (estree) { return expression.type === "Literal" && (typeof expression.value === "number" || "bigint" in expression); } return expression.type === "NumericLiteral" || expression.type === "BigIntLiteral"; } function isNegativeNumber(expression, estree) { if (expression.type === "UnaryExpression") { const { operator, argument } = expression; if (operator === "-" && isNumber(argument, estree)) { return true; } } return false; } function isUncomputedMemberExpressionChain(expression) { if (expression.type === "Identifier") return true; if (expression.type !== "MemberExpression" || expression.computed) { return false; } return isUncomputedMemberExpressionChain(expression.object); } const PlaceholderErrors = ParseErrorEnum`placeholders`({ ClassNameIsRequired: "A class name is required.", UnexpectedSpace: "Unexpected space in placeholder." }); var placeholders = superClass => class PlaceholdersParserMixin extends superClass { parsePlaceholder(expectedNode) { if (this.match(133)) { const node = this.startNode(); this.next(); this.assertNoSpace(); node.name = super.parseIdentifier(true); this.assertNoSpace(); this.expect(133); return this.finishPlaceholder(node, expectedNode); } } finishPlaceholder(node, expectedNode) { let placeholder = node; if (!placeholder.expectedNode || !placeholder.type) { placeholder = this.finishNode(placeholder, "Placeholder"); } placeholder.expectedNode = expectedNode; return placeholder; } getTokenFromCode(code) { if (code === 37 && this.input.charCodeAt(this.state.pos + 1) === 37) { this.finishOp(133, 2); } else { super.getTokenFromCode(code); } } parseExprAtom(refExpressionErrors) { return this.parsePlaceholder("Expression") || super.parseExprAtom(refExpressionErrors); } parseIdentifier(liberal) { return this.parsePlaceholder("Identifier") || super.parseIdentifier(liberal); } checkReservedWord(word, startLoc, checkKeywords, isBinding) { if (word !== undefined) { super.checkReservedWord(word, startLoc, checkKeywords, isBinding); } } parseBindingAtom() { return this.parsePlaceholder("Pattern") || super.parseBindingAtom(); } isValidLVal(type, isParenthesized, binding) { return type === "Placeholder" || super.isValidLVal(type, isParenthesized, binding); } toAssignable(node, isLHS) { if (node && node.type === "Placeholder" && node.expectedNode === "Expression") { node.expectedNode = "Pattern"; } else { super.toAssignable(node, isLHS); } } chStartsBindingIdentifier(ch, pos) { if (super.chStartsBindingIdentifier(ch, pos)) { return true; } const nextToken = this.lookahead(); if (nextToken.type === 133) { return true; } return false; } verifyBreakContinue(node, isBreak) { if (node.label && node.label.type === "Placeholder") return; super.verifyBreakContinue(node, isBreak); } parseExpressionStatement(node, expr) { var _expr$extra; if (expr.type !== "Placeholder" || (_expr$extra = expr.extra) != null && _expr$extra.parenthesized) { return super.parseExpressionStatement(node, expr); } if (this.match(14)) { const stmt = node; stmt.label = this.finishPlaceholder(expr, "Identifier"); this.next(); stmt.body = super.parseStatementOrSloppyAnnexBFunctionDeclaration(); return this.finishNode(stmt, "LabeledStatement"); } this.semicolon(); const stmtPlaceholder = node; stmtPlaceholder.name = expr.name; return this.finishPlaceholder(stmtPlaceholder, "Statement"); } parseBlock(allowDirectives, createNewLexicalScope, afterBlockParse) { return this.parsePlaceholder("BlockStatement") || super.parseBlock(allowDirectives, createNewLexicalScope, afterBlockParse); } parseFunctionId(requireId) { return this.parsePlaceholder("Identifier") || super.parseFunctionId(requireId); } parseClass(node, isStatement, optionalId) { const type = isStatement ? "ClassDeclaration" : "ClassExpression"; this.next(); const oldStrict = this.state.strict; const placeholder = this.parsePlaceholder("Identifier"); if (placeholder) { if (this.match(81) || this.match(133) || this.match(5)) { node.id = placeholder; } else if (optionalId || !isStatement) { node.id = null; node.body = this.finishPlaceholder(placeholder, "ClassBody"); return this.finishNode(node, type); } else { throw this.raise(PlaceholderErrors.ClassNameIsRequired, this.state.startLoc); } } else { this.parseClassId(node, isStatement, optionalId); } super.parseClassSuper(node); node.body = this.parsePlaceholder("ClassBody") || super.parseClassBody(!!node.superClass, oldStrict); return this.finishNode(node, type); } parseExport(node, decorators) { const placeholder = this.parsePlaceholder("Identifier"); if (!placeholder) return super.parseExport(node, decorators); const node2 = node; if (!this.isContextual(98) && !this.match(12)) { node2.specifiers = []; node2.source = null; node2.declaration = this.finishPlaceholder(placeholder, "Declaration"); return this.finishNode(node2, "ExportNamedDeclaration"); } this.expectPlugin("exportDefaultFrom"); const specifier = this.startNode(); specifier.exported = placeholder; node2.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")]; return super.parseExport(node2, decorators); } isExportDefaultSpecifier() { if (this.match(65)) { const next = this.nextTokenStart(); if (this.isUnparsedContextual(next, "from")) { if (this.input.startsWith(tokenLabelName(133), this.nextTokenStartSince(next + 4))) { return true; } } } return super.isExportDefaultSpecifier(); } maybeParseExportDefaultSpecifier(node, maybeDefaultIdentifier) { var _specifiers; if ((_specifiers = node.specifiers) != null && _specifiers.length) { return true; } return super.maybeParseExportDefaultSpecifier(node, maybeDefaultIdentifier); } checkExport(node) { const { specifiers } = node; if (specifiers != null && specifiers.length) { node.specifiers = specifiers.filter(node => node.exported.type === "Placeholder"); } super.checkExport(node); node.specifiers = specifiers; } parseImport(node) { const placeholder = this.parsePlaceholder("Identifier"); if (!placeholder) return super.parseImport(node); node.specifiers = []; if (!this.isContextual(98) && !this.match(12)) { node.source = this.finishPlaceholder(placeholder, "StringLiteral"); this.semicolon(); return this.finishNode(node, "ImportDeclaration"); } const specifier = this.startNodeAtNode(placeholder); specifier.local = placeholder; node.specifiers.push(this.finishNode(specifier, "ImportDefaultSpecifier")); if (this.eat(12)) { const hasStarImport = this.maybeParseStarImportSpecifier(node); if (!hasStarImport) this.parseNamedImportSpecifiers(node); } this.expectContextual(98); node.source = this.parseImportSource(); this.semicolon(); return this.finishNode(node, "ImportDeclaration"); } parseImportSource() { return this.parsePlaceholder("StringLiteral") || super.parseImportSource(); } assertNoSpace() { if (this.state.start > this.offsetToSourcePos(this.state.lastTokEndLoc.index)) { this.raise(PlaceholderErrors.UnexpectedSpace, this.state.lastTokEndLoc); } } }; var v8intrinsic = superClass => class V8IntrinsicMixin extends superClass { parseV8Intrinsic() { if (this.match(54)) { const v8IntrinsicStartLoc = this.state.startLoc; const node = this.startNode(); this.next(); if (tokenIsIdentifier(this.state.type)) { const name = this.parseIdentifierName(); const identifier = this.createIdentifier(node, name); identifier.type = "V8IntrinsicIdentifier"; if (this.match(10)) { return identifier; } } this.unexpected(v8IntrinsicStartLoc); } } parseExprAtom(refExpressionErrors) { return this.parseV8Intrinsic() || super.parseExprAtom(refExpressionErrors); } }; const PIPELINE_PROPOSALS = ["minimal", "fsharp", "hack", "smart"]; const TOPIC_TOKENS = ["^^", "@@", "^", "%", "#"]; function validatePlugins(pluginsMap) { if (pluginsMap.has("decorators")) { if (pluginsMap.has("decorators-legacy")) { throw new Error("Cannot use the decorators and decorators-legacy plugin together"); } const decoratorsBeforeExport = pluginsMap.get("decorators").decoratorsBeforeExport; if (decoratorsBeforeExport != null && typeof decoratorsBeforeExport !== "boolean") { throw new Error("'decoratorsBeforeExport' must be a boolean, if specified."); } const allowCallParenthesized = pluginsMap.get("decorators").allowCallParenthesized; if (allowCallParenthesized != null && typeof allowCallParenthesized !== "boolean") { throw new Error("'allowCallParenthesized' must be a boolean."); } } if (pluginsMap.has("flow") && pluginsMap.has("typescript")) { throw new Error("Cannot combine flow and typescript plugins."); } if (pluginsMap.has("placeholders") && pluginsMap.has("v8intrinsic")) { throw new Error("Cannot combine placeholders and v8intrinsic plugins."); } if (pluginsMap.has("pipelineOperator")) { var _pluginsMap$get; const proposal = pluginsMap.get("pipelineOperator").proposal; if (!PIPELINE_PROPOSALS.includes(proposal)) { const proposalList = PIPELINE_PROPOSALS.map(p => `"${p}"`).join(", "); throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${proposalList}.`); } const tupleSyntaxIsHash = ((_pluginsMap$get = pluginsMap.get("recordAndTuple")) == null ? void 0 : _pluginsMap$get.syntaxType) === "hash"; if (proposal === "hack") { if (pluginsMap.has("placeholders")) { throw new Error("Cannot combine placeholders plugin and Hack-style pipes."); } if (pluginsMap.has("v8intrinsic")) { throw new Error("Cannot combine v8intrinsic plugin and Hack-style pipes."); } const topicToken = pluginsMap.get("pipelineOperator").topicToken; if (!TOPIC_TOKENS.includes(topicToken)) { const tokenList = TOPIC_TOKENS.map(t => `"${t}"`).join(", "); throw new Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${tokenList}.`); } if (topicToken === "#" && tupleSyntaxIsHash) { throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "hack", topicToken: "#" }]\` and \`${JSON.stringify(["recordAndTuple", pluginsMap.get("recordAndTuple")])}\`.`); } } else if (proposal === "smart" && tupleSyntaxIsHash) { throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "smart" }]\` and \`${JSON.stringify(["recordAndTuple", pluginsMap.get("recordAndTuple")])}\`.`); } } if (pluginsMap.has("moduleAttributes")) { { if (pluginsMap.has("deprecatedImportAssert") || pluginsMap.has("importAssertions")) { throw new Error("Cannot combine importAssertions, deprecatedImportAssert and moduleAttributes plugins."); } const moduleAttributesVersionPluginOption = pluginsMap.get("moduleAttributes").version; if (moduleAttributesVersionPluginOption !== "may-2020") { throw new Error("The 'moduleAttributes' plugin requires a 'version' option," + " representing the last proposal update. Currently, the" + " only supported value is 'may-2020'."); } } } if (pluginsMap.has("importAssertions")) { if (pluginsMap.has("deprecatedImportAssert")) { throw new Error("Cannot combine importAssertions and deprecatedImportAssert plugins."); } } if (!pluginsMap.has("deprecatedImportAssert") && pluginsMap.has("importAttributes") && pluginsMap.get("importAttributes").deprecatedAssertSyntax) { { pluginsMap.set("deprecatedImportAssert", {}); } } if (pluginsMap.has("recordAndTuple")) { const syntaxType = pluginsMap.get("recordAndTuple").syntaxType; if (syntaxType != null) { { const RECORD_AND_TUPLE_SYNTAX_TYPES = ["hash", "bar"]; if (!RECORD_AND_TUPLE_SYNTAX_TYPES.includes(syntaxType)) { throw new Error("The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: " + RECORD_AND_TUPLE_SYNTAX_TYPES.map(p => `'${p}'`).join(", ")); } } } } if (pluginsMap.has("asyncDoExpressions") && !pluginsMap.has("doExpressions")) { const error = new Error("'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins."); error.missingPlugins = "doExpressions"; throw error; } if (pluginsMap.has("optionalChainingAssign") && pluginsMap.get("optionalChainingAssign").version !== "2023-07") { throw new Error("The 'optionalChainingAssign' plugin requires a 'version' option," + " representing the last proposal update. Currently, the" + " only supported value is '2023-07'."); } } const mixinPlugins = { estree, jsx, flow, typescript, v8intrinsic, placeholders }; const mixinPluginNames = Object.keys(mixinPlugins); function createDefaultOptions() { return { sourceType: "script", sourceFilename: undefined, startIndex: 0, startColumn: 0, startLine: 1, allowAwaitOutsideFunction: false, allowReturnOutsideFunction: false, allowNewTargetOutsideFunction: false, allowImportExportEverywhere: false, allowSuperOutsideMethod: false, allowUndeclaredExports: false, plugins: [], strictMode: null, ranges: false, tokens: false, createImportExpressions: false, createParenthesizedExpressions: false, errorRecovery: false, attachComment: true, annexB: true }; } function getOptions(opts) { const options = createDefaultOptions(); if (opts == null) { return options; } if (opts.annexB != null && opts.annexB !== false) { throw new Error("The `annexB` option can only be set to `false`."); } for (const key of Object.keys(options)) { if (opts[key] != null) options[key] = opts[key]; } if (options.startLine === 1) { if (opts.startIndex == null && options.startColumn > 0) { options.startIndex = options.startColumn; } else if (opts.startColumn == null && options.startIndex > 0) { options.startColumn = options.startIndex; } } else if (opts.startColumn == null || opts.startIndex == null) { if (opts.startIndex != null) { throw new Error("With a `startLine > 1` you must also specify `startIndex` and `startColumn`."); } } return options; } class ExpressionParser extends LValParser { checkProto(prop, isRecord, protoRef, refExpressionErrors) { if (prop.type === "SpreadElement" || this.isObjectMethod(prop) || prop.computed || prop.shorthand) { return; } const key = prop.key; const name = key.type === "Identifier" ? key.name : key.value; if (name === "__proto__") { if (isRecord) { this.raise(Errors.RecordNoProto, key); return; } if (protoRef.used) { if (refExpressionErrors) { if (refExpressionErrors.doubleProtoLoc === null) { refExpressionErrors.doubleProtoLoc = key.loc.start; } } else { this.raise(Errors.DuplicateProto, key); } } protoRef.used = true; } } shouldExitDescending(expr, potentialArrowAt) { return expr.type === "ArrowFunctionExpression" && this.offsetToSourcePos(expr.start) === potentialArrowAt; } getExpression() { this.enterInitialScopes(); this.nextToken(); const expr = this.parseExpression(); if (!this.match(140)) { this.unexpected(); } this.finalizeRemainingComments(); expr.comments = this.comments; expr.errors = this.state.errors; if (this.options.tokens) { expr.tokens = this.tokens; } return expr; } parseExpression(disallowIn, refExpressionErrors) { if (disallowIn) { return this.disallowInAnd(() => this.parseExpressionBase(refExpressionErrors)); } return this.allowInAnd(() => this.parseExpressionBase(refExpressionErrors)); } parseExpressionBase(refExpressionErrors) { const startLoc = this.state.startLoc; const expr = this.parseMaybeAssign(refExpressionErrors); if (this.match(12)) { const node = this.startNodeAt(startLoc); node.expressions = [expr]; while (this.eat(12)) { node.expressions.push(this.parseMaybeAssign(refExpressionErrors)); } this.toReferencedList(node.expressions); return this.finishNode(node, "SequenceExpression"); } return expr; } parseMaybeAssignDisallowIn(refExpressionErrors, afterLeftParse) { return this.disallowInAnd(() => this.parseMaybeAssign(refExpressionErrors, afterLeftParse)); } parseMaybeAssignAllowIn(refExpressionErrors, afterLeftParse) { return this.allowInAnd(() => this.parseMaybeAssign(refExpressionErrors, afterLeftParse)); } setOptionalParametersError(refExpressionErrors, resultError) { var _resultError$loc; refExpressionErrors.optionalParametersLoc = (_resultError$loc = resultError == null ? void 0 : resultError.loc) != null ? _resultError$loc : this.state.startLoc; } parseMaybeAssign(refExpressionErrors, afterLeftParse) { const startLoc = this.state.startLoc; if (this.isContextual(108)) { if (this.prodParam.hasYield) { let left = this.parseYield(); if (afterLeftParse) { left = afterLeftParse.call(this, left, startLoc); } return left; } } let ownExpressionErrors; if (refExpressionErrors) { ownExpressionErrors = false; } else { refExpressionErrors = new ExpressionErrors(); ownExpressionErrors = true; } const { type } = this.state; if (type === 10 || tokenIsIdentifier(type)) { this.state.potentialArrowAt = this.state.start; } let left = this.parseMaybeConditional(refExpressionErrors); if (afterLeftParse) { left = afterLeftParse.call(this, left, startLoc); } if (tokenIsAssignment(this.state.type)) { const node = this.startNodeAt(startLoc); const operator = this.state.value; node.operator = operator; if (this.match(29)) { this.toAssignable(left, true); node.left = left; const startIndex = startLoc.index; if (refExpressionErrors.doubleProtoLoc != null && refExpressionErrors.doubleProtoLoc.index >= startIndex) { refExpressionErrors.doubleProtoLoc = null; } if (refExpressionErrors.shorthandAssignLoc != null && refExpressionErrors.shorthandAssignLoc.index >= startIndex) { refExpressionErrors.shorthandAssignLoc = null; } if (refExpressionErrors.privateKeyLoc != null && refExpressionErrors.privateKeyLoc.index >= startIndex) { this.checkDestructuringPrivate(refExpressionErrors); refExpressionErrors.privateKeyLoc = null; } } else { node.left = left; } this.next(); node.right = this.parseMaybeAssign(); this.checkLVal(left, this.finishNode(node, "AssignmentExpression")); return node; } else if (ownExpressionErrors) { this.checkExpressionErrors(refExpressionErrors, true); } return left; } parseMaybeConditional(refExpressionErrors) { const startLoc = this.state.startLoc; const potentialArrowAt = this.state.potentialArrowAt; const expr = this.parseExprOps(refExpressionErrors); if (this.shouldExitDescending(expr, potentialArrowAt)) { return expr; } return this.parseConditional(expr, startLoc, refExpressionErrors); } parseConditional(expr, startLoc, refExpressionErrors) { if (this.eat(17)) { const node = this.startNodeAt(startLoc); node.test = expr; node.consequent = this.parseMaybeAssignAllowIn(); this.expect(14); node.alternate = this.parseMaybeAssign(); return this.finishNode(node, "ConditionalExpression"); } return expr; } parseMaybeUnaryOrPrivate(refExpressionErrors) { return this.match(139) ? this.parsePrivateName() : this.parseMaybeUnary(refExpressionErrors); } parseExprOps(refExpressionErrors) { const startLoc = this.state.startLoc; const potentialArrowAt = this.state.potentialArrowAt; const expr = this.parseMaybeUnaryOrPrivate(refExpressionErrors); if (this.shouldExitDescending(expr, potentialArrowAt)) { return expr; } return this.parseExprOp(expr, startLoc, -1); } parseExprOp(left, leftStartLoc, minPrec) { if (this.isPrivateName(left)) { const value = this.getPrivateNameSV(left); if (minPrec >= tokenOperatorPrecedence(58) || !this.prodParam.hasIn || !this.match(58)) { this.raise(Errors.PrivateInExpectedIn, left, { identifierName: value }); } this.classScope.usePrivateName(value, left.loc.start); } const op = this.state.type; if (tokenIsOperator(op) && (this.prodParam.hasIn || !this.match(58))) { let prec = tokenOperatorPrecedence(op); if (prec > minPrec) { if (op === 39) { this.expectPlugin("pipelineOperator"); if (this.state.inFSharpPipelineDirectBody) { return left; } this.checkPipelineAtInfixOperator(left, leftStartLoc); } const node = this.startNodeAt(leftStartLoc); node.left = left; node.operator = this.state.value; const logical = op === 41 || op === 42; const coalesce = op === 40; if (coalesce) { prec = tokenOperatorPrecedence(42); } this.next(); if (op === 39 && this.hasPlugin(["pipelineOperator", { proposal: "minimal" }])) { if (this.state.type === 96 && this.prodParam.hasAwait) { throw this.raise(Errors.UnexpectedAwaitAfterPipelineBody, this.state.startLoc); } } node.right = this.parseExprOpRightExpr(op, prec); const finishedNode = this.finishNode(node, logical || coalesce ? "LogicalExpression" : "BinaryExpression"); const nextOp = this.state.type; if (coalesce && (nextOp === 41 || nextOp === 42) || logical && nextOp === 40) { throw this.raise(Errors.MixingCoalesceWithLogical, this.state.startLoc); } return this.parseExprOp(finishedNode, leftStartLoc, minPrec); } } return left; } parseExprOpRightExpr(op, prec) { const startLoc = this.state.startLoc; switch (op) { case 39: switch (this.getPluginOption("pipelineOperator", "proposal")) { case "hack": return this.withTopicBindingContext(() => { return this.parseHackPipeBody(); }); case "smart": return this.withTopicBindingContext(() => { if (this.prodParam.hasYield && this.isContextual(108)) { throw this.raise(Errors.PipeBodyIsTighter, this.state.startLoc); } return this.parseSmartPipelineBodyInStyle(this.parseExprOpBaseRightExpr(op, prec), startLoc); }); case "fsharp": return this.withSoloAwaitPermittingContext(() => { return this.parseFSharpPipelineBody(prec); }); } default: return this.parseExprOpBaseRightExpr(op, prec); } } parseExprOpBaseRightExpr(op, prec) { const startLoc = this.state.startLoc; return this.parseExprOp(this.parseMaybeUnaryOrPrivate(), startLoc, tokenIsRightAssociative(op) ? prec - 1 : prec); } parseHackPipeBody() { var _body$extra; const { startLoc } = this.state; const body = this.parseMaybeAssign(); const requiredParentheses = UnparenthesizedPipeBodyDescriptions.has(body.type); if (requiredParentheses && !((_body$extra = body.extra) != null && _body$extra.parenthesized)) { this.raise(Errors.PipeUnparenthesizedBody, startLoc, { type: body.type }); } if (!this.topicReferenceWasUsedInCurrentContext()) { this.raise(Errors.PipeTopicUnused, startLoc); } return body; } checkExponentialAfterUnary(node) { if (this.match(57)) { this.raise(Errors.UnexpectedTokenUnaryExponentiation, node.argument); } } parseMaybeUnary(refExpressionErrors, sawUnary) { const startLoc = this.state.startLoc; const isAwait = this.isContextual(96); if (isAwait && this.recordAwaitIfAllowed()) { this.next(); const expr = this.parseAwait(startLoc); if (!sawUnary) this.checkExponentialAfterUnary(expr); return expr; } const update = this.match(34); const node = this.startNode(); if (tokenIsPrefix(this.state.type)) { node.operator = this.state.value; node.prefix = true; if (this.match(72)) { this.expectPlugin("throwExpressions"); } const isDelete = this.match(89); this.next(); node.argument = this.parseMaybeUnary(null, true); this.checkExpressionErrors(refExpressionErrors, true); if (this.state.strict && isDelete) { const arg = node.argument; if (arg.type === "Identifier") { this.raise(Errors.StrictDelete, node); } else if (this.hasPropertyAsPrivateName(arg)) { this.raise(Errors.DeletePrivateField, node); } } if (!update) { if (!sawUnary) { this.checkExponentialAfterUnary(node); } return this.finishNode(node, "UnaryExpression"); } } const expr = this.parseUpdate(node, update, refExpressionErrors); if (isAwait) { const { type } = this.state; const startsExpr = this.hasPlugin("v8intrinsic") ? tokenCanStartExpression(type) : tokenCanStartExpression(type) && !this.match(54); if (startsExpr && !this.isAmbiguousAwait()) { this.raiseOverwrite(Errors.AwaitNotInAsyncContext, startLoc); return this.parseAwait(startLoc); } } return expr; } parseUpdate(node, update, refExpressionErrors) { if (update) { const updateExpressionNode = node; this.checkLVal(updateExpressionNode.argument, this.finishNode(updateExpressionNode, "UpdateExpression")); return node; } const startLoc = this.state.startLoc; let expr = this.parseExprSubscripts(refExpressionErrors); if (this.checkExpressionErrors(refExpressionErrors, false)) return expr; while (tokenIsPostfix(this.state.type) && !this.canInsertSemicolon()) { const node = this.startNodeAt(startLoc); node.operator = this.state.value; node.prefix = false; node.argument = expr; this.next(); this.checkLVal(expr, expr = this.finishNode(node, "UpdateExpression")); } return expr; } parseExprSubscripts(refExpressionErrors) { const startLoc = this.state.startLoc; const potentialArrowAt = this.state.potentialArrowAt; const expr = this.parseExprAtom(refExpressionErrors); if (this.shouldExitDescending(expr, potentialArrowAt)) { return expr; } return this.parseSubscripts(expr, startLoc); } parseSubscripts(base, startLoc, noCalls) { const state = { optionalChainMember: false, maybeAsyncArrow: this.atPossibleAsyncArrow(base), stop: false }; do { base = this.parseSubscript(base, startLoc, noCalls, state); state.maybeAsyncArrow = false; } while (!state.stop); return base; } parseSubscript(base, startLoc, noCalls, state) { const { type } = this.state; if (!noCalls && type === 15) { return this.parseBind(base, startLoc, noCalls, state); } else if (tokenIsTemplate(type)) { return this.parseTaggedTemplateExpression(base, startLoc, state); } let optional = false; if (type === 18) { if (noCalls) { this.raise(Errors.OptionalChainingNoNew, this.state.startLoc); if (this.lookaheadCharCode() === 40) { state.stop = true; return base; } } state.optionalChainMember = optional = true; this.next(); } if (!noCalls && this.match(10)) { return this.parseCoverCallAndAsyncArrowHead(base, startLoc, state, optional); } else { const computed = this.eat(0); if (computed || optional || this.eat(16)) { return this.parseMember(base, startLoc, state, computed, optional); } else { state.stop = true; return base; } } } parseMember(base, startLoc, state, computed, optional) { const node = this.startNodeAt(startLoc); node.object = base; node.computed = computed; if (computed) { node.property = this.parseExpression(); this.expect(3); } else if (this.match(139)) { if (base.type === "Super") { this.raise(Errors.SuperPrivateField, startLoc); } this.classScope.usePrivateName(this.state.value, this.state.startLoc); node.property = this.parsePrivateName(); } else { node.property = this.parseIdentifier(true); } if (state.optionalChainMember) { node.optional = optional; return this.finishNode(node, "OptionalMemberExpression"); } else { return this.finishNode(node, "MemberExpression"); } } parseBind(base, startLoc, noCalls, state) { const node = this.startNodeAt(startLoc); node.object = base; this.next(); node.callee = this.parseNoCallExpr(); state.stop = true; return this.parseSubscripts(this.finishNode(node, "BindExpression"), startLoc, noCalls); } parseCoverCallAndAsyncArrowHead(base, startLoc, state, optional) { const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; let refExpressionErrors = null; this.state.maybeInArrowParameters = true; this.next(); const node = this.startNodeAt(startLoc); node.callee = base; const { maybeAsyncArrow, optionalChainMember } = state; if (maybeAsyncArrow) { this.expressionScope.enter(newAsyncArrowScope()); refExpressionErrors = new ExpressionErrors(); } if (optionalChainMember) { node.optional = optional; } if (optional) { node.arguments = this.parseCallExpressionArguments(11); } else { node.arguments = this.parseCallExpressionArguments(11, base.type !== "Super", node, refExpressionErrors); } let finishedNode = this.finishCallExpression(node, optionalChainMember); if (maybeAsyncArrow && this.shouldParseAsyncArrow() && !optional) { state.stop = true; this.checkDestructuringPrivate(refExpressionErrors); this.expressionScope.validateAsPattern(); this.expressionScope.exit(); finishedNode = this.parseAsyncArrowFromCallExpression(this.startNodeAt(startLoc), finishedNode); } else { if (maybeAsyncArrow) { this.checkExpressionErrors(refExpressionErrors, true); this.expressionScope.exit(); } this.toReferencedArguments(finishedNode); } this.state.maybeInArrowParameters = oldMaybeInArrowParameters; return finishedNode; } toReferencedArguments(node, isParenthesizedExpr) { this.toReferencedListDeep(node.arguments, isParenthesizedExpr); } parseTaggedTemplateExpression(base, startLoc, state) { const node = this.startNodeAt(startLoc); node.tag = base; node.quasi = this.parseTemplate(true); if (state.optionalChainMember) { this.raise(Errors.OptionalChainingNoTemplate, startLoc); } return this.finishNode(node, "TaggedTemplateExpression"); } atPossibleAsyncArrow(base) { return base.type === "Identifier" && base.name === "async" && this.state.lastTokEndLoc.index === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 && this.offsetToSourcePos(base.start) === this.state.potentialArrowAt; } finishCallExpression(node, optional) { if (node.callee.type === "Import") { if (node.arguments.length === 0 || node.arguments.length > 2) { this.raise(Errors.ImportCallArity, node); } else { for (const arg of node.arguments) { if (arg.type === "SpreadElement") { this.raise(Errors.ImportCallSpreadArgument, arg); } } } } return this.finishNode(node, optional ? "OptionalCallExpression" : "CallExpression"); } parseCallExpressionArguments(close, allowPlaceholder, nodeForExtra, refExpressionErrors) { const elts = []; let first = true; const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; this.state.inFSharpPipelineDirectBody = false; while (!this.eat(close)) { if (first) { first = false; } else { this.expect(12); if (this.match(close)) { if (nodeForExtra) { this.addTrailingCommaExtraToNode(nodeForExtra); } this.next(); break; } } elts.push(this.parseExprListItem(false, refExpressionErrors, allowPlaceholder)); } this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; return elts; } shouldParseAsyncArrow() { return this.match(19) && !this.canInsertSemicolon(); } parseAsyncArrowFromCallExpression(node, call) { var _call$extra; this.resetPreviousNodeTrailingComments(call); this.expect(19); this.parseArrowExpression(node, call.arguments, true, (_call$extra = call.extra) == null ? void 0 : _call$extra.trailingCommaLoc); if (call.innerComments) { setInnerComments(node, call.innerComments); } if (call.callee.trailingComments) { setInnerComments(node, call.callee.trailingComments); } return node; } parseNoCallExpr() { const startLoc = this.state.startLoc; return this.parseSubscripts(this.parseExprAtom(), startLoc, true); } parseExprAtom(refExpressionErrors) { let node; let decorators = null; const { type } = this.state; switch (type) { case 79: return this.parseSuper(); case 83: node = this.startNode(); this.next(); if (this.match(16)) { return this.parseImportMetaProperty(node); } if (this.match(10)) { if (this.options.createImportExpressions) { return this.parseImportCall(node); } else { return this.finishNode(node, "Import"); } } else { this.raise(Errors.UnsupportedImport, this.state.lastTokStartLoc); return this.finishNode(node, "Import"); } case 78: node = this.startNode(); this.next(); return this.finishNode(node, "ThisExpression"); case 90: { return this.parseDo(this.startNode(), false); } case 56: case 31: { this.readRegexp(); return this.parseRegExpLiteral(this.state.value); } case 135: return this.parseNumericLiteral(this.state.value); case 136: return this.parseBigIntLiteral(this.state.value); case 134: return this.parseStringLiteral(this.state.value); case 84: return this.parseNullLiteral(); case 85: return this.parseBooleanLiteral(true); case 86: return this.parseBooleanLiteral(false); case 10: { const canBeArrow = this.state.potentialArrowAt === this.state.start; return this.parseParenAndDistinguishExpression(canBeArrow); } case 2: case 1: { return this.parseArrayLike(this.state.type === 2 ? 4 : 3, false, true); } case 0: { return this.parseArrayLike(3, true, false, refExpressionErrors); } case 6: case 7: { return this.parseObjectLike(this.state.type === 6 ? 9 : 8, false, true); } case 5: { return this.parseObjectLike(8, false, false, refExpressionErrors); } case 68: return this.parseFunctionOrFunctionSent(); case 26: decorators = this.parseDecorators(); case 80: return this.parseClass(this.maybeTakeDecorators(decorators, this.startNode()), false); case 77: return this.parseNewOrNewTarget(); case 25: case 24: return this.parseTemplate(false); case 15: { node = this.startNode(); this.next(); node.object = null; const callee = node.callee = this.parseNoCallExpr(); if (callee.type === "MemberExpression") { return this.finishNode(node, "BindExpression"); } else { throw this.raise(Errors.UnsupportedBind, callee); } } case 139: { this.raise(Errors.PrivateInExpectedIn, this.state.startLoc, { identifierName: this.state.value }); return this.parsePrivateName(); } case 33: { return this.parseTopicReferenceThenEqualsSign(54, "%"); } case 32: { return this.parseTopicReferenceThenEqualsSign(44, "^"); } case 37: case 38: { return this.parseTopicReference("hack"); } case 44: case 54: case 27: { const pipeProposal = this.getPluginOption("pipelineOperator", "proposal"); if (pipeProposal) { return this.parseTopicReference(pipeProposal); } this.unexpected(); break; } case 47: { const lookaheadCh = this.input.codePointAt(this.nextTokenStart()); if (isIdentifierStart(lookaheadCh) || lookaheadCh === 62) { this.expectOnePlugin(["jsx", "flow", "typescript"]); } else { this.unexpected(); } break; } default: if (type === 137) { return this.parseDecimalLiteral(this.state.value); } if (tokenIsIdentifier(type)) { if (this.isContextual(127) && this.lookaheadInLineCharCode() === 123) { return this.parseModuleExpression(); } const canBeArrow = this.state.potentialArrowAt === this.state.start; const containsEsc = this.state.containsEsc; const id = this.parseIdentifier(); if (!containsEsc && id.name === "async" && !this.canInsertSemicolon()) { const { type } = this.state; if (type === 68) { this.resetPreviousNodeTrailingComments(id); this.next(); return this.parseAsyncFunctionExpression(this.startNodeAtNode(id)); } else if (tokenIsIdentifier(type)) { if (this.lookaheadCharCode() === 61) { return this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(id)); } else { return id; } } else if (type === 90) { this.resetPreviousNodeTrailingComments(id); return this.parseDo(this.startNodeAtNode(id), true); } } if (canBeArrow && this.match(19) && !this.canInsertSemicolon()) { this.next(); return this.parseArrowExpression(this.startNodeAtNode(id), [id], false); } return id; } else { this.unexpected(); } } } parseTopicReferenceThenEqualsSign(topicTokenType, topicTokenValue) { const pipeProposal = this.getPluginOption("pipelineOperator", "proposal"); if (pipeProposal) { this.state.type = topicTokenType; this.state.value = topicTokenValue; this.state.pos--; this.state.end--; this.state.endLoc = createPositionWithColumnOffset(this.state.endLoc, -1); return this.parseTopicReference(pipeProposal); } else { this.unexpected(); } } parseTopicReference(pipeProposal) { const node = this.startNode(); const startLoc = this.state.startLoc; const tokenType = this.state.type; this.next(); return this.finishTopicReference(node, startLoc, pipeProposal, tokenType); } finishTopicReference(node, startLoc, pipeProposal, tokenType) { if (this.testTopicReferenceConfiguration(pipeProposal, startLoc, tokenType)) { const nodeType = pipeProposal === "smart" ? "PipelinePrimaryTopicReference" : "TopicReference"; if (!this.topicReferenceIsAllowedInCurrentContext()) { this.raise(pipeProposal === "smart" ? Errors.PrimaryTopicNotAllowed : Errors.PipeTopicUnbound, startLoc); } this.registerTopicReference(); return this.finishNode(node, nodeType); } else { throw this.raise(Errors.PipeTopicUnconfiguredToken, startLoc, { token: tokenLabelName(tokenType) }); } } testTopicReferenceConfiguration(pipeProposal, startLoc, tokenType) { switch (pipeProposal) { case "hack": { return this.hasPlugin(["pipelineOperator", { topicToken: tokenLabelName(tokenType) }]); } case "smart": return tokenType === 27; default: throw this.raise(Errors.PipeTopicRequiresHackPipes, startLoc); } } parseAsyncArrowUnaryFunction(node) { this.prodParam.enter(functionFlags(true, this.prodParam.hasYield)); const params = [this.parseIdentifier()]; this.prodParam.exit(); if (this.hasPrecedingLineBreak()) { this.raise(Errors.LineTerminatorBeforeArrow, this.state.curPosition()); } this.expect(19); return this.parseArrowExpression(node, params, true); } parseDo(node, isAsync) { this.expectPlugin("doExpressions"); if (isAsync) { this.expectPlugin("asyncDoExpressions"); } node.async = isAsync; this.next(); const oldLabels = this.state.labels; this.state.labels = []; if (isAsync) { this.prodParam.enter(2); node.body = this.parseBlock(); this.prodParam.exit(); } else { node.body = this.parseBlock(); } this.state.labels = oldLabels; return this.finishNode(node, "DoExpression"); } parseSuper() { const node = this.startNode(); this.next(); if (this.match(10) && !this.scope.allowDirectSuper && !this.options.allowSuperOutsideMethod) { this.raise(Errors.SuperNotAllowed, node); } else if (!this.scope.allowSuper && !this.options.allowSuperOutsideMethod) { this.raise(Errors.UnexpectedSuper, node); } if (!this.match(10) && !this.match(0) && !this.match(16)) { this.raise(Errors.UnsupportedSuper, node); } return this.finishNode(node, "Super"); } parsePrivateName() { const node = this.startNode(); const id = this.startNodeAt(createPositionWithColumnOffset(this.state.startLoc, 1)); const name = this.state.value; this.next(); node.id = this.createIdentifier(id, name); return this.finishNode(node, "PrivateName"); } parseFunctionOrFunctionSent() { const node = this.startNode(); this.next(); if (this.prodParam.hasYield && this.match(16)) { const meta = this.createIdentifier(this.startNodeAtNode(node), "function"); this.next(); if (this.match(103)) { this.expectPlugin("functionSent"); } else if (!this.hasPlugin("functionSent")) { this.unexpected(); } return this.parseMetaProperty(node, meta, "sent"); } return this.parseFunction(node); } parseMetaProperty(node, meta, propertyName) { node.meta = meta; const containsEsc = this.state.containsEsc; node.property = this.parseIdentifier(true); if (node.property.name !== propertyName || containsEsc) { this.raise(Errors.UnsupportedMetaProperty, node.property, { target: meta.name, onlyValidPropertyName: propertyName }); } return this.finishNode(node, "MetaProperty"); } parseImportMetaProperty(node) { const id = this.createIdentifier(this.startNodeAtNode(node), "import"); this.next(); if (this.isContextual(101)) { if (!this.inModule) { this.raise(Errors.ImportMetaOutsideModule, id); } this.sawUnambiguousESM = true; } else if (this.isContextual(105) || this.isContextual(97)) { const isSource = this.isContextual(105); if (!isSource) this.unexpected(); this.expectPlugin(isSource ? "sourcePhaseImports" : "deferredImportEvaluation"); if (!this.options.createImportExpressions) { throw this.raise(Errors.DynamicImportPhaseRequiresImportExpressions, this.state.startLoc, { phase: this.state.value }); } this.next(); node.phase = isSource ? "source" : "defer"; return this.parseImportCall(node); } return this.parseMetaProperty(node, id, "meta"); } parseLiteralAtNode(value, type, node) { this.addExtra(node, "rawValue", value); this.addExtra(node, "raw", this.input.slice(this.offsetToSourcePos(node.start), this.state.end)); node.value = value; this.next(); return this.finishNode(node, type); } parseLiteral(value, type) { const node = this.startNode(); return this.parseLiteralAtNode(value, type, node); } parseStringLiteral(value) { return this.parseLiteral(value, "StringLiteral"); } parseNumericLiteral(value) { return this.parseLiteral(value, "NumericLiteral"); } parseBigIntLiteral(value) { return this.parseLiteral(value, "BigIntLiteral"); } parseDecimalLiteral(value) { return this.parseLiteral(value, "DecimalLiteral"); } parseRegExpLiteral(value) { const node = this.startNode(); this.addExtra(node, "raw", this.input.slice(this.offsetToSourcePos(node.start), this.state.end)); node.pattern = value.pattern; node.flags = value.flags; this.next(); return this.finishNode(node, "RegExpLiteral"); } parseBooleanLiteral(value) { const node = this.startNode(); node.value = value; this.next(); return this.finishNode(node, "BooleanLiteral"); } parseNullLiteral() { const node = this.startNode(); this.next(); return this.finishNode(node, "NullLiteral"); } parseParenAndDistinguishExpression(canBeArrow) { const startLoc = this.state.startLoc; let val; this.next(); this.expressionScope.enter(newArrowHeadScope()); const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; this.state.maybeInArrowParameters = true; this.state.inFSharpPipelineDirectBody = false; const innerStartLoc = this.state.startLoc; const exprList = []; const refExpressionErrors = new ExpressionErrors(); let first = true; let spreadStartLoc; let optionalCommaStartLoc; while (!this.match(11)) { if (first) { first = false; } else { this.expect(12, refExpressionErrors.optionalParametersLoc === null ? null : refExpressionErrors.optionalParametersLoc); if (this.match(11)) { optionalCommaStartLoc = this.state.startLoc; break; } } if (this.match(21)) { const spreadNodeStartLoc = this.state.startLoc; spreadStartLoc = this.state.startLoc; exprList.push(this.parseParenItem(this.parseRestBinding(), spreadNodeStartLoc)); if (!this.checkCommaAfterRest(41)) { break; } } else { exprList.push(this.parseMaybeAssignAllowIn(refExpressionErrors, this.parseParenItem)); } } const innerEndLoc = this.state.lastTokEndLoc; this.expect(11); this.state.maybeInArrowParameters = oldMaybeInArrowParameters; this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; let arrowNode = this.startNodeAt(startLoc); if (canBeArrow && this.shouldParseArrow(exprList) && (arrowNode = this.parseArrow(arrowNode))) { this.checkDestructuringPrivate(refExpressionErrors); this.expressionScope.validateAsPattern(); this.expressionScope.exit(); this.parseArrowExpression(arrowNode, exprList, false); return arrowNode; } this.expressionScope.exit(); if (!exprList.length) { this.unexpected(this.state.lastTokStartLoc); } if (optionalCommaStartLoc) this.unexpected(optionalCommaStartLoc); if (spreadStartLoc) this.unexpected(spreadStartLoc); this.checkExpressionErrors(refExpressionErrors, true); this.toReferencedListDeep(exprList, true); if (exprList.length > 1) { val = this.startNodeAt(innerStartLoc); val.expressions = exprList; this.finishNode(val, "SequenceExpression"); this.resetEndLocation(val, innerEndLoc); } else { val = exprList[0]; } return this.wrapParenthesis(startLoc, val); } wrapParenthesis(startLoc, expression) { if (!this.options.createParenthesizedExpressions) { this.addExtra(expression, "parenthesized", true); this.addExtra(expression, "parenStart", startLoc.index); this.takeSurroundingComments(expression, startLoc.index, this.state.lastTokEndLoc.index); return expression; } const parenExpression = this.startNodeAt(startLoc); parenExpression.expression = expression; return this.finishNode(parenExpression, "ParenthesizedExpression"); } shouldParseArrow(params) { return !this.canInsertSemicolon(); } parseArrow(node) { if (this.eat(19)) { return node; } } parseParenItem(node, startLoc) { return node; } parseNewOrNewTarget() { const node = this.startNode(); this.next(); if (this.match(16)) { const meta = this.createIdentifier(this.startNodeAtNode(node), "new"); this.next(); const metaProp = this.parseMetaProperty(node, meta, "target"); if (!this.scope.inNonArrowFunction && !this.scope.inClass && !this.options.allowNewTargetOutsideFunction) { this.raise(Errors.UnexpectedNewTarget, metaProp); } return metaProp; } return this.parseNew(node); } parseNew(node) { this.parseNewCallee(node); if (this.eat(10)) { const args = this.parseExprList(11); this.toReferencedList(args); node.arguments = args; } else { node.arguments = []; } return this.finishNode(node, "NewExpression"); } parseNewCallee(node) { const isImport = this.match(83); const callee = this.parseNoCallExpr(); node.callee = callee; if (isImport && (callee.type === "Import" || callee.type === "ImportExpression")) { this.raise(Errors.ImportCallNotNewExpression, callee); } } parseTemplateElement(isTagged) { const { start, startLoc, end, value } = this.state; const elemStart = start + 1; const elem = this.startNodeAt(createPositionWithColumnOffset(startLoc, 1)); if (value === null) { if (!isTagged) { this.raise(Errors.InvalidEscapeSequenceTemplate, createPositionWithColumnOffset(this.state.firstInvalidTemplateEscapePos, 1)); } } const isTail = this.match(24); const endOffset = isTail ? -1 : -2; const elemEnd = end + endOffset; elem.value = { raw: this.input.slice(elemStart, elemEnd).replace(/\r\n?/g, "\n"), cooked: value === null ? null : value.slice(1, endOffset) }; elem.tail = isTail; this.next(); const finishedNode = this.finishNode(elem, "TemplateElement"); this.resetEndLocation(finishedNode, createPositionWithColumnOffset(this.state.lastTokEndLoc, endOffset)); return finishedNode; } parseTemplate(isTagged) { const node = this.startNode(); let curElt = this.parseTemplateElement(isTagged); const quasis = [curElt]; const substitutions = []; while (!curElt.tail) { substitutions.push(this.parseTemplateSubstitution()); this.readTemplateContinuation(); quasis.push(curElt = this.parseTemplateElement(isTagged)); } node.expressions = substitutions; node.quasis = quasis; return this.finishNode(node, "TemplateLiteral"); } parseTemplateSubstitution() { return this.parseExpression(); } parseObjectLike(close, isPattern, isRecord, refExpressionErrors) { if (isRecord) { this.expectPlugin("recordAndTuple"); } const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; this.state.inFSharpPipelineDirectBody = false; const propHash = Object.create(null); let first = true; const node = this.startNode(); node.properties = []; this.next(); while (!this.match(close)) { if (first) { first = false; } else { this.expect(12); if (this.match(close)) { this.addTrailingCommaExtraToNode(node); break; } } let prop; if (isPattern) { prop = this.parseBindingProperty(); } else { prop = this.parsePropertyDefinition(refExpressionErrors); this.checkProto(prop, isRecord, propHash, refExpressionErrors); } if (isRecord && !this.isObjectProperty(prop) && prop.type !== "SpreadElement") { this.raise(Errors.InvalidRecordProperty, prop); } { if (prop.shorthand) { this.addExtra(prop, "shorthand", true); } } node.properties.push(prop); } this.next(); this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; let type = "ObjectExpression"; if (isPattern) { type = "ObjectPattern"; } else if (isRecord) { type = "RecordExpression"; } return this.finishNode(node, type); } addTrailingCommaExtraToNode(node) { this.addExtra(node, "trailingComma", this.state.lastTokStartLoc.index); this.addExtra(node, "trailingCommaLoc", this.state.lastTokStartLoc, false); } maybeAsyncOrAccessorProp(prop) { return !prop.computed && prop.key.type === "Identifier" && (this.isLiteralPropertyName() || this.match(0) || this.match(55)); } parsePropertyDefinition(refExpressionErrors) { let decorators = []; if (this.match(26)) { if (this.hasPlugin("decorators")) { this.raise(Errors.UnsupportedPropertyDecorator, this.state.startLoc); } while (this.match(26)) { decorators.push(this.parseDecorator()); } } const prop = this.startNode(); let isAsync = false; let isAccessor = false; let startLoc; if (this.match(21)) { if (decorators.length) this.unexpected(); return this.parseSpread(); } if (decorators.length) { prop.decorators = decorators; decorators = []; } prop.method = false; if (refExpressionErrors) { startLoc = this.state.startLoc; } let isGenerator = this.eat(55); this.parsePropertyNamePrefixOperator(prop); const containsEsc = this.state.containsEsc; this.parsePropertyName(prop, refExpressionErrors); if (!isGenerator && !containsEsc && this.maybeAsyncOrAccessorProp(prop)) { const { key } = prop; const keyName = key.name; if (keyName === "async" && !this.hasPrecedingLineBreak()) { isAsync = true; this.resetPreviousNodeTrailingComments(key); isGenerator = this.eat(55); this.parsePropertyName(prop); } if (keyName === "get" || keyName === "set") { isAccessor = true; this.resetPreviousNodeTrailingComments(key); prop.kind = keyName; if (this.match(55)) { isGenerator = true; this.raise(Errors.AccessorIsGenerator, this.state.curPosition(), { kind: keyName }); this.next(); } this.parsePropertyName(prop); } } return this.parseObjPropValue(prop, startLoc, isGenerator, isAsync, false, isAccessor, refExpressionErrors); } getGetterSetterExpectedParamCount(method) { return method.kind === "get" ? 0 : 1; } getObjectOrClassMethodParams(method) { return method.params; } checkGetterSetterParams(method) { var _params; const paramCount = this.getGetterSetterExpectedParamCount(method); const params = this.getObjectOrClassMethodParams(method); if (params.length !== paramCount) { this.raise(method.kind === "get" ? Errors.BadGetterArity : Errors.BadSetterArity, method); } if (method.kind === "set" && ((_params = params[params.length - 1]) == null ? void 0 : _params.type) === "RestElement") { this.raise(Errors.BadSetterRestParameter, method); } } parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) { if (isAccessor) { const finishedProp = this.parseMethod(prop, isGenerator, false, false, false, "ObjectMethod"); this.checkGetterSetterParams(finishedProp); return finishedProp; } if (isAsync || isGenerator || this.match(10)) { if (isPattern) this.unexpected(); prop.kind = "method"; prop.method = true; return this.parseMethod(prop, isGenerator, isAsync, false, false, "ObjectMethod"); } } parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors) { prop.shorthand = false; if (this.eat(14)) { prop.value = isPattern ? this.parseMaybeDefault(this.state.startLoc) : this.parseMaybeAssignAllowIn(refExpressionErrors); return this.finishNode(prop, "ObjectProperty"); } if (!prop.computed && prop.key.type === "Identifier") { this.checkReservedWord(prop.key.name, prop.key.loc.start, true, false); if (isPattern) { prop.value = this.parseMaybeDefault(startLoc, cloneIdentifier(prop.key)); } else if (this.match(29)) { const shorthandAssignLoc = this.state.startLoc; if (refExpressionErrors != null) { if (refExpressionErrors.shorthandAssignLoc === null) { refExpressionErrors.shorthandAssignLoc = shorthandAssignLoc; } } else { this.raise(Errors.InvalidCoverInitializedName, shorthandAssignLoc); } prop.value = this.parseMaybeDefault(startLoc, cloneIdentifier(prop.key)); } else { prop.value = cloneIdentifier(prop.key); } prop.shorthand = true; return this.finishNode(prop, "ObjectProperty"); } } parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) { const node = this.parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) || this.parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors); if (!node) this.unexpected(); return node; } parsePropertyName(prop, refExpressionErrors) { if (this.eat(0)) { prop.computed = true; prop.key = this.parseMaybeAssignAllowIn(); this.expect(3); } else { const { type, value } = this.state; let key; if (tokenIsKeywordOrIdentifier(type)) { key = this.parseIdentifier(true); } else { switch (type) { case 135: key = this.parseNumericLiteral(value); break; case 134: key = this.parseStringLiteral(value); break; case 136: key = this.parseBigIntLiteral(value); break; case 139: { const privateKeyLoc = this.state.startLoc; if (refExpressionErrors != null) { if (refExpressionErrors.privateKeyLoc === null) { refExpressionErrors.privateKeyLoc = privateKeyLoc; } } else { this.raise(Errors.UnexpectedPrivateField, privateKeyLoc); } key = this.parsePrivateName(); break; } default: if (type === 137) { key = this.parseDecimalLiteral(value); break; } this.unexpected(); } } prop.key = key; if (type !== 139) { prop.computed = false; } } } initFunction(node, isAsync) { node.id = null; node.generator = false; node.async = isAsync; } parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) { this.initFunction(node, isAsync); node.generator = isGenerator; this.scope.enter(2 | 16 | (inClassScope ? 64 : 0) | (allowDirectSuper ? 32 : 0)); this.prodParam.enter(functionFlags(isAsync, node.generator)); this.parseFunctionParams(node, isConstructor); const finishedNode = this.parseFunctionBodyAndFinish(node, type, true); this.prodParam.exit(); this.scope.exit(); return finishedNode; } parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) { if (isTuple) { this.expectPlugin("recordAndTuple"); } const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; this.state.inFSharpPipelineDirectBody = false; const node = this.startNode(); this.next(); node.elements = this.parseExprList(close, !isTuple, refExpressionErrors, node); this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; return this.finishNode(node, isTuple ? "TupleExpression" : "ArrayExpression"); } parseArrowExpression(node, params, isAsync, trailingCommaLoc) { this.scope.enter(2 | 4); let flags = functionFlags(isAsync, false); if (!this.match(5) && this.prodParam.hasIn) { flags |= 8; } this.prodParam.enter(flags); this.initFunction(node, isAsync); const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; if (params) { this.state.maybeInArrowParameters = true; this.setArrowFunctionParameters(node, params, trailingCommaLoc); } this.state.maybeInArrowParameters = false; this.parseFunctionBody(node, true); this.prodParam.exit(); this.scope.exit(); this.state.maybeInArrowParameters = oldMaybeInArrowParameters; return this.finishNode(node, "ArrowFunctionExpression"); } setArrowFunctionParameters(node, params, trailingCommaLoc) { this.toAssignableList(params, trailingCommaLoc, false); node.params = params; } parseFunctionBodyAndFinish(node, type, isMethod = false) { this.parseFunctionBody(node, false, isMethod); return this.finishNode(node, type); } parseFunctionBody(node, allowExpression, isMethod = false) { const isExpression = allowExpression && !this.match(5); this.expressionScope.enter(newExpressionScope()); if (isExpression) { node.body = this.parseMaybeAssign(); this.checkParams(node, false, allowExpression, false); } else { const oldStrict = this.state.strict; const oldLabels = this.state.labels; this.state.labels = []; this.prodParam.enter(this.prodParam.currentFlags() | 4); node.body = this.parseBlock(true, false, hasStrictModeDirective => { const nonSimple = !this.isSimpleParamList(node.params); if (hasStrictModeDirective && nonSimple) { this.raise(Errors.IllegalLanguageModeDirective, (node.kind === "method" || node.kind === "constructor") && !!node.key ? node.key.loc.end : node); } const strictModeChanged = !oldStrict && this.state.strict; this.checkParams(node, !this.state.strict && !allowExpression && !isMethod && !nonSimple, allowExpression, strictModeChanged); if (this.state.strict && node.id) { this.checkIdentifier(node.id, 65, strictModeChanged); } }); this.prodParam.exit(); this.state.labels = oldLabels; } this.expressionScope.exit(); } isSimpleParameter(node) { return node.type === "Identifier"; } isSimpleParamList(params) { for (let i = 0, len = params.length; i < len; i++) { if (!this.isSimpleParameter(params[i])) return false; } return true; } checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged = true) { const checkClashes = !allowDuplicates && new Set(); const formalParameters = { type: "FormalParameters" }; for (const param of node.params) { this.checkLVal(param, formalParameters, 5, checkClashes, strictModeChanged); } } parseExprList(close, allowEmpty, refExpressionErrors, nodeForExtra) { const elts = []; let first = true; while (!this.eat(close)) { if (first) { first = false; } else { this.expect(12); if (this.match(close)) { if (nodeForExtra) { this.addTrailingCommaExtraToNode(nodeForExtra); } this.next(); break; } } elts.push(this.parseExprListItem(allowEmpty, refExpressionErrors)); } return elts; } parseExprListItem(allowEmpty, refExpressionErrors, allowPlaceholder) { let elt; if (this.match(12)) { if (!allowEmpty) { this.raise(Errors.UnexpectedToken, this.state.curPosition(), { unexpected: "," }); } elt = null; } else if (this.match(21)) { const spreadNodeStartLoc = this.state.startLoc; elt = this.parseParenItem(this.parseSpread(refExpressionErrors), spreadNodeStartLoc); } else if (this.match(17)) { this.expectPlugin("partialApplication"); if (!allowPlaceholder) { this.raise(Errors.UnexpectedArgumentPlaceholder, this.state.startLoc); } const node = this.startNode(); this.next(); elt = this.finishNode(node, "ArgumentPlaceholder"); } else { elt = this.parseMaybeAssignAllowIn(refExpressionErrors, this.parseParenItem); } return elt; } parseIdentifier(liberal) { const node = this.startNode(); const name = this.parseIdentifierName(liberal); return this.createIdentifier(node, name); } createIdentifier(node, name) { node.name = name; node.loc.identifierName = name; return this.finishNode(node, "Identifier"); } parseIdentifierName(liberal) { let name; const { startLoc, type } = this.state; if (tokenIsKeywordOrIdentifier(type)) { name = this.state.value; } else { this.unexpected(); } const tokenIsKeyword = tokenKeywordOrIdentifierIsKeyword(type); if (liberal) { if (tokenIsKeyword) { this.replaceToken(132); } } else { this.checkReservedWord(name, startLoc, tokenIsKeyword, false); } this.next(); return name; } checkReservedWord(word, startLoc, checkKeywords, isBinding) { if (word.length > 10) { return; } if (!canBeReservedWord(word)) { return; } if (checkKeywords && isKeyword(word)) { this.raise(Errors.UnexpectedKeyword, startLoc, { keyword: word }); return; } const reservedTest = !this.state.strict ? isReservedWord : isBinding ? isStrictBindReservedWord : isStrictReservedWord; if (reservedTest(word, this.inModule)) { this.raise(Errors.UnexpectedReservedWord, startLoc, { reservedWord: word }); return; } else if (word === "yield") { if (this.prodParam.hasYield) { this.raise(Errors.YieldBindingIdentifier, startLoc); return; } } else if (word === "await") { if (this.prodParam.hasAwait) { this.raise(Errors.AwaitBindingIdentifier, startLoc); return; } if (this.scope.inStaticBlock) { this.raise(Errors.AwaitBindingIdentifierInStaticBlock, startLoc); return; } this.expressionScope.recordAsyncArrowParametersError(startLoc); } else if (word === "arguments") { if (this.scope.inClassAndNotInNonArrowFunction) { this.raise(Errors.ArgumentsInClass, startLoc); return; } } } recordAwaitIfAllowed() { const isAwaitAllowed = this.prodParam.hasAwait || this.options.allowAwaitOutsideFunction && !this.scope.inFunction; if (isAwaitAllowed && !this.scope.inFunction) { this.state.hasTopLevelAwait = true; } return isAwaitAllowed; } parseAwait(startLoc) { const node = this.startNodeAt(startLoc); this.expressionScope.recordParameterInitializerError(Errors.AwaitExpressionFormalParameter, node); if (this.eat(55)) { this.raise(Errors.ObsoleteAwaitStar, node); } if (!this.scope.inFunction && !this.options.allowAwaitOutsideFunction) { if (this.isAmbiguousAwait()) { this.ambiguousScriptDifferentAst = true; } else { this.sawUnambiguousESM = true; } } if (!this.state.soloAwait) { node.argument = this.parseMaybeUnary(null, true); } return this.finishNode(node, "AwaitExpression"); } isAmbiguousAwait() { if (this.hasPrecedingLineBreak()) return true; const { type } = this.state; return type === 53 || type === 10 || type === 0 || tokenIsTemplate(type) || type === 102 && !this.state.containsEsc || type === 138 || type === 56 || this.hasPlugin("v8intrinsic") && type === 54; } parseYield() { const node = this.startNode(); this.expressionScope.recordParameterInitializerError(Errors.YieldInParameter, node); this.next(); let delegating = false; let argument = null; if (!this.hasPrecedingLineBreak()) { delegating = this.eat(55); switch (this.state.type) { case 13: case 140: case 8: case 11: case 3: case 9: case 14: case 12: if (!delegating) break; default: argument = this.parseMaybeAssign(); } } node.delegate = delegating; node.argument = argument; return this.finishNode(node, "YieldExpression"); } parseImportCall(node) { this.next(); node.source = this.parseMaybeAssignAllowIn(); node.options = null; if (this.eat(12)) { if (!this.match(11)) { node.options = this.parseMaybeAssignAllowIn(); if (this.eat(12) && !this.match(11)) { do { this.parseMaybeAssignAllowIn(); } while (this.eat(12) && !this.match(11)); this.raise(Errors.ImportCallArity, node); } } } this.expect(11); return this.finishNode(node, "ImportExpression"); } checkPipelineAtInfixOperator(left, leftStartLoc) { if (this.hasPlugin(["pipelineOperator", { proposal: "smart" }])) { if (left.type === "SequenceExpression") { this.raise(Errors.PipelineHeadSequenceExpression, leftStartLoc); } } } parseSmartPipelineBodyInStyle(childExpr, startLoc) { if (this.isSimpleReference(childExpr)) { const bodyNode = this.startNodeAt(startLoc); bodyNode.callee = childExpr; return this.finishNode(bodyNode, "PipelineBareFunction"); } else { const bodyNode = this.startNodeAt(startLoc); this.checkSmartPipeTopicBodyEarlyErrors(startLoc); bodyNode.expression = childExpr; return this.finishNode(bodyNode, "PipelineTopicExpression"); } } isSimpleReference(expression) { switch (expression.type) { case "MemberExpression": return !expression.computed && this.isSimpleReference(expression.object); case "Identifier": return true; default: return false; } } checkSmartPipeTopicBodyEarlyErrors(startLoc) { if (this.match(19)) { throw this.raise(Errors.PipelineBodyNoArrow, this.state.startLoc); } if (!this.topicReferenceWasUsedInCurrentContext()) { this.raise(Errors.PipelineTopicUnused, startLoc); } } withTopicBindingContext(callback) { const outerContextTopicState = this.state.topicContext; this.state.topicContext = { maxNumOfResolvableTopics: 1, maxTopicIndex: null }; try { return callback(); } finally { this.state.topicContext = outerContextTopicState; } } withSmartMixTopicForbiddingContext(callback) { if (this.hasPlugin(["pipelineOperator", { proposal: "smart" }])) { const outerContextTopicState = this.state.topicContext; this.state.topicContext = { maxNumOfResolvableTopics: 0, maxTopicIndex: null }; try { return callback(); } finally { this.state.topicContext = outerContextTopicState; } } else { return callback(); } } withSoloAwaitPermittingContext(callback) { const outerContextSoloAwaitState = this.state.soloAwait; this.state.soloAwait = true; try { return callback(); } finally { this.state.soloAwait = outerContextSoloAwaitState; } } allowInAnd(callback) { const flags = this.prodParam.currentFlags(); const prodParamToSet = 8 & ~flags; if (prodParamToSet) { this.prodParam.enter(flags | 8); try { return callback(); } finally { this.prodParam.exit(); } } return callback(); } disallowInAnd(callback) { const flags = this.prodParam.currentFlags(); const prodParamToClear = 8 & flags; if (prodParamToClear) { this.prodParam.enter(flags & ~8); try { return callback(); } finally { this.prodParam.exit(); } } return callback(); } registerTopicReference() { this.state.topicContext.maxTopicIndex = 0; } topicReferenceIsAllowedInCurrentContext() { return this.state.topicContext.maxNumOfResolvableTopics >= 1; } topicReferenceWasUsedInCurrentContext() { return this.state.topicContext.maxTopicIndex != null && this.state.topicContext.maxTopicIndex >= 0; } parseFSharpPipelineBody(prec) { const startLoc = this.state.startLoc; this.state.potentialArrowAt = this.state.start; const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; this.state.inFSharpPipelineDirectBody = true; const ret = this.parseExprOp(this.parseMaybeUnaryOrPrivate(), startLoc, prec); this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; return ret; } parseModuleExpression() { this.expectPlugin("moduleBlocks"); const node = this.startNode(); this.next(); if (!this.match(5)) { this.unexpected(null, 5); } const program = this.startNodeAt(this.state.endLoc); this.next(); const revertScopes = this.initializeScopes(true); this.enterInitialScopes(); try { node.body = this.parseProgram(program, 8, "module"); } finally { revertScopes(); } return this.finishNode(node, "ModuleExpression"); } parsePropertyNamePrefixOperator(prop) {} } const loopLabel = { kind: 1 }, switchLabel = { kind: 2 }; const loneSurrogate = /[\uD800-\uDFFF]/u; const keywordRelationalOperator = /in(?:stanceof)?/y; function babel7CompatTokens(tokens, input, startIndex) { for (let i = 0; i < tokens.length; i++) { const token = tokens[i]; const { type } = token; if (typeof type === "number") { { if (type === 139) { const { loc, start, value, end } = token; const hashEndPos = start + 1; const hashEndLoc = createPositionWithColumnOffset(loc.start, 1); tokens.splice(i, 1, new Token({ type: getExportedToken(27), value: "#", start: start, end: hashEndPos, startLoc: loc.start, endLoc: hashEndLoc }), new Token({ type: getExportedToken(132), value: value, start: hashEndPos, end: end, startLoc: hashEndLoc, endLoc: loc.end })); i++; continue; } if (tokenIsTemplate(type)) { const { loc, start, value, end } = token; const backquoteEnd = start + 1; const backquoteEndLoc = createPositionWithColumnOffset(loc.start, 1); let startToken; if (input.charCodeAt(start - startIndex) === 96) { startToken = new Token({ type: getExportedToken(22), value: "`", start: start, end: backquoteEnd, startLoc: loc.start, endLoc: backquoteEndLoc }); } else { startToken = new Token({ type: getExportedToken(8), value: "}", start: start, end: backquoteEnd, startLoc: loc.start, endLoc: backquoteEndLoc }); } let templateValue, templateElementEnd, templateElementEndLoc, endToken; if (type === 24) { templateElementEnd = end - 1; templateElementEndLoc = createPositionWithColumnOffset(loc.end, -1); templateValue = value === null ? null : value.slice(1, -1); endToken = new Token({ type: getExportedToken(22), value: "`", start: templateElementEnd, end: end, startLoc: templateElementEndLoc, endLoc: loc.end }); } else { templateElementEnd = end - 2; templateElementEndLoc = createPositionWithColumnOffset(loc.end, -2); templateValue = value === null ? null : value.slice(1, -2); endToken = new Token({ type: getExportedToken(23), value: "${", start: templateElementEnd, end: end, startLoc: templateElementEndLoc, endLoc: loc.end }); } tokens.splice(i, 1, startToken, new Token({ type: getExportedToken(20), value: templateValue, start: backquoteEnd, end: templateElementEnd, startLoc: backquoteEndLoc, endLoc: templateElementEndLoc }), endToken); i += 2; continue; } } token.type = getExportedToken(type); } } return tokens; } class StatementParser extends ExpressionParser { parseTopLevel(file, program) { file.program = this.parseProgram(program); file.comments = this.comments; if (this.options.tokens) { file.tokens = babel7CompatTokens(this.tokens, this.input, this.startIndex); } return this.finishNode(file, "File"); } parseProgram(program, end = 140, sourceType = this.options.sourceType) { program.sourceType = sourceType; program.interpreter = this.parseInterpreterDirective(); this.parseBlockBody(program, true, true, end); if (this.inModule) { if (!this.options.allowUndeclaredExports && this.scope.undefinedExports.size > 0) { for (const [localName, at] of Array.from(this.scope.undefinedExports)) { this.raise(Errors.ModuleExportUndefined, at, { localName }); } } this.addExtra(program, "topLevelAwait", this.state.hasTopLevelAwait); } let finishedProgram; if (end === 140) { finishedProgram = this.finishNode(program, "Program"); } else { finishedProgram = this.finishNodeAt(program, "Program", createPositionWithColumnOffset(this.state.startLoc, -1)); } return finishedProgram; } stmtToDirective(stmt) { const directive = stmt; directive.type = "Directive"; directive.value = directive.expression; delete directive.expression; const directiveLiteral = directive.value; const expressionValue = directiveLiteral.value; const raw = this.input.slice(this.offsetToSourcePos(directiveLiteral.start), this.offsetToSourcePos(directiveLiteral.end)); const val = directiveLiteral.value = raw.slice(1, -1); this.addExtra(directiveLiteral, "raw", raw); this.addExtra(directiveLiteral, "rawValue", val); this.addExtra(directiveLiteral, "expressionValue", expressionValue); directiveLiteral.type = "DirectiveLiteral"; return directive; } parseInterpreterDirective() { if (!this.match(28)) { return null; } const node = this.startNode(); node.value = this.state.value; this.next(); return this.finishNode(node, "InterpreterDirective"); } isLet() { if (!this.isContextual(100)) { return false; } return this.hasFollowingBindingAtom(); } chStartsBindingIdentifier(ch, pos) { if (isIdentifierStart(ch)) { keywordRelationalOperator.lastIndex = pos; if (keywordRelationalOperator.test(this.input)) { const endCh = this.codePointAtPos(keywordRelationalOperator.lastIndex); if (!isIdentifierChar(endCh) && endCh !== 92) { return false; } } return true; } else if (ch === 92) { return true; } else { return false; } } chStartsBindingPattern(ch) { return ch === 91 || ch === 123; } hasFollowingBindingAtom() { const next = this.nextTokenStart(); const nextCh = this.codePointAtPos(next); return this.chStartsBindingPattern(nextCh) || this.chStartsBindingIdentifier(nextCh, next); } hasInLineFollowingBindingIdentifierOrBrace() { const next = this.nextTokenInLineStart(); const nextCh = this.codePointAtPos(next); return nextCh === 123 || this.chStartsBindingIdentifier(nextCh, next); } startsUsingForOf() { const { type, containsEsc } = this.lookahead(); if (type === 102 && !containsEsc) { return false; } else if (tokenIsIdentifier(type) && !this.hasFollowingLineBreak()) { this.expectPlugin("explicitResourceManagement"); return true; } } startsAwaitUsing() { let next = this.nextTokenInLineStart(); if (this.isUnparsedContextual(next, "using")) { next = this.nextTokenInLineStartSince(next + 5); const nextCh = this.codePointAtPos(next); if (this.chStartsBindingIdentifier(nextCh, next)) { this.expectPlugin("explicitResourceManagement"); return true; } } return false; } parseModuleItem() { return this.parseStatementLike(1 | 2 | 4 | 8); } parseStatementListItem() { return this.parseStatementLike(2 | 4 | (!this.options.annexB || this.state.strict ? 0 : 8)); } parseStatementOrSloppyAnnexBFunctionDeclaration(allowLabeledFunction = false) { let flags = 0; if (this.options.annexB && !this.state.strict) { flags |= 4; if (allowLabeledFunction) { flags |= 8; } } return this.parseStatementLike(flags); } parseStatement() { return this.parseStatementLike(0); } parseStatementLike(flags) { let decorators = null; if (this.match(26)) { decorators = this.parseDecorators(true); } return this.parseStatementContent(flags, decorators); } parseStatementContent(flags, decorators) { const startType = this.state.type; const node = this.startNode(); const allowDeclaration = !!(flags & 2); const allowFunctionDeclaration = !!(flags & 4); const topLevel = flags & 1; switch (startType) { case 60: return this.parseBreakContinueStatement(node, true); case 63: return this.parseBreakContinueStatement(node, false); case 64: return this.parseDebuggerStatement(node); case 90: return this.parseDoWhileStatement(node); case 91: return this.parseForStatement(node); case 68: if (this.lookaheadCharCode() === 46) break; if (!allowFunctionDeclaration) { this.raise(this.state.strict ? Errors.StrictFunction : this.options.annexB ? Errors.SloppyFunctionAnnexB : Errors.SloppyFunction, this.state.startLoc); } return this.parseFunctionStatement(node, false, !allowDeclaration && allowFunctionDeclaration); case 80: if (!allowDeclaration) this.unexpected(); return this.parseClass(this.maybeTakeDecorators(decorators, node), true); case 69: return this.parseIfStatement(node); case 70: return this.parseReturnStatement(node); case 71: return this.parseSwitchStatement(node); case 72: return this.parseThrowStatement(node); case 73: return this.parseTryStatement(node); case 96: if (!this.state.containsEsc && this.startsAwaitUsing()) { if (!this.recordAwaitIfAllowed()) { this.raise(Errors.AwaitUsingNotInAsyncContext, node); } else if (!allowDeclaration) { this.raise(Errors.UnexpectedLexicalDeclaration, node); } this.next(); return this.parseVarStatement(node, "await using"); } break; case 107: if (this.state.containsEsc || !this.hasInLineFollowingBindingIdentifierOrBrace()) { break; } this.expectPlugin("explicitResourceManagement"); if (!this.scope.inModule && this.scope.inTopLevel) { this.raise(Errors.UnexpectedUsingDeclaration, this.state.startLoc); } else if (!allowDeclaration) { this.raise(Errors.UnexpectedLexicalDeclaration, this.state.startLoc); } return this.parseVarStatement(node, "using"); case 100: { if (this.state.containsEsc) { break; } const next = this.nextTokenStart(); const nextCh = this.codePointAtPos(next); if (nextCh !== 91) { if (!allowDeclaration && this.hasFollowingLineBreak()) break; if (!this.chStartsBindingIdentifier(nextCh, next) && nextCh !== 123) { break; } } } case 75: { if (!allowDeclaration) { this.raise(Errors.UnexpectedLexicalDeclaration, this.state.startLoc); } } case 74: { const kind = this.state.value; return this.parseVarStatement(node, kind); } case 92: return this.parseWhileStatement(node); case 76: return this.parseWithStatement(node); case 5: return this.parseBlock(); case 13: return this.parseEmptyStatement(node); case 83: { const nextTokenCharCode = this.lookaheadCharCode(); if (nextTokenCharCode === 40 || nextTokenCharCode === 46) { break; } } case 82: { if (!this.options.allowImportExportEverywhere && !topLevel) { this.raise(Errors.UnexpectedImportExport, this.state.startLoc); } this.next(); let result; if (startType === 83) { result = this.parseImport(node); if (result.type === "ImportDeclaration" && (!result.importKind || result.importKind === "value")) { this.sawUnambiguousESM = true; } } else { result = this.parseExport(node, decorators); if (result.type === "ExportNamedDeclaration" && (!result.exportKind || result.exportKind === "value") || result.type === "ExportAllDeclaration" && (!result.exportKind || result.exportKind === "value") || result.type === "ExportDefaultDeclaration") { this.sawUnambiguousESM = true; } } this.assertModuleNodeAllowed(result); return result; } default: { if (this.isAsyncFunction()) { if (!allowDeclaration) { this.raise(Errors.AsyncFunctionInSingleStatementContext, this.state.startLoc); } this.next(); return this.parseFunctionStatement(node, true, !allowDeclaration && allowFunctionDeclaration); } } } const maybeName = this.state.value; const expr = this.parseExpression(); if (tokenIsIdentifier(startType) && expr.type === "Identifier" && this.eat(14)) { return this.parseLabeledStatement(node, maybeName, expr, flags); } else { return this.parseExpressionStatement(node, expr, decorators); } } assertModuleNodeAllowed(node) { if (!this.options.allowImportExportEverywhere && !this.inModule) { this.raise(Errors.ImportOutsideModule, node); } } decoratorsEnabledBeforeExport() { if (this.hasPlugin("decorators-legacy")) return true; return this.hasPlugin("decorators") && this.getPluginOption("decorators", "decoratorsBeforeExport") !== false; } maybeTakeDecorators(maybeDecorators, classNode, exportNode) { if (maybeDecorators) { if (classNode.decorators && classNode.decorators.length > 0) { if (typeof this.getPluginOption("decorators", "decoratorsBeforeExport") !== "boolean") { this.raise(Errors.DecoratorsBeforeAfterExport, classNode.decorators[0]); } classNode.decorators.unshift(...maybeDecorators); } else { classNode.decorators = maybeDecorators; } this.resetStartLocationFromNode(classNode, maybeDecorators[0]); if (exportNode) this.resetStartLocationFromNode(exportNode, classNode); } return classNode; } canHaveLeadingDecorator() { return this.match(80); } parseDecorators(allowExport) { const decorators = []; do { decorators.push(this.parseDecorator()); } while (this.match(26)); if (this.match(82)) { if (!allowExport) { this.unexpected(); } if (!this.decoratorsEnabledBeforeExport()) { this.raise(Errors.DecoratorExportClass, this.state.startLoc); } } else if (!this.canHaveLeadingDecorator()) { throw this.raise(Errors.UnexpectedLeadingDecorator, this.state.startLoc); } return decorators; } parseDecorator() { this.expectOnePlugin(["decorators", "decorators-legacy"]); const node = this.startNode(); this.next(); if (this.hasPlugin("decorators")) { const startLoc = this.state.startLoc; let expr; if (this.match(10)) { const startLoc = this.state.startLoc; this.next(); expr = this.parseExpression(); this.expect(11); expr = this.wrapParenthesis(startLoc, expr); const paramsStartLoc = this.state.startLoc; node.expression = this.parseMaybeDecoratorArguments(expr); if (this.getPluginOption("decorators", "allowCallParenthesized") === false && node.expression !== expr) { this.raise(Errors.DecoratorArgumentsOutsideParentheses, paramsStartLoc); } } else { expr = this.parseIdentifier(false); while (this.eat(16)) { const node = this.startNodeAt(startLoc); node.object = expr; if (this.match(139)) { this.classScope.usePrivateName(this.state.value, this.state.startLoc); node.property = this.parsePrivateName(); } else { node.property = this.parseIdentifier(true); } node.computed = false; expr = this.finishNode(node, "MemberExpression"); } node.expression = this.parseMaybeDecoratorArguments(expr); } } else { node.expression = this.parseExprSubscripts(); } return this.finishNode(node, "Decorator"); } parseMaybeDecoratorArguments(expr) { if (this.eat(10)) { const node = this.startNodeAtNode(expr); node.callee = expr; node.arguments = this.parseCallExpressionArguments(11); this.toReferencedList(node.arguments); return this.finishNode(node, "CallExpression"); } return expr; } parseBreakContinueStatement(node, isBreak) { this.next(); if (this.isLineTerminator()) { node.label = null; } else { node.label = this.parseIdentifier(); this.semicolon(); } this.verifyBreakContinue(node, isBreak); return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement"); } verifyBreakContinue(node, isBreak) { let i; for (i = 0; i < this.state.labels.length; ++i) { const lab = this.state.labels[i]; if (node.label == null || lab.name === node.label.name) { if (lab.kind != null && (isBreak || lab.kind === 1)) { break; } if (node.label && isBreak) break; } } if (i === this.state.labels.length) { const type = isBreak ? "BreakStatement" : "ContinueStatement"; this.raise(Errors.IllegalBreakContinue, node, { type }); } } parseDebuggerStatement(node) { this.next(); this.semicolon(); return this.finishNode(node, "DebuggerStatement"); } parseHeaderExpression() { this.expect(10); const val = this.parseExpression(); this.expect(11); return val; } parseDoWhileStatement(node) { this.next(); this.state.labels.push(loopLabel); node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement()); this.state.labels.pop(); this.expect(92); node.test = this.parseHeaderExpression(); this.eat(13); return this.finishNode(node, "DoWhileStatement"); } parseForStatement(node) { this.next(); this.state.labels.push(loopLabel); let awaitAt = null; if (this.isContextual(96) && this.recordAwaitIfAllowed()) { awaitAt = this.state.startLoc; this.next(); } this.scope.enter(0); this.expect(10); if (this.match(13)) { if (awaitAt !== null) { this.unexpected(awaitAt); } return this.parseFor(node, null); } const startsWithLet = this.isContextual(100); { const startsWithAwaitUsing = this.isContextual(96) && this.startsAwaitUsing(); const starsWithUsingDeclaration = startsWithAwaitUsing || this.isContextual(107) && this.startsUsingForOf(); const isLetOrUsing = startsWithLet && this.hasFollowingBindingAtom() || starsWithUsingDeclaration; if (this.match(74) || this.match(75) || isLetOrUsing) { const initNode = this.startNode(); let kind; if (startsWithAwaitUsing) { kind = "await using"; if (!this.recordAwaitIfAllowed()) { this.raise(Errors.AwaitUsingNotInAsyncContext, this.state.startLoc); } this.next(); } else { kind = this.state.value; } this.next(); this.parseVar(initNode, true, kind); const init = this.finishNode(initNode, "VariableDeclaration"); const isForIn = this.match(58); if (isForIn && starsWithUsingDeclaration) { this.raise(Errors.ForInUsing, init); } if ((isForIn || this.isContextual(102)) && init.declarations.length === 1) { return this.parseForIn(node, init, awaitAt); } if (awaitAt !== null) { this.unexpected(awaitAt); } return this.parseFor(node, init); } } const startsWithAsync = this.isContextual(95); const refExpressionErrors = new ExpressionErrors(); const init = this.parseExpression(true, refExpressionErrors); const isForOf = this.isContextual(102); if (isForOf) { if (startsWithLet) { this.raise(Errors.ForOfLet, init); } if (awaitAt === null && startsWithAsync && init.type === "Identifier") { this.raise(Errors.ForOfAsync, init); } } if (isForOf || this.match(58)) { this.checkDestructuringPrivate(refExpressionErrors); this.toAssignable(init, true); const type = isForOf ? "ForOfStatement" : "ForInStatement"; this.checkLVal(init, { type }); return this.parseForIn(node, init, awaitAt); } else { this.checkExpressionErrors(refExpressionErrors, true); } if (awaitAt !== null) { this.unexpected(awaitAt); } return this.parseFor(node, init); } parseFunctionStatement(node, isAsync, isHangingDeclaration) { this.next(); return this.parseFunction(node, 1 | (isHangingDeclaration ? 2 : 0) | (isAsync ? 8 : 0)); } parseIfStatement(node) { this.next(); node.test = this.parseHeaderExpression(); node.consequent = this.parseStatementOrSloppyAnnexBFunctionDeclaration(); node.alternate = this.eat(66) ? this.parseStatementOrSloppyAnnexBFunctionDeclaration() : null; return this.finishNode(node, "IfStatement"); } parseReturnStatement(node) { if (!this.prodParam.hasReturn && !this.options.allowReturnOutsideFunction) { this.raise(Errors.IllegalReturn, this.state.startLoc); } this.next(); if (this.isLineTerminator()) { node.argument = null; } else { node.argument = this.parseExpression(); this.semicolon(); } return this.finishNode(node, "ReturnStatement"); } parseSwitchStatement(node) { this.next(); node.discriminant = this.parseHeaderExpression(); const cases = node.cases = []; this.expect(5); this.state.labels.push(switchLabel); this.scope.enter(0); let cur; for (let sawDefault; !this.match(8);) { if (this.match(61) || this.match(65)) { const isCase = this.match(61); if (cur) this.finishNode(cur, "SwitchCase"); cases.push(cur = this.startNode()); cur.consequent = []; this.next(); if (isCase) { cur.test = this.parseExpression(); } else { if (sawDefault) { this.raise(Errors.MultipleDefaultsInSwitch, this.state.lastTokStartLoc); } sawDefault = true; cur.test = null; } this.expect(14); } else { if (cur) { cur.consequent.push(this.parseStatementListItem()); } else { this.unexpected(); } } } this.scope.exit(); if (cur) this.finishNode(cur, "SwitchCase"); this.next(); this.state.labels.pop(); return this.finishNode(node, "SwitchStatement"); } parseThrowStatement(node) { this.next(); if (this.hasPrecedingLineBreak()) { this.raise(Errors.NewlineAfterThrow, this.state.lastTokEndLoc); } node.argument = this.parseExpression(); this.semicolon(); return this.finishNode(node, "ThrowStatement"); } parseCatchClauseParam() { const param = this.parseBindingAtom(); this.scope.enter(this.options.annexB && param.type === "Identifier" ? 8 : 0); this.checkLVal(param, { type: "CatchClause" }, 9); return param; } parseTryStatement(node) { this.next(); node.block = this.parseBlock(); node.handler = null; if (this.match(62)) { const clause = this.startNode(); this.next(); if (this.match(10)) { this.expect(10); clause.param = this.parseCatchClauseParam(); this.expect(11); } else { clause.param = null; this.scope.enter(0); } clause.body = this.withSmartMixTopicForbiddingContext(() => this.parseBlock(false, false)); this.scope.exit(); node.handler = this.finishNode(clause, "CatchClause"); } node.finalizer = this.eat(67) ? this.parseBlock() : null; if (!node.handler && !node.finalizer) { this.raise(Errors.NoCatchOrFinally, node); } return this.finishNode(node, "TryStatement"); } parseVarStatement(node, kind, allowMissingInitializer = false) { this.next(); this.parseVar(node, false, kind, allowMissingInitializer); this.semicolon(); return this.finishNode(node, "VariableDeclaration"); } parseWhileStatement(node) { this.next(); node.test = this.parseHeaderExpression(); this.state.labels.push(loopLabel); node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement()); this.state.labels.pop(); return this.finishNode(node, "WhileStatement"); } parseWithStatement(node) { if (this.state.strict) { this.raise(Errors.StrictWith, this.state.startLoc); } this.next(); node.object = this.parseHeaderExpression(); node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement()); return this.finishNode(node, "WithStatement"); } parseEmptyStatement(node) { this.next(); return this.finishNode(node, "EmptyStatement"); } parseLabeledStatement(node, maybeName, expr, flags) { for (const label of this.state.labels) { if (label.name === maybeName) { this.raise(Errors.LabelRedeclaration, expr, { labelName: maybeName }); } } const kind = tokenIsLoop(this.state.type) ? 1 : this.match(71) ? 2 : null; for (let i = this.state.labels.length - 1; i >= 0; i--) { const label = this.state.labels[i]; if (label.statementStart === node.start) { label.statementStart = this.sourceToOffsetPos(this.state.start); label.kind = kind; } else { break; } } this.state.labels.push({ name: maybeName, kind: kind, statementStart: this.sourceToOffsetPos(this.state.start) }); node.body = flags & 8 ? this.parseStatementOrSloppyAnnexBFunctionDeclaration(true) : this.parseStatement(); this.state.labels.pop(); node.label = expr; return this.finishNode(node, "LabeledStatement"); } parseExpressionStatement(node, expr, decorators) { node.expression = expr; this.semicolon(); return this.finishNode(node, "ExpressionStatement"); } parseBlock(allowDirectives = false, createNewLexicalScope = true, afterBlockParse) { const node = this.startNode(); if (allowDirectives) { this.state.strictErrors.clear(); } this.expect(5); if (createNewLexicalScope) { this.scope.enter(0); } this.parseBlockBody(node, allowDirectives, false, 8, afterBlockParse); if (createNewLexicalScope) { this.scope.exit(); } return this.finishNode(node, "BlockStatement"); } isValidDirective(stmt) { return stmt.type === "ExpressionStatement" && stmt.expression.type === "StringLiteral" && !stmt.expression.extra.parenthesized; } parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse) { const body = node.body = []; const directives = node.directives = []; this.parseBlockOrModuleBlockBody(body, allowDirectives ? directives : undefined, topLevel, end, afterBlockParse); } parseBlockOrModuleBlockBody(body, directives, topLevel, end, afterBlockParse) { const oldStrict = this.state.strict; let hasStrictModeDirective = false; let parsedNonDirective = false; while (!this.match(end)) { const stmt = topLevel ? this.parseModuleItem() : this.parseStatementListItem(); if (directives && !parsedNonDirective) { if (this.isValidDirective(stmt)) { const directive = this.stmtToDirective(stmt); directives.push(directive); if (!hasStrictModeDirective && directive.value.value === "use strict") { hasStrictModeDirective = true; this.setStrict(true); } continue; } parsedNonDirective = true; this.state.strictErrors.clear(); } body.push(stmt); } afterBlockParse == null || afterBlockParse.call(this, hasStrictModeDirective); if (!oldStrict) { this.setStrict(false); } this.next(); } parseFor(node, init) { node.init = init; this.semicolon(false); node.test = this.match(13) ? null : this.parseExpression(); this.semicolon(false); node.update = this.match(11) ? null : this.parseExpression(); this.expect(11); node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement()); this.scope.exit(); this.state.labels.pop(); return this.finishNode(node, "ForStatement"); } parseForIn(node, init, awaitAt) { const isForIn = this.match(58); this.next(); if (isForIn) { if (awaitAt !== null) this.unexpected(awaitAt); } else { node.await = awaitAt !== null; } if (init.type === "VariableDeclaration" && init.declarations[0].init != null && (!isForIn || !this.options.annexB || this.state.strict || init.kind !== "var" || init.declarations[0].id.type !== "Identifier")) { this.raise(Errors.ForInOfLoopInitializer, init, { type: isForIn ? "ForInStatement" : "ForOfStatement" }); } if (init.type === "AssignmentPattern") { this.raise(Errors.InvalidLhs, init, { ancestor: { type: "ForStatement" } }); } node.left = init; node.right = isForIn ? this.parseExpression() : this.parseMaybeAssignAllowIn(); this.expect(11); node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement()); this.scope.exit(); this.state.labels.pop(); return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement"); } parseVar(node, isFor, kind, allowMissingInitializer = false) { const declarations = node.declarations = []; node.kind = kind; for (;;) { const decl = this.startNode(); this.parseVarId(decl, kind); decl.init = !this.eat(29) ? null : isFor ? this.parseMaybeAssignDisallowIn() : this.parseMaybeAssignAllowIn(); if (decl.init === null && !allowMissingInitializer) { if (decl.id.type !== "Identifier" && !(isFor && (this.match(58) || this.isContextual(102)))) { this.raise(Errors.DeclarationMissingInitializer, this.state.lastTokEndLoc, { kind: "destructuring" }); } else if ((kind === "const" || kind === "using" || kind === "await using") && !(this.match(58) || this.isContextual(102))) { this.raise(Errors.DeclarationMissingInitializer, this.state.lastTokEndLoc, { kind }); } } declarations.push(this.finishNode(decl, "VariableDeclarator")); if (!this.eat(12)) break; } return node; } parseVarId(decl, kind) { const id = this.parseBindingAtom(); if (kind === "using" || kind === "await using") { if (id.type === "ArrayPattern" || id.type === "ObjectPattern") { this.raise(Errors.UsingDeclarationHasBindingPattern, id.loc.start); } } this.checkLVal(id, { type: "VariableDeclarator" }, kind === "var" ? 5 : 8201); decl.id = id; } parseAsyncFunctionExpression(node) { return this.parseFunction(node, 8); } parseFunction(node, flags = 0) { const hangingDeclaration = flags & 2; const isDeclaration = !!(flags & 1); const requireId = isDeclaration && !(flags & 4); const isAsync = !!(flags & 8); this.initFunction(node, isAsync); if (this.match(55)) { if (hangingDeclaration) { this.raise(Errors.GeneratorInSingleStatementContext, this.state.startLoc); } this.next(); node.generator = true; } if (isDeclaration) { node.id = this.parseFunctionId(requireId); } const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; this.state.maybeInArrowParameters = false; this.scope.enter(2); this.prodParam.enter(functionFlags(isAsync, node.generator)); if (!isDeclaration) { node.id = this.parseFunctionId(); } this.parseFunctionParams(node, false); this.withSmartMixTopicForbiddingContext(() => { this.parseFunctionBodyAndFinish(node, isDeclaration ? "FunctionDeclaration" : "FunctionExpression"); }); this.prodParam.exit(); this.scope.exit(); if (isDeclaration && !hangingDeclaration) { this.registerFunctionStatementId(node); } this.state.maybeInArrowParameters = oldMaybeInArrowParameters; return node; } parseFunctionId(requireId) { return requireId || tokenIsIdentifier(this.state.type) ? this.parseIdentifier() : null; } parseFunctionParams(node, isConstructor) { this.expect(10); this.expressionScope.enter(newParameterDeclarationScope()); node.params = this.parseBindingList(11, 41, 2 | (isConstructor ? 4 : 0)); this.expressionScope.exit(); } registerFunctionStatementId(node) { if (!node.id) return; this.scope.declareName(node.id.name, !this.options.annexB || this.state.strict || node.generator || node.async ? this.scope.treatFunctionsAsVar ? 5 : 8201 : 17, node.id.loc.start); } parseClass(node, isStatement, optionalId) { this.next(); const oldStrict = this.state.strict; this.state.strict = true; this.parseClassId(node, isStatement, optionalId); this.parseClassSuper(node); node.body = this.parseClassBody(!!node.superClass, oldStrict); return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression"); } isClassProperty() { return this.match(29) || this.match(13) || this.match(8); } isClassMethod() { return this.match(10); } nameIsConstructor(key) { return key.type === "Identifier" && key.name === "constructor" || key.type === "StringLiteral" && key.value === "constructor"; } isNonstaticConstructor(method) { return !method.computed && !method.static && this.nameIsConstructor(method.key); } parseClassBody(hadSuperClass, oldStrict) { this.classScope.enter(); const state = { hadConstructor: false, hadSuperClass }; let decorators = []; const classBody = this.startNode(); classBody.body = []; this.expect(5); this.withSmartMixTopicForbiddingContext(() => { while (!this.match(8)) { if (this.eat(13)) { if (decorators.length > 0) { throw this.raise(Errors.DecoratorSemicolon, this.state.lastTokEndLoc); } continue; } if (this.match(26)) { decorators.push(this.parseDecorator()); continue; } const member = this.startNode(); if (decorators.length) { member.decorators = decorators; this.resetStartLocationFromNode(member, decorators[0]); decorators = []; } this.parseClassMember(classBody, member, state); if (member.kind === "constructor" && member.decorators && member.decorators.length > 0) { this.raise(Errors.DecoratorConstructor, member); } } }); this.state.strict = oldStrict; this.next(); if (decorators.length) { throw this.raise(Errors.TrailingDecorator, this.state.startLoc); } this.classScope.exit(); return this.finishNode(classBody, "ClassBody"); } parseClassMemberFromModifier(classBody, member) { const key = this.parseIdentifier(true); if (this.isClassMethod()) { const method = member; method.kind = "method"; method.computed = false; method.key = key; method.static = false; this.pushClassMethod(classBody, method, false, false, false, false); return true; } else if (this.isClassProperty()) { const prop = member; prop.computed = false; prop.key = key; prop.static = false; classBody.body.push(this.parseClassProperty(prop)); return true; } this.resetPreviousNodeTrailingComments(key); return false; } parseClassMember(classBody, member, state) { const isStatic = this.isContextual(106); if (isStatic) { if (this.parseClassMemberFromModifier(classBody, member)) { return; } if (this.eat(5)) { this.parseClassStaticBlock(classBody, member); return; } } this.parseClassMemberWithIsStatic(classBody, member, state, isStatic); } parseClassMemberWithIsStatic(classBody, member, state, isStatic) { const publicMethod = member; const privateMethod = member; const publicProp = member; const privateProp = member; const accessorProp = member; const method = publicMethod; const publicMember = publicMethod; member.static = isStatic; this.parsePropertyNamePrefixOperator(member); if (this.eat(55)) { method.kind = "method"; const isPrivateName = this.match(139); this.parseClassElementName(method); if (isPrivateName) { this.pushClassPrivateMethod(classBody, privateMethod, true, false); return; } if (this.isNonstaticConstructor(publicMethod)) { this.raise(Errors.ConstructorIsGenerator, publicMethod.key); } this.pushClassMethod(classBody, publicMethod, true, false, false, false); return; } const isContextual = !this.state.containsEsc && tokenIsIdentifier(this.state.type); const key = this.parseClassElementName(member); const maybeContextualKw = isContextual ? key.name : null; const isPrivate = this.isPrivateName(key); const maybeQuestionTokenStartLoc = this.state.startLoc; this.parsePostMemberNameModifiers(publicMember); if (this.isClassMethod()) { method.kind = "method"; if (isPrivate) { this.pushClassPrivateMethod(classBody, privateMethod, false, false); return; } const isConstructor = this.isNonstaticConstructor(publicMethod); let allowsDirectSuper = false; if (isConstructor) { publicMethod.kind = "constructor"; if (state.hadConstructor && !this.hasPlugin("typescript")) { this.raise(Errors.DuplicateConstructor, key); } if (isConstructor && this.hasPlugin("typescript") && member.override) { this.raise(Errors.OverrideOnConstructor, key); } state.hadConstructor = true; allowsDirectSuper = state.hadSuperClass; } this.pushClassMethod(classBody, publicMethod, false, false, isConstructor, allowsDirectSuper); } else if (this.isClassProperty()) { if (isPrivate) { this.pushClassPrivateProperty(classBody, privateProp); } else { this.pushClassProperty(classBody, publicProp); } } else if (maybeContextualKw === "async" && !this.isLineTerminator()) { this.resetPreviousNodeTrailingComments(key); const isGenerator = this.eat(55); if (publicMember.optional) { this.unexpected(maybeQuestionTokenStartLoc); } method.kind = "method"; const isPrivate = this.match(139); this.parseClassElementName(method); this.parsePostMemberNameModifiers(publicMember); if (isPrivate) { this.pushClassPrivateMethod(classBody, privateMethod, isGenerator, true); } else { if (this.isNonstaticConstructor(publicMethod)) { this.raise(Errors.ConstructorIsAsync, publicMethod.key); } this.pushClassMethod(classBody, publicMethod, isGenerator, true, false, false); } } else if ((maybeContextualKw === "get" || maybeContextualKw === "set") && !(this.match(55) && this.isLineTerminator())) { this.resetPreviousNodeTrailingComments(key); method.kind = maybeContextualKw; const isPrivate = this.match(139); this.parseClassElementName(publicMethod); if (isPrivate) { this.pushClassPrivateMethod(classBody, privateMethod, false, false); } else { if (this.isNonstaticConstructor(publicMethod)) { this.raise(Errors.ConstructorIsAccessor, publicMethod.key); } this.pushClassMethod(classBody, publicMethod, false, false, false, false); } this.checkGetterSetterParams(publicMethod); } else if (maybeContextualKw === "accessor" && !this.isLineTerminator()) { this.expectPlugin("decoratorAutoAccessors"); this.resetPreviousNodeTrailingComments(key); const isPrivate = this.match(139); this.parseClassElementName(publicProp); this.pushClassAccessorProperty(classBody, accessorProp, isPrivate); } else if (this.isLineTerminator()) { if (isPrivate) { this.pushClassPrivateProperty(classBody, privateProp); } else { this.pushClassProperty(classBody, publicProp); } } else { this.unexpected(); } } parseClassElementName(member) { const { type, value } = this.state; if ((type === 132 || type === 134) && member.static && value === "prototype") { this.raise(Errors.StaticPrototype, this.state.startLoc); } if (type === 139) { if (value === "constructor") { this.raise(Errors.ConstructorClassPrivateField, this.state.startLoc); } const key = this.parsePrivateName(); member.key = key; return key; } this.parsePropertyName(member); return member.key; } parseClassStaticBlock(classBody, member) { var _member$decorators; this.scope.enter(64 | 128 | 16); const oldLabels = this.state.labels; this.state.labels = []; this.prodParam.enter(0); const body = member.body = []; this.parseBlockOrModuleBlockBody(body, undefined, false, 8); this.prodParam.exit(); this.scope.exit(); this.state.labels = oldLabels; classBody.body.push(this.finishNode(member, "StaticBlock")); if ((_member$decorators = member.decorators) != null && _member$decorators.length) { this.raise(Errors.DecoratorStaticBlock, member); } } pushClassProperty(classBody, prop) { if (!prop.computed && this.nameIsConstructor(prop.key)) { this.raise(Errors.ConstructorClassField, prop.key); } classBody.body.push(this.parseClassProperty(prop)); } pushClassPrivateProperty(classBody, prop) { const node = this.parseClassPrivateProperty(prop); classBody.body.push(node); this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), 0, node.key.loc.start); } pushClassAccessorProperty(classBody, prop, isPrivate) { if (!isPrivate && !prop.computed && this.nameIsConstructor(prop.key)) { this.raise(Errors.ConstructorClassField, prop.key); } const node = this.parseClassAccessorProperty(prop); classBody.body.push(node); if (isPrivate) { this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), 0, node.key.loc.start); } } pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { classBody.body.push(this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, "ClassMethod", true)); } pushClassPrivateMethod(classBody, method, isGenerator, isAsync) { const node = this.parseMethod(method, isGenerator, isAsync, false, false, "ClassPrivateMethod", true); classBody.body.push(node); const kind = node.kind === "get" ? node.static ? 6 : 2 : node.kind === "set" ? node.static ? 5 : 1 : 0; this.declareClassPrivateMethodInScope(node, kind); } declareClassPrivateMethodInScope(node, kind) { this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), kind, node.key.loc.start); } parsePostMemberNameModifiers(methodOrProp) {} parseClassPrivateProperty(node) { this.parseInitializer(node); this.semicolon(); return this.finishNode(node, "ClassPrivateProperty"); } parseClassProperty(node) { this.parseInitializer(node); this.semicolon(); return this.finishNode(node, "ClassProperty"); } parseClassAccessorProperty(node) { this.parseInitializer(node); this.semicolon(); return this.finishNode(node, "ClassAccessorProperty"); } parseInitializer(node) { this.scope.enter(64 | 16); this.expressionScope.enter(newExpressionScope()); this.prodParam.enter(0); node.value = this.eat(29) ? this.parseMaybeAssignAllowIn() : null; this.expressionScope.exit(); this.prodParam.exit(); this.scope.exit(); } parseClassId(node, isStatement, optionalId, bindingType = 8331) { if (tokenIsIdentifier(this.state.type)) { node.id = this.parseIdentifier(); if (isStatement) { this.declareNameFromIdentifier(node.id, bindingType); } } else { if (optionalId || !isStatement) { node.id = null; } else { throw this.raise(Errors.MissingClassName, this.state.startLoc); } } } parseClassSuper(node) { node.superClass = this.eat(81) ? this.parseExprSubscripts() : null; } parseExport(node, decorators) { const maybeDefaultIdentifier = this.parseMaybeImportPhase(node, true); const hasDefault = this.maybeParseExportDefaultSpecifier(node, maybeDefaultIdentifier); const parseAfterDefault = !hasDefault || this.eat(12); const hasStar = parseAfterDefault && this.eatExportStar(node); const hasNamespace = hasStar && this.maybeParseExportNamespaceSpecifier(node); const parseAfterNamespace = parseAfterDefault && (!hasNamespace || this.eat(12)); const isFromRequired = hasDefault || hasStar; if (hasStar && !hasNamespace) { if (hasDefault) this.unexpected(); if (decorators) { throw this.raise(Errors.UnsupportedDecoratorExport, node); } this.parseExportFrom(node, true); return this.finishNode(node, "ExportAllDeclaration"); } const hasSpecifiers = this.maybeParseExportNamedSpecifiers(node); if (hasDefault && parseAfterDefault && !hasStar && !hasSpecifiers) { this.unexpected(null, 5); } if (hasNamespace && parseAfterNamespace) { this.unexpected(null, 98); } let hasDeclaration; if (isFromRequired || hasSpecifiers) { hasDeclaration = false; if (decorators) { throw this.raise(Errors.UnsupportedDecoratorExport, node); } this.parseExportFrom(node, isFromRequired); } else { hasDeclaration = this.maybeParseExportDeclaration(node); } if (isFromRequired || hasSpecifiers || hasDeclaration) { var _node2$declaration; const node2 = node; this.checkExport(node2, true, false, !!node2.source); if (((_node2$declaration = node2.declaration) == null ? void 0 : _node2$declaration.type) === "ClassDeclaration") { this.maybeTakeDecorators(decorators, node2.declaration, node2); } else if (decorators) { throw this.raise(Errors.UnsupportedDecoratorExport, node); } return this.finishNode(node2, "ExportNamedDeclaration"); } if (this.eat(65)) { const node2 = node; const decl = this.parseExportDefaultExpression(); node2.declaration = decl; if (decl.type === "ClassDeclaration") { this.maybeTakeDecorators(decorators, decl, node2); } else if (decorators) { throw this.raise(Errors.UnsupportedDecoratorExport, node); } this.checkExport(node2, true, true); return this.finishNode(node2, "ExportDefaultDeclaration"); } this.unexpected(null, 5); } eatExportStar(node) { return this.eat(55); } maybeParseExportDefaultSpecifier(node, maybeDefaultIdentifier) { if (maybeDefaultIdentifier || this.isExportDefaultSpecifier()) { this.expectPlugin("exportDefaultFrom", maybeDefaultIdentifier == null ? void 0 : maybeDefaultIdentifier.loc.start); const id = maybeDefaultIdentifier || this.parseIdentifier(true); const specifier = this.startNodeAtNode(id); specifier.exported = id; node.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")]; return true; } return false; } maybeParseExportNamespaceSpecifier(node) { if (this.isContextual(93)) { var _ref, _ref$specifiers; (_ref$specifiers = (_ref = node).specifiers) != null ? _ref$specifiers : _ref.specifiers = []; const specifier = this.startNodeAt(this.state.lastTokStartLoc); this.next(); specifier.exported = this.parseModuleExportName(); node.specifiers.push(this.finishNode(specifier, "ExportNamespaceSpecifier")); return true; } return false; } maybeParseExportNamedSpecifiers(node) { if (this.match(5)) { const node2 = node; if (!node2.specifiers) node2.specifiers = []; const isTypeExport = node2.exportKind === "type"; node2.specifiers.push(...this.parseExportSpecifiers(isTypeExport)); node2.source = null; node2.declaration = null; if (this.hasPlugin("importAssertions")) { node2.assertions = []; } return true; } return false; } maybeParseExportDeclaration(node) { if (this.shouldParseExportDeclaration()) { node.specifiers = []; node.source = null; if (this.hasPlugin("importAssertions")) { node.assertions = []; } node.declaration = this.parseExportDeclaration(node); return true; } return false; } isAsyncFunction() { if (!this.isContextual(95)) return false; const next = this.nextTokenInLineStart(); return this.isUnparsedContextual(next, "function"); } parseExportDefaultExpression() { const expr = this.startNode(); if (this.match(68)) { this.next(); return this.parseFunction(expr, 1 | 4); } else if (this.isAsyncFunction()) { this.next(); this.next(); return this.parseFunction(expr, 1 | 4 | 8); } if (this.match(80)) { return this.parseClass(expr, true, true); } if (this.match(26)) { if (this.hasPlugin("decorators") && this.getPluginOption("decorators", "decoratorsBeforeExport") === true) { this.raise(Errors.DecoratorBeforeExport, this.state.startLoc); } return this.parseClass(this.maybeTakeDecorators(this.parseDecorators(false), this.startNode()), true, true); } if (this.match(75) || this.match(74) || this.isLet()) { throw this.raise(Errors.UnsupportedDefaultExport, this.state.startLoc); } const res = this.parseMaybeAssignAllowIn(); this.semicolon(); return res; } parseExportDeclaration(node) { if (this.match(80)) { const node = this.parseClass(this.startNode(), true, false); return node; } return this.parseStatementListItem(); } isExportDefaultSpecifier() { const { type } = this.state; if (tokenIsIdentifier(type)) { if (type === 95 && !this.state.containsEsc || type === 100) { return false; } if ((type === 130 || type === 129) && !this.state.containsEsc) { const { type: nextType } = this.lookahead(); if (tokenIsIdentifier(nextType) && nextType !== 98 || nextType === 5) { this.expectOnePlugin(["flow", "typescript"]); return false; } } } else if (!this.match(65)) { return false; } const next = this.nextTokenStart(); const hasFrom = this.isUnparsedContextual(next, "from"); if (this.input.charCodeAt(next) === 44 || tokenIsIdentifier(this.state.type) && hasFrom) { return true; } if (this.match(65) && hasFrom) { const nextAfterFrom = this.input.charCodeAt(this.nextTokenStartSince(next + 4)); return nextAfterFrom === 34 || nextAfterFrom === 39; } return false; } parseExportFrom(node, expect) { if (this.eatContextual(98)) { node.source = this.parseImportSource(); this.checkExport(node); this.maybeParseImportAttributes(node); this.checkJSONModuleImport(node); } else if (expect) { this.unexpected(); } this.semicolon(); } shouldParseExportDeclaration() { const { type } = this.state; if (type === 26) { this.expectOnePlugin(["decorators", "decorators-legacy"]); if (this.hasPlugin("decorators")) { if (this.getPluginOption("decorators", "decoratorsBeforeExport") === true) { this.raise(Errors.DecoratorBeforeExport, this.state.startLoc); } return true; } } if (this.isContextual(107)) { this.raise(Errors.UsingDeclarationExport, this.state.startLoc); return true; } if (this.isContextual(96) && this.startsAwaitUsing()) { this.raise(Errors.UsingDeclarationExport, this.state.startLoc); return true; } return type === 74 || type === 75 || type === 68 || type === 80 || this.isLet() || this.isAsyncFunction(); } checkExport(node, checkNames, isDefault, isFrom) { if (checkNames) { var _node$specifiers; if (isDefault) { this.checkDuplicateExports(node, "default"); if (this.hasPlugin("exportDefaultFrom")) { var _declaration$extra; const declaration = node.declaration; if (declaration.type === "Identifier" && declaration.name === "from" && declaration.end - declaration.start === 4 && !((_declaration$extra = declaration.extra) != null && _declaration$extra.parenthesized)) { this.raise(Errors.ExportDefaultFromAsIdentifier, declaration); } } } else if ((_node$specifiers = node.specifiers) != null && _node$specifiers.length) { for (const specifier of node.specifiers) { const { exported } = specifier; const exportName = exported.type === "Identifier" ? exported.name : exported.value; this.checkDuplicateExports(specifier, exportName); if (!isFrom && specifier.local) { const { local } = specifier; if (local.type !== "Identifier") { this.raise(Errors.ExportBindingIsString, specifier, { localName: local.value, exportName }); } else { this.checkReservedWord(local.name, local.loc.start, true, false); this.scope.checkLocalExport(local); } } } } else if (node.declaration) { const decl = node.declaration; if (decl.type === "FunctionDeclaration" || decl.type === "ClassDeclaration") { const { id } = decl; if (!id) throw new Error("Assertion failure"); this.checkDuplicateExports(node, id.name); } else if (decl.type === "VariableDeclaration") { for (const declaration of decl.declarations) { this.checkDeclaration(declaration.id); } } } } } checkDeclaration(node) { if (node.type === "Identifier") { this.checkDuplicateExports(node, node.name); } else if (node.type === "ObjectPattern") { for (const prop of node.properties) { this.checkDeclaration(prop); } } else if (node.type === "ArrayPattern") { for (const elem of node.elements) { if (elem) { this.checkDeclaration(elem); } } } else if (node.type === "ObjectProperty") { this.checkDeclaration(node.value); } else if (node.type === "RestElement") { this.checkDeclaration(node.argument); } else if (node.type === "AssignmentPattern") { this.checkDeclaration(node.left); } } checkDuplicateExports(node, exportName) { if (this.exportedIdentifiers.has(exportName)) { if (exportName === "default") { this.raise(Errors.DuplicateDefaultExport, node); } else { this.raise(Errors.DuplicateExport, node, { exportName }); } } this.exportedIdentifiers.add(exportName); } parseExportSpecifiers(isInTypeExport) { const nodes = []; let first = true; this.expect(5); while (!this.eat(8)) { if (first) { first = false; } else { this.expect(12); if (this.eat(8)) break; } const isMaybeTypeOnly = this.isContextual(130); const isString = this.match(134); const node = this.startNode(); node.local = this.parseModuleExportName(); nodes.push(this.parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly)); } return nodes; } parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly) { if (this.eatContextual(93)) { node.exported = this.parseModuleExportName(); } else if (isString) { node.exported = cloneStringLiteral(node.local); } else if (!node.exported) { node.exported = cloneIdentifier(node.local); } return this.finishNode(node, "ExportSpecifier"); } parseModuleExportName() { if (this.match(134)) { const result = this.parseStringLiteral(this.state.value); const surrogate = loneSurrogate.exec(result.value); if (surrogate) { this.raise(Errors.ModuleExportNameHasLoneSurrogate, result, { surrogateCharCode: surrogate[0].charCodeAt(0) }); } return result; } return this.parseIdentifier(true); } isJSONModuleImport(node) { if (node.assertions != null) { return node.assertions.some(({ key, value }) => { return value.value === "json" && (key.type === "Identifier" ? key.name === "type" : key.value === "type"); }); } return false; } checkImportReflection(node) { const { specifiers } = node; const singleBindingType = specifiers.length === 1 ? specifiers[0].type : null; if (node.phase === "source") { if (singleBindingType !== "ImportDefaultSpecifier") { this.raise(Errors.SourcePhaseImportRequiresDefault, specifiers[0].loc.start); } } else if (node.phase === "defer") { if (singleBindingType !== "ImportNamespaceSpecifier") { this.raise(Errors.DeferImportRequiresNamespace, specifiers[0].loc.start); } } else if (node.module) { var _node$assertions; if (singleBindingType !== "ImportDefaultSpecifier") { this.raise(Errors.ImportReflectionNotBinding, specifiers[0].loc.start); } if (((_node$assertions = node.assertions) == null ? void 0 : _node$assertions.length) > 0) { this.raise(Errors.ImportReflectionHasAssertion, specifiers[0].loc.start); } } } checkJSONModuleImport(node) { if (this.isJSONModuleImport(node) && node.type !== "ExportAllDeclaration") { const { specifiers } = node; if (specifiers != null) { const nonDefaultNamedSpecifier = specifiers.find(specifier => { let imported; if (specifier.type === "ExportSpecifier") { imported = specifier.local; } else if (specifier.type === "ImportSpecifier") { imported = specifier.imported; } if (imported !== undefined) { return imported.type === "Identifier" ? imported.name !== "default" : imported.value !== "default"; } }); if (nonDefaultNamedSpecifier !== undefined) { this.raise(Errors.ImportJSONBindingNotDefault, nonDefaultNamedSpecifier.loc.start); } } } } isPotentialImportPhase(isExport) { if (isExport) return false; return this.isContextual(105) || this.isContextual(97) || this.isContextual(127); } applyImportPhase(node, isExport, phase, loc) { if (isExport) { return; } if (phase === "module") { this.expectPlugin("importReflection", loc); node.module = true; } else if (this.hasPlugin("importReflection")) { node.module = false; } if (phase === "source") { this.expectPlugin("sourcePhaseImports", loc); node.phase = "source"; } else if (phase === "defer") { this.expectPlugin("deferredImportEvaluation", loc); node.phase = "defer"; } else if (this.hasPlugin("sourcePhaseImports")) { node.phase = null; } } parseMaybeImportPhase(node, isExport) { if (!this.isPotentialImportPhase(isExport)) { this.applyImportPhase(node, isExport, null); return null; } const phaseIdentifier = this.parseIdentifier(true); const { type } = this.state; const isImportPhase = tokenIsKeywordOrIdentifier(type) ? type !== 98 || this.lookaheadCharCode() === 102 : type !== 12; if (isImportPhase) { this.resetPreviousIdentifierLeadingComments(phaseIdentifier); this.applyImportPhase(node, isExport, phaseIdentifier.name, phaseIdentifier.loc.start); return null; } else { this.applyImportPhase(node, isExport, null); return phaseIdentifier; } } isPrecedingIdImportPhase(phase) { const { type } = this.state; return tokenIsIdentifier(type) ? type !== 98 || this.lookaheadCharCode() === 102 : type !== 12; } parseImport(node) { if (this.match(134)) { return this.parseImportSourceAndAttributes(node); } return this.parseImportSpecifiersAndAfter(node, this.parseMaybeImportPhase(node, false)); } parseImportSpecifiersAndAfter(node, maybeDefaultIdentifier) { node.specifiers = []; const hasDefault = this.maybeParseDefaultImportSpecifier(node, maybeDefaultIdentifier); const parseNext = !hasDefault || this.eat(12); const hasStar = parseNext && this.maybeParseStarImportSpecifier(node); if (parseNext && !hasStar) this.parseNamedImportSpecifiers(node); this.expectContextual(98); return this.parseImportSourceAndAttributes(node); } parseImportSourceAndAttributes(node) { var _node$specifiers2; (_node$specifiers2 = node.specifiers) != null ? _node$specifiers2 : node.specifiers = []; node.source = this.parseImportSource(); this.maybeParseImportAttributes(node); this.checkImportReflection(node); this.checkJSONModuleImport(node); this.semicolon(); return this.finishNode(node, "ImportDeclaration"); } parseImportSource() { if (!this.match(134)) this.unexpected(); return this.parseExprAtom(); } parseImportSpecifierLocal(node, specifier, type) { specifier.local = this.parseIdentifier(); node.specifiers.push(this.finishImportSpecifier(specifier, type)); } finishImportSpecifier(specifier, type, bindingType = 8201) { this.checkLVal(specifier.local, { type }, bindingType); return this.finishNode(specifier, type); } parseImportAttributes() { this.expect(5); const attrs = []; const attrNames = new Set(); do { if (this.match(8)) { break; } const node = this.startNode(); const keyName = this.state.value; if (attrNames.has(keyName)) { this.raise(Errors.ModuleAttributesWithDuplicateKeys, this.state.startLoc, { key: keyName }); } attrNames.add(keyName); if (this.match(134)) { node.key = this.parseStringLiteral(keyName); } else { node.key = this.parseIdentifier(true); } this.expect(14); if (!this.match(134)) { throw this.raise(Errors.ModuleAttributeInvalidValue, this.state.startLoc); } node.value = this.parseStringLiteral(this.state.value); attrs.push(this.finishNode(node, "ImportAttribute")); } while (this.eat(12)); this.expect(8); return attrs; } parseModuleAttributes() { const attrs = []; const attributes = new Set(); do { const node = this.startNode(); node.key = this.parseIdentifier(true); if (node.key.name !== "type") { this.raise(Errors.ModuleAttributeDifferentFromType, node.key); } if (attributes.has(node.key.name)) { this.raise(Errors.ModuleAttributesWithDuplicateKeys, node.key, { key: node.key.name }); } attributes.add(node.key.name); this.expect(14); if (!this.match(134)) { throw this.raise(Errors.ModuleAttributeInvalidValue, this.state.startLoc); } node.value = this.parseStringLiteral(this.state.value); attrs.push(this.finishNode(node, "ImportAttribute")); } while (this.eat(12)); return attrs; } maybeParseImportAttributes(node) { let attributes; { var useWith = false; } if (this.match(76)) { if (this.hasPrecedingLineBreak() && this.lookaheadCharCode() === 40) { return; } this.next(); if (this.hasPlugin("moduleAttributes")) { attributes = this.parseModuleAttributes(); } else { attributes = this.parseImportAttributes(); } { useWith = true; } } else if (this.isContextual(94) && !this.hasPrecedingLineBreak()) { if (!this.hasPlugin("deprecatedImportAssert") && !this.hasPlugin("importAssertions")) { this.raise(Errors.ImportAttributesUseAssert, this.state.startLoc); } if (!this.hasPlugin("importAssertions")) { this.addExtra(node, "deprecatedAssertSyntax", true); } this.next(); attributes = this.parseImportAttributes(); } else { attributes = []; } if (!useWith && this.hasPlugin("importAssertions")) { node.assertions = attributes; } else { node.attributes = attributes; } } maybeParseDefaultImportSpecifier(node, maybeDefaultIdentifier) { if (maybeDefaultIdentifier) { const specifier = this.startNodeAtNode(maybeDefaultIdentifier); specifier.local = maybeDefaultIdentifier; node.specifiers.push(this.finishImportSpecifier(specifier, "ImportDefaultSpecifier")); return true; } else if (tokenIsKeywordOrIdentifier(this.state.type)) { this.parseImportSpecifierLocal(node, this.startNode(), "ImportDefaultSpecifier"); return true; } return false; } maybeParseStarImportSpecifier(node) { if (this.match(55)) { const specifier = this.startNode(); this.next(); this.expectContextual(93); this.parseImportSpecifierLocal(node, specifier, "ImportNamespaceSpecifier"); return true; } return false; } parseNamedImportSpecifiers(node) { let first = true; this.expect(5); while (!this.eat(8)) { if (first) { first = false; } else { if (this.eat(14)) { throw this.raise(Errors.DestructureNamedImport, this.state.startLoc); } this.expect(12); if (this.eat(8)) break; } const specifier = this.startNode(); const importedIsString = this.match(134); const isMaybeTypeOnly = this.isContextual(130); specifier.imported = this.parseModuleExportName(); const importSpecifier = this.parseImportSpecifier(specifier, importedIsString, node.importKind === "type" || node.importKind === "typeof", isMaybeTypeOnly, undefined); node.specifiers.push(importSpecifier); } } parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, bindingType) { if (this.eatContextual(93)) { specifier.local = this.parseIdentifier(); } else { const { imported } = specifier; if (importedIsString) { throw this.raise(Errors.ImportBindingIsString, specifier, { importName: imported.value }); } this.checkReservedWord(imported.name, specifier.loc.start, true, true); if (!specifier.local) { specifier.local = cloneIdentifier(imported); } } return this.finishImportSpecifier(specifier, "ImportSpecifier", bindingType); } isThisParam(param) { return param.type === "Identifier" && param.name === "this"; } } class Parser extends StatementParser { constructor(options, input, pluginsMap) { options = getOptions(options); super(options, input); this.options = options; this.initializeScopes(); this.plugins = pluginsMap; this.filename = options.sourceFilename; this.startIndex = options.startIndex; } getScopeHandler() { return ScopeHandler; } parse() { this.enterInitialScopes(); const file = this.startNode(); const program = this.startNode(); this.nextToken(); file.errors = null; this.parseTopLevel(file, program); file.errors = this.state.errors; file.comments.length = this.state.commentsLen; return file; } } function parse(input, options) { var _options; if (((_options = options) == null ? void 0 : _options.sourceType) === "unambiguous") { options = Object.assign({}, options); try { options.sourceType = "module"; const parser = getParser(options, input); const ast = parser.parse(); if (parser.sawUnambiguousESM) { return ast; } if (parser.ambiguousScriptDifferentAst) { try { options.sourceType = "script"; return getParser(options, input).parse(); } catch (_unused) {} } else { ast.program.sourceType = "script"; } return ast; } catch (moduleError) { try { options.sourceType = "script"; return getParser(options, input).parse(); } catch (_unused2) {} throw moduleError; } } else { return getParser(options, input).parse(); } } function parseExpression(input, options) { const parser = getParser(options, input); if (parser.options.strictMode) { parser.state.strict = true; } return parser.getExpression(); } function generateExportedTokenTypes(internalTokenTypes) { const tokenTypes = {}; for (const typeName of Object.keys(internalTokenTypes)) { tokenTypes[typeName] = getExportedToken(internalTokenTypes[typeName]); } return tokenTypes; } const tokTypes = generateExportedTokenTypes(tt); function getParser(options, input) { let cls = Parser; const pluginsMap = new Map(); if (options != null && options.plugins) { for (const plugin of options.plugins) { let name, opts; if (typeof plugin === "string") { name = plugin; } else { [name, opts] = plugin; } if (!pluginsMap.has(name)) { pluginsMap.set(name, opts || {}); } } validatePlugins(pluginsMap); cls = getParserClass(pluginsMap); } return new cls(options, input, pluginsMap); } const parserClassCache = new Map(); function getParserClass(pluginsMap) { const pluginList = []; for (const name of mixinPluginNames) { if (pluginsMap.has(name)) { pluginList.push(name); } } const key = pluginList.join("|"); let cls = parserClassCache.get(key); if (!cls) { cls = Parser; for (const plugin of pluginList) { cls = mixinPlugins[plugin](cls); } parserClassCache.set(key, cls); } return cls; } exports.parse = parse; exports.parseExpression = parseExpression; exports.tokTypes = tokTypes; //# sourceMappingURL=index.js.map /***/ }), /***/ "./node_modules/csv-parse/dist/cjs/sync.cjs": /*!**************************************************!*\ !*** ./node_modules/csv-parse/dist/cjs/sync.cjs ***! \**************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; class CsvError extends Error { constructor(code, message, options, ...contexts) { if (Array.isArray(message)) message = message.join(" ").trim(); super(message); if (Error.captureStackTrace !== undefined) { Error.captureStackTrace(this, CsvError); } this.code = code; for (const context of contexts) { for (const key in context) { const value = context[key]; this[key] = Buffer.isBuffer(value) ? value.toString(options.encoding) : value == null ? value : JSON.parse(JSON.stringify(value)); } } } } const is_object = function (obj) { return typeof obj === "object" && obj !== null && !Array.isArray(obj); }; const normalize_columns_array = function (columns) { const normalizedColumns = []; for (let i = 0, l = columns.length; i < l; i++) { const column = columns[i]; if (column === undefined || column === null || column === false) { normalizedColumns[i] = { disabled: true }; } else if (typeof column === "string") { normalizedColumns[i] = { name: column }; } else if (is_object(column)) { if (typeof column.name !== "string") { throw new CsvError("CSV_OPTION_COLUMNS_MISSING_NAME", [ "Option columns missing name:", `property "name" is required at position ${i}`, "when column is an object literal", ]); } normalizedColumns[i] = column; } else { throw new CsvError("CSV_INVALID_COLUMN_DEFINITION", [ "Invalid column definition:", "expect a string or a literal object,", `got ${JSON.stringify(column)} at position ${i}`, ]); } } return normalizedColumns; }; class ResizeableBuffer { constructor(size = 100) { this.size = size; this.length = 0; this.buf = Buffer.allocUnsafe(size); } prepend(val) { if (Buffer.isBuffer(val)) { const length = this.length + val.length; if (length >= this.size) { this.resize(); if (length >= this.size) { throw Error("INVALID_BUFFER_STATE"); } } const buf = this.buf; this.buf = Buffer.allocUnsafe(this.size); val.copy(this.buf, 0); buf.copy(this.buf, val.length); this.length += val.length; } else { const length = this.length++; if (length === this.size) { this.resize(); } const buf = this.clone(); this.buf[0] = val; buf.copy(this.buf, 1, 0, length); } } append(val) { const length = this.length++; if (length === this.size) { this.resize(); } this.buf[length] = val; } clone() { return Buffer.from(this.buf.slice(0, this.length)); } resize() { const length = this.length; this.size = this.size * 2; const buf = Buffer.allocUnsafe(this.size); this.buf.copy(buf, 0, 0, length); this.buf = buf; } toString(encoding) { if (encoding) { return this.buf.slice(0, this.length).toString(encoding); } else { return Uint8Array.prototype.slice.call(this.buf.slice(0, this.length)); } } toJSON() { return this.toString("utf8"); } reset() { this.length = 0; } } // white space characters // https://en.wikipedia.org/wiki/Whitespace_character // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions/Character_Classes#Types // \f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff const np = 12; const cr$1 = 13; // `\r`, carriage return, 0x0D in hexadécimal, 13 in decimal const nl$1 = 10; // `\n`, newline, 0x0A in hexadecimal, 10 in decimal const space = 32; const tab = 9; const init_state = function (options) { return { bomSkipped: false, bufBytesStart: 0, castField: options.cast_function, commenting: false, // Current error encountered by a record error: undefined, enabled: options.from_line === 1, escaping: false, escapeIsQuote: Buffer.isBuffer(options.escape) && Buffer.isBuffer(options.quote) && Buffer.compare(options.escape, options.quote) === 0, // columns can be `false`, `true`, `Array` expectedRecordLength: Array.isArray(options.columns) ? options.columns.length : undefined, field: new ResizeableBuffer(20), firstLineToHeaders: options.cast_first_line_to_header, needMoreDataSize: Math.max( // Skip if the remaining buffer smaller than comment options.comment !== null ? options.comment.length : 0, // Skip if the remaining buffer can be delimiter ...options.delimiter.map((delimiter) => delimiter.length), // Skip if the remaining buffer can be escape sequence options.quote !== null ? options.quote.length : 0, ), previousBuf: undefined, quoting: false, stop: false, rawBuffer: new ResizeableBuffer(100), record: [], recordHasError: false, record_length: 0, recordDelimiterMaxLength: options.record_delimiter.length === 0 ? 0 : Math.max(...options.record_delimiter.map((v) => v.length)), trimChars: [ Buffer.from(" ", options.encoding)[0], Buffer.from("\t", options.encoding)[0], ], wasQuoting: false, wasRowDelimiter: false, timchars: [ Buffer.from(Buffer.from([cr$1], "utf8").toString(), options.encoding), Buffer.from(Buffer.from([nl$1], "utf8").toString(), options.encoding), Buffer.from(Buffer.from([np], "utf8").toString(), options.encoding), Buffer.from(Buffer.from([space], "utf8").toString(), options.encoding), Buffer.from(Buffer.from([tab], "utf8").toString(), options.encoding), ], }; }; const underscore = function (str) { return str.replace(/([A-Z])/g, function (_, match) { return "_" + match.toLowerCase(); }); }; const normalize_options = function (opts) { const options = {}; // Merge with user options for (const opt in opts) { options[underscore(opt)] = opts[opt]; } // Normalize option `encoding` // Note: defined first because other options depends on it // to convert chars/strings into buffers. if (options.encoding === undefined || options.encoding === true) { options.encoding = "utf8"; } else if (options.encoding === null || options.encoding === false) { options.encoding = null; } else if ( typeof options.encoding !== "string" && options.encoding !== null ) { throw new CsvError( "CSV_INVALID_OPTION_ENCODING", [ "Invalid option encoding:", "encoding must be a string or null to return a buffer,", `got ${JSON.stringify(options.encoding)}`, ], options, ); } // Normalize option `bom` if ( options.bom === undefined || options.bom === null || options.bom === false ) { options.bom = false; } else if (options.bom !== true) { throw new CsvError( "CSV_INVALID_OPTION_BOM", [ "Invalid option bom:", "bom must be true,", `got ${JSON.stringify(options.bom)}`, ], options, ); } // Normalize option `cast` options.cast_function = null; if ( options.cast === undefined || options.cast === null || options.cast === false || options.cast === "" ) { options.cast = undefined; } else if (typeof options.cast === "function") { options.cast_function = options.cast; options.cast = true; } else if (options.cast !== true) { throw new CsvError( "CSV_INVALID_OPTION_CAST", [ "Invalid option cast:", "cast must be true or a function,", `got ${JSON.stringify(options.cast)}`, ], options, ); } // Normalize option `cast_date` if ( options.cast_date === undefined || options.cast_date === null || options.cast_date === false || options.cast_date === "" ) { options.cast_date = false; } else if (options.cast_date === true) { options.cast_date = function (value) { const date = Date.parse(value); return !isNaN(date) ? new Date(date) : value; }; } else if (typeof options.cast_date !== "function") { throw new CsvError( "CSV_INVALID_OPTION_CAST_DATE", [ "Invalid option cast_date:", "cast_date must be true or a function,", `got ${JSON.stringify(options.cast_date)}`, ], options, ); } // Normalize option `columns` options.cast_first_line_to_header = null; if (options.columns === true) { // Fields in the first line are converted as-is to columns options.cast_first_line_to_header = undefined; } else if (typeof options.columns === "function") { options.cast_first_line_to_header = options.columns; options.columns = true; } else if (Array.isArray(options.columns)) { options.columns = normalize_columns_array(options.columns); } else if ( options.columns === undefined || options.columns === null || options.columns === false ) { options.columns = false; } else { throw new CsvError( "CSV_INVALID_OPTION_COLUMNS", [ "Invalid option columns:", "expect an array, a function or true,", `got ${JSON.stringify(options.columns)}`, ], options, ); } // Normalize option `group_columns_by_name` if ( options.group_columns_by_name === undefined || options.group_columns_by_name === null || options.group_columns_by_name === false ) { options.group_columns_by_name = false; } else if (options.group_columns_by_name !== true) { throw new CsvError( "CSV_INVALID_OPTION_GROUP_COLUMNS_BY_NAME", [ "Invalid option group_columns_by_name:", "expect an boolean,", `got ${JSON.stringify(options.group_columns_by_name)}`, ], options, ); } else if (options.columns === false) { throw new CsvError( "CSV_INVALID_OPTION_GROUP_COLUMNS_BY_NAME", [ "Invalid option group_columns_by_name:", "the `columns` mode must be activated.", ], options, ); } // Normalize option `comment` if ( options.comment === undefined || options.comment === null || options.comment === false || options.comment === "" ) { options.comment = null; } else { if (typeof options.comment === "string") { options.comment = Buffer.from(options.comment, options.encoding); } if (!Buffer.isBuffer(options.comment)) { throw new CsvError( "CSV_INVALID_OPTION_COMMENT", [ "Invalid option comment:", "comment must be a buffer or a string,", `got ${JSON.stringify(options.comment)}`, ], options, ); } } // Normalize option `comment_no_infix` if ( options.comment_no_infix === undefined || options.comment_no_infix === null || options.comment_no_infix === false ) { options.comment_no_infix = false; } else if (options.comment_no_infix !== true) { throw new CsvError( "CSV_INVALID_OPTION_COMMENT", [ "Invalid option comment_no_infix:", "value must be a boolean,", `got ${JSON.stringify(options.comment_no_infix)}`, ], options, ); } // Normalize option `delimiter` const delimiter_json = JSON.stringify(options.delimiter); if (!Array.isArray(options.delimiter)) options.delimiter = [options.delimiter]; if (options.delimiter.length === 0) { throw new CsvError( "CSV_INVALID_OPTION_DELIMITER", [ "Invalid option delimiter:", "delimiter must be a non empty string or buffer or array of string|buffer,", `got ${delimiter_json}`, ], options, ); } options.delimiter = options.delimiter.map(function (delimiter) { if (delimiter === undefined || delimiter === null || delimiter === false) { return Buffer.from(",", options.encoding); } if (typeof delimiter === "string") { delimiter = Buffer.from(delimiter, options.encoding); } if (!Buffer.isBuffer(delimiter) || delimiter.length === 0) { throw new CsvError( "CSV_INVALID_OPTION_DELIMITER", [ "Invalid option delimiter:", "delimiter must be a non empty string or buffer or array of string|buffer,", `got ${delimiter_json}`, ], options, ); } return delimiter; }); // Normalize option `escape` if (options.escape === undefined || options.escape === true) { options.escape = Buffer.from('"', options.encoding); } else if (typeof options.escape === "string") { options.escape = Buffer.from(options.escape, options.encoding); } else if (options.escape === null || options.escape === false) { options.escape = null; } if (options.escape !== null) { if (!Buffer.isBuffer(options.escape)) { throw new Error( `Invalid Option: escape must be a buffer, a string or a boolean, got ${JSON.stringify(options.escape)}`, ); } } // Normalize option `from` if (options.from === undefined || options.from === null) { options.from = 1; } else { if (typeof options.from === "string" && /\d+/.test(options.from)) { options.from = parseInt(options.from); } if (Number.isInteger(options.from)) { if (options.from < 0) { throw new Error( `Invalid Option: from must be a positive integer, got ${JSON.stringify(opts.from)}`, ); } } else { throw new Error( `Invalid Option: from must be an integer, got ${JSON.stringify(options.from)}`, ); } } // Normalize option `from_line` if (options.from_line === undefined || options.from_line === null) { options.from_line = 1; } else { if ( typeof options.from_line === "string" && /\d+/.test(options.from_line) ) { options.from_line = parseInt(options.from_line); } if (Number.isInteger(options.from_line)) { if (options.from_line <= 0) { throw new Error( `Invalid Option: from_line must be a positive integer greater than 0, got ${JSON.stringify(opts.from_line)}`, ); } } else { throw new Error( `Invalid Option: from_line must be an integer, got ${JSON.stringify(opts.from_line)}`, ); } } // Normalize options `ignore_last_delimiters` if ( options.ignore_last_delimiters === undefined || options.ignore_last_delimiters === null ) { options.ignore_last_delimiters = false; } else if (typeof options.ignore_last_delimiters === "number") { options.ignore_last_delimiters = Math.floor(options.ignore_last_delimiters); if (options.ignore_last_delimiters === 0) { options.ignore_last_delimiters = false; } } else if (typeof options.ignore_last_delimiters !== "boolean") { throw new CsvError( "CSV_INVALID_OPTION_IGNORE_LAST_DELIMITERS", [ "Invalid option `ignore_last_delimiters`:", "the value must be a boolean value or an integer,", `got ${JSON.stringify(options.ignore_last_delimiters)}`, ], options, ); } if (options.ignore_last_delimiters === true && options.columns === false) { throw new CsvError( "CSV_IGNORE_LAST_DELIMITERS_REQUIRES_COLUMNS", [ "The option `ignore_last_delimiters`", "requires the activation of the `columns` option", ], options, ); } // Normalize option `info` if ( options.info === undefined || options.info === null || options.info === false ) { options.info = false; } else if (options.info !== true) { throw new Error( `Invalid Option: info must be true, got ${JSON.stringify(options.info)}`, ); } // Normalize option `max_record_size` if ( options.max_record_size === undefined || options.max_record_size === null || options.max_record_size === false ) { options.max_record_size = 0; } else if ( Number.isInteger(options.max_record_size) && options.max_record_size >= 0 ) ; else if ( typeof options.max_record_size === "string" && /\d+/.test(options.max_record_size) ) { options.max_record_size = parseInt(options.max_record_size); } else { throw new Error( `Invalid Option: max_record_size must be a positive integer, got ${JSON.stringify(options.max_record_size)}`, ); } // Normalize option `objname` if ( options.objname === undefined || options.objname === null || options.objname === false ) { options.objname = undefined; } else if (Buffer.isBuffer(options.objname)) { if (options.objname.length === 0) { throw new Error(`Invalid Option: objname must be a non empty buffer`); } if (options.encoding === null) ; else { options.objname = options.objname.toString(options.encoding); } } else if (typeof options.objname === "string") { if (options.objname.length === 0) { throw new Error(`Invalid Option: objname must be a non empty string`); } // Great, nothing to do } else if (typeof options.objname === "number") ; else { throw new Error( `Invalid Option: objname must be a string or a buffer, got ${options.objname}`, ); } if (options.objname !== undefined) { if (typeof options.objname === "number") { if (options.columns !== false) { throw Error( "Invalid Option: objname index cannot be combined with columns or be defined as a field", ); } } else { // A string or a buffer if (options.columns === false) { throw Error( "Invalid Option: objname field must be combined with columns or be defined as an index", ); } } } // Normalize option `on_record` if (options.on_record === undefined || options.on_record === null) { options.on_record = undefined; } else if (typeof options.on_record !== "function") { throw new CsvError( "CSV_INVALID_OPTION_ON_RECORD", [ "Invalid option `on_record`:", "expect a function,", `got ${JSON.stringify(options.on_record)}`, ], options, ); } // Normalize option `on_skip` // options.on_skip ??= (err, chunk) => { // this.emit('skip', err, chunk); // }; if ( options.on_skip !== undefined && options.on_skip !== null && typeof options.on_skip !== "function" ) { throw new Error( `Invalid Option: on_skip must be a function, got ${JSON.stringify(options.on_skip)}`, ); } // Normalize option `quote` if ( options.quote === null || options.quote === false || options.quote === "" ) { options.quote = null; } else { if (options.quote === undefined || options.quote === true) { options.quote = Buffer.from('"', options.encoding); } else if (typeof options.quote === "string") { options.quote = Buffer.from(options.quote, options.encoding); } if (!Buffer.isBuffer(options.quote)) { throw new Error( `Invalid Option: quote must be a buffer or a string, got ${JSON.stringify(options.quote)}`, ); } } // Normalize option `raw` if ( options.raw === undefined || options.raw === null || options.raw === false ) { options.raw = false; } else if (options.raw !== true) { throw new Error( `Invalid Option: raw must be true, got ${JSON.stringify(options.raw)}`, ); } // Normalize option `record_delimiter` if (options.record_delimiter === undefined) { options.record_delimiter = []; } else if ( typeof options.record_delimiter === "string" || Buffer.isBuffer(options.record_delimiter) ) { if (options.record_delimiter.length === 0) { throw new CsvError( "CSV_INVALID_OPTION_RECORD_DELIMITER", [ "Invalid option `record_delimiter`:", "value must be a non empty string or buffer,", `got ${JSON.stringify(options.record_delimiter)}`, ], options, ); } options.record_delimiter = [options.record_delimiter]; } else if (!Array.isArray(options.record_delimiter)) { throw new CsvError( "CSV_INVALID_OPTION_RECORD_DELIMITER", [ "Invalid option `record_delimiter`:", "value must be a string, a buffer or array of string|buffer,", `got ${JSON.stringify(options.record_delimiter)}`, ], options, ); } options.record_delimiter = options.record_delimiter.map(function (rd, i) { if (typeof rd !== "string" && !Buffer.isBuffer(rd)) { throw new CsvError( "CSV_INVALID_OPTION_RECORD_DELIMITER", [ "Invalid option `record_delimiter`:", "value must be a string, a buffer or array of string|buffer", `at index ${i},`, `got ${JSON.stringify(rd)}`, ], options, ); } else if (rd.length === 0) { throw new CsvError( "CSV_INVALID_OPTION_RECORD_DELIMITER", [ "Invalid option `record_delimiter`:", "value must be a non empty string or buffer", `at index ${i},`, `got ${JSON.stringify(rd)}`, ], options, ); } if (typeof rd === "string") { rd = Buffer.from(rd, options.encoding); } return rd; }); // Normalize option `relax_column_count` if (typeof options.relax_column_count === "boolean") ; else if ( options.relax_column_count === undefined || options.relax_column_count === null ) { options.relax_column_count = false; } else { throw new Error( `Invalid Option: relax_column_count must be a boolean, got ${JSON.stringify(options.relax_column_count)}`, ); } if (typeof options.relax_column_count_less === "boolean") ; else if ( options.relax_column_count_less === undefined || options.relax_column_count_less === null ) { options.relax_column_count_less = false; } else { throw new Error( `Invalid Option: relax_column_count_less must be a boolean, got ${JSON.stringify(options.relax_column_count_less)}`, ); } if (typeof options.relax_column_count_more === "boolean") ; else if ( options.relax_column_count_more === undefined || options.relax_column_count_more === null ) { options.relax_column_count_more = false; } else { throw new Error( `Invalid Option: relax_column_count_more must be a boolean, got ${JSON.stringify(options.relax_column_count_more)}`, ); } // Normalize option `relax_quotes` if (typeof options.relax_quotes === "boolean") ; else if ( options.relax_quotes === undefined || options.relax_quotes === null ) { options.relax_quotes = false; } else { throw new Error( `Invalid Option: relax_quotes must be a boolean, got ${JSON.stringify(options.relax_quotes)}`, ); } // Normalize option `skip_empty_lines` if (typeof options.skip_empty_lines === "boolean") ; else if ( options.skip_empty_lines === undefined || options.skip_empty_lines === null ) { options.skip_empty_lines = false; } else { throw new Error( `Invalid Option: skip_empty_lines must be a boolean, got ${JSON.stringify(options.skip_empty_lines)}`, ); } // Normalize option `skip_records_with_empty_values` if (typeof options.skip_records_with_empty_values === "boolean") ; else if ( options.skip_records_with_empty_values === undefined || options.skip_records_with_empty_values === null ) { options.skip_records_with_empty_values = false; } else { throw new Error( `Invalid Option: skip_records_with_empty_values must be a boolean, got ${JSON.stringify(options.skip_records_with_empty_values)}`, ); } // Normalize option `skip_records_with_error` if (typeof options.skip_records_with_error === "boolean") ; else if ( options.skip_records_with_error === undefined || options.skip_records_with_error === null ) { options.skip_records_with_error = false; } else { throw new Error( `Invalid Option: skip_records_with_error must be a boolean, got ${JSON.stringify(options.skip_records_with_error)}`, ); } // Normalize option `rtrim` if ( options.rtrim === undefined || options.rtrim === null || options.rtrim === false ) { options.rtrim = false; } else if (options.rtrim !== true) { throw new Error( `Invalid Option: rtrim must be a boolean, got ${JSON.stringify(options.rtrim)}`, ); } // Normalize option `ltrim` if ( options.ltrim === undefined || options.ltrim === null || options.ltrim === false ) { options.ltrim = false; } else if (options.ltrim !== true) { throw new Error( `Invalid Option: ltrim must be a boolean, got ${JSON.stringify(options.ltrim)}`, ); } // Normalize option `trim` if ( options.trim === undefined || options.trim === null || options.trim === false ) { options.trim = false; } else if (options.trim !== true) { throw new Error( `Invalid Option: trim must be a boolean, got ${JSON.stringify(options.trim)}`, ); } // Normalize options `trim`, `ltrim` and `rtrim` if (options.trim === true && opts.ltrim !== false) { options.ltrim = true; } else if (options.ltrim !== true) { options.ltrim = false; } if (options.trim === true && opts.rtrim !== false) { options.rtrim = true; } else if (options.rtrim !== true) { options.rtrim = false; } // Normalize option `to` if (options.to === undefined || options.to === null) { options.to = -1; } else { if (typeof options.to === "string" && /\d+/.test(options.to)) { options.to = parseInt(options.to); } if (Number.isInteger(options.to)) { if (options.to <= 0) { throw new Error( `Invalid Option: to must be a positive integer greater than 0, got ${JSON.stringify(opts.to)}`, ); } } else { throw new Error( `Invalid Option: to must be an integer, got ${JSON.stringify(opts.to)}`, ); } } // Normalize option `to_line` if (options.to_line === undefined || options.to_line === null) { options.to_line = -1; } else { if (typeof options.to_line === "string" && /\d+/.test(options.to_line)) { options.to_line = parseInt(options.to_line); } if (Number.isInteger(options.to_line)) { if (options.to_line <= 0) { throw new Error( `Invalid Option: to_line must be a positive integer greater than 0, got ${JSON.stringify(opts.to_line)}`, ); } } else { throw new Error( `Invalid Option: to_line must be an integer, got ${JSON.stringify(opts.to_line)}`, ); } } return options; }; const isRecordEmpty = function (record) { return record.every( (field) => field == null || (field.toString && field.toString().trim() === ""), ); }; const cr = 13; // `\r`, carriage return, 0x0D in hexadécimal, 13 in decimal const nl = 10; // `\n`, newline, 0x0A in hexadecimal, 10 in decimal const boms = { // Note, the following are equals: // Buffer.from("\ufeff") // Buffer.from([239, 187, 191]) // Buffer.from('EFBBBF', 'hex') utf8: Buffer.from([239, 187, 191]), // Note, the following are equals: // Buffer.from "\ufeff", 'utf16le // Buffer.from([255, 254]) utf16le: Buffer.from([255, 254]), }; const transform = function (original_options = {}) { const info = { bytes: 0, comment_lines: 0, empty_lines: 0, invalid_field_length: 0, lines: 1, records: 0, }; const options = normalize_options(original_options); return { info: info, original_options: original_options, options: options, state: init_state(options), __needMoreData: function (i, bufLen, end) { if (end) return false; const { encoding, escape, quote } = this.options; const { quoting, needMoreDataSize, recordDelimiterMaxLength } = this.state; const numOfCharLeft = bufLen - i - 1; const requiredLength = Math.max( needMoreDataSize, // Skip if the remaining buffer smaller than record delimiter // If "record_delimiter" is yet to be discovered: // 1. It is equals to `[]` and "recordDelimiterMaxLength" equals `0` // 2. We set the length to windows line ending in the current encoding // Note, that encoding is known from user or bom discovery at that point // recordDelimiterMaxLength, recordDelimiterMaxLength === 0 ? Buffer.from("\r\n", encoding).length : recordDelimiterMaxLength, // Skip if remaining buffer can be an escaped quote quoting ? (escape === null ? 0 : escape.length) + quote.length : 0, // Skip if remaining buffer can be record delimiter following the closing quote quoting ? quote.length + recordDelimiterMaxLength : 0, ); return numOfCharLeft < requiredLength; }, // Central parser implementation parse: function (nextBuf, end, push, close) { const { bom, comment_no_infix, encoding, from_line, ltrim, max_record_size, raw, relax_quotes, rtrim, skip_empty_lines, to, to_line, } = this.options; let { comment, escape, quote, record_delimiter } = this.options; const { bomSkipped, previousBuf, rawBuffer, escapeIsQuote } = this.state; let buf; if (previousBuf === undefined) { if (nextBuf === undefined) { // Handle empty string close(); return; } else { buf = nextBuf; } } else if (previousBuf !== undefined && nextBuf === undefined) { buf = previousBuf; } else { buf = Buffer.concat([previousBuf, nextBuf]); } // Handle UTF BOM if (bomSkipped === false) { if (bom === false) { this.state.bomSkipped = true; } else if (buf.length < 3) { // No enough data if (end === false) { // Wait for more data this.state.previousBuf = buf; return; } } else { for (const encoding in boms) { if (boms[encoding].compare(buf, 0, boms[encoding].length) === 0) { // Skip BOM const bomLength = boms[encoding].length; this.state.bufBytesStart += bomLength; buf = buf.slice(bomLength); // Renormalize original options with the new encoding this.options = normalize_options({ ...this.original_options, encoding: encoding, }); // Options will re-evaluate the Buffer with the new encoding ({ comment, escape, quote } = this.options); break; } } this.state.bomSkipped = true; } } const bufLen = buf.length; let pos; for (pos = 0; pos < bufLen; pos++) { // Ensure we get enough space to look ahead // There should be a way to move this out of the loop if (this.__needMoreData(pos, bufLen, end)) { break; } if (this.state.wasRowDelimiter === true) { this.info.lines++; this.state.wasRowDelimiter = false; } if (to_line !== -1 && this.info.lines > to_line) { this.state.stop = true; close(); return; } // Auto discovery of record_delimiter, unix, mac and windows supported if (this.state.quoting === false && record_delimiter.length === 0) { const record_delimiterCount = this.__autoDiscoverRecordDelimiter( buf, pos, ); if (record_delimiterCount) { record_delimiter = this.options.record_delimiter; } } const chr = buf[pos]; if (raw === true) { rawBuffer.append(chr); } if ( (chr === cr || chr === nl) && this.state.wasRowDelimiter === false ) { this.state.wasRowDelimiter = true; } // Previous char was a valid escape char // treat the current char as a regular char if (this.state.escaping === true) { this.state.escaping = false; } else { // Escape is only active inside quoted fields // We are quoting, the char is an escape chr and there is a chr to escape // if(escape !== null && this.state.quoting === true && chr === escape && pos + 1 < bufLen){ if ( escape !== null && this.state.quoting === true && this.__isEscape(buf, pos, chr) && pos + escape.length < bufLen ) { if (escapeIsQuote) { if (this.__isQuote(buf, pos + escape.length)) { this.state.escaping = true; pos += escape.length - 1; continue; } } else { this.state.escaping = true; pos += escape.length - 1; continue; } } // Not currently escaping and chr is a quote // TODO: need to compare bytes instead of single char if (this.state.commenting === false && this.__isQuote(buf, pos)) { if (this.state.quoting === true) { const nextChr = buf[pos + quote.length]; const isNextChrTrimable = rtrim && this.__isCharTrimable(buf, pos + quote.length); const isNextChrComment = comment !== null && this.__compareBytes(comment, buf, pos + quote.length, nextChr); const isNextChrDelimiter = this.__isDelimiter( buf, pos + quote.length, nextChr, ); const isNextChrRecordDelimiter = record_delimiter.length === 0 ? this.__autoDiscoverRecordDelimiter(buf, pos + quote.length) : this.__isRecordDelimiter(nextChr, buf, pos + quote.length); // Escape a quote // Treat next char as a regular character if ( escape !== null && this.__isEscape(buf, pos, chr) && this.__isQuote(buf, pos + escape.length) ) { pos += escape.length - 1; } else if ( !nextChr || isNextChrDelimiter || isNextChrRecordDelimiter || isNextChrComment || isNextChrTrimable ) { this.state.quoting = false; this.state.wasQuoting = true; pos += quote.length - 1; continue; } else if (relax_quotes === false) { const err = this.__error( new CsvError( "CSV_INVALID_CLOSING_QUOTE", [ "Invalid Closing Quote:", `got "${String.fromCharCode(nextChr)}"`, `at line ${this.info.lines}`, "instead of delimiter, record delimiter, trimable character", "(if activated) or comment", ], this.options, this.__infoField(), ), ); if (err !== undefined) return err; } else { this.state.quoting = false; this.state.wasQuoting = true; this.state.field.prepend(quote); pos += quote.length - 1; } } else { if (this.state.field.length !== 0) { // In relax_quotes mode, treat opening quote preceded by chrs as regular if (relax_quotes === false) { const info = this.__infoField(); const bom = Object.keys(boms) .map((b) => boms[b].equals(this.state.field.toString()) ? b : false, ) .filter(Boolean)[0]; const err = this.__error( new CsvError( "INVALID_OPENING_QUOTE", [ "Invalid Opening Quote:", `a quote is found on field ${JSON.stringify(info.column)} at line ${info.lines}, value is ${JSON.stringify(this.state.field.toString(encoding))}`, bom ? `(${bom} bom)` : undefined, ], this.options, info, { field: this.state.field, }, ), ); if (err !== undefined) return err; } } else { this.state.quoting = true; pos += quote.length - 1; continue; } } } if (this.state.quoting === false) { const recordDelimiterLength = this.__isRecordDelimiter( chr, buf, pos, ); if (recordDelimiterLength !== 0) { // Do not emit comments which take a full line const skipCommentLine = this.state.commenting && this.state.wasQuoting === false && this.state.record.length === 0 && this.state.field.length === 0; if (skipCommentLine) { this.info.comment_lines++; // Skip full comment line } else { // Activate records emition if above from_line if ( this.state.enabled === false && this.info.lines + (this.state.wasRowDelimiter === true ? 1 : 0) >= from_line ) { this.state.enabled = true; this.__resetField(); this.__resetRecord(); pos += recordDelimiterLength - 1; continue; } // Skip if line is empty and skip_empty_lines activated if ( skip_empty_lines === true && this.state.wasQuoting === false && this.state.record.length === 0 && this.state.field.length === 0 ) { this.info.empty_lines++; pos += recordDelimiterLength - 1; continue; } this.info.bytes = this.state.bufBytesStart + pos; const errField = this.__onField(); if (errField !== undefined) return errField; this.info.bytes = this.state.bufBytesStart + pos + recordDelimiterLength; const errRecord = this.__onRecord(push); if (errRecord !== undefined) return errRecord; if (to !== -1 && this.info.records >= to) { this.state.stop = true; close(); return; } } this.state.commenting = false; pos += recordDelimiterLength - 1; continue; } if (this.state.commenting) { continue; } if ( comment !== null && (comment_no_infix === false || (this.state.record.length === 0 && this.state.field.length === 0)) ) { const commentCount = this.__compareBytes(comment, buf, pos, chr); if (commentCount !== 0) { this.state.commenting = true; continue; } } const delimiterLength = this.__isDelimiter(buf, pos, chr); if (delimiterLength !== 0) { this.info.bytes = this.state.bufBytesStart + pos; const errField = this.__onField(); if (errField !== undefined) return errField; pos += delimiterLength - 1; continue; } } } if (this.state.commenting === false) { if ( max_record_size !== 0 && this.state.record_length + this.state.field.length > max_record_size ) { return this.__error( new CsvError( "CSV_MAX_RECORD_SIZE", [ "Max Record Size:", "record exceed the maximum number of tolerated bytes", `of ${max_record_size}`, `at line ${this.info.lines}`, ], this.options, this.__infoField(), ), ); } } const lappend = ltrim === false || this.state.quoting === true || this.state.field.length !== 0 || !this.__isCharTrimable(buf, pos); // rtrim in non quoting is handle in __onField const rappend = rtrim === false || this.state.wasQuoting === false; if (lappend === true && rappend === true) { this.state.field.append(chr); } else if (rtrim === true && !this.__isCharTrimable(buf, pos)) { return this.__error( new CsvError( "CSV_NON_TRIMABLE_CHAR_AFTER_CLOSING_QUOTE", [ "Invalid Closing Quote:", "found non trimable byte after quote", `at line ${this.info.lines}`, ], this.options, this.__infoField(), ), ); } else { if (lappend === false) { pos += this.__isCharTrimable(buf, pos) - 1; } continue; } } if (end === true) { // Ensure we are not ending in a quoting state if (this.state.quoting === true) { const err = this.__error( new CsvError( "CSV_QUOTE_NOT_CLOSED", [ "Quote Not Closed:", `the parsing is finished with an opening quote at line ${this.info.lines}`, ], this.options, this.__infoField(), ), ); if (err !== undefined) return err; } else { // Skip last line if it has no characters if ( this.state.wasQuoting === true || this.state.record.length !== 0 || this.state.field.length !== 0 ) { this.info.bytes = this.state.bufBytesStart + pos; const errField = this.__onField(); if (errField !== undefined) return errField; const errRecord = this.__onRecord(push); if (errRecord !== undefined) return errRecord; } else if (this.state.wasRowDelimiter === true) { this.info.empty_lines++; } else if (this.state.commenting === true) { this.info.comment_lines++; } } } else { this.state.bufBytesStart += pos; this.state.previousBuf = buf.slice(pos); } if (this.state.wasRowDelimiter === true) { this.info.lines++; this.state.wasRowDelimiter = false; } }, __onRecord: function (push) { const { columns, group_columns_by_name, encoding, info, from, relax_column_count, relax_column_count_less, relax_column_count_more, raw, skip_records_with_empty_values, } = this.options; const { enabled, record } = this.state; if (enabled === false) { return this.__resetRecord(); } // Convert the first line into column names const recordLength = record.length; if (columns === true) { if (skip_records_with_empty_values === true && isRecordEmpty(record)) { this.__resetRecord(); return; } return this.__firstLineToColumns(record); } if (columns === false && this.info.records === 0) { this.state.expectedRecordLength = recordLength; } if (recordLength !== this.state.expectedRecordLength) { const err = columns === false ? new CsvError( "CSV_RECORD_INCONSISTENT_FIELDS_LENGTH", [ "Invalid Record Length:", `expect ${this.state.expectedRecordLength},`, `got ${recordLength} on line ${this.info.lines}`, ], this.options, this.__infoField(), { record: record, }, ) : new CsvError( "CSV_RECORD_INCONSISTENT_COLUMNS", [ "Invalid Record Length:", `columns length is ${columns.length},`, // rename columns `got ${recordLength} on line ${this.info.lines}`, ], this.options, this.__infoField(), { record: record, }, ); if ( relax_column_count === true || (relax_column_count_less === true && recordLength < this.state.expectedRecordLength) || (relax_column_count_more === true && recordLength > this.state.expectedRecordLength) ) { this.info.invalid_field_length++; this.state.error = err; // Error is undefined with skip_records_with_error } else { const finalErr = this.__error(err); if (finalErr) return finalErr; } } if (skip_records_with_empty_values === true && isRecordEmpty(record)) { this.__resetRecord(); return; } if (this.state.recordHasError === true) { this.__resetRecord(); this.state.recordHasError = false; return; } this.info.records++; if (from === 1 || this.info.records >= from) { const { objname } = this.options; // With columns, records are object if (columns !== false) { const obj = {}; // Transform record array to an object for (let i = 0, l = record.length; i < l; i++) { if (columns[i] === undefined || columns[i].disabled) continue; // Turn duplicate columns into an array if ( group_columns_by_name === true && obj[columns[i].name] !== undefined ) { if (Array.isArray(obj[columns[i].name])) { obj[columns[i].name] = obj[columns[i].name].concat(record[i]); } else { obj[columns[i].name] = [obj[columns[i].name], record[i]]; } } else { obj[columns[i].name] = record[i]; } } // Without objname (default) if (raw === true || info === true) { const extRecord = Object.assign( { record: obj }, raw === true ? { raw: this.state.rawBuffer.toString(encoding) } : {}, info === true ? { info: this.__infoRecord() } : {}, ); const err = this.__push( objname === undefined ? extRecord : [obj[objname], extRecord], push, ); if (err) { return err; } } else { const err = this.__push( objname === undefined ? obj : [obj[objname], obj], push, ); if (err) { return err; } } // Without columns, records are array } else { if (raw === true || info === true) { const extRecord = Object.assign( { record: record }, raw === true ? { raw: this.state.rawBuffer.toString(encoding) } : {}, info === true ? { info: this.__infoRecord() } : {}, ); const err = this.__push( objname === undefined ? extRecord : [record[objname], extRecord], push, ); if (err) { return err; } } else { const err = this.__push( objname === undefined ? record : [record[objname], record], push, ); if (err) { return err; } } } } this.__resetRecord(); }, __firstLineToColumns: function (record) { const { firstLineToHeaders } = this.state; try { const headers = firstLineToHeaders === undefined ? record : firstLineToHeaders.call(null, record); if (!Array.isArray(headers)) { return this.__error( new CsvError( "CSV_INVALID_COLUMN_MAPPING", [ "Invalid Column Mapping:", "expect an array from column function,", `got ${JSON.stringify(headers)}`, ], this.options, this.__infoField(), { headers: headers, }, ), ); } const normalizedHeaders = normalize_columns_array(headers); this.state.expectedRecordLength = normalizedHeaders.length; this.options.columns = normalizedHeaders; this.__resetRecord(); return; } catch (err) { return err; } }, __resetRecord: function () { if (this.options.raw === true) { this.state.rawBuffer.reset(); } this.state.error = undefined; this.state.record = []; this.state.record_length = 0; }, __onField: function () { const { cast, encoding, rtrim, max_record_size } = this.options; const { enabled, wasQuoting } = this.state; // Short circuit for the from_line options if (enabled === false) { return this.__resetField(); } let field = this.state.field.toString(encoding); if (rtrim === true && wasQuoting === false) { field = field.trimRight(); } if (cast === true) { const [err, f] = this.__cast(field); if (err !== undefined) return err; field = f; } this.state.record.push(field); // Increment record length if record size must not exceed a limit if (max_record_size !== 0 && typeof field === "string") { this.state.record_length += field.length; } this.__resetField(); }, __resetField: function () { this.state.field.reset(); this.state.wasQuoting = false; }, __push: function (record, push) { const { on_record } = this.options; if (on_record !== undefined) { const info = this.__infoRecord(); try { record = on_record.call(null, record, info); } catch (err) { return err; } if (record === undefined || record === null) { return; } } push(record); }, // Return a tuple with the error and the casted value __cast: function (field) { const { columns, relax_column_count } = this.options; const isColumns = Array.isArray(columns); // Dont loose time calling cast // because the final record is an object // and this field can't be associated to a key present in columns if ( isColumns === true && relax_column_count && this.options.columns.length <= this.state.record.length ) { return [undefined, undefined]; } if (this.state.castField !== null) { try { const info = this.__infoField(); return [undefined, this.state.castField.call(null, field, info)]; } catch (err) { return [err]; } } if (this.__isFloat(field)) { return [undefined, parseFloat(field)]; } else if (this.options.cast_date !== false) { const info = this.__infoField(); return [undefined, this.options.cast_date.call(null, field, info)]; } return [undefined, field]; }, // Helper to test if a character is a space or a line delimiter __isCharTrimable: function (buf, pos) { const isTrim = (buf, pos) => { const { timchars } = this.state; loop1: for (let i = 0; i < timchars.length; i++) { const timchar = timchars[i]; for (let j = 0; j < timchar.length; j++) { if (timchar[j] !== buf[pos + j]) continue loop1; } return timchar.length; } return 0; }; return isTrim(buf, pos); }, // Keep it in case we implement the `cast_int` option // __isInt(value){ // // return Number.isInteger(parseInt(value)) // // return !isNaN( parseInt( obj ) ); // return /^(\-|\+)?[1-9][0-9]*$/.test(value) // } __isFloat: function (value) { return value - parseFloat(value) + 1 >= 0; // Borrowed from jquery }, __compareBytes: function (sourceBuf, targetBuf, targetPos, firstByte) { if (sourceBuf[0] !== firstByte) return 0; const sourceLength = sourceBuf.length; for (let i = 1; i < sourceLength; i++) { if (sourceBuf[i] !== targetBuf[targetPos + i]) return 0; } return sourceLength; }, __isDelimiter: function (buf, pos, chr) { const { delimiter, ignore_last_delimiters } = this.options; if ( ignore_last_delimiters === true && this.state.record.length === this.options.columns.length - 1 ) { return 0; } else if ( ignore_last_delimiters !== false && typeof ignore_last_delimiters === "number" && this.state.record.length === ignore_last_delimiters - 1 ) { return 0; } loop1: for (let i = 0; i < delimiter.length; i++) { const del = delimiter[i]; if (del[0] === chr) { for (let j = 1; j < del.length; j++) { if (del[j] !== buf[pos + j]) continue loop1; } return del.length; } } return 0; }, __isRecordDelimiter: function (chr, buf, pos) { const { record_delimiter } = this.options; const recordDelimiterLength = record_delimiter.length; loop1: for (let i = 0; i < recordDelimiterLength; i++) { const rd = record_delimiter[i]; const rdLength = rd.length; if (rd[0] !== chr) { continue; } for (let j = 1; j < rdLength; j++) { if (rd[j] !== buf[pos + j]) { continue loop1; } } return rd.length; } return 0; }, __isEscape: function (buf, pos, chr) { const { escape } = this.options; if (escape === null) return false; const l = escape.length; if (escape[0] === chr) { for (let i = 0; i < l; i++) { if (escape[i] !== buf[pos + i]) { return false; } } return true; } return false; }, __isQuote: function (buf, pos) { const { quote } = this.options; if (quote === null) return false; const l = quote.length; for (let i = 0; i < l; i++) { if (quote[i] !== buf[pos + i]) { return false; } } return true; }, __autoDiscoverRecordDelimiter: function (buf, pos) { const { encoding } = this.options; // Note, we don't need to cache this information in state, // It is only called on the first line until we find out a suitable // record delimiter. const rds = [ // Important, the windows line ending must be before mac os 9 Buffer.from("\r\n", encoding), Buffer.from("\n", encoding), Buffer.from("\r", encoding), ]; loop: for (let i = 0; i < rds.length; i++) { const l = rds[i].length; for (let j = 0; j < l; j++) { if (rds[i][j] !== buf[pos + j]) { continue loop; } } this.options.record_delimiter.push(rds[i]); this.state.recordDelimiterMaxLength = rds[i].length; return rds[i].length; } return 0; }, __error: function (msg) { const { encoding, raw, skip_records_with_error } = this.options; const err = typeof msg === "string" ? new Error(msg) : msg; if (skip_records_with_error) { this.state.recordHasError = true; if (this.options.on_skip !== undefined) { this.options.on_skip( err, raw ? this.state.rawBuffer.toString(encoding) : undefined, ); } // this.emit('skip', err, raw ? this.state.rawBuffer.toString(encoding) : undefined); return undefined; } else { return err; } }, __infoDataSet: function () { return { ...this.info, columns: this.options.columns, }; }, __infoRecord: function () { const { columns, raw, encoding } = this.options; return { ...this.__infoDataSet(), error: this.state.error, header: columns === true, index: this.state.record.length, raw: raw ? this.state.rawBuffer.toString(encoding) : undefined, }; }, __infoField: function () { const { columns } = this.options; const isColumns = Array.isArray(columns); return { ...this.__infoRecord(), column: isColumns === true ? columns.length > this.state.record.length ? columns[this.state.record.length].name : null : this.state.record.length, quoting: this.state.wasQuoting, }; }, }; }; const parse = function (data, opts = {}) { if (typeof data === "string") { data = Buffer.from(data); } const records = opts && opts.objname ? {} : []; const parser = transform(opts); const push = (record) => { if (parser.options.objname === undefined) records.push(record); else { records[record[0]] = record[1]; } }; const close = () => {}; const err1 = parser.parse(data, false, push, close); if (err1 !== undefined) throw err1; const err2 = parser.parse(undefined, true, push, close); if (err2 !== undefined) throw err2; return records; }; exports.CsvError = CsvError; exports.parse = parse; /***/ }), /***/ "./node_modules/csv-stringify/dist/cjs/sync.cjs": /*!******************************************************!*\ !*** ./node_modules/csv-stringify/dist/cjs/sync.cjs ***! \******************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; // Lodash implementation of `get` const charCodeOfDot = ".".charCodeAt(0); const reEscapeChar = /\\(\\)?/g; const rePropName = RegExp( // Match anything that isn't a dot or bracket. "[^.[\\]]+" + "|" + // Or match property names within brackets. "\\[(?:" + // Match a non-string expression. "([^\"'][^[]*)" + "|" + // Or match strings (supports escaping characters). "([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2" + ")\\]" + "|" + // Or match "" as the space between consecutive dots or empty brackets. "(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))", "g", ); const reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/; const reIsPlainProp = /^\w*$/; const getTag = function (value) { return Object.prototype.toString.call(value); }; const isSymbol = function (value) { const type = typeof value; return ( type === "symbol" || (type === "object" && value && getTag(value) === "[object Symbol]") ); }; const isKey = function (value, object) { if (Array.isArray(value)) { return false; } const type = typeof value; if ( type === "number" || type === "symbol" || type === "boolean" || !value || isSymbol(value) ) { return true; } return ( reIsPlainProp.test(value) || !reIsDeepProp.test(value) || (object != null && value in Object(object)) ); }; const stringToPath = function (string) { const result = []; if (string.charCodeAt(0) === charCodeOfDot) { result.push(""); } string.replace(rePropName, function (match, expression, quote, subString) { let key = match; if (quote) { key = subString.replace(reEscapeChar, "$1"); } else if (expression) { key = expression.trim(); } result.push(key); }); return result; }; const castPath = function (value, object) { if (Array.isArray(value)) { return value; } else { return isKey(value, object) ? [value] : stringToPath(value); } }; const toKey = function (value) { if (typeof value === "string" || isSymbol(value)) return value; const result = `${value}`; // eslint-disable-next-line return result == "0" && 1 / value == -INFINITY ? "-0" : result; }; const get = function (object, path) { path = castPath(path, object); let index = 0; const length = path.length; while (object != null && index < length) { object = object[toKey(path[index++])]; } return index && index === length ? object : undefined; }; const is_object = function (obj) { return typeof obj === "object" && obj !== null && !Array.isArray(obj); }; const normalize_columns = function (columns) { if (columns === undefined || columns === null) { return [undefined, undefined]; } if (typeof columns !== "object") { return [Error('Invalid option "columns": expect an array or an object')]; } if (!Array.isArray(columns)) { const newcolumns = []; for (const k in columns) { newcolumns.push({ key: k, header: columns[k], }); } columns = newcolumns; } else { const newcolumns = []; for (const column of columns) { if (typeof column === "string") { newcolumns.push({ key: column, header: column, }); } else if ( typeof column === "object" && column !== null && !Array.isArray(column) ) { if (!column.key) { return [ Error('Invalid column definition: property "key" is required'), ]; } if (column.header === undefined) { column.header = column.key; } newcolumns.push(column); } else { return [ Error("Invalid column definition: expect a string or an object"), ]; } } columns = newcolumns; } return [undefined, columns]; }; class CsvError extends Error { constructor(code, message, ...contexts) { if (Array.isArray(message)) message = message.join(" "); super(message); if (Error.captureStackTrace !== undefined) { Error.captureStackTrace(this, CsvError); } this.code = code; for (const context of contexts) { for (const key in context) { const value = context[key]; this[key] = Buffer.isBuffer(value) ? value.toString() : value == null ? value : JSON.parse(JSON.stringify(value)); } } } } const underscore = function (str) { return str.replace(/([A-Z])/g, function (_, match) { return "_" + match.toLowerCase(); }); }; const normalize_options = function (opts) { const options = {}; // Merge with user options for (const opt in opts) { options[underscore(opt)] = opts[opt]; } // Normalize option `bom` if ( options.bom === undefined || options.bom === null || options.bom === false ) { options.bom = false; } else if (options.bom !== true) { return [ new CsvError("CSV_OPTION_BOOLEAN_INVALID_TYPE", [ "option `bom` is optional and must be a boolean value,", `got ${JSON.stringify(options.bom)}`, ]), ]; } // Normalize option `delimiter` if (options.delimiter === undefined || options.delimiter === null) { options.delimiter = ","; } else if (Buffer.isBuffer(options.delimiter)) { options.delimiter = options.delimiter.toString(); } else if (typeof options.delimiter !== "string") { return [ new CsvError("CSV_OPTION_DELIMITER_INVALID_TYPE", [ "option `delimiter` must be a buffer or a string,", `got ${JSON.stringify(options.delimiter)}`, ]), ]; } // Normalize option `quote` if (options.quote === undefined || options.quote === null) { options.quote = '"'; } else if (options.quote === true) { options.quote = '"'; } else if (options.quote === false) { options.quote = ""; } else if (Buffer.isBuffer(options.quote)) { options.quote = options.quote.toString(); } else if (typeof options.quote !== "string") { return [ new CsvError("CSV_OPTION_QUOTE_INVALID_TYPE", [ "option `quote` must be a boolean, a buffer or a string,", `got ${JSON.stringify(options.quote)}`, ]), ]; } // Normalize option `quoted` if (options.quoted === undefined || options.quoted === null) { options.quoted = false; } // Normalize option `escape_formulas` if ( options.escape_formulas === undefined || options.escape_formulas === null ) { options.escape_formulas = false; } else if (typeof options.escape_formulas !== "boolean") { return [ new CsvError("CSV_OPTION_ESCAPE_FORMULAS_INVALID_TYPE", [ "option `escape_formulas` must be a boolean,", `got ${JSON.stringify(options.escape_formulas)}`, ]), ]; } // Normalize option `quoted_empty` if (options.quoted_empty === undefined || options.quoted_empty === null) { options.quoted_empty = undefined; } // Normalize option `quoted_match` if ( options.quoted_match === undefined || options.quoted_match === null || options.quoted_match === false ) { options.quoted_match = null; } else if (!Array.isArray(options.quoted_match)) { options.quoted_match = [options.quoted_match]; } if (options.quoted_match) { for (const quoted_match of options.quoted_match) { const isString = typeof quoted_match === "string"; const isRegExp = quoted_match instanceof RegExp; if (!isString && !isRegExp) { return [ Error( `Invalid Option: quoted_match must be a string or a regex, got ${JSON.stringify(quoted_match)}`, ), ]; } } } // Normalize option `quoted_string` if (options.quoted_string === undefined || options.quoted_string === null) { options.quoted_string = false; } // Normalize option `eof` if (options.eof === undefined || options.eof === null) { options.eof = true; } // Normalize option `escape` if (options.escape === undefined || options.escape === null) { options.escape = '"'; } else if (Buffer.isBuffer(options.escape)) { options.escape = options.escape.toString(); } else if (typeof options.escape !== "string") { return [ Error( `Invalid Option: escape must be a buffer or a string, got ${JSON.stringify(options.escape)}`, ), ]; } if (options.escape.length > 1) { return [ Error( `Invalid Option: escape must be one character, got ${options.escape.length} characters`, ), ]; } // Normalize option `header` if (options.header === undefined || options.header === null) { options.header = false; } // Normalize option `columns` const [errColumns, columns] = normalize_columns(options.columns); if (errColumns !== undefined) return [errColumns]; options.columns = columns; // Normalize option `quoted` if (options.quoted === undefined || options.quoted === null) { options.quoted = false; } // Normalize option `cast` if (options.cast === undefined || options.cast === null) { options.cast = {}; } // Normalize option cast.bigint if (options.cast.bigint === undefined || options.cast.bigint === null) { // Cast boolean to string by default options.cast.bigint = (value) => "" + value; } // Normalize option cast.boolean if (options.cast.boolean === undefined || options.cast.boolean === null) { // Cast boolean to string by default options.cast.boolean = (value) => (value ? "1" : ""); } // Normalize option cast.date if (options.cast.date === undefined || options.cast.date === null) { // Cast date to timestamp string by default options.cast.date = (value) => "" + value.getTime(); } // Normalize option cast.number if (options.cast.number === undefined || options.cast.number === null) { // Cast number to string using native casting by default options.cast.number = (value) => "" + value; } // Normalize option cast.object if (options.cast.object === undefined || options.cast.object === null) { // Stringify object as JSON by default options.cast.object = (value) => JSON.stringify(value); } // Normalize option cast.string if (options.cast.string === undefined || options.cast.string === null) { // Leave string untouched options.cast.string = function (value) { return value; }; } // Normalize option `on_record` if ( options.on_record !== undefined && typeof options.on_record !== "function" ) { return [Error(`Invalid Option: "on_record" must be a function.`)]; } // Normalize option `record_delimiter` if ( options.record_delimiter === undefined || options.record_delimiter === null ) { options.record_delimiter = "\n"; } else if (Buffer.isBuffer(options.record_delimiter)) { options.record_delimiter = options.record_delimiter.toString(); } else if (typeof options.record_delimiter !== "string") { return [ Error( `Invalid Option: record_delimiter must be a buffer or a string, got ${JSON.stringify(options.record_delimiter)}`, ), ]; } switch (options.record_delimiter) { case "unix": options.record_delimiter = "\n"; break; case "mac": options.record_delimiter = "\r"; break; case "windows": options.record_delimiter = "\r\n"; break; case "ascii": options.record_delimiter = "\u001e"; break; case "unicode": options.record_delimiter = "\u2028"; break; } return [undefined, options]; }; const bom_utf8 = Buffer.from([239, 187, 191]); const stringifier = function (options, state, info) { return { options: options, state: state, info: info, __transform: function (chunk, push) { // Chunk validation if (!Array.isArray(chunk) && typeof chunk !== "object") { return Error( `Invalid Record: expect an array or an object, got ${JSON.stringify(chunk)}`, ); } // Detect columns from the first record if (this.info.records === 0) { if (Array.isArray(chunk)) { if ( this.options.header === true && this.options.columns === undefined ) { return Error( "Undiscoverable Columns: header option requires column option or object records", ); } } else if (this.options.columns === undefined) { const [err, columns] = normalize_columns(Object.keys(chunk)); if (err) return; this.options.columns = columns; } } // Emit the header if (this.info.records === 0) { this.bom(push); const err = this.headers(push); if (err) return err; } // Emit and stringify the record if an object or an array try { // this.emit('record', chunk, this.info.records); if (this.options.on_record) { this.options.on_record(chunk, this.info.records); } } catch (err) { return err; } // Convert the record into a string let err, chunk_string; if (this.options.eof) { [err, chunk_string] = this.stringify(chunk); if (err) return err; if (chunk_string === undefined) { return; } else { chunk_string = chunk_string + this.options.record_delimiter; } } else { [err, chunk_string] = this.stringify(chunk); if (err) return err; if (chunk_string === undefined) { return; } else { if (this.options.header || this.info.records) { chunk_string = this.options.record_delimiter + chunk_string; } } } // Emit the csv this.info.records++; push(chunk_string); }, stringify: function (chunk, chunkIsHeader = false) { if (typeof chunk !== "object") { return [undefined, chunk]; } const { columns } = this.options; const record = []; // Record is an array if (Array.isArray(chunk)) { // We are getting an array but the user has specified output columns. In // this case, we respect the columns indexes if (columns) { chunk.splice(columns.length); } // Cast record elements for (let i = 0; i < chunk.length; i++) { const field = chunk[i]; const [err, value] = this.__cast(field, { index: i, column: i, records: this.info.records, header: chunkIsHeader, }); if (err) return [err]; record[i] = [value, field]; } // Record is a literal object // `columns` is always defined: it is either provided or discovered. } else { for (let i = 0; i < columns.length; i++) { const field = get(chunk, columns[i].key); const [err, value] = this.__cast(field, { index: i, column: columns[i].key, records: this.info.records, header: chunkIsHeader, }); if (err) return [err]; record[i] = [value, field]; } } let csvrecord = ""; for (let i = 0; i < record.length; i++) { let options, err; let [value, field] = record[i]; if (typeof value === "string") { options = this.options; } else if (is_object(value)) { options = value; value = options.value; delete options.value; if ( typeof value !== "string" && value !== undefined && value !== null ) { if (err) return [ Error( `Invalid Casting Value: returned value must return a string, null or undefined, got ${JSON.stringify(value)}`, ), ]; } options = { ...this.options, ...options }; [err, options] = normalize_options(options); if (err !== undefined) { return [err]; } } else if (value === undefined || value === null) { options = this.options; } else { return [ Error( `Invalid Casting Value: returned value must return a string, an object, null or undefined, got ${JSON.stringify(value)}`, ), ]; } const { delimiter, escape, quote, quoted, quoted_empty, quoted_string, quoted_match, record_delimiter, escape_formulas, } = options; if ("" === value && "" === field) { let quotedMatch = quoted_match && quoted_match.filter((quoted_match) => { if (typeof quoted_match === "string") { return value.indexOf(quoted_match) !== -1; } else { return quoted_match.test(value); } }); quotedMatch = quotedMatch && quotedMatch.length > 0; const shouldQuote = quotedMatch || true === quoted_empty || (true === quoted_string && false !== quoted_empty); if (shouldQuote === true) { value = quote + value + quote; } csvrecord += value; } else if (value) { if (typeof value !== "string") { return [ Error( `Formatter must return a string, null or undefined, got ${JSON.stringify(value)}`, ), ]; } const containsdelimiter = delimiter.length && value.indexOf(delimiter) >= 0; const containsQuote = quote !== "" && value.indexOf(quote) >= 0; const containsEscape = value.indexOf(escape) >= 0 && escape !== quote; const containsRecordDelimiter = value.indexOf(record_delimiter) >= 0; const quotedString = quoted_string && typeof field === "string"; let quotedMatch = quoted_match && quoted_match.filter((quoted_match) => { if (typeof quoted_match === "string") { return value.indexOf(quoted_match) !== -1; } else { return quoted_match.test(value); } }); quotedMatch = quotedMatch && quotedMatch.length > 0; // See https://github.com/adaltas/node-csv/pull/387 // More about CSV injection or formula injection, when websites embed // untrusted input inside CSV files: // https://owasp.org/www-community/attacks/CSV_Injection // http://georgemauer.net/2017/10/07/csv-injection.html // Apple Numbers unicode normalization is empirical from testing if (escape_formulas) { switch (value[0]) { case "=": case "+": case "-": case "@": case "\t": case "\r": case "\uFF1D": // Unicode '=' case "\uFF0B": // Unicode '+' case "\uFF0D": // Unicode '-' case "\uFF20": // Unicode '@' value = `'${value}`; break; } } const shouldQuote = containsQuote === true || containsdelimiter || containsRecordDelimiter || quoted || quotedString || quotedMatch; if (shouldQuote === true && containsEscape === true) { const regexp = escape === "\\" ? new RegExp(escape + escape, "g") : new RegExp(escape, "g"); value = value.replace(regexp, escape + escape); } if (containsQuote === true) { const regexp = new RegExp(quote, "g"); value = value.replace(regexp, escape + quote); } if (shouldQuote === true) { value = quote + value + quote; } csvrecord += value; } else if ( quoted_empty === true || (field === "" && quoted_string === true && quoted_empty !== false) ) { csvrecord += quote + quote; } if (i !== record.length - 1) { csvrecord += delimiter; } } return [undefined, csvrecord]; }, bom: function (push) { if (this.options.bom !== true) { return; } push(bom_utf8); }, headers: function (push) { if (this.options.header === false) { return; } if (this.options.columns === undefined) { return; } let err; let headers = this.options.columns.map((column) => column.header); if (this.options.eof) { [err, headers] = this.stringify(headers, true); headers += this.options.record_delimiter; } else { [err, headers] = this.stringify(headers); } if (err) return err; push(headers); }, __cast: function (value, context) { const type = typeof value; try { if (type === "string") { // Fine for 99% of the cases return [undefined, this.options.cast.string(value, context)]; } else if (type === "bigint") { return [undefined, this.options.cast.bigint(value, context)]; } else if (type === "number") { return [undefined, this.options.cast.number(value, context)]; } else if (type === "boolean") { return [undefined, this.options.cast.boolean(value, context)]; } else if (value instanceof Date) { return [undefined, this.options.cast.date(value, context)]; } else if (type === "object" && value !== null) { return [undefined, this.options.cast.object(value, context)]; } else { return [undefined, value, value]; } } catch (err) { return [err]; } }, }; }; const stringify = function (records, opts = {}) { const data = []; const [err, options] = normalize_options(opts); if (err !== undefined) throw err; const state = { stop: false, }; // Information const info = { records: 0, }; const api = stringifier(options, state, info); for (const record of records) { const err = api.__transform(record, function (record) { data.push(record); }); if (err !== undefined) throw err; } if (data.length === 0) { api.bom((d) => { data.push(d); }); const err = api.headers((headers) => { data.push(headers); }); if (err !== undefined) throw err; } return data.join(""); }; exports.stringify = stringify; /***/ }), /***/ "./node_modules/estree-walker/dist/umd/estree-walker.js": /*!**************************************************************!*\ !*** ./node_modules/estree-walker/dist/umd/estree-walker.js ***! \**************************************************************/ /***/ (function(__unused_webpack_module, exports) { (function (global, factory) { true ? factory(exports) : 0; }(this, (function (exports) { 'use strict'; // @ts-check /** @typedef { import('estree').BaseNode} BaseNode */ /** @typedef {{ skip: () => void; remove: () => void; replace: (node: BaseNode) => void; }} WalkerContext */ class WalkerBase { constructor() { /** @type {boolean} */ this.should_skip = false; /** @type {boolean} */ this.should_remove = false; /** @type {BaseNode | null} */ this.replacement = null; /** @type {WalkerContext} */ this.context = { skip: () => (this.should_skip = true), remove: () => (this.should_remove = true), replace: (node) => (this.replacement = node) }; } /** * * @param {any} parent * @param {string} prop * @param {number} index * @param {BaseNode} node */ replace(parent, prop, index, node) { if (parent) { if (index !== null) { parent[prop][index] = node; } else { parent[prop] = node; } } } /** * * @param {any} parent * @param {string} prop * @param {number} index */ remove(parent, prop, index) { if (parent) { if (index !== null) { parent[prop].splice(index, 1); } else { delete parent[prop]; } } } } // @ts-check /** @typedef { import('estree').BaseNode} BaseNode */ /** @typedef { import('./walker.js').WalkerContext} WalkerContext */ /** @typedef {( * this: WalkerContext, * node: BaseNode, * parent: BaseNode, * key: string, * index: number * ) => void} SyncHandler */ class SyncWalker extends WalkerBase { /** * * @param {SyncHandler} enter * @param {SyncHandler} leave */ constructor(enter, leave) { super(); /** @type {SyncHandler} */ this.enter = enter; /** @type {SyncHandler} */ this.leave = leave; } /** * * @param {BaseNode} node * @param {BaseNode} parent * @param {string} [prop] * @param {number} [index] * @returns {BaseNode} */ visit(node, parent, prop, index) { if (node) { if (this.enter) { const _should_skip = this.should_skip; const _should_remove = this.should_remove; const _replacement = this.replacement; this.should_skip = false; this.should_remove = false; this.replacement = null; this.enter.call(this.context, node, parent, prop, index); if (this.replacement) { node = this.replacement; this.replace(parent, prop, index, node); } if (this.should_remove) { this.remove(parent, prop, index); } const skipped = this.should_skip; const removed = this.should_remove; this.should_skip = _should_skip; this.should_remove = _should_remove; this.replacement = _replacement; if (skipped) return node; if (removed) return null; } for (const key in node) { const value = node[key]; if (typeof value !== "object") { continue; } else if (Array.isArray(value)) { for (let i = 0; i < value.length; i += 1) { if (value[i] !== null && typeof value[i].type === 'string') { if (!this.visit(value[i], node, key, i)) { // removed i--; } } } } else if (value !== null && typeof value.type === "string") { this.visit(value, node, key, null); } } if (this.leave) { const _replacement = this.replacement; const _should_remove = this.should_remove; this.replacement = null; this.should_remove = false; this.leave.call(this.context, node, parent, prop, index); if (this.replacement) { node = this.replacement; this.replace(parent, prop, index, node); } if (this.should_remove) { this.remove(parent, prop, index); } const removed = this.should_remove; this.replacement = _replacement; this.should_remove = _should_remove; if (removed) return null; } } return node; } } // @ts-check /** @typedef { import('estree').BaseNode} BaseNode */ /** @typedef { import('./walker').WalkerContext} WalkerContext */ /** @typedef {( * this: WalkerContext, * node: BaseNode, * parent: BaseNode, * key: string, * index: number * ) => Promise<void>} AsyncHandler */ class AsyncWalker extends WalkerBase { /** * * @param {AsyncHandler} enter * @param {AsyncHandler} leave */ constructor(enter, leave) { super(); /** @type {AsyncHandler} */ this.enter = enter; /** @type {AsyncHandler} */ this.leave = leave; } /** * * @param {BaseNode} node * @param {BaseNode} parent * @param {string} [prop] * @param {number} [index] * @returns {Promise<BaseNode>} */ async visit(node, parent, prop, index) { if (node) { if (this.enter) { const _should_skip = this.should_skip; const _should_remove = this.should_remove; const _replacement = this.replacement; this.should_skip = false; this.should_remove = false; this.replacement = null; await this.enter.call(this.context, node, parent, prop, index); if (this.replacement) { node = this.replacement; this.replace(parent, prop, index, node); } if (this.should_remove) { this.remove(parent, prop, index); } const skipped = this.should_skip; const removed = this.should_remove; this.should_skip = _should_skip; this.should_remove = _should_remove; this.replacement = _replacement; if (skipped) return node; if (removed) return null; } for (const key in node) { const value = node[key]; if (typeof value !== "object") { continue; } else if (Array.isArray(value)) { for (let i = 0; i < value.length; i += 1) { if (value[i] !== null && typeof value[i].type === 'string') { if (!(await this.visit(value[i], node, key, i))) { // removed i--; } } } } else if (value !== null && typeof value.type === "string") { await this.visit(value, node, key, null); } } if (this.leave) { const _replacement = this.replacement; const _should_remove = this.should_remove; this.replacement = null; this.should_remove = false; await this.leave.call(this.context, node, parent, prop, index); if (this.replacement) { node = this.replacement; this.replace(parent, prop, index, node); } if (this.should_remove) { this.remove(parent, prop, index); } const removed = this.should_remove; this.replacement = _replacement; this.should_remove = _should_remove; if (removed) return null; } } return node; } } // @ts-check /** @typedef { import('estree').BaseNode} BaseNode */ /** @typedef { import('./sync.js').SyncHandler} SyncHandler */ /** @typedef { import('./async.js').AsyncHandler} AsyncHandler */ /** * * @param {BaseNode} ast * @param {{ * enter?: SyncHandler * leave?: SyncHandler * }} walker * @returns {BaseNode} */ function walk(ast, { enter, leave }) { const instance = new SyncWalker(enter, leave); return instance.visit(ast, null); } /** * * @param {BaseNode} ast * @param {{ * enter?: AsyncHandler * leave?: AsyncHandler * }} walker * @returns {Promise<BaseNode>} */ async function asyncWalk(ast, { enter, leave }) { const instance = new AsyncWalker(enter, leave); return await instance.visit(ast, null); } exports.asyncWalk = asyncWalk; exports.walk = walk; Object.defineProperty(exports, '__esModule', { value: true }); }))); /***/ }), /***/ "./node_modules/vue/index.mjs": /*!************************************!*\ !*** ./node_modules/vue/index.mjs ***! \************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./index.js */ "./node_modules/vue/index.js"); /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _index_js__WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== "default") __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _index_js__WEBPACK_IMPORTED_MODULE_0__[__WEBPACK_IMPORT_KEY__] /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); /***/ }), /***/ "./node_modules/xlsx/xlsx.mjs": /*!************************************!*\ !*** ./node_modules/xlsx/xlsx.mjs ***! \************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CFB: () => (/* binding */ CFB), /* harmony export */ SSF: () => (/* binding */ SSF), /* harmony export */ parse_xlscfb: () => (/* binding */ parse_xlscfb), /* harmony export */ parse_zip: () => (/* binding */ parse_zip), /* harmony export */ read: () => (/* binding */ readSync), /* harmony export */ readFile: () => (/* binding */ readFileSync), /* harmony export */ readFileSync: () => (/* binding */ readFileSync), /* harmony export */ set_cptable: () => (/* binding */ set_cptable), /* harmony export */ set_fs: () => (/* binding */ set_fs), /* harmony export */ stream: () => (/* binding */ __stream), /* harmony export */ utils: () => (/* binding */ utils), /* harmony export */ version: () => (/* binding */ version), /* harmony export */ write: () => (/* binding */ writeSync), /* harmony export */ writeFile: () => (/* binding */ writeFileSync), /* harmony export */ writeFileAsync: () => (/* binding */ writeFileAsync), /* harmony export */ writeFileSync: () => (/* binding */ writeFileSync), /* harmony export */ writeFileXLSX: () => (/* binding */ writeFileSyncXLSX), /* harmony export */ writeXLSX: () => (/* binding */ writeSyncXLSX) /* harmony export */ }); /*! xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */ /* vim: set ts=2: */ /*exported XLSX */ /*global process:false, Buffer:false, ArrayBuffer:false, DataView:false, Deno:false */ var XLSX = {}; XLSX.version = '0.18.5'; var current_codepage = 1200, current_ansi = 1252; var VALID_ANSI = [ 874, 932, 936, 949, 950, 1250, 1251, 1252, 1253, 1254, 1255, 1256, 1257, 1258, 10000 ]; /* ECMA-376 Part I 18.4.1 charset to codepage mapping */ var CS2CP = ({ /*::[*/0/*::]*/: 1252, /* ANSI */ /*::[*/1/*::]*/: 65001, /* DEFAULT */ /*::[*/2/*::]*/: 65001, /* SYMBOL */ /*::[*/77/*::]*/: 10000, /* MAC */ /*::[*/128/*::]*/: 932, /* SHIFTJIS */ /*::[*/129/*::]*/: 949, /* HANGUL */ /*::[*/130/*::]*/: 1361, /* JOHAB */ /*::[*/134/*::]*/: 936, /* GB2312 */ /*::[*/136/*::]*/: 950, /* CHINESEBIG5 */ /*::[*/161/*::]*/: 1253, /* GREEK */ /*::[*/162/*::]*/: 1254, /* TURKISH */ /*::[*/163/*::]*/: 1258, /* VIETNAMESE */ /*::[*/177/*::]*/: 1255, /* HEBREW */ /*::[*/178/*::]*/: 1256, /* ARABIC */ /*::[*/186/*::]*/: 1257, /* BALTIC */ /*::[*/204/*::]*/: 1251, /* RUSSIAN */ /*::[*/222/*::]*/: 874, /* THAI */ /*::[*/238/*::]*/: 1250, /* EASTEUROPE */ /*::[*/255/*::]*/: 1252, /* OEM */ /*::[*/69/*::]*/: 6969 /* MISC */ }/*:any*/); var set_ansi = function(cp/*:number*/) { if(VALID_ANSI.indexOf(cp) == -1) return; current_ansi = CS2CP[0] = cp; }; function reset_ansi() { set_ansi(1252); } var set_cp = function(cp/*:number*/) { current_codepage = cp; set_ansi(cp); }; function reset_cp() { set_cp(1200); reset_ansi(); } function char_codes(data/*:string*/)/*:Array<number>*/ { var o/*:Array<number>*/ = []; for(var i = 0, len = data.length; i < len; ++i) o[i] = data.charCodeAt(i); return o; } function utf16leread(data/*:string*/)/*:string*/ { var o/*:Array<string>*/ = []; for(var i = 0; i < (data.length>>1); ++i) o[i] = String.fromCharCode(data.charCodeAt(2*i) + (data.charCodeAt(2*i+1)<<8)); return o.join(""); } function utf16beread(data/*:string*/)/*:string*/ { var o/*:Array<string>*/ = []; for(var i = 0; i < (data.length>>1); ++i) o[i] = String.fromCharCode(data.charCodeAt(2*i+1) + (data.charCodeAt(2*i)<<8)); return o.join(""); } var debom = function(data/*:string*/)/*:string*/ { var c1 = data.charCodeAt(0), c2 = data.charCodeAt(1); if(c1 == 0xFF && c2 == 0xFE) return utf16leread(data.slice(2)); if(c1 == 0xFE && c2 == 0xFF) return utf16beread(data.slice(2)); if(c1 == 0xFEFF) return data.slice(1); return data; }; var _getchar = function _gc1(x/*:number*/)/*:string*/ { return String.fromCharCode(x); }; var _getansi = function _ga1(x/*:number*/)/*:string*/ { return String.fromCharCode(x); }; var $cptable; function set_cptable(cptable) { $cptable = cptable; set_cp = function(cp/*:number*/) { current_codepage = cp; set_ansi(cp); }; debom = function(data/*:string*/) { if(data.charCodeAt(0) === 0xFF && data.charCodeAt(1) === 0xFE) { return $cptable.utils.decode(1200, char_codes(data.slice(2))); } return data; }; _getchar = function _gc2(x/*:number*/)/*:string*/ { if(current_codepage === 1200) return String.fromCharCode(x); return $cptable.utils.decode(current_codepage, [x&255,x>>8])[0]; }; _getansi = function _ga2(x/*:number*/)/*:string*/ { return $cptable.utils.decode(current_ansi, [x])[0]; }; cpdoit(); } var DENSE = null; var DIF_XL = true; var Base64_map = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; function Base64_encode(input) { var o = ""; var c1 = 0, c2 = 0, c3 = 0, e1 = 0, e2 = 0, e3 = 0, e4 = 0; for (var i = 0; i < input.length; ) { c1 = input.charCodeAt(i++); e1 = c1 >> 2; c2 = input.charCodeAt(i++); e2 = (c1 & 3) << 4 | c2 >> 4; c3 = input.charCodeAt(i++); e3 = (c2 & 15) << 2 | c3 >> 6; e4 = c3 & 63; if (isNaN(c2)) { e3 = e4 = 64; } else if (isNaN(c3)) { e4 = 64; } o += Base64_map.charAt(e1) + Base64_map.charAt(e2) + Base64_map.charAt(e3) + Base64_map.charAt(e4); } return o; } function Base64_decode(input) { var o = ""; var c1 = 0, c2 = 0, c3 = 0, e1 = 0, e2 = 0, e3 = 0, e4 = 0; input = input.replace(/[^\w\+\/\=]/g, ""); for (var i = 0; i < input.length; ) { e1 = Base64_map.indexOf(input.charAt(i++)); e2 = Base64_map.indexOf(input.charAt(i++)); c1 = e1 << 2 | e2 >> 4; o += String.fromCharCode(c1); e3 = Base64_map.indexOf(input.charAt(i++)); c2 = (e2 & 15) << 4 | e3 >> 2; if (e3 !== 64) { o += String.fromCharCode(c2); } e4 = Base64_map.indexOf(input.charAt(i++)); c3 = (e3 & 3) << 6 | e4; if (e4 !== 64) { o += String.fromCharCode(c3); } } return o; } var has_buf = /*#__PURE__*/(function() { return typeof Buffer !== 'undefined' && typeof process !== 'undefined' && typeof process.versions !== 'undefined' && !!process.versions.node; })(); var Buffer_from = /*#__PURE__*/(function() { if(typeof Buffer !== 'undefined') { var nbfs = !Buffer.from; if(!nbfs) try { Buffer.from("foo", "utf8"); } catch(e) { nbfs = true; } return nbfs ? function(buf, enc) { return (enc) ? new Buffer(buf, enc) : new Buffer(buf); } : Buffer.from.bind(Buffer); } return function() {}; })(); function new_raw_buf(len/*:number*/) { /* jshint -W056 */ if(has_buf) return Buffer.alloc ? Buffer.alloc(len) : new Buffer(len); return typeof Uint8Array != "undefined" ? new Uint8Array(len) : new Array(len); /* jshint +W056 */ } function new_unsafe_buf(len/*:number*/) { /* jshint -W056 */ if(has_buf) return Buffer.allocUnsafe ? Buffer.allocUnsafe(len) : new Buffer(len); return typeof Uint8Array != "undefined" ? new Uint8Array(len) : new Array(len); /* jshint +W056 */ } var s2a = function s2a(s/*:string*/)/*:any*/ { if(has_buf) return Buffer_from(s, "binary"); return s.split("").map(function(x/*:string*/)/*:number*/{ return x.charCodeAt(0) & 0xff; }); }; function s2ab(s/*:string*/)/*:any*/ { if(typeof ArrayBuffer === 'undefined') return s2a(s); var buf = new ArrayBuffer(s.length), view = new Uint8Array(buf); for (var i=0; i!=s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF; return buf; } function a2s(data/*:any*/)/*:string*/ { if(Array.isArray(data)) return data.map(function(c) { return String.fromCharCode(c); }).join(""); var o/*:Array<string>*/ = []; for(var i = 0; i < data.length; ++i) o[i] = String.fromCharCode(data[i]); return o.join(""); } function a2u(data/*:Array<number>*/)/*:Uint8Array*/ { if(typeof Uint8Array === 'undefined') throw new Error("Unsupported"); return new Uint8Array(data); } function ab2a(data/*:ArrayBuffer|Uint8Array*/)/*:Array<number>*/ { if(typeof ArrayBuffer == 'undefined') throw new Error("Unsupported"); if(data instanceof ArrayBuffer) return ab2a(new Uint8Array(data)); /*:: if(data instanceof ArrayBuffer) throw new Error("unreachable"); */ var o = new Array(data.length); for(var i = 0; i < data.length; ++i) o[i] = data[i]; return o; } var bconcat = has_buf ? function(bufs) { return Buffer.concat(bufs.map(function(buf) { return Buffer.isBuffer(buf) ? buf : Buffer_from(buf); })); } : function(bufs) { if(typeof Uint8Array !== "undefined") { var i = 0, maxlen = 0; for(i = 0; i < bufs.length; ++i) maxlen += bufs[i].length; var o = new Uint8Array(maxlen); var len = 0; for(i = 0, maxlen = 0; i < bufs.length; maxlen += len, ++i) { len = bufs[i].length; if(bufs[i] instanceof Uint8Array) o.set(bufs[i], maxlen); else if(typeof bufs[i] == "string") { throw "wtf"; } else o.set(new Uint8Array(bufs[i]), maxlen); } return o; } return [].concat.apply([], bufs.map(function(buf) { return Array.isArray(buf) ? buf : [].slice.call(buf); })); }; function utf8decode(content/*:string*/) { var out = [], widx = 0, L = content.length + 250; var o = new_raw_buf(content.length + 255); for(var ridx = 0; ridx < content.length; ++ridx) { var c = content.charCodeAt(ridx); if(c < 0x80) o[widx++] = c; else if(c < 0x800) { o[widx++] = (192|((c>>6)&31)); o[widx++] = (128|(c&63)); } else if(c >= 0xD800 && c < 0xE000) { c = (c&1023)+64; var d = content.charCodeAt(++ridx)&1023; o[widx++] = (240|((c>>8)&7)); o[widx++] = (128|((c>>2)&63)); o[widx++] = (128|((d>>6)&15)|((c&3)<<4)); o[widx++] = (128|(d&63)); } else { o[widx++] = (224|((c>>12)&15)); o[widx++] = (128|((c>>6)&63)); o[widx++] = (128|(c&63)); } if(widx > L) { out.push(o.slice(0, widx)); widx = 0; o = new_raw_buf(65535); L = 65530; } } out.push(o.slice(0, widx)); return bconcat(out); } var chr0 = /\u0000/g, chr1 = /[\u0001-\u0006]/g; /*:: declare type Block = any; declare type BufArray = { newblk(sz:number):Block; next(sz:number):Block; end():any; push(buf:Block):void; }; type RecordHopperCB = {(d:any, Rn:string, RT:number):?boolean;}; type EvertType = {[string]:string}; type EvertNumType = {[string]:number}; type EvertArrType = {[string]:Array<string>}; type StringConv = {(string):string}; */ /* ssf.js (C) 2013-present SheetJS -- http://sheetjs.com */ /*jshint -W041 */ function _strrev(x/*:string*/)/*:string*/ { var o = "", i = x.length-1; while(i>=0) o += x.charAt(i--); return o; } function pad0(v/*:any*/,d/*:number*/)/*:string*/{var t=""+v; return t.length>=d?t:fill('0',d-t.length)+t;} function pad_(v/*:any*/,d/*:number*/)/*:string*/{var t=""+v;return t.length>=d?t:fill(' ',d-t.length)+t;} function rpad_(v/*:any*/,d/*:number*/)/*:string*/{var t=""+v; return t.length>=d?t:t+fill(' ',d-t.length);} function pad0r1(v/*:any*/,d/*:number*/)/*:string*/{var t=""+Math.round(v); return t.length>=d?t:fill('0',d-t.length)+t;} function pad0r2(v/*:any*/,d/*:number*/)/*:string*/{var t=""+v; return t.length>=d?t:fill('0',d-t.length)+t;} var p2_32 = /*#__PURE__*/Math.pow(2,32); function pad0r(v/*:any*/,d/*:number*/)/*:string*/{if(v>p2_32||v<-p2_32) return pad0r1(v,d); var i = Math.round(v); return pad0r2(i,d); } /* yes, in 2022 this is still faster than string compare */ function SSF_isgeneral(s/*:string*/, i/*:?number*/)/*:boolean*/ { i = i || 0; return s.length >= 7 + i && (s.charCodeAt(i)|32) === 103 && (s.charCodeAt(i+1)|32) === 101 && (s.charCodeAt(i+2)|32) === 110 && (s.charCodeAt(i+3)|32) === 101 && (s.charCodeAt(i+4)|32) === 114 && (s.charCodeAt(i+5)|32) === 97 && (s.charCodeAt(i+6)|32) === 108; } var days/*:Array<Array<string> >*/ = [ ['Sun', 'Sunday'], ['Mon', 'Monday'], ['Tue', 'Tuesday'], ['Wed', 'Wednesday'], ['Thu', 'Thursday'], ['Fri', 'Friday'], ['Sat', 'Saturday'] ]; var months/*:Array<Array<string> >*/ = [ ['J', 'Jan', 'January'], ['F', 'Feb', 'February'], ['M', 'Mar', 'March'], ['A', 'Apr', 'April'], ['M', 'May', 'May'], ['J', 'Jun', 'June'], ['J', 'Jul', 'July'], ['A', 'Aug', 'August'], ['S', 'Sep', 'September'], ['O', 'Oct', 'October'], ['N', 'Nov', 'November'], ['D', 'Dec', 'December'] ]; function SSF_init_table(t/*:any*/) { if(!t) t = {}; t[0]= 'General'; t[1]= '0'; t[2]= '0.00'; t[3]= '#,##0'; t[4]= '#,##0.00'; t[9]= '0%'; t[10]= '0.00%'; t[11]= '0.00E+00'; t[12]= '# ?/?'; t[13]= '# ??/??'; t[14]= 'm/d/yy'; t[15]= 'd-mmm-yy'; t[16]= 'd-mmm'; t[17]= 'mmm-yy'; t[18]= 'h:mm AM/PM'; t[19]= 'h:mm:ss AM/PM'; t[20]= 'h:mm'; t[21]= 'h:mm:ss'; t[22]= 'm/d/yy h:mm'; t[37]= '#,##0 ;(#,##0)'; t[38]= '#,##0 ;[Red](#,##0)'; t[39]= '#,##0.00;(#,##0.00)'; t[40]= '#,##0.00;[Red](#,##0.00)'; t[45]= 'mm:ss'; t[46]= '[h]:mm:ss'; t[47]= 'mmss.0'; t[48]= '##0.0E+0'; t[49]= '@'; t[56]= '"上午/下午 "hh"時"mm"分"ss"秒 "'; return t; } /* repeated to satiate webpack */ var table_fmt = { 0: 'General', 1: '0', 2: '0.00', 3: '#,##0', 4: '#,##0.00', 9: '0%', 10: '0.00%', 11: '0.00E+00', 12: '# ?/?', 13: '# ??/??', 14: 'm/d/yy', 15: 'd-mmm-yy', 16: 'd-mmm', 17: 'mmm-yy', 18: 'h:mm AM/PM', 19: 'h:mm:ss AM/PM', 20: 'h:mm', 21: 'h:mm:ss', 22: 'm/d/yy h:mm', 37: '#,##0 ;(#,##0)', 38: '#,##0 ;[Red](#,##0)', 39: '#,##0.00;(#,##0.00)', 40: '#,##0.00;[Red](#,##0.00)', 45: 'mm:ss', 46: '[h]:mm:ss', 47: 'mmss.0', 48: '##0.0E+0', 49: '@', 56: '"上午/下午 "hh"時"mm"分"ss"秒 "' }; /* Defaults determined by systematically testing in Excel 2019 */ /* These formats appear to default to other formats in the table */ var SSF_default_map = { 5: 37, 6: 38, 7: 39, 8: 40, // 5 -> 37 ... 8 -> 40 23: 0, 24: 0, 25: 0, 26: 0, // 23 -> 0 ... 26 -> 0 27: 14, 28: 14, 29: 14, 30: 14, 31: 14, // 27 -> 14 ... 31 -> 14 50: 14, 51: 14, 52: 14, 53: 14, 54: 14, // 50 -> 14 ... 58 -> 14 55: 14, 56: 14, 57: 14, 58: 14, 59: 1, 60: 2, 61: 3, 62: 4, // 59 -> 1 ... 62 -> 4 67: 9, 68: 10, // 67 -> 9 ... 68 -> 10 69: 12, 70: 13, 71: 14, // 69 -> 12 ... 71 -> 14 72: 14, 73: 15, 74: 16, 75: 17, // 72 -> 14 ... 75 -> 17 76: 20, 77: 21, 78: 22, // 76 -> 20 ... 78 -> 22 79: 45, 80: 46, 81: 47, // 79 -> 45 ... 81 -> 47 82: 0 // 82 -> 0 ... 65536 -> 0 (omitted) }; /* These formats technically refer to Accounting formats with no equivalent */ var SSF_default_str = { // 5 -- Currency, 0 decimal, black negative 5: '"$"#,##0_);\\("$"#,##0\\)', 63: '"$"#,##0_);\\("$"#,##0\\)', // 6 -- Currency, 0 decimal, red negative 6: '"$"#,##0_);[Red]\\("$"#,##0\\)', 64: '"$"#,##0_);[Red]\\("$"#,##0\\)', // 7 -- Currency, 2 decimal, black negative 7: '"$"#,##0.00_);\\("$"#,##0.00\\)', 65: '"$"#,##0.00_);\\("$"#,##0.00\\)', // 8 -- Currency, 2 decimal, red negative 8: '"$"#,##0.00_);[Red]\\("$"#,##0.00\\)', 66: '"$"#,##0.00_);[Red]\\("$"#,##0.00\\)', // 41 -- Accounting, 0 decimal, No Symbol 41: '_(* #,##0_);_(* \\(#,##0\\);_(* "-"_);_(@_)', // 42 -- Accounting, 0 decimal, $ Symbol 42: '_("$"* #,##0_);_("$"* \\(#,##0\\);_("$"* "-"_);_(@_)', // 43 -- Accounting, 2 decimal, No Symbol 43: '_(* #,##0.00_);_(* \\(#,##0.00\\);_(* "-"??_);_(@_)', // 44 -- Accounting, 2 decimal, $ Symbol 44: '_("$"* #,##0.00_);_("$"* \\(#,##0.00\\);_("$"* "-"??_);_(@_)' }; function SSF_frac(x/*:number*/, D/*:number*/, mixed/*:?boolean*/)/*:Array<number>*/ { var sgn = x < 0 ? -1 : 1; var B = x * sgn; var P_2 = 0, P_1 = 1, P = 0; var Q_2 = 1, Q_1 = 0, Q = 0; var A = Math.floor(B); while(Q_1 < D) { A = Math.floor(B); P = A * P_1 + P_2; Q = A * Q_1 + Q_2; if((B - A) < 0.00000005) break; B = 1 / (B - A); P_2 = P_1; P_1 = P; Q_2 = Q_1; Q_1 = Q; } if(Q > D) { if(Q_1 > D) { Q = Q_2; P = P_2; } else { Q = Q_1; P = P_1; } } if(!mixed) return [0, sgn * P, Q]; var q = Math.floor(sgn * P/Q); return [q, sgn*P - q*Q, Q]; } function SSF_parse_date_code(v/*:number*/,opts/*:?any*/,b2/*:?boolean*/) { if(v > 2958465 || v < 0) return null; var date = (v|0), time = Math.floor(86400 * (v - date)), dow=0; var dout=[]; var out={D:date, T:time, u:86400*(v-date)-time,y:0,m:0,d:0,H:0,M:0,S:0,q:0}; if(Math.abs(out.u) < 1e-6) out.u = 0; if(opts && opts.date1904) date += 1462; if(out.u > 0.9999) { out.u = 0; if(++time == 86400) { out.T = time = 0; ++date; ++out.D; } } if(date === 60) {dout = b2 ? [1317,10,29] : [1900,2,29]; dow=3;} else if(date === 0) {dout = b2 ? [1317,8,29] : [1900,1,0]; dow=6;} else { if(date > 60) --date; /* 1 = Jan 1 1900 in Gregorian */ var d = new Date(1900, 0, 1); d.setDate(d.getDate() + date - 1); dout = [d.getFullYear(), d.getMonth()+1,d.getDate()]; dow = d.getDay(); if(date < 60) dow = (dow + 6) % 7; if(b2) dow = SSF_fix_hijri(d, dout); } out.y = dout[0]; out.m = dout[1]; out.d = dout[2]; out.S = time % 60; time = Math.floor(time / 60); out.M = time % 60; time = Math.floor(time / 60); out.H = time; out.q = dow; return out; } var SSFbasedate = /*#__PURE__*/new Date(1899, 11, 31, 0, 0, 0); var SSFdnthresh = /*#__PURE__*/SSFbasedate.getTime(); var SSFbase1904 = /*#__PURE__*/new Date(1900, 2, 1, 0, 0, 0); function datenum_local(v/*:Date*/, date1904/*:?boolean*/)/*:number*/ { var epoch = /*#__PURE__*/v.getTime(); if(date1904) epoch -= 1461*24*60*60*1000; else if(v >= SSFbase1904) epoch += 24*60*60*1000; return (epoch - (SSFdnthresh + (/*#__PURE__*/v.getTimezoneOffset() - /*#__PURE__*/SSFbasedate.getTimezoneOffset()) * 60000)) / (24 * 60 * 60 * 1000); } /* ECMA-376 18.8.30 numFmt*/ /* Note: `toPrecision` uses standard form when prec > E and E >= -6 */ /* exponent >= -9 and <= 9 */ function SSF_strip_decimal(o/*:string*/)/*:string*/ { return (o.indexOf(".") == -1) ? o : o.replace(/(?:\.0*|(\.\d*[1-9])0+)$/, "$1"); } /* General Exponential always shows 2 digits exp and trims the mantissa */ function SSF_normalize_exp(o/*:string*/)/*:string*/ { if(o.indexOf("E") == -1) return o; return o.replace(/(?:\.0*|(\.\d*[1-9])0+)[Ee]/,"$1E").replace(/(E[+-])(\d)$/,"$10$2"); } /* exponent >= -9 and <= 9 */ function SSF_small_exp(v/*:number*/)/*:string*/ { var w = (v<0?12:11); var o = SSF_strip_decimal(v.toFixed(12)); if(o.length <= w) return o; o = v.toPrecision(10); if(o.length <= w) return o; return v.toExponential(5); } /* exponent >= 11 or <= -10 likely exponential */ function SSF_large_exp(v/*:number*/)/*:string*/ { var o = SSF_strip_decimal(v.toFixed(11)); return (o.length > (v<0?12:11) || o === "0" || o === "-0") ? v.toPrecision(6) : o; } function SSF_general_num(v/*:number*/)/*:string*/ { var V = Math.floor(Math.log(Math.abs(v))*Math.LOG10E), o; if(V >= -4 && V <= -1) o = v.toPrecision(10+V); else if(Math.abs(V) <= 9) o = SSF_small_exp(v); else if(V === 10) o = v.toFixed(10).substr(0,12); else o = SSF_large_exp(v); return SSF_strip_decimal(SSF_normalize_exp(o.toUpperCase())); } /* "General" rules: - text is passed through ("@") - booleans are rendered as TRUE/FALSE - "up to 11 characters" displayed for numbers - Default date format (code 14) used for Dates The longest 32-bit integer text is "-2147483648", exactly 11 chars TODO: technically the display depends on the width of the cell */ function SSF_general(v/*:any*/, opts/*:any*/) { switch(typeof v) { case 'string': return v; case 'boolean': return v ? "TRUE" : "FALSE"; case 'number': return (v|0) === v ? v.toString(10) : SSF_general_num(v); case 'undefined': return ""; case 'object': if(v == null) return ""; if(v instanceof Date) return SSF_format(14, datenum_local(v, opts && opts.date1904), opts); } throw new Error("unsupported value in General format: " + v); } function SSF_fix_hijri(date/*:Date*/, o/*:[number, number, number]*/) { /* TODO: properly adjust y/m/d and */ o[0] -= 581; var dow = date.getDay(); if(date < 60) dow = (dow + 6) % 7; return dow; } //var THAI_DIGITS = "\u0E50\u0E51\u0E52\u0E53\u0E54\u0E55\u0E56\u0E57\u0E58\u0E59".split(""); function SSF_write_date(type/*:number*/, fmt/*:string*/, val, ss0/*:?number*/)/*:string*/ { var o="", ss=0, tt=0, y = val.y, out, outl = 0; switch(type) { case 98: /* 'b' buddhist year */ y = val.y + 543; /* falls through */ case 121: /* 'y' year */ switch(fmt.length) { case 1: case 2: out = y % 100; outl = 2; break; default: out = y % 10000; outl = 4; break; } break; case 109: /* 'm' month */ switch(fmt.length) { case 1: case 2: out = val.m; outl = fmt.length; break; case 3: return months[val.m-1][1]; case 5: return months[val.m-1][0]; default: return months[val.m-1][2]; } break; case 100: /* 'd' day */ switch(fmt.length) { case 1: case 2: out = val.d; outl = fmt.length; break; case 3: return days[val.q][0]; default: return days[val.q][1]; } break; case 104: /* 'h' 12-hour */ switch(fmt.length) { case 1: case 2: out = 1+(val.H+11)%12; outl = fmt.length; break; default: throw 'bad hour format: ' + fmt; } break; case 72: /* 'H' 24-hour */ switch(fmt.length) { case 1: case 2: out = val.H; outl = fmt.length; break; default: throw 'bad hour format: ' + fmt; } break; case 77: /* 'M' minutes */ switch(fmt.length) { case 1: case 2: out = val.M; outl = fmt.length; break; default: throw 'bad minute format: ' + fmt; } break; case 115: /* 's' seconds */ if(fmt != 's' && fmt != 'ss' && fmt != '.0' && fmt != '.00' && fmt != '.000') throw 'bad second format: ' + fmt; if(val.u === 0 && (fmt == "s" || fmt == "ss")) return pad0(val.S, fmt.length); /*::if(!ss0) ss0 = 0; */ if(ss0 >= 2) tt = ss0 === 3 ? 1000 : 100; else tt = ss0 === 1 ? 10 : 1; ss = Math.round((tt)*(val.S + val.u)); if(ss >= 60*tt) ss = 0; if(fmt === 's') return ss === 0 ? "0" : ""+ss/tt; o = pad0(ss,2 + ss0); if(fmt === 'ss') return o.substr(0,2); return "." + o.substr(2,fmt.length-1); case 90: /* 'Z' absolute time */ switch(fmt) { case '[h]': case '[hh]': out = val.D*24+val.H; break; case '[m]': case '[mm]': out = (val.D*24+val.H)*60+val.M; break; case '[s]': case '[ss]': out = ((val.D*24+val.H)*60+val.M)*60+Math.round(val.S+val.u); break; default: throw 'bad abstime format: ' + fmt; } outl = fmt.length === 3 ? 1 : 2; break; case 101: /* 'e' era */ out = y; outl = 1; break; } var outstr = outl > 0 ? pad0(out, outl) : ""; return outstr; } /*jshint -W086 */ /*jshint +W086 */ function commaify(s/*:string*/)/*:string*/ { var w = 3; if(s.length <= w) return s; var j = (s.length % w), o = s.substr(0,j); for(; j!=s.length; j+=w) o+=(o.length > 0 ? "," : "") + s.substr(j,w); return o; } var pct1 = /%/g; function write_num_pct(type/*:string*/, fmt/*:string*/, val/*:number*/)/*:string*/{ var sfmt = fmt.replace(pct1,""), mul = fmt.length - sfmt.length; return write_num(type, sfmt, val * Math.pow(10,2*mul)) + fill("%",mul); } function write_num_cm(type/*:string*/, fmt/*:string*/, val/*:number*/)/*:string*/{ var idx = fmt.length - 1; while(fmt.charCodeAt(idx-1) === 44) --idx; return write_num(type, fmt.substr(0,idx), val / Math.pow(10,3*(fmt.length-idx))); } function write_num_exp(fmt/*:string*/, val/*:number*/)/*:string*/{ var o/*:string*/; var idx = fmt.indexOf("E") - fmt.indexOf(".") - 1; if(fmt.match(/^#+0.0E\+0$/)) { if(val == 0) return "0.0E+0"; else if(val < 0) return "-" + write_num_exp(fmt, -val); var period = fmt.indexOf("."); if(period === -1) period=fmt.indexOf('E'); var ee = Math.floor(Math.log(val)*Math.LOG10E)%period; if(ee < 0) ee += period; o = (val/Math.pow(10,ee)).toPrecision(idx+1+(period+ee)%period); if(o.indexOf("e") === -1) { var fakee = Math.floor(Math.log(val)*Math.LOG10E); if(o.indexOf(".") === -1) o = o.charAt(0) + "." + o.substr(1) + "E+" + (fakee - o.length+ee); else o += "E+" + (fakee - ee); while(o.substr(0,2) === "0.") { o = o.charAt(0) + o.substr(2,period) + "." + o.substr(2+period); o = o.replace(/^0+([1-9])/,"$1").replace(/^0+\./,"0."); } o = o.replace(/\+-/,"-"); } o = o.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function($$,$1,$2,$3) { return $1 + $2 + $3.substr(0,(period+ee)%period) + "." + $3.substr(ee) + "E"; }); } else o = val.toExponential(idx); if(fmt.match(/E\+00$/) && o.match(/e[+-]\d$/)) o = o.substr(0,o.length-1) + "0" + o.charAt(o.length-1); if(fmt.match(/E\-/) && o.match(/e\+/)) o = o.replace(/e\+/,"e"); return o.replace("e","E"); } var frac1 = /# (\?+)( ?)\/( ?)(\d+)/; function write_num_f1(r/*:Array<string>*/, aval/*:number*/, sign/*:string*/)/*:string*/ { var den = parseInt(r[4],10), rr = Math.round(aval * den), base = Math.floor(rr/den); var myn = (rr - base*den), myd = den; return sign + (base === 0 ? "" : ""+base) + " " + (myn === 0 ? fill(" ", r[1].length + 1 + r[4].length) : pad_(myn,r[1].length) + r[2] + "/" + r[3] + pad0(myd,r[4].length)); } function write_num_f2(r/*:Array<string>*/, aval/*:number*/, sign/*:string*/)/*:string*/ { return sign + (aval === 0 ? "" : ""+aval) + fill(" ", r[1].length + 2 + r[4].length); } var dec1 = /^#*0*\.([0#]+)/; var closeparen = /\).*[0#]/; var phone = /\(###\) ###\\?-####/; function hashq(str/*:string*/)/*:string*/ { var o = "", cc; for(var i = 0; i != str.length; ++i) switch((cc=str.charCodeAt(i))) { case 35: break; case 63: o+= " "; break; case 48: o+= "0"; break; default: o+= String.fromCharCode(cc); } return o; } function rnd(val/*:number*/, d/*:number*/)/*:string*/ { var dd = Math.pow(10,d); return ""+(Math.round(val * dd)/dd); } function dec(val/*:number*/, d/*:number*/)/*:number*/ { var _frac = val - Math.floor(val), dd = Math.pow(10,d); if (d < ('' + Math.round(_frac * dd)).length) return 0; return Math.round(_frac * dd); } function carry(val/*:number*/, d/*:number*/)/*:number*/ { if (d < ('' + Math.round((val-Math.floor(val))*Math.pow(10,d))).length) { return 1; } return 0; } function flr(val/*:number*/)/*:string*/ { if(val < 2147483647 && val > -2147483648) return ""+(val >= 0 ? (val|0) : (val-1|0)); return ""+Math.floor(val); } function write_num_flt(type/*:string*/, fmt/*:string*/, val/*:number*/)/*:string*/ { if(type.charCodeAt(0) === 40 && !fmt.match(closeparen)) { var ffmt = fmt.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,""); if(val >= 0) return write_num_flt('n', ffmt, val); return '(' + write_num_flt('n', ffmt, -val) + ')'; } if(fmt.charCodeAt(fmt.length - 1) === 44) return write_num_cm(type, fmt, val); if(fmt.indexOf('%') !== -1) return write_num_pct(type, fmt, val); if(fmt.indexOf('E') !== -1) return write_num_exp(fmt, val); if(fmt.charCodeAt(0) === 36) return "$"+write_num_flt(type,fmt.substr(fmt.charAt(1)==' '?2:1),val); var o; var r/*:?Array<string>*/, ri, ff, aval = Math.abs(val), sign = val < 0 ? "-" : ""; if(fmt.match(/^00+$/)) return sign + pad0r(aval,fmt.length); if(fmt.match(/^[#?]+$/)) { o = pad0r(val,0); if(o === "0") o = ""; return o.length > fmt.length ? o : hashq(fmt.substr(0,fmt.length-o.length)) + o; } if((r = fmt.match(frac1))) return write_num_f1(r, aval, sign); if(fmt.match(/^#+0+$/)) return sign + pad0r(aval,fmt.length - fmt.indexOf("0")); if((r = fmt.match(dec1))) { o = rnd(val, r[1].length).replace(/^([^\.]+)$/,"$1."+hashq(r[1])).replace(/\.$/,"."+hashq(r[1])).replace(/\.(\d*)$/,function($$, $1) { return "." + $1 + fill("0", hashq(/*::(*/r/*::||[""])*/[1]).length-$1.length); }); return fmt.indexOf("0.") !== -1 ? o : o.replace(/^0\./,"."); } fmt = fmt.replace(/^#+([0.])/, "$1"); if((r = fmt.match(/^(0*)\.(#*)$/))) { return sign + rnd(aval, r[2].length).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,r[1].length?"0.":"."); } if((r = fmt.match(/^#{1,3},##0(\.?)$/))) return sign + commaify(pad0r(aval,0)); if((r = fmt.match(/^#,##0\.([#0]*0)$/))) { return val < 0 ? "-" + write_num_flt(type, fmt, -val) : commaify(""+(Math.floor(val) + carry(val, r[1].length))) + "." + pad0(dec(val, r[1].length),r[1].length); } if((r = fmt.match(/^#,#*,#0/))) return write_num_flt(type,fmt.replace(/^#,#*,/,""),val); if((r = fmt.match(/^([0#]+)(\\?-([0#]+))+$/))) { o = _strrev(write_num_flt(type, fmt.replace(/[\\-]/g,""), val)); ri = 0; return _strrev(_strrev(fmt.replace(/\\/g,"")).replace(/[0#]/g,function(x){return ri<o.length?o.charAt(ri++):x==='0'?'0':"";})); } if(fmt.match(phone)) { o = write_num_flt(type, "##########", val); return "(" + o.substr(0,3) + ") " + o.substr(3, 3) + "-" + o.substr(6); } var oa = ""; if((r = fmt.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))) { ri = Math.min(/*::String(*/r[4]/*::)*/.length,7); ff = SSF_frac(aval, Math.pow(10,ri)-1, false); o = "" + sign; oa = write_num("n", /*::String(*/r[1]/*::)*/, ff[1]); if(oa.charAt(oa.length-1) == " ") oa = oa.substr(0,oa.length-1) + "0"; o += oa + /*::String(*/r[2]/*::)*/ + "/" + /*::String(*/r[3]/*::)*/; oa = rpad_(ff[2],ri); if(oa.length < r[4].length) oa = hashq(r[4].substr(r[4].length-oa.length)) + oa; o += oa; return o; } if((r = fmt.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))) { ri = Math.min(Math.max(r[1].length, r[4].length),7); ff = SSF_frac(aval, Math.pow(10,ri)-1, true); return sign + (ff[0]||(ff[1] ? "" : "0")) + " " + (ff[1] ? pad_(ff[1],ri) + r[2] + "/" + r[3] + rpad_(ff[2],ri): fill(" ", 2*ri+1 + r[2].length + r[3].length)); } if((r = fmt.match(/^[#0?]+$/))) { o = pad0r(val, 0); if(fmt.length <= o.length) return o; return hashq(fmt.substr(0,fmt.length-o.length)) + o; } if((r = fmt.match(/^([#0?]+)\.([#0]+)$/))) { o = "" + val.toFixed(Math.min(r[2].length,10)).replace(/([^0])0+$/,"$1"); ri = o.indexOf("."); var lres = fmt.indexOf(".") - ri, rres = fmt.length - o.length - lres; return hashq(fmt.substr(0,lres) + o + fmt.substr(fmt.length-rres)); } if((r = fmt.match(/^00,000\.([#0]*0)$/))) { ri = dec(val, r[1].length); return val < 0 ? "-" + write_num_flt(type, fmt, -val) : commaify(flr(val)).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,function($$) { return "00," + ($$.length < 3 ? pad0(0,3-$$.length) : "") + $$; }) + "." + pad0(ri,r[1].length); } switch(fmt) { case "###,##0.00": return write_num_flt(type, "#,##0.00", val); case "###,###": case "##,###": case "#,###": var x = commaify(pad0r(aval,0)); return x !== "0" ? sign + x : ""; case "###,###.00": return write_num_flt(type, "###,##0.00",val).replace(/^0\./,"."); case "#,###.00": return write_num_flt(type, "#,##0.00",val).replace(/^0\./,"."); default: } throw new Error("unsupported format |" + fmt + "|"); } function write_num_cm2(type/*:string*/, fmt/*:string*/, val/*:number*/)/*:string*/{ var idx = fmt.length - 1; while(fmt.charCodeAt(idx-1) === 44) --idx; return write_num(type, fmt.substr(0,idx), val / Math.pow(10,3*(fmt.length-idx))); } function write_num_pct2(type/*:string*/, fmt/*:string*/, val/*:number*/)/*:string*/{ var sfmt = fmt.replace(pct1,""), mul = fmt.length - sfmt.length; return write_num(type, sfmt, val * Math.pow(10,2*mul)) + fill("%",mul); } function write_num_exp2(fmt/*:string*/, val/*:number*/)/*:string*/{ var o/*:string*/; var idx = fmt.indexOf("E") - fmt.indexOf(".") - 1; if(fmt.match(/^#+0.0E\+0$/)) { if(val == 0) return "0.0E+0"; else if(val < 0) return "-" + write_num_exp2(fmt, -val); var period = fmt.indexOf("."); if(period === -1) period=fmt.indexOf('E'); var ee = Math.floor(Math.log(val)*Math.LOG10E)%period; if(ee < 0) ee += period; o = (val/Math.pow(10,ee)).toPrecision(idx+1+(period+ee)%period); if(!o.match(/[Ee]/)) { var fakee = Math.floor(Math.log(val)*Math.LOG10E); if(o.indexOf(".") === -1) o = o.charAt(0) + "." + o.substr(1) + "E+" + (fakee - o.length+ee); else o += "E+" + (fakee - ee); o = o.replace(/\+-/,"-"); } o = o.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function($$,$1,$2,$3) { return $1 + $2 + $3.substr(0,(period+ee)%period) + "." + $3.substr(ee) + "E"; }); } else o = val.toExponential(idx); if(fmt.match(/E\+00$/) && o.match(/e[+-]\d$/)) o = o.substr(0,o.length-1) + "0" + o.charAt(o.length-1); if(fmt.match(/E\-/) && o.match(/e\+/)) o = o.replace(/e\+/,"e"); return o.replace("e","E"); } function write_num_int(type/*:string*/, fmt/*:string*/, val/*:number*/)/*:string*/ { if(type.charCodeAt(0) === 40 && !fmt.match(closeparen)) { var ffmt = fmt.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,""); if(val >= 0) return write_num_int('n', ffmt, val); return '(' + write_num_int('n', ffmt, -val) + ')'; } if(fmt.charCodeAt(fmt.length - 1) === 44) return write_num_cm2(type, fmt, val); if(fmt.indexOf('%') !== -1) return write_num_pct2(type, fmt, val); if(fmt.indexOf('E') !== -1) return write_num_exp2(fmt, val); if(fmt.charCodeAt(0) === 36) return "$"+write_num_int(type,fmt.substr(fmt.charAt(1)==' '?2:1),val); var o; var r/*:?Array<string>*/, ri, ff, aval = Math.abs(val), sign = val < 0 ? "-" : ""; if(fmt.match(/^00+$/)) return sign + pad0(aval,fmt.length); if(fmt.match(/^[#?]+$/)) { o = (""+val); if(val === 0) o = ""; return o.length > fmt.length ? o : hashq(fmt.substr(0,fmt.length-o.length)) + o; } if((r = fmt.match(frac1))) return write_num_f2(r, aval, sign); if(fmt.match(/^#+0+$/)) return sign + pad0(aval,fmt.length - fmt.indexOf("0")); if((r = fmt.match(dec1))) { /*:: if(!Array.isArray(r)) throw new Error("unreachable"); */ o = (""+val).replace(/^([^\.]+)$/,"$1."+hashq(r[1])).replace(/\.$/,"."+hashq(r[1])); o = o.replace(/\.(\d*)$/,function($$, $1) { /*:: if(!Array.isArray(r)) throw new Error("unreachable"); */ return "." + $1 + fill("0", hashq(r[1]).length-$1.length); }); return fmt.indexOf("0.") !== -1 ? o : o.replace(/^0\./,"."); } fmt = fmt.replace(/^#+([0.])/, "$1"); if((r = fmt.match(/^(0*)\.(#*)$/))) { return sign + (""+aval).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,r[1].length?"0.":"."); } if((r = fmt.match(/^#{1,3},##0(\.?)$/))) return sign + commaify((""+aval)); if((r = fmt.match(/^#,##0\.([#0]*0)$/))) { return val < 0 ? "-" + write_num_int(type, fmt, -val) : commaify((""+val)) + "." + fill('0',r[1].length); } if((r = fmt.match(/^#,#*,#0/))) return write_num_int(type,fmt.replace(/^#,#*,/,""),val); if((r = fmt.match(/^([0#]+)(\\?-([0#]+))+$/))) { o = _strrev(write_num_int(type, fmt.replace(/[\\-]/g,""), val)); ri = 0; return _strrev(_strrev(fmt.replace(/\\/g,"")).replace(/[0#]/g,function(x){return ri<o.length?o.charAt(ri++):x==='0'?'0':"";})); } if(fmt.match(phone)) { o = write_num_int(type, "##########", val); return "(" + o.substr(0,3) + ") " + o.substr(3, 3) + "-" + o.substr(6); } var oa = ""; if((r = fmt.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))) { ri = Math.min(/*::String(*/r[4]/*::)*/.length,7); ff = SSF_frac(aval, Math.pow(10,ri)-1, false); o = "" + sign; oa = write_num("n", /*::String(*/r[1]/*::)*/, ff[1]); if(oa.charAt(oa.length-1) == " ") oa = oa.substr(0,oa.length-1) + "0"; o += oa + /*::String(*/r[2]/*::)*/ + "/" + /*::String(*/r[3]/*::)*/; oa = rpad_(ff[2],ri); if(oa.length < r[4].length) oa = hashq(r[4].substr(r[4].length-oa.length)) + oa; o += oa; return o; } if((r = fmt.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))) { ri = Math.min(Math.max(r[1].length, r[4].length),7); ff = SSF_frac(aval, Math.pow(10,ri)-1, true); return sign + (ff[0]||(ff[1] ? "" : "0")) + " " + (ff[1] ? pad_(ff[1],ri) + r[2] + "/" + r[3] + rpad_(ff[2],ri): fill(" ", 2*ri+1 + r[2].length + r[3].length)); } if((r = fmt.match(/^[#0?]+$/))) { o = "" + val; if(fmt.length <= o.length) return o; return hashq(fmt.substr(0,fmt.length-o.length)) + o; } if((r = fmt.match(/^([#0]+)\.([#0]+)$/))) { o = "" + val.toFixed(Math.min(r[2].length,10)).replace(/([^0])0+$/,"$1"); ri = o.indexOf("."); var lres = fmt.indexOf(".") - ri, rres = fmt.length - o.length - lres; return hashq(fmt.substr(0,lres) + o + fmt.substr(fmt.length-rres)); } if((r = fmt.match(/^00,000\.([#0]*0)$/))) { return val < 0 ? "-" + write_num_int(type, fmt, -val) : commaify(""+val).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,function($$) { return "00," + ($$.length < 3 ? pad0(0,3-$$.length) : "") + $$; }) + "." + pad0(0,r[1].length); } switch(fmt) { case "###,###": case "##,###": case "#,###": var x = commaify(""+aval); return x !== "0" ? sign + x : ""; default: if(fmt.match(/\.[0#?]*$/)) return write_num_int(type, fmt.slice(0,fmt.lastIndexOf(".")), val) + hashq(fmt.slice(fmt.lastIndexOf("."))); } throw new Error("unsupported format |" + fmt + "|"); } function write_num(type/*:string*/, fmt/*:string*/, val/*:number*/)/*:string*/ { return (val|0) === val ? write_num_int(type, fmt, val) : write_num_flt(type, fmt, val); } function SSF_split_fmt(fmt/*:string*/)/*:Array<string>*/ { var out/*:Array<string>*/ = []; var in_str = false/*, cc*/; for(var i = 0, j = 0; i < fmt.length; ++i) switch((/*cc=*/fmt.charCodeAt(i))) { case 34: /* '"' */ in_str = !in_str; break; case 95: case 42: case 92: /* '_' '*' '\\' */ ++i; break; case 59: /* ';' */ out[out.length] = fmt.substr(j,i-j); j = i+1; } out[out.length] = fmt.substr(j); if(in_str === true) throw new Error("Format |" + fmt + "| unterminated string "); return out; } var SSF_abstime = /\[[HhMmSs\u0E0A\u0E19\u0E17]*\]/; function fmt_is_date(fmt/*:string*/)/*:boolean*/ { var i = 0, /*cc = 0,*/ c = "", o = ""; while(i < fmt.length) { switch((c = fmt.charAt(i))) { case 'G': if(SSF_isgeneral(fmt, i)) i+= 6; i++; break; case '"': for(;(/*cc=*/fmt.charCodeAt(++i)) !== 34 && i < fmt.length;){/*empty*/} ++i; break; case '\\': i+=2; break; case '_': i+=2; break; case '@': ++i; break; case 'B': case 'b': if(fmt.charAt(i+1) === "1" || fmt.charAt(i+1) === "2") return true; /* falls through */ case 'M': case 'D': case 'Y': case 'H': case 'S': case 'E': /* falls through */ case 'm': case 'd': case 'y': case 'h': case 's': case 'e': case 'g': return true; case 'A': case 'a': case '上': if(fmt.substr(i, 3).toUpperCase() === "A/P") return true; if(fmt.substr(i, 5).toUpperCase() === "AM/PM") return true; if(fmt.substr(i, 5).toUpperCase() === "上午/下午") return true; ++i; break; case '[': o = c; while(fmt.charAt(i++) !== ']' && i < fmt.length) o += fmt.charAt(i); if(o.match(SSF_abstime)) return true; break; case '.': /* falls through */ case '0': case '#': while(i < fmt.length && ("0#?.,E+-%".indexOf(c=fmt.charAt(++i)) > -1 || (c=='\\' && fmt.charAt(i+1) == "-" && "0#".indexOf(fmt.charAt(i+2))>-1))){/* empty */} break; case '?': while(fmt.charAt(++i) === c){/* empty */} break; case '*': ++i; if(fmt.charAt(i) == ' ' || fmt.charAt(i) == '*') ++i; break; case '(': case ')': ++i; break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': while(i < fmt.length && "0123456789".indexOf(fmt.charAt(++i)) > -1){/* empty */} break; case ' ': ++i; break; default: ++i; break; } } return false; } function eval_fmt(fmt/*:string*/, v/*:any*/, opts/*:any*/, flen/*:number*/) { var out = [], o = "", i = 0, c = "", lst='t', dt, j, cc; var hr='H'; /* Tokenize */ while(i < fmt.length) { switch((c = fmt.charAt(i))) { case 'G': /* General */ if(!SSF_isgeneral(fmt, i)) throw new Error('unrecognized character ' + c + ' in ' +fmt); out[out.length] = {t:'G', v:'General'}; i+=7; break; case '"': /* Literal text */ for(o="";(cc=fmt.charCodeAt(++i)) !== 34 && i < fmt.length;) o += String.fromCharCode(cc); out[out.length] = {t:'t', v:o}; ++i; break; case '\\': var w = fmt.charAt(++i), t = (w === "(" || w === ")") ? w : 't'; out[out.length] = {t:t, v:w}; ++i; break; case '_': out[out.length] = {t:'t', v:" "}; i+=2; break; case '@': /* Text Placeholder */ out[out.length] = {t:'T', v:v}; ++i; break; case 'B': case 'b': if(fmt.charAt(i+1) === "1" || fmt.charAt(i+1) === "2") { if(dt==null) { dt=SSF_parse_date_code(v, opts, fmt.charAt(i+1) === "2"); if(dt==null) return ""; } out[out.length] = {t:'X', v:fmt.substr(i,2)}; lst = c; i+=2; break; } /* falls through */ case 'M': case 'D': case 'Y': case 'H': case 'S': case 'E': c = c.toLowerCase(); /* falls through */ case 'm': case 'd': case 'y': case 'h': case 's': case 'e': case 'g': if(v < 0) return ""; if(dt==null) { dt=SSF_parse_date_code(v, opts); if(dt==null) return ""; } o = c; while(++i < fmt.length && fmt.charAt(i).toLowerCase() === c) o+=c; if(c === 'm' && lst.toLowerCase() === 'h') c = 'M'; if(c === 'h') c = hr; out[out.length] = {t:c, v:o}; lst = c; break; case 'A': case 'a': case '上': var q={t:c, v:c}; if(dt==null) dt=SSF_parse_date_code(v, opts); if(fmt.substr(i, 3).toUpperCase() === "A/P") { if(dt!=null) q.v = dt.H >= 12 ? "P" : "A"; q.t = 'T'; hr='h';i+=3;} else if(fmt.substr(i,5).toUpperCase() === "AM/PM") { if(dt!=null) q.v = dt.H >= 12 ? "PM" : "AM"; q.t = 'T'; i+=5; hr='h'; } else if(fmt.substr(i,5).toUpperCase() === "上午/下午") { if(dt!=null) q.v = dt.H >= 12 ? "下午" : "上午"; q.t = 'T'; i+=5; hr='h'; } else { q.t = "t"; ++i; } if(dt==null && q.t === 'T') return ""; out[out.length] = q; lst = c; break; case '[': o = c; while(fmt.charAt(i++) !== ']' && i < fmt.length) o += fmt.charAt(i); if(o.slice(-1) !== ']') throw 'unterminated "[" block: |' + o + '|'; if(o.match(SSF_abstime)) { if(dt==null) { dt=SSF_parse_date_code(v, opts); if(dt==null) return ""; } out[out.length] = {t:'Z', v:o.toLowerCase()}; lst = o.charAt(1); } else if(o.indexOf("$") > -1) { o = (o.match(/\$([^-\[\]]*)/)||[])[1]||"$"; if(!fmt_is_date(fmt)) out[out.length] = {t:'t',v:o}; } break; /* Numbers */ case '.': if(dt != null) { o = c; while(++i < fmt.length && (c=fmt.charAt(i)) === "0") o += c; out[out.length] = {t:'s', v:o}; break; } /* falls through */ case '0': case '#': o = c; while(++i < fmt.length && "0#?.,E+-%".indexOf(c=fmt.charAt(i)) > -1) o += c; out[out.length] = {t:'n', v:o}; break; case '?': o = c; while(fmt.charAt(++i) === c) o+=c; out[out.length] = {t:c, v:o}; lst = c; break; case '*': ++i; if(fmt.charAt(i) == ' ' || fmt.charAt(i) == '*') ++i; break; // ** case '(': case ')': out[out.length] = {t:(flen===1?'t':c), v:c}; ++i; break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': o = c; while(i < fmt.length && "0123456789".indexOf(fmt.charAt(++i)) > -1) o+=fmt.charAt(i); out[out.length] = {t:'D', v:o}; break; case ' ': out[out.length] = {t:c, v:c}; ++i; break; case '$': out[out.length] = {t:'t', v:'$'}; ++i; break; default: if(",$-+/():!^&'~{}<>=€acfijklopqrtuvwxzP".indexOf(c) === -1) throw new Error('unrecognized character ' + c + ' in ' + fmt); out[out.length] = {t:'t', v:c}; ++i; break; } } /* Scan for date/time parts */ var bt = 0, ss0 = 0, ssm; for(i=out.length-1, lst='t'; i >= 0; --i) { switch(out[i].t) { case 'h': case 'H': out[i].t = hr; lst='h'; if(bt < 1) bt = 1; break; case 's': if((ssm=out[i].v.match(/\.0+$/))) ss0=Math.max(ss0,ssm[0].length-1); if(bt < 3) bt = 3; /* falls through */ case 'd': case 'y': case 'M': case 'e': lst=out[i].t; break; case 'm': if(lst === 's') { out[i].t = 'M'; if(bt < 2) bt = 2; } break; case 'X': /*if(out[i].v === "B2");*/ break; case 'Z': if(bt < 1 && out[i].v.match(/[Hh]/)) bt = 1; if(bt < 2 && out[i].v.match(/[Mm]/)) bt = 2; if(bt < 3 && out[i].v.match(/[Ss]/)) bt = 3; } } /* time rounding depends on presence of minute / second / usec fields */ switch(bt) { case 0: break; case 1: /*::if(!dt) break;*/ if(dt.u >= 0.5) { dt.u = 0; ++dt.S; } if(dt.S >= 60) { dt.S = 0; ++dt.M; } if(dt.M >= 60) { dt.M = 0; ++dt.H; } break; case 2: /*::if(!dt) break;*/ if(dt.u >= 0.5) { dt.u = 0; ++dt.S; } if(dt.S >= 60) { dt.S = 0; ++dt.M; } break; } /* replace fields */ var nstr = "", jj; for(i=0; i < out.length; ++i) { switch(out[i].t) { case 't': case 'T': case ' ': case 'D': break; case 'X': out[i].v = ""; out[i].t = ";"; break; case 'd': case 'm': case 'y': case 'h': case 'H': case 'M': case 's': case 'e': case 'b': case 'Z': /*::if(!dt) throw "unreachable"; */ out[i].v = SSF_write_date(out[i].t.charCodeAt(0), out[i].v, dt, ss0); out[i].t = 't'; break; case 'n': case '?': jj = i+1; while(out[jj] != null && ( (c=out[jj].t) === "?" || c === "D" || ((c === " " || c === "t") && out[jj+1] != null && (out[jj+1].t === '?' || out[jj+1].t === "t" && out[jj+1].v === '/')) || (out[i].t === '(' && (c === ' ' || c === 'n' || c === ')')) || (c === 't' && (out[jj].v === '/' || out[jj].v === ' ' && out[jj+1] != null && out[jj+1].t == '?')) )) { out[i].v += out[jj].v; out[jj] = {v:"", t:";"}; ++jj; } nstr += out[i].v; i = jj-1; break; case 'G': out[i].t = 't'; out[i].v = SSF_general(v,opts); break; } } var vv = "", myv, ostr; if(nstr.length > 0) { if(nstr.charCodeAt(0) == 40) /* '(' */ { myv = (v<0&&nstr.charCodeAt(0) === 45 ? -v : v); ostr = write_num('n', nstr, myv); } else { myv = (v<0 && flen > 1 ? -v : v); ostr = write_num('n', nstr, myv); if(myv < 0 && out[0] && out[0].t == 't') { ostr = ostr.substr(1); out[0].v = "-" + out[0].v; } } jj=ostr.length-1; var decpt = out.length; for(i=0; i < out.length; ++i) if(out[i] != null && out[i].t != 't' && out[i].v.indexOf(".") > -1) { decpt = i; break; } var lasti=out.length; if(decpt === out.length && ostr.indexOf("E") === -1) { for(i=out.length-1; i>= 0;--i) { if(out[i] == null || 'n?'.indexOf(out[i].t) === -1) continue; if(jj>=out[i].v.length-1) { jj -= out[i].v.length; out[i].v = ostr.substr(jj+1, out[i].v.length); } else if(jj < 0) out[i].v = ""; else { out[i].v = ostr.substr(0, jj+1); jj = -1; } out[i].t = 't'; lasti = i; } if(jj>=0 && lasti<out.length) out[lasti].v = ostr.substr(0,jj+1) + out[lasti].v; } else if(decpt !== out.length && ostr.indexOf("E") === -1) { jj = ostr.indexOf(".")-1; for(i=decpt; i>= 0; --i) { if(out[i] == null || 'n?'.indexOf(out[i].t) === -1) continue; j=out[i].v.indexOf(".")>-1&&i===decpt?out[i].v.indexOf(".")-1:out[i].v.length-1; vv = out[i].v.substr(j+1); for(; j>=0; --j) { if(jj>=0 && (out[i].v.charAt(j) === "0" || out[i].v.charAt(j) === "#")) vv = ostr.charAt(jj--) + vv; } out[i].v = vv; out[i].t = 't'; lasti = i; } if(jj>=0 && lasti<out.length) out[lasti].v = ostr.substr(0,jj+1) + out[lasti].v; jj = ostr.indexOf(".")+1; for(i=decpt; i<out.length; ++i) { if(out[i] == null || ('n?('.indexOf(out[i].t) === -1 && i !== decpt)) continue; j=out[i].v.indexOf(".")>-1&&i===decpt?out[i].v.indexOf(".")+1:0; vv = out[i].v.substr(0,j); for(; j<out[i].v.length; ++j) { if(jj<ostr.length) vv += ostr.charAt(jj++); } out[i].v = vv; out[i].t = 't'; lasti = i; } } } for(i=0; i<out.length; ++i) if(out[i] != null && 'n?'.indexOf(out[i].t)>-1) { myv = (flen >1 && v < 0 && i>0 && out[i-1].v === "-" ? -v:v); out[i].v = write_num(out[i].t, out[i].v, myv); out[i].t = 't'; } var retval = ""; for(i=0; i !== out.length; ++i) if(out[i] != null) retval += out[i].v; return retval; } var cfregex2 = /\[(=|>[=]?|<[>=]?)(-?\d+(?:\.\d*)?)\]/; function chkcond(v, rr) { if(rr == null) return false; var thresh = parseFloat(rr[2]); switch(rr[1]) { case "=": if(v == thresh) return true; break; case ">": if(v > thresh) return true; break; case "<": if(v < thresh) return true; break; case "<>": if(v != thresh) return true; break; case ">=": if(v >= thresh) return true; break; case "<=": if(v <= thresh) return true; break; } return false; } function choose_fmt(f/*:string*/, v/*:any*/) { var fmt = SSF_split_fmt(f); var l = fmt.length, lat = fmt[l-1].indexOf("@"); if(l<4 && lat>-1) --l; if(fmt.length > 4) throw new Error("cannot find right format for |" + fmt.join("|") + "|"); if(typeof v !== "number") return [4, fmt.length === 4 || lat>-1?fmt[fmt.length-1]:"@"]; switch(fmt.length) { case 1: fmt = lat>-1 ? ["General", "General", "General", fmt[0]] : [fmt[0], fmt[0], fmt[0], "@"]; break; case 2: fmt = lat>-1 ? [fmt[0], fmt[0], fmt[0], fmt[1]] : [fmt[0], fmt[1], fmt[0], "@"]; break; case 3: fmt = lat>-1 ? [fmt[0], fmt[1], fmt[0], fmt[2]] : [fmt[0], fmt[1], fmt[2], "@"]; break; case 4: break; } var ff = v > 0 ? fmt[0] : v < 0 ? fmt[1] : fmt[2]; if(fmt[0].indexOf("[") === -1 && fmt[1].indexOf("[") === -1) return [l, ff]; if(fmt[0].match(/\[[=<>]/) != null || fmt[1].match(/\[[=<>]/) != null) { var m1 = fmt[0].match(cfregex2); var m2 = fmt[1].match(cfregex2); return chkcond(v, m1) ? [l, fmt[0]] : chkcond(v, m2) ? [l, fmt[1]] : [l, fmt[m1 != null && m2 != null ? 2 : 1]]; } return [l, ff]; } function SSF_format(fmt/*:string|number*/,v/*:any*/,o/*:?any*/) { if(o == null) o = {}; var sfmt = ""; switch(typeof fmt) { case "string": if(fmt == "m/d/yy" && o.dateNF) sfmt = o.dateNF; else sfmt = fmt; break; case "number": if(fmt == 14 && o.dateNF) sfmt = o.dateNF; else sfmt = (o.table != null ? (o.table/*:any*/) : table_fmt)[fmt]; if(sfmt == null) sfmt = (o.table && o.table[SSF_default_map[fmt]]) || table_fmt[SSF_default_map[fmt]]; if(sfmt == null) sfmt = SSF_default_str[fmt] || "General"; break; } if(SSF_isgeneral(sfmt,0)) return SSF_general(v, o); if(v instanceof Date) v = datenum_local(v, o.date1904); var f = choose_fmt(sfmt, v); if(SSF_isgeneral(f[1])) return SSF_general(v, o); if(v === true) v = "TRUE"; else if(v === false) v = "FALSE"; else if(v === "" || v == null) return ""; return eval_fmt(f[1], v, o, f[0]); } function SSF_load(fmt/*:string*/, idx/*:?number*/)/*:number*/ { if(typeof idx != 'number') { idx = +idx || -1; /*::if(typeof idx != 'number') return 0x188; */ for(var i = 0; i < 0x0188; ++i) { /*::if(typeof idx != 'number') return 0x188; */ if(table_fmt[i] == undefined) { if(idx < 0) idx = i; continue; } if(table_fmt[i] == fmt) { idx = i; break; } } /*::if(typeof idx != 'number') return 0x188; */ if(idx < 0) idx = 0x187; } /*::if(typeof idx != 'number') return 0x188; */ table_fmt[idx] = fmt; return idx; } function SSF_load_table(tbl/*:SSFTable*/)/*:void*/ { for(var i=0; i!=0x0188; ++i) if(tbl[i] !== undefined) SSF_load(tbl[i], i); } function make_ssf() { table_fmt = SSF_init_table(); } var SSF = { format: SSF_format, load: SSF_load, _table: table_fmt, load_table: SSF_load_table, parse_date_code: SSF_parse_date_code, is_date: fmt_is_date, get_table: function get_table() { return SSF._table = table_fmt; } }; var SSFImplicit/*{[number]:string}*/ = ({ "5": '"$"#,##0_);\\("$"#,##0\\)', "6": '"$"#,##0_);[Red]\\("$"#,##0\\)', "7": '"$"#,##0.00_);\\("$"#,##0.00\\)', "8": '"$"#,##0.00_);[Red]\\("$"#,##0.00\\)', "23": 'General', "24": 'General', "25": 'General', "26": 'General', "27": 'm/d/yy', "28": 'm/d/yy', "29": 'm/d/yy', "30": 'm/d/yy', "31": 'm/d/yy', "32": 'h:mm:ss', "33": 'h:mm:ss', "34": 'h:mm:ss', "35": 'h:mm:ss', "36": 'm/d/yy', "41": '_(* #,##0_);_(* \(#,##0\);_(* "-"_);_(@_)', "42": '_("$"* #,##0_);_("$"* \(#,##0\);_("$"* "-"_);_(@_)', "43": '_(* #,##0.00_);_(* \(#,##0.00\);_(* "-"??_);_(@_)', "44": '_("$"* #,##0.00_);_("$"* \(#,##0.00\);_("$"* "-"??_);_(@_)', "50": 'm/d/yy', "51": 'm/d/yy', "52": 'm/d/yy', "53": 'm/d/yy', "54": 'm/d/yy', "55": 'm/d/yy', "56": 'm/d/yy', "57": 'm/d/yy', "58": 'm/d/yy', "59": '0', "60": '0.00', "61": '#,##0', "62": '#,##0.00', "63": '"$"#,##0_);\\("$"#,##0\\)', "64": '"$"#,##0_);[Red]\\("$"#,##0\\)', "65": '"$"#,##0.00_);\\("$"#,##0.00\\)', "66": '"$"#,##0.00_);[Red]\\("$"#,##0.00\\)', "67": '0%', "68": '0.00%', "69": '# ?/?', "70": '# ??/??', "71": 'm/d/yy', "72": 'm/d/yy', "73": 'd-mmm-yy', "74": 'd-mmm', "75": 'mmm-yy', "76": 'h:mm', "77": 'h:mm:ss', "78": 'm/d/yy h:mm', "79": 'mm:ss', "80": '[h]:mm:ss', "81": 'mmss.0' }/*:any*/); /* dateNF parse TODO: move to SSF */ var dateNFregex = /[dD]+|[mM]+|[yYeE]+|[Hh]+|[Ss]+/g; function dateNF_regex(dateNF/*:string|number*/)/*:RegExp*/ { var fmt = typeof dateNF == "number" ? table_fmt[dateNF] : dateNF; fmt = fmt.replace(dateNFregex, "(\\d+)"); return new RegExp("^" + fmt + "$"); } function dateNF_fix(str/*:string*/, dateNF/*:string*/, match/*:Array<string>*/)/*:string*/ { var Y = -1, m = -1, d = -1, H = -1, M = -1, S = -1; (dateNF.match(dateNFregex)||[]).forEach(function(n, i) { var v = parseInt(match[i+1], 10); switch(n.toLowerCase().charAt(0)) { case 'y': Y = v; break; case 'd': d = v; break; case 'h': H = v; break; case 's': S = v; break; case 'm': if(H >= 0) M = v; else m = v; break; } }); if(S >= 0 && M == -1 && m >= 0) { M = m; m = -1; } var datestr = (("" + (Y>=0?Y: new Date().getFullYear())).slice(-4) + "-" + ("00" + (m>=1?m:1)).slice(-2) + "-" + ("00" + (d>=1?d:1)).slice(-2)); if(datestr.length == 7) datestr = "0" + datestr; if(datestr.length == 8) datestr = "20" + datestr; var timestr = (("00" + (H>=0?H:0)).slice(-2) + ":" + ("00" + (M>=0?M:0)).slice(-2) + ":" + ("00" + (S>=0?S:0)).slice(-2)); if(H == -1 && M == -1 && S == -1) return datestr; if(Y == -1 && m == -1 && d == -1) return timestr; return datestr + "T" + timestr; } /*:: declare var ReadShift:any; declare var CheckField:any; declare var prep_blob:any; declare var __readUInt32LE:any; declare var __readInt32LE:any; declare var __toBuffer:any; declare var __utf16le:any; declare var bconcat:any; declare var s2a:any; declare var chr0:any; declare var chr1:any; declare var has_buf:boolean; declare var new_buf:any; declare var new_raw_buf:any; declare var new_unsafe_buf:any; declare var Buffer_from:any; */ /* cfb.js (C) 2013-present SheetJS -- http://sheetjs.com */ /* vim: set ts=2: */ /*jshint eqnull:true */ /*exported CFB */ /*global Uint8Array:false, Uint16Array:false */ /*:: type SectorEntry = { name?:string; nodes?:Array<number>; data:RawBytes; }; type SectorList = { [k:string|number]:SectorEntry; name:?string; fat_addrs:Array<number>; ssz:number; } type CFBFiles = {[n:string]:CFBEntry}; */ /* crc32.js (C) 2014-present SheetJS -- http://sheetjs.com */ /* vim: set ts=2: */ /*exported CRC32 */ var CRC32 = /*#__PURE__*/(function() { var CRC32 = {}; CRC32.version = '1.2.0'; /* see perf/crc32table.js */ /*global Int32Array */ function signed_crc_table()/*:any*/ { var c = 0, table/*:Array<number>*/ = new Array(256); for(var n =0; n != 256; ++n){ c = n; c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1)); c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1)); c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1)); c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1)); c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1)); c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1)); c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1)); c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1)); table[n] = c; } return typeof Int32Array !== 'undefined' ? new Int32Array(table) : table; } var T0 = signed_crc_table(); function slice_by_16_tables(T) { var c = 0, v = 0, n = 0, table/*:Array<number>*/ = typeof Int32Array !== 'undefined' ? new Int32Array(4096) : new Array(4096) ; for(n = 0; n != 256; ++n) table[n] = T[n]; for(n = 0; n != 256; ++n) { v = T[n]; for(c = 256 + n; c < 4096; c += 256) v = table[c] = (v >>> 8) ^ T[v & 0xFF]; } var out = []; for(n = 1; n != 16; ++n) out[n - 1] = typeof Int32Array !== 'undefined' ? table.subarray(n * 256, n * 256 + 256) : table.slice(n * 256, n * 256 + 256); return out; } var TT = slice_by_16_tables(T0); var T1 = TT[0], T2 = TT[1], T3 = TT[2], T4 = TT[3], T5 = TT[4]; var T6 = TT[5], T7 = TT[6], T8 = TT[7], T9 = TT[8], Ta = TT[9]; var Tb = TT[10], Tc = TT[11], Td = TT[12], Te = TT[13], Tf = TT[14]; function crc32_bstr(bstr/*:string*/, seed/*:number*/)/*:number*/ { var C = seed/*:: ? 0 : 0 */ ^ -1; for(var i = 0, L = bstr.length; i < L;) C = (C>>>8) ^ T0[(C^bstr.charCodeAt(i++))&0xFF]; return ~C; } function crc32_buf(B/*:Uint8Array|Array<number>*/, seed/*:number*/)/*:number*/ { var C = seed/*:: ? 0 : 0 */ ^ -1, L = B.length - 15, i = 0; for(; i < L;) C = Tf[B[i++] ^ (C & 255)] ^ Te[B[i++] ^ ((C >> 8) & 255)] ^ Td[B[i++] ^ ((C >> 16) & 255)] ^ Tc[B[i++] ^ (C >>> 24)] ^ Tb[B[i++]] ^ Ta[B[i++]] ^ T9[B[i++]] ^ T8[B[i++]] ^ T7[B[i++]] ^ T6[B[i++]] ^ T5[B[i++]] ^ T4[B[i++]] ^ T3[B[i++]] ^ T2[B[i++]] ^ T1[B[i++]] ^ T0[B[i++]]; L += 15; while(i < L) C = (C>>>8) ^ T0[(C^B[i++])&0xFF]; return ~C; } function crc32_str(str/*:string*/, seed/*:number*/)/*:number*/ { var C = seed ^ -1; for(var i = 0, L = str.length, c = 0, d = 0; i < L;) { c = str.charCodeAt(i++); if(c < 0x80) { C = (C>>>8) ^ T0[(C^c)&0xFF]; } else if(c < 0x800) { C = (C>>>8) ^ T0[(C ^ (192|((c>>6)&31)))&0xFF]; C = (C>>>8) ^ T0[(C ^ (128|(c&63)))&0xFF]; } else if(c >= 0xD800 && c < 0xE000) { c = (c&1023)+64; d = str.charCodeAt(i++)&1023; C = (C>>>8) ^ T0[(C ^ (240|((c>>8)&7)))&0xFF]; C = (C>>>8) ^ T0[(C ^ (128|((c>>2)&63)))&0xFF]; C = (C>>>8) ^ T0[(C ^ (128|((d>>6)&15)|((c&3)<<4)))&0xFF]; C = (C>>>8) ^ T0[(C ^ (128|(d&63)))&0xFF]; } else { C = (C>>>8) ^ T0[(C ^ (224|((c>>12)&15)))&0xFF]; C = (C>>>8) ^ T0[(C ^ (128|((c>>6)&63)))&0xFF]; C = (C>>>8) ^ T0[(C ^ (128|(c&63)))&0xFF]; } } return ~C; } CRC32.table = T0; CRC32.bstr = crc32_bstr; CRC32.buf = crc32_buf; CRC32.str = crc32_str; return CRC32; })(); /* [MS-CFB] v20171201 */ var CFB = /*#__PURE__*/(function _CFB(){ var exports = {}; exports.version = '1.2.1'; /* [MS-CFB] 2.6.4 */ function namecmp(l/*:string*/, r/*:string*/)/*:number*/ { var L = l.split("/"), R = r.split("/"); for(var i = 0, c = 0, Z = Math.min(L.length, R.length); i < Z; ++i) { if((c = L[i].length - R[i].length)) return c; if(L[i] != R[i]) return L[i] < R[i] ? -1 : 1; } return L.length - R.length; } function dirname(p/*:string*/)/*:string*/ { if(p.charAt(p.length - 1) == "/") return (p.slice(0,-1).indexOf("/") === -1) ? p : dirname(p.slice(0, -1)); var c = p.lastIndexOf("/"); return (c === -1) ? p : p.slice(0, c+1); } function filename(p/*:string*/)/*:string*/ { if(p.charAt(p.length - 1) == "/") return filename(p.slice(0, -1)); var c = p.lastIndexOf("/"); return (c === -1) ? p : p.slice(c+1); } /* -------------------------------------------------------------------------- */ /* DOS Date format: high|YYYYYYYm.mmmddddd.HHHHHMMM.MMMSSSSS|low add 1980 to stored year stored second should be doubled */ /* write JS date to buf as a DOS date */ function write_dos_date(buf/*:CFBlob*/, date/*:Date|string*/) { if(typeof date === "string") date = new Date(date); var hms/*:number*/ = date.getHours(); hms = hms << 6 | date.getMinutes(); hms = hms << 5 | (date.getSeconds()>>>1); buf.write_shift(2, hms); var ymd/*:number*/ = (date.getFullYear() - 1980); ymd = ymd << 4 | (date.getMonth()+1); ymd = ymd << 5 | date.getDate(); buf.write_shift(2, ymd); } /* read four bytes from buf and interpret as a DOS date */ function parse_dos_date(buf/*:CFBlob*/)/*:Date*/ { var hms = buf.read_shift(2) & 0xFFFF; var ymd = buf.read_shift(2) & 0xFFFF; var val = new Date(); var d = ymd & 0x1F; ymd >>>= 5; var m = ymd & 0x0F; ymd >>>= 4; val.setMilliseconds(0); val.setFullYear(ymd + 1980); val.setMonth(m-1); val.setDate(d); var S = hms & 0x1F; hms >>>= 5; var M = hms & 0x3F; hms >>>= 6; val.setHours(hms); val.setMinutes(M); val.setSeconds(S<<1); return val; } function parse_extra_field(blob/*:CFBlob*/)/*:any*/ { prep_blob(blob, 0); var o = /*::(*/{}/*:: :any)*/; var flags = 0; while(blob.l <= blob.length - 4) { var type = blob.read_shift(2); var sz = blob.read_shift(2), tgt = blob.l + sz; var p = {}; switch(type) { /* UNIX-style Timestamps */ case 0x5455: { flags = blob.read_shift(1); if(flags & 1) p.mtime = blob.read_shift(4); /* for some reason, CD flag corresponds to LFH */ if(sz > 5) { if(flags & 2) p.atime = blob.read_shift(4); if(flags & 4) p.ctime = blob.read_shift(4); } if(p.mtime) p.mt = new Date(p.mtime*1000); } break; } blob.l = tgt; o[type] = p; } return o; } var fs/*:: = require('fs'); */; function get_fs() { return fs || (fs = {}); } function parse(file/*:RawBytes*/, options/*:CFBReadOpts*/)/*:CFBContainer*/ { if(file[0] == 0x50 && file[1] == 0x4b) return parse_zip(file, options); if((file[0] | 0x20) == 0x6d && (file[1]|0x20) == 0x69) return parse_mad(file, options); if(file.length < 512) throw new Error("CFB file size " + file.length + " < 512"); var mver = 3; var ssz = 512; var nmfs = 0; // number of mini FAT sectors var difat_sec_cnt = 0; var dir_start = 0; var minifat_start = 0; var difat_start = 0; var fat_addrs/*:Array<number>*/ = []; // locations of FAT sectors /* [MS-CFB] 2.2 Compound File Header */ var blob/*:CFBlob*/ = /*::(*/file.slice(0,512)/*:: :any)*/; prep_blob(blob, 0); /* major version */ var mv = check_get_mver(blob); mver = mv[0]; switch(mver) { case 3: ssz = 512; break; case 4: ssz = 4096; break; case 0: if(mv[1] == 0) return parse_zip(file, options); /* falls through */ default: throw new Error("Major Version: Expected 3 or 4 saw " + mver); } /* reprocess header */ if(ssz !== 512) { blob = /*::(*/file.slice(0,ssz)/*:: :any)*/; prep_blob(blob, 28 /* blob.l */); } /* Save header for final object */ var header/*:RawBytes*/ = file.slice(0,ssz); check_shifts(blob, mver); // Number of Directory Sectors var dir_cnt/*:number*/ = blob.read_shift(4, 'i'); if(mver === 3 && dir_cnt !== 0) throw new Error('# Directory Sectors: Expected 0 saw ' + dir_cnt); // Number of FAT Sectors blob.l += 4; // First Directory Sector Location dir_start = blob.read_shift(4, 'i'); // Transaction Signature blob.l += 4; // Mini Stream Cutoff Size blob.chk('00100000', 'Mini Stream Cutoff Size: '); // First Mini FAT Sector Location minifat_start = blob.read_shift(4, 'i'); // Number of Mini FAT Sectors nmfs = blob.read_shift(4, 'i'); // First DIFAT sector location difat_start = blob.read_shift(4, 'i'); // Number of DIFAT Sectors difat_sec_cnt = blob.read_shift(4, 'i'); // Grab FAT Sector Locations for(var q = -1, j = 0; j < 109; ++j) { /* 109 = (512 - blob.l)>>>2; */ q = blob.read_shift(4, 'i'); if(q<0) break; fat_addrs[j] = q; } /** Break the file up into sectors */ var sectors/*:Array<RawBytes>*/ = sectorify(file, ssz); sleuth_fat(difat_start, difat_sec_cnt, sectors, ssz, fat_addrs); /** Chains */ var sector_list/*:SectorList*/ = make_sector_list(sectors, dir_start, fat_addrs, ssz); sector_list[dir_start].name = "!Directory"; if(nmfs > 0 && minifat_start !== ENDOFCHAIN) sector_list[minifat_start].name = "!MiniFAT"; sector_list[fat_addrs[0]].name = "!FAT"; sector_list.fat_addrs = fat_addrs; sector_list.ssz = ssz; /* [MS-CFB] 2.6.1 Compound File Directory Entry */ var files/*:CFBFiles*/ = {}, Paths/*:Array<string>*/ = [], FileIndex/*:CFBFileIndex*/ = [], FullPaths/*:Array<string>*/ = []; read_directory(dir_start, sector_list, sectors, Paths, nmfs, files, FileIndex, minifat_start); build_full_paths(FileIndex, FullPaths, Paths); Paths.shift(); var o = { FileIndex: FileIndex, FullPaths: FullPaths }; // $FlowIgnore if(options && options.raw) o.raw = {header: header, sectors: sectors}; return o; } // parse /* [MS-CFB] 2.2 Compound File Header -- read up to major version */ function check_get_mver(blob/*:CFBlob*/)/*:[number, number]*/ { if(blob[blob.l] == 0x50 && blob[blob.l + 1] == 0x4b) return [0, 0]; // header signature 8 blob.chk(HEADER_SIGNATURE, 'Header Signature: '); // clsid 16 //blob.chk(HEADER_CLSID, 'CLSID: '); blob.l += 16; // minor version 2 var mver/*:number*/ = blob.read_shift(2, 'u'); return [blob.read_shift(2,'u'), mver]; } function check_shifts(blob/*:CFBlob*/, mver/*:number*/)/*:void*/ { var shift = 0x09; // Byte Order //blob.chk('feff', 'Byte Order: '); // note: some writers put 0xffff blob.l += 2; // Sector Shift switch((shift = blob.read_shift(2))) { case 0x09: if(mver != 3) throw new Error('Sector Shift: Expected 9 saw ' + shift); break; case 0x0c: if(mver != 4) throw new Error('Sector Shift: Expected 12 saw ' + shift); break; default: throw new Error('Sector Shift: Expected 9 or 12 saw ' + shift); } // Mini Sector Shift blob.chk('0600', 'Mini Sector Shift: '); // Reserved blob.chk('000000000000', 'Reserved: '); } /** Break the file up into sectors */ function sectorify(file/*:RawBytes*/, ssz/*:number*/)/*:Array<RawBytes>*/ { var nsectors = Math.ceil(file.length/ssz)-1; var sectors/*:Array<RawBytes>*/ = []; for(var i=1; i < nsectors; ++i) sectors[i-1] = file.slice(i*ssz,(i+1)*ssz); sectors[nsectors-1] = file.slice(nsectors*ssz); return sectors; } /* [MS-CFB] 2.6.4 Red-Black Tree */ function build_full_paths(FI/*:CFBFileIndex*/, FP/*:Array<string>*/, Paths/*:Array<string>*/)/*:void*/ { var i = 0, L = 0, R = 0, C = 0, j = 0, pl = Paths.length; var dad/*:Array<number>*/ = [], q/*:Array<number>*/ = []; for(; i < pl; ++i) { dad[i]=q[i]=i; FP[i]=Paths[i]; } for(; j < q.length; ++j) { i = q[j]; L = FI[i].L; R = FI[i].R; C = FI[i].C; if(dad[i] === i) { if(L !== -1 /*NOSTREAM*/ && dad[L] !== L) dad[i] = dad[L]; if(R !== -1 && dad[R] !== R) dad[i] = dad[R]; } if(C !== -1 /*NOSTREAM*/) dad[C] = i; if(L !== -1 && i != dad[i]) { dad[L] = dad[i]; if(q.lastIndexOf(L) < j) q.push(L); } if(R !== -1 && i != dad[i]) { dad[R] = dad[i]; if(q.lastIndexOf(R) < j) q.push(R); } } for(i=1; i < pl; ++i) if(dad[i] === i) { if(R !== -1 /*NOSTREAM*/ && dad[R] !== R) dad[i] = dad[R]; else if(L !== -1 && dad[L] !== L) dad[i] = dad[L]; } for(i=1; i < pl; ++i) { if(FI[i].type === 0 /* unknown */) continue; j = i; if(j != dad[j]) do { j = dad[j]; FP[i] = FP[j] + "/" + FP[i]; } while (j !== 0 && -1 !== dad[j] && j != dad[j]); dad[i] = -1; } FP[0] += "/"; for(i=1; i < pl; ++i) { if(FI[i].type !== 2 /* stream */) FP[i] += "/"; } } function get_mfat_entry(entry/*:CFBEntry*/, payload/*:RawBytes*/, mini/*:?RawBytes*/)/*:CFBlob*/ { var start = entry.start, size = entry.size; //return (payload.slice(start*MSSZ, start*MSSZ + size)/*:any*/); var o = []; var idx = start; while(mini && size > 0 && idx >= 0) { o.push(payload.slice(idx * MSSZ, idx * MSSZ + MSSZ)); size -= MSSZ; idx = __readInt32LE(mini, idx * 4); } if(o.length === 0) return (new_buf(0)/*:any*/); return (bconcat(o).slice(0, entry.size)/*:any*/); } /** Chase down the rest of the DIFAT chain to build a comprehensive list DIFAT chains by storing the next sector number as the last 32 bits */ function sleuth_fat(idx/*:number*/, cnt/*:number*/, sectors/*:Array<RawBytes>*/, ssz/*:number*/, fat_addrs)/*:void*/ { var q/*:number*/ = ENDOFCHAIN; if(idx === ENDOFCHAIN) { if(cnt !== 0) throw new Error("DIFAT chain shorter than expected"); } else if(idx !== -1 /*FREESECT*/) { var sector = sectors[idx], m = (ssz>>>2)-1; if(!sector) return; for(var i = 0; i < m; ++i) { if((q = __readInt32LE(sector,i*4)) === ENDOFCHAIN) break; fat_addrs.push(q); } sleuth_fat(__readInt32LE(sector,ssz-4),cnt - 1, sectors, ssz, fat_addrs); } } /** Follow the linked list of sectors for a given starting point */ function get_sector_list(sectors/*:Array<RawBytes>*/, start/*:number*/, fat_addrs/*:Array<number>*/, ssz/*:number*/, chkd/*:?Array<boolean>*/)/*:SectorEntry*/ { var buf/*:Array<number>*/ = [], buf_chain/*:Array<any>*/ = []; if(!chkd) chkd = []; var modulus = ssz - 1, j = 0, jj = 0; for(j=start; j>=0;) { chkd[j] = true; buf[buf.length] = j; buf_chain.push(sectors[j]); var addr = fat_addrs[Math.floor(j*4/ssz)]; jj = ((j*4) & modulus); if(ssz < 4 + jj) throw new Error("FAT boundary crossed: " + j + " 4 "+ssz); if(!sectors[addr]) break; j = __readInt32LE(sectors[addr], jj); } return {nodes: buf, data:__toBuffer([buf_chain])}; } /** Chase down the sector linked lists */ function make_sector_list(sectors/*:Array<RawBytes>*/, dir_start/*:number*/, fat_addrs/*:Array<number>*/, ssz/*:number*/)/*:SectorList*/ { var sl = sectors.length, sector_list/*:SectorList*/ = ([]/*:any*/); var chkd/*:Array<boolean>*/ = [], buf/*:Array<number>*/ = [], buf_chain/*:Array<RawBytes>*/ = []; var modulus = ssz - 1, i=0, j=0, k=0, jj=0; for(i=0; i < sl; ++i) { buf = ([]/*:Array<number>*/); k = (i + dir_start); if(k >= sl) k-=sl; if(chkd[k]) continue; buf_chain = []; var seen = []; for(j=k; j>=0;) { seen[j] = true; chkd[j] = true; buf[buf.length] = j; buf_chain.push(sectors[j]); var addr/*:number*/ = fat_addrs[Math.floor(j*4/ssz)]; jj = ((j*4) & modulus); if(ssz < 4 + jj) throw new Error("FAT boundary crossed: " + j + " 4 "+ssz); if(!sectors[addr]) break; j = __readInt32LE(sectors[addr], jj); if(seen[j]) break; } sector_list[k] = ({nodes: buf, data:__toBuffer([buf_chain])}/*:SectorEntry*/); } return sector_list; } /* [MS-CFB] 2.6.1 Compound File Directory Entry */ function read_directory(dir_start/*:number*/, sector_list/*:SectorList*/, sectors/*:Array<RawBytes>*/, Paths/*:Array<string>*/, nmfs, files, FileIndex, mini) { var minifat_store = 0, pl = (Paths.length?2:0); var sector = sector_list[dir_start].data; var i = 0, namelen = 0, name; for(; i < sector.length; i+= 128) { var blob/*:CFBlob*/ = /*::(*/sector.slice(i, i+128)/*:: :any)*/; prep_blob(blob, 64); namelen = blob.read_shift(2); name = __utf16le(blob,0,namelen-pl); Paths.push(name); var o/*:CFBEntry*/ = ({ name: name, type: blob.read_shift(1), color: blob.read_shift(1), L: blob.read_shift(4, 'i'), R: blob.read_shift(4, 'i'), C: blob.read_shift(4, 'i'), clsid: blob.read_shift(16), state: blob.read_shift(4, 'i'), start: 0, size: 0 }); var ctime/*:number*/ = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2); if(ctime !== 0) o.ct = read_date(blob, blob.l-8); var mtime/*:number*/ = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2); if(mtime !== 0) o.mt = read_date(blob, blob.l-8); o.start = blob.read_shift(4, 'i'); o.size = blob.read_shift(4, 'i'); if(o.size < 0 && o.start < 0) { o.size = o.type = 0; o.start = ENDOFCHAIN; o.name = ""; } if(o.type === 5) { /* root */ minifat_store = o.start; if(nmfs > 0 && minifat_store !== ENDOFCHAIN) sector_list[minifat_store].name = "!StreamData"; /*minifat_size = o.size;*/ } else if(o.size >= 4096 /* MSCSZ */) { o.storage = 'fat'; if(sector_list[o.start] === undefined) sector_list[o.start] = get_sector_list(sectors, o.start, sector_list.fat_addrs, sector_list.ssz); sector_list[o.start].name = o.name; o.content = (sector_list[o.start].data.slice(0,o.size)/*:any*/); } else { o.storage = 'minifat'; if(o.size < 0) o.size = 0; else if(minifat_store !== ENDOFCHAIN && o.start !== ENDOFCHAIN && sector_list[minifat_store]) { o.content = get_mfat_entry(o, sector_list[minifat_store].data, (sector_list[mini]||{}).data); } } if(o.content) prep_blob(o.content, 0); files[name] = o; FileIndex.push(o); } } function read_date(blob/*:RawBytes|CFBlob*/, offset/*:number*/)/*:Date*/ { return new Date(( ( (__readUInt32LE(blob,offset+4)/1e7)*Math.pow(2,32)+__readUInt32LE(blob,offset)/1e7 ) - 11644473600)*1000); } function read_file(filename/*:string*/, options/*:CFBReadOpts*/) { get_fs(); return parse(fs.readFileSync(filename), options); } function read(blob/*:RawBytes|string*/, options/*:CFBReadOpts*/) { var type = options && options.type; if(!type) { if(has_buf && Buffer.isBuffer(blob)) type = "buffer"; } switch(type || "base64") { case "file": /*:: if(typeof blob !== 'string') throw "Must pass a filename when type='file'"; */return read_file(blob, options); case "base64": /*:: if(typeof blob !== 'string') throw "Must pass a base64-encoded binary string when type='file'"; */return parse(s2a(Base64_decode(blob)), options); case "binary": /*:: if(typeof blob !== 'string') throw "Must pass a binary string when type='file'"; */return parse(s2a(blob), options); } return parse(/*::typeof blob == 'string' ? new Buffer(blob, 'utf-8') : */blob, options); } function init_cfb(cfb/*:CFBContainer*/, opts/*:?any*/)/*:void*/ { var o = opts || {}, root = o.root || "Root Entry"; if(!cfb.FullPaths) cfb.FullPaths = []; if(!cfb.FileIndex) cfb.FileIndex = []; if(cfb.FullPaths.length !== cfb.FileIndex.length) throw new Error("inconsistent CFB structure"); if(cfb.FullPaths.length === 0) { cfb.FullPaths[0] = root + "/"; cfb.FileIndex[0] = ({ name: root, type: 5 }/*:any*/); } if(o.CLSID) cfb.FileIndex[0].clsid = o.CLSID; seed_cfb(cfb); } function seed_cfb(cfb/*:CFBContainer*/)/*:void*/ { var nm = "\u0001Sh33tJ5"; if(CFB.find(cfb, "/" + nm)) return; var p = new_buf(4); p[0] = 55; p[1] = p[3] = 50; p[2] = 54; cfb.FileIndex.push(({ name: nm, type: 2, content:p, size:4, L:69, R:69, C:69 }/*:any*/)); cfb.FullPaths.push(cfb.FullPaths[0] + nm); rebuild_cfb(cfb); } function rebuild_cfb(cfb/*:CFBContainer*/, f/*:?boolean*/)/*:void*/ { init_cfb(cfb); var gc = false, s = false; for(var i = cfb.FullPaths.length - 1; i >= 0; --i) { var _file = cfb.FileIndex[i]; switch(_file.type) { case 0: if(s) gc = true; else { cfb.FileIndex.pop(); cfb.FullPaths.pop(); } break; case 1: case 2: case 5: s = true; if(isNaN(_file.R * _file.L * _file.C)) gc = true; if(_file.R > -1 && _file.L > -1 && _file.R == _file.L) gc = true; break; default: gc = true; break; } } if(!gc && !f) return; var now = new Date(1987, 1, 19), j = 0; // Track which names exist var fullPaths = Object.create ? Object.create(null) : {}; var data/*:Array<[string, CFBEntry]>*/ = []; for(i = 0; i < cfb.FullPaths.length; ++i) { fullPaths[cfb.FullPaths[i]] = true; if(cfb.FileIndex[i].type === 0) continue; data.push([cfb.FullPaths[i], cfb.FileIndex[i]]); } for(i = 0; i < data.length; ++i) { var dad = dirname(data[i][0]); s = fullPaths[dad]; if(!s) { data.push([dad, ({ name: filename(dad).replace("/",""), type: 1, clsid: HEADER_CLSID, ct: now, mt: now, content: null }/*:any*/)]); // Add name to set fullPaths[dad] = true; } } data.sort(function(x,y) { return namecmp(x[0], y[0]); }); cfb.FullPaths = []; cfb.FileIndex = []; for(i = 0; i < data.length; ++i) { cfb.FullPaths[i] = data[i][0]; cfb.FileIndex[i] = data[i][1]; } for(i = 0; i < data.length; ++i) { var elt = cfb.FileIndex[i]; var nm = cfb.FullPaths[i]; elt.name = filename(nm).replace("/",""); elt.L = elt.R = elt.C = -(elt.color = 1); elt.size = elt.content ? elt.content.length : 0; elt.start = 0; elt.clsid = (elt.clsid || HEADER_CLSID); if(i === 0) { elt.C = data.length > 1 ? 1 : -1; elt.size = 0; elt.type = 5; } else if(nm.slice(-1) == "/") { for(j=i+1;j < data.length; ++j) if(dirname(cfb.FullPaths[j])==nm) break; elt.C = j >= data.length ? -1 : j; for(j=i+1;j < data.length; ++j) if(dirname(cfb.FullPaths[j])==dirname(nm)) break; elt.R = j >= data.length ? -1 : j; elt.type = 1; } else { if(dirname(cfb.FullPaths[i+1]||"") == dirname(nm)) elt.R = i + 1; elt.type = 2; } } } function _write(cfb/*:CFBContainer*/, options/*:CFBWriteOpts*/)/*:RawBytes|string*/ { var _opts = options || {}; /* MAD is order-sensitive, skip rebuild and sort */ if(_opts.fileType == 'mad') return write_mad(cfb, _opts); rebuild_cfb(cfb); switch(_opts.fileType) { case 'zip': return write_zip(cfb, _opts); //case 'mad': return write_mad(cfb, _opts); } var L = (function(cfb/*:CFBContainer*/)/*:Array<number>*/{ var mini_size = 0, fat_size = 0; for(var i = 0; i < cfb.FileIndex.length; ++i) { var file = cfb.FileIndex[i]; if(!file.content) continue; /*:: if(file.content == null) throw new Error("unreachable"); */ var flen = file.content.length; if(flen > 0){ if(flen < 0x1000) mini_size += (flen + 0x3F) >> 6; else fat_size += (flen + 0x01FF) >> 9; } } var dir_cnt = (cfb.FullPaths.length +3) >> 2; var mini_cnt = (mini_size + 7) >> 3; var mfat_cnt = (mini_size + 0x7F) >> 7; var fat_base = mini_cnt + fat_size + dir_cnt + mfat_cnt; var fat_cnt = (fat_base + 0x7F) >> 7; var difat_cnt = fat_cnt <= 109 ? 0 : Math.ceil((fat_cnt-109)/0x7F); while(((fat_base + fat_cnt + difat_cnt + 0x7F) >> 7) > fat_cnt) difat_cnt = ++fat_cnt <= 109 ? 0 : Math.ceil((fat_cnt-109)/0x7F); var L = [1, difat_cnt, fat_cnt, mfat_cnt, dir_cnt, fat_size, mini_size, 0]; cfb.FileIndex[0].size = mini_size << 6; L[7] = (cfb.FileIndex[0].start=L[0]+L[1]+L[2]+L[3]+L[4]+L[5])+((L[6]+7) >> 3); return L; })(cfb); var o = new_buf(L[7] << 9); var i = 0, T = 0; { for(i = 0; i < 8; ++i) o.write_shift(1, HEADER_SIG[i]); for(i = 0; i < 8; ++i) o.write_shift(2, 0); o.write_shift(2, 0x003E); o.write_shift(2, 0x0003); o.write_shift(2, 0xFFFE); o.write_shift(2, 0x0009); o.write_shift(2, 0x0006); for(i = 0; i < 3; ++i) o.write_shift(2, 0); o.write_shift(4, 0); o.write_shift(4, L[2]); o.write_shift(4, L[0] + L[1] + L[2] + L[3] - 1); o.write_shift(4, 0); o.write_shift(4, 1<<12); o.write_shift(4, L[3] ? L[0] + L[1] + L[2] - 1: ENDOFCHAIN); o.write_shift(4, L[3]); o.write_shift(-4, L[1] ? L[0] - 1: ENDOFCHAIN); o.write_shift(4, L[1]); for(i = 0; i < 109; ++i) o.write_shift(-4, i < L[2] ? L[1] + i : -1); } if(L[1]) { for(T = 0; T < L[1]; ++T) { for(; i < 236 + T * 127; ++i) o.write_shift(-4, i < L[2] ? L[1] + i : -1); o.write_shift(-4, T === L[1] - 1 ? ENDOFCHAIN : T + 1); } } var chainit = function(w/*:number*/)/*:void*/ { for(T += w; i<T-1; ++i) o.write_shift(-4, i+1); if(w) { ++i; o.write_shift(-4, ENDOFCHAIN); } }; T = i = 0; for(T+=L[1]; i<T; ++i) o.write_shift(-4, consts.DIFSECT); for(T+=L[2]; i<T; ++i) o.write_shift(-4, consts.FATSECT); chainit(L[3]); chainit(L[4]); var j/*:number*/ = 0, flen/*:number*/ = 0; var file/*:CFBEntry*/ = cfb.FileIndex[0]; for(; j < cfb.FileIndex.length; ++j) { file = cfb.FileIndex[j]; if(!file.content) continue; /*:: if(file.content == null) throw new Error("unreachable"); */ flen = file.content.length; if(flen < 0x1000) continue; file.start = T; chainit((flen + 0x01FF) >> 9); } chainit((L[6] + 7) >> 3); while(o.l & 0x1FF) o.write_shift(-4, consts.ENDOFCHAIN); T = i = 0; for(j = 0; j < cfb.FileIndex.length; ++j) { file = cfb.FileIndex[j]; if(!file.content) continue; /*:: if(file.content == null) throw new Error("unreachable"); */ flen = file.content.length; if(!flen || flen >= 0x1000) continue; file.start = T; chainit((flen + 0x3F) >> 6); } while(o.l & 0x1FF) o.write_shift(-4, consts.ENDOFCHAIN); for(i = 0; i < L[4]<<2; ++i) { var nm = cfb.FullPaths[i]; if(!nm || nm.length === 0) { for(j = 0; j < 17; ++j) o.write_shift(4, 0); for(j = 0; j < 3; ++j) o.write_shift(4, -1); for(j = 0; j < 12; ++j) o.write_shift(4, 0); continue; } file = cfb.FileIndex[i]; if(i === 0) file.start = file.size ? file.start - 1 : ENDOFCHAIN; var _nm/*:string*/ = (i === 0 && _opts.root) || file.name; flen = 2*(_nm.length+1); o.write_shift(64, _nm, "utf16le"); o.write_shift(2, flen); o.write_shift(1, file.type); o.write_shift(1, file.color); o.write_shift(-4, file.L); o.write_shift(-4, file.R); o.write_shift(-4, file.C); if(!file.clsid) for(j = 0; j < 4; ++j) o.write_shift(4, 0); else o.write_shift(16, file.clsid, "hex"); o.write_shift(4, file.state || 0); o.write_shift(4, 0); o.write_shift(4, 0); o.write_shift(4, 0); o.write_shift(4, 0); o.write_shift(4, file.start); o.write_shift(4, file.size); o.write_shift(4, 0); } for(i = 1; i < cfb.FileIndex.length; ++i) { file = cfb.FileIndex[i]; /*:: if(!file.content) throw new Error("unreachable"); */ if(file.size >= 0x1000) { o.l = (file.start+1) << 9; if (has_buf && Buffer.isBuffer(file.content)) { file.content.copy(o, o.l, 0, file.size); // o is a 0-filled Buffer so just set next offset o.l += (file.size + 511) & -512; } else { for(j = 0; j < file.size; ++j) o.write_shift(1, file.content[j]); for(; j & 0x1FF; ++j) o.write_shift(1, 0); } } } for(i = 1; i < cfb.FileIndex.length; ++i) { file = cfb.FileIndex[i]; /*:: if(!file.content) throw new Error("unreachable"); */ if(file.size > 0 && file.size < 0x1000) { if (has_buf && Buffer.isBuffer(file.content)) { file.content.copy(o, o.l, 0, file.size); // o is a 0-filled Buffer so just set next offset o.l += (file.size + 63) & -64; } else { for(j = 0; j < file.size; ++j) o.write_shift(1, file.content[j]); for(; j & 0x3F; ++j) o.write_shift(1, 0); } } } if (has_buf) { o.l = o.length; } else { // When using Buffer, already 0-filled while(o.l < o.length) o.write_shift(1, 0); } return o; } /* [MS-CFB] 2.6.4 (Unicode 3.0.1 case conversion) */ function find(cfb/*:CFBContainer*/, path/*:string*/)/*:?CFBEntry*/ { var UCFullPaths/*:Array<string>*/ = cfb.FullPaths.map(function(x) { return x.toUpperCase(); }); var UCPaths/*:Array<string>*/ = UCFullPaths.map(function(x) { var y = x.split("/"); return y[y.length - (x.slice(-1) == "/" ? 2 : 1)]; }); var k/*:boolean*/ = false; if(path.charCodeAt(0) === 47 /* "/" */) { k = true; path = UCFullPaths[0].slice(0, -1) + path; } else k = path.indexOf("/") !== -1; var UCPath/*:string*/ = path.toUpperCase(); var w/*:number*/ = k === true ? UCFullPaths.indexOf(UCPath) : UCPaths.indexOf(UCPath); if(w !== -1) return cfb.FileIndex[w]; var m = !UCPath.match(chr1); UCPath = UCPath.replace(chr0,''); if(m) UCPath = UCPath.replace(chr1,'!'); for(w = 0; w < UCFullPaths.length; ++w) { if((m ? UCFullPaths[w].replace(chr1,'!') : UCFullPaths[w]).replace(chr0,'') == UCPath) return cfb.FileIndex[w]; if((m ? UCPaths[w].replace(chr1,'!') : UCPaths[w]).replace(chr0,'') == UCPath) return cfb.FileIndex[w]; } return null; } /** CFB Constants */ var MSSZ = 64; /* Mini Sector Size = 1<<6 */ //var MSCSZ = 4096; /* Mini Stream Cutoff Size */ /* 2.1 Compound File Sector Numbers and Types */ var ENDOFCHAIN = -2; /* 2.2 Compound File Header */ var HEADER_SIGNATURE = 'd0cf11e0a1b11ae1'; var HEADER_SIG = [0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1]; var HEADER_CLSID = '00000000000000000000000000000000'; var consts = { /* 2.1 Compund File Sector Numbers and Types */ MAXREGSECT: -6, DIFSECT: -4, FATSECT: -3, ENDOFCHAIN: ENDOFCHAIN, FREESECT: -1, /* 2.2 Compound File Header */ HEADER_SIGNATURE: HEADER_SIGNATURE, HEADER_MINOR_VERSION: '3e00', MAXREGSID: -6, NOSTREAM: -1, HEADER_CLSID: HEADER_CLSID, /* 2.6.1 Compound File Directory Entry */ EntryTypes: ['unknown','storage','stream','lockbytes','property','root'] }; function write_file(cfb/*:CFBContainer*/, filename/*:string*/, options/*:CFBWriteOpts*/)/*:void*/ { get_fs(); var o = _write(cfb, options); /*:: if(typeof Buffer == 'undefined' || !Buffer.isBuffer(o) || !(o instanceof Buffer)) throw new Error("unreachable"); */ fs.writeFileSync(filename, o); } function a2s(o/*:RawBytes*/)/*:string*/ { var out = new Array(o.length); for(var i = 0; i < o.length; ++i) out[i] = String.fromCharCode(o[i]); return out.join(""); } function write(cfb/*:CFBContainer*/, options/*:CFBWriteOpts*/)/*:RawBytes|string*/ { var o = _write(cfb, options); switch(options && options.type || "buffer") { case "file": get_fs(); fs.writeFileSync(options.filename, (o/*:any*/)); return o; case "binary": return typeof o == "string" ? o : a2s(o); case "base64": return Base64_encode(typeof o == "string" ? o : a2s(o)); case "buffer": if(has_buf) return Buffer.isBuffer(o) ? o : Buffer_from(o); /* falls through */ case "array": return typeof o == "string" ? s2a(o) : o; } return o; } /* node < 8.1 zlib does not expose bytesRead, so default to pure JS */ var _zlib; function use_zlib(zlib) { try { var InflateRaw = zlib.InflateRaw; var InflRaw = new InflateRaw(); InflRaw._processChunk(new Uint8Array([3, 0]), InflRaw._finishFlushFlag); if(InflRaw.bytesRead) _zlib = zlib; else throw new Error("zlib does not expose bytesRead"); } catch(e) {console.error("cannot use native zlib: " + (e.message || e)); } } function _inflateRawSync(payload, usz) { if(!_zlib) return _inflate(payload, usz); var InflateRaw = _zlib.InflateRaw; var InflRaw = new InflateRaw(); var out = InflRaw._processChunk(payload.slice(payload.l), InflRaw._finishFlushFlag); payload.l += InflRaw.bytesRead; return out; } function _deflateRawSync(payload) { return _zlib ? _zlib.deflateRawSync(payload) : _deflate(payload); } var CLEN_ORDER = [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ]; /* LEN_ID = [ 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285 ]; */ var LEN_LN = [ 3, 4, 5, 6, 7, 8, 9, 10, 11, 13 , 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258 ]; /* DST_ID = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29 ]; */ var DST_LN = [ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577 ]; function bit_swap_8(n) { var t = (((((n<<1)|(n<<11)) & 0x22110) | (((n<<5)|(n<<15)) & 0x88440))); return ((t>>16) | (t>>8) |t)&0xFF; } var use_typed_arrays = typeof Uint8Array !== 'undefined'; var bitswap8 = use_typed_arrays ? new Uint8Array(1<<8) : []; for(var q = 0; q < (1<<8); ++q) bitswap8[q] = bit_swap_8(q); function bit_swap_n(n, b) { var rev = bitswap8[n & 0xFF]; if(b <= 8) return rev >>> (8-b); rev = (rev << 8) | bitswap8[(n>>8)&0xFF]; if(b <= 16) return rev >>> (16-b); rev = (rev << 8) | bitswap8[(n>>16)&0xFF]; return rev >>> (24-b); } /* helpers for unaligned bit reads */ function read_bits_2(buf, bl) { var w = (bl&7), h = (bl>>>3); return ((buf[h]|(w <= 6 ? 0 : buf[h+1]<<8))>>>w)& 0x03; } function read_bits_3(buf, bl) { var w = (bl&7), h = (bl>>>3); return ((buf[h]|(w <= 5 ? 0 : buf[h+1]<<8))>>>w)& 0x07; } function read_bits_4(buf, bl) { var w = (bl&7), h = (bl>>>3); return ((buf[h]|(w <= 4 ? 0 : buf[h+1]<<8))>>>w)& 0x0F; } function read_bits_5(buf, bl) { var w = (bl&7), h = (bl>>>3); return ((buf[h]|(w <= 3 ? 0 : buf[h+1]<<8))>>>w)& 0x1F; } function read_bits_7(buf, bl) { var w = (bl&7), h = (bl>>>3); return ((buf[h]|(w <= 1 ? 0 : buf[h+1]<<8))>>>w)& 0x7F; } /* works up to n = 3 * 8 + 1 = 25 */ function read_bits_n(buf, bl, n) { var w = (bl&7), h = (bl>>>3), f = ((1<<n)-1); var v = buf[h] >>> w; if(n < 8 - w) return v & f; v |= buf[h+1]<<(8-w); if(n < 16 - w) return v & f; v |= buf[h+2]<<(16-w); if(n < 24 - w) return v & f; v |= buf[h+3]<<(24-w); return v & f; } /* helpers for unaligned bit writes */ function write_bits_3(buf, bl, v) { var w = bl & 7, h = bl >>> 3; if(w <= 5) buf[h] |= (v & 7) << w; else { buf[h] |= (v << w) & 0xFF; buf[h+1] = (v&7) >> (8-w); } return bl + 3; } function write_bits_1(buf, bl, v) { var w = bl & 7, h = bl >>> 3; v = (v&1) << w; buf[h] |= v; return bl + 1; } function write_bits_8(buf, bl, v) { var w = bl & 7, h = bl >>> 3; v <<= w; buf[h] |= v & 0xFF; v >>>= 8; buf[h+1] = v; return bl + 8; } function write_bits_16(buf, bl, v) { var w = bl & 7, h = bl >>> 3; v <<= w; buf[h] |= v & 0xFF; v >>>= 8; buf[h+1] = v & 0xFF; buf[h+2] = v >>> 8; return bl + 16; } /* until ArrayBuffer#realloc is a thing, fake a realloc */ function realloc(b, sz/*:number*/) { var L = b.length, M = 2*L > sz ? 2*L : sz + 5, i = 0; if(L >= sz) return b; if(has_buf) { var o = new_unsafe_buf(M); // $FlowIgnore if(b.copy) b.copy(o); else for(; i < b.length; ++i) o[i] = b[i]; return o; } else if(use_typed_arrays) { var a = new Uint8Array(M); if(a.set) a.set(b); else for(; i < L; ++i) a[i] = b[i]; return a; } b.length = M; return b; } /* zero-filled arrays for older browsers */ function zero_fill_array(n) { var o = new Array(n); for(var i = 0; i < n; ++i) o[i] = 0; return o; } /* build tree (used for literals and lengths) */ function build_tree(clens, cmap, MAX/*:number*/)/*:number*/ { var maxlen = 1, w = 0, i = 0, j = 0, ccode = 0, L = clens.length; var bl_count = use_typed_arrays ? new Uint16Array(32) : zero_fill_array(32); for(i = 0; i < 32; ++i) bl_count[i] = 0; for(i = L; i < MAX; ++i) clens[i] = 0; L = clens.length; var ctree = use_typed_arrays ? new Uint16Array(L) : zero_fill_array(L); // [] /* build code tree */ for(i = 0; i < L; ++i) { bl_count[(w = clens[i])]++; if(maxlen < w) maxlen = w; ctree[i] = 0; } bl_count[0] = 0; for(i = 1; i <= maxlen; ++i) bl_count[i+16] = (ccode = (ccode + bl_count[i-1])<<1); for(i = 0; i < L; ++i) { ccode = clens[i]; if(ccode != 0) ctree[i] = bl_count[ccode+16]++; } /* cmap[maxlen + 4 bits] = (off&15) + (lit<<4) reverse mapping */ var cleni = 0; for(i = 0; i < L; ++i) { cleni = clens[i]; if(cleni != 0) { ccode = bit_swap_n(ctree[i], maxlen)>>(maxlen-cleni); for(j = (1<<(maxlen + 4 - cleni)) - 1; j>=0; --j) cmap[ccode|(j<<cleni)] = (cleni&15) | (i<<4); } } return maxlen; } /* Fixed Huffman */ var fix_lmap = use_typed_arrays ? new Uint16Array(512) : zero_fill_array(512); var fix_dmap = use_typed_arrays ? new Uint16Array(32) : zero_fill_array(32); if(!use_typed_arrays) { for(var i = 0; i < 512; ++i) fix_lmap[i] = 0; for(i = 0; i < 32; ++i) fix_dmap[i] = 0; } (function() { var dlens/*:Array<number>*/ = []; var i = 0; for(;i<32; i++) dlens.push(5); build_tree(dlens, fix_dmap, 32); var clens/*:Array<number>*/ = []; i = 0; for(; i<=143; i++) clens.push(8); for(; i<=255; i++) clens.push(9); for(; i<=279; i++) clens.push(7); for(; i<=287; i++) clens.push(8); build_tree(clens, fix_lmap, 288); })();var _deflateRaw = /*#__PURE__*/(function _deflateRawIIFE() { var DST_LN_RE = use_typed_arrays ? new Uint8Array(0x8000) : []; var j = 0, k = 0; for(; j < DST_LN.length - 1; ++j) { for(; k < DST_LN[j+1]; ++k) DST_LN_RE[k] = j; } for(;k < 32768; ++k) DST_LN_RE[k] = 29; var LEN_LN_RE = use_typed_arrays ? new Uint8Array(0x103) : []; for(j = 0, k = 0; j < LEN_LN.length - 1; ++j) { for(; k < LEN_LN[j+1]; ++k) LEN_LN_RE[k] = j; } function write_stored(data, out) { var boff = 0; while(boff < data.length) { var L = Math.min(0xFFFF, data.length - boff); var h = boff + L == data.length; out.write_shift(1, +h); out.write_shift(2, L); out.write_shift(2, (~L) & 0xFFFF); while(L-- > 0) out[out.l++] = data[boff++]; } return out.l; } /* Fixed Huffman */ function write_huff_fixed(data, out) { var bl = 0; var boff = 0; var addrs = use_typed_arrays ? new Uint16Array(0x8000) : []; while(boff < data.length) { var L = /* data.length - boff; */ Math.min(0xFFFF, data.length - boff); /* write a stored block for short data */ if(L < 10) { bl = write_bits_3(out, bl, +!!(boff + L == data.length)); // jshint ignore:line if(bl & 7) bl += 8 - (bl & 7); out.l = (bl / 8) | 0; out.write_shift(2, L); out.write_shift(2, (~L) & 0xFFFF); while(L-- > 0) out[out.l++] = data[boff++]; bl = out.l * 8; continue; } bl = write_bits_3(out, bl, +!!(boff + L == data.length) + 2); // jshint ignore:line var hash = 0; while(L-- > 0) { var d = data[boff]; hash = ((hash << 5) ^ d) & 0x7FFF; var match = -1, mlen = 0; if((match = addrs[hash])) { match |= boff & ~0x7FFF; if(match > boff) match -= 0x8000; if(match < boff) while(data[match + mlen] == data[boff + mlen] && mlen < 250) ++mlen; } if(mlen > 2) { /* Copy Token */ d = LEN_LN_RE[mlen]; if(d <= 22) bl = write_bits_8(out, bl, bitswap8[d+1]>>1) - 1; else { write_bits_8(out, bl, 3); bl += 5; write_bits_8(out, bl, bitswap8[d-23]>>5); bl += 3; } var len_eb = (d < 8) ? 0 : ((d - 4)>>2); if(len_eb > 0) { write_bits_16(out, bl, mlen - LEN_LN[d]); bl += len_eb; } d = DST_LN_RE[boff - match]; bl = write_bits_8(out, bl, bitswap8[d]>>3); bl -= 3; var dst_eb = d < 4 ? 0 : (d-2)>>1; if(dst_eb > 0) { write_bits_16(out, bl, boff - match - DST_LN[d]); bl += dst_eb; } for(var q = 0; q < mlen; ++q) { addrs[hash] = boff & 0x7FFF; hash = ((hash << 5) ^ data[boff]) & 0x7FFF; ++boff; } L-= mlen - 1; } else { /* Literal Token */ if(d <= 143) d = d + 48; else bl = write_bits_1(out, bl, 1); bl = write_bits_8(out, bl, bitswap8[d]); addrs[hash] = boff & 0x7FFF; ++boff; } } bl = write_bits_8(out, bl, 0) - 1; } out.l = ((bl + 7)/8)|0; return out.l; } return function _deflateRaw(data, out) { if(data.length < 8) return write_stored(data, out); return write_huff_fixed(data, out); }; })(); function _deflate(data) { var buf = new_buf(50+Math.floor(data.length*1.1)); var off = _deflateRaw(data, buf); return buf.slice(0, off); } /* modified inflate function also moves original read head */ var dyn_lmap = use_typed_arrays ? new Uint16Array(32768) : zero_fill_array(32768); var dyn_dmap = use_typed_arrays ? new Uint16Array(32768) : zero_fill_array(32768); var dyn_cmap = use_typed_arrays ? new Uint16Array(128) : zero_fill_array(128); var dyn_len_1 = 1, dyn_len_2 = 1; /* 5.5.3 Expanding Huffman Codes */ function dyn(data, boff/*:number*/) { /* nomenclature from RFC1951 refers to bit values; these are offset by the implicit constant */ var _HLIT = read_bits_5(data, boff) + 257; boff += 5; var _HDIST = read_bits_5(data, boff) + 1; boff += 5; var _HCLEN = read_bits_4(data, boff) + 4; boff += 4; var w = 0; /* grab and store code lengths */ var clens = use_typed_arrays ? new Uint8Array(19) : zero_fill_array(19); var ctree = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]; var maxlen = 1; var bl_count = use_typed_arrays ? new Uint8Array(8) : zero_fill_array(8); var next_code = use_typed_arrays ? new Uint8Array(8) : zero_fill_array(8); var L = clens.length; /* 19 */ for(var i = 0; i < _HCLEN; ++i) { clens[CLEN_ORDER[i]] = w = read_bits_3(data, boff); if(maxlen < w) maxlen = w; bl_count[w]++; boff += 3; } /* build code tree */ var ccode = 0; bl_count[0] = 0; for(i = 1; i <= maxlen; ++i) next_code[i] = ccode = (ccode + bl_count[i-1])<<1; for(i = 0; i < L; ++i) if((ccode = clens[i]) != 0) ctree[i] = next_code[ccode]++; /* cmap[7 bits from stream] = (off&7) + (lit<<3) */ var cleni = 0; for(i = 0; i < L; ++i) { cleni = clens[i]; if(cleni != 0) { ccode = bitswap8[ctree[i]]>>(8-cleni); for(var j = (1<<(7-cleni))-1; j>=0; --j) dyn_cmap[ccode|(j<<cleni)] = (cleni&7) | (i<<3); } } /* read literal and dist codes at once */ var hcodes/*:Array<number>*/ = []; maxlen = 1; for(; hcodes.length < _HLIT + _HDIST;) { ccode = dyn_cmap[read_bits_7(data, boff)]; boff += ccode & 7; switch((ccode >>>= 3)) { case 16: w = 3 + read_bits_2(data, boff); boff += 2; ccode = hcodes[hcodes.length - 1]; while(w-- > 0) hcodes.push(ccode); break; case 17: w = 3 + read_bits_3(data, boff); boff += 3; while(w-- > 0) hcodes.push(0); break; case 18: w = 11 + read_bits_7(data, boff); boff += 7; while(w -- > 0) hcodes.push(0); break; default: hcodes.push(ccode); if(maxlen < ccode) maxlen = ccode; break; } } /* build literal / length trees */ var h1 = hcodes.slice(0, _HLIT), h2 = hcodes.slice(_HLIT); for(i = _HLIT; i < 286; ++i) h1[i] = 0; for(i = _HDIST; i < 30; ++i) h2[i] = 0; dyn_len_1 = build_tree(h1, dyn_lmap, 286); dyn_len_2 = build_tree(h2, dyn_dmap, 30); return boff; } /* return [ data, bytesRead ] */ function inflate(data, usz/*:number*/) { /* shortcircuit for empty buffer [0x03, 0x00] */ if(data[0] == 3 && !(data[1] & 0x3)) { return [new_raw_buf(usz), 2]; } /* bit offset */ var boff = 0; /* header includes final bit and type bits */ var header = 0; var outbuf = new_unsafe_buf(usz ? usz : (1<<18)); var woff = 0; var OL = outbuf.length>>>0; var max_len_1 = 0, max_len_2 = 0; while((header&1) == 0) { header = read_bits_3(data, boff); boff += 3; if((header >>> 1) == 0) { /* Stored block */ if(boff & 7) boff += 8 - (boff&7); /* 2 bytes sz, 2 bytes bit inverse */ var sz = data[boff>>>3] | data[(boff>>>3)+1]<<8; boff += 32; /* push sz bytes */ if(sz > 0) { if(!usz && OL < woff + sz) { outbuf = realloc(outbuf, woff + sz); OL = outbuf.length; } while(sz-- > 0) { outbuf[woff++] = data[boff>>>3]; boff += 8; } } continue; } else if((header >> 1) == 1) { /* Fixed Huffman */ max_len_1 = 9; max_len_2 = 5; } else { /* Dynamic Huffman */ boff = dyn(data, boff); max_len_1 = dyn_len_1; max_len_2 = dyn_len_2; } for(;;) { // while(true) is apparently out of vogue in modern JS circles if(!usz && (OL < woff + 32767)) { outbuf = realloc(outbuf, woff + 32767); OL = outbuf.length; } /* ingest code and move read head */ var bits = read_bits_n(data, boff, max_len_1); var code = (header>>>1) == 1 ? fix_lmap[bits] : dyn_lmap[bits]; boff += code & 15; code >>>= 4; /* 0-255 are literals, 256 is end of block token, 257+ are copy tokens */ if(((code>>>8)&0xFF) === 0) outbuf[woff++] = code; else if(code == 256) break; else { code -= 257; var len_eb = (code < 8) ? 0 : ((code-4)>>2); if(len_eb > 5) len_eb = 0; var tgt = woff + LEN_LN[code]; /* length extra bits */ if(len_eb > 0) { tgt += read_bits_n(data, boff, len_eb); boff += len_eb; } /* dist code */ bits = read_bits_n(data, boff, max_len_2); code = (header>>>1) == 1 ? fix_dmap[bits] : dyn_dmap[bits]; boff += code & 15; code >>>= 4; var dst_eb = (code < 4 ? 0 : (code-2)>>1); var dst = DST_LN[code]; /* dist extra bits */ if(dst_eb > 0) { dst += read_bits_n(data, boff, dst_eb); boff += dst_eb; } /* in the common case, manual byte copy is faster than TA set / Buffer copy */ if(!usz && OL < tgt) { outbuf = realloc(outbuf, tgt + 100); OL = outbuf.length; } while(woff < tgt) { outbuf[woff] = outbuf[woff - dst]; ++woff; } } } } if(usz) return [outbuf, (boff+7)>>>3]; return [outbuf.slice(0, woff), (boff+7)>>>3]; } function _inflate(payload, usz) { var data = payload.slice(payload.l||0); var out = inflate(data, usz); payload.l += out[1]; return out[0]; } function warn_or_throw(wrn, msg) { if(wrn) { if(typeof console !== 'undefined') console.error(msg); } else throw new Error(msg); } function parse_zip(file/*:RawBytes*/, options/*:CFBReadOpts*/)/*:CFBContainer*/ { var blob/*:CFBlob*/ = /*::(*/file/*:: :any)*/; prep_blob(blob, 0); var FileIndex/*:CFBFileIndex*/ = [], FullPaths/*:Array<string>*/ = []; var o = { FileIndex: FileIndex, FullPaths: FullPaths }; init_cfb(o, { root: options.root }); /* find end of central directory, start just after signature */ var i = blob.length - 4; while((blob[i] != 0x50 || blob[i+1] != 0x4b || blob[i+2] != 0x05 || blob[i+3] != 0x06) && i >= 0) --i; blob.l = i + 4; /* parse end of central directory */ blob.l += 4; var fcnt = blob.read_shift(2); blob.l += 6; var start_cd = blob.read_shift(4); /* parse central directory */ blob.l = start_cd; for(i = 0; i < fcnt; ++i) { /* trust local file header instead of CD entry */ blob.l += 20; var csz = blob.read_shift(4); var usz = blob.read_shift(4); var namelen = blob.read_shift(2); var efsz = blob.read_shift(2); var fcsz = blob.read_shift(2); blob.l += 8; var offset = blob.read_shift(4); var EF = parse_extra_field(/*::(*/blob.slice(blob.l+namelen, blob.l+namelen+efsz)/*:: :any)*/); blob.l += namelen + efsz + fcsz; var L = blob.l; blob.l = offset + 4; parse_local_file(blob, csz, usz, o, EF); blob.l = L; } return o; } /* head starts just after local file header signature */ function parse_local_file(blob/*:CFBlob*/, csz/*:number*/, usz/*:number*/, o/*:CFBContainer*/, EF) { /* [local file header] */ blob.l += 2; var flags = blob.read_shift(2); var meth = blob.read_shift(2); var date = parse_dos_date(blob); if(flags & 0x2041) throw new Error("Unsupported ZIP encryption"); var crc32 = blob.read_shift(4); var _csz = blob.read_shift(4); var _usz = blob.read_shift(4); var namelen = blob.read_shift(2); var efsz = blob.read_shift(2); // TODO: flags & (1<<11) // UTF8 var name = ""; for(var i = 0; i < namelen; ++i) name += String.fromCharCode(blob[blob.l++]); if(efsz) { var ef = parse_extra_field(/*::(*/blob.slice(blob.l, blob.l + efsz)/*:: :any)*/); if((ef[0x5455]||{}).mt) date = ef[0x5455].mt; if(((EF||{})[0x5455]||{}).mt) date = EF[0x5455].mt; } blob.l += efsz; /* [encryption header] */ /* [file data] */ var data = blob.slice(blob.l, blob.l + _csz); switch(meth) { case 8: data = _inflateRawSync(blob, _usz); break; case 0: break; // TODO: scan for magic number default: throw new Error("Unsupported ZIP Compression method " + meth); } /* [data descriptor] */ var wrn = false; if(flags & 8) { crc32 = blob.read_shift(4); if(crc32 == 0x08074b50) { crc32 = blob.read_shift(4); wrn = true; } _csz = blob.read_shift(4); _usz = blob.read_shift(4); } if(_csz != csz) warn_or_throw(wrn, "Bad compressed size: " + csz + " != " + _csz); if(_usz != usz) warn_or_throw(wrn, "Bad uncompressed size: " + usz + " != " + _usz); //var _crc32 = CRC32.buf(data, 0); //if((crc32>>0) != (_crc32>>0)) warn_or_throw(wrn, "Bad CRC32 checksum: " + crc32 + " != " + _crc32); cfb_add(o, name, data, {unsafe: true, mt: date}); } function write_zip(cfb/*:CFBContainer*/, options/*:CFBWriteOpts*/)/*:RawBytes*/ { var _opts = options || {}; var out = [], cdirs = []; var o/*:CFBlob*/ = new_buf(1); var method = (_opts.compression ? 8 : 0), flags = 0; var desc = false; if(desc) flags |= 8; var i = 0, j = 0; var start_cd = 0, fcnt = 0; var root = cfb.FullPaths[0], fp = root, fi = cfb.FileIndex[0]; var crcs = []; var sz_cd = 0; for(i = 1; i < cfb.FullPaths.length; ++i) { fp = cfb.FullPaths[i].slice(root.length); fi = cfb.FileIndex[i]; if(!fi.size || !fi.content || fp == "\u0001Sh33tJ5") continue; var start = start_cd; /* TODO: CP437 filename */ var namebuf = new_buf(fp.length); for(j = 0; j < fp.length; ++j) namebuf.write_shift(1, fp.charCodeAt(j) & 0x7F); namebuf = namebuf.slice(0, namebuf.l); crcs[fcnt] = CRC32.buf(/*::((*/fi.content/*::||[]):any)*/, 0); var outbuf = fi.content/*::||[]*/; if(method == 8) outbuf = _deflateRawSync(outbuf); /* local file header */ o = new_buf(30); o.write_shift(4, 0x04034b50); o.write_shift(2, 20); o.write_shift(2, flags); o.write_shift(2, method); /* TODO: last mod file time/date */ if(fi.mt) write_dos_date(o, fi.mt); else o.write_shift(4, 0); o.write_shift(-4, (flags & 8) ? 0 : crcs[fcnt]); o.write_shift(4, (flags & 8) ? 0 : outbuf.length); o.write_shift(4, (flags & 8) ? 0 : /*::(*/fi.content/*::||[])*/.length); o.write_shift(2, namebuf.length); o.write_shift(2, 0); start_cd += o.length; out.push(o); start_cd += namebuf.length; out.push(namebuf); /* TODO: extra fields? */ /* TODO: encryption header ? */ start_cd += outbuf.length; out.push(outbuf); /* data descriptor */ if(flags & 8) { o = new_buf(12); o.write_shift(-4, crcs[fcnt]); o.write_shift(4, outbuf.length); o.write_shift(4, /*::(*/fi.content/*::||[])*/.length); start_cd += o.l; out.push(o); } /* central directory */ o = new_buf(46); o.write_shift(4, 0x02014b50); o.write_shift(2, 0); o.write_shift(2, 20); o.write_shift(2, flags); o.write_shift(2, method); o.write_shift(4, 0); /* TODO: last mod file time/date */ o.write_shift(-4, crcs[fcnt]); o.write_shift(4, outbuf.length); o.write_shift(4, /*::(*/fi.content/*::||[])*/.length); o.write_shift(2, namebuf.length); o.write_shift(2, 0); o.write_shift(2, 0); o.write_shift(2, 0); o.write_shift(2, 0); o.write_shift(4, 0); o.write_shift(4, start); sz_cd += o.l; cdirs.push(o); sz_cd += namebuf.length; cdirs.push(namebuf); ++fcnt; } /* end of central directory */ o = new_buf(22); o.write_shift(4, 0x06054b50); o.write_shift(2, 0); o.write_shift(2, 0); o.write_shift(2, fcnt); o.write_shift(2, fcnt); o.write_shift(4, sz_cd); o.write_shift(4, start_cd); o.write_shift(2, 0); return bconcat(([bconcat((out/*:any*/)), bconcat(cdirs), o]/*:any*/)); } var ContentTypeMap = ({ "htm": "text/html", "xml": "text/xml", "gif": "image/gif", "jpg": "image/jpeg", "png": "image/png", "mso": "application/x-mso", "thmx": "application/vnd.ms-officetheme", "sh33tj5": "application/octet-stream" }/*:any*/); function get_content_type(fi/*:CFBEntry*/, fp/*:string*/)/*:string*/ { if(fi.ctype) return fi.ctype; var ext = fi.name || "", m = ext.match(/\.([^\.]+)$/); if(m && ContentTypeMap[m[1]]) return ContentTypeMap[m[1]]; if(fp) { m = (ext = fp).match(/[\.\\]([^\.\\])+$/); if(m && ContentTypeMap[m[1]]) return ContentTypeMap[m[1]]; } return "application/octet-stream"; } /* 76 character chunks TODO: intertwine encoding */ function write_base64_76(bstr/*:string*/)/*:string*/ { var data = Base64_encode(bstr); var o = []; for(var i = 0; i < data.length; i+= 76) o.push(data.slice(i, i+76)); return o.join("\r\n") + "\r\n"; } /* Rules for QP: - escape =## applies for all non-display characters and literal "=" - space or tab at end of line must be encoded - \r\n newlines can be preserved, but bare \r and \n must be escaped - lines must not exceed 76 characters, use soft breaks =\r\n TODO: Some files from word appear to write line extensions with bare equals: ``` <table class=3DMsoTableGrid border=3D1 cellspacing=3D0 cellpadding=3D0 width= ="70%" ``` */ function write_quoted_printable(text/*:string*/)/*:string*/ { var encoded = text.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7E-\xFF=]/g, function(c) { var w = c.charCodeAt(0).toString(16).toUpperCase(); return "=" + (w.length == 1 ? "0" + w : w); }); encoded = encoded.replace(/ $/mg, "=20").replace(/\t$/mg, "=09"); if(encoded.charAt(0) == "\n") encoded = "=0D" + encoded.slice(1); encoded = encoded.replace(/\r(?!\n)/mg, "=0D").replace(/\n\n/mg, "\n=0A").replace(/([^\r\n])\n/mg, "$1=0A"); var o/*:Array<string>*/ = [], split = encoded.split("\r\n"); for(var si = 0; si < split.length; ++si) { var str = split[si]; if(str.length == 0) { o.push(""); continue; } for(var i = 0; i < str.length;) { var end = 76; var tmp = str.slice(i, i + end); if(tmp.charAt(end - 1) == "=") end --; else if(tmp.charAt(end - 2) == "=") end -= 2; else if(tmp.charAt(end - 3) == "=") end -= 3; tmp = str.slice(i, i + end); i += end; if(i < str.length) tmp += "="; o.push(tmp); } } return o.join("\r\n"); } function parse_quoted_printable(data/*:Array<string>*/)/*:RawBytes*/ { var o = []; /* unify long lines */ for(var di = 0; di < data.length; ++di) { var line = data[di]; while(di <= data.length && line.charAt(line.length - 1) == "=") line = line.slice(0, line.length - 1) + data[++di]; o.push(line); } /* decode */ for(var oi = 0; oi < o.length; ++oi) o[oi] = o[oi].replace(/[=][0-9A-Fa-f]{2}/g, function($$) { return String.fromCharCode(parseInt($$.slice(1), 16)); }); return s2a(o.join("\r\n")); } function parse_mime(cfb/*:CFBContainer*/, data/*:Array<string>*/, root/*:string*/)/*:void*/ { var fname = "", cte = "", ctype = "", fdata; var di = 0; for(;di < 10; ++di) { var line = data[di]; if(!line || line.match(/^\s*$/)) break; var m = line.match(/^(.*?):\s*([^\s].*)$/); if(m) switch(m[1].toLowerCase()) { case "content-location": fname = m[2].trim(); break; case "content-type": ctype = m[2].trim(); break; case "content-transfer-encoding": cte = m[2].trim(); break; } } ++di; switch(cte.toLowerCase()) { case 'base64': fdata = s2a(Base64_decode(data.slice(di).join(""))); break; case 'quoted-printable': fdata = parse_quoted_printable(data.slice(di)); break; default: throw new Error("Unsupported Content-Transfer-Encoding " + cte); } var file = cfb_add(cfb, fname.slice(root.length), fdata, {unsafe: true}); if(ctype) file.ctype = ctype; } function parse_mad(file/*:RawBytes*/, options/*:CFBReadOpts*/)/*:CFBContainer*/ { if(a2s(file.slice(0,13)).toLowerCase() != "mime-version:") throw new Error("Unsupported MAD header"); var root = (options && options.root || ""); // $FlowIgnore var data = (has_buf && Buffer.isBuffer(file) ? file.toString("binary") : a2s(file)).split("\r\n"); var di = 0, row = ""; /* if root is not specified, scan for the common prefix */ for(di = 0; di < data.length; ++di) { row = data[di]; if(!/^Content-Location:/i.test(row)) continue; row = row.slice(row.indexOf("file")); if(!root) root = row.slice(0, row.lastIndexOf("/") + 1); if(row.slice(0, root.length) == root) continue; while(root.length > 0) { root = root.slice(0, root.length - 1); root = root.slice(0, root.lastIndexOf("/") + 1); if(row.slice(0,root.length) == root) break; } } var mboundary = (data[1] || "").match(/boundary="(.*?)"/); if(!mboundary) throw new Error("MAD cannot find boundary"); var boundary = "--" + (mboundary[1] || ""); var FileIndex/*:CFBFileIndex*/ = [], FullPaths/*:Array<string>*/ = []; var o = { FileIndex: FileIndex, FullPaths: FullPaths }; init_cfb(o); var start_di, fcnt = 0; for(di = 0; di < data.length; ++di) { var line = data[di]; if(line !== boundary && line !== boundary + "--") continue; if(fcnt++) parse_mime(o, data.slice(start_di, di), root); start_di = di; } return o; } function write_mad(cfb/*:CFBContainer*/, options/*:CFBWriteOpts*/)/*:string*/ { var opts = options || {}; var boundary = opts.boundary || "SheetJS"; boundary = '------=' + boundary; var out = [ 'MIME-Version: 1.0', 'Content-Type: multipart/related; boundary="' + boundary.slice(2) + '"', '', '', '' ]; var root = cfb.FullPaths[0], fp = root, fi = cfb.FileIndex[0]; for(var i = 1; i < cfb.FullPaths.length; ++i) { fp = cfb.FullPaths[i].slice(root.length); fi = cfb.FileIndex[i]; if(!fi.size || !fi.content || fp == "\u0001Sh33tJ5") continue; /* Normalize filename */ fp = fp.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7E-\xFF]/g, function(c) { return "_x" + c.charCodeAt(0).toString(16) + "_"; }).replace(/[\u0080-\uFFFF]/g, function(u) { return "_u" + u.charCodeAt(0).toString(16) + "_"; }); /* Extract content as binary string */ var ca = fi.content; // $FlowIgnore var cstr = has_buf && Buffer.isBuffer(ca) ? ca.toString("binary") : a2s(ca); /* 4/5 of first 1024 chars ascii -> quoted printable, else base64 */ var dispcnt = 0, L = Math.min(1024, cstr.length), cc = 0; for(var csl = 0; csl <= L; ++csl) if((cc=cstr.charCodeAt(csl)) >= 0x20 && cc < 0x80) ++dispcnt; var qp = dispcnt >= L * 4 / 5; out.push(boundary); out.push('Content-Location: ' + (opts.root || 'file:///C:/SheetJS/') + fp); out.push('Content-Transfer-Encoding: ' + (qp ? 'quoted-printable' : 'base64')); out.push('Content-Type: ' + get_content_type(fi, fp)); out.push(''); out.push(qp ? write_quoted_printable(cstr) : write_base64_76(cstr)); } out.push(boundary + '--\r\n'); return out.join("\r\n"); } function cfb_new(opts/*:?any*/)/*:CFBContainer*/ { var o/*:CFBContainer*/ = ({}/*:any*/); init_cfb(o, opts); return o; } function cfb_add(cfb/*:CFBContainer*/, name/*:string*/, content/*:?RawBytes*/, opts/*:?any*/)/*:CFBEntry*/ { var unsafe = opts && opts.unsafe; if(!unsafe) init_cfb(cfb); var file = !unsafe && CFB.find(cfb, name); if(!file) { var fpath/*:string*/ = cfb.FullPaths[0]; if(name.slice(0, fpath.length) == fpath) fpath = name; else { if(fpath.slice(-1) != "/") fpath += "/"; fpath = (fpath + name).replace("//","/"); } file = ({name: filename(name), type: 2}/*:any*/); cfb.FileIndex.push(file); cfb.FullPaths.push(fpath); if(!unsafe) CFB.utils.cfb_gc(cfb); } /*:: if(!file) throw new Error("unreachable"); */ file.content = (content/*:any*/); file.size = content ? content.length : 0; if(opts) { if(opts.CLSID) file.clsid = opts.CLSID; if(opts.mt) file.mt = opts.mt; if(opts.ct) file.ct = opts.ct; } return file; } function cfb_del(cfb/*:CFBContainer*/, name/*:string*/)/*:boolean*/ { init_cfb(cfb); var file = CFB.find(cfb, name); if(file) for(var j = 0; j < cfb.FileIndex.length; ++j) if(cfb.FileIndex[j] == file) { cfb.FileIndex.splice(j, 1); cfb.FullPaths.splice(j, 1); return true; } return false; } function cfb_mov(cfb/*:CFBContainer*/, old_name/*:string*/, new_name/*:string*/)/*:boolean*/ { init_cfb(cfb); var file = CFB.find(cfb, old_name); if(file) for(var j = 0; j < cfb.FileIndex.length; ++j) if(cfb.FileIndex[j] == file) { cfb.FileIndex[j].name = filename(new_name); cfb.FullPaths[j] = new_name; return true; } return false; } function cfb_gc(cfb/*:CFBContainer*/)/*:void*/ { rebuild_cfb(cfb, true); } exports.find = find; exports.read = read; exports.parse = parse; exports.write = write; exports.writeFile = write_file; exports.utils = { cfb_new: cfb_new, cfb_add: cfb_add, cfb_del: cfb_del, cfb_mov: cfb_mov, cfb_gc: cfb_gc, ReadShift: ReadShift, CheckField: CheckField, prep_blob: prep_blob, bconcat: bconcat, use_zlib: use_zlib, _deflateRaw: _deflate, _inflateRaw: _inflate, consts: consts }; return exports; })(); let _fs = void 0; function set_fs(fs) { _fs = fs; } /* normalize data for blob ctor */ function blobify(data) { if(typeof data === "string") return s2ab(data); if(Array.isArray(data)) return a2u(data); return data; } /* write or download file */ function write_dl(fname/*:string*/, payload/*:any*/, enc/*:?string*/) { /*global IE_SaveFile, Blob, navigator, saveAs, document, File, chrome */ if(typeof _fs !== 'undefined' && _fs.writeFileSync) return enc ? _fs.writeFileSync(fname, payload, enc) : _fs.writeFileSync(fname, payload); if(typeof Deno !== 'undefined') { /* in this spot, it's safe to assume typed arrays and TextEncoder/TextDecoder exist */ if(enc && typeof payload == "string") switch(enc) { case "utf8": payload = new TextEncoder(enc).encode(payload); break; case "binary": payload = s2ab(payload); break; /* TODO: binary equivalent */ default: throw new Error("Unsupported encoding " + enc); } return Deno.writeFileSync(fname, payload); } var data = (enc == "utf8") ? utf8write(payload) : payload; /*:: declare var IE_SaveFile: any; */ if(typeof IE_SaveFile !== 'undefined') return IE_SaveFile(data, fname); if(typeof Blob !== 'undefined') { var blob = new Blob([blobify(data)], {type:"application/octet-stream"}); /*:: declare var navigator: any; */ if(typeof navigator !== 'undefined' && navigator.msSaveBlob) return navigator.msSaveBlob(blob, fname); /*:: declare var saveAs: any; */ if(typeof saveAs !== 'undefined') return saveAs(blob, fname); if(typeof URL !== 'undefined' && typeof document !== 'undefined' && document.createElement && URL.createObjectURL) { var url = URL.createObjectURL(blob); /*:: declare var chrome: any; */ if(typeof chrome === 'object' && typeof (chrome.downloads||{}).download == "function") { if(URL.revokeObjectURL && typeof setTimeout !== 'undefined') setTimeout(function() { URL.revokeObjectURL(url); }, 60000); return chrome.downloads.download({ url: url, filename: fname, saveAs: true}); } var a = document.createElement("a"); if(a.download != null) { /*:: if(document.body == null) throw new Error("unreachable"); */ a.download = fname; a.href = url; document.body.appendChild(a); a.click(); /*:: if(document.body == null) throw new Error("unreachable"); */ document.body.removeChild(a); if(URL.revokeObjectURL && typeof setTimeout !== 'undefined') setTimeout(function() { URL.revokeObjectURL(url); }, 60000); return url; } } } // $FlowIgnore if(typeof $ !== 'undefined' && typeof File !== 'undefined' && typeof Folder !== 'undefined') try { // extendscript // $FlowIgnore var out = File(fname); out.open("w"); out.encoding = "binary"; if(Array.isArray(payload)) payload = a2s(payload); out.write(payload); out.close(); return payload; } catch(e) { if(!e.message || !e.message.match(/onstruct/)) throw e; } throw new Error("cannot save file " + fname); } /* read binary data from file */ function read_binary(path/*:string*/) { if(typeof _fs !== 'undefined') return _fs.readFileSync(path); if(typeof Deno !== 'undefined') return Deno.readFileSync(path); // $FlowIgnore if(typeof $ !== 'undefined' && typeof File !== 'undefined' && typeof Folder !== 'undefined') try { // extendscript // $FlowIgnore var infile = File(path); infile.open("r"); infile.encoding = "binary"; var data = infile.read(); infile.close(); return data; } catch(e) { if(!e.message || !e.message.match(/onstruct/)) throw e; } throw new Error("Cannot access file " + path); } function keys(o/*:any*/)/*:Array<any>*/ { var ks = Object.keys(o), o2 = []; for(var i = 0; i < ks.length; ++i) if(Object.prototype.hasOwnProperty.call(o, ks[i])) o2.push(ks[i]); return o2; } function evert_key(obj/*:any*/, key/*:string*/)/*:EvertType*/ { var o = ([]/*:any*/), K = keys(obj); for(var i = 0; i !== K.length; ++i) if(o[obj[K[i]][key]] == null) o[obj[K[i]][key]] = K[i]; return o; } function evert(obj/*:any*/)/*:EvertType*/ { var o = ([]/*:any*/), K = keys(obj); for(var i = 0; i !== K.length; ++i) o[obj[K[i]]] = K[i]; return o; } function evert_num(obj/*:any*/)/*:EvertNumType*/ { var o = ([]/*:any*/), K = keys(obj); for(var i = 0; i !== K.length; ++i) o[obj[K[i]]] = parseInt(K[i],10); return o; } function evert_arr(obj/*:any*/)/*:EvertArrType*/ { var o/*:EvertArrType*/ = ([]/*:any*/), K = keys(obj); for(var i = 0; i !== K.length; ++i) { if(o[obj[K[i]]] == null) o[obj[K[i]]] = []; o[obj[K[i]]].push(K[i]); } return o; } var basedate = /*#__PURE__*/new Date(1899, 11, 30, 0, 0, 0); // 2209161600000 function datenum(v/*:Date*/, date1904/*:?boolean*/)/*:number*/ { var epoch = /*#__PURE__*/v.getTime(); if(date1904) epoch -= 1462*24*60*60*1000; var dnthresh = /*#__PURE__*/basedate.getTime() + (/*#__PURE__*/v.getTimezoneOffset() - /*#__PURE__*/basedate.getTimezoneOffset()) * 60000; return (epoch - dnthresh) / (24 * 60 * 60 * 1000); } var refdate = /*#__PURE__*/new Date(); var dnthresh = /*#__PURE__*/basedate.getTime() + (/*#__PURE__*/refdate.getTimezoneOffset() - /*#__PURE__*/basedate.getTimezoneOffset()) * 60000; var refoffset = /*#__PURE__*/refdate.getTimezoneOffset(); function numdate(v/*:number*/)/*:Date*/ { var out = new Date(); out.setTime(v * 24 * 60 * 60 * 1000 + dnthresh); if (out.getTimezoneOffset() !== refoffset) { out.setTime(out.getTime() + (out.getTimezoneOffset() - refoffset) * 60000); } return out; } /* ISO 8601 Duration */ function parse_isodur(s) { var sec = 0, mt = 0, time = false; var m = s.match(/P([0-9\.]+Y)?([0-9\.]+M)?([0-9\.]+D)?T([0-9\.]+H)?([0-9\.]+M)?([0-9\.]+S)?/); if(!m) throw new Error("|" + s + "| is not an ISO8601 Duration"); for(var i = 1; i != m.length; ++i) { if(!m[i]) continue; mt = 1; if(i > 3) time = true; switch(m[i].slice(m[i].length-1)) { case 'Y': throw new Error("Unsupported ISO Duration Field: " + m[i].slice(m[i].length-1)); case 'D': mt *= 24; /* falls through */ case 'H': mt *= 60; /* falls through */ case 'M': if(!time) throw new Error("Unsupported ISO Duration Field: M"); else mt *= 60; /* falls through */ case 'S': break; } sec += mt * parseInt(m[i], 10); } return sec; } var good_pd_date_1 = /*#__PURE__*/new Date('2017-02-19T19:06:09.000Z'); var good_pd_date = /*#__PURE__*/isNaN(/*#__PURE__*/good_pd_date_1.getFullYear()) ? /*#__PURE__*/new Date('2/19/17') : good_pd_date_1; var good_pd = /*#__PURE__*/good_pd_date.getFullYear() == 2017; /* parses a date as a local date */ function parseDate(str/*:string|Date*/, fixdate/*:?number*/)/*:Date*/ { var d = new Date(str); if(good_pd) { /*:: if(fixdate == null) fixdate = 0; */ if(fixdate > 0) d.setTime(d.getTime() + d.getTimezoneOffset() * 60 * 1000); else if(fixdate < 0) d.setTime(d.getTime() - d.getTimezoneOffset() * 60 * 1000); return d; } if(str instanceof Date) return str; if(good_pd_date.getFullYear() == 1917 && !isNaN(d.getFullYear())) { var s = d.getFullYear(); if(str.indexOf("" + s) > -1) return d; d.setFullYear(d.getFullYear() + 100); return d; } var n = str.match(/\d+/g)||["2017","2","19","0","0","0"]; var out = new Date(+n[0], +n[1] - 1, +n[2], (+n[3]||0), (+n[4]||0), (+n[5]||0)); if(str.indexOf("Z") > -1) out = new Date(out.getTime() - out.getTimezoneOffset() * 60 * 1000); return out; } function cc2str(arr/*:Array<number>*/, debomit)/*:string*/ { if(has_buf && Buffer.isBuffer(arr)) { if(debomit) { if(arr[0] == 0xFF && arr[1] == 0xFE) return utf8write(arr.slice(2).toString("utf16le")); if(arr[1] == 0xFE && arr[2] == 0xFF) return utf8write(utf16beread(arr.slice(2).toString("binary"))); } return arr.toString("binary"); } if(typeof TextDecoder !== "undefined") try { if(debomit) { if(arr[0] == 0xFF && arr[1] == 0xFE) return utf8write(new TextDecoder("utf-16le").decode(arr.slice(2))); if(arr[0] == 0xFE && arr[1] == 0xFF) return utf8write(new TextDecoder("utf-16be").decode(arr.slice(2))); } var rev = { "\u20ac": "\x80", "\u201a": "\x82", "\u0192": "\x83", "\u201e": "\x84", "\u2026": "\x85", "\u2020": "\x86", "\u2021": "\x87", "\u02c6": "\x88", "\u2030": "\x89", "\u0160": "\x8a", "\u2039": "\x8b", "\u0152": "\x8c", "\u017d": "\x8e", "\u2018": "\x91", "\u2019": "\x92", "\u201c": "\x93", "\u201d": "\x94", "\u2022": "\x95", "\u2013": "\x96", "\u2014": "\x97", "\u02dc": "\x98", "\u2122": "\x99", "\u0161": "\x9a", "\u203a": "\x9b", "\u0153": "\x9c", "\u017e": "\x9e", "\u0178": "\x9f" }; if(Array.isArray(arr)) arr = new Uint8Array(arr); return new TextDecoder("latin1").decode(arr).replace(/[€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ]/g, function(c) { return rev[c] || c; }); } catch(e) {} var o = []; for(var i = 0; i != arr.length; ++i) o.push(String.fromCharCode(arr[i])); return o.join(""); } function dup(o/*:any*/)/*:any*/ { if(typeof JSON != 'undefined' && !Array.isArray(o)) return JSON.parse(JSON.stringify(o)); if(typeof o != 'object' || o == null) return o; if(o instanceof Date) return new Date(o.getTime()); var out = {}; for(var k in o) if(Object.prototype.hasOwnProperty.call(o, k)) out[k] = dup(o[k]); return out; } function fill(c/*:string*/,l/*:number*/)/*:string*/ { var o = ""; while(o.length < l) o+=c; return o; } /* TODO: stress test */ function fuzzynum(s/*:string*/)/*:number*/ { var v/*:number*/ = Number(s); if(!isNaN(v)) return isFinite(v) ? v : NaN; if(!/\d/.test(s)) return v; var wt = 1; var ss = s.replace(/([\d]),([\d])/g,"$1$2").replace(/[$]/g,"").replace(/[%]/g, function() { wt *= 100; return "";}); if(!isNaN(v = Number(ss))) return v / wt; ss = ss.replace(/[(](.*)[)]/,function($$, $1) { wt = -wt; return $1;}); if(!isNaN(v = Number(ss))) return v / wt; return v; } var lower_months = ['january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december']; function fuzzydate(s/*:string*/)/*:Date*/ { var o = new Date(s), n = new Date(NaN); var y = o.getYear(), m = o.getMonth(), d = o.getDate(); if(isNaN(d)) return n; var lower = s.toLowerCase(); if(lower.match(/jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec/)) { lower = lower.replace(/[^a-z]/g,"").replace(/([^a-z]|^)[ap]m?([^a-z]|$)/,""); if(lower.length > 3 && lower_months.indexOf(lower) == -1) return n; } else if(lower.match(/[a-z]/)) return n; if(y < 0 || y > 8099) return n; if((m > 0 || d > 1) && y != 101) return o; if(s.match(/[^-0-9:,\/\\]/)) return n; return o; } var split_regex = /*#__PURE__*/(function() { var safe_split_regex = "abacaba".split(/(:?b)/i).length == 5; return function split_regex(str/*:string*/, re, def/*:string*/)/*:Array<string>*/ { if(safe_split_regex || typeof re == "string") return str.split(re); var p = str.split(re), o = [p[0]]; for(var i = 1; i < p.length; ++i) { o.push(def); o.push(p[i]); } return o; }; })(); function getdatastr(data)/*:?string*/ { if(!data) return null; if(data.content && data.type) return cc2str(data.content, true); if(data.data) return debom(data.data); if(data.asNodeBuffer && has_buf) return debom(data.asNodeBuffer().toString('binary')); if(data.asBinary) return debom(data.asBinary()); if(data._data && data._data.getContent) return debom(cc2str(Array.prototype.slice.call(data._data.getContent(),0))); return null; } function getdatabin(data) { if(!data) return null; if(data.data) return char_codes(data.data); if(data.asNodeBuffer && has_buf) return data.asNodeBuffer(); if(data._data && data._data.getContent) { var o = data._data.getContent(); if(typeof o == "string") return char_codes(o); return Array.prototype.slice.call(o); } if(data.content && data.type) return data.content; return null; } function getdata(data) { return (data && data.name.slice(-4) === ".bin") ? getdatabin(data) : getdatastr(data); } /* Part 2 Section 10.1.2 "Mapping Content Types" Names are case-insensitive */ /* OASIS does not comment on filename case sensitivity */ function safegetzipfile(zip, file/*:string*/) { var k = zip.FullPaths || keys(zip.files); var f = file.toLowerCase().replace(/[\/]/g, '\\'), g = f.replace(/\\/g,'\/'); for(var i=0; i<k.length; ++i) { var n = k[i].replace(/^Root Entry[\/]/,"").toLowerCase(); if(f == n || g == n) return zip.files ? zip.files[k[i]] : zip.FileIndex[i]; } return null; } function getzipfile(zip, file/*:string*/) { var o = safegetzipfile(zip, file); if(o == null) throw new Error("Cannot find file " + file + " in zip"); return o; } function getzipdata(zip, file/*:string*/, safe/*:?boolean*/)/*:any*/ { if(!safe) return getdata(getzipfile(zip, file)); if(!file) return null; try { return getzipdata(zip, file); } catch(e) { return null; } } function getzipstr(zip, file/*:string*/, safe/*:?boolean*/)/*:?string*/ { if(!safe) return getdatastr(getzipfile(zip, file)); if(!file) return null; try { return getzipstr(zip, file); } catch(e) { return null; } } function getzipbin(zip, file/*:string*/, safe/*:?boolean*/)/*:any*/ { if(!safe) return getdatabin(getzipfile(zip, file)); if(!file) return null; try { return getzipbin(zip, file); } catch(e) { return null; } } function zipentries(zip) { var k = zip.FullPaths || keys(zip.files), o = []; for(var i = 0; i < k.length; ++i) if(k[i].slice(-1) != '/') o.push(k[i].replace(/^Root Entry[\/]/, "")); return o.sort(); } function zip_add_file(zip, path, content) { if(zip.FullPaths) { if(typeof content == "string") { var res; if(has_buf) res = Buffer_from(content); /* TODO: investigate performance in Edge 13 */ //else if(typeof TextEncoder !== "undefined") res = new TextEncoder().encode(content); else res = utf8decode(content); return CFB.utils.cfb_add(zip, path, res); } CFB.utils.cfb_add(zip, path, content); } else zip.file(path, content); } function zip_new() { return CFB.utils.cfb_new(); } function zip_read(d, o) { switch(o.type) { case "base64": return CFB.read(d, { type: "base64" }); case "binary": return CFB.read(d, { type: "binary" }); case "buffer": case "array": return CFB.read(d, { type: "buffer" }); } throw new Error("Unrecognized type " + o.type); } function resolve_path(path/*:string*/, base/*:string*/)/*:string*/ { if(path.charAt(0) == "/") return path.slice(1); var result = base.split('/'); if(base.slice(-1) != "/") result.pop(); // folder path var target = path.split('/'); while (target.length !== 0) { var step = target.shift(); if (step === '..') result.pop(); else if (step !== '.') result.push(step); } return result.join('/'); } var XML_HEADER = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n'; var attregexg=/([^"\s?>\/]+)\s*=\s*((?:")([^"]*)(?:")|(?:')([^']*)(?:')|([^'">\s]+))/g; var tagregex1=/<[\/\?]?[a-zA-Z0-9:_-]+(?:\s+[^"\s?>\/]+\s*=\s*(?:"[^"]*"|'[^']*'|[^'">\s=]+))*\s*[\/\?]?>/mg, tagregex2 = /<[^>]*>/g; var tagregex = /*#__PURE__*/XML_HEADER.match(tagregex1) ? tagregex1 : tagregex2; var nsregex=/<\w*:/, nsregex2 = /<(\/?)\w+:/; function parsexmltag(tag/*:string*/, skip_root/*:?boolean*/, skip_LC/*:?boolean*/)/*:any*/ { var z = ({}/*:any*/); var eq = 0, c = 0; for(; eq !== tag.length; ++eq) if((c = tag.charCodeAt(eq)) === 32 || c === 10 || c === 13) break; if(!skip_root) z[0] = tag.slice(0, eq); if(eq === tag.length) return z; var m = tag.match(attregexg), j=0, v="", i=0, q="", cc="", quot = 1; if(m) for(i = 0; i != m.length; ++i) { cc = m[i]; for(c=0; c != cc.length; ++c) if(cc.charCodeAt(c) === 61) break; q = cc.slice(0,c).trim(); while(cc.charCodeAt(c+1) == 32) ++c; quot = ((eq=cc.charCodeAt(c+1)) == 34 || eq == 39) ? 1 : 0; v = cc.slice(c+1+quot, cc.length-quot); for(j=0;j!=q.length;++j) if(q.charCodeAt(j) === 58) break; if(j===q.length) { if(q.indexOf("_") > 0) q = q.slice(0, q.indexOf("_")); // from ods z[q] = v; if(!skip_LC) z[q.toLowerCase()] = v; } else { var k = (j===5 && q.slice(0,5)==="xmlns"?"xmlns":"")+q.slice(j+1); if(z[k] && q.slice(j-3,j) == "ext") continue; // from ods z[k] = v; if(!skip_LC) z[k.toLowerCase()] = v; } } return z; } function strip_ns(x/*:string*/)/*:string*/ { return x.replace(nsregex2, "<$1"); } var encodings = { '"': '"', ''': "'", '>': '>', '<': '<', '&': '&' }; var rencoding = /*#__PURE__*/evert(encodings); //var rencstr = "&<>'\"".split(""); // TODO: CP remap (need to read file version to determine OS) var unescapexml/*:StringConv*/ = /*#__PURE__*/(function() { /* 22.4.2.4 bstr (Basic String) */ var encregex = /&(?:quot|apos|gt|lt|amp|#x?([\da-fA-F]+));/ig, coderegex = /_x([\da-fA-F]{4})_/ig; return function unescapexml(text/*:string*/)/*:string*/ { var s = text + '', i = s.indexOf("<![CDATA["); if(i == -1) return s.replace(encregex, function($$, $1) { return encodings[$$]||String.fromCharCode(parseInt($1,$$.indexOf("x")>-1?16:10))||$$; }).replace(coderegex,function(m,c) {return String.fromCharCode(parseInt(c,16));}); var j = s.indexOf("]]>"); return unescapexml(s.slice(0, i)) + s.slice(i+9,j) + unescapexml(s.slice(j+3)); }; })(); var decregex=/[&<>'"]/g, charegex = /[\u0000-\u0008\u000b-\u001f]/g; function escapexml(text/*:string*/)/*:string*/{ var s = text + ''; return s.replace(decregex, function(y) { return rencoding[y]; }).replace(charegex,function(s) { return "_x" + ("000"+s.charCodeAt(0).toString(16)).slice(-4) + "_";}); } function escapexmltag(text/*:string*/)/*:string*/{ return escapexml(text).replace(/ /g,"_x0020_"); } var htmlcharegex = /[\u0000-\u001f]/g; function escapehtml(text/*:string*/)/*:string*/{ var s = text + ''; return s.replace(decregex, function(y) { return rencoding[y]; }).replace(/\n/g, "<br/>").replace(htmlcharegex,function(s) { return "&#x" + ("000"+s.charCodeAt(0).toString(16)).slice(-4) + ";"; }); } function escapexlml(text/*:string*/)/*:string*/{ var s = text + ''; return s.replace(decregex, function(y) { return rencoding[y]; }).replace(htmlcharegex,function(s) { return "&#x" + (s.charCodeAt(0).toString(16)).toUpperCase() + ";"; }); } /* TODO: handle codepages */ var xlml_fixstr/*:StringConv*/ = /*#__PURE__*/(function() { var entregex = /&#(\d+);/g; function entrepl($$/*:string*/,$1/*:string*/)/*:string*/ { return String.fromCharCode(parseInt($1,10)); } return function xlml_fixstr(str/*:string*/)/*:string*/ { return str.replace(entregex,entrepl); }; })(); function xlml_unfixstr(str/*:string*/)/*:string*/ { return str.replace(/(\r\n|[\r\n])/g,"\ "); } function parsexmlbool(value/*:any*/)/*:boolean*/ { switch(value) { case 1: case true: case '1': case 'true': case 'TRUE': return true; /* case '0': case 'false': case 'FALSE':*/ default: return false; } } function utf8reada(orig/*:string*/)/*:string*/ { var out = "", i = 0, c = 0, d = 0, e = 0, f = 0, w = 0; while (i < orig.length) { c = orig.charCodeAt(i++); if (c < 128) { out += String.fromCharCode(c); continue; } d = orig.charCodeAt(i++); if (c>191 && c<224) { f = ((c & 31) << 6); f |= (d & 63); out += String.fromCharCode(f); continue; } e = orig.charCodeAt(i++); if (c < 240) { out += String.fromCharCode(((c & 15) << 12) | ((d & 63) << 6) | (e & 63)); continue; } f = orig.charCodeAt(i++); w = (((c & 7) << 18) | ((d & 63) << 12) | ((e & 63) << 6) | (f & 63))-65536; out += String.fromCharCode(0xD800 + ((w>>>10)&1023)); out += String.fromCharCode(0xDC00 + (w&1023)); } return out; } function utf8readb(data) { var out = new_raw_buf(2*data.length), w, i, j = 1, k = 0, ww=0, c; for(i = 0; i < data.length; i+=j) { j = 1; if((c=data.charCodeAt(i)) < 128) w = c; else if(c < 224) { w = (c&31)*64+(data.charCodeAt(i+1)&63); j=2; } else if(c < 240) { w=(c&15)*4096+(data.charCodeAt(i+1)&63)*64+(data.charCodeAt(i+2)&63); j=3; } else { j = 4; w = (c & 7)*262144+(data.charCodeAt(i+1)&63)*4096+(data.charCodeAt(i+2)&63)*64+(data.charCodeAt(i+3)&63); w -= 65536; ww = 0xD800 + ((w>>>10)&1023); w = 0xDC00 + (w&1023); } if(ww !== 0) { out[k++] = ww&255; out[k++] = ww>>>8; ww = 0; } out[k++] = w%256; out[k++] = w>>>8; } return out.slice(0,k).toString('ucs2'); } function utf8readc(data) { return Buffer_from(data, 'binary').toString('utf8'); } var utf8corpus = "foo bar baz\u00e2\u0098\u0083\u00f0\u009f\u008d\u00a3"; var utf8read = has_buf && (/*#__PURE__*/utf8readc(utf8corpus) == /*#__PURE__*/utf8reada(utf8corpus) && utf8readc || /*#__PURE__*/utf8readb(utf8corpus) == /*#__PURE__*/utf8reada(utf8corpus) && utf8readb) || utf8reada; var utf8write/*:StringConv*/ = has_buf ? function(data) { return Buffer_from(data, 'utf8').toString("binary"); } : function(orig/*:string*/)/*:string*/ { var out/*:Array<string>*/ = [], i = 0, c = 0, d = 0; while(i < orig.length) { c = orig.charCodeAt(i++); switch(true) { case c < 128: out.push(String.fromCharCode(c)); break; case c < 2048: out.push(String.fromCharCode(192 + (c >> 6))); out.push(String.fromCharCode(128 + (c & 63))); break; case c >= 55296 && c < 57344: c -= 55296; d = orig.charCodeAt(i++) - 56320 + (c<<10); out.push(String.fromCharCode(240 + ((d >>18) & 7))); out.push(String.fromCharCode(144 + ((d >>12) & 63))); out.push(String.fromCharCode(128 + ((d >> 6) & 63))); out.push(String.fromCharCode(128 + (d & 63))); break; default: out.push(String.fromCharCode(224 + (c >> 12))); out.push(String.fromCharCode(128 + ((c >> 6) & 63))); out.push(String.fromCharCode(128 + (c & 63))); } } return out.join(""); }; // matches <foo>...</foo> extracts content var matchtag = /*#__PURE__*/(function() { var mtcache/*:{[k:string]:RegExp}*/ = ({}/*:any*/); return function matchtag(f/*:string*/,g/*:?string*/)/*:RegExp*/ { var t = f+"|"+(g||""); if(mtcache[t]) return mtcache[t]; return (mtcache[t] = new RegExp('<(?:\\w+:)?'+f+'(?: xml:space="preserve")?(?:[^>]*)>([\\s\\S]*?)</(?:\\w+:)?'+f+'>',((g||"")/*:any*/))); }; })(); var htmldecode/*:{(s:string):string}*/ = /*#__PURE__*/(function() { var entities/*:Array<[RegExp, string]>*/ = [ ['nbsp', ' '], ['middot', '·'], ['quot', '"'], ['apos', "'"], ['gt', '>'], ['lt', '<'], ['amp', '&'] ].map(function(x/*:[string, string]*/) { return [new RegExp('&' + x[0] + ';', "ig"), x[1]]; }); return function htmldecode(str/*:string*/)/*:string*/ { var o = str // Remove new lines and spaces from start of content .replace(/^[\t\n\r ]+/, "") // Remove new lines and spaces from end of content .replace(/[\t\n\r ]+$/,"") // Added line which removes any white space characters after and before html tags .replace(/>\s+/g,">").replace(/\s+</g,"<") // Replace remaining new lines and spaces with space .replace(/[\t\n\r ]+/g, " ") // Replace <br> tags with new lines .replace(/<\s*[bB][rR]\s*\/?>/g,"\n") // Strip HTML elements .replace(/<[^>]*>/g,""); for(var i = 0; i < entities.length; ++i) o = o.replace(entities[i][0], entities[i][1]); return o; }; })(); var vtregex = /*#__PURE__*/(function(){ var vt_cache = {}; return function vt_regex(bt) { if(vt_cache[bt] !== undefined) return vt_cache[bt]; return (vt_cache[bt] = new RegExp("<(?:vt:)?" + bt + ">([\\s\\S]*?)</(?:vt:)?" + bt + ">", 'g') ); };})(); var vtvregex = /<\/?(?:vt:)?variant>/g, vtmregex = /<(?:vt:)([^>]*)>([\s\S]*)</; function parseVector(data/*:string*/, opts)/*:Array<{v:string,t:string}>*/ { var h = parsexmltag(data); var matches/*:Array<string>*/ = data.match(vtregex(h.baseType))||[]; var res/*:Array<any>*/ = []; if(matches.length != h.size) { if(opts.WTF) throw new Error("unexpected vector length " + matches.length + " != " + h.size); return res; } matches.forEach(function(x/*:string*/) { var v = x.replace(vtvregex,"").match(vtmregex); if(v) res.push({v:utf8read(v[2]), t:v[1]}); }); return res; } var wtregex = /(^\s|\s$|\n)/; function writetag(f/*:string*/,g/*:string*/)/*:string*/ { return '<' + f + (g.match(wtregex)?' xml:space="preserve"' : "") + '>' + g + '</' + f + '>'; } function wxt_helper(h)/*:string*/ { return keys(h).map(function(k) { return " " + k + '="' + h[k] + '"';}).join(""); } function writextag(f/*:string*/,g/*:?string*/,h) { return '<' + f + ((h != null) ? wxt_helper(h) : "") + ((g != null) ? (g.match(wtregex)?' xml:space="preserve"' : "") + '>' + g + '</' + f : "/") + '>';} function write_w3cdtf(d/*:Date*/, t/*:?boolean*/)/*:string*/ { try { return d.toISOString().replace(/\.\d*/,""); } catch(e) { if(t) throw e; } return ""; } function write_vt(s, xlsx/*:?boolean*/)/*:string*/ { switch(typeof s) { case 'string': var o = writextag('vt:lpwstr', escapexml(s)); if(xlsx) o = o.replace(/"/g, "_x0022_"); return o; case 'number': return writextag((s|0)==s?'vt:i4':'vt:r8', escapexml(String(s))); case 'boolean': return writextag('vt:bool',s?'true':'false'); } if(s instanceof Date) return writextag('vt:filetime', write_w3cdtf(s)); throw new Error("Unable to serialize " + s); } function xlml_normalize(d)/*:string*/ { if(has_buf &&/*::typeof Buffer !== "undefined" && d != null && d instanceof Buffer &&*/ Buffer.isBuffer(d)) return d.toString('utf8'); if(typeof d === 'string') return d; /* duktape */ if(typeof Uint8Array !== 'undefined' && d instanceof Uint8Array) return utf8read(a2s(ab2a(d))); throw new Error("Bad input format: expected Buffer or string"); } /* UOS uses CJK in tags */ var xlmlregex = /<(\/?)([^\s?><!\/:]*:|)([^\s?<>:\/]+)(?:[\s?:\/][^>]*)?>/mg; //var xlmlregex = /<(\/?)([a-z0-9]*:|)(\w+)[^>]*>/mg; var XMLNS = ({ CORE_PROPS: 'http://schemas.openxmlformats.org/package/2006/metadata/core-properties', CUST_PROPS: "http://schemas.openxmlformats.org/officeDocument/2006/custom-properties", EXT_PROPS: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties", CT: 'http://schemas.openxmlformats.org/package/2006/content-types', RELS: 'http://schemas.openxmlformats.org/package/2006/relationships', TCMNT: 'http://schemas.microsoft.com/office/spreadsheetml/2018/threadedcomments', 'dc': 'http://purl.org/dc/elements/1.1/', 'dcterms': 'http://purl.org/dc/terms/', 'dcmitype': 'http://purl.org/dc/dcmitype/', 'mx': 'http://schemas.microsoft.com/office/mac/excel/2008/main', 'r': 'http://schemas.openxmlformats.org/officeDocument/2006/relationships', 'sjs': 'http://schemas.openxmlformats.org/package/2006/sheetjs/core-properties', 'vt': 'http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes', 'xsi': 'http://www.w3.org/2001/XMLSchema-instance', 'xsd': 'http://www.w3.org/2001/XMLSchema' }/*:any*/); var XMLNS_main = [ 'http://schemas.openxmlformats.org/spreadsheetml/2006/main', 'http://purl.oclc.org/ooxml/spreadsheetml/main', 'http://schemas.microsoft.com/office/excel/2006/main', 'http://schemas.microsoft.com/office/excel/2006/2' ]; var XLMLNS = ({ 'o': 'urn:schemas-microsoft-com:office:office', 'x': 'urn:schemas-microsoft-com:office:excel', 'ss': 'urn:schemas-microsoft-com:office:spreadsheet', 'dt': 'uuid:C2F41010-65B3-11d1-A29F-00AA00C14882', 'mv': 'http://macVmlSchemaUri', 'v': 'urn:schemas-microsoft-com:vml', 'html': 'http://www.w3.org/TR/REC-html40' }/*:any*/); function read_double_le(b/*:RawBytes|CFBlob*/, idx/*:number*/)/*:number*/ { var s = 1 - 2 * (b[idx + 7] >>> 7); var e = ((b[idx + 7] & 0x7f) << 4) + ((b[idx + 6] >>> 4) & 0x0f); var m = (b[idx+6]&0x0f); for(var i = 5; i >= 0; --i) m = m * 256 + b[idx + i]; if(e == 0x7ff) return m == 0 ? (s * Infinity) : NaN; if(e == 0) e = -1022; else { e -= 1023; m += Math.pow(2,52); } return s * Math.pow(2, e - 52) * m; } function write_double_le(b/*:RawBytes|CFBlob*/, v/*:number*/, idx/*:number*/) { var bs = ((((v < 0) || (1/v == -Infinity)) ? 1 : 0) << 7), e = 0, m = 0; var av = bs ? (-v) : v; if(!isFinite(av)) { e = 0x7ff; m = isNaN(v) ? 0x6969 : 0; } else if(av == 0) e = m = 0; else { e = Math.floor(Math.log(av) / Math.LN2); m = av * Math.pow(2, 52 - e); if((e <= -1023) && (!isFinite(m) || (m < Math.pow(2,52)))) { e = -1022; } else { m -= Math.pow(2,52); e+=1023; } } for(var i = 0; i <= 5; ++i, m/=256) b[idx + i] = m & 0xff; b[idx + 6] = ((e & 0x0f) << 4) | (m & 0xf); b[idx + 7] = (e >> 4) | bs; } var ___toBuffer = function(bufs/*:Array<Array<RawBytes> >*/)/*:RawBytes*/ { var x=[],w=10240; for(var i=0;i<bufs[0].length;++i) if(bufs[0][i]) for(var j=0,L=bufs[0][i].length;j<L;j+=w) x.push.apply(x, bufs[0][i].slice(j,j+w)); return x; }; var __toBuffer = has_buf ? function(bufs) { return (bufs[0].length > 0 && Buffer.isBuffer(bufs[0][0])) ? Buffer.concat(bufs[0].map(function(x) { return Buffer.isBuffer(x) ? x : Buffer_from(x); })) : ___toBuffer(bufs);} : ___toBuffer; var ___utf16le = function(b/*:RawBytes|CFBlob*/,s/*:number*/,e/*:number*/)/*:string*/ { var ss/*:Array<string>*/=[]; for(var i=s; i<e; i+=2) ss.push(String.fromCharCode(__readUInt16LE(b,i))); return ss.join("").replace(chr0,''); }; var __utf16le = has_buf ? function(b/*:RawBytes|CFBlob*/,s/*:number*/,e/*:number*/)/*:string*/ { if(!Buffer.isBuffer(b)/*:: || !(b instanceof Buffer)*/) return ___utf16le(b,s,e); return b.toString('utf16le',s,e).replace(chr0,'')/*.replace(chr1,'!')*/; } : ___utf16le; var ___hexlify = function(b/*:RawBytes|CFBlob*/,s/*:number*/,l/*:number*/)/*:string*/ { var ss/*:Array<string>*/=[]; for(var i=s; i<s+l; ++i) ss.push(("0" + b[i].toString(16)).slice(-2)); return ss.join(""); }; var __hexlify = has_buf ? function(b/*:RawBytes|CFBlob*/,s/*:number*/,l/*:number*/)/*:string*/ { return Buffer.isBuffer(b)/*:: && b instanceof Buffer*/ ? b.toString('hex',s,s+l) : ___hexlify(b,s,l); } : ___hexlify; var ___utf8 = function(b/*:RawBytes|CFBlob*/,s/*:number*/,e/*:number*/) { var ss=[]; for(var i=s; i<e; i++) ss.push(String.fromCharCode(__readUInt8(b,i))); return ss.join(""); }; var __utf8 = has_buf ? function utf8_b(b/*:RawBytes|CFBlob*/, s/*:number*/, e/*:number*/) { return (Buffer.isBuffer(b)/*:: && (b instanceof Buffer)*/) ? b.toString('utf8',s,e) : ___utf8(b,s,e); } : ___utf8; var ___lpstr = function(b/*:RawBytes|CFBlob*/,i/*:number*/) { var len = __readUInt32LE(b,i); return len > 0 ? __utf8(b, i+4,i+4+len-1) : "";}; var __lpstr = ___lpstr; var ___cpstr = function(b/*:RawBytes|CFBlob*/,i/*:number*/) { var len = __readUInt32LE(b,i); return len > 0 ? __utf8(b, i+4,i+4+len-1) : "";}; var __cpstr = ___cpstr; var ___lpwstr = function(b/*:RawBytes|CFBlob*/,i/*:number*/) { var len = 2*__readUInt32LE(b,i); return len > 0 ? __utf8(b, i+4,i+4+len-1) : "";}; var __lpwstr = ___lpwstr; var ___lpp4 = function lpp4_(b/*:RawBytes|CFBlob*/,i/*:number*/) { var len = __readUInt32LE(b,i); return len > 0 ? __utf16le(b, i+4,i+4+len) : "";}; var __lpp4 = ___lpp4; var ___8lpp4 = function(b/*:RawBytes|CFBlob*/,i/*:number*/) { var len = __readUInt32LE(b,i); return len > 0 ? __utf8(b, i+4,i+4+len) : "";}; var __8lpp4 = ___8lpp4; var ___double = function(b/*:RawBytes|CFBlob*/, idx/*:number*/) { return read_double_le(b, idx);}; var __double = ___double; var is_buf = function is_buf_a(a) { return Array.isArray(a) || (typeof Uint8Array !== "undefined" && a instanceof Uint8Array); }; if(has_buf/*:: && typeof Buffer !== 'undefined'*/) { __lpstr = function lpstr_b(b/*:RawBytes|CFBlob*/, i/*:number*/) { if(!Buffer.isBuffer(b)/*:: || !(b instanceof Buffer)*/) return ___lpstr(b, i); var len = b.readUInt32LE(i); return len > 0 ? b.toString('utf8',i+4,i+4+len-1) : "";}; __cpstr = function cpstr_b(b/*:RawBytes|CFBlob*/, i/*:number*/) { if(!Buffer.isBuffer(b)/*:: || !(b instanceof Buffer)*/) return ___cpstr(b, i); var len = b.readUInt32LE(i); return len > 0 ? b.toString('utf8',i+4,i+4+len-1) : "";}; __lpwstr = function lpwstr_b(b/*:RawBytes|CFBlob*/, i/*:number*/) { if(!Buffer.isBuffer(b)/*:: || !(b instanceof Buffer)*/) return ___lpwstr(b, i); var len = 2*b.readUInt32LE(i); return b.toString('utf16le',i+4,i+4+len-1);}; __lpp4 = function lpp4_b(b/*:RawBytes|CFBlob*/, i/*:number*/) { if(!Buffer.isBuffer(b)/*:: || !(b instanceof Buffer)*/) return ___lpp4(b, i); var len = b.readUInt32LE(i); return b.toString('utf16le',i+4,i+4+len);}; __8lpp4 = function lpp4_8b(b/*:RawBytes|CFBlob*/, i/*:number*/) { if(!Buffer.isBuffer(b)/*:: || !(b instanceof Buffer)*/) return ___8lpp4(b, i); var len = b.readUInt32LE(i); return b.toString('utf8',i+4,i+4+len);}; __double = function double_(b/*:RawBytes|CFBlob*/, i/*:number*/) { if(Buffer.isBuffer(b)/*::&& b instanceof Buffer*/) return b.readDoubleLE(i); return ___double(b,i); }; is_buf = function is_buf_b(a) { return Buffer.isBuffer(a) || Array.isArray(a) || (typeof Uint8Array !== "undefined" && a instanceof Uint8Array); }; } /* from js-xls */ function cpdoit() { __utf16le = function(b/*:RawBytes|CFBlob*/,s/*:number*/,e/*:number*/) { return $cptable.utils.decode(1200, b.slice(s,e)).replace(chr0, ''); }; __utf8 = function(b/*:RawBytes|CFBlob*/,s/*:number*/,e/*:number*/) { return $cptable.utils.decode(65001, b.slice(s,e)); }; __lpstr = function(b/*:RawBytes|CFBlob*/,i/*:number*/) { var len = __readUInt32LE(b,i); return len > 0 ? $cptable.utils.decode(current_ansi, b.slice(i+4, i+4+len-1)) : "";}; __cpstr = function(b/*:RawBytes|CFBlob*/,i/*:number*/) { var len = __readUInt32LE(b,i); return len > 0 ? $cptable.utils.decode(current_codepage, b.slice(i+4, i+4+len-1)) : "";}; __lpwstr = function(b/*:RawBytes|CFBlob*/,i/*:number*/) { var len = 2*__readUInt32LE(b,i); return len > 0 ? $cptable.utils.decode(1200, b.slice(i+4,i+4+len-1)) : "";}; __lpp4 = function(b/*:RawBytes|CFBlob*/,i/*:number*/) { var len = __readUInt32LE(b,i); return len > 0 ? $cptable.utils.decode(1200, b.slice(i+4,i+4+len)) : "";}; __8lpp4 = function(b/*:RawBytes|CFBlob*/,i/*:number*/) { var len = __readUInt32LE(b,i); return len > 0 ? $cptable.utils.decode(65001, b.slice(i+4,i+4+len)) : "";}; } if(typeof $cptable !== 'undefined') cpdoit(); var __readUInt8 = function(b/*:RawBytes|CFBlob*/, idx/*:number*/)/*:number*/ { return b[idx]; }; var __readUInt16LE = function(b/*:RawBytes|CFBlob*/, idx/*:number*/)/*:number*/ { return (b[idx+1]*(1<<8))+b[idx]; }; var __readInt16LE = function(b/*:RawBytes|CFBlob*/, idx/*:number*/)/*:number*/ { var u = (b[idx+1]*(1<<8))+b[idx]; return (u < 0x8000) ? u : ((0xffff - u + 1) * -1); }; var __readUInt32LE = function(b/*:RawBytes|CFBlob*/, idx/*:number*/)/*:number*/ { return b[idx+3]*(1<<24)+(b[idx+2]<<16)+(b[idx+1]<<8)+b[idx]; }; var __readInt32LE = function(b/*:RawBytes|CFBlob*/, idx/*:number*/)/*:number*/ { return (b[idx+3]<<24)|(b[idx+2]<<16)|(b[idx+1]<<8)|b[idx]; }; var __readInt32BE = function(b/*:RawBytes|CFBlob*/, idx/*:number*/)/*:number*/ { return (b[idx]<<24)|(b[idx+1]<<16)|(b[idx+2]<<8)|b[idx+3]; }; function ReadShift(size/*:number*/, t/*:?string*/)/*:number|string*/ { var o="", oI/*:: :number = 0*/, oR, oo=[], w, vv, i, loc; switch(t) { case 'dbcs': loc = this.l; if(has_buf && Buffer.isBuffer(this)) o = this.slice(this.l, this.l+2*size).toString("utf16le"); else for(i = 0; i < size; ++i) { o+=String.fromCharCode(__readUInt16LE(this, loc)); loc+=2; } size *= 2; break; case 'utf8': o = __utf8(this, this.l, this.l + size); break; case 'utf16le': size *= 2; o = __utf16le(this, this.l, this.l + size); break; case 'wstr': if(typeof $cptable !== 'undefined') o = $cptable.utils.decode(current_codepage, this.slice(this.l, this.l+2*size)); else return ReadShift.call(this, size, 'dbcs'); size = 2 * size; break; /* [MS-OLEDS] 2.1.4 LengthPrefixedAnsiString */ case 'lpstr-ansi': o = __lpstr(this, this.l); size = 4 + __readUInt32LE(this, this.l); break; case 'lpstr-cp': o = __cpstr(this, this.l); size = 4 + __readUInt32LE(this, this.l); break; /* [MS-OLEDS] 2.1.5 LengthPrefixedUnicodeString */ case 'lpwstr': o = __lpwstr(this, this.l); size = 4 + 2 * __readUInt32LE(this, this.l); break; /* [MS-OFFCRYPTO] 2.1.2 Length-Prefixed Padded Unicode String (UNICODE-LP-P4) */ case 'lpp4': size = 4 + __readUInt32LE(this, this.l); o = __lpp4(this, this.l); if(size & 0x02) size += 2; break; /* [MS-OFFCRYPTO] 2.1.3 Length-Prefixed UTF-8 String (UTF-8-LP-P4) */ case '8lpp4': size = 4 + __readUInt32LE(this, this.l); o = __8lpp4(this, this.l); if(size & 0x03) size += 4 - (size & 0x03); break; case 'cstr': size = 0; o = ""; while((w=__readUInt8(this, this.l + size++))!==0) oo.push(_getchar(w)); o = oo.join(""); break; case '_wstr': size = 0; o = ""; while((w=__readUInt16LE(this,this.l +size))!==0){oo.push(_getchar(w));size+=2;} size+=2; o = oo.join(""); break; /* sbcs and dbcs support continue records in the SST way TODO codepages */ case 'dbcs-cont': o = ""; loc = this.l; for(i = 0; i < size; ++i) { if(this.lens && this.lens.indexOf(loc) !== -1) { w = __readUInt8(this, loc); this.l = loc + 1; vv = ReadShift.call(this, size-i, w ? 'dbcs-cont' : 'sbcs-cont'); return oo.join("") + vv; } oo.push(_getchar(__readUInt16LE(this, loc))); loc+=2; } o = oo.join(""); size *= 2; break; case 'cpstr': if(typeof $cptable !== 'undefined') { o = $cptable.utils.decode(current_codepage, this.slice(this.l, this.l + size)); break; } /* falls through */ case 'sbcs-cont': o = ""; loc = this.l; for(i = 0; i != size; ++i) { if(this.lens && this.lens.indexOf(loc) !== -1) { w = __readUInt8(this, loc); this.l = loc + 1; vv = ReadShift.call(this, size-i, w ? 'dbcs-cont' : 'sbcs-cont'); return oo.join("") + vv; } oo.push(_getchar(__readUInt8(this, loc))); loc+=1; } o = oo.join(""); break; default: switch(size) { case 1: oI = __readUInt8(this, this.l); this.l++; return oI; case 2: oI = (t === 'i' ? __readInt16LE : __readUInt16LE)(this, this.l); this.l += 2; return oI; case 4: case -4: if(t === 'i' || ((this[this.l+3] & 0x80)===0)) { oI = ((size > 0) ? __readInt32LE : __readInt32BE)(this, this.l); this.l += 4; return oI; } else { oR = __readUInt32LE(this, this.l); this.l += 4; } return oR; case 8: case -8: if(t === 'f') { if(size == 8) oR = __double(this, this.l); else oR = __double([this[this.l+7],this[this.l+6],this[this.l+5],this[this.l+4],this[this.l+3],this[this.l+2],this[this.l+1],this[this.l+0]], 0); this.l += 8; return oR; } else size = 8; /* falls through */ case 16: o = __hexlify(this, this.l, size); break; }} this.l+=size; return o; } var __writeUInt32LE = function(b/*:RawBytes|CFBlob*/, val/*:number*/, idx/*:number*/)/*:void*/ { b[idx] = (val & 0xFF); b[idx+1] = ((val >>> 8) & 0xFF); b[idx+2] = ((val >>> 16) & 0xFF); b[idx+3] = ((val >>> 24) & 0xFF); }; var __writeInt32LE = function(b/*:RawBytes|CFBlob*/, val/*:number*/, idx/*:number*/)/*:void*/ { b[idx] = (val & 0xFF); b[idx+1] = ((val >> 8) & 0xFF); b[idx+2] = ((val >> 16) & 0xFF); b[idx+3] = ((val >> 24) & 0xFF); }; var __writeUInt16LE = function(b/*:RawBytes|CFBlob*/, val/*:number*/, idx/*:number*/)/*:void*/ { b[idx] = (val & 0xFF); b[idx+1] = ((val >>> 8) & 0xFF); }; function WriteShift(t/*:number*/, val/*:string|number*/, f/*:?string*/)/*:any*/ { var size = 0, i = 0; if(f === 'dbcs') { /*:: if(typeof val !== 'string') throw new Error("unreachable"); */ for(i = 0; i != val.length; ++i) __writeUInt16LE(this, val.charCodeAt(i), this.l + 2 * i); size = 2 * val.length; } else if(f === 'sbcs') { if(typeof $cptable !== 'undefined' && current_ansi == 874) { /* TODO: use tables directly, don't encode */ /*:: if(typeof val !== "string") throw new Error("unreachable"); */ for(i = 0; i != val.length; ++i) { var cppayload = $cptable.utils.encode(current_ansi, val.charAt(i)); this[this.l + i] = cppayload[0]; } } else { /*:: if(typeof val !== 'string') throw new Error("unreachable"); */ val = val.replace(/[^\x00-\x7F]/g, "_"); /*:: if(typeof val !== 'string') throw new Error("unreachable"); */ for(i = 0; i != val.length; ++i) this[this.l + i] = (val.charCodeAt(i) & 0xFF); } size = val.length; } else if(f === 'hex') { for(; i < t; ++i) { /*:: if(typeof val !== "string") throw new Error("unreachable"); */ this[this.l++] = (parseInt(val.slice(2*i, 2*i+2), 16)||0); } return this; } else if(f === 'utf16le') { /*:: if(typeof val !== "string") throw new Error("unreachable"); */ var end/*:number*/ = Math.min(this.l + t, this.length); for(i = 0; i < Math.min(val.length, t); ++i) { var cc = val.charCodeAt(i); this[this.l++] = (cc & 0xff); this[this.l++] = (cc >> 8); } while(this.l < end) this[this.l++] = 0; return this; } else /*:: if(typeof val === 'number') */ switch(t) { case 1: size = 1; this[this.l] = val&0xFF; break; case 2: size = 2; this[this.l] = val&0xFF; val >>>= 8; this[this.l+1] = val&0xFF; break; case 3: size = 3; this[this.l] = val&0xFF; val >>>= 8; this[this.l+1] = val&0xFF; val >>>= 8; this[this.l+2] = val&0xFF; break; case 4: size = 4; __writeUInt32LE(this, val, this.l); break; case 8: size = 8; if(f === 'f') { write_double_le(this, val, this.l); break; } /* falls through */ case 16: break; case -4: size = 4; __writeInt32LE(this, val, this.l); break; } this.l += size; return this; } function CheckField(hexstr/*:string*/, fld/*:string*/)/*:void*/ { var m = __hexlify(this,this.l,hexstr.length>>1); if(m !== hexstr) throw new Error(fld + 'Expected ' + hexstr + ' saw ' + m); this.l += hexstr.length>>1; } function prep_blob(blob, pos/*:number*/)/*:void*/ { blob.l = pos; blob.read_shift = /*::(*/ReadShift/*:: :any)*/; blob.chk = CheckField; blob.write_shift = WriteShift; } function parsenoop(blob, length/*:: :number, opts?:any */) { blob.l += length; } function new_buf(sz/*:number*/)/*:Block*/ { var o = new_raw_buf(sz); prep_blob(o, 0); return o; } /* [MS-XLSB] 2.1.4 Record */ function recordhopper(data, cb/*:RecordHopperCB*/, opts/*:?any*/) { if(!data) return; var tmpbyte, cntbyte, length; prep_blob(data, data.l || 0); var L = data.length, RT = 0, tgt = 0; while(data.l < L) { RT = data.read_shift(1); if(RT & 0x80) RT = (RT & 0x7F) + ((data.read_shift(1) & 0x7F)<<7); var R = XLSBRecordEnum[RT] || XLSBRecordEnum[0xFFFF]; tmpbyte = data.read_shift(1); length = tmpbyte & 0x7F; for(cntbyte = 1; cntbyte <4 && (tmpbyte & 0x80); ++cntbyte) length += ((tmpbyte = data.read_shift(1)) & 0x7F)<<(7*cntbyte); tgt = data.l + length; var d = R.f && R.f(data, length, opts); data.l = tgt; if(cb(d, R, RT)) return; } } /* control buffer usage for fixed-length buffers */ function buf_array()/*:BufArray*/ { var bufs/*:Array<Block>*/ = [], blksz = has_buf ? 256 : 2048; var newblk = function ba_newblk(sz/*:number*/)/*:Block*/ { var o/*:Block*/ = (new_buf(sz)/*:any*/); prep_blob(o, 0); return o; }; var curbuf/*:Block*/ = newblk(blksz); var endbuf = function ba_endbuf() { if(!curbuf) return; if(curbuf.length > curbuf.l) { curbuf = curbuf.slice(0, curbuf.l); curbuf.l = curbuf.length; } if(curbuf.length > 0) bufs.push(curbuf); curbuf = null; }; var next = function ba_next(sz/*:number*/)/*:Block*/ { if(curbuf && (sz < (curbuf.length - curbuf.l))) return curbuf; endbuf(); return (curbuf = newblk(Math.max(sz+1, blksz))); }; var end = function ba_end() { endbuf(); return bconcat(bufs); }; var push = function ba_push(buf) { endbuf(); curbuf = buf; if(curbuf.l == null) curbuf.l = curbuf.length; next(blksz); }; return ({ next:next, push:push, end:end, _bufs:bufs }/*:any*/); } function write_record(ba/*:BufArray*/, type/*:number*/, payload, length/*:?number*/) { var t/*:number*/ = +type, l; if(isNaN(t)) return; // TODO: throw something here? if(!length) length = XLSBRecordEnum[t].p || (payload||[]).length || 0; l = 1 + (t >= 0x80 ? 1 : 0) + 1/* + length*/; if(length >= 0x80) ++l; if(length >= 0x4000) ++l; if(length >= 0x200000) ++l; var o = ba.next(l); if(t <= 0x7F) o.write_shift(1, t); else { o.write_shift(1, (t & 0x7F) + 0x80); o.write_shift(1, (t >> 7)); } for(var i = 0; i != 4; ++i) { if(length >= 0x80) { o.write_shift(1, (length & 0x7F)+0x80); length >>= 7; } else { o.write_shift(1, length); break; } } if(/*:: length != null &&*/length > 0 && is_buf(payload)) ba.push(payload); } /* XLS ranges enforced */ function shift_cell_xls(cell/*:CellAddress*/, tgt/*:any*/, opts/*:?any*/)/*:CellAddress*/ { var out = dup(cell); if(tgt.s) { if(out.cRel) out.c += tgt.s.c; if(out.rRel) out.r += tgt.s.r; } else { if(out.cRel) out.c += tgt.c; if(out.rRel) out.r += tgt.r; } if(!opts || opts.biff < 12) { while(out.c >= 0x100) out.c -= 0x100; while(out.r >= 0x10000) out.r -= 0x10000; } return out; } function shift_range_xls(cell, range, opts) { var out = dup(cell); out.s = shift_cell_xls(out.s, range.s, opts); out.e = shift_cell_xls(out.e, range.s, opts); return out; } function encode_cell_xls(c/*:CellAddress*/, biff/*:number*/)/*:string*/ { if(c.cRel && c.c < 0) { c = dup(c); while(c.c < 0) c.c += (biff > 8) ? 0x4000 : 0x100; } if(c.rRel && c.r < 0) { c = dup(c); while(c.r < 0) c.r += (biff > 8) ? 0x100000 : ((biff > 5) ? 0x10000 : 0x4000); } var s = encode_cell(c); if(!c.cRel && c.cRel != null) s = fix_col(s); if(!c.rRel && c.rRel != null) s = fix_row(s); return s; } function encode_range_xls(r, opts)/*:string*/ { if(r.s.r == 0 && !r.s.rRel) { if(r.e.r == (opts.biff >= 12 ? 0xFFFFF : (opts.biff >= 8 ? 0x10000 : 0x4000)) && !r.e.rRel) { return (r.s.cRel ? "" : "$") + encode_col(r.s.c) + ":" + (r.e.cRel ? "" : "$") + encode_col(r.e.c); } } if(r.s.c == 0 && !r.s.cRel) { if(r.e.c == (opts.biff >= 12 ? 0x3FFF : 0xFF) && !r.e.cRel) { return (r.s.rRel ? "" : "$") + encode_row(r.s.r) + ":" + (r.e.rRel ? "" : "$") + encode_row(r.e.r); } } return encode_cell_xls(r.s, opts.biff) + ":" + encode_cell_xls(r.e, opts.biff); } function decode_row(rowstr/*:string*/)/*:number*/ { return parseInt(unfix_row(rowstr),10) - 1; } function encode_row(row/*:number*/)/*:string*/ { return "" + (row + 1); } function fix_row(cstr/*:string*/)/*:string*/ { return cstr.replace(/([A-Z]|^)(\d+)$/,"$1$$$2"); } function unfix_row(cstr/*:string*/)/*:string*/ { return cstr.replace(/\$(\d+)$/,"$1"); } function decode_col(colstr/*:string*/)/*:number*/ { var c = unfix_col(colstr), d = 0, i = 0; for(; i !== c.length; ++i) d = 26*d + c.charCodeAt(i) - 64; return d - 1; } function encode_col(col/*:number*/)/*:string*/ { if(col < 0) throw new Error("invalid column " + col); var s=""; for(++col; col; col=Math.floor((col-1)/26)) s = String.fromCharCode(((col-1)%26) + 65) + s; return s; } function fix_col(cstr/*:string*/)/*:string*/ { return cstr.replace(/^([A-Z])/,"$$$1"); } function unfix_col(cstr/*:string*/)/*:string*/ { return cstr.replace(/^\$([A-Z])/,"$1"); } function split_cell(cstr/*:string*/)/*:Array<string>*/ { return cstr.replace(/(\$?[A-Z]*)(\$?\d*)/,"$1,$2").split(","); } //function decode_cell(cstr/*:string*/)/*:CellAddress*/ { var splt = split_cell(cstr); return { c:decode_col(splt[0]), r:decode_row(splt[1]) }; } function decode_cell(cstr/*:string*/)/*:CellAddress*/ { var R = 0, C = 0; for(var i = 0; i < cstr.length; ++i) { var cc = cstr.charCodeAt(i); if(cc >= 48 && cc <= 57) R = 10 * R + (cc - 48); else if(cc >= 65 && cc <= 90) C = 26 * C + (cc - 64); } return { c: C - 1, r:R - 1 }; } //function encode_cell(cell/*:CellAddress*/)/*:string*/ { return encode_col(cell.c) + encode_row(cell.r); } function encode_cell(cell/*:CellAddress*/)/*:string*/ { var col = cell.c + 1; var s=""; for(; col; col=((col-1)/26)|0) s = String.fromCharCode(((col-1)%26) + 65) + s; return s + (cell.r + 1); } function decode_range(range/*:string*/)/*:Range*/ { var idx = range.indexOf(":"); if(idx == -1) return { s: decode_cell(range), e: decode_cell(range) }; return { s: decode_cell(range.slice(0, idx)), e: decode_cell(range.slice(idx + 1)) }; } /*# if only one arg, it is assumed to be a Range. If 2 args, both are cell addresses */ function encode_range(cs/*:CellAddrSpec|Range*/,ce/*:?CellAddrSpec*/)/*:string*/ { if(typeof ce === 'undefined' || typeof ce === 'number') { /*:: if(!(cs instanceof Range)) throw "unreachable"; */ return encode_range(cs.s, cs.e); } /*:: if((cs instanceof Range)) throw "unreachable"; */ if(typeof cs !== 'string') cs = encode_cell((cs/*:any*/)); if(typeof ce !== 'string') ce = encode_cell((ce/*:any*/)); /*:: if(typeof cs !== 'string') throw "unreachable"; */ /*:: if(typeof ce !== 'string') throw "unreachable"; */ return cs == ce ? cs : cs + ":" + ce; } function safe_decode_range(range/*:string*/)/*:Range*/ { var o = {s:{c:0,r:0},e:{c:0,r:0}}; var idx = 0, i = 0, cc = 0; var len = range.length; for(idx = 0; i < len; ++i) { if((cc=range.charCodeAt(i)-64) < 1 || cc > 26) break; idx = 26*idx + cc; } o.s.c = --idx; for(idx = 0; i < len; ++i) { if((cc=range.charCodeAt(i)-48) < 0 || cc > 9) break; idx = 10*idx + cc; } o.s.r = --idx; if(i === len || cc != 10) { o.e.c=o.s.c; o.e.r=o.s.r; return o; } ++i; for(idx = 0; i != len; ++i) { if((cc=range.charCodeAt(i)-64) < 1 || cc > 26) break; idx = 26*idx + cc; } o.e.c = --idx; for(idx = 0; i != len; ++i) { if((cc=range.charCodeAt(i)-48) < 0 || cc > 9) break; idx = 10*idx + cc; } o.e.r = --idx; return o; } function safe_format_cell(cell/*:Cell*/, v/*:any*/) { var q = (cell.t == 'd' && v instanceof Date); if(cell.z != null) try { return (cell.w = SSF_format(cell.z, q ? datenum(v) : v)); } catch(e) { } try { return (cell.w = SSF_format((cell.XF||{}).numFmtId||(q ? 14 : 0), q ? datenum(v) : v)); } catch(e) { return ''+v; } } function format_cell(cell/*:Cell*/, v/*:any*/, o/*:any*/) { if(cell == null || cell.t == null || cell.t == 'z') return ""; if(cell.w !== undefined) return cell.w; if(cell.t == 'd' && !cell.z && o && o.dateNF) cell.z = o.dateNF; if(cell.t == "e") return BErr[cell.v] || cell.v; if(v == undefined) return safe_format_cell(cell, cell.v); return safe_format_cell(cell, v); } function sheet_to_workbook(sheet/*:Worksheet*/, opts)/*:Workbook*/ { var n = opts && opts.sheet ? opts.sheet : "Sheet1"; var sheets = {}; sheets[n] = sheet; return { SheetNames: [n], Sheets: sheets }; } function sheet_add_aoa(_ws/*:?Worksheet*/, data/*:AOA*/, opts/*:?any*/)/*:Worksheet*/ { var o = opts || {}; var dense = _ws ? Array.isArray(_ws) : o.dense; if(DENSE != null && dense == null) dense = DENSE; var ws/*:Worksheet*/ = _ws || (dense ? ([]/*:any*/) : ({}/*:any*/)); var _R = 0, _C = 0; if(ws && o.origin != null) { if(typeof o.origin == 'number') _R = o.origin; else { var _origin/*:CellAddress*/ = typeof o.origin == "string" ? decode_cell(o.origin) : o.origin; _R = _origin.r; _C = _origin.c; } if(!ws["!ref"]) ws["!ref"] = "A1:A1"; } var range/*:Range*/ = ({s: {c:10000000, r:10000000}, e: {c:0, r:0}}/*:any*/); if(ws['!ref']) { var _range = safe_decode_range(ws['!ref']); range.s.c = _range.s.c; range.s.r = _range.s.r; range.e.c = Math.max(range.e.c, _range.e.c); range.e.r = Math.max(range.e.r, _range.e.r); if(_R == -1) range.e.r = _R = _range.e.r + 1; } for(var R = 0; R != data.length; ++R) { if(!data[R]) continue; if(!Array.isArray(data[R])) throw new Error("aoa_to_sheet expects an array of arrays"); for(var C = 0; C != data[R].length; ++C) { if(typeof data[R][C] === 'undefined') continue; var cell/*:Cell*/ = ({v: data[R][C] }/*:any*/); var __R = _R + R, __C = _C + C; if(range.s.r > __R) range.s.r = __R; if(range.s.c > __C) range.s.c = __C; if(range.e.r < __R) range.e.r = __R; if(range.e.c < __C) range.e.c = __C; if(data[R][C] && typeof data[R][C] === 'object' && !Array.isArray(data[R][C]) && !(data[R][C] instanceof Date)) cell = data[R][C]; else { if(Array.isArray(cell.v)) { cell.f = data[R][C][1]; cell.v = cell.v[0]; } if(cell.v === null) { if(cell.f) cell.t = 'n'; else if(o.nullError) { cell.t = 'e'; cell.v = 0; } else if(!o.sheetStubs) continue; else cell.t = 'z'; } else if(typeof cell.v === 'number') cell.t = 'n'; else if(typeof cell.v === 'boolean') cell.t = 'b'; else if(cell.v instanceof Date) { cell.z = o.dateNF || table_fmt[14]; if(o.cellDates) { cell.t = 'd'; cell.w = SSF_format(cell.z, datenum(cell.v)); } else { cell.t = 'n'; cell.v = datenum(cell.v); cell.w = SSF_format(cell.z, cell.v); } } else cell.t = 's'; } if(dense) { if(!ws[__R]) ws[__R] = []; if(ws[__R][__C] && ws[__R][__C].z) cell.z = ws[__R][__C].z; ws[__R][__C] = cell; } else { var cell_ref = encode_cell(({c:__C,r:__R}/*:any*/)); if(ws[cell_ref] && ws[cell_ref].z) cell.z = ws[cell_ref].z; ws[cell_ref] = cell; } } } if(range.s.c < 10000000) ws['!ref'] = encode_range(range); return ws; } function aoa_to_sheet(data/*:AOA*/, opts/*:?any*/)/*:Worksheet*/ { return sheet_add_aoa(null, data, opts); } function parse_Int32LE(data) { return data.read_shift(4, 'i'); } function write_UInt32LE(x/*:number*/, o) { if (!o) o = new_buf(4); o.write_shift(4, x); return o; } /* [MS-XLSB] 2.5.168 */ function parse_XLWideString(data/*::, length*/)/*:string*/ { var cchCharacters = data.read_shift(4); return cchCharacters === 0 ? "" : data.read_shift(cchCharacters, 'dbcs'); } function write_XLWideString(data/*:string*/, o) { var _null = false; if (o == null) { _null = true; o = new_buf(4 + 2 * data.length); } o.write_shift(4, data.length); if (data.length > 0) o.write_shift(0, data, 'dbcs'); return _null ? o.slice(0, o.l) : o; } /* [MS-XLSB] 2.5.91 */ //function parse_LPWideString(data/*::, length*/)/*:string*/ { // var cchCharacters = data.read_shift(2); // return cchCharacters === 0 ? "" : data.read_shift(cchCharacters, "utf16le"); //} /* [MS-XLSB] 2.5.143 */ function parse_StrRun(data) { return { ich: data.read_shift(2), ifnt: data.read_shift(2) }; } function write_StrRun(run, o) { if (!o) o = new_buf(4); o.write_shift(2, run.ich || 0); o.write_shift(2, run.ifnt || 0); return o; } /* [MS-XLSB] 2.5.121 */ function parse_RichStr(data, length/*:number*/)/*:XLString*/ { var start = data.l; var flags = data.read_shift(1); var str = parse_XLWideString(data); var rgsStrRun = []; var z = ({ t: str, h: str }/*:any*/); if ((flags & 1) !== 0) { /* fRichStr */ /* TODO: formatted string */ var dwSizeStrRun = data.read_shift(4); for (var i = 0; i != dwSizeStrRun; ++i) rgsStrRun.push(parse_StrRun(data)); z.r = rgsStrRun; } else z.r = [{ ich: 0, ifnt: 0 }]; //if((flags & 2) !== 0) { /* fExtStr */ // /* TODO: phonetic string */ //} data.l = start + length; return z; } function write_RichStr(str/*:XLString*/, o/*:?Block*/)/*:Block*/ { /* TODO: formatted string */ var _null = false; if (o == null) { _null = true; o = new_buf(15 + 4 * str.t.length); } o.write_shift(1, 0); write_XLWideString(str.t, o); return _null ? o.slice(0, o.l) : o; } /* [MS-XLSB] 2.4.328 BrtCommentText (RichStr w/1 run) */ var parse_BrtCommentText = parse_RichStr; function write_BrtCommentText(str/*:XLString*/, o/*:?Block*/)/*:Block*/ { /* TODO: formatted string */ var _null = false; if (o == null) { _null = true; o = new_buf(23 + 4 * str.t.length); } o.write_shift(1, 1); write_XLWideString(str.t, o); o.write_shift(4, 1); write_StrRun({ ich: 0, ifnt: 0 }, o); return _null ? o.slice(0, o.l) : o; } /* [MS-XLSB] 2.5.9 */ function parse_XLSBCell(data)/*:any*/ { var col = data.read_shift(4); var iStyleRef = data.read_shift(2); iStyleRef += data.read_shift(1) << 16; data.l++; //var fPhShow = data.read_shift(1); return { c: col, iStyleRef: iStyleRef }; } function write_XLSBCell(cell/*:any*/, o/*:?Block*/) { if (o == null) o = new_buf(8); o.write_shift(-4, cell.c); o.write_shift(3, cell.iStyleRef || cell.s); o.write_shift(1, 0); /* fPhShow */ return o; } /* Short XLSB Cell does not include column */ function parse_XLSBShortCell(data)/*:any*/ { var iStyleRef = data.read_shift(2); iStyleRef += data.read_shift(1) <<16; data.l++; //var fPhShow = data.read_shift(1); return { c:-1, iStyleRef: iStyleRef }; } function write_XLSBShortCell(cell/*:any*/, o/*:?Block*/) { if(o == null) o = new_buf(4); o.write_shift(3, cell.iStyleRef || cell.s); o.write_shift(1, 0); /* fPhShow */ return o; } /* [MS-XLSB] 2.5.21 */ var parse_XLSBCodeName = parse_XLWideString; var write_XLSBCodeName = write_XLWideString; /* [MS-XLSB] 2.5.166 */ function parse_XLNullableWideString(data/*::, length*/)/*:string*/ { var cchCharacters = data.read_shift(4); return cchCharacters === 0 || cchCharacters === 0xFFFFFFFF ? "" : data.read_shift(cchCharacters, 'dbcs'); } function write_XLNullableWideString(data/*:string*/, o) { var _null = false; if (o == null) { _null = true; o = new_buf(127); } o.write_shift(4, data.length > 0 ? data.length : 0xFFFFFFFF); if (data.length > 0) o.write_shift(0, data, 'dbcs'); return _null ? o.slice(0, o.l) : o; } /* [MS-XLSB] 2.5.165 */ var parse_XLNameWideString = parse_XLWideString; //var write_XLNameWideString = write_XLWideString; /* [MS-XLSB] 2.5.114 */ var parse_RelID = parse_XLNullableWideString; var write_RelID = write_XLNullableWideString; /* [MS-XLS] 2.5.217 ; [MS-XLSB] 2.5.122 */ function parse_RkNumber(data)/*:number*/ { var b = data.slice(data.l, data.l + 4); var fX100 = (b[0] & 1), fInt = (b[0] & 2); data.l += 4; var RK = fInt === 0 ? __double([0, 0, 0, 0, (b[0] & 0xFC), b[1], b[2], b[3]], 0) : __readInt32LE(b, 0) >> 2; return fX100 ? (RK / 100) : RK; } function write_RkNumber(data/*:number*/, o) { if (o == null) o = new_buf(4); var fX100 = 0, fInt = 0, d100 = data * 100; if ((data == (data | 0)) && (data >= -(1 << 29)) && (data < (1 << 29))) { fInt = 1; } else if ((d100 == (d100 | 0)) && (d100 >= -(1 << 29)) && (d100 < (1 << 29))) { fInt = 1; fX100 = 1; } if (fInt) o.write_shift(-4, ((fX100 ? d100 : data) << 2) + (fX100 + 2)); else throw new Error("unsupported RkNumber " + data); // TODO } /* [MS-XLSB] 2.5.117 RfX */ function parse_RfX(data /*::, length*/)/*:Range*/ { var cell/*:Range*/ = ({ s: {}, e: {} }/*:any*/); cell.s.r = data.read_shift(4); cell.e.r = data.read_shift(4); cell.s.c = data.read_shift(4); cell.e.c = data.read_shift(4); return cell; } function write_RfX(r/*:Range*/, o) { if (!o) o = new_buf(16); o.write_shift(4, r.s.r); o.write_shift(4, r.e.r); o.write_shift(4, r.s.c); o.write_shift(4, r.e.c); return o; } /* [MS-XLSB] 2.5.153 UncheckedRfX */ var parse_UncheckedRfX = parse_RfX; var write_UncheckedRfX = write_RfX; /* [MS-XLSB] 2.5.155 UncheckedSqRfX */ //function parse_UncheckedSqRfX(data) { // var cnt = data.read_shift(4); // var out = []; // for(var i = 0; i < cnt; ++i) { // var rng = parse_UncheckedRfX(data); // out.push(encode_range(rng)); // } // return out.join(","); //} //function write_UncheckedSqRfX(sqrfx/*:string*/) { // var parts = sqrfx.split(/\s*,\s*/); // var o = new_buf(4); o.write_shift(4, parts.length); // var out = [o]; // parts.forEach(function(rng) { // out.push(write_UncheckedRfX(safe_decode_range(rng))); // }); // return bconcat(out); //} /* [MS-XLS] 2.5.342 ; [MS-XLSB] 2.5.171 */ /* TODO: error checking, NaN and Infinity values are not valid Xnum */ function parse_Xnum(data/*::, length*/) { if(data.length - data.l < 8) throw "XLS Xnum Buffer underflow"; return data.read_shift(8, 'f'); } function write_Xnum(data, o) { return (o || new_buf(8)).write_shift(8, data, 'f'); } /* [MS-XLSB] 2.4.324 BrtColor */ function parse_BrtColor(data/*::, length*/) { var out = {}; var d = data.read_shift(1); //var fValidRGB = d & 1; var xColorType = d >>> 1; var index = data.read_shift(1); var nTS = data.read_shift(2, 'i'); var bR = data.read_shift(1); var bG = data.read_shift(1); var bB = data.read_shift(1); data.l++; //var bAlpha = data.read_shift(1); switch (xColorType) { case 0: out.auto = 1; break; case 1: out.index = index; var icv = XLSIcv[index]; /* automatic pseudo index 81 */ if (icv) out.rgb = rgb2Hex(icv); break; case 2: /* if(!fValidRGB) throw new Error("invalid"); */ out.rgb = rgb2Hex([bR, bG, bB]); break; case 3: out.theme = index; break; } if (nTS != 0) out.tint = nTS > 0 ? nTS / 32767 : nTS / 32768; return out; } function write_BrtColor(color, o) { if (!o) o = new_buf(8); if (!color || color.auto) { o.write_shift(4, 0); o.write_shift(4, 0); return o; } if (color.index != null) { o.write_shift(1, 0x02); o.write_shift(1, color.index); } else if (color.theme != null) { o.write_shift(1, 0x06); o.write_shift(1, color.theme); } else { o.write_shift(1, 0x05); o.write_shift(1, 0); } var nTS = color.tint || 0; if (nTS > 0) nTS *= 32767; else if (nTS < 0) nTS *= 32768; o.write_shift(2, nTS); if (!color.rgb || color.theme != null) { o.write_shift(2, 0); o.write_shift(1, 0); o.write_shift(1, 0); } else { var rgb = (color.rgb || 'FFFFFF'); if (typeof rgb == 'number') rgb = ("000000" + rgb.toString(16)).slice(-6); o.write_shift(1, parseInt(rgb.slice(0, 2), 16)); o.write_shift(1, parseInt(rgb.slice(2, 4), 16)); o.write_shift(1, parseInt(rgb.slice(4, 6), 16)); o.write_shift(1, 0xFF); } return o; } /* [MS-XLSB] 2.5.52 */ function parse_FontFlags(data/*::, length, opts*/) { var d = data.read_shift(1); data.l++; var out = { fBold: d & 0x01, fItalic: d & 0x02, fUnderline: d & 0x04, fStrikeout: d & 0x08, fOutline: d & 0x10, fShadow: d & 0x20, fCondense: d & 0x40, fExtend: d & 0x80 }; return out; } function write_FontFlags(font, o) { if (!o) o = new_buf(2); var grbit = (font.italic ? 0x02 : 0) | (font.strike ? 0x08 : 0) | (font.outline ? 0x10 : 0) | (font.shadow ? 0x20 : 0) | (font.condense ? 0x40 : 0) | (font.extend ? 0x80 : 0); o.write_shift(1, grbit); o.write_shift(1, 0); return o; } /* [MS-OLEDS] 2.3.1 and 2.3.2 */ function parse_ClipboardFormatOrString(o, w/*:number*/)/*:string*/ { // $FlowIgnore var ClipFmt = { 2: "BITMAP", 3: "METAFILEPICT", 8: "DIB", 14: "ENHMETAFILE" }; var m/*:number*/ = o.read_shift(4); switch (m) { case 0x00000000: return ""; case 0xffffffff: case 0xfffffffe: return ClipFmt[o.read_shift(4)] || ""; } if (m > 0x190) throw new Error("Unsupported Clipboard: " + m.toString(16)); o.l -= 4; return o.read_shift(0, w == 1 ? "lpstr" : "lpwstr"); } function parse_ClipboardFormatOrAnsiString(o) { return parse_ClipboardFormatOrString(o, 1); } function parse_ClipboardFormatOrUnicodeString(o) { return parse_ClipboardFormatOrString(o, 2); } /* [MS-OLEPS] 2.2 PropertyType */ // Note: some tree shakers cannot handle VT_VECTOR | $CONST, hence extra vars //var VT_EMPTY = 0x0000; //var VT_NULL = 0x0001; var VT_I2 = 0x0002; var VT_I4 = 0x0003; //var VT_R4 = 0x0004; //var VT_R8 = 0x0005; //var VT_CY = 0x0006; //var VT_DATE = 0x0007; //var VT_BSTR = 0x0008; //var VT_ERROR = 0x000A; var VT_BOOL = 0x000B; var VT_VARIANT = 0x000C; //var VT_DECIMAL = 0x000E; //var VT_I1 = 0x0010; //var VT_UI1 = 0x0011; //var VT_UI2 = 0x0012; var VT_UI4 = 0x0013; //var VT_I8 = 0x0014; //var VT_UI8 = 0x0015; //var VT_INT = 0x0016; //var VT_UINT = 0x0017; var VT_LPSTR = 0x001E; //var VT_LPWSTR = 0x001F; var VT_FILETIME = 0x0040; var VT_BLOB = 0x0041; //var VT_STREAM = 0x0042; //var VT_STORAGE = 0x0043; //var VT_STREAMED_Object = 0x0044; //var VT_STORED_Object = 0x0045; //var VT_BLOB_Object = 0x0046; var VT_CF = 0x0047; //var VT_CLSID = 0x0048; //var VT_VERSIONED_STREAM = 0x0049; var VT_VECTOR = 0x1000; var VT_VECTOR_VARIANT = 0x100C; var VT_VECTOR_LPSTR = 0x101E; //var VT_ARRAY = 0x2000; var VT_STRING = 0x0050; // 2.3.3.1.11 VtString var VT_USTR = 0x0051; // 2.3.3.1.12 VtUnalignedString var VT_CUSTOM = [VT_STRING, VT_USTR]; /* [MS-OSHARED] 2.3.3.2.2.1 Document Summary Information PIDDSI */ var DocSummaryPIDDSI = { /*::[*/0x01/*::]*/: { n: 'CodePage', t: VT_I2 }, /*::[*/0x02/*::]*/: { n: 'Category', t: VT_STRING }, /*::[*/0x03/*::]*/: { n: 'PresentationFormat', t: VT_STRING }, /*::[*/0x04/*::]*/: { n: 'ByteCount', t: VT_I4 }, /*::[*/0x05/*::]*/: { n: 'LineCount', t: VT_I4 }, /*::[*/0x06/*::]*/: { n: 'ParagraphCount', t: VT_I4 }, /*::[*/0x07/*::]*/: { n: 'SlideCount', t: VT_I4 }, /*::[*/0x08/*::]*/: { n: 'NoteCount', t: VT_I4 }, /*::[*/0x09/*::]*/: { n: 'HiddenCount', t: VT_I4 }, /*::[*/0x0a/*::]*/: { n: 'MultimediaClipCount', t: VT_I4 }, /*::[*/0x0b/*::]*/: { n: 'ScaleCrop', t: VT_BOOL }, /*::[*/0x0c/*::]*/: { n: 'HeadingPairs', t: VT_VECTOR_VARIANT /* VT_VECTOR | VT_VARIANT */ }, /*::[*/0x0d/*::]*/: { n: 'TitlesOfParts', t: VT_VECTOR_LPSTR /* VT_VECTOR | VT_LPSTR */ }, /*::[*/0x0e/*::]*/: { n: 'Manager', t: VT_STRING }, /*::[*/0x0f/*::]*/: { n: 'Company', t: VT_STRING }, /*::[*/0x10/*::]*/: { n: 'LinksUpToDate', t: VT_BOOL }, /*::[*/0x11/*::]*/: { n: 'CharacterCount', t: VT_I4 }, /*::[*/0x13/*::]*/: { n: 'SharedDoc', t: VT_BOOL }, /*::[*/0x16/*::]*/: { n: 'HyperlinksChanged', t: VT_BOOL }, /*::[*/0x17/*::]*/: { n: 'AppVersion', t: VT_I4, p: 'version' }, /*::[*/0x18/*::]*/: { n: 'DigSig', t: VT_BLOB }, /*::[*/0x1A/*::]*/: { n: 'ContentType', t: VT_STRING }, /*::[*/0x1B/*::]*/: { n: 'ContentStatus', t: VT_STRING }, /*::[*/0x1C/*::]*/: { n: 'Language', t: VT_STRING }, /*::[*/0x1D/*::]*/: { n: 'Version', t: VT_STRING }, /*::[*/0xFF/*::]*/: {}, /* [MS-OLEPS] 2.18 */ /*::[*/0x80000000/*::]*/: { n: 'Locale', t: VT_UI4 }, /*::[*/0x80000003/*::]*/: { n: 'Behavior', t: VT_UI4 }, /*::[*/0x72627262/*::]*/: {} }; /* [MS-OSHARED] 2.3.3.2.1.1 Summary Information Property Set PIDSI */ var SummaryPIDSI = { /*::[*/0x01/*::]*/: { n: 'CodePage', t: VT_I2 }, /*::[*/0x02/*::]*/: { n: 'Title', t: VT_STRING }, /*::[*/0x03/*::]*/: { n: 'Subject', t: VT_STRING }, /*::[*/0x04/*::]*/: { n: 'Author', t: VT_STRING }, /*::[*/0x05/*::]*/: { n: 'Keywords', t: VT_STRING }, /*::[*/0x06/*::]*/: { n: 'Comments', t: VT_STRING }, /*::[*/0x07/*::]*/: { n: 'Template', t: VT_STRING }, /*::[*/0x08/*::]*/: { n: 'LastAuthor', t: VT_STRING }, /*::[*/0x09/*::]*/: { n: 'RevNumber', t: VT_STRING }, /*::[*/0x0A/*::]*/: { n: 'EditTime', t: VT_FILETIME }, /*::[*/0x0B/*::]*/: { n: 'LastPrinted', t: VT_FILETIME }, /*::[*/0x0C/*::]*/: { n: 'CreatedDate', t: VT_FILETIME }, /*::[*/0x0D/*::]*/: { n: 'ModifiedDate', t: VT_FILETIME }, /*::[*/0x0E/*::]*/: { n: 'PageCount', t: VT_I4 }, /*::[*/0x0F/*::]*/: { n: 'WordCount', t: VT_I4 }, /*::[*/0x10/*::]*/: { n: 'CharCount', t: VT_I4 }, /*::[*/0x11/*::]*/: { n: 'Thumbnail', t: VT_CF }, /*::[*/0x12/*::]*/: { n: 'Application', t: VT_STRING }, /*::[*/0x13/*::]*/: { n: 'DocSecurity', t: VT_I4 }, /*::[*/0xFF/*::]*/: {}, /* [MS-OLEPS] 2.18 */ /*::[*/0x80000000/*::]*/: { n: 'Locale', t: VT_UI4 }, /*::[*/0x80000003/*::]*/: { n: 'Behavior', t: VT_UI4 }, /*::[*/0x72627262/*::]*/: {} }; /* [MS-XLS] 2.4.63 Country/Region codes */ var CountryEnum = { /*::[*/0x0001/*::]*/: "US", // United States /*::[*/0x0002/*::]*/: "CA", // Canada /*::[*/0x0003/*::]*/: "", // Latin America (except Brazil) /*::[*/0x0007/*::]*/: "RU", // Russia /*::[*/0x0014/*::]*/: "EG", // Egypt /*::[*/0x001E/*::]*/: "GR", // Greece /*::[*/0x001F/*::]*/: "NL", // Netherlands /*::[*/0x0020/*::]*/: "BE", // Belgium /*::[*/0x0021/*::]*/: "FR", // France /*::[*/0x0022/*::]*/: "ES", // Spain /*::[*/0x0024/*::]*/: "HU", // Hungary /*::[*/0x0027/*::]*/: "IT", // Italy /*::[*/0x0029/*::]*/: "CH", // Switzerland /*::[*/0x002B/*::]*/: "AT", // Austria /*::[*/0x002C/*::]*/: "GB", // United Kingdom /*::[*/0x002D/*::]*/: "DK", // Denmark /*::[*/0x002E/*::]*/: "SE", // Sweden /*::[*/0x002F/*::]*/: "NO", // Norway /*::[*/0x0030/*::]*/: "PL", // Poland /*::[*/0x0031/*::]*/: "DE", // Germany /*::[*/0x0034/*::]*/: "MX", // Mexico /*::[*/0x0037/*::]*/: "BR", // Brazil /*::[*/0x003d/*::]*/: "AU", // Australia /*::[*/0x0040/*::]*/: "NZ", // New Zealand /*::[*/0x0042/*::]*/: "TH", // Thailand /*::[*/0x0051/*::]*/: "JP", // Japan /*::[*/0x0052/*::]*/: "KR", // Korea /*::[*/0x0054/*::]*/: "VN", // Viet Nam /*::[*/0x0056/*::]*/: "CN", // China /*::[*/0x005A/*::]*/: "TR", // Turkey /*::[*/0x0069/*::]*/: "JS", // Ramastan /*::[*/0x00D5/*::]*/: "DZ", // Algeria /*::[*/0x00D8/*::]*/: "MA", // Morocco /*::[*/0x00DA/*::]*/: "LY", // Libya /*::[*/0x015F/*::]*/: "PT", // Portugal /*::[*/0x0162/*::]*/: "IS", // Iceland /*::[*/0x0166/*::]*/: "FI", // Finland /*::[*/0x01A4/*::]*/: "CZ", // Czech Republic /*::[*/0x0376/*::]*/: "TW", // Taiwan /*::[*/0x03C1/*::]*/: "LB", // Lebanon /*::[*/0x03C2/*::]*/: "JO", // Jordan /*::[*/0x03C3/*::]*/: "SY", // Syria /*::[*/0x03C4/*::]*/: "IQ", // Iraq /*::[*/0x03C5/*::]*/: "KW", // Kuwait /*::[*/0x03C6/*::]*/: "SA", // Saudi Arabia /*::[*/0x03CB/*::]*/: "AE", // United Arab Emirates /*::[*/0x03CC/*::]*/: "IL", // Israel /*::[*/0x03CE/*::]*/: "QA", // Qatar /*::[*/0x03D5/*::]*/: "IR", // Iran /*::[*/0xFFFF/*::]*/: "US" // United States }; /* [MS-XLS] 2.5.127 */ var XLSFillPattern = [ null, 'solid', 'mediumGray', 'darkGray', 'lightGray', 'darkHorizontal', 'darkVertical', 'darkDown', 'darkUp', 'darkGrid', 'darkTrellis', 'lightHorizontal', 'lightVertical', 'lightDown', 'lightUp', 'lightGrid', 'lightTrellis', 'gray125', 'gray0625' ]; function rgbify(arr/*:Array<number>*/)/*:Array<[number, number, number]>*/ { return arr.map(function(x) { return [(x>>16)&255,(x>>8)&255,x&255]; }); } /* [MS-XLS] 2.5.161 */ /* [MS-XLSB] 2.5.75 Icv */ var _XLSIcv = /*#__PURE__*/ rgbify([ /* Color Constants */ 0x000000, 0xFFFFFF, 0xFF0000, 0x00FF00, 0x0000FF, 0xFFFF00, 0xFF00FF, 0x00FFFF, /* Overridable Defaults */ 0x000000, 0xFFFFFF, 0xFF0000, 0x00FF00, 0x0000FF, 0xFFFF00, 0xFF00FF, 0x00FFFF, 0x800000, 0x008000, 0x000080, 0x808000, 0x800080, 0x008080, 0xC0C0C0, 0x808080, 0x9999FF, 0x993366, 0xFFFFCC, 0xCCFFFF, 0x660066, 0xFF8080, 0x0066CC, 0xCCCCFF, 0x000080, 0xFF00FF, 0xFFFF00, 0x00FFFF, 0x800080, 0x800000, 0x008080, 0x0000FF, 0x00CCFF, 0xCCFFFF, 0xCCFFCC, 0xFFFF99, 0x99CCFF, 0xFF99CC, 0xCC99FF, 0xFFCC99, 0x3366FF, 0x33CCCC, 0x99CC00, 0xFFCC00, 0xFF9900, 0xFF6600, 0x666699, 0x969696, 0x003366, 0x339966, 0x003300, 0x333300, 0x993300, 0x993366, 0x333399, 0x333333, /* Other entries to appease BIFF8/12 */ 0xFFFFFF, /* 0x40 icvForeground ?? */ 0x000000, /* 0x41 icvBackground ?? */ 0x000000, /* 0x42 icvFrame ?? */ 0x000000, /* 0x43 icv3D ?? */ 0x000000, /* 0x44 icv3DText ?? */ 0x000000, /* 0x45 icv3DHilite ?? */ 0x000000, /* 0x46 icv3DShadow ?? */ 0x000000, /* 0x47 icvHilite ?? */ 0x000000, /* 0x48 icvCtlText ?? */ 0x000000, /* 0x49 icvCtlScrl ?? */ 0x000000, /* 0x4A icvCtlInv ?? */ 0x000000, /* 0x4B icvCtlBody ?? */ 0x000000, /* 0x4C icvCtlFrame ?? */ 0x000000, /* 0x4D icvCtlFore ?? */ 0x000000, /* 0x4E icvCtlBack ?? */ 0x000000, /* 0x4F icvCtlNeutral */ 0x000000, /* 0x50 icvInfoBk ?? */ 0x000000 /* 0x51 icvInfoText ?? */ ]); var XLSIcv = /*#__PURE__*/dup(_XLSIcv); /* [MS-XLSB] 2.5.97.2 */ var BErr = { /*::[*/0x00/*::]*/: "#NULL!", /*::[*/0x07/*::]*/: "#DIV/0!", /*::[*/0x0F/*::]*/: "#VALUE!", /*::[*/0x17/*::]*/: "#REF!", /*::[*/0x1D/*::]*/: "#NAME?", /*::[*/0x24/*::]*/: "#NUM!", /*::[*/0x2A/*::]*/: "#N/A", /*::[*/0x2B/*::]*/: "#GETTING_DATA", /*::[*/0xFF/*::]*/: "#WTF?" }; //var RBErr = evert_num(BErr); var RBErr = { "#NULL!": 0x00, "#DIV/0!": 0x07, "#VALUE!": 0x0F, "#REF!": 0x17, "#NAME?": 0x1D, "#NUM!": 0x24, "#N/A": 0x2A, "#GETTING_DATA": 0x2B, "#WTF?": 0xFF }; /* Parts enumerated in OPC spec, MS-XLSB and MS-XLSX */ /* 12.3 Part Summary <SpreadsheetML> */ /* 14.2 Part Summary <DrawingML> */ /* [MS-XLSX] 2.1 Part Enumerations ; [MS-XLSB] 2.1.7 Part Enumeration */ var ct2type/*{[string]:string}*/ = ({ /* Workbook */ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": "workbooks", "application/vnd.ms-excel.sheet.macroEnabled.main+xml": "workbooks", "application/vnd.ms-excel.sheet.binary.macroEnabled.main": "workbooks", "application/vnd.ms-excel.addin.macroEnabled.main+xml": "workbooks", "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": "workbooks", /* Worksheet */ "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": "sheets", "application/vnd.ms-excel.worksheet": "sheets", "application/vnd.ms-excel.binIndexWs": "TODO", /* Binary Index */ /* Chartsheet */ "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": "charts", "application/vnd.ms-excel.chartsheet": "charts", /* Macrosheet */ "application/vnd.ms-excel.macrosheet+xml": "macros", "application/vnd.ms-excel.macrosheet": "macros", "application/vnd.ms-excel.intlmacrosheet": "TODO", "application/vnd.ms-excel.binIndexMs": "TODO", /* Binary Index */ /* Dialogsheet */ "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": "dialogs", "application/vnd.ms-excel.dialogsheet": "dialogs", /* Shared Strings */ "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml": "strs", "application/vnd.ms-excel.sharedStrings": "strs", /* Styles */ "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": "styles", "application/vnd.ms-excel.styles": "styles", /* File Properties */ "application/vnd.openxmlformats-package.core-properties+xml": "coreprops", "application/vnd.openxmlformats-officedocument.custom-properties+xml": "custprops", "application/vnd.openxmlformats-officedocument.extended-properties+xml": "extprops", /* Custom Data Properties */ "application/vnd.openxmlformats-officedocument.customXmlProperties+xml": "TODO", "application/vnd.openxmlformats-officedocument.spreadsheetml.customProperty": "TODO", /* Comments */ "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": "comments", "application/vnd.ms-excel.comments": "comments", "application/vnd.ms-excel.threadedcomments+xml": "threadedcomments", "application/vnd.ms-excel.person+xml": "people", /* Metadata (Stock/Geography and Dynamic Array) */ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml": "metadata", "application/vnd.ms-excel.sheetMetadata": "metadata", /* PivotTable */ "application/vnd.ms-excel.pivotTable": "TODO", "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml": "TODO", /* Chart Objects */ "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": "TODO", /* Chart Colors */ "application/vnd.ms-office.chartcolorstyle+xml": "TODO", /* Chart Style */ "application/vnd.ms-office.chartstyle+xml": "TODO", /* Chart Advanced */ "application/vnd.ms-office.chartex+xml": "TODO", /* Calculation Chain */ "application/vnd.ms-excel.calcChain": "calcchains", "application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml": "calcchains", /* Printer Settings */ "application/vnd.openxmlformats-officedocument.spreadsheetml.printerSettings": "TODO", /* ActiveX */ "application/vnd.ms-office.activeX": "TODO", "application/vnd.ms-office.activeX+xml": "TODO", /* Custom Toolbars */ "application/vnd.ms-excel.attachedToolbars": "TODO", /* External Data Connections */ "application/vnd.ms-excel.connections": "TODO", "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": "TODO", /* External Links */ "application/vnd.ms-excel.externalLink": "links", "application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml": "links", /* PivotCache */ "application/vnd.ms-excel.pivotCacheDefinition": "TODO", "application/vnd.ms-excel.pivotCacheRecords": "TODO", "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml": "TODO", "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml": "TODO", /* Query Table */ "application/vnd.ms-excel.queryTable": "TODO", "application/vnd.openxmlformats-officedocument.spreadsheetml.queryTable+xml": "TODO", /* Shared Workbook */ "application/vnd.ms-excel.userNames": "TODO", "application/vnd.ms-excel.revisionHeaders": "TODO", "application/vnd.ms-excel.revisionLog": "TODO", "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionHeaders+xml": "TODO", "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionLog+xml": "TODO", "application/vnd.openxmlformats-officedocument.spreadsheetml.userNames+xml": "TODO", /* Single Cell Table */ "application/vnd.ms-excel.tableSingleCells": "TODO", "application/vnd.openxmlformats-officedocument.spreadsheetml.tableSingleCells+xml": "TODO", /* Slicer */ "application/vnd.ms-excel.slicer": "TODO", "application/vnd.ms-excel.slicerCache": "TODO", "application/vnd.ms-excel.slicer+xml": "TODO", "application/vnd.ms-excel.slicerCache+xml": "TODO", /* Sort Map */ "application/vnd.ms-excel.wsSortMap": "TODO", /* Table */ "application/vnd.ms-excel.table": "TODO", "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": "TODO", /* Themes */ "application/vnd.openxmlformats-officedocument.theme+xml": "themes", /* Theme Override */ "application/vnd.openxmlformats-officedocument.themeOverride+xml": "TODO", /* Timeline */ "application/vnd.ms-excel.Timeline+xml": "TODO", /* verify */ "application/vnd.ms-excel.TimelineCache+xml": "TODO", /* verify */ /* VBA */ "application/vnd.ms-office.vbaProject": "vba", "application/vnd.ms-office.vbaProjectSignature": "TODO", /* Volatile Dependencies */ "application/vnd.ms-office.volatileDependencies": "TODO", "application/vnd.openxmlformats-officedocument.spreadsheetml.volatileDependencies+xml": "TODO", /* Control Properties */ "application/vnd.ms-excel.controlproperties+xml": "TODO", /* Data Model */ "application/vnd.openxmlformats-officedocument.model+data": "TODO", /* Survey */ "application/vnd.ms-excel.Survey+xml": "TODO", /* Drawing */ "application/vnd.openxmlformats-officedocument.drawing+xml": "drawings", "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": "TODO", "application/vnd.openxmlformats-officedocument.drawingml.diagramColors+xml": "TODO", "application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml": "TODO", "application/vnd.openxmlformats-officedocument.drawingml.diagramLayout+xml": "TODO", "application/vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml": "TODO", /* VML */ "application/vnd.openxmlformats-officedocument.vmlDrawing": "TODO", "application/vnd.openxmlformats-package.relationships+xml": "rels", "application/vnd.openxmlformats-officedocument.oleObject": "TODO", /* Image */ "image/png": "TODO", "sheet": "js" }/*:any*/); var CT_LIST = { workbooks: { xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml", xlsm: "application/vnd.ms-excel.sheet.macroEnabled.main+xml", xlsb: "application/vnd.ms-excel.sheet.binary.macroEnabled.main", xlam: "application/vnd.ms-excel.addin.macroEnabled.main+xml", xltx: "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml" }, strs: { /* Shared Strings */ xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml", xlsb: "application/vnd.ms-excel.sharedStrings" }, comments: { /* Comments */ xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml", xlsb: "application/vnd.ms-excel.comments" }, sheets: { /* Worksheet */ xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml", xlsb: "application/vnd.ms-excel.worksheet" }, charts: { /* Chartsheet */ xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml", xlsb: "application/vnd.ms-excel.chartsheet" }, dialogs: { /* Dialogsheet */ xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml", xlsb: "application/vnd.ms-excel.dialogsheet" }, macros: { /* Macrosheet (Excel 4.0 Macros) */ xlsx: "application/vnd.ms-excel.macrosheet+xml", xlsb: "application/vnd.ms-excel.macrosheet" }, metadata: { /* Metadata (Stock/Geography and Dynamic Array) */ xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml", xlsb: "application/vnd.ms-excel.sheetMetadata" }, styles: { /* Styles */ xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml", xlsb: "application/vnd.ms-excel.styles" } }; function new_ct()/*:any*/ { return ({ workbooks:[], sheets:[], charts:[], dialogs:[], macros:[], rels:[], strs:[], comments:[], threadedcomments:[], links:[], coreprops:[], extprops:[], custprops:[], themes:[], styles:[], calcchains:[], vba: [], drawings: [], metadata: [], people:[], TODO:[], xmlns: "" }/*:any*/); } function parse_ct(data/*:?string*/) { var ct = new_ct(); if(!data || !data.match) return ct; var ctext = {}; (data.match(tagregex)||[]).forEach(function(x) { var y = parsexmltag(x); switch(y[0].replace(nsregex,"<")) { case '<?xml': break; case '<Types': ct.xmlns = y['xmlns' + (y[0].match(/<(\w+):/)||["",""])[1] ]; break; case '<Default': ctext[y.Extension] = y.ContentType; break; case '<Override': if(ct[ct2type[y.ContentType]] !== undefined) ct[ct2type[y.ContentType]].push(y.PartName); break; } }); if(ct.xmlns !== XMLNS.CT) throw new Error("Unknown Namespace: " + ct.xmlns); ct.calcchain = ct.calcchains.length > 0 ? ct.calcchains[0] : ""; ct.sst = ct.strs.length > 0 ? ct.strs[0] : ""; ct.style = ct.styles.length > 0 ? ct.styles[0] : ""; ct.defaults = ctext; delete ct.calcchains; return ct; } function write_ct(ct, opts)/*:string*/ { var type2ct/*{[string]:Array<string>}*/ = evert_arr(ct2type); var o/*:Array<string>*/ = [], v; o[o.length] = (XML_HEADER); o[o.length] = writextag('Types', null, { 'xmlns': XMLNS.CT, 'xmlns:xsd': XMLNS.xsd, 'xmlns:xsi': XMLNS.xsi }); o = o.concat([ ['xml', 'application/xml'], ['bin', 'application/vnd.ms-excel.sheet.binary.macroEnabled.main'], ['vml', 'application/vnd.openxmlformats-officedocument.vmlDrawing'], ['data', 'application/vnd.openxmlformats-officedocument.model+data'], /* from test files */ ['bmp', 'image/bmp'], ['png', 'image/png'], ['gif', 'image/gif'], ['emf', 'image/x-emf'], ['wmf', 'image/x-wmf'], ['jpg', 'image/jpeg'], ['jpeg', 'image/jpeg'], ['tif', 'image/tiff'], ['tiff', 'image/tiff'], ['pdf', 'application/pdf'], ['rels', 'application/vnd.openxmlformats-package.relationships+xml'] ].map(function(x) { return writextag('Default', null, {'Extension':x[0], 'ContentType': x[1]}); })); /* only write first instance */ var f1 = function(w) { if(ct[w] && ct[w].length > 0) { v = ct[w][0]; o[o.length] = (writextag('Override', null, { 'PartName': (v[0] == '/' ? "":"/") + v, 'ContentType': CT_LIST[w][opts.bookType] || CT_LIST[w]['xlsx'] })); } }; /* book type-specific */ var f2 = function(w) { (ct[w]||[]).forEach(function(v) { o[o.length] = (writextag('Override', null, { 'PartName': (v[0] == '/' ? "":"/") + v, 'ContentType': CT_LIST[w][opts.bookType] || CT_LIST[w]['xlsx'] })); }); }; /* standard type */ var f3 = function(t) { (ct[t]||[]).forEach(function(v) { o[o.length] = (writextag('Override', null, { 'PartName': (v[0] == '/' ? "":"/") + v, 'ContentType': type2ct[t][0] })); }); }; f1('workbooks'); f2('sheets'); f2('charts'); f3('themes'); ['strs', 'styles'].forEach(f1); ['coreprops', 'extprops', 'custprops'].forEach(f3); f3('vba'); f3('comments'); f3('threadedcomments'); f3('drawings'); f2('metadata'); f3('people'); if(o.length>2){ o[o.length] = ('</Types>'); o[1]=o[1].replace("/>",">"); } return o.join(""); } /* 9.3 Relationships */ var RELS = ({ WB: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument", SHEET: "http://sheetjs.openxmlformats.org/officeDocument/2006/relationships/officeDocument", HLINK: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink", VML: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing", XPATH: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLinkPath", XMISS: "http://schemas.microsoft.com/office/2006/relationships/xlExternalLinkPath/xlPathMissing", XLINK: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink", CXML: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml", CXMLP: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps", CMNT: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments", CORE_PROPS: "http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties", EXT_PROPS: 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties', CUST_PROPS: 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties', SST: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings", STY: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles", THEME: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme", CHART: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart", CHARTEX: "http://schemas.microsoft.com/office/2014/relationships/chartEx", CS: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chartsheet", WS: [ "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet", "http://purl.oclc.org/ooxml/officeDocument/relationships/worksheet" ], DS: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/dialogsheet", MS: "http://schemas.microsoft.com/office/2006/relationships/xlMacrosheet", IMG: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image", DRAW: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing", XLMETA: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/sheetMetadata", TCMNT: "http://schemas.microsoft.com/office/2017/10/relationships/threadedComment", PEOPLE: "http://schemas.microsoft.com/office/2017/10/relationships/person", VBA: "http://schemas.microsoft.com/office/2006/relationships/vbaProject" }/*:any*/); /* 9.3.3 Representing Relationships */ function get_rels_path(file/*:string*/)/*:string*/ { var n = file.lastIndexOf("/"); return file.slice(0,n+1) + '_rels/' + file.slice(n+1) + ".rels"; } function parse_rels(data/*:?string*/, currentFilePath/*:string*/) { var rels = {"!id":{}}; if (!data) return rels; if (currentFilePath.charAt(0) !== '/') { currentFilePath = '/'+currentFilePath; } var hash = {}; (data.match(tagregex)||[]).forEach(function(x) { var y = parsexmltag(x); /* 9.3.2.2 OPC_Relationships */ if (y[0] === '<Relationship') { var rel = {}; rel.Type = y.Type; rel.Target = y.Target; rel.Id = y.Id; if(y.TargetMode) rel.TargetMode = y.TargetMode; var canonictarget = y.TargetMode === 'External' ? y.Target : resolve_path(y.Target, currentFilePath); rels[canonictarget] = rel; hash[y.Id] = rel; } }); rels["!id"] = hash; return rels; } /* TODO */ function write_rels(rels)/*:string*/ { var o = [XML_HEADER, writextag('Relationships', null, { //'xmlns:ns0': XMLNS.RELS, 'xmlns': XMLNS.RELS })]; keys(rels['!id']).forEach(function(rid) { o[o.length] = (writextag('Relationship', null, rels['!id'][rid])); }); if(o.length>2){ o[o.length] = ('</Relationships>'); o[1]=o[1].replace("/>",">"); } return o.join(""); } function add_rels(rels, rId/*:number*/, f, type, relobj, targetmode/*:?string*/)/*:number*/ { if(!relobj) relobj = {}; if(!rels['!id']) rels['!id'] = {}; if(!rels['!idx']) rels['!idx'] = 1; if(rId < 0) for(rId = rels['!idx']; rels['!id']['rId' + rId]; ++rId){/* empty */} rels['!idx'] = rId + 1; relobj.Id = 'rId' + rId; relobj.Type = type; relobj.Target = f; if(targetmode) relobj.TargetMode = targetmode; else if([RELS.HLINK, RELS.XPATH, RELS.XMISS].indexOf(relobj.Type) > -1) relobj.TargetMode = "External"; if(rels['!id'][relobj.Id]) throw new Error("Cannot rewrite rId " + rId); rels['!id'][relobj.Id] = relobj; rels[('/' + relobj.Target).replace("//","/")] = relobj; return rId; } /* Open Document Format for Office Applications (OpenDocument) Version 1.2 */ /* Part 3 Section 4 Manifest File */ var CT_ODS = "application/vnd.oasis.opendocument.spreadsheet"; function parse_manifest(d, opts) { var str = xlml_normalize(d); var Rn; var FEtag; while((Rn = xlmlregex.exec(str))) switch(Rn[3]) { case 'manifest': break; // 4.2 <manifest:manifest> case 'file-entry': // 4.3 <manifest:file-entry> FEtag = parsexmltag(Rn[0], false); if(FEtag.path == '/' && FEtag.type !== CT_ODS) throw new Error("This OpenDocument is not a spreadsheet"); break; case 'encryption-data': // 4.4 <manifest:encryption-data> case 'algorithm': // 4.5 <manifest:algorithm> case 'start-key-generation': // 4.6 <manifest:start-key-generation> case 'key-derivation': // 4.7 <manifest:key-derivation> throw new Error("Unsupported ODS Encryption"); default: if(opts && opts.WTF) throw Rn; } } function write_manifest(manifest/*:Array<Array<string> >*/)/*:string*/ { var o = [XML_HEADER]; o.push('<manifest:manifest xmlns:manifest="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0" manifest:version="1.2">\n'); o.push(' <manifest:file-entry manifest:full-path="/" manifest:version="1.2" manifest:media-type="application/vnd.oasis.opendocument.spreadsheet"/>\n'); for(var i = 0; i < manifest.length; ++i) o.push(' <manifest:file-entry manifest:full-path="' + manifest[i][0] + '" manifest:media-type="' + manifest[i][1] + '"/>\n'); o.push('</manifest:manifest>'); return o.join(""); } /* Part 3 Section 6 Metadata Manifest File */ function write_rdf_type(file/*:string*/, res/*:string*/, tag/*:?string*/) { return [ ' <rdf:Description rdf:about="' + file + '">\n', ' <rdf:type rdf:resource="http://docs.oasis-open.org/ns/office/1.2/meta/' + (tag || "odf") + '#' + res + '"/>\n', ' </rdf:Description>\n' ].join(""); } function write_rdf_has(base/*:string*/, file/*:string*/) { return [ ' <rdf:Description rdf:about="' + base + '">\n', ' <ns0:hasPart xmlns:ns0="http://docs.oasis-open.org/ns/office/1.2/meta/pkg#" rdf:resource="' + file + '"/>\n', ' </rdf:Description>\n' ].join(""); } function write_rdf(rdf) { var o = [XML_HEADER]; o.push('<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">\n'); for(var i = 0; i != rdf.length; ++i) { o.push(write_rdf_type(rdf[i][0], rdf[i][1])); o.push(write_rdf_has("",rdf[i][0])); } o.push(write_rdf_type("","Document", "pkg")); o.push('</rdf:RDF>'); return o.join(""); } /* TODO: pull properties */ function write_meta_ods(/*:: wb: Workbook, opts: any*/)/*:string*/ { return '<office:document-meta xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xlink="http://www.w3.org/1999/xlink" office:version="1.2"><office:meta><meta:generator>Sheet' + 'JS ' + XLSX.version + '</meta:generator></office:meta></office:document-meta>'; } /* ECMA-376 Part II 11.1 Core Properties Part */ /* [MS-OSHARED] 2.3.3.2.[1-2].1 (PIDSI/PIDDSI) */ var CORE_PROPS/*:Array<Array<string> >*/ = [ ["cp:category", "Category"], ["cp:contentStatus", "ContentStatus"], ["cp:keywords", "Keywords"], ["cp:lastModifiedBy", "LastAuthor"], ["cp:lastPrinted", "LastPrinted"], ["cp:revision", "RevNumber"], ["cp:version", "Version"], ["dc:creator", "Author"], ["dc:description", "Comments"], ["dc:identifier", "Identifier"], ["dc:language", "Language"], ["dc:subject", "Subject"], ["dc:title", "Title"], ["dcterms:created", "CreatedDate", 'date'], ["dcterms:modified", "ModifiedDate", 'date'] ]; var CORE_PROPS_REGEX/*:Array<RegExp>*/ = /*#__PURE__*/(function() { var r = new Array(CORE_PROPS.length); for(var i = 0; i < CORE_PROPS.length; ++i) { var f = CORE_PROPS[i]; var g = "(?:"+ f[0].slice(0,f[0].indexOf(":")) +":)"+ f[0].slice(f[0].indexOf(":")+1); r[i] = new RegExp("<" + g + "[^>]*>([\\s\\S]*?)<\/" + g + ">"); } return r; })(); function parse_core_props(data) { var p = {}; data = utf8read(data); for(var i = 0; i < CORE_PROPS.length; ++i) { var f = CORE_PROPS[i], cur = data.match(CORE_PROPS_REGEX[i]); if(cur != null && cur.length > 0) p[f[1]] = unescapexml(cur[1]); if(f[2] === 'date' && p[f[1]]) p[f[1]] = parseDate(p[f[1]]); } return p; } function cp_doit(f, g, h, o, p) { if(p[f] != null || g == null || g === "") return; p[f] = g; g = escapexml(g); o[o.length] = (h ? writextag(f,g,h) : writetag(f,g)); } function write_core_props(cp, _opts) { var opts = _opts || {}; var o = [XML_HEADER, writextag('cp:coreProperties', null, { //'xmlns': XMLNS.CORE_PROPS, 'xmlns:cp': XMLNS.CORE_PROPS, 'xmlns:dc': XMLNS.dc, 'xmlns:dcterms': XMLNS.dcterms, 'xmlns:dcmitype': XMLNS.dcmitype, 'xmlns:xsi': XMLNS.xsi })], p = {}; if(!cp && !opts.Props) return o.join(""); if(cp) { if(cp.CreatedDate != null) cp_doit("dcterms:created", typeof cp.CreatedDate === "string" ? cp.CreatedDate : write_w3cdtf(cp.CreatedDate, opts.WTF), {"xsi:type":"dcterms:W3CDTF"}, o, p); if(cp.ModifiedDate != null) cp_doit("dcterms:modified", typeof cp.ModifiedDate === "string" ? cp.ModifiedDate : write_w3cdtf(cp.ModifiedDate, opts.WTF), {"xsi:type":"dcterms:W3CDTF"}, o, p); } for(var i = 0; i != CORE_PROPS.length; ++i) { var f = CORE_PROPS[i]; var v = opts.Props && opts.Props[f[1]] != null ? opts.Props[f[1]] : cp ? cp[f[1]] : null; if(v === true) v = "1"; else if(v === false) v = "0"; else if(typeof v == "number") v = String(v); if(v != null) cp_doit(f[0], v, null, o, p); } if(o.length>2){ o[o.length] = ('</cp:coreProperties>'); o[1]=o[1].replace("/>",">"); } return o.join(""); } /* 15.2.12.3 Extended File Properties Part */ /* [MS-OSHARED] 2.3.3.2.[1-2].1 (PIDSI/PIDDSI) */ var EXT_PROPS/*:Array<Array<string> >*/ = [ ["Application", "Application", "string"], ["AppVersion", "AppVersion", "string"], ["Company", "Company", "string"], ["DocSecurity", "DocSecurity", "string"], ["Manager", "Manager", "string"], ["HyperlinksChanged", "HyperlinksChanged", "bool"], ["SharedDoc", "SharedDoc", "bool"], ["LinksUpToDate", "LinksUpToDate", "bool"], ["ScaleCrop", "ScaleCrop", "bool"], ["HeadingPairs", "HeadingPairs", "raw"], ["TitlesOfParts", "TitlesOfParts", "raw"] ]; var PseudoPropsPairs = [ "Worksheets", "SheetNames", "NamedRanges", "DefinedNames", "Chartsheets", "ChartNames" ]; function load_props_pairs(HP/*:string|Array<Array<any>>*/, TOP, props, opts) { var v = []; if(typeof HP == "string") v = parseVector(HP, opts); else for(var j = 0; j < HP.length; ++j) v = v.concat(HP[j].map(function(hp) { return {v:hp}; })); var parts = (typeof TOP == "string") ? parseVector(TOP, opts).map(function (x) { return x.v; }) : TOP; var idx = 0, len = 0; if(parts.length > 0) for(var i = 0; i !== v.length; i += 2) { len = +(v[i+1].v); switch(v[i].v) { case "Worksheets": case "工作表": case "Листы": case "أوراق العمل": case "ワークシート": case "גליונות עבודה": case "Arbeitsblätter": case "Çalışma Sayfaları": case "Feuilles de calcul": case "Fogli di lavoro": case "Folhas de cálculo": case "Planilhas": case "Regneark": case "Hojas de cálculo": case "Werkbladen": props.Worksheets = len; props.SheetNames = parts.slice(idx, idx + len); break; case "Named Ranges": case "Rangos con nombre": case "名前付き一覧": case "Benannte Bereiche": case "Navngivne områder": props.NamedRanges = len; props.DefinedNames = parts.slice(idx, idx + len); break; case "Charts": case "Diagramme": props.Chartsheets = len; props.ChartNames = parts.slice(idx, idx + len); break; } idx += len; } } function parse_ext_props(data, p, opts) { var q = {}; if(!p) p = {}; data = utf8read(data); EXT_PROPS.forEach(function(f) { var xml = (data.match(matchtag(f[0]))||[])[1]; switch(f[2]) { case "string": if(xml) p[f[1]] = unescapexml(xml); break; case "bool": p[f[1]] = xml === "true"; break; case "raw": var cur = data.match(new RegExp("<" + f[0] + "[^>]*>([\\s\\S]*?)<\/" + f[0] + ">")); if(cur && cur.length > 0) q[f[1]] = cur[1]; break; } }); if(q.HeadingPairs && q.TitlesOfParts) load_props_pairs(q.HeadingPairs, q.TitlesOfParts, p, opts); return p; } function write_ext_props(cp/*::, opts*/)/*:string*/ { var o/*:Array<string>*/ = [], W = writextag; if(!cp) cp = {}; cp.Application = "SheetJS"; o[o.length] = (XML_HEADER); o[o.length] = (writextag('Properties', null, { 'xmlns': XMLNS.EXT_PROPS, 'xmlns:vt': XMLNS.vt })); EXT_PROPS.forEach(function(f) { if(cp[f[1]] === undefined) return; var v; switch(f[2]) { case 'string': v = escapexml(String(cp[f[1]])); break; case 'bool': v = cp[f[1]] ? 'true' : 'false'; break; } if(v !== undefined) o[o.length] = (W(f[0], v)); }); /* TODO: HeadingPairs, TitlesOfParts */ o[o.length] = (W('HeadingPairs', W('vt:vector', W('vt:variant', '<vt:lpstr>Worksheets</vt:lpstr>')+W('vt:variant', W('vt:i4', String(cp.Worksheets))), {size:2, baseType:"variant"}))); o[o.length] = (W('TitlesOfParts', W('vt:vector', cp.SheetNames.map(function(s) { return "<vt:lpstr>" + escapexml(s) + "</vt:lpstr>"; }).join(""), {size: cp.Worksheets, baseType:"lpstr"}))); if(o.length>2){ o[o.length] = ('</Properties>'); o[1]=o[1].replace("/>",">"); } return o.join(""); } /* 15.2.12.2 Custom File Properties Part */ var custregex = /<[^>]+>[^<]*/g; function parse_cust_props(data/*:string*/, opts) { var p = {}, name = ""; var m = data.match(custregex); if(m) for(var i = 0; i != m.length; ++i) { var x = m[i], y = parsexmltag(x); switch(y[0]) { case '<?xml': break; case '<Properties': break; case '<property': name = unescapexml(y.name); break; case '</property>': name = null; break; default: if (x.indexOf('<vt:') === 0) { var toks = x.split('>'); var type = toks[0].slice(4), text = toks[1]; /* 22.4.2.32 (CT_Variant). Omit the binary types from 22.4 (Variant Types) */ switch(type) { case 'lpstr': case 'bstr': case 'lpwstr': p[name] = unescapexml(text); break; case 'bool': p[name] = parsexmlbool(text); break; case 'i1': case 'i2': case 'i4': case 'i8': case 'int': case 'uint': p[name] = parseInt(text, 10); break; case 'r4': case 'r8': case 'decimal': p[name] = parseFloat(text); break; case 'filetime': case 'date': p[name] = parseDate(text); break; case 'cy': case 'error': p[name] = unescapexml(text); break; default: if(type.slice(-1) == '/') break; if(opts.WTF && typeof console !== 'undefined') console.warn('Unexpected', x, type, toks); } } else if(x.slice(0,2) === "</") {/* empty */ } else if(opts.WTF) throw new Error(x); } } return p; } function write_cust_props(cp/*::, opts*/)/*:string*/ { var o = [XML_HEADER, writextag('Properties', null, { 'xmlns': XMLNS.CUST_PROPS, 'xmlns:vt': XMLNS.vt })]; if(!cp) return o.join(""); var pid = 1; keys(cp).forEach(function custprop(k) { ++pid; o[o.length] = (writextag('property', write_vt(cp[k], true), { 'fmtid': '{D5CDD505-2E9C-101B-9397-08002B2CF9AE}', 'pid': pid, 'name': escapexml(k) })); }); if(o.length>2){ o[o.length] = '</Properties>'; o[1]=o[1].replace("/>",">"); } return o.join(""); } /* Common Name -> XLML Name */ var XLMLDocPropsMap = { Title: 'Title', Subject: 'Subject', Author: 'Author', Keywords: 'Keywords', Comments: 'Description', LastAuthor: 'LastAuthor', RevNumber: 'Revision', Application: 'AppName', /* TotalTime: 'TotalTime', */ LastPrinted: 'LastPrinted', CreatedDate: 'Created', ModifiedDate: 'LastSaved', /* Pages */ /* Words */ /* Characters */ Category: 'Category', /* PresentationFormat */ Manager: 'Manager', Company: 'Company', /* Guid */ /* HyperlinkBase */ /* Bytes */ /* Lines */ /* Paragraphs */ /* CharactersWithSpaces */ AppVersion: 'Version', ContentStatus: 'ContentStatus', /* NOTE: missing from schema */ Identifier: 'Identifier', /* NOTE: missing from schema */ Language: 'Language' /* NOTE: missing from schema */ }; var evert_XLMLDPM; function xlml_set_prop(Props, tag/*:string*/, val) { if(!evert_XLMLDPM) evert_XLMLDPM = evert(XLMLDocPropsMap); tag = evert_XLMLDPM[tag] || tag; Props[tag] = val; } function xlml_write_docprops(Props, opts) { var o/*:Array<string>*/ = []; keys(XLMLDocPropsMap).map(function(m) { for(var i = 0; i < CORE_PROPS.length; ++i) if(CORE_PROPS[i][1] == m) return CORE_PROPS[i]; for(i = 0; i < EXT_PROPS.length; ++i) if(EXT_PROPS[i][1] == m) return EXT_PROPS[i]; throw m; }).forEach(function(p) { if(Props[p[1]] == null) return; var m = opts && opts.Props && opts.Props[p[1]] != null ? opts.Props[p[1]] : Props[p[1]]; switch(p[2]) { case 'date': m = new Date(m).toISOString().replace(/\.\d*Z/,"Z"); break; } if(typeof m == 'number') m = String(m); else if(m === true || m === false) { m = m ? "1" : "0"; } else if(m instanceof Date) m = new Date(m).toISOString().replace(/\.\d*Z/,""); o.push(writetag(XLMLDocPropsMap[p[1]] || p[1], m)); }); return writextag('DocumentProperties', o.join(""), {xmlns:XLMLNS.o }); } function xlml_write_custprops(Props, Custprops/*::, opts*/) { var BLACKLIST = ["Worksheets","SheetNames"]; var T = 'CustomDocumentProperties'; var o/*:Array<string>*/ = []; if(Props) keys(Props).forEach(function(k) { /*:: if(!Props) return; */ if(!Object.prototype.hasOwnProperty.call(Props, k)) return; for(var i = 0; i < CORE_PROPS.length; ++i) if(k == CORE_PROPS[i][1]) return; for(i = 0; i < EXT_PROPS.length; ++i) if(k == EXT_PROPS[i][1]) return; for(i = 0; i < BLACKLIST.length; ++i) if(k == BLACKLIST[i]) return; var m = Props[k]; var t = "string"; if(typeof m == 'number') { t = "float"; m = String(m); } else if(m === true || m === false) { t = "boolean"; m = m ? "1" : "0"; } else m = String(m); o.push(writextag(escapexmltag(k), m, {"dt:dt":t})); }); if(Custprops) keys(Custprops).forEach(function(k) { /*:: if(!Custprops) return; */ if(!Object.prototype.hasOwnProperty.call(Custprops, k)) return; if(Props && Object.prototype.hasOwnProperty.call(Props, k)) return; var m = Custprops[k]; var t = "string"; if(typeof m == 'number') { t = "float"; m = String(m); } else if(m === true || m === false) { t = "boolean"; m = m ? "1" : "0"; } else if(m instanceof Date) { t = "dateTime.tz"; m = m.toISOString(); } else m = String(m); o.push(writextag(escapexmltag(k), m, {"dt:dt":t})); }); return '<' + T + ' xmlns="' + XLMLNS.o + '">' + o.join("") + '</' + T + '>'; } /* [MS-DTYP] 2.3.3 FILETIME */ /* [MS-OLEDS] 2.1.3 FILETIME (Packet Version) */ /* [MS-OLEPS] 2.8 FILETIME (Packet Version) */ function parse_FILETIME(blob) { var dwLowDateTime = blob.read_shift(4), dwHighDateTime = blob.read_shift(4); return new Date(((dwHighDateTime/1e7*Math.pow(2,32) + dwLowDateTime/1e7) - 11644473600)*1000).toISOString().replace(/\.000/,""); } function write_FILETIME(time/*:string|Date*/) { var date = (typeof time == "string") ? new Date(Date.parse(time)) : time; var t = date.getTime() / 1000 + 11644473600; var l = t % Math.pow(2,32), h = (t - l) / Math.pow(2,32); l *= 1e7; h *= 1e7; var w = (l / Math.pow(2,32)) | 0; if(w > 0) { l = l % Math.pow(2,32); h += w; } var o = new_buf(8); o.write_shift(4, l); o.write_shift(4, h); return o; } /* [MS-OSHARED] 2.3.3.1.4 Lpstr */ function parse_lpstr(blob, type, pad/*:?number*/) { var start = blob.l; var str = blob.read_shift(0, 'lpstr-cp'); if(pad) while((blob.l - start) & 3) ++blob.l; return str; } /* [MS-OSHARED] 2.3.3.1.6 Lpwstr */ function parse_lpwstr(blob, type, pad) { var str = blob.read_shift(0, 'lpwstr'); if(pad) blob.l += (4 - ((str.length+1) & 3)) & 3; return str; } /* [MS-OSHARED] 2.3.3.1.11 VtString */ /* [MS-OSHARED] 2.3.3.1.12 VtUnalignedString */ function parse_VtStringBase(blob, stringType, pad) { if(stringType === 0x1F /*VT_LPWSTR*/) return parse_lpwstr(blob); return parse_lpstr(blob, stringType, pad); } function parse_VtString(blob, t/*:number*/, pad/*:?boolean*/) { return parse_VtStringBase(blob, t, pad === false ? 0: 4); } function parse_VtUnalignedString(blob, t/*:number*/) { if(!t) throw new Error("VtUnalignedString must have positive length"); return parse_VtStringBase(blob, t, 0); } /* [MS-OSHARED] 2.3.3.1.7 VtVecLpwstrValue */ function parse_VtVecLpwstrValue(blob)/*:Array<string>*/ { var length = blob.read_shift(4); var ret/*:Array<string>*/ = []; for(var i = 0; i != length; ++i) { var start = blob.l; ret[i] = blob.read_shift(0, 'lpwstr').replace(chr0,''); if((blob.l - start) & 0x02) blob.l += 2; } return ret; } /* [MS-OSHARED] 2.3.3.1.9 VtVecUnalignedLpstrValue */ function parse_VtVecUnalignedLpstrValue(blob)/*:Array<string>*/ { var length = blob.read_shift(4); var ret/*:Array<string>*/ = []; for(var i = 0; i != length; ++i) ret[i] = blob.read_shift(0, 'lpstr-cp').replace(chr0,''); return ret; } /* [MS-OSHARED] 2.3.3.1.13 VtHeadingPair */ function parse_VtHeadingPair(blob) { var start = blob.l; var headingString = parse_TypedPropertyValue(blob, VT_USTR); if(blob[blob.l] == 0x00 && blob[blob.l+1] == 0x00 && ((blob.l - start) & 0x02)) blob.l += 2; var headerParts = parse_TypedPropertyValue(blob, VT_I4); return [headingString, headerParts]; } /* [MS-OSHARED] 2.3.3.1.14 VtVecHeadingPairValue */ function parse_VtVecHeadingPairValue(blob) { var cElements = blob.read_shift(4); var out = []; for(var i = 0; i < cElements / 2; ++i) out.push(parse_VtHeadingPair(blob)); return out; } /* [MS-OLEPS] 2.18.1 Dictionary (uses 2.17, 2.16) */ function parse_dictionary(blob,CodePage) { var cnt = blob.read_shift(4); var dict/*:{[number]:string}*/ = ({}/*:any*/); for(var j = 0; j != cnt; ++j) { var pid = blob.read_shift(4); var len = blob.read_shift(4); dict[pid] = blob.read_shift(len, (CodePage === 0x4B0 ?'utf16le':'utf8')).replace(chr0,'').replace(chr1,'!'); if(CodePage === 0x4B0 && (len % 2)) blob.l += 2; } if(blob.l & 3) blob.l = (blob.l>>2+1)<<2; return dict; } /* [MS-OLEPS] 2.9 BLOB */ function parse_BLOB(blob) { var size = blob.read_shift(4); var bytes = blob.slice(blob.l,blob.l+size); blob.l += size; if((size & 3) > 0) blob.l += (4 - (size & 3)) & 3; return bytes; } /* [MS-OLEPS] 2.11 ClipboardData */ function parse_ClipboardData(blob) { // TODO var o = {}; o.Size = blob.read_shift(4); //o.Format = blob.read_shift(4); blob.l += o.Size + 3 - (o.Size - 1) % 4; return o; } /* [MS-OLEPS] 2.15 TypedPropertyValue */ function parse_TypedPropertyValue(blob, type/*:number*/, _opts)/*:any*/ { var t = blob.read_shift(2), ret, opts = _opts||{}; blob.l += 2; if(type !== VT_VARIANT) if(t !== type && VT_CUSTOM.indexOf(type)===-1 && !((type & 0xFFFE) == 0x101E && (t & 0xFFFE) == 0x101E)) throw new Error('Expected type ' + type + ' saw ' + t); switch(type === VT_VARIANT ? t : type) { case 0x02 /*VT_I2*/: ret = blob.read_shift(2, 'i'); if(!opts.raw) blob.l += 2; return ret; case 0x03 /*VT_I4*/: ret = blob.read_shift(4, 'i'); return ret; case 0x0B /*VT_BOOL*/: return blob.read_shift(4) !== 0x0; case 0x13 /*VT_UI4*/: ret = blob.read_shift(4); return ret; case 0x1E /*VT_LPSTR*/: return parse_lpstr(blob, t, 4).replace(chr0,''); case 0x1F /*VT_LPWSTR*/: return parse_lpwstr(blob); case 0x40 /*VT_FILETIME*/: return parse_FILETIME(blob); case 0x41 /*VT_BLOB*/: return parse_BLOB(blob); case 0x47 /*VT_CF*/: return parse_ClipboardData(blob); case 0x50 /*VT_STRING*/: return parse_VtString(blob, t, !opts.raw).replace(chr0,''); case 0x51 /*VT_USTR*/: return parse_VtUnalignedString(blob, t/*, 4*/).replace(chr0,''); case 0x100C /*VT_VECTOR|VT_VARIANT*/: return parse_VtVecHeadingPairValue(blob); case 0x101E /*VT_VECTOR|VT_LPSTR*/: case 0x101F /*VT_VECTOR|VT_LPWSTR*/: return t == 0x101F ? parse_VtVecLpwstrValue(blob) : parse_VtVecUnalignedLpstrValue(blob); default: throw new Error("TypedPropertyValue unrecognized type " + type + " " + t); } } function write_TypedPropertyValue(type/*:number*/, value) { var o = new_buf(4), p = new_buf(4); o.write_shift(4, type == 0x50 ? 0x1F : type); switch(type) { case 0x03 /*VT_I4*/: p.write_shift(-4, value); break; case 0x05 /*VT_I4*/: p = new_buf(8); p.write_shift(8, value, 'f'); break; case 0x0B /*VT_BOOL*/: p.write_shift(4, value ? 0x01 : 0x00); break; case 0x40 /*VT_FILETIME*/: /*:: if(typeof value !== "string" && !(value instanceof Date)) throw "unreachable"; */ p = write_FILETIME(value); break; case 0x1F /*VT_LPWSTR*/: case 0x50 /*VT_STRING*/: /*:: if(typeof value !== "string") throw "unreachable"; */ p = new_buf(4 + 2 * (value.length + 1) + (value.length % 2 ? 0 : 2)); p.write_shift(4, value.length + 1); p.write_shift(0, value, "dbcs"); while(p.l != p.length) p.write_shift(1, 0); break; default: throw new Error("TypedPropertyValue unrecognized type " + type + " " + value); } return bconcat([o, p]); } /* [MS-OLEPS] 2.20 PropertySet */ function parse_PropertySet(blob, PIDSI) { var start_addr = blob.l; var size = blob.read_shift(4); var NumProps = blob.read_shift(4); var Props = [], i = 0; var CodePage = 0; var Dictionary = -1, DictObj/*:{[number]:string}*/ = ({}/*:any*/); for(i = 0; i != NumProps; ++i) { var PropID = blob.read_shift(4); var Offset = blob.read_shift(4); Props[i] = [PropID, Offset + start_addr]; } Props.sort(function(x,y) { return x[1] - y[1]; }); var PropH = {}; for(i = 0; i != NumProps; ++i) { if(blob.l !== Props[i][1]) { var fail = true; if(i>0 && PIDSI) switch(PIDSI[Props[i-1][0]].t) { case 0x02 /*VT_I2*/: if(blob.l+2 === Props[i][1]) { blob.l+=2; fail = false; } break; case 0x50 /*VT_STRING*/: if(blob.l <= Props[i][1]) { blob.l=Props[i][1]; fail = false; } break; case 0x100C /*VT_VECTOR|VT_VARIANT*/: if(blob.l <= Props[i][1]) { blob.l=Props[i][1]; fail = false; } break; } if((!PIDSI||i==0) && blob.l <= Props[i][1]) { fail=false; blob.l = Props[i][1]; } if(fail) throw new Error("Read Error: Expected address " + Props[i][1] + ' at ' + blob.l + ' :' + i); } if(PIDSI) { var piddsi = PIDSI[Props[i][0]]; PropH[piddsi.n] = parse_TypedPropertyValue(blob, piddsi.t, {raw:true}); if(piddsi.p === 'version') PropH[piddsi.n] = String(PropH[piddsi.n] >> 16) + "." + ("0000" + String(PropH[piddsi.n] & 0xFFFF)).slice(-4); if(piddsi.n == "CodePage") switch(PropH[piddsi.n]) { case 0: PropH[piddsi.n] = 1252; /* falls through */ case 874: case 932: case 936: case 949: case 950: case 1250: case 1251: case 1253: case 1254: case 1255: case 1256: case 1257: case 1258: case 10000: case 1200: case 1201: case 1252: case 65000: case -536: case 65001: case -535: set_cp(CodePage = (PropH[piddsi.n]>>>0) & 0xFFFF); break; default: throw new Error("Unsupported CodePage: " + PropH[piddsi.n]); } } else { if(Props[i][0] === 0x1) { CodePage = PropH.CodePage = (parse_TypedPropertyValue(blob, VT_I2)/*:number*/); set_cp(CodePage); if(Dictionary !== -1) { var oldpos = blob.l; blob.l = Props[Dictionary][1]; DictObj = parse_dictionary(blob,CodePage); blob.l = oldpos; } } else if(Props[i][0] === 0) { if(CodePage === 0) { Dictionary = i; blob.l = Props[i+1][1]; continue; } DictObj = parse_dictionary(blob,CodePage); } else { var name = DictObj[Props[i][0]]; var val; /* [MS-OSHARED] 2.3.3.2.3.1.2 + PROPVARIANT */ switch(blob[blob.l]) { case 0x41 /*VT_BLOB*/: blob.l += 4; val = parse_BLOB(blob); break; case 0x1E /*VT_LPSTR*/: blob.l += 4; val = parse_VtString(blob, blob[blob.l-4]).replace(/\u0000+$/,""); break; case 0x1F /*VT_LPWSTR*/: blob.l += 4; val = parse_VtString(blob, blob[blob.l-4]).replace(/\u0000+$/,""); break; case 0x03 /*VT_I4*/: blob.l += 4; val = blob.read_shift(4, 'i'); break; case 0x13 /*VT_UI4*/: blob.l += 4; val = blob.read_shift(4); break; case 0x05 /*VT_R8*/: blob.l += 4; val = blob.read_shift(8, 'f'); break; case 0x0B /*VT_BOOL*/: blob.l += 4; val = parsebool(blob, 4); break; case 0x40 /*VT_FILETIME*/: blob.l += 4; val = parseDate(parse_FILETIME(blob)); break; default: throw new Error("unparsed value: " + blob[blob.l]); } PropH[name] = val; } } } blob.l = start_addr + size; /* step ahead to skip padding */ return PropH; } var XLSPSSkip = [ "CodePage", "Thumbnail", "_PID_LINKBASE", "_PID_HLINKS", "SystemIdentifier", "FMTID" ]; //.concat(PseudoPropsPairs); function guess_property_type(val/*:any*/)/*:number*/ { switch(typeof val) { case "boolean": return 0x0B; case "number": return ((val|0)==val) ? 0x03 : 0x05; case "string": return 0x1F; case "object": if(val instanceof Date) return 0x40; break; } return -1; } function write_PropertySet(entries, RE, PIDSI) { var hdr = new_buf(8), piao = [], prop = []; var sz = 8, i = 0; var pr = new_buf(8), pio = new_buf(8); pr.write_shift(4, 0x0002); pr.write_shift(4, 0x04B0); pio.write_shift(4, 0x0001); prop.push(pr); piao.push(pio); sz += 8 + pr.length; if(!RE) { pio = new_buf(8); pio.write_shift(4, 0); piao.unshift(pio); var bufs = [new_buf(4)]; bufs[0].write_shift(4, entries.length); for(i = 0; i < entries.length; ++i) { var value = entries[i][0]; pr = new_buf(4 + 4 + 2 * (value.length + 1) + (value.length % 2 ? 0 : 2)); pr.write_shift(4, i+2); pr.write_shift(4, value.length + 1); pr.write_shift(0, value, "dbcs"); while(pr.l != pr.length) pr.write_shift(1, 0); bufs.push(pr); } pr = bconcat(bufs); prop.unshift(pr); sz += 8 + pr.length; } for(i = 0; i < entries.length; ++i) { if(RE && !RE[entries[i][0]]) continue; if(XLSPSSkip.indexOf(entries[i][0]) > -1 || PseudoPropsPairs.indexOf(entries[i][0]) > -1) continue; if(entries[i][1] == null) continue; var val = entries[i][1], idx = 0; if(RE) { idx = +RE[entries[i][0]]; var pinfo = (PIDSI/*:: || {}*/)[idx]/*:: || {} */; if(pinfo.p == "version" && typeof val == "string") { /*:: if(typeof val !== "string") throw "unreachable"; */ var arr = val.split("."); val = ((+arr[0])<<16) + ((+arr[1])||0); } pr = write_TypedPropertyValue(pinfo.t, val); } else { var T = guess_property_type(val); if(T == -1) { T = 0x1F; val = String(val); } pr = write_TypedPropertyValue(T, val); } prop.push(pr); pio = new_buf(8); pio.write_shift(4, !RE ? 2+i : idx); piao.push(pio); sz += 8 + pr.length; } var w = 8 * (prop.length + 1); for(i = 0; i < prop.length; ++i) { piao[i].write_shift(4, w); w += prop[i].length; } hdr.write_shift(4, sz); hdr.write_shift(4, prop.length); return bconcat([hdr].concat(piao).concat(prop)); } /* [MS-OLEPS] 2.21 PropertySetStream */ function parse_PropertySetStream(file, PIDSI, clsid) { var blob = file.content; if(!blob) return ({}/*:any*/); prep_blob(blob, 0); var NumSets, FMTID0, FMTID1, Offset0, Offset1 = 0; blob.chk('feff', 'Byte Order: '); /*var vers = */blob.read_shift(2); // TODO: check version var SystemIdentifier = blob.read_shift(4); var CLSID = blob.read_shift(16); if(CLSID !== CFB.utils.consts.HEADER_CLSID && CLSID !== clsid) throw new Error("Bad PropertySet CLSID " + CLSID); NumSets = blob.read_shift(4); if(NumSets !== 1 && NumSets !== 2) throw new Error("Unrecognized #Sets: " + NumSets); FMTID0 = blob.read_shift(16); Offset0 = blob.read_shift(4); if(NumSets === 1 && Offset0 !== blob.l) throw new Error("Length mismatch: " + Offset0 + " !== " + blob.l); else if(NumSets === 2) { FMTID1 = blob.read_shift(16); Offset1 = blob.read_shift(4); } var PSet0 = parse_PropertySet(blob, PIDSI); var rval = ({ SystemIdentifier: SystemIdentifier }/*:any*/); for(var y in PSet0) rval[y] = PSet0[y]; //rval.blob = blob; rval.FMTID = FMTID0; //rval.PSet0 = PSet0; if(NumSets === 1) return rval; if(Offset1 - blob.l == 2) blob.l += 2; if(blob.l !== Offset1) throw new Error("Length mismatch 2: " + blob.l + " !== " + Offset1); var PSet1; try { PSet1 = parse_PropertySet(blob, null); } catch(e) {/* empty */} for(y in PSet1) rval[y] = PSet1[y]; rval.FMTID = [FMTID0, FMTID1]; // TODO: verify FMTID0/1 return rval; } function write_PropertySetStream(entries, clsid, RE, PIDSI/*:{[key:string|number]:any}*/, entries2/*:?any*/, clsid2/*:?any*/) { var hdr = new_buf(entries2 ? 68 : 48); var bufs = [hdr]; hdr.write_shift(2, 0xFFFE); hdr.write_shift(2, 0x0000); /* TODO: type 1 props */ hdr.write_shift(4, 0x32363237); hdr.write_shift(16, CFB.utils.consts.HEADER_CLSID, "hex"); hdr.write_shift(4, (entries2 ? 2 : 1)); hdr.write_shift(16, clsid, "hex"); hdr.write_shift(4, (entries2 ? 68 : 48)); var ps0 = write_PropertySet(entries, RE, PIDSI); bufs.push(ps0); if(entries2) { var ps1 = write_PropertySet(entries2, null, null); hdr.write_shift(16, clsid2, "hex"); hdr.write_shift(4, 68 + ps0.length); bufs.push(ps1); } return bconcat(bufs); } function parsenoop2(blob, length) { blob.read_shift(length); return null; } function writezeroes(n, o) { if(!o) o=new_buf(n); for(var j=0; j<n; ++j) o.write_shift(1, 0); return o; } function parslurp(blob, length, cb) { var arr = [], target = blob.l + length; while(blob.l < target) arr.push(cb(blob, target - blob.l)); if(target !== blob.l) throw new Error("Slurp error"); return arr; } function parsebool(blob, length/*:number*/) { return blob.read_shift(length) === 0x1; } function writebool(v/*:any*/, o) { if(!o) o=new_buf(2); o.write_shift(2, +!!v); return o; } function parseuint16(blob/*::, length:?number, opts:?any*/) { return blob.read_shift(2, 'u'); } function writeuint16(v/*:number*/, o) { if(!o) o=new_buf(2); o.write_shift(2, v); return o; } function parseuint16a(blob, length/*:: :?number, opts:?any*/) { return parslurp(blob,length,parseuint16);} /* --- 2.5 Structures --- */ /* [MS-XLS] 2.5.10 Bes (boolean or error) */ function parse_Bes(blob/*::, length*/) { var v = blob.read_shift(1), t = blob.read_shift(1); return t === 0x01 ? v : v === 0x01; } function write_Bes(v, t/*:string*/, o) { if(!o) o = new_buf(2); o.write_shift(1, ((t == 'e') ? +v : +!!v)); o.write_shift(1, ((t == 'e') ? 1 : 0)); return o; } /* [MS-XLS] 2.5.240 ShortXLUnicodeString */ function parse_ShortXLUnicodeString(blob, length, opts) { var cch = blob.read_shift(opts && opts.biff >= 12 ? 2 : 1); var encoding = 'sbcs-cont'; var cp = current_codepage; if(opts && opts.biff >= 8) current_codepage = 1200; if(!opts || opts.biff == 8 ) { var fHighByte = blob.read_shift(1); if(fHighByte) { encoding = 'dbcs-cont'; } } else if(opts.biff == 12) { encoding = 'wstr'; } if(opts.biff >= 2 && opts.biff <= 5) encoding = 'cpstr'; var o = cch ? blob.read_shift(cch, encoding) : ""; current_codepage = cp; return o; } /* 2.5.293 XLUnicodeRichExtendedString */ function parse_XLUnicodeRichExtendedString(blob) { var cp = current_codepage; current_codepage = 1200; var cch = blob.read_shift(2), flags = blob.read_shift(1); var /*fHighByte = flags & 0x1,*/ fExtSt = flags & 0x4, fRichSt = flags & 0x8; var width = 1 + (flags & 0x1); // 0x0 -> utf8, 0x1 -> dbcs var cRun = 0, cbExtRst; var z = {}; if(fRichSt) cRun = blob.read_shift(2); if(fExtSt) cbExtRst = blob.read_shift(4); var encoding = width == 2 ? 'dbcs-cont' : 'sbcs-cont'; var msg = cch === 0 ? "" : blob.read_shift(cch, encoding); if(fRichSt) blob.l += 4 * cRun; //TODO: parse this if(fExtSt) blob.l += cbExtRst; //TODO: parse this z.t = msg; if(!fRichSt) { z.raw = "<t>" + z.t + "</t>"; z.r = z.t; } current_codepage = cp; return z; } function write_XLUnicodeRichExtendedString(xlstr/*:: :XLString, opts*/) { var str = (xlstr.t||""), nfmts = 1; var hdr = new_buf(3 + (nfmts > 1 ? 2 : 0)); hdr.write_shift(2, str.length); hdr.write_shift(1, (nfmts > 1 ? 0x08 : 0x00) | 0x01); if(nfmts > 1) hdr.write_shift(2, nfmts); var otext = new_buf(2 * str.length); otext.write_shift(2 * str.length, str, 'utf16le'); var out = [hdr, otext]; return bconcat(out); } /* 2.5.296 XLUnicodeStringNoCch */ function parse_XLUnicodeStringNoCch(blob, cch, opts) { var retval; if(opts) { if(opts.biff >= 2 && opts.biff <= 5) return blob.read_shift(cch, 'cpstr'); if(opts.biff >= 12) return blob.read_shift(cch, 'dbcs-cont'); } var fHighByte = blob.read_shift(1); if(fHighByte===0) { retval = blob.read_shift(cch, 'sbcs-cont'); } else { retval = blob.read_shift(cch, 'dbcs-cont'); } return retval; } /* 2.5.294 XLUnicodeString */ function parse_XLUnicodeString(blob, length, opts) { var cch = blob.read_shift(opts && opts.biff == 2 ? 1 : 2); if(cch === 0) { blob.l++; return ""; } return parse_XLUnicodeStringNoCch(blob, cch, opts); } /* BIFF5 override */ function parse_XLUnicodeString2(blob, length, opts) { if(opts.biff > 5) return parse_XLUnicodeString(blob, length, opts); var cch = blob.read_shift(1); if(cch === 0) { blob.l++; return ""; } return blob.read_shift(cch, (opts.biff <= 4 || !blob.lens ) ? 'cpstr' : 'sbcs-cont'); } /* TODO: BIFF5 and lower, codepage awareness */ function write_XLUnicodeString(str, opts, o) { if(!o) o = new_buf(3 + 2 * str.length); o.write_shift(2, str.length); o.write_shift(1, 1); o.write_shift(31, str, 'utf16le'); return o; } /* [MS-XLS] 2.5.61 ControlInfo */ function parse_ControlInfo(blob/*::, length, opts*/) { var flags = blob.read_shift(1); blob.l++; var accel = blob.read_shift(2); blob.l += 2; return [flags, accel]; } /* [MS-OSHARED] 2.3.7.6 URLMoniker TODO: flags */ function parse_URLMoniker(blob/*::, length, opts*/) { var len = blob.read_shift(4), start = blob.l; var extra = false; if(len > 24) { /* look ahead */ blob.l += len - 24; if(blob.read_shift(16) === "795881f43b1d7f48af2c825dc4852763") extra = true; blob.l = start; } var url = blob.read_shift((extra?len-24:len)>>1, 'utf16le').replace(chr0,""); if(extra) blob.l += 24; return url; } /* [MS-OSHARED] 2.3.7.8 FileMoniker TODO: all fields */ function parse_FileMoniker(blob/*::, length*/) { var cAnti = blob.read_shift(2); var preamble = ""; while(cAnti-- > 0) preamble += "../"; var ansiPath = blob.read_shift(0, 'lpstr-ansi'); blob.l += 2; //var endServer = blob.read_shift(2); if(blob.read_shift(2) != 0xDEAD) throw new Error("Bad FileMoniker"); var sz = blob.read_shift(4); if(sz === 0) return preamble + ansiPath.replace(/\\/g,"/"); var bytes = blob.read_shift(4); if(blob.read_shift(2) != 3) throw new Error("Bad FileMoniker"); var unicodePath = blob.read_shift(bytes>>1, 'utf16le').replace(chr0,""); return preamble + unicodePath; } /* [MS-OSHARED] 2.3.7.2 HyperlinkMoniker TODO: all the monikers */ function parse_HyperlinkMoniker(blob, length) { var clsid = blob.read_shift(16); length -= 16; switch(clsid) { case "e0c9ea79f9bace118c8200aa004ba90b": return parse_URLMoniker(blob, length); case "0303000000000000c000000000000046": return parse_FileMoniker(blob, length); default: throw new Error("Unsupported Moniker " + clsid); } } /* [MS-OSHARED] 2.3.7.9 HyperlinkString */ function parse_HyperlinkString(blob/*::, length*/) { var len = blob.read_shift(4); var o = len > 0 ? blob.read_shift(len, 'utf16le').replace(chr0, "") : ""; return o; } function write_HyperlinkString(str/*:string*/, o) { if(!o) o = new_buf(6 + str.length * 2); o.write_shift(4, 1 + str.length); for(var i = 0; i < str.length; ++i) o.write_shift(2, str.charCodeAt(i)); o.write_shift(2, 0); return o; } /* [MS-OSHARED] 2.3.7.1 Hyperlink Object */ function parse_Hyperlink(blob, length)/*:Hyperlink*/ { var end = blob.l + length; var sVer = blob.read_shift(4); if(sVer !== 2) throw new Error("Unrecognized streamVersion: " + sVer); var flags = blob.read_shift(2); blob.l += 2; var displayName, targetFrameName, moniker, oleMoniker, Loc="", guid, fileTime; if(flags & 0x0010) displayName = parse_HyperlinkString(blob, end - blob.l); if(flags & 0x0080) targetFrameName = parse_HyperlinkString(blob, end - blob.l); if((flags & 0x0101) === 0x0101) moniker = parse_HyperlinkString(blob, end - blob.l); if((flags & 0x0101) === 0x0001) oleMoniker = parse_HyperlinkMoniker(blob, end - blob.l); if(flags & 0x0008) Loc = parse_HyperlinkString(blob, end - blob.l); if(flags & 0x0020) guid = blob.read_shift(16); if(flags & 0x0040) fileTime = parse_FILETIME(blob/*, 8*/); blob.l = end; var target = targetFrameName||moniker||oleMoniker||""; if(target && Loc) target+="#"+Loc; if(!target) target = "#" + Loc; if((flags & 0x0002) && target.charAt(0) == "/" && target.charAt(1) != "/") target = "file://" + target; var out = ({Target:target}/*:any*/); if(guid) out.guid = guid; if(fileTime) out.time = fileTime; if(displayName) out.Tooltip = displayName; return out; } function write_Hyperlink(hl) { var out = new_buf(512), i = 0; var Target = hl.Target; if(Target.slice(0,7) == "file://") Target = Target.slice(7); var hashidx = Target.indexOf("#"); var F = hashidx > -1 ? 0x1f : 0x17; switch(Target.charAt(0)) { case "#": F=0x1c; break; case ".": F&=~2; break; } out.write_shift(4,2); out.write_shift(4, F); var data = [8,6815827,6619237,4849780,83]; for(i = 0; i < data.length; ++i) out.write_shift(4, data[i]); if(F == 0x1C) { Target = Target.slice(1); write_HyperlinkString(Target, out); } else if(F & 0x02) { data = "e0 c9 ea 79 f9 ba ce 11 8c 82 00 aa 00 4b a9 0b".split(" "); for(i = 0; i < data.length; ++i) out.write_shift(1, parseInt(data[i], 16)); var Pretarget = hashidx > -1 ? Target.slice(0, hashidx) : Target; out.write_shift(4, 2*(Pretarget.length + 1)); for(i = 0; i < Pretarget.length; ++i) out.write_shift(2, Pretarget.charCodeAt(i)); out.write_shift(2, 0); if(F & 0x08) write_HyperlinkString(hashidx > -1 ? Target.slice(hashidx+1): "", out); } else { data = "03 03 00 00 00 00 00 00 c0 00 00 00 00 00 00 46".split(" "); for(i = 0; i < data.length; ++i) out.write_shift(1, parseInt(data[i], 16)); var P = 0; while(Target.slice(P*3,P*3+3)=="../"||Target.slice(P*3,P*3+3)=="..\\") ++P; out.write_shift(2, P); out.write_shift(4, Target.length - 3 * P + 1); for(i = 0; i < Target.length - 3 * P; ++i) out.write_shift(1, Target.charCodeAt(i + 3 * P) & 0xFF); out.write_shift(1, 0); out.write_shift(2, 0xFFFF); out.write_shift(2, 0xDEAD); for(i = 0; i < 6; ++i) out.write_shift(4, 0); } return out.slice(0, out.l); } /* 2.5.178 LongRGBA */ function parse_LongRGBA(blob/*::, length*/) { var r = blob.read_shift(1), g = blob.read_shift(1), b = blob.read_shift(1), a = blob.read_shift(1); return [r,g,b,a]; } /* 2.5.177 LongRGB */ function parse_LongRGB(blob, length) { var x = parse_LongRGBA(blob, length); x[3] = 0; return x; } /* [MS-XLS] 2.5.19 */ function parse_XLSCell(blob/*::, length*/)/*:Cell*/ { var rw = blob.read_shift(2); // 0-indexed var col = blob.read_shift(2); var ixfe = blob.read_shift(2); return ({r:rw, c:col, ixfe:ixfe}/*:any*/); } function write_XLSCell(R/*:number*/, C/*:number*/, ixfe/*:?number*/, o) { if(!o) o = new_buf(6); o.write_shift(2, R); o.write_shift(2, C); o.write_shift(2, ixfe||0); return o; } /* [MS-XLS] 2.5.134 */ function parse_frtHeader(blob) { var rt = blob.read_shift(2); var flags = blob.read_shift(2); // TODO: parse these flags blob.l += 8; return {type: rt, flags: flags}; } function parse_OptXLUnicodeString(blob, length, opts) { return length === 0 ? "" : parse_XLUnicodeString2(blob, length, opts); } /* [MS-XLS] 2.5.344 */ function parse_XTI(blob, length, opts) { var w = opts.biff > 8 ? 4 : 2; var iSupBook = blob.read_shift(w), itabFirst = blob.read_shift(w,'i'), itabLast = blob.read_shift(w,'i'); return [iSupBook, itabFirst, itabLast]; } /* [MS-XLS] 2.5.218 */ function parse_RkRec(blob) { var ixfe = blob.read_shift(2); var RK = parse_RkNumber(blob); return [ixfe, RK]; } /* [MS-XLS] 2.5.1 */ function parse_AddinUdf(blob, length, opts) { blob.l += 4; length -= 4; var l = blob.l + length; var udfName = parse_ShortXLUnicodeString(blob, length, opts); var cb = blob.read_shift(2); l -= blob.l; if(cb !== l) throw new Error("Malformed AddinUdf: padding = " + l + " != " + cb); blob.l += cb; return udfName; } /* [MS-XLS] 2.5.209 TODO: Check sizes */ function parse_Ref8U(blob/*::, length*/) { var rwFirst = blob.read_shift(2); var rwLast = blob.read_shift(2); var colFirst = blob.read_shift(2); var colLast = blob.read_shift(2); return {s:{c:colFirst, r:rwFirst}, e:{c:colLast,r:rwLast}}; } function write_Ref8U(r/*:Range*/, o) { if(!o) o = new_buf(8); o.write_shift(2, r.s.r); o.write_shift(2, r.e.r); o.write_shift(2, r.s.c); o.write_shift(2, r.e.c); return o; } /* [MS-XLS] 2.5.211 */ function parse_RefU(blob/*::, length*/) { var rwFirst = blob.read_shift(2); var rwLast = blob.read_shift(2); var colFirst = blob.read_shift(1); var colLast = blob.read_shift(1); return {s:{c:colFirst, r:rwFirst}, e:{c:colLast,r:rwLast}}; } /* [MS-XLS] 2.5.207 */ var parse_Ref = parse_RefU; /* [MS-XLS] 2.5.143 */ function parse_FtCmo(blob/*::, length*/) { blob.l += 4; var ot = blob.read_shift(2); var id = blob.read_shift(2); var flags = blob.read_shift(2); blob.l+=12; return [id, ot, flags]; } /* [MS-XLS] 2.5.149 */ function parse_FtNts(blob) { var out = {}; blob.l += 4; blob.l += 16; // GUID TODO out.fSharedNote = blob.read_shift(2); blob.l += 4; return out; } /* [MS-XLS] 2.5.142 */ function parse_FtCf(blob) { var out = {}; blob.l += 4; blob.cf = blob.read_shift(2); return out; } /* [MS-XLS] 2.5.140 - 2.5.154 and friends */ function parse_FtSkip(blob) { blob.l += 2; blob.l += blob.read_shift(2); } var FtTab = { /*::[*/0x00/*::]*/: parse_FtSkip, /* FtEnd */ /*::[*/0x04/*::]*/: parse_FtSkip, /* FtMacro */ /*::[*/0x05/*::]*/: parse_FtSkip, /* FtButton */ /*::[*/0x06/*::]*/: parse_FtSkip, /* FtGmo */ /*::[*/0x07/*::]*/: parse_FtCf, /* FtCf */ /*::[*/0x08/*::]*/: parse_FtSkip, /* FtPioGrbit */ /*::[*/0x09/*::]*/: parse_FtSkip, /* FtPictFmla */ /*::[*/0x0A/*::]*/: parse_FtSkip, /* FtCbls */ /*::[*/0x0B/*::]*/: parse_FtSkip, /* FtRbo */ /*::[*/0x0C/*::]*/: parse_FtSkip, /* FtSbs */ /*::[*/0x0D/*::]*/: parse_FtNts, /* FtNts */ /*::[*/0x0E/*::]*/: parse_FtSkip, /* FtSbsFmla */ /*::[*/0x0F/*::]*/: parse_FtSkip, /* FtGboData */ /*::[*/0x10/*::]*/: parse_FtSkip, /* FtEdoData */ /*::[*/0x11/*::]*/: parse_FtSkip, /* FtRboData */ /*::[*/0x12/*::]*/: parse_FtSkip, /* FtCblsData */ /*::[*/0x13/*::]*/: parse_FtSkip, /* FtLbsData */ /*::[*/0x14/*::]*/: parse_FtSkip, /* FtCblsFmla */ /*::[*/0x15/*::]*/: parse_FtCmo }; function parse_FtArray(blob, length/*::, ot*/) { var tgt = blob.l + length; var fts = []; while(blob.l < tgt) { var ft = blob.read_shift(2); blob.l-=2; try { fts.push(FtTab[ft](blob, tgt - blob.l)); } catch(e) { blob.l = tgt; return fts; } } if(blob.l != tgt) blob.l = tgt; //throw new Error("bad Object Ft-sequence"); return fts; } /* --- 2.4 Records --- */ /* [MS-XLS] 2.4.21 */ function parse_BOF(blob, length) { var o = {BIFFVer:0, dt:0}; o.BIFFVer = blob.read_shift(2); length -= 2; if(length >= 2) { o.dt = blob.read_shift(2); blob.l -= 2; } switch(o.BIFFVer) { case 0x0600: /* BIFF8 */ case 0x0500: /* BIFF5 */ case 0x0400: /* BIFF4 */ case 0x0300: /* BIFF3 */ case 0x0200: /* BIFF2 */ case 0x0002: case 0x0007: /* BIFF2 */ break; default: if(length > 6) throw new Error("Unexpected BIFF Ver " + o.BIFFVer); } blob.read_shift(length); return o; } function write_BOF(wb/*:Workbook*/, t/*:number*/, o) { var h = 0x0600, w = 16; switch(o.bookType) { case 'biff8': break; case 'biff5': h = 0x0500; w = 8; break; case 'biff4': h = 0x0004; w = 6; break; case 'biff3': h = 0x0003; w = 6; break; case 'biff2': h = 0x0002; w = 4; break; case 'xla': break; default: throw new Error("unsupported BIFF version"); } var out = new_buf(w); out.write_shift(2, h); out.write_shift(2, t); if(w > 4) out.write_shift(2, 0x7262); if(w > 6) out.write_shift(2, 0x07CD); if(w > 8) { out.write_shift(2, 0xC009); out.write_shift(2, 0x0001); out.write_shift(2, 0x0706); out.write_shift(2, 0x0000); } return out; } /* [MS-XLS] 2.4.146 */ function parse_InterfaceHdr(blob, length) { if(length === 0) return 0x04b0; if((blob.read_shift(2))!==0x04b0){/* empty */} return 0x04b0; } /* [MS-XLS] 2.4.349 */ function parse_WriteAccess(blob, length, opts) { if(opts.enc) { blob.l += length; return ""; } var l = blob.l; // TODO: make sure XLUnicodeString doesnt overrun var UserName = parse_XLUnicodeString2(blob, 0, opts); blob.read_shift(length + l - blob.l); return UserName; } function write_WriteAccess(s/*:string*/, opts) { var b8 = !opts || opts.biff == 8; var o = new_buf(b8 ? 112 : 54); o.write_shift(opts.biff == 8 ? 2 : 1, 7); if(b8) o.write_shift(1, 0); o.write_shift(4, 0x33336853); o.write_shift(4, (0x00534A74 | (b8 ? 0 : 0x20000000))); while(o.l < o.length) o.write_shift(1, (b8 ? 0 : 32)); return o; } /* [MS-XLS] 2.4.351 */ function parse_WsBool(blob, length, opts) { var flags = opts && opts.biff == 8 || length == 2 ? blob.read_shift(2) : (blob.l += length, 0); return { fDialog: flags & 0x10, fBelow: flags & 0x40, fRight: flags & 0x80 }; } /* [MS-XLS] 2.4.28 */ function parse_BoundSheet8(blob, length, opts) { var pos = blob.read_shift(4); var hidden = blob.read_shift(1) & 0x03; var dt = blob.read_shift(1); switch(dt) { case 0: dt = 'Worksheet'; break; case 1: dt = 'Macrosheet'; break; case 2: dt = 'Chartsheet'; break; case 6: dt = 'VBAModule'; break; } var name = parse_ShortXLUnicodeString(blob, 0, opts); if(name.length === 0) name = "Sheet1"; return { pos:pos, hs:hidden, dt:dt, name:name }; } function write_BoundSheet8(data, opts) { var w = (!opts || opts.biff >= 8 ? 2 : 1); var o = new_buf(8 + w * data.name.length); o.write_shift(4, data.pos); o.write_shift(1, data.hs || 0); o.write_shift(1, data.dt); o.write_shift(1, data.name.length); if(opts.biff >= 8) o.write_shift(1, 1); o.write_shift(w * data.name.length, data.name, opts.biff < 8 ? 'sbcs' : 'utf16le'); var out = o.slice(0, o.l); out.l = o.l; return out; } /* [MS-XLS] 2.4.265 TODO */ function parse_SST(blob, length)/*:SST*/ { var end = blob.l + length; var cnt = blob.read_shift(4); var ucnt = blob.read_shift(4); var strs/*:SST*/ = ([]/*:any*/); for(var i = 0; i != ucnt && blob.l < end; ++i) { strs.push(parse_XLUnicodeRichExtendedString(blob)); } strs.Count = cnt; strs.Unique = ucnt; return strs; } function write_SST(sst, opts) { var header = new_buf(8); header.write_shift(4, sst.Count); header.write_shift(4, sst.Unique); var strs = []; for(var j = 0; j < sst.length; ++j) strs[j] = write_XLUnicodeRichExtendedString(sst[j], opts); var o = bconcat([header].concat(strs)); /*::(*/o/*:: :any)*/.parts = [header.length].concat(strs.map(function(str) { return str.length; })); return o; } /* [MS-XLS] 2.4.107 */ function parse_ExtSST(blob, length) { var extsst = {}; extsst.dsst = blob.read_shift(2); blob.l += length-2; return extsst; } /* [MS-XLS] 2.4.221 TODO: check BIFF2-4 */ function parse_Row(blob) { var z = ({}/*:any*/); z.r = blob.read_shift(2); z.c = blob.read_shift(2); z.cnt = blob.read_shift(2) - z.c; var miyRw = blob.read_shift(2); blob.l += 4; // reserved(2), unused(2) var flags = blob.read_shift(1); // various flags blob.l += 3; // reserved(8), ixfe(12), flags(4) if(flags & 0x07) z.level = flags & 0x07; // collapsed: flags & 0x10 if(flags & 0x20) z.hidden = true; if(flags & 0x40) z.hpt = miyRw / 20; return z; } /* [MS-XLS] 2.4.125 */ function parse_ForceFullCalculation(blob) { var header = parse_frtHeader(blob); if(header.type != 0x08A3) throw new Error("Invalid Future Record " + header.type); var fullcalc = blob.read_shift(4); return fullcalc !== 0x0; } /* [MS-XLS] 2.4.215 rt */ function parse_RecalcId(blob) { blob.read_shift(2); return blob.read_shift(4); } /* [MS-XLS] 2.4.87 */ function parse_DefaultRowHeight(blob, length, opts) { var f = 0; if(!(opts && opts.biff == 2)) { f = blob.read_shift(2); } var miyRw = blob.read_shift(2); if((opts && opts.biff == 2)) { f = 1 - (miyRw >> 15); miyRw &= 0x7fff; } var fl = {Unsynced:f&1,DyZero:(f&2)>>1,ExAsc:(f&4)>>2,ExDsc:(f&8)>>3}; return [fl, miyRw]; } /* [MS-XLS] 2.4.345 TODO */ function parse_Window1(blob) { var xWn = blob.read_shift(2), yWn = blob.read_shift(2), dxWn = blob.read_shift(2), dyWn = blob.read_shift(2); var flags = blob.read_shift(2), iTabCur = blob.read_shift(2), iTabFirst = blob.read_shift(2); var ctabSel = blob.read_shift(2), wTabRatio = blob.read_shift(2); return { Pos: [xWn, yWn], Dim: [dxWn, dyWn], Flags: flags, CurTab: iTabCur, FirstTab: iTabFirst, Selected: ctabSel, TabRatio: wTabRatio }; } function write_Window1(/*::opts*/) { var o = new_buf(18); o.write_shift(2, 0); o.write_shift(2, 0); o.write_shift(2, 0x7260); o.write_shift(2, 0x44c0); o.write_shift(2, 0x38); o.write_shift(2, 0); o.write_shift(2, 0); o.write_shift(2, 1); o.write_shift(2, 0x01f4); return o; } /* [MS-XLS] 2.4.346 TODO */ function parse_Window2(blob, length, opts) { if(opts && opts.biff >= 2 && opts.biff < 5) return {}; var f = blob.read_shift(2); return { RTL: f & 0x40 }; } function write_Window2(view) { var o = new_buf(18), f = 0x6b6; if(view && view.RTL) f |= 0x40; o.write_shift(2, f); o.write_shift(4, 0); o.write_shift(4, 64); o.write_shift(4, 0); o.write_shift(4, 0); return o; } /* [MS-XLS] 2.4.189 TODO */ function parse_Pane(/*blob, length, opts*/) { } /* [MS-XLS] 2.4.122 TODO */ function parse_Font(blob, length, opts) { var o/*:any*/ = { dyHeight: blob.read_shift(2), fl: blob.read_shift(2) }; switch((opts && opts.biff) || 8) { case 2: break; case 3: case 4: blob.l += 2; break; default: blob.l += 10; break; } o.name = parse_ShortXLUnicodeString(blob, 0, opts); return o; } function write_Font(data, opts) { var name = data.name || "Arial"; var b5 = (opts && (opts.biff == 5)), w = (b5 ? (15 + name.length) : (16 + 2 * name.length)); var o = new_buf(w); o.write_shift(2, (data.sz || 12) * 20); o.write_shift(4, 0); o.write_shift(2, 400); o.write_shift(4, 0); o.write_shift(2, 0); o.write_shift(1, name.length); if(!b5) o.write_shift(1, 1); o.write_shift((b5 ? 1 : 2) * name.length, name, (b5 ? "sbcs" : "utf16le")); return o; } /* [MS-XLS] 2.4.149 */ function parse_LabelSst(blob) { var cell = parse_XLSCell(blob); cell.isst = blob.read_shift(4); return cell; } function write_LabelSst(R/*:number*/, C/*:number*/, v/*:number*/, os/*:number*/ /*::, opts*/) { var o = new_buf(10); write_XLSCell(R, C, os, o); o.write_shift(4, v); return o; } /* [MS-XLS] 2.4.148 */ function parse_Label(blob, length, opts) { if(opts.biffguess && opts.biff == 2) opts.biff = 5; var target = blob.l + length; var cell = parse_XLSCell(blob, 6); if(opts.biff == 2) blob.l++; var str = parse_XLUnicodeString(blob, target - blob.l, opts); cell.val = str; return cell; } function write_Label(R/*:number*/, C/*:number*/, v/*:string*/, os/*:number*/, opts) { var b8 = !opts || opts.biff == 8; var o = new_buf(6 + 2 + (+b8) + (1 + b8) * v.length); write_XLSCell(R, C, os, o); o.write_shift(2, v.length); if(b8) o.write_shift(1, 1); o.write_shift((1 + b8) * v.length, v, b8 ? 'utf16le' : 'sbcs'); return o; } /* [MS-XLS] 2.4.126 Number Formats */ function parse_Format(blob, length, opts) { var numFmtId = blob.read_shift(2); var fmtstr = parse_XLUnicodeString2(blob, 0, opts); return [numFmtId, fmtstr]; } function write_Format(i/*:number*/, f/*:string*/, opts, o) { var b5 = (opts && (opts.biff == 5)); if(!o) o = new_buf(b5 ? (3 + f.length) : (5 + 2 * f.length)); o.write_shift(2, i); o.write_shift((b5 ? 1 : 2), f.length); if(!b5) o.write_shift(1, 1); o.write_shift((b5 ? 1 : 2) * f.length, f, (b5 ? 'sbcs' : 'utf16le')); var out = (o.length > o.l) ? o.slice(0, o.l) : o; if(out.l == null) out.l = out.length; return out; } var parse_BIFF2Format = parse_XLUnicodeString2; /* [MS-XLS] 2.4.90 */ function parse_Dimensions(blob, length, opts) { var end = blob.l + length; var w = opts.biff == 8 || !opts.biff ? 4 : 2; var r = blob.read_shift(w), R = blob.read_shift(w); var c = blob.read_shift(2), C = blob.read_shift(2); blob.l = end; return {s: {r:r, c:c}, e: {r:R, c:C}}; } function write_Dimensions(range, opts) { var w = opts.biff == 8 || !opts.biff ? 4 : 2; var o = new_buf(2*w + 6); o.write_shift(w, range.s.r); o.write_shift(w, range.e.r + 1); o.write_shift(2, range.s.c); o.write_shift(2, range.e.c + 1); o.write_shift(2, 0); return o; } /* [MS-XLS] 2.4.220 */ function parse_RK(blob) { var rw = blob.read_shift(2), col = blob.read_shift(2); var rkrec = parse_RkRec(blob); return {r:rw, c:col, ixfe:rkrec[0], rknum:rkrec[1]}; } /* [MS-XLS] 2.4.175 */ function parse_MulRk(blob, length) { var target = blob.l + length - 2; var rw = blob.read_shift(2), col = blob.read_shift(2); var rkrecs = []; while(blob.l < target) rkrecs.push(parse_RkRec(blob)); if(blob.l !== target) throw new Error("MulRK read error"); var lastcol = blob.read_shift(2); if(rkrecs.length != lastcol - col + 1) throw new Error("MulRK length mismatch"); return {r:rw, c:col, C:lastcol, rkrec:rkrecs}; } /* [MS-XLS] 2.4.174 */ function parse_MulBlank(blob, length) { var target = blob.l + length - 2; var rw = blob.read_shift(2), col = blob.read_shift(2); var ixfes = []; while(blob.l < target) ixfes.push(blob.read_shift(2)); if(blob.l !== target) throw new Error("MulBlank read error"); var lastcol = blob.read_shift(2); if(ixfes.length != lastcol - col + 1) throw new Error("MulBlank length mismatch"); return {r:rw, c:col, C:lastcol, ixfe:ixfes}; } /* [MS-XLS] 2.5.20 2.5.249 TODO: interpret values here */ function parse_CellStyleXF(blob, length, style, opts) { var o = {}; var a = blob.read_shift(4), b = blob.read_shift(4); var c = blob.read_shift(4), d = blob.read_shift(2); o.patternType = XLSFillPattern[c >> 26]; if(!opts.cellStyles) return o; o.alc = a & 0x07; o.fWrap = (a >> 3) & 0x01; o.alcV = (a >> 4) & 0x07; o.fJustLast = (a >> 7) & 0x01; o.trot = (a >> 8) & 0xFF; o.cIndent = (a >> 16) & 0x0F; o.fShrinkToFit = (a >> 20) & 0x01; o.iReadOrder = (a >> 22) & 0x02; o.fAtrNum = (a >> 26) & 0x01; o.fAtrFnt = (a >> 27) & 0x01; o.fAtrAlc = (a >> 28) & 0x01; o.fAtrBdr = (a >> 29) & 0x01; o.fAtrPat = (a >> 30) & 0x01; o.fAtrProt = (a >> 31) & 0x01; o.dgLeft = b & 0x0F; o.dgRight = (b >> 4) & 0x0F; o.dgTop = (b >> 8) & 0x0F; o.dgBottom = (b >> 12) & 0x0F; o.icvLeft = (b >> 16) & 0x7F; o.icvRight = (b >> 23) & 0x7F; o.grbitDiag = (b >> 30) & 0x03; o.icvTop = c & 0x7F; o.icvBottom = (c >> 7) & 0x7F; o.icvDiag = (c >> 14) & 0x7F; o.dgDiag = (c >> 21) & 0x0F; o.icvFore = d & 0x7F; o.icvBack = (d >> 7) & 0x7F; o.fsxButton = (d >> 14) & 0x01; return o; } //function parse_CellXF(blob, length, opts) {return parse_CellStyleXF(blob,length,0, opts);} //function parse_StyleXF(blob, length, opts) {return parse_CellStyleXF(blob,length,1, opts);} /* [MS-XLS] 2.4.353 TODO: actually do this right */ function parse_XF(blob, length, opts) { var o = {}; o.ifnt = blob.read_shift(2); o.numFmtId = blob.read_shift(2); o.flags = blob.read_shift(2); o.fStyle = (o.flags >> 2) & 0x01; length -= 6; o.data = parse_CellStyleXF(blob, length, o.fStyle, opts); return o; } function write_XF(data, ixfeP, opts, o) { var b5 = (opts && (opts.biff == 5)); if(!o) o = new_buf(b5 ? 16 : 20); o.write_shift(2, 0); if(data.style) { o.write_shift(2, (data.numFmtId||0)); o.write_shift(2, 0xFFF4); } else { o.write_shift(2, (data.numFmtId||0)); o.write_shift(2, (ixfeP<<4)); } var f = 0; if(data.numFmtId > 0 && b5) f |= 0x0400; o.write_shift(4, f); o.write_shift(4, 0); if(!b5) o.write_shift(4, 0); o.write_shift(2, 0); return o; } /* [MS-XLS] 2.4.134 */ function parse_Guts(blob) { blob.l += 4; var out = [blob.read_shift(2), blob.read_shift(2)]; if(out[0] !== 0) out[0]--; if(out[1] !== 0) out[1]--; if(out[0] > 7 || out[1] > 7) throw new Error("Bad Gutters: " + out.join("|")); return out; } function write_Guts(guts/*:Array<number>*/) { var o = new_buf(8); o.write_shift(4, 0); o.write_shift(2, guts[0] ? guts[0] + 1 : 0); o.write_shift(2, guts[1] ? guts[1] + 1 : 0); return o; } /* [MS-XLS] 2.4.24 */ function parse_BoolErr(blob, length, opts) { var cell = parse_XLSCell(blob, 6); if(opts.biff == 2 || length == 9) ++blob.l; var val = parse_Bes(blob, 2); cell.val = val; cell.t = (val === true || val === false) ? 'b' : 'e'; return cell; } function write_BoolErr(R/*:number*/, C/*:number*/, v, os/*:number*/, opts, t/*:string*/) { var o = new_buf(8); write_XLSCell(R, C, os, o); write_Bes(v, t, o); return o; } /* [MS-XLS] 2.4.180 Number */ function parse_Number(blob, length, opts) { if(opts.biffguess && opts.biff == 2) opts.biff = 5; var cell = parse_XLSCell(blob, 6); var xnum = parse_Xnum(blob, 8); cell.val = xnum; return cell; } function write_Number(R/*:number*/, C/*:number*/, v, os/*:: :number, opts*/) { var o = new_buf(14); write_XLSCell(R, C, os, o); write_Xnum(v, o); return o; } var parse_XLHeaderFooter = parse_OptXLUnicodeString; // TODO: parse 2.4.136 /* [MS-XLS] 2.4.271 */ function parse_SupBook(blob, length, opts) { var end = blob.l + length; var ctab = blob.read_shift(2); var cch = blob.read_shift(2); opts.sbcch = cch; if(cch == 0x0401 || cch == 0x3A01) return [cch, ctab]; if(cch < 0x01 || cch >0xff) throw new Error("Unexpected SupBook type: "+cch); var virtPath = parse_XLUnicodeStringNoCch(blob, cch); /* TODO: 2.5.277 Virtual Path */ var rgst = []; while(end > blob.l) rgst.push(parse_XLUnicodeString(blob)); return [cch, ctab, virtPath, rgst]; } /* [MS-XLS] 2.4.105 TODO */ function parse_ExternName(blob, length, opts) { var flags = blob.read_shift(2); var body; var o = ({ fBuiltIn: flags & 0x01, fWantAdvise: (flags >>> 1) & 0x01, fWantPict: (flags >>> 2) & 0x01, fOle: (flags >>> 3) & 0x01, fOleLink: (flags >>> 4) & 0x01, cf: (flags >>> 5) & 0x3FF, fIcon: flags >>> 15 & 0x01 }/*:any*/); if(opts.sbcch === 0x3A01) body = parse_AddinUdf(blob, length-2, opts); //else throw new Error("unsupported SupBook cch: " + opts.sbcch); o.body = body || blob.read_shift(length-2); if(typeof body === "string") o.Name = body; return o; } /* [MS-XLS] 2.4.150 TODO */ var XLSLblBuiltIn = [ "_xlnm.Consolidate_Area", "_xlnm.Auto_Open", "_xlnm.Auto_Close", "_xlnm.Extract", "_xlnm.Database", "_xlnm.Criteria", "_xlnm.Print_Area", "_xlnm.Print_Titles", "_xlnm.Recorder", "_xlnm.Data_Form", "_xlnm.Auto_Activate", "_xlnm.Auto_Deactivate", "_xlnm.Sheet_Title", "_xlnm._FilterDatabase" ]; function parse_Lbl(blob, length, opts) { var target = blob.l + length; var flags = blob.read_shift(2); var chKey = blob.read_shift(1); var cch = blob.read_shift(1); var cce = blob.read_shift(opts && opts.biff == 2 ? 1 : 2); var itab = 0; if(!opts || opts.biff >= 5) { if(opts.biff != 5) blob.l += 2; itab = blob.read_shift(2); if(opts.biff == 5) blob.l += 2; blob.l += 4; } var name = parse_XLUnicodeStringNoCch(blob, cch, opts); if(flags & 0x20) name = XLSLblBuiltIn[name.charCodeAt(0)]; var npflen = target - blob.l; if(opts && opts.biff == 2) --npflen; /*jshint -W018 */ var rgce = (target == blob.l || cce === 0 || !(npflen > 0)) ? [] : parse_NameParsedFormula(blob, npflen, opts, cce); /*jshint +W018 */ return { chKey: chKey, Name: name, itab: itab, rgce: rgce }; } /* [MS-XLS] 2.4.106 TODO: verify filename encoding */ function parse_ExternSheet(blob, length, opts) { if(opts.biff < 8) return parse_BIFF5ExternSheet(blob, length, opts); var o = [], target = blob.l + length, len = blob.read_shift(opts.biff > 8 ? 4 : 2); while(len-- !== 0) o.push(parse_XTI(blob, opts.biff > 8 ? 12 : 6, opts)); // [iSupBook, itabFirst, itabLast]; if(blob.l != target) throw new Error("Bad ExternSheet: " + blob.l + " != " + target); return o; } function parse_BIFF5ExternSheet(blob, length, opts) { if(blob[blob.l + 1] == 0x03) blob[blob.l]++; var o = parse_ShortXLUnicodeString(blob, length, opts); return o.charCodeAt(0) == 0x03 ? o.slice(1) : o; } /* [MS-XLS] 2.4.176 TODO: check older biff */ function parse_NameCmt(blob, length, opts) { if(opts.biff < 8) { blob.l += length; return; } var cchName = blob.read_shift(2); var cchComment = blob.read_shift(2); var name = parse_XLUnicodeStringNoCch(blob, cchName, opts); var comment = parse_XLUnicodeStringNoCch(blob, cchComment, opts); return [name, comment]; } /* [MS-XLS] 2.4.260 */ function parse_ShrFmla(blob, length, opts) { var ref = parse_RefU(blob, 6); blob.l++; var cUse = blob.read_shift(1); length -= 8; return [parse_SharedParsedFormula(blob, length, opts), cUse, ref]; } /* [MS-XLS] 2.4.4 TODO */ function parse_Array(blob, length, opts) { var ref = parse_Ref(blob, 6); /* TODO: fAlwaysCalc */ switch(opts.biff) { case 2: blob.l ++; length -= 7; break; case 3: case 4: blob.l += 2; length -= 8; break; default: blob.l += 6; length -= 12; } return [ref, parse_ArrayParsedFormula(blob, length, opts, ref)]; } /* [MS-XLS] 2.4.173 */ function parse_MTRSettings(blob) { var fMTREnabled = blob.read_shift(4) !== 0x00; var fUserSetThreadCount = blob.read_shift(4) !== 0x00; var cUserThreadCount = blob.read_shift(4); return [fMTREnabled, fUserSetThreadCount, cUserThreadCount]; } /* [MS-XLS] 2.5.186 TODO: BIFF5 */ function parse_NoteSh(blob, length, opts) { if(opts.biff < 8) return; var row = blob.read_shift(2), col = blob.read_shift(2); var flags = blob.read_shift(2), idObj = blob.read_shift(2); var stAuthor = parse_XLUnicodeString2(blob, 0, opts); if(opts.biff < 8) blob.read_shift(1); return [{r:row,c:col}, stAuthor, idObj, flags]; } /* [MS-XLS] 2.4.179 */ function parse_Note(blob, length, opts) { /* TODO: Support revisions */ return parse_NoteSh(blob, length, opts); } /* [MS-XLS] 2.4.168 */ function parse_MergeCells(blob, length)/*:Array<Range>*/ { var merges/*:Array<Range>*/ = []; var cmcs = blob.read_shift(2); while (cmcs--) merges.push(parse_Ref8U(blob,length)); return merges; } function write_MergeCells(merges/*:Array<Range>*/) { var o = new_buf(2 + merges.length * 8); o.write_shift(2, merges.length); for(var i = 0; i < merges.length; ++i) write_Ref8U(merges[i], o); return o; } /* [MS-XLS] 2.4.181 TODO: parse all the things! */ function parse_Obj(blob, length, opts) { if(opts && opts.biff < 8) return parse_BIFF5Obj(blob, length, opts); var cmo = parse_FtCmo(blob, 22); // id, ot, flags var fts = parse_FtArray(blob, length-22, cmo[1]); return { cmo: cmo, ft:fts }; } /* from older spec */ var parse_BIFF5OT = { 0x08: function(blob, length) { var tgt = blob.l + length; blob.l += 10; // todo var cf = blob.read_shift(2); blob.l += 4; blob.l += 2; //var cbPictFmla = blob.read_shift(2); blob.l += 2; blob.l += 2; //var grbit = blob.read_shift(2); blob.l += 4; var cchName = blob.read_shift(1); blob.l += cchName; // TODO: stName blob.l = tgt; // TODO: fmla return { fmt:cf }; } }; function parse_BIFF5Obj(blob, length, opts) { blob.l += 4; //var cnt = blob.read_shift(4); var ot = blob.read_shift(2); var id = blob.read_shift(2); var grbit = blob.read_shift(2); blob.l += 2; //var colL = blob.read_shift(2); blob.l += 2; //var dxL = blob.read_shift(2); blob.l += 2; //var rwT = blob.read_shift(2); blob.l += 2; //var dyT = blob.read_shift(2); blob.l += 2; //var colR = blob.read_shift(2); blob.l += 2; //var dxR = blob.read_shift(2); blob.l += 2; //var rwB = blob.read_shift(2); blob.l += 2; //var dyB = blob.read_shift(2); blob.l += 2; //var cbMacro = blob.read_shift(2); blob.l += 6; length -= 36; var fts = []; fts.push((parse_BIFF5OT[ot]||parsenoop)(blob, length, opts)); return { cmo: [id, ot, grbit], ft:fts }; } /* [MS-XLS] 2.4.329 TODO: parse properly */ function parse_TxO(blob, length, opts) { var s = blob.l; var texts = ""; try { blob.l += 4; var ot = (opts.lastobj||{cmo:[0,0]}).cmo[1]; var controlInfo; // eslint-disable-line no-unused-vars if([0,5,7,11,12,14].indexOf(ot) == -1) blob.l += 6; else controlInfo = parse_ControlInfo(blob, 6, opts); // eslint-disable-line no-unused-vars var cchText = blob.read_shift(2); /*var cbRuns = */blob.read_shift(2); /*var ifntEmpty = */parseuint16(blob, 2); var len = blob.read_shift(2); blob.l += len; //var fmla = parse_ObjFmla(blob, s + length - blob.l); for(var i = 1; i < blob.lens.length-1; ++i) { if(blob.l-s != blob.lens[i]) throw new Error("TxO: bad continue record"); var hdr = blob[blob.l]; var t = parse_XLUnicodeStringNoCch(blob, blob.lens[i+1]-blob.lens[i]-1); texts += t; if(texts.length >= (hdr ? cchText : 2*cchText)) break; } if(texts.length !== cchText && texts.length !== cchText*2) { throw new Error("cchText: " + cchText + " != " + texts.length); } blob.l = s + length; /* [MS-XLS] 2.5.272 TxORuns */ // var rgTxoRuns = []; // for(var j = 0; j != cbRuns/8-1; ++j) blob.l += 8; // var cchText2 = blob.read_shift(2); // if(cchText2 !== cchText) throw new Error("TxOLastRun mismatch: " + cchText2 + " " + cchText); // blob.l += 6; // if(s + length != blob.l) throw new Error("TxO " + (s + length) + ", at " + blob.l); return { t: texts }; } catch(e) { blob.l = s + length; return { t: texts }; } } /* [MS-XLS] 2.4.140 */ function parse_HLink(blob, length) { var ref = parse_Ref8U(blob, 8); blob.l += 16; /* CLSID */ var hlink = parse_Hyperlink(blob, length-24); return [ref, hlink]; } function write_HLink(hl) { var O = new_buf(24); var ref = decode_cell(hl[0]); O.write_shift(2, ref.r); O.write_shift(2, ref.r); O.write_shift(2, ref.c); O.write_shift(2, ref.c); var clsid = "d0 c9 ea 79 f9 ba ce 11 8c 82 00 aa 00 4b a9 0b".split(" "); for(var i = 0; i < 16; ++i) O.write_shift(1, parseInt(clsid[i], 16)); return bconcat([O, write_Hyperlink(hl[1])]); } /* [MS-XLS] 2.4.141 */ function parse_HLinkTooltip(blob, length) { blob.read_shift(2); var ref = parse_Ref8U(blob, 8); var wzTooltip = blob.read_shift((length-10)/2, 'dbcs-cont'); wzTooltip = wzTooltip.replace(chr0,""); return [ref, wzTooltip]; } function write_HLinkTooltip(hl) { var TT = hl[1].Tooltip; var O = new_buf(10 + 2 * (TT.length + 1)); O.write_shift(2, 0x0800); var ref = decode_cell(hl[0]); O.write_shift(2, ref.r); O.write_shift(2, ref.r); O.write_shift(2, ref.c); O.write_shift(2, ref.c); for(var i = 0; i < TT.length; ++i) O.write_shift(2, TT.charCodeAt(i)); O.write_shift(2, 0); return O; } /* [MS-XLS] 2.4.63 */ function parse_Country(blob)/*:[string|number, string|number]*/ { var o = [0,0], d; d = blob.read_shift(2); o[0] = CountryEnum[d] || d; d = blob.read_shift(2); o[1] = CountryEnum[d] || d; return o; } function write_Country(o) { if(!o) o = new_buf(4); o.write_shift(2, 0x01); o.write_shift(2, 0x01); return o; } /* [MS-XLS] 2.4.50 ClrtClient */ function parse_ClrtClient(blob) { var ccv = blob.read_shift(2); var o = []; while(ccv-->0) o.push(parse_LongRGB(blob, 8)); return o; } /* [MS-XLS] 2.4.188 */ function parse_Palette(blob) { var ccv = blob.read_shift(2); var o = []; while(ccv-->0) o.push(parse_LongRGB(blob, 8)); return o; } /* [MS-XLS] 2.4.354 */ function parse_XFCRC(blob) { blob.l += 2; var o = {cxfs:0, crc:0}; o.cxfs = blob.read_shift(2); o.crc = blob.read_shift(4); return o; } /* [MS-XLS] 2.4.53 TODO: parse flags */ /* [MS-XLSB] 2.4.323 TODO: parse flags */ function parse_ColInfo(blob, length, opts) { if(!opts.cellStyles) return parsenoop(blob, length); var w = opts && opts.biff >= 12 ? 4 : 2; var colFirst = blob.read_shift(w); var colLast = blob.read_shift(w); var coldx = blob.read_shift(w); var ixfe = blob.read_shift(w); var flags = blob.read_shift(2); if(w == 2) blob.l += 2; var o = ({s:colFirst, e:colLast, w:coldx, ixfe:ixfe, flags:flags}/*:any*/); if(opts.biff >= 5 || !opts.biff) o.level = (flags >> 8) & 0x7; return o; } function write_ColInfo(col, idx) { var o = new_buf(12); o.write_shift(2, idx); o.write_shift(2, idx); o.write_shift(2, col.width * 256); o.write_shift(2, 0); var f = 0; if(col.hidden) f |= 1; o.write_shift(1, f); f = col.level || 0; o.write_shift(1, f); o.write_shift(2, 0); return o; } /* [MS-XLS] 2.4.257 */ function parse_Setup(blob, length) { var o = {}; if(length < 32) return o; blob.l += 16; o.header = parse_Xnum(blob, 8); o.footer = parse_Xnum(blob, 8); blob.l += 2; return o; } /* [MS-XLS] 2.4.261 */ function parse_ShtProps(blob, length, opts) { var def = {area:false}; if(opts.biff != 5) { blob.l += length; return def; } var d = blob.read_shift(1); blob.l += 3; if((d & 0x10)) def.area = true; return def; } /* [MS-XLS] 2.4.241 */ function write_RRTabId(n/*:number*/) { var out = new_buf(2 * n); for(var i = 0; i < n; ++i) out.write_shift(2, i+1); return out; } var parse_Blank = parse_XLSCell; /* [MS-XLS] 2.4.20 Just the cell */ var parse_Scl = parseuint16a; /* [MS-XLS] 2.4.247 num, den */ var parse_String = parse_XLUnicodeString; /* [MS-XLS] 2.4.268 */ /* --- Specific to versions before BIFF8 --- */ function parse_ImData(blob) { var cf = blob.read_shift(2); var env = blob.read_shift(2); var lcb = blob.read_shift(4); var o = {fmt:cf, env:env, len:lcb, data:blob.slice(blob.l,blob.l+lcb)}; blob.l += lcb; return o; } /* BIFF2_??? where ??? is the name from [XLS] */ function parse_BIFF2STR(blob, length, opts) { if(opts.biffguess && opts.biff == 5) opts.biff = 2; var cell = parse_XLSCell(blob, 6); ++blob.l; var str = parse_XLUnicodeString2(blob, length-7, opts); cell.t = 'str'; cell.val = str; return cell; } function parse_BIFF2NUM(blob/*::, length*/) { var cell = parse_XLSCell(blob, 6); ++blob.l; var num = parse_Xnum(blob, 8); cell.t = 'n'; cell.val = num; return cell; } function write_BIFF2NUM(r/*:number*/, c/*:number*/, val/*:number*/) { var out = new_buf(15); write_BIFF2Cell(out, r, c); out.write_shift(8, val, 'f'); return out; } function parse_BIFF2INT(blob) { var cell = parse_XLSCell(blob, 6); ++blob.l; var num = blob.read_shift(2); cell.t = 'n'; cell.val = num; return cell; } function write_BIFF2INT(r/*:number*/, c/*:number*/, val/*:number*/) { var out = new_buf(9); write_BIFF2Cell(out, r, c); out.write_shift(2, val); return out; } function parse_BIFF2STRING(blob) { var cch = blob.read_shift(1); if(cch === 0) { blob.l++; return ""; } return blob.read_shift(cch, 'sbcs-cont'); } /* TODO: convert to BIFF8 font struct */ function parse_BIFF2FONTXTRA(blob, length) { blob.l += 6; // unknown blob.l += 2; // font weight "bls" blob.l += 1; // charset blob.l += 3; // unknown blob.l += 1; // font family blob.l += length - 13; } /* TODO: parse rich text runs */ function parse_RString(blob, length, opts) { var end = blob.l + length; var cell = parse_XLSCell(blob, 6); var cch = blob.read_shift(2); var str = parse_XLUnicodeStringNoCch(blob, cch, opts); blob.l = end; cell.t = 'str'; cell.val = str; return cell; } /* from js-harb (C) 2014-present SheetJS */ var DBF_SUPPORTED_VERSIONS = [0x02, 0x03, 0x30, 0x31, 0x83, 0x8B, 0x8C, 0xF5]; var DBF = /*#__PURE__*/(function() { var dbf_codepage_map = { /* Code Pages Supported by Visual FoxPro */ /*::[*/0x01/*::]*/: 437, /*::[*/0x02/*::]*/: 850, /*::[*/0x03/*::]*/: 1252, /*::[*/0x04/*::]*/: 10000, /*::[*/0x64/*::]*/: 852, /*::[*/0x65/*::]*/: 866, /*::[*/0x66/*::]*/: 865, /*::[*/0x67/*::]*/: 861, /*::[*/0x68/*::]*/: 895, /*::[*/0x69/*::]*/: 620, /*::[*/0x6A/*::]*/: 737, /*::[*/0x6B/*::]*/: 857, /*::[*/0x78/*::]*/: 950, /*::[*/0x79/*::]*/: 949, /*::[*/0x7A/*::]*/: 936, /*::[*/0x7B/*::]*/: 932, /*::[*/0x7C/*::]*/: 874, /*::[*/0x7D/*::]*/: 1255, /*::[*/0x7E/*::]*/: 1256, /*::[*/0x96/*::]*/: 10007, /*::[*/0x97/*::]*/: 10029, /*::[*/0x98/*::]*/: 10006, /*::[*/0xC8/*::]*/: 1250, /*::[*/0xC9/*::]*/: 1251, /*::[*/0xCA/*::]*/: 1254, /*::[*/0xCB/*::]*/: 1253, /* shapefile DBF extension */ /*::[*/0x00/*::]*/: 20127, /*::[*/0x08/*::]*/: 865, /*::[*/0x09/*::]*/: 437, /*::[*/0x0A/*::]*/: 850, /*::[*/0x0B/*::]*/: 437, /*::[*/0x0D/*::]*/: 437, /*::[*/0x0E/*::]*/: 850, /*::[*/0x0F/*::]*/: 437, /*::[*/0x10/*::]*/: 850, /*::[*/0x11/*::]*/: 437, /*::[*/0x12/*::]*/: 850, /*::[*/0x13/*::]*/: 932, /*::[*/0x14/*::]*/: 850, /*::[*/0x15/*::]*/: 437, /*::[*/0x16/*::]*/: 850, /*::[*/0x17/*::]*/: 865, /*::[*/0x18/*::]*/: 437, /*::[*/0x19/*::]*/: 437, /*::[*/0x1A/*::]*/: 850, /*::[*/0x1B/*::]*/: 437, /*::[*/0x1C/*::]*/: 863, /*::[*/0x1D/*::]*/: 850, /*::[*/0x1F/*::]*/: 852, /*::[*/0x22/*::]*/: 852, /*::[*/0x23/*::]*/: 852, /*::[*/0x24/*::]*/: 860, /*::[*/0x25/*::]*/: 850, /*::[*/0x26/*::]*/: 866, /*::[*/0x37/*::]*/: 850, /*::[*/0x40/*::]*/: 852, /*::[*/0x4D/*::]*/: 936, /*::[*/0x4E/*::]*/: 949, /*::[*/0x4F/*::]*/: 950, /*::[*/0x50/*::]*/: 874, /*::[*/0x57/*::]*/: 1252, /*::[*/0x58/*::]*/: 1252, /*::[*/0x59/*::]*/: 1252, /*::[*/0x6C/*::]*/: 863, /*::[*/0x86/*::]*/: 737, /*::[*/0x87/*::]*/: 852, /*::[*/0x88/*::]*/: 857, /*::[*/0xCC/*::]*/: 1257, /*::[*/0xFF/*::]*/: 16969 }; var dbf_reverse_map = evert({ /*::[*/0x01/*::]*/: 437, /*::[*/0x02/*::]*/: 850, /*::[*/0x03/*::]*/: 1252, /*::[*/0x04/*::]*/: 10000, /*::[*/0x64/*::]*/: 852, /*::[*/0x65/*::]*/: 866, /*::[*/0x66/*::]*/: 865, /*::[*/0x67/*::]*/: 861, /*::[*/0x68/*::]*/: 895, /*::[*/0x69/*::]*/: 620, /*::[*/0x6A/*::]*/: 737, /*::[*/0x6B/*::]*/: 857, /*::[*/0x78/*::]*/: 950, /*::[*/0x79/*::]*/: 949, /*::[*/0x7A/*::]*/: 936, /*::[*/0x7B/*::]*/: 932, /*::[*/0x7C/*::]*/: 874, /*::[*/0x7D/*::]*/: 1255, /*::[*/0x7E/*::]*/: 1256, /*::[*/0x96/*::]*/: 10007, /*::[*/0x97/*::]*/: 10029, /*::[*/0x98/*::]*/: 10006, /*::[*/0xC8/*::]*/: 1250, /*::[*/0xC9/*::]*/: 1251, /*::[*/0xCA/*::]*/: 1254, /*::[*/0xCB/*::]*/: 1253, /*::[*/0x00/*::]*/: 20127 }); /* TODO: find an actual specification */ function dbf_to_aoa(buf, opts)/*:AOA*/ { var out/*:AOA*/ = []; var d/*:Block*/ = (new_raw_buf(1)/*:any*/); switch(opts.type) { case 'base64': d = s2a(Base64_decode(buf)); break; case 'binary': d = s2a(buf); break; case 'buffer': case 'array': d = buf; break; } prep_blob(d, 0); /* header */ var ft = d.read_shift(1); var memo = !!(ft & 0x88); var vfp = false, l7 = false; switch(ft) { case 0x02: break; // dBASE II case 0x03: break; // dBASE III case 0x30: vfp = true; memo = true; break; // VFP case 0x31: vfp = true; memo = true; break; // VFP with autoincrement // 0x43 dBASE IV SQL table files // 0x63 dBASE IV SQL system files case 0x83: break; // dBASE III with memo case 0x8B: break; // dBASE IV with memo case 0x8C: l7 = true; break; // dBASE Level 7 with memo // case 0xCB dBASE IV SQL table files with memo case 0xF5: break; // FoxPro 2.x with memo // case 0xFB FoxBASE default: throw new Error("DBF Unsupported Version: " + ft.toString(16)); } var nrow = 0, fpos = 0x0209; if(ft == 0x02) nrow = d.read_shift(2); d.l += 3; // dBASE II stores DDMMYY date, others use YYMMDD if(ft != 0x02) nrow = d.read_shift(4); if(nrow > 1048576) nrow = 1e6; if(ft != 0x02) fpos = d.read_shift(2); // header length var rlen = d.read_shift(2); // record length var /*flags = 0,*/ current_cp = opts.codepage || 1252; if(ft != 0x02) { // 20 reserved bytes d.l+=16; /*flags = */d.read_shift(1); //if(memo && ((flags & 0x02) === 0)) throw new Error("DBF Flags " + flags.toString(16) + " ft " + ft.toString(16)); /* codepage present in FoxPro and dBASE Level 7 */ if(d[d.l] !== 0) current_cp = dbf_codepage_map[d[d.l]]; d.l+=1; d.l+=2; } if(l7) d.l += 36; // Level 7: 32 byte "Language driver name", 4 byte reserved /*:: type DBFField = { name:string; len:number; type:string; } */ var fields/*:Array<DBFField>*/ = [], field/*:DBFField*/ = ({}/*:any*/); var hend = Math.min(d.length, (ft == 0x02 ? 0x209 : (fpos - 10 - (vfp ? 264 : 0)))); var ww = l7 ? 32 : 11; while(d.l < hend && d[d.l] != 0x0d) { field = ({}/*:any*/); field.name = $cptable.utils.decode(current_cp, d.slice(d.l, d.l+ww)).replace(/[\u0000\r\n].*$/g,""); d.l += ww; field.type = String.fromCharCode(d.read_shift(1)); if(ft != 0x02 && !l7) field.offset = d.read_shift(4); field.len = d.read_shift(1); if(ft == 0x02) field.offset = d.read_shift(2); field.dec = d.read_shift(1); if(field.name.length) fields.push(field); if(ft != 0x02) d.l += l7 ? 13 : 14; switch(field.type) { case 'B': // Double (VFP) / Binary (dBASE L7) if((!vfp || field.len != 8) && opts.WTF) console.log('Skipping ' + field.name + ':' + field.type); break; case 'G': // General (FoxPro and dBASE L7) case 'P': // Picture (FoxPro and dBASE L7) if(opts.WTF) console.log('Skipping ' + field.name + ':' + field.type); break; case '+': // Autoincrement (dBASE L7 only) case '0': // _NullFlags (VFP only) case '@': // Timestamp (dBASE L7 only) case 'C': // Character (dBASE II) case 'D': // Date (dBASE III) case 'F': // Float (dBASE IV) case 'I': // Long (VFP and dBASE L7) case 'L': // Logical (dBASE II) case 'M': // Memo (dBASE III) case 'N': // Number (dBASE II) case 'O': // Double (dBASE L7 only) case 'T': // Datetime (VFP only) case 'Y': // Currency (VFP only) break; default: throw new Error('Unknown Field Type: ' + field.type); } } if(d[d.l] !== 0x0D) d.l = fpos-1; if(d.read_shift(1) !== 0x0D) throw new Error("DBF Terminator not found " + d.l + " " + d[d.l]); d.l = fpos; /* data */ var R = 0, C = 0; out[0] = []; for(C = 0; C != fields.length; ++C) out[0][C] = fields[C].name; while(nrow-- > 0) { if(d[d.l] === 0x2A) { // TODO: record marked as deleted -- create a hidden row? d.l+=rlen; continue; } ++d.l; out[++R] = []; C = 0; for(C = 0; C != fields.length; ++C) { var dd = d.slice(d.l, d.l+fields[C].len); d.l+=fields[C].len; prep_blob(dd, 0); var s = $cptable.utils.decode(current_cp, dd); switch(fields[C].type) { case 'C': // NOTE: it is conventional to write ' / / ' for empty dates if(s.trim().length) out[R][C] = s.replace(/\s+$/,""); break; case 'D': if(s.length === 8) out[R][C] = new Date(+s.slice(0,4), +s.slice(4,6)-1, +s.slice(6,8)); else out[R][C] = s; break; case 'F': out[R][C] = parseFloat(s.trim()); break; case '+': case 'I': out[R][C] = l7 ? dd.read_shift(-4, 'i') ^ 0x80000000 : dd.read_shift(4, 'i'); break; case 'L': switch(s.trim().toUpperCase()) { case 'Y': case 'T': out[R][C] = true; break; case 'N': case 'F': out[R][C] = false; break; case '': case '?': break; default: throw new Error("DBF Unrecognized L:|" + s + "|"); } break; case 'M': /* TODO: handle memo files */ if(!memo) throw new Error("DBF Unexpected MEMO for type " + ft.toString(16)); out[R][C] = "##MEMO##" + (l7 ? parseInt(s.trim(), 10): dd.read_shift(4)); break; case 'N': s = s.replace(/\u0000/g,"").trim(); // NOTE: dBASE II interprets " . " as 0 if(s && s != ".") out[R][C] = +s || 0; break; case '@': // NOTE: dBASE specs appear to be incorrect out[R][C] = new Date(dd.read_shift(-8, 'f') - 0x388317533400); break; case 'T': out[R][C] = new Date((dd.read_shift(4) - 0x253D8C) * 0x5265C00 + dd.read_shift(4)); break; case 'Y': out[R][C] = dd.read_shift(4,'i')/1e4 + (dd.read_shift(4, 'i')/1e4)*Math.pow(2,32); break; case 'O': out[R][C] = -dd.read_shift(-8, 'f'); break; case 'B': if(vfp && fields[C].len == 8) { out[R][C] = dd.read_shift(8,'f'); break; } /* falls through */ case 'G': case 'P': dd.l += fields[C].len; break; case '0': if(fields[C].name === '_NullFlags') break; /* falls through */ default: throw new Error("DBF Unsupported data type " + fields[C].type); } } } if(ft != 0x02) if(d.l < d.length && d[d.l++] != 0x1A) throw new Error("DBF EOF Marker missing " + (d.l-1) + " of " + d.length + " " + d[d.l-1].toString(16)); if(opts && opts.sheetRows) out = out.slice(0, opts.sheetRows); opts.DBF = fields; return out; } function dbf_to_sheet(buf, opts)/*:Worksheet*/ { var o = opts || {}; if(!o.dateNF) o.dateNF = "yyyymmdd"; var ws = aoa_to_sheet(dbf_to_aoa(buf, o), o); ws["!cols"] = o.DBF.map(function(field) { return { wch: field.len, DBF: field };}); delete o.DBF; return ws; } function dbf_to_workbook(buf, opts)/*:Workbook*/ { try { return sheet_to_workbook(dbf_to_sheet(buf, opts), opts); } catch(e) { if(opts && opts.WTF) throw e; } return ({SheetNames:[],Sheets:{}}); } var _RLEN = { 'B': 8, 'C': 250, 'L': 1, 'D': 8, '?': 0, '': 0 }; function sheet_to_dbf(ws/*:Worksheet*/, opts/*:WriteOpts*/) { var o = opts || {}; if(+o.codepage >= 0) set_cp(+o.codepage); if(o.type == "string") throw new Error("Cannot write DBF to JS string"); var ba = buf_array(); var aoa/*:AOA*/ = sheet_to_json(ws, {header:1, raw:true, cellDates:true}); var headers = aoa[0], data = aoa.slice(1), cols = ws["!cols"] || []; var i = 0, j = 0, hcnt = 0, rlen = 1; for(i = 0; i < headers.length; ++i) { if(((cols[i]||{}).DBF||{}).name) { headers[i] = cols[i].DBF.name; ++hcnt; continue; } if(headers[i] == null) continue; ++hcnt; if(typeof headers[i] === 'number') headers[i] = headers[i].toString(10); if(typeof headers[i] !== 'string') throw new Error("DBF Invalid column name " + headers[i] + " |" + (typeof headers[i]) + "|"); if(headers.indexOf(headers[i]) !== i) for(j=0; j<1024;++j) if(headers.indexOf(headers[i] + "_" + j) == -1) { headers[i] += "_" + j; break; } } var range = safe_decode_range(ws['!ref']); var coltypes/*:Array<string>*/ = []; var colwidths/*:Array<number>*/ = []; var coldecimals/*:Array<number>*/ = []; for(i = 0; i <= range.e.c - range.s.c; ++i) { var guess = '', _guess = '', maxlen = 0; var col/*:Array<any>*/ = []; for(j=0; j < data.length; ++j) { if(data[j][i] != null) col.push(data[j][i]); } if(col.length == 0 || headers[i] == null) { coltypes[i] = '?'; continue; } for(j = 0; j < col.length; ++j) { switch(typeof col[j]) { /* TODO: check if L2 compat is desired */ case 'number': _guess = 'B'; break; case 'string': _guess = 'C'; break; case 'boolean': _guess = 'L'; break; case 'object': _guess = col[j] instanceof Date ? 'D' : 'C'; break; default: _guess = 'C'; } maxlen = Math.max(maxlen, String(col[j]).length); guess = guess && guess != _guess ? 'C' : _guess; //if(guess == 'C') break; } if(maxlen > 250) maxlen = 250; _guess = ((cols[i]||{}).DBF||{}).type; /* TODO: more fine grained control over DBF type resolution */ if(_guess == 'C') { if(cols[i].DBF.len > maxlen) maxlen = cols[i].DBF.len; } if(guess == 'B' && _guess == 'N') { guess = 'N'; coldecimals[i] = cols[i].DBF.dec; maxlen = cols[i].DBF.len; } colwidths[i] = guess == 'C' || _guess == 'N' ? maxlen : (_RLEN[guess] || 0); rlen += colwidths[i]; coltypes[i] = guess; } var h = ba.next(32); h.write_shift(4, 0x13021130); h.write_shift(4, data.length); h.write_shift(2, 296 + 32 * hcnt); h.write_shift(2, rlen); for(i=0; i < 4; ++i) h.write_shift(4, 0); h.write_shift(4, 0x00000000 | ((+dbf_reverse_map[/*::String(*/current_ansi/*::)*/] || 0x03)<<8)); for(i = 0, j = 0; i < headers.length; ++i) { if(headers[i] == null) continue; var hf = ba.next(32); var _f = (headers[i].slice(-10) + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00").slice(0, 11); hf.write_shift(1, _f, "sbcs"); hf.write_shift(1, coltypes[i] == '?' ? 'C' : coltypes[i], "sbcs"); hf.write_shift(4, j); hf.write_shift(1, colwidths[i] || _RLEN[coltypes[i]] || 0); hf.write_shift(1, coldecimals[i] || 0); hf.write_shift(1, 0x02); hf.write_shift(4, 0); hf.write_shift(1, 0); hf.write_shift(4, 0); hf.write_shift(4, 0); j += (colwidths[i] || _RLEN[coltypes[i]] || 0); } var hb = ba.next(264); hb.write_shift(4, 0x0000000D); for(i=0; i < 65;++i) hb.write_shift(4, 0x00000000); for(i=0; i < data.length; ++i) { var rout = ba.next(rlen); rout.write_shift(1, 0); for(j=0; j<headers.length; ++j) { if(headers[j] == null) continue; switch(coltypes[j]) { case 'L': rout.write_shift(1, data[i][j] == null ? 0x3F : data[i][j] ? 0x54 : 0x46); break; case 'B': rout.write_shift(8, data[i][j]||0, 'f'); break; case 'N': var _n = "0"; if(typeof data[i][j] == "number") _n = data[i][j].toFixed(coldecimals[j]||0); for(hcnt=0; hcnt < colwidths[j]-_n.length; ++hcnt) rout.write_shift(1, 0x20); rout.write_shift(1, _n, "sbcs"); break; case 'D': if(!data[i][j]) rout.write_shift(8, "00000000", "sbcs"); else { rout.write_shift(4, ("0000"+data[i][j].getFullYear()).slice(-4), "sbcs"); rout.write_shift(2, ("00"+(data[i][j].getMonth()+1)).slice(-2), "sbcs"); rout.write_shift(2, ("00"+data[i][j].getDate()).slice(-2), "sbcs"); } break; case 'C': var _s = String(data[i][j] != null ? data[i][j] : "").slice(0, colwidths[j]); rout.write_shift(1, _s, "sbcs"); for(hcnt=0; hcnt < colwidths[j]-_s.length; ++hcnt) rout.write_shift(1, 0x20); break; } } // data } ba.next(1).write_shift(1, 0x1A); return ba.end(); } return { to_workbook: dbf_to_workbook, to_sheet: dbf_to_sheet, from_sheet: sheet_to_dbf }; })(); var SYLK = /*#__PURE__*/(function() { /* TODO: stress test sequences */ var sylk_escapes = ({ AA:'À', BA:'Á', CA:'Â', DA:195, HA:'Ä', JA:197, AE:'È', BE:'É', CE:'Ê', HE:'Ë', AI:'Ì', BI:'Í', CI:'Î', HI:'Ï', AO:'Ò', BO:'Ó', CO:'Ô', DO:213, HO:'Ö', AU:'Ù', BU:'Ú', CU:'Û', HU:'Ü', Aa:'à', Ba:'á', Ca:'â', Da:227, Ha:'ä', Ja:229, Ae:'è', Be:'é', Ce:'ê', He:'ë', Ai:'ì', Bi:'í', Ci:'î', Hi:'ï', Ao:'ò', Bo:'ó', Co:'ô', Do:245, Ho:'ö', Au:'ù', Bu:'ú', Cu:'û', Hu:'ü', KC:'Ç', Kc:'ç', q:'æ', z:'œ', a:'Æ', j:'Œ', DN:209, Dn:241, Hy:255, S:169, c:170, R:174, "B ":180, /*::[*/0/*::]*/:176, /*::[*/1/*::]*/:177, /*::[*/2/*::]*/:178, /*::[*/3/*::]*/:179, /*::[*/5/*::]*/:181, /*::[*/6/*::]*/:182, /*::[*/7/*::]*/:183, Q:185, k:186, b:208, i:216, l:222, s:240, y:248, "!":161, '"':162, "#":163, "(":164, "%":165, "'":167, "H ":168, "+":171, ";":187, "<":188, "=":189, ">":190, "?":191, "{":223 }/*:any*/); var sylk_char_regex = new RegExp("\u001BN(" + keys(sylk_escapes).join("|").replace(/\|\|\|/, "|\\||").replace(/([?()+])/g,"\\$1") + "|\\|)", "gm"); var sylk_char_fn = function(_, $1){ var o = sylk_escapes[$1]; return typeof o == "number" ? _getansi(o) : o; }; var decode_sylk_char = function($$, $1, $2) { var newcc = (($1.charCodeAt(0) - 0x20)<<4) | ($2.charCodeAt(0) - 0x30); return newcc == 59 ? $$ : _getansi(newcc); }; sylk_escapes["|"] = 254; /* TODO: find an actual specification */ function sylk_to_aoa(d/*:RawData*/, opts)/*:[AOA, Worksheet]*/ { switch(opts.type) { case 'base64': return sylk_to_aoa_str(Base64_decode(d), opts); case 'binary': return sylk_to_aoa_str(d, opts); case 'buffer': return sylk_to_aoa_str(has_buf && Buffer.isBuffer(d) ? d.toString('binary') : a2s(d), opts); case 'array': return sylk_to_aoa_str(cc2str(d), opts); } throw new Error("Unrecognized type " + opts.type); } function sylk_to_aoa_str(str/*:string*/, opts)/*:[AOA, Worksheet]*/ { var records = str.split(/[\n\r]+/), R = -1, C = -1, ri = 0, rj = 0, arr/*:AOA*/ = []; var formats/*:Array<string>*/ = []; var next_cell_format/*:string|null*/ = null; var sht = {}, rowinfo/*:Array<RowInfo>*/ = [], colinfo/*:Array<ColInfo>*/ = [], cw/*:Array<string>*/ = []; var Mval = 0, j; if(+opts.codepage >= 0) set_cp(+opts.codepage); for (; ri !== records.length; ++ri) { Mval = 0; var rstr=records[ri].trim().replace(/\x1B([\x20-\x2F])([\x30-\x3F])/g, decode_sylk_char).replace(sylk_char_regex, sylk_char_fn); var record=rstr.replace(/;;/g, "\u0000").split(";").map(function(x) { return x.replace(/\u0000/g, ";"); }); var RT=record[0], val; if(rstr.length > 0) switch(RT) { case 'ID': break; /* header */ case 'E': break; /* EOF */ case 'B': break; /* dimensions */ case 'O': break; /* options? */ case 'W': break; /* window? */ case 'P': if(record[1].charAt(0) == 'P') formats.push(rstr.slice(3).replace(/;;/g, ";")); break; case 'C': var C_seen_K = false, C_seen_X = false, C_seen_S = false, C_seen_E = false, _R = -1, _C = -1; for(rj=1; rj<record.length; ++rj) switch(record[rj].charAt(0)) { case 'A': break; // TODO: comment case 'X': C = parseInt(record[rj].slice(1))-1; C_seen_X = true; break; case 'Y': R = parseInt(record[rj].slice(1))-1; if(!C_seen_X) C = 0; for(j = arr.length; j <= R; ++j) arr[j] = []; break; case 'K': val = record[rj].slice(1); if(val.charAt(0) === '"') val = val.slice(1,val.length - 1); else if(val === 'TRUE') val = true; else if(val === 'FALSE') val = false; else if(!isNaN(fuzzynum(val))) { val = fuzzynum(val); if(next_cell_format !== null && fmt_is_date(next_cell_format)) val = numdate(val); } else if(!isNaN(fuzzydate(val).getDate())) { val = parseDate(val); } if(typeof $cptable !== 'undefined' && typeof val == "string" && ((opts||{}).type != "string") && (opts||{}).codepage) val = $cptable.utils.decode(opts.codepage, val); C_seen_K = true; break; case 'E': C_seen_E = true; var formula = rc_to_a1(record[rj].slice(1), {r:R,c:C}); arr[R][C] = [arr[R][C], formula]; break; case 'S': C_seen_S = true; arr[R][C] = [arr[R][C], "S5S"]; break; case 'G': break; // unknown case 'R': _R = parseInt(record[rj].slice(1))-1; break; case 'C': _C = parseInt(record[rj].slice(1))-1; break; default: if(opts && opts.WTF) throw new Error("SYLK bad record " + rstr); } if(C_seen_K) { if(arr[R][C] && arr[R][C].length == 2) arr[R][C][0] = val; else arr[R][C] = val; next_cell_format = null; } if(C_seen_S) { if(C_seen_E) throw new Error("SYLK shared formula cannot have own formula"); var shrbase = _R > -1 && arr[_R][_C]; if(!shrbase || !shrbase[1]) throw new Error("SYLK shared formula cannot find base"); arr[R][C][1] = shift_formula_str(shrbase[1], {r: R - _R, c: C - _C}); } break; case 'F': var F_seen = 0; for(rj=1; rj<record.length; ++rj) switch(record[rj].charAt(0)) { case 'X': C = parseInt(record[rj].slice(1))-1; ++F_seen; break; case 'Y': R = parseInt(record[rj].slice(1))-1; /*C = 0;*/ for(j = arr.length; j <= R; ++j) arr[j] = []; break; case 'M': Mval = parseInt(record[rj].slice(1)) / 20; break; case 'F': break; /* ??? */ case 'G': break; /* hide grid */ case 'P': next_cell_format = formats[parseInt(record[rj].slice(1))]; break; case 'S': break; /* cell style */ case 'D': break; /* column */ case 'N': break; /* font */ case 'W': cw = record[rj].slice(1).split(" "); for(j = parseInt(cw[0], 10); j <= parseInt(cw[1], 10); ++j) { Mval = parseInt(cw[2], 10); colinfo[j-1] = Mval === 0 ? {hidden:true}: {wch:Mval}; process_col(colinfo[j-1]); } break; case 'C': /* default column format */ C = parseInt(record[rj].slice(1))-1; if(!colinfo[C]) colinfo[C] = {}; break; case 'R': /* row properties */ R = parseInt(record[rj].slice(1))-1; if(!rowinfo[R]) rowinfo[R] = {}; if(Mval > 0) { rowinfo[R].hpt = Mval; rowinfo[R].hpx = pt2px(Mval); } else if(Mval === 0) rowinfo[R].hidden = true; break; default: if(opts && opts.WTF) throw new Error("SYLK bad record " + rstr); } if(F_seen < 1) next_cell_format = null; break; default: if(opts && opts.WTF) throw new Error("SYLK bad record " + rstr); } } if(rowinfo.length > 0) sht['!rows'] = rowinfo; if(colinfo.length > 0) sht['!cols'] = colinfo; if(opts && opts.sheetRows) arr = arr.slice(0, opts.sheetRows); return [arr, sht]; } function sylk_to_sheet(d/*:RawData*/, opts)/*:Worksheet*/ { var aoasht = sylk_to_aoa(d, opts); var aoa = aoasht[0], ws = aoasht[1]; var o = aoa_to_sheet(aoa, opts); keys(ws).forEach(function(k) { o[k] = ws[k]; }); return o; } function sylk_to_workbook(d/*:RawData*/, opts)/*:Workbook*/ { return sheet_to_workbook(sylk_to_sheet(d, opts), opts); } function write_ws_cell_sylk(cell/*:Cell*/, ws/*:Worksheet*/, R/*:number*/, C/*:number*//*::, opts*/)/*:string*/ { var o = "C;Y" + (R+1) + ";X" + (C+1) + ";K"; switch(cell.t) { case 'n': o += (cell.v||0); if(cell.f && !cell.F) o += ";E" + a1_to_rc(cell.f, {r:R, c:C}); break; case 'b': o += cell.v ? "TRUE" : "FALSE"; break; case 'e': o += cell.w || cell.v; break; case 'd': o += '"' + (cell.w || cell.v) + '"'; break; case 's': o += '"' + cell.v.replace(/"/g,"").replace(/;/g, ";;") + '"'; break; } return o; } function write_ws_cols_sylk(out, cols) { cols.forEach(function(col, i) { var rec = "F;W" + (i+1) + " " + (i+1) + " "; if(col.hidden) rec += "0"; else { if(typeof col.width == 'number' && !col.wpx) col.wpx = width2px(col.width); if(typeof col.wpx == 'number' && !col.wch) col.wch = px2char(col.wpx); if(typeof col.wch == 'number') rec += Math.round(col.wch); } if(rec.charAt(rec.length - 1) != " ") out.push(rec); }); } function write_ws_rows_sylk(out/*:Array<string>*/, rows/*:Array<RowInfo>*/) { rows.forEach(function(row, i) { var rec = "F;"; if(row.hidden) rec += "M0;"; else if(row.hpt) rec += "M" + 20 * row.hpt + ";"; else if(row.hpx) rec += "M" + 20 * px2pt(row.hpx) + ";"; if(rec.length > 2) out.push(rec + "R" + (i+1)); }); } function sheet_to_sylk(ws/*:Worksheet*/, opts/*:?any*/)/*:string*/ { var preamble/*:Array<string>*/ = ["ID;PWXL;N;E"], o/*:Array<string>*/ = []; var r = safe_decode_range(ws['!ref']), cell/*:Cell*/; var dense = Array.isArray(ws); var RS = "\r\n"; preamble.push("P;PGeneral"); preamble.push("F;P0;DG0G8;M255"); if(ws['!cols']) write_ws_cols_sylk(preamble, ws['!cols']); if(ws['!rows']) write_ws_rows_sylk(preamble, ws['!rows']); preamble.push("B;Y" + (r.e.r - r.s.r + 1) + ";X" + (r.e.c - r.s.c + 1) + ";D" + [r.s.c,r.s.r,r.e.c,r.e.r].join(" ")); for(var R = r.s.r; R <= r.e.r; ++R) { for(var C = r.s.c; C <= r.e.c; ++C) { var coord = encode_cell({r:R,c:C}); cell = dense ? (ws[R]||[])[C]: ws[coord]; if(!cell || (cell.v == null && (!cell.f || cell.F))) continue; o.push(write_ws_cell_sylk(cell, ws, R, C, opts)); } } return preamble.join(RS) + RS + o.join(RS) + RS + "E" + RS; } return { to_workbook: sylk_to_workbook, to_sheet: sylk_to_sheet, from_sheet: sheet_to_sylk }; })(); var DIF = /*#__PURE__*/(function() { function dif_to_aoa(d/*:RawData*/, opts)/*:AOA*/ { switch(opts.type) { case 'base64': return dif_to_aoa_str(Base64_decode(d), opts); case 'binary': return dif_to_aoa_str(d, opts); case 'buffer': return dif_to_aoa_str(has_buf && Buffer.isBuffer(d) ? d.toString('binary') : a2s(d), opts); case 'array': return dif_to_aoa_str(cc2str(d), opts); } throw new Error("Unrecognized type " + opts.type); } function dif_to_aoa_str(str/*:string*/, opts)/*:AOA*/ { var records = str.split('\n'), R = -1, C = -1, ri = 0, arr/*:AOA*/ = []; for (; ri !== records.length; ++ri) { if (records[ri].trim() === 'BOT') { arr[++R] = []; C = 0; continue; } if (R < 0) continue; var metadata = records[ri].trim().split(","); var type = metadata[0], value = metadata[1]; ++ri; var data = records[ri] || ""; while(((data.match(/["]/g)||[]).length & 1) && ri < records.length - 1) data += "\n" + records[++ri]; data = data.trim(); switch (+type) { case -1: if (data === 'BOT') { arr[++R] = []; C = 0; continue; } else if (data !== 'EOD') throw new Error("Unrecognized DIF special command " + data); break; case 0: if(data === 'TRUE') arr[R][C] = true; else if(data === 'FALSE') arr[R][C] = false; else if(!isNaN(fuzzynum(value))) arr[R][C] = fuzzynum(value); else if(!isNaN(fuzzydate(value).getDate())) arr[R][C] = parseDate(value); else arr[R][C] = value; ++C; break; case 1: data = data.slice(1,data.length-1); data = data.replace(/""/g, '"'); if(DIF_XL && data && data.match(/^=".*"$/)) data = data.slice(2, -1); arr[R][C++] = data !== '' ? data : null; break; } if (data === 'EOD') break; } if(opts && opts.sheetRows) arr = arr.slice(0, opts.sheetRows); return arr; } function dif_to_sheet(str/*:string*/, opts)/*:Worksheet*/ { return aoa_to_sheet(dif_to_aoa(str, opts), opts); } function dif_to_workbook(str/*:string*/, opts)/*:Workbook*/ { return sheet_to_workbook(dif_to_sheet(str, opts), opts); } var sheet_to_dif = /*#__PURE__*/(function() { var push_field = function pf(o/*:Array<string>*/, topic/*:string*/, v/*:number*/, n/*:number*/, s/*:string*/) { o.push(topic); o.push(v + "," + n); o.push('"' + s.replace(/"/g,'""') + '"'); }; var push_value = function po(o/*:Array<string>*/, type/*:number*/, v/*:any*/, s/*:string*/) { o.push(type + "," + v); o.push(type == 1 ? '"' + s.replace(/"/g,'""') + '"' : s); }; return function sheet_to_dif(ws/*:Worksheet*//*::, opts:?any*/)/*:string*/ { var o/*:Array<string>*/ = []; var r = safe_decode_range(ws['!ref']), cell/*:Cell*/; var dense = Array.isArray(ws); push_field(o, "TABLE", 0, 1, "sheetjs"); push_field(o, "VECTORS", 0, r.e.r - r.s.r + 1,""); push_field(o, "TUPLES", 0, r.e.c - r.s.c + 1,""); push_field(o, "DATA", 0, 0,""); for(var R = r.s.r; R <= r.e.r; ++R) { push_value(o, -1, 0, "BOT"); for(var C = r.s.c; C <= r.e.c; ++C) { var coord = encode_cell({r:R,c:C}); cell = dense ? (ws[R]||[])[C] : ws[coord]; if(!cell) { push_value(o, 1, 0, ""); continue;} switch(cell.t) { case 'n': var val = DIF_XL ? cell.w : cell.v; if(!val && cell.v != null) val = cell.v; if(val == null) { if(DIF_XL && cell.f && !cell.F) push_value(o, 1, 0, "=" + cell.f); else push_value(o, 1, 0, ""); } else push_value(o, 0, val, "V"); break; case 'b': push_value(o, 0, cell.v ? 1 : 0, cell.v ? "TRUE" : "FALSE"); break; case 's': push_value(o, 1, 0, (!DIF_XL || isNaN(cell.v)) ? cell.v : '="' + cell.v + '"'); break; case 'd': if(!cell.w) cell.w = SSF_format(cell.z || table_fmt[14], datenum(parseDate(cell.v))); if(DIF_XL) push_value(o, 0, cell.w, "V"); else push_value(o, 1, 0, cell.w); break; default: push_value(o, 1, 0, ""); } } } push_value(o, -1, 0, "EOD"); var RS = "\r\n"; var oo = o.join(RS); //while((oo.length & 0x7F) != 0) oo += "\0"; return oo; }; })(); return { to_workbook: dif_to_workbook, to_sheet: dif_to_sheet, from_sheet: sheet_to_dif }; })(); var ETH = /*#__PURE__*/(function() { function decode(s/*:string*/)/*:string*/ { return s.replace(/\\b/g,"\\").replace(/\\c/g,":").replace(/\\n/g,"\n"); } function encode(s/*:string*/)/*:string*/ { return s.replace(/\\/g, "\\b").replace(/:/g, "\\c").replace(/\n/g,"\\n"); } function eth_to_aoa(str/*:string*/, opts)/*:AOA*/ { var records = str.split('\n'), R = -1, C = -1, ri = 0, arr/*:AOA*/ = []; for (; ri !== records.length; ++ri) { var record = records[ri].trim().split(":"); if(record[0] !== 'cell') continue; var addr = decode_cell(record[1]); if(arr.length <= addr.r) for(R = arr.length; R <= addr.r; ++R) if(!arr[R]) arr[R] = []; R = addr.r; C = addr.c; switch(record[2]) { case 't': arr[R][C] = decode(record[3]); break; case 'v': arr[R][C] = +record[3]; break; case 'vtf': var _f = record[record.length - 1]; /* falls through */ case 'vtc': switch(record[3]) { case 'nl': arr[R][C] = +record[4] ? true : false; break; default: arr[R][C] = +record[4]; break; } if(record[2] == 'vtf') arr[R][C] = [arr[R][C], _f]; } } if(opts && opts.sheetRows) arr = arr.slice(0, opts.sheetRows); return arr; } function eth_to_sheet(d/*:string*/, opts)/*:Worksheet*/ { return aoa_to_sheet(eth_to_aoa(d, opts), opts); } function eth_to_workbook(d/*:string*/, opts)/*:Workbook*/ { return sheet_to_workbook(eth_to_sheet(d, opts), opts); } var header = [ "socialcalc:version:1.5", "MIME-Version: 1.0", "Content-Type: multipart/mixed; boundary=SocialCalcSpreadsheetControlSave" ].join("\n"); var sep = [ "--SocialCalcSpreadsheetControlSave", "Content-type: text/plain; charset=UTF-8" ].join("\n") + "\n"; /* TODO: the other parts */ var meta = [ "# SocialCalc Spreadsheet Control Save", "part:sheet" ].join("\n"); var end = "--SocialCalcSpreadsheetControlSave--"; function sheet_to_eth_data(ws/*:Worksheet*/)/*:string*/ { if(!ws || !ws['!ref']) return ""; var o/*:Array<string>*/ = [], oo/*:Array<string>*/ = [], cell, coord = ""; var r = decode_range(ws['!ref']); var dense = Array.isArray(ws); for(var R = r.s.r; R <= r.e.r; ++R) { for(var C = r.s.c; C <= r.e.c; ++C) { coord = encode_cell({r:R,c:C}); cell = dense ? (ws[R]||[])[C] : ws[coord]; if(!cell || cell.v == null || cell.t === 'z') continue; oo = ["cell", coord, 't']; switch(cell.t) { case 's': case 'str': oo.push(encode(cell.v)); break; case 'n': if(!cell.f) { oo[2]='v'; oo[3]=cell.v; } else { oo[2]='vtf'; oo[3]='n'; oo[4]=cell.v; oo[5]=encode(cell.f); } break; case 'b': oo[2] = 'vt'+(cell.f?'f':'c'); oo[3]='nl'; oo[4]=cell.v?"1":"0"; oo[5] = encode(cell.f||(cell.v?'TRUE':'FALSE')); break; case 'd': var t = datenum(parseDate(cell.v)); oo[2] = 'vtc'; oo[3] = 'nd'; oo[4] = ""+t; oo[5] = cell.w || SSF_format(cell.z || table_fmt[14], t); break; case 'e': continue; } o.push(oo.join(":")); } } o.push("sheet:c:" + (r.e.c-r.s.c+1) + ":r:" + (r.e.r-r.s.r+1) + ":tvf:1"); o.push("valueformat:1:text-wiki"); //o.push("copiedfrom:" + ws['!ref']); // clipboard only return o.join("\n"); } function sheet_to_eth(ws/*:Worksheet*//*::, opts:?any*/)/*:string*/ { return [header, sep, meta, sep, sheet_to_eth_data(ws), end].join("\n"); // return ["version:1.5", sheet_to_eth_data(ws)].join("\n"); // clipboard form } return { to_workbook: eth_to_workbook, to_sheet: eth_to_sheet, from_sheet: sheet_to_eth }; })(); var PRN = /*#__PURE__*/(function() { function set_text_arr(data/*:string*/, arr/*:AOA*/, R/*:number*/, C/*:number*/, o/*:any*/) { if(o.raw) arr[R][C] = data; else if(data === ""){/* empty */} else if(data === 'TRUE') arr[R][C] = true; else if(data === 'FALSE') arr[R][C] = false; else if(!isNaN(fuzzynum(data))) arr[R][C] = fuzzynum(data); else if(!isNaN(fuzzydate(data).getDate())) arr[R][C] = parseDate(data); else arr[R][C] = data; } function prn_to_aoa_str(f/*:string*/, opts)/*:AOA*/ { var o = opts || {}; var arr/*:AOA*/ = ([]/*:any*/); if(!f || f.length === 0) return arr; var lines = f.split(/[\r\n]/); var L = lines.length - 1; while(L >= 0 && lines[L].length === 0) --L; var start = 10, idx = 0; var R = 0; for(; R <= L; ++R) { idx = lines[R].indexOf(" "); if(idx == -1) idx = lines[R].length; else idx++; start = Math.max(start, idx); } for(R = 0; R <= L; ++R) { arr[R] = []; /* TODO: confirm that widths are always 10 */ var C = 0; set_text_arr(lines[R].slice(0, start).trim(), arr, R, C, o); for(C = 1; C <= (lines[R].length - start)/10 + 1; ++C) set_text_arr(lines[R].slice(start+(C-1)*10,start+C*10).trim(),arr,R,C,o); } if(o.sheetRows) arr = arr.slice(0, o.sheetRows); return arr; } // List of accepted CSV separators var guess_seps = { /*::[*/0x2C/*::]*/: ',', /*::[*/0x09/*::]*/: "\t", /*::[*/0x3B/*::]*/: ';', /*::[*/0x7C/*::]*/: '|' }; // CSV separator weights to be used in case of equal numbers var guess_sep_weights = { /*::[*/0x2C/*::]*/: 3, /*::[*/0x09/*::]*/: 2, /*::[*/0x3B/*::]*/: 1, /*::[*/0x7C/*::]*/: 0 }; function guess_sep(str) { var cnt = {}, instr = false, end = 0, cc = 0; for(;end < str.length;++end) { if((cc=str.charCodeAt(end)) == 0x22) instr = !instr; else if(!instr && cc in guess_seps) cnt[cc] = (cnt[cc]||0)+1; } cc = []; for(end in cnt) if ( Object.prototype.hasOwnProperty.call(cnt, end) ) { cc.push([ cnt[end], end ]); } if ( !cc.length ) { cnt = guess_sep_weights; for(end in cnt) if ( Object.prototype.hasOwnProperty.call(cnt, end) ) { cc.push([ cnt[end], end ]); } } cc.sort(function(a, b) { return a[0] - b[0] || guess_sep_weights[a[1]] - guess_sep_weights[b[1]]; }); return guess_seps[cc.pop()[1]] || 0x2C; } function dsv_to_sheet_str(str/*:string*/, opts)/*:Worksheet*/ { var o = opts || {}; var sep = ""; if(DENSE != null && o.dense == null) o.dense = DENSE; var ws/*:Worksheet*/ = o.dense ? ([]/*:any*/) : ({}/*:any*/); var range/*:Range*/ = ({s: {c:0, r:0}, e: {c:0, r:0}}/*:any*/); if(str.slice(0,4) == "sep=") { // If the line ends in \r\n if(str.charCodeAt(5) == 13 && str.charCodeAt(6) == 10 ) { sep = str.charAt(4); str = str.slice(7); } // If line ends in \r OR \n else if(str.charCodeAt(5) == 13 || str.charCodeAt(5) == 10 ) { sep = str.charAt(4); str = str.slice(6); } else sep = guess_sep(str.slice(0,1024)); } else if(o && o.FS) sep = o.FS; else sep = guess_sep(str.slice(0,1024)); var R = 0, C = 0, v = 0; var start = 0, end = 0, sepcc = sep.charCodeAt(0), instr = false, cc=0, startcc=str.charCodeAt(0); str = str.replace(/\r\n/mg, "\n"); var _re/*:?RegExp*/ = o.dateNF != null ? dateNF_regex(o.dateNF) : null; function finish_cell() { var s = str.slice(start, end); var cell = ({}/*:any*/); if(s.charAt(0) == '"' && s.charAt(s.length - 1) == '"') s = s.slice(1,-1).replace(/""/g,'"'); if(s.length === 0) cell.t = 'z'; else if(o.raw) { cell.t = 's'; cell.v = s; } else if(s.trim().length === 0) { cell.t = 's'; cell.v = s; } else if(s.charCodeAt(0) == 0x3D) { if(s.charCodeAt(1) == 0x22 && s.charCodeAt(s.length - 1) == 0x22) { cell.t = 's'; cell.v = s.slice(2,-1).replace(/""/g,'"'); } else if(fuzzyfmla(s)) { cell.t = 'n'; cell.f = s.slice(1); } else { cell.t = 's'; cell.v = s; } } else if(s == "TRUE") { cell.t = 'b'; cell.v = true; } else if(s == "FALSE") { cell.t = 'b'; cell.v = false; } else if(!isNaN(v = fuzzynum(s))) { cell.t = 'n'; if(o.cellText !== false) cell.w = s; cell.v = v; } else if(!isNaN(fuzzydate(s).getDate()) || _re && s.match(_re)) { cell.z = o.dateNF || table_fmt[14]; var k = 0; if(_re && s.match(_re)){ s=dateNF_fix(s, o.dateNF, (s.match(_re)||[])); k=1; } if(o.cellDates) { cell.t = 'd'; cell.v = parseDate(s, k); } else { cell.t = 'n'; cell.v = datenum(parseDate(s, k)); } if(o.cellText !== false) cell.w = SSF_format(cell.z, cell.v instanceof Date ? datenum(cell.v):cell.v); if(!o.cellNF) delete cell.z; } else { cell.t = 's'; cell.v = s; } if(cell.t == 'z'){} else if(o.dense) { if(!ws[R]) ws[R] = []; ws[R][C] = cell; } else ws[encode_cell({c:C,r:R})] = cell; start = end+1; startcc = str.charCodeAt(start); if(range.e.c < C) range.e.c = C; if(range.e.r < R) range.e.r = R; if(cc == sepcc) ++C; else { C = 0; ++R; if(o.sheetRows && o.sheetRows <= R) return true; } } outer: for(;end < str.length;++end) switch((cc=str.charCodeAt(end))) { case 0x22: if(startcc === 0x22) instr = !instr; break; case sepcc: case 0x0a: case 0x0d: if(!instr && finish_cell()) break outer; break; default: break; } if(end - start > 0) finish_cell(); ws['!ref'] = encode_range(range); return ws; } function prn_to_sheet_str(str/*:string*/, opts)/*:Worksheet*/ { if(!(opts && opts.PRN)) return dsv_to_sheet_str(str, opts); if(opts.FS) return dsv_to_sheet_str(str, opts); if(str.slice(0,4) == "sep=") return dsv_to_sheet_str(str, opts); if(str.indexOf("\t") >= 0 || str.indexOf(",") >= 0 || str.indexOf(";") >= 0) return dsv_to_sheet_str(str, opts); return aoa_to_sheet(prn_to_aoa_str(str, opts), opts); } function prn_to_sheet(d/*:RawData*/, opts)/*:Worksheet*/ { var str = "", bytes = opts.type == 'string' ? [0,0,0,0] : firstbyte(d, opts); switch(opts.type) { case 'base64': str = Base64_decode(d); break; case 'binary': str = d; break; case 'buffer': if(opts.codepage == 65001) str = d.toString('utf8'); // TODO: test if buf else if(opts.codepage && typeof $cptable !== 'undefined') str = $cptable.utils.decode(opts.codepage, d); else str = has_buf && Buffer.isBuffer(d) ? d.toString('binary') : a2s(d); break; case 'array': str = cc2str(d); break; case 'string': str = d; break; default: throw new Error("Unrecognized type " + opts.type); } if(bytes[0] == 0xEF && bytes[1] == 0xBB && bytes[2] == 0xBF) str = utf8read(str.slice(3)); else if(opts.type != 'string' && opts.type != 'buffer' && opts.codepage == 65001) str = utf8read(str); else if((opts.type == 'binary') && typeof $cptable !== 'undefined' && opts.codepage) str = $cptable.utils.decode(opts.codepage, $cptable.utils.encode(28591,str)); if(str.slice(0,19) == "socialcalc:version:") return ETH.to_sheet(opts.type == 'string' ? str : utf8read(str), opts); return prn_to_sheet_str(str, opts); } function prn_to_workbook(d/*:RawData*/, opts)/*:Workbook*/ { return sheet_to_workbook(prn_to_sheet(d, opts), opts); } function sheet_to_prn(ws/*:Worksheet*//*::, opts:?any*/)/*:string*/ { var o/*:Array<string>*/ = []; var r = safe_decode_range(ws['!ref']), cell/*:Cell*/; var dense = Array.isArray(ws); for(var R = r.s.r; R <= r.e.r; ++R) { var oo/*:Array<string>*/ = []; for(var C = r.s.c; C <= r.e.c; ++C) { var coord = encode_cell({r:R,c:C}); cell = dense ? (ws[R]||[])[C] : ws[coord]; if(!cell || cell.v == null) { oo.push(" "); continue; } var w = (cell.w || (format_cell(cell), cell.w) || "").slice(0,10); while(w.length < 10) w += " "; oo.push(w + (C === 0 ? " " : "")); } o.push(oo.join("")); } return o.join("\n"); } return { to_workbook: prn_to_workbook, to_sheet: prn_to_sheet, from_sheet: sheet_to_prn }; })(); /* Excel defaults to SYLK but warns if data is not valid */ function read_wb_ID(d, opts) { var o = opts || {}, OLD_WTF = !!o.WTF; o.WTF = true; try { var out = SYLK.to_workbook(d, o); o.WTF = OLD_WTF; return out; } catch(e) { o.WTF = OLD_WTF; if(!e.message.match(/SYLK bad record ID/) && OLD_WTF) throw e; return PRN.to_workbook(d, opts); } } var WK_ = /*#__PURE__*/(function() { function lotushopper(data, cb/*:RecordHopperCB*/, opts/*:any*/) { if(!data) return; prep_blob(data, data.l || 0); var Enum = opts.Enum || WK1Enum; while(data.l < data.length) { var RT = data.read_shift(2); var R = Enum[RT] || Enum[0xFFFF]; var length = data.read_shift(2); var tgt = data.l + length; var d = R.f && R.f(data, length, opts); data.l = tgt; if(cb(d, R, RT)) return; } } function lotus_to_workbook(d/*:RawData*/, opts) { switch(opts.type) { case 'base64': return lotus_to_workbook_buf(s2a(Base64_decode(d)), opts); case 'binary': return lotus_to_workbook_buf(s2a(d), opts); case 'buffer': case 'array': return lotus_to_workbook_buf(d, opts); } throw "Unsupported type " + opts.type; } function lotus_to_workbook_buf(d, opts)/*:Workbook*/ { if(!d) return d; var o = opts || {}; if(DENSE != null && o.dense == null) o.dense = DENSE; var s/*:Worksheet*/ = ((o.dense ? [] : {})/*:any*/), n = "Sheet1", next_n = "", sidx = 0; var sheets = {}, snames = [], realnames = []; var refguess = {s: {r:0, c:0}, e: {r:0, c:0} }; var sheetRows = o.sheetRows || 0; if(d[2] == 0x00) { if(d[3] == 0x08 || d[3] == 0x09) { if(d.length >= 16 && d[14] == 0x05 && d[15] === 0x6c) throw new Error("Unsupported Works 3 for Mac file"); } } if(d[2] == 0x02) { o.Enum = WK1Enum; lotushopper(d, function(val, R, RT) { switch(RT) { case 0x00: /* BOF */ o.vers = val; if(val >= 0x1000) o.qpro = true; break; case 0x06: refguess = val; break; /* RANGE */ case 0xCC: if(val) next_n = val; break; /* SHEETNAMECS */ case 0xDE: next_n = val; break; /* SHEETNAMELP */ case 0x0F: /* LABEL */ case 0x33: /* STRING */ if(!o.qpro) val[1].v = val[1].v.slice(1); /* falls through */ case 0x0D: /* INTEGER */ case 0x0E: /* NUMBER */ case 0x10: /* FORMULA */ /* TODO: actual translation of the format code */ if(RT == 0x0E && (val[2] & 0x70) == 0x70 && (val[2] & 0x0F) > 1 && (val[2] & 0x0F) < 15) { val[1].z = o.dateNF || table_fmt[14]; if(o.cellDates) { val[1].t = 'd'; val[1].v = numdate(val[1].v); } } if(o.qpro) { if(val[3] > sidx) { s["!ref"] = encode_range(refguess); sheets[n] = s; snames.push(n); s = (o.dense ? [] : {}); refguess = {s: {r:0, c:0}, e: {r:0, c:0} }; sidx = val[3]; n = next_n || "Sheet" + (sidx + 1); next_n = ""; } } var tmpcell = o.dense ? (s[val[0].r]||[])[val[0].c] : s[encode_cell(val[0])]; if(tmpcell) { tmpcell.t = val[1].t; tmpcell.v = val[1].v; if(val[1].z != null) tmpcell.z = val[1].z; if(val[1].f != null) tmpcell.f = val[1].f; break; } if(o.dense) { if(!s[val[0].r]) s[val[0].r] = []; s[val[0].r][val[0].c] = val[1]; } else s[encode_cell(val[0])] = val[1]; break; default: }}, o); } else if(d[2] == 0x1A || d[2] == 0x0E) { o.Enum = WK3Enum; if(d[2] == 0x0E) { o.qpro = true; d.l = 0; } lotushopper(d, function(val, R, RT) { switch(RT) { case 0xCC: n = val; break; /* SHEETNAMECS */ case 0x16: /* LABEL16 */ val[1].v = val[1].v.slice(1); /* falls through */ case 0x17: /* NUMBER17 */ case 0x18: /* NUMBER18 */ case 0x19: /* FORMULA19 */ case 0x25: /* NUMBER25 */ case 0x27: /* NUMBER27 */ case 0x28: /* FORMULA28 */ if(val[3] > sidx) { s["!ref"] = encode_range(refguess); sheets[n] = s; snames.push(n); s = (o.dense ? [] : {}); refguess = {s: {r:0, c:0}, e: {r:0, c:0} }; sidx = val[3]; n = "Sheet" + (sidx + 1); } if(sheetRows > 0 && val[0].r >= sheetRows) break; if(o.dense) { if(!s[val[0].r]) s[val[0].r] = []; s[val[0].r][val[0].c] = val[1]; } else s[encode_cell(val[0])] = val[1]; if(refguess.e.c < val[0].c) refguess.e.c = val[0].c; if(refguess.e.r < val[0].r) refguess.e.r = val[0].r; break; case 0x1B: /* XFORMAT */ if(val[0x36b0]) realnames[val[0x36b0][0]] = val[0x36b0][1]; break; case 0x0601: /* SHEETINFOQP */ realnames[val[0]] = val[1]; if(val[0] == sidx) n = val[1]; break; default: break; }}, o); } else throw new Error("Unrecognized LOTUS BOF " + d[2]); s["!ref"] = encode_range(refguess); sheets[next_n || n] = s; snames.push(next_n || n); if(!realnames.length) return { SheetNames: snames, Sheets: sheets }; var osheets = {}, rnames = []; /* TODO: verify no collisions */ for(var i = 0; i < realnames.length; ++i) if(sheets[snames[i]]) { rnames.push(realnames[i] || snames[i]); osheets[realnames[i]] = sheets[realnames[i]] || sheets[snames[i]]; } else { rnames.push(realnames[i]); osheets[realnames[i]] = ({ "!ref": "A1" }); } return { SheetNames: rnames, Sheets: osheets }; } function sheet_to_wk1(ws/*:Worksheet*/, opts/*:WriteOpts*/) { var o = opts || {}; if(+o.codepage >= 0) set_cp(+o.codepage); if(o.type == "string") throw new Error("Cannot write WK1 to JS string"); var ba = buf_array(); var range = safe_decode_range(ws["!ref"]); var dense = Array.isArray(ws); var cols = []; write_biff_rec(ba, 0x00, write_BOF_WK1(0x0406)); write_biff_rec(ba, 0x06, write_RANGE(range)); var max_R = Math.min(range.e.r, 8191); for(var R = range.s.r; R <= max_R; ++R) { var rr = encode_row(R); for(var C = range.s.c; C <= range.e.c; ++C) { if(R === range.s.r) cols[C] = encode_col(C); var ref = cols[C] + rr; var cell = dense ? (ws[R]||[])[C] : ws[ref]; if(!cell || cell.t == "z") continue; /* TODO: formula records */ if(cell.t == "n") { if((cell.v|0)==cell.v && cell.v >= -32768 && cell.v <= 32767) write_biff_rec(ba, 0x0d, write_INTEGER(R, C, cell.v)); else write_biff_rec(ba, 0x0e, write_NUMBER(R, C, cell.v)); } else { var str = format_cell(cell); write_biff_rec(ba, 0x0F, write_LABEL(R, C, str.slice(0, 239))); } } } write_biff_rec(ba, 0x01); return ba.end(); } function book_to_wk3(wb/*:Workbook*/, opts/*:WriteOpts*/) { var o = opts || {}; if(+o.codepage >= 0) set_cp(+o.codepage); if(o.type == "string") throw new Error("Cannot write WK3 to JS string"); var ba = buf_array(); write_biff_rec(ba, 0x00, write_BOF_WK3(wb)); for(var i = 0, cnt = 0; i < wb.SheetNames.length; ++i) if((wb.Sheets[wb.SheetNames[i]] || {})["!ref"]) write_biff_rec(ba, 0x1b, write_XFORMAT_SHEETNAME(wb.SheetNames[i], cnt++)); var wsidx = 0; for(i = 0; i < wb.SheetNames.length; ++i) { var ws = wb.Sheets[wb.SheetNames[i]]; if(!ws || !ws["!ref"]) continue; var range = safe_decode_range(ws["!ref"]); var dense = Array.isArray(ws); var cols = []; var max_R = Math.min(range.e.r, 8191); for(var R = range.s.r; R <= max_R; ++R) { var rr = encode_row(R); for(var C = range.s.c; C <= range.e.c; ++C) { if(R === range.s.r) cols[C] = encode_col(C); var ref = cols[C] + rr; var cell = dense ? (ws[R]||[])[C] : ws[ref]; if(!cell || cell.t == "z") continue; /* TODO: FORMULA19 NUMBER18 records */ if(cell.t == "n") { write_biff_rec(ba, 0x17, write_NUMBER_17(R, C, wsidx, cell.v)); } else { var str = format_cell(cell); /* TODO: max len? */ write_biff_rec(ba, 0x16, write_LABEL_16(R, C, wsidx, str.slice(0, 239))); } } } ++wsidx; } write_biff_rec(ba, 0x01); return ba.end(); } function write_BOF_WK1(v/*:number*/) { var out = new_buf(2); out.write_shift(2, v); return out; } function write_BOF_WK3(wb/*:Workbook*/) { var out = new_buf(26); out.write_shift(2, 0x1000); out.write_shift(2, 0x0004); out.write_shift(4, 0x0000); var rows = 0, cols = 0, wscnt = 0; for(var i = 0; i < wb.SheetNames.length; ++i) { var name = wb.SheetNames[i]; var ws = wb.Sheets[name]; if(!ws || !ws["!ref"]) continue; ++wscnt; var range = decode_range(ws["!ref"]); if(rows < range.e.r) rows = range.e.r; if(cols < range.e.c) cols = range.e.c; } if(rows > 8191) rows = 8191; out.write_shift(2, rows); out.write_shift(1, wscnt); out.write_shift(1, cols); out.write_shift(2, 0x00); out.write_shift(2, 0x00); out.write_shift(1, 0x01); out.write_shift(1, 0x02); out.write_shift(4, 0); out.write_shift(4, 0); return out; } function parse_RANGE(blob, length, opts) { var o = {s:{c:0,r:0},e:{c:0,r:0}}; if(length == 8 && opts.qpro) { o.s.c = blob.read_shift(1); blob.l++; o.s.r = blob.read_shift(2); o.e.c = blob.read_shift(1); blob.l++; o.e.r = blob.read_shift(2); return o; } o.s.c = blob.read_shift(2); o.s.r = blob.read_shift(2); if(length == 12 && opts.qpro) blob.l += 2; o.e.c = blob.read_shift(2); o.e.r = blob.read_shift(2); if(length == 12 && opts.qpro) blob.l += 2; if(o.s.c == 0xFFFF) o.s.c = o.e.c = o.s.r = o.e.r = 0; return o; } function write_RANGE(range) { var out = new_buf(8); out.write_shift(2, range.s.c); out.write_shift(2, range.s.r); out.write_shift(2, range.e.c); out.write_shift(2, range.e.r); return out; } function parse_cell(blob, length, opts) { var o = [{c:0,r:0}, {t:'n',v:0}, 0, 0]; if(opts.qpro && opts.vers != 0x5120) { o[0].c = blob.read_shift(1); o[3] = blob.read_shift(1); o[0].r = blob.read_shift(2); blob.l+=2; } else { o[2] = blob.read_shift(1); o[0].c = blob.read_shift(2); o[0].r = blob.read_shift(2); } return o; } function parse_LABEL(blob, length, opts) { var tgt = blob.l + length; var o = parse_cell(blob, length, opts); o[1].t = 's'; if(opts.vers == 0x5120) { blob.l++; var len = blob.read_shift(1); o[1].v = blob.read_shift(len, 'utf8'); return o; } if(opts.qpro) blob.l++; o[1].v = blob.read_shift(tgt - blob.l, 'cstr'); return o; } function write_LABEL(R, C, s) { /* TODO: encoding */ var o = new_buf(7 + s.length); o.write_shift(1, 0xFF); o.write_shift(2, C); o.write_shift(2, R); o.write_shift(1, 0x27); // ?? for(var i = 0; i < o.length; ++i) { var cc = s.charCodeAt(i); o.write_shift(1, cc >= 0x80 ? 0x5F : cc); } o.write_shift(1, 0); return o; } function parse_INTEGER(blob, length, opts) { var o = parse_cell(blob, length, opts); o[1].v = blob.read_shift(2, 'i'); return o; } function write_INTEGER(R, C, v) { var o = new_buf(7); o.write_shift(1, 0xFF); o.write_shift(2, C); o.write_shift(2, R); o.write_shift(2, v, 'i'); return o; } function parse_NUMBER(blob, length, opts) { var o = parse_cell(blob, length, opts); o[1].v = blob.read_shift(8, 'f'); return o; } function write_NUMBER(R, C, v) { var o = new_buf(13); o.write_shift(1, 0xFF); o.write_shift(2, C); o.write_shift(2, R); o.write_shift(8, v, 'f'); return o; } function parse_FORMULA(blob, length, opts) { var tgt = blob.l + length; var o = parse_cell(blob, length, opts); /* TODO: formula */ o[1].v = blob.read_shift(8, 'f'); if(opts.qpro) blob.l = tgt; else { var flen = blob.read_shift(2); wk1_fmla_to_csf(blob.slice(blob.l, blob.l + flen), o); blob.l += flen; } return o; } function wk1_parse_rc(B, V, col) { var rel = V & 0x8000; V &= ~0x8000; V = (rel ? B : 0) + ((V >= 0x2000) ? V - 0x4000 : V); return (rel ? "" : "$") + (col ? encode_col(V) : encode_row(V)); } /* var oprec = [ 8, 8, 8, 8, 8, 8, 8, 8, 6, 4, 4, 5, 5, 7, 3, 3, 3, 3, 3, 3, 1, 1, 2, 6, 8, 8, 8, 8, 8, 8, 8, 8 ]; */ /* TODO: flesh out */ var FuncTab = { 0x33: ["FALSE", 0], 0x34: ["TRUE", 0], 0x46: ["LEN", 1], 0x50: ["SUM", 69], 0x51: ["AVERAGEA", 69], 0x52: ["COUNTA", 69], 0x53: ["MINA", 69], 0x54: ["MAXA", 69], 0x6F: ["T", 1] }; var BinOpTab = [ "", "", "", "", "", "", "", "", // eslint-disable-line no-mixed-spaces-and-tabs "", "+", "-", "*", "/", "^", "=", "<>", // eslint-disable-line no-mixed-spaces-and-tabs "<=", ">=", "<", ">", "", "", "", "", // eslint-disable-line no-mixed-spaces-and-tabs "&", "", "", "", "", "", "", "" // eslint-disable-line no-mixed-spaces-and-tabs ]; function wk1_fmla_to_csf(blob, o) { prep_blob(blob, 0); var out = [], argc = 0, R = "", C = "", argL = "", argR = ""; while(blob.l < blob.length) { var cc = blob[blob.l++]; switch(cc) { case 0x00: out.push(blob.read_shift(8, 'f')); break; case 0x01: { C = wk1_parse_rc(o[0].c, blob.read_shift(2), true); R = wk1_parse_rc(o[0].r, blob.read_shift(2), false); out.push(C + R); } break; case 0x02: { var c = wk1_parse_rc(o[0].c, blob.read_shift(2), true); var r = wk1_parse_rc(o[0].r, blob.read_shift(2), false); C = wk1_parse_rc(o[0].c, blob.read_shift(2), true); R = wk1_parse_rc(o[0].r, blob.read_shift(2), false); out.push(c + r + ":" + C + R); } break; case 0x03: if(blob.l < blob.length) { console.error("WK1 premature formula end"); return; } break; case 0x04: out.push("(" + out.pop() + ")"); break; case 0x05: out.push(blob.read_shift(2)); break; case 0x06: { /* TODO: text encoding */ var Z = ""; while((cc = blob[blob.l++])) Z += String.fromCharCode(cc); out.push('"' + Z.replace(/"/g, '""') + '"'); } break; case 0x08: out.push("-" + out.pop()); break; case 0x17: out.push("+" + out.pop()); break; case 0x16: out.push("NOT(" + out.pop() + ")"); break; case 0x14: case 0x15: { argR = out.pop(); argL = out.pop(); out.push(["AND", "OR"][cc - 0x14] + "(" + argL + "," + argR + ")"); } break; default: if(cc < 0x20 && BinOpTab[cc]) { argR = out.pop(); argL = out.pop(); out.push(argL + BinOpTab[cc] + argR); } else if(FuncTab[cc]) { argc = FuncTab[cc][1]; if(argc == 69) argc = blob[blob.l++]; if(argc > out.length) { console.error("WK1 bad formula parse 0x" + cc.toString(16) + ":|" + out.join("|") + "|"); return; } var args = out.slice(-argc); out.length -= argc; out.push(FuncTab[cc][0] + "(" + args.join(",") + ")"); } else if(cc <= 0x07) return console.error("WK1 invalid opcode " + cc.toString(16)); else if(cc <= 0x18) return console.error("WK1 unsupported op " + cc.toString(16)); else if(cc <= 0x1E) return console.error("WK1 invalid opcode " + cc.toString(16)); else if(cc <= 0x73) return console.error("WK1 unsupported function opcode " + cc.toString(16)); // possible future functions ?? else return console.error("WK1 unrecognized opcode " + cc.toString(16)); } } if(out.length == 1) o[1].f = "" + out[0]; else console.error("WK1 bad formula parse |" + out.join("|") + "|"); } function parse_cell_3(blob/*::, length*/) { var o = [{c:0,r:0}, {t:'n',v:0}, 0]; o[0].r = blob.read_shift(2); o[3] = blob[blob.l++]; o[0].c = blob[blob.l++]; return o; } function parse_LABEL_16(blob, length) { var o = parse_cell_3(blob, length); o[1].t = 's'; o[1].v = blob.read_shift(length - 4, 'cstr'); return o; } function write_LABEL_16(R, C, wsidx, s) { /* TODO: encoding */ var o = new_buf(6 + s.length); o.write_shift(2, R); o.write_shift(1, wsidx); o.write_shift(1, C); o.write_shift(1, 0x27); for(var i = 0; i < s.length; ++i) { var cc = s.charCodeAt(i); o.write_shift(1, cc >= 0x80 ? 0x5F : cc); } o.write_shift(1, 0); return o; } function parse_NUMBER_18(blob, length) { var o = parse_cell_3(blob, length); o[1].v = blob.read_shift(2); var v = o[1].v >> 1; if(o[1].v & 0x1) { switch(v & 0x07) { case 0: v = (v >> 3) * 5000; break; case 1: v = (v >> 3) * 500; break; case 2: v = (v >> 3) / 20; break; case 3: v = (v >> 3) / 200; break; case 4: v = (v >> 3) / 2000; break; case 5: v = (v >> 3) / 20000; break; case 6: v = (v >> 3) / 16; break; case 7: v = (v >> 3) / 64; break; } } o[1].v = v; return o; } function parse_NUMBER_17(blob, length) { var o = parse_cell_3(blob, length); var v1 = blob.read_shift(4); var v2 = blob.read_shift(4); var e = blob.read_shift(2); if(e == 0xFFFF) { if(v1 === 0 && v2 === 0xC0000000) { o[1].t = "e"; o[1].v = 0x0F; } // ERR -> #VALUE! else if(v1 === 0 && v2 === 0xD0000000) { o[1].t = "e"; o[1].v = 0x2A; } // NA -> #N/A else o[1].v = 0; return o; } var s = e & 0x8000; e = (e&0x7FFF) - 16446; o[1].v = (1 - s*2) * (v2 * Math.pow(2, e+32) + v1 * Math.pow(2, e)); return o; } function write_NUMBER_17(R, C, wsidx, v) { var o = new_buf(14); o.write_shift(2, R); o.write_shift(1, wsidx); o.write_shift(1, C); if(v == 0) { o.write_shift(4, 0); o.write_shift(4, 0); o.write_shift(2, 0xFFFF); return o; } var s = 0, e = 0, v1 = 0, v2 = 0; if(v < 0) { s = 1; v = -v; } e = Math.log2(v) | 0; v /= Math.pow(2, e-31); v2 = (v)>>>0; if((v2&0x80000000) == 0) { v/=2; ++e; v2 = v >>> 0; } v -= v2; v2 |= 0x80000000; v2 >>>= 0; v *= Math.pow(2, 32); v1 = v>>>0; o.write_shift(4, v1); o.write_shift(4, v2); e += 0x3FFF + (s ? 0x8000 : 0); o.write_shift(2, e); return o; } function parse_FORMULA_19(blob, length) { var o = parse_NUMBER_17(blob, 14); blob.l += length - 14; /* TODO: WK3 formula */ return o; } function parse_NUMBER_25(blob, length) { var o = parse_cell_3(blob, length); var v1 = blob.read_shift(4); o[1].v = v1 >> 6; return o; } function parse_NUMBER_27(blob, length) { var o = parse_cell_3(blob, length); var v1 = blob.read_shift(8,'f'); o[1].v = v1; return o; } function parse_FORMULA_28(blob, length) { var o = parse_NUMBER_27(blob, 14); blob.l += length - 10; /* TODO: formula */ return o; } function parse_SHEETNAMECS(blob, length) { return blob[blob.l + length - 1] == 0 ? blob.read_shift(length, 'cstr') : ""; } function parse_SHEETNAMELP(blob, length) { var len = blob[blob.l++]; if(len > length - 1) len = length - 1; var o = ""; while(o.length < len) o += String.fromCharCode(blob[blob.l++]); return o; } function parse_SHEETINFOQP(blob, length, opts) { if(!opts.qpro || length < 21) return; var id = blob.read_shift(1); blob.l += 17; blob.l += 1; //var len = blob.read_shift(1); blob.l += 2; var nm = blob.read_shift(length - 21, 'cstr'); return [id, nm]; } function parse_XFORMAT(blob, length) { var o = {}, tgt = blob.l + length; while(blob.l < tgt) { var dt = blob.read_shift(2); if(dt == 0x36b0) { o[dt] = [0, ""]; o[dt][0] = blob.read_shift(2); while(blob[blob.l]) { o[dt][1] += String.fromCharCode(blob[blob.l]); blob.l++; } blob.l++; } // TODO: 0x3a99 ?? } return o; } function write_XFORMAT_SHEETNAME(name, wsidx) { var out = new_buf(5 + name.length); out.write_shift(2, 0x36b0); out.write_shift(2, wsidx); for(var i = 0; i < name.length; ++i) { var cc = name.charCodeAt(i); out[out.l++] = cc > 0x7F ? 0x5F : cc; } out[out.l++] = 0; return out; } var WK1Enum = { /*::[*/0x0000/*::]*/: { n:"BOF", f:parseuint16 }, /*::[*/0x0001/*::]*/: { n:"EOF" }, /*::[*/0x0002/*::]*/: { n:"CALCMODE" }, /*::[*/0x0003/*::]*/: { n:"CALCORDER" }, /*::[*/0x0004/*::]*/: { n:"SPLIT" }, /*::[*/0x0005/*::]*/: { n:"SYNC" }, /*::[*/0x0006/*::]*/: { n:"RANGE", f:parse_RANGE }, /*::[*/0x0007/*::]*/: { n:"WINDOW1" }, /*::[*/0x0008/*::]*/: { n:"COLW1" }, /*::[*/0x0009/*::]*/: { n:"WINTWO" }, /*::[*/0x000A/*::]*/: { n:"COLW2" }, /*::[*/0x000B/*::]*/: { n:"NAME" }, /*::[*/0x000C/*::]*/: { n:"BLANK" }, /*::[*/0x000D/*::]*/: { n:"INTEGER", f:parse_INTEGER }, /*::[*/0x000E/*::]*/: { n:"NUMBER", f:parse_NUMBER }, /*::[*/0x000F/*::]*/: { n:"LABEL", f:parse_LABEL }, /*::[*/0x0010/*::]*/: { n:"FORMULA", f:parse_FORMULA }, /*::[*/0x0018/*::]*/: { n:"TABLE" }, /*::[*/0x0019/*::]*/: { n:"ORANGE" }, /*::[*/0x001A/*::]*/: { n:"PRANGE" }, /*::[*/0x001B/*::]*/: { n:"SRANGE" }, /*::[*/0x001C/*::]*/: { n:"FRANGE" }, /*::[*/0x001D/*::]*/: { n:"KRANGE1" }, /*::[*/0x0020/*::]*/: { n:"HRANGE" }, /*::[*/0x0023/*::]*/: { n:"KRANGE2" }, /*::[*/0x0024/*::]*/: { n:"PROTEC" }, /*::[*/0x0025/*::]*/: { n:"FOOTER" }, /*::[*/0x0026/*::]*/: { n:"HEADER" }, /*::[*/0x0027/*::]*/: { n:"SETUP" }, /*::[*/0x0028/*::]*/: { n:"MARGINS" }, /*::[*/0x0029/*::]*/: { n:"LABELFMT" }, /*::[*/0x002A/*::]*/: { n:"TITLES" }, /*::[*/0x002B/*::]*/: { n:"SHEETJS" }, /*::[*/0x002D/*::]*/: { n:"GRAPH" }, /*::[*/0x002E/*::]*/: { n:"NGRAPH" }, /*::[*/0x002F/*::]*/: { n:"CALCCOUNT" }, /*::[*/0x0030/*::]*/: { n:"UNFORMATTED" }, /*::[*/0x0031/*::]*/: { n:"CURSORW12" }, /*::[*/0x0032/*::]*/: { n:"WINDOW" }, /*::[*/0x0033/*::]*/: { n:"STRING", f:parse_LABEL }, /*::[*/0x0037/*::]*/: { n:"PASSWORD" }, /*::[*/0x0038/*::]*/: { n:"LOCKED" }, /*::[*/0x003C/*::]*/: { n:"QUERY" }, /*::[*/0x003D/*::]*/: { n:"QUERYNAME" }, /*::[*/0x003E/*::]*/: { n:"PRINT" }, /*::[*/0x003F/*::]*/: { n:"PRINTNAME" }, /*::[*/0x0040/*::]*/: { n:"GRAPH2" }, /*::[*/0x0041/*::]*/: { n:"GRAPHNAME" }, /*::[*/0x0042/*::]*/: { n:"ZOOM" }, /*::[*/0x0043/*::]*/: { n:"SYMSPLIT" }, /*::[*/0x0044/*::]*/: { n:"NSROWS" }, /*::[*/0x0045/*::]*/: { n:"NSCOLS" }, /*::[*/0x0046/*::]*/: { n:"RULER" }, /*::[*/0x0047/*::]*/: { n:"NNAME" }, /*::[*/0x0048/*::]*/: { n:"ACOMM" }, /*::[*/0x0049/*::]*/: { n:"AMACRO" }, /*::[*/0x004A/*::]*/: { n:"PARSE" }, /*::[*/0x0066/*::]*/: { n:"PRANGES??" }, /*::[*/0x0067/*::]*/: { n:"RRANGES??" }, /*::[*/0x0068/*::]*/: { n:"FNAME??" }, /*::[*/0x0069/*::]*/: { n:"MRANGES??" }, /*::[*/0x00CC/*::]*/: { n:"SHEETNAMECS", f:parse_SHEETNAMECS }, /*::[*/0x00DE/*::]*/: { n:"SHEETNAMELP", f:parse_SHEETNAMELP }, /*::[*/0xFFFF/*::]*/: { n:"" } }; var WK3Enum = { /*::[*/0x0000/*::]*/: { n:"BOF" }, /*::[*/0x0001/*::]*/: { n:"EOF" }, /*::[*/0x0002/*::]*/: { n:"PASSWORD" }, /*::[*/0x0003/*::]*/: { n:"CALCSET" }, /*::[*/0x0004/*::]*/: { n:"WINDOWSET" }, /*::[*/0x0005/*::]*/: { n:"SHEETCELLPTR" }, /*::[*/0x0006/*::]*/: { n:"SHEETLAYOUT" }, /*::[*/0x0007/*::]*/: { n:"COLUMNWIDTH" }, /*::[*/0x0008/*::]*/: { n:"HIDDENCOLUMN" }, /*::[*/0x0009/*::]*/: { n:"USERRANGE" }, /*::[*/0x000A/*::]*/: { n:"SYSTEMRANGE" }, /*::[*/0x000B/*::]*/: { n:"ZEROFORCE" }, /*::[*/0x000C/*::]*/: { n:"SORTKEYDIR" }, /*::[*/0x000D/*::]*/: { n:"FILESEAL" }, /*::[*/0x000E/*::]*/: { n:"DATAFILLNUMS" }, /*::[*/0x000F/*::]*/: { n:"PRINTMAIN" }, /*::[*/0x0010/*::]*/: { n:"PRINTSTRING" }, /*::[*/0x0011/*::]*/: { n:"GRAPHMAIN" }, /*::[*/0x0012/*::]*/: { n:"GRAPHSTRING" }, /*::[*/0x0013/*::]*/: { n:"??" }, /*::[*/0x0014/*::]*/: { n:"ERRCELL" }, /*::[*/0x0015/*::]*/: { n:"NACELL" }, /*::[*/0x0016/*::]*/: { n:"LABEL16", f:parse_LABEL_16}, /*::[*/0x0017/*::]*/: { n:"NUMBER17", f:parse_NUMBER_17 }, /*::[*/0x0018/*::]*/: { n:"NUMBER18", f:parse_NUMBER_18 }, /*::[*/0x0019/*::]*/: { n:"FORMULA19", f:parse_FORMULA_19}, /*::[*/0x001A/*::]*/: { n:"FORMULA1A" }, /*::[*/0x001B/*::]*/: { n:"XFORMAT", f:parse_XFORMAT }, /*::[*/0x001C/*::]*/: { n:"DTLABELMISC" }, /*::[*/0x001D/*::]*/: { n:"DTLABELCELL" }, /*::[*/0x001E/*::]*/: { n:"GRAPHWINDOW" }, /*::[*/0x001F/*::]*/: { n:"CPA" }, /*::[*/0x0020/*::]*/: { n:"LPLAUTO" }, /*::[*/0x0021/*::]*/: { n:"QUERY" }, /*::[*/0x0022/*::]*/: { n:"HIDDENSHEET" }, /*::[*/0x0023/*::]*/: { n:"??" }, /*::[*/0x0025/*::]*/: { n:"NUMBER25", f:parse_NUMBER_25 }, /*::[*/0x0026/*::]*/: { n:"??" }, /*::[*/0x0027/*::]*/: { n:"NUMBER27", f:parse_NUMBER_27 }, /*::[*/0x0028/*::]*/: { n:"FORMULA28", f:parse_FORMULA_28 }, /*::[*/0x008E/*::]*/: { n:"??" }, /*::[*/0x0093/*::]*/: { n:"??" }, /*::[*/0x0096/*::]*/: { n:"??" }, /*::[*/0x0097/*::]*/: { n:"??" }, /*::[*/0x0098/*::]*/: { n:"??" }, /*::[*/0x0099/*::]*/: { n:"??" }, /*::[*/0x009A/*::]*/: { n:"??" }, /*::[*/0x009B/*::]*/: { n:"??" }, /*::[*/0x009C/*::]*/: { n:"??" }, /*::[*/0x00A3/*::]*/: { n:"??" }, /*::[*/0x00AE/*::]*/: { n:"??" }, /*::[*/0x00AF/*::]*/: { n:"??" }, /*::[*/0x00B0/*::]*/: { n:"??" }, /*::[*/0x00B1/*::]*/: { n:"??" }, /*::[*/0x00B8/*::]*/: { n:"??" }, /*::[*/0x00B9/*::]*/: { n:"??" }, /*::[*/0x00BA/*::]*/: { n:"??" }, /*::[*/0x00BB/*::]*/: { n:"??" }, /*::[*/0x00BC/*::]*/: { n:"??" }, /*::[*/0x00C3/*::]*/: { n:"??" }, /*::[*/0x00C9/*::]*/: { n:"??" }, /*::[*/0x00CC/*::]*/: { n:"SHEETNAMECS", f:parse_SHEETNAMECS }, /*::[*/0x00CD/*::]*/: { n:"??" }, /*::[*/0x00CE/*::]*/: { n:"??" }, /*::[*/0x00CF/*::]*/: { n:"??" }, /*::[*/0x00D0/*::]*/: { n:"??" }, /*::[*/0x0100/*::]*/: { n:"??" }, /*::[*/0x0103/*::]*/: { n:"??" }, /*::[*/0x0104/*::]*/: { n:"??" }, /*::[*/0x0105/*::]*/: { n:"??" }, /*::[*/0x0106/*::]*/: { n:"??" }, /*::[*/0x0107/*::]*/: { n:"??" }, /*::[*/0x0109/*::]*/: { n:"??" }, /*::[*/0x010A/*::]*/: { n:"??" }, /*::[*/0x010B/*::]*/: { n:"??" }, /*::[*/0x010C/*::]*/: { n:"??" }, /*::[*/0x010E/*::]*/: { n:"??" }, /*::[*/0x010F/*::]*/: { n:"??" }, /*::[*/0x0180/*::]*/: { n:"??" }, /*::[*/0x0185/*::]*/: { n:"??" }, /*::[*/0x0186/*::]*/: { n:"??" }, /*::[*/0x0189/*::]*/: { n:"??" }, /*::[*/0x018C/*::]*/: { n:"??" }, /*::[*/0x0200/*::]*/: { n:"??" }, /*::[*/0x0202/*::]*/: { n:"??" }, /*::[*/0x0201/*::]*/: { n:"??" }, /*::[*/0x0204/*::]*/: { n:"??" }, /*::[*/0x0205/*::]*/: { n:"??" }, /*::[*/0x0280/*::]*/: { n:"??" }, /*::[*/0x0281/*::]*/: { n:"??" }, /*::[*/0x0282/*::]*/: { n:"??" }, /*::[*/0x0283/*::]*/: { n:"??" }, /*::[*/0x0284/*::]*/: { n:"??" }, /*::[*/0x0285/*::]*/: { n:"??" }, /*::[*/0x0286/*::]*/: { n:"??" }, /*::[*/0x0287/*::]*/: { n:"??" }, /*::[*/0x0288/*::]*/: { n:"??" }, /*::[*/0x0292/*::]*/: { n:"??" }, /*::[*/0x0293/*::]*/: { n:"??" }, /*::[*/0x0294/*::]*/: { n:"??" }, /*::[*/0x0295/*::]*/: { n:"??" }, /*::[*/0x0296/*::]*/: { n:"??" }, /*::[*/0x0299/*::]*/: { n:"??" }, /*::[*/0x029A/*::]*/: { n:"??" }, /*::[*/0x0300/*::]*/: { n:"??" }, /*::[*/0x0304/*::]*/: { n:"??" }, /*::[*/0x0601/*::]*/: { n:"SHEETINFOQP", f:parse_SHEETINFOQP }, /*::[*/0x0640/*::]*/: { n:"??" }, /*::[*/0x0642/*::]*/: { n:"??" }, /*::[*/0x0701/*::]*/: { n:"??" }, /*::[*/0x0702/*::]*/: { n:"??" }, /*::[*/0x0703/*::]*/: { n:"??" }, /*::[*/0x0704/*::]*/: { n:"??" }, /*::[*/0x0780/*::]*/: { n:"??" }, /*::[*/0x0800/*::]*/: { n:"??" }, /*::[*/0x0801/*::]*/: { n:"??" }, /*::[*/0x0804/*::]*/: { n:"??" }, /*::[*/0x0A80/*::]*/: { n:"??" }, /*::[*/0x2AF6/*::]*/: { n:"??" }, /*::[*/0x3231/*::]*/: { n:"??" }, /*::[*/0x6E49/*::]*/: { n:"??" }, /*::[*/0x6F44/*::]*/: { n:"??" }, /*::[*/0xFFFF/*::]*/: { n:"" } }; return { sheet_to_wk1: sheet_to_wk1, book_to_wk3: book_to_wk3, to_workbook: lotus_to_workbook }; })(); /* 18.4.7 rPr CT_RPrElt */ function parse_rpr(rpr) { var font = {}, m = rpr.match(tagregex), i = 0; var pass = false; if(m) for(;i!=m.length; ++i) { var y = parsexmltag(m[i]); switch(y[0].replace(/\w*:/g,"")) { /* 18.8.12 condense CT_BooleanProperty */ /* ** not required . */ case '<condense': break; /* 18.8.17 extend CT_BooleanProperty */ /* ** not required . */ case '<extend': break; /* 18.8.36 shadow CT_BooleanProperty */ /* ** not required . */ case '<shadow': if(!y.val) break; /* falls through */ case '<shadow>': case '<shadow/>': font.shadow = 1; break; case '</shadow>': break; /* 18.4.1 charset CT_IntProperty TODO */ case '<charset': if(y.val == '1') break; font.cp = CS2CP[parseInt(y.val, 10)]; break; /* 18.4.2 outline CT_BooleanProperty TODO */ case '<outline': if(!y.val) break; /* falls through */ case '<outline>': case '<outline/>': font.outline = 1; break; case '</outline>': break; /* 18.4.5 rFont CT_FontName */ case '<rFont': font.name = y.val; break; /* 18.4.11 sz CT_FontSize */ case '<sz': font.sz = y.val; break; /* 18.4.10 strike CT_BooleanProperty */ case '<strike': if(!y.val) break; /* falls through */ case '<strike>': case '<strike/>': font.strike = 1; break; case '</strike>': break; /* 18.4.13 u CT_UnderlineProperty */ case '<u': if(!y.val) break; switch(y.val) { case 'double': font.uval = "double"; break; case 'singleAccounting': font.uval = "single-accounting"; break; case 'doubleAccounting': font.uval = "double-accounting"; break; } /* falls through */ case '<u>': case '<u/>': font.u = 1; break; case '</u>': break; /* 18.8.2 b */ case '<b': if(y.val == '0') break; /* falls through */ case '<b>': case '<b/>': font.b = 1; break; case '</b>': break; /* 18.8.26 i */ case '<i': if(y.val == '0') break; /* falls through */ case '<i>': case '<i/>': font.i = 1; break; case '</i>': break; /* 18.3.1.15 color CT_Color TODO: tint, theme, auto, indexed */ case '<color': if(y.rgb) font.color = y.rgb.slice(2,8); break; case '<color>': case '<color/>': case '</color>': break; /* 18.8.18 family ST_FontFamily */ case '<family': font.family = y.val; break; case '<family>': case '<family/>': case '</family>': break; /* 18.4.14 vertAlign CT_VerticalAlignFontProperty TODO */ case '<vertAlign': font.valign = y.val; break; case '<vertAlign>': case '<vertAlign/>': case '</vertAlign>': break; /* 18.8.35 scheme CT_FontScheme TODO */ case '<scheme': break; case '<scheme>': case '<scheme/>': case '</scheme>': break; /* 18.2.10 extLst CT_ExtensionList ? */ case '<extLst': case '<extLst>': case '</extLst>': break; case '<ext': pass = true; break; case '</ext>': pass = false; break; default: if(y[0].charCodeAt(1) !== 47 && !pass) throw new Error('Unrecognized rich format ' + y[0]); } } return font; } var parse_rs = /*#__PURE__*/(function() { var tregex = matchtag("t"), rpregex = matchtag("rPr"); /* 18.4.4 r CT_RElt */ function parse_r(r) { /* 18.4.12 t ST_Xstring */ var t = r.match(tregex)/*, cp = 65001*/; if(!t) return {t:"s", v:""}; var o/*:Cell*/ = ({t:'s', v:unescapexml(t[1])}/*:any*/); var rpr = r.match(rpregex); if(rpr) o.s = parse_rpr(rpr[1]); return o; } var rregex = /<(?:\w+:)?r>/g, rend = /<\/(?:\w+:)?r>/; return function parse_rs(rs) { return rs.replace(rregex,"").split(rend).map(parse_r).filter(function(r) { return r.v; }); }; })(); /* Parse a list of <r> tags */ var rs_to_html = /*#__PURE__*/(function parse_rs_factory() { var nlregex = /(\r\n|\n)/g; function parse_rpr2(font, intro, outro) { var style/*:Array<string>*/ = []; if(font.u) style.push("text-decoration: underline;"); if(font.uval) style.push("text-underline-style:" + font.uval + ";"); if(font.sz) style.push("font-size:" + font.sz + "pt;"); if(font.outline) style.push("text-effect: outline;"); if(font.shadow) style.push("text-shadow: auto;"); intro.push('<span style="' + style.join("") + '">'); if(font.b) { intro.push("<b>"); outro.push("</b>"); } if(font.i) { intro.push("<i>"); outro.push("</i>"); } if(font.strike) { intro.push("<s>"); outro.push("</s>"); } var align = font.valign || ""; if(align == "superscript" || align == "super") align = "sup"; else if(align == "subscript") align = "sub"; if(align != "") { intro.push("<" + align + ">"); outro.push("</" + align + ">"); } outro.push("</span>"); return font; } /* 18.4.4 r CT_RElt */ function r_to_html(r) { var terms/*:[Array<string>, string, Array<string>]*/ = [[],r.v,[]]; if(!r.v) return ""; if(r.s) parse_rpr2(r.s, terms[0], terms[2]); return terms[0].join("") + terms[1].replace(nlregex,'<br/>') + terms[2].join(""); } return function parse_rs(rs) { return rs.map(r_to_html).join(""); }; })(); /* 18.4.8 si CT_Rst */ var sitregex = /<(?:\w+:)?t[^>]*>([^<]*)<\/(?:\w+:)?t>/g, sirregex = /<(?:\w+:)?r>/; var sirphregex = /<(?:\w+:)?rPh.*?>([\s\S]*?)<\/(?:\w+:)?rPh>/g; function parse_si(x, opts) { var html = opts ? opts.cellHTML : true; var z = {}; if(!x) return { t: "" }; //var y; /* 18.4.12 t ST_Xstring (Plaintext String) */ // TODO: is whitespace actually valid here? if(x.match(/^\s*<(?:\w+:)?t[^>]*>/)) { z.t = unescapexml(utf8read(x.slice(x.indexOf(">")+1).split(/<\/(?:\w+:)?t>/)[0]||"")); z.r = utf8read(x); if(html) z.h = escapehtml(z.t); } /* 18.4.4 r CT_RElt (Rich Text Run) */ else if((/*y = */x.match(sirregex))) { z.r = utf8read(x); z.t = unescapexml(utf8read((x.replace(sirphregex, '').match(sitregex)||[]).join("").replace(tagregex,""))); if(html) z.h = rs_to_html(parse_rs(z.r)); } /* 18.4.3 phoneticPr CT_PhoneticPr (TODO: needed for Asian support) */ /* 18.4.6 rPh CT_PhoneticRun (TODO: needed for Asian support) */ return z; } /* 18.4 Shared String Table */ var sstr0 = /<(?:\w+:)?sst([^>]*)>([\s\S]*)<\/(?:\w+:)?sst>/; var sstr1 = /<(?:\w+:)?(?:si|sstItem)>/g; var sstr2 = /<\/(?:\w+:)?(?:si|sstItem)>/; function parse_sst_xml(data/*:string*/, opts)/*:SST*/ { var s/*:SST*/ = ([]/*:any*/), ss = ""; if(!data) return s; /* 18.4.9 sst CT_Sst */ var sst = data.match(sstr0); if(sst) { ss = sst[2].replace(sstr1,"").split(sstr2); for(var i = 0; i != ss.length; ++i) { var o = parse_si(ss[i].trim(), opts); if(o != null) s[s.length] = o; } sst = parsexmltag(sst[1]); s.Count = sst.count; s.Unique = sst.uniqueCount; } return s; } var straywsregex = /^\s|\s$|[\t\n\r]/; function write_sst_xml(sst/*:SST*/, opts)/*:string*/ { if(!opts.bookSST) return ""; var o = [XML_HEADER]; o[o.length] = (writextag('sst', null, { xmlns: XMLNS_main[0], count: sst.Count, uniqueCount: sst.Unique })); for(var i = 0; i != sst.length; ++i) { if(sst[i] == null) continue; var s/*:XLString*/ = sst[i]; var sitag = "<si>"; if(s.r) sitag += s.r; else { sitag += "<t"; if(!s.t) s.t = ""; if(s.t.match(straywsregex)) sitag += ' xml:space="preserve"'; sitag += ">" + escapexml(s.t) + "</t>"; } sitag += "</si>"; o[o.length] = (sitag); } if(o.length>2){ o[o.length] = ('</sst>'); o[1]=o[1].replace("/>",">"); } return o.join(""); } /* [MS-XLSB] 2.4.221 BrtBeginSst */ function parse_BrtBeginSst(data) { return [data.read_shift(4), data.read_shift(4)]; } /* [MS-XLSB] 2.1.7.45 Shared Strings */ function parse_sst_bin(data, opts)/*:SST*/ { var s/*:SST*/ = ([]/*:any*/); var pass = false; recordhopper(data, function hopper_sst(val, R, RT) { switch(RT) { case 0x009F: /* BrtBeginSst */ s.Count = val[0]; s.Unique = val[1]; break; case 0x0013: /* BrtSSTItem */ s.push(val); break; case 0x00A0: /* BrtEndSst */ return true; case 0x0023: /* BrtFRTBegin */ pass = true; break; case 0x0024: /* BrtFRTEnd */ pass = false; break; default: if(R.T){} if(!pass || opts.WTF) throw new Error("Unexpected record 0x" + RT.toString(16)); } }); return s; } function write_BrtBeginSst(sst, o) { if(!o) o = new_buf(8); o.write_shift(4, sst.Count); o.write_shift(4, sst.Unique); return o; } var write_BrtSSTItem = write_RichStr; function write_sst_bin(sst/*::, opts*/) { var ba = buf_array(); write_record(ba, 0x009F /* BrtBeginSst */, write_BrtBeginSst(sst)); for(var i = 0; i < sst.length; ++i) write_record(ba, 0x0013 /* BrtSSTItem */, write_BrtSSTItem(sst[i])); /* FRTSST */ write_record(ba, 0x00A0 /* BrtEndSst */); return ba.end(); } function _JS2ANSI(str/*:string*/)/*:Array<number>*/ { if(typeof $cptable !== 'undefined') return $cptable.utils.encode(current_ansi, str); var o/*:Array<number>*/ = [], oo = str.split(""); for(var i = 0; i < oo.length; ++i) o[i] = oo[i].charCodeAt(0); return o; } /* [MS-OFFCRYPTO] 2.1.4 Version */ function parse_CRYPTOVersion(blob, length/*:?number*/) { var o/*:any*/ = {}; o.Major = blob.read_shift(2); o.Minor = blob.read_shift(2); /*:: if(length == null) return o; */ if(length >= 4) blob.l += length - 4; return o; } /* [MS-OFFCRYPTO] 2.1.5 DataSpaceVersionInfo */ function parse_DataSpaceVersionInfo(blob) { var o = {}; o.id = blob.read_shift(0, 'lpp4'); o.R = parse_CRYPTOVersion(blob, 4); o.U = parse_CRYPTOVersion(blob, 4); o.W = parse_CRYPTOVersion(blob, 4); return o; } /* [MS-OFFCRYPTO] 2.1.6.1 DataSpaceMapEntry Structure */ function parse_DataSpaceMapEntry(blob) { var len = blob.read_shift(4); var end = blob.l + len - 4; var o = {}; var cnt = blob.read_shift(4); var comps/*:Array<{t:number, v:string}>*/ = []; /* [MS-OFFCRYPTO] 2.1.6.2 DataSpaceReferenceComponent Structure */ while(cnt-- > 0) comps.push({ t: blob.read_shift(4), v: blob.read_shift(0, 'lpp4') }); o.name = blob.read_shift(0, 'lpp4'); o.comps = comps; if(blob.l != end) throw new Error("Bad DataSpaceMapEntry: " + blob.l + " != " + end); return o; } /* [MS-OFFCRYPTO] 2.1.6 DataSpaceMap */ function parse_DataSpaceMap(blob) { var o = []; blob.l += 4; // must be 0x8 var cnt = blob.read_shift(4); while(cnt-- > 0) o.push(parse_DataSpaceMapEntry(blob)); return o; } /* [MS-OFFCRYPTO] 2.1.7 DataSpaceDefinition */ function parse_DataSpaceDefinition(blob)/*:Array<string>*/ { var o/*:Array<string>*/ = []; blob.l += 4; // must be 0x8 var cnt = blob.read_shift(4); while(cnt-- > 0) o.push(blob.read_shift(0, 'lpp4')); return o; } /* [MS-OFFCRYPTO] 2.1.8 DataSpaceDefinition */ function parse_TransformInfoHeader(blob) { var o = {}; /*var len = */blob.read_shift(4); blob.l += 4; // must be 0x1 o.id = blob.read_shift(0, 'lpp4'); o.name = blob.read_shift(0, 'lpp4'); o.R = parse_CRYPTOVersion(blob, 4); o.U = parse_CRYPTOVersion(blob, 4); o.W = parse_CRYPTOVersion(blob, 4); return o; } function parse_Primary(blob) { /* [MS-OFFCRYPTO] 2.2.6 IRMDSTransformInfo */ var hdr = parse_TransformInfoHeader(blob); /* [MS-OFFCRYPTO] 2.1.9 EncryptionTransformInfo */ hdr.ename = blob.read_shift(0, '8lpp4'); hdr.blksz = blob.read_shift(4); hdr.cmode = blob.read_shift(4); if(blob.read_shift(4) != 0x04) throw new Error("Bad !Primary record"); return hdr; } /* [MS-OFFCRYPTO] 2.3.2 Encryption Header */ function parse_EncryptionHeader(blob, length/*:number*/) { var tgt = blob.l + length; var o = {}; o.Flags = (blob.read_shift(4) & 0x3F); blob.l += 4; o.AlgID = blob.read_shift(4); var valid = false; switch(o.AlgID) { case 0x660E: case 0x660F: case 0x6610: valid = (o.Flags == 0x24); break; case 0x6801: valid = (o.Flags == 0x04); break; case 0: valid = (o.Flags == 0x10 || o.Flags == 0x04 || o.Flags == 0x24); break; default: throw 'Unrecognized encryption algorithm: ' + o.AlgID; } if(!valid) throw new Error("Encryption Flags/AlgID mismatch"); o.AlgIDHash = blob.read_shift(4); o.KeySize = blob.read_shift(4); o.ProviderType = blob.read_shift(4); blob.l += 8; o.CSPName = blob.read_shift((tgt-blob.l)>>1, 'utf16le'); blob.l = tgt; return o; } /* [MS-OFFCRYPTO] 2.3.3 Encryption Verifier */ function parse_EncryptionVerifier(blob, length/*:number*/) { var o = {}, tgt = blob.l + length; blob.l += 4; // SaltSize must be 0x10 o.Salt = blob.slice(blob.l, blob.l+16); blob.l += 16; o.Verifier = blob.slice(blob.l, blob.l+16); blob.l += 16; /*var sz = */blob.read_shift(4); o.VerifierHash = blob.slice(blob.l, tgt); blob.l = tgt; return o; } /* [MS-OFFCRYPTO] 2.3.4.* EncryptionInfo Stream */ function parse_EncryptionInfo(blob) { var vers = parse_CRYPTOVersion(blob); switch(vers.Minor) { case 0x02: return [vers.Minor, parse_EncInfoStd(blob, vers)]; case 0x03: return [vers.Minor, parse_EncInfoExt(blob, vers)]; case 0x04: return [vers.Minor, parse_EncInfoAgl(blob, vers)]; } throw new Error("ECMA-376 Encrypted file unrecognized Version: " + vers.Minor); } /* [MS-OFFCRYPTO] 2.3.4.5 EncryptionInfo Stream (Standard Encryption) */ function parse_EncInfoStd(blob/*::, vers*/) { var flags = blob.read_shift(4); if((flags & 0x3F) != 0x24) throw new Error("EncryptionInfo mismatch"); var sz = blob.read_shift(4); //var tgt = blob.l + sz; var hdr = parse_EncryptionHeader(blob, sz); var verifier = parse_EncryptionVerifier(blob, blob.length - blob.l); return { t:"Std", h:hdr, v:verifier }; } /* [MS-OFFCRYPTO] 2.3.4.6 EncryptionInfo Stream (Extensible Encryption) */ function parse_EncInfoExt(/*::blob, vers*/) { throw new Error("File is password-protected: ECMA-376 Extensible"); } /* [MS-OFFCRYPTO] 2.3.4.10 EncryptionInfo Stream (Agile Encryption) */ function parse_EncInfoAgl(blob/*::, vers*/) { var KeyData = ["saltSize","blockSize","keyBits","hashSize","cipherAlgorithm","cipherChaining","hashAlgorithm","saltValue"]; blob.l+=4; var xml = blob.read_shift(blob.length - blob.l, 'utf8'); var o = {}; xml.replace(tagregex, function xml_agile(x) { var y/*:any*/ = parsexmltag(x); switch(strip_ns(y[0])) { case '<?xml': break; case '<encryption': case '</encryption>': break; case '<keyData': KeyData.forEach(function(k) { o[k] = y[k]; }); break; case '<dataIntegrity': o.encryptedHmacKey = y.encryptedHmacKey; o.encryptedHmacValue = y.encryptedHmacValue; break; case '<keyEncryptors>': case '<keyEncryptors': o.encs = []; break; case '</keyEncryptors>': break; case '<keyEncryptor': o.uri = y.uri; break; case '</keyEncryptor>': break; case '<encryptedKey': o.encs.push(y); break; default: throw y[0]; } }); return o; } /* [MS-OFFCRYPTO] 2.3.5.1 RC4 CryptoAPI Encryption Header */ function parse_RC4CryptoHeader(blob, length/*:number*/) { var o = {}; var vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4); length -= 4; if(vers.Minor != 2) throw new Error('unrecognized minor version code: ' + vers.Minor); if(vers.Major > 4 || vers.Major < 2) throw new Error('unrecognized major version code: ' + vers.Major); o.Flags = blob.read_shift(4); length -= 4; var sz = blob.read_shift(4); length -= 4; o.EncryptionHeader = parse_EncryptionHeader(blob, sz); length -= sz; o.EncryptionVerifier = parse_EncryptionVerifier(blob, length); return o; } /* [MS-OFFCRYPTO] 2.3.6.1 RC4 Encryption Header */ function parse_RC4Header(blob/*::, length*/) { var o = {}; var vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4); if(vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor; o.Salt = blob.read_shift(16); o.EncryptedVerifier = blob.read_shift(16); o.EncryptedVerifierHash = blob.read_shift(16); return o; } /* [MS-OFFCRYPTO] 2.3.7.1 Binary Document Password Verifier Derivation */ function crypto_CreatePasswordVerifier_Method1(Password/*:string*/) { var Verifier = 0x0000, PasswordArray; var PasswordDecoded = _JS2ANSI(Password); var len = PasswordDecoded.length + 1, i, PasswordByte; var Intermediate1, Intermediate2, Intermediate3; PasswordArray = new_raw_buf(len); PasswordArray[0] = PasswordDecoded.length; for(i = 1; i != len; ++i) PasswordArray[i] = PasswordDecoded[i-1]; for(i = len-1; i >= 0; --i) { PasswordByte = PasswordArray[i]; Intermediate1 = ((Verifier & 0x4000) === 0x0000) ? 0 : 1; Intermediate2 = (Verifier << 1) & 0x7FFF; Intermediate3 = Intermediate1 | Intermediate2; Verifier = Intermediate3 ^ PasswordByte; } return Verifier ^ 0xCE4B; } /* [MS-OFFCRYPTO] 2.3.7.2 Binary Document XOR Array Initialization */ var crypto_CreateXorArray_Method1 = /*#__PURE__*/(function() { var PadArray = [0xBB, 0xFF, 0xFF, 0xBA, 0xFF, 0xFF, 0xB9, 0x80, 0x00, 0xBE, 0x0F, 0x00, 0xBF, 0x0F, 0x00]; var InitialCode = [0xE1F0, 0x1D0F, 0xCC9C, 0x84C0, 0x110C, 0x0E10, 0xF1CE, 0x313E, 0x1872, 0xE139, 0xD40F, 0x84F9, 0x280C, 0xA96A, 0x4EC3]; var XorMatrix = [0xAEFC, 0x4DD9, 0x9BB2, 0x2745, 0x4E8A, 0x9D14, 0x2A09, 0x7B61, 0xF6C2, 0xFDA5, 0xEB6B, 0xC6F7, 0x9DCF, 0x2BBF, 0x4563, 0x8AC6, 0x05AD, 0x0B5A, 0x16B4, 0x2D68, 0x5AD0, 0x0375, 0x06EA, 0x0DD4, 0x1BA8, 0x3750, 0x6EA0, 0xDD40, 0xD849, 0xA0B3, 0x5147, 0xA28E, 0x553D, 0xAA7A, 0x44D5, 0x6F45, 0xDE8A, 0xAD35, 0x4A4B, 0x9496, 0x390D, 0x721A, 0xEB23, 0xC667, 0x9CEF, 0x29FF, 0x53FE, 0xA7FC, 0x5FD9, 0x47D3, 0x8FA6, 0x0F6D, 0x1EDA, 0x3DB4, 0x7B68, 0xF6D0, 0xB861, 0x60E3, 0xC1C6, 0x93AD, 0x377B, 0x6EF6, 0xDDEC, 0x45A0, 0x8B40, 0x06A1, 0x0D42, 0x1A84, 0x3508, 0x6A10, 0xAA51, 0x4483, 0x8906, 0x022D, 0x045A, 0x08B4, 0x1168, 0x76B4, 0xED68, 0xCAF1, 0x85C3, 0x1BA7, 0x374E, 0x6E9C, 0x3730, 0x6E60, 0xDCC0, 0xA9A1, 0x4363, 0x86C6, 0x1DAD, 0x3331, 0x6662, 0xCCC4, 0x89A9, 0x0373, 0x06E6, 0x0DCC, 0x1021, 0x2042, 0x4084, 0x8108, 0x1231, 0x2462, 0x48C4]; var Ror = function(Byte) { return ((Byte/2) | (Byte*128)) & 0xFF; }; var XorRor = function(byte1, byte2) { return Ror(byte1 ^ byte2); }; var CreateXorKey_Method1 = function(Password) { var XorKey = InitialCode[Password.length - 1]; var CurrentElement = 0x68; for(var i = Password.length-1; i >= 0; --i) { var Char = Password[i]; for(var j = 0; j != 7; ++j) { if(Char & 0x40) XorKey ^= XorMatrix[CurrentElement]; Char *= 2; --CurrentElement; } } return XorKey; }; return function(password/*:string*/) { var Password = _JS2ANSI(password); var XorKey = CreateXorKey_Method1(Password); var Index = Password.length; var ObfuscationArray = new_raw_buf(16); for(var i = 0; i != 16; ++i) ObfuscationArray[i] = 0x00; var Temp, PasswordLastChar, PadIndex; if((Index & 1) === 1) { Temp = XorKey >> 8; ObfuscationArray[Index] = XorRor(PadArray[0], Temp); --Index; Temp = XorKey & 0xFF; PasswordLastChar = Password[Password.length - 1]; ObfuscationArray[Index] = XorRor(PasswordLastChar, Temp); } while(Index > 0) { --Index; Temp = XorKey >> 8; ObfuscationArray[Index] = XorRor(Password[Index], Temp); --Index; Temp = XorKey & 0xFF; ObfuscationArray[Index] = XorRor(Password[Index], Temp); } Index = 15; PadIndex = 15 - Password.length; while(PadIndex > 0) { Temp = XorKey >> 8; ObfuscationArray[Index] = XorRor(PadArray[PadIndex], Temp); --Index; --PadIndex; Temp = XorKey & 0xFF; ObfuscationArray[Index] = XorRor(Password[Index], Temp); --Index; --PadIndex; } return ObfuscationArray; }; })(); /* [MS-OFFCRYPTO] 2.3.7.3 Binary Document XOR Data Transformation Method 1 */ var crypto_DecryptData_Method1 = function(password/*:string*/, Data, XorArrayIndex, XorArray, O) { /* If XorArray is set, use it; if O is not set, make changes in-place */ if(!O) O = Data; if(!XorArray) XorArray = crypto_CreateXorArray_Method1(password); var Index, Value; for(Index = 0; Index != Data.length; ++Index) { Value = Data[Index]; Value ^= XorArray[XorArrayIndex]; Value = ((Value>>5) | (Value<<3)) & 0xFF; O[Index] = Value; ++XorArrayIndex; } return [O, XorArrayIndex, XorArray]; }; var crypto_MakeXorDecryptor = function(password/*:string*/) { var XorArrayIndex = 0, XorArray = crypto_CreateXorArray_Method1(password); return function(Data) { var O = crypto_DecryptData_Method1("", Data, XorArrayIndex, XorArray); XorArrayIndex = O[1]; return O[0]; }; }; /* 2.5.343 */ function parse_XORObfuscation(blob, length, opts, out) { var o = ({ key: parseuint16(blob), verificationBytes: parseuint16(blob) }/*:any*/); if(opts.password) o.verifier = crypto_CreatePasswordVerifier_Method1(opts.password); out.valid = o.verificationBytes === o.verifier; if(out.valid) out.insitu = crypto_MakeXorDecryptor(opts.password); return o; } /* 2.4.117 */ function parse_FilePassHeader(blob, length/*:number*/, oo) { var o = oo || {}; o.Info = blob.read_shift(2); blob.l -= 2; if(o.Info === 1) o.Data = parse_RC4Header(blob, length); else o.Data = parse_RC4CryptoHeader(blob, length); return o; } function parse_FilePass(blob, length/*:number*/, opts) { var o = ({ Type: opts.biff >= 8 ? blob.read_shift(2) : 0 }/*:any*/); /* wEncryptionType */ if(o.Type) parse_FilePassHeader(blob, length-2, o); else parse_XORObfuscation(blob, opts.biff >= 8 ? length : length - 2, opts, o); return o; } var RTF = /*#__PURE__*/(function() { function rtf_to_sheet(d/*:RawData*/, opts)/*:Worksheet*/ { switch(opts.type) { case 'base64': return rtf_to_sheet_str(Base64_decode(d), opts); case 'binary': return rtf_to_sheet_str(d, opts); case 'buffer': return rtf_to_sheet_str(has_buf && Buffer.isBuffer(d) ? d.toString('binary') : a2s(d), opts); case 'array': return rtf_to_sheet_str(cc2str(d), opts); } throw new Error("Unrecognized type " + opts.type); } /* TODO: this is a stub */ function rtf_to_sheet_str(str/*:string*/, opts)/*:Worksheet*/ { var o = opts || {}; var ws/*:Worksheet*/ = o.dense ? ([]/*:any*/) : ({}/*:any*/); var rows = str.match(/\\trowd.*?\\row\b/g); if(!rows.length) throw new Error("RTF missing table"); var range/*:Range*/ = ({s: {c:0, r:0}, e: {c:0, r:rows.length - 1}}/*:any*/); rows.forEach(function(rowtf, R) { if(Array.isArray(ws)) ws[R] = []; var rtfre = /\\\w+\b/g; var last_index = 0; var res; var C = -1; while((res = rtfre.exec(rowtf))) { switch(res[0]) { case "\\cell": var data = rowtf.slice(last_index, rtfre.lastIndex - res[0].length); if(data[0] == " ") data = data.slice(1); ++C; if(data.length) { // TODO: value parsing, including codepage adjustments var cell = {v: data, t:"s"}; if(Array.isArray(ws)) ws[R][C] = cell; else ws[encode_cell({r:R, c:C})] = cell; } break; } last_index = rtfre.lastIndex; } if(C > range.e.c) range.e.c = C; }); ws['!ref'] = encode_range(range); return ws; } function rtf_to_workbook(d/*:RawData*/, opts)/*:Workbook*/ { return sheet_to_workbook(rtf_to_sheet(d, opts), opts); } /* TODO: this is a stub */ function sheet_to_rtf(ws/*:Worksheet*//*::, opts*/)/*:string*/ { var o = ["{\\rtf1\\ansi"]; var r = safe_decode_range(ws['!ref']), cell/*:Cell*/; var dense = Array.isArray(ws); for(var R = r.s.r; R <= r.e.r; ++R) { o.push("\\trowd\\trautofit1"); for(var C = r.s.c; C <= r.e.c; ++C) o.push("\\cellx" + (C+1)); o.push("\\pard\\intbl"); for(C = r.s.c; C <= r.e.c; ++C) { var coord = encode_cell({r:R,c:C}); cell = dense ? (ws[R]||[])[C]: ws[coord]; if(!cell || cell.v == null && (!cell.f || cell.F)) continue; o.push(" " + (cell.w || (format_cell(cell), cell.w))); o.push("\\cell"); } o.push("\\pard\\intbl\\row"); } return o.join("") + "}"; } return { to_workbook: rtf_to_workbook, to_sheet: rtf_to_sheet, from_sheet: sheet_to_rtf }; })(); function hex2RGB(h) { var o = h.slice(h[0]==="#"?1:0).slice(0,6); return [parseInt(o.slice(0,2),16),parseInt(o.slice(2,4),16),parseInt(o.slice(4,6),16)]; } function rgb2Hex(rgb) { for(var i=0,o=1; i!=3; ++i) o = o*256 + (rgb[i]>255?255:rgb[i]<0?0:rgb[i]); return o.toString(16).toUpperCase().slice(1); } function rgb2HSL(rgb) { var R = rgb[0]/255, G = rgb[1]/255, B=rgb[2]/255; var M = Math.max(R, G, B), m = Math.min(R, G, B), C = M - m; if(C === 0) return [0, 0, R]; var H6 = 0, S = 0, L2 = (M + m); S = C / (L2 > 1 ? 2 - L2 : L2); switch(M){ case R: H6 = ((G - B) / C + 6)%6; break; case G: H6 = ((B - R) / C + 2); break; case B: H6 = ((R - G) / C + 4); break; } return [H6 / 6, S, L2 / 2]; } function hsl2RGB(hsl){ var H = hsl[0], S = hsl[1], L = hsl[2]; var C = S * 2 * (L < 0.5 ? L : 1 - L), m = L - C/2; var rgb = [m,m,m], h6 = 6*H; var X; if(S !== 0) switch(h6|0) { case 0: case 6: X = C * h6; rgb[0] += C; rgb[1] += X; break; case 1: X = C * (2 - h6); rgb[0] += X; rgb[1] += C; break; case 2: X = C * (h6 - 2); rgb[1] += C; rgb[2] += X; break; case 3: X = C * (4 - h6); rgb[1] += X; rgb[2] += C; break; case 4: X = C * (h6 - 4); rgb[2] += C; rgb[0] += X; break; case 5: X = C * (6 - h6); rgb[2] += X; rgb[0] += C; break; } for(var i = 0; i != 3; ++i) rgb[i] = Math.round(rgb[i]*255); return rgb; } /* 18.8.3 bgColor tint algorithm */ function rgb_tint(hex, tint) { if(tint === 0) return hex; var hsl = rgb2HSL(hex2RGB(hex)); if (tint < 0) hsl[2] = hsl[2] * (1 + tint); else hsl[2] = 1 - (1 - hsl[2]) * (1 - tint); return rgb2Hex(hsl2RGB(hsl)); } /* 18.3.1.13 width calculations */ /* [MS-OI29500] 2.1.595 Column Width & Formatting */ var DEF_MDW = 6, MAX_MDW = 15, MIN_MDW = 1, MDW = DEF_MDW; function width2px(width) { return Math.floor(( width + (Math.round(128/MDW))/256 )* MDW ); } function px2char(px) { return (Math.floor((px - 5)/MDW * 100 + 0.5))/100; } function char2width(chr) { return (Math.round((chr * MDW + 5)/MDW*256))/256; } //function px2char_(px) { return (((px - 5)/MDW * 100 + 0.5))/100; } //function char2width_(chr) { return (((chr * MDW + 5)/MDW*256))/256; } function cycle_width(collw) { return char2width(px2char(width2px(collw))); } /* XLSX/XLSB/XLS specify width in units of MDW */ function find_mdw_colw(collw) { var delta = Math.abs(collw - cycle_width(collw)), _MDW = MDW; if(delta > 0.005) for(MDW=MIN_MDW; MDW<MAX_MDW; ++MDW) if(Math.abs(collw - cycle_width(collw)) <= delta) { delta = Math.abs(collw - cycle_width(collw)); _MDW = MDW; } MDW = _MDW; } /* XLML specifies width in terms of pixels */ /*function find_mdw_wpx(wpx) { var delta = Infinity, guess = 0, _MDW = MIN_MDW; for(MDW=MIN_MDW; MDW<MAX_MDW; ++MDW) { guess = char2width_(px2char_(wpx))*256; guess = (guess) % 1; if(guess > 0.5) guess--; if(Math.abs(guess) < delta) { delta = Math.abs(guess); _MDW = MDW; } } MDW = _MDW; }*/ function process_col(coll/*:ColInfo*/) { if(coll.width) { coll.wpx = width2px(coll.width); coll.wch = px2char(coll.wpx); coll.MDW = MDW; } else if(coll.wpx) { coll.wch = px2char(coll.wpx); coll.width = char2width(coll.wch); coll.MDW = MDW; } else if(typeof coll.wch == 'number') { coll.width = char2width(coll.wch); coll.wpx = width2px(coll.width); coll.MDW = MDW; } if(coll.customWidth) delete coll.customWidth; } var DEF_PPI = 96, PPI = DEF_PPI; function px2pt(px) { return px * 96 / PPI; } function pt2px(pt) { return pt * PPI / 96; } /* [MS-EXSPXML3] 2.4.54 ST_enmPattern */ var XLMLPatternTypeMap = { "None": "none", "Solid": "solid", "Gray50": "mediumGray", "Gray75": "darkGray", "Gray25": "lightGray", "HorzStripe": "darkHorizontal", "VertStripe": "darkVertical", "ReverseDiagStripe": "darkDown", "DiagStripe": "darkUp", "DiagCross": "darkGrid", "ThickDiagCross": "darkTrellis", "ThinHorzStripe": "lightHorizontal", "ThinVertStripe": "lightVertical", "ThinReverseDiagStripe": "lightDown", "ThinHorzCross": "lightGrid" }; /* 18.8.5 borders CT_Borders */ function parse_borders(t, styles, themes, opts) { styles.Borders = []; var border = {}; var pass = false; (t[0].match(tagregex)||[]).forEach(function(x) { var y = parsexmltag(x); switch(strip_ns(y[0])) { case '<borders': case '<borders>': case '</borders>': break; /* 18.8.4 border CT_Border */ case '<border': case '<border>': case '<border/>': border = /*::(*/{}/*:: :any)*/; if(y.diagonalUp) border.diagonalUp = parsexmlbool(y.diagonalUp); if(y.diagonalDown) border.diagonalDown = parsexmlbool(y.diagonalDown); styles.Borders.push(border); break; case '</border>': break; /* note: not in spec, appears to be CT_BorderPr */ case '<left/>': break; case '<left': case '<left>': break; case '</left>': break; /* note: not in spec, appears to be CT_BorderPr */ case '<right/>': break; case '<right': case '<right>': break; case '</right>': break; /* 18.8.43 top CT_BorderPr */ case '<top/>': break; case '<top': case '<top>': break; case '</top>': break; /* 18.8.6 bottom CT_BorderPr */ case '<bottom/>': break; case '<bottom': case '<bottom>': break; case '</bottom>': break; /* 18.8.13 diagonal CT_BorderPr */ case '<diagonal': case '<diagonal>': case '<diagonal/>': break; case '</diagonal>': break; /* 18.8.25 horizontal CT_BorderPr */ case '<horizontal': case '<horizontal>': case '<horizontal/>': break; case '</horizontal>': break; /* 18.8.44 vertical CT_BorderPr */ case '<vertical': case '<vertical>': case '<vertical/>': break; case '</vertical>': break; /* 18.8.37 start CT_BorderPr */ case '<start': case '<start>': case '<start/>': break; case '</start>': break; /* 18.8.16 end CT_BorderPr */ case '<end': case '<end>': case '<end/>': break; case '</end>': break; /* 18.8.? color CT_Color */ case '<color': case '<color>': break; case '<color/>': case '</color>': break; /* 18.2.10 extLst CT_ExtensionList ? */ case '<extLst': case '<extLst>': case '</extLst>': break; case '<ext': pass = true; break; case '</ext>': pass = false; break; default: if(opts && opts.WTF) { if(!pass) throw new Error('unrecognized ' + y[0] + ' in borders'); } } }); } /* 18.8.21 fills CT_Fills */ function parse_fills(t, styles, themes, opts) { styles.Fills = []; var fill = {}; var pass = false; (t[0].match(tagregex)||[]).forEach(function(x) { var y = parsexmltag(x); switch(strip_ns(y[0])) { case '<fills': case '<fills>': case '</fills>': break; /* 18.8.20 fill CT_Fill */ case '<fill>': case '<fill': case '<fill/>': fill = {}; styles.Fills.push(fill); break; case '</fill>': break; /* 18.8.24 gradientFill CT_GradientFill */ case '<gradientFill>': break; case '<gradientFill': case '</gradientFill>': styles.Fills.push(fill); fill = {}; break; /* 18.8.32 patternFill CT_PatternFill */ case '<patternFill': case '<patternFill>': if(y.patternType) fill.patternType = y.patternType; break; case '<patternFill/>': case '</patternFill>': break; /* 18.8.3 bgColor CT_Color */ case '<bgColor': if(!fill.bgColor) fill.bgColor = {}; if(y.indexed) fill.bgColor.indexed = parseInt(y.indexed, 10); if(y.theme) fill.bgColor.theme = parseInt(y.theme, 10); if(y.tint) fill.bgColor.tint = parseFloat(y.tint); /* Excel uses ARGB strings */ if(y.rgb) fill.bgColor.rgb = y.rgb.slice(-6); break; case '<bgColor/>': case '</bgColor>': break; /* 18.8.19 fgColor CT_Color */ case '<fgColor': if(!fill.fgColor) fill.fgColor = {}; if(y.theme) fill.fgColor.theme = parseInt(y.theme, 10); if(y.tint) fill.fgColor.tint = parseFloat(y.tint); /* Excel uses ARGB strings */ if(y.rgb != null) fill.fgColor.rgb = y.rgb.slice(-6); break; case '<fgColor/>': case '</fgColor>': break; /* 18.8.38 stop CT_GradientStop */ case '<stop': case '<stop/>': break; case '</stop>': break; /* 18.8.? color CT_Color */ case '<color': case '<color/>': break; case '</color>': break; /* 18.2.10 extLst CT_ExtensionList ? */ case '<extLst': case '<extLst>': case '</extLst>': break; case '<ext': pass = true; break; case '</ext>': pass = false; break; default: if(opts && opts.WTF) { if(!pass) throw new Error('unrecognized ' + y[0] + ' in fills'); } } }); } /* 18.8.23 fonts CT_Fonts */ function parse_fonts(t, styles, themes, opts) { styles.Fonts = []; var font = {}; var pass = false; (t[0].match(tagregex)||[]).forEach(function(x) { var y = parsexmltag(x); switch(strip_ns(y[0])) { case '<fonts': case '<fonts>': case '</fonts>': break; /* 18.8.22 font CT_Font */ case '<font': case '<font>': break; case '</font>': case '<font/>': styles.Fonts.push(font); font = {}; break; /* 18.8.29 name CT_FontName */ case '<name': if(y.val) font.name = utf8read(y.val); break; case '<name/>': case '</name>': break; /* 18.8.2 b CT_BooleanProperty */ case '<b': font.bold = y.val ? parsexmlbool(y.val) : 1; break; case '<b/>': font.bold = 1; break; /* 18.8.26 i CT_BooleanProperty */ case '<i': font.italic = y.val ? parsexmlbool(y.val) : 1; break; case '<i/>': font.italic = 1; break; /* 18.4.13 u CT_UnderlineProperty */ case '<u': switch(y.val) { case "none": font.underline = 0x00; break; case "single": font.underline = 0x01; break; case "double": font.underline = 0x02; break; case "singleAccounting": font.underline = 0x21; break; case "doubleAccounting": font.underline = 0x22; break; } break; case '<u/>': font.underline = 1; break; /* 18.4.10 strike CT_BooleanProperty */ case '<strike': font.strike = y.val ? parsexmlbool(y.val) : 1; break; case '<strike/>': font.strike = 1; break; /* 18.4.2 outline CT_BooleanProperty */ case '<outline': font.outline = y.val ? parsexmlbool(y.val) : 1; break; case '<outline/>': font.outline = 1; break; /* 18.8.36 shadow CT_BooleanProperty */ case '<shadow': font.shadow = y.val ? parsexmlbool(y.val) : 1; break; case '<shadow/>': font.shadow = 1; break; /* 18.8.12 condense CT_BooleanProperty */ case '<condense': font.condense = y.val ? parsexmlbool(y.val) : 1; break; case '<condense/>': font.condense = 1; break; /* 18.8.17 extend CT_BooleanProperty */ case '<extend': font.extend = y.val ? parsexmlbool(y.val) : 1; break; case '<extend/>': font.extend = 1; break; /* 18.4.11 sz CT_FontSize */ case '<sz': if(y.val) font.sz = +y.val; break; case '<sz/>': case '</sz>': break; /* 18.4.14 vertAlign CT_VerticalAlignFontProperty */ case '<vertAlign': if(y.val) font.vertAlign = y.val; break; case '<vertAlign/>': case '</vertAlign>': break; /* 18.8.18 family CT_FontFamily */ case '<family': if(y.val) font.family = parseInt(y.val,10); break; case '<family/>': case '</family>': break; /* 18.8.35 scheme CT_FontScheme */ case '<scheme': if(y.val) font.scheme = y.val; break; case '<scheme/>': case '</scheme>': break; /* 18.4.1 charset CT_IntProperty */ case '<charset': if(y.val == '1') break; y.codepage = CS2CP[parseInt(y.val, 10)]; break; /* 18.?.? color CT_Color */ case '<color': if(!font.color) font.color = {}; if(y.auto) font.color.auto = parsexmlbool(y.auto); if(y.rgb) font.color.rgb = y.rgb.slice(-6); else if(y.indexed) { font.color.index = parseInt(y.indexed, 10); var icv = XLSIcv[font.color.index]; if(font.color.index == 81) icv = XLSIcv[1]; if(!icv) icv = XLSIcv[1]; //throw new Error(x); // note: 206 is valid font.color.rgb = icv[0].toString(16) + icv[1].toString(16) + icv[2].toString(16); } else if(y.theme) { font.color.theme = parseInt(y.theme, 10); if(y.tint) font.color.tint = parseFloat(y.tint); if(y.theme && themes.themeElements && themes.themeElements.clrScheme) { font.color.rgb = rgb_tint(themes.themeElements.clrScheme[font.color.theme].rgb, font.color.tint || 0); } } break; case '<color/>': case '</color>': break; /* note: sometimes mc:AlternateContent appears bare */ case '<AlternateContent': pass = true; break; case '</AlternateContent>': pass = false; break; /* 18.2.10 extLst CT_ExtensionList ? */ case '<extLst': case '<extLst>': case '</extLst>': break; case '<ext': pass = true; break; case '</ext>': pass = false; break; default: if(opts && opts.WTF) { if(!pass) throw new Error('unrecognized ' + y[0] + ' in fonts'); } } }); } /* 18.8.31 numFmts CT_NumFmts */ function parse_numFmts(t, styles, opts) { styles.NumberFmt = []; var k/*Array<number>*/ = (keys(table_fmt)/*:any*/); for(var i=0; i < k.length; ++i) styles.NumberFmt[k[i]] = table_fmt[k[i]]; var m = t[0].match(tagregex); if(!m) return; for(i=0; i < m.length; ++i) { var y = parsexmltag(m[i]); switch(strip_ns(y[0])) { case '<numFmts': case '</numFmts>': case '<numFmts/>': case '<numFmts>': break; case '<numFmt': { var f=unescapexml(utf8read(y.formatCode)), j=parseInt(y.numFmtId,10); styles.NumberFmt[j] = f; if(j>0) { if(j > 0x188) { for(j = 0x188; j > 0x3c; --j) if(styles.NumberFmt[j] == null) break; styles.NumberFmt[j] = f; } SSF_load(f,j); } } break; case '</numFmt>': break; default: if(opts.WTF) throw new Error('unrecognized ' + y[0] + ' in numFmts'); } } } function write_numFmts(NF/*:{[n:number|string]:string}*//*::, opts*/) { var o = ["<numFmts>"]; [[5,8],[23,26],[41,44],[/*63*/50,/*66],[164,*/392]].forEach(function(r) { for(var i = r[0]; i <= r[1]; ++i) if(NF[i] != null) o[o.length] = (writextag('numFmt',null,{numFmtId:i,formatCode:escapexml(NF[i])})); }); if(o.length === 1) return ""; o[o.length] = ("</numFmts>"); o[0] = writextag('numFmts', null, { count:o.length-2 }).replace("/>", ">"); return o.join(""); } /* 18.8.10 cellXfs CT_CellXfs */ var cellXF_uint = [ "numFmtId", "fillId", "fontId", "borderId", "xfId" ]; var cellXF_bool = [ "applyAlignment", "applyBorder", "applyFill", "applyFont", "applyNumberFormat", "applyProtection", "pivotButton", "quotePrefix" ]; function parse_cellXfs(t, styles, opts) { styles.CellXf = []; var xf; var pass = false; (t[0].match(tagregex)||[]).forEach(function(x) { var y = parsexmltag(x), i = 0; switch(strip_ns(y[0])) { case '<cellXfs': case '<cellXfs>': case '<cellXfs/>': case '</cellXfs>': break; /* 18.8.45 xf CT_Xf */ case '<xf': case '<xf/>': xf = y; delete xf[0]; for(i = 0; i < cellXF_uint.length; ++i) if(xf[cellXF_uint[i]]) xf[cellXF_uint[i]] = parseInt(xf[cellXF_uint[i]], 10); for(i = 0; i < cellXF_bool.length; ++i) if(xf[cellXF_bool[i]]) xf[cellXF_bool[i]] = parsexmlbool(xf[cellXF_bool[i]]); if(styles.NumberFmt && xf.numFmtId > 0x188) { for(i = 0x188; i > 0x3c; --i) if(styles.NumberFmt[xf.numFmtId] == styles.NumberFmt[i]) { xf.numFmtId = i; break; } } styles.CellXf.push(xf); break; case '</xf>': break; /* 18.8.1 alignment CT_CellAlignment */ case '<alignment': case '<alignment/>': var alignment = {}; if(y.vertical) alignment.vertical = y.vertical; if(y.horizontal) alignment.horizontal = y.horizontal; if(y.textRotation != null) alignment.textRotation = y.textRotation; if(y.indent) alignment.indent = y.indent; if(y.wrapText) alignment.wrapText = parsexmlbool(y.wrapText); xf.alignment = alignment; break; case '</alignment>': break; /* 18.8.33 protection CT_CellProtection */ case '<protection': break; case '</protection>': case '<protection/>': break; /* note: sometimes mc:AlternateContent appears bare */ case '<AlternateContent': pass = true; break; case '</AlternateContent>': pass = false; break; /* 18.2.10 extLst CT_ExtensionList ? */ case '<extLst': case '<extLst>': case '</extLst>': break; case '<ext': pass = true; break; case '</ext>': pass = false; break; default: if(opts && opts.WTF) { if(!pass) throw new Error('unrecognized ' + y[0] + ' in cellXfs'); } } }); } function write_cellXfs(cellXfs)/*:string*/ { var o/*:Array<string>*/ = []; o[o.length] = (writextag('cellXfs',null)); cellXfs.forEach(function(c) { o[o.length] = (writextag('xf', null, c)); }); o[o.length] = ("</cellXfs>"); if(o.length === 2) return ""; o[0] = writextag('cellXfs',null, {count:o.length-2}).replace("/>",">"); return o.join(""); } /* 18.8 Styles CT_Stylesheet*/ var parse_sty_xml= /*#__PURE__*/(function make_pstyx() { var numFmtRegex = /<(?:\w+:)?numFmts([^>]*)>[\S\s]*?<\/(?:\w+:)?numFmts>/; var cellXfRegex = /<(?:\w+:)?cellXfs([^>]*)>[\S\s]*?<\/(?:\w+:)?cellXfs>/; var fillsRegex = /<(?:\w+:)?fills([^>]*)>[\S\s]*?<\/(?:\w+:)?fills>/; var fontsRegex = /<(?:\w+:)?fonts([^>]*)>[\S\s]*?<\/(?:\w+:)?fonts>/; var bordersRegex = /<(?:\w+:)?borders([^>]*)>[\S\s]*?<\/(?:\w+:)?borders>/; return function parse_sty_xml(data, themes, opts) { var styles = {}; if(!data) return styles; data = data.replace(/<!--([\s\S]*?)-->/mg,"").replace(/<!DOCTYPE[^\[]*\[[^\]]*\]>/gm,""); /* 18.8.39 styleSheet CT_Stylesheet */ var t; /* 18.8.31 numFmts CT_NumFmts ? */ if((t=data.match(numFmtRegex))) parse_numFmts(t, styles, opts); /* 18.8.23 fonts CT_Fonts ? */ if((t=data.match(fontsRegex))) parse_fonts(t, styles, themes, opts); /* 18.8.21 fills CT_Fills ? */ if((t=data.match(fillsRegex))) parse_fills(t, styles, themes, opts); /* 18.8.5 borders CT_Borders ? */ if((t=data.match(bordersRegex))) parse_borders(t, styles, themes, opts); /* 18.8.9 cellStyleXfs CT_CellStyleXfs ? */ /* 18.8.8 cellStyles CT_CellStyles ? */ /* 18.8.10 cellXfs CT_CellXfs ? */ if((t=data.match(cellXfRegex))) parse_cellXfs(t, styles, opts); /* 18.8.15 dxfs CT_Dxfs ? */ /* 18.8.42 tableStyles CT_TableStyles ? */ /* 18.8.11 colors CT_Colors ? */ /* 18.2.10 extLst CT_ExtensionList ? */ return styles; }; })(); function write_sty_xml(wb/*:Workbook*/, opts)/*:string*/ { var o = [XML_HEADER, writextag('styleSheet', null, { 'xmlns': XMLNS_main[0], 'xmlns:vt': XMLNS.vt })], w; if(wb.SSF && (w = write_numFmts(wb.SSF)) != null) o[o.length] = w; o[o.length] = ('<fonts count="1"><font><sz val="12"/><color theme="1"/><name val="Calibri"/><family val="2"/><scheme val="minor"/></font></fonts>'); o[o.length] = ('<fills count="2"><fill><patternFill patternType="none"/></fill><fill><patternFill patternType="gray125"/></fill></fills>'); o[o.length] = ('<borders count="1"><border><left/><right/><top/><bottom/><diagonal/></border></borders>'); o[o.length] = ('<cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs>'); if((w = write_cellXfs(opts.cellXfs))) o[o.length] = (w); o[o.length] = ('<cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles>'); o[o.length] = ('<dxfs count="0"/>'); o[o.length] = ('<tableStyles count="0" defaultTableStyle="TableStyleMedium9" defaultPivotStyle="PivotStyleMedium4"/>'); if(o.length>2){ o[o.length] = ('</styleSheet>'); o[1]=o[1].replace("/>",">"); } return o.join(""); } /* [MS-XLSB] 2.4.657 BrtFmt */ function parse_BrtFmt(data, length/*:number*/) { var numFmtId = data.read_shift(2); var stFmtCode = parse_XLWideString(data,length-2); return [numFmtId, stFmtCode]; } function write_BrtFmt(i/*:number*/, f/*:string*/, o) { if(!o) o = new_buf(6 + 4 * f.length); o.write_shift(2, i); write_XLWideString(f, o); var out = (o.length > o.l) ? o.slice(0, o.l) : o; if(o.l == null) o.l = o.length; return out; } /* [MS-XLSB] 2.4.659 BrtFont TODO */ function parse_BrtFont(data, length/*:number*/, opts) { var out = ({}/*:any*/); out.sz = data.read_shift(2) / 20; var grbit = parse_FontFlags(data, 2, opts); if(grbit.fItalic) out.italic = 1; if(grbit.fCondense) out.condense = 1; if(grbit.fExtend) out.extend = 1; if(grbit.fShadow) out.shadow = 1; if(grbit.fOutline) out.outline = 1; if(grbit.fStrikeout) out.strike = 1; var bls = data.read_shift(2); if(bls === 0x02BC) out.bold = 1; switch(data.read_shift(2)) { /* case 0: out.vertAlign = "baseline"; break; */ case 1: out.vertAlign = "superscript"; break; case 2: out.vertAlign = "subscript"; break; } var underline = data.read_shift(1); if(underline != 0) out.underline = underline; var family = data.read_shift(1); if(family > 0) out.family = family; var bCharSet = data.read_shift(1); if(bCharSet > 0) out.charset = bCharSet; data.l++; out.color = parse_BrtColor(data, 8); switch(data.read_shift(1)) { /* case 0: out.scheme = "none": break; */ case 1: out.scheme = "major"; break; case 2: out.scheme = "minor"; break; } out.name = parse_XLWideString(data, length - 21); return out; } function write_BrtFont(font/*:any*/, o) { if(!o) o = new_buf(25+4*32); o.write_shift(2, font.sz * 20); write_FontFlags(font, o); o.write_shift(2, font.bold ? 0x02BC : 0x0190); var sss = 0; if(font.vertAlign == "superscript") sss = 1; else if(font.vertAlign == "subscript") sss = 2; o.write_shift(2, sss); o.write_shift(1, font.underline || 0); o.write_shift(1, font.family || 0); o.write_shift(1, font.charset || 0); o.write_shift(1, 0); write_BrtColor(font.color, o); var scheme = 0; if(font.scheme == "major") scheme = 1; if(font.scheme == "minor") scheme = 2; o.write_shift(1, scheme); write_XLWideString(font.name, o); return o.length > o.l ? o.slice(0, o.l) : o; } /* [MS-XLSB] 2.4.650 BrtFill */ var XLSBFillPTNames = [ "none", "solid", "mediumGray", "darkGray", "lightGray", "darkHorizontal", "darkVertical", "darkDown", "darkUp", "darkGrid", "darkTrellis", "lightHorizontal", "lightVertical", "lightDown", "lightUp", "lightGrid", "lightTrellis", "gray125", "gray0625" ]; var rev_XLSBFillPTNames/*:EvertNumType*/; /* TODO: gradient fill representation */ var parse_BrtFill = parsenoop; function write_BrtFill(fill, o) { if(!o) o = new_buf(4*3 + 8*7 + 16*1); if(!rev_XLSBFillPTNames) rev_XLSBFillPTNames = (evert(XLSBFillPTNames)/*:any*/); var fls/*:number*/ = rev_XLSBFillPTNames[fill.patternType]; if(fls == null) fls = 0x28; o.write_shift(4, fls); var j = 0; if(fls != 0x28) { /* TODO: custom FG Color */ write_BrtColor({auto:1}, o); /* TODO: custom BG Color */ write_BrtColor({auto:1}, o); for(; j < 12; ++j) o.write_shift(4, 0); } else { for(; j < 4; ++j) o.write_shift(4, 0); for(; j < 12; ++j) o.write_shift(4, 0); /* TODO */ /* iGradientType */ /* xnumDegree */ /* xnumFillToLeft */ /* xnumFillToRight */ /* xnumFillToTop */ /* xnumFillToBottom */ /* cNumStop */ /* xfillGradientStop */ } return o.length > o.l ? o.slice(0, o.l) : o; } /* [MS-XLSB] 2.4.824 BrtXF */ function parse_BrtXF(data, length/*:number*/) { var tgt = data.l + length; var ixfeParent = data.read_shift(2); var ifmt = data.read_shift(2); data.l = tgt; return {ixfe:ixfeParent, numFmtId:ifmt }; } function write_BrtXF(data, ixfeP, o) { if(!o) o = new_buf(16); o.write_shift(2, ixfeP||0); o.write_shift(2, data.numFmtId||0); o.write_shift(2, 0); /* iFont */ o.write_shift(2, 0); /* iFill */ o.write_shift(2, 0); /* ixBorder */ o.write_shift(1, 0); /* trot */ o.write_shift(1, 0); /* indent */ var flow = 0; o.write_shift(1, flow); /* flags */ o.write_shift(1, 0); /* flags */ o.write_shift(1, 0); /* xfGrbitAtr */ o.write_shift(1, 0); return o; } /* [MS-XLSB] 2.5.4 Blxf TODO */ function write_Blxf(data, o) { if(!o) o = new_buf(10); o.write_shift(1, 0); /* dg */ o.write_shift(1, 0); o.write_shift(4, 0); /* color */ o.write_shift(4, 0); /* color */ return o; } /* [MS-XLSB] 2.4.302 BrtBorder TODO */ var parse_BrtBorder = parsenoop; function write_BrtBorder(border, o) { if(!o) o = new_buf(51); o.write_shift(1, 0); /* diagonal */ write_Blxf(null, o); /* top */ write_Blxf(null, o); /* bottom */ write_Blxf(null, o); /* left */ write_Blxf(null, o); /* right */ write_Blxf(null, o); /* diag */ return o.length > o.l ? o.slice(0, o.l) : o; } /* [MS-XLSB] 2.4.763 BrtStyle TODO */ function write_BrtStyle(style, o) { if(!o) o = new_buf(12+4*10); o.write_shift(4, style.xfId); o.write_shift(2, 1); o.write_shift(1, +style.builtinId); o.write_shift(1, 0); /* iLevel */ write_XLNullableWideString(style.name || "", o); return o.length > o.l ? o.slice(0, o.l) : o; } /* [MS-XLSB] 2.4.272 BrtBeginTableStyles */ function write_BrtBeginTableStyles(cnt, defTableStyle, defPivotStyle) { var o = new_buf(4+256*2*4); o.write_shift(4, cnt); write_XLNullableWideString(defTableStyle, o); write_XLNullableWideString(defPivotStyle, o); return o.length > o.l ? o.slice(0, o.l) : o; } /* [MS-XLSB] 2.1.7.50 Styles */ function parse_sty_bin(data, themes, opts) { var styles = {}; styles.NumberFmt = ([]/*:any*/); for(var y in table_fmt) styles.NumberFmt[y] = table_fmt[y]; styles.CellXf = []; styles.Fonts = []; var state/*:Array<string>*/ = []; var pass = false; recordhopper(data, function hopper_sty(val, R, RT) { switch(RT) { case 0x002C: /* BrtFmt */ styles.NumberFmt[val[0]] = val[1]; SSF_load(val[1], val[0]); break; case 0x002B: /* BrtFont */ styles.Fonts.push(val); if(val.color.theme != null && themes && themes.themeElements && themes.themeElements.clrScheme) { val.color.rgb = rgb_tint(themes.themeElements.clrScheme[val.color.theme].rgb, val.color.tint || 0); } break; case 0x0401: /* BrtKnownFonts */ break; case 0x002D: /* BrtFill */ break; case 0x002E: /* BrtBorder */ break; case 0x002F: /* BrtXF */ if(state[state.length - 1] == 0x0269 /* BrtBeginCellXFs */) { styles.CellXf.push(val); } break; case 0x0030: /* BrtStyle */ case 0x01FB: /* BrtDXF */ case 0x023C: /* BrtMRUColor */ case 0x01DB: /* BrtIndexedColor */ break; case 0x0493: /* BrtDXF14 */ case 0x0836: /* BrtDXF15 */ case 0x046A: /* BrtSlicerStyleElement */ case 0x0200: /* BrtTableStyleElement */ case 0x082F: /* BrtTimelineStyleElement */ case 0x0C00: /* BrtUid */ break; case 0x0023: /* BrtFRTBegin */ pass = true; break; case 0x0024: /* BrtFRTEnd */ pass = false; break; case 0x0025: /* BrtACBegin */ state.push(RT); pass = true; break; case 0x0026: /* BrtACEnd */ state.pop(); pass = false; break; default: if(R.T > 0) state.push(RT); else if(R.T < 0) state.pop(); else if(!pass || (opts.WTF && state[state.length-1] != 0x0025 /* BrtACBegin */)) throw new Error("Unexpected record 0x" + RT.toString(16)); } }); return styles; } function write_FMTS_bin(ba, NF/*:?SSFTable*/) { if(!NF) return; var cnt = 0; [[5,8],[23,26],[41,44],[/*63*/50,/*66],[164,*/392]].forEach(function(r) { /*:: if(!NF) return; */ for(var i = r[0]; i <= r[1]; ++i) if(NF[i] != null) ++cnt; }); if(cnt == 0) return; write_record(ba, 0x0267 /* BrtBeginFmts */, write_UInt32LE(cnt)); [[5,8],[23,26],[41,44],[/*63*/50,/*66],[164,*/392]].forEach(function(r) { /*:: if(!NF) return; */ for(var i = r[0]; i <= r[1]; ++i) if(NF[i] != null) write_record(ba, 0x002C /* BrtFmt */, write_BrtFmt(i, NF[i])); }); write_record(ba, 0x0268 /* BrtEndFmts */); } function write_FONTS_bin(ba/*::, data*/) { var cnt = 1; if(cnt == 0) return; write_record(ba, 0x0263 /* BrtBeginFonts */, write_UInt32LE(cnt)); write_record(ba, 0x002B /* BrtFont */, write_BrtFont({ sz:12, color: {theme:1}, name: "Calibri", family: 2, scheme: "minor" })); /* 1*65491BrtFont [ACFONTS] */ write_record(ba, 0x0264 /* BrtEndFonts */); } function write_FILLS_bin(ba/*::, data*/) { var cnt = 2; if(cnt == 0) return; write_record(ba, 0x025B /* BrtBeginFills */, write_UInt32LE(cnt)); write_record(ba, 0x002D /* BrtFill */, write_BrtFill({patternType:"none"})); write_record(ba, 0x002D /* BrtFill */, write_BrtFill({patternType:"gray125"})); /* 1*65431BrtFill */ write_record(ba, 0x025C /* BrtEndFills */); } function write_BORDERS_bin(ba/*::, data*/) { var cnt = 1; if(cnt == 0) return; write_record(ba, 0x0265 /* BrtBeginBorders */, write_UInt32LE(cnt)); write_record(ba, 0x002E /* BrtBorder */, write_BrtBorder({})); /* 1*65430BrtBorder */ write_record(ba, 0x0266 /* BrtEndBorders */); } function write_CELLSTYLEXFS_bin(ba/*::, data*/) { var cnt = 1; write_record(ba, 0x0272 /* BrtBeginCellStyleXFs */, write_UInt32LE(cnt)); write_record(ba, 0x002F /* BrtXF */, write_BrtXF({ numFmtId: 0, fontId: 0, fillId: 0, borderId: 0 }, 0xFFFF)); /* 1*65430(BrtXF *FRT) */ write_record(ba, 0x0273 /* BrtEndCellStyleXFs */); } function write_CELLXFS_bin(ba, data) { write_record(ba, 0x0269 /* BrtBeginCellXFs */, write_UInt32LE(data.length)); data.forEach(function(c) { write_record(ba, 0x002F /* BrtXF */, write_BrtXF(c,0)); }); /* 1*65430(BrtXF *FRT) */ write_record(ba, 0x026A /* BrtEndCellXFs */); } function write_STYLES_bin(ba/*::, data*/) { var cnt = 1; write_record(ba, 0x026B /* BrtBeginStyles */, write_UInt32LE(cnt)); write_record(ba, 0x0030 /* BrtStyle */, write_BrtStyle({ xfId:0, builtinId:0, name:"Normal" })); /* 1*65430(BrtStyle *FRT) */ write_record(ba, 0x026C /* BrtEndStyles */); } function write_DXFS_bin(ba/*::, data*/) { var cnt = 0; write_record(ba, 0x01F9 /* BrtBeginDXFs */, write_UInt32LE(cnt)); /* *2147483647(BrtDXF *FRT) */ write_record(ba, 0x01FA /* BrtEndDXFs */); } function write_TABLESTYLES_bin(ba/*::, data*/) { var cnt = 0; write_record(ba, 0x01FC /* BrtBeginTableStyles */, write_BrtBeginTableStyles(cnt, "TableStyleMedium9", "PivotStyleMedium4")); /* *TABLESTYLE */ write_record(ba, 0x01FD /* BrtEndTableStyles */); } function write_COLORPALETTE_bin(/*::ba, data*/) { return; /* BrtBeginColorPalette [INDEXEDCOLORS] [MRUCOLORS] BrtEndColorPalette */ } /* [MS-XLSB] 2.1.7.50 Styles */ function write_sty_bin(wb, opts) { var ba = buf_array(); write_record(ba, 0x0116 /* BrtBeginStyleSheet */); write_FMTS_bin(ba, wb.SSF); write_FONTS_bin(ba, wb); write_FILLS_bin(ba, wb); write_BORDERS_bin(ba, wb); write_CELLSTYLEXFS_bin(ba, wb); write_CELLXFS_bin(ba, opts.cellXfs); write_STYLES_bin(ba, wb); write_DXFS_bin(ba, wb); write_TABLESTYLES_bin(ba, wb); write_COLORPALETTE_bin(ba, wb); /* FRTSTYLESHEET*/ write_record(ba, 0x0117 /* BrtEndStyleSheet */); return ba.end(); } /* Even though theme layout is dk1 lt1 dk2 lt2, true order is lt1 dk1 lt2 dk2 */ var XLSXThemeClrScheme = [ '</a:lt1>', '</a:dk1>', '</a:lt2>', '</a:dk2>', '</a:accent1>', '</a:accent2>', '</a:accent3>', '</a:accent4>', '</a:accent5>', '</a:accent6>', '</a:hlink>', '</a:folHlink>' ]; /* 20.1.6.2 clrScheme CT_ColorScheme */ function parse_clrScheme(t, themes, opts) { themes.themeElements.clrScheme = []; var color = {}; (t[0].match(tagregex)||[]).forEach(function(x) { var y = parsexmltag(x); switch(y[0]) { /* 20.1.6.2 clrScheme (Color Scheme) CT_ColorScheme */ case '<a:clrScheme': case '</a:clrScheme>': break; /* 20.1.2.3.32 srgbClr CT_SRgbColor */ case '<a:srgbClr': color.rgb = y.val; break; /* 20.1.2.3.33 sysClr CT_SystemColor */ case '<a:sysClr': color.rgb = y.lastClr; break; /* 20.1.4.1.1 accent1 (Accent 1) */ /* 20.1.4.1.2 accent2 (Accent 2) */ /* 20.1.4.1.3 accent3 (Accent 3) */ /* 20.1.4.1.4 accent4 (Accent 4) */ /* 20.1.4.1.5 accent5 (Accent 5) */ /* 20.1.4.1.6 accent6 (Accent 6) */ /* 20.1.4.1.9 dk1 (Dark 1) */ /* 20.1.4.1.10 dk2 (Dark 2) */ /* 20.1.4.1.15 folHlink (Followed Hyperlink) */ /* 20.1.4.1.19 hlink (Hyperlink) */ /* 20.1.4.1.22 lt1 (Light 1) */ /* 20.1.4.1.23 lt2 (Light 2) */ case '<a:dk1>': case '</a:dk1>': case '<a:lt1>': case '</a:lt1>': case '<a:dk2>': case '</a:dk2>': case '<a:lt2>': case '</a:lt2>': case '<a:accent1>': case '</a:accent1>': case '<a:accent2>': case '</a:accent2>': case '<a:accent3>': case '</a:accent3>': case '<a:accent4>': case '</a:accent4>': case '<a:accent5>': case '</a:accent5>': case '<a:accent6>': case '</a:accent6>': case '<a:hlink>': case '</a:hlink>': case '<a:folHlink>': case '</a:folHlink>': if (y[0].charAt(1) === '/') { themes.themeElements.clrScheme[XLSXThemeClrScheme.indexOf(y[0])] = color; color = {}; } else { color.name = y[0].slice(3, y[0].length - 1); } break; default: if(opts && opts.WTF) throw new Error('Unrecognized ' + y[0] + ' in clrScheme'); } }); } /* 20.1.4.1.18 fontScheme CT_FontScheme */ function parse_fontScheme(/*::t, themes, opts*/) { } /* 20.1.4.1.15 fmtScheme CT_StyleMatrix */ function parse_fmtScheme(/*::t, themes, opts*/) { } var clrsregex = /<a:clrScheme([^>]*)>[\s\S]*<\/a:clrScheme>/; var fntsregex = /<a:fontScheme([^>]*)>[\s\S]*<\/a:fontScheme>/; var fmtsregex = /<a:fmtScheme([^>]*)>[\s\S]*<\/a:fmtScheme>/; /* 20.1.6.10 themeElements CT_BaseStyles */ function parse_themeElements(data, themes, opts) { themes.themeElements = {}; var t; [ /* clrScheme CT_ColorScheme */ ['clrScheme', clrsregex, parse_clrScheme], /* fontScheme CT_FontScheme */ ['fontScheme', fntsregex, parse_fontScheme], /* fmtScheme CT_StyleMatrix */ ['fmtScheme', fmtsregex, parse_fmtScheme] ].forEach(function(m) { if(!(t=data.match(m[1]))) throw new Error(m[0] + ' not found in themeElements'); m[2](t, themes, opts); }); } var themeltregex = /<a:themeElements([^>]*)>[\s\S]*<\/a:themeElements>/; /* 14.2.7 Theme Part */ function parse_theme_xml(data/*:string*/, opts) { /* 20.1.6.9 theme CT_OfficeStyleSheet */ if(!data || data.length === 0) data = write_theme(); var t; var themes = {}; /* themeElements CT_BaseStyles */ if(!(t=data.match(themeltregex))) throw new Error('themeElements not found in theme'); parse_themeElements(t[0], themes, opts); themes.raw = data; return themes; } function write_theme(Themes, opts)/*:string*/ { if(opts && opts.themeXLSX) return opts.themeXLSX; if(Themes && typeof Themes.raw == "string") return Themes.raw; var o = [XML_HEADER]; o[o.length] = '<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme">'; o[o.length] = '<a:themeElements>'; o[o.length] = '<a:clrScheme name="Office">'; o[o.length] = '<a:dk1><a:sysClr val="windowText" lastClr="000000"/></a:dk1>'; o[o.length] = '<a:lt1><a:sysClr val="window" lastClr="FFFFFF"/></a:lt1>'; o[o.length] = '<a:dk2><a:srgbClr val="1F497D"/></a:dk2>'; o[o.length] = '<a:lt2><a:srgbClr val="EEECE1"/></a:lt2>'; o[o.length] = '<a:accent1><a:srgbClr val="4F81BD"/></a:accent1>'; o[o.length] = '<a:accent2><a:srgbClr val="C0504D"/></a:accent2>'; o[o.length] = '<a:accent3><a:srgbClr val="9BBB59"/></a:accent3>'; o[o.length] = '<a:accent4><a:srgbClr val="8064A2"/></a:accent4>'; o[o.length] = '<a:accent5><a:srgbClr val="4BACC6"/></a:accent5>'; o[o.length] = '<a:accent6><a:srgbClr val="F79646"/></a:accent6>'; o[o.length] = '<a:hlink><a:srgbClr val="0000FF"/></a:hlink>'; o[o.length] = '<a:folHlink><a:srgbClr val="800080"/></a:folHlink>'; o[o.length] = '</a:clrScheme>'; o[o.length] = '<a:fontScheme name="Office">'; o[o.length] = '<a:majorFont>'; o[o.length] = '<a:latin typeface="Cambria"/>'; o[o.length] = '<a:ea typeface=""/>'; o[o.length] = '<a:cs typeface=""/>'; o[o.length] = '<a:font script="Jpan" typeface="MS Pゴシック"/>'; o[o.length] = '<a:font script="Hang" typeface="맑은 고딕"/>'; o[o.length] = '<a:font script="Hans" typeface="宋体"/>'; o[o.length] = '<a:font script="Hant" typeface="新細明體"/>'; o[o.length] = '<a:font script="Arab" typeface="Times New Roman"/>'; o[o.length] = '<a:font script="Hebr" typeface="Times New Roman"/>'; o[o.length] = '<a:font script="Thai" typeface="Tahoma"/>'; o[o.length] = '<a:font script="Ethi" typeface="Nyala"/>'; o[o.length] = '<a:font script="Beng" typeface="Vrinda"/>'; o[o.length] = '<a:font script="Gujr" typeface="Shruti"/>'; o[o.length] = '<a:font script="Khmr" typeface="MoolBoran"/>'; o[o.length] = '<a:font script="Knda" typeface="Tunga"/>'; o[o.length] = '<a:font script="Guru" typeface="Raavi"/>'; o[o.length] = '<a:font script="Cans" typeface="Euphemia"/>'; o[o.length] = '<a:font script="Cher" typeface="Plantagenet Cherokee"/>'; o[o.length] = '<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>'; o[o.length] = '<a:font script="Tibt" typeface="Microsoft Himalaya"/>'; o[o.length] = '<a:font script="Thaa" typeface="MV Boli"/>'; o[o.length] = '<a:font script="Deva" typeface="Mangal"/>'; o[o.length] = '<a:font script="Telu" typeface="Gautami"/>'; o[o.length] = '<a:font script="Taml" typeface="Latha"/>'; o[o.length] = '<a:font script="Syrc" typeface="Estrangelo Edessa"/>'; o[o.length] = '<a:font script="Orya" typeface="Kalinga"/>'; o[o.length] = '<a:font script="Mlym" typeface="Kartika"/>'; o[o.length] = '<a:font script="Laoo" typeface="DokChampa"/>'; o[o.length] = '<a:font script="Sinh" typeface="Iskoola Pota"/>'; o[o.length] = '<a:font script="Mong" typeface="Mongolian Baiti"/>'; o[o.length] = '<a:font script="Viet" typeface="Times New Roman"/>'; o[o.length] = '<a:font script="Uigh" typeface="Microsoft Uighur"/>'; o[o.length] = '<a:font script="Geor" typeface="Sylfaen"/>'; o[o.length] = '</a:majorFont>'; o[o.length] = '<a:minorFont>'; o[o.length] = '<a:latin typeface="Calibri"/>'; o[o.length] = '<a:ea typeface=""/>'; o[o.length] = '<a:cs typeface=""/>'; o[o.length] = '<a:font script="Jpan" typeface="MS Pゴシック"/>'; o[o.length] = '<a:font script="Hang" typeface="맑은 고딕"/>'; o[o.length] = '<a:font script="Hans" typeface="宋体"/>'; o[o.length] = '<a:font script="Hant" typeface="新細明體"/>'; o[o.length] = '<a:font script="Arab" typeface="Arial"/>'; o[o.length] = '<a:font script="Hebr" typeface="Arial"/>'; o[o.length] = '<a:font script="Thai" typeface="Tahoma"/>'; o[o.length] = '<a:font script="Ethi" typeface="Nyala"/>'; o[o.length] = '<a:font script="Beng" typeface="Vrinda"/>'; o[o.length] = '<a:font script="Gujr" typeface="Shruti"/>'; o[o.length] = '<a:font script="Khmr" typeface="DaunPenh"/>'; o[o.length] = '<a:font script="Knda" typeface="Tunga"/>'; o[o.length] = '<a:font script="Guru" typeface="Raavi"/>'; o[o.length] = '<a:font script="Cans" typeface="Euphemia"/>'; o[o.length] = '<a:font script="Cher" typeface="Plantagenet Cherokee"/>'; o[o.length] = '<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>'; o[o.length] = '<a:font script="Tibt" typeface="Microsoft Himalaya"/>'; o[o.length] = '<a:font script="Thaa" typeface="MV Boli"/>'; o[o.length] = '<a:font script="Deva" typeface="Mangal"/>'; o[o.length] = '<a:font script="Telu" typeface="Gautami"/>'; o[o.length] = '<a:font script="Taml" typeface="Latha"/>'; o[o.length] = '<a:font script="Syrc" typeface="Estrangelo Edessa"/>'; o[o.length] = '<a:font script="Orya" typeface="Kalinga"/>'; o[o.length] = '<a:font script="Mlym" typeface="Kartika"/>'; o[o.length] = '<a:font script="Laoo" typeface="DokChampa"/>'; o[o.length] = '<a:font script="Sinh" typeface="Iskoola Pota"/>'; o[o.length] = '<a:font script="Mong" typeface="Mongolian Baiti"/>'; o[o.length] = '<a:font script="Viet" typeface="Arial"/>'; o[o.length] = '<a:font script="Uigh" typeface="Microsoft Uighur"/>'; o[o.length] = '<a:font script="Geor" typeface="Sylfaen"/>'; o[o.length] = '</a:minorFont>'; o[o.length] = '</a:fontScheme>'; o[o.length] = '<a:fmtScheme name="Office">'; o[o.length] = '<a:fillStyleLst>'; o[o.length] = '<a:solidFill><a:schemeClr val="phClr"/></a:solidFill>'; o[o.length] = '<a:gradFill rotWithShape="1">'; o[o.length] = '<a:gsLst>'; o[o.length] = '<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="50000"/><a:satMod val="300000"/></a:schemeClr></a:gs>'; o[o.length] = '<a:gs pos="35000"><a:schemeClr val="phClr"><a:tint val="37000"/><a:satMod val="300000"/></a:schemeClr></a:gs>'; o[o.length] = '<a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="15000"/><a:satMod val="350000"/></a:schemeClr></a:gs>'; o[o.length] = '</a:gsLst>'; o[o.length] = '<a:lin ang="16200000" scaled="1"/>'; o[o.length] = '</a:gradFill>'; o[o.length] = '<a:gradFill rotWithShape="1">'; o[o.length] = '<a:gsLst>'; o[o.length] = '<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="100000"/><a:shade val="100000"/><a:satMod val="130000"/></a:schemeClr></a:gs>'; o[o.length] = '<a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="50000"/><a:shade val="100000"/><a:satMod val="350000"/></a:schemeClr></a:gs>'; o[o.length] = '</a:gsLst>'; o[o.length] = '<a:lin ang="16200000" scaled="0"/>'; o[o.length] = '</a:gradFill>'; o[o.length] = '</a:fillStyleLst>'; o[o.length] = '<a:lnStyleLst>'; o[o.length] = '<a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"><a:shade val="95000"/><a:satMod val="105000"/></a:schemeClr></a:solidFill><a:prstDash val="solid"/></a:ln>'; o[o.length] = '<a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>'; o[o.length] = '<a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>'; o[o.length] = '</a:lnStyleLst>'; o[o.length] = '<a:effectStyleLst>'; o[o.length] = '<a:effectStyle>'; o[o.length] = '<a:effectLst>'; o[o.length] = '<a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="38000"/></a:srgbClr></a:outerShdw>'; o[o.length] = '</a:effectLst>'; o[o.length] = '</a:effectStyle>'; o[o.length] = '<a:effectStyle>'; o[o.length] = '<a:effectLst>'; o[o.length] = '<a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw>'; o[o.length] = '</a:effectLst>'; o[o.length] = '</a:effectStyle>'; o[o.length] = '<a:effectStyle>'; o[o.length] = '<a:effectLst>'; o[o.length] = '<a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw>'; o[o.length] = '</a:effectLst>'; o[o.length] = '<a:scene3d><a:camera prst="orthographicFront"><a:rot lat="0" lon="0" rev="0"/></a:camera><a:lightRig rig="threePt" dir="t"><a:rot lat="0" lon="0" rev="1200000"/></a:lightRig></a:scene3d>'; o[o.length] = '<a:sp3d><a:bevelT w="63500" h="25400"/></a:sp3d>'; o[o.length] = '</a:effectStyle>'; o[o.length] = '</a:effectStyleLst>'; o[o.length] = '<a:bgFillStyleLst>'; o[o.length] = '<a:solidFill><a:schemeClr val="phClr"/></a:solidFill>'; o[o.length] = '<a:gradFill rotWithShape="1">'; o[o.length] = '<a:gsLst>'; o[o.length] = '<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="40000"/><a:satMod val="350000"/></a:schemeClr></a:gs>'; o[o.length] = '<a:gs pos="40000"><a:schemeClr val="phClr"><a:tint val="45000"/><a:shade val="99000"/><a:satMod val="350000"/></a:schemeClr></a:gs>'; o[o.length] = '<a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="20000"/><a:satMod val="255000"/></a:schemeClr></a:gs>'; o[o.length] = '</a:gsLst>'; o[o.length] = '<a:path path="circle"><a:fillToRect l="50000" t="-80000" r="50000" b="180000"/></a:path>'; o[o.length] = '</a:gradFill>'; o[o.length] = '<a:gradFill rotWithShape="1">'; o[o.length] = '<a:gsLst>'; o[o.length] = '<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="80000"/><a:satMod val="300000"/></a:schemeClr></a:gs>'; o[o.length] = '<a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="30000"/><a:satMod val="200000"/></a:schemeClr></a:gs>'; o[o.length] = '</a:gsLst>'; o[o.length] = '<a:path path="circle"><a:fillToRect l="50000" t="50000" r="50000" b="50000"/></a:path>'; o[o.length] = '</a:gradFill>'; o[o.length] = '</a:bgFillStyleLst>'; o[o.length] = '</a:fmtScheme>'; o[o.length] = '</a:themeElements>'; o[o.length] = '<a:objectDefaults>'; o[o.length] = '<a:spDef>'; o[o.length] = '<a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="1"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="3"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="2"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="lt1"/></a:fontRef></a:style>'; o[o.length] = '</a:spDef>'; o[o.length] = '<a:lnDef>'; o[o.length] = '<a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="2"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="0"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="1"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="tx1"/></a:fontRef></a:style>'; o[o.length] = '</a:lnDef>'; o[o.length] = '</a:objectDefaults>'; o[o.length] = '<a:extraClrSchemeLst/>'; o[o.length] = '</a:theme>'; return o.join(""); } /* [MS-XLS] 2.4.326 TODO: payload is a zip file */ function parse_Theme(blob, length, opts) { var end = blob.l + length; var dwThemeVersion = blob.read_shift(4); if(dwThemeVersion === 124226) return; if(!opts.cellStyles) { blob.l = end; return; } var data = blob.slice(blob.l); blob.l = end; var zip; try { zip = zip_read(data, {type: "array"}); } catch(e) { return; } var themeXML = getzipstr(zip, "theme/theme/theme1.xml", true); if(!themeXML) return; return parse_theme_xml(themeXML, opts); } /* 2.5.49 */ function parse_ColorTheme(blob/*::, length*/) { return blob.read_shift(4); } /* 2.5.155 */ function parse_FullColorExt(blob/*::, length*/) { var o = {}; o.xclrType = blob.read_shift(2); o.nTintShade = blob.read_shift(2); switch(o.xclrType) { case 0: blob.l += 4; break; case 1: o.xclrValue = parse_IcvXF(blob, 4); break; case 2: o.xclrValue = parse_LongRGBA(blob, 4); break; case 3: o.xclrValue = parse_ColorTheme(blob, 4); break; case 4: blob.l += 4; break; } blob.l += 8; return o; } /* 2.5.164 TODO: read 7 bits*/ function parse_IcvXF(blob, length) { return parsenoop(blob, length); } /* 2.5.280 */ function parse_XFExtGradient(blob, length) { return parsenoop(blob, length); } /* [MS-XLS] 2.5.108 */ function parse_ExtProp(blob/*::, length*/)/*:Array<any>*/ { var extType = blob.read_shift(2); var cb = blob.read_shift(2) - 4; var o = [extType]; switch(extType) { case 0x04: case 0x05: case 0x07: case 0x08: case 0x09: case 0x0A: case 0x0B: case 0x0D: o[1] = parse_FullColorExt(blob, cb); break; case 0x06: o[1] = parse_XFExtGradient(blob, cb); break; case 0x0E: case 0x0F: o[1] = blob.read_shift(cb === 1 ? 1 : 2); break; default: throw new Error("Unrecognized ExtProp type: " + extType + " " + cb); } return o; } /* 2.4.355 */ function parse_XFExt(blob, length) { var end = blob.l + length; blob.l += 2; var ixfe = blob.read_shift(2); blob.l += 2; var cexts = blob.read_shift(2); var ext/*:AOA*/ = []; while(cexts-- > 0) ext.push(parse_ExtProp(blob, end-blob.l)); return {ixfe:ixfe, ext:ext}; } /* xf is an XF, see parse_XFExt for xfext */ function update_xfext(xf, xfext) { xfext.forEach(function(xfe) { switch(xfe[0]) { /* 2.5.108 extPropData */ case 0x04: break; /* foreground color */ case 0x05: break; /* background color */ case 0x06: break; /* gradient fill */ case 0x07: break; /* top cell border color */ case 0x08: break; /* bottom cell border color */ case 0x09: break; /* left cell border color */ case 0x0a: break; /* right cell border color */ case 0x0b: break; /* diagonal cell border color */ case 0x0d: /* text color */ break; case 0x0e: break; /* font scheme */ case 0x0f: break; /* indentation level */ } }); } function parse_BrtMdtinfo(data, length) { return { flags: data.read_shift(4), version: data.read_shift(4), name: parse_XLWideString(data, length - 8) }; } function write_BrtMdtinfo(data) { var o = new_buf(12 + 2 * data.name.length); o.write_shift(4, data.flags); o.write_shift(4, data.version); write_XLWideString(data.name, o); return o.slice(0, o.l); } function parse_BrtMdb(data) { var out = []; var cnt = data.read_shift(4); while (cnt-- > 0) out.push([data.read_shift(4), data.read_shift(4)]); return out; } function write_BrtMdb(mdb) { var o = new_buf(4 + 8 * mdb.length); o.write_shift(4, mdb.length); for (var i = 0; i < mdb.length; ++i) { o.write_shift(4, mdb[i][0]); o.write_shift(4, mdb[i][1]); } return o; } function write_BrtBeginEsfmd(cnt, name) { var o = new_buf(8 + 2 * name.length); o.write_shift(4, cnt); write_XLWideString(name, o); return o.slice(0, o.l); } function parse_BrtBeginEsmdb(data) { data.l += 4; return data.read_shift(4) != 0; } function write_BrtBeginEsmdb(cnt, cm) { var o = new_buf(8); o.write_shift(4, cnt); o.write_shift(4, cm ? 1 : 0); return o; } function parse_xlmeta_bin(data, name, _opts) { var out = { Types: [], Cell: [], Value: [] }; var opts = _opts || {}; var state = []; var pass = false; var metatype = 2; recordhopper(data, function(val, R, RT) { switch (RT) { case 335: out.Types.push({ name: val.name }); break; case 51: val.forEach(function(r) { if (metatype == 1) out.Cell.push({ type: out.Types[r[0] - 1].name, index: r[1] }); else if (metatype == 0) out.Value.push({ type: out.Types[r[0] - 1].name, index: r[1] }); }); break; case 337: metatype = val ? 1 : 0; break; case 338: metatype = 2; break; case 35: state.push(RT); pass = true; break; case 36: state.pop(); pass = false; break; default: if (R.T) { } else if (!pass || opts.WTF && state[state.length - 1] != 35) throw new Error("Unexpected record 0x" + RT.toString(16)); } }); return out; } function write_xlmeta_bin() { var ba = buf_array(); write_record(ba, 332); write_record(ba, 334, write_UInt32LE(1)); write_record(ba, 335, write_BrtMdtinfo({ name: "XLDAPR", version: 12e4, flags: 3496657072 })); write_record(ba, 336); write_record(ba, 339, write_BrtBeginEsfmd(1, "XLDAPR")); write_record(ba, 52); write_record(ba, 35, write_UInt32LE(514)); write_record(ba, 4096, write_UInt32LE(0)); write_record(ba, 4097, writeuint16(1)); write_record(ba, 36); write_record(ba, 53); write_record(ba, 340); write_record(ba, 337, write_BrtBeginEsmdb(1, true)); write_record(ba, 51, write_BrtMdb([[1, 0]])); write_record(ba, 338); write_record(ba, 333); return ba.end(); } function parse_xlmeta_xml(data, name, opts) { var out = { Types: [], Cell: [], Value: [] }; if (!data) return out; var pass = false; var metatype = 2; var lastmeta; data.replace(tagregex, function(x) { var y = parsexmltag(x); switch (strip_ns(y[0])) { case "<?xml": break; case "<metadata": case "</metadata>": break; case "<metadataTypes": case "</metadataTypes>": break; case "<metadataType": out.Types.push({ name: y.name }); break; case "</metadataType>": break; case "<futureMetadata": for (var j = 0; j < out.Types.length; ++j) if (out.Types[j].name == y.name) lastmeta = out.Types[j]; break; case "</futureMetadata>": break; case "<bk>": break; case "</bk>": break; case "<rc": if (metatype == 1) out.Cell.push({ type: out.Types[y.t - 1].name, index: +y.v }); else if (metatype == 0) out.Value.push({ type: out.Types[y.t - 1].name, index: +y.v }); break; case "</rc>": break; case "<cellMetadata": metatype = 1; break; case "</cellMetadata>": metatype = 2; break; case "<valueMetadata": metatype = 0; break; case "</valueMetadata>": metatype = 2; break; case "<extLst": case "<extLst>": case "</extLst>": case "<extLst/>": break; case "<ext": pass = true; break; case "</ext>": pass = false; break; case "<rvb": if (!lastmeta) break; if (!lastmeta.offsets) lastmeta.offsets = []; lastmeta.offsets.push(+y.i); break; default: if (!pass && opts.WTF) throw new Error("unrecognized " + y[0] + " in metadata"); } return x; }); return out; } function write_xlmeta_xml() { var o = [XML_HEADER]; o.push('<metadata xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:xlrd="http://schemas.microsoft.com/office/spreadsheetml/2017/richdata" xmlns:xda="http://schemas.microsoft.com/office/spreadsheetml/2017/dynamicarray">\n <metadataTypes count="1">\n <metadataType name="XLDAPR" minSupportedVersion="120000" copy="1" pasteAll="1" pasteValues="1" merge="1" splitFirst="1" rowColShift="1" clearFormats="1" clearComments="1" assign="1" coerce="1" cellMeta="1"/>\n </metadataTypes>\n <futureMetadata name="XLDAPR" count="1">\n <bk>\n <extLst>\n <ext uri="{bdbb8cdc-fa1e-496e-a857-3c3f30c029c3}">\n <xda:dynamicArrayProperties fDynamic="1" fCollapsed="0"/>\n </ext>\n </extLst>\n </bk>\n </futureMetadata>\n <cellMetadata count="1">\n <bk>\n <rc t="1" v="0"/>\n </bk>\n </cellMetadata>\n</metadata>'); return o.join(""); } /* 18.6 Calculation Chain */ function parse_cc_xml(data/*::, name, opts*/)/*:Array<any>*/ { var d = []; if(!data) return d; var i = 1; (data.match(tagregex)||[]).forEach(function(x) { var y = parsexmltag(x); switch(y[0]) { case '<?xml': break; /* 18.6.2 calcChain CT_CalcChain 1 */ case '<calcChain': case '<calcChain>': case '</calcChain>': break; /* 18.6.1 c CT_CalcCell 1 */ case '<c': delete y[0]; if(y.i) i = y.i; else y.i = i; d.push(y); break; } }); return d; } //function write_cc_xml(data, opts) { } /* [MS-XLSB] 2.6.4.1 */ function parse_BrtCalcChainItem$(data) { var out = {}; out.i = data.read_shift(4); var cell = {}; cell.r = data.read_shift(4); cell.c = data.read_shift(4); out.r = encode_cell(cell); var flags = data.read_shift(1); if(flags & 0x2) out.l = '1'; if(flags & 0x8) out.a = '1'; return out; } /* 18.6 Calculation Chain */ function parse_cc_bin(data, name, opts) { var out = []; var pass = false; recordhopper(data, function hopper_cc(val, R, RT) { switch(RT) { case 0x003F: /* 'BrtCalcChainItem$' */ out.push(val); break; default: if(R.T){/* empty */} else if(!pass || opts.WTF) throw new Error("Unexpected record 0x" + RT.toString(16)); } }); return out; } //function write_cc_bin(data, opts) { } /* 18.14 Supplementary Workbook Data */ function parse_xlink_xml(/*::data, rel, name:string, _opts*/) { //var opts = _opts || {}; //if(opts.WTF) throw "XLSX External Link"; } /* [MS-XLSB] 2.1.7.25 External Link */ function parse_xlink_bin(data, rel, name/*:string*/, _opts) { if(!data) return data; var opts = _opts || {}; var pass = false, end = false; recordhopper(data, function xlink_parse(val, R, RT) { if(end) return; switch(RT) { case 0x0167: /* 'BrtSupTabs' */ case 0x016B: /* 'BrtExternTableStart' */ case 0x016C: /* 'BrtExternTableEnd' */ case 0x016E: /* 'BrtExternRowHdr' */ case 0x016F: /* 'BrtExternCellBlank' */ case 0x0170: /* 'BrtExternCellReal' */ case 0x0171: /* 'BrtExternCellBool' */ case 0x0172: /* 'BrtExternCellError' */ case 0x0173: /* 'BrtExternCellString' */ case 0x01D8: /* 'BrtExternValueMeta' */ case 0x0241: /* 'BrtSupNameStart' */ case 0x0242: /* 'BrtSupNameValueStart' */ case 0x0243: /* 'BrtSupNameValueEnd' */ case 0x0244: /* 'BrtSupNameNum' */ case 0x0245: /* 'BrtSupNameErr' */ case 0x0246: /* 'BrtSupNameSt' */ case 0x0247: /* 'BrtSupNameNil' */ case 0x0248: /* 'BrtSupNameBool' */ case 0x0249: /* 'BrtSupNameFmla' */ case 0x024A: /* 'BrtSupNameBits' */ case 0x024B: /* 'BrtSupNameEnd' */ break; case 0x0023: /* 'BrtFRTBegin' */ pass = true; break; case 0x0024: /* 'BrtFRTEnd' */ pass = false; break; default: if(R.T){/* empty */} else if(!pass || opts.WTF) throw new Error("Unexpected record 0x" + RT.toString(16)); } }, opts); } /* 20.5 DrawingML - SpreadsheetML Drawing */ /* 20.5.2.35 wsDr CT_Drawing */ function parse_drawing(data, rels/*:any*/) { if(!data) return "??"; /* Chartsheet Drawing: - 20.5.2.35 wsDr CT_Drawing - 20.5.2.1 absoluteAnchor CT_AbsoluteAnchor - 20.5.2.16 graphicFrame CT_GraphicalObjectFrame - 20.1.2.2.16 graphic CT_GraphicalObject - 20.1.2.2.17 graphicData CT_GraphicalObjectData - chart reference the actual type is based on the URI of the graphicData TODO: handle embedded charts and other types of graphics */ var id = (data.match(/<c:chart [^>]*r:id="([^"]*)"/)||["",""])[1]; return rels['!id'][id].Target; } /* L.5.5.2 SpreadsheetML Comments + VML Schema */ var _shapeid = 1024; function write_comments_vml(rId/*:number*/, comments) { var csize = [21600, 21600]; /* L.5.2.1.2 Path Attribute */ var bbox = ["m0,0l0",csize[1],csize[0],csize[1],csize[0],"0xe"].join(","); var o = [ writextag("xml", null, { 'xmlns:v': XLMLNS.v, 'xmlns:o': XLMLNS.o, 'xmlns:x': XLMLNS.x, 'xmlns:mv': XLMLNS.mv }).replace(/\/>/,">"), writextag("o:shapelayout", writextag("o:idmap", null, {'v:ext':"edit", 'data':rId}), {'v:ext':"edit"}), writextag("v:shapetype", [ writextag("v:stroke", null, {joinstyle:"miter"}), writextag("v:path", null, {gradientshapeok:"t", 'o:connecttype':"rect"}) ].join(""), {id:"_x0000_t202", 'o:spt':202, coordsize:csize.join(","),path:bbox}) ]; while(_shapeid < rId * 1000) _shapeid += 1000; comments.forEach(function(x) { var c = decode_cell(x[0]); var fillopts = /*::(*/{'color2':"#BEFF82", 'type':"gradient"}/*:: :any)*/; if(fillopts.type == "gradient") fillopts.angle = "-180"; var fillparm = fillopts.type == "gradient" ? writextag("o:fill", null, {type:"gradientUnscaled", 'v:ext':"view"}) : null; var fillxml = writextag('v:fill', fillparm, fillopts); var shadata = ({on:"t", 'obscured':"t"}/*:any*/); ++_shapeid; o = o.concat([ '<v:shape' + wxt_helper({ id:'_x0000_s' + _shapeid, type:"#_x0000_t202", style:"position:absolute; margin-left:80pt;margin-top:5pt;width:104pt;height:64pt;z-index:10" + (x[1].hidden ? ";visibility:hidden" : "") , fillcolor:"#ECFAD4", strokecolor:"#edeaa1" }) + '>', fillxml, writextag("v:shadow", null, shadata), writextag("v:path", null, {'o:connecttype':"none"}), '<v:textbox><div style="text-align:left"></div></v:textbox>', '<x:ClientData ObjectType="Note">', '<x:MoveWithCells/>', '<x:SizeWithCells/>', /* Part 4 19.4.2.3 Anchor (Anchor) */ writetag('x:Anchor', [c.c+1, 0, c.r+1, 0, c.c+3, 20, c.r+5, 20].join(",")), writetag('x:AutoFill', "False"), writetag('x:Row', String(c.r)), writetag('x:Column', String(c.c)), x[1].hidden ? '' : '<x:Visible/>', '</x:ClientData>', '</v:shape>' ]); }); o.push('</xml>'); return o.join(""); } function sheet_insert_comments(sheet, comments/*:Array<RawComment>*/, threaded/*:boolean*/, people/*:?Array<any>*/) { var dense = Array.isArray(sheet); var cell/*:Cell*/; comments.forEach(function(comment) { var r = decode_cell(comment.ref); if(dense) { if(!sheet[r.r]) sheet[r.r] = []; cell = sheet[r.r][r.c]; } else cell = sheet[comment.ref]; if (!cell) { cell = ({t:"z"}/*:any*/); if(dense) sheet[r.r][r.c] = cell; else sheet[comment.ref] = cell; var range = safe_decode_range(sheet["!ref"]||"BDWGO1000001:A1"); if(range.s.r > r.r) range.s.r = r.r; if(range.e.r < r.r) range.e.r = r.r; if(range.s.c > r.c) range.s.c = r.c; if(range.e.c < r.c) range.e.c = r.c; var encoded = encode_range(range); if (encoded !== sheet["!ref"]) sheet["!ref"] = encoded; } if (!cell.c) cell.c = []; var o/*:Comment*/ = ({a: comment.author, t: comment.t, r: comment.r, T: threaded}); if(comment.h) o.h = comment.h; /* threaded comments always override */ for(var i = cell.c.length - 1; i >= 0; --i) { if(!threaded && cell.c[i].T) return; if(threaded && !cell.c[i].T) cell.c.splice(i, 1); } if(threaded && people) for(i = 0; i < people.length; ++i) { if(o.a == people[i].id) { o.a = people[i].name || o.a; break; } } cell.c.push(o); }); } /* 18.7 Comments */ function parse_comments_xml(data/*:string*/, opts)/*:Array<RawComment>*/ { /* 18.7.6 CT_Comments */ if(data.match(/<(?:\w+:)?comments *\/>/)) return []; var authors/*:Array<string>*/ = []; var commentList/*:Array<RawComment>*/ = []; var authtag = data.match(/<(?:\w+:)?authors>([\s\S]*)<\/(?:\w+:)?authors>/); if(authtag && authtag[1]) authtag[1].split(/<\/\w*:?author>/).forEach(function(x) { if(x === "" || x.trim() === "") return; var a = x.match(/<(?:\w+:)?author[^>]*>(.*)/); if(a) authors.push(a[1]); }); var cmnttag = data.match(/<(?:\w+:)?commentList>([\s\S]*)<\/(?:\w+:)?commentList>/); if(cmnttag && cmnttag[1]) cmnttag[1].split(/<\/\w*:?comment>/).forEach(function(x) { if(x === "" || x.trim() === "") return; var cm = x.match(/<(?:\w+:)?comment[^>]*>/); if(!cm) return; var y = parsexmltag(cm[0]); var comment/*:RawComment*/ = ({ author: y.authorId && authors[y.authorId] || "sheetjsghost", ref: y.ref, guid: y.guid }/*:any*/); var cell = decode_cell(y.ref); if(opts.sheetRows && opts.sheetRows <= cell.r) return; var textMatch = x.match(/<(?:\w+:)?text>([\s\S]*)<\/(?:\w+:)?text>/); var rt = !!textMatch && !!textMatch[1] && parse_si(textMatch[1]) || {r:"",t:"",h:""}; comment.r = rt.r; if(rt.r == "<t></t>") rt.t = rt.h = ""; comment.t = (rt.t||"").replace(/\r\n/g,"\n").replace(/\r/g,"\n"); if(opts.cellHTML) comment.h = rt.h; commentList.push(comment); }); return commentList; } function write_comments_xml(data/*::, opts*/) { var o = [XML_HEADER, writextag('comments', null, { 'xmlns': XMLNS_main[0] })]; var iauthor/*:Array<string>*/ = []; o.push("<authors>"); data.forEach(function(x) { x[1].forEach(function(w) { var a = escapexml(w.a); if(iauthor.indexOf(a) == -1) { iauthor.push(a); o.push("<author>" + a + "</author>"); } if(w.T && w.ID && iauthor.indexOf("tc=" + w.ID) == -1) { iauthor.push("tc=" + w.ID); o.push("<author>" + "tc=" + w.ID + "</author>"); } }); }); if(iauthor.length == 0) { iauthor.push("SheetJ5"); o.push("<author>SheetJ5</author>"); } o.push("</authors>"); o.push("<commentList>"); data.forEach(function(d) { /* 18.7.3 CT_Comment */ var lastauthor = 0, ts = []; if(d[1][0] && d[1][0].T && d[1][0].ID) lastauthor = iauthor.indexOf("tc=" + d[1][0].ID); else d[1].forEach(function(c) { if(c.a) lastauthor = iauthor.indexOf(escapexml(c.a)); ts.push(c.t||""); }); o.push('<comment ref="' + d[0] + '" authorId="' + lastauthor + '"><text>'); if(ts.length <= 1) o.push(writetag("t", escapexml(ts[0]||""))); else { /* based on Threaded Comments -> Comments projection */ var t = "Comment:\n " + (ts[0]) + "\n"; for(var i = 1; i < ts.length; ++i) t += "Reply:\n " + ts[i] + "\n"; o.push(writetag("t", escapexml(t))); } o.push('</text></comment>'); }); o.push("</commentList>"); if(o.length>2) { o[o.length] = ('</comments>'); o[1]=o[1].replace("/>",">"); } return o.join(""); } /* [MS-XLSX] 2.1.17 */ function parse_tcmnt_xml(data/*:string*/, opts)/*:Array<RawComment>*/ { var out = []; var pass = false, comment = {}, tidx = 0; data.replace(tagregex, function xml_tcmnt(x, idx) { var y/*:any*/ = parsexmltag(x); switch(strip_ns(y[0])) { case '<?xml': break; /* 2.6.207 ThreadedComments CT_ThreadedComments */ case '<ThreadedComments': break; case '</ThreadedComments>': break; /* 2.6.205 threadedComment CT_ThreadedComment */ case '<threadedComment': comment = {author: y.personId, guid: y.id, ref: y.ref, T: 1}; break; case '</threadedComment>': if(comment.t != null) out.push(comment); break; case '<text>': case '<text': tidx = idx + x.length; break; case '</text>': comment.t = data.slice(tidx, idx).replace(/\r\n/g, "\n").replace(/\r/g, "\n"); break; /* 2.6.206 mentions CT_ThreadedCommentMentions TODO */ case '<mentions': case '<mentions>': pass = true; break; case '</mentions>': pass = false; break; /* 2.6.202 mention CT_Mention TODO */ /* 18.2.10 extLst CT_ExtensionList ? */ case '<extLst': case '<extLst>': case '</extLst>': case '<extLst/>': break; /* 18.2.7 ext CT_Extension + */ case '<ext': pass=true; break; case '</ext>': pass=false; break; default: if(!pass && opts.WTF) throw new Error('unrecognized ' + y[0] + ' in threaded comments'); } return x; }); return out; } function write_tcmnt_xml(comments, people, opts) { var o = [XML_HEADER, writextag('ThreadedComments', null, { 'xmlns': XMLNS.TCMNT }).replace(/[\/]>/, ">")]; comments.forEach(function(carr) { var rootid = ""; (carr[1] || []).forEach(function(c, idx) { if(!c.T) { delete c.ID; return; } if(c.a && people.indexOf(c.a) == -1) people.push(c.a); var tcopts = { ref: carr[0], id: "{54EE7951-7262-4200-6969-" + ("000000000000" + opts.tcid++).slice(-12) + "}" }; if(idx == 0) rootid = tcopts.id; else tcopts.parentId = rootid; c.ID = tcopts.id; if(c.a) tcopts.personId = "{54EE7950-7262-4200-6969-" + ("000000000000" + people.indexOf(c.a)).slice(-12) + "}"; o.push(writextag('threadedComment', writetag('text', c.t||""), tcopts)); }); }); o.push('</ThreadedComments>'); return o.join(""); } /* [MS-XLSX] 2.1.18 */ function parse_people_xml(data/*:string*/, opts) { var out = []; var pass = false; data.replace(tagregex, function xml_tcmnt(x) { var y/*:any*/ = parsexmltag(x); switch(strip_ns(y[0])) { case '<?xml': break; /* 2.4.85 personList CT_PersonList */ case '<personList': break; case '</personList>': break; /* 2.6.203 person CT_Person TODO: providers */ case '<person': out.push({name: y.displayname, id: y.id }); break; case '</person>': break; /* 18.2.10 extLst CT_ExtensionList ? */ case '<extLst': case '<extLst>': case '</extLst>': case '<extLst/>': break; /* 18.2.7 ext CT_Extension + */ case '<ext': pass=true; break; case '</ext>': pass=false; break; default: if(!pass && opts.WTF) throw new Error('unrecognized ' + y[0] + ' in threaded comments'); } return x; }); return out; } function write_people_xml(people/*, opts*/) { var o = [XML_HEADER, writextag('personList', null, { 'xmlns': XMLNS.TCMNT, 'xmlns:x': XMLNS_main[0] }).replace(/[\/]>/, ">")]; people.forEach(function(person, idx) { o.push(writextag('person', null, { displayName: person, id: "{54EE7950-7262-4200-6969-" + ("000000000000" + idx).slice(-12) + "}", userId: person, providerId: "None" })); }); o.push("</personList>"); return o.join(""); } /* [MS-XLSB] 2.4.28 BrtBeginComment */ function parse_BrtBeginComment(data) { var out = {}; out.iauthor = data.read_shift(4); var rfx = parse_UncheckedRfX(data, 16); out.rfx = rfx.s; out.ref = encode_cell(rfx.s); data.l += 16; /*var guid = parse_GUID(data); */ return out; } function write_BrtBeginComment(data, o) { if(o == null) o = new_buf(36); o.write_shift(4, data[1].iauthor); write_UncheckedRfX((data[0]/*:any*/), o); o.write_shift(4, 0); o.write_shift(4, 0); o.write_shift(4, 0); o.write_shift(4, 0); return o; } /* [MS-XLSB] 2.4.327 BrtCommentAuthor */ var parse_BrtCommentAuthor = parse_XLWideString; function write_BrtCommentAuthor(data) { return write_XLWideString(data.slice(0, 54)); } /* [MS-XLSB] 2.1.7.8 Comments */ function parse_comments_bin(data, opts)/*:Array<RawComment>*/ { var out/*:Array<RawComment>*/ = []; var authors/*:Array<string>*/ = []; var c = {}; var pass = false; recordhopper(data, function hopper_cmnt(val, R, RT) { switch(RT) { case 0x0278: /* 'BrtCommentAuthor' */ authors.push(val); break; case 0x027B: /* 'BrtBeginComment' */ c = val; break; case 0x027D: /* 'BrtCommentText' */ c.t = val.t; c.h = val.h; c.r = val.r; break; case 0x027C: /* 'BrtEndComment' */ c.author = authors[c.iauthor]; delete (c/*:any*/).iauthor; if(opts.sheetRows && c.rfx && opts.sheetRows <= c.rfx.r) break; if(!c.t) c.t = ""; delete c.rfx; out.push(c); break; case 0x0C00: /* 'BrtUid' */ break; case 0x0023: /* 'BrtFRTBegin' */ pass = true; break; case 0x0024: /* 'BrtFRTEnd' */ pass = false; break; case 0x0025: /* 'BrtACBegin' */ break; case 0x0026: /* 'BrtACEnd' */ break; default: if(R.T){/* empty */} else if(!pass || opts.WTF) throw new Error("Unexpected record 0x" + RT.toString(16)); } }); return out; } function write_comments_bin(data/*::, opts*/) { var ba = buf_array(); var iauthor/*:Array<string>*/ = []; write_record(ba, 0x0274 /* BrtBeginComments */); write_record(ba, 0x0276 /* BrtBeginCommentAuthors */); data.forEach(function(comment) { comment[1].forEach(function(c) { if(iauthor.indexOf(c.a) > -1) return; iauthor.push(c.a.slice(0,54)); write_record(ba, 0x0278 /* BrtCommentAuthor */, write_BrtCommentAuthor(c.a)); }); }); write_record(ba, 0x0277 /* BrtEndCommentAuthors */); write_record(ba, 0x0279 /* BrtBeginCommentList */); data.forEach(function(comment) { comment[1].forEach(function(c) { c.iauthor = iauthor.indexOf(c.a); var range = {s:decode_cell(comment[0]),e:decode_cell(comment[0])}; write_record(ba, 0x027B /* BrtBeginComment */, write_BrtBeginComment([range, c])); if(c.t && c.t.length > 0) write_record(ba, 0x027D /* BrtCommentText */, write_BrtCommentText(c)); write_record(ba, 0x027C /* BrtEndComment */); delete c.iauthor; }); }); write_record(ba, 0x027A /* BrtEndCommentList */); write_record(ba, 0x0275 /* BrtEndComments */); return ba.end(); } var CT_VBA = "application/vnd.ms-office.vbaProject"; function make_vba_xls(cfb) { var newcfb = CFB.utils.cfb_new({ root: "R" }); cfb.FullPaths.forEach(function(p, i) { if (p.slice(-1) === "/" || !p.match(/_VBA_PROJECT_CUR/)) return; var newpath = p.replace(/^[^\/]*/, "R").replace(/\/_VBA_PROJECT_CUR\u0000*/, ""); CFB.utils.cfb_add(newcfb, newpath, cfb.FileIndex[i].content); }); return CFB.write(newcfb); } function fill_vba_xls(cfb, vba) { vba.FullPaths.forEach(function(p, i) { if (i == 0) return; var newpath = p.replace(/[^\/]*[\/]/, "/_VBA_PROJECT_CUR/"); if (newpath.slice(-1) !== "/") CFB.utils.cfb_add(cfb, newpath, vba.FileIndex[i].content); }); } var VBAFMTS = ["xlsb", "xlsm", "xlam", "biff8", "xla"]; /* macro and dialog sheet stubs */ function parse_ds_bin(/*::data:any, opts, idx:number, rels, wb, themes, styles*/)/*:Worksheet*/ { return {'!type':'dialog'}; } function parse_ds_xml(/*::data:any, opts, idx:number, rels, wb, themes, styles*/)/*:Worksheet*/ { return {'!type':'dialog'}; } function parse_ms_bin(/*::data:any, opts, idx:number, rels, wb, themes, styles*/)/*:Worksheet*/ { return {'!type':'macro'}; } function parse_ms_xml(/*::data:any, opts, idx:number, rels, wb, themes, styles*/)/*:Worksheet*/ { return {'!type':'macro'}; } /* TODO: it will be useful to parse the function str */ var rc_to_a1 = /*#__PURE__*/(function(){ var rcregex = /(^|[^A-Za-z_])R(\[?-?\d+\]|[1-9]\d*|)C(\[?-?\d+\]|[1-9]\d*|)(?![A-Za-z0-9_])/g; var rcbase/*:Cell*/ = ({r:0,c:0}/*:any*/); function rcfunc($$,$1,$2,$3) { var cRel = false, rRel = false; if($2.length == 0) rRel = true; else if($2.charAt(0) == "[") { rRel = true; $2 = $2.slice(1, -1); } if($3.length == 0) cRel = true; else if($3.charAt(0) == "[") { cRel = true; $3 = $3.slice(1, -1); } var R = $2.length>0?parseInt($2,10)|0:0, C = $3.length>0?parseInt($3,10)|0:0; if(cRel) C += rcbase.c; else --C; if(rRel) R += rcbase.r; else --R; return $1 + (cRel ? "" : "$") + encode_col(C) + (rRel ? "" : "$") + encode_row(R); } return function rc_to_a1(fstr/*:string*/, base/*:Cell*/)/*:string*/ { rcbase = base; return fstr.replace(rcregex, rcfunc); }; })(); var crefregex = /(^|[^._A-Z0-9])([$]?)([A-Z]{1,2}|[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D])([$]?)(10[0-3]\d{4}|104[0-7]\d{3}|1048[0-4]\d{2}|10485[0-6]\d|104857[0-6]|[1-9]\d{0,5})(?![_.\(A-Za-z0-9])/g; var a1_to_rc = /*#__PURE__*/(function(){ return function a1_to_rc(fstr/*:string*/, base/*:CellAddress*/) { return fstr.replace(crefregex, function($0, $1, $2, $3, $4, $5) { var c = decode_col($3) - ($2 ? 0 : base.c); var r = decode_row($5) - ($4 ? 0 : base.r); var R = (r == 0 ? "" : !$4 ? "[" + r + "]" : (r+1)); var C = (c == 0 ? "" : !$2 ? "[" + c + "]" : (c+1)); return $1 + "R" + R + "C" + C; }); }; })(); /* no defined name can collide with a valid cell address A1:XFD1048576 ... except LOG10! */ function shift_formula_str(f/*:string*/, delta/*:Cell*/)/*:string*/ { return f.replace(crefregex, function($0, $1, $2, $3, $4, $5) { return $1+($2=="$" ? $2+$3 : encode_col(decode_col($3)+delta.c))+($4=="$" ? $4+$5 : encode_row(decode_row($5) + delta.r)); }); } function shift_formula_xlsx(f/*:string*/, range/*:string*/, cell/*:string*/)/*:string*/ { var r = decode_range(range), s = r.s, c = decode_cell(cell); var delta = {r:c.r - s.r, c:c.c - s.c}; return shift_formula_str(f, delta); } /* TODO: parse formula */ function fuzzyfmla(f/*:string*/)/*:boolean*/ { if(f.length == 1) return false; return true; } function _xlfn(f/*:string*/)/*:string*/ { return f.replace(/_xlfn\./g,""); } function parseread1(blob) { blob.l+=1; return; } /* [MS-XLS] 2.5.51 */ function parse_ColRelU(blob, length) { var c = blob.read_shift(length == 1 ? 1 : 2); return [c & 0x3FFF, (c >> 14) & 1, (c >> 15) & 1]; } /* [MS-XLS] 2.5.198.105 ; [MS-XLSB] 2.5.97.89 */ function parse_RgceArea(blob, length, opts) { var w = 2; if(opts) { if(opts.biff >= 2 && opts.biff <= 5) return parse_RgceArea_BIFF2(blob, length, opts); else if(opts.biff == 12) w = 4; } var r=blob.read_shift(w), R=blob.read_shift(w); var c=parse_ColRelU(blob, 2); var C=parse_ColRelU(blob, 2); return { s:{r:r, c:c[0], cRel:c[1], rRel:c[2]}, e:{r:R, c:C[0], cRel:C[1], rRel:C[2]} }; } /* BIFF 2-5 encodes flags in the row field */ function parse_RgceArea_BIFF2(blob/*::, length, opts*/) { var r=parse_ColRelU(blob, 2), R=parse_ColRelU(blob, 2); var c=blob.read_shift(1); var C=blob.read_shift(1); return { s:{r:r[0], c:c, cRel:r[1], rRel:r[2]}, e:{r:R[0], c:C, cRel:R[1], rRel:R[2]} }; } /* [MS-XLS] 2.5.198.105 ; [MS-XLSB] 2.5.97.90 */ function parse_RgceAreaRel(blob, length, opts) { if(opts.biff < 8) return parse_RgceArea_BIFF2(blob, length, opts); var r=blob.read_shift(opts.biff == 12 ? 4 : 2), R=blob.read_shift(opts.biff == 12 ? 4 : 2); var c=parse_ColRelU(blob, 2); var C=parse_ColRelU(blob, 2); return { s:{r:r, c:c[0], cRel:c[1], rRel:c[2]}, e:{r:R, c:C[0], cRel:C[1], rRel:C[2]} }; } /* [MS-XLS] 2.5.198.109 ; [MS-XLSB] 2.5.97.91 */ function parse_RgceLoc(blob, length, opts) { if(opts && opts.biff >= 2 && opts.biff <= 5) return parse_RgceLoc_BIFF2(blob, length, opts); var r = blob.read_shift(opts && opts.biff == 12 ? 4 : 2); var c = parse_ColRelU(blob, 2); return {r:r, c:c[0], cRel:c[1], rRel:c[2]}; } function parse_RgceLoc_BIFF2(blob/*::, length, opts*/) { var r = parse_ColRelU(blob, 2); var c = blob.read_shift(1); return {r:r[0], c:c, cRel:r[1], rRel:r[2]}; } /* [MS-XLS] 2.5.198.107, 2.5.47 */ function parse_RgceElfLoc(blob/*::, length, opts*/) { var r = blob.read_shift(2); var c = blob.read_shift(2); return {r:r, c:c & 0xFF, fQuoted:!!(c & 0x4000), cRel:c>>15, rRel:c>>15 }; } /* [MS-XLS] 2.5.198.111 ; [MS-XLSB] 2.5.97.92 TODO */ function parse_RgceLocRel(blob, length, opts) { var biff = opts && opts.biff ? opts.biff : 8; if(biff >= 2 && biff <= 5) return parse_RgceLocRel_BIFF2(blob, length, opts); var r = blob.read_shift(biff >= 12 ? 4 : 2); var cl = blob.read_shift(2); var cRel = (cl & 0x4000) >> 14, rRel = (cl & 0x8000) >> 15; cl &= 0x3FFF; if(rRel == 1) while(r > 0x7FFFF) r -= 0x100000; if(cRel == 1) while(cl > 0x1FFF) cl = cl - 0x4000; return {r:r,c:cl,cRel:cRel,rRel:rRel}; } function parse_RgceLocRel_BIFF2(blob/*::, length:number, opts*/) { var rl = blob.read_shift(2); var c = blob.read_shift(1); var rRel = (rl & 0x8000) >> 15, cRel = (rl & 0x4000) >> 14; rl &= 0x3FFF; if(rRel == 1 && rl >= 0x2000) rl = rl - 0x4000; if(cRel == 1 && c >= 0x80) c = c - 0x100; return {r:rl,c:c,cRel:cRel,rRel:rRel}; } /* [MS-XLS] 2.5.198.27 ; [MS-XLSB] 2.5.97.18 */ function parse_PtgArea(blob, length, opts) { var type = (blob[blob.l++] & 0x60) >> 5; var area = parse_RgceArea(blob, opts.biff >= 2 && opts.biff <= 5 ? 6 : 8, opts); return [type, area]; } /* [MS-XLS] 2.5.198.28 ; [MS-XLSB] 2.5.97.19 */ function parse_PtgArea3d(blob, length, opts) { var type = (blob[blob.l++] & 0x60) >> 5; var ixti = blob.read_shift(2, 'i'); var w = 8; if(opts) switch(opts.biff) { case 5: blob.l += 12; w = 6; break; case 12: w = 12; break; } var area = parse_RgceArea(blob, w, opts); return [type, ixti, area]; } /* [MS-XLS] 2.5.198.29 ; [MS-XLSB] 2.5.97.20 */ function parse_PtgAreaErr(blob, length, opts) { var type = (blob[blob.l++] & 0x60) >> 5; blob.l += opts && (opts.biff > 8) ? 12 : (opts.biff < 8 ? 6 : 8); return [type]; } /* [MS-XLS] 2.5.198.30 ; [MS-XLSB] 2.5.97.21 */ function parse_PtgAreaErr3d(blob, length, opts) { var type = (blob[blob.l++] & 0x60) >> 5; var ixti = blob.read_shift(2); var w = 8; if(opts) switch(opts.biff) { case 5: blob.l += 12; w = 6; break; case 12: w = 12; break; } blob.l += w; return [type, ixti]; } /* [MS-XLS] 2.5.198.31 ; [MS-XLSB] 2.5.97.22 */ function parse_PtgAreaN(blob, length, opts) { var type = (blob[blob.l++] & 0x60) >> 5; var area = parse_RgceAreaRel(blob, length - 1, opts); return [type, area]; } /* [MS-XLS] 2.5.198.32 ; [MS-XLSB] 2.5.97.23 */ function parse_PtgArray(blob, length, opts) { var type = (blob[blob.l++] & 0x60) >> 5; blob.l += opts.biff == 2 ? 6 : opts.biff == 12 ? 14 : 7; return [type]; } /* [MS-XLS] 2.5.198.33 ; [MS-XLSB] 2.5.97.24 */ function parse_PtgAttrBaxcel(blob) { var bitSemi = blob[blob.l+1] & 0x01; /* 1 = volatile */ var bitBaxcel = 1; blob.l += 4; return [bitSemi, bitBaxcel]; } /* [MS-XLS] 2.5.198.34 ; [MS-XLSB] 2.5.97.25 */ function parse_PtgAttrChoose(blob, length, opts)/*:Array<number>*/ { blob.l +=2; var offset = blob.read_shift(opts && opts.biff == 2 ? 1 : 2); var o/*:Array<number>*/ = []; /* offset is 1 less than the number of elements */ for(var i = 0; i <= offset; ++i) o.push(blob.read_shift(opts && opts.biff == 2 ? 1 : 2)); return o; } /* [MS-XLS] 2.5.198.35 ; [MS-XLSB] 2.5.97.26 */ function parse_PtgAttrGoto(blob, length, opts) { var bitGoto = (blob[blob.l+1] & 0xFF) ? 1 : 0; blob.l += 2; return [bitGoto, blob.read_shift(opts && opts.biff == 2 ? 1 : 2)]; } /* [MS-XLS] 2.5.198.36 ; [MS-XLSB] 2.5.97.27 */ function parse_PtgAttrIf(blob, length, opts) { var bitIf = (blob[blob.l+1] & 0xFF) ? 1 : 0; blob.l += 2; return [bitIf, blob.read_shift(opts && opts.biff == 2 ? 1 : 2)]; } /* [MS-XLSB] 2.5.97.28 */ function parse_PtgAttrIfError(blob) { var bitIf = (blob[blob.l+1] & 0xFF) ? 1 : 0; blob.l += 2; return [bitIf, blob.read_shift(2)]; } /* [MS-XLS] 2.5.198.37 ; [MS-XLSB] 2.5.97.29 */ function parse_PtgAttrSemi(blob, length, opts) { var bitSemi = (blob[blob.l+1] & 0xFF) ? 1 : 0; blob.l += opts && opts.biff == 2 ? 3 : 4; return [bitSemi]; } /* [MS-XLS] 2.5.198.40 ; [MS-XLSB] 2.5.97.32 */ function parse_PtgAttrSpaceType(blob/*::, length*/) { var type = blob.read_shift(1), cch = blob.read_shift(1); return [type, cch]; } /* [MS-XLS] 2.5.198.38 ; [MS-XLSB] 2.5.97.30 */ function parse_PtgAttrSpace(blob) { blob.read_shift(2); return parse_PtgAttrSpaceType(blob, 2); } /* [MS-XLS] 2.5.198.39 ; [MS-XLSB] 2.5.97.31 */ function parse_PtgAttrSpaceSemi(blob) { blob.read_shift(2); return parse_PtgAttrSpaceType(blob, 2); } /* [MS-XLS] 2.5.198.84 ; [MS-XLSB] 2.5.97.68 TODO */ function parse_PtgRef(blob, length, opts) { //var ptg = blob[blob.l] & 0x1F; var type = (blob[blob.l] & 0x60)>>5; blob.l += 1; var loc = parse_RgceLoc(blob, 0, opts); return [type, loc]; } /* [MS-XLS] 2.5.198.88 ; [MS-XLSB] 2.5.97.72 TODO */ function parse_PtgRefN(blob, length, opts) { var type = (blob[blob.l] & 0x60)>>5; blob.l += 1; var loc = parse_RgceLocRel(blob, 0, opts); return [type, loc]; } /* [MS-XLS] 2.5.198.85 ; [MS-XLSB] 2.5.97.69 TODO */ function parse_PtgRef3d(blob, length, opts) { var type = (blob[blob.l] & 0x60)>>5; blob.l += 1; var ixti = blob.read_shift(2); // XtiIndex if(opts && opts.biff == 5) blob.l += 12; var loc = parse_RgceLoc(blob, 0, opts); // TODO: or RgceLocRel return [type, ixti, loc]; } /* [MS-XLS] 2.5.198.62 ; [MS-XLSB] 2.5.97.45 TODO */ function parse_PtgFunc(blob, length, opts) { //var ptg = blob[blob.l] & 0x1F; var type = (blob[blob.l] & 0x60)>>5; blob.l += 1; var iftab = blob.read_shift(opts && opts.biff <= 3 ? 1 : 2); return [FtabArgc[iftab], Ftab[iftab], type]; } /* [MS-XLS] 2.5.198.63 ; [MS-XLSB] 2.5.97.46 TODO */ function parse_PtgFuncVar(blob, length, opts) { var type = blob[blob.l++]; var cparams = blob.read_shift(1), tab = opts && opts.biff <= 3 ? [(type == 0x58 ? -1 : 0), blob.read_shift(1)]: parsetab(blob); return [cparams, (tab[0] === 0 ? Ftab : Cetab)[tab[1]]]; } function parsetab(blob) { return [blob[blob.l+1]>>7, blob.read_shift(2) & 0x7FFF]; } /* [MS-XLS] 2.5.198.41 ; [MS-XLSB] 2.5.97.33 */ function parse_PtgAttrSum(blob, length, opts) { blob.l += opts && opts.biff == 2 ? 3 : 4; return; } /* [MS-XLS] 2.5.198.58 ; [MS-XLSB] 2.5.97.40 */ function parse_PtgExp(blob, length, opts) { blob.l++; if(opts && opts.biff == 12) return [blob.read_shift(4, 'i'), 0]; var row = blob.read_shift(2); var col = blob.read_shift(opts && opts.biff == 2 ? 1 : 2); return [row, col]; } /* [MS-XLS] 2.5.198.57 ; [MS-XLSB] 2.5.97.39 */ function parse_PtgErr(blob) { blob.l++; return BErr[blob.read_shift(1)]; } /* [MS-XLS] 2.5.198.66 ; [MS-XLSB] 2.5.97.49 */ function parse_PtgInt(blob) { blob.l++; return blob.read_shift(2); } /* [MS-XLS] 2.5.198.42 ; [MS-XLSB] 2.5.97.34 */ function parse_PtgBool(blob) { blob.l++; return blob.read_shift(1)!==0;} /* [MS-XLS] 2.5.198.79 ; [MS-XLSB] 2.5.97.63 */ function parse_PtgNum(blob) { blob.l++; return parse_Xnum(blob, 8); } /* [MS-XLS] 2.5.198.89 ; [MS-XLSB] 2.5.97.74 */ function parse_PtgStr(blob, length, opts) { blob.l++; return parse_ShortXLUnicodeString(blob, length-1, opts); } /* [MS-XLS] 2.5.192.112 + 2.5.192.11{3,4,5,6,7} */ /* [MS-XLSB] 2.5.97.93 + 2.5.97.9{4,5,6,7} */ function parse_SerAr(blob, biff/*:number*/) { var val = [blob.read_shift(1)]; if(biff == 12) switch(val[0]) { case 0x02: val[0] = 0x04; break; /* SerBool */ case 0x04: val[0] = 0x10; break; /* SerErr */ case 0x00: val[0] = 0x01; break; /* SerNum */ case 0x01: val[0] = 0x02; break; /* SerStr */ } switch(val[0]) { case 0x04: /* SerBool -- boolean */ val[1] = parsebool(blob, 1) ? 'TRUE' : 'FALSE'; if(biff != 12) blob.l += 7; break; case 0x25: /* appears to be an alias */ case 0x10: /* SerErr -- error */ val[1] = BErr[blob[blob.l]]; blob.l += ((biff == 12) ? 4 : 8); break; case 0x00: /* SerNil -- honestly, I'm not sure how to reproduce this */ blob.l += 8; break; case 0x01: /* SerNum -- Xnum */ val[1] = parse_Xnum(blob, 8); break; case 0x02: /* SerStr -- XLUnicodeString (<256 chars) */ val[1] = parse_XLUnicodeString2(blob, 0, {biff:biff > 0 && biff < 8 ? 2 : biff}); break; default: throw new Error("Bad SerAr: " + val[0]); /* Unreachable */ } return val; } /* [MS-XLS] 2.5.198.61 ; [MS-XLSB] 2.5.97.44 */ function parse_PtgExtraMem(blob, cce, opts) { var count = blob.read_shift((opts.biff == 12) ? 4 : 2); var out/*:Array<Range>*/ = []; for(var i = 0; i != count; ++i) out.push(((opts.biff == 12) ? parse_UncheckedRfX : parse_Ref8U)(blob, 8)); return out; } /* [MS-XLS] 2.5.198.59 ; [MS-XLSB] 2.5.97.41 */ function parse_PtgExtraArray(blob, length, opts) { var rows = 0, cols = 0; if(opts.biff == 12) { rows = blob.read_shift(4); // DRw cols = blob.read_shift(4); // DCol } else { cols = 1 + blob.read_shift(1); //DColByteU rows = 1 + blob.read_shift(2); //DRw } if(opts.biff >= 2 && opts.biff < 8) { --rows; if(--cols == 0) cols = 0x100; } // $FlowIgnore for(var i = 0, o/*:Array<Array<any>>*/ = []; i != rows && (o[i] = []); ++i) for(var j = 0; j != cols; ++j) o[i][j] = parse_SerAr(blob, opts.biff); return o; } /* [MS-XLS] 2.5.198.76 ; [MS-XLSB] 2.5.97.60 */ function parse_PtgName(blob, length, opts) { var type = (blob.read_shift(1) >>> 5) & 0x03; var w = (!opts || (opts.biff >= 8)) ? 4 : 2; var nameindex = blob.read_shift(w); switch(opts.biff) { case 2: blob.l += 5; break; case 3: case 4: blob.l += 8; break; case 5: blob.l += 12; break; } return [type, 0, nameindex]; } /* [MS-XLS] 2.5.198.77 ; [MS-XLSB] 2.5.97.61 */ function parse_PtgNameX(blob, length, opts) { if(opts.biff == 5) return parse_PtgNameX_BIFF5(blob, length, opts); var type = (blob.read_shift(1) >>> 5) & 0x03; var ixti = blob.read_shift(2); // XtiIndex var nameindex = blob.read_shift(4); return [type, ixti, nameindex]; } function parse_PtgNameX_BIFF5(blob/*::, length, opts*/) { var type = (blob.read_shift(1) >>> 5) & 0x03; var ixti = blob.read_shift(2, 'i'); // XtiIndex blob.l += 8; var nameindex = blob.read_shift(2); blob.l += 12; return [type, ixti, nameindex]; } /* [MS-XLS] 2.5.198.70 ; [MS-XLSB] 2.5.97.54 */ function parse_PtgMemArea(blob, length, opts) { var type = (blob.read_shift(1) >>> 5) & 0x03; blob.l += (opts && opts.biff == 2 ? 3 : 4); var cce = blob.read_shift(opts && opts.biff == 2 ? 1 : 2); return [type, cce]; } /* [MS-XLS] 2.5.198.72 ; [MS-XLSB] 2.5.97.56 */ function parse_PtgMemFunc(blob, length, opts) { var type = (blob.read_shift(1) >>> 5) & 0x03; var cce = blob.read_shift(opts && opts.biff == 2 ? 1 : 2); return [type, cce]; } /* [MS-XLS] 2.5.198.86 ; [MS-XLSB] 2.5.97.69 */ function parse_PtgRefErr(blob, length, opts) { var type = (blob.read_shift(1) >>> 5) & 0x03; blob.l += 4; if(opts.biff < 8) blob.l--; if(opts.biff == 12) blob.l += 2; return [type]; } /* [MS-XLS] 2.5.198.87 ; [MS-XLSB] 2.5.97.71 */ function parse_PtgRefErr3d(blob, length, opts) { var type = (blob[blob.l++] & 0x60) >> 5; var ixti = blob.read_shift(2); var w = 4; if(opts) switch(opts.biff) { case 5: w = 15; break; case 12: w = 6; break; } blob.l += w; return [type, ixti]; } /* [MS-XLS] 2.5.198.71 ; [MS-XLSB] 2.5.97.55 */ var parse_PtgMemErr = parsenoop; /* [MS-XLS] 2.5.198.73 ; [MS-XLSB] 2.5.97.57 */ var parse_PtgMemNoMem = parsenoop; /* [MS-XLS] 2.5.198.92 */ var parse_PtgTbl = parsenoop; function parse_PtgElfLoc(blob, length, opts) { blob.l += 2; return [parse_RgceElfLoc(blob, 4, opts)]; } function parse_PtgElfNoop(blob/*::, length, opts*/) { blob.l += 6; return []; } /* [MS-XLS] 2.5.198.46 */ var parse_PtgElfCol = parse_PtgElfLoc; /* [MS-XLS] 2.5.198.47 */ var parse_PtgElfColS = parse_PtgElfNoop; /* [MS-XLS] 2.5.198.48 */ var parse_PtgElfColSV = parse_PtgElfNoop; /* [MS-XLS] 2.5.198.49 */ var parse_PtgElfColV = parse_PtgElfLoc; /* [MS-XLS] 2.5.198.50 */ function parse_PtgElfLel(blob/*::, length, opts*/) { blob.l += 2; return [parseuint16(blob), blob.read_shift(2) & 0x01]; } /* [MS-XLS] 2.5.198.51 */ var parse_PtgElfRadical = parse_PtgElfLoc; /* [MS-XLS] 2.5.198.52 */ var parse_PtgElfRadicalLel = parse_PtgElfLel; /* [MS-XLS] 2.5.198.53 */ var parse_PtgElfRadicalS = parse_PtgElfNoop; /* [MS-XLS] 2.5.198.54 */ var parse_PtgElfRw = parse_PtgElfLoc; /* [MS-XLS] 2.5.198.55 */ var parse_PtgElfRwV = parse_PtgElfLoc; /* [MS-XLSB] 2.5.97.52 TODO */ var PtgListRT = [ "Data", "All", "Headers", "??", "?Data2", "??", "?DataHeaders", "??", "Totals", "??", "??", "??", "?DataTotals", "??", "??", "??", "?Current" ]; function parse_PtgList(blob/*::, length, opts*/) { blob.l += 2; var ixti = blob.read_shift(2); var flags = blob.read_shift(2); var idx = blob.read_shift(4); var c = blob.read_shift(2); var C = blob.read_shift(2); var rt = PtgListRT[(flags >> 2) & 0x1F]; return {ixti: ixti, coltype:(flags&0x3), rt:rt, idx:idx, c:c, C:C}; } /* [MS-XLS] 2.5.198.91 ; [MS-XLSB] 2.5.97.76 */ function parse_PtgSxName(blob/*::, length, opts*/) { blob.l += 2; return [blob.read_shift(4)]; } /* [XLS] old spec */ function parse_PtgSheet(blob, length, opts) { blob.l += 5; blob.l += 2; blob.l += (opts.biff == 2 ? 1 : 4); return ["PTGSHEET"]; } function parse_PtgEndSheet(blob, length, opts) { blob.l += (opts.biff == 2 ? 4 : 5); return ["PTGENDSHEET"]; } function parse_PtgMemAreaN(blob/*::, length, opts*/) { var type = (blob.read_shift(1) >>> 5) & 0x03; var cce = blob.read_shift(2); return [type, cce]; } function parse_PtgMemNoMemN(blob/*::, length, opts*/) { var type = (blob.read_shift(1) >>> 5) & 0x03; var cce = blob.read_shift(2); return [type, cce]; } function parse_PtgAttrNoop(blob/*::, length, opts*/) { blob.l += 4; return [0, 0]; } /* [MS-XLS] 2.5.198.25 ; [MS-XLSB] 2.5.97.16 */ var PtgTypes = { /*::[*/0x01/*::]*/: { n:'PtgExp', f:parse_PtgExp }, /*::[*/0x02/*::]*/: { n:'PtgTbl', f:parse_PtgTbl }, /*::[*/0x03/*::]*/: { n:'PtgAdd', f:parseread1 }, /*::[*/0x04/*::]*/: { n:'PtgSub', f:parseread1 }, /*::[*/0x05/*::]*/: { n:'PtgMul', f:parseread1 }, /*::[*/0x06/*::]*/: { n:'PtgDiv', f:parseread1 }, /*::[*/0x07/*::]*/: { n:'PtgPower', f:parseread1 }, /*::[*/0x08/*::]*/: { n:'PtgConcat', f:parseread1 }, /*::[*/0x09/*::]*/: { n:'PtgLt', f:parseread1 }, /*::[*/0x0A/*::]*/: { n:'PtgLe', f:parseread1 }, /*::[*/0x0B/*::]*/: { n:'PtgEq', f:parseread1 }, /*::[*/0x0C/*::]*/: { n:'PtgGe', f:parseread1 }, /*::[*/0x0D/*::]*/: { n:'PtgGt', f:parseread1 }, /*::[*/0x0E/*::]*/: { n:'PtgNe', f:parseread1 }, /*::[*/0x0F/*::]*/: { n:'PtgIsect', f:parseread1 }, /*::[*/0x10/*::]*/: { n:'PtgUnion', f:parseread1 }, /*::[*/0x11/*::]*/: { n:'PtgRange', f:parseread1 }, /*::[*/0x12/*::]*/: { n:'PtgUplus', f:parseread1 }, /*::[*/0x13/*::]*/: { n:'PtgUminus', f:parseread1 }, /*::[*/0x14/*::]*/: { n:'PtgPercent', f:parseread1 }, /*::[*/0x15/*::]*/: { n:'PtgParen', f:parseread1 }, /*::[*/0x16/*::]*/: { n:'PtgMissArg', f:parseread1 }, /*::[*/0x17/*::]*/: { n:'PtgStr', f:parse_PtgStr }, /*::[*/0x1A/*::]*/: { n:'PtgSheet', f:parse_PtgSheet }, /*::[*/0x1B/*::]*/: { n:'PtgEndSheet', f:parse_PtgEndSheet }, /*::[*/0x1C/*::]*/: { n:'PtgErr', f:parse_PtgErr }, /*::[*/0x1D/*::]*/: { n:'PtgBool', f:parse_PtgBool }, /*::[*/0x1E/*::]*/: { n:'PtgInt', f:parse_PtgInt }, /*::[*/0x1F/*::]*/: { n:'PtgNum', f:parse_PtgNum }, /*::[*/0x20/*::]*/: { n:'PtgArray', f:parse_PtgArray }, /*::[*/0x21/*::]*/: { n:'PtgFunc', f:parse_PtgFunc }, /*::[*/0x22/*::]*/: { n:'PtgFuncVar', f:parse_PtgFuncVar }, /*::[*/0x23/*::]*/: { n:'PtgName', f:parse_PtgName }, /*::[*/0x24/*::]*/: { n:'PtgRef', f:parse_PtgRef }, /*::[*/0x25/*::]*/: { n:'PtgArea', f:parse_PtgArea }, /*::[*/0x26/*::]*/: { n:'PtgMemArea', f:parse_PtgMemArea }, /*::[*/0x27/*::]*/: { n:'PtgMemErr', f:parse_PtgMemErr }, /*::[*/0x28/*::]*/: { n:'PtgMemNoMem', f:parse_PtgMemNoMem }, /*::[*/0x29/*::]*/: { n:'PtgMemFunc', f:parse_PtgMemFunc }, /*::[*/0x2A/*::]*/: { n:'PtgRefErr', f:parse_PtgRefErr }, /*::[*/0x2B/*::]*/: { n:'PtgAreaErr', f:parse_PtgAreaErr }, /*::[*/0x2C/*::]*/: { n:'PtgRefN', f:parse_PtgRefN }, /*::[*/0x2D/*::]*/: { n:'PtgAreaN', f:parse_PtgAreaN }, /*::[*/0x2E/*::]*/: { n:'PtgMemAreaN', f:parse_PtgMemAreaN }, /*::[*/0x2F/*::]*/: { n:'PtgMemNoMemN', f:parse_PtgMemNoMemN }, /*::[*/0x39/*::]*/: { n:'PtgNameX', f:parse_PtgNameX }, /*::[*/0x3A/*::]*/: { n:'PtgRef3d', f:parse_PtgRef3d }, /*::[*/0x3B/*::]*/: { n:'PtgArea3d', f:parse_PtgArea3d }, /*::[*/0x3C/*::]*/: { n:'PtgRefErr3d', f:parse_PtgRefErr3d }, /*::[*/0x3D/*::]*/: { n:'PtgAreaErr3d', f:parse_PtgAreaErr3d }, /*::[*/0xFF/*::]*/: {} }; /* These are duplicated in the PtgTypes table */ var PtgDupes = { /*::[*/0x40/*::]*/: 0x20, /*::[*/0x60/*::]*/: 0x20, /*::[*/0x41/*::]*/: 0x21, /*::[*/0x61/*::]*/: 0x21, /*::[*/0x42/*::]*/: 0x22, /*::[*/0x62/*::]*/: 0x22, /*::[*/0x43/*::]*/: 0x23, /*::[*/0x63/*::]*/: 0x23, /*::[*/0x44/*::]*/: 0x24, /*::[*/0x64/*::]*/: 0x24, /*::[*/0x45/*::]*/: 0x25, /*::[*/0x65/*::]*/: 0x25, /*::[*/0x46/*::]*/: 0x26, /*::[*/0x66/*::]*/: 0x26, /*::[*/0x47/*::]*/: 0x27, /*::[*/0x67/*::]*/: 0x27, /*::[*/0x48/*::]*/: 0x28, /*::[*/0x68/*::]*/: 0x28, /*::[*/0x49/*::]*/: 0x29, /*::[*/0x69/*::]*/: 0x29, /*::[*/0x4A/*::]*/: 0x2A, /*::[*/0x6A/*::]*/: 0x2A, /*::[*/0x4B/*::]*/: 0x2B, /*::[*/0x6B/*::]*/: 0x2B, /*::[*/0x4C/*::]*/: 0x2C, /*::[*/0x6C/*::]*/: 0x2C, /*::[*/0x4D/*::]*/: 0x2D, /*::[*/0x6D/*::]*/: 0x2D, /*::[*/0x4E/*::]*/: 0x2E, /*::[*/0x6E/*::]*/: 0x2E, /*::[*/0x4F/*::]*/: 0x2F, /*::[*/0x6F/*::]*/: 0x2F, /*::[*/0x58/*::]*/: 0x22, /*::[*/0x78/*::]*/: 0x22, /*::[*/0x59/*::]*/: 0x39, /*::[*/0x79/*::]*/: 0x39, /*::[*/0x5A/*::]*/: 0x3A, /*::[*/0x7A/*::]*/: 0x3A, /*::[*/0x5B/*::]*/: 0x3B, /*::[*/0x7B/*::]*/: 0x3B, /*::[*/0x5C/*::]*/: 0x3C, /*::[*/0x7C/*::]*/: 0x3C, /*::[*/0x5D/*::]*/: 0x3D, /*::[*/0x7D/*::]*/: 0x3D }; var Ptg18 = { /*::[*/0x01/*::]*/: { n:'PtgElfLel', f:parse_PtgElfLel }, /*::[*/0x02/*::]*/: { n:'PtgElfRw', f:parse_PtgElfRw }, /*::[*/0x03/*::]*/: { n:'PtgElfCol', f:parse_PtgElfCol }, /*::[*/0x06/*::]*/: { n:'PtgElfRwV', f:parse_PtgElfRwV }, /*::[*/0x07/*::]*/: { n:'PtgElfColV', f:parse_PtgElfColV }, /*::[*/0x0A/*::]*/: { n:'PtgElfRadical', f:parse_PtgElfRadical }, /*::[*/0x0B/*::]*/: { n:'PtgElfRadicalS', f:parse_PtgElfRadicalS }, /*::[*/0x0D/*::]*/: { n:'PtgElfColS', f:parse_PtgElfColS }, /*::[*/0x0F/*::]*/: { n:'PtgElfColSV', f:parse_PtgElfColSV }, /*::[*/0x10/*::]*/: { n:'PtgElfRadicalLel', f:parse_PtgElfRadicalLel }, /*::[*/0x19/*::]*/: { n:'PtgList', f:parse_PtgList }, /*::[*/0x1D/*::]*/: { n:'PtgSxName', f:parse_PtgSxName }, /*::[*/0xFF/*::]*/: {} }; var Ptg19 = { /*::[*/0x00/*::]*/: { n:'PtgAttrNoop', f:parse_PtgAttrNoop }, /*::[*/0x01/*::]*/: { n:'PtgAttrSemi', f:parse_PtgAttrSemi }, /*::[*/0x02/*::]*/: { n:'PtgAttrIf', f:parse_PtgAttrIf }, /*::[*/0x04/*::]*/: { n:'PtgAttrChoose', f:parse_PtgAttrChoose }, /*::[*/0x08/*::]*/: { n:'PtgAttrGoto', f:parse_PtgAttrGoto }, /*::[*/0x10/*::]*/: { n:'PtgAttrSum', f:parse_PtgAttrSum }, /*::[*/0x20/*::]*/: { n:'PtgAttrBaxcel', f:parse_PtgAttrBaxcel }, /*::[*/0x21/*::]*/: { n:'PtgAttrBaxcel', f:parse_PtgAttrBaxcel }, /*::[*/0x40/*::]*/: { n:'PtgAttrSpace', f:parse_PtgAttrSpace }, /*::[*/0x41/*::]*/: { n:'PtgAttrSpaceSemi', f:parse_PtgAttrSpaceSemi }, /*::[*/0x80/*::]*/: { n:'PtgAttrIfError', f:parse_PtgAttrIfError }, /*::[*/0xFF/*::]*/: {} }; /* [MS-XLS] 2.5.198.103 ; [MS-XLSB] 2.5.97.87 */ function parse_RgbExtra(blob, length, rgce, opts) { if(opts.biff < 8) return parsenoop(blob, length); var target = blob.l + length; var o = []; for(var i = 0; i !== rgce.length; ++i) { switch(rgce[i][0]) { case 'PtgArray': /* PtgArray -> PtgExtraArray */ rgce[i][1] = parse_PtgExtraArray(blob, 0, opts); o.push(rgce[i][1]); break; case 'PtgMemArea': /* PtgMemArea -> PtgExtraMem */ rgce[i][2] = parse_PtgExtraMem(blob, rgce[i][1], opts); o.push(rgce[i][2]); break; case 'PtgExp': /* PtgExp -> PtgExtraCol */ if(opts && opts.biff == 12) { rgce[i][1][1] = blob.read_shift(4); o.push(rgce[i][1]); } break; case 'PtgList': /* TODO: PtgList -> PtgExtraList */ case 'PtgElfRadicalS': /* TODO: PtgElfRadicalS -> PtgExtraElf */ case 'PtgElfColS': /* TODO: PtgElfColS -> PtgExtraElf */ case 'PtgElfColSV': /* TODO: PtgElfColSV -> PtgExtraElf */ throw "Unsupported " + rgce[i][0]; default: break; } } length = target - blob.l; /* note: this is technically an error but Excel disregards */ //if(target !== blob.l && blob.l !== target - length) throw new Error(target + " != " + blob.l); if(length !== 0) o.push(parsenoop(blob, length)); return o; } /* [MS-XLS] 2.5.198.104 ; [MS-XLSB] 2.5.97.88 */ function parse_Rgce(blob, length, opts) { var target = blob.l + length; var R, id, ptgs = []; while(target != blob.l) { length = target - blob.l; id = blob[blob.l]; R = PtgTypes[id] || PtgTypes[PtgDupes[id]]; if(id === 0x18 || id === 0x19) R = (id === 0x18 ? Ptg18 : Ptg19)[blob[blob.l + 1]]; if(!R || !R.f) { /*ptgs.push*/(parsenoop(blob, length)); } else { ptgs.push([R.n, R.f(blob, length, opts)]); } } return ptgs; } function stringify_array(f/*:Array<Array<string>>*/)/*:string*/ { var o/*:Array<string>*/ = []; for(var i = 0; i < f.length; ++i) { var x = f[i], r/*:Array<string>*/ = []; for(var j = 0; j < x.length; ++j) { var y = x[j]; if(y) switch(y[0]) { // TODO: handle embedded quotes case 0x02: /*:: if(typeof y[1] != 'string') throw "unreachable"; */ r.push('"' + y[1].replace(/"/g,'""') + '"'); break; default: r.push(y[1]); } else r.push(""); } o.push(r.join(",")); } return o.join(";"); } /* [MS-XLS] 2.2.2 ; [MS-XLSB] 2.2.2 TODO */ var PtgBinOp = { PtgAdd: "+", PtgConcat: "&", PtgDiv: "/", PtgEq: "=", PtgGe: ">=", PtgGt: ">", PtgLe: "<=", PtgLt: "<", PtgMul: "*", PtgNe: "<>", PtgPower: "^", PtgSub: "-" }; // List of invalid characters needs to be tested further function formula_quote_sheet_name(sname/*:string*/, opts)/*:string*/ { if(!sname && !(opts && opts.biff <= 5 && opts.biff >= 2)) throw new Error("empty sheet name"); if (/[^\w\u4E00-\u9FFF\u3040-\u30FF]/.test(sname)) return "'" + sname + "'"; return sname; } function get_ixti_raw(supbooks, ixti/*:number*/, opts)/*:string*/ { if(!supbooks) return "SH33TJSERR0"; if(opts.biff > 8 && (!supbooks.XTI || !supbooks.XTI[ixti])) return supbooks.SheetNames[ixti]; if(!supbooks.XTI) return "SH33TJSERR6"; var XTI = supbooks.XTI[ixti]; if(opts.biff < 8) { if(ixti > 10000) ixti-= 65536; if(ixti < 0) ixti = -ixti; return ixti == 0 ? "" : supbooks.XTI[ixti - 1]; } if(!XTI) return "SH33TJSERR1"; var o = ""; if(opts.biff > 8) switch(supbooks[XTI[0]][0]) { case 0x0165: /* 'BrtSupSelf' */ o = XTI[1] == -1 ? "#REF" : supbooks.SheetNames[XTI[1]]; return XTI[1] == XTI[2] ? o : o + ":" + supbooks.SheetNames[XTI[2]]; case 0x0166: /* 'BrtSupSame' */ if(opts.SID != null) return supbooks.SheetNames[opts.SID]; return "SH33TJSSAME" + supbooks[XTI[0]][0]; case 0x0163: /* 'BrtSupBookSrc' */ /* falls through */ default: return "SH33TJSSRC" + supbooks[XTI[0]][0]; } switch(supbooks[XTI[0]][0][0]) { case 0x0401: o = XTI[1] == -1 ? "#REF" : (supbooks.SheetNames[XTI[1]] || "SH33TJSERR3"); return XTI[1] == XTI[2] ? o : o + ":" + supbooks.SheetNames[XTI[2]]; case 0x3A01: return supbooks[XTI[0]].slice(1).map(function(name) { return name.Name; }).join(";;"); //return "SH33TJSERR8"; default: if(!supbooks[XTI[0]][0][3]) return "SH33TJSERR2"; o = XTI[1] == -1 ? "#REF" : (supbooks[XTI[0]][0][3][XTI[1]] || "SH33TJSERR4"); return XTI[1] == XTI[2] ? o : o + ":" + supbooks[XTI[0]][0][3][XTI[2]]; } } function get_ixti(supbooks, ixti/*:number*/, opts)/*:string*/ { var ixtiraw = get_ixti_raw(supbooks, ixti, opts); return ixtiraw == "#REF" ? ixtiraw : formula_quote_sheet_name(ixtiraw, opts); } function stringify_formula(formula/*Array<any>*/, range, cell/*:any*/, supbooks, opts)/*:string*/ { var biff = (opts && opts.biff) || 8; var _range = /*range != null ? range :*/ {s:{c:0, r:0},e:{c:0, r:0}}; var stack/*:Array<string>*/ = [], e1, e2, /*::type,*/ c/*:CellAddress*/, ixti=0, nameidx=0, r, sname=""; if(!formula[0] || !formula[0][0]) return ""; var last_sp = -1, sp = ""; for(var ff = 0, fflen = formula[0].length; ff < fflen; ++ff) { var f = formula[0][ff]; switch(f[0]) { case 'PtgUminus': /* [MS-XLS] 2.5.198.93 */ stack.push("-" + stack.pop()); break; case 'PtgUplus': /* [MS-XLS] 2.5.198.95 */ stack.push("+" + stack.pop()); break; case 'PtgPercent': /* [MS-XLS] 2.5.198.81 */ stack.push(stack.pop() + "%"); break; case 'PtgAdd': /* [MS-XLS] 2.5.198.26 */ case 'PtgConcat': /* [MS-XLS] 2.5.198.43 */ case 'PtgDiv': /* [MS-XLS] 2.5.198.45 */ case 'PtgEq': /* [MS-XLS] 2.5.198.56 */ case 'PtgGe': /* [MS-XLS] 2.5.198.64 */ case 'PtgGt': /* [MS-XLS] 2.5.198.65 */ case 'PtgLe': /* [MS-XLS] 2.5.198.68 */ case 'PtgLt': /* [MS-XLS] 2.5.198.69 */ case 'PtgMul': /* [MS-XLS] 2.5.198.75 */ case 'PtgNe': /* [MS-XLS] 2.5.198.78 */ case 'PtgPower': /* [MS-XLS] 2.5.198.82 */ case 'PtgSub': /* [MS-XLS] 2.5.198.90 */ e1 = stack.pop(); e2 = stack.pop(); if(last_sp >= 0) { switch(formula[0][last_sp][1][0]) { case 0: // $FlowIgnore sp = fill(" ", formula[0][last_sp][1][1]); break; case 1: // $FlowIgnore sp = fill("\r", formula[0][last_sp][1][1]); break; default: sp = ""; // $FlowIgnore if(opts.WTF) throw new Error("Unexpected PtgAttrSpaceType " + formula[0][last_sp][1][0]); } e2 = e2 + sp; last_sp = -1; } stack.push(e2+PtgBinOp[f[0]]+e1); break; case 'PtgIsect': /* [MS-XLS] 2.5.198.67 */ e1 = stack.pop(); e2 = stack.pop(); stack.push(e2+" "+e1); break; case 'PtgUnion': /* [MS-XLS] 2.5.198.94 */ e1 = stack.pop(); e2 = stack.pop(); stack.push(e2+","+e1); break; case 'PtgRange': /* [MS-XLS] 2.5.198.83 */ e1 = stack.pop(); e2 = stack.pop(); stack.push(e2+":"+e1); break; case 'PtgAttrChoose': /* [MS-XLS] 2.5.198.34 */ break; case 'PtgAttrGoto': /* [MS-XLS] 2.5.198.35 */ break; case 'PtgAttrIf': /* [MS-XLS] 2.5.198.36 */ break; case 'PtgAttrIfError': /* [MS-XLSB] 2.5.97.28 */ break; case 'PtgRef': /* [MS-XLS] 2.5.198.84 */ /*::type = f[1][0]; */c = shift_cell_xls((f[1][1]/*:any*/), _range, opts); stack.push(encode_cell_xls(c, biff)); break; case 'PtgRefN': /* [MS-XLS] 2.5.198.88 */ /*::type = f[1][0]; */c = cell ? shift_cell_xls((f[1][1]/*:any*/), cell, opts) : (f[1][1]/*:any*/); stack.push(encode_cell_xls(c, biff)); break; case 'PtgRef3d': /* [MS-XLS] 2.5.198.85 */ /*::type = f[1][0]; */ixti = /*::Number(*/f[1][1]/*::)*/; c = shift_cell_xls((f[1][2]/*:any*/), _range, opts); sname = get_ixti(supbooks, ixti, opts); var w = sname; /* IE9 fails on defined names */ // eslint-disable-line no-unused-vars stack.push(sname + "!" + encode_cell_xls(c, biff)); break; case 'PtgFunc': /* [MS-XLS] 2.5.198.62 */ case 'PtgFuncVar': /* [MS-XLS] 2.5.198.63 */ /* f[1] = [argc, func, type] */ var argc/*:number*/ = (f[1][0]/*:any*/), func/*:string*/ = (f[1][1]/*:any*/); if(!argc) argc = 0; argc &= 0x7F; var args = argc == 0 ? [] : stack.slice(-argc); stack.length -= argc; if(func === 'User') func = args.shift(); stack.push(func + "(" + args.join(",") + ")"); break; case 'PtgBool': /* [MS-XLS] 2.5.198.42 */ stack.push(f[1] ? "TRUE" : "FALSE"); break; case 'PtgInt': /* [MS-XLS] 2.5.198.66 */ stack.push(/*::String(*/f[1]/*::)*/); break; case 'PtgNum': /* [MS-XLS] 2.5.198.79 TODO: precision? */ stack.push(String(f[1])); break; case 'PtgStr': /* [MS-XLS] 2.5.198.89 */ // $FlowIgnore stack.push('"' + f[1].replace(/"/g, '""') + '"'); break; case 'PtgErr': /* [MS-XLS] 2.5.198.57 */ stack.push(/*::String(*/f[1]/*::)*/); break; case 'PtgAreaN': /* [MS-XLS] 2.5.198.31 TODO */ /*::type = f[1][0]; */r = shift_range_xls(f[1][1], cell ? {s:cell} : _range, opts); stack.push(encode_range_xls((r/*:any*/), opts)); break; case 'PtgArea': /* [MS-XLS] 2.5.198.27 TODO: fixed points */ /*::type = f[1][0]; */r = shift_range_xls(f[1][1], _range, opts); stack.push(encode_range_xls((r/*:any*/), opts)); break; case 'PtgArea3d': /* [MS-XLS] 2.5.198.28 TODO */ /*::type = f[1][0]; */ixti = /*::Number(*/f[1][1]/*::)*/; r = f[1][2]; sname = get_ixti(supbooks, ixti, opts); stack.push(sname + "!" + encode_range_xls((r/*:any*/), opts)); break; case 'PtgAttrSum': /* [MS-XLS] 2.5.198.41 */ stack.push("SUM(" + stack.pop() + ")"); break; case 'PtgAttrBaxcel': /* [MS-XLS] 2.5.198.33 */ case 'PtgAttrSemi': /* [MS-XLS] 2.5.198.37 */ break; case 'PtgName': /* [MS-XLS] 2.5.198.76 ; [MS-XLSB] 2.5.97.60 TODO: revisions */ /* f[1] = type, 0, nameindex */ nameidx = (f[1][2]/*:any*/); var lbl = (supbooks.names||[])[nameidx-1] || (supbooks[0]||[])[nameidx]; var name = lbl ? lbl.Name : "SH33TJSNAME" + String(nameidx); /* [MS-XLSB] 2.5.97.10 Ftab -- last verified 20220204 */ if(name && name.slice(0,6) == "_xlfn." && !opts.xlfn) name = name.slice(6); stack.push(name); break; case 'PtgNameX': /* [MS-XLS] 2.5.198.77 ; [MS-XLSB] 2.5.97.61 TODO: revisions */ /* f[1] = type, ixti, nameindex */ var bookidx/*:number*/ = (f[1][1]/*:any*/); nameidx = (f[1][2]/*:any*/); var externbook; /* TODO: Properly handle missing values -- this should be using get_ixti_raw primarily */ if(opts.biff <= 5) { if(bookidx < 0) bookidx = -bookidx; if(supbooks[bookidx]) externbook = supbooks[bookidx][nameidx]; } else { var o = ""; if(((supbooks[bookidx]||[])[0]||[])[0] == 0x3A01){/* empty */} else if(((supbooks[bookidx]||[])[0]||[])[0] == 0x0401){ if(supbooks[bookidx][nameidx] && supbooks[bookidx][nameidx].itab > 0) { o = supbooks.SheetNames[supbooks[bookidx][nameidx].itab-1] + "!"; } } else o = supbooks.SheetNames[nameidx-1]+ "!"; if(supbooks[bookidx] && supbooks[bookidx][nameidx]) o += supbooks[bookidx][nameidx].Name; else if(supbooks[0] && supbooks[0][nameidx]) o += supbooks[0][nameidx].Name; else { var ixtidata = (get_ixti_raw(supbooks, bookidx, opts)||"").split(";;"); if(ixtidata[nameidx - 1]) o = ixtidata[nameidx - 1]; // TODO: confirm this is correct else o += "SH33TJSERRX"; } stack.push(o); break; } if(!externbook) externbook = {Name: "SH33TJSERRY"}; stack.push(externbook.Name); break; case 'PtgParen': /* [MS-XLS] 2.5.198.80 */ var lp = '(', rp = ')'; if(last_sp >= 0) { sp = ""; switch(formula[0][last_sp][1][0]) { // $FlowIgnore case 2: lp = fill(" ", formula[0][last_sp][1][1]) + lp; break; // $FlowIgnore case 3: lp = fill("\r", formula[0][last_sp][1][1]) + lp; break; // $FlowIgnore case 4: rp = fill(" ", formula[0][last_sp][1][1]) + rp; break; // $FlowIgnore case 5: rp = fill("\r", formula[0][last_sp][1][1]) + rp; break; default: // $FlowIgnore if(opts.WTF) throw new Error("Unexpected PtgAttrSpaceType " + formula[0][last_sp][1][0]); } last_sp = -1; } stack.push(lp + stack.pop() + rp); break; case 'PtgRefErr': /* [MS-XLS] 2.5.198.86 */ stack.push('#REF!'); break; case 'PtgRefErr3d': /* [MS-XLS] 2.5.198.87 */ stack.push('#REF!'); break; case 'PtgExp': /* [MS-XLS] 2.5.198.58 TODO */ c = {c:(f[1][1]/*:any*/),r:(f[1][0]/*:any*/)}; var q = ({c: cell.c, r:cell.r}/*:any*/); if(supbooks.sharedf[encode_cell(c)]) { var parsedf = (supbooks.sharedf[encode_cell(c)]); stack.push(stringify_formula(parsedf, _range, q, supbooks, opts)); } else { var fnd = false; for(e1=0;e1!=supbooks.arrayf.length; ++e1) { /* TODO: should be something like range_has */ e2 = supbooks.arrayf[e1]; if(c.c < e2[0].s.c || c.c > e2[0].e.c) continue; if(c.r < e2[0].s.r || c.r > e2[0].e.r) continue; stack.push(stringify_formula(e2[1], _range, q, supbooks, opts)); fnd = true; break; } if(!fnd) stack.push(/*::String(*/f[1]/*::)*/); } break; case 'PtgArray': /* [MS-XLS] 2.5.198.32 TODO */ stack.push("{" + stringify_array(/*::(*/f[1]/*:: :any)*/) + "}"); break; case 'PtgMemArea': /* [MS-XLS] 2.5.198.70 TODO: confirm this is a non-display */ //stack.push("(" + f[2].map(encode_range).join(",") + ")"); break; case 'PtgAttrSpace': /* [MS-XLS] 2.5.198.38 */ case 'PtgAttrSpaceSemi': /* [MS-XLS] 2.5.198.39 */ last_sp = ff; break; case 'PtgTbl': /* [MS-XLS] 2.5.198.92 TODO */ break; case 'PtgMemErr': /* [MS-XLS] 2.5.198.71 */ break; case 'PtgMissArg': /* [MS-XLS] 2.5.198.74 */ stack.push(""); break; case 'PtgAreaErr': /* [MS-XLS] 2.5.198.29 */ stack.push("#REF!"); break; case 'PtgAreaErr3d': /* [MS-XLS] 2.5.198.30 */ stack.push("#REF!"); break; case 'PtgList': /* [MS-XLSB] 2.5.97.52 */ // $FlowIgnore stack.push("Table" + f[1].idx + "[#" + f[1].rt + "]"); break; case 'PtgMemAreaN': case 'PtgMemNoMemN': case 'PtgAttrNoop': case 'PtgSheet': case 'PtgEndSheet': break; case 'PtgMemFunc': /* [MS-XLS] 2.5.198.72 TODO */ break; case 'PtgMemNoMem': /* [MS-XLS] 2.5.198.73 TODO */ break; case 'PtgElfCol': /* [MS-XLS] 2.5.198.46 */ case 'PtgElfColS': /* [MS-XLS] 2.5.198.47 */ case 'PtgElfColSV': /* [MS-XLS] 2.5.198.48 */ case 'PtgElfColV': /* [MS-XLS] 2.5.198.49 */ case 'PtgElfLel': /* [MS-XLS] 2.5.198.50 */ case 'PtgElfRadical': /* [MS-XLS] 2.5.198.51 */ case 'PtgElfRadicalLel': /* [MS-XLS] 2.5.198.52 */ case 'PtgElfRadicalS': /* [MS-XLS] 2.5.198.53 */ case 'PtgElfRw': /* [MS-XLS] 2.5.198.54 */ case 'PtgElfRwV': /* [MS-XLS] 2.5.198.55 */ throw new Error("Unsupported ELFs"); case 'PtgSxName': /* [MS-XLS] 2.5.198.91 TODO -- find a test case */ throw new Error('Unrecognized Formula Token: ' + String(f)); default: throw new Error('Unrecognized Formula Token: ' + String(f)); } var PtgNonDisp = ['PtgAttrSpace', 'PtgAttrSpaceSemi', 'PtgAttrGoto']; if(opts.biff != 3) if(last_sp >= 0 && PtgNonDisp.indexOf(formula[0][ff][0]) == -1) { f = formula[0][last_sp]; var _left = true; switch(f[1][0]) { /* note: some bad XLSB files omit the PtgParen */ case 4: _left = false; /* falls through */ case 0: // $FlowIgnore sp = fill(" ", f[1][1]); break; case 5: _left = false; /* falls through */ case 1: // $FlowIgnore sp = fill("\r", f[1][1]); break; default: sp = ""; // $FlowIgnore if(opts.WTF) throw new Error("Unexpected PtgAttrSpaceType " + f[1][0]); } stack.push((_left ? sp : "") + stack.pop() + (_left ? "" : sp)); last_sp = -1; } } if(stack.length > 1 && opts.WTF) throw new Error("bad formula stack"); return stack[0]; } /* [MS-XLS] 2.5.198.1 TODO */ function parse_ArrayParsedFormula(blob, length, opts/*::, ref*/) { var target = blob.l + length, len = opts.biff == 2 ? 1 : 2; var rgcb, cce = blob.read_shift(len); // length of rgce if(cce == 0xFFFF) return [[],parsenoop(blob, length-2)]; var rgce = parse_Rgce(blob, cce, opts); if(length !== cce + len) rgcb = parse_RgbExtra(blob, length - cce - len, rgce, opts); blob.l = target; return [rgce, rgcb]; } /* [MS-XLS] 2.5.198.3 TODO */ function parse_XLSCellParsedFormula(blob, length, opts) { var target = blob.l + length, len = opts.biff == 2 ? 1 : 2; var rgcb, cce = blob.read_shift(len); // length of rgce if(cce == 0xFFFF) return [[],parsenoop(blob, length-2)]; var rgce = parse_Rgce(blob, cce, opts); if(length !== cce + len) rgcb = parse_RgbExtra(blob, length - cce - len, rgce, opts); blob.l = target; return [rgce, rgcb]; } /* [MS-XLS] 2.5.198.21 */ function parse_NameParsedFormula(blob, length, opts, cce) { var target = blob.l + length; var rgce = parse_Rgce(blob, cce, opts); var rgcb; if(target !== blob.l) rgcb = parse_RgbExtra(blob, target - blob.l, rgce, opts); return [rgce, rgcb]; } /* [MS-XLS] 2.5.198.118 TODO */ function parse_SharedParsedFormula(blob, length, opts) { var target = blob.l + length; var rgcb, cce = blob.read_shift(2); // length of rgce var rgce = parse_Rgce(blob, cce, opts); if(cce == 0xFFFF) return [[],parsenoop(blob, length-2)]; if(length !== cce + 2) rgcb = parse_RgbExtra(blob, target - cce - 2, rgce, opts); return [rgce, rgcb]; } /* [MS-XLS] 2.5.133 TODO: how to emit empty strings? */ function parse_FormulaValue(blob/*::, length*/) { var b; if(__readUInt16LE(blob,blob.l + 6) !== 0xFFFF) return [parse_Xnum(blob),'n']; switch(blob[blob.l]) { case 0x00: blob.l += 8; return ["String", 's']; case 0x01: b = blob[blob.l+2] === 0x1; blob.l += 8; return [b,'b']; case 0x02: b = blob[blob.l+2]; blob.l += 8; return [b,'e']; case 0x03: blob.l += 8; return ["",'s']; } return []; } function write_FormulaValue(value) { if(value == null) { // Blank String Value var o = new_buf(8); o.write_shift(1, 0x03); o.write_shift(1, 0); o.write_shift(2, 0); o.write_shift(2, 0); o.write_shift(2, 0xFFFF); return o; } else if(typeof value == "number") return write_Xnum(value); return write_Xnum(0); } /* [MS-XLS] 2.4.127 TODO */ function parse_Formula(blob, length, opts) { var end = blob.l + length; var cell = parse_XLSCell(blob, 6); if(opts.biff == 2) ++blob.l; var val = parse_FormulaValue(blob,8); var flags = blob.read_shift(1); if(opts.biff != 2) { blob.read_shift(1); if(opts.biff >= 5) { /*var chn = */blob.read_shift(4); } } var cbf = parse_XLSCellParsedFormula(blob, end - blob.l, opts); return {cell:cell, val:val[0], formula:cbf, shared: (flags >> 3) & 1, tt:val[1]}; } function write_Formula(cell/*:Cell*/, R/*:number*/, C/*:number*/, opts, os/*:number*/) { // Cell var o1 = write_XLSCell(R, C, os); // FormulaValue var o2 = write_FormulaValue(cell.v); // flags + cache var o3 = new_buf(6); var flags = 0x01 | 0x20; o3.write_shift(2, flags); o3.write_shift(4, 0); // CellParsedFormula var bf = new_buf(cell.bf.length); for(var i = 0; i < cell.bf.length; ++i) bf[i] = cell.bf[i]; var out = bconcat([o1, o2, o3, bf]); return out; } /* XLSB Parsed Formula records have the same shape */ function parse_XLSBParsedFormula(data, length, opts) { var cce = data.read_shift(4); var rgce = parse_Rgce(data, cce, opts); var cb = data.read_shift(4); var rgcb = cb > 0 ? parse_RgbExtra(data, cb, rgce, opts) : null; return [rgce, rgcb]; } /* [MS-XLSB] 2.5.97.1 ArrayParsedFormula */ var parse_XLSBArrayParsedFormula = parse_XLSBParsedFormula; /* [MS-XLSB] 2.5.97.4 CellParsedFormula */ var parse_XLSBCellParsedFormula = parse_XLSBParsedFormula; /* [MS-XLSB] 2.5.97.8 DVParsedFormula */ //var parse_XLSBDVParsedFormula = parse_XLSBParsedFormula; /* [MS-XLSB] 2.5.97.9 FRTParsedFormula */ //var parse_XLSBFRTParsedFormula = parse_XLSBParsedFormula2; /* [MS-XLSB] 2.5.97.12 NameParsedFormula */ var parse_XLSBNameParsedFormula = parse_XLSBParsedFormula; /* [MS-XLSB] 2.5.97.98 SharedParsedFormula */ var parse_XLSBSharedParsedFormula = parse_XLSBParsedFormula; var Cetab = { 0: "BEEP", 1: "OPEN", 2: "OPEN.LINKS", 3: "CLOSE.ALL", 4: "SAVE", 5: "SAVE.AS", 6: "FILE.DELETE", 7: "PAGE.SETUP", 8: "PRINT", 9: "PRINTER.SETUP", 10: "QUIT", 11: "NEW.WINDOW", 12: "ARRANGE.ALL", 13: "WINDOW.SIZE", 14: "WINDOW.MOVE", 15: "FULL", 16: "CLOSE", 17: "RUN", 22: "SET.PRINT.AREA", 23: "SET.PRINT.TITLES", 24: "SET.PAGE.BREAK", 25: "REMOVE.PAGE.BREAK", 26: "FONT", 27: "DISPLAY", 28: "PROTECT.DOCUMENT", 29: "PRECISION", 30: "A1.R1C1", 31: "CALCULATE.NOW", 32: "CALCULATION", 34: "DATA.FIND", 35: "EXTRACT", 36: "DATA.DELETE", 37: "SET.DATABASE", 38: "SET.CRITERIA", 39: "SORT", 40: "DATA.SERIES", 41: "TABLE", 42: "FORMAT.NUMBER", 43: "ALIGNMENT", 44: "STYLE", 45: "BORDER", 46: "CELL.PROTECTION", 47: "COLUMN.WIDTH", 48: "UNDO", 49: "CUT", 50: "COPY", 51: "PASTE", 52: "CLEAR", 53: "PASTE.SPECIAL", 54: "EDIT.DELETE", 55: "INSERT", 56: "FILL.RIGHT", 57: "FILL.DOWN", 61: "DEFINE.NAME", 62: "CREATE.NAMES", 63: "FORMULA.GOTO", 64: "FORMULA.FIND", 65: "SELECT.LAST.CELL", 66: "SHOW.ACTIVE.CELL", 67: "GALLERY.AREA", 68: "GALLERY.BAR", 69: "GALLERY.COLUMN", 70: "GALLERY.LINE", 71: "GALLERY.PIE", 72: "GALLERY.SCATTER", 73: "COMBINATION", 74: "PREFERRED", 75: "ADD.OVERLAY", 76: "GRIDLINES", 77: "SET.PREFERRED", 78: "AXES", 79: "LEGEND", 80: "ATTACH.TEXT", 81: "ADD.ARROW", 82: "SELECT.CHART", 83: "SELECT.PLOT.AREA", 84: "PATTERNS", 85: "MAIN.CHART", 86: "OVERLAY", 87: "SCALE", 88: "FORMAT.LEGEND", 89: "FORMAT.TEXT", 90: "EDIT.REPEAT", 91: "PARSE", 92: "JUSTIFY", 93: "HIDE", 94: "UNHIDE", 95: "WORKSPACE", 96: "FORMULA", 97: "FORMULA.FILL", 98: "FORMULA.ARRAY", 99: "DATA.FIND.NEXT", 100: "DATA.FIND.PREV", 101: "FORMULA.FIND.NEXT", 102: "FORMULA.FIND.PREV", 103: "ACTIVATE", 104: "ACTIVATE.NEXT", 105: "ACTIVATE.PREV", 106: "UNLOCKED.NEXT", 107: "UNLOCKED.PREV", 108: "COPY.PICTURE", 109: "SELECT", 110: "DELETE.NAME", 111: "DELETE.FORMAT", 112: "VLINE", 113: "HLINE", 114: "VPAGE", 115: "HPAGE", 116: "VSCROLL", 117: "HSCROLL", 118: "ALERT", 119: "NEW", 120: "CANCEL.COPY", 121: "SHOW.CLIPBOARD", 122: "MESSAGE", 124: "PASTE.LINK", 125: "APP.ACTIVATE", 126: "DELETE.ARROW", 127: "ROW.HEIGHT", 128: "FORMAT.MOVE", 129: "FORMAT.SIZE", 130: "FORMULA.REPLACE", 131: "SEND.KEYS", 132: "SELECT.SPECIAL", 133: "APPLY.NAMES", 134: "REPLACE.FONT", 135: "FREEZE.PANES", 136: "SHOW.INFO", 137: "SPLIT", 138: "ON.WINDOW", 139: "ON.DATA", 140: "DISABLE.INPUT", 142: "OUTLINE", 143: "LIST.NAMES", 144: "FILE.CLOSE", 145: "SAVE.WORKBOOK", 146: "DATA.FORM", 147: "COPY.CHART", 148: "ON.TIME", 149: "WAIT", 150: "FORMAT.FONT", 151: "FILL.UP", 152: "FILL.LEFT", 153: "DELETE.OVERLAY", 155: "SHORT.MENUS", 159: "SET.UPDATE.STATUS", 161: "COLOR.PALETTE", 162: "DELETE.STYLE", 163: "WINDOW.RESTORE", 164: "WINDOW.MAXIMIZE", 166: "CHANGE.LINK", 167: "CALCULATE.DOCUMENT", 168: "ON.KEY", 169: "APP.RESTORE", 170: "APP.MOVE", 171: "APP.SIZE", 172: "APP.MINIMIZE", 173: "APP.MAXIMIZE", 174: "BRING.TO.FRONT", 175: "SEND.TO.BACK", 185: "MAIN.CHART.TYPE", 186: "OVERLAY.CHART.TYPE", 187: "SELECT.END", 188: "OPEN.MAIL", 189: "SEND.MAIL", 190: "STANDARD.FONT", 191: "CONSOLIDATE", 192: "SORT.SPECIAL", 193: "GALLERY.3D.AREA", 194: "GALLERY.3D.COLUMN", 195: "GALLERY.3D.LINE", 196: "GALLERY.3D.PIE", 197: "VIEW.3D", 198: "GOAL.SEEK", 199: "WORKGROUP", 200: "FILL.GROUP", 201: "UPDATE.LINK", 202: "PROMOTE", 203: "DEMOTE", 204: "SHOW.DETAIL", 206: "UNGROUP", 207: "OBJECT.PROPERTIES", 208: "SAVE.NEW.OBJECT", 209: "SHARE", 210: "SHARE.NAME", 211: "DUPLICATE", 212: "APPLY.STYLE", 213: "ASSIGN.TO.OBJECT", 214: "OBJECT.PROTECTION", 215: "HIDE.OBJECT", 216: "SET.EXTRACT", 217: "CREATE.PUBLISHER", 218: "SUBSCRIBE.TO", 219: "ATTRIBUTES", 220: "SHOW.TOOLBAR", 222: "PRINT.PREVIEW", 223: "EDIT.COLOR", 224: "SHOW.LEVELS", 225: "FORMAT.MAIN", 226: "FORMAT.OVERLAY", 227: "ON.RECALC", 228: "EDIT.SERIES", 229: "DEFINE.STYLE", 240: "LINE.PRINT", 243: "ENTER.DATA", 249: "GALLERY.RADAR", 250: "MERGE.STYLES", 251: "EDITION.OPTIONS", 252: "PASTE.PICTURE", 253: "PASTE.PICTURE.LINK", 254: "SPELLING", 256: "ZOOM", 259: "INSERT.OBJECT", 260: "WINDOW.MINIMIZE", 265: "SOUND.NOTE", 266: "SOUND.PLAY", 267: "FORMAT.SHAPE", 268: "EXTEND.POLYGON", 269: "FORMAT.AUTO", 272: "GALLERY.3D.BAR", 273: "GALLERY.3D.SURFACE", 274: "FILL.AUTO", 276: "CUSTOMIZE.TOOLBAR", 277: "ADD.TOOL", 278: "EDIT.OBJECT", 279: "ON.DOUBLECLICK", 280: "ON.ENTRY", 281: "WORKBOOK.ADD", 282: "WORKBOOK.MOVE", 283: "WORKBOOK.COPY", 284: "WORKBOOK.OPTIONS", 285: "SAVE.WORKSPACE", 288: "CHART.WIZARD", 289: "DELETE.TOOL", 290: "MOVE.TOOL", 291: "WORKBOOK.SELECT", 292: "WORKBOOK.ACTIVATE", 293: "ASSIGN.TO.TOOL", 295: "COPY.TOOL", 296: "RESET.TOOL", 297: "CONSTRAIN.NUMERIC", 298: "PASTE.TOOL", 302: "WORKBOOK.NEW", 305: "SCENARIO.CELLS", 306: "SCENARIO.DELETE", 307: "SCENARIO.ADD", 308: "SCENARIO.EDIT", 309: "SCENARIO.SHOW", 310: "SCENARIO.SHOW.NEXT", 311: "SCENARIO.SUMMARY", 312: "PIVOT.TABLE.WIZARD", 313: "PIVOT.FIELD.PROPERTIES", 314: "PIVOT.FIELD", 315: "PIVOT.ITEM", 316: "PIVOT.ADD.FIELDS", 318: "OPTIONS.CALCULATION", 319: "OPTIONS.EDIT", 320: "OPTIONS.VIEW", 321: "ADDIN.MANAGER", 322: "MENU.EDITOR", 323: "ATTACH.TOOLBARS", 324: "VBAActivate", 325: "OPTIONS.CHART", 328: "VBA.INSERT.FILE", 330: "VBA.PROCEDURE.DEFINITION", 336: "ROUTING.SLIP", 338: "ROUTE.DOCUMENT", 339: "MAIL.LOGON", 342: "INSERT.PICTURE", 343: "EDIT.TOOL", 344: "GALLERY.DOUGHNUT", 350: "CHART.TREND", 352: "PIVOT.ITEM.PROPERTIES", 354: "WORKBOOK.INSERT", 355: "OPTIONS.TRANSITION", 356: "OPTIONS.GENERAL", 370: "FILTER.ADVANCED", 373: "MAIL.ADD.MAILER", 374: "MAIL.DELETE.MAILER", 375: "MAIL.REPLY", 376: "MAIL.REPLY.ALL", 377: "MAIL.FORWARD", 378: "MAIL.NEXT.LETTER", 379: "DATA.LABEL", 380: "INSERT.TITLE", 381: "FONT.PROPERTIES", 382: "MACRO.OPTIONS", 383: "WORKBOOK.HIDE", 384: "WORKBOOK.UNHIDE", 385: "WORKBOOK.DELETE", 386: "WORKBOOK.NAME", 388: "GALLERY.CUSTOM", 390: "ADD.CHART.AUTOFORMAT", 391: "DELETE.CHART.AUTOFORMAT", 392: "CHART.ADD.DATA", 393: "AUTO.OUTLINE", 394: "TAB.ORDER", 395: "SHOW.DIALOG", 396: "SELECT.ALL", 397: "UNGROUP.SHEETS", 398: "SUBTOTAL.CREATE", 399: "SUBTOTAL.REMOVE", 400: "RENAME.OBJECT", 412: "WORKBOOK.SCROLL", 413: "WORKBOOK.NEXT", 414: "WORKBOOK.PREV", 415: "WORKBOOK.TAB.SPLIT", 416: "FULL.SCREEN", 417: "WORKBOOK.PROTECT", 420: "SCROLLBAR.PROPERTIES", 421: "PIVOT.SHOW.PAGES", 422: "TEXT.TO.COLUMNS", 423: "FORMAT.CHARTTYPE", 424: "LINK.FORMAT", 425: "TRACER.DISPLAY", 430: "TRACER.NAVIGATE", 431: "TRACER.CLEAR", 432: "TRACER.ERROR", 433: "PIVOT.FIELD.GROUP", 434: "PIVOT.FIELD.UNGROUP", 435: "CHECKBOX.PROPERTIES", 436: "LABEL.PROPERTIES", 437: "LISTBOX.PROPERTIES", 438: "EDITBOX.PROPERTIES", 439: "PIVOT.REFRESH", 440: "LINK.COMBO", 441: "OPEN.TEXT", 442: "HIDE.DIALOG", 443: "SET.DIALOG.FOCUS", 444: "ENABLE.OBJECT", 445: "PUSHBUTTON.PROPERTIES", 446: "SET.DIALOG.DEFAULT", 447: "FILTER", 448: "FILTER.SHOW.ALL", 449: "CLEAR.OUTLINE", 450: "FUNCTION.WIZARD", 451: "ADD.LIST.ITEM", 452: "SET.LIST.ITEM", 453: "REMOVE.LIST.ITEM", 454: "SELECT.LIST.ITEM", 455: "SET.CONTROL.VALUE", 456: "SAVE.COPY.AS", 458: "OPTIONS.LISTS.ADD", 459: "OPTIONS.LISTS.DELETE", 460: "SERIES.AXES", 461: "SERIES.X", 462: "SERIES.Y", 463: "ERRORBAR.X", 464: "ERRORBAR.Y", 465: "FORMAT.CHART", 466: "SERIES.ORDER", 467: "MAIL.LOGOFF", 468: "CLEAR.ROUTING.SLIP", 469: "APP.ACTIVATE.MICROSOFT", 470: "MAIL.EDIT.MAILER", 471: "ON.SHEET", 472: "STANDARD.WIDTH", 473: "SCENARIO.MERGE", 474: "SUMMARY.INFO", 475: "FIND.FILE", 476: "ACTIVE.CELL.FONT", 477: "ENABLE.TIPWIZARD", 478: "VBA.MAKE.ADDIN", 480: "INSERTDATATABLE", 481: "WORKGROUP.OPTIONS", 482: "MAIL.SEND.MAILER", 485: "AUTOCORRECT", 489: "POST.DOCUMENT", 491: "PICKLIST", 493: "VIEW.SHOW", 494: "VIEW.DEFINE", 495: "VIEW.DELETE", 509: "SHEET.BACKGROUND", 510: "INSERT.MAP.OBJECT", 511: "OPTIONS.MENONO", 517: "MSOCHECKS", 518: "NORMAL", 519: "LAYOUT", 520: "RM.PRINT.AREA", 521: "CLEAR.PRINT.AREA", 522: "ADD.PRINT.AREA", 523: "MOVE.BRK", 545: "HIDECURR.NOTE", 546: "HIDEALL.NOTES", 547: "DELETE.NOTE", 548: "TRAVERSE.NOTES", 549: "ACTIVATE.NOTES", 620: "PROTECT.REVISIONS", 621: "UNPROTECT.REVISIONS", 647: "OPTIONS.ME", 653: "WEB.PUBLISH", 667: "NEWWEBQUERY", 673: "PIVOT.TABLE.CHART", 753: "OPTIONS.SAVE", 755: "OPTIONS.SPELL", 808: "HIDEALL.INKANNOTS" }; var Ftab = { 0: "COUNT", 1: "IF", 2: "ISNA", 3: "ISERROR", 4: "SUM", 5: "AVERAGE", 6: "MIN", 7: "MAX", 8: "ROW", 9: "COLUMN", 10: "NA", 11: "NPV", 12: "STDEV", 13: "DOLLAR", 14: "FIXED", 15: "SIN", 16: "COS", 17: "TAN", 18: "ATAN", 19: "PI", 20: "SQRT", 21: "EXP", 22: "LN", 23: "LOG10", 24: "ABS", 25: "INT", 26: "SIGN", 27: "ROUND", 28: "LOOKUP", 29: "INDEX", 30: "REPT", 31: "MID", 32: "LEN", 33: "VALUE", 34: "TRUE", 35: "FALSE", 36: "AND", 37: "OR", 38: "NOT", 39: "MOD", 40: "DCOUNT", 41: "DSUM", 42: "DAVERAGE", 43: "DMIN", 44: "DMAX", 45: "DSTDEV", 46: "VAR", 47: "DVAR", 48: "TEXT", 49: "LINEST", 50: "TREND", 51: "LOGEST", 52: "GROWTH", 53: "GOTO", 54: "HALT", 55: "RETURN", 56: "PV", 57: "FV", 58: "NPER", 59: "PMT", 60: "RATE", 61: "MIRR", 62: "IRR", 63: "RAND", 64: "MATCH", 65: "DATE", 66: "TIME", 67: "DAY", 68: "MONTH", 69: "YEAR", 70: "WEEKDAY", 71: "HOUR", 72: "MINUTE", 73: "SECOND", 74: "NOW", 75: "AREAS", 76: "ROWS", 77: "COLUMNS", 78: "OFFSET", 79: "ABSREF", 80: "RELREF", 81: "ARGUMENT", 82: "SEARCH", 83: "TRANSPOSE", 84: "ERROR", 85: "STEP", 86: "TYPE", 87: "ECHO", 88: "SET.NAME", 89: "CALLER", 90: "DEREF", 91: "WINDOWS", 92: "SERIES", 93: "DOCUMENTS", 94: "ACTIVE.CELL", 95: "SELECTION", 96: "RESULT", 97: "ATAN2", 98: "ASIN", 99: "ACOS", 100: "CHOOSE", 101: "HLOOKUP", 102: "VLOOKUP", 103: "LINKS", 104: "INPUT", 105: "ISREF", 106: "GET.FORMULA", 107: "GET.NAME", 108: "SET.VALUE", 109: "LOG", 110: "EXEC", 111: "CHAR", 112: "LOWER", 113: "UPPER", 114: "PROPER", 115: "LEFT", 116: "RIGHT", 117: "EXACT", 118: "TRIM", 119: "REPLACE", 120: "SUBSTITUTE", 121: "CODE", 122: "NAMES", 123: "DIRECTORY", 124: "FIND", 125: "CELL", 126: "ISERR", 127: "ISTEXT", 128: "ISNUMBER", 129: "ISBLANK", 130: "T", 131: "N", 132: "FOPEN", 133: "FCLOSE", 134: "FSIZE", 135: "FREADLN", 136: "FREAD", 137: "FWRITELN", 138: "FWRITE", 139: "FPOS", 140: "DATEVALUE", 141: "TIMEVALUE", 142: "SLN", 143: "SYD", 144: "DDB", 145: "GET.DEF", 146: "REFTEXT", 147: "TEXTREF", 148: "INDIRECT", 149: "REGISTER", 150: "CALL", 151: "ADD.BAR", 152: "ADD.MENU", 153: "ADD.COMMAND", 154: "ENABLE.COMMAND", 155: "CHECK.COMMAND", 156: "RENAME.COMMAND", 157: "SHOW.BAR", 158: "DELETE.MENU", 159: "DELETE.COMMAND", 160: "GET.CHART.ITEM", 161: "DIALOG.BOX", 162: "CLEAN", 163: "MDETERM", 164: "MINVERSE", 165: "MMULT", 166: "FILES", 167: "IPMT", 168: "PPMT", 169: "COUNTA", 170: "CANCEL.KEY", 171: "FOR", 172: "WHILE", 173: "BREAK", 174: "NEXT", 175: "INITIATE", 176: "REQUEST", 177: "POKE", 178: "EXECUTE", 179: "TERMINATE", 180: "RESTART", 181: "HELP", 182: "GET.BAR", 183: "PRODUCT", 184: "FACT", 185: "GET.CELL", 186: "GET.WORKSPACE", 187: "GET.WINDOW", 188: "GET.DOCUMENT", 189: "DPRODUCT", 190: "ISNONTEXT", 191: "GET.NOTE", 192: "NOTE", 193: "STDEVP", 194: "VARP", 195: "DSTDEVP", 196: "DVARP", 197: "TRUNC", 198: "ISLOGICAL", 199: "DCOUNTA", 200: "DELETE.BAR", 201: "UNREGISTER", 204: "USDOLLAR", 205: "FINDB", 206: "SEARCHB", 207: "REPLACEB", 208: "LEFTB", 209: "RIGHTB", 210: "MIDB", 211: "LENB", 212: "ROUNDUP", 213: "ROUNDDOWN", 214: "ASC", 215: "DBCS", 216: "RANK", 219: "ADDRESS", 220: "DAYS360", 221: "TODAY", 222: "VDB", 223: "ELSE", 224: "ELSE.IF", 225: "END.IF", 226: "FOR.CELL", 227: "MEDIAN", 228: "SUMPRODUCT", 229: "SINH", 230: "COSH", 231: "TANH", 232: "ASINH", 233: "ACOSH", 234: "ATANH", 235: "DGET", 236: "CREATE.OBJECT", 237: "VOLATILE", 238: "LAST.ERROR", 239: "CUSTOM.UNDO", 240: "CUSTOM.REPEAT", 241: "FORMULA.CONVERT", 242: "GET.LINK.INFO", 243: "TEXT.BOX", 244: "INFO", 245: "GROUP", 246: "GET.OBJECT", 247: "DB", 248: "PAUSE", 251: "RESUME", 252: "FREQUENCY", 253: "ADD.TOOLBAR", 254: "DELETE.TOOLBAR", 255: "User", 256: "RESET.TOOLBAR", 257: "EVALUATE", 258: "GET.TOOLBAR", 259: "GET.TOOL", 260: "SPELLING.CHECK", 261: "ERROR.TYPE", 262: "APP.TITLE", 263: "WINDOW.TITLE", 264: "SAVE.TOOLBAR", 265: "ENABLE.TOOL", 266: "PRESS.TOOL", 267: "REGISTER.ID", 268: "GET.WORKBOOK", 269: "AVEDEV", 270: "BETADIST", 271: "GAMMALN", 272: "BETAINV", 273: "BINOMDIST", 274: "CHIDIST", 275: "CHIINV", 276: "COMBIN", 277: "CONFIDENCE", 278: "CRITBINOM", 279: "EVEN", 280: "EXPONDIST", 281: "FDIST", 282: "FINV", 283: "FISHER", 284: "FISHERINV", 285: "FLOOR", 286: "GAMMADIST", 287: "GAMMAINV", 288: "CEILING", 289: "HYPGEOMDIST", 290: "LOGNORMDIST", 291: "LOGINV", 292: "NEGBINOMDIST", 293: "NORMDIST", 294: "NORMSDIST", 295: "NORMINV", 296: "NORMSINV", 297: "STANDARDIZE", 298: "ODD", 299: "PERMUT", 300: "POISSON", 301: "TDIST", 302: "WEIBULL", 303: "SUMXMY2", 304: "SUMX2MY2", 305: "SUMX2PY2", 306: "CHITEST", 307: "CORREL", 308: "COVAR", 309: "FORECAST", 310: "FTEST", 311: "INTERCEPT", 312: "PEARSON", 313: "RSQ", 314: "STEYX", 315: "SLOPE", 316: "TTEST", 317: "PROB", 318: "DEVSQ", 319: "GEOMEAN", 320: "HARMEAN", 321: "SUMSQ", 322: "KURT", 323: "SKEW", 324: "ZTEST", 325: "LARGE", 326: "SMALL", 327: "QUARTILE", 328: "PERCENTILE", 329: "PERCENTRANK", 330: "MODE", 331: "TRIMMEAN", 332: "TINV", 334: "MOVIE.COMMAND", 335: "GET.MOVIE", 336: "CONCATENATE", 337: "POWER", 338: "PIVOT.ADD.DATA", 339: "GET.PIVOT.TABLE", 340: "GET.PIVOT.FIELD", 341: "GET.PIVOT.ITEM", 342: "RADIANS", 343: "DEGREES", 344: "SUBTOTAL", 345: "SUMIF", 346: "COUNTIF", 347: "COUNTBLANK", 348: "SCENARIO.GET", 349: "OPTIONS.LISTS.GET", 350: "ISPMT", 351: "DATEDIF", 352: "DATESTRING", 353: "NUMBERSTRING", 354: "ROMAN", 355: "OPEN.DIALOG", 356: "SAVE.DIALOG", 357: "VIEW.GET", 358: "GETPIVOTDATA", 359: "HYPERLINK", 360: "PHONETIC", 361: "AVERAGEA", 362: "MAXA", 363: "MINA", 364: "STDEVPA", 365: "VARPA", 366: "STDEVA", 367: "VARA", 368: "BAHTTEXT", 369: "THAIDAYOFWEEK", 370: "THAIDIGIT", 371: "THAIMONTHOFYEAR", 372: "THAINUMSOUND", 373: "THAINUMSTRING", 374: "THAISTRINGLENGTH", 375: "ISTHAIDIGIT", 376: "ROUNDBAHTDOWN", 377: "ROUNDBAHTUP", 378: "THAIYEAR", 379: "RTD", 380: "CUBEVALUE", 381: "CUBEMEMBER", 382: "CUBEMEMBERPROPERTY", 383: "CUBERANKEDMEMBER", 384: "HEX2BIN", 385: "HEX2DEC", 386: "HEX2OCT", 387: "DEC2BIN", 388: "DEC2HEX", 389: "DEC2OCT", 390: "OCT2BIN", 391: "OCT2HEX", 392: "OCT2DEC", 393: "BIN2DEC", 394: "BIN2OCT", 395: "BIN2HEX", 396: "IMSUB", 397: "IMDIV", 398: "IMPOWER", 399: "IMABS", 400: "IMSQRT", 401: "IMLN", 402: "IMLOG2", 403: "IMLOG10", 404: "IMSIN", 405: "IMCOS", 406: "IMEXP", 407: "IMARGUMENT", 408: "IMCONJUGATE", 409: "IMAGINARY", 410: "IMREAL", 411: "COMPLEX", 412: "IMSUM", 413: "IMPRODUCT", 414: "SERIESSUM", 415: "FACTDOUBLE", 416: "SQRTPI", 417: "QUOTIENT", 418: "DELTA", 419: "GESTEP", 420: "ISEVEN", 421: "ISODD", 422: "MROUND", 423: "ERF", 424: "ERFC", 425: "BESSELJ", 426: "BESSELK", 427: "BESSELY", 428: "BESSELI", 429: "XIRR", 430: "XNPV", 431: "PRICEMAT", 432: "YIELDMAT", 433: "INTRATE", 434: "RECEIVED", 435: "DISC", 436: "PRICEDISC", 437: "YIELDDISC", 438: "TBILLEQ", 439: "TBILLPRICE", 440: "TBILLYIELD", 441: "PRICE", 442: "YIELD", 443: "DOLLARDE", 444: "DOLLARFR", 445: "NOMINAL", 446: "EFFECT", 447: "CUMPRINC", 448: "CUMIPMT", 449: "EDATE", 450: "EOMONTH", 451: "YEARFRAC", 452: "COUPDAYBS", 453: "COUPDAYS", 454: "COUPDAYSNC", 455: "COUPNCD", 456: "COUPNUM", 457: "COUPPCD", 458: "DURATION", 459: "MDURATION", 460: "ODDLPRICE", 461: "ODDLYIELD", 462: "ODDFPRICE", 463: "ODDFYIELD", 464: "RANDBETWEEN", 465: "WEEKNUM", 466: "AMORDEGRC", 467: "AMORLINC", 468: "CONVERT", 724: "SHEETJS", 469: "ACCRINT", 470: "ACCRINTM", 471: "WORKDAY", 472: "NETWORKDAYS", 473: "GCD", 474: "MULTINOMIAL", 475: "LCM", 476: "FVSCHEDULE", 477: "CUBEKPIMEMBER", 478: "CUBESET", 479: "CUBESETCOUNT", 480: "IFERROR", 481: "COUNTIFS", 482: "SUMIFS", 483: "AVERAGEIF", 484: "AVERAGEIFS" }; var FtabArgc = { 2: 1, 3: 1, 10: 0, 15: 1, 16: 1, 17: 1, 18: 1, 19: 0, 20: 1, 21: 1, 22: 1, 23: 1, 24: 1, 25: 1, 26: 1, 27: 2, 30: 2, 31: 3, 32: 1, 33: 1, 34: 0, 35: 0, 38: 1, 39: 2, 40: 3, 41: 3, 42: 3, 43: 3, 44: 3, 45: 3, 47: 3, 48: 2, 53: 1, 61: 3, 63: 0, 65: 3, 66: 3, 67: 1, 68: 1, 69: 1, 70: 1, 71: 1, 72: 1, 73: 1, 74: 0, 75: 1, 76: 1, 77: 1, 79: 2, 80: 2, 83: 1, 85: 0, 86: 1, 89: 0, 90: 1, 94: 0, 95: 0, 97: 2, 98: 1, 99: 1, 101: 3, 102: 3, 105: 1, 106: 1, 108: 2, 111: 1, 112: 1, 113: 1, 114: 1, 117: 2, 118: 1, 119: 4, 121: 1, 126: 1, 127: 1, 128: 1, 129: 1, 130: 1, 131: 1, 133: 1, 134: 1, 135: 1, 136: 2, 137: 2, 138: 2, 140: 1, 141: 1, 142: 3, 143: 4, 144: 4, 161: 1, 162: 1, 163: 1, 164: 1, 165: 2, 172: 1, 175: 2, 176: 2, 177: 3, 178: 2, 179: 1, 184: 1, 186: 1, 189: 3, 190: 1, 195: 3, 196: 3, 197: 1, 198: 1, 199: 3, 201: 1, 207: 4, 210: 3, 211: 1, 212: 2, 213: 2, 214: 1, 215: 1, 225: 0, 229: 1, 230: 1, 231: 1, 232: 1, 233: 1, 234: 1, 235: 3, 244: 1, 247: 4, 252: 2, 257: 1, 261: 1, 271: 1, 273: 4, 274: 2, 275: 2, 276: 2, 277: 3, 278: 3, 279: 1, 280: 3, 281: 3, 282: 3, 283: 1, 284: 1, 285: 2, 286: 4, 287: 3, 288: 2, 289: 4, 290: 3, 291: 3, 292: 3, 293: 4, 294: 1, 295: 3, 296: 1, 297: 3, 298: 1, 299: 2, 300: 3, 301: 3, 302: 4, 303: 2, 304: 2, 305: 2, 306: 2, 307: 2, 308: 2, 309: 3, 310: 2, 311: 2, 312: 2, 313: 2, 314: 2, 315: 2, 316: 4, 325: 2, 326: 2, 327: 2, 328: 2, 331: 2, 332: 2, 337: 2, 342: 1, 343: 1, 346: 2, 347: 1, 350: 4, 351: 3, 352: 1, 353: 2, 360: 1, 368: 1, 369: 1, 370: 1, 371: 1, 372: 1, 373: 1, 374: 1, 375: 1, 376: 1, 377: 1, 378: 1, 382: 3, 385: 1, 392: 1, 393: 1, 396: 2, 397: 2, 398: 2, 399: 1, 400: 1, 401: 1, 402: 1, 403: 1, 404: 1, 405: 1, 406: 1, 407: 1, 408: 1, 409: 1, 410: 1, 414: 4, 415: 1, 416: 1, 417: 2, 420: 1, 421: 1, 422: 2, 424: 1, 425: 2, 426: 2, 427: 2, 428: 2, 430: 3, 438: 3, 439: 3, 440: 3, 443: 2, 444: 2, 445: 2, 446: 2, 447: 6, 448: 6, 449: 2, 450: 2, 464: 2, 468: 3, 476: 2, 479: 1, 480: 2, 65535: 0 }; /* Part 3 TODO: actually parse formulae */ function ods_to_csf_formula(f/*:string*/)/*:string*/ { if(f.slice(0,3) == "of:") f = f.slice(3); /* 5.2 Basic Expressions */ if(f.charCodeAt(0) == 61) { f = f.slice(1); if(f.charCodeAt(0) == 61) f = f.slice(1); } f = f.replace(/COM\.MICROSOFT\./g, ""); /* Part 3 Section 5.8 References */ f = f.replace(/\[((?:\.[A-Z]+[0-9]+)(?::\.[A-Z]+[0-9]+)?)\]/g, function($$, $1) { return $1.replace(/\./g,""); }); /* TODO: something other than this */ f = f.replace(/\[.(#[A-Z]*[?!])\]/g, "$1"); return f.replace(/[;~]/g,",").replace(/\|/g,";"); } function csf_to_ods_formula(f/*:string*/)/*:string*/ { var o = "of:=" + f.replace(crefregex, "$1[.$2$3$4$5]").replace(/\]:\[/g,":"); /* TODO: something other than this */ return o.replace(/;/g, "|").replace(/,/g,";"); } function ods_to_csf_3D(r/*:string*/)/*:[string, string]*/ { var a = r.split(":"); var s = a[0].split(".")[0]; return [s, a[0].split(".")[1] + (a.length > 1 ? (":" + (a[1].split(".")[1] || a[1].split(".")[0])) : "")]; } function csf_to_ods_3D(r/*:string*/)/*:string*/ { return r.replace(/\./,"!"); } var strs = {}; // shared strings var _ssfopts = {}; // spreadsheet formatting options /*global Map */ var browser_has_Map = typeof Map !== 'undefined'; function get_sst_id(sst/*:SST*/, str/*:string*/, rev)/*:number*/ { var i = 0, len = sst.length; if(rev) { if(browser_has_Map ? rev.has(str) : Object.prototype.hasOwnProperty.call(rev, str)) { var revarr = browser_has_Map ? rev.get(str) : rev[str]; for(; i < revarr.length; ++i) { if(sst[revarr[i]].t === str) { sst.Count ++; return revarr[i]; } } } } else for(; i < len; ++i) { if(sst[i].t === str) { sst.Count ++; return i; } } sst[len] = ({t:str}/*:any*/); sst.Count ++; sst.Unique ++; if(rev) { if(browser_has_Map) { if(!rev.has(str)) rev.set(str, []); rev.get(str).push(len); } else { if(!Object.prototype.hasOwnProperty.call(rev, str)) rev[str] = []; rev[str].push(len); } } return len; } function col_obj_w(C/*:number*/, col) { var p = ({min:C+1,max:C+1}/*:any*/); /* wch (chars), wpx (pixels) */ var wch = -1; if(col.MDW) MDW = col.MDW; if(col.width != null) p.customWidth = 1; else if(col.wpx != null) wch = px2char(col.wpx); else if(col.wch != null) wch = col.wch; if(wch > -1) { p.width = char2width(wch); p.customWidth = 1; } else if(col.width != null) p.width = col.width; if(col.hidden) p.hidden = true; if(col.level != null) { p.outlineLevel = p.level = col.level; } return p; } function default_margins(margins/*:Margins*/, mode/*:?string*/) { if(!margins) return; var defs = [0.7, 0.7, 0.75, 0.75, 0.3, 0.3]; if(mode == 'xlml') defs = [1, 1, 1, 1, 0.5, 0.5]; if(margins.left == null) margins.left = defs[0]; if(margins.right == null) margins.right = defs[1]; if(margins.top == null) margins.top = defs[2]; if(margins.bottom == null) margins.bottom = defs[3]; if(margins.header == null) margins.header = defs[4]; if(margins.footer == null) margins.footer = defs[5]; } function get_cell_style(styles/*:Array<any>*/, cell/*:Cell*/, opts) { var z = opts.revssf[cell.z != null ? cell.z : "General"]; var i = 0x3c, len = styles.length; if(z == null && opts.ssf) { for(; i < 0x188; ++i) if(opts.ssf[i] == null) { SSF_load(cell.z, i); // $FlowIgnore opts.ssf[i] = cell.z; opts.revssf[cell.z] = z = i; break; } } for(i = 0; i != len; ++i) if(styles[i].numFmtId === z) return i; styles[len] = { numFmtId:z, fontId:0, fillId:0, borderId:0, xfId:0, applyNumberFormat:1 }; return len; } function safe_format(p/*:Cell*/, fmtid/*:number*/, fillid/*:?number*/, opts, themes, styles) { try { if(opts.cellNF) p.z = table_fmt[fmtid]; } catch(e) { if(opts.WTF) throw e; } if(p.t === 'z' && !opts.cellStyles) return; if(p.t === 'd' && typeof p.v === 'string') p.v = parseDate(p.v); if((!opts || opts.cellText !== false) && p.t !== 'z') try { if(table_fmt[fmtid] == null) SSF_load(SSFImplicit[fmtid] || "General", fmtid); if(p.t === 'e') p.w = p.w || BErr[p.v]; else if(fmtid === 0) { if(p.t === 'n') { if((p.v|0) === p.v) p.w = p.v.toString(10); else p.w = SSF_general_num(p.v); } else if(p.t === 'd') { var dd = datenum(p.v); if((dd|0) === dd) p.w = dd.toString(10); else p.w = SSF_general_num(dd); } else if(p.v === undefined) return ""; else p.w = SSF_general(p.v,_ssfopts); } else if(p.t === 'd') p.w = SSF_format(fmtid,datenum(p.v),_ssfopts); else p.w = SSF_format(fmtid,p.v,_ssfopts); } catch(e) { if(opts.WTF) throw e; } if(!opts.cellStyles) return; if(fillid != null) try { p.s = styles.Fills[fillid]; if (p.s.fgColor && p.s.fgColor.theme && !p.s.fgColor.rgb) { p.s.fgColor.rgb = rgb_tint(themes.themeElements.clrScheme[p.s.fgColor.theme].rgb, p.s.fgColor.tint || 0); if(opts.WTF) p.s.fgColor.raw_rgb = themes.themeElements.clrScheme[p.s.fgColor.theme].rgb; } if (p.s.bgColor && p.s.bgColor.theme) { p.s.bgColor.rgb = rgb_tint(themes.themeElements.clrScheme[p.s.bgColor.theme].rgb, p.s.bgColor.tint || 0); if(opts.WTF) p.s.bgColor.raw_rgb = themes.themeElements.clrScheme[p.s.bgColor.theme].rgb; } } catch(e) { if(opts.WTF && styles.Fills) throw e; } } function check_ws(ws/*:Worksheet*/, sname/*:string*/, i/*:number*/) { if(ws && ws['!ref']) { var range = safe_decode_range(ws['!ref']); if(range.e.c < range.s.c || range.e.r < range.s.r) throw new Error("Bad range (" + i + "): " + ws['!ref']); } } function parse_ws_xml_dim(ws/*:Worksheet*/, s/*:string*/) { var d = safe_decode_range(s); if(d.s.r<=d.e.r && d.s.c<=d.e.c && d.s.r>=0 && d.s.c>=0) ws["!ref"] = encode_range(d); } var mergecregex = /<(?:\w:)?mergeCell ref="[A-Z0-9:]+"\s*[\/]?>/g; var sheetdataregex = /<(?:\w+:)?sheetData[^>]*>([\s\S]*)<\/(?:\w+:)?sheetData>/; var hlinkregex = /<(?:\w:)?hyperlink [^>]*>/mg; var dimregex = /"(\w*:\w*)"/; var colregex = /<(?:\w:)?col\b[^>]*[\/]?>/g; var afregex = /<(?:\w:)?autoFilter[^>]*([\/]|>([\s\S]*)<\/(?:\w:)?autoFilter)>/g; var marginregex= /<(?:\w:)?pageMargins[^>]*\/>/g; var sheetprregex = /<(?:\w:)?sheetPr\b(?:[^>a-z][^>]*)?\/>/; var sheetprregex2= /<(?:\w:)?sheetPr[^>]*(?:[\/]|>([\s\S]*)<\/(?:\w:)?sheetPr)>/; var svsregex = /<(?:\w:)?sheetViews[^>]*(?:[\/]|>([\s\S]*)<\/(?:\w:)?sheetViews)>/; /* 18.3 Worksheets */ function parse_ws_xml(data/*:?string*/, opts, idx/*:number*/, rels, wb/*:WBWBProps*/, themes, styles)/*:Worksheet*/ { if(!data) return data; if(!rels) rels = {'!id':{}}; if(DENSE != null && opts.dense == null) opts.dense = DENSE; /* 18.3.1.99 worksheet CT_Worksheet */ var s = opts.dense ? ([]/*:any*/) : ({}/*:any*/); var refguess/*:Range*/ = ({s: {r:2000000, c:2000000}, e: {r:0, c:0} }/*:any*/); var data1 = "", data2 = ""; var mtch/*:?any*/ = data.match(sheetdataregex); if(mtch) { data1 = data.slice(0, mtch.index); data2 = data.slice(mtch.index + mtch[0].length); } else data1 = data2 = data; /* 18.3.1.82 sheetPr CT_SheetPr */ var sheetPr = data1.match(sheetprregex); if(sheetPr) parse_ws_xml_sheetpr(sheetPr[0], s, wb, idx); else if((sheetPr = data1.match(sheetprregex2))) parse_ws_xml_sheetpr2(sheetPr[0], sheetPr[1]||"", s, wb, idx, styles, themes); /* 18.3.1.35 dimension CT_SheetDimension */ var ridx = (data1.match(/<(?:\w*:)?dimension/)||{index:-1}).index; if(ridx > 0) { var ref = data1.slice(ridx,ridx+50).match(dimregex); if(ref) parse_ws_xml_dim(s, ref[1]); } /* 18.3.1.88 sheetViews CT_SheetViews */ var svs = data1.match(svsregex); if(svs && svs[1]) parse_ws_xml_sheetviews(svs[1], wb); /* 18.3.1.17 cols CT_Cols */ var columns/*:Array<ColInfo>*/ = []; if(opts.cellStyles) { /* 18.3.1.13 col CT_Col */ var cols = data1.match(colregex); if(cols) parse_ws_xml_cols(columns, cols); } /* 18.3.1.80 sheetData CT_SheetData ? */ if(mtch) parse_ws_xml_data(mtch[1], s, opts, refguess, themes, styles); /* 18.3.1.2 autoFilter CT_AutoFilter */ var afilter = data2.match(afregex); if(afilter) s['!autofilter'] = parse_ws_xml_autofilter(afilter[0]); /* 18.3.1.55 mergeCells CT_MergeCells */ var merges/*:Array<Range>*/ = []; var _merge = data2.match(mergecregex); if(_merge) for(ridx = 0; ridx != _merge.length; ++ridx) merges[ridx] = safe_decode_range(_merge[ridx].slice(_merge[ridx].indexOf("\"")+1)); /* 18.3.1.48 hyperlinks CT_Hyperlinks */ var hlink = data2.match(hlinkregex); if(hlink) parse_ws_xml_hlinks(s, hlink, rels); /* 18.3.1.62 pageMargins CT_PageMargins */ var margins = data2.match(marginregex); if(margins) s['!margins'] = parse_ws_xml_margins(parsexmltag(margins[0])); if(!s["!ref"] && refguess.e.c >= refguess.s.c && refguess.e.r >= refguess.s.r) s["!ref"] = encode_range(refguess); if(opts.sheetRows > 0 && s["!ref"]) { var tmpref = safe_decode_range(s["!ref"]); if(opts.sheetRows <= +tmpref.e.r) { tmpref.e.r = opts.sheetRows - 1; if(tmpref.e.r > refguess.e.r) tmpref.e.r = refguess.e.r; if(tmpref.e.r < tmpref.s.r) tmpref.s.r = tmpref.e.r; if(tmpref.e.c > refguess.e.c) tmpref.e.c = refguess.e.c; if(tmpref.e.c < tmpref.s.c) tmpref.s.c = tmpref.e.c; s["!fullref"] = s["!ref"]; s["!ref"] = encode_range(tmpref); } } if(columns.length > 0) s["!cols"] = columns; if(merges.length > 0) s["!merges"] = merges; return s; } function write_ws_xml_merges(merges/*:Array<Range>*/)/*:string*/ { if(merges.length === 0) return ""; var o = '<mergeCells count="' + merges.length + '">'; for(var i = 0; i != merges.length; ++i) o += '<mergeCell ref="' + encode_range(merges[i]) + '"/>'; return o + '</mergeCells>'; } /* 18.3.1.82-3 sheetPr CT_ChartsheetPr / CT_SheetPr */ function parse_ws_xml_sheetpr(sheetPr/*:string*/, s, wb/*:WBWBProps*/, idx/*:number*/) { var data = parsexmltag(sheetPr); if(!wb.Sheets[idx]) wb.Sheets[idx] = {}; if(data.codeName) wb.Sheets[idx].CodeName = unescapexml(utf8read(data.codeName)); } function parse_ws_xml_sheetpr2(sheetPr/*:string*/, body/*:string*/, s, wb/*:WBWBProps*/, idx/*:number*/) { parse_ws_xml_sheetpr(sheetPr.slice(0, sheetPr.indexOf(">")), s, wb, idx); } function write_ws_xml_sheetpr(ws, wb, idx, opts, o) { var needed = false; var props = {}, payload = null; if(opts.bookType !== 'xlsx' && wb.vbaraw) { var cname = wb.SheetNames[idx]; try { if(wb.Workbook) cname = wb.Workbook.Sheets[idx].CodeName || cname; } catch(e) {} needed = true; props.codeName = utf8write(escapexml(cname)); } if(ws && ws["!outline"]) { var outlineprops = {summaryBelow:1, summaryRight:1}; if(ws["!outline"].above) outlineprops.summaryBelow = 0; if(ws["!outline"].left) outlineprops.summaryRight = 0; payload = (payload||"") + writextag('outlinePr', null, outlineprops); } if(!needed && !payload) return; o[o.length] = (writextag('sheetPr', payload, props)); } /* 18.3.1.85 sheetProtection CT_SheetProtection */ var sheetprot_deffalse = ["objects", "scenarios", "selectLockedCells", "selectUnlockedCells"]; var sheetprot_deftrue = [ "formatColumns", "formatRows", "formatCells", "insertColumns", "insertRows", "insertHyperlinks", "deleteColumns", "deleteRows", "sort", "autoFilter", "pivotTables" ]; function write_ws_xml_protection(sp)/*:string*/ { // algorithmName, hashValue, saltValue, spinCount var o = ({sheet:1}/*:any*/); sheetprot_deffalse.forEach(function(n) { if(sp[n] != null && sp[n]) o[n] = "1"; }); sheetprot_deftrue.forEach(function(n) { if(sp[n] != null && !sp[n]) o[n] = "0"; }); /* TODO: algorithm */ if(sp.password) o.password = crypto_CreatePasswordVerifier_Method1(sp.password).toString(16).toUpperCase(); return writextag('sheetProtection', null, o); } function parse_ws_xml_hlinks(s, data/*:Array<string>*/, rels) { var dense = Array.isArray(s); for(var i = 0; i != data.length; ++i) { var val = parsexmltag(utf8read(data[i]), true); if(!val.ref) return; var rel = ((rels || {})['!id']||[])[val.id]; if(rel) { val.Target = rel.Target; if(val.location) val.Target += "#"+unescapexml(val.location); } else { val.Target = "#" + unescapexml(val.location); rel = {Target: val.Target, TargetMode: 'Internal'}; } val.Rel = rel; if(val.tooltip) { val.Tooltip = val.tooltip; delete val.tooltip; } var rng = safe_decode_range(val.ref); for(var R=rng.s.r;R<=rng.e.r;++R) for(var C=rng.s.c;C<=rng.e.c;++C) { var addr = encode_cell({c:C,r:R}); if(dense) { if(!s[R]) s[R] = []; if(!s[R][C]) s[R][C] = {t:"z",v:undefined}; s[R][C].l = val; } else { if(!s[addr]) s[addr] = {t:"z",v:undefined}; s[addr].l = val; } } } } function parse_ws_xml_margins(margin) { var o = {}; ["left", "right", "top", "bottom", "header", "footer"].forEach(function(k) { if(margin[k]) o[k] = parseFloat(margin[k]); }); return o; } function write_ws_xml_margins(margin)/*:string*/ { default_margins(margin); return writextag('pageMargins', null, margin); } function parse_ws_xml_cols(columns, cols) { var seencol = false; for(var coli = 0; coli != cols.length; ++coli) { var coll = parsexmltag(cols[coli], true); if(coll.hidden) coll.hidden = parsexmlbool(coll.hidden); var colm=parseInt(coll.min, 10)-1, colM=parseInt(coll.max,10)-1; if(coll.outlineLevel) coll.level = (+coll.outlineLevel || 0); delete coll.min; delete coll.max; coll.width = +coll.width; if(!seencol && coll.width) { seencol = true; find_mdw_colw(coll.width); } process_col(coll); while(colm <= colM) columns[colm++] = dup(coll); } } function write_ws_xml_cols(ws, cols)/*:string*/ { var o = ["<cols>"], col; for(var i = 0; i != cols.length; ++i) { if(!(col = cols[i])) continue; o[o.length] = (writextag('col', null, col_obj_w(i, col))); } o[o.length] = "</cols>"; return o.join(""); } function parse_ws_xml_autofilter(data/*:string*/) { var o = { ref: (data.match(/ref="([^"]*)"/)||[])[1]}; return o; } function write_ws_xml_autofilter(data, ws, wb, idx)/*:string*/ { var ref = typeof data.ref == "string" ? data.ref : encode_range(data.ref); if(!wb.Workbook) wb.Workbook = ({Sheets:[]}/*:any*/); if(!wb.Workbook.Names) wb.Workbook.Names = []; var names/*: Array<any> */ = wb.Workbook.Names; var range = decode_range(ref); if(range.s.r == range.e.r) { range.e.r = decode_range(ws["!ref"]).e.r; ref = encode_range(range); } for(var i = 0; i < names.length; ++i) { var name = names[i]; if(name.Name != '_xlnm._FilterDatabase') continue; if(name.Sheet != idx) continue; name.Ref = "'" + wb.SheetNames[idx] + "'!" + ref; break; } if(i == names.length) names.push({ Name: '_xlnm._FilterDatabase', Sheet: idx, Ref: "'" + wb.SheetNames[idx] + "'!" + ref }); return writextag("autoFilter", null, {ref:ref}); } /* 18.3.1.88 sheetViews CT_SheetViews */ /* 18.3.1.87 sheetView CT_SheetView */ var sviewregex = /<(?:\w:)?sheetView(?:[^>a-z][^>]*)?\/?>/; function parse_ws_xml_sheetviews(data, wb/*:WBWBProps*/) { if(!wb.Views) wb.Views = [{}]; (data.match(sviewregex)||[]).forEach(function(r/*:string*/, i/*:number*/) { var tag = parsexmltag(r); // $FlowIgnore if(!wb.Views[i]) wb.Views[i] = {}; // $FlowIgnore if(+tag.zoomScale) wb.Views[i].zoom = +tag.zoomScale; // $FlowIgnore if(parsexmlbool(tag.rightToLeft)) wb.Views[i].RTL = true; }); } function write_ws_xml_sheetviews(ws, opts, idx, wb)/*:string*/ { var sview = ({workbookViewId:"0"}/*:any*/); // $FlowIgnore if((((wb||{}).Workbook||{}).Views||[])[0]) sview.rightToLeft = wb.Workbook.Views[0].RTL ? "1" : "0"; return writextag("sheetViews", writextag("sheetView", null, sview), {}); } function write_ws_xml_cell(cell/*:Cell*/, ref, ws, opts/*::, idx, wb*/)/*:string*/ { if(cell.c) ws['!comments'].push([ref, cell.c]); if(cell.v === undefined && typeof cell.f !== "string" || cell.t === 'z' && !cell.f) return ""; var vv = ""; var oldt = cell.t, oldv = cell.v; if(cell.t !== "z") switch(cell.t) { case 'b': vv = cell.v ? "1" : "0"; break; case 'n': vv = ''+cell.v; break; case 'e': vv = BErr[cell.v]; break; case 'd': if(opts && opts.cellDates) vv = parseDate(cell.v, -1).toISOString(); else { cell = dup(cell); cell.t = 'n'; vv = ''+(cell.v = datenum(parseDate(cell.v))); } if(typeof cell.z === 'undefined') cell.z = table_fmt[14]; break; default: vv = cell.v; break; } var v = writetag('v', escapexml(vv)), o = ({r:ref}/*:any*/); /* TODO: cell style */ var os = get_cell_style(opts.cellXfs, cell, opts); if(os !== 0) o.s = os; switch(cell.t) { case 'n': break; case 'd': o.t = "d"; break; case 'b': o.t = "b"; break; case 'e': o.t = "e"; break; case 'z': break; default: if(cell.v == null) { delete cell.t; break; } if(cell.v.length > 32767) throw new Error("Text length must not exceed 32767 characters"); if(opts && opts.bookSST) { v = writetag('v', ''+get_sst_id(opts.Strings, cell.v, opts.revStrings)); o.t = "s"; break; } o.t = "str"; break; } if(cell.t != oldt) { cell.t = oldt; cell.v = oldv; } if(typeof cell.f == "string" && cell.f) { var ff = cell.F && cell.F.slice(0, ref.length) == ref ? {t:"array", ref:cell.F} : null; v = writextag('f', escapexml(cell.f), ff) + (cell.v != null ? v : ""); } if(cell.l) ws['!links'].push([ref, cell.l]); if(cell.D) o.cm = 1; return writextag('c', v, o); } var parse_ws_xml_data = /*#__PURE__*/(function() { var cellregex = /<(?:\w+:)?c[ \/>]/, rowregex = /<\/(?:\w+:)?row>/; var rregex = /r=["']([^"']*)["']/, isregex = /<(?:\w+:)?is>([\S\s]*?)<\/(?:\w+:)?is>/; var refregex = /ref=["']([^"']*)["']/; var match_v = matchtag("v"), match_f = matchtag("f"); return function parse_ws_xml_data(sdata/*:string*/, s, opts, guess/*:Range*/, themes, styles) { var ri = 0, x = "", cells/*:Array<string>*/ = [], cref/*:?Array<string>*/ = [], idx=0, i=0, cc=0, d="", p/*:any*/; var tag, tagr = 0, tagc = 0; var sstr, ftag; var fmtid = 0, fillid = 0; var do_format = Array.isArray(styles.CellXf), cf; var arrayf/*:Array<[Range, string]>*/ = []; var sharedf = []; var dense = Array.isArray(s); var rows/*:Array<RowInfo>*/ = [], rowobj = {}, rowrite = false; var sheetStubs = !!opts.sheetStubs; for(var marr = sdata.split(rowregex), mt = 0, marrlen = marr.length; mt != marrlen; ++mt) { x = marr[mt].trim(); var xlen = x.length; if(xlen === 0) continue; /* 18.3.1.73 row CT_Row */ var rstarti = 0; outa: for(ri = 0; ri < xlen; ++ri) switch(/*x.charCodeAt(ri)*/x[ri]) { case ">" /*62*/: if(/*x.charCodeAt(ri-1) != 47*/x[ri-1] != "/") { ++ri; break outa; } if(opts && opts.cellStyles) { // TODO: avoid duplication tag = parsexmltag(x.slice(rstarti,ri), true); tagr = tag.r != null ? parseInt(tag.r, 10) : tagr+1; tagc = -1; if(opts.sheetRows && opts.sheetRows < tagr) continue; rowobj = {}; rowrite = false; if(tag.ht) { rowrite = true; rowobj.hpt = parseFloat(tag.ht); rowobj.hpx = pt2px(rowobj.hpt); } if(tag.hidden == "1") { rowrite = true; rowobj.hidden = true; } if(tag.outlineLevel != null) { rowrite = true; rowobj.level = +tag.outlineLevel; } if(rowrite) rows[tagr-1] = rowobj; } break; case "<" /*60*/: rstarti = ri; break; } if(rstarti >= ri) break; tag = parsexmltag(x.slice(rstarti,ri), true); tagr = tag.r != null ? parseInt(tag.r, 10) : tagr+1; tagc = -1; if(opts.sheetRows && opts.sheetRows < tagr) continue; if(guess.s.r > tagr - 1) guess.s.r = tagr - 1; if(guess.e.r < tagr - 1) guess.e.r = tagr - 1; if(opts && opts.cellStyles) { rowobj = {}; rowrite = false; if(tag.ht) { rowrite = true; rowobj.hpt = parseFloat(tag.ht); rowobj.hpx = pt2px(rowobj.hpt); } if(tag.hidden == "1") { rowrite = true; rowobj.hidden = true; } if(tag.outlineLevel != null) { rowrite = true; rowobj.level = +tag.outlineLevel; } if(rowrite) rows[tagr-1] = rowobj; } /* 18.3.1.4 c CT_Cell */ cells = x.slice(ri).split(cellregex); for(var rslice = 0; rslice != cells.length; ++rslice) if(cells[rslice].trim().charAt(0) != "<") break; cells = cells.slice(rslice); for(ri = 0; ri != cells.length; ++ri) { x = cells[ri].trim(); if(x.length === 0) continue; cref = x.match(rregex); idx = ri; i=0; cc=0; x = "<c " + (x.slice(0,1)=="<"?">":"") + x; if(cref != null && cref.length === 2) { idx = 0; d=cref[1]; for(i=0; i != d.length; ++i) { if((cc=d.charCodeAt(i)-64) < 1 || cc > 26) break; idx = 26*idx + cc; } --idx; tagc = idx; } else ++tagc; for(i = 0; i != x.length; ++i) if(x.charCodeAt(i) === 62) break; ++i; tag = parsexmltag(x.slice(0,i), true); if(!tag.r) tag.r = encode_cell({r:tagr-1, c:tagc}); d = x.slice(i); p = ({t:""}/*:any*/); if((cref=d.match(match_v))!= null && /*::cref != null && */cref[1] !== '') p.v=unescapexml(cref[1]); if(opts.cellFormula) { if((cref=d.match(match_f))!= null && /*::cref != null && */cref[1] !== '') { /* TODO: match against XLSXFutureFunctions */ p.f=unescapexml(utf8read(cref[1])).replace(/\r\n/g, "\n"); if(!opts.xlfn) p.f = _xlfn(p.f); if(/*::cref != null && cref[0] != null && */cref[0].indexOf('t="array"') > -1) { p.F = (d.match(refregex)||[])[1]; if(p.F.indexOf(":") > -1) arrayf.push([safe_decode_range(p.F), p.F]); } else if(/*::cref != null && cref[0] != null && */cref[0].indexOf('t="shared"') > -1) { // TODO: parse formula ftag = parsexmltag(cref[0]); var ___f = unescapexml(utf8read(cref[1])); if(!opts.xlfn) ___f = _xlfn(___f); sharedf[parseInt(ftag.si, 10)] = [ftag, ___f, tag.r]; } } else if((cref=d.match(/<f[^>]*\/>/))) { ftag = parsexmltag(cref[0]); if(sharedf[ftag.si]) p.f = shift_formula_xlsx(sharedf[ftag.si][1], sharedf[ftag.si][2]/*[0].ref*/, tag.r); } /* TODO: factor out contains logic */ var _tag = decode_cell(tag.r); for(i = 0; i < arrayf.length; ++i) if(_tag.r >= arrayf[i][0].s.r && _tag.r <= arrayf[i][0].e.r) if(_tag.c >= arrayf[i][0].s.c && _tag.c <= arrayf[i][0].e.c) p.F = arrayf[i][1]; } if(tag.t == null && p.v === undefined) { if(p.f || p.F) { p.v = 0; p.t = "n"; } else if(!sheetStubs) continue; else p.t = "z"; } else p.t = tag.t || "n"; if(guess.s.c > tagc) guess.s.c = tagc; if(guess.e.c < tagc) guess.e.c = tagc; /* 18.18.11 t ST_CellType */ switch(p.t) { case 'n': if(p.v == "" || p.v == null) { if(!sheetStubs) continue; p.t = 'z'; } else p.v = parseFloat(p.v); break; case 's': if(typeof p.v == 'undefined') { if(!sheetStubs) continue; p.t = 'z'; } else { sstr = strs[parseInt(p.v, 10)]; p.v = sstr.t; p.r = sstr.r; if(opts.cellHTML) p.h = sstr.h; } break; case 'str': p.t = "s"; p.v = (p.v!=null) ? utf8read(p.v) : ''; if(opts.cellHTML) p.h = escapehtml(p.v); break; case 'inlineStr': cref = d.match(isregex); p.t = 's'; if(cref != null && (sstr = parse_si(cref[1]))) { p.v = sstr.t; if(opts.cellHTML) p.h = sstr.h; } else p.v = ""; break; case 'b': p.v = parsexmlbool(p.v); break; case 'd': if(opts.cellDates) p.v = parseDate(p.v, 1); else { p.v = datenum(parseDate(p.v, 1)); p.t = 'n'; } break; /* error string in .w, number in .v */ case 'e': if(!opts || opts.cellText !== false) p.w = p.v; p.v = RBErr[p.v]; break; } /* formatting */ fmtid = fillid = 0; cf = null; if(do_format && tag.s !== undefined) { cf = styles.CellXf[tag.s]; if(cf != null) { if(cf.numFmtId != null) fmtid = cf.numFmtId; if(opts.cellStyles) { if(cf.fillId != null) fillid = cf.fillId; } } } safe_format(p, fmtid, fillid, opts, themes, styles); if(opts.cellDates && do_format && p.t == 'n' && fmt_is_date(table_fmt[fmtid])) { p.t = 'd'; p.v = numdate(p.v); } if(tag.cm && opts.xlmeta) { var cm = (opts.xlmeta.Cell||[])[+tag.cm-1]; if(cm && cm.type == 'XLDAPR') p.D = true; } if(dense) { var _r = decode_cell(tag.r); if(!s[_r.r]) s[_r.r] = []; s[_r.r][_r.c] = p; } else s[tag.r] = p; } } if(rows.length > 0) s['!rows'] = rows; }; })(); function write_ws_xml_data(ws/*:Worksheet*/, opts, idx/*:number*/, wb/*:Workbook*//*::, rels*/)/*:string*/ { var o/*:Array<string>*/ = [], r/*:Array<string>*/ = [], range = safe_decode_range(ws['!ref']), cell="", ref, rr = "", cols/*:Array<string>*/ = [], R=0, C=0, rows = ws['!rows']; var dense = Array.isArray(ws); var params = ({r:rr}/*:any*/), row/*:RowInfo*/, height = -1; for(C = range.s.c; C <= range.e.c; ++C) cols[C] = encode_col(C); for(R = range.s.r; R <= range.e.r; ++R) { r = []; rr = encode_row(R); for(C = range.s.c; C <= range.e.c; ++C) { ref = cols[C] + rr; var _cell = dense ? (ws[R]||[])[C]: ws[ref]; if(_cell === undefined) continue; if((cell = write_ws_xml_cell(_cell, ref, ws, opts, idx, wb)) != null) r.push(cell); } if(r.length > 0 || (rows && rows[R])) { params = ({r:rr}/*:any*/); if(rows && rows[R]) { row = rows[R]; if(row.hidden) params.hidden = 1; height = -1; if(row.hpx) height = px2pt(row.hpx); else if(row.hpt) height = row.hpt; if(height > -1) { params.ht = height; params.customHeight = 1; } if(row.level) { params.outlineLevel = row.level; } } o[o.length] = (writextag('row', r.join(""), params)); } } if(rows) for(; R < rows.length; ++R) { if(rows && rows[R]) { params = ({r:R+1}/*:any*/); row = rows[R]; if(row.hidden) params.hidden = 1; height = -1; if (row.hpx) height = px2pt(row.hpx); else if (row.hpt) height = row.hpt; if (height > -1) { params.ht = height; params.customHeight = 1; } if (row.level) { params.outlineLevel = row.level; } o[o.length] = (writextag('row', "", params)); } } return o.join(""); } function write_ws_xml(idx/*:number*/, opts, wb/*:Workbook*/, rels)/*:string*/ { var o = [XML_HEADER, writextag('worksheet', null, { 'xmlns': XMLNS_main[0], 'xmlns:r': XMLNS.r })]; var s = wb.SheetNames[idx], sidx = 0, rdata = ""; var ws = wb.Sheets[s]; if(ws == null) ws = {}; var ref = ws['!ref'] || 'A1'; var range = safe_decode_range(ref); if(range.e.c > 0x3FFF || range.e.r > 0xFFFFF) { if(opts.WTF) throw new Error("Range " + ref + " exceeds format limit A1:XFD1048576"); range.e.c = Math.min(range.e.c, 0x3FFF); range.e.r = Math.min(range.e.c, 0xFFFFF); ref = encode_range(range); } if(!rels) rels = {}; ws['!comments'] = []; var _drawing = []; write_ws_xml_sheetpr(ws, wb, idx, opts, o); o[o.length] = (writextag('dimension', null, {'ref': ref})); o[o.length] = write_ws_xml_sheetviews(ws, opts, idx, wb); /* TODO: store in WB, process styles */ if(opts.sheetFormat) o[o.length] = (writextag('sheetFormatPr', null, { defaultRowHeight:opts.sheetFormat.defaultRowHeight||'16', baseColWidth:opts.sheetFormat.baseColWidth||'10', outlineLevelRow:opts.sheetFormat.outlineLevelRow||'7' })); if(ws['!cols'] != null && ws['!cols'].length > 0) o[o.length] = (write_ws_xml_cols(ws, ws['!cols'])); o[sidx = o.length] = '<sheetData/>'; ws['!links'] = []; if(ws['!ref'] != null) { rdata = write_ws_xml_data(ws, opts, idx, wb, rels); if(rdata.length > 0) o[o.length] = (rdata); } if(o.length>sidx+1) { o[o.length] = ('</sheetData>'); o[sidx]=o[sidx].replace("/>",">"); } /* sheetCalcPr */ if(ws['!protect']) o[o.length] = write_ws_xml_protection(ws['!protect']); /* protectedRanges */ /* scenarios */ if(ws['!autofilter'] != null) o[o.length] = write_ws_xml_autofilter(ws['!autofilter'], ws, wb, idx); /* sortState */ /* dataConsolidate */ /* customSheetViews */ if(ws['!merges'] != null && ws['!merges'].length > 0) o[o.length] = (write_ws_xml_merges(ws['!merges'])); /* phoneticPr */ /* conditionalFormatting */ /* dataValidations */ var relc = -1, rel, rId = -1; if(/*::(*/ws['!links']/*::||[])*/.length > 0) { o[o.length] = "<hyperlinks>"; /*::(*/ws['!links']/*::||[])*/.forEach(function(l) { if(!l[1].Target) return; rel = ({"ref":l[0]}/*:any*/); if(l[1].Target.charAt(0) != "#") { rId = add_rels(rels, -1, escapexml(l[1].Target).replace(/#.*$/, ""), RELS.HLINK); rel["r:id"] = "rId"+rId; } if((relc = l[1].Target.indexOf("#")) > -1) rel.location = escapexml(l[1].Target.slice(relc+1)); if(l[1].Tooltip) rel.tooltip = escapexml(l[1].Tooltip); o[o.length] = writextag("hyperlink",null,rel); }); o[o.length] = "</hyperlinks>"; } delete ws['!links']; /* printOptions */ if(ws['!margins'] != null) o[o.length] = write_ws_xml_margins(ws['!margins']); /* pageSetup */ /* headerFooter */ /* rowBreaks */ /* colBreaks */ /* customProperties */ /* cellWatches */ if(!opts || opts.ignoreEC || (opts.ignoreEC == (void 0))) o[o.length] = writetag("ignoredErrors", writextag("ignoredError", null, {numberStoredAsText:1, sqref:ref})); /* smartTags */ if(_drawing.length > 0) { rId = add_rels(rels, -1, "../drawings/drawing" + (idx+1) + ".xml", RELS.DRAW); o[o.length] = writextag("drawing", null, {"r:id":"rId" + rId}); ws['!drawing'] = _drawing; } if(ws['!comments'].length > 0) { rId = add_rels(rels, -1, "../drawings/vmlDrawing" + (idx+1) + ".vml", RELS.VML); o[o.length] = writextag("legacyDrawing", null, {"r:id":"rId" + rId}); ws['!legacy'] = rId; } /* legacyDrawingHF */ /* picture */ /* oleObjects */ /* controls */ /* webPublishItems */ /* tableParts */ /* extLst */ if(o.length>1) { o[o.length] = ('</worksheet>'); o[1]=o[1].replace("/>",">"); } return o.join(""); } /* [MS-XLSB] 2.4.726 BrtRowHdr */ function parse_BrtRowHdr(data, length) { var z = ({}/*:any*/); var tgt = data.l + length; z.r = data.read_shift(4); data.l += 4; // TODO: ixfe var miyRw = data.read_shift(2); data.l += 1; // TODO: top/bot padding var flags = data.read_shift(1); data.l = tgt; if(flags & 0x07) z.level = flags & 0x07; if(flags & 0x10) z.hidden = true; if(flags & 0x20) z.hpt = miyRw / 20; return z; } function write_BrtRowHdr(R/*:number*/, range, ws) { var o = new_buf(17+8*16); var row = (ws['!rows']||[])[R]||{}; o.write_shift(4, R); o.write_shift(4, 0); /* TODO: ixfe */ var miyRw = 0x0140; if(row.hpx) miyRw = px2pt(row.hpx) * 20; else if(row.hpt) miyRw = row.hpt * 20; o.write_shift(2, miyRw); o.write_shift(1, 0); /* top/bot padding */ var flags = 0x0; if(row.level) flags |= row.level; if(row.hidden) flags |= 0x10; if(row.hpx || row.hpt) flags |= 0x20; o.write_shift(1, flags); o.write_shift(1, 0); /* phonetic guide */ /* [MS-XLSB] 2.5.8 BrtColSpan explains the mechanism */ var ncolspan = 0, lcs = o.l; o.l += 4; var caddr = {r:R, c:0}; for(var i = 0; i < 16; ++i) { if((range.s.c > ((i+1) << 10)) || (range.e.c < (i << 10))) continue; var first = -1, last = -1; for(var j = (i<<10); j < ((i+1)<<10); ++j) { caddr.c = j; var cell = Array.isArray(ws) ? (ws[caddr.r]||[])[caddr.c] : ws[encode_cell(caddr)]; if(cell) { if(first < 0) first = j; last = j; } } if(first < 0) continue; ++ncolspan; o.write_shift(4, first); o.write_shift(4, last); } var l = o.l; o.l = lcs; o.write_shift(4, ncolspan); o.l = l; return o.length > o.l ? o.slice(0, o.l) : o; } function write_row_header(ba, ws, range, R) { var o = write_BrtRowHdr(R, range, ws); if((o.length > 17) || (ws['!rows']||[])[R]) write_record(ba, 0x0000 /* BrtRowHdr */, o); } /* [MS-XLSB] 2.4.820 BrtWsDim */ var parse_BrtWsDim = parse_UncheckedRfX; var write_BrtWsDim = write_UncheckedRfX; /* [MS-XLSB] 2.4.821 BrtWsFmtInfo */ function parse_BrtWsFmtInfo(/*::data, length*/) { } //function write_BrtWsFmtInfo(ws, o) { } /* [MS-XLSB] 2.4.823 BrtWsProp */ function parse_BrtWsProp(data, length) { var z = {}; var f = data[data.l]; ++data.l; z.above = !(f & 0x40); z.left = !(f & 0x80); /* TODO: pull flags */ data.l += 18; z.name = parse_XLSBCodeName(data, length - 19); return z; } function write_BrtWsProp(str, outl, o) { if(o == null) o = new_buf(84+4*str.length); var f = 0xC0; if(outl) { if(outl.above) f &= ~0x40; if(outl.left) f &= ~0x80; } o.write_shift(1, f); for(var i = 1; i < 3; ++i) o.write_shift(1,0); write_BrtColor({auto:1}, o); o.write_shift(-4,-1); o.write_shift(-4,-1); write_XLSBCodeName(str, o); return o.slice(0, o.l); } /* [MS-XLSB] 2.4.306 BrtCellBlank */ function parse_BrtCellBlank(data) { var cell = parse_XLSBCell(data); return [cell]; } function write_BrtCellBlank(cell, ncell, o) { if(o == null) o = new_buf(8); return write_XLSBCell(ncell, o); } function parse_BrtShortBlank(data) { var cell = parse_XLSBShortCell(data); return [cell]; } function write_BrtShortBlank(cell, ncell, o) { if(o == null) o = new_buf(4); return write_XLSBShortCell(ncell, o); } /* [MS-XLSB] 2.4.307 BrtCellBool */ function parse_BrtCellBool(data) { var cell = parse_XLSBCell(data); var fBool = data.read_shift(1); return [cell, fBool, 'b']; } function write_BrtCellBool(cell, ncell, o) { if(o == null) o = new_buf(9); write_XLSBCell(ncell, o); o.write_shift(1, cell.v ? 1 : 0); return o; } function parse_BrtShortBool(data) { var cell = parse_XLSBShortCell(data); var fBool = data.read_shift(1); return [cell, fBool, 'b']; } function write_BrtShortBool(cell, ncell, o) { if(o == null) o = new_buf(5); write_XLSBShortCell(ncell, o); o.write_shift(1, cell.v ? 1 : 0); return o; } /* [MS-XLSB] 2.4.308 BrtCellError */ function parse_BrtCellError(data) { var cell = parse_XLSBCell(data); var bError = data.read_shift(1); return [cell, bError, 'e']; } function write_BrtCellError(cell, ncell, o) { if(o == null) o = new_buf(9); write_XLSBCell(ncell, o); o.write_shift(1, cell.v); return o; } function parse_BrtShortError(data) { var cell = parse_XLSBShortCell(data); var bError = data.read_shift(1); return [cell, bError, 'e']; } function write_BrtShortError(cell, ncell, o) { if(o == null) o = new_buf(8); write_XLSBShortCell(ncell, o); o.write_shift(1, cell.v); o.write_shift(2, 0); o.write_shift(1, 0); return o; } /* [MS-XLSB] 2.4.311 BrtCellIsst */ function parse_BrtCellIsst(data) { var cell = parse_XLSBCell(data); var isst = data.read_shift(4); return [cell, isst, 's']; } function write_BrtCellIsst(cell, ncell, o) { if(o == null) o = new_buf(12); write_XLSBCell(ncell, o); o.write_shift(4, ncell.v); return o; } function parse_BrtShortIsst(data) { var cell = parse_XLSBShortCell(data); var isst = data.read_shift(4); return [cell, isst, 's']; } function write_BrtShortIsst(cell, ncell, o) { if(o == null) o = new_buf(8); write_XLSBShortCell(ncell, o); o.write_shift(4, ncell.v); return o; } /* [MS-XLSB] 2.4.313 BrtCellReal */ function parse_BrtCellReal(data) { var cell = parse_XLSBCell(data); var value = parse_Xnum(data); return [cell, value, 'n']; } function write_BrtCellReal(cell, ncell, o) { if(o == null) o = new_buf(16); write_XLSBCell(ncell, o); write_Xnum(cell.v, o); return o; } function parse_BrtShortReal(data) { var cell = parse_XLSBShortCell(data); var value = parse_Xnum(data); return [cell, value, 'n']; } function write_BrtShortReal(cell, ncell, o) { if(o == null) o = new_buf(12); write_XLSBShortCell(ncell, o); write_Xnum(cell.v, o); return o; } /* [MS-XLSB] 2.4.314 BrtCellRk */ function parse_BrtCellRk(data) { var cell = parse_XLSBCell(data); var value = parse_RkNumber(data); return [cell, value, 'n']; } function write_BrtCellRk(cell, ncell, o) { if(o == null) o = new_buf(12); write_XLSBCell(ncell, o); write_RkNumber(cell.v, o); return o; } function parse_BrtShortRk(data) { var cell = parse_XLSBShortCell(data); var value = parse_RkNumber(data); return [cell, value, 'n']; } function write_BrtShortRk(cell, ncell, o) { if(o == null) o = new_buf(8); write_XLSBShortCell(ncell, o); write_RkNumber(cell.v, o); return o; } /* [MS-XLSB] 2.4.323 BrtCellRString */ function parse_BrtCellRString(data) { var cell = parse_XLSBCell(data); var value = parse_RichStr(data); return [cell, value, 'is']; } /* [MS-XLSB] 2.4.317 BrtCellSt */ function parse_BrtCellSt(data) { var cell = parse_XLSBCell(data); var value = parse_XLWideString(data); return [cell, value, 'str']; } function write_BrtCellSt(cell, ncell, o) { if(o == null) o = new_buf(12 + 4 * cell.v.length); write_XLSBCell(ncell, o); write_XLWideString(cell.v, o); return o.length > o.l ? o.slice(0, o.l) : o; } function parse_BrtShortSt(data) { var cell = parse_XLSBShortCell(data); var value = parse_XLWideString(data); return [cell, value, 'str']; } function write_BrtShortSt(cell, ncell, o) { if(o == null) o = new_buf(8 + 4 * cell.v.length); write_XLSBShortCell(ncell, o); write_XLWideString(cell.v, o); return o.length > o.l ? o.slice(0, o.l) : o; } /* [MS-XLSB] 2.4.653 BrtFmlaBool */ function parse_BrtFmlaBool(data, length, opts) { var end = data.l + length; var cell = parse_XLSBCell(data); cell.r = opts['!row']; var value = data.read_shift(1); var o = [cell, value, 'b']; if(opts.cellFormula) { data.l += 2; var formula = parse_XLSBCellParsedFormula(data, end - data.l, opts); o[3] = stringify_formula(formula, null/*range*/, cell, opts.supbooks, opts);/* TODO */ } else data.l = end; return o; } /* [MS-XLSB] 2.4.654 BrtFmlaError */ function parse_BrtFmlaError(data, length, opts) { var end = data.l + length; var cell = parse_XLSBCell(data); cell.r = opts['!row']; var value = data.read_shift(1); var o = [cell, value, 'e']; if(opts.cellFormula) { data.l += 2; var formula = parse_XLSBCellParsedFormula(data, end - data.l, opts); o[3] = stringify_formula(formula, null/*range*/, cell, opts.supbooks, opts);/* TODO */ } else data.l = end; return o; } /* [MS-XLSB] 2.4.655 BrtFmlaNum */ function parse_BrtFmlaNum(data, length, opts) { var end = data.l + length; var cell = parse_XLSBCell(data); cell.r = opts['!row']; var value = parse_Xnum(data); var o = [cell, value, 'n']; if(opts.cellFormula) { data.l += 2; var formula = parse_XLSBCellParsedFormula(data, end - data.l, opts); o[3] = stringify_formula(formula, null/*range*/, cell, opts.supbooks, opts);/* TODO */ } else data.l = end; return o; } /* [MS-XLSB] 2.4.656 BrtFmlaString */ function parse_BrtFmlaString(data, length, opts) { var end = data.l + length; var cell = parse_XLSBCell(data); cell.r = opts['!row']; var value = parse_XLWideString(data); var o = [cell, value, 'str']; if(opts.cellFormula) { data.l += 2; var formula = parse_XLSBCellParsedFormula(data, end - data.l, opts); o[3] = stringify_formula(formula, null/*range*/, cell, opts.supbooks, opts);/* TODO */ } else data.l = end; return o; } /* [MS-XLSB] 2.4.682 BrtMergeCell */ var parse_BrtMergeCell = parse_UncheckedRfX; var write_BrtMergeCell = write_UncheckedRfX; /* [MS-XLSB] 2.4.107 BrtBeginMergeCells */ function write_BrtBeginMergeCells(cnt, o) { if(o == null) o = new_buf(4); o.write_shift(4, cnt); return o; } /* [MS-XLSB] 2.4.662 BrtHLink */ function parse_BrtHLink(data, length/*::, opts*/) { var end = data.l + length; var rfx = parse_UncheckedRfX(data, 16); var relId = parse_XLNullableWideString(data); var loc = parse_XLWideString(data); var tooltip = parse_XLWideString(data); var display = parse_XLWideString(data); data.l = end; var o = ({rfx:rfx, relId:relId, loc:loc, display:display}/*:any*/); if(tooltip) o.Tooltip = tooltip; return o; } function write_BrtHLink(l, rId) { var o = new_buf(50+4*(l[1].Target.length + (l[1].Tooltip || "").length)); write_UncheckedRfX({s:decode_cell(l[0]), e:decode_cell(l[0])}, o); write_RelID("rId" + rId, o); var locidx = l[1].Target.indexOf("#"); var loc = locidx == -1 ? "" : l[1].Target.slice(locidx+1); write_XLWideString(loc || "", o); write_XLWideString(l[1].Tooltip || "", o); write_XLWideString("", o); return o.slice(0, o.l); } /* [MS-XLSB] 2.4.692 BrtPane */ function parse_BrtPane(/*data, length, opts*/) { } /* [MS-XLSB] 2.4.6 BrtArrFmla */ function parse_BrtArrFmla(data, length, opts) { var end = data.l + length; var rfx = parse_RfX(data, 16); var fAlwaysCalc = data.read_shift(1); var o = [rfx]; o[2] = fAlwaysCalc; if(opts.cellFormula) { var formula = parse_XLSBArrayParsedFormula(data, end - data.l, opts); o[1] = formula; } else data.l = end; return o; } /* [MS-XLSB] 2.4.750 BrtShrFmla */ function parse_BrtShrFmla(data, length, opts) { var end = data.l + length; var rfx = parse_UncheckedRfX(data, 16); var o = [rfx]; if(opts.cellFormula) { var formula = parse_XLSBSharedParsedFormula(data, end - data.l, opts); o[1] = formula; data.l = end; } else data.l = end; return o; } /* [MS-XLSB] 2.4.323 BrtColInfo */ /* TODO: once XLS ColInfo is set, combine the functions */ function write_BrtColInfo(C/*:number*/, col, o) { if(o == null) o = new_buf(18); var p = col_obj_w(C, col); o.write_shift(-4, C); o.write_shift(-4, C); o.write_shift(4, (p.width || 10) * 256); o.write_shift(4, 0/*ixfe*/); // style var flags = 0; if(col.hidden) flags |= 0x01; if(typeof p.width == 'number') flags |= 0x02; if(col.level) flags |= (col.level << 8); o.write_shift(2, flags); // bit flag return o; } /* [MS-XLSB] 2.4.678 BrtMargins */ var BrtMarginKeys = ["left","right","top","bottom","header","footer"]; function parse_BrtMargins(data/*::, length, opts*/)/*:Margins*/ { var margins = ({}/*:any*/); BrtMarginKeys.forEach(function(k) { margins[k] = parse_Xnum(data, 8); }); return margins; } function write_BrtMargins(margins/*:Margins*/, o) { if(o == null) o = new_buf(6*8); default_margins(margins); BrtMarginKeys.forEach(function(k) { write_Xnum((margins/*:any*/)[k], o); }); return o; } /* [MS-XLSB] 2.4.299 BrtBeginWsView */ function parse_BrtBeginWsView(data/*::, length, opts*/) { var f = data.read_shift(2); data.l += 28; return { RTL: f & 0x20 }; } function write_BrtBeginWsView(ws, Workbook, o) { if(o == null) o = new_buf(30); var f = 0x39c; if((((Workbook||{}).Views||[])[0]||{}).RTL) f |= 0x20; o.write_shift(2, f); // bit flag o.write_shift(4, 0); o.write_shift(4, 0); // view first row o.write_shift(4, 0); // view first col o.write_shift(1, 0); // gridline color ICV o.write_shift(1, 0); o.write_shift(2, 0); o.write_shift(2, 100); // zoom scale o.write_shift(2, 0); o.write_shift(2, 0); o.write_shift(2, 0); o.write_shift(4, 0); // workbook view id return o; } /* [MS-XLSB] 2.4.309 BrtCellIgnoreEC */ function write_BrtCellIgnoreEC(ref) { var o = new_buf(24); o.write_shift(4, 4); o.write_shift(4, 1); write_UncheckedRfX(ref, o); return o; } /* [MS-XLSB] 2.4.748 BrtSheetProtection */ function write_BrtSheetProtection(sp, o) { if(o == null) o = new_buf(16*4+2); o.write_shift(2, sp.password ? crypto_CreatePasswordVerifier_Method1(sp.password) : 0); o.write_shift(4, 1); // this record should not be written if no protection [ ["objects", false], // fObjects ["scenarios", false], // fScenarios ["formatCells", true], // fFormatCells ["formatColumns", true], // fFormatColumns ["formatRows", true], // fFormatRows ["insertColumns", true], // fInsertColumns ["insertRows", true], // fInsertRows ["insertHyperlinks", true], // fInsertHyperlinks ["deleteColumns", true], // fDeleteColumns ["deleteRows", true], // fDeleteRows ["selectLockedCells", false], // fSelLockedCells ["sort", true], // fSort ["autoFilter", true], // fAutoFilter ["pivotTables", true], // fPivotTables ["selectUnlockedCells", false] // fSelUnlockedCells ].forEach(function(n) { /*:: if(o == null) throw "unreachable"; */ if(n[1]) o.write_shift(4, sp[n[0]] != null && !sp[n[0]] ? 1 : 0); else o.write_shift(4, sp[n[0]] != null && sp[n[0]] ? 0 : 1); }); return o; } function parse_BrtDVal(/*data, length, opts*/) { } function parse_BrtDVal14(/*data, length, opts*/) { } /* [MS-XLSB] 2.1.7.61 Worksheet */ function parse_ws_bin(data, _opts, idx, rels, wb/*:WBWBProps*/, themes, styles)/*:Worksheet*/ { if(!data) return data; var opts = _opts || {}; if(!rels) rels = {'!id':{}}; if(DENSE != null && opts.dense == null) opts.dense = DENSE; var s/*:Worksheet*/ = (opts.dense ? [] : {}); var ref; var refguess = {s: {r:2000000, c:2000000}, e: {r:0, c:0} }; var state/*:Array<string>*/ = []; var pass = false, end = false; var row, p, cf, R, C, addr, sstr, rr, cell/*:Cell*/; var merges/*:Array<Range>*/ = []; opts.biff = 12; opts['!row'] = 0; var ai = 0, af = false; var arrayf/*:Array<[Range, string]>*/ = []; var sharedf = {}; var supbooks = opts.supbooks || /*::(*/wb/*:: :any)*/.supbooks || ([[]]/*:any*/); supbooks.sharedf = sharedf; supbooks.arrayf = arrayf; supbooks.SheetNames = wb.SheetNames || wb.Sheets.map(function(x) { return x.name; }); if(!opts.supbooks) { opts.supbooks = supbooks; if(wb.Names) for(var i = 0; i < wb.Names.length; ++i) supbooks[0][i+1] = wb.Names[i]; } var colinfo/*:Array<ColInfo>*/ = [], rowinfo/*:Array<RowInfo>*/ = []; var seencol = false; XLSBRecordEnum[0x0010] = { n:"BrtShortReal", f:parse_BrtShortReal }; var cm, vm; recordhopper(data, function ws_parse(val, RR, RT) { if(end) return; switch(RT) { case 0x0094: /* 'BrtWsDim' */ ref = val; break; case 0x0000: /* 'BrtRowHdr' */ row = val; if(opts.sheetRows && opts.sheetRows <= row.r) end=true; rr = encode_row(R = row.r); opts['!row'] = row.r; if(val.hidden || val.hpt || val.level != null) { if(val.hpt) val.hpx = pt2px(val.hpt); rowinfo[val.r] = val; } break; case 0x0002: /* 'BrtCellRk' */ case 0x0003: /* 'BrtCellError' */ case 0x0004: /* 'BrtCellBool' */ case 0x0005: /* 'BrtCellReal' */ case 0x0006: /* 'BrtCellSt' */ case 0x0007: /* 'BrtCellIsst' */ case 0x0008: /* 'BrtFmlaString' */ case 0x0009: /* 'BrtFmlaNum' */ case 0x000A: /* 'BrtFmlaBool' */ case 0x000B: /* 'BrtFmlaError' */ case 0x000D: /* 'BrtShortRk' */ case 0x000E: /* 'BrtShortError' */ case 0x000F: /* 'BrtShortBool' */ case 0x0010: /* 'BrtShortReal' */ case 0x0011: /* 'BrtShortSt' */ case 0x0012: /* 'BrtShortIsst' */ case 0x003E: /* 'BrtCellRString' */ p = ({t:val[2]}/*:any*/); switch(val[2]) { case 'n': p.v = val[1]; break; case 's': sstr = strs[val[1]]; p.v = sstr.t; p.r = sstr.r; break; case 'b': p.v = val[1] ? true : false; break; case 'e': p.v = val[1]; if(opts.cellText !== false) p.w = BErr[p.v]; break; case 'str': p.t = 's'; p.v = val[1]; break; case 'is': p.t = 's'; p.v = val[1].t; break; } if((cf = styles.CellXf[val[0].iStyleRef])) safe_format(p,cf.numFmtId,null,opts, themes, styles); C = val[0].c == -1 ? C + 1 : val[0].c; if(opts.dense) { if(!s[R]) s[R] = []; s[R][C] = p; } else s[encode_col(C) + rr] = p; if(opts.cellFormula) { af = false; for(ai = 0; ai < arrayf.length; ++ai) { var aii = arrayf[ai]; if(row.r >= aii[0].s.r && row.r <= aii[0].e.r) if(C >= aii[0].s.c && C <= aii[0].e.c) { p.F = encode_range(aii[0]); af = true; } } if(!af && val.length > 3) p.f = val[3]; } if(refguess.s.r > row.r) refguess.s.r = row.r; if(refguess.s.c > C) refguess.s.c = C; if(refguess.e.r < row.r) refguess.e.r = row.r; if(refguess.e.c < C) refguess.e.c = C; if(opts.cellDates && cf && p.t == 'n' && fmt_is_date(table_fmt[cf.numFmtId])) { var _d = SSF_parse_date_code(p.v); if(_d) { p.t = 'd'; p.v = new Date(_d.y, _d.m-1,_d.d,_d.H,_d.M,_d.S,_d.u); } } if(cm) { if(cm.type == 'XLDAPR') p.D = true; cm = void 0; } if(vm) vm = void 0; break; case 0x0001: /* 'BrtCellBlank' */ case 0x000C: /* 'BrtShortBlank' */ if(!opts.sheetStubs || pass) break; p = ({t:'z',v:void 0}/*:any*/); C = val[0].c == -1 ? C + 1 : val[0].c; if(opts.dense) { if(!s[R]) s[R] = []; s[R][C] = p; } else s[encode_col(C) + rr] = p; if(refguess.s.r > row.r) refguess.s.r = row.r; if(refguess.s.c > C) refguess.s.c = C; if(refguess.e.r < row.r) refguess.e.r = row.r; if(refguess.e.c < C) refguess.e.c = C; if(cm) { if(cm.type == 'XLDAPR') p.D = true; cm = void 0; } if(vm) vm = void 0; break; case 0x00B0: /* 'BrtMergeCell' */ merges.push(val); break; case 0x0031: { /* 'BrtCellMeta' */ cm = ((opts.xlmeta||{}).Cell||[])[val-1]; } break; case 0x01EE: /* 'BrtHLink' */ var rel = rels['!id'][val.relId]; if(rel) { val.Target = rel.Target; if(val.loc) val.Target += "#"+val.loc; val.Rel = rel; } else if(val.relId == '') { val.Target = "#" + val.loc; } for(R=val.rfx.s.r;R<=val.rfx.e.r;++R) for(C=val.rfx.s.c;C<=val.rfx.e.c;++C) { if(opts.dense) { if(!s[R]) s[R] = []; if(!s[R][C]) s[R][C] = {t:'z',v:undefined}; s[R][C].l = val; } else { addr = encode_cell({c:C,r:R}); if(!s[addr]) s[addr] = {t:'z',v:undefined}; s[addr].l = val; } } break; case 0x01AA: /* 'BrtArrFmla' */ if(!opts.cellFormula) break; arrayf.push(val); cell = ((opts.dense ? s[R][C] : s[encode_col(C) + rr])/*:any*/); cell.f = stringify_formula(val[1], refguess, {r:row.r, c:C}, supbooks, opts); cell.F = encode_range(val[0]); break; case 0x01AB: /* 'BrtShrFmla' */ if(!opts.cellFormula) break; sharedf[encode_cell(val[0].s)] = val[1]; cell = (opts.dense ? s[R][C] : s[encode_col(C) + rr]); cell.f = stringify_formula(val[1], refguess, {r:row.r, c:C}, supbooks, opts); break; /* identical to 'ColInfo' in XLS */ case 0x003C: /* 'BrtColInfo' */ if(!opts.cellStyles) break; while(val.e >= val.s) { colinfo[val.e--] = { width: val.w/256, hidden: !!(val.flags & 0x01), level: val.level }; if(!seencol) { seencol = true; find_mdw_colw(val.w/256); } process_col(colinfo[val.e+1]); } break; case 0x00A1: /* 'BrtBeginAFilter' */ s['!autofilter'] = { ref:encode_range(val) }; break; case 0x01DC: /* 'BrtMargins' */ s['!margins'] = val; break; case 0x0093: /* 'BrtWsProp' */ if(!wb.Sheets[idx]) wb.Sheets[idx] = {}; if(val.name) wb.Sheets[idx].CodeName = val.name; if(val.above || val.left) s['!outline'] = { above: val.above, left: val.left }; break; case 0x0089: /* 'BrtBeginWsView' */ if(!wb.Views) wb.Views = [{}]; if(!wb.Views[0]) wb.Views[0] = {}; if(val.RTL) wb.Views[0].RTL = true; break; case 0x01E5: /* 'BrtWsFmtInfo' */ break; case 0x0040: /* 'BrtDVal' */ case 0x041D: /* 'BrtDVal14' */ break; case 0x0097: /* 'BrtPane' */ break; case 0x0098: /* 'BrtSel' */ case 0x00AF: /* 'BrtAFilterDateGroupItem' */ case 0x0284: /* 'BrtActiveX' */ case 0x0271: /* 'BrtBigName' */ case 0x0232: /* 'BrtBkHim' */ case 0x018C: /* 'BrtBrk' */ case 0x0458: /* 'BrtCFIcon' */ case 0x047A: /* 'BrtCFRuleExt' */ case 0x01D7: /* 'BrtCFVO' */ case 0x041A: /* 'BrtCFVO14' */ case 0x0289: /* 'BrtCellIgnoreEC' */ case 0x0451: /* 'BrtCellIgnoreEC14' */ case 0x024D: /* 'BrtCellSmartTagProperty' */ case 0x025F: /* 'BrtCellWatch' */ case 0x0234: /* 'BrtColor' */ case 0x041F: /* 'BrtColor14' */ case 0x00A8: /* 'BrtColorFilter' */ case 0x00AE: /* 'BrtCustomFilter' */ case 0x049C: /* 'BrtCustomFilter14' */ case 0x01F3: /* 'BrtDRef' */ case 0x01FB: /* 'BrtDXF' */ case 0x0226: /* 'BrtDrawing' */ case 0x00AB: /* 'BrtDynamicFilter' */ case 0x00A7: /* 'BrtFilter' */ case 0x0499: /* 'BrtFilter14' */ case 0x00A9: /* 'BrtIconFilter' */ case 0x049D: /* 'BrtIconFilter14' */ case 0x0227: /* 'BrtLegacyDrawing' */ case 0x0228: /* 'BrtLegacyDrawingHF' */ case 0x0295: /* 'BrtListPart' */ case 0x027F: /* 'BrtOleObject' */ case 0x01DE: /* 'BrtPageSetup' */ case 0x0219: /* 'BrtPhoneticInfo' */ case 0x01DD: /* 'BrtPrintOptions' */ case 0x0218: /* 'BrtRangeProtection' */ case 0x044F: /* 'BrtRangeProtection14' */ case 0x02A8: /* 'BrtRangeProtectionIso' */ case 0x0450: /* 'BrtRangeProtectionIso14' */ case 0x0400: /* 'BrtRwDescent' */ case 0x0297: /* 'BrtSheetCalcProp' */ case 0x0217: /* 'BrtSheetProtection' */ case 0x02A6: /* 'BrtSheetProtectionIso' */ case 0x01F8: /* 'BrtSlc' */ case 0x0413: /* 'BrtSparkline' */ case 0x01AC: /* 'BrtTable' */ case 0x00AA: /* 'BrtTop10Filter' */ case 0x0C00: /* 'BrtUid' */ case 0x0032: /* 'BrtValueMeta' */ case 0x0816: /* 'BrtWebExtension' */ case 0x0415: /* 'BrtWsFmtInfoEx14' */ break; case 0x0023: /* 'BrtFRTBegin' */ pass = true; break; case 0x0024: /* 'BrtFRTEnd' */ pass = false; break; case 0x0025: /* 'BrtACBegin' */ state.push(RT); pass = true; break; case 0x0026: /* 'BrtACEnd' */ state.pop(); pass = false; break; default: if(RR.T){/* empty */} else if(!pass || opts.WTF) throw new Error("Unexpected record 0x" + RT.toString(16)); } }, opts); delete opts.supbooks; delete opts['!row']; if(!s["!ref"] && (refguess.s.r < 2000000 || ref && (ref.e.r > 0 || ref.e.c > 0 || ref.s.r > 0 || ref.s.c > 0))) s["!ref"] = encode_range(ref || refguess); if(opts.sheetRows && s["!ref"]) { var tmpref = safe_decode_range(s["!ref"]); if(opts.sheetRows <= +tmpref.e.r) { tmpref.e.r = opts.sheetRows - 1; if(tmpref.e.r > refguess.e.r) tmpref.e.r = refguess.e.r; if(tmpref.e.r < tmpref.s.r) tmpref.s.r = tmpref.e.r; if(tmpref.e.c > refguess.e.c) tmpref.e.c = refguess.e.c; if(tmpref.e.c < tmpref.s.c) tmpref.s.c = tmpref.e.c; s["!fullref"] = s["!ref"]; s["!ref"] = encode_range(tmpref); } } if(merges.length > 0) s["!merges"] = merges; if(colinfo.length > 0) s["!cols"] = colinfo; if(rowinfo.length > 0) s["!rows"] = rowinfo; return s; } /* TODO: something useful -- this is a stub */ function write_ws_bin_cell(ba/*:BufArray*/, cell/*:Cell*/, R/*:number*/, C/*:number*/, opts, ws/*:Worksheet*/, last_seen/*:boolean*/)/*:boolean*/ { if(cell.v === undefined) return false; var vv = ""; switch(cell.t) { case 'b': vv = cell.v ? "1" : "0"; break; case 'd': // no BrtCellDate :( cell = dup(cell); cell.z = cell.z || table_fmt[14]; cell.v = datenum(parseDate(cell.v)); cell.t = 'n'; break; /* falls through */ case 'n': case 'e': vv = ''+cell.v; break; default: vv = cell.v; break; } var o/*:any*/ = ({r:R, c:C}/*:any*/); /* TODO: cell style */ o.s = get_cell_style(opts.cellXfs, cell, opts); if(cell.l) ws['!links'].push([encode_cell(o), cell.l]); if(cell.c) ws['!comments'].push([encode_cell(o), cell.c]); switch(cell.t) { case 's': case 'str': if(opts.bookSST) { vv = get_sst_id(opts.Strings, (cell.v/*:any*/), opts.revStrings); o.t = "s"; o.v = vv; if(last_seen) write_record(ba, 0x0012 /* BrtShortIsst */, write_BrtShortIsst(cell, o)); else write_record(ba, 0x0007 /* BrtCellIsst */, write_BrtCellIsst(cell, o)); } else { o.t = "str"; if(last_seen) write_record(ba, 0x0011 /* BrtShortSt */, write_BrtShortSt(cell, o)); else write_record(ba, 0x0006 /* BrtCellSt */, write_BrtCellSt(cell, o)); } return true; case 'n': /* TODO: determine threshold for Real vs RK */ if(cell.v == (cell.v | 0) && cell.v > -1000 && cell.v < 1000) { if(last_seen) write_record(ba, 0x000D /* BrtShortRk */, write_BrtShortRk(cell, o)); else write_record(ba, 0x0002 /* BrtCellRk */, write_BrtCellRk(cell, o)); } else { if(last_seen) write_record(ba, 0x0010 /* BrtShortReal */, write_BrtShortReal(cell, o)); else write_record(ba, 0x0005 /* BrtCellReal */, write_BrtCellReal(cell, o)); } return true; case 'b': o.t = "b"; if(last_seen) write_record(ba, 0x000F /* BrtShortBool */, write_BrtShortBool(cell, o)); else write_record(ba, 0x0004 /* BrtCellBool */, write_BrtCellBool(cell, o)); return true; case 'e': o.t = "e"; if(last_seen) write_record(ba, 0x000E /* BrtShortError */, write_BrtShortError(cell, o)); else write_record(ba, 0x0003 /* BrtCellError */, write_BrtCellError(cell, o)); return true; } if(last_seen) write_record(ba, 0x000C /* BrtShortBlank */, write_BrtShortBlank(cell, o)); else write_record(ba, 0x0001 /* BrtCellBlank */, write_BrtCellBlank(cell, o)); return true; } function write_CELLTABLE(ba, ws/*:Worksheet*/, idx/*:number*/, opts/*::, wb:Workbook*/) { var range = safe_decode_range(ws['!ref'] || "A1"), ref, rr = "", cols/*:Array<string>*/ = []; write_record(ba, 0x0091 /* BrtBeginSheetData */); var dense = Array.isArray(ws); var cap = range.e.r; if(ws['!rows']) cap = Math.max(range.e.r, ws['!rows'].length - 1); for(var R = range.s.r; R <= cap; ++R) { rr = encode_row(R); /* [ACCELLTABLE] */ /* BrtRowHdr */ write_row_header(ba, ws, range, R); var last_seen = false; if(R <= range.e.r) for(var C = range.s.c; C <= range.e.c; ++C) { /* *16384CELL */ if(R === range.s.r) cols[C] = encode_col(C); ref = cols[C] + rr; var cell = dense ? (ws[R]||[])[C] : ws[ref]; if(!cell) { last_seen = false; continue; } /* write cell */ last_seen = write_ws_bin_cell(ba, cell, R, C, opts, ws, last_seen); } } write_record(ba, 0x0092 /* BrtEndSheetData */); } function write_MERGECELLS(ba, ws/*:Worksheet*/) { if(!ws || !ws['!merges']) return; write_record(ba, 0x00B1 /* BrtBeginMergeCells */, write_BrtBeginMergeCells(ws['!merges'].length)); ws['!merges'].forEach(function(m) { write_record(ba, 0x00B0 /* BrtMergeCell */, write_BrtMergeCell(m)); }); write_record(ba, 0x00B2 /* BrtEndMergeCells */); } function write_COLINFOS(ba, ws/*:Worksheet*//*::, idx:number, opts, wb:Workbook*/) { if(!ws || !ws['!cols']) return; write_record(ba, 0x0186 /* BrtBeginColInfos */); ws['!cols'].forEach(function(m, i) { if(m) write_record(ba, 0x003C /* 'BrtColInfo' */, write_BrtColInfo(i, m)); }); write_record(ba, 0x0187 /* BrtEndColInfos */); } function write_IGNOREECS(ba, ws/*:Worksheet*/) { if(!ws || !ws['!ref']) return; write_record(ba, 0x0288 /* BrtBeginCellIgnoreECs */); write_record(ba, 0x0289 /* BrtCellIgnoreEC */, write_BrtCellIgnoreEC(safe_decode_range(ws['!ref']))); write_record(ba, 0x028A /* BrtEndCellIgnoreECs */); } function write_HLINKS(ba, ws/*:Worksheet*/, rels) { /* *BrtHLink */ ws['!links'].forEach(function(l) { if(!l[1].Target) return; var rId = add_rels(rels, -1, l[1].Target.replace(/#.*$/, ""), RELS.HLINK); write_record(ba, 0x01EE /* BrtHLink */, write_BrtHLink(l, rId)); }); delete ws['!links']; } function write_LEGACYDRAWING(ba, ws/*:Worksheet*/, idx/*:number*/, rels) { /* [BrtLegacyDrawing] */ if(ws['!comments'].length > 0) { var rId = add_rels(rels, -1, "../drawings/vmlDrawing" + (idx+1) + ".vml", RELS.VML); write_record(ba, 0x0227 /* BrtLegacyDrawing */, write_RelID("rId" + rId)); ws['!legacy'] = rId; } } function write_AUTOFILTER(ba, ws, wb, idx) { if(!ws['!autofilter']) return; var data = ws['!autofilter']; var ref = typeof data.ref === "string" ? data.ref : encode_range(data.ref); /* Update FilterDatabase defined name for the worksheet */ if(!wb.Workbook) wb.Workbook = ({Sheets:[]}/*:any*/); if(!wb.Workbook.Names) wb.Workbook.Names = []; var names/*: Array<any> */ = wb.Workbook.Names; var range = decode_range(ref); if(range.s.r == range.e.r) { range.e.r = decode_range(ws["!ref"]).e.r; ref = encode_range(range); } for(var i = 0; i < names.length; ++i) { var name = names[i]; if(name.Name != '_xlnm._FilterDatabase') continue; if(name.Sheet != idx) continue; name.Ref = "'" + wb.SheetNames[idx] + "'!" + ref; break; } if(i == names.length) names.push({ Name: '_xlnm._FilterDatabase', Sheet: idx, Ref: "'" + wb.SheetNames[idx] + "'!" + ref }); write_record(ba, 0x00A1 /* BrtBeginAFilter */, write_UncheckedRfX(safe_decode_range(ref))); /* *FILTERCOLUMN */ /* [SORTSTATE] */ /* BrtEndAFilter */ write_record(ba, 0x00A2 /* BrtEndAFilter */); } function write_WSVIEWS2(ba, ws, Workbook) { write_record(ba, 0x0085 /* BrtBeginWsViews */); { /* 1*WSVIEW2 */ /* [ACUID] */ write_record(ba, 0x0089 /* BrtBeginWsView */, write_BrtBeginWsView(ws, Workbook)); /* [BrtPane] */ /* *4BrtSel */ /* *4SXSELECT */ /* *FRT */ write_record(ba, 0x008A /* BrtEndWsView */); } /* *FRT */ write_record(ba, 0x0086 /* BrtEndWsViews */); } function write_WSFMTINFO(/*::ba, ws*/) { /* [ACWSFMTINFO] */ // write_record(ba, 0x01E5 /* BrtWsFmtInfo */, write_BrtWsFmtInfo(ws)); } function write_SHEETPROTECT(ba, ws) { if(!ws['!protect']) return; /* [BrtSheetProtectionIso] */ write_record(ba, 0x0217 /* BrtSheetProtection */, write_BrtSheetProtection(ws['!protect'])); } function write_ws_bin(idx/*:number*/, opts, wb/*:Workbook*/, rels) { var ba = buf_array(); var s = wb.SheetNames[idx], ws = wb.Sheets[s] || {}; var c/*:string*/ = s; try { if(wb && wb.Workbook) c = wb.Workbook.Sheets[idx].CodeName || c; } catch(e) {} var r = safe_decode_range(ws['!ref'] || "A1"); if(r.e.c > 0x3FFF || r.e.r > 0xFFFFF) { if(opts.WTF) throw new Error("Range " + (ws['!ref'] || "A1") + " exceeds format limit A1:XFD1048576"); r.e.c = Math.min(r.e.c, 0x3FFF); r.e.r = Math.min(r.e.c, 0xFFFFF); } ws['!links'] = []; /* passed back to write_zip and removed there */ ws['!comments'] = []; write_record(ba, 0x0081 /* BrtBeginSheet */); if(wb.vbaraw || ws['!outline']) write_record(ba, 0x0093 /* BrtWsProp */, write_BrtWsProp(c, ws['!outline'])); write_record(ba, 0x0094 /* BrtWsDim */, write_BrtWsDim(r)); write_WSVIEWS2(ba, ws, wb.Workbook); write_WSFMTINFO(ba, ws); write_COLINFOS(ba, ws, idx, opts, wb); write_CELLTABLE(ba, ws, idx, opts, wb); /* [BrtSheetCalcProp] */ write_SHEETPROTECT(ba, ws); /* *([BrtRangeProtectionIso] BrtRangeProtection) */ /* [SCENMAN] */ write_AUTOFILTER(ba, ws, wb, idx); /* [SORTSTATE] */ /* [DCON] */ /* [USERSHVIEWS] */ write_MERGECELLS(ba, ws); /* [BrtPhoneticInfo] */ /* *CONDITIONALFORMATTING */ /* [DVALS] */ write_HLINKS(ba, ws, rels); /* [BrtPrintOptions] */ if(ws['!margins']) write_record(ba, 0x01DC /* BrtMargins */, write_BrtMargins(ws['!margins'])); /* [BrtPageSetup] */ /* [HEADERFOOTER] */ /* [RWBRK] */ /* [COLBRK] */ /* *BrtBigName */ /* [CELLWATCHES] */ if(!opts || opts.ignoreEC || (opts.ignoreEC == (void 0))) write_IGNOREECS(ba, ws); /* [SMARTTAGS] */ /* [BrtDrawing] */ write_LEGACYDRAWING(ba, ws, idx, rels); /* [BrtLegacyDrawingHF] */ /* [BrtBkHim] */ /* [OLEOBJECTS] */ /* [ACTIVEXCONTROLS] */ /* [WEBPUBITEMS] */ /* [LISTPARTS] */ /* FRTWORKSHEET */ write_record(ba, 0x0082 /* BrtEndSheet */); return ba.end(); } function parse_Cache(data/*:string*/)/*:[Array<number|string>, string, ?string]*/ { var col/*:Array<number|string>*/ = []; var num = data.match(/^<c:numCache>/); var f; /* 21.2.2.150 pt CT_NumVal */ (data.match(/<c:pt idx="(\d*)">(.*?)<\/c:pt>/mg)||[]).forEach(function(pt) { var q = pt.match(/<c:pt idx="(\d*?)"><c:v>(.*)<\/c:v><\/c:pt>/); if(!q) return; col[+q[1]] = num ? +q[2] : q[2]; }); /* 21.2.2.71 formatCode CT_Xstring */ var nf = unescapexml((data.match(/<c:formatCode>([\s\S]*?)<\/c:formatCode>/) || ["","General"])[1]); (data.match(/<c:f>(.*?)<\/c:f>/mg)||[]).forEach(function(F) { f = F.replace(/<.*?>/g,""); }); return [col, nf, f]; } /* 21.2 DrawingML - Charts */ function parse_chart(data/*:?string*/, name/*:string*/, opts, rels, wb, csheet) { var cs/*:Worksheet*/ = ((csheet || {"!type":"chart"})/*:any*/); if(!data) return csheet; /* 21.2.2.27 chart CT_Chart */ var C = 0, R = 0, col = "A"; var refguess = {s: {r:2000000, c:2000000}, e: {r:0, c:0} }; /* 21.2.2.120 numCache CT_NumData */ (data.match(/<c:numCache>[\s\S]*?<\/c:numCache>/gm)||[]).forEach(function(nc) { var cache = parse_Cache(nc); refguess.s.r = refguess.s.c = 0; refguess.e.c = C; col = encode_col(C); cache[0].forEach(function(n,i) { cs[col + encode_row(i)] = {t:'n', v:n, z:cache[1] }; R = i; }); if(refguess.e.r < R) refguess.e.r = R; ++C; }); if(C > 0) cs["!ref"] = encode_range(refguess); return cs; } /* 18.3 Worksheets also covers Chartsheets */ function parse_cs_xml(data/*:?string*/, opts, idx/*:number*/, rels, wb/*::, themes, styles*/)/*:Worksheet*/ { if(!data) return data; /* 18.3.1.12 chartsheet CT_ChartSheet */ if(!rels) rels = {'!id':{}}; var s = ({'!type':"chart", '!drawel':null, '!rel':""}/*:any*/); var m; /* 18.3.1.83 sheetPr CT_ChartsheetPr */ var sheetPr = data.match(sheetprregex); if(sheetPr) parse_ws_xml_sheetpr(sheetPr[0], s, wb, idx); /* 18.3.1.36 drawing CT_Drawing */ if((m = data.match(/drawing r:id="(.*?)"/))) s['!rel'] = m[1]; if(rels['!id'][s['!rel']]) s['!drawel'] = rels['!id'][s['!rel']]; return s; } function write_cs_xml(idx/*:number*/, opts, wb/*:Workbook*/, rels)/*:string*/ { var o = [XML_HEADER, writextag('chartsheet', null, { 'xmlns': XMLNS_main[0], 'xmlns:r': XMLNS.r })]; o[o.length] = writextag("drawing", null, {"r:id": "rId1"}); add_rels(rels, -1, "../drawings/drawing" + (idx+1) + ".xml", RELS.DRAW); if(o.length>2) { o[o.length] = ('</chartsheet>'); o[1]=o[1].replace("/>",">"); } return o.join(""); } /* [MS-XLSB] 2.4.331 BrtCsProp */ function parse_BrtCsProp(data, length/*:number*/) { data.l += 10; var name = parse_XLWideString(data, length - 10); return { name: name }; } /* [MS-XLSB] 2.1.7.7 Chart Sheet */ function parse_cs_bin(data, opts, idx/*:number*/, rels, wb/*::, themes, styles*/)/*:Worksheet*/ { if(!data) return data; if(!rels) rels = {'!id':{}}; var s = {'!type':"chart", '!drawel':null, '!rel':""}; var state/*:Array<string>*/ = []; var pass = false; recordhopper(data, function cs_parse(val, R, RT) { switch(RT) { case 0x0226: /* 'BrtDrawing' */ s['!rel'] = val; break; case 0x028B: /* 'BrtCsProp' */ if(!wb.Sheets[idx]) wb.Sheets[idx] = {}; if(val.name) wb.Sheets[idx].CodeName = val.name; break; case 0x0232: /* 'BrtBkHim' */ case 0x028C: /* 'BrtCsPageSetup' */ case 0x029D: /* 'BrtCsProtection' */ case 0x02A7: /* 'BrtCsProtectionIso' */ case 0x0227: /* 'BrtLegacyDrawing' */ case 0x0228: /* 'BrtLegacyDrawingHF' */ case 0x01DC: /* 'BrtMargins' */ case 0x0C00: /* 'BrtUid' */ break; case 0x0023: /* 'BrtFRTBegin' */ pass = true; break; case 0x0024: /* 'BrtFRTEnd' */ pass = false; break; case 0x0025: /* 'BrtACBegin' */ state.push(RT); break; case 0x0026: /* 'BrtACEnd' */ state.pop(); break; default: if(R.T > 0) state.push(RT); else if(R.T < 0) state.pop(); else if(!pass || opts.WTF) throw new Error("Unexpected record 0x" + RT.toString(16)); } }, opts); if(rels['!id'][s['!rel']]) s['!drawel'] = rels['!id'][s['!rel']]; return s; } function write_cs_bin(/*::idx:number, opts, wb:Workbook, rels*/) { var ba = buf_array(); write_record(ba, 0x0081 /* BrtBeginSheet */); /* [BrtCsProp] */ /* CSVIEWS */ /* [[BrtCsProtectionIso] BrtCsProtection] */ /* [USERCSVIEWS] */ /* [BrtMargins] */ /* [BrtCsPageSetup] */ /* [HEADERFOOTER] */ /* BrtDrawing */ /* [BrtLegacyDrawing] */ /* [BrtLegacyDrawingHF] */ /* [BrtBkHim] */ /* [WEBPUBITEMS] */ /* FRTCHARTSHEET */ write_record(ba, 0x0082 /* BrtEndSheet */); return ba.end(); } /* 18.2.28 (CT_WorkbookProtection) Defaults */ var WBPropsDef = [ ['allowRefreshQuery', false, "bool"], ['autoCompressPictures', true, "bool"], ['backupFile', false, "bool"], ['checkCompatibility', false, "bool"], ['CodeName', ''], ['date1904', false, "bool"], ['defaultThemeVersion', 0, "int"], ['filterPrivacy', false, "bool"], ['hidePivotFieldList', false, "bool"], ['promptedSolutions', false, "bool"], ['publishItems', false, "bool"], ['refreshAllConnections', false, "bool"], ['saveExternalLinkValues', true, "bool"], ['showBorderUnselectedTables', true, "bool"], ['showInkAnnotation', true, "bool"], ['showObjects', 'all'], ['showPivotChartFilter', false, "bool"], ['updateLinks', 'userSet'] ]; /* 18.2.30 (CT_BookView) Defaults */ var WBViewDef = [ ['activeTab', 0, "int"], ['autoFilterDateGrouping', true, "bool"], ['firstSheet', 0, "int"], ['minimized', false, "bool"], ['showHorizontalScroll', true, "bool"], ['showSheetTabs', true, "bool"], ['showVerticalScroll', true, "bool"], ['tabRatio', 600, "int"], ['visibility', 'visible'] //window{Height,Width}, {x,y}Window ]; /* 18.2.19 (CT_Sheet) Defaults */ var SheetDef = [ //['state', 'visible'] ]; /* 18.2.2 (CT_CalcPr) Defaults */ var CalcPrDef = [ ['calcCompleted', 'true'], ['calcMode', 'auto'], ['calcOnSave', 'true'], ['concurrentCalc', 'true'], ['fullCalcOnLoad', 'false'], ['fullPrecision', 'true'], ['iterate', 'false'], ['iterateCount', '100'], ['iterateDelta', '0.001'], ['refMode', 'A1'] ]; /* 18.2.3 (CT_CustomWorkbookView) Defaults */ /*var CustomWBViewDef = [ ['autoUpdate', 'false'], ['changesSavedWin', 'false'], ['includeHiddenRowCol', 'true'], ['includePrintSettings', 'true'], ['maximized', 'false'], ['minimized', 'false'], ['onlySync', 'false'], ['personalView', 'false'], ['showComments', 'commIndicator'], ['showFormulaBar', 'true'], ['showHorizontalScroll', 'true'], ['showObjects', 'all'], ['showSheetTabs', 'true'], ['showStatusbar', 'true'], ['showVerticalScroll', 'true'], ['tabRatio', '600'], ['xWindow', '0'], ['yWindow', '0'] ];*/ function push_defaults_array(target, defaults) { for(var j = 0; j != target.length; ++j) { var w = target[j]; for(var i=0; i != defaults.length; ++i) { var z = defaults[i]; if(w[z[0]] == null) w[z[0]] = z[1]; else switch(z[2]) { case "bool": if(typeof w[z[0]] == "string") w[z[0]] = parsexmlbool(w[z[0]]); break; case "int": if(typeof w[z[0]] == "string") w[z[0]] = parseInt(w[z[0]], 10); break; } } } } function push_defaults(target, defaults) { for(var i = 0; i != defaults.length; ++i) { var z = defaults[i]; if(target[z[0]] == null) target[z[0]] = z[1]; else switch(z[2]) { case "bool": if(typeof target[z[0]] == "string") target[z[0]] = parsexmlbool(target[z[0]]); break; case "int": if(typeof target[z[0]] == "string") target[z[0]] = parseInt(target[z[0]], 10); break; } } } function parse_wb_defaults(wb) { push_defaults(wb.WBProps, WBPropsDef); push_defaults(wb.CalcPr, CalcPrDef); push_defaults_array(wb.WBView, WBViewDef); push_defaults_array(wb.Sheets, SheetDef); _ssfopts.date1904 = parsexmlbool(wb.WBProps.date1904); } function safe1904(wb/*:Workbook*/)/*:string*/ { /* TODO: store date1904 somewhere else */ if(!wb.Workbook) return "false"; if(!wb.Workbook.WBProps) return "false"; return parsexmlbool(wb.Workbook.WBProps.date1904) ? "true" : "false"; } var badchars = /*#__PURE__*/"][*?\/\\".split(""); function check_ws_name(n/*:string*/, safe/*:?boolean*/)/*:boolean*/ { if(n.length > 31) { if(safe) return false; throw new Error("Sheet names cannot exceed 31 chars"); } var _good = true; badchars.forEach(function(c) { if(n.indexOf(c) == -1) return; if(!safe) throw new Error("Sheet name cannot contain : \\ / ? * [ ]"); _good = false; }); return _good; } function check_wb_names(N, S, codes) { N.forEach(function(n,i) { check_ws_name(n); for(var j = 0; j < i; ++j) if(n == N[j]) throw new Error("Duplicate Sheet Name: " + n); if(codes) { var cn = (S && S[i] && S[i].CodeName) || n; if(cn.charCodeAt(0) == 95 && cn.length > 22) throw new Error("Bad Code Name: Worksheet" + cn); } }); } function check_wb(wb) { if(!wb || !wb.SheetNames || !wb.Sheets) throw new Error("Invalid Workbook"); if(!wb.SheetNames.length) throw new Error("Workbook is empty"); var Sheets = (wb.Workbook && wb.Workbook.Sheets) || []; check_wb_names(wb.SheetNames, Sheets, !!wb.vbaraw); for(var i = 0; i < wb.SheetNames.length; ++i) check_ws(wb.Sheets[wb.SheetNames[i]], wb.SheetNames[i], i); /* TODO: validate workbook */ } /* 18.2 Workbook */ var wbnsregex = /<\w+:workbook/; function parse_wb_xml(data, opts)/*:WorkbookFile*/ { if(!data) throw new Error("Could not find file"); var wb = /*::(*/{ AppVersion:{}, WBProps:{}, WBView:[], Sheets:[], CalcPr:{}, Names:[], xmlns: "" }/*::)*/; var pass = false, xmlns = "xmlns"; var dname = {}, dnstart = 0; data.replace(tagregex, function xml_wb(x, idx) { var y/*:any*/ = parsexmltag(x); switch(strip_ns(y[0])) { case '<?xml': break; /* 18.2.27 workbook CT_Workbook 1 */ case '<workbook': if(x.match(wbnsregex)) xmlns = "xmlns" + x.match(/<(\w+):/)[1]; wb.xmlns = y[xmlns]; break; case '</workbook>': break; /* 18.2.13 fileVersion CT_FileVersion ? */ case '<fileVersion': delete y[0]; wb.AppVersion = y; break; case '<fileVersion/>': case '</fileVersion>': break; /* 18.2.12 fileSharing CT_FileSharing ? */ case '<fileSharing': break; case '<fileSharing/>': break; /* 18.2.28 workbookPr CT_WorkbookPr ? */ case '<workbookPr': case '<workbookPr/>': WBPropsDef.forEach(function(w) { if(y[w[0]] == null) return; switch(w[2]) { case "bool": wb.WBProps[w[0]] = parsexmlbool(y[w[0]]); break; case "int": wb.WBProps[w[0]] = parseInt(y[w[0]], 10); break; default: wb.WBProps[w[0]] = y[w[0]]; } }); if(y.codeName) wb.WBProps.CodeName = utf8read(y.codeName); break; case '</workbookPr>': break; /* 18.2.29 workbookProtection CT_WorkbookProtection ? */ case '<workbookProtection': break; case '<workbookProtection/>': break; /* 18.2.1 bookViews CT_BookViews ? */ case '<bookViews': case '<bookViews>': case '</bookViews>': break; /* 18.2.30 workbookView CT_BookView + */ case '<workbookView': case '<workbookView/>': delete y[0]; wb.WBView.push(y); break; case '</workbookView>': break; /* 18.2.20 sheets CT_Sheets 1 */ case '<sheets': case '<sheets>': case '</sheets>': break; // aggregate sheet /* 18.2.19 sheet CT_Sheet + */ case '<sheet': switch(y.state) { case "hidden": y.Hidden = 1; break; case "veryHidden": y.Hidden = 2; break; default: y.Hidden = 0; } delete y.state; y.name = unescapexml(utf8read(y.name)); delete y[0]; wb.Sheets.push(y); break; case '</sheet>': break; /* 18.2.15 functionGroups CT_FunctionGroups ? */ case '<functionGroups': case '<functionGroups/>': break; /* 18.2.14 functionGroup CT_FunctionGroup + */ case '<functionGroup': break; /* 18.2.9 externalReferences CT_ExternalReferences ? */ case '<externalReferences': case '</externalReferences>': case '<externalReferences>': break; /* 18.2.8 externalReference CT_ExternalReference + */ case '<externalReference': break; /* 18.2.6 definedNames CT_DefinedNames ? */ case '<definedNames/>': break; case '<definedNames>': case '<definedNames': pass=true; break; case '</definedNames>': pass=false; break; /* 18.2.5 definedName CT_DefinedName + */ case '<definedName': { dname = {}; dname.Name = utf8read(y.name); if(y.comment) dname.Comment = y.comment; if(y.localSheetId) dname.Sheet = +y.localSheetId; if(parsexmlbool(y.hidden||"0")) dname.Hidden = true; dnstart = idx + x.length; } break; case '</definedName>': { dname.Ref = unescapexml(utf8read(data.slice(dnstart, idx))); wb.Names.push(dname); } break; case '<definedName/>': break; /* 18.2.2 calcPr CT_CalcPr ? */ case '<calcPr': delete y[0]; wb.CalcPr = y; break; case '<calcPr/>': delete y[0]; wb.CalcPr = y; break; case '</calcPr>': break; /* 18.2.16 oleSize CT_OleSize ? (ref required) */ case '<oleSize': break; /* 18.2.4 customWorkbookViews CT_CustomWorkbookViews ? */ case '<customWorkbookViews>': case '</customWorkbookViews>': case '<customWorkbookViews': break; /* 18.2.3 customWorkbookView CT_CustomWorkbookView + */ case '<customWorkbookView': case '</customWorkbookView>': break; /* 18.2.18 pivotCaches CT_PivotCaches ? */ case '<pivotCaches>': case '</pivotCaches>': case '<pivotCaches': break; /* 18.2.17 pivotCache CT_PivotCache ? */ case '<pivotCache': break; /* 18.2.21 smartTagPr CT_SmartTagPr ? */ case '<smartTagPr': case '<smartTagPr/>': break; /* 18.2.23 smartTagTypes CT_SmartTagTypes ? */ case '<smartTagTypes': case '<smartTagTypes>': case '</smartTagTypes>': break; /* 18.2.22 smartTagType CT_SmartTagType ? */ case '<smartTagType': break; /* 18.2.24 webPublishing CT_WebPublishing ? */ case '<webPublishing': case '<webPublishing/>': break; /* 18.2.11 fileRecoveryPr CT_FileRecoveryPr ? */ case '<fileRecoveryPr': case '<fileRecoveryPr/>': break; /* 18.2.26 webPublishObjects CT_WebPublishObjects ? */ case '<webPublishObjects>': case '<webPublishObjects': case '</webPublishObjects>': break; /* 18.2.25 webPublishObject CT_WebPublishObject ? */ case '<webPublishObject': break; /* 18.2.10 extLst CT_ExtensionList ? */ case '<extLst': case '<extLst>': case '</extLst>': case '<extLst/>': break; /* 18.2.7 ext CT_Extension + */ case '<ext': pass=true; break; //TODO: check with versions of excel case '</ext>': pass=false; break; /* Others */ case '<ArchID': break; case '<AlternateContent': case '<AlternateContent>': pass=true; break; case '</AlternateContent>': pass=false; break; /* TODO */ case '<revisionPtr': break; default: if(!pass && opts.WTF) throw new Error('unrecognized ' + y[0] + ' in workbook'); } return x; }); if(XMLNS_main.indexOf(wb.xmlns) === -1) throw new Error("Unknown Namespace: " + wb.xmlns); parse_wb_defaults(wb); return wb; } function write_wb_xml(wb/*:Workbook*//*::, opts:?WriteOpts*/)/*:string*/ { var o = [XML_HEADER]; o[o.length] = writextag('workbook', null, { 'xmlns': XMLNS_main[0], //'xmlns:mx': XMLNS.mx, //'xmlns:s': XMLNS_main[0], 'xmlns:r': XMLNS.r }); var write_names = (wb.Workbook && (wb.Workbook.Names||[]).length > 0); /* fileVersion */ /* fileSharing */ var workbookPr/*:any*/ = ({codeName:"ThisWorkbook"}/*:any*/); if(wb.Workbook && wb.Workbook.WBProps) { WBPropsDef.forEach(function(x) { /*:: if(!wb.Workbook || !wb.Workbook.WBProps) throw "unreachable"; */ if((wb.Workbook.WBProps[x[0]]/*:any*/) == null) return; if((wb.Workbook.WBProps[x[0]]/*:any*/) == x[1]) return; workbookPr[x[0]] = (wb.Workbook.WBProps[x[0]]/*:any*/); }); /*:: if(!wb.Workbook || !wb.Workbook.WBProps) throw "unreachable"; */ if(wb.Workbook.WBProps.CodeName) { workbookPr.codeName = wb.Workbook.WBProps.CodeName; delete workbookPr.CodeName; } } o[o.length] = (writextag('workbookPr', null, workbookPr)); /* workbookProtection */ var sheets = wb.Workbook && wb.Workbook.Sheets || []; var i = 0; /* bookViews only written if first worksheet is hidden */ if(sheets && sheets[0] && !!sheets[0].Hidden) { o[o.length] = "<bookViews>"; for(i = 0; i != wb.SheetNames.length; ++i) { if(!sheets[i]) break; if(!sheets[i].Hidden) break; } if(i == wb.SheetNames.length) i = 0; o[o.length] = '<workbookView firstSheet="' + i + '" activeTab="' + i + '"/>'; o[o.length] = "</bookViews>"; } o[o.length] = "<sheets>"; for(i = 0; i != wb.SheetNames.length; ++i) { var sht = ({name:escapexml(wb.SheetNames[i].slice(0,31))}/*:any*/); sht.sheetId = ""+(i+1); sht["r:id"] = "rId"+(i+1); if(sheets[i]) switch(sheets[i].Hidden) { case 1: sht.state = "hidden"; break; case 2: sht.state = "veryHidden"; break; } o[o.length] = (writextag('sheet',null,sht)); } o[o.length] = "</sheets>"; /* functionGroups */ /* externalReferences */ if(write_names) { o[o.length] = "<definedNames>"; if(wb.Workbook && wb.Workbook.Names) wb.Workbook.Names.forEach(function(n) { var d/*:any*/ = {name:n.Name}; if(n.Comment) d.comment = n.Comment; if(n.Sheet != null) d.localSheetId = ""+n.Sheet; if(n.Hidden) d.hidden = "1"; if(!n.Ref) return; o[o.length] = writextag('definedName', escapexml(n.Ref), d); }); o[o.length] = "</definedNames>"; } /* calcPr */ /* oleSize */ /* customWorkbookViews */ /* pivotCaches */ /* smartTagPr */ /* smartTagTypes */ /* webPublishing */ /* fileRecoveryPr */ /* webPublishObjects */ /* extLst */ if(o.length>2){ o[o.length] = '</workbook>'; o[1]=o[1].replace("/>",">"); } return o.join(""); } /* [MS-XLSB] 2.4.304 BrtBundleSh */ function parse_BrtBundleSh(data, length/*:number*/) { var z = {}; z.Hidden = data.read_shift(4); //hsState ST_SheetState z.iTabID = data.read_shift(4); z.strRelID = parse_RelID(data,length-8); z.name = parse_XLWideString(data); return z; } function write_BrtBundleSh(data, o) { if(!o) o = new_buf(127); o.write_shift(4, data.Hidden); o.write_shift(4, data.iTabID); write_RelID(data.strRelID, o); write_XLWideString(data.name.slice(0,31), o); return o.length > o.l ? o.slice(0, o.l) : o; } /* [MS-XLSB] 2.4.815 BrtWbProp */ function parse_BrtWbProp(data, length)/*:WBProps*/ { var o/*:WBProps*/ = ({}/*:any*/); var flags = data.read_shift(4); o.defaultThemeVersion = data.read_shift(4); var strName = (length > 8) ? parse_XLWideString(data) : ""; if(strName.length > 0) o.CodeName = strName; o.autoCompressPictures = !!(flags & 0x10000); o.backupFile = !!(flags & 0x40); o.checkCompatibility = !!(flags & 0x1000); o.date1904 = !!(flags & 0x01); o.filterPrivacy = !!(flags & 0x08); o.hidePivotFieldList = !!(flags & 0x400); o.promptedSolutions = !!(flags & 0x10); o.publishItems = !!(flags & 0x800); o.refreshAllConnections = !!(flags & 0x40000); o.saveExternalLinkValues = !!(flags & 0x80); o.showBorderUnselectedTables = !!(flags & 0x04); o.showInkAnnotation = !!(flags & 0x20); o.showObjects = ["all", "placeholders", "none"][(flags >> 13) & 0x03]; o.showPivotChartFilter = !!(flags & 0x8000); o.updateLinks = ["userSet", "never", "always"][(flags >> 8) & 0x03]; return o; } function write_BrtWbProp(data/*:?WBProps*/, o) { if(!o) o = new_buf(72); var flags = 0; if(data) { /* TODO: mirror parse_BrtWbProp fields */ if(data.filterPrivacy) flags |= 0x08; } o.write_shift(4, flags); o.write_shift(4, 0); write_XLSBCodeName(data && data.CodeName || "ThisWorkbook", o); return o.slice(0, o.l); } function parse_BrtFRTArchID$(data, length) { var o = {}; data.read_shift(4); o.ArchID = data.read_shift(4); data.l += length - 8; return o; } /* [MS-XLSB] 2.4.687 BrtName */ function parse_BrtName(data, length, opts) { var end = data.l + length; data.l += 4; //var flags = data.read_shift(4); data.l += 1; //var chKey = data.read_shift(1); var itab = data.read_shift(4); var name = parse_XLNameWideString(data); var formula = parse_XLSBNameParsedFormula(data, 0, opts); var comment = parse_XLNullableWideString(data); //if(0 /* fProc */) { // unusedstring1: XLNullableWideString // description: XLNullableWideString // helpTopic: XLNullableWideString // unusedstring2: XLNullableWideString //} data.l = end; var out = ({Name:name, Ptg:formula}/*:any*/); if(itab < 0xFFFFFFF) out.Sheet = itab; if(comment) out.Comment = comment; return out; } /* [MS-XLSB] 2.1.7.61 Workbook */ function parse_wb_bin(data, opts)/*:WorkbookFile*/ { var wb = { AppVersion:{}, WBProps:{}, WBView:[], Sheets:[], CalcPr:{}, xmlns: "" }; var state/*:Array<string>*/ = []; var pass = false; if(!opts) opts = {}; opts.biff = 12; var Names = []; var supbooks = ([[]]/*:any*/); supbooks.SheetNames = []; supbooks.XTI = []; XLSBRecordEnum[0x0010] = { n:"BrtFRTArchID$", f:parse_BrtFRTArchID$ }; recordhopper(data, function hopper_wb(val, R, RT) { switch(RT) { case 0x009C: /* 'BrtBundleSh' */ supbooks.SheetNames.push(val.name); wb.Sheets.push(val); break; case 0x0099: /* 'BrtWbProp' */ wb.WBProps = val; break; case 0x0027: /* 'BrtName' */ if(val.Sheet != null) opts.SID = val.Sheet; val.Ref = stringify_formula(val.Ptg, null, null, supbooks, opts); delete opts.SID; delete val.Ptg; Names.push(val); break; case 0x040C: /* 'BrtNameExt' */ break; case 0x0165: /* 'BrtSupSelf' */ case 0x0166: /* 'BrtSupSame' */ case 0x0163: /* 'BrtSupBookSrc' */ case 0x029B: /* 'BrtSupAddin' */ if(!supbooks[0].length) supbooks[0] = [RT, val]; else supbooks.push([RT, val]); supbooks[supbooks.length - 1].XTI = []; break; case 0x016A: /* 'BrtExternSheet' */ if(supbooks.length === 0) { supbooks[0] = []; supbooks[0].XTI = []; } supbooks[supbooks.length - 1].XTI = supbooks[supbooks.length - 1].XTI.concat(val); supbooks.XTI = supbooks.XTI.concat(val); break; case 0x0169: /* 'BrtPlaceholderName' */ break; case 0x0817: /* 'BrtAbsPath15' */ case 0x009E: /* 'BrtBookView' */ case 0x008F: /* 'BrtBeginBundleShs' */ case 0x0298: /* 'BrtBeginFnGroup' */ case 0x0161: /* 'BrtBeginExternals' */ break; /* case 'BrtModelTimeGroupingCalcCol' */ case 0x0C00: /* 'BrtUid' */ case 0x0C01: /* 'BrtRevisionPtr' */ case 0x0216: /* 'BrtBookProtection' */ case 0x02A5: /* 'BrtBookProtectionIso' */ case 0x009D: /* 'BrtCalcProp' */ case 0x0262: /* 'BrtCrashRecErr' */ case 0x0802: /* 'BrtDecoupledPivotCacheID' */ case 0x009B: /* 'BrtFileRecover' */ case 0x0224: /* 'BrtFileSharing' */ case 0x02A4: /* 'BrtFileSharingIso' */ case 0x0080: /* 'BrtFileVersion' */ case 0x0299: /* 'BrtFnGroup' */ case 0x0850: /* 'BrtModelRelationship' */ case 0x084D: /* 'BrtModelTable' */ case 0x0225: /* 'BrtOleSize' */ case 0x0805: /* 'BrtPivotTableRef' */ case 0x0254: /* 'BrtSmartTagType' */ case 0x081C: /* 'BrtTableSlicerCacheID' */ case 0x081B: /* 'BrtTableSlicerCacheIDs' */ case 0x0822: /* 'BrtTimelineCachePivotCacheID' */ case 0x018D: /* 'BrtUserBookView' */ case 0x009A: /* 'BrtWbFactoid' */ case 0x045D: /* 'BrtWbProp14' */ case 0x0229: /* 'BrtWebOpt' */ case 0x082B: /* 'BrtWorkBookPr15' */ break; case 0x0023: /* 'BrtFRTBegin' */ state.push(RT); pass = true; break; case 0x0024: /* 'BrtFRTEnd' */ state.pop(); pass = false; break; case 0x0025: /* 'BrtACBegin' */ state.push(RT); pass = true; break; case 0x0026: /* 'BrtACEnd' */ state.pop(); pass = false; break; case 0x0010: /* 'BrtFRTArchID$' */ break; default: if(R.T){/* empty */} else if(!pass || (opts.WTF && state[state.length-1] != 0x0025 /* BrtACBegin */ && state[state.length-1] != 0x0023 /* BrtFRTBegin */)) throw new Error("Unexpected record 0x" + RT.toString(16)); } }, opts); parse_wb_defaults(wb); // $FlowIgnore wb.Names = Names; (wb/*:any*/).supbooks = supbooks; return wb; } function write_BUNDLESHS(ba, wb/*::, opts*/) { write_record(ba, 0x008F /* BrtBeginBundleShs */); for(var idx = 0; idx != wb.SheetNames.length; ++idx) { var viz = wb.Workbook && wb.Workbook.Sheets && wb.Workbook.Sheets[idx] && wb.Workbook.Sheets[idx].Hidden || 0; var d = { Hidden: viz, iTabID: idx+1, strRelID: 'rId' + (idx+1), name: wb.SheetNames[idx] }; write_record(ba, 0x009C /* BrtBundleSh */, write_BrtBundleSh(d)); } write_record(ba, 0x0090 /* BrtEndBundleShs */); } /* [MS-XLSB] 2.4.649 BrtFileVersion */ function write_BrtFileVersion(data, o) { if(!o) o = new_buf(127); for(var i = 0; i != 4; ++i) o.write_shift(4, 0); write_XLWideString("SheetJS", o); write_XLWideString(XLSX.version, o); write_XLWideString(XLSX.version, o); write_XLWideString("7262", o); return o.length > o.l ? o.slice(0, o.l) : o; } /* [MS-XLSB] 2.4.301 BrtBookView */ function write_BrtBookView(idx, o) { if(!o) o = new_buf(29); o.write_shift(-4, 0); o.write_shift(-4, 460); o.write_shift(4, 28800); o.write_shift(4, 17600); o.write_shift(4, 500); o.write_shift(4, idx); o.write_shift(4, idx); var flags = 0x78; o.write_shift(1, flags); return o.length > o.l ? o.slice(0, o.l) : o; } function write_BOOKVIEWS(ba, wb/*::, opts*/) { /* required if hidden tab appears before visible tab */ if(!wb.Workbook || !wb.Workbook.Sheets) return; var sheets = wb.Workbook.Sheets; var i = 0, vistab = -1, hidden = -1; for(; i < sheets.length; ++i) { if(!sheets[i] || !sheets[i].Hidden && vistab == -1) vistab = i; else if(sheets[i].Hidden == 1 && hidden == -1) hidden = i; } if(hidden > vistab) return; write_record(ba, 0x0087 /* BrtBeginBookViews */); write_record(ba, 0x009E /* BrtBookView */, write_BrtBookView(vistab)); /* 1*(BrtBookView *FRT) */ write_record(ba, 0x0088 /* BrtEndBookViews */); } /* [MS-XLSB] 2.4.305 BrtCalcProp */ /*function write_BrtCalcProp(data, o) { if(!o) o = new_buf(26); o.write_shift(4,0); // force recalc o.write_shift(4,1); o.write_shift(4,0); write_Xnum(0, o); o.write_shift(-4, 1023); o.write_shift(1, 0x33); o.write_shift(1, 0x00); return o; }*/ /* [MS-XLSB] 2.4.646 BrtFileRecover */ /*function write_BrtFileRecover(data, o) { if(!o) o = new_buf(1); o.write_shift(1,0); return o; }*/ /* [MS-XLSB] 2.1.7.61 Workbook */ function write_wb_bin(wb, opts) { var ba = buf_array(); write_record(ba, 0x0083 /* BrtBeginBook */); write_record(ba, 0x0080 /* BrtFileVersion */, write_BrtFileVersion()); /* [[BrtFileSharingIso] BrtFileSharing] */ write_record(ba, 0x0099 /* BrtWbProp */, write_BrtWbProp(wb.Workbook && wb.Workbook.WBProps || null)); /* [ACABSPATH] */ /* [[BrtBookProtectionIso] BrtBookProtection] */ write_BOOKVIEWS(ba, wb, opts); write_BUNDLESHS(ba, wb, opts); /* [FNGROUP] */ /* [EXTERNALS] */ /* *BrtName */ /* write_record(ba, 0x009D BrtCalcProp, write_BrtCalcProp()); */ /* [BrtOleSize] */ /* *(BrtUserBookView *FRT) */ /* [PIVOTCACHEIDS] */ /* [BrtWbFactoid] */ /* [SMARTTAGTYPES] */ /* [BrtWebOpt] */ /* write_record(ba, 0x009B BrtFileRecover, write_BrtFileRecover()); */ /* [WEBPUBITEMS] */ /* [CRERRS] */ /* FRTWORKBOOK */ write_record(ba, 0x0084 /* BrtEndBook */); return ba.end(); } function parse_wb(data, name/*:string*/, opts)/*:WorkbookFile*/ { if(name.slice(-4)===".bin") return parse_wb_bin((data/*:any*/), opts); return parse_wb_xml((data/*:any*/), opts); } function parse_ws(data, name/*:string*/, idx/*:number*/, opts, rels, wb, themes, styles)/*:Worksheet*/ { if(name.slice(-4)===".bin") return parse_ws_bin((data/*:any*/), opts, idx, rels, wb, themes, styles); return parse_ws_xml((data/*:any*/), opts, idx, rels, wb, themes, styles); } function parse_cs(data, name/*:string*/, idx/*:number*/, opts, rels, wb, themes, styles)/*:Worksheet*/ { if(name.slice(-4)===".bin") return parse_cs_bin((data/*:any*/), opts, idx, rels, wb, themes, styles); return parse_cs_xml((data/*:any*/), opts, idx, rels, wb, themes, styles); } function parse_ms(data, name/*:string*/, idx/*:number*/, opts, rels, wb, themes, styles)/*:Worksheet*/ { if(name.slice(-4)===".bin") return parse_ms_bin((data/*:any*/), opts, idx, rels, wb, themes, styles); return parse_ms_xml((data/*:any*/), opts, idx, rels, wb, themes, styles); } function parse_ds(data, name/*:string*/, idx/*:number*/, opts, rels, wb, themes, styles)/*:Worksheet*/ { if(name.slice(-4)===".bin") return parse_ds_bin((data/*:any*/), opts, idx, rels, wb, themes, styles); return parse_ds_xml((data/*:any*/), opts, idx, rels, wb, themes, styles); } function parse_sty(data, name/*:string*/, themes, opts) { if(name.slice(-4)===".bin") return parse_sty_bin((data/*:any*/), themes, opts); return parse_sty_xml((data/*:any*/), themes, opts); } function parse_theme(data/*:string*/, name/*:string*/, opts) { return parse_theme_xml(data, opts); } function parse_sst(data, name/*:string*/, opts)/*:SST*/ { if(name.slice(-4)===".bin") return parse_sst_bin((data/*:any*/), opts); return parse_sst_xml((data/*:any*/), opts); } function parse_cmnt(data, name/*:string*/, opts)/*:Array<RawComment>*/ { if(name.slice(-4)===".bin") return parse_comments_bin((data/*:any*/), opts); return parse_comments_xml((data/*:any*/), opts); } function parse_cc(data, name/*:string*/, opts) { if(name.slice(-4)===".bin") return parse_cc_bin((data/*:any*/), name, opts); return parse_cc_xml((data/*:any*/), name, opts); } function parse_xlink(data, rel, name/*:string*/, opts) { if(name.slice(-4)===".bin") return parse_xlink_bin((data/*:any*/), rel, name, opts); return parse_xlink_xml((data/*:any*/), rel, name, opts); } function parse_xlmeta(data, name/*:string*/, opts) { if(name.slice(-4)===".bin") return parse_xlmeta_bin((data/*:any*/), name, opts); return parse_xlmeta_xml((data/*:any*/), name, opts); } function write_wb(wb, name/*:string*/, opts) { return (name.slice(-4)===".bin" ? write_wb_bin : write_wb_xml)(wb, opts); } function write_ws(data/*:number*/, name/*:string*/, opts, wb/*:Workbook*/, rels) { return (name.slice(-4)===".bin" ? write_ws_bin : write_ws_xml)(data, opts, wb, rels); } // eslint-disable-next-line no-unused-vars function write_cs(data/*:number*/, name/*:string*/, opts, wb/*:Workbook*/, rels) { return (name.slice(-4)===".bin" ? write_cs_bin : write_cs_xml)(data, opts, wb, rels); } function write_sty(data, name/*:string*/, opts) { return (name.slice(-4)===".bin" ? write_sty_bin : write_sty_xml)(data, opts); } function write_sst(data/*:SST*/, name/*:string*/, opts) { return (name.slice(-4)===".bin" ? write_sst_bin : write_sst_xml)(data, opts); } function write_cmnt(data/*:Array<any>*/, name/*:string*/, opts) { return (name.slice(-4)===".bin" ? write_comments_bin : write_comments_xml)(data, opts); } /* function write_cc(data, name:string, opts) { return (name.slice(-4)===".bin" ? write_cc_bin : write_cc_xml)(data, opts); } */ function write_xlmeta(name/*:string*/) { return (name.slice(-4)===".bin" ? write_xlmeta_bin : write_xlmeta_xml)(); } var attregexg2=/([\w:]+)=((?:")([^"]*)(?:")|(?:')([^']*)(?:'))/g; var attregex2=/([\w:]+)=((?:")(?:[^"]*)(?:")|(?:')(?:[^']*)(?:'))/; function xlml_parsexmltag(tag/*:string*/, skip_root/*:?boolean*/) { var words = tag.split(/\s+/); var z/*:any*/ = ([]/*:any*/); if(!skip_root) z[0] = words[0]; if(words.length === 1) return z; var m = tag.match(attregexg2), y, j, w, i; if(m) for(i = 0; i != m.length; ++i) { y = m[i].match(attregex2); /*:: if(!y || !y[2]) continue; */ if((j=y[1].indexOf(":")) === -1) z[y[1]] = y[2].slice(1,y[2].length-1); else { if(y[1].slice(0,6) === "xmlns:") w = "xmlns"+y[1].slice(6); else w = y[1].slice(j+1); z[w] = y[2].slice(1,y[2].length-1); } } return z; } function xlml_parsexmltagobj(tag/*:string*/) { var words = tag.split(/\s+/); var z = {}; if(words.length === 1) return z; var m = tag.match(attregexg2), y, j, w, i; if(m) for(i = 0; i != m.length; ++i) { y = m[i].match(attregex2); /*:: if(!y || !y[2]) continue; */ if((j=y[1].indexOf(":")) === -1) z[y[1]] = y[2].slice(1,y[2].length-1); else { if(y[1].slice(0,6) === "xmlns:") w = "xmlns"+y[1].slice(6); else w = y[1].slice(j+1); z[w] = y[2].slice(1,y[2].length-1); } } return z; } // ---- /* map from xlml named formats to SSF TODO: localize */ var XLMLFormatMap/*: {[string]:string}*/; function xlml_format(format, value)/*:string*/ { var fmt = XLMLFormatMap[format] || unescapexml(format); if(fmt === "General") return SSF_general(value); return SSF_format(fmt, value); } function xlml_set_custprop(Custprops, key, cp, val/*:string*/) { var oval/*:any*/ = val; switch((cp[0].match(/dt:dt="([\w.]+)"/)||["",""])[1]) { case "boolean": oval = parsexmlbool(val); break; case "i2": case "int": oval = parseInt(val, 10); break; case "r4": case "float": oval = parseFloat(val); break; case "date": case "dateTime.tz": oval = parseDate(val); break; case "i8": case "string": case "fixed": case "uuid": case "bin.base64": break; default: throw new Error("bad custprop:" + cp[0]); } Custprops[unescapexml(key)] = oval; } function safe_format_xlml(cell/*:Cell*/, nf, o) { if(cell.t === 'z') return; if(!o || o.cellText !== false) try { if(cell.t === 'e') { cell.w = cell.w || BErr[cell.v]; } else if(nf === "General") { if(cell.t === 'n') { if((cell.v|0) === cell.v) cell.w = cell.v.toString(10); else cell.w = SSF_general_num(cell.v); } else cell.w = SSF_general(cell.v); } else cell.w = xlml_format(nf||"General", cell.v); } catch(e) { if(o.WTF) throw e; } try { var z = XLMLFormatMap[nf]||nf||"General"; if(o.cellNF) cell.z = z; if(o.cellDates && cell.t == 'n' && fmt_is_date(z)) { var _d = SSF_parse_date_code(cell.v); if(_d) { cell.t = 'd'; cell.v = new Date(_d.y, _d.m-1,_d.d,_d.H,_d.M,_d.S,_d.u); } } } catch(e) { if(o.WTF) throw e; } } function process_style_xlml(styles, stag, opts) { if(opts.cellStyles) { if(stag.Interior) { var I = stag.Interior; if(I.Pattern) I.patternType = XLMLPatternTypeMap[I.Pattern] || I.Pattern; } } styles[stag.ID] = stag; } /* TODO: there must exist some form of OSP-blessed spec */ function parse_xlml_data(xml, ss, data, cell/*:any*/, base, styles, csty, row, arrayf, o) { var nf = "General", sid = cell.StyleID, S = {}; o = o || {}; var interiors = []; var i = 0; if(sid === undefined && row) sid = row.StyleID; if(sid === undefined && csty) sid = csty.StyleID; while(styles[sid] !== undefined) { if(styles[sid].nf) nf = styles[sid].nf; if(styles[sid].Interior) interiors.push(styles[sid].Interior); if(!styles[sid].Parent) break; sid = styles[sid].Parent; } switch(data.Type) { case 'Boolean': cell.t = 'b'; cell.v = parsexmlbool(xml); break; case 'String': cell.t = 's'; cell.r = xlml_fixstr(unescapexml(xml)); cell.v = (xml.indexOf("<") > -1 ? unescapexml(ss||xml).replace(/<.*?>/g, "") : cell.r); // todo: BR etc break; case 'DateTime': if(xml.slice(-1) != "Z") xml += "Z"; cell.v = (parseDate(xml) - new Date(Date.UTC(1899, 11, 30))) / (24 * 60 * 60 * 1000); if(cell.v !== cell.v) cell.v = unescapexml(xml); else if(cell.v<60) cell.v = cell.v -1; if(!nf || nf == "General") nf = "yyyy-mm-dd"; /* falls through */ case 'Number': if(cell.v === undefined) cell.v=+xml; if(!cell.t) cell.t = 'n'; break; case 'Error': cell.t = 'e'; cell.v = RBErr[xml]; if(o.cellText !== false) cell.w = xml; break; default: if(xml == "" && ss == "") { cell.t = 'z'; } else { cell.t = 's'; cell.v = xlml_fixstr(ss||xml); } break; } safe_format_xlml(cell, nf, o); if(o.cellFormula !== false) { if(cell.Formula) { var fstr = unescapexml(cell.Formula); /* strictly speaking, the leading = is required but some writers omit */ if(fstr.charCodeAt(0) == 61 /* = */) fstr = fstr.slice(1); cell.f = rc_to_a1(fstr, base); delete cell.Formula; if(cell.ArrayRange == "RC") cell.F = rc_to_a1("RC:RC", base); else if(cell.ArrayRange) { cell.F = rc_to_a1(cell.ArrayRange, base); arrayf.push([safe_decode_range(cell.F), cell.F]); } } else { for(i = 0; i < arrayf.length; ++i) if(base.r >= arrayf[i][0].s.r && base.r <= arrayf[i][0].e.r) if(base.c >= arrayf[i][0].s.c && base.c <= arrayf[i][0].e.c) cell.F = arrayf[i][1]; } } if(o.cellStyles) { interiors.forEach(function(x) { if(!S.patternType && x.patternType) S.patternType = x.patternType; }); cell.s = S; } if(cell.StyleID !== undefined) cell.ixfe = cell.StyleID; } function xlml_clean_comment(comment/*:any*/) { comment.t = comment.v || ""; comment.t = comment.t.replace(/\r\n/g,"\n").replace(/\r/g,"\n"); comment.v = comment.w = comment.ixfe = undefined; } /* TODO: Everything */ function parse_xlml_xml(d, _opts)/*:Workbook*/ { var opts = _opts || {}; make_ssf(); var str = debom(xlml_normalize(d)); if(opts.type == 'binary' || opts.type == 'array' || opts.type == 'base64') { if(typeof $cptable !== 'undefined') str = $cptable.utils.decode(65001, char_codes(str)); else str = utf8read(str); } var opening = str.slice(0, 1024).toLowerCase(), ishtml = false; opening = opening.replace(/".*?"/g, ""); if((opening.indexOf(">") & 1023) > Math.min((opening.indexOf(",") & 1023), (opening.indexOf(";")&1023))) { var _o = dup(opts); _o.type = "string"; return PRN.to_workbook(str, _o); } if(opening.indexOf("<?xml") == -1) ["html", "table", "head", "meta", "script", "style", "div"].forEach(function(tag) { if(opening.indexOf("<" + tag) >= 0) ishtml = true; }); if(ishtml) return html_to_workbook(str, opts); XLMLFormatMap = ({ "General Number": "General", "General Date": table_fmt[22], "Long Date": "dddd, mmmm dd, yyyy", "Medium Date": table_fmt[15], "Short Date": table_fmt[14], "Long Time": table_fmt[19], "Medium Time": table_fmt[18], "Short Time": table_fmt[20], "Currency": '"$"#,##0.00_);[Red]\\("$"#,##0.00\\)', "Fixed": table_fmt[2], "Standard": table_fmt[4], "Percent": table_fmt[10], "Scientific": table_fmt[11], "Yes/No": '"Yes";"Yes";"No";@', "True/False": '"True";"True";"False";@', "On/Off": '"Yes";"Yes";"No";@' }/*:any*/); var Rn; var state = [], tmp; if(DENSE != null && opts.dense == null) opts.dense = DENSE; var sheets = {}, sheetnames/*:Array<string>*/ = [], cursheet/*:Worksheet*/ = (opts.dense ? [] : {}), sheetname = ""; var cell = ({}/*:any*/), row = {};// eslint-disable-line no-unused-vars var dtag = xlml_parsexmltag('<Data ss:Type="String">'), didx = 0; var c = 0, r = 0; var refguess/*:Range*/ = {s: {r:2000000, c:2000000}, e: {r:0, c:0} }; var styles = {}, stag = {}; var ss = "", fidx = 0; var merges/*:Array<Range>*/ = []; var Props = {}, Custprops = {}, pidx = 0, cp = []; var comments/*:Array<Comment>*/ = [], comment/*:Comment*/ = ({}/*:any*/); var cstys = [], csty, seencol = false; var arrayf/*:Array<[Range, string]>*/ = []; var rowinfo/*:Array<RowInfo>*/ = [], rowobj = {}, cc = 0, rr = 0; var Workbook/*:WBWBProps*/ = ({ Sheets:[], WBProps:{date1904:false} }/*:any*/), wsprops = {}; xlmlregex.lastIndex = 0; str = str.replace(/<!--([\s\S]*?)-->/mg,""); var raw_Rn3 = ""; while((Rn = xlmlregex.exec(str))) switch((Rn[3] = (raw_Rn3 = Rn[3]).toLowerCase())) { case 'data' /*case 'Data'*/: if(raw_Rn3 == "data") { if(Rn[1]==='/'){if((tmp=state.pop())[0]!==Rn[3]) throw new Error("Bad state: "+tmp.join("|"));} else if(Rn[0].charAt(Rn[0].length-2) !== '/') state.push([Rn[3], true]); break; } if(state[state.length-1][1]) break; if(Rn[1]==='/') parse_xlml_data(str.slice(didx, Rn.index), ss, dtag, state[state.length-1][0]==/*"Comment"*/"comment"?comment:cell, {c:c,r:r}, styles, cstys[c], row, arrayf, opts); else { ss = ""; dtag = xlml_parsexmltag(Rn[0]); didx = Rn.index + Rn[0].length; } break; case 'cell' /*case 'Cell'*/: if(Rn[1]==='/'){ if(comments.length > 0) cell.c = comments; if((!opts.sheetRows || opts.sheetRows > r) && cell.v !== undefined) { if(opts.dense) { if(!cursheet[r]) cursheet[r] = []; cursheet[r][c] = cell; } else cursheet[encode_col(c) + encode_row(r)] = cell; } if(cell.HRef) { cell.l = ({Target:unescapexml(cell.HRef)}/*:any*/); if(cell.HRefScreenTip) cell.l.Tooltip = cell.HRefScreenTip; delete cell.HRef; delete cell.HRefScreenTip; } if(cell.MergeAcross || cell.MergeDown) { cc = c + (parseInt(cell.MergeAcross,10)|0); rr = r + (parseInt(cell.MergeDown,10)|0); merges.push({s:{c:c,r:r},e:{c:cc,r:rr}}); } if(!opts.sheetStubs) { if(cell.MergeAcross) c = cc + 1; else ++c; } else if(cell.MergeAcross || cell.MergeDown) { /*:: if(!cc) cc = 0; if(!rr) rr = 0; */ for(var cma = c; cma <= cc; ++cma) { for(var cmd = r; cmd <= rr; ++cmd) { if(cma > c || cmd > r) { if(opts.dense) { if(!cursheet[cmd]) cursheet[cmd] = []; cursheet[cmd][cma] = {t:'z'}; } else cursheet[encode_col(cma) + encode_row(cmd)] = {t:'z'}; } } } c = cc + 1; } else ++c; } else { cell = xlml_parsexmltagobj(Rn[0]); if(cell.Index) c = +cell.Index - 1; if(c < refguess.s.c) refguess.s.c = c; if(c > refguess.e.c) refguess.e.c = c; if(Rn[0].slice(-2) === "/>") ++c; comments = []; } break; case 'row' /*case 'Row'*/: if(Rn[1]==='/' || Rn[0].slice(-2) === "/>") { if(r < refguess.s.r) refguess.s.r = r; if(r > refguess.e.r) refguess.e.r = r; if(Rn[0].slice(-2) === "/>") { row = xlml_parsexmltag(Rn[0]); if(row.Index) r = +row.Index - 1; } c = 0; ++r; } else { row = xlml_parsexmltag(Rn[0]); if(row.Index) r = +row.Index - 1; rowobj = {}; if(row.AutoFitHeight == "0" || row.Height) { rowobj.hpx = parseInt(row.Height, 10); rowobj.hpt = px2pt(rowobj.hpx); rowinfo[r] = rowobj; } if(row.Hidden == "1") { rowobj.hidden = true; rowinfo[r] = rowobj; } } break; case 'worksheet' /*case 'Worksheet'*/: /* TODO: read range from FullRows/FullColumns */ if(Rn[1]==='/'){ if((tmp=state.pop())[0]!==Rn[3]) throw new Error("Bad state: "+tmp.join("|")); sheetnames.push(sheetname); if(refguess.s.r <= refguess.e.r && refguess.s.c <= refguess.e.c) { cursheet["!ref"] = encode_range(refguess); if(opts.sheetRows && opts.sheetRows <= refguess.e.r) { cursheet["!fullref"] = cursheet["!ref"]; refguess.e.r = opts.sheetRows - 1; cursheet["!ref"] = encode_range(refguess); } } if(merges.length) cursheet["!merges"] = merges; if(cstys.length > 0) cursheet["!cols"] = cstys; if(rowinfo.length > 0) cursheet["!rows"] = rowinfo; sheets[sheetname] = cursheet; } else { refguess = {s: {r:2000000, c:2000000}, e: {r:0, c:0} }; r = c = 0; state.push([Rn[3], false]); tmp = xlml_parsexmltag(Rn[0]); sheetname = unescapexml(tmp.Name); cursheet = (opts.dense ? [] : {}); merges = []; arrayf = []; rowinfo = []; wsprops = {name:sheetname, Hidden:0}; Workbook.Sheets.push(wsprops); } break; case 'table' /*case 'Table'*/: if(Rn[1]==='/'){if((tmp=state.pop())[0]!==Rn[3]) throw new Error("Bad state: "+tmp.join("|"));} else if(Rn[0].slice(-2) == "/>") break; else { state.push([Rn[3], false]); cstys = []; seencol = false; } break; case 'style' /*case 'Style'*/: if(Rn[1]==='/') process_style_xlml(styles, stag, opts); else stag = xlml_parsexmltag(Rn[0]); break; case 'numberformat' /*case 'NumberFormat'*/: stag.nf = unescapexml(xlml_parsexmltag(Rn[0]).Format || "General"); if(XLMLFormatMap[stag.nf]) stag.nf = XLMLFormatMap[stag.nf]; for(var ssfidx = 0; ssfidx != 0x188; ++ssfidx) if(table_fmt[ssfidx] == stag.nf) break; if(ssfidx == 0x188) for(ssfidx = 0x39; ssfidx != 0x188; ++ssfidx) if(table_fmt[ssfidx] == null) { SSF_load(stag.nf, ssfidx); break; } break; case 'column' /*case 'Column'*/: if(state[state.length-1][0] !== /*'Table'*/'table') break; csty = xlml_parsexmltag(Rn[0]); if(csty.Hidden) { csty.hidden = true; delete csty.Hidden; } if(csty.Width) csty.wpx = parseInt(csty.Width, 10); if(!seencol && csty.wpx > 10) { seencol = true; MDW = DEF_MDW; //find_mdw_wpx(csty.wpx); for(var _col = 0; _col < cstys.length; ++_col) if(cstys[_col]) process_col(cstys[_col]); } if(seencol) process_col(csty); cstys[(csty.Index-1||cstys.length)] = csty; for(var i = 0; i < +csty.Span; ++i) cstys[cstys.length] = dup(csty); break; case 'namedrange' /*case 'NamedRange'*/: if(Rn[1]==='/') break; if(!Workbook.Names) Workbook.Names = []; var _NamedRange = parsexmltag(Rn[0]); var _DefinedName/*:DefinedName*/ = ({ Name: _NamedRange.Name, Ref: rc_to_a1(_NamedRange.RefersTo.slice(1), {r:0, c:0}) }/*:any*/); if(Workbook.Sheets.length>0) _DefinedName.Sheet=Workbook.Sheets.length-1; /*:: if(Workbook.Names) */Workbook.Names.push(_DefinedName); break; case 'namedcell' /*case 'NamedCell'*/: break; case 'b' /*case 'B'*/: break; case 'i' /*case 'I'*/: break; case 'u' /*case 'U'*/: break; case 's' /*case 'S'*/: break; case 'em' /*case 'EM'*/: break; case 'h2' /*case 'H2'*/: break; case 'h3' /*case 'H3'*/: break; case 'sub' /*case 'Sub'*/: break; case 'sup' /*case 'Sup'*/: break; case 'span' /*case 'Span'*/: break; case 'alignment' /*case 'Alignment'*/: break; case 'borders' /*case 'Borders'*/: break; case 'border' /*case 'Border'*/: break; case 'font' /*case 'Font'*/: if(Rn[0].slice(-2) === "/>") break; else if(Rn[1]==="/") ss += str.slice(fidx, Rn.index); else fidx = Rn.index + Rn[0].length; break; case 'interior' /*case 'Interior'*/: if(!opts.cellStyles) break; stag.Interior = xlml_parsexmltag(Rn[0]); break; case 'protection' /*case 'Protection'*/: break; case 'author' /*case 'Author'*/: case 'title' /*case 'Title'*/: case 'description' /*case 'Description'*/: case 'created' /*case 'Created'*/: case 'keywords' /*case 'Keywords'*/: case 'subject' /*case 'Subject'*/: case 'category' /*case 'Category'*/: case 'company' /*case 'Company'*/: case 'lastauthor' /*case 'LastAuthor'*/: case 'lastsaved' /*case 'LastSaved'*/: case 'lastprinted' /*case 'LastPrinted'*/: case 'version' /*case 'Version'*/: case 'revision' /*case 'Revision'*/: case 'totaltime' /*case 'TotalTime'*/: case 'hyperlinkbase' /*case 'HyperlinkBase'*/: case 'manager' /*case 'Manager'*/: case 'contentstatus' /*case 'ContentStatus'*/: case 'identifier' /*case 'Identifier'*/: case 'language' /*case 'Language'*/: case 'appname' /*case 'AppName'*/: if(Rn[0].slice(-2) === "/>") break; else if(Rn[1]==="/") xlml_set_prop(Props, raw_Rn3, str.slice(pidx, Rn.index)); else pidx = Rn.index + Rn[0].length; break; case 'paragraphs' /*case 'Paragraphs'*/: break; case 'styles' /*case 'Styles'*/: case 'workbook' /*case 'Workbook'*/: if(Rn[1]==='/'){if((tmp=state.pop())[0]!==Rn[3]) throw new Error("Bad state: "+tmp.join("|"));} else state.push([Rn[3], false]); break; case 'comment' /*case 'Comment'*/: if(Rn[1]==='/'){ if((tmp=state.pop())[0]!==Rn[3]) throw new Error("Bad state: "+tmp.join("|")); xlml_clean_comment(comment); comments.push(comment); } else { state.push([Rn[3], false]); tmp = xlml_parsexmltag(Rn[0]); comment = ({a:tmp.Author}/*:any*/); } break; case 'autofilter' /*case 'AutoFilter'*/: if(Rn[1]==='/'){if((tmp=state.pop())[0]!==Rn[3]) throw new Error("Bad state: "+tmp.join("|"));} else if(Rn[0].charAt(Rn[0].length-2) !== '/') { var AutoFilter = xlml_parsexmltag(Rn[0]); cursheet['!autofilter'] = { ref:rc_to_a1(AutoFilter.Range).replace(/\$/g,"") }; state.push([Rn[3], true]); } break; case 'name' /*case 'Name'*/: break; case 'datavalidation' /*case 'DataValidation'*/: if(Rn[1]==='/'){ if((tmp=state.pop())[0]!==Rn[3]) throw new Error("Bad state: "+tmp.join("|")); } else { if(Rn[0].charAt(Rn[0].length-2) !== '/') state.push([Rn[3], true]); } break; case 'pixelsperinch' /*case 'PixelsPerInch'*/: break; case 'componentoptions' /*case 'ComponentOptions'*/: case 'documentproperties' /*case 'DocumentProperties'*/: case 'customdocumentproperties' /*case 'CustomDocumentProperties'*/: case 'officedocumentsettings' /*case 'OfficeDocumentSettings'*/: case 'pivottable' /*case 'PivotTable'*/: case 'pivotcache' /*case 'PivotCache'*/: case 'names' /*case 'Names'*/: case 'mapinfo' /*case 'MapInfo'*/: case 'pagebreaks' /*case 'PageBreaks'*/: case 'querytable' /*case 'QueryTable'*/: case 'sorting' /*case 'Sorting'*/: case 'schema' /*case 'Schema'*/: //case 'data' /*case 'data'*/: case 'conditionalformatting' /*case 'ConditionalFormatting'*/: case 'smarttagtype' /*case 'SmartTagType'*/: case 'smarttags' /*case 'SmartTags'*/: case 'excelworkbook' /*case 'ExcelWorkbook'*/: case 'workbookoptions' /*case 'WorkbookOptions'*/: case 'worksheetoptions' /*case 'WorksheetOptions'*/: if(Rn[1]==='/'){if((tmp=state.pop())[0]!==Rn[3]) throw new Error("Bad state: "+tmp.join("|"));} else if(Rn[0].charAt(Rn[0].length-2) !== '/') state.push([Rn[3], true]); break; case 'null' /*case 'Null'*/: break; default: /* FODS file root is <office:document> */ if(state.length == 0 && Rn[3] == "document") return parse_fods(str, opts); /* UOS file root is <uof:UOF> */ if(state.length == 0 && Rn[3] == "uof"/*"UOF"*/) return parse_fods(str, opts); var seen = true; switch(state[state.length-1][0]) { /* OfficeDocumentSettings */ case 'officedocumentsettings' /*case 'OfficeDocumentSettings'*/: switch(Rn[3]) { case 'allowpng' /*case 'AllowPNG'*/: break; case 'removepersonalinformation' /*case 'RemovePersonalInformation'*/: break; case 'downloadcomponents' /*case 'DownloadComponents'*/: break; case 'locationofcomponents' /*case 'LocationOfComponents'*/: break; case 'colors' /*case 'Colors'*/: break; case 'color' /*case 'Color'*/: break; case 'index' /*case 'Index'*/: break; case 'rgb' /*case 'RGB'*/: break; case 'targetscreensize' /*case 'TargetScreenSize'*/: break; case 'readonlyrecommended' /*case 'ReadOnlyRecommended'*/: break; default: seen = false; } break; /* ComponentOptions */ case 'componentoptions' /*case 'ComponentOptions'*/: switch(Rn[3]) { case 'toolbar' /*case 'Toolbar'*/: break; case 'hideofficelogo' /*case 'HideOfficeLogo'*/: break; case 'spreadsheetautofit' /*case 'SpreadsheetAutoFit'*/: break; case 'label' /*case 'Label'*/: break; case 'caption' /*case 'Caption'*/: break; case 'maxheight' /*case 'MaxHeight'*/: break; case 'maxwidth' /*case 'MaxWidth'*/: break; case 'nextsheetnumber' /*case 'NextSheetNumber'*/: break; default: seen = false; } break; /* ExcelWorkbook */ case 'excelworkbook' /*case 'ExcelWorkbook'*/: switch(Rn[3]) { case 'date1904' /*case 'Date1904'*/: /*:: if(!Workbook.WBProps) Workbook.WBProps = {}; */ Workbook.WBProps.date1904 = true; break; case 'windowheight' /*case 'WindowHeight'*/: break; case 'windowwidth' /*case 'WindowWidth'*/: break; case 'windowtopx' /*case 'WindowTopX'*/: break; case 'windowtopy' /*case 'WindowTopY'*/: break; case 'tabratio' /*case 'TabRatio'*/: break; case 'protectstructure' /*case 'ProtectStructure'*/: break; case 'protectwindow' /*case 'ProtectWindow'*/: break; case 'protectwindows' /*case 'ProtectWindows'*/: break; case 'activesheet' /*case 'ActiveSheet'*/: break; case 'displayinknotes' /*case 'DisplayInkNotes'*/: break; case 'firstvisiblesheet' /*case 'FirstVisibleSheet'*/: break; case 'supbook' /*case 'SupBook'*/: break; case 'sheetname' /*case 'SheetName'*/: break; case 'sheetindex' /*case 'SheetIndex'*/: break; case 'sheetindexfirst' /*case 'SheetIndexFirst'*/: break; case 'sheetindexlast' /*case 'SheetIndexLast'*/: break; case 'dll' /*case 'Dll'*/: break; case 'acceptlabelsinformulas' /*case 'AcceptLabelsInFormulas'*/: break; case 'donotsavelinkvalues' /*case 'DoNotSaveLinkValues'*/: break; case 'iteration' /*case 'Iteration'*/: break; case 'maxiterations' /*case 'MaxIterations'*/: break; case 'maxchange' /*case 'MaxChange'*/: break; case 'path' /*case 'Path'*/: break; case 'xct' /*case 'Xct'*/: break; case 'count' /*case 'Count'*/: break; case 'selectedsheets' /*case 'SelectedSheets'*/: break; case 'calculation' /*case 'Calculation'*/: break; case 'uncalced' /*case 'Uncalced'*/: break; case 'startupprompt' /*case 'StartupPrompt'*/: break; case 'crn' /*case 'Crn'*/: break; case 'externname' /*case 'ExternName'*/: break; case 'formula' /*case 'Formula'*/: break; case 'colfirst' /*case 'ColFirst'*/: break; case 'collast' /*case 'ColLast'*/: break; case 'wantadvise' /*case 'WantAdvise'*/: break; case 'boolean' /*case 'Boolean'*/: break; case 'error' /*case 'Error'*/: break; case 'text' /*case 'Text'*/: break; case 'ole' /*case 'OLE'*/: break; case 'noautorecover' /*case 'NoAutoRecover'*/: break; case 'publishobjects' /*case 'PublishObjects'*/: break; case 'donotcalculatebeforesave' /*case 'DoNotCalculateBeforeSave'*/: break; case 'number' /*case 'Number'*/: break; case 'refmoder1c1' /*case 'RefModeR1C1'*/: break; case 'embedsavesmarttags' /*case 'EmbedSaveSmartTags'*/: break; default: seen = false; } break; /* WorkbookOptions */ case 'workbookoptions' /*case 'WorkbookOptions'*/: switch(Rn[3]) { case 'owcversion' /*case 'OWCVersion'*/: break; case 'height' /*case 'Height'*/: break; case 'width' /*case 'Width'*/: break; default: seen = false; } break; /* WorksheetOptions */ case 'worksheetoptions' /*case 'WorksheetOptions'*/: switch(Rn[3]) { case 'visible' /*case 'Visible'*/: if(Rn[0].slice(-2) === "/>"){/* empty */} else if(Rn[1]==="/") switch(str.slice(pidx, Rn.index)) { case "SheetHidden": wsprops.Hidden = 1; break; case "SheetVeryHidden": wsprops.Hidden = 2; break; } else pidx = Rn.index + Rn[0].length; break; case 'header' /*case 'Header'*/: if(!cursheet['!margins']) default_margins(cursheet['!margins']={}, 'xlml'); if(!isNaN(+parsexmltag(Rn[0]).Margin)) cursheet['!margins'].header = +parsexmltag(Rn[0]).Margin; break; case 'footer' /*case 'Footer'*/: if(!cursheet['!margins']) default_margins(cursheet['!margins']={}, 'xlml'); if(!isNaN(+parsexmltag(Rn[0]).Margin)) cursheet['!margins'].footer = +parsexmltag(Rn[0]).Margin; break; case 'pagemargins' /*case 'PageMargins'*/: var pagemargins = parsexmltag(Rn[0]); if(!cursheet['!margins']) default_margins(cursheet['!margins']={},'xlml'); if(!isNaN(+pagemargins.Top)) cursheet['!margins'].top = +pagemargins.Top; if(!isNaN(+pagemargins.Left)) cursheet['!margins'].left = +pagemargins.Left; if(!isNaN(+pagemargins.Right)) cursheet['!margins'].right = +pagemargins.Right; if(!isNaN(+pagemargins.Bottom)) cursheet['!margins'].bottom = +pagemargins.Bottom; break; case 'displayrighttoleft' /*case 'DisplayRightToLeft'*/: if(!Workbook.Views) Workbook.Views = []; if(!Workbook.Views[0]) Workbook.Views[0] = {}; Workbook.Views[0].RTL = true; break; case 'freezepanes' /*case 'FreezePanes'*/: break; case 'frozennosplit' /*case 'FrozenNoSplit'*/: break; case 'splithorizontal' /*case 'SplitHorizontal'*/: case 'splitvertical' /*case 'SplitVertical'*/: break; case 'donotdisplaygridlines' /*case 'DoNotDisplayGridlines'*/: break; case 'activerow' /*case 'ActiveRow'*/: break; case 'activecol' /*case 'ActiveCol'*/: break; case 'toprowbottompane' /*case 'TopRowBottomPane'*/: break; case 'leftcolumnrightpane' /*case 'LeftColumnRightPane'*/: break; case 'unsynced' /*case 'Unsynced'*/: break; case 'print' /*case 'Print'*/: break; case 'printerrors' /*case 'PrintErrors'*/: break; case 'panes' /*case 'Panes'*/: break; case 'scale' /*case 'Scale'*/: break; case 'pane' /*case 'Pane'*/: break; case 'number' /*case 'Number'*/: break; case 'layout' /*case 'Layout'*/: break; case 'pagesetup' /*case 'PageSetup'*/: break; case 'selected' /*case 'Selected'*/: break; case 'protectobjects' /*case 'ProtectObjects'*/: break; case 'enableselection' /*case 'EnableSelection'*/: break; case 'protectscenarios' /*case 'ProtectScenarios'*/: break; case 'validprinterinfo' /*case 'ValidPrinterInfo'*/: break; case 'horizontalresolution' /*case 'HorizontalResolution'*/: break; case 'verticalresolution' /*case 'VerticalResolution'*/: break; case 'numberofcopies' /*case 'NumberofCopies'*/: break; case 'activepane' /*case 'ActivePane'*/: break; case 'toprowvisible' /*case 'TopRowVisible'*/: break; case 'leftcolumnvisible' /*case 'LeftColumnVisible'*/: break; case 'fittopage' /*case 'FitToPage'*/: break; case 'rangeselection' /*case 'RangeSelection'*/: break; case 'papersizeindex' /*case 'PaperSizeIndex'*/: break; case 'pagelayoutzoom' /*case 'PageLayoutZoom'*/: break; case 'pagebreakzoom' /*case 'PageBreakZoom'*/: break; case 'filteron' /*case 'FilterOn'*/: break; case 'fitwidth' /*case 'FitWidth'*/: break; case 'fitheight' /*case 'FitHeight'*/: break; case 'commentslayout' /*case 'CommentsLayout'*/: break; case 'zoom' /*case 'Zoom'*/: break; case 'lefttoright' /*case 'LeftToRight'*/: break; case 'gridlines' /*case 'Gridlines'*/: break; case 'allowsort' /*case 'AllowSort'*/: break; case 'allowfilter' /*case 'AllowFilter'*/: break; case 'allowinsertrows' /*case 'AllowInsertRows'*/: break; case 'allowdeleterows' /*case 'AllowDeleteRows'*/: break; case 'allowinsertcols' /*case 'AllowInsertCols'*/: break; case 'allowdeletecols' /*case 'AllowDeleteCols'*/: break; case 'allowinserthyperlinks' /*case 'AllowInsertHyperlinks'*/: break; case 'allowformatcells' /*case 'AllowFormatCells'*/: break; case 'allowsizecols' /*case 'AllowSizeCols'*/: break; case 'allowsizerows' /*case 'AllowSizeRows'*/: break; case 'nosummaryrowsbelowdetail' /*case 'NoSummaryRowsBelowDetail'*/: if(!cursheet["!outline"]) cursheet["!outline"] = {}; cursheet["!outline"].above = true; break; case 'tabcolorindex' /*case 'TabColorIndex'*/: break; case 'donotdisplayheadings' /*case 'DoNotDisplayHeadings'*/: break; case 'showpagelayoutzoom' /*case 'ShowPageLayoutZoom'*/: break; case 'nosummarycolumnsrightdetail' /*case 'NoSummaryColumnsRightDetail'*/: if(!cursheet["!outline"]) cursheet["!outline"] = {}; cursheet["!outline"].left = true; break; case 'blackandwhite' /*case 'BlackAndWhite'*/: break; case 'donotdisplayzeros' /*case 'DoNotDisplayZeros'*/: break; case 'displaypagebreak' /*case 'DisplayPageBreak'*/: break; case 'rowcolheadings' /*case 'RowColHeadings'*/: break; case 'donotdisplayoutline' /*case 'DoNotDisplayOutline'*/: break; case 'noorientation' /*case 'NoOrientation'*/: break; case 'allowusepivottables' /*case 'AllowUsePivotTables'*/: break; case 'zeroheight' /*case 'ZeroHeight'*/: break; case 'viewablerange' /*case 'ViewableRange'*/: break; case 'selection' /*case 'Selection'*/: break; case 'protectcontents' /*case 'ProtectContents'*/: break; default: seen = false; } break; /* PivotTable */ case 'pivottable' /*case 'PivotTable'*/: case 'pivotcache' /*case 'PivotCache'*/: switch(Rn[3]) { case 'immediateitemsondrop' /*case 'ImmediateItemsOnDrop'*/: break; case 'showpagemultipleitemlabel' /*case 'ShowPageMultipleItemLabel'*/: break; case 'compactrowindent' /*case 'CompactRowIndent'*/: break; case 'location' /*case 'Location'*/: break; case 'pivotfield' /*case 'PivotField'*/: break; case 'orientation' /*case 'Orientation'*/: break; case 'layoutform' /*case 'LayoutForm'*/: break; case 'layoutsubtotallocation' /*case 'LayoutSubtotalLocation'*/: break; case 'layoutcompactrow' /*case 'LayoutCompactRow'*/: break; case 'position' /*case 'Position'*/: break; case 'pivotitem' /*case 'PivotItem'*/: break; case 'datatype' /*case 'DataType'*/: break; case 'datafield' /*case 'DataField'*/: break; case 'sourcename' /*case 'SourceName'*/: break; case 'parentfield' /*case 'ParentField'*/: break; case 'ptlineitems' /*case 'PTLineItems'*/: break; case 'ptlineitem' /*case 'PTLineItem'*/: break; case 'countofsameitems' /*case 'CountOfSameItems'*/: break; case 'item' /*case 'Item'*/: break; case 'itemtype' /*case 'ItemType'*/: break; case 'ptsource' /*case 'PTSource'*/: break; case 'cacheindex' /*case 'CacheIndex'*/: break; case 'consolidationreference' /*case 'ConsolidationReference'*/: break; case 'filename' /*case 'FileName'*/: break; case 'reference' /*case 'Reference'*/: break; case 'nocolumngrand' /*case 'NoColumnGrand'*/: break; case 'norowgrand' /*case 'NoRowGrand'*/: break; case 'blanklineafteritems' /*case 'BlankLineAfterItems'*/: break; case 'hidden' /*case 'Hidden'*/: break; case 'subtotal' /*case 'Subtotal'*/: break; case 'basefield' /*case 'BaseField'*/: break; case 'mapchilditems' /*case 'MapChildItems'*/: break; case 'function' /*case 'Function'*/: break; case 'refreshonfileopen' /*case 'RefreshOnFileOpen'*/: break; case 'printsettitles' /*case 'PrintSetTitles'*/: break; case 'mergelabels' /*case 'MergeLabels'*/: break; case 'defaultversion' /*case 'DefaultVersion'*/: break; case 'refreshname' /*case 'RefreshName'*/: break; case 'refreshdate' /*case 'RefreshDate'*/: break; case 'refreshdatecopy' /*case 'RefreshDateCopy'*/: break; case 'versionlastrefresh' /*case 'VersionLastRefresh'*/: break; case 'versionlastupdate' /*case 'VersionLastUpdate'*/: break; case 'versionupdateablemin' /*case 'VersionUpdateableMin'*/: break; case 'versionrefreshablemin' /*case 'VersionRefreshableMin'*/: break; case 'calculation' /*case 'Calculation'*/: break; default: seen = false; } break; /* PageBreaks */ case 'pagebreaks' /*case 'PageBreaks'*/: switch(Rn[3]) { case 'colbreaks' /*case 'ColBreaks'*/: break; case 'colbreak' /*case 'ColBreak'*/: break; case 'rowbreaks' /*case 'RowBreaks'*/: break; case 'rowbreak' /*case 'RowBreak'*/: break; case 'colstart' /*case 'ColStart'*/: break; case 'colend' /*case 'ColEnd'*/: break; case 'rowend' /*case 'RowEnd'*/: break; default: seen = false; } break; /* AutoFilter */ case 'autofilter' /*case 'AutoFilter'*/: switch(Rn[3]) { case 'autofiltercolumn' /*case 'AutoFilterColumn'*/: break; case 'autofiltercondition' /*case 'AutoFilterCondition'*/: break; case 'autofilterand' /*case 'AutoFilterAnd'*/: break; case 'autofilteror' /*case 'AutoFilterOr'*/: break; default: seen = false; } break; /* QueryTable */ case 'querytable' /*case 'QueryTable'*/: switch(Rn[3]) { case 'id' /*case 'Id'*/: break; case 'autoformatfont' /*case 'AutoFormatFont'*/: break; case 'autoformatpattern' /*case 'AutoFormatPattern'*/: break; case 'querysource' /*case 'QuerySource'*/: break; case 'querytype' /*case 'QueryType'*/: break; case 'enableredirections' /*case 'EnableRedirections'*/: break; case 'refreshedinxl9' /*case 'RefreshedInXl9'*/: break; case 'urlstring' /*case 'URLString'*/: break; case 'htmltables' /*case 'HTMLTables'*/: break; case 'connection' /*case 'Connection'*/: break; case 'commandtext' /*case 'CommandText'*/: break; case 'refreshinfo' /*case 'RefreshInfo'*/: break; case 'notitles' /*case 'NoTitles'*/: break; case 'nextid' /*case 'NextId'*/: break; case 'columninfo' /*case 'ColumnInfo'*/: break; case 'overwritecells' /*case 'OverwriteCells'*/: break; case 'donotpromptforfile' /*case 'DoNotPromptForFile'*/: break; case 'textwizardsettings' /*case 'TextWizardSettings'*/: break; case 'source' /*case 'Source'*/: break; case 'number' /*case 'Number'*/: break; case 'decimal' /*case 'Decimal'*/: break; case 'thousandseparator' /*case 'ThousandSeparator'*/: break; case 'trailingminusnumbers' /*case 'TrailingMinusNumbers'*/: break; case 'formatsettings' /*case 'FormatSettings'*/: break; case 'fieldtype' /*case 'FieldType'*/: break; case 'delimiters' /*case 'Delimiters'*/: break; case 'tab' /*case 'Tab'*/: break; case 'comma' /*case 'Comma'*/: break; case 'autoformatname' /*case 'AutoFormatName'*/: break; case 'versionlastedit' /*case 'VersionLastEdit'*/: break; case 'versionlastrefresh' /*case 'VersionLastRefresh'*/: break; default: seen = false; } break; case 'datavalidation' /*case 'DataValidation'*/: switch(Rn[3]) { case 'range' /*case 'Range'*/: break; case 'type' /*case 'Type'*/: break; case 'min' /*case 'Min'*/: break; case 'max' /*case 'Max'*/: break; case 'sort' /*case 'Sort'*/: break; case 'descending' /*case 'Descending'*/: break; case 'order' /*case 'Order'*/: break; case 'casesensitive' /*case 'CaseSensitive'*/: break; case 'value' /*case 'Value'*/: break; case 'errorstyle' /*case 'ErrorStyle'*/: break; case 'errormessage' /*case 'ErrorMessage'*/: break; case 'errortitle' /*case 'ErrorTitle'*/: break; case 'inputmessage' /*case 'InputMessage'*/: break; case 'inputtitle' /*case 'InputTitle'*/: break; case 'combohide' /*case 'ComboHide'*/: break; case 'inputhide' /*case 'InputHide'*/: break; case 'condition' /*case 'Condition'*/: break; case 'qualifier' /*case 'Qualifier'*/: break; case 'useblank' /*case 'UseBlank'*/: break; case 'value1' /*case 'Value1'*/: break; case 'value2' /*case 'Value2'*/: break; case 'format' /*case 'Format'*/: break; case 'cellrangelist' /*case 'CellRangeList'*/: break; default: seen = false; } break; case 'sorting' /*case 'Sorting'*/: case 'conditionalformatting' /*case 'ConditionalFormatting'*/: switch(Rn[3]) { case 'range' /*case 'Range'*/: break; case 'type' /*case 'Type'*/: break; case 'min' /*case 'Min'*/: break; case 'max' /*case 'Max'*/: break; case 'sort' /*case 'Sort'*/: break; case 'descending' /*case 'Descending'*/: break; case 'order' /*case 'Order'*/: break; case 'casesensitive' /*case 'CaseSensitive'*/: break; case 'value' /*case 'Value'*/: break; case 'errorstyle' /*case 'ErrorStyle'*/: break; case 'errormessage' /*case 'ErrorMessage'*/: break; case 'errortitle' /*case 'ErrorTitle'*/: break; case 'cellrangelist' /*case 'CellRangeList'*/: break; case 'inputmessage' /*case 'InputMessage'*/: break; case 'inputtitle' /*case 'InputTitle'*/: break; case 'combohide' /*case 'ComboHide'*/: break; case 'inputhide' /*case 'InputHide'*/: break; case 'condition' /*case 'Condition'*/: break; case 'qualifier' /*case 'Qualifier'*/: break; case 'useblank' /*case 'UseBlank'*/: break; case 'value1' /*case 'Value1'*/: break; case 'value2' /*case 'Value2'*/: break; case 'format' /*case 'Format'*/: break; default: seen = false; } break; /* MapInfo (schema) */ case 'mapinfo' /*case 'MapInfo'*/: case 'schema' /*case 'Schema'*/: case 'data' /*case 'data'*/: switch(Rn[3]) { case 'map' /*case 'Map'*/: break; case 'entry' /*case 'Entry'*/: break; case 'range' /*case 'Range'*/: break; case 'xpath' /*case 'XPath'*/: break; case 'field' /*case 'Field'*/: break; case 'xsdtype' /*case 'XSDType'*/: break; case 'filteron' /*case 'FilterOn'*/: break; case 'aggregate' /*case 'Aggregate'*/: break; case 'elementtype' /*case 'ElementType'*/: break; case 'attributetype' /*case 'AttributeType'*/: break; /* These are from xsd (XML Schema Definition) */ case 'schema' /*case 'schema'*/: case 'element' /*case 'element'*/: case 'complextype' /*case 'complexType'*/: case 'datatype' /*case 'datatype'*/: case 'all' /*case 'all'*/: case 'attribute' /*case 'attribute'*/: case 'extends' /*case 'extends'*/: break; case 'row' /*case 'row'*/: break; default: seen = false; } break; /* SmartTags (can be anything) */ case 'smarttags' /*case 'SmartTags'*/: break; default: seen = false; break; } if(seen) break; /* CustomDocumentProperties */ if(Rn[3].match(/!\[CDATA/)) break; if(!state[state.length-1][1]) throw 'Unrecognized tag: ' + Rn[3] + "|" + state.join("|"); if(state[state.length-1][0]===/*'CustomDocumentProperties'*/'customdocumentproperties') { if(Rn[0].slice(-2) === "/>") break; else if(Rn[1]==="/") xlml_set_custprop(Custprops, raw_Rn3, cp, str.slice(pidx, Rn.index)); else { cp = Rn; pidx = Rn.index + Rn[0].length; } break; } if(opts.WTF) throw 'Unrecognized tag: ' + Rn[3] + "|" + state.join("|"); } var out = ({}/*:any*/); if(!opts.bookSheets && !opts.bookProps) out.Sheets = sheets; out.SheetNames = sheetnames; out.Workbook = Workbook; out.SSF = dup(table_fmt); out.Props = Props; out.Custprops = Custprops; return out; } function parse_xlml(data/*:RawBytes|string*/, opts)/*:Workbook*/ { fix_read_opts(opts=opts||{}); switch(opts.type||"base64") { case "base64": return parse_xlml_xml(Base64_decode(data), opts); case "binary": case "buffer": case "file": return parse_xlml_xml(data, opts); case "array": return parse_xlml_xml(a2s(data), opts); } /*:: throw new Error("unsupported type " + opts.type); */ } /* TODO */ function write_props_xlml(wb/*:Workbook*/, opts)/*:string*/ { var o/*:Array<string>*/ = []; /* DocumentProperties */ if(wb.Props) o.push(xlml_write_docprops(wb.Props, opts)); /* CustomDocumentProperties */ if(wb.Custprops) o.push(xlml_write_custprops(wb.Props, wb.Custprops, opts)); return o.join(""); } /* TODO */ function write_wb_xlml(/*::wb, opts*/)/*:string*/ { /* OfficeDocumentSettings */ /* ExcelWorkbook */ return ""; } /* TODO */ function write_sty_xlml(wb, opts)/*:string*/ { /* Styles */ var styles/*:Array<string>*/ = ['<Style ss:ID="Default" ss:Name="Normal"><NumberFormat/></Style>']; opts.cellXfs.forEach(function(xf, id) { var payload/*:Array<string>*/ = []; payload.push(writextag('NumberFormat', null, {"ss:Format": escapexml(table_fmt[xf.numFmtId])})); var o = /*::(*/{"ss:ID": "s" + (21+id)}/*:: :any)*/; styles.push(writextag('Style', payload.join(""), o)); }); return writextag("Styles", styles.join("")); } function write_name_xlml(n) { return writextag("NamedRange", null, {"ss:Name": n.Name, "ss:RefersTo":"=" + a1_to_rc(n.Ref, {r:0,c:0})}); } function write_names_xlml(wb/*::, opts*/)/*:string*/ { if(!((wb||{}).Workbook||{}).Names) return ""; /*:: if(!wb || !wb.Workbook || !wb.Workbook.Names) throw new Error("unreachable"); */ var names/*:Array<any>*/ = wb.Workbook.Names; var out/*:Array<string>*/ = []; for(var i = 0; i < names.length; ++i) { var n = names[i]; if(n.Sheet != null) continue; if(n.Name.match(/^_xlfn\./)) continue; out.push(write_name_xlml(n)); } return writextag("Names", out.join("")); } function write_ws_xlml_names(ws/*:Worksheet*/, opts, idx/*:number*/, wb/*:Workbook*/)/*:string*/ { if(!ws) return ""; if(!((wb||{}).Workbook||{}).Names) return ""; /*:: if(!wb || !wb.Workbook || !wb.Workbook.Names) throw new Error("unreachable"); */ var names/*:Array<any>*/ = wb.Workbook.Names; var out/*:Array<string>*/ = []; for(var i = 0; i < names.length; ++i) { var n = names[i]; if(n.Sheet != idx) continue; /*switch(n.Name) { case "_": continue; }*/ if(n.Name.match(/^_xlfn\./)) continue; out.push(write_name_xlml(n)); } return out.join(""); } /* WorksheetOptions */ function write_ws_xlml_wsopts(ws/*:Worksheet*/, opts, idx/*:number*/, wb/*:Workbook*/)/*:string*/ { if(!ws) return ""; var o/*:Array<string>*/ = []; /* NOTE: spec technically allows any order, but stick with implied order */ /* FitToPage */ /* DoNotDisplayColHeaders */ /* DoNotDisplayRowHeaders */ /* ViewableRange */ /* Selection */ /* GridlineColor */ /* Name */ /* ExcelWorksheetType */ /* IntlMacro */ /* Unsynced */ /* Selected */ /* CodeName */ if(ws['!margins']) { o.push("<PageSetup>"); if(ws['!margins'].header) o.push(writextag("Header", null, {'x:Margin':ws['!margins'].header})); if(ws['!margins'].footer) o.push(writextag("Footer", null, {'x:Margin':ws['!margins'].footer})); o.push(writextag("PageMargins", null, { 'x:Bottom': ws['!margins'].bottom || "0.75", 'x:Left': ws['!margins'].left || "0.7", 'x:Right': ws['!margins'].right || "0.7", 'x:Top': ws['!margins'].top || "0.75" })); o.push("</PageSetup>"); } /* PageSetup */ /* DisplayPageBreak */ /* TransitionExpressionEvaluation */ /* TransitionFormulaEntry */ /* Print */ /* Zoom */ /* PageLayoutZoom */ /* PageBreakZoom */ /* ShowPageBreakZoom */ /* DefaultRowHeight */ /* DefaultColumnWidth */ /* StandardWidth */ if(wb && wb.Workbook && wb.Workbook.Sheets && wb.Workbook.Sheets[idx]) { /* Visible */ if(wb.Workbook.Sheets[idx].Hidden) o.push(writextag("Visible", (wb.Workbook.Sheets[idx].Hidden == 1 ? "SheetHidden" : "SheetVeryHidden"), {})); else { /* Selected */ for(var i = 0; i < idx; ++i) if(wb.Workbook.Sheets[i] && !wb.Workbook.Sheets[i].Hidden) break; if(i == idx) o.push("<Selected/>"); } } /* LeftColumnVisible */ if(((((wb||{}).Workbook||{}).Views||[])[0]||{}).RTL) o.push("<DisplayRightToLeft/>"); /* GridlineColorIndex */ /* DisplayFormulas */ /* DoNotDisplayGridlines */ /* DoNotDisplayHeadings */ /* DoNotDisplayOutline */ /* ApplyAutomaticOutlineStyles */ /* NoSummaryRowsBelowDetail */ /* NoSummaryColumnsRightDetail */ /* DoNotDisplayZeros */ /* ActiveRow */ /* ActiveColumn */ /* FilterOn */ /* RangeSelection */ /* TopRowVisible */ /* TopRowBottomPane */ /* LeftColumnRightPane */ /* ActivePane */ /* SplitHorizontal */ /* SplitVertical */ /* FreezePanes */ /* FrozenNoSplit */ /* TabColorIndex */ /* Panes */ /* NOTE: Password not supported in XLML Format */ if(ws['!protect']) { o.push(writetag("ProtectContents", "True")); if(ws['!protect'].objects) o.push(writetag("ProtectObjects", "True")); if(ws['!protect'].scenarios) o.push(writetag("ProtectScenarios", "True")); if(ws['!protect'].selectLockedCells != null && !ws['!protect'].selectLockedCells) o.push(writetag("EnableSelection", "NoSelection")); else if(ws['!protect'].selectUnlockedCells != null && !ws['!protect'].selectUnlockedCells) o.push(writetag("EnableSelection", "UnlockedCells")); [ [ "formatCells", "AllowFormatCells" ], [ "formatColumns", "AllowSizeCols" ], [ "formatRows", "AllowSizeRows" ], [ "insertColumns", "AllowInsertCols" ], [ "insertRows", "AllowInsertRows" ], [ "insertHyperlinks", "AllowInsertHyperlinks" ], [ "deleteColumns", "AllowDeleteCols" ], [ "deleteRows", "AllowDeleteRows" ], [ "sort", "AllowSort" ], [ "autoFilter", "AllowFilter" ], [ "pivotTables", "AllowUsePivotTables" ] ].forEach(function(x) { if(ws['!protect'][x[0]]) o.push("<"+x[1]+"/>"); }); } if(o.length == 0) return ""; return writextag("WorksheetOptions", o.join(""), {xmlns:XLMLNS.x}); } function write_ws_xlml_comment(comments/*:Array<any>*/)/*:string*/ { return comments.map(function(c) { // TODO: formatted text var t = xlml_unfixstr(c.t||""); var d =writextag("ss:Data", t, {"xmlns":"http://www.w3.org/TR/REC-html40"}); return writextag("Comment", d, {"ss:Author":c.a}); }).join(""); } function write_ws_xlml_cell(cell, ref/*:string*/, ws, opts, idx/*:number*/, wb, addr)/*:string*/{ if(!cell || (cell.v == undefined && cell.f == undefined)) return ""; var attr = {}; if(cell.f) attr["ss:Formula"] = "=" + escapexml(a1_to_rc(cell.f, addr)); if(cell.F && cell.F.slice(0, ref.length) == ref) { var end = decode_cell(cell.F.slice(ref.length + 1)); attr["ss:ArrayRange"] = "RC:R" + (end.r == addr.r ? "" : "[" + (end.r - addr.r) + "]") + "C" + (end.c == addr.c ? "" : "[" + (end.c - addr.c) + "]"); } if(cell.l && cell.l.Target) { attr["ss:HRef"] = escapexml(cell.l.Target); if(cell.l.Tooltip) attr["x:HRefScreenTip"] = escapexml(cell.l.Tooltip); } if(ws['!merges']) { var marr = ws['!merges']; for(var mi = 0; mi != marr.length; ++mi) { if(marr[mi].s.c != addr.c || marr[mi].s.r != addr.r) continue; if(marr[mi].e.c > marr[mi].s.c) attr['ss:MergeAcross'] = marr[mi].e.c - marr[mi].s.c; if(marr[mi].e.r > marr[mi].s.r) attr['ss:MergeDown'] = marr[mi].e.r - marr[mi].s.r; } } var t = "", p = ""; switch(cell.t) { case 'z': if(!opts.sheetStubs) return ""; break; case 'n': t = 'Number'; p = String(cell.v); break; case 'b': t = 'Boolean'; p = (cell.v ? "1" : "0"); break; case 'e': t = 'Error'; p = BErr[cell.v]; break; case 'd': t = 'DateTime'; p = new Date(cell.v).toISOString(); if(cell.z == null) cell.z = cell.z || table_fmt[14]; break; case 's': t = 'String'; p = escapexlml(cell.v||""); break; } /* TODO: cell style */ var os = get_cell_style(opts.cellXfs, cell, opts); attr["ss:StyleID"] = "s" + (21+os); attr["ss:Index"] = addr.c + 1; var _v = (cell.v != null ? p : ""); var m = cell.t == 'z' ? "" : ('<Data ss:Type="' + t + '">' + _v + '</Data>'); if((cell.c||[]).length > 0) m += write_ws_xlml_comment(cell.c); return writextag("Cell", m, attr); } function write_ws_xlml_row(R/*:number*/, row)/*:string*/ { var o = '<Row ss:Index="' + (R+1) + '"'; if(row) { if(row.hpt && !row.hpx) row.hpx = pt2px(row.hpt); if(row.hpx) o += ' ss:AutoFitHeight="0" ss:Height="' + row.hpx + '"'; if(row.hidden) o += ' ss:Hidden="1"'; } return o + '>'; } /* TODO */ function write_ws_xlml_table(ws/*:Worksheet*/, opts, idx/*:number*/, wb/*:Workbook*/)/*:string*/ { if(!ws['!ref']) return ""; var range/*:Range*/ = safe_decode_range(ws['!ref']); var marr/*:Array<Range>*/ = ws['!merges'] || [], mi = 0; var o/*:Array<string>*/ = []; if(ws['!cols']) ws['!cols'].forEach(function(n, i) { process_col(n); var w = !!n.width; var p = col_obj_w(i, n); var k/*:any*/ = {"ss:Index":i+1}; if(w) k['ss:Width'] = width2px(p.width); if(n.hidden) k['ss:Hidden']="1"; o.push(writextag("Column",null,k)); }); var dense = Array.isArray(ws); for(var R = range.s.r; R <= range.e.r; ++R) { var row = [write_ws_xlml_row(R, (ws['!rows']||[])[R])]; for(var C = range.s.c; C <= range.e.c; ++C) { var skip = false; for(mi = 0; mi != marr.length; ++mi) { if(marr[mi].s.c > C) continue; if(marr[mi].s.r > R) continue; if(marr[mi].e.c < C) continue; if(marr[mi].e.r < R) continue; if(marr[mi].s.c != C || marr[mi].s.r != R) skip = true; break; } if(skip) continue; var addr = {r:R,c:C}; var ref = encode_cell(addr), cell = dense ? (ws[R]||[])[C] : ws[ref]; row.push(write_ws_xlml_cell(cell, ref, ws, opts, idx, wb, addr)); } row.push("</Row>"); if(row.length > 2) o.push(row.join("")); } return o.join(""); } function write_ws_xlml(idx/*:number*/, opts, wb/*:Workbook*/)/*:string*/ { var o/*:Array<string>*/ = []; var s = wb.SheetNames[idx]; var ws = wb.Sheets[s]; var t/*:string*/ = ws ? write_ws_xlml_names(ws, opts, idx, wb) : ""; if(t.length > 0) o.push("<Names>" + t + "</Names>"); /* Table */ t = ws ? write_ws_xlml_table(ws, opts, idx, wb) : ""; if(t.length > 0) o.push("<Table>" + t + "</Table>"); /* WorksheetOptions */ o.push(write_ws_xlml_wsopts(ws, opts, idx, wb)); return o.join(""); } function write_xlml(wb, opts)/*:string*/ { if(!opts) opts = {}; if(!wb.SSF) wb.SSF = dup(table_fmt); if(wb.SSF) { make_ssf(); SSF_load_table(wb.SSF); // $FlowIgnore opts.revssf = evert_num(wb.SSF); opts.revssf[wb.SSF[65535]] = 0; opts.ssf = wb.SSF; opts.cellXfs = []; get_cell_style(opts.cellXfs, {}, {revssf:{"General":0}}); } var d/*:Array<string>*/ = []; d.push(write_props_xlml(wb, opts)); d.push(write_wb_xlml(wb, opts)); d.push(""); d.push(""); for(var i = 0; i < wb.SheetNames.length; ++i) d.push(writextag("Worksheet", write_ws_xlml(i, opts, wb), {"ss:Name":escapexml(wb.SheetNames[i])})); d[2] = write_sty_xlml(wb, opts); d[3] = write_names_xlml(wb, opts); return XML_HEADER + writextag("Workbook", d.join(""), { 'xmlns': XLMLNS.ss, 'xmlns:o': XLMLNS.o, 'xmlns:x': XLMLNS.x, 'xmlns:ss': XLMLNS.ss, 'xmlns:dt': XLMLNS.dt, 'xmlns:html': XLMLNS.html }); } /* [MS-OLEDS] 2.3.8 CompObjStream */ function parse_compobj(obj/*:CFBEntry*/) { var v = {}; var o = obj.content; /*:: if(o == null) return; */ /* [MS-OLEDS] 2.3.7 CompObjHeader -- All fields MUST be ignored */ o.l = 28; v.AnsiUserType = o.read_shift(0, "lpstr-ansi"); v.AnsiClipboardFormat = parse_ClipboardFormatOrAnsiString(o); if(o.length - o.l <= 4) return v; var m/*:number*/ = o.read_shift(4); if(m == 0 || m > 40) return v; o.l-=4; v.Reserved1 = o.read_shift(0, "lpstr-ansi"); if(o.length - o.l <= 4) return v; m = o.read_shift(4); if(m !== 0x71b239f4) return v; v.UnicodeClipboardFormat = parse_ClipboardFormatOrUnicodeString(o); m = o.read_shift(4); if(m == 0 || m > 40) return v; o.l-=4; v.Reserved2 = o.read_shift(0, "lpwstr"); } /* Continue logic for: - 2.4.58 Continue 0x003c - 2.4.59 ContinueBigName 0x043c - 2.4.60 ContinueFrt 0x0812 - 2.4.61 ContinueFrt11 0x0875 - 2.4.62 ContinueFrt12 0x087f */ var CONTINUE_RT = [ 0x003c, 0x043c, 0x0812, 0x0875, 0x087f ]; function slurp(RecordType, R, blob, length/*:number*/, opts)/*:any*/ { var l = length; var bufs = []; var d = blob.slice(blob.l,blob.l+l); if(opts && opts.enc && opts.enc.insitu && d.length > 0) switch(RecordType) { case 0x0009: case 0x0209: case 0x0409: case 0x0809/* BOF */: case 0x002f /* FilePass */: case 0x0195 /* FileLock */: case 0x00e1 /* InterfaceHdr */: case 0x0196 /* RRDInfo */: case 0x0138 /* RRDHead */: case 0x0194 /* UsrExcl */: case 0x000a /* EOF */: break; case 0x0085 /* BoundSheet8 */: break; default: opts.enc.insitu(d); } bufs.push(d); blob.l += l; var nextrt = __readUInt16LE(blob,blob.l), next = XLSRecordEnum[nextrt]; var start = 0; while(next != null && CONTINUE_RT.indexOf(nextrt) > -1) { l = __readUInt16LE(blob,blob.l+2); start = blob.l + 4; if(nextrt == 0x0812 /* ContinueFrt */) start += 4; else if(nextrt == 0x0875 || nextrt == 0x087f) { start += 12; } d = blob.slice(start,blob.l+4+l); bufs.push(d); blob.l += 4+l; next = (XLSRecordEnum[nextrt = __readUInt16LE(blob, blob.l)]); } var b = (bconcat(bufs)/*:any*/); prep_blob(b, 0); var ll = 0; b.lens = []; for(var j = 0; j < bufs.length; ++j) { b.lens.push(ll); ll += bufs[j].length; } if(b.length < length) throw "XLS Record 0x" + RecordType.toString(16) + " Truncated: " + b.length + " < " + length; return R.f(b, b.length, opts); } function safe_format_xf(p/*:any*/, opts/*:ParseOpts*/, date1904/*:?boolean*/) { if(p.t === 'z') return; if(!p.XF) return; var fmtid = 0; try { fmtid = p.z || p.XF.numFmtId || 0; if(opts.cellNF) p.z = table_fmt[fmtid]; } catch(e) { if(opts.WTF) throw e; } if(!opts || opts.cellText !== false) try { if(p.t === 'e') { p.w = p.w || BErr[p.v]; } else if(fmtid === 0 || fmtid == "General") { if(p.t === 'n') { if((p.v|0) === p.v) p.w = p.v.toString(10); else p.w = SSF_general_num(p.v); } else p.w = SSF_general(p.v); } else p.w = SSF_format(fmtid,p.v, {date1904:!!date1904, dateNF: opts && opts.dateNF}); } catch(e) { if(opts.WTF) throw e; } if(opts.cellDates && fmtid && p.t == 'n' && fmt_is_date(table_fmt[fmtid] || String(fmtid))) { var _d = SSF_parse_date_code(p.v); if(_d) { p.t = 'd'; p.v = new Date(_d.y, _d.m-1,_d.d,_d.H,_d.M,_d.S,_d.u); } } } function make_cell(val, ixfe, t)/*:Cell*/ { return ({v:val, ixfe:ixfe, t:t}/*:any*/); } // 2.3.2 function parse_workbook(blob, options/*:ParseOpts*/)/*:Workbook*/ { var wb = ({opts:{}}/*:any*/); var Sheets = {}; if(DENSE != null && options.dense == null) options.dense = DENSE; var out/*:Worksheet*/ = ((options.dense ? [] : {})/*:any*/); var Directory = {}; var range/*:Range*/ = ({}/*:any*/); var last_formula = null; var sst/*:SST*/ = ([]/*:any*/); var cur_sheet = ""; var Preamble = {}; var lastcell, last_cell = "", cc/*:Cell*/, cmnt, rngC, rngR; var sharedf = {}; var arrayf/*:Array<[Range, string]>*/ = []; var temp_val/*:Cell*/; var country; var XFs = []; /* XF records */ var palette/*:Array<[number, number, number]>*/ = []; var Workbook/*:WBWBProps*/ = ({ Sheets:[], WBProps:{date1904:false}, Views:[{}] }/*:any*/), wsprops = {}; var get_rgb = function getrgb(icv/*:number*/)/*:[number, number, number]*/ { if(icv < 8) return XLSIcv[icv]; if(icv < 64) return palette[icv-8] || XLSIcv[icv]; return XLSIcv[icv]; }; var process_cell_style = function pcs(cell, line/*:any*/, options) { var xfd = line.XF.data; if(!xfd || !xfd.patternType || !options || !options.cellStyles) return; line.s = ({}/*:any*/); line.s.patternType = xfd.patternType; var t; if((t = rgb2Hex(get_rgb(xfd.icvFore)))) { line.s.fgColor = {rgb:t}; } if((t = rgb2Hex(get_rgb(xfd.icvBack)))) { line.s.bgColor = {rgb:t}; } }; var addcell = function addcell(cell/*:any*/, line/*:any*/, options/*:any*/) { if(file_depth > 1) return; if(options.sheetRows && cell.r >= options.sheetRows) return; if(options.cellStyles && line.XF && line.XF.data) process_cell_style(cell, line, options); delete line.ixfe; delete line.XF; lastcell = cell; last_cell = encode_cell(cell); if(!range || !range.s || !range.e) range = {s:{r:0,c:0},e:{r:0,c:0}}; if(cell.r < range.s.r) range.s.r = cell.r; if(cell.c < range.s.c) range.s.c = cell.c; if(cell.r + 1 > range.e.r) range.e.r = cell.r + 1; if(cell.c + 1 > range.e.c) range.e.c = cell.c + 1; if(options.cellFormula && line.f) { for(var afi = 0; afi < arrayf.length; ++afi) { if(arrayf[afi][0].s.c > cell.c || arrayf[afi][0].s.r > cell.r) continue; if(arrayf[afi][0].e.c < cell.c || arrayf[afi][0].e.r < cell.r) continue; line.F = encode_range(arrayf[afi][0]); if(arrayf[afi][0].s.c != cell.c || arrayf[afi][0].s.r != cell.r) delete line.f; if(line.f) line.f = "" + stringify_formula(arrayf[afi][1], range, cell, supbooks, opts); break; } } { if(options.dense) { if(!out[cell.r]) out[cell.r] = []; out[cell.r][cell.c] = line; } else out[last_cell] = line; } }; var opts = ({ enc: false, // encrypted sbcch: 0, // cch in the preceding SupBook snames: [], // sheetnames sharedf: sharedf, // shared formulae by address arrayf: arrayf, // array formulae array rrtabid: [], // RRTabId lastuser: "", // Last User from WriteAccess biff: 8, // BIFF version codepage: 0, // CP from CodePage record winlocked: 0, // fLockWn from WinProtect cellStyles: !!options && !!options.cellStyles, WTF: !!options && !!options.wtf }/*:any*/); if(options.password) opts.password = options.password; var themes; var merges/*:Array<Range>*/ = []; var objects = []; var colinfo/*:Array<ColInfo>*/ = [], rowinfo/*:Array<RowInfo>*/ = []; var seencol = false; var supbooks = ([]/*:any*/); // 1-indexed, will hold extern names supbooks.SheetNames = opts.snames; supbooks.sharedf = opts.sharedf; supbooks.arrayf = opts.arrayf; supbooks.names = []; supbooks.XTI = []; var last_RT = 0; var file_depth = 0; /* TODO: make a real stack */ var BIFF2Fmt = 0, BIFF2FmtTable/*:Array<string>*/ = []; var FilterDatabases = []; /* TODO: sort out supbooks and process elsewhere */ var last_lbl/*:?DefinedName*/; /* explicit override for some broken writers */ opts.codepage = 1200; set_cp(1200); var seen_codepage = false; while(blob.l < blob.length - 1) { var s = blob.l; var RecordType = blob.read_shift(2); if(RecordType === 0 && last_RT === 0x000a /* EOF */) break; var length = (blob.l === blob.length ? 0 : blob.read_shift(2)); var R = XLSRecordEnum[RecordType]; //console.log(RecordType.toString(16), RecordType, R, blob.l, length, blob.length); //if(!R) console.log(blob.slice(blob.l, blob.l + length)); if(R && R.f) { if(options.bookSheets) { if(last_RT === 0x0085 /* BoundSheet8 */ && RecordType !== 0x0085 /* R.n !== 'BoundSheet8' */) break; } last_RT = RecordType; if(R.r === 2 || R.r == 12) { var rt = blob.read_shift(2); length -= 2; if(!opts.enc && rt !== RecordType && (((rt&0xFF)<<8)|(rt>>8)) !== RecordType) throw new Error("rt mismatch: " + rt + "!=" + RecordType); if(R.r == 12){ blob.l += 10; length -= 10; } // skip FRT } //console.error(R,blob.l,length,blob.length); var val/*:any*/ = ({}/*:any*/); if(RecordType === 0x000a /* EOF */) val = /*::(*/R.f(blob, length, opts)/*:: :any)*/; else val = /*::(*/slurp(RecordType, R, blob, length, opts)/*:: :any)*/; /*:: val = (val:any); */ if(file_depth == 0 && [0x0009, 0x0209, 0x0409, 0x0809].indexOf(last_RT) === -1 /* 'BOF' */) continue; switch(RecordType) { case 0x0022 /* Date1904 */: /*:: if(!Workbook.WBProps) Workbook.WBProps = {}; */ wb.opts.Date1904 = Workbook.WBProps.date1904 = val; break; case 0x0086 /* WriteProtect */: wb.opts.WriteProtect = true; break; case 0x002f /* FilePass */: if(!opts.enc) blob.l = 0; opts.enc = val; if(!options.password) throw new Error("File is password-protected"); if(val.valid == null) throw new Error("Encryption scheme unsupported"); if(!val.valid) throw new Error("Password is incorrect"); break; case 0x005c /* WriteAccess */: opts.lastuser = val; break; case 0x0042 /* CodePage */: var cpval = Number(val); /* overrides based on test cases */ switch(cpval) { case 0x5212: cpval = 1200; break; case 0x8000: cpval = 10000; break; case 0x8001: cpval = 1252; break; } set_cp(opts.codepage = cpval); seen_codepage = true; break; case 0x013d /* RRTabId */: opts.rrtabid = val; break; case 0x0019 /* WinProtect */: opts.winlocked = val; break; case 0x01b7 /* RefreshAll */: wb.opts["RefreshAll"] = val; break; case 0x000c /* CalcCount */: wb.opts["CalcCount"] = val; break; case 0x0010 /* CalcDelta */: wb.opts["CalcDelta"] = val; break; case 0x0011 /* CalcIter */: wb.opts["CalcIter"] = val; break; case 0x000d /* CalcMode */: wb.opts["CalcMode"] = val; break; case 0x000e /* CalcPrecision */: wb.opts["CalcPrecision"] = val; break; case 0x005f /* CalcSaveRecalc */: wb.opts["CalcSaveRecalc"] = val; break; case 0x000f /* CalcRefMode */: opts.CalcRefMode = val; break; // TODO: implement R1C1 case 0x08a3 /* ForceFullCalculation */: wb.opts.FullCalc = val; break; case 0x0081 /* WsBool */: if(val.fDialog) out["!type"] = "dialog"; if(!val.fBelow) (out["!outline"] || (out["!outline"] = {})).above = true; if(!val.fRight) (out["!outline"] || (out["!outline"] = {})).left = true; break; // TODO case 0x00e0 /* XF */: XFs.push(val); break; case 0x01ae /* SupBook */: supbooks.push([val]); supbooks[supbooks.length-1].XTI = []; break; case 0x0023: case 0x0223 /* ExternName */: supbooks[supbooks.length-1].push(val); break; case 0x0018: case 0x0218 /* Lbl */: last_lbl = ({ Name: val.Name, Ref: stringify_formula(val.rgce,range,null,supbooks,opts) }/*:DefinedName*/); if(val.itab > 0) last_lbl.Sheet = val.itab - 1; supbooks.names.push(last_lbl); if(!supbooks[0]) { supbooks[0] = []; supbooks[0].XTI = []; } supbooks[supbooks.length-1].push(val); if(val.Name == "_xlnm._FilterDatabase" && val.itab > 0) if(val.rgce && val.rgce[0] && val.rgce[0][0] && val.rgce[0][0][0] == 'PtgArea3d') FilterDatabases[val.itab - 1] = { ref: encode_range(val.rgce[0][0][1][2]) }; break; case 0x0016 /* ExternCount */: opts.ExternCount = val; break; case 0x0017 /* ExternSheet */: if(supbooks.length == 0) { supbooks[0] = []; supbooks[0].XTI = []; } supbooks[supbooks.length - 1].XTI = supbooks[supbooks.length - 1].XTI.concat(val); supbooks.XTI = supbooks.XTI.concat(val); break; case 0x0894 /* NameCmt */: /* TODO: search for correct name */ if(opts.biff < 8) break; if(last_lbl != null) last_lbl.Comment = val[1]; break; case 0x0012 /* Protect */: out["!protect"] = val; break; /* for sheet or book */ case 0x0013 /* Password */: if(val !== 0 && opts.WTF) console.error("Password verifier: " + val); break; case 0x0085 /* BoundSheet8 */: { Directory[val.pos] = val; opts.snames.push(val.name); } break; case 0x000a /* EOF */: { if(--file_depth) break; if(range.e) { if(range.e.r > 0 && range.e.c > 0) { range.e.r--; range.e.c--; out["!ref"] = encode_range(range); if(options.sheetRows && options.sheetRows <= range.e.r) { var tmpri = range.e.r; range.e.r = options.sheetRows - 1; out["!fullref"] = out["!ref"]; out["!ref"] = encode_range(range); range.e.r = tmpri; } range.e.r++; range.e.c++; } if(merges.length > 0) out["!merges"] = merges; if(objects.length > 0) out["!objects"] = objects; if(colinfo.length > 0) out["!cols"] = colinfo; if(rowinfo.length > 0) out["!rows"] = rowinfo; Workbook.Sheets.push(wsprops); } if(cur_sheet === "") Preamble = out; else Sheets[cur_sheet] = out; out = ((options.dense ? [] : {})/*:any*/); } break; case 0x0009: case 0x0209: case 0x0409: case 0x0809 /* BOF */: { if(opts.biff === 8) opts.biff = { /*::[*/0x0009/*::]*/:2, /*::[*/0x0209/*::]*/:3, /*::[*/0x0409/*::]*/:4 }[RecordType] || { /*::[*/0x0200/*::]*/:2, /*::[*/0x0300/*::]*/:3, /*::[*/0x0400/*::]*/:4, /*::[*/0x0500/*::]*/:5, /*::[*/0x0600/*::]*/:8, /*::[*/0x0002/*::]*/:2, /*::[*/0x0007/*::]*/:2 }[val.BIFFVer] || 8; opts.biffguess = val.BIFFVer == 0; if(val.BIFFVer == 0 && val.dt == 0x1000) { opts.biff = 5; seen_codepage = true; set_cp(opts.codepage = 28591); } if(opts.biff == 8 && val.BIFFVer == 0 && val.dt == 16) opts.biff = 2; if(file_depth++) break; out = ((options.dense ? [] : {})/*:any*/); if(opts.biff < 8 && !seen_codepage) { seen_codepage = true; set_cp(opts.codepage = options.codepage || 1252); } if(opts.biff < 5 || val.BIFFVer == 0 && val.dt == 0x1000) { if(cur_sheet === "") cur_sheet = "Sheet1"; range = {s:{r:0,c:0},e:{r:0,c:0}}; /* fake BoundSheet8 */ var fakebs8 = {pos: blob.l - length, name:cur_sheet}; Directory[fakebs8.pos] = fakebs8; opts.snames.push(cur_sheet); } else cur_sheet = (Directory[s] || {name:""}).name; if(val.dt == 0x20) out["!type"] = "chart"; if(val.dt == 0x40) out["!type"] = "macro"; merges = []; objects = []; opts.arrayf = arrayf = []; colinfo = []; rowinfo = []; seencol = false; wsprops = {Hidden:(Directory[s]||{hs:0}).hs, name:cur_sheet }; } break; case 0x0203 /* Number */: case 0x0003 /* BIFF2NUM */: case 0x0002 /* BIFF2INT */: { if(out["!type"] == "chart") if(options.dense ? (out[val.r]||[])[val.c]: out[encode_cell({c:val.c, r:val.r})]) ++val.c; temp_val = ({ixfe: val.ixfe, XF: XFs[val.ixfe]||{}, v:val.val, t:'n'}/*:any*/); if(BIFF2Fmt > 0) temp_val.z = BIFF2FmtTable[(temp_val.ixfe>>8) & 0x3F]; safe_format_xf(temp_val, options, wb.opts.Date1904); addcell({c:val.c, r:val.r}, temp_val, options); } break; case 0x0005: case 0x0205 /* BoolErr */: { temp_val = ({ixfe: val.ixfe, XF: XFs[val.ixfe], v:val.val, t:val.t}/*:any*/); if(BIFF2Fmt > 0) temp_val.z = BIFF2FmtTable[(temp_val.ixfe>>8) & 0x3F]; safe_format_xf(temp_val, options, wb.opts.Date1904); addcell({c:val.c, r:val.r}, temp_val, options); } break; case 0x027e /* RK */: { temp_val = ({ixfe: val.ixfe, XF: XFs[val.ixfe], v:val.rknum, t:'n'}/*:any*/); if(BIFF2Fmt > 0) temp_val.z = BIFF2FmtTable[(temp_val.ixfe>>8) & 0x3F]; safe_format_xf(temp_val, options, wb.opts.Date1904); addcell({c:val.c, r:val.r}, temp_val, options); } break; case 0x00bd /* MulRk */: { for(var j = val.c; j <= val.C; ++j) { var ixfe = val.rkrec[j-val.c][0]; temp_val= ({ixfe:ixfe, XF:XFs[ixfe], v:val.rkrec[j-val.c][1], t:'n'}/*:any*/); if(BIFF2Fmt > 0) temp_val.z = BIFF2FmtTable[(temp_val.ixfe>>8) & 0x3F]; safe_format_xf(temp_val, options, wb.opts.Date1904); addcell({c:j, r:val.r}, temp_val, options); } } break; case 0x0006: case 0x0206: case 0x0406 /* Formula */: { if(val.val == 'String') { last_formula = val; break; } temp_val = make_cell(val.val, val.cell.ixfe, val.tt); temp_val.XF = XFs[temp_val.ixfe]; if(options.cellFormula) { var _f = val.formula; if(_f && _f[0] && _f[0][0] && _f[0][0][0] == 'PtgExp') { var _fr = _f[0][0][1][0], _fc = _f[0][0][1][1]; var _fe = encode_cell({r:_fr, c:_fc}); if(sharedf[_fe]) temp_val.f = ""+stringify_formula(val.formula,range,val.cell,supbooks, opts); else temp_val.F = ((options.dense ? (out[_fr]||[])[_fc]: out[_fe]) || {}).F; } else temp_val.f = ""+stringify_formula(val.formula,range,val.cell,supbooks, opts); } if(BIFF2Fmt > 0) temp_val.z = BIFF2FmtTable[(temp_val.ixfe>>8) & 0x3F]; safe_format_xf(temp_val, options, wb.opts.Date1904); addcell(val.cell, temp_val, options); last_formula = val; } break; case 0x0007: case 0x0207 /* String */: { if(last_formula) { /* technically always true */ last_formula.val = val; temp_val = make_cell(val, last_formula.cell.ixfe, 's'); temp_val.XF = XFs[temp_val.ixfe]; if(options.cellFormula) { temp_val.f = ""+stringify_formula(last_formula.formula, range, last_formula.cell, supbooks, opts); } if(BIFF2Fmt > 0) temp_val.z = BIFF2FmtTable[(temp_val.ixfe>>8) & 0x3F]; safe_format_xf(temp_val, options, wb.opts.Date1904); addcell(last_formula.cell, temp_val, options); last_formula = null; } else throw new Error("String record expects Formula"); } break; case 0x0021: case 0x0221 /* Array */: { arrayf.push(val); var _arraystart = encode_cell(val[0].s); cc = options.dense ? (out[val[0].s.r]||[])[val[0].s.c] : out[_arraystart]; if(options.cellFormula && cc) { if(!last_formula) break; /* technically unreachable */ if(!_arraystart || !cc) break; cc.f = ""+stringify_formula(val[1], range, val[0], supbooks, opts); cc.F = encode_range(val[0]); } } break; case 0x04bc /* ShrFmla */: { if(!options.cellFormula) break; if(last_cell) { /* TODO: capture range */ if(!last_formula) break; /* technically unreachable */ sharedf[encode_cell(last_formula.cell)]= val[0]; cc = options.dense ? (out[last_formula.cell.r]||[])[last_formula.cell.c] : out[encode_cell(last_formula.cell)]; (cc||{}).f = ""+stringify_formula(val[0], range, lastcell, supbooks, opts); } } break; case 0x00fd /* LabelSst */: temp_val=make_cell(sst[val.isst].t, val.ixfe, 's'); if(sst[val.isst].h) temp_val.h = sst[val.isst].h; temp_val.XF = XFs[temp_val.ixfe]; if(BIFF2Fmt > 0) temp_val.z = BIFF2FmtTable[(temp_val.ixfe>>8) & 0x3F]; safe_format_xf(temp_val, options, wb.opts.Date1904); addcell({c:val.c, r:val.r}, temp_val, options); break; case 0x0201 /* Blank */: if(options.sheetStubs) { temp_val = ({ixfe: val.ixfe, XF: XFs[val.ixfe], t:'z'}/*:any*/); if(BIFF2Fmt > 0) temp_val.z = BIFF2FmtTable[(temp_val.ixfe>>8) & 0x3F]; safe_format_xf(temp_val, options, wb.opts.Date1904); addcell({c:val.c, r:val.r}, temp_val, options); } break; case 0x00be /* MulBlank */: if(options.sheetStubs) { for(var _j = val.c; _j <= val.C; ++_j) { var _ixfe = val.ixfe[_j-val.c]; temp_val= ({ixfe:_ixfe, XF:XFs[_ixfe], t:'z'}/*:any*/); if(BIFF2Fmt > 0) temp_val.z = BIFF2FmtTable[(temp_val.ixfe>>8) & 0x3F]; safe_format_xf(temp_val, options, wb.opts.Date1904); addcell({c:_j, r:val.r}, temp_val, options); } } break; case 0x00d6 /* RString */: case 0x0204 /* Label */: case 0x0004 /* BIFF2STR */: temp_val=make_cell(val.val, val.ixfe, 's'); temp_val.XF = XFs[temp_val.ixfe]; if(BIFF2Fmt > 0) temp_val.z = BIFF2FmtTable[(temp_val.ixfe>>8) & 0x3F]; safe_format_xf(temp_val, options, wb.opts.Date1904); addcell({c:val.c, r:val.r}, temp_val, options); break; case 0x0000: case 0x0200 /* Dimensions */: { if(file_depth === 1) range = val; /* TODO: stack */ } break; case 0x00fc /* SST */: { sst = val; } break; case 0x041e /* Format */: { /* val = [id, fmt] */ if(opts.biff == 4) { BIFF2FmtTable[BIFF2Fmt++] = val[1]; for(var b4idx = 0; b4idx < BIFF2Fmt + 163; ++b4idx) if(table_fmt[b4idx] == val[1]) break; if(b4idx >= 163) SSF_load(val[1], BIFF2Fmt + 163); } else SSF_load(val[1], val[0]); } break; case 0x001e /* BIFF2FORMAT */: { BIFF2FmtTable[BIFF2Fmt++] = val; for(var b2idx = 0; b2idx < BIFF2Fmt + 163; ++b2idx) if(table_fmt[b2idx] == val) break; if(b2idx >= 163) SSF_load(val, BIFF2Fmt + 163); } break; case 0x00e5 /* MergeCells */: merges = merges.concat(val); break; case 0x005d /* Obj */: objects[val.cmo[0]] = opts.lastobj = val; break; case 0x01b6 /* TxO */: opts.lastobj.TxO = val; break; case 0x007f /* ImData */: opts.lastobj.ImData = val; break; case 0x01b8 /* HLink */: { for(rngR = val[0].s.r; rngR <= val[0].e.r; ++rngR) for(rngC = val[0].s.c; rngC <= val[0].e.c; ++rngC) { cc = options.dense ? (out[rngR]||[])[rngC] : out[encode_cell({c:rngC,r:rngR})]; if(cc) cc.l = val[1]; } } break; case 0x0800 /* HLinkTooltip */: { for(rngR = val[0].s.r; rngR <= val[0].e.r; ++rngR) for(rngC = val[0].s.c; rngC <= val[0].e.c; ++rngC) { cc = options.dense ? (out[rngR]||[])[rngC] : out[encode_cell({c:rngC,r:rngR})]; if(cc && cc.l) cc.l.Tooltip = val[1]; } } break; case 0x001c /* Note */: { if(opts.biff <= 5 && opts.biff >= 2) break; /* TODO: BIFF5 */ cc = options.dense ? (out[val[0].r]||[])[val[0].c] : out[encode_cell(val[0])]; var noteobj = objects[val[2]]; if(!cc) { if(options.dense) { if(!out[val[0].r]) out[val[0].r] = []; cc = out[val[0].r][val[0].c] = ({t:"z"}/*:any*/); } else { cc = out[encode_cell(val[0])] = ({t:"z"}/*:any*/); } range.e.r = Math.max(range.e.r, val[0].r); range.s.r = Math.min(range.s.r, val[0].r); range.e.c = Math.max(range.e.c, val[0].c); range.s.c = Math.min(range.s.c, val[0].c); } if(!cc.c) cc.c = []; cmnt = {a:val[1],t:noteobj.TxO.t}; cc.c.push(cmnt); } break; case 0x087d /* XFExt */: update_xfext(XFs[val.ixfe], val.ext); break; case 0x007d /* ColInfo */: { if(!opts.cellStyles) break; while(val.e >= val.s) { colinfo[val.e--] = { width: val.w/256, level: (val.level || 0), hidden: !!(val.flags & 1) }; if(!seencol) { seencol = true; find_mdw_colw(val.w/256); } process_col(colinfo[val.e+1]); } } break; case 0x0208 /* Row */: { var rowobj = {}; if(val.level != null) { rowinfo[val.r] = rowobj; rowobj.level = val.level; } if(val.hidden) { rowinfo[val.r] = rowobj; rowobj.hidden = true; } if(val.hpt) { rowinfo[val.r] = rowobj; rowobj.hpt = val.hpt; rowobj.hpx = pt2px(val.hpt); } } break; case 0x0026 /* LeftMargin */: case 0x0027 /* RightMargin */: case 0x0028 /* TopMargin */: case 0x0029 /* BottomMargin */: if(!out['!margins']) default_margins(out['!margins'] = {}); out['!margins'][({0x26: "left", 0x27:"right", 0x28:"top", 0x29:"bottom"})[RecordType]] = val; break; case 0x00a1 /* Setup */: // TODO if(!out['!margins']) default_margins(out['!margins'] = {}); out['!margins'].header = val.header; out['!margins'].footer = val.footer; break; case 0x023e /* Window2 */: // TODO // $FlowIgnore if(val.RTL) Workbook.Views[0].RTL = true; break; case 0x0092 /* Palette */: palette = val; break; case 0x0896 /* Theme */: themes = val; break; case 0x008c /* Country */: country = val; break; case 0x01ba /* CodeName */: { /*:: if(!Workbook.WBProps) Workbook.WBProps = {}; */ if(!cur_sheet) Workbook.WBProps.CodeName = val || "ThisWorkbook"; else wsprops.CodeName = val || wsprops.name; } break; } } else { if(!R) console.error("Missing Info for XLS Record 0x" + RecordType.toString(16)); blob.l += length; } } wb.SheetNames=keys(Directory).sort(function(a,b) { return Number(a) - Number(b); }).map(function(x){return Directory[x].name;}); if(!options.bookSheets) wb.Sheets=Sheets; if(!wb.SheetNames.length && Preamble["!ref"]) { wb.SheetNames.push("Sheet1"); /*jshint -W069 */ if(wb.Sheets) wb.Sheets["Sheet1"] = Preamble; /*jshint +W069 */ } else wb.Preamble=Preamble; if(wb.Sheets) FilterDatabases.forEach(function(r,i) { wb.Sheets[wb.SheetNames[i]]['!autofilter'] = r; }); wb.Strings = sst; wb.SSF = dup(table_fmt); if(opts.enc) wb.Encryption = opts.enc; if(themes) wb.Themes = themes; wb.Metadata = {}; if(country !== undefined) wb.Metadata.Country = country; if(supbooks.names.length > 0) Workbook.Names = supbooks.names; wb.Workbook = Workbook; return wb; } /* TODO: split props*/ var PSCLSID = { SI: "e0859ff2f94f6810ab9108002b27b3d9", DSI: "02d5cdd59c2e1b10939708002b2cf9ae", UDI: "05d5cdd59c2e1b10939708002b2cf9ae" }; function parse_xls_props(cfb/*:CFBContainer*/, props, o) { /* [MS-OSHARED] 2.3.3.2.2 Document Summary Information Property Set */ var DSI = CFB.find(cfb, '/!DocumentSummaryInformation'); if(DSI && DSI.size > 0) try { var DocSummary = parse_PropertySetStream(DSI, DocSummaryPIDDSI, PSCLSID.DSI); for(var d in DocSummary) props[d] = DocSummary[d]; } catch(e) {if(o.WTF) throw e;/* empty */} /* [MS-OSHARED] 2.3.3.2.1 Summary Information Property Set*/ var SI = CFB.find(cfb, '/!SummaryInformation'); if(SI && SI.size > 0) try { var Summary = parse_PropertySetStream(SI, SummaryPIDSI, PSCLSID.SI); for(var s in Summary) if(props[s] == null) props[s] = Summary[s]; } catch(e) {if(o.WTF) throw e;/* empty */} if(props.HeadingPairs && props.TitlesOfParts) { load_props_pairs(props.HeadingPairs, props.TitlesOfParts, props, o); delete props.HeadingPairs; delete props.TitlesOfParts; } } function write_xls_props(wb/*:Workbook*/, cfb/*:CFBContainer*/) { var DSEntries = [], SEntries = [], CEntries = []; var i = 0, Keys; var DocSummaryRE/*:{[key:string]:string}*/ = evert_key(DocSummaryPIDDSI, "n"); var SummaryRE/*:{[key:string]:string}*/ = evert_key(SummaryPIDSI, "n"); if(wb.Props) { Keys = keys(wb.Props); // $FlowIgnore for(i = 0; i < Keys.length; ++i) (Object.prototype.hasOwnProperty.call(DocSummaryRE, Keys[i]) ? DSEntries : Object.prototype.hasOwnProperty.call(SummaryRE, Keys[i]) ? SEntries : CEntries).push([Keys[i], wb.Props[Keys[i]]]); } if(wb.Custprops) { Keys = keys(wb.Custprops); // $FlowIgnore for(i = 0; i < Keys.length; ++i) if(!Object.prototype.hasOwnProperty.call((wb.Props||{}), Keys[i])) (Object.prototype.hasOwnProperty.call(DocSummaryRE, Keys[i]) ? DSEntries : Object.prototype.hasOwnProperty.call(SummaryRE, Keys[i]) ? SEntries : CEntries).push([Keys[i], wb.Custprops[Keys[i]]]); } var CEntries2 = []; for(i = 0; i < CEntries.length; ++i) { if(XLSPSSkip.indexOf(CEntries[i][0]) > -1 || PseudoPropsPairs.indexOf(CEntries[i][0]) > -1) continue; if(CEntries[i][1] == null) continue; CEntries2.push(CEntries[i]); } if(SEntries.length) CFB.utils.cfb_add(cfb, "/\u0005SummaryInformation", write_PropertySetStream(SEntries, PSCLSID.SI, SummaryRE, SummaryPIDSI)); if(DSEntries.length || CEntries2.length) CFB.utils.cfb_add(cfb, "/\u0005DocumentSummaryInformation", write_PropertySetStream(DSEntries, PSCLSID.DSI, DocSummaryRE, DocSummaryPIDDSI, CEntries2.length ? CEntries2 : null, PSCLSID.UDI)); } function parse_xlscfb(cfb/*:any*/, options/*:?ParseOpts*/)/*:Workbook*/ { if(!options) options = {}; fix_read_opts(options); reset_cp(); if(options.codepage) set_ansi(options.codepage); var CompObj/*:?CFBEntry*/, WB/*:?any*/; if(cfb.FullPaths) { if(CFB.find(cfb, '/encryption')) throw new Error("File is password-protected"); CompObj = CFB.find(cfb, '!CompObj'); WB = CFB.find(cfb, '/Workbook') || CFB.find(cfb, '/Book'); } else { switch(options.type) { case 'base64': cfb = s2a(Base64_decode(cfb)); break; case 'binary': cfb = s2a(cfb); break; case 'buffer': break; case 'array': if(!Array.isArray(cfb)) cfb = Array.prototype.slice.call(cfb); break; } prep_blob(cfb, 0); WB = ({content: cfb}/*:any*/); } var /*::CompObjP, */WorkbookP/*:: :Workbook = XLSX.utils.book_new(); */; var _data/*:?any*/; if(CompObj) /*::CompObjP = */parse_compobj(CompObj); if(options.bookProps && !options.bookSheets) WorkbookP = ({}/*:any*/); else/*:: if(cfb instanceof CFBContainer) */ { var T = has_buf ? 'buffer' : 'array'; if(WB && WB.content) WorkbookP = parse_workbook(WB.content, options); /* Quattro Pro 7-8 */ else if((_data=CFB.find(cfb, 'PerfectOffice_MAIN')) && _data.content) WorkbookP = WK_.to_workbook(_data.content, (options.type = T, options)); /* Quattro Pro 9 */ else if((_data=CFB.find(cfb, 'NativeContent_MAIN')) && _data.content) WorkbookP = WK_.to_workbook(_data.content, (options.type = T, options)); /* Works 4 for Mac */ else if((_data=CFB.find(cfb, 'MN0')) && _data.content) throw new Error("Unsupported Works 4 for Mac file"); else throw new Error("Cannot find Workbook stream"); if(options.bookVBA && cfb.FullPaths && CFB.find(cfb, '/_VBA_PROJECT_CUR/VBA/dir')) WorkbookP.vbaraw = make_vba_xls(cfb); } var props = {}; if(cfb.FullPaths) parse_xls_props(/*::((*/cfb/*:: :any):CFBContainer)*/, props, options); WorkbookP.Props = WorkbookP.Custprops = props; /* TODO: split up properties */ if(options.bookFiles) WorkbookP.cfb = cfb; /*WorkbookP.CompObjP = CompObjP; // TODO: storage? */ return WorkbookP; } function write_xlscfb(wb/*:Workbook*/, opts/*:WriteOpts*/)/*:CFBContainer*/ { var o = opts || {}; var cfb = CFB.utils.cfb_new({root:"R"}); var wbpath = "/Workbook"; switch(o.bookType || "xls") { case "xls": o.bookType = "biff8"; /* falls through */ case "xla": if(!o.bookType) o.bookType = "xla"; /* falls through */ case "biff8": wbpath = "/Workbook"; o.biff = 8; break; case "biff5": wbpath = "/Book"; o.biff = 5; break; default: throw new Error("invalid type " + o.bookType + " for XLS CFB"); } CFB.utils.cfb_add(cfb, wbpath, write_biff_buf(wb, o)); if(o.biff == 8 && (wb.Props || wb.Custprops)) write_xls_props(wb, cfb); // TODO: SI, DSI, CO if(o.biff == 8 && wb.vbaraw) fill_vba_xls(cfb, CFB.read(wb.vbaraw, {type: typeof wb.vbaraw == "string" ? "binary" : "buffer"})); return cfb; } /* [MS-XLSB] 2.3 Record Enumeration */ var XLSBRecordEnum = { /*::[*/0x0000/*::]*/: { /* n:"BrtRowHdr", */ f:parse_BrtRowHdr }, /*::[*/0x0001/*::]*/: { /* n:"BrtCellBlank", */ f:parse_BrtCellBlank }, /*::[*/0x0002/*::]*/: { /* n:"BrtCellRk", */ f:parse_BrtCellRk }, /*::[*/0x0003/*::]*/: { /* n:"BrtCellError", */ f:parse_BrtCellError }, /*::[*/0x0004/*::]*/: { /* n:"BrtCellBool", */ f:parse_BrtCellBool }, /*::[*/0x0005/*::]*/: { /* n:"BrtCellReal", */ f:parse_BrtCellReal }, /*::[*/0x0006/*::]*/: { /* n:"BrtCellSt", */ f:parse_BrtCellSt }, /*::[*/0x0007/*::]*/: { /* n:"BrtCellIsst", */ f:parse_BrtCellIsst }, /*::[*/0x0008/*::]*/: { /* n:"BrtFmlaString", */ f:parse_BrtFmlaString }, /*::[*/0x0009/*::]*/: { /* n:"BrtFmlaNum", */ f:parse_BrtFmlaNum }, /*::[*/0x000A/*::]*/: { /* n:"BrtFmlaBool", */ f:parse_BrtFmlaBool }, /*::[*/0x000B/*::]*/: { /* n:"BrtFmlaError", */ f:parse_BrtFmlaError }, /*::[*/0x000C/*::]*/: { /* n:"BrtShortBlank", */ f:parse_BrtShortBlank }, /*::[*/0x000D/*::]*/: { /* n:"BrtShortRk", */ f:parse_BrtShortRk }, /*::[*/0x000E/*::]*/: { /* n:"BrtShortError", */ f:parse_BrtShortError }, /*::[*/0x000F/*::]*/: { /* n:"BrtShortBool", */ f:parse_BrtShortBool }, /*::[*/0x0010/*::]*/: { /* n:"BrtShortReal", */ f:parse_BrtShortReal }, /*::[*/0x0011/*::]*/: { /* n:"BrtShortSt", */ f:parse_BrtShortSt }, /*::[*/0x0012/*::]*/: { /* n:"BrtShortIsst", */ f:parse_BrtShortIsst }, /*::[*/0x0013/*::]*/: { /* n:"BrtSSTItem", */ f:parse_RichStr }, /*::[*/0x0014/*::]*/: { /* n:"BrtPCDIMissing" */ }, /*::[*/0x0015/*::]*/: { /* n:"BrtPCDINumber" */ }, /*::[*/0x0016/*::]*/: { /* n:"BrtPCDIBoolean" */ }, /*::[*/0x0017/*::]*/: { /* n:"BrtPCDIError" */ }, /*::[*/0x0018/*::]*/: { /* n:"BrtPCDIString" */ }, /*::[*/0x0019/*::]*/: { /* n:"BrtPCDIDatetime" */ }, /*::[*/0x001A/*::]*/: { /* n:"BrtPCDIIndex" */ }, /*::[*/0x001B/*::]*/: { /* n:"BrtPCDIAMissing" */ }, /*::[*/0x001C/*::]*/: { /* n:"BrtPCDIANumber" */ }, /*::[*/0x001D/*::]*/: { /* n:"BrtPCDIABoolean" */ }, /*::[*/0x001E/*::]*/: { /* n:"BrtPCDIAError" */ }, /*::[*/0x001F/*::]*/: { /* n:"BrtPCDIAString" */ }, /*::[*/0x0020/*::]*/: { /* n:"BrtPCDIADatetime" */ }, /*::[*/0x0021/*::]*/: { /* n:"BrtPCRRecord" */ }, /*::[*/0x0022/*::]*/: { /* n:"BrtPCRRecordDt" */ }, /*::[*/0x0023/*::]*/: { /* n:"BrtFRTBegin", */ T:1 }, /*::[*/0x0024/*::]*/: { /* n:"BrtFRTEnd", */ T:-1 }, /*::[*/0x0025/*::]*/: { /* n:"BrtACBegin", */ T:1 }, /*::[*/0x0026/*::]*/: { /* n:"BrtACEnd", */ T:-1 }, /*::[*/0x0027/*::]*/: { /* n:"BrtName", */ f:parse_BrtName }, /*::[*/0x0028/*::]*/: { /* n:"BrtIndexRowBlock" */ }, /*::[*/0x002A/*::]*/: { /* n:"BrtIndexBlock" */ }, /*::[*/0x002B/*::]*/: { /* n:"BrtFont", */ f:parse_BrtFont }, /*::[*/0x002C/*::]*/: { /* n:"BrtFmt", */ f:parse_BrtFmt }, /*::[*/0x002D/*::]*/: { /* n:"BrtFill", */ f:parse_BrtFill }, /*::[*/0x002E/*::]*/: { /* n:"BrtBorder", */ f:parse_BrtBorder }, /*::[*/0x002F/*::]*/: { /* n:"BrtXF", */ f:parse_BrtXF }, /*::[*/0x0030/*::]*/: { /* n:"BrtStyle" */ }, /*::[*/0x0031/*::]*/: { /* n:"BrtCellMeta", */ f:parse_Int32LE }, /*::[*/0x0032/*::]*/: { /* n:"BrtValueMeta" */ }, /*::[*/0x0033/*::]*/: { /* n:"BrtMdb" */ f:parse_BrtMdb }, /*::[*/0x0034/*::]*/: { /* n:"BrtBeginFmd", */ T:1 }, /*::[*/0x0035/*::]*/: { /* n:"BrtEndFmd", */ T:-1 }, /*::[*/0x0036/*::]*/: { /* n:"BrtBeginMdx", */ T:1 }, /*::[*/0x0037/*::]*/: { /* n:"BrtEndMdx", */ T:-1 }, /*::[*/0x0038/*::]*/: { /* n:"BrtBeginMdxTuple", */ T:1 }, /*::[*/0x0039/*::]*/: { /* n:"BrtEndMdxTuple", */ T:-1 }, /*::[*/0x003A/*::]*/: { /* n:"BrtMdxMbrIstr" */ }, /*::[*/0x003B/*::]*/: { /* n:"BrtStr" */ }, /*::[*/0x003C/*::]*/: { /* n:"BrtColInfo", */ f:parse_ColInfo }, /*::[*/0x003E/*::]*/: { /* n:"BrtCellRString", */ f:parse_BrtCellRString }, /*::[*/0x003F/*::]*/: { /* n:"BrtCalcChainItem$", */ f:parse_BrtCalcChainItem$ }, /*::[*/0x0040/*::]*/: { /* n:"BrtDVal", */ f:parse_BrtDVal }, /*::[*/0x0041/*::]*/: { /* n:"BrtSxvcellNum" */ }, /*::[*/0x0042/*::]*/: { /* n:"BrtSxvcellStr" */ }, /*::[*/0x0043/*::]*/: { /* n:"BrtSxvcellBool" */ }, /*::[*/0x0044/*::]*/: { /* n:"BrtSxvcellErr" */ }, /*::[*/0x0045/*::]*/: { /* n:"BrtSxvcellDate" */ }, /*::[*/0x0046/*::]*/: { /* n:"BrtSxvcellNil" */ }, /*::[*/0x0080/*::]*/: { /* n:"BrtFileVersion" */ }, /*::[*/0x0081/*::]*/: { /* n:"BrtBeginSheet", */ T:1 }, /*::[*/0x0082/*::]*/: { /* n:"BrtEndSheet", */ T:-1 }, /*::[*/0x0083/*::]*/: { /* n:"BrtBeginBook", */ T:1, f:parsenoop, p:0 }, /*::[*/0x0084/*::]*/: { /* n:"BrtEndBook", */ T:-1 }, /*::[*/0x0085/*::]*/: { /* n:"BrtBeginWsViews", */ T:1 }, /*::[*/0x0086/*::]*/: { /* n:"BrtEndWsViews", */ T:-1 }, /*::[*/0x0087/*::]*/: { /* n:"BrtBeginBookViews", */ T:1 }, /*::[*/0x0088/*::]*/: { /* n:"BrtEndBookViews", */ T:-1 }, /*::[*/0x0089/*::]*/: { /* n:"BrtBeginWsView", */ T:1, f:parse_BrtBeginWsView }, /*::[*/0x008A/*::]*/: { /* n:"BrtEndWsView", */ T:-1 }, /*::[*/0x008B/*::]*/: { /* n:"BrtBeginCsViews", */ T:1 }, /*::[*/0x008C/*::]*/: { /* n:"BrtEndCsViews", */ T:-1 }, /*::[*/0x008D/*::]*/: { /* n:"BrtBeginCsView", */ T:1 }, /*::[*/0x008E/*::]*/: { /* n:"BrtEndCsView", */ T:-1 }, /*::[*/0x008F/*::]*/: { /* n:"BrtBeginBundleShs", */ T:1 }, /*::[*/0x0090/*::]*/: { /* n:"BrtEndBundleShs", */ T:-1 }, /*::[*/0x0091/*::]*/: { /* n:"BrtBeginSheetData", */ T:1 }, /*::[*/0x0092/*::]*/: { /* n:"BrtEndSheetData", */ T:-1 }, /*::[*/0x0093/*::]*/: { /* n:"BrtWsProp", */ f:parse_BrtWsProp }, /*::[*/0x0094/*::]*/: { /* n:"BrtWsDim", */ f:parse_BrtWsDim, p:16 }, /*::[*/0x0097/*::]*/: { /* n:"BrtPane", */ f:parse_BrtPane }, /*::[*/0x0098/*::]*/: { /* n:"BrtSel" */ }, /*::[*/0x0099/*::]*/: { /* n:"BrtWbProp", */ f:parse_BrtWbProp }, /*::[*/0x009A/*::]*/: { /* n:"BrtWbFactoid" */ }, /*::[*/0x009B/*::]*/: { /* n:"BrtFileRecover" */ }, /*::[*/0x009C/*::]*/: { /* n:"BrtBundleSh", */ f:parse_BrtBundleSh }, /*::[*/0x009D/*::]*/: { /* n:"BrtCalcProp" */ }, /*::[*/0x009E/*::]*/: { /* n:"BrtBookView" */ }, /*::[*/0x009F/*::]*/: { /* n:"BrtBeginSst", */ T:1, f:parse_BrtBeginSst }, /*::[*/0x00A0/*::]*/: { /* n:"BrtEndSst", */ T:-1 }, /*::[*/0x00A1/*::]*/: { /* n:"BrtBeginAFilter", */ T:1, f:parse_UncheckedRfX }, /*::[*/0x00A2/*::]*/: { /* n:"BrtEndAFilter", */ T:-1 }, /*::[*/0x00A3/*::]*/: { /* n:"BrtBeginFilterColumn", */ T:1 }, /*::[*/0x00A4/*::]*/: { /* n:"BrtEndFilterColumn", */ T:-1 }, /*::[*/0x00A5/*::]*/: { /* n:"BrtBeginFilters", */ T:1 }, /*::[*/0x00A6/*::]*/: { /* n:"BrtEndFilters", */ T:-1 }, /*::[*/0x00A7/*::]*/: { /* n:"BrtFilter" */ }, /*::[*/0x00A8/*::]*/: { /* n:"BrtColorFilter" */ }, /*::[*/0x00A9/*::]*/: { /* n:"BrtIconFilter" */ }, /*::[*/0x00AA/*::]*/: { /* n:"BrtTop10Filter" */ }, /*::[*/0x00AB/*::]*/: { /* n:"BrtDynamicFilter" */ }, /*::[*/0x00AC/*::]*/: { /* n:"BrtBeginCustomFilters", */ T:1 }, /*::[*/0x00AD/*::]*/: { /* n:"BrtEndCustomFilters", */ T:-1 }, /*::[*/0x00AE/*::]*/: { /* n:"BrtCustomFilter" */ }, /*::[*/0x00AF/*::]*/: { /* n:"BrtAFilterDateGroupItem" */ }, /*::[*/0x00B0/*::]*/: { /* n:"BrtMergeCell", */ f:parse_BrtMergeCell }, /*::[*/0x00B1/*::]*/: { /* n:"BrtBeginMergeCells", */ T:1 }, /*::[*/0x00B2/*::]*/: { /* n:"BrtEndMergeCells", */ T:-1 }, /*::[*/0x00B3/*::]*/: { /* n:"BrtBeginPivotCacheDef", */ T:1 }, /*::[*/0x00B4/*::]*/: { /* n:"BrtEndPivotCacheDef", */ T:-1 }, /*::[*/0x00B5/*::]*/: { /* n:"BrtBeginPCDFields", */ T:1 }, /*::[*/0x00B6/*::]*/: { /* n:"BrtEndPCDFields", */ T:-1 }, /*::[*/0x00B7/*::]*/: { /* n:"BrtBeginPCDField", */ T:1 }, /*::[*/0x00B8/*::]*/: { /* n:"BrtEndPCDField", */ T:-1 }, /*::[*/0x00B9/*::]*/: { /* n:"BrtBeginPCDSource", */ T:1 }, /*::[*/0x00BA/*::]*/: { /* n:"BrtEndPCDSource", */ T:-1 }, /*::[*/0x00BB/*::]*/: { /* n:"BrtBeginPCDSRange", */ T:1 }, /*::[*/0x00BC/*::]*/: { /* n:"BrtEndPCDSRange", */ T:-1 }, /*::[*/0x00BD/*::]*/: { /* n:"BrtBeginPCDFAtbl", */ T:1 }, /*::[*/0x00BE/*::]*/: { /* n:"BrtEndPCDFAtbl", */ T:-1 }, /*::[*/0x00BF/*::]*/: { /* n:"BrtBeginPCDIRun", */ T:1 }, /*::[*/0x00C0/*::]*/: { /* n:"BrtEndPCDIRun", */ T:-1 }, /*::[*/0x00C1/*::]*/: { /* n:"BrtBeginPivotCacheRecords", */ T:1 }, /*::[*/0x00C2/*::]*/: { /* n:"BrtEndPivotCacheRecords", */ T:-1 }, /*::[*/0x00C3/*::]*/: { /* n:"BrtBeginPCDHierarchies", */ T:1 }, /*::[*/0x00C4/*::]*/: { /* n:"BrtEndPCDHierarchies", */ T:-1 }, /*::[*/0x00C5/*::]*/: { /* n:"BrtBeginPCDHierarchy", */ T:1 }, /*::[*/0x00C6/*::]*/: { /* n:"BrtEndPCDHierarchy", */ T:-1 }, /*::[*/0x00C7/*::]*/: { /* n:"BrtBeginPCDHFieldsUsage", */ T:1 }, /*::[*/0x00C8/*::]*/: { /* n:"BrtEndPCDHFieldsUsage", */ T:-1 }, /*::[*/0x00C9/*::]*/: { /* n:"BrtBeginExtConnection", */ T:1 }, /*::[*/0x00CA/*::]*/: { /* n:"BrtEndExtConnection", */ T:-1 }, /*::[*/0x00CB/*::]*/: { /* n:"BrtBeginECDbProps", */ T:1 }, /*::[*/0x00CC/*::]*/: { /* n:"BrtEndECDbProps", */ T:-1 }, /*::[*/0x00CD/*::]*/: { /* n:"BrtBeginECOlapProps", */ T:1 }, /*::[*/0x00CE/*::]*/: { /* n:"BrtEndECOlapProps", */ T:-1 }, /*::[*/0x00CF/*::]*/: { /* n:"BrtBeginPCDSConsol", */ T:1 }, /*::[*/0x00D0/*::]*/: { /* n:"BrtEndPCDSConsol", */ T:-1 }, /*::[*/0x00D1/*::]*/: { /* n:"BrtBeginPCDSCPages", */ T:1 }, /*::[*/0x00D2/*::]*/: { /* n:"BrtEndPCDSCPages", */ T:-1 }, /*::[*/0x00D3/*::]*/: { /* n:"BrtBeginPCDSCPage", */ T:1 }, /*::[*/0x00D4/*::]*/: { /* n:"BrtEndPCDSCPage", */ T:-1 }, /*::[*/0x00D5/*::]*/: { /* n:"BrtBeginPCDSCPItem", */ T:1 }, /*::[*/0x00D6/*::]*/: { /* n:"BrtEndPCDSCPItem", */ T:-1 }, /*::[*/0x00D7/*::]*/: { /* n:"BrtBeginPCDSCSets", */ T:1 }, /*::[*/0x00D8/*::]*/: { /* n:"BrtEndPCDSCSets", */ T:-1 }, /*::[*/0x00D9/*::]*/: { /* n:"BrtBeginPCDSCSet", */ T:1 }, /*::[*/0x00DA/*::]*/: { /* n:"BrtEndPCDSCSet", */ T:-1 }, /*::[*/0x00DB/*::]*/: { /* n:"BrtBeginPCDFGroup", */ T:1 }, /*::[*/0x00DC/*::]*/: { /* n:"BrtEndPCDFGroup", */ T:-1 }, /*::[*/0x00DD/*::]*/: { /* n:"BrtBeginPCDFGItems", */ T:1 }, /*::[*/0x00DE/*::]*/: { /* n:"BrtEndPCDFGItems", */ T:-1 }, /*::[*/0x00DF/*::]*/: { /* n:"BrtBeginPCDFGRange", */ T:1 }, /*::[*/0x00E0/*::]*/: { /* n:"BrtEndPCDFGRange", */ T:-1 }, /*::[*/0x00E1/*::]*/: { /* n:"BrtBeginPCDFGDiscrete", */ T:1 }, /*::[*/0x00E2/*::]*/: { /* n:"BrtEndPCDFGDiscrete", */ T:-1 }, /*::[*/0x00E3/*::]*/: { /* n:"BrtBeginPCDSDTupleCache", */ T:1 }, /*::[*/0x00E4/*::]*/: { /* n:"BrtEndPCDSDTupleCache", */ T:-1 }, /*::[*/0x00E5/*::]*/: { /* n:"BrtBeginPCDSDTCEntries", */ T:1 }, /*::[*/0x00E6/*::]*/: { /* n:"BrtEndPCDSDTCEntries", */ T:-1 }, /*::[*/0x00E7/*::]*/: { /* n:"BrtBeginPCDSDTCEMembers", */ T:1 }, /*::[*/0x00E8/*::]*/: { /* n:"BrtEndPCDSDTCEMembers", */ T:-1 }, /*::[*/0x00E9/*::]*/: { /* n:"BrtBeginPCDSDTCEMember", */ T:1 }, /*::[*/0x00EA/*::]*/: { /* n:"BrtEndPCDSDTCEMember", */ T:-1 }, /*::[*/0x00EB/*::]*/: { /* n:"BrtBeginPCDSDTCQueries", */ T:1 }, /*::[*/0x00EC/*::]*/: { /* n:"BrtEndPCDSDTCQueries", */ T:-1 }, /*::[*/0x00ED/*::]*/: { /* n:"BrtBeginPCDSDTCQuery", */ T:1 }, /*::[*/0x00EE/*::]*/: { /* n:"BrtEndPCDSDTCQuery", */ T:-1 }, /*::[*/0x00EF/*::]*/: { /* n:"BrtBeginPCDSDTCSets", */ T:1 }, /*::[*/0x00F0/*::]*/: { /* n:"BrtEndPCDSDTCSets", */ T:-1 }, /*::[*/0x00F1/*::]*/: { /* n:"BrtBeginPCDSDTCSet", */ T:1 }, /*::[*/0x00F2/*::]*/: { /* n:"BrtEndPCDSDTCSet", */ T:-1 }, /*::[*/0x00F3/*::]*/: { /* n:"BrtBeginPCDCalcItems", */ T:1 }, /*::[*/0x00F4/*::]*/: { /* n:"BrtEndPCDCalcItems", */ T:-1 }, /*::[*/0x00F5/*::]*/: { /* n:"BrtBeginPCDCalcItem", */ T:1 }, /*::[*/0x00F6/*::]*/: { /* n:"BrtEndPCDCalcItem", */ T:-1 }, /*::[*/0x00F7/*::]*/: { /* n:"BrtBeginPRule", */ T:1 }, /*::[*/0x00F8/*::]*/: { /* n:"BrtEndPRule", */ T:-1 }, /*::[*/0x00F9/*::]*/: { /* n:"BrtBeginPRFilters", */ T:1 }, /*::[*/0x00FA/*::]*/: { /* n:"BrtEndPRFilters", */ T:-1 }, /*::[*/0x00FB/*::]*/: { /* n:"BrtBeginPRFilter", */ T:1 }, /*::[*/0x00FC/*::]*/: { /* n:"BrtEndPRFilter", */ T:-1 }, /*::[*/0x00FD/*::]*/: { /* n:"BrtBeginPNames", */ T:1 }, /*::[*/0x00FE/*::]*/: { /* n:"BrtEndPNames", */ T:-1 }, /*::[*/0x00FF/*::]*/: { /* n:"BrtBeginPName", */ T:1 }, /*::[*/0x0100/*::]*/: { /* n:"BrtEndPName", */ T:-1 }, /*::[*/0x0101/*::]*/: { /* n:"BrtBeginPNPairs", */ T:1 }, /*::[*/0x0102/*::]*/: { /* n:"BrtEndPNPairs", */ T:-1 }, /*::[*/0x0103/*::]*/: { /* n:"BrtBeginPNPair", */ T:1 }, /*::[*/0x0104/*::]*/: { /* n:"BrtEndPNPair", */ T:-1 }, /*::[*/0x0105/*::]*/: { /* n:"BrtBeginECWebProps", */ T:1 }, /*::[*/0x0106/*::]*/: { /* n:"BrtEndECWebProps", */ T:-1 }, /*::[*/0x0107/*::]*/: { /* n:"BrtBeginEcWpTables", */ T:1 }, /*::[*/0x0108/*::]*/: { /* n:"BrtEndECWPTables", */ T:-1 }, /*::[*/0x0109/*::]*/: { /* n:"BrtBeginECParams", */ T:1 }, /*::[*/0x010A/*::]*/: { /* n:"BrtEndECParams", */ T:-1 }, /*::[*/0x010B/*::]*/: { /* n:"BrtBeginECParam", */ T:1 }, /*::[*/0x010C/*::]*/: { /* n:"BrtEndECParam", */ T:-1 }, /*::[*/0x010D/*::]*/: { /* n:"BrtBeginPCDKPIs", */ T:1 }, /*::[*/0x010E/*::]*/: { /* n:"BrtEndPCDKPIs", */ T:-1 }, /*::[*/0x010F/*::]*/: { /* n:"BrtBeginPCDKPI", */ T:1 }, /*::[*/0x0110/*::]*/: { /* n:"BrtEndPCDKPI", */ T:-1 }, /*::[*/0x0111/*::]*/: { /* n:"BrtBeginDims", */ T:1 }, /*::[*/0x0112/*::]*/: { /* n:"BrtEndDims", */ T:-1 }, /*::[*/0x0113/*::]*/: { /* n:"BrtBeginDim", */ T:1 }, /*::[*/0x0114/*::]*/: { /* n:"BrtEndDim", */ T:-1 }, /*::[*/0x0115/*::]*/: { /* n:"BrtIndexPartEnd" */ }, /*::[*/0x0116/*::]*/: { /* n:"BrtBeginStyleSheet", */ T:1 }, /*::[*/0x0117/*::]*/: { /* n:"BrtEndStyleSheet", */ T:-1 }, /*::[*/0x0118/*::]*/: { /* n:"BrtBeginSXView", */ T:1 }, /*::[*/0x0119/*::]*/: { /* n:"BrtEndSXVI", */ T:-1 }, /*::[*/0x011A/*::]*/: { /* n:"BrtBeginSXVI", */ T:1 }, /*::[*/0x011B/*::]*/: { /* n:"BrtBeginSXVIs", */ T:1 }, /*::[*/0x011C/*::]*/: { /* n:"BrtEndSXVIs", */ T:-1 }, /*::[*/0x011D/*::]*/: { /* n:"BrtBeginSXVD", */ T:1 }, /*::[*/0x011E/*::]*/: { /* n:"BrtEndSXVD", */ T:-1 }, /*::[*/0x011F/*::]*/: { /* n:"BrtBeginSXVDs", */ T:1 }, /*::[*/0x0120/*::]*/: { /* n:"BrtEndSXVDs", */ T:-1 }, /*::[*/0x0121/*::]*/: { /* n:"BrtBeginSXPI", */ T:1 }, /*::[*/0x0122/*::]*/: { /* n:"BrtEndSXPI", */ T:-1 }, /*::[*/0x0123/*::]*/: { /* n:"BrtBeginSXPIs", */ T:1 }, /*::[*/0x0124/*::]*/: { /* n:"BrtEndSXPIs", */ T:-1 }, /*::[*/0x0125/*::]*/: { /* n:"BrtBeginSXDI", */ T:1 }, /*::[*/0x0126/*::]*/: { /* n:"BrtEndSXDI", */ T:-1 }, /*::[*/0x0127/*::]*/: { /* n:"BrtBeginSXDIs", */ T:1 }, /*::[*/0x0128/*::]*/: { /* n:"BrtEndSXDIs", */ T:-1 }, /*::[*/0x0129/*::]*/: { /* n:"BrtBeginSXLI", */ T:1 }, /*::[*/0x012A/*::]*/: { /* n:"BrtEndSXLI", */ T:-1 }, /*::[*/0x012B/*::]*/: { /* n:"BrtBeginSXLIRws", */ T:1 }, /*::[*/0x012C/*::]*/: { /* n:"BrtEndSXLIRws", */ T:-1 }, /*::[*/0x012D/*::]*/: { /* n:"BrtBeginSXLICols", */ T:1 }, /*::[*/0x012E/*::]*/: { /* n:"BrtEndSXLICols", */ T:-1 }, /*::[*/0x012F/*::]*/: { /* n:"BrtBeginSXFormat", */ T:1 }, /*::[*/0x0130/*::]*/: { /* n:"BrtEndSXFormat", */ T:-1 }, /*::[*/0x0131/*::]*/: { /* n:"BrtBeginSXFormats", */ T:1 }, /*::[*/0x0132/*::]*/: { /* n:"BrtEndSxFormats", */ T:-1 }, /*::[*/0x0133/*::]*/: { /* n:"BrtBeginSxSelect", */ T:1 }, /*::[*/0x0134/*::]*/: { /* n:"BrtEndSxSelect", */ T:-1 }, /*::[*/0x0135/*::]*/: { /* n:"BrtBeginISXVDRws", */ T:1 }, /*::[*/0x0136/*::]*/: { /* n:"BrtEndISXVDRws", */ T:-1 }, /*::[*/0x0137/*::]*/: { /* n:"BrtBeginISXVDCols", */ T:1 }, /*::[*/0x0138/*::]*/: { /* n:"BrtEndISXVDCols", */ T:-1 }, /*::[*/0x0139/*::]*/: { /* n:"BrtEndSXLocation", */ T:-1 }, /*::[*/0x013A/*::]*/: { /* n:"BrtBeginSXLocation", */ T:1 }, /*::[*/0x013B/*::]*/: { /* n:"BrtEndSXView", */ T:-1 }, /*::[*/0x013C/*::]*/: { /* n:"BrtBeginSXTHs", */ T:1 }, /*::[*/0x013D/*::]*/: { /* n:"BrtEndSXTHs", */ T:-1 }, /*::[*/0x013E/*::]*/: { /* n:"BrtBeginSXTH", */ T:1 }, /*::[*/0x013F/*::]*/: { /* n:"BrtEndSXTH", */ T:-1 }, /*::[*/0x0140/*::]*/: { /* n:"BrtBeginISXTHRws", */ T:1 }, /*::[*/0x0141/*::]*/: { /* n:"BrtEndISXTHRws", */ T:-1 }, /*::[*/0x0142/*::]*/: { /* n:"BrtBeginISXTHCols", */ T:1 }, /*::[*/0x0143/*::]*/: { /* n:"BrtEndISXTHCols", */ T:-1 }, /*::[*/0x0144/*::]*/: { /* n:"BrtBeginSXTDMPS", */ T:1 }, /*::[*/0x0145/*::]*/: { /* n:"BrtEndSXTDMPs", */ T:-1 }, /*::[*/0x0146/*::]*/: { /* n:"BrtBeginSXTDMP", */ T:1 }, /*::[*/0x0147/*::]*/: { /* n:"BrtEndSXTDMP", */ T:-1 }, /*::[*/0x0148/*::]*/: { /* n:"BrtBeginSXTHItems", */ T:1 }, /*::[*/0x0149/*::]*/: { /* n:"BrtEndSXTHItems", */ T:-1 }, /*::[*/0x014A/*::]*/: { /* n:"BrtBeginSXTHItem", */ T:1 }, /*::[*/0x014B/*::]*/: { /* n:"BrtEndSXTHItem", */ T:-1 }, /*::[*/0x014C/*::]*/: { /* n:"BrtBeginMetadata", */ T:1 }, /*::[*/0x014D/*::]*/: { /* n:"BrtEndMetadata", */ T:-1 }, /*::[*/0x014E/*::]*/: { /* n:"BrtBeginEsmdtinfo", */ T:1 }, /*::[*/0x014F/*::]*/: { /* n:"BrtMdtinfo", */ f:parse_BrtMdtinfo }, /*::[*/0x0150/*::]*/: { /* n:"BrtEndEsmdtinfo", */ T:-1 }, /*::[*/0x0151/*::]*/: { /* n:"BrtBeginEsmdb", */ f:parse_BrtBeginEsmdb, T:1 }, /*::[*/0x0152/*::]*/: { /* n:"BrtEndEsmdb", */ T:-1 }, /*::[*/0x0153/*::]*/: { /* n:"BrtBeginEsfmd", */ T:1 }, /*::[*/0x0154/*::]*/: { /* n:"BrtEndEsfmd", */ T:-1 }, /*::[*/0x0155/*::]*/: { /* n:"BrtBeginSingleCells", */ T:1 }, /*::[*/0x0156/*::]*/: { /* n:"BrtEndSingleCells", */ T:-1 }, /*::[*/0x0157/*::]*/: { /* n:"BrtBeginList", */ T:1 }, /*::[*/0x0158/*::]*/: { /* n:"BrtEndList", */ T:-1 }, /*::[*/0x0159/*::]*/: { /* n:"BrtBeginListCols", */ T:1 }, /*::[*/0x015A/*::]*/: { /* n:"BrtEndListCols", */ T:-1 }, /*::[*/0x015B/*::]*/: { /* n:"BrtBeginListCol", */ T:1 }, /*::[*/0x015C/*::]*/: { /* n:"BrtEndListCol", */ T:-1 }, /*::[*/0x015D/*::]*/: { /* n:"BrtBeginListXmlCPr", */ T:1 }, /*::[*/0x015E/*::]*/: { /* n:"BrtEndListXmlCPr", */ T:-1 }, /*::[*/0x015F/*::]*/: { /* n:"BrtListCCFmla" */ }, /*::[*/0x0160/*::]*/: { /* n:"BrtListTrFmla" */ }, /*::[*/0x0161/*::]*/: { /* n:"BrtBeginExternals", */ T:1 }, /*::[*/0x0162/*::]*/: { /* n:"BrtEndExternals", */ T:-1 }, /*::[*/0x0163/*::]*/: { /* n:"BrtSupBookSrc", */ f:parse_RelID}, /*::[*/0x0165/*::]*/: { /* n:"BrtSupSelf" */ }, /*::[*/0x0166/*::]*/: { /* n:"BrtSupSame" */ }, /*::[*/0x0167/*::]*/: { /* n:"BrtSupTabs" */ }, /*::[*/0x0168/*::]*/: { /* n:"BrtBeginSupBook", */ T:1 }, /*::[*/0x0169/*::]*/: { /* n:"BrtPlaceholderName" */ }, /*::[*/0x016A/*::]*/: { /* n:"BrtExternSheet", */ f:parse_ExternSheet }, /*::[*/0x016B/*::]*/: { /* n:"BrtExternTableStart" */ }, /*::[*/0x016C/*::]*/: { /* n:"BrtExternTableEnd" */ }, /*::[*/0x016E/*::]*/: { /* n:"BrtExternRowHdr" */ }, /*::[*/0x016F/*::]*/: { /* n:"BrtExternCellBlank" */ }, /*::[*/0x0170/*::]*/: { /* n:"BrtExternCellReal" */ }, /*::[*/0x0171/*::]*/: { /* n:"BrtExternCellBool" */ }, /*::[*/0x0172/*::]*/: { /* n:"BrtExternCellError" */ }, /*::[*/0x0173/*::]*/: { /* n:"BrtExternCellString" */ }, /*::[*/0x0174/*::]*/: { /* n:"BrtBeginEsmdx", */ T:1 }, /*::[*/0x0175/*::]*/: { /* n:"BrtEndEsmdx", */ T:-1 }, /*::[*/0x0176/*::]*/: { /* n:"BrtBeginMdxSet", */ T:1 }, /*::[*/0x0177/*::]*/: { /* n:"BrtEndMdxSet", */ T:-1 }, /*::[*/0x0178/*::]*/: { /* n:"BrtBeginMdxMbrProp", */ T:1 }, /*::[*/0x0179/*::]*/: { /* n:"BrtEndMdxMbrProp", */ T:-1 }, /*::[*/0x017A/*::]*/: { /* n:"BrtBeginMdxKPI", */ T:1 }, /*::[*/0x017B/*::]*/: { /* n:"BrtEndMdxKPI", */ T:-1 }, /*::[*/0x017C/*::]*/: { /* n:"BrtBeginEsstr", */ T:1 }, /*::[*/0x017D/*::]*/: { /* n:"BrtEndEsstr", */ T:-1 }, /*::[*/0x017E/*::]*/: { /* n:"BrtBeginPRFItem", */ T:1 }, /*::[*/0x017F/*::]*/: { /* n:"BrtEndPRFItem", */ T:-1 }, /*::[*/0x0180/*::]*/: { /* n:"BrtBeginPivotCacheIDs", */ T:1 }, /*::[*/0x0181/*::]*/: { /* n:"BrtEndPivotCacheIDs", */ T:-1 }, /*::[*/0x0182/*::]*/: { /* n:"BrtBeginPivotCacheID", */ T:1 }, /*::[*/0x0183/*::]*/: { /* n:"BrtEndPivotCacheID", */ T:-1 }, /*::[*/0x0184/*::]*/: { /* n:"BrtBeginISXVIs", */ T:1 }, /*::[*/0x0185/*::]*/: { /* n:"BrtEndISXVIs", */ T:-1 }, /*::[*/0x0186/*::]*/: { /* n:"BrtBeginColInfos", */ T:1 }, /*::[*/0x0187/*::]*/: { /* n:"BrtEndColInfos", */ T:-1 }, /*::[*/0x0188/*::]*/: { /* n:"BrtBeginRwBrk", */ T:1 }, /*::[*/0x0189/*::]*/: { /* n:"BrtEndRwBrk", */ T:-1 }, /*::[*/0x018A/*::]*/: { /* n:"BrtBeginColBrk", */ T:1 }, /*::[*/0x018B/*::]*/: { /* n:"BrtEndColBrk", */ T:-1 }, /*::[*/0x018C/*::]*/: { /* n:"BrtBrk" */ }, /*::[*/0x018D/*::]*/: { /* n:"BrtUserBookView" */ }, /*::[*/0x018E/*::]*/: { /* n:"BrtInfo" */ }, /*::[*/0x018F/*::]*/: { /* n:"BrtCUsr" */ }, /*::[*/0x0190/*::]*/: { /* n:"BrtUsr" */ }, /*::[*/0x0191/*::]*/: { /* n:"BrtBeginUsers", */ T:1 }, /*::[*/0x0193/*::]*/: { /* n:"BrtEOF" */ }, /*::[*/0x0194/*::]*/: { /* n:"BrtUCR" */ }, /*::[*/0x0195/*::]*/: { /* n:"BrtRRInsDel" */ }, /*::[*/0x0196/*::]*/: { /* n:"BrtRREndInsDel" */ }, /*::[*/0x0197/*::]*/: { /* n:"BrtRRMove" */ }, /*::[*/0x0198/*::]*/: { /* n:"BrtRREndMove" */ }, /*::[*/0x0199/*::]*/: { /* n:"BrtRRChgCell" */ }, /*::[*/0x019A/*::]*/: { /* n:"BrtRREndChgCell" */ }, /*::[*/0x019B/*::]*/: { /* n:"BrtRRHeader" */ }, /*::[*/0x019C/*::]*/: { /* n:"BrtRRUserView" */ }, /*::[*/0x019D/*::]*/: { /* n:"BrtRRRenSheet" */ }, /*::[*/0x019E/*::]*/: { /* n:"BrtRRInsertSh" */ }, /*::[*/0x019F/*::]*/: { /* n:"BrtRRDefName" */ }, /*::[*/0x01A0/*::]*/: { /* n:"BrtRRNote" */ }, /*::[*/0x01A1/*::]*/: { /* n:"BrtRRConflict" */ }, /*::[*/0x01A2/*::]*/: { /* n:"BrtRRTQSIF" */ }, /*::[*/0x01A3/*::]*/: { /* n:"BrtRRFormat" */ }, /*::[*/0x01A4/*::]*/: { /* n:"BrtRREndFormat" */ }, /*::[*/0x01A5/*::]*/: { /* n:"BrtRRAutoFmt" */ }, /*::[*/0x01A6/*::]*/: { /* n:"BrtBeginUserShViews", */ T:1 }, /*::[*/0x01A7/*::]*/: { /* n:"BrtBeginUserShView", */ T:1 }, /*::[*/0x01A8/*::]*/: { /* n:"BrtEndUserShView", */ T:-1 }, /*::[*/0x01A9/*::]*/: { /* n:"BrtEndUserShViews", */ T:-1 }, /*::[*/0x01AA/*::]*/: { /* n:"BrtArrFmla", */ f:parse_BrtArrFmla }, /*::[*/0x01AB/*::]*/: { /* n:"BrtShrFmla", */ f:parse_BrtShrFmla }, /*::[*/0x01AC/*::]*/: { /* n:"BrtTable" */ }, /*::[*/0x01AD/*::]*/: { /* n:"BrtBeginExtConnections", */ T:1 }, /*::[*/0x01AE/*::]*/: { /* n:"BrtEndExtConnections", */ T:-1 }, /*::[*/0x01AF/*::]*/: { /* n:"BrtBeginPCDCalcMems", */ T:1 }, /*::[*/0x01B0/*::]*/: { /* n:"BrtEndPCDCalcMems", */ T:-1 }, /*::[*/0x01B1/*::]*/: { /* n:"BrtBeginPCDCalcMem", */ T:1 }, /*::[*/0x01B2/*::]*/: { /* n:"BrtEndPCDCalcMem", */ T:-1 }, /*::[*/0x01B3/*::]*/: { /* n:"BrtBeginPCDHGLevels", */ T:1 }, /*::[*/0x01B4/*::]*/: { /* n:"BrtEndPCDHGLevels", */ T:-1 }, /*::[*/0x01B5/*::]*/: { /* n:"BrtBeginPCDHGLevel", */ T:1 }, /*::[*/0x01B6/*::]*/: { /* n:"BrtEndPCDHGLevel", */ T:-1 }, /*::[*/0x01B7/*::]*/: { /* n:"BrtBeginPCDHGLGroups", */ T:1 }, /*::[*/0x01B8/*::]*/: { /* n:"BrtEndPCDHGLGroups", */ T:-1 }, /*::[*/0x01B9/*::]*/: { /* n:"BrtBeginPCDHGLGroup", */ T:1 }, /*::[*/0x01BA/*::]*/: { /* n:"BrtEndPCDHGLGroup", */ T:-1 }, /*::[*/0x01BB/*::]*/: { /* n:"BrtBeginPCDHGLGMembers", */ T:1 }, /*::[*/0x01BC/*::]*/: { /* n:"BrtEndPCDHGLGMembers", */ T:-1 }, /*::[*/0x01BD/*::]*/: { /* n:"BrtBeginPCDHGLGMember", */ T:1 }, /*::[*/0x01BE/*::]*/: { /* n:"BrtEndPCDHGLGMember", */ T:-1 }, /*::[*/0x01BF/*::]*/: { /* n:"BrtBeginQSI", */ T:1 }, /*::[*/0x01C0/*::]*/: { /* n:"BrtEndQSI", */ T:-1 }, /*::[*/0x01C1/*::]*/: { /* n:"BrtBeginQSIR", */ T:1 }, /*::[*/0x01C2/*::]*/: { /* n:"BrtEndQSIR", */ T:-1 }, /*::[*/0x01C3/*::]*/: { /* n:"BrtBeginDeletedNames", */ T:1 }, /*::[*/0x01C4/*::]*/: { /* n:"BrtEndDeletedNames", */ T:-1 }, /*::[*/0x01C5/*::]*/: { /* n:"BrtBeginDeletedName", */ T:1 }, /*::[*/0x01C6/*::]*/: { /* n:"BrtEndDeletedName", */ T:-1 }, /*::[*/0x01C7/*::]*/: { /* n:"BrtBeginQSIFs", */ T:1 }, /*::[*/0x01C8/*::]*/: { /* n:"BrtEndQSIFs", */ T:-1 }, /*::[*/0x01C9/*::]*/: { /* n:"BrtBeginQSIF", */ T:1 }, /*::[*/0x01CA/*::]*/: { /* n:"BrtEndQSIF", */ T:-1 }, /*::[*/0x01CB/*::]*/: { /* n:"BrtBeginAutoSortScope", */ T:1 }, /*::[*/0x01CC/*::]*/: { /* n:"BrtEndAutoSortScope", */ T:-1 }, /*::[*/0x01CD/*::]*/: { /* n:"BrtBeginConditionalFormatting", */ T:1 }, /*::[*/0x01CE/*::]*/: { /* n:"BrtEndConditionalFormatting", */ T:-1 }, /*::[*/0x01CF/*::]*/: { /* n:"BrtBeginCFRule", */ T:1 }, /*::[*/0x01D0/*::]*/: { /* n:"BrtEndCFRule", */ T:-1 }, /*::[*/0x01D1/*::]*/: { /* n:"BrtBeginIconSet", */ T:1 }, /*::[*/0x01D2/*::]*/: { /* n:"BrtEndIconSet", */ T:-1 }, /*::[*/0x01D3/*::]*/: { /* n:"BrtBeginDatabar", */ T:1 }, /*::[*/0x01D4/*::]*/: { /* n:"BrtEndDatabar", */ T:-1 }, /*::[*/0x01D5/*::]*/: { /* n:"BrtBeginColorScale", */ T:1 }, /*::[*/0x01D6/*::]*/: { /* n:"BrtEndColorScale", */ T:-1 }, /*::[*/0x01D7/*::]*/: { /* n:"BrtCFVO" */ }, /*::[*/0x01D8/*::]*/: { /* n:"BrtExternValueMeta" */ }, /*::[*/0x01D9/*::]*/: { /* n:"BrtBeginColorPalette", */ T:1 }, /*::[*/0x01DA/*::]*/: { /* n:"BrtEndColorPalette", */ T:-1 }, /*::[*/0x01DB/*::]*/: { /* n:"BrtIndexedColor" */ }, /*::[*/0x01DC/*::]*/: { /* n:"BrtMargins", */ f:parse_BrtMargins }, /*::[*/0x01DD/*::]*/: { /* n:"BrtPrintOptions" */ }, /*::[*/0x01DE/*::]*/: { /* n:"BrtPageSetup" */ }, /*::[*/0x01DF/*::]*/: { /* n:"BrtBeginHeaderFooter", */ T:1 }, /*::[*/0x01E0/*::]*/: { /* n:"BrtEndHeaderFooter", */ T:-1 }, /*::[*/0x01E1/*::]*/: { /* n:"BrtBeginSXCrtFormat", */ T:1 }, /*::[*/0x01E2/*::]*/: { /* n:"BrtEndSXCrtFormat", */ T:-1 }, /*::[*/0x01E3/*::]*/: { /* n:"BrtBeginSXCrtFormats", */ T:1 }, /*::[*/0x01E4/*::]*/: { /* n:"BrtEndSXCrtFormats", */ T:-1 }, /*::[*/0x01E5/*::]*/: { /* n:"BrtWsFmtInfo", */ f:parse_BrtWsFmtInfo }, /*::[*/0x01E6/*::]*/: { /* n:"BrtBeginMgs", */ T:1 }, /*::[*/0x01E7/*::]*/: { /* n:"BrtEndMGs", */ T:-1 }, /*::[*/0x01E8/*::]*/: { /* n:"BrtBeginMGMaps", */ T:1 }, /*::[*/0x01E9/*::]*/: { /* n:"BrtEndMGMaps", */ T:-1 }, /*::[*/0x01EA/*::]*/: { /* n:"BrtBeginMG", */ T:1 }, /*::[*/0x01EB/*::]*/: { /* n:"BrtEndMG", */ T:-1 }, /*::[*/0x01EC/*::]*/: { /* n:"BrtBeginMap", */ T:1 }, /*::[*/0x01ED/*::]*/: { /* n:"BrtEndMap", */ T:-1 }, /*::[*/0x01EE/*::]*/: { /* n:"BrtHLink", */ f:parse_BrtHLink }, /*::[*/0x01EF/*::]*/: { /* n:"BrtBeginDCon", */ T:1 }, /*::[*/0x01F0/*::]*/: { /* n:"BrtEndDCon", */ T:-1 }, /*::[*/0x01F1/*::]*/: { /* n:"BrtBeginDRefs", */ T:1 }, /*::[*/0x01F2/*::]*/: { /* n:"BrtEndDRefs", */ T:-1 }, /*::[*/0x01F3/*::]*/: { /* n:"BrtDRef" */ }, /*::[*/0x01F4/*::]*/: { /* n:"BrtBeginScenMan", */ T:1 }, /*::[*/0x01F5/*::]*/: { /* n:"BrtEndScenMan", */ T:-1 }, /*::[*/0x01F6/*::]*/: { /* n:"BrtBeginSct", */ T:1 }, /*::[*/0x01F7/*::]*/: { /* n:"BrtEndSct", */ T:-1 }, /*::[*/0x01F8/*::]*/: { /* n:"BrtSlc" */ }, /*::[*/0x01F9/*::]*/: { /* n:"BrtBeginDXFs", */ T:1 }, /*::[*/0x01FA/*::]*/: { /* n:"BrtEndDXFs", */ T:-1 }, /*::[*/0x01FB/*::]*/: { /* n:"BrtDXF" */ }, /*::[*/0x01FC/*::]*/: { /* n:"BrtBeginTableStyles", */ T:1 }, /*::[*/0x01FD/*::]*/: { /* n:"BrtEndTableStyles", */ T:-1 }, /*::[*/0x01FE/*::]*/: { /* n:"BrtBeginTableStyle", */ T:1 }, /*::[*/0x01FF/*::]*/: { /* n:"BrtEndTableStyle", */ T:-1 }, /*::[*/0x0200/*::]*/: { /* n:"BrtTableStyleElement" */ }, /*::[*/0x0201/*::]*/: { /* n:"BrtTableStyleClient" */ }, /*::[*/0x0202/*::]*/: { /* n:"BrtBeginVolDeps", */ T:1 }, /*::[*/0x0203/*::]*/: { /* n:"BrtEndVolDeps", */ T:-1 }, /*::[*/0x0204/*::]*/: { /* n:"BrtBeginVolType", */ T:1 }, /*::[*/0x0205/*::]*/: { /* n:"BrtEndVolType", */ T:-1 }, /*::[*/0x0206/*::]*/: { /* n:"BrtBeginVolMain", */ T:1 }, /*::[*/0x0207/*::]*/: { /* n:"BrtEndVolMain", */ T:-1 }, /*::[*/0x0208/*::]*/: { /* n:"BrtBeginVolTopic", */ T:1 }, /*::[*/0x0209/*::]*/: { /* n:"BrtEndVolTopic", */ T:-1 }, /*::[*/0x020A/*::]*/: { /* n:"BrtVolSubtopic" */ }, /*::[*/0x020B/*::]*/: { /* n:"BrtVolRef" */ }, /*::[*/0x020C/*::]*/: { /* n:"BrtVolNum" */ }, /*::[*/0x020D/*::]*/: { /* n:"BrtVolErr" */ }, /*::[*/0x020E/*::]*/: { /* n:"BrtVolStr" */ }, /*::[*/0x020F/*::]*/: { /* n:"BrtVolBool" */ }, /*::[*/0x0210/*::]*/: { /* n:"BrtBeginCalcChain$", */ T:1 }, /*::[*/0x0211/*::]*/: { /* n:"BrtEndCalcChain$", */ T:-1 }, /*::[*/0x0212/*::]*/: { /* n:"BrtBeginSortState", */ T:1 }, /*::[*/0x0213/*::]*/: { /* n:"BrtEndSortState", */ T:-1 }, /*::[*/0x0214/*::]*/: { /* n:"BrtBeginSortCond", */ T:1 }, /*::[*/0x0215/*::]*/: { /* n:"BrtEndSortCond", */ T:-1 }, /*::[*/0x0216/*::]*/: { /* n:"BrtBookProtection" */ }, /*::[*/0x0217/*::]*/: { /* n:"BrtSheetProtection" */ }, /*::[*/0x0218/*::]*/: { /* n:"BrtRangeProtection" */ }, /*::[*/0x0219/*::]*/: { /* n:"BrtPhoneticInfo" */ }, /*::[*/0x021A/*::]*/: { /* n:"BrtBeginECTxtWiz", */ T:1 }, /*::[*/0x021B/*::]*/: { /* n:"BrtEndECTxtWiz", */ T:-1 }, /*::[*/0x021C/*::]*/: { /* n:"BrtBeginECTWFldInfoLst", */ T:1 }, /*::[*/0x021D/*::]*/: { /* n:"BrtEndECTWFldInfoLst", */ T:-1 }, /*::[*/0x021E/*::]*/: { /* n:"BrtBeginECTwFldInfo", */ T:1 }, /*::[*/0x0224/*::]*/: { /* n:"BrtFileSharing" */ }, /*::[*/0x0225/*::]*/: { /* n:"BrtOleSize" */ }, /*::[*/0x0226/*::]*/: { /* n:"BrtDrawing", */ f:parse_RelID }, /*::[*/0x0227/*::]*/: { /* n:"BrtLegacyDrawing" */ }, /*::[*/0x0228/*::]*/: { /* n:"BrtLegacyDrawingHF" */ }, /*::[*/0x0229/*::]*/: { /* n:"BrtWebOpt" */ }, /*::[*/0x022A/*::]*/: { /* n:"BrtBeginWebPubItems", */ T:1 }, /*::[*/0x022B/*::]*/: { /* n:"BrtEndWebPubItems", */ T:-1 }, /*::[*/0x022C/*::]*/: { /* n:"BrtBeginWebPubItem", */ T:1 }, /*::[*/0x022D/*::]*/: { /* n:"BrtEndWebPubItem", */ T:-1 }, /*::[*/0x022E/*::]*/: { /* n:"BrtBeginSXCondFmt", */ T:1 }, /*::[*/0x022F/*::]*/: { /* n:"BrtEndSXCondFmt", */ T:-1 }, /*::[*/0x0230/*::]*/: { /* n:"BrtBeginSXCondFmts", */ T:1 }, /*::[*/0x0231/*::]*/: { /* n:"BrtEndSXCondFmts", */ T:-1 }, /*::[*/0x0232/*::]*/: { /* n:"BrtBkHim" */ }, /*::[*/0x0234/*::]*/: { /* n:"BrtColor" */ }, /*::[*/0x0235/*::]*/: { /* n:"BrtBeginIndexedColors", */ T:1 }, /*::[*/0x0236/*::]*/: { /* n:"BrtEndIndexedColors", */ T:-1 }, /*::[*/0x0239/*::]*/: { /* n:"BrtBeginMRUColors", */ T:1 }, /*::[*/0x023A/*::]*/: { /* n:"BrtEndMRUColors", */ T:-1 }, /*::[*/0x023C/*::]*/: { /* n:"BrtMRUColor" */ }, /*::[*/0x023D/*::]*/: { /* n:"BrtBeginDVals", */ T:1 }, /*::[*/0x023E/*::]*/: { /* n:"BrtEndDVals", */ T:-1 }, /*::[*/0x0241/*::]*/: { /* n:"BrtSupNameStart" */ }, /*::[*/0x0242/*::]*/: { /* n:"BrtSupNameValueStart" */ }, /*::[*/0x0243/*::]*/: { /* n:"BrtSupNameValueEnd" */ }, /*::[*/0x0244/*::]*/: { /* n:"BrtSupNameNum" */ }, /*::[*/0x0245/*::]*/: { /* n:"BrtSupNameErr" */ }, /*::[*/0x0246/*::]*/: { /* n:"BrtSupNameSt" */ }, /*::[*/0x0247/*::]*/: { /* n:"BrtSupNameNil" */ }, /*::[*/0x0248/*::]*/: { /* n:"BrtSupNameBool" */ }, /*::[*/0x0249/*::]*/: { /* n:"BrtSupNameFmla" */ }, /*::[*/0x024A/*::]*/: { /* n:"BrtSupNameBits" */ }, /*::[*/0x024B/*::]*/: { /* n:"BrtSupNameEnd" */ }, /*::[*/0x024C/*::]*/: { /* n:"BrtEndSupBook", */ T:-1 }, /*::[*/0x024D/*::]*/: { /* n:"BrtCellSmartTagProperty" */ }, /*::[*/0x024E/*::]*/: { /* n:"BrtBeginCellSmartTag", */ T:1 }, /*::[*/0x024F/*::]*/: { /* n:"BrtEndCellSmartTag", */ T:-1 }, /*::[*/0x0250/*::]*/: { /* n:"BrtBeginCellSmartTags", */ T:1 }, /*::[*/0x0251/*::]*/: { /* n:"BrtEndCellSmartTags", */ T:-1 }, /*::[*/0x0252/*::]*/: { /* n:"BrtBeginSmartTags", */ T:1 }, /*::[*/0x0253/*::]*/: { /* n:"BrtEndSmartTags", */ T:-1 }, /*::[*/0x0254/*::]*/: { /* n:"BrtSmartTagType" */ }, /*::[*/0x0255/*::]*/: { /* n:"BrtBeginSmartTagTypes", */ T:1 }, /*::[*/0x0256/*::]*/: { /* n:"BrtEndSmartTagTypes", */ T:-1 }, /*::[*/0x0257/*::]*/: { /* n:"BrtBeginSXFilters", */ T:1 }, /*::[*/0x0258/*::]*/: { /* n:"BrtEndSXFilters", */ T:-1 }, /*::[*/0x0259/*::]*/: { /* n:"BrtBeginSXFILTER", */ T:1 }, /*::[*/0x025A/*::]*/: { /* n:"BrtEndSXFilter", */ T:-1 }, /*::[*/0x025B/*::]*/: { /* n:"BrtBeginFills", */ T:1 }, /*::[*/0x025C/*::]*/: { /* n:"BrtEndFills", */ T:-1 }, /*::[*/0x025D/*::]*/: { /* n:"BrtBeginCellWatches", */ T:1 }, /*::[*/0x025E/*::]*/: { /* n:"BrtEndCellWatches", */ T:-1 }, /*::[*/0x025F/*::]*/: { /* n:"BrtCellWatch" */ }, /*::[*/0x0260/*::]*/: { /* n:"BrtBeginCRErrs", */ T:1 }, /*::[*/0x0261/*::]*/: { /* n:"BrtEndCRErrs", */ T:-1 }, /*::[*/0x0262/*::]*/: { /* n:"BrtCrashRecErr" */ }, /*::[*/0x0263/*::]*/: { /* n:"BrtBeginFonts", */ T:1 }, /*::[*/0x0264/*::]*/: { /* n:"BrtEndFonts", */ T:-1 }, /*::[*/0x0265/*::]*/: { /* n:"BrtBeginBorders", */ T:1 }, /*::[*/0x0266/*::]*/: { /* n:"BrtEndBorders", */ T:-1 }, /*::[*/0x0267/*::]*/: { /* n:"BrtBeginFmts", */ T:1 }, /*::[*/0x0268/*::]*/: { /* n:"BrtEndFmts", */ T:-1 }, /*::[*/0x0269/*::]*/: { /* n:"BrtBeginCellXFs", */ T:1 }, /*::[*/0x026A/*::]*/: { /* n:"BrtEndCellXFs", */ T:-1 }, /*::[*/0x026B/*::]*/: { /* n:"BrtBeginStyles", */ T:1 }, /*::[*/0x026C/*::]*/: { /* n:"BrtEndStyles", */ T:-1 }, /*::[*/0x0271/*::]*/: { /* n:"BrtBigName" */ }, /*::[*/0x0272/*::]*/: { /* n:"BrtBeginCellStyleXFs", */ T:1 }, /*::[*/0x0273/*::]*/: { /* n:"BrtEndCellStyleXFs", */ T:-1 }, /*::[*/0x0274/*::]*/: { /* n:"BrtBeginComments", */ T:1 }, /*::[*/0x0275/*::]*/: { /* n:"BrtEndComments", */ T:-1 }, /*::[*/0x0276/*::]*/: { /* n:"BrtBeginCommentAuthors", */ T:1 }, /*::[*/0x0277/*::]*/: { /* n:"BrtEndCommentAuthors", */ T:-1 }, /*::[*/0x0278/*::]*/: { /* n:"BrtCommentAuthor", */ f:parse_BrtCommentAuthor }, /*::[*/0x0279/*::]*/: { /* n:"BrtBeginCommentList", */ T:1 }, /*::[*/0x027A/*::]*/: { /* n:"BrtEndCommentList", */ T:-1 }, /*::[*/0x027B/*::]*/: { /* n:"BrtBeginComment", */ T:1, f:parse_BrtBeginComment}, /*::[*/0x027C/*::]*/: { /* n:"BrtEndComment", */ T:-1 }, /*::[*/0x027D/*::]*/: { /* n:"BrtCommentText", */ f:parse_BrtCommentText }, /*::[*/0x027E/*::]*/: { /* n:"BrtBeginOleObjects", */ T:1 }, /*::[*/0x027F/*::]*/: { /* n:"BrtOleObject" */ }, /*::[*/0x0280/*::]*/: { /* n:"BrtEndOleObjects", */ T:-1 }, /*::[*/0x0281/*::]*/: { /* n:"BrtBeginSxrules", */ T:1 }, /*::[*/0x0282/*::]*/: { /* n:"BrtEndSxRules", */ T:-1 }, /*::[*/0x0283/*::]*/: { /* n:"BrtBeginActiveXControls", */ T:1 }, /*::[*/0x0284/*::]*/: { /* n:"BrtActiveX" */ }, /*::[*/0x0285/*::]*/: { /* n:"BrtEndActiveXControls", */ T:-1 }, /*::[*/0x0286/*::]*/: { /* n:"BrtBeginPCDSDTCEMembersSortBy", */ T:1 }, /*::[*/0x0288/*::]*/: { /* n:"BrtBeginCellIgnoreECs", */ T:1 }, /*::[*/0x0289/*::]*/: { /* n:"BrtCellIgnoreEC" */ }, /*::[*/0x028A/*::]*/: { /* n:"BrtEndCellIgnoreECs", */ T:-1 }, /*::[*/0x028B/*::]*/: { /* n:"BrtCsProp", */ f:parse_BrtCsProp }, /*::[*/0x028C/*::]*/: { /* n:"BrtCsPageSetup" */ }, /*::[*/0x028D/*::]*/: { /* n:"BrtBeginUserCsViews", */ T:1 }, /*::[*/0x028E/*::]*/: { /* n:"BrtEndUserCsViews", */ T:-1 }, /*::[*/0x028F/*::]*/: { /* n:"BrtBeginUserCsView", */ T:1 }, /*::[*/0x0290/*::]*/: { /* n:"BrtEndUserCsView", */ T:-1 }, /*::[*/0x0291/*::]*/: { /* n:"BrtBeginPcdSFCIEntries", */ T:1 }, /*::[*/0x0292/*::]*/: { /* n:"BrtEndPCDSFCIEntries", */ T:-1 }, /*::[*/0x0293/*::]*/: { /* n:"BrtPCDSFCIEntry" */ }, /*::[*/0x0294/*::]*/: { /* n:"BrtBeginListParts", */ T:1 }, /*::[*/0x0295/*::]*/: { /* n:"BrtListPart" */ }, /*::[*/0x0296/*::]*/: { /* n:"BrtEndListParts", */ T:-1 }, /*::[*/0x0297/*::]*/: { /* n:"BrtSheetCalcProp" */ }, /*::[*/0x0298/*::]*/: { /* n:"BrtBeginFnGroup", */ T:1 }, /*::[*/0x0299/*::]*/: { /* n:"BrtFnGroup" */ }, /*::[*/0x029A/*::]*/: { /* n:"BrtEndFnGroup", */ T:-1 }, /*::[*/0x029B/*::]*/: { /* n:"BrtSupAddin" */ }, /*::[*/0x029C/*::]*/: { /* n:"BrtSXTDMPOrder" */ }, /*::[*/0x029D/*::]*/: { /* n:"BrtCsProtection" */ }, /*::[*/0x029F/*::]*/: { /* n:"BrtBeginWsSortMap", */ T:1 }, /*::[*/0x02A0/*::]*/: { /* n:"BrtEndWsSortMap", */ T:-1 }, /*::[*/0x02A1/*::]*/: { /* n:"BrtBeginRRSort", */ T:1 }, /*::[*/0x02A2/*::]*/: { /* n:"BrtEndRRSort", */ T:-1 }, /*::[*/0x02A3/*::]*/: { /* n:"BrtRRSortItem" */ }, /*::[*/0x02A4/*::]*/: { /* n:"BrtFileSharingIso" */ }, /*::[*/0x02A5/*::]*/: { /* n:"BrtBookProtectionIso" */ }, /*::[*/0x02A6/*::]*/: { /* n:"BrtSheetProtectionIso" */ }, /*::[*/0x02A7/*::]*/: { /* n:"BrtCsProtectionIso" */ }, /*::[*/0x02A8/*::]*/: { /* n:"BrtRangeProtectionIso" */ }, /*::[*/0x02A9/*::]*/: { /* n:"BrtDValList" */ }, /*::[*/0x0400/*::]*/: { /* n:"BrtRwDescent" */ }, /*::[*/0x0401/*::]*/: { /* n:"BrtKnownFonts" */ }, /*::[*/0x0402/*::]*/: { /* n:"BrtBeginSXTupleSet", */ T:1 }, /*::[*/0x0403/*::]*/: { /* n:"BrtEndSXTupleSet", */ T:-1 }, /*::[*/0x0404/*::]*/: { /* n:"BrtBeginSXTupleSetHeader", */ T:1 }, /*::[*/0x0405/*::]*/: { /* n:"BrtEndSXTupleSetHeader", */ T:-1 }, /*::[*/0x0406/*::]*/: { /* n:"BrtSXTupleSetHeaderItem" */ }, /*::[*/0x0407/*::]*/: { /* n:"BrtBeginSXTupleSetData", */ T:1 }, /*::[*/0x0408/*::]*/: { /* n:"BrtEndSXTupleSetData", */ T:-1 }, /*::[*/0x0409/*::]*/: { /* n:"BrtBeginSXTupleSetRow", */ T:1 }, /*::[*/0x040A/*::]*/: { /* n:"BrtEndSXTupleSetRow", */ T:-1 }, /*::[*/0x040B/*::]*/: { /* n:"BrtSXTupleSetRowItem" */ }, /*::[*/0x040C/*::]*/: { /* n:"BrtNameExt" */ }, /*::[*/0x040D/*::]*/: { /* n:"BrtPCDH14" */ }, /*::[*/0x040E/*::]*/: { /* n:"BrtBeginPCDCalcMem14", */ T:1 }, /*::[*/0x040F/*::]*/: { /* n:"BrtEndPCDCalcMem14", */ T:-1 }, /*::[*/0x0410/*::]*/: { /* n:"BrtSXTH14" */ }, /*::[*/0x0411/*::]*/: { /* n:"BrtBeginSparklineGroup", */ T:1 }, /*::[*/0x0412/*::]*/: { /* n:"BrtEndSparklineGroup", */ T:-1 }, /*::[*/0x0413/*::]*/: { /* n:"BrtSparkline" */ }, /*::[*/0x0414/*::]*/: { /* n:"BrtSXDI14" */ }, /*::[*/0x0415/*::]*/: { /* n:"BrtWsFmtInfoEx14" */ }, /*::[*/0x0416/*::]*/: { /* n:"BrtBeginConditionalFormatting14", */ T:1 }, /*::[*/0x0417/*::]*/: { /* n:"BrtEndConditionalFormatting14", */ T:-1 }, /*::[*/0x0418/*::]*/: { /* n:"BrtBeginCFRule14", */ T:1 }, /*::[*/0x0419/*::]*/: { /* n:"BrtEndCFRule14", */ T:-1 }, /*::[*/0x041A/*::]*/: { /* n:"BrtCFVO14" */ }, /*::[*/0x041B/*::]*/: { /* n:"BrtBeginDatabar14", */ T:1 }, /*::[*/0x041C/*::]*/: { /* n:"BrtBeginIconSet14", */ T:1 }, /*::[*/0x041D/*::]*/: { /* n:"BrtDVal14", */ f: parse_BrtDVal14 }, /*::[*/0x041E/*::]*/: { /* n:"BrtBeginDVals14", */ T:1 }, /*::[*/0x041F/*::]*/: { /* n:"BrtColor14" */ }, /*::[*/0x0420/*::]*/: { /* n:"BrtBeginSparklines", */ T:1 }, /*::[*/0x0421/*::]*/: { /* n:"BrtEndSparklines", */ T:-1 }, /*::[*/0x0422/*::]*/: { /* n:"BrtBeginSparklineGroups", */ T:1 }, /*::[*/0x0423/*::]*/: { /* n:"BrtEndSparklineGroups", */ T:-1 }, /*::[*/0x0425/*::]*/: { /* n:"BrtSXVD14" */ }, /*::[*/0x0426/*::]*/: { /* n:"BrtBeginSXView14", */ T:1 }, /*::[*/0x0427/*::]*/: { /* n:"BrtEndSXView14", */ T:-1 }, /*::[*/0x0428/*::]*/: { /* n:"BrtBeginSXView16", */ T:1 }, /*::[*/0x0429/*::]*/: { /* n:"BrtEndSXView16", */ T:-1 }, /*::[*/0x042A/*::]*/: { /* n:"BrtBeginPCD14", */ T:1 }, /*::[*/0x042B/*::]*/: { /* n:"BrtEndPCD14", */ T:-1 }, /*::[*/0x042C/*::]*/: { /* n:"BrtBeginExtConn14", */ T:1 }, /*::[*/0x042D/*::]*/: { /* n:"BrtEndExtConn14", */ T:-1 }, /*::[*/0x042E/*::]*/: { /* n:"BrtBeginSlicerCacheIDs", */ T:1 }, /*::[*/0x042F/*::]*/: { /* n:"BrtEndSlicerCacheIDs", */ T:-1 }, /*::[*/0x0430/*::]*/: { /* n:"BrtBeginSlicerCacheID", */ T:1 }, /*::[*/0x0431/*::]*/: { /* n:"BrtEndSlicerCacheID", */ T:-1 }, /*::[*/0x0433/*::]*/: { /* n:"BrtBeginSlicerCache", */ T:1 }, /*::[*/0x0434/*::]*/: { /* n:"BrtEndSlicerCache", */ T:-1 }, /*::[*/0x0435/*::]*/: { /* n:"BrtBeginSlicerCacheDef", */ T:1 }, /*::[*/0x0436/*::]*/: { /* n:"BrtEndSlicerCacheDef", */ T:-1 }, /*::[*/0x0437/*::]*/: { /* n:"BrtBeginSlicersEx", */ T:1 }, /*::[*/0x0438/*::]*/: { /* n:"BrtEndSlicersEx", */ T:-1 }, /*::[*/0x0439/*::]*/: { /* n:"BrtBeginSlicerEx", */ T:1 }, /*::[*/0x043A/*::]*/: { /* n:"BrtEndSlicerEx", */ T:-1 }, /*::[*/0x043B/*::]*/: { /* n:"BrtBeginSlicer", */ T:1 }, /*::[*/0x043C/*::]*/: { /* n:"BrtEndSlicer", */ T:-1 }, /*::[*/0x043D/*::]*/: { /* n:"BrtSlicerCachePivotTables" */ }, /*::[*/0x043E/*::]*/: { /* n:"BrtBeginSlicerCacheOlapImpl", */ T:1 }, /*::[*/0x043F/*::]*/: { /* n:"BrtEndSlicerCacheOlapImpl", */ T:-1 }, /*::[*/0x0440/*::]*/: { /* n:"BrtBeginSlicerCacheLevelsData", */ T:1 }, /*::[*/0x0441/*::]*/: { /* n:"BrtEndSlicerCacheLevelsData", */ T:-1 }, /*::[*/0x0442/*::]*/: { /* n:"BrtBeginSlicerCacheLevelData", */ T:1 }, /*::[*/0x0443/*::]*/: { /* n:"BrtEndSlicerCacheLevelData", */ T:-1 }, /*::[*/0x0444/*::]*/: { /* n:"BrtBeginSlicerCacheSiRanges", */ T:1 }, /*::[*/0x0445/*::]*/: { /* n:"BrtEndSlicerCacheSiRanges", */ T:-1 }, /*::[*/0x0446/*::]*/: { /* n:"BrtBeginSlicerCacheSiRange", */ T:1 }, /*::[*/0x0447/*::]*/: { /* n:"BrtEndSlicerCacheSiRange", */ T:-1 }, /*::[*/0x0448/*::]*/: { /* n:"BrtSlicerCacheOlapItem" */ }, /*::[*/0x0449/*::]*/: { /* n:"BrtBeginSlicerCacheSelections", */ T:1 }, /*::[*/0x044A/*::]*/: { /* n:"BrtSlicerCacheSelection" */ }, /*::[*/0x044B/*::]*/: { /* n:"BrtEndSlicerCacheSelections", */ T:-1 }, /*::[*/0x044C/*::]*/: { /* n:"BrtBeginSlicerCacheNative", */ T:1 }, /*::[*/0x044D/*::]*/: { /* n:"BrtEndSlicerCacheNative", */ T:-1 }, /*::[*/0x044E/*::]*/: { /* n:"BrtSlicerCacheNativeItem" */ }, /*::[*/0x044F/*::]*/: { /* n:"BrtRangeProtection14" */ }, /*::[*/0x0450/*::]*/: { /* n:"BrtRangeProtectionIso14" */ }, /*::[*/0x0451/*::]*/: { /* n:"BrtCellIgnoreEC14" */ }, /*::[*/0x0457/*::]*/: { /* n:"BrtList14" */ }, /*::[*/0x0458/*::]*/: { /* n:"BrtCFIcon" */ }, /*::[*/0x0459/*::]*/: { /* n:"BrtBeginSlicerCachesPivotCacheIDs", */ T:1 }, /*::[*/0x045A/*::]*/: { /* n:"BrtEndSlicerCachesPivotCacheIDs", */ T:-1 }, /*::[*/0x045B/*::]*/: { /* n:"BrtBeginSlicers", */ T:1 }, /*::[*/0x045C/*::]*/: { /* n:"BrtEndSlicers", */ T:-1 }, /*::[*/0x045D/*::]*/: { /* n:"BrtWbProp14" */ }, /*::[*/0x045E/*::]*/: { /* n:"BrtBeginSXEdit", */ T:1 }, /*::[*/0x045F/*::]*/: { /* n:"BrtEndSXEdit", */ T:-1 }, /*::[*/0x0460/*::]*/: { /* n:"BrtBeginSXEdits", */ T:1 }, /*::[*/0x0461/*::]*/: { /* n:"BrtEndSXEdits", */ T:-1 }, /*::[*/0x0462/*::]*/: { /* n:"BrtBeginSXChange", */ T:1 }, /*::[*/0x0463/*::]*/: { /* n:"BrtEndSXChange", */ T:-1 }, /*::[*/0x0464/*::]*/: { /* n:"BrtBeginSXChanges", */ T:1 }, /*::[*/0x0465/*::]*/: { /* n:"BrtEndSXChanges", */ T:-1 }, /*::[*/0x0466/*::]*/: { /* n:"BrtSXTupleItems" */ }, /*::[*/0x0468/*::]*/: { /* n:"BrtBeginSlicerStyle", */ T:1 }, /*::[*/0x0469/*::]*/: { /* n:"BrtEndSlicerStyle", */ T:-1 }, /*::[*/0x046A/*::]*/: { /* n:"BrtSlicerStyleElement" */ }, /*::[*/0x046B/*::]*/: { /* n:"BrtBeginStyleSheetExt14", */ T:1 }, /*::[*/0x046C/*::]*/: { /* n:"BrtEndStyleSheetExt14", */ T:-1 }, /*::[*/0x046D/*::]*/: { /* n:"BrtBeginSlicerCachesPivotCacheID", */ T:1 }, /*::[*/0x046E/*::]*/: { /* n:"BrtEndSlicerCachesPivotCacheID", */ T:-1 }, /*::[*/0x046F/*::]*/: { /* n:"BrtBeginConditionalFormattings", */ T:1 }, /*::[*/0x0470/*::]*/: { /* n:"BrtEndConditionalFormattings", */ T:-1 }, /*::[*/0x0471/*::]*/: { /* n:"BrtBeginPCDCalcMemExt", */ T:1 }, /*::[*/0x0472/*::]*/: { /* n:"BrtEndPCDCalcMemExt", */ T:-1 }, /*::[*/0x0473/*::]*/: { /* n:"BrtBeginPCDCalcMemsExt", */ T:1 }, /*::[*/0x0474/*::]*/: { /* n:"BrtEndPCDCalcMemsExt", */ T:-1 }, /*::[*/0x0475/*::]*/: { /* n:"BrtPCDField14" */ }, /*::[*/0x0476/*::]*/: { /* n:"BrtBeginSlicerStyles", */ T:1 }, /*::[*/0x0477/*::]*/: { /* n:"BrtEndSlicerStyles", */ T:-1 }, /*::[*/0x0478/*::]*/: { /* n:"BrtBeginSlicerStyleElements", */ T:1 }, /*::[*/0x0479/*::]*/: { /* n:"BrtEndSlicerStyleElements", */ T:-1 }, /*::[*/0x047A/*::]*/: { /* n:"BrtCFRuleExt" */ }, /*::[*/0x047B/*::]*/: { /* n:"BrtBeginSXCondFmt14", */ T:1 }, /*::[*/0x047C/*::]*/: { /* n:"BrtEndSXCondFmt14", */ T:-1 }, /*::[*/0x047D/*::]*/: { /* n:"BrtBeginSXCondFmts14", */ T:1 }, /*::[*/0x047E/*::]*/: { /* n:"BrtEndSXCondFmts14", */ T:-1 }, /*::[*/0x0480/*::]*/: { /* n:"BrtBeginSortCond14", */ T:1 }, /*::[*/0x0481/*::]*/: { /* n:"BrtEndSortCond14", */ T:-1 }, /*::[*/0x0482/*::]*/: { /* n:"BrtEndDVals14", */ T:-1 }, /*::[*/0x0483/*::]*/: { /* n:"BrtEndIconSet14", */ T:-1 }, /*::[*/0x0484/*::]*/: { /* n:"BrtEndDatabar14", */ T:-1 }, /*::[*/0x0485/*::]*/: { /* n:"BrtBeginColorScale14", */ T:1 }, /*::[*/0x0486/*::]*/: { /* n:"BrtEndColorScale14", */ T:-1 }, /*::[*/0x0487/*::]*/: { /* n:"BrtBeginSxrules14", */ T:1 }, /*::[*/0x0488/*::]*/: { /* n:"BrtEndSxrules14", */ T:-1 }, /*::[*/0x0489/*::]*/: { /* n:"BrtBeginPRule14", */ T:1 }, /*::[*/0x048A/*::]*/: { /* n:"BrtEndPRule14", */ T:-1 }, /*::[*/0x048B/*::]*/: { /* n:"BrtBeginPRFilters14", */ T:1 }, /*::[*/0x048C/*::]*/: { /* n:"BrtEndPRFilters14", */ T:-1 }, /*::[*/0x048D/*::]*/: { /* n:"BrtBeginPRFilter14", */ T:1 }, /*::[*/0x048E/*::]*/: { /* n:"BrtEndPRFilter14", */ T:-1 }, /*::[*/0x048F/*::]*/: { /* n:"BrtBeginPRFItem14", */ T:1 }, /*::[*/0x0490/*::]*/: { /* n:"BrtEndPRFItem14", */ T:-1 }, /*::[*/0x0491/*::]*/: { /* n:"BrtBeginCellIgnoreECs14", */ T:1 }, /*::[*/0x0492/*::]*/: { /* n:"BrtEndCellIgnoreECs14", */ T:-1 }, /*::[*/0x0493/*::]*/: { /* n:"BrtDxf14" */ }, /*::[*/0x0494/*::]*/: { /* n:"BrtBeginDxF14s", */ T:1 }, /*::[*/0x0495/*::]*/: { /* n:"BrtEndDxf14s", */ T:-1 }, /*::[*/0x0499/*::]*/: { /* n:"BrtFilter14" */ }, /*::[*/0x049A/*::]*/: { /* n:"BrtBeginCustomFilters14", */ T:1 }, /*::[*/0x049C/*::]*/: { /* n:"BrtCustomFilter14" */ }, /*::[*/0x049D/*::]*/: { /* n:"BrtIconFilter14" */ }, /*::[*/0x049E/*::]*/: { /* n:"BrtPivotCacheConnectionName" */ }, /*::[*/0x0800/*::]*/: { /* n:"BrtBeginDecoupledPivotCacheIDs", */ T:1 }, /*::[*/0x0801/*::]*/: { /* n:"BrtEndDecoupledPivotCacheIDs", */ T:-1 }, /*::[*/0x0802/*::]*/: { /* n:"BrtDecoupledPivotCacheID" */ }, /*::[*/0x0803/*::]*/: { /* n:"BrtBeginPivotTableRefs", */ T:1 }, /*::[*/0x0804/*::]*/: { /* n:"BrtEndPivotTableRefs", */ T:-1 }, /*::[*/0x0805/*::]*/: { /* n:"BrtPivotTableRef" */ }, /*::[*/0x0806/*::]*/: { /* n:"BrtSlicerCacheBookPivotTables" */ }, /*::[*/0x0807/*::]*/: { /* n:"BrtBeginSxvcells", */ T:1 }, /*::[*/0x0808/*::]*/: { /* n:"BrtEndSxvcells", */ T:-1 }, /*::[*/0x0809/*::]*/: { /* n:"BrtBeginSxRow", */ T:1 }, /*::[*/0x080A/*::]*/: { /* n:"BrtEndSxRow", */ T:-1 }, /*::[*/0x080C/*::]*/: { /* n:"BrtPcdCalcMem15" */ }, /*::[*/0x0813/*::]*/: { /* n:"BrtQsi15" */ }, /*::[*/0x0814/*::]*/: { /* n:"BrtBeginWebExtensions", */ T:1 }, /*::[*/0x0815/*::]*/: { /* n:"BrtEndWebExtensions", */ T:-1 }, /*::[*/0x0816/*::]*/: { /* n:"BrtWebExtension" */ }, /*::[*/0x0817/*::]*/: { /* n:"BrtAbsPath15" */ }, /*::[*/0x0818/*::]*/: { /* n:"BrtBeginPivotTableUISettings", */ T:1 }, /*::[*/0x0819/*::]*/: { /* n:"BrtEndPivotTableUISettings", */ T:-1 }, /*::[*/0x081B/*::]*/: { /* n:"BrtTableSlicerCacheIDs" */ }, /*::[*/0x081C/*::]*/: { /* n:"BrtTableSlicerCacheID" */ }, /*::[*/0x081D/*::]*/: { /* n:"BrtBeginTableSlicerCache", */ T:1 }, /*::[*/0x081E/*::]*/: { /* n:"BrtEndTableSlicerCache", */ T:-1 }, /*::[*/0x081F/*::]*/: { /* n:"BrtSxFilter15" */ }, /*::[*/0x0820/*::]*/: { /* n:"BrtBeginTimelineCachePivotCacheIDs", */ T:1 }, /*::[*/0x0821/*::]*/: { /* n:"BrtEndTimelineCachePivotCacheIDs", */ T:-1 }, /*::[*/0x0822/*::]*/: { /* n:"BrtTimelineCachePivotCacheID" */ }, /*::[*/0x0823/*::]*/: { /* n:"BrtBeginTimelineCacheIDs", */ T:1 }, /*::[*/0x0824/*::]*/: { /* n:"BrtEndTimelineCacheIDs", */ T:-1 }, /*::[*/0x0825/*::]*/: { /* n:"BrtBeginTimelineCacheID", */ T:1 }, /*::[*/0x0826/*::]*/: { /* n:"BrtEndTimelineCacheID", */ T:-1 }, /*::[*/0x0827/*::]*/: { /* n:"BrtBeginTimelinesEx", */ T:1 }, /*::[*/0x0828/*::]*/: { /* n:"BrtEndTimelinesEx", */ T:-1 }, /*::[*/0x0829/*::]*/: { /* n:"BrtBeginTimelineEx", */ T:1 }, /*::[*/0x082A/*::]*/: { /* n:"BrtEndTimelineEx", */ T:-1 }, /*::[*/0x082B/*::]*/: { /* n:"BrtWorkBookPr15" */ }, /*::[*/0x082C/*::]*/: { /* n:"BrtPCDH15" */ }, /*::[*/0x082D/*::]*/: { /* n:"BrtBeginTimelineStyle", */ T:1 }, /*::[*/0x082E/*::]*/: { /* n:"BrtEndTimelineStyle", */ T:-1 }, /*::[*/0x082F/*::]*/: { /* n:"BrtTimelineStyleElement" */ }, /*::[*/0x0830/*::]*/: { /* n:"BrtBeginTimelineStylesheetExt15", */ T:1 }, /*::[*/0x0831/*::]*/: { /* n:"BrtEndTimelineStylesheetExt15", */ T:-1 }, /*::[*/0x0832/*::]*/: { /* n:"BrtBeginTimelineStyles", */ T:1 }, /*::[*/0x0833/*::]*/: { /* n:"BrtEndTimelineStyles", */ T:-1 }, /*::[*/0x0834/*::]*/: { /* n:"BrtBeginTimelineStyleElements", */ T:1 }, /*::[*/0x0835/*::]*/: { /* n:"BrtEndTimelineStyleElements", */ T:-1 }, /*::[*/0x0836/*::]*/: { /* n:"BrtDxf15" */ }, /*::[*/0x0837/*::]*/: { /* n:"BrtBeginDxfs15", */ T:1 }, /*::[*/0x0838/*::]*/: { /* n:"BrtEndDxfs15", */ T:-1 }, /*::[*/0x0839/*::]*/: { /* n:"BrtSlicerCacheHideItemsWithNoData" */ }, /*::[*/0x083A/*::]*/: { /* n:"BrtBeginItemUniqueNames", */ T:1 }, /*::[*/0x083B/*::]*/: { /* n:"BrtEndItemUniqueNames", */ T:-1 }, /*::[*/0x083C/*::]*/: { /* n:"BrtItemUniqueName" */ }, /*::[*/0x083D/*::]*/: { /* n:"BrtBeginExtConn15", */ T:1 }, /*::[*/0x083E/*::]*/: { /* n:"BrtEndExtConn15", */ T:-1 }, /*::[*/0x083F/*::]*/: { /* n:"BrtBeginOledbPr15", */ T:1 }, /*::[*/0x0840/*::]*/: { /* n:"BrtEndOledbPr15", */ T:-1 }, /*::[*/0x0841/*::]*/: { /* n:"BrtBeginDataFeedPr15", */ T:1 }, /*::[*/0x0842/*::]*/: { /* n:"BrtEndDataFeedPr15", */ T:-1 }, /*::[*/0x0843/*::]*/: { /* n:"BrtTextPr15" */ }, /*::[*/0x0844/*::]*/: { /* n:"BrtRangePr15" */ }, /*::[*/0x0845/*::]*/: { /* n:"BrtDbCommand15" */ }, /*::[*/0x0846/*::]*/: { /* n:"BrtBeginDbTables15", */ T:1 }, /*::[*/0x0847/*::]*/: { /* n:"BrtEndDbTables15", */ T:-1 }, /*::[*/0x0848/*::]*/: { /* n:"BrtDbTable15" */ }, /*::[*/0x0849/*::]*/: { /* n:"BrtBeginDataModel", */ T:1 }, /*::[*/0x084A/*::]*/: { /* n:"BrtEndDataModel", */ T:-1 }, /*::[*/0x084B/*::]*/: { /* n:"BrtBeginModelTables", */ T:1 }, /*::[*/0x084C/*::]*/: { /* n:"BrtEndModelTables", */ T:-1 }, /*::[*/0x084D/*::]*/: { /* n:"BrtModelTable" */ }, /*::[*/0x084E/*::]*/: { /* n:"BrtBeginModelRelationships", */ T:1 }, /*::[*/0x084F/*::]*/: { /* n:"BrtEndModelRelationships", */ T:-1 }, /*::[*/0x0850/*::]*/: { /* n:"BrtModelRelationship" */ }, /*::[*/0x0851/*::]*/: { /* n:"BrtBeginECTxtWiz15", */ T:1 }, /*::[*/0x0852/*::]*/: { /* n:"BrtEndECTxtWiz15", */ T:-1 }, /*::[*/0x0853/*::]*/: { /* n:"BrtBeginECTWFldInfoLst15", */ T:1 }, /*::[*/0x0854/*::]*/: { /* n:"BrtEndECTWFldInfoLst15", */ T:-1 }, /*::[*/0x0855/*::]*/: { /* n:"BrtBeginECTWFldInfo15", */ T:1 }, /*::[*/0x0856/*::]*/: { /* n:"BrtFieldListActiveItem" */ }, /*::[*/0x0857/*::]*/: { /* n:"BrtPivotCacheIdVersion" */ }, /*::[*/0x0858/*::]*/: { /* n:"BrtSXDI15" */ }, /*::[*/0x0859/*::]*/: { /* n:"BrtBeginModelTimeGroupings", */ T:1 }, /*::[*/0x085A/*::]*/: { /* n:"BrtEndModelTimeGroupings", */ T:-1 }, /*::[*/0x085B/*::]*/: { /* n:"BrtBeginModelTimeGrouping", */ T:1 }, /*::[*/0x085C/*::]*/: { /* n:"BrtEndModelTimeGrouping", */ T:-1 }, /*::[*/0x085D/*::]*/: { /* n:"BrtModelTimeGroupingCalcCol" */ }, /*::[*/0x0C00/*::]*/: { /* n:"BrtUid" */ }, /*::[*/0x0C01/*::]*/: { /* n:"BrtRevisionPtr" */ }, /*::[*/0x1000/*::]*/: { /* n:"BrtBeginDynamicArrayPr", */ T:1 }, /*::[*/0x1001/*::]*/: { /* n:"BrtEndDynamicArrayPr", */ T:-1 }, /*::[*/0x138A/*::]*/: { /* n:"BrtBeginRichValueBlock", */ T:1 }, /*::[*/0x138B/*::]*/: { /* n:"BrtEndRichValueBlock", */ T:-1 }, /*::[*/0x13D9/*::]*/: { /* n:"BrtBeginRichFilters", */ T:1 }, /*::[*/0x13DA/*::]*/: { /* n:"BrtEndRichFilters", */ T:-1 }, /*::[*/0x13DB/*::]*/: { /* n:"BrtRichFilter" */ }, /*::[*/0x13DC/*::]*/: { /* n:"BrtBeginRichFilterColumn", */ T:1 }, /*::[*/0x13DD/*::]*/: { /* n:"BrtEndRichFilterColumn", */ T:-1 }, /*::[*/0x13DE/*::]*/: { /* n:"BrtBeginCustomRichFilters", */ T:1 }, /*::[*/0x13DF/*::]*/: { /* n:"BrtEndCustomRichFilters", */ T:-1 }, /*::[*/0x13E0/*::]*/: { /* n:"BrtCustomRichFilter" */ }, /*::[*/0x13E1/*::]*/: { /* n:"BrtTop10RichFilter" */ }, /*::[*/0x13E2/*::]*/: { /* n:"BrtDynamicRichFilter" */ }, /*::[*/0x13E4/*::]*/: { /* n:"BrtBeginRichSortCondition", */ T:1 }, /*::[*/0x13E5/*::]*/: { /* n:"BrtEndRichSortCondition", */ T:-1 }, /*::[*/0x13E6/*::]*/: { /* n:"BrtRichFilterDateGroupItem" */ }, /*::[*/0x13E7/*::]*/: { /* n:"BrtBeginCalcFeatures", */ T:1 }, /*::[*/0x13E8/*::]*/: { /* n:"BrtEndCalcFeatures", */ T:-1 }, /*::[*/0x13E9/*::]*/: { /* n:"BrtCalcFeature" */ }, /*::[*/0x13EB/*::]*/: { /* n:"BrtExternalLinksPr" */ }, /*::[*/0xFFFF/*::]*/: { n:"" } }; /* [MS-XLS] 2.3 Record Enumeration (and other sources) */ var XLSRecordEnum = { /* [MS-XLS] 2.3 Record Enumeration 2021-08-17 */ /*::[*/0x0006/*::]*/: { /* n:"Formula", */ f:parse_Formula }, /*::[*/0x000a/*::]*/: { /* n:"EOF", */ f:parsenoop2 }, /*::[*/0x000c/*::]*/: { /* n:"CalcCount", */ f:parseuint16 }, // /*::[*/0x000d/*::]*/: { /* n:"CalcMode", */ f:parseuint16 }, // /*::[*/0x000e/*::]*/: { /* n:"CalcPrecision", */ f:parsebool }, // /*::[*/0x000f/*::]*/: { /* n:"CalcRefMode", */ f:parsebool }, // /*::[*/0x0010/*::]*/: { /* n:"CalcDelta", */ f:parse_Xnum }, // /*::[*/0x0011/*::]*/: { /* n:"CalcIter", */ f:parsebool }, // /*::[*/0x0012/*::]*/: { /* n:"Protect", */ f:parsebool }, /*::[*/0x0013/*::]*/: { /* n:"Password", */ f:parseuint16 }, /*::[*/0x0014/*::]*/: { /* n:"Header", */ f:parse_XLHeaderFooter }, /*::[*/0x0015/*::]*/: { /* n:"Footer", */ f:parse_XLHeaderFooter }, /*::[*/0x0017/*::]*/: { /* n:"ExternSheet", */ f:parse_ExternSheet }, /*::[*/0x0018/*::]*/: { /* n:"Lbl", */ f:parse_Lbl }, /*::[*/0x0019/*::]*/: { /* n:"WinProtect", */ f:parsebool }, /*::[*/0x001a/*::]*/: { /* n:"VerticalPageBreaks", */ }, /*::[*/0x001b/*::]*/: { /* n:"HorizontalPageBreaks", */ }, /*::[*/0x001c/*::]*/: { /* n:"Note", */ f:parse_Note }, /*::[*/0x001d/*::]*/: { /* n:"Selection", */ }, /*::[*/0x0022/*::]*/: { /* n:"Date1904", */ f:parsebool }, /*::[*/0x0023/*::]*/: { /* n:"ExternName", */ f:parse_ExternName }, /*::[*/0x0026/*::]*/: { /* n:"LeftMargin", */ f:parse_Xnum }, // * /*::[*/0x0027/*::]*/: { /* n:"RightMargin", */ f:parse_Xnum }, // * /*::[*/0x0028/*::]*/: { /* n:"TopMargin", */ f:parse_Xnum }, // * /*::[*/0x0029/*::]*/: { /* n:"BottomMargin", */ f:parse_Xnum }, // * /*::[*/0x002a/*::]*/: { /* n:"PrintRowCol", */ f:parsebool }, /*::[*/0x002b/*::]*/: { /* n:"PrintGrid", */ f:parsebool }, /*::[*/0x002f/*::]*/: { /* n:"FilePass", */ f:parse_FilePass }, /*::[*/0x0031/*::]*/: { /* n:"Font", */ f:parse_Font }, /*::[*/0x0033/*::]*/: { /* n:"PrintSize", */ f:parseuint16 }, /*::[*/0x003c/*::]*/: { /* n:"Continue", */ }, /*::[*/0x003d/*::]*/: { /* n:"Window1", */ f:parse_Window1 }, /*::[*/0x0040/*::]*/: { /* n:"Backup", */ f:parsebool }, /*::[*/0x0041/*::]*/: { /* n:"Pane", */ f:parse_Pane }, /*::[*/0x0042/*::]*/: { /* n:"CodePage", */ f:parseuint16 }, /*::[*/0x004d/*::]*/: { /* n:"Pls", */ }, /*::[*/0x0050/*::]*/: { /* n:"DCon", */ }, /*::[*/0x0051/*::]*/: { /* n:"DConRef", */ }, /*::[*/0x0052/*::]*/: { /* n:"DConName", */ }, /*::[*/0x0055/*::]*/: { /* n:"DefColWidth", */ f:parseuint16 }, /*::[*/0x0059/*::]*/: { /* n:"XCT", */ }, /*::[*/0x005a/*::]*/: { /* n:"CRN", */ }, /*::[*/0x005b/*::]*/: { /* n:"FileSharing", */ }, /*::[*/0x005c/*::]*/: { /* n:"WriteAccess", */ f:parse_WriteAccess }, /*::[*/0x005d/*::]*/: { /* n:"Obj", */ f:parse_Obj }, /*::[*/0x005e/*::]*/: { /* n:"Uncalced", */ }, /*::[*/0x005f/*::]*/: { /* n:"CalcSaveRecalc", */ f:parsebool }, // /*::[*/0x0060/*::]*/: { /* n:"Template", */ }, /*::[*/0x0061/*::]*/: { /* n:"Intl", */ }, /*::[*/0x0063/*::]*/: { /* n:"ObjProtect", */ f:parsebool }, /*::[*/0x007d/*::]*/: { /* n:"ColInfo", */ f:parse_ColInfo }, /*::[*/0x0080/*::]*/: { /* n:"Guts", */ f:parse_Guts }, /*::[*/0x0081/*::]*/: { /* n:"WsBool", */ f:parse_WsBool }, /*::[*/0x0082/*::]*/: { /* n:"GridSet", */ f:parseuint16 }, /*::[*/0x0083/*::]*/: { /* n:"HCenter", */ f:parsebool }, /*::[*/0x0084/*::]*/: { /* n:"VCenter", */ f:parsebool }, /*::[*/0x0085/*::]*/: { /* n:"BoundSheet8", */ f:parse_BoundSheet8 }, /*::[*/0x0086/*::]*/: { /* n:"WriteProtect", */ }, /*::[*/0x008c/*::]*/: { /* n:"Country", */ f:parse_Country }, /*::[*/0x008d/*::]*/: { /* n:"HideObj", */ f:parseuint16 }, /*::[*/0x0090/*::]*/: { /* n:"Sort", */ }, /*::[*/0x0092/*::]*/: { /* n:"Palette", */ f:parse_Palette }, /*::[*/0x0097/*::]*/: { /* n:"Sync", */ }, /*::[*/0x0098/*::]*/: { /* n:"LPr", */ }, /*::[*/0x0099/*::]*/: { /* n:"DxGCol", */ }, /*::[*/0x009a/*::]*/: { /* n:"FnGroupName", */ }, /*::[*/0x009b/*::]*/: { /* n:"FilterMode", */ }, /*::[*/0x009c/*::]*/: { /* n:"BuiltInFnGroupCount", */ f:parseuint16 }, /*::[*/0x009d/*::]*/: { /* n:"AutoFilterInfo", */ }, /*::[*/0x009e/*::]*/: { /* n:"AutoFilter", */ }, /*::[*/0x00a0/*::]*/: { /* n:"Scl", */ f:parse_Scl }, /*::[*/0x00a1/*::]*/: { /* n:"Setup", */ f:parse_Setup }, /*::[*/0x00ae/*::]*/: { /* n:"ScenMan", */ }, /*::[*/0x00af/*::]*/: { /* n:"SCENARIO", */ }, /*::[*/0x00b0/*::]*/: { /* n:"SxView", */ }, /*::[*/0x00b1/*::]*/: { /* n:"Sxvd", */ }, /*::[*/0x00b2/*::]*/: { /* n:"SXVI", */ }, /*::[*/0x00b4/*::]*/: { /* n:"SxIvd", */ }, /*::[*/0x00b5/*::]*/: { /* n:"SXLI", */ }, /*::[*/0x00b6/*::]*/: { /* n:"SXPI", */ }, /*::[*/0x00b8/*::]*/: { /* n:"DocRoute", */ }, /*::[*/0x00b9/*::]*/: { /* n:"RecipName", */ }, /*::[*/0x00bd/*::]*/: { /* n:"MulRk", */ f:parse_MulRk }, /*::[*/0x00be/*::]*/: { /* n:"MulBlank", */ f:parse_MulBlank }, /*::[*/0x00c1/*::]*/: { /* n:"Mms", */ f:parsenoop2 }, /*::[*/0x00c5/*::]*/: { /* n:"SXDI", */ }, /*::[*/0x00c6/*::]*/: { /* n:"SXDB", */ }, /*::[*/0x00c7/*::]*/: { /* n:"SXFDB", */ }, /*::[*/0x00c8/*::]*/: { /* n:"SXDBB", */ }, /*::[*/0x00c9/*::]*/: { /* n:"SXNum", */ }, /*::[*/0x00ca/*::]*/: { /* n:"SxBool", */ f:parsebool }, /*::[*/0x00cb/*::]*/: { /* n:"SxErr", */ }, /*::[*/0x00cc/*::]*/: { /* n:"SXInt", */ }, /*::[*/0x00cd/*::]*/: { /* n:"SXString", */ }, /*::[*/0x00ce/*::]*/: { /* n:"SXDtr", */ }, /*::[*/0x00cf/*::]*/: { /* n:"SxNil", */ }, /*::[*/0x00d0/*::]*/: { /* n:"SXTbl", */ }, /*::[*/0x00d1/*::]*/: { /* n:"SXTBRGIITM", */ }, /*::[*/0x00d2/*::]*/: { /* n:"SxTbpg", */ }, /*::[*/0x00d3/*::]*/: { /* n:"ObProj", */ }, /*::[*/0x00d5/*::]*/: { /* n:"SXStreamID", */ }, /*::[*/0x00d7/*::]*/: { /* n:"DBCell", */ }, /*::[*/0x00d8/*::]*/: { /* n:"SXRng", */ }, /*::[*/0x00d9/*::]*/: { /* n:"SxIsxoper", */ }, /*::[*/0x00da/*::]*/: { /* n:"BookBool", */ f:parseuint16 }, /*::[*/0x00dc/*::]*/: { /* n:"DbOrParamQry", */ }, /*::[*/0x00dd/*::]*/: { /* n:"ScenarioProtect", */ f:parsebool }, /*::[*/0x00de/*::]*/: { /* n:"OleObjectSize", */ }, /*::[*/0x00e0/*::]*/: { /* n:"XF", */ f:parse_XF }, /*::[*/0x00e1/*::]*/: { /* n:"InterfaceHdr", */ f:parse_InterfaceHdr }, /*::[*/0x00e2/*::]*/: { /* n:"InterfaceEnd", */ f:parsenoop2 }, /*::[*/0x00e3/*::]*/: { /* n:"SXVS", */ }, /*::[*/0x00e5/*::]*/: { /* n:"MergeCells", */ f:parse_MergeCells }, /*::[*/0x00e9/*::]*/: { /* n:"BkHim", */ }, /*::[*/0x00eb/*::]*/: { /* n:"MsoDrawingGroup", */ }, /*::[*/0x00ec/*::]*/: { /* n:"MsoDrawing", */ }, /*::[*/0x00ed/*::]*/: { /* n:"MsoDrawingSelection", */ }, /*::[*/0x00ef/*::]*/: { /* n:"PhoneticInfo", */ }, /*::[*/0x00f0/*::]*/: { /* n:"SxRule", */ }, /*::[*/0x00f1/*::]*/: { /* n:"SXEx", */ }, /*::[*/0x00f2/*::]*/: { /* n:"SxFilt", */ }, /*::[*/0x00f4/*::]*/: { /* n:"SxDXF", */ }, /*::[*/0x00f5/*::]*/: { /* n:"SxItm", */ }, /*::[*/0x00f6/*::]*/: { /* n:"SxName", */ }, /*::[*/0x00f7/*::]*/: { /* n:"SxSelect", */ }, /*::[*/0x00f8/*::]*/: { /* n:"SXPair", */ }, /*::[*/0x00f9/*::]*/: { /* n:"SxFmla", */ }, /*::[*/0x00fb/*::]*/: { /* n:"SxFormat", */ }, /*::[*/0x00fc/*::]*/: { /* n:"SST", */ f:parse_SST }, /*::[*/0x00fd/*::]*/: { /* n:"LabelSst", */ f:parse_LabelSst }, /*::[*/0x00ff/*::]*/: { /* n:"ExtSST", */ f:parse_ExtSST }, /*::[*/0x0100/*::]*/: { /* n:"SXVDEx", */ }, /*::[*/0x0103/*::]*/: { /* n:"SXFormula", */ }, /*::[*/0x0122/*::]*/: { /* n:"SXDBEx", */ }, /*::[*/0x0137/*::]*/: { /* n:"RRDInsDel", */ }, /*::[*/0x0138/*::]*/: { /* n:"RRDHead", */ }, /*::[*/0x013b/*::]*/: { /* n:"RRDChgCell", */ }, /*::[*/0x013d/*::]*/: { /* n:"RRTabId", */ f:parseuint16a }, /*::[*/0x013e/*::]*/: { /* n:"RRDRenSheet", */ }, /*::[*/0x013f/*::]*/: { /* n:"RRSort", */ }, /*::[*/0x0140/*::]*/: { /* n:"RRDMove", */ }, /*::[*/0x014a/*::]*/: { /* n:"RRFormat", */ }, /*::[*/0x014b/*::]*/: { /* n:"RRAutoFmt", */ }, /*::[*/0x014d/*::]*/: { /* n:"RRInsertSh", */ }, /*::[*/0x014e/*::]*/: { /* n:"RRDMoveBegin", */ }, /*::[*/0x014f/*::]*/: { /* n:"RRDMoveEnd", */ }, /*::[*/0x0150/*::]*/: { /* n:"RRDInsDelBegin", */ }, /*::[*/0x0151/*::]*/: { /* n:"RRDInsDelEnd", */ }, /*::[*/0x0152/*::]*/: { /* n:"RRDConflict", */ }, /*::[*/0x0153/*::]*/: { /* n:"RRDDefName", */ }, /*::[*/0x0154/*::]*/: { /* n:"RRDRstEtxp", */ }, /*::[*/0x015f/*::]*/: { /* n:"LRng", */ }, /*::[*/0x0160/*::]*/: { /* n:"UsesELFs", */ f:parsebool }, /*::[*/0x0161/*::]*/: { /* n:"DSF", */ f:parsenoop2 }, /*::[*/0x0191/*::]*/: { /* n:"CUsr", */ }, /*::[*/0x0192/*::]*/: { /* n:"CbUsr", */ }, /*::[*/0x0193/*::]*/: { /* n:"UsrInfo", */ }, /*::[*/0x0194/*::]*/: { /* n:"UsrExcl", */ }, /*::[*/0x0195/*::]*/: { /* n:"FileLock", */ }, /*::[*/0x0196/*::]*/: { /* n:"RRDInfo", */ }, /*::[*/0x0197/*::]*/: { /* n:"BCUsrs", */ }, /*::[*/0x0198/*::]*/: { /* n:"UsrChk", */ }, /*::[*/0x01a9/*::]*/: { /* n:"UserBView", */ }, /*::[*/0x01aa/*::]*/: { /* n:"UserSViewBegin", */ }, /*::[*/0x01ab/*::]*/: { /* n:"UserSViewEnd", */ }, /*::[*/0x01ac/*::]*/: { /* n:"RRDUserView", */ }, /*::[*/0x01ad/*::]*/: { /* n:"Qsi", */ }, /*::[*/0x01ae/*::]*/: { /* n:"SupBook", */ f:parse_SupBook }, /*::[*/0x01af/*::]*/: { /* n:"Prot4Rev", */ f:parsebool }, /*::[*/0x01b0/*::]*/: { /* n:"CondFmt", */ }, /*::[*/0x01b1/*::]*/: { /* n:"CF", */ }, /*::[*/0x01b2/*::]*/: { /* n:"DVal", */ }, /*::[*/0x01b5/*::]*/: { /* n:"DConBin", */ }, /*::[*/0x01b6/*::]*/: { /* n:"TxO", */ f:parse_TxO }, /*::[*/0x01b7/*::]*/: { /* n:"RefreshAll", */ f:parsebool }, // /*::[*/0x01b8/*::]*/: { /* n:"HLink", */ f:parse_HLink }, /*::[*/0x01b9/*::]*/: { /* n:"Lel", */ }, /*::[*/0x01ba/*::]*/: { /* n:"CodeName", */ f:parse_XLUnicodeString }, /*::[*/0x01bb/*::]*/: { /* n:"SXFDBType", */ }, /*::[*/0x01bc/*::]*/: { /* n:"Prot4RevPass", */ f:parseuint16 }, /*::[*/0x01bd/*::]*/: { /* n:"ObNoMacros", */ }, /*::[*/0x01be/*::]*/: { /* n:"Dv", */ }, /*::[*/0x01c0/*::]*/: { /* n:"Excel9File", */ f:parsenoop2 }, /*::[*/0x01c1/*::]*/: { /* n:"RecalcId", */ f:parse_RecalcId, r:2}, /*::[*/0x01c2/*::]*/: { /* n:"EntExU2", */ f:parsenoop2 }, /*::[*/0x0200/*::]*/: { /* n:"Dimensions", */ f:parse_Dimensions }, /*::[*/0x0201/*::]*/: { /* n:"Blank", */ f:parse_Blank }, /*::[*/0x0203/*::]*/: { /* n:"Number", */ f:parse_Number }, /*::[*/0x0204/*::]*/: { /* n:"Label", */ f:parse_Label }, /*::[*/0x0205/*::]*/: { /* n:"BoolErr", */ f:parse_BoolErr }, /*::[*/0x0207/*::]*/: { /* n:"String", */ f:parse_String }, /*::[*/0x0208/*::]*/: { /* n:"Row", */ f:parse_Row }, /*::[*/0x020b/*::]*/: { /* n:"Index", */ }, /*::[*/0x0221/*::]*/: { /* n:"Array", */ f:parse_Array }, /*::[*/0x0225/*::]*/: { /* n:"DefaultRowHeight", */ f:parse_DefaultRowHeight }, /*::[*/0x0236/*::]*/: { /* n:"Table", */ }, /*::[*/0x023e/*::]*/: { /* n:"Window2", */ f:parse_Window2 }, /*::[*/0x027e/*::]*/: { /* n:"RK", */ f:parse_RK }, /*::[*/0x0293/*::]*/: { /* n:"Style", */ }, /*::[*/0x0418/*::]*/: { /* n:"BigName", */ }, /*::[*/0x041e/*::]*/: { /* n:"Format", */ f:parse_Format }, /*::[*/0x043c/*::]*/: { /* n:"ContinueBigName", */ }, /*::[*/0x04bc/*::]*/: { /* n:"ShrFmla", */ f:parse_ShrFmla }, /*::[*/0x0800/*::]*/: { /* n:"HLinkTooltip", */ f:parse_HLinkTooltip }, /*::[*/0x0801/*::]*/: { /* n:"WebPub", */ }, /*::[*/0x0802/*::]*/: { /* n:"QsiSXTag", */ }, /*::[*/0x0803/*::]*/: { /* n:"DBQueryExt", */ }, /*::[*/0x0804/*::]*/: { /* n:"ExtString", */ }, /*::[*/0x0805/*::]*/: { /* n:"TxtQry", */ }, /*::[*/0x0806/*::]*/: { /* n:"Qsir", */ }, /*::[*/0x0807/*::]*/: { /* n:"Qsif", */ }, /*::[*/0x0808/*::]*/: { /* n:"RRDTQSIF", */ }, /*::[*/0x0809/*::]*/: { /* n:"BOF", */ f:parse_BOF }, /*::[*/0x080a/*::]*/: { /* n:"OleDbConn", */ }, /*::[*/0x080b/*::]*/: { /* n:"WOpt", */ }, /*::[*/0x080c/*::]*/: { /* n:"SXViewEx", */ }, /*::[*/0x080d/*::]*/: { /* n:"SXTH", */ }, /*::[*/0x080e/*::]*/: { /* n:"SXPIEx", */ }, /*::[*/0x080f/*::]*/: { /* n:"SXVDTEx", */ }, /*::[*/0x0810/*::]*/: { /* n:"SXViewEx9", */ }, /*::[*/0x0812/*::]*/: { /* n:"ContinueFrt", */ }, /*::[*/0x0813/*::]*/: { /* n:"RealTimeData", */ }, /*::[*/0x0850/*::]*/: { /* n:"ChartFrtInfo", */ }, /*::[*/0x0851/*::]*/: { /* n:"FrtWrapper", */ }, /*::[*/0x0852/*::]*/: { /* n:"StartBlock", */ }, /*::[*/0x0853/*::]*/: { /* n:"EndBlock", */ }, /*::[*/0x0854/*::]*/: { /* n:"StartObject", */ }, /*::[*/0x0855/*::]*/: { /* n:"EndObject", */ }, /*::[*/0x0856/*::]*/: { /* n:"CatLab", */ }, /*::[*/0x0857/*::]*/: { /* n:"YMult", */ }, /*::[*/0x0858/*::]*/: { /* n:"SXViewLink", */ }, /*::[*/0x0859/*::]*/: { /* n:"PivotChartBits", */ }, /*::[*/0x085a/*::]*/: { /* n:"FrtFontList", */ }, /*::[*/0x0862/*::]*/: { /* n:"SheetExt", */ }, /*::[*/0x0863/*::]*/: { /* n:"BookExt", */ r:12}, /*::[*/0x0864/*::]*/: { /* n:"SXAddl", */ }, /*::[*/0x0865/*::]*/: { /* n:"CrErr", */ }, /*::[*/0x0866/*::]*/: { /* n:"HFPicture", */ }, /*::[*/0x0867/*::]*/: { /* n:"FeatHdr", */ f:parsenoop2 }, /*::[*/0x0868/*::]*/: { /* n:"Feat", */ }, /*::[*/0x086a/*::]*/: { /* n:"DataLabExt", */ }, /*::[*/0x086b/*::]*/: { /* n:"DataLabExtContents", */ }, /*::[*/0x086c/*::]*/: { /* n:"CellWatch", */ }, /*::[*/0x0871/*::]*/: { /* n:"FeatHdr11", */ }, /*::[*/0x0872/*::]*/: { /* n:"Feature11", */ }, /*::[*/0x0874/*::]*/: { /* n:"DropDownObjIds", */ }, /*::[*/0x0875/*::]*/: { /* n:"ContinueFrt11", */ }, /*::[*/0x0876/*::]*/: { /* n:"DConn", */ }, /*::[*/0x0877/*::]*/: { /* n:"List12", */ }, /*::[*/0x0878/*::]*/: { /* n:"Feature12", */ }, /*::[*/0x0879/*::]*/: { /* n:"CondFmt12", */ }, /*::[*/0x087a/*::]*/: { /* n:"CF12", */ }, /*::[*/0x087b/*::]*/: { /* n:"CFEx", */ }, /*::[*/0x087c/*::]*/: { /* n:"XFCRC", */ f:parse_XFCRC, r:12 }, /*::[*/0x087d/*::]*/: { /* n:"XFExt", */ f:parse_XFExt, r:12 }, /*::[*/0x087e/*::]*/: { /* n:"AutoFilter12", */ }, /*::[*/0x087f/*::]*/: { /* n:"ContinueFrt12", */ }, /*::[*/0x0884/*::]*/: { /* n:"MDTInfo", */ }, /*::[*/0x0885/*::]*/: { /* n:"MDXStr", */ }, /*::[*/0x0886/*::]*/: { /* n:"MDXTuple", */ }, /*::[*/0x0887/*::]*/: { /* n:"MDXSet", */ }, /*::[*/0x0888/*::]*/: { /* n:"MDXProp", */ }, /*::[*/0x0889/*::]*/: { /* n:"MDXKPI", */ }, /*::[*/0x088a/*::]*/: { /* n:"MDB", */ }, /*::[*/0x088b/*::]*/: { /* n:"PLV", */ }, /*::[*/0x088c/*::]*/: { /* n:"Compat12", */ f:parsebool, r:12 }, /*::[*/0x088d/*::]*/: { /* n:"DXF", */ }, /*::[*/0x088e/*::]*/: { /* n:"TableStyles", */ r:12 }, /*::[*/0x088f/*::]*/: { /* n:"TableStyle", */ }, /*::[*/0x0890/*::]*/: { /* n:"TableStyleElement", */ }, /*::[*/0x0892/*::]*/: { /* n:"StyleExt", */ }, /*::[*/0x0893/*::]*/: { /* n:"NamePublish", */ }, /*::[*/0x0894/*::]*/: { /* n:"NameCmt", */ f:parse_NameCmt, r:12 }, /*::[*/0x0895/*::]*/: { /* n:"SortData", */ }, /*::[*/0x0896/*::]*/: { /* n:"Theme", */ f:parse_Theme, r:12 }, /*::[*/0x0897/*::]*/: { /* n:"GUIDTypeLib", */ }, /*::[*/0x0898/*::]*/: { /* n:"FnGrp12", */ }, /*::[*/0x0899/*::]*/: { /* n:"NameFnGrp12", */ }, /*::[*/0x089a/*::]*/: { /* n:"MTRSettings", */ f:parse_MTRSettings, r:12 }, /*::[*/0x089b/*::]*/: { /* n:"CompressPictures", */ f:parsenoop2 }, /*::[*/0x089c/*::]*/: { /* n:"HeaderFooter", */ }, /*::[*/0x089d/*::]*/: { /* n:"CrtLayout12", */ }, /*::[*/0x089e/*::]*/: { /* n:"CrtMlFrt", */ }, /*::[*/0x089f/*::]*/: { /* n:"CrtMlFrtContinue", */ }, /*::[*/0x08a3/*::]*/: { /* n:"ForceFullCalculation", */ f:parse_ForceFullCalculation }, /*::[*/0x08a4/*::]*/: { /* n:"ShapePropsStream", */ }, /*::[*/0x08a5/*::]*/: { /* n:"TextPropsStream", */ }, /*::[*/0x08a6/*::]*/: { /* n:"RichTextStream", */ }, /*::[*/0x08a7/*::]*/: { /* n:"CrtLayout12A", */ }, /*::[*/0x1001/*::]*/: { /* n:"Units", */ }, /*::[*/0x1002/*::]*/: { /* n:"Chart", */ }, /*::[*/0x1003/*::]*/: { /* n:"Series", */ }, /*::[*/0x1006/*::]*/: { /* n:"DataFormat", */ }, /*::[*/0x1007/*::]*/: { /* n:"LineFormat", */ }, /*::[*/0x1009/*::]*/: { /* n:"MarkerFormat", */ }, /*::[*/0x100a/*::]*/: { /* n:"AreaFormat", */ }, /*::[*/0x100b/*::]*/: { /* n:"PieFormat", */ }, /*::[*/0x100c/*::]*/: { /* n:"AttachedLabel", */ }, /*::[*/0x100d/*::]*/: { /* n:"SeriesText", */ }, /*::[*/0x1014/*::]*/: { /* n:"ChartFormat", */ }, /*::[*/0x1015/*::]*/: { /* n:"Legend", */ }, /*::[*/0x1016/*::]*/: { /* n:"SeriesList", */ }, /*::[*/0x1017/*::]*/: { /* n:"Bar", */ }, /*::[*/0x1018/*::]*/: { /* n:"Line", */ }, /*::[*/0x1019/*::]*/: { /* n:"Pie", */ }, /*::[*/0x101a/*::]*/: { /* n:"Area", */ }, /*::[*/0x101b/*::]*/: { /* n:"Scatter", */ }, /*::[*/0x101c/*::]*/: { /* n:"CrtLine", */ }, /*::[*/0x101d/*::]*/: { /* n:"Axis", */ }, /*::[*/0x101e/*::]*/: { /* n:"Tick", */ }, /*::[*/0x101f/*::]*/: { /* n:"ValueRange", */ }, /*::[*/0x1020/*::]*/: { /* n:"CatSerRange", */ }, /*::[*/0x1021/*::]*/: { /* n:"AxisLine", */ }, /*::[*/0x1022/*::]*/: { /* n:"CrtLink", */ }, /*::[*/0x1024/*::]*/: { /* n:"DefaultText", */ }, /*::[*/0x1025/*::]*/: { /* n:"Text", */ }, /*::[*/0x1026/*::]*/: { /* n:"FontX", */ f:parseuint16 }, /*::[*/0x1027/*::]*/: { /* n:"ObjectLink", */ }, /*::[*/0x1032/*::]*/: { /* n:"Frame", */ }, /*::[*/0x1033/*::]*/: { /* n:"Begin", */ }, /*::[*/0x1034/*::]*/: { /* n:"End", */ }, /*::[*/0x1035/*::]*/: { /* n:"PlotArea", */ }, /*::[*/0x103a/*::]*/: { /* n:"Chart3d", */ }, /*::[*/0x103c/*::]*/: { /* n:"PicF", */ }, /*::[*/0x103d/*::]*/: { /* n:"DropBar", */ }, /*::[*/0x103e/*::]*/: { /* n:"Radar", */ }, /*::[*/0x103f/*::]*/: { /* n:"Surf", */ }, /*::[*/0x1040/*::]*/: { /* n:"RadarArea", */ }, /*::[*/0x1041/*::]*/: { /* n:"AxisParent", */ }, /*::[*/0x1043/*::]*/: { /* n:"LegendException", */ }, /*::[*/0x1044/*::]*/: { /* n:"ShtProps", */ f:parse_ShtProps }, /*::[*/0x1045/*::]*/: { /* n:"SerToCrt", */ }, /*::[*/0x1046/*::]*/: { /* n:"AxesUsed", */ }, /*::[*/0x1048/*::]*/: { /* n:"SBaseRef", */ }, /*::[*/0x104a/*::]*/: { /* n:"SerParent", */ }, /*::[*/0x104b/*::]*/: { /* n:"SerAuxTrend", */ }, /*::[*/0x104e/*::]*/: { /* n:"IFmtRecord", */ }, /*::[*/0x104f/*::]*/: { /* n:"Pos", */ }, /*::[*/0x1050/*::]*/: { /* n:"AlRuns", */ }, /*::[*/0x1051/*::]*/: { /* n:"BRAI", */ }, /*::[*/0x105b/*::]*/: { /* n:"SerAuxErrBar", */ }, /*::[*/0x105c/*::]*/: { /* n:"ClrtClient", */ f:parse_ClrtClient }, /*::[*/0x105d/*::]*/: { /* n:"SerFmt", */ }, /*::[*/0x105f/*::]*/: { /* n:"Chart3DBarShape", */ }, /*::[*/0x1060/*::]*/: { /* n:"Fbi", */ }, /*::[*/0x1061/*::]*/: { /* n:"BopPop", */ }, /*::[*/0x1062/*::]*/: { /* n:"AxcExt", */ }, /*::[*/0x1063/*::]*/: { /* n:"Dat", */ }, /*::[*/0x1064/*::]*/: { /* n:"PlotGrowth", */ }, /*::[*/0x1065/*::]*/: { /* n:"SIIndex", */ }, /*::[*/0x1066/*::]*/: { /* n:"GelFrame", */ }, /*::[*/0x1067/*::]*/: { /* n:"BopPopCustom", */ }, /*::[*/0x1068/*::]*/: { /* n:"Fbi2", */ }, /*::[*/0x0000/*::]*/: { /* n:"Dimensions", */ f:parse_Dimensions }, /*::[*/0x0001/*::]*/: { /* n:"BIFF2BLANK", */ }, /*::[*/0x0002/*::]*/: { /* n:"BIFF2INT", */ f:parse_BIFF2INT }, /*::[*/0x0003/*::]*/: { /* n:"BIFF2NUM", */ f:parse_BIFF2NUM }, /*::[*/0x0004/*::]*/: { /* n:"BIFF2STR", */ f:parse_BIFF2STR }, /*::[*/0x0005/*::]*/: { /* n:"BoolErr", */ f:parse_BoolErr }, /*::[*/0x0007/*::]*/: { /* n:"String", */ f:parse_BIFF2STRING }, /*::[*/0x0008/*::]*/: { /* n:"BIFF2ROW", */ }, /*::[*/0x0009/*::]*/: { /* n:"BOF", */ f:parse_BOF }, /*::[*/0x000b/*::]*/: { /* n:"Index", */ }, /*::[*/0x0016/*::]*/: { /* n:"ExternCount", */ f:parseuint16 }, /*::[*/0x001e/*::]*/: { /* n:"BIFF2FORMAT", */ f:parse_BIFF2Format }, /*::[*/0x001f/*::]*/: { /* n:"BIFF2FMTCNT", */ }, /* 16-bit cnt of BIFF2FORMAT records */ /*::[*/0x0020/*::]*/: { /* n:"BIFF2COLINFO", */ }, /*::[*/0x0021/*::]*/: { /* n:"Array", */ f:parse_Array }, /*::[*/0x0024/*::]*/: { /* n:"COLWIDTH", */ }, /*::[*/0x0025/*::]*/: { /* n:"DefaultRowHeight", */ f:parse_DefaultRowHeight }, // 0x2c ?? // 0x2d ?? // 0x2e ?? // 0x30 FONTCOUNT: number of fonts /*::[*/0x0032/*::]*/: { /* n:"BIFF2FONTXTRA", */ f:parse_BIFF2FONTXTRA }, // 0x35: INFOOPTS // 0x36: TABLE (BIFF2 only) // 0x37: TABLE2 (BIFF2 only) // 0x38: WNDESK // 0x39 ?? // 0x3a: BEGINPREF // 0x3b: ENDPREF /*::[*/0x003e/*::]*/: { /* n:"BIFF2WINDOW2", */ }, // 0x3f ?? // 0x46: SHOWSCROLL // 0x47: SHOWFORMULA // 0x48: STATUSBAR // 0x49: SHORTMENUS // 0x4A: // 0x4B: // 0x4C: // 0x4E: // 0x4F: // 0x58: TOOLBAR (BIFF3) /* - - - */ /*::[*/0x0034/*::]*/: { /* n:"DDEObjName", */ }, /*::[*/0x0043/*::]*/: { /* n:"BIFF2XF", */ }, /*::[*/0x0044/*::]*/: { /* n:"BIFF2XFINDEX", */ f:parseuint16 }, /*::[*/0x0045/*::]*/: { /* n:"BIFF2FONTCLR", */ }, /*::[*/0x0056/*::]*/: { /* n:"BIFF4FMTCNT", */ }, /* 16-bit cnt, similar to BIFF2 */ /*::[*/0x007e/*::]*/: { /* n:"RK", */ }, /* Not necessarily same as 0x027e */ /*::[*/0x007f/*::]*/: { /* n:"ImData", */ f:parse_ImData }, /*::[*/0x0087/*::]*/: { /* n:"Addin", */ }, /*::[*/0x0088/*::]*/: { /* n:"Edg", */ }, /*::[*/0x0089/*::]*/: { /* n:"Pub", */ }, // 0x8A // 0x8B LH: alternate menu key flag (BIFF3/4) // 0x8E // 0x8F /*::[*/0x0091/*::]*/: { /* n:"Sub", */ }, // 0x93 STYLE /*::[*/0x0094/*::]*/: { /* n:"LHRecord", */ }, /*::[*/0x0095/*::]*/: { /* n:"LHNGraph", */ }, /*::[*/0x0096/*::]*/: { /* n:"Sound", */ }, // 0xA2 FNPROTO: function prototypes (BIFF4) // 0xA3 // 0xA8 /*::[*/0x00a9/*::]*/: { /* n:"CoordList", */ }, /*::[*/0x00ab/*::]*/: { /* n:"GCW", */ }, /*::[*/0x00bc/*::]*/: { /* n:"ShrFmla", */ }, /* Not necessarily same as 0x04bc */ /*::[*/0x00bf/*::]*/: { /* n:"ToolbarHdr", */ }, /*::[*/0x00c0/*::]*/: { /* n:"ToolbarEnd", */ }, /*::[*/0x00c2/*::]*/: { /* n:"AddMenu", */ }, /*::[*/0x00c3/*::]*/: { /* n:"DelMenu", */ }, /*::[*/0x00d6/*::]*/: { /* n:"RString", */ f:parse_RString }, /*::[*/0x00df/*::]*/: { /* n:"UDDesc", */ }, /*::[*/0x00ea/*::]*/: { /* n:"TabIdConf", */ }, /*::[*/0x0162/*::]*/: { /* n:"XL5Modify", */ }, /*::[*/0x01a5/*::]*/: { /* n:"FileSharing2", */ }, /*::[*/0x0206/*::]*/: { /* n:"Formula", */ f:parse_Formula }, /*::[*/0x0209/*::]*/: { /* n:"BOF", */ f:parse_BOF }, /*::[*/0x0218/*::]*/: { /* n:"Lbl", */ f:parse_Lbl }, /*::[*/0x0223/*::]*/: { /* n:"ExternName", */ f:parse_ExternName }, /*::[*/0x0231/*::]*/: { /* n:"Font", */ }, /*::[*/0x0243/*::]*/: { /* n:"BIFF3XF", */ }, /*::[*/0x0406/*::]*/: { /* n:"Formula", */ f:parse_Formula }, /*::[*/0x0409/*::]*/: { /* n:"BOF", */ f:parse_BOF }, /*::[*/0x0443/*::]*/: { /* n:"BIFF4XF", */ }, /*::[*/0x086d/*::]*/: { /* n:"FeatInfo", */ }, /*::[*/0x0873/*::]*/: { /* n:"FeatInfo11", */ }, /*::[*/0x0881/*::]*/: { /* n:"SXAddl12", */ }, /*::[*/0x08c0/*::]*/: { /* n:"AutoWebPub", */ }, /*::[*/0x08c1/*::]*/: { /* n:"ListObj", */ }, /*::[*/0x08c2/*::]*/: { /* n:"ListField", */ }, /*::[*/0x08c3/*::]*/: { /* n:"ListDV", */ }, /*::[*/0x08c4/*::]*/: { /* n:"ListCondFmt", */ }, /*::[*/0x08c5/*::]*/: { /* n:"ListCF", */ }, /*::[*/0x08c6/*::]*/: { /* n:"FMQry", */ }, /*::[*/0x08c7/*::]*/: { /* n:"FMSQry", */ }, /*::[*/0x08c8/*::]*/: { /* n:"PLV", */ }, /*::[*/0x08c9/*::]*/: { /* n:"LnExt", */ }, /*::[*/0x08ca/*::]*/: { /* n:"MkrExt", */ }, /*::[*/0x08cb/*::]*/: { /* n:"CrtCoopt", */ }, /*::[*/0x08d6/*::]*/: { /* n:"FRTArchId$", */ r:12 }, /*::[*/0x7262/*::]*/: {} }; function write_biff_rec(ba/*:BufArray*/, type/*:number*/, payload, length/*:?number*/)/*:void*/ { var t/*:number*/ = type; if(isNaN(t)) return; var len = length || (payload||[]).length || 0; var o = ba.next(4); o.write_shift(2, t); o.write_shift(2, len); if(/*:: len != null &&*/len > 0 && is_buf(payload)) ba.push(payload); } function write_biff_continue(ba/*:BufArray*/, type/*:number*/, payload, length/*:?number*/)/*:void*/ { var len = length || (payload||[]).length || 0; if(len <= 8224) return write_biff_rec(ba, type, payload, len); var t = type; if(isNaN(t)) return; var parts = payload.parts || [], sidx = 0; var i = 0, w = 0; while(w + (parts[sidx] || 8224) <= 8224) { w+= (parts[sidx] || 8224); sidx++; } var o = ba.next(4); o.write_shift(2, t); o.write_shift(2, w); ba.push(payload.slice(i, i + w)); i += w; while(i < len) { o = ba.next(4); o.write_shift(2, 0x3c); // TODO: figure out correct continue type w = 0; while(w + (parts[sidx] || 8224) <= 8224) { w+= (parts[sidx] || 8224); sidx++; } o.write_shift(2, w); ba.push(payload.slice(i, i+w)); i+= w; } } function write_BIFF2Cell(out, r/*:number*/, c/*:number*/) { if(!out) out = new_buf(7); out.write_shift(2, r); out.write_shift(2, c); out.write_shift(2, 0); out.write_shift(1, 0); return out; } function write_BIFF2BERR(r/*:number*/, c/*:number*/, val, t/*:?string*/) { var out = new_buf(9); write_BIFF2Cell(out, r, c); write_Bes(val, t || 'b', out); return out; } /* TODO: codepage, large strings */ function write_BIFF2LABEL(r/*:number*/, c/*:number*/, val) { var out = new_buf(8 + 2*val.length); write_BIFF2Cell(out, r, c); out.write_shift(1, val.length); out.write_shift(val.length, val, 'sbcs'); return out.l < out.length ? out.slice(0, out.l) : out; } function write_ws_biff2_cell(ba/*:BufArray*/, cell/*:Cell*/, R/*:number*/, C/*:number*//*::, opts*/) { if(cell.v != null) switch(cell.t) { case 'd': case 'n': var v = cell.t == 'd' ? datenum(parseDate(cell.v)) : cell.v; if((v == (v|0)) && (v >= 0) && (v < 65536)) write_biff_rec(ba, 0x0002, write_BIFF2INT(R, C, v)); else write_biff_rec(ba, 0x0003, write_BIFF2NUM(R,C, v)); return; case 'b': case 'e': write_biff_rec(ba, 0x0005, write_BIFF2BERR(R, C, cell.v, cell.t)); return; /* TODO: codepage, sst */ case 's': case 'str': write_biff_rec(ba, 0x0004, write_BIFF2LABEL(R, C, (cell.v||"").slice(0,255))); return; } write_biff_rec(ba, 0x0001, write_BIFF2Cell(null, R, C)); } function write_ws_biff2(ba/*:BufArray*/, ws/*:Worksheet*/, idx/*:number*/, opts/*::, wb:Workbook*/) { var dense = Array.isArray(ws); var range = safe_decode_range(ws['!ref'] || "A1"), ref/*:string*/, rr = "", cols/*:Array<string>*/ = []; if(range.e.c > 0xFF || range.e.r > 0x3FFF) { if(opts.WTF) throw new Error("Range " + (ws['!ref'] || "A1") + " exceeds format limit A1:IV16384"); range.e.c = Math.min(range.e.c, 0xFF); range.e.r = Math.min(range.e.c, 0x3FFF); ref = encode_range(range); } for(var R = range.s.r; R <= range.e.r; ++R) { rr = encode_row(R); for(var C = range.s.c; C <= range.e.c; ++C) { if(R === range.s.r) cols[C] = encode_col(C); ref = cols[C] + rr; var cell = dense ? (ws[R]||[])[C] : ws[ref]; if(!cell) continue; /* write cell */ write_ws_biff2_cell(ba, cell, R, C, opts); } } } /* Based on test files */ function write_biff2_buf(wb/*:Workbook*/, opts/*:WriteOpts*/) { var o = opts || {}; if(DENSE != null && o.dense == null) o.dense = DENSE; var ba = buf_array(); var idx = 0; for(var i=0;i<wb.SheetNames.length;++i) if(wb.SheetNames[i] == o.sheet) idx=i; if(idx == 0 && !!o.sheet && wb.SheetNames[0] != o.sheet) throw new Error("Sheet not found: " + o.sheet); write_biff_rec(ba, (o.biff == 4 ? 0x0409 : (o.biff == 3 ? 0x0209 : 0x0009)), write_BOF(wb, 0x10, o)); /* ... */ write_ws_biff2(ba, wb.Sheets[wb.SheetNames[idx]], idx, o, wb); /* ... */ write_biff_rec(ba, 0x000A); return ba.end(); } function write_FONTS_biff8(ba, data, opts) { write_biff_rec(ba, 0x0031 /* Font */, write_Font({ sz:12, color: {theme:1}, name: "Arial", family: 2, scheme: "minor" }, opts)); } function write_FMTS_biff8(ba, NF/*:?SSFTable*/, opts) { if(!NF) return; [[5,8],[23,26],[41,44],[/*63*/50,/*66],[164,*/392]].forEach(function(r) { /*:: if(!NF) return; */ for(var i = r[0]; i <= r[1]; ++i) if(NF[i] != null) write_biff_rec(ba, 0x041E /* Format */, write_Format(i, NF[i], opts)); }); } function write_FEAT(ba, ws) { /* [MS-XLS] 2.4.112 */ var o = new_buf(19); o.write_shift(4, 0x867); o.write_shift(4, 0); o.write_shift(4, 0); o.write_shift(2, 3); o.write_shift(1, 1); o.write_shift(4, 0); write_biff_rec(ba, 0x0867 /* FeatHdr */, o); /* [MS-XLS] 2.4.111 */ o = new_buf(39); o.write_shift(4, 0x868); o.write_shift(4, 0); o.write_shift(4, 0); o.write_shift(2, 3); o.write_shift(1, 0); o.write_shift(4, 0); o.write_shift(2, 1); o.write_shift(4, 4); o.write_shift(2, 0); write_Ref8U(safe_decode_range(ws['!ref']||"A1"), o); o.write_shift(4, 4); write_biff_rec(ba, 0x0868 /* Feat */, o); } function write_CELLXFS_biff8(ba, opts) { for(var i = 0; i < 16; ++i) write_biff_rec(ba, 0x00e0 /* XF */, write_XF({numFmtId:0, style:true}, 0, opts)); opts.cellXfs.forEach(function(c) { write_biff_rec(ba, 0x00e0 /* XF */, write_XF(c, 0, opts)); }); } function write_ws_biff8_hlinks(ba/*:BufArray*/, ws) { for(var R=0; R<ws['!links'].length; ++R) { var HL = ws['!links'][R]; write_biff_rec(ba, 0x01b8 /* HLink */, write_HLink(HL)); if(HL[1].Tooltip) write_biff_rec(ba, 0x0800 /* HLinkTooltip */, write_HLinkTooltip(HL)); } delete ws['!links']; } function write_ws_cols_biff8(ba, cols) { if(!cols) return; var cnt = 0; cols.forEach(function(col, idx) { if(++cnt <= 256 && col) { write_biff_rec(ba, 0x007d /* ColInfo */, write_ColInfo(col_obj_w(idx, col), idx)); } }); } function write_ws_biff8_cell(ba/*:BufArray*/, cell/*:Cell*/, R/*:number*/, C/*:number*/, opts) { var os = 16 + get_cell_style(opts.cellXfs, cell, opts); if(cell.v == null && !cell.bf) { write_biff_rec(ba, 0x0201 /* Blank */, write_XLSCell(R, C, os)); return; } if(cell.bf) write_biff_rec(ba, 0x0006 /* Formula */, write_Formula(cell, R, C, opts, os)); else switch(cell.t) { case 'd': case 'n': var v = cell.t == 'd' ? datenum(parseDate(cell.v)) : cell.v; /* TODO: emit RK as appropriate */ write_biff_rec(ba, 0x0203 /* Number */, write_Number(R, C, v, os, opts)); break; case 'b': case 'e': write_biff_rec(ba, 0x0205 /* BoolErr */, write_BoolErr(R, C, cell.v, os, opts, cell.t)); break; /* TODO: codepage, sst */ case 's': case 'str': if(opts.bookSST) { var isst = get_sst_id(opts.Strings, cell.v, opts.revStrings); write_biff_rec(ba, 0x00fd /* LabelSst */, write_LabelSst(R, C, isst, os, opts)); } else write_biff_rec(ba, 0x0204 /* Label */, write_Label(R, C, (cell.v||"").slice(0,255), os, opts)); break; default: write_biff_rec(ba, 0x0201 /* Blank */, write_XLSCell(R, C, os)); } } /* [MS-XLS] 2.1.7.20.5 */ function write_ws_biff8(idx/*:number*/, opts, wb/*:Workbook*/) { var ba = buf_array(); var s = wb.SheetNames[idx], ws = wb.Sheets[s] || {}; var _WB/*:WBWBProps*/ = ((wb||{}).Workbook||{}/*:any*/); var _sheet/*:WBWSProp*/ = ((_WB.Sheets||[])[idx]||{}/*:any*/); var dense = Array.isArray(ws); var b8 = opts.biff == 8; var ref/*:string*/, rr = "", cols/*:Array<string>*/ = []; var range = safe_decode_range(ws['!ref'] || "A1"); var MAX_ROWS = b8 ? 65536 : 16384; if(range.e.c > 0xFF || range.e.r >= MAX_ROWS) { if(opts.WTF) throw new Error("Range " + (ws['!ref'] || "A1") + " exceeds format limit A1:IV16384"); range.e.c = Math.min(range.e.c, 0xFF); range.e.r = Math.min(range.e.c, MAX_ROWS-1); } write_biff_rec(ba, 0x0809, write_BOF(wb, 0x10, opts)); /* [Uncalced] Index */ write_biff_rec(ba, 0x000d /* CalcMode */, writeuint16(1)); write_biff_rec(ba, 0x000c /* CalcCount */, writeuint16(100)); write_biff_rec(ba, 0x000f /* CalcRefMode */, writebool(true)); write_biff_rec(ba, 0x0011 /* CalcIter */, writebool(false)); write_biff_rec(ba, 0x0010 /* CalcDelta */, write_Xnum(0.001)); write_biff_rec(ba, 0x005f /* CalcSaveRecalc */, writebool(true)); write_biff_rec(ba, 0x002a /* PrintRowCol */, writebool(false)); write_biff_rec(ba, 0x002b /* PrintGrid */, writebool(false)); write_biff_rec(ba, 0x0082 /* GridSet */, writeuint16(1)); write_biff_rec(ba, 0x0080 /* Guts */, write_Guts([0,0])); /* DefaultRowHeight WsBool [Sync] [LPr] [HorizontalPageBreaks] [VerticalPageBreaks] */ /* Header (string) */ /* Footer (string) */ write_biff_rec(ba, 0x0083 /* HCenter */, writebool(false)); write_biff_rec(ba, 0x0084 /* VCenter */, writebool(false)); /* ... */ if(b8) write_ws_cols_biff8(ba, ws["!cols"]); /* ... */ write_biff_rec(ba, 0x200, write_Dimensions(range, opts)); /* ... */ if(b8) ws['!links'] = []; for(var R = range.s.r; R <= range.e.r; ++R) { rr = encode_row(R); for(var C = range.s.c; C <= range.e.c; ++C) { if(R === range.s.r) cols[C] = encode_col(C); ref = cols[C] + rr; var cell = dense ? (ws[R]||[])[C] : ws[ref]; if(!cell) continue; /* write cell */ write_ws_biff8_cell(ba, cell, R, C, opts); if(b8 && cell.l) ws['!links'].push([ref, cell.l]); } } var cname/*:string*/ = _sheet.CodeName || _sheet.name || s; /* ... */ if(b8) write_biff_rec(ba, 0x023e /* Window2 */, write_Window2((_WB.Views||[])[0])); /* ... */ if(b8 && (ws['!merges']||[]).length) write_biff_rec(ba, 0x00e5 /* MergeCells */, write_MergeCells(ws['!merges'])); /* [LRng] *QUERYTABLE [PHONETICINFO] CONDFMTS */ if(b8) write_ws_biff8_hlinks(ba, ws); /* [DVAL] */ write_biff_rec(ba, 0x01ba /* CodeName */, write_XLUnicodeString(cname, opts)); /* *WebPub *CellWatch [SheetExt] */ if(b8) write_FEAT(ba, ws); /* *FEAT11 *RECORD12 */ write_biff_rec(ba, 0x000a /* EOF */); return ba.end(); } /* [MS-XLS] 2.1.7.20.3 */ function write_biff8_global(wb/*:Workbook*/, bufs, opts/*:WriteOpts*/) { var A = buf_array(); var _WB/*:WBWBProps*/ = ((wb||{}).Workbook||{}/*:any*/); var _sheets/*:Array<WBWSProp>*/ = (_WB.Sheets||[]); var _wb/*:WBProps*/ = /*::((*/_WB.WBProps||{/*::CodeName:"ThisWorkbook"*/}/*:: ):any)*/; var b8 = opts.biff == 8, b5 = opts.biff == 5; write_biff_rec(A, 0x0809, write_BOF(wb, 0x05, opts)); if(opts.bookType == "xla") write_biff_rec(A, 0x0087 /* Addin */); write_biff_rec(A, 0x00e1 /* InterfaceHdr */, b8 ? writeuint16(0x04b0) : null); write_biff_rec(A, 0x00c1 /* Mms */, writezeroes(2)); if(b5) write_biff_rec(A, 0x00bf /* ToolbarHdr */); if(b5) write_biff_rec(A, 0x00c0 /* ToolbarEnd */); write_biff_rec(A, 0x00e2 /* InterfaceEnd */); write_biff_rec(A, 0x005c /* WriteAccess */, write_WriteAccess("SheetJS", opts)); /* [FileSharing] */ write_biff_rec(A, 0x0042 /* CodePage */, writeuint16(b8 ? 0x04b0 : 0x04E4)); /* *2047 Lel */ if(b8) write_biff_rec(A, 0x0161 /* DSF */, writeuint16(0)); if(b8) write_biff_rec(A, 0x01c0 /* Excel9File */); write_biff_rec(A, 0x013d /* RRTabId */, write_RRTabId(wb.SheetNames.length)); if(b8 && wb.vbaraw) write_biff_rec(A, 0x00d3 /* ObProj */); /* [ObNoMacros] */ if(b8 && wb.vbaraw) { var cname/*:string*/ = _wb.CodeName || "ThisWorkbook"; write_biff_rec(A, 0x01ba /* CodeName */, write_XLUnicodeString(cname, opts)); } write_biff_rec(A, 0x009c /* BuiltInFnGroupCount */, writeuint16(0x11)); /* *FnGroupName *FnGrp12 */ /* *Lbl */ /* [OleObjectSize] */ write_biff_rec(A, 0x0019 /* WinProtect */, writebool(false)); write_biff_rec(A, 0x0012 /* Protect */, writebool(false)); write_biff_rec(A, 0x0013 /* Password */, writeuint16(0)); if(b8) write_biff_rec(A, 0x01af /* Prot4Rev */, writebool(false)); if(b8) write_biff_rec(A, 0x01bc /* Prot4RevPass */, writeuint16(0)); write_biff_rec(A, 0x003d /* Window1 */, write_Window1(opts)); write_biff_rec(A, 0x0040 /* Backup */, writebool(false)); write_biff_rec(A, 0x008d /* HideObj */, writeuint16(0)); write_biff_rec(A, 0x0022 /* Date1904 */, writebool(safe1904(wb)=="true")); write_biff_rec(A, 0x000e /* CalcPrecision */, writebool(true)); if(b8) write_biff_rec(A, 0x01b7 /* RefreshAll */, writebool(false)); write_biff_rec(A, 0x00DA /* BookBool */, writeuint16(0)); /* ... */ write_FONTS_biff8(A, wb, opts); write_FMTS_biff8(A, wb.SSF, opts); write_CELLXFS_biff8(A, opts); /* ... */ if(b8) write_biff_rec(A, 0x0160 /* UsesELFs */, writebool(false)); var a = A.end(); var C = buf_array(); /* METADATA [MTRSettings] [ForceFullCalculation] */ if(b8) write_biff_rec(C, 0x008C, write_Country()); /* *SUPBOOK *LBL *RTD [RecalcId] *HFPicture *MSODRAWINGGROUP */ /* BIFF8: [SST *Continue] ExtSST */ if(b8 && opts.Strings) write_biff_continue(C, 0x00FC, write_SST(opts.Strings, opts)); /* *WebPub [WOpt] [CrErr] [BookExt] *FeatHdr *DConn [THEME] [CompressPictures] [Compat12] [GUIDTypeLib] */ write_biff_rec(C, 0x000A /* EOF */); var c = C.end(); var B = buf_array(); var blen = 0, j = 0; for(j = 0; j < wb.SheetNames.length; ++j) blen += (b8 ? 12 : 11) + (b8 ? 2 : 1) * wb.SheetNames[j].length; var start = a.length + blen + c.length; for(j = 0; j < wb.SheetNames.length; ++j) { var _sheet/*:WBWSProp*/ = _sheets[j] || ({}/*:any*/); write_biff_rec(B, 0x0085 /* BoundSheet8 */, write_BoundSheet8({pos:start, hs:_sheet.Hidden||0, dt:0, name:wb.SheetNames[j]}, opts)); start += bufs[j].length; } /* 1*BoundSheet8 */ var b = B.end(); if(blen != b.length) throw new Error("BS8 " + blen + " != " + b.length); var out = []; if(a.length) out.push(a); if(b.length) out.push(b); if(c.length) out.push(c); return bconcat(out); } /* [MS-XLS] 2.1.7.20 Workbook Stream */ function write_biff8_buf(wb/*:Workbook*/, opts/*:WriteOpts*/) { var o = opts || {}; var bufs = []; if(wb && !wb.SSF) { wb.SSF = dup(table_fmt); } if(wb && wb.SSF) { make_ssf(); SSF_load_table(wb.SSF); // $FlowIgnore o.revssf = evert_num(wb.SSF); o.revssf[wb.SSF[65535]] = 0; o.ssf = wb.SSF; } o.Strings = /*::((*/[]/*:: :any):SST)*/; o.Strings.Count = 0; o.Strings.Unique = 0; fix_write_opts(o); o.cellXfs = []; get_cell_style(o.cellXfs, {}, {revssf:{"General":0}}); if(!wb.Props) wb.Props = {}; for(var i = 0; i < wb.SheetNames.length; ++i) bufs[bufs.length] = write_ws_biff8(i, o, wb); bufs.unshift(write_biff8_global(wb, bufs, o)); return bconcat(bufs); } function write_biff_buf(wb/*:Workbook*/, opts/*:WriteOpts*/) { for(var i = 0; i <= wb.SheetNames.length; ++i) { var ws = wb.Sheets[wb.SheetNames[i]]; if(!ws || !ws["!ref"]) continue; var range = decode_range(ws["!ref"]); if(range.e.c > 255) { // note: 255 is IV if(typeof console != "undefined" && console.error) console.error("Worksheet '" + wb.SheetNames[i] + "' extends beyond column IV (255). Data may be lost."); } } var o = opts || {}; switch(o.biff || 2) { case 8: case 5: return write_biff8_buf(wb, opts); case 4: case 3: case 2: return write_biff2_buf(wb, opts); } throw new Error("invalid type " + o.bookType + " for BIFF"); } /* note: browser DOM element cannot see mso- style attrs, must parse */ function html_to_sheet(str/*:string*/, _opts)/*:Workbook*/ { var opts = _opts || {}; if(DENSE != null && opts.dense == null) opts.dense = DENSE; var ws/*:Worksheet*/ = opts.dense ? ([]/*:any*/) : ({}/*:any*/); str = str.replace(/<!--.*?-->/g, ""); var mtch/*:any*/ = str.match(/<table/i); if(!mtch) throw new Error("Invalid HTML: could not find <table>"); var mtch2/*:any*/ = str.match(/<\/table/i); var i/*:number*/ = mtch.index, j/*:number*/ = mtch2 && mtch2.index || str.length; var rows = split_regex(str.slice(i, j), /(:?<tr[^>]*>)/i, "<tr>"); var R = -1, C = 0, RS = 0, CS = 0; var range/*:Range*/ = {s:{r:10000000, c:10000000},e:{r:0,c:0}}; var merges/*:Array<Range>*/ = []; for(i = 0; i < rows.length; ++i) { var row = rows[i].trim(); var hd = row.slice(0,3).toLowerCase(); if(hd == "<tr") { ++R; if(opts.sheetRows && opts.sheetRows <= R) { --R; break; } C = 0; continue; } if(hd != "<td" && hd != "<th") continue; var cells = row.split(/<\/t[dh]>/i); for(j = 0; j < cells.length; ++j) { var cell = cells[j].trim(); if(!cell.match(/<t[dh]/i)) continue; var m = cell, cc = 0; /* TODO: parse styles etc */ while(m.charAt(0) == "<" && (cc = m.indexOf(">")) > -1) m = m.slice(cc+1); for(var midx = 0; midx < merges.length; ++midx) { var _merge/*:Range*/ = merges[midx]; if(_merge.s.c == C && _merge.s.r < R && R <= _merge.e.r) { C = _merge.e.c + 1; midx = -1; } } var tag = parsexmltag(cell.slice(0, cell.indexOf(">"))); CS = tag.colspan ? +tag.colspan : 1; if((RS = +tag.rowspan)>1 || CS>1) merges.push({s:{r:R,c:C},e:{r:R + (RS||1) - 1, c:C + CS - 1}}); var _t/*:string*/ = tag.t || tag["data-t"] || ""; /* TODO: generate stub cells */ if(!m.length) { C += CS; continue; } m = htmldecode(m); if(range.s.r > R) range.s.r = R; if(range.e.r < R) range.e.r = R; if(range.s.c > C) range.s.c = C; if(range.e.c < C) range.e.c = C; if(!m.length) { C += CS; continue; } var o/*:Cell*/ = {t:'s', v:m}; if(opts.raw || !m.trim().length || _t == 's'){} else if(m === 'TRUE') o = {t:'b', v:true}; else if(m === 'FALSE') o = {t:'b', v:false}; else if(!isNaN(fuzzynum(m))) o = {t:'n', v:fuzzynum(m)}; else if(!isNaN(fuzzydate(m).getDate())) { o = ({t:'d', v:parseDate(m)}/*:any*/); if(!opts.cellDates) o = ({t:'n', v:datenum(o.v)}/*:any*/); o.z = opts.dateNF || table_fmt[14]; } if(opts.dense) { if(!ws[R]) ws[R] = []; ws[R][C] = o; } else ws[encode_cell({r:R, c:C})] = o; C += CS; } } ws['!ref'] = encode_range(range); if(merges.length) ws["!merges"] = merges; return ws; } function make_html_row(ws/*:Worksheet*/, r/*:Range*/, R/*:number*/, o/*:Sheet2HTMLOpts*/)/*:string*/ { var M/*:Array<Range>*/ = (ws['!merges'] ||[]); var oo/*:Array<string>*/ = []; for(var C = r.s.c; C <= r.e.c; ++C) { var RS = 0, CS = 0; for(var j = 0; j < M.length; ++j) { if(M[j].s.r > R || M[j].s.c > C) continue; if(M[j].e.r < R || M[j].e.c < C) continue; if(M[j].s.r < R || M[j].s.c < C) { RS = -1; break; } RS = M[j].e.r - M[j].s.r + 1; CS = M[j].e.c - M[j].s.c + 1; break; } if(RS < 0) continue; var coord = encode_cell({r:R,c:C}); var cell = o.dense ? (ws[R]||[])[C] : ws[coord]; /* TODO: html entities */ var w = (cell && cell.v != null) && (cell.h || escapehtml(cell.w || (format_cell(cell), cell.w) || "")) || ""; var sp = ({}/*:any*/); if(RS > 1) sp.rowspan = RS; if(CS > 1) sp.colspan = CS; if(o.editable) w = '<span contenteditable="true">' + w + '</span>'; else if(cell) { sp["data-t"] = cell && cell.t || 'z'; if(cell.v != null) sp["data-v"] = cell.v; if(cell.z != null) sp["data-z"] = cell.z; if(cell.l && (cell.l.Target || "#").charAt(0) != "#") w = '<a href="' + cell.l.Target +'">' + w + '</a>'; } sp.id = (o.id || "sjs") + "-" + coord; oo.push(writextag('td', w, sp)); } var preamble = "<tr>"; return preamble + oo.join("") + "</tr>"; } var HTML_BEGIN = '<html><head><meta charset="utf-8"/><title>SheetJS Table Export'; var HTML_END = ''; function html_to_workbook(str/*:string*/, opts)/*:Workbook*/ { var mtch = str.match(/[\s\S]*?<\/table>/gi); if(!mtch || mtch.length == 0) throw new Error("Invalid HTML: could not find "); if(mtch.length == 1) return sheet_to_workbook(html_to_sheet(mtch[0], opts), opts); var wb = book_new(); mtch.forEach(function(s, idx) { book_append_sheet(wb, html_to_sheet(s, opts), "Sheet" + (idx+1)); }); return wb; } function make_html_preamble(ws/*:Worksheet*/, R/*:Range*/, o/*:Sheet2HTMLOpts*/)/*:string*/ { var out/*:Array*/ = []; return out.join("") + ''; } function sheet_to_html(ws/*:Worksheet*/, opts/*:?Sheet2HTMLOpts*//*, wb:?Workbook*/)/*:string*/ { var o = opts || {}; var header = o.header != null ? o.header : HTML_BEGIN; var footer = o.footer != null ? o.footer : HTML_END; var out/*:Array*/ = [header]; var r = decode_range(ws['!ref']); o.dense = Array.isArray(ws); out.push(make_html_preamble(ws, r, o)); for(var R = r.s.r; R <= r.e.r; ++R) out.push(make_html_row(ws, r, R, o)); out.push("
" + footer); return out.join(""); } function sheet_add_dom(ws/*:Worksheet*/, table/*:HTMLElement*/, _opts/*:?any*/)/*:Worksheet*/ { var opts = _opts || {}; if(DENSE != null) opts.dense = DENSE; var or_R = 0, or_C = 0; if(opts.origin != null) { if(typeof opts.origin == 'number') or_R = opts.origin; else { var _origin/*:CellAddress*/ = typeof opts.origin == "string" ? decode_cell(opts.origin) : opts.origin; or_R = _origin.r; or_C = _origin.c; } } var rows/*:HTMLCollection*/ = table.getElementsByTagName('tr'); var sheetRows = Math.min(opts.sheetRows||10000000, rows.length); var range/*:Range*/ = {s:{r:0,c:0},e:{r:or_R,c:or_C}}; if(ws["!ref"]) { var _range/*:Range*/ = decode_range(ws["!ref"]); range.s.r = Math.min(range.s.r, _range.s.r); range.s.c = Math.min(range.s.c, _range.s.c); range.e.r = Math.max(range.e.r, _range.e.r); range.e.c = Math.max(range.e.c, _range.e.c); if(or_R == -1) range.e.r = or_R = _range.e.r + 1; } var merges/*:Array*/ = [], midx = 0; var rowinfo/*:Array*/ = ws["!rows"] || (ws["!rows"] = []); var _R = 0, R = 0, _C = 0, C = 0, RS = 0, CS = 0; if(!ws["!cols"]) ws['!cols'] = []; for(; _R < rows.length && R < sheetRows; ++_R) { var row/*:HTMLTableRowElement*/ = rows[_R]; if (is_dom_element_hidden(row)) { if (opts.display) continue; rowinfo[R] = {hidden: true}; } var elts/*:HTMLCollection*/ = (row.children/*:any*/); for(_C = C = 0; _C < elts.length; ++_C) { var elt/*:HTMLTableCellElement*/ = elts[_C]; if (opts.display && is_dom_element_hidden(elt)) continue; var v/*:?string*/ = elt.hasAttribute('data-v') ? elt.getAttribute('data-v') : elt.hasAttribute('v') ? elt.getAttribute('v') : htmldecode(elt.innerHTML); var z/*:?string*/ = elt.getAttribute('data-z') || elt.getAttribute('z'); for(midx = 0; midx < merges.length; ++midx) { var m/*:Range*/ = merges[midx]; if(m.s.c == C + or_C && m.s.r < R + or_R && R + or_R <= m.e.r) { C = m.e.c+1 - or_C; midx = -1; } } /* TODO: figure out how to extract nonstandard mso- style */ CS = +elt.getAttribute("colspan") || 1; if( ((RS = (+elt.getAttribute("rowspan") || 1)))>1 || CS>1) merges.push({s:{r:R + or_R,c:C + or_C},e:{r:R + or_R + (RS||1) - 1, c:C + or_C + (CS||1) - 1}}); var o/*:Cell*/ = {t:'s', v:v}; var _t/*:string*/ = elt.getAttribute("data-t") || elt.getAttribute("t") || ""; if(v != null) { if(v.length == 0) o.t = _t || 'z'; else if(opts.raw || v.trim().length == 0 || _t == "s"){} else if(v === 'TRUE') o = {t:'b', v:true}; else if(v === 'FALSE') o = {t:'b', v:false}; else if(!isNaN(fuzzynum(v))) o = {t:'n', v:fuzzynum(v)}; else if(!isNaN(fuzzydate(v).getDate())) { o = ({t:'d', v:parseDate(v)}/*:any*/); if(!opts.cellDates) o = ({t:'n', v:datenum(o.v)}/*:any*/); o.z = opts.dateNF || table_fmt[14]; } } if(o.z === undefined && z != null) o.z = z; /* The first link is used. Links are assumed to be fully specified. * TODO: The right way to process relative links is to make a new */ var l = "", Aelts = elt.getElementsByTagName("A"); if(Aelts && Aelts.length) for(var Aelti = 0; Aelti < Aelts.length; ++Aelti) if(Aelts[Aelti].hasAttribute("href")) { l = Aelts[Aelti].getAttribute("href"); if(l.charAt(0) != "#") break; } if(l && l.charAt(0) != "#") o.l = ({ Target: l }); if(opts.dense) { if(!ws[R + or_R]) ws[R + or_R] = []; ws[R + or_R][C + or_C] = o; } else ws[encode_cell({c:C + or_C, r:R + or_R})] = o; if(range.e.c < C + or_C) range.e.c = C + or_C; C += CS; } ++R; } if(merges.length) ws['!merges'] = (ws["!merges"] || []).concat(merges); range.e.r = Math.max(range.e.r, R - 1 + or_R); ws['!ref'] = encode_range(range); if(R >= sheetRows) ws['!fullref'] = encode_range((range.e.r = rows.length-_R+R-1 + or_R,range)); // We can count the real number of rows to parse but we don't to improve the performance return ws; } function parse_dom_table(table/*:HTMLElement*/, _opts/*:?any*/)/*:Worksheet*/ { var opts = _opts || {}; var ws/*:Worksheet*/ = opts.dense ? ([]/*:any*/) : ({}/*:any*/); return sheet_add_dom(ws, table, _opts); } function table_to_book(table/*:HTMLElement*/, opts/*:?any*/)/*:Workbook*/ { return sheet_to_workbook(parse_dom_table(table, opts), opts); } function is_dom_element_hidden(element/*:HTMLElement*/)/*:boolean*/ { var display/*:string*/ = ''; var get_computed_style/*:?function*/ = get_get_computed_style_function(element); if(get_computed_style) display = get_computed_style(element).getPropertyValue('display'); if(!display) display = element.style && element.style.display; return display === 'none'; } /* global getComputedStyle */ function get_get_computed_style_function(element/*:HTMLElement*/)/*:?function*/ { // The proper getComputedStyle implementation is the one defined in the element window if(element.ownerDocument.defaultView && typeof element.ownerDocument.defaultView.getComputedStyle === 'function') return element.ownerDocument.defaultView.getComputedStyle; // If it is not available, try to get one from the global namespace if(typeof getComputedStyle === 'function') return getComputedStyle; return null; } /* OpenDocument */ function parse_text_p(text/*:string*//*::, tag*/)/*:Array*/ { /* 6.1.2 White Space Characters */ var fixed = text .replace(/[\t\r\n]/g, " ").trim().replace(/ +/g, " ") .replace(//g," ") .replace(//g, function($$,$1) { return Array(parseInt($1,10)+1).join(" "); }) .replace(/]*\/>/g,"\t") .replace(//g,"\n"); var v = unescapexml(fixed.replace(/<[^>]*>/g,"")); return [v]; } var number_formats_ods = { /* ods name: [short ssf fmt, long ssf fmt] */ day: ["d", "dd"], month: ["m", "mm"], year: ["y", "yy"], hours: ["h", "hh"], minutes: ["m", "mm"], seconds: ["s", "ss"], "am-pm": ["A/P", "AM/PM"], "day-of-week": ["ddd", "dddd"], era: ["e", "ee"], /* there is no native representation of LO "Q" format */ quarter: ["\\Qm", "m\\\"th quarter\""] }; function parse_content_xml(d/*:string*/, _opts)/*:Workbook*/ { var opts = _opts || {}; if(DENSE != null && opts.dense == null) opts.dense = DENSE; var str = xlml_normalize(d); var state/*:Array*/ = [], tmp; var tag/*:: = {}*/; var NFtag = {name:""}, NF = "", pidx = 0; var sheetag/*:: = {name:"", '名称':""}*/; var rowtag/*:: = {'行号':""}*/; var Sheets = {}, SheetNames/*:Array*/ = []; var ws = opts.dense ? ([]/*:any*/) : ({}/*:any*/); var Rn, q/*:: :any = ({t:"", v:null, z:null, w:"",c:[],}:any)*/; var ctag = ({value:""}/*:any*/); var textp = "", textpidx = 0, textptag/*:: = {}*/; var textR = []; var R = -1, C = -1, range = {s: {r:1000000,c:10000000}, e: {r:0, c:0}}; var row_ol = 0; var number_format_map = {}; var merges/*:Array*/ = [], mrange = {}, mR = 0, mC = 0; var rowinfo/*:Array*/ = [], rowpeat = 1, colpeat = 1; var arrayf/*:Array<[Range, string]>*/ = []; var WB = {Names:[]}; var atag = ({}/*:any*/); var _Ref/*:[string, string]*/ = ["", ""]; var comments/*:Array*/ = [], comment/*:Comment*/ = ({}/*:any*/); var creator = "", creatoridx = 0; var isstub = false, intable = false; var i = 0; xlmlregex.lastIndex = 0; str = str.replace(//mg,"").replace(//gm,""); while((Rn = xlmlregex.exec(str))) switch((Rn[3]=Rn[3].replace(/_.*$/,""))) { case 'table': case '工作表': // 9.1.2 if(Rn[1]==='/') { if(range.e.c >= range.s.c && range.e.r >= range.s.r) ws['!ref'] = encode_range(range); else ws['!ref'] = "A1:A1"; if(opts.sheetRows > 0 && opts.sheetRows <= range.e.r) { ws['!fullref'] = ws['!ref']; range.e.r = opts.sheetRows - 1; ws['!ref'] = encode_range(range); } if(merges.length) ws['!merges'] = merges; if(rowinfo.length) ws["!rows"] = rowinfo; sheetag.name = sheetag['名称'] || sheetag.name; if(typeof JSON !== 'undefined') JSON.stringify(sheetag); SheetNames.push(sheetag.name); Sheets[sheetag.name] = ws; intable = false; } else if(Rn[0].charAt(Rn[0].length-2) !== '/') { sheetag = parsexmltag(Rn[0], false); R = C = -1; range.s.r = range.s.c = 10000000; range.e.r = range.e.c = 0; ws = opts.dense ? ([]/*:any*/) : ({}/*:any*/); merges = []; rowinfo = []; intable = true; } break; case 'table-row-group': // 9.1.9 if(Rn[1] === "/") --row_ol; else ++row_ol; break; case 'table-row': case '行': // 9.1.3 if(Rn[1] === '/') { R+=rowpeat; rowpeat = 1; break; } rowtag = parsexmltag(Rn[0], false); if(rowtag['行号']) R = rowtag['行号'] - 1; else if(R == -1) R = 0; rowpeat = +rowtag['number-rows-repeated'] || 1; /* TODO: remove magic */ if(rowpeat < 10) for(i = 0; i < rowpeat; ++i) if(row_ol > 0) rowinfo[R + i] = {level: row_ol}; C = -1; break; case 'covered-table-cell': // 9.1.5 if(Rn[1] !== '/') ++C; if(opts.sheetStubs) { if(opts.dense) { if(!ws[R]) ws[R] = []; ws[R][C] = {t:'z'}; } else ws[encode_cell({r:R,c:C})] = {t:'z'}; } textp = ""; textR = []; break; /* stub */ case 'table-cell': case '数据': if(Rn[0].charAt(Rn[0].length-2) === '/') { ++C; ctag = parsexmltag(Rn[0], false); colpeat = parseInt(ctag['number-columns-repeated']||"1", 10); q = ({t:'z', v:null/*:: , z:null, w:"",c:[]*/}/*:any*/); if(ctag.formula && opts.cellFormula != false) q.f = ods_to_csf_formula(unescapexml(ctag.formula)); if((ctag['数据类型'] || ctag['value-type']) == "string") { q.t = "s"; q.v = unescapexml(ctag['string-value'] || ""); if(opts.dense) { if(!ws[R]) ws[R] = []; ws[R][C] = q; } else { ws[encode_cell({r:R,c:C})] = q; } } C+= colpeat-1; } else if(Rn[1]!=='/') { ++C; textp = ""; textpidx = 0; textR = []; colpeat = 1; var rptR = rowpeat ? R + rowpeat - 1 : R; if(C > range.e.c) range.e.c = C; if(C < range.s.c) range.s.c = C; if(R < range.s.r) range.s.r = R; if(rptR > range.e.r) range.e.r = rptR; ctag = parsexmltag(Rn[0], false); comments = []; comment = ({}/*:any*/); q = ({t:ctag['数据类型'] || ctag['value-type'], v:null/*:: , z:null, w:"",c:[]*/}/*:any*/); if(opts.cellFormula) { if(ctag.formula) ctag.formula = unescapexml(ctag.formula); if(ctag['number-matrix-columns-spanned'] && ctag['number-matrix-rows-spanned']) { mR = parseInt(ctag['number-matrix-rows-spanned'],10) || 0; mC = parseInt(ctag['number-matrix-columns-spanned'],10) || 0; mrange = {s: {r:R,c:C}, e:{r:R + mR-1,c:C + mC-1}}; q.F = encode_range(mrange); arrayf.push([mrange, q.F]); } if(ctag.formula) q.f = ods_to_csf_formula(ctag.formula); else for(i = 0; i < arrayf.length; ++i) if(R >= arrayf[i][0].s.r && R <= arrayf[i][0].e.r) if(C >= arrayf[i][0].s.c && C <= arrayf[i][0].e.c) q.F = arrayf[i][1]; } if(ctag['number-columns-spanned'] || ctag['number-rows-spanned']) { mR = parseInt(ctag['number-rows-spanned'],10) || 0; mC = parseInt(ctag['number-columns-spanned'],10) || 0; mrange = {s: {r:R,c:C}, e:{r:R + mR-1,c:C + mC-1}}; merges.push(mrange); } /* 19.675.2 table:number-columns-repeated */ if(ctag['number-columns-repeated']) colpeat = parseInt(ctag['number-columns-repeated'], 10); /* 19.385 office:value-type */ switch(q.t) { case 'boolean': q.t = 'b'; q.v = parsexmlbool(ctag['boolean-value']); break; case 'float': q.t = 'n'; q.v = parseFloat(ctag.value); break; case 'percentage': q.t = 'n'; q.v = parseFloat(ctag.value); break; case 'currency': q.t = 'n'; q.v = parseFloat(ctag.value); break; case 'date': q.t = 'd'; q.v = parseDate(ctag['date-value']); if(!opts.cellDates) { q.t = 'n'; q.v = datenum(q.v); } q.z = 'm/d/yy'; break; case 'time': q.t = 'n'; q.v = parse_isodur(ctag['time-value'])/86400; if(opts.cellDates) { q.t = 'd'; q.v = numdate(q.v); } q.z = 'HH:MM:SS'; break; case 'number': q.t = 'n'; q.v = parseFloat(ctag['数据数值']); break; default: if(q.t === 'string' || q.t === 'text' || !q.t) { q.t = 's'; if(ctag['string-value'] != null) { textp = unescapexml(ctag['string-value']); textR = []; } } else throw new Error('Unsupported value type ' + q.t); } } else { isstub = false; if(q.t === 's') { q.v = textp || ''; if(textR.length) q.R = textR; isstub = textpidx == 0; } if(atag.Target) q.l = atag; if(comments.length > 0) { q.c = comments; comments = []; } if(textp && opts.cellText !== false) q.w = textp; if(isstub) { q.t = "z"; delete q.v; } if(!isstub || opts.sheetStubs) { if(!(opts.sheetRows && opts.sheetRows <= R)) { for(var rpt = 0; rpt < rowpeat; ++rpt) { colpeat = parseInt(ctag['number-columns-repeated']||"1", 10); if(opts.dense) { if(!ws[R + rpt]) ws[R + rpt] = []; ws[R + rpt][C] = rpt == 0 ? q : dup(q); while(--colpeat > 0) ws[R + rpt][C + colpeat] = dup(q); } else { ws[encode_cell({r:R + rpt,c:C})] = q; while(--colpeat > 0) ws[encode_cell({r:R + rpt,c:C + colpeat})] = dup(q); } if(range.e.c <= C) range.e.c = C; } } } colpeat = parseInt(ctag['number-columns-repeated']||"1", 10); C += colpeat-1; colpeat = 0; q = {/*:: t:"", v:null, z:null, w:"",c:[]*/}; textp = ""; textR = []; } atag = ({}/*:any*/); break; // 9.1.4 /* pure state */ case 'document': // TODO: is the root for FODS case 'document-content': case '电子表格文档': // 3.1.3.2 case 'spreadsheet': case '主体': // 3.7 case 'scripts': // 3.12 case 'styles': // TODO case 'font-face-decls': // 3.14 case 'master-styles': // 3.15.4 -- relevant for FODS if(Rn[1]==='/'){if((tmp=state.pop())[0]!==Rn[3]) throw "Bad state: "+tmp;} else if(Rn[0].charAt(Rn[0].length-2) !== '/') state.push([Rn[3], true]); break; case 'annotation': // 14.1 if(Rn[1]==='/'){ if((tmp=state.pop())[0]!==Rn[3]) throw "Bad state: "+tmp; comment.t = textp; if(textR.length) /*::(*/comment/*:: :any)*/.R = textR; comment.a = creator; comments.push(comment); } else if(Rn[0].charAt(Rn[0].length-2) !== '/') {state.push([Rn[3], false]);} creator = ""; creatoridx = 0; textp = ""; textpidx = 0; textR = []; break; case 'creator': // 4.3.2.7 if(Rn[1]==='/') { creator = str.slice(creatoridx,Rn.index); } else creatoridx = Rn.index + Rn[0].length; break; /* ignore state */ case 'meta': case '元数据': // TODO: FODS/UOF case 'settings': // TODO: case 'config-item-set': // TODO: case 'config-item-map-indexed': // TODO: case 'config-item-map-entry': // TODO: case 'config-item-map-named': // TODO: case 'shapes': // 9.2.8 case 'frame': // 10.4.2 case 'text-box': // 10.4.3 case 'image': // 10.4.4 case 'data-pilot-tables': // 9.6.2 case 'list-style': // 16.30 case 'form': // 13.13 case 'dde-links': // 9.8 case 'event-listeners': // TODO case 'chart': // TODO if(Rn[1]==='/'){if((tmp=state.pop())[0]!==Rn[3]) throw "Bad state: "+tmp;} else if(Rn[0].charAt(Rn[0].length-2) !== '/') state.push([Rn[3], false]); textp = ""; textpidx = 0; textR = []; break; case 'scientific-number': // TODO: break; case 'currency-symbol': // TODO: break; case 'currency-style': // TODO: break; case 'number-style': // 16.27.2 case 'percentage-style': // 16.27.9 case 'date-style': // 16.27.10 case 'time-style': // 16.27.18 if(Rn[1]==='/'){ number_format_map[NFtag.name] = NF; if((tmp=state.pop())[0]!==Rn[3]) throw "Bad state: "+tmp; } else if(Rn[0].charAt(Rn[0].length-2) !== '/') { NF = ""; NFtag = parsexmltag(Rn[0], false); state.push([Rn[3], true]); } break; case 'script': break; // 3.13 case 'libraries': break; // TODO: case 'automatic-styles': break; // 3.15.3 case 'default-style': // TODO: case 'page-layout': break; // TODO: case 'style': // 16.2 break; case 'map': break; // 16.3 case 'font-face': break; // 16.21 case 'paragraph-properties': break; // 17.6 case 'table-properties': break; // 17.15 case 'table-column-properties': break; // 17.16 case 'table-row-properties': break; // 17.17 case 'table-cell-properties': break; // 17.18 case 'number': // 16.27.3 switch(state[state.length-1][0]) { case 'time-style': case 'date-style': tag = parsexmltag(Rn[0], false); NF += number_formats_ods[Rn[3]][tag.style==='long'?1:0]; break; } break; case 'fraction': break; // TODO 16.27.6 case 'day': // 16.27.11 case 'month': // 16.27.12 case 'year': // 16.27.13 case 'era': // 16.27.14 case 'day-of-week': // 16.27.15 case 'week-of-year': // 16.27.16 case 'quarter': // 16.27.17 case 'hours': // 16.27.19 case 'minutes': // 16.27.20 case 'seconds': // 16.27.21 case 'am-pm': // 16.27.22 switch(state[state.length-1][0]) { case 'time-style': case 'date-style': tag = parsexmltag(Rn[0], false); NF += number_formats_ods[Rn[3]][tag.style==='long'?1:0]; break; } break; case 'boolean-style': break; // 16.27.23 case 'boolean': break; // 16.27.24 case 'text-style': break; // 16.27.25 case 'text': // 16.27.26 if(Rn[0].slice(-2) === "/>") break; else if(Rn[1]==="/") switch(state[state.length-1][0]) { case 'number-style': case 'date-style': case 'time-style': NF += str.slice(pidx, Rn.index); break; } else pidx = Rn.index + Rn[0].length; break; case 'named-range': // 9.4.12 tag = parsexmltag(Rn[0], false); _Ref = ods_to_csf_3D(tag['cell-range-address']); var nrange = ({Name:tag.name, Ref:_Ref[0] + '!' + _Ref[1]}/*:any*/); if(intable) nrange.Sheet = SheetNames.length; WB.Names.push(nrange); break; case 'text-content': break; // 16.27.27 case 'text-properties': break; // 16.27.27 case 'embedded-text': break; // 16.27.4 case 'body': case '电子表格': break; // 3.3 16.9.6 19.726.3 case 'forms': break; // 12.25.2 13.2 case 'table-column': break; // 9.1.6 case 'table-header-rows': break; // 9.1.7 case 'table-rows': break; // 9.1.12 /* TODO: outline levels */ case 'table-column-group': break; // 9.1.10 case 'table-header-columns': break; // 9.1.11 case 'table-columns': break; // 9.1.12 case 'null-date': break; // 9.4.2 TODO: date1904 case 'graphic-properties': break; // 17.21 case 'calculation-settings': break; // 9.4.1 case 'named-expressions': break; // 9.4.11 case 'label-range': break; // 9.4.9 case 'label-ranges': break; // 9.4.10 case 'named-expression': break; // 9.4.13 case 'sort': break; // 9.4.19 case 'sort-by': break; // 9.4.20 case 'sort-groups': break; // 9.4.22 case 'tab': break; // 6.1.4 case 'line-break': break; // 6.1.5 case 'span': break; // 6.1.7 case 'p': case '文本串': // 5.1.3 if(['master-styles'].indexOf(state[state.length-1][0]) > -1) break; if(Rn[1]==='/' && (!ctag || !ctag['string-value'])) { var ptp = parse_text_p(str.slice(textpidx,Rn.index), textptag); textp = (textp.length > 0 ? textp + "\n" : "") + ptp[0]; } else { textptag = parsexmltag(Rn[0], false); textpidx = Rn.index + Rn[0].length; } break; // case 's': break; // case 'database-range': // 9.4.15 if(Rn[1]==='/') break; try { _Ref = ods_to_csf_3D(parsexmltag(Rn[0])['target-range-address']); Sheets[_Ref[0]]['!autofilter'] = { ref:_Ref[1] }; } catch(e) {/* empty */} break; case 'date': break; // <*:date> case 'object': break; // 10.4.6.2 case 'title': case '标题': break; // <*:title> OR case 'desc': break; // <*:desc> case 'binary-data': break; // 10.4.5 TODO: b64 blob /* 9.2 Advanced Tables */ case 'table-source': break; // 9.2.6 case 'scenario': break; // 9.2.6 case 'iteration': break; // 9.4.3 case 'content-validations': break; // 9.4.4 case 'filter': break; // 9.5.2 case 'filter-and': break; // 9.5.3 case 'filter-or': break; // 9.5.4 case 'filter-condition': break; // 9.5.5 case 'list-level-style-bullet': break; // 16.31 case 'page-count': break; // TODO case 'time': break; // TODO /* 9.3 Advanced Table Cells */ case 'cell-range-source': break; // 9.3.1 case 'property': break; // 13.8 case 'a': // 6.1.8 hyperlink if(Rn[1]!== '/') { atag = parsexmltag(Rn[0], false); if(!atag.href) break; atag.Target = unescapexml(atag.href); delete atag.href; if(atag.Target.charAt(0) == "#" && atag.Target.indexOf(".") > -1) { _Ref = ods_to_csf_3D(atag.Target.slice(1)); atag.Target = "#" + _Ref[0] + "!" + _Ref[1]; } else if(atag.Target.match(/^\.\.[\\\/]/)) atag.Target = atag.Target.slice(3); } break; /* non-standard */ case 'table-protection': break; case 'data-pilot-grand-total': break; // ', '', '', '', '', '', '', '' ].join(""); var payload = '' + master_styles + ''; return function wso(/*::wb, opts*/) { return XML_HEADER + payload; }; })(); var write_content_ods/*:{(wb:any, opts:any):string}*/ = /* @__PURE__ */(function() { /* 6.1.2 White Space Characters */ var write_text_p = function(text/*:string*/)/*:string*/ { return escapexml(text) .replace(/ +/g, function($$){return '';}) .replace(/\t/g, "") .replace(/\n/g, "") .replace(/^ /, "").replace(/ $/, ""); }; var null_cell_xml = ' \n'; var covered_cell_xml = ' \n'; var write_ws = function(ws, wb/*:Workbook*/, i/*:number*//*::, opts*/)/*:string*/ { /* Section 9 Tables */ var o/*:Array*/ = []; o.push(' \n'); var R=0,C=0, range = decode_range(ws['!ref']||"A1"); var marr/*:Array*/ = ws['!merges'] || [], mi = 0; var dense = Array.isArray(ws); if(ws["!cols"]) { for(C = 0; C <= range.e.c; ++C) o.push(' \n'); } var H = "", ROWS = ws["!rows"]||[]; for(R = 0; R < range.s.r; ++R) { H = ROWS[R] ? ' table:style-name="ro' + ROWS[R].ods + '"' : ""; o.push(' \n'); } for(; R <= range.e.r; ++R) { H = ROWS[R] ? ' table:style-name="ro' + ROWS[R].ods + '"' : ""; o.push(' \n'); for(C=0; C < range.s.c; ++C) o.push(null_cell_xml); for(; C <= range.e.c; ++C) { var skip = false, ct = {}, textp = ""; for(mi = 0; mi != marr.length; ++mi) { if(marr[mi].s.c > C) continue; if(marr[mi].s.r > R) continue; if(marr[mi].e.c < C) continue; if(marr[mi].e.r < R) continue; if(marr[mi].s.c != C || marr[mi].s.r != R) skip = true; ct['table:number-columns-spanned'] = (marr[mi].e.c - marr[mi].s.c + 1); ct['table:number-rows-spanned'] = (marr[mi].e.r - marr[mi].s.r + 1); break; } if(skip) { o.push(covered_cell_xml); continue; } var ref = encode_cell({r:R, c:C}), cell = dense ? (ws[R]||[])[C]: ws[ref]; if(cell && cell.f) { ct['table:formula'] = escapexml(csf_to_ods_formula(cell.f)); if(cell.F) { if(cell.F.slice(0, ref.length) == ref) { var _Fref = decode_range(cell.F); ct['table:number-matrix-columns-spanned'] = (_Fref.e.c - _Fref.s.c + 1); ct['table:number-matrix-rows-spanned'] = (_Fref.e.r - _Fref.s.r + 1); } } } if(!cell) { o.push(null_cell_xml); continue; } switch(cell.t) { case 'b': textp = (cell.v ? 'TRUE' : 'FALSE'); ct['office:value-type'] = "boolean"; ct['office:boolean-value'] = (cell.v ? 'true' : 'false'); break; case 'n': textp = (cell.w||String(cell.v||0)); ct['office:value-type'] = "float"; ct['office:value'] = (cell.v||0); break; case 's': case 'str': textp = cell.v == null ? "" : cell.v; ct['office:value-type'] = "string"; break; case 'd': textp = (cell.w||(parseDate(cell.v).toISOString())); ct['office:value-type'] = "date"; ct['office:date-value'] = (parseDate(cell.v).toISOString()); ct['table:style-name'] = "ce1"; break; //case 'e': default: o.push(null_cell_xml); continue; } var text_p = write_text_p(textp); if(cell.l && cell.l.Target) { var _tgt = cell.l.Target; _tgt = _tgt.charAt(0) == "#" ? "#" + csf_to_ods_3D(_tgt.slice(1)) : _tgt; // TODO: choose correct parent path format based on link delimiters if(_tgt.charAt(0) != "#" && !_tgt.match(/^\w+:/)) _tgt = '../' + _tgt; text_p = writextag('text:a', text_p, {'xlink:href': _tgt.replace(/&/g, "&")}); } o.push(' ' + writextag('table:table-cell', writextag('text:p', text_p, {}), ct) + '\n'); } o.push(' \n'); } o.push(' \n'); return o.join(""); }; var write_automatic_styles_ods = function(o/*:Array*/, wb) { o.push(' \n'); o.push(' \n'); o.push(' \n'); o.push(' /\n'); o.push(' \n'); o.push(' /\n'); o.push(' \n'); o.push(' \n'); /* column styles */ var cidx = 0; wb.SheetNames.map(function(n) { return wb.Sheets[n]; }).forEach(function(ws) { if(!ws) return; if(ws["!cols"]) { for(var C = 0; C < ws["!cols"].length; ++C) if(ws["!cols"][C]) { var colobj = ws["!cols"][C]; if(colobj.width == null && colobj.wpx == null && colobj.wch == null) continue; process_col(colobj); colobj.ods = cidx; var w = ws["!cols"][C].wpx + "px"; o.push(' \n'); o.push(' \n'); o.push(' \n'); ++cidx; } } }); /* row styles */ var ridx = 0; wb.SheetNames.map(function(n) { return wb.Sheets[n]; }).forEach(function(ws) { if(!ws) return; if(ws["!rows"]) { for(var R = 0; R < ws["!rows"].length; ++R) if(ws["!rows"][R]) { ws["!rows"][R].ods = ridx; var h = ws["!rows"][R].hpx + "px"; o.push(' \n'); o.push(' \n'); o.push(' \n'); ++ridx; } } }); /* table */ o.push(' \n'); o.push(' \n'); o.push(' \n'); /* table cells, text */ o.push(' \n'); /* page-layout */ o.push(' \n'); }; return function wcx(wb, opts) { var o = [XML_HEADER]; /* 3.1.3.2 */ var attr = wxt_helper({ 'xmlns:office': "urn:oasis:names:tc:opendocument:xmlns:office:1.0", 'xmlns:table': "urn:oasis:names:tc:opendocument:xmlns:table:1.0", 'xmlns:style': "urn:oasis:names:tc:opendocument:xmlns:style:1.0", 'xmlns:text': "urn:oasis:names:tc:opendocument:xmlns:text:1.0", 'xmlns:draw': "urn:oasis:names:tc:opendocument:xmlns:drawing:1.0", 'xmlns:fo': "urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0", 'xmlns:xlink': "http://www.w3.org/1999/xlink", 'xmlns:dc': "http://purl.org/dc/elements/1.1/", 'xmlns:meta': "urn:oasis:names:tc:opendocument:xmlns:meta:1.0", 'xmlns:number': "urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0", 'xmlns:presentation': "urn:oasis:names:tc:opendocument:xmlns:presentation:1.0", 'xmlns:svg': "urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0", 'xmlns:chart': "urn:oasis:names:tc:opendocument:xmlns:chart:1.0", 'xmlns:dr3d': "urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0", 'xmlns:math': "http://www.w3.org/1998/Math/MathML", 'xmlns:form': "urn:oasis:names:tc:opendocument:xmlns:form:1.0", 'xmlns:script': "urn:oasis:names:tc:opendocument:xmlns:script:1.0", 'xmlns:ooo': "http://openoffice.org/2004/office", 'xmlns:ooow': "http://openoffice.org/2004/writer", 'xmlns:oooc': "http://openoffice.org/2004/calc", 'xmlns:dom': "http://www.w3.org/2001/xml-events", 'xmlns:xforms': "http://www.w3.org/2002/xforms", 'xmlns:xsd': "http://www.w3.org/2001/XMLSchema", 'xmlns:xsi': "http://www.w3.org/2001/XMLSchema-instance", 'xmlns:sheet': "urn:oasis:names:tc:opendocument:sh33tjs:1.0", 'xmlns:rpt': "http://openoffice.org/2005/report", 'xmlns:of': "urn:oasis:names:tc:opendocument:xmlns:of:1.2", 'xmlns:xhtml': "http://www.w3.org/1999/xhtml", 'xmlns:grddl': "http://www.w3.org/2003/g/data-view#", 'xmlns:tableooo': "http://openoffice.org/2009/table", 'xmlns:drawooo': "http://openoffice.org/2010/draw", 'xmlns:calcext': "urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0", 'xmlns:loext': "urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0", 'xmlns:field': "urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0", 'xmlns:formx': "urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0", 'xmlns:css3t': "http://www.w3.org/TR/css3-text/", 'office:version': "1.2" }); var fods = wxt_helper({ 'xmlns:config': "urn:oasis:names:tc:opendocument:xmlns:config:1.0", 'office:mimetype': "application/vnd.oasis.opendocument.spreadsheet" }); if(opts.bookType == "fods") { o.push('\n'); o.push(write_meta_ods().replace(/office:document-meta/g, "office:meta")); // TODO: settings (equiv of settings.xml for ODS) } else o.push('\n'); // o.push(' \n'); write_automatic_styles_ods(o, wb); o.push(' \n'); o.push(' \n'); for(var i = 0; i != wb.SheetNames.length; ++i) o.push(write_ws(wb.Sheets[wb.SheetNames[i]], wb, i, opts)); o.push(' \n'); o.push(' \n'); if(opts.bookType == "fods") o.push(''); else o.push(''); return o.join(""); }; })(); function write_ods(wb/*:any*/, opts/*:any*/) { if(opts.bookType == "fods") return write_content_ods(wb, opts); var zip = zip_new(); var f = ""; var manifest/*:Array >*/ = []; var rdf/*:Array<[string, string]>*/ = []; /* Part 3 Section 3.3 MIME Media Type */ f = "mimetype"; zip_add_file(zip, f, "application/vnd.oasis.opendocument.spreadsheet"); /* Part 1 Section 2.2 Documents */ f = "content.xml"; zip_add_file(zip, f, write_content_ods(wb, opts)); manifest.push([f, "text/xml"]); rdf.push([f, "ContentFile"]); /* TODO: these are hard-coded styles to satiate excel */ f = "styles.xml"; zip_add_file(zip, f, write_styles_ods(wb, opts)); manifest.push([f, "text/xml"]); rdf.push([f, "StylesFile"]); /* TODO: this is hard-coded to satiate excel */ f = "meta.xml"; zip_add_file(zip, f, XML_HEADER + write_meta_ods(/*::wb, opts*/)); manifest.push([f, "text/xml"]); rdf.push([f, "MetadataFile"]); /* Part 3 Section 6 Metadata Manifest File */ f = "manifest.rdf"; zip_add_file(zip, f, write_rdf(rdf/*, opts*/)); manifest.push([f, "application/rdf+xml"]); /* Part 3 Section 4 Manifest File */ f = "META-INF/manifest.xml"; zip_add_file(zip, f, write_manifest(manifest/*, opts*/)); return zip; } /*! sheetjs (C) 2013-present SheetJS -- http://sheetjs.com */ function u8_to_dataview(array) { return new DataView(array.buffer, array.byteOffset, array.byteLength); } function u8str(u8) { return typeof TextDecoder != "undefined" ? new TextDecoder().decode(u8) : utf8read(a2s(u8)); } function stru8(str) { return typeof TextEncoder != "undefined" ? new TextEncoder().encode(str) : s2a(utf8write(str)); } function u8contains(body, search) { outer: for (var L = 0; L <= body.length - search.length; ++L) { for (var j = 0; j < search.length; ++j) if (body[L + j] != search[j]) continue outer; return true; } return false; } function u8concat(u8a) { var len = u8a.reduce(function(acc, x) { return acc + x.length; }, 0); var out = new Uint8Array(len); var off = 0; u8a.forEach(function(u8) { out.set(u8, off); off += u8.length; }); return out; } function popcnt(x) { x -= x >> 1 & 1431655765; x = (x & 858993459) + (x >> 2 & 858993459); return (x + (x >> 4) & 252645135) * 16843009 >>> 24; } function readDecimal128LE(buf, offset) { var exp = (buf[offset + 15] & 127) << 7 | buf[offset + 14] >> 1; var mantissa = buf[offset + 14] & 1; for (var j = offset + 13; j >= offset; --j) mantissa = mantissa * 256 + buf[j]; return (buf[offset + 15] & 128 ? -mantissa : mantissa) * Math.pow(10, exp - 6176); } function writeDecimal128LE(buf, offset, value) { var exp = Math.floor(value == 0 ? 0 : Math.LOG10E * Math.log(Math.abs(value))) + 6176 - 20; var mantissa = value / Math.pow(10, exp - 6176); buf[offset + 15] |= exp >> 7; buf[offset + 14] |= (exp & 127) << 1; for (var i = 0; mantissa >= 1; ++i, mantissa /= 256) buf[offset + i] = mantissa & 255; buf[offset + 15] |= value >= 0 ? 0 : 128; } function parse_varint49(buf, ptr) { var l = ptr ? ptr[0] : 0; var usz = buf[l] & 127; varint: if (buf[l++] >= 128) { usz |= (buf[l] & 127) << 7; if (buf[l++] < 128) break varint; usz |= (buf[l] & 127) << 14; if (buf[l++] < 128) break varint; usz |= (buf[l] & 127) << 21; if (buf[l++] < 128) break varint; usz += (buf[l] & 127) * Math.pow(2, 28); ++l; if (buf[l++] < 128) break varint; usz += (buf[l] & 127) * Math.pow(2, 35); ++l; if (buf[l++] < 128) break varint; usz += (buf[l] & 127) * Math.pow(2, 42); ++l; if (buf[l++] < 128) break varint; } if (ptr) ptr[0] = l; return usz; } function write_varint49(v) { var usz = new Uint8Array(7); usz[0] = v & 127; var L = 1; sz: if (v > 127) { usz[L - 1] |= 128; usz[L] = v >> 7 & 127; ++L; if (v <= 16383) break sz; usz[L - 1] |= 128; usz[L] = v >> 14 & 127; ++L; if (v <= 2097151) break sz; usz[L - 1] |= 128; usz[L] = v >> 21 & 127; ++L; if (v <= 268435455) break sz; usz[L - 1] |= 128; usz[L] = v / 256 >>> 21 & 127; ++L; if (v <= 34359738367) break sz; usz[L - 1] |= 128; usz[L] = v / 65536 >>> 21 & 127; ++L; if (v <= 4398046511103) break sz; usz[L - 1] |= 128; usz[L] = v / 16777216 >>> 21 & 127; ++L; } return usz.slice(0, L); } function varint_to_i32(buf) { var l = 0, i32 = buf[l] & 127; varint: if (buf[l++] >= 128) { i32 |= (buf[l] & 127) << 7; if (buf[l++] < 128) break varint; i32 |= (buf[l] & 127) << 14; if (buf[l++] < 128) break varint; i32 |= (buf[l] & 127) << 21; if (buf[l++] < 128) break varint; i32 |= (buf[l] & 127) << 28; } return i32; } function parse_shallow(buf) { var out = [], ptr = [0]; while (ptr[0] < buf.length) { var off = ptr[0]; var num = parse_varint49(buf, ptr); var type = num & 7; num = Math.floor(num / 8); var len = 0; var res; if (num == 0) break; switch (type) { case 0: { var l = ptr[0]; while (buf[ptr[0]++] >= 128) ; res = buf.slice(l, ptr[0]); } break; case 5: len = 4; res = buf.slice(ptr[0], ptr[0] + len); ptr[0] += len; break; case 1: len = 8; res = buf.slice(ptr[0], ptr[0] + len); ptr[0] += len; break; case 2: len = parse_varint49(buf, ptr); res = buf.slice(ptr[0], ptr[0] + len); ptr[0] += len; break; case 3: case 4: default: throw new Error("PB Type ".concat(type, " for Field ").concat(num, " at offset ").concat(off)); } var v = { data: res, type: type }; if (out[num] == null) out[num] = [v]; else out[num].push(v); } return out; } function write_shallow(proto) { var out = []; proto.forEach(function(field, idx) { field.forEach(function(item) { if (!item.data) return; out.push(write_varint49(idx * 8 + item.type)); if (item.type == 2) out.push(write_varint49(item.data.length)); out.push(item.data); }); }); return u8concat(out); } function mappa(data, cb) { return (data == null ? void 0 : data.map(function(d) { return cb(d.data); })) || []; } function parse_iwa_file(buf) { var _a; var out = [], ptr = [0]; while (ptr[0] < buf.length) { var len = parse_varint49(buf, ptr); var ai = parse_shallow(buf.slice(ptr[0], ptr[0] + len)); ptr[0] += len; var res = { id: varint_to_i32(ai[1][0].data), messages: [] }; ai[2].forEach(function(b) { var mi = parse_shallow(b.data); var fl = varint_to_i32(mi[3][0].data); res.messages.push({ meta: mi, data: buf.slice(ptr[0], ptr[0] + fl) }); ptr[0] += fl; }); if ((_a = ai[3]) == null ? void 0 : _a[0]) res.merge = varint_to_i32(ai[3][0].data) >>> 0 > 0; out.push(res); } return out; } function write_iwa_file(ias) { var bufs = []; ias.forEach(function(ia) { var ai = []; ai[1] = [{ data: write_varint49(ia.id), type: 0 }]; ai[2] = []; if (ia.merge != null) ai[3] = [{ data: write_varint49(+!!ia.merge), type: 0 }]; var midata = []; ia.messages.forEach(function(mi) { midata.push(mi.data); mi.meta[3] = [{ type: 0, data: write_varint49(mi.data.length) }]; ai[2].push({ data: write_shallow(mi.meta), type: 2 }); }); var aipayload = write_shallow(ai); bufs.push(write_varint49(aipayload.length)); bufs.push(aipayload); midata.forEach(function(mid) { return bufs.push(mid); }); }); return u8concat(bufs); } function parse_snappy_chunk(type, buf) { if (type != 0) throw new Error("Unexpected Snappy chunk type ".concat(type)); var ptr = [0]; var usz = parse_varint49(buf, ptr); var chunks = []; while (ptr[0] < buf.length) { var tag = buf[ptr[0]] & 3; if (tag == 0) { var len = buf[ptr[0]++] >> 2; if (len < 60) ++len; else { var c = len - 59; len = buf[ptr[0]]; if (c > 1) len |= buf[ptr[0] + 1] << 8; if (c > 2) len |= buf[ptr[0] + 2] << 16; if (c > 3) len |= buf[ptr[0] + 3] << 24; len >>>= 0; len++; ptr[0] += c; } chunks.push(buf.slice(ptr[0], ptr[0] + len)); ptr[0] += len; continue; } else { var offset = 0, length = 0; if (tag == 1) { length = (buf[ptr[0]] >> 2 & 7) + 4; offset = (buf[ptr[0]++] & 224) << 3; offset |= buf[ptr[0]++]; } else { length = (buf[ptr[0]++] >> 2) + 1; if (tag == 2) { offset = buf[ptr[0]] | buf[ptr[0] + 1] << 8; ptr[0] += 2; } else { offset = (buf[ptr[0]] | buf[ptr[0] + 1] << 8 | buf[ptr[0] + 2] << 16 | buf[ptr[0] + 3] << 24) >>> 0; ptr[0] += 4; } } chunks = [u8concat(chunks)]; if (offset == 0) throw new Error("Invalid offset 0"); if (offset > chunks[0].length) throw new Error("Invalid offset beyond length"); if (length >= offset) { chunks.push(chunks[0].slice(-offset)); length -= offset; while (length >= chunks[chunks.length - 1].length) { chunks.push(chunks[chunks.length - 1]); length -= chunks[chunks.length - 1].length; } } chunks.push(chunks[0].slice(-offset, -offset + length)); } } var o = u8concat(chunks); if (o.length != usz) throw new Error("Unexpected length: ".concat(o.length, " != ").concat(usz)); return o; } function decompress_iwa_file(buf) { var out = []; var l = 0; while (l < buf.length) { var t = buf[l++]; var len = buf[l] | buf[l + 1] << 8 | buf[l + 2] << 16; l += 3; out.push(parse_snappy_chunk(t, buf.slice(l, l + len))); l += len; } if (l !== buf.length) throw new Error("data is not a valid framed stream!"); return u8concat(out); } function compress_iwa_file(buf) { var out = []; var l = 0; while (l < buf.length) { var c = Math.min(buf.length - l, 268435455); var frame = new Uint8Array(4); out.push(frame); var usz = write_varint49(c); var L = usz.length; out.push(usz); if (c <= 60) { L++; out.push(new Uint8Array([c - 1 << 2])); } else if (c <= 256) { L += 2; out.push(new Uint8Array([240, c - 1 & 255])); } else if (c <= 65536) { L += 3; out.push(new Uint8Array([244, c - 1 & 255, c - 1 >> 8 & 255])); } else if (c <= 16777216) { L += 4; out.push(new Uint8Array([248, c - 1 & 255, c - 1 >> 8 & 255, c - 1 >> 16 & 255])); } else if (c <= 4294967296) { L += 5; out.push(new Uint8Array([252, c - 1 & 255, c - 1 >> 8 & 255, c - 1 >> 16 & 255, c - 1 >>> 24 & 255])); } out.push(buf.slice(l, l + c)); L += c; frame[0] = 0; frame[1] = L & 255; frame[2] = L >> 8 & 255; frame[3] = L >> 16 & 255; l += c; } return u8concat(out); } function parse_old_storage(buf, sst, rsst, v) { var dv = u8_to_dataview(buf); var flags = dv.getUint32(4, true); var data_offset = (v > 1 ? 12 : 8) + popcnt(flags & (v > 1 ? 3470 : 398)) * 4; var ridx = -1, sidx = -1, ieee = NaN, dt = new Date(2001, 0, 1); if (flags & 512) { ridx = dv.getUint32(data_offset, true); data_offset += 4; } data_offset += popcnt(flags & (v > 1 ? 12288 : 4096)) * 4; if (flags & 16) { sidx = dv.getUint32(data_offset, true); data_offset += 4; } if (flags & 32) { ieee = dv.getFloat64(data_offset, true); data_offset += 8; } if (flags & 64) { dt.setTime(dt.getTime() + dv.getFloat64(data_offset, true) * 1e3); data_offset += 8; } var ret; switch (buf[2]) { case 0: break; case 2: ret = { t: "n", v: ieee }; break; case 3: ret = { t: "s", v: sst[sidx] }; break; case 5: ret = { t: "d", v: dt }; break; case 6: ret = { t: "b", v: ieee > 0 }; break; case 7: ret = { t: "n", v: ieee / 86400 }; break; case 8: ret = { t: "e", v: 0 }; break; case 9: { if (ridx > -1) ret = { t: "s", v: rsst[ridx] }; else if (sidx > -1) ret = { t: "s", v: sst[sidx] }; else if (!isNaN(ieee)) ret = { t: "n", v: ieee }; else throw new Error("Unsupported cell type ".concat(buf.slice(0, 4))); } break; default: throw new Error("Unsupported cell type ".concat(buf.slice(0, 4))); } return ret; } function parse_new_storage(buf, sst, rsst) { var dv = u8_to_dataview(buf); var flags = dv.getUint32(8, true); var data_offset = 12; var ridx = -1, sidx = -1, d128 = NaN, ieee = NaN, dt = new Date(2001, 0, 1); if (flags & 1) { d128 = readDecimal128LE(buf, data_offset); data_offset += 16; } if (flags & 2) { ieee = dv.getFloat64(data_offset, true); data_offset += 8; } if (flags & 4) { dt.setTime(dt.getTime() + dv.getFloat64(data_offset, true) * 1e3); data_offset += 8; } if (flags & 8) { sidx = dv.getUint32(data_offset, true); data_offset += 4; } if (flags & 16) { ridx = dv.getUint32(data_offset, true); data_offset += 4; } var ret; switch (buf[1]) { case 0: break; case 2: ret = { t: "n", v: d128 }; break; case 3: ret = { t: "s", v: sst[sidx] }; break; case 5: ret = { t: "d", v: dt }; break; case 6: ret = { t: "b", v: ieee > 0 }; break; case 7: ret = { t: "n", v: ieee / 86400 }; break; case 8: ret = { t: "e", v: 0 }; break; case 9: { if (ridx > -1) ret = { t: "s", v: rsst[ridx] }; else throw new Error("Unsupported cell type ".concat(buf[1], " : ").concat(flags & 31, " : ").concat(buf.slice(0, 4))); } break; case 10: ret = { t: "n", v: d128 }; break; default: throw new Error("Unsupported cell type ".concat(buf[1], " : ").concat(flags & 31, " : ").concat(buf.slice(0, 4))); } return ret; } function write_new_storage(cell, sst) { var out = new Uint8Array(32), dv = u8_to_dataview(out), l = 12, flags = 0; out[0] = 5; switch (cell.t) { case "n": out[1] = 2; writeDecimal128LE(out, l, cell.v); flags |= 1; l += 16; break; case "b": out[1] = 6; dv.setFloat64(l, cell.v ? 1 : 0, true); flags |= 2; l += 8; break; case "s": if (sst.indexOf(cell.v) == -1) throw new Error("Value ".concat(cell.v, " missing from SST!")); out[1] = 3; dv.setUint32(l, sst.indexOf(cell.v), true); flags |= 8; l += 4; break; default: throw "unsupported cell type " + cell.t; } dv.setUint32(8, flags, true); return out.slice(0, l); } function write_old_storage(cell, sst) { var out = new Uint8Array(32), dv = u8_to_dataview(out), l = 12, flags = 0; out[0] = 3; switch (cell.t) { case "n": out[2] = 2; dv.setFloat64(l, cell.v, true); flags |= 32; l += 8; break; case "b": out[2] = 6; dv.setFloat64(l, cell.v ? 1 : 0, true); flags |= 32; l += 8; break; case "s": if (sst.indexOf(cell.v) == -1) throw new Error("Value ".concat(cell.v, " missing from SST!")); out[2] = 3; dv.setUint32(l, sst.indexOf(cell.v), true); flags |= 16; l += 4; break; default: throw "unsupported cell type " + cell.t; } dv.setUint32(4, flags, true); return out.slice(0, l); } function parse_cell_storage(buf, sst, rsst) { switch (buf[0]) { case 0: case 1: case 2: case 3: return parse_old_storage(buf, sst, rsst, buf[0]); case 5: return parse_new_storage(buf, sst, rsst); default: throw new Error("Unsupported payload version ".concat(buf[0])); } } function parse_TSP_Reference(buf) { var pb = parse_shallow(buf); return parse_varint49(pb[1][0].data); } function write_TSP_Reference(idx) { var out = []; out[1] = [{ type: 0, data: write_varint49(idx) }]; return write_shallow(out); } function parse_TST_TableDataList(M, root) { var pb = parse_shallow(root.data); var type = varint_to_i32(pb[1][0].data); var entries = pb[3]; var data = []; (entries || []).forEach(function(entry) { var le = parse_shallow(entry.data); var key = varint_to_i32(le[1][0].data) >>> 0; switch (type) { case 1: data[key] = u8str(le[3][0].data); break; case 8: { var rt = M[parse_TSP_Reference(le[9][0].data)][0]; var rtp = parse_shallow(rt.data); var rtpref = M[parse_TSP_Reference(rtp[1][0].data)][0]; var mtype = varint_to_i32(rtpref.meta[1][0].data); if (mtype != 2001) throw new Error("2000 unexpected reference to ".concat(mtype)); var tswpsa = parse_shallow(rtpref.data); data[key] = tswpsa[3].map(function(x) { return u8str(x.data); }).join(""); } break; } }); return data; } function parse_TST_TileRowInfo(u8, type) { var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n; var pb = parse_shallow(u8); var R = varint_to_i32(pb[1][0].data) >>> 0; var cnt = varint_to_i32(pb[2][0].data) >>> 0; var wide_offsets = ((_b = (_a = pb[8]) == null ? void 0 : _a[0]) == null ? void 0 : _b.data) && varint_to_i32(pb[8][0].data) > 0 || false; var used_storage_u8, used_storage; if (((_d = (_c = pb[7]) == null ? void 0 : _c[0]) == null ? void 0 : _d.data) && type != 0) { used_storage_u8 = (_f = (_e = pb[7]) == null ? void 0 : _e[0]) == null ? void 0 : _f.data; used_storage = (_h = (_g = pb[6]) == null ? void 0 : _g[0]) == null ? void 0 : _h.data; } else if (((_j = (_i = pb[4]) == null ? void 0 : _i[0]) == null ? void 0 : _j.data) && type != 1) { used_storage_u8 = (_l = (_k = pb[4]) == null ? void 0 : _k[0]) == null ? void 0 : _l.data; used_storage = (_n = (_m = pb[3]) == null ? void 0 : _m[0]) == null ? void 0 : _n.data; } else throw "NUMBERS Tile missing ".concat(type, " cell storage"); var width = wide_offsets ? 4 : 1; var used_storage_offsets = u8_to_dataview(used_storage_u8); var offsets = []; for (var C = 0; C < used_storage_u8.length / 2; ++C) { var off = used_storage_offsets.getUint16(C * 2, true); if (off < 65535) offsets.push([C, off]); } if (offsets.length != cnt) throw "Expected ".concat(cnt, " cells, found ").concat(offsets.length); var cells = []; for (C = 0; C < offsets.length - 1; ++C) cells[offsets[C][0]] = used_storage.subarray(offsets[C][1] * width, offsets[C + 1][1] * width); if (offsets.length >= 1) cells[offsets[offsets.length - 1][0]] = used_storage.subarray(offsets[offsets.length - 1][1] * width); return { R: R, cells: cells }; } function parse_TST_Tile(M, root) { var _a; var pb = parse_shallow(root.data); var storage = ((_a = pb == null ? void 0 : pb[7]) == null ? void 0 : _a[0]) ? varint_to_i32(pb[7][0].data) >>> 0 > 0 ? 1 : 0 : -1; var ri = mappa(pb[5], function(u8) { return parse_TST_TileRowInfo(u8, storage); }); return { nrows: varint_to_i32(pb[4][0].data) >>> 0, data: ri.reduce(function(acc, x) { if (!acc[x.R]) acc[x.R] = []; x.cells.forEach(function(cell, C) { if (acc[x.R][C]) throw new Error("Duplicate cell r=".concat(x.R, " c=").concat(C)); acc[x.R][C] = cell; }); return acc; }, []) }; } function parse_TST_TableModelArchive(M, root, ws) { var _a; var pb = parse_shallow(root.data); var range = { s: { r: 0, c: 0 }, e: { r: 0, c: 0 } }; range.e.r = (varint_to_i32(pb[6][0].data) >>> 0) - 1; if (range.e.r < 0) throw new Error("Invalid row varint ".concat(pb[6][0].data)); range.e.c = (varint_to_i32(pb[7][0].data) >>> 0) - 1; if (range.e.c < 0) throw new Error("Invalid col varint ".concat(pb[7][0].data)); ws["!ref"] = encode_range(range); var store = parse_shallow(pb[4][0].data); var sst = parse_TST_TableDataList(M, M[parse_TSP_Reference(store[4][0].data)][0]); var rsst = ((_a = store[17]) == null ? void 0 : _a[0]) ? parse_TST_TableDataList(M, M[parse_TSP_Reference(store[17][0].data)][0]) : []; var tile = parse_shallow(store[3][0].data); var _R = 0; tile[1].forEach(function(t) { var tl = parse_shallow(t.data); var ref = M[parse_TSP_Reference(tl[2][0].data)][0]; var mtype = varint_to_i32(ref.meta[1][0].data); if (mtype != 6002) throw new Error("6001 unexpected reference to ".concat(mtype)); var _tile = parse_TST_Tile(M, ref); _tile.data.forEach(function(row, R) { row.forEach(function(buf, C) { var addr = encode_cell({ r: _R + R, c: C }); var res = parse_cell_storage(buf, sst, rsst); if (res) ws[addr] = res; }); }); _R += _tile.nrows; }); } function parse_TST_TableInfoArchive(M, root) { var pb = parse_shallow(root.data); var out = { "!ref": "A1" }; var tableref = M[parse_TSP_Reference(pb[2][0].data)]; var mtype = varint_to_i32(tableref[0].meta[1][0].data); if (mtype != 6001) throw new Error("6000 unexpected reference to ".concat(mtype)); parse_TST_TableModelArchive(M, tableref[0], out); return out; } function parse_TN_SheetArchive(M, root) { var _a; var pb = parse_shallow(root.data); var out = { name: ((_a = pb[1]) == null ? void 0 : _a[0]) ? u8str(pb[1][0].data) : "", sheets: [] }; var shapeoffs = mappa(pb[2], parse_TSP_Reference); shapeoffs.forEach(function(off) { M[off].forEach(function(m) { var mtype = varint_to_i32(m.meta[1][0].data); if (mtype == 6e3) out.sheets.push(parse_TST_TableInfoArchive(M, m)); }); }); return out; } function parse_TN_DocumentArchive(M, root) { var out = book_new(); var pb = parse_shallow(root.data); var sheetoffs = mappa(pb[1], parse_TSP_Reference); sheetoffs.forEach(function(off) { M[off].forEach(function(m) { var mtype = varint_to_i32(m.meta[1][0].data); if (mtype == 2) { var root2 = parse_TN_SheetArchive(M, m); root2.sheets.forEach(function(sheet, idx) { book_append_sheet(out, sheet, idx == 0 ? root2.name : root2.name + "_" + idx, true); }); } }); }); if (out.SheetNames.length == 0) throw new Error("Empty NUMBERS file"); return out; } function parse_numbers_iwa(cfb) { var _a, _b, _c, _d; var M = {}, indices = []; cfb.FullPaths.forEach(function(p) { if (p.match(/\.iwpv2/)) throw new Error("Unsupported password protection"); }); cfb.FileIndex.forEach(function(s) { if (!s.name.match(/\.iwa$/)) return; var o; try { o = decompress_iwa_file(s.content); } catch (e) { return console.log("?? " + s.content.length + " " + (e.message || e)); } var packets; try { packets = parse_iwa_file(o); } catch (e) { return console.log("## " + (e.message || e)); } packets.forEach(function(packet) { M[packet.id] = packet.messages; indices.push(packet.id); }); }); if (!indices.length) throw new Error("File has no messages"); var docroot = ((_d = (_c = (_b = (_a = M == null ? void 0 : M[1]) == null ? void 0 : _a[0]) == null ? void 0 : _b.meta) == null ? void 0 : _c[1]) == null ? void 0 : _d[0].data) && varint_to_i32(M[1][0].meta[1][0].data) == 1 && M[1][0]; if (!docroot) indices.forEach(function(idx) { M[idx].forEach(function(iwam) { var mtype = varint_to_i32(iwam.meta[1][0].data) >>> 0; if (mtype == 1) { if (!docroot) docroot = iwam; else throw new Error("Document has multiple roots"); } }); }); if (!docroot) throw new Error("Cannot find Document root"); return parse_TN_DocumentArchive(M, docroot); } function write_tile_row(tri, data, SST) { var _a, _b, _c, _d; if (!((_a = tri[6]) == null ? void 0 : _a[0]) || !((_b = tri[7]) == null ? void 0 : _b[0])) throw "Mutation only works on post-BNC storages!"; var wide_offsets = ((_d = (_c = tri[8]) == null ? void 0 : _c[0]) == null ? void 0 : _d.data) && varint_to_i32(tri[8][0].data) > 0 || false; if (wide_offsets) throw "Math only works with normal offsets"; var cnt = 0; var dv = u8_to_dataview(tri[7][0].data), last_offset = 0, cell_storage = []; var _dv = u8_to_dataview(tri[4][0].data), _last_offset = 0, _cell_storage = []; for (var C = 0; C < data.length; ++C) { if (data[C] == null) { dv.setUint16(C * 2, 65535, true); _dv.setUint16(C * 2, 65535); continue; } dv.setUint16(C * 2, last_offset, true); _dv.setUint16(C * 2, _last_offset, true); var celload, _celload; switch (typeof data[C]) { case "string": celload = write_new_storage({ t: "s", v: data[C] }, SST); _celload = write_old_storage({ t: "s", v: data[C] }, SST); break; case "number": celload = write_new_storage({ t: "n", v: data[C] }, SST); _celload = write_old_storage({ t: "n", v: data[C] }, SST); break; case "boolean": celload = write_new_storage({ t: "b", v: data[C] }, SST); _celload = write_old_storage({ t: "b", v: data[C] }, SST); break; default: throw new Error("Unsupported value " + data[C]); } cell_storage.push(celload); last_offset += celload.length; _cell_storage.push(_celload); _last_offset += _celload.length; ++cnt; } tri[2][0].data = write_varint49(cnt); for (; C < tri[7][0].data.length / 2; ++C) { dv.setUint16(C * 2, 65535, true); _dv.setUint16(C * 2, 65535, true); } tri[6][0].data = u8concat(cell_storage); tri[3][0].data = u8concat(_cell_storage); return cnt; } function write_numbers_iwa(wb, opts) { if (!opts || !opts.numbers) throw new Error("Must pass a `numbers` option -- check the README"); var ws = wb.Sheets[wb.SheetNames[0]]; if (wb.SheetNames.length > 1) console.error("The Numbers writer currently writes only the first table"); var range = decode_range(ws["!ref"]); range.s.r = range.s.c = 0; var trunc = false; if (range.e.c > 9) { trunc = true; range.e.c = 9; } if (range.e.r > 49) { trunc = true; range.e.r = 49; } if (trunc) console.error("The Numbers writer is currently limited to ".concat(encode_range(range))); var data = sheet_to_json(ws, { range: range, header: 1 }); var SST = ["~Sh33tJ5~"]; data.forEach(function(row) { return row.forEach(function(cell) { if (typeof cell == "string") SST.push(cell); }); }); var dependents = {}; var indices = []; var cfb = CFB.read(opts.numbers, { type: "base64" }); cfb.FileIndex.map(function(fi, idx) { return [fi, cfb.FullPaths[idx]]; }).forEach(function(row) { var fi = row[0], fp = row[1]; if (fi.type != 2) return; if (!fi.name.match(/\.iwa/)) return; var old_content = fi.content; var raw1 = decompress_iwa_file(old_content); var x2 = parse_iwa_file(raw1); x2.forEach(function(packet2) { indices.push(packet2.id); dependents[packet2.id] = { deps: [], location: fp, type: varint_to_i32(packet2.messages[0].meta[1][0].data) }; }); }); indices.sort(function(x2, y2) { return x2 - y2; }); var indices_varint = indices.filter(function(x2) { return x2 > 1; }).map(function(x2) { return [x2, write_varint49(x2)]; }); cfb.FileIndex.map(function(fi, idx) { return [fi, cfb.FullPaths[idx]]; }).forEach(function(row) { var fi = row[0], fp = row[1]; if (!fi.name.match(/\.iwa/)) return; var x2 = parse_iwa_file(decompress_iwa_file(fi.content)); x2.forEach(function(ia) { ia.messages.forEach(function(m) { indices_varint.forEach(function(ivi) { if (ia.messages.some(function(mess) { return varint_to_i32(mess.meta[1][0].data) != 11006 && u8contains(mess.data, ivi[1]); })) { dependents[ivi[0]].deps.push(ia.id); } }); }); }); }); function get_unique_msgid() { for (var i = 927262; i < 2e6; ++i) if (!dependents[i]) return i; throw new Error("Too many messages"); } var entry = CFB.find(cfb, dependents[1].location); var x = parse_iwa_file(decompress_iwa_file(entry.content)); var docroot; for (var xi = 0; xi < x.length; ++xi) { var packet = x[xi]; if (packet.id == 1) docroot = packet; } var sheetrootref = parse_TSP_Reference(parse_shallow(docroot.messages[0].data)[1][0].data); entry = CFB.find(cfb, dependents[sheetrootref].location); x = parse_iwa_file(decompress_iwa_file(entry.content)); for (xi = 0; xi < x.length; ++xi) { packet = x[xi]; if (packet.id == sheetrootref) docroot = packet; } sheetrootref = parse_TSP_Reference(parse_shallow(docroot.messages[0].data)[2][0].data); entry = CFB.find(cfb, dependents[sheetrootref].location); x = parse_iwa_file(decompress_iwa_file(entry.content)); for (xi = 0; xi < x.length; ++xi) { packet = x[xi]; if (packet.id == sheetrootref) docroot = packet; } sheetrootref = parse_TSP_Reference(parse_shallow(docroot.messages[0].data)[2][0].data); entry = CFB.find(cfb, dependents[sheetrootref].location); x = parse_iwa_file(decompress_iwa_file(entry.content)); for (xi = 0; xi < x.length; ++xi) { packet = x[xi]; if (packet.id == sheetrootref) docroot = packet; } var pb = parse_shallow(docroot.messages[0].data); { pb[6][0].data = write_varint49(range.e.r + 1); pb[7][0].data = write_varint49(range.e.c + 1); var cruidsref = parse_TSP_Reference(pb[46][0].data); var oldbucket = CFB.find(cfb, dependents[cruidsref].location); var _x = parse_iwa_file(decompress_iwa_file(oldbucket.content)); { for (var j = 0; j < _x.length; ++j) { if (_x[j].id == cruidsref) break; } if (_x[j].id != cruidsref) throw "Bad ColumnRowUIDMapArchive"; var cruids = parse_shallow(_x[j].messages[0].data); cruids[1] = []; cruids[2] = [], cruids[3] = []; for (var C = 0; C <= range.e.c; ++C) { var uuid = []; uuid[1] = uuid[2] = [{ type: 0, data: write_varint49(C + 420690) }]; cruids[1].push({ type: 2, data: write_shallow(uuid) }); cruids[2].push({ type: 0, data: write_varint49(C) }); cruids[3].push({ type: 0, data: write_varint49(C) }); } cruids[4] = []; cruids[5] = [], cruids[6] = []; for (var R = 0; R <= range.e.r; ++R) { uuid = []; uuid[1] = uuid[2] = [{ type: 0, data: write_varint49(R + 726270) }]; cruids[4].push({ type: 2, data: write_shallow(uuid) }); cruids[5].push({ type: 0, data: write_varint49(R) }); cruids[6].push({ type: 0, data: write_varint49(R) }); } _x[j].messages[0].data = write_shallow(cruids); } oldbucket.content = compress_iwa_file(write_iwa_file(_x)); oldbucket.size = oldbucket.content.length; delete pb[46]; var store = parse_shallow(pb[4][0].data); { store[7][0].data = write_varint49(range.e.r + 1); var row_headers = parse_shallow(store[1][0].data); var row_header_ref = parse_TSP_Reference(row_headers[2][0].data); oldbucket = CFB.find(cfb, dependents[row_header_ref].location); _x = parse_iwa_file(decompress_iwa_file(oldbucket.content)); { if (_x[0].id != row_header_ref) throw "Bad HeaderStorageBucket"; var base_bucket = parse_shallow(_x[0].messages[0].data); for (R = 0; R < data.length; ++R) { var _bucket = parse_shallow(base_bucket[2][0].data); _bucket[1][0].data = write_varint49(R); _bucket[4][0].data = write_varint49(data[R].length); base_bucket[2][R] = { type: base_bucket[2][0].type, data: write_shallow(_bucket) }; } _x[0].messages[0].data = write_shallow(base_bucket); } oldbucket.content = compress_iwa_file(write_iwa_file(_x)); oldbucket.size = oldbucket.content.length; var col_header_ref = parse_TSP_Reference(store[2][0].data); oldbucket = CFB.find(cfb, dependents[col_header_ref].location); _x = parse_iwa_file(decompress_iwa_file(oldbucket.content)); { if (_x[0].id != col_header_ref) throw "Bad HeaderStorageBucket"; base_bucket = parse_shallow(_x[0].messages[0].data); for (C = 0; C <= range.e.c; ++C) { _bucket = parse_shallow(base_bucket[2][0].data); _bucket[1][0].data = write_varint49(C); _bucket[4][0].data = write_varint49(range.e.r + 1); base_bucket[2][C] = { type: base_bucket[2][0].type, data: write_shallow(_bucket) }; } _x[0].messages[0].data = write_shallow(base_bucket); } oldbucket.content = compress_iwa_file(write_iwa_file(_x)); oldbucket.size = oldbucket.content.length; var sstref = parse_TSP_Reference(store[4][0].data); (function() { var sentry = CFB.find(cfb, dependents[sstref].location); var sx = parse_iwa_file(decompress_iwa_file(sentry.content)); var sstroot; for (var sxi = 0; sxi < sx.length; ++sxi) { var packet2 = sx[sxi]; if (packet2.id == sstref) sstroot = packet2; } var sstdata = parse_shallow(sstroot.messages[0].data); { sstdata[3] = []; var newsst = []; SST.forEach(function(str, i) { newsst[1] = [{ type: 0, data: write_varint49(i) }]; newsst[2] = [{ type: 0, data: write_varint49(1) }]; newsst[3] = [{ type: 2, data: stru8(str) }]; sstdata[3].push({ type: 2, data: write_shallow(newsst) }); }); } sstroot.messages[0].data = write_shallow(sstdata); var sy = write_iwa_file(sx); var raw32 = compress_iwa_file(sy); sentry.content = raw32; sentry.size = sentry.content.length; })(); var tile = parse_shallow(store[3][0].data); { var t = tile[1][0]; delete tile[2]; var tl = parse_shallow(t.data); { var tileref = parse_TSP_Reference(tl[2][0].data); (function() { var tentry = CFB.find(cfb, dependents[tileref].location); var tx = parse_iwa_file(decompress_iwa_file(tentry.content)); var tileroot; for (var sxi = 0; sxi < tx.length; ++sxi) { var packet2 = tx[sxi]; if (packet2.id == tileref) tileroot = packet2; } var tiledata = parse_shallow(tileroot.messages[0].data); { delete tiledata[6]; delete tile[7]; var rowload = new Uint8Array(tiledata[5][0].data); tiledata[5] = []; var cnt = 0; for (var R2 = 0; R2 <= range.e.r; ++R2) { var tilerow = parse_shallow(rowload); cnt += write_tile_row(tilerow, data[R2], SST); tilerow[1][0].data = write_varint49(R2); tiledata[5].push({ data: write_shallow(tilerow), type: 2 }); } tiledata[1] = [{ type: 0, data: write_varint49(range.e.c + 1) }]; tiledata[2] = [{ type: 0, data: write_varint49(range.e.r + 1) }]; tiledata[3] = [{ type: 0, data: write_varint49(cnt) }]; tiledata[4] = [{ type: 0, data: write_varint49(range.e.r + 1) }]; } tileroot.messages[0].data = write_shallow(tiledata); var ty = write_iwa_file(tx); var raw32 = compress_iwa_file(ty); tentry.content = raw32; tentry.size = tentry.content.length; })(); } t.data = write_shallow(tl); } store[3][0].data = write_shallow(tile); } pb[4][0].data = write_shallow(store); } docroot.messages[0].data = write_shallow(pb); var y = write_iwa_file(x); var raw3 = compress_iwa_file(y); entry.content = raw3; entry.size = entry.content.length; return cfb; } function fix_opts_func(defaults/*:Array >*/)/*:{(o:any):void}*/ { return function fix_opts(opts) { for(var i = 0; i != defaults.length; ++i) { var d = defaults[i]; if(opts[d[0]] === undefined) opts[d[0]] = d[1]; if(d[2] === 'n') opts[d[0]] = Number(opts[d[0]]); } }; } function fix_read_opts(opts) { fix_opts_func([ ['cellNF', false], /* emit cell number format string as .z */ ['cellHTML', true], /* emit html string as .h */ ['cellFormula', true], /* emit formulae as .f */ ['cellStyles', false], /* emits style/theme as .s */ ['cellText', true], /* emit formatted text as .w */ ['cellDates', false], /* emit date cells with type `d` */ ['sheetStubs', false], /* emit empty cells */ ['sheetRows', 0, 'n'], /* read n rows (0 = read all rows) */ ['bookDeps', false], /* parse calculation chains */ ['bookSheets', false], /* only try to get sheet names (no Sheets) */ ['bookProps', false], /* only try to get properties (no Sheets) */ ['bookFiles', false], /* include raw file structure (keys, files, cfb) */ ['bookVBA', false], /* include vba raw data (vbaraw) */ ['password',''], /* password */ ['WTF', false] /* WTF mode (throws errors) */ ])(opts); } function fix_write_opts(opts) { fix_opts_func([ ['cellDates', false], /* write date cells with type `d` */ ['bookSST', false], /* Generate Shared String Table */ ['bookType', 'xlsx'], /* Type of workbook (xlsx/m/b) */ ['compression', false], /* Use file compression */ ['WTF', false] /* WTF mode (throws errors) */ ])(opts); } function get_sheet_type(n/*:string*/)/*:string*/ { if(RELS.WS.indexOf(n) > -1) return "sheet"; if(RELS.CS && n == RELS.CS) return "chart"; if(RELS.DS && n == RELS.DS) return "dialog"; if(RELS.MS && n == RELS.MS) return "macro"; return (n && n.length) ? n : "sheet"; } function safe_parse_wbrels(wbrels, sheets) { if(!wbrels) return 0; try { wbrels = sheets.map(function pwbr(w) { if(!w.id) w.id = w.strRelID; return [w.name, wbrels['!id'][w.id].Target, get_sheet_type(wbrels['!id'][w.id].Type)]; }); } catch(e) { return null; } return !wbrels || wbrels.length === 0 ? null : wbrels; } function safe_parse_sheet(zip, path/*:string*/, relsPath/*:string*/, sheet, idx/*:number*/, sheetRels, sheets, stype/*:string*/, opts, wb, themes, styles) { try { sheetRels[sheet]=parse_rels(getzipstr(zip, relsPath, true), path); var data = getzipdata(zip, path); var _ws; switch(stype) { case 'sheet': _ws = parse_ws(data, path, idx, opts, sheetRels[sheet], wb, themes, styles); break; case 'chart': _ws = parse_cs(data, path, idx, opts, sheetRels[sheet], wb, themes, styles); if(!_ws || !_ws['!drawel']) break; var dfile = resolve_path(_ws['!drawel'].Target, path); var drelsp = get_rels_path(dfile); var draw = parse_drawing(getzipstr(zip, dfile, true), parse_rels(getzipstr(zip, drelsp, true), dfile)); var chartp = resolve_path(draw, dfile); var crelsp = get_rels_path(chartp); _ws = parse_chart(getzipstr(zip, chartp, true), chartp, opts, parse_rels(getzipstr(zip, crelsp, true), chartp), wb, _ws); break; case 'macro': _ws = parse_ms(data, path, idx, opts, sheetRels[sheet], wb, themes, styles); break; case 'dialog': _ws = parse_ds(data, path, idx, opts, sheetRels[sheet], wb, themes, styles); break; default: throw new Error("Unrecognized sheet type " + stype); } sheets[sheet] = _ws; /* scan rels for comments and threaded comments */ var tcomments = []; if(sheetRels && sheetRels[sheet]) keys(sheetRels[sheet]).forEach(function(n) { var dfile = ""; if(sheetRels[sheet][n].Type == RELS.CMNT) { dfile = resolve_path(sheetRels[sheet][n].Target, path); var comments = parse_cmnt(getzipdata(zip, dfile, true), dfile, opts); if(!comments || !comments.length) return; sheet_insert_comments(_ws, comments, false); } if(sheetRels[sheet][n].Type == RELS.TCMNT) { dfile = resolve_path(sheetRels[sheet][n].Target, path); tcomments = tcomments.concat(parse_tcmnt_xml(getzipdata(zip, dfile, true), opts)); } }); if(tcomments && tcomments.length) sheet_insert_comments(_ws, tcomments, true, opts.people || []); } catch(e) { if(opts.WTF) throw e; } } function strip_front_slash(x/*:string*/)/*:string*/ { return x.charAt(0) == '/' ? x.slice(1) : x; } function parse_zip(zip/*:ZIP*/, opts/*:?ParseOpts*/)/*:Workbook*/ { make_ssf(); opts = opts || {}; fix_read_opts(opts); /* OpenDocument Part 3 Section 2.2.1 OpenDocument Package */ if(safegetzipfile(zip, 'META-INF/manifest.xml')) return parse_ods(zip, opts); /* UOC */ if(safegetzipfile(zip, 'objectdata.xml')) return parse_ods(zip, opts); /* Numbers */ if(safegetzipfile(zip, 'Index/Document.iwa')) { if(typeof Uint8Array == "undefined") throw new Error('NUMBERS file parsing requires Uint8Array support'); if(typeof parse_numbers_iwa != "undefined") { if(zip.FileIndex) return parse_numbers_iwa(zip); var _zip = CFB.utils.cfb_new(); zipentries(zip).forEach(function(e) { zip_add_file(_zip, e, getzipbin(zip, e)); }); return parse_numbers_iwa(_zip); } throw new Error('Unsupported NUMBERS file'); } if(!safegetzipfile(zip, '[Content_Types].xml')) { if(safegetzipfile(zip, 'index.xml.gz')) throw new Error('Unsupported NUMBERS 08 file'); if(safegetzipfile(zip, 'index.xml')) throw new Error('Unsupported NUMBERS 09 file'); throw new Error('Unsupported ZIP file'); } var entries = zipentries(zip); var dir = parse_ct((getzipstr(zip, '[Content_Types].xml')/*:?any*/)); var xlsb = false; var sheets, binname; if(dir.workbooks.length === 0) { binname = "xl/workbook.xml"; if(getzipdata(zip,binname, true)) dir.workbooks.push(binname); } if(dir.workbooks.length === 0) { binname = "xl/workbook.bin"; if(!getzipdata(zip,binname,true)) throw new Error("Could not find workbook"); dir.workbooks.push(binname); xlsb = true; } if(dir.workbooks[0].slice(-3) == "bin") xlsb = true; var themes = ({}/*:any*/); var styles = ({}/*:any*/); if(!opts.bookSheets && !opts.bookProps) { strs = []; if(dir.sst) try { strs=parse_sst(getzipdata(zip, strip_front_slash(dir.sst)), dir.sst, opts); } catch(e) { if(opts.WTF) throw e; } if(opts.cellStyles && dir.themes.length) themes = parse_theme(getzipstr(zip, dir.themes[0].replace(/^\//,''), true)||"",dir.themes[0], opts); if(dir.style) styles = parse_sty(getzipdata(zip, strip_front_slash(dir.style)), dir.style, themes, opts); } /*var externbooks = */dir.links.map(function(link) { try { var rels = parse_rels(getzipstr(zip, get_rels_path(strip_front_slash(link))), link); return parse_xlink(getzipdata(zip, strip_front_slash(link)), rels, link, opts); } catch(e) {} }); var wb = parse_wb(getzipdata(zip, strip_front_slash(dir.workbooks[0])), dir.workbooks[0], opts); var props = {}, propdata = ""; if(dir.coreprops.length) { propdata = getzipdata(zip, strip_front_slash(dir.coreprops[0]), true); if(propdata) props = parse_core_props(propdata); if(dir.extprops.length !== 0) { propdata = getzipdata(zip, strip_front_slash(dir.extprops[0]), true); if(propdata) parse_ext_props(propdata, props, opts); } } var custprops = {}; if(!opts.bookSheets || opts.bookProps) { if (dir.custprops.length !== 0) { propdata = getzipstr(zip, strip_front_slash(dir.custprops[0]), true); if(propdata) custprops = parse_cust_props(propdata, opts); } } var out = ({}/*:any*/); if(opts.bookSheets || opts.bookProps) { if(wb.Sheets) sheets = wb.Sheets.map(function pluck(x){ return x.name; }); else if(props.Worksheets && props.SheetNames.length > 0) sheets=props.SheetNames; if(opts.bookProps) { out.Props = props; out.Custprops = custprops; } if(opts.bookSheets && typeof sheets !== 'undefined') out.SheetNames = sheets; if(opts.bookSheets ? out.SheetNames : opts.bookProps) return out; } sheets = {}; var deps = {}; if(opts.bookDeps && dir.calcchain) deps=parse_cc(getzipdata(zip, strip_front_slash(dir.calcchain)),dir.calcchain,opts); var i=0; var sheetRels = ({}/*:any*/); var path, relsPath; { var wbsheets = wb.Sheets; props.Worksheets = wbsheets.length; props.SheetNames = []; for(var j = 0; j != wbsheets.length; ++j) { props.SheetNames[j] = wbsheets[j].name; } } var wbext = xlsb ? "bin" : "xml"; var wbrelsi = dir.workbooks[0].lastIndexOf("/"); var wbrelsfile = (dir.workbooks[0].slice(0, wbrelsi+1) + "_rels/" + dir.workbooks[0].slice(wbrelsi+1) + ".rels").replace(/^\//,""); if(!safegetzipfile(zip, wbrelsfile)) wbrelsfile = 'xl/_rels/workbook.' + wbext + '.rels'; var wbrels = parse_rels(getzipstr(zip, wbrelsfile, true), wbrelsfile.replace(/_rels.*/, "s5s")); if((dir.metadata || []).length >= 1) { /* TODO: MDX and other types of metadata */ opts.xlmeta = parse_xlmeta(getzipdata(zip, strip_front_slash(dir.metadata[0])),dir.metadata[0],opts); } if((dir.people || []).length >= 1) { opts.people = parse_people_xml(getzipdata(zip, strip_front_slash(dir.people[0])),opts); } if(wbrels) wbrels = safe_parse_wbrels(wbrels, wb.Sheets); /* Numbers iOS hack */ var nmode = (getzipdata(zip,"xl/worksheets/sheet.xml",true))?1:0; wsloop: for(i = 0; i != props.Worksheets; ++i) { var stype = "sheet"; if(wbrels && wbrels[i]) { path = 'xl/' + (wbrels[i][1]).replace(/[\/]?xl\//, ""); if(!safegetzipfile(zip, path)) path = wbrels[i][1]; if(!safegetzipfile(zip, path)) path = wbrelsfile.replace(/_rels\/.*$/,"") + wbrels[i][1]; stype = wbrels[i][2]; } else { path = 'xl/worksheets/sheet'+(i+1-nmode)+"." + wbext; path = path.replace(/sheet0\./,"sheet."); } relsPath = path.replace(/^(.*)(\/)([^\/]*)$/, "$1/_rels/$3.rels"); if(opts && opts.sheets != null) switch(typeof opts.sheets) { case "number": if(i != opts.sheets) continue wsloop; break; case "string": if(props.SheetNames[i].toLowerCase() != opts.sheets.toLowerCase()) continue wsloop; break; default: if(Array.isArray && Array.isArray(opts.sheets)) { var snjseen = false; for(var snj = 0; snj != opts.sheets.length; ++snj) { if(typeof opts.sheets[snj] == "number" && opts.sheets[snj] == i) snjseen=1; if(typeof opts.sheets[snj] == "string" && opts.sheets[snj].toLowerCase() == props.SheetNames[i].toLowerCase()) snjseen = 1; } if(!snjseen) continue wsloop; } } safe_parse_sheet(zip, path, relsPath, props.SheetNames[i], i, sheetRels, sheets, stype, opts, wb, themes, styles); } out = ({ Directory: dir, Workbook: wb, Props: props, Custprops: custprops, Deps: deps, Sheets: sheets, SheetNames: props.SheetNames, Strings: strs, Styles: styles, Themes: themes, SSF: dup(table_fmt) }/*:any*/); if(opts && opts.bookFiles) { if(zip.files) { out.keys = entries; out.files = zip.files; } else { out.keys = []; out.files = {}; zip.FullPaths.forEach(function(p, idx) { p = p.replace(/^Root Entry[\/]/, ""); out.keys.push(p); out.files[p] = zip.FileIndex[idx]; }); } } if(opts && opts.bookVBA) { if(dir.vba.length > 0) out.vbaraw = getzipdata(zip,strip_front_slash(dir.vba[0]),true); else if(dir.defaults && dir.defaults.bin === CT_VBA) out.vbaraw = getzipdata(zip, 'xl/vbaProject.bin',true); } return out; } /* [MS-OFFCRYPTO] 2.1.1 */ function parse_xlsxcfb(cfb, _opts/*:?ParseOpts*/)/*:Workbook*/ { var opts = _opts || {}; var f = 'Workbook', data = CFB.find(cfb, f); try { f = '/!DataSpaces/Version'; data = CFB.find(cfb, f); if(!data || !data.content) throw new Error("ECMA-376 Encrypted file missing " + f); /*var version = */parse_DataSpaceVersionInfo(data.content); /* 2.3.4.1 */ f = '/!DataSpaces/DataSpaceMap'; data = CFB.find(cfb, f); if(!data || !data.content) throw new Error("ECMA-376 Encrypted file missing " + f); var dsm = parse_DataSpaceMap(data.content); if(dsm.length !== 1 || dsm[0].comps.length !== 1 || dsm[0].comps[0].t !== 0 || dsm[0].name !== "StrongEncryptionDataSpace" || dsm[0].comps[0].v !== "EncryptedPackage") throw new Error("ECMA-376 Encrypted file bad " + f); /* 2.3.4.2 */ f = '/!DataSpaces/DataSpaceInfo/StrongEncryptionDataSpace'; data = CFB.find(cfb, f); if(!data || !data.content) throw new Error("ECMA-376 Encrypted file missing " + f); var seds = parse_DataSpaceDefinition(data.content); if(seds.length != 1 || seds[0] != "StrongEncryptionTransform") throw new Error("ECMA-376 Encrypted file bad " + f); /* 2.3.4.3 */ f = '/!DataSpaces/TransformInfo/StrongEncryptionTransform/!Primary'; data = CFB.find(cfb, f); if(!data || !data.content) throw new Error("ECMA-376 Encrypted file missing " + f); /*var hdr = */parse_Primary(data.content); } catch(e) {} f = '/EncryptionInfo'; data = CFB.find(cfb, f); if(!data || !data.content) throw new Error("ECMA-376 Encrypted file missing " + f); var einfo = parse_EncryptionInfo(data.content); /* 2.3.4.4 */ f = '/EncryptedPackage'; data = CFB.find(cfb, f); if(!data || !data.content) throw new Error("ECMA-376 Encrypted file missing " + f); /*global decrypt_agile */ /*:: declare var decrypt_agile:any; */ if(einfo[0] == 0x04 && typeof decrypt_agile !== 'undefined') return decrypt_agile(einfo[1], data.content, opts.password || "", opts); /*global decrypt_std76 */ /*:: declare var decrypt_std76:any; */ if(einfo[0] == 0x02 && typeof decrypt_std76 !== 'undefined') return decrypt_std76(einfo[1], data.content, opts.password || "", opts); throw new Error("File is password-protected"); } function write_zip(wb/*:Workbook*/, opts/*:WriteOpts*/)/*:ZIP*/ { if(opts.bookType == "ods") return write_ods(wb, opts); if(opts.bookType == "numbers") return write_numbers_iwa(wb, opts); if(opts.bookType == "xlsb") return write_zip_xlsxb(wb, opts); return write_zip_xlsx(wb, opts); } /* XLSX and XLSB writing are very similar. Originally they were unified in one export function. This is horrible for tree shaking in the common case (most applications need to export files in one format) so this function supports both formats while write_zip_xlsx only handles XLSX */ function write_zip_xlsxb(wb/*:Workbook*/, opts/*:WriteOpts*/)/*:ZIP*/ { _shapeid = 1024; if(wb && !wb.SSF) { wb.SSF = dup(table_fmt); } if(wb && wb.SSF) { make_ssf(); SSF_load_table(wb.SSF); // $FlowIgnore opts.revssf = evert_num(wb.SSF); opts.revssf[wb.SSF[65535]] = 0; opts.ssf = wb.SSF; } opts.rels = {}; opts.wbrels = {}; opts.Strings = /*::((*/[]/*:: :any):SST)*/; opts.Strings.Count = 0; opts.Strings.Unique = 0; if(browser_has_Map) opts.revStrings = new Map(); else { opts.revStrings = {}; opts.revStrings.foo = []; delete opts.revStrings.foo; } var wbext = opts.bookType == "xlsb" ? "bin" : "xml"; var vbafmt = VBAFMTS.indexOf(opts.bookType) > -1; var ct = new_ct(); fix_write_opts(opts = opts || {}); var zip = zip_new(); var f = "", rId = 0; opts.cellXfs = []; get_cell_style(opts.cellXfs, {}, {revssf:{"General":0}}); if(!wb.Props) wb.Props = {}; f = "docProps/core.xml"; zip_add_file(zip, f, write_core_props(wb.Props, opts)); ct.coreprops.push(f); add_rels(opts.rels, 2, f, RELS.CORE_PROPS); /*::if(!wb.Props) throw "unreachable"; */ f = "docProps/app.xml"; if(wb.Props && wb.Props.SheetNames){/* empty */} else if(!wb.Workbook || !wb.Workbook.Sheets) wb.Props.SheetNames = wb.SheetNames; else { var _sn = []; for(var _i = 0; _i < wb.SheetNames.length; ++_i) if((wb.Workbook.Sheets[_i]||{}).Hidden != 2) _sn.push(wb.SheetNames[_i]); wb.Props.SheetNames = _sn; } wb.Props.Worksheets = wb.Props.SheetNames.length; zip_add_file(zip, f, write_ext_props(wb.Props, opts)); ct.extprops.push(f); add_rels(opts.rels, 3, f, RELS.EXT_PROPS); if(wb.Custprops !== wb.Props && keys(wb.Custprops||{}).length > 0) { f = "docProps/custom.xml"; zip_add_file(zip, f, write_cust_props(wb.Custprops, opts)); ct.custprops.push(f); add_rels(opts.rels, 4, f, RELS.CUST_PROPS); } for(rId=1;rId <= wb.SheetNames.length; ++rId) { var wsrels = {'!id':{}}; var ws = wb.Sheets[wb.SheetNames[rId-1]]; var _type = (ws || {})["!type"] || "sheet"; switch(_type) { case "chart": /* falls through */ default: f = "xl/worksheets/sheet" + rId + "." + wbext; zip_add_file(zip, f, write_ws(rId-1, f, opts, wb, wsrels)); ct.sheets.push(f); add_rels(opts.wbrels, -1, "worksheets/sheet" + rId + "." + wbext, RELS.WS[0]); } if(ws) { var comments = ws['!comments']; var need_vml = false; var cf = ""; if(comments && comments.length > 0) { cf = "xl/comments" + rId + "." + wbext; zip_add_file(zip, cf, write_cmnt(comments, cf, opts)); ct.comments.push(cf); add_rels(wsrels, -1, "../comments" + rId + "." + wbext, RELS.CMNT); need_vml = true; } if(ws['!legacy']) { if(need_vml) zip_add_file(zip, "xl/drawings/vmlDrawing" + (rId) + ".vml", write_comments_vml(rId, ws['!comments'])); } delete ws['!comments']; delete ws['!legacy']; } if(wsrels['!id'].rId1) zip_add_file(zip, get_rels_path(f), write_rels(wsrels)); } if(opts.Strings != null && opts.Strings.length > 0) { f = "xl/sharedStrings." + wbext; zip_add_file(zip, f, write_sst(opts.Strings, f, opts)); ct.strs.push(f); add_rels(opts.wbrels, -1, "sharedStrings." + wbext, RELS.SST); } f = "xl/workbook." + wbext; zip_add_file(zip, f, write_wb(wb, f, opts)); ct.workbooks.push(f); add_rels(opts.rels, 1, f, RELS.WB); /* TODO: something more intelligent with themes */ f = "xl/theme/theme1.xml"; zip_add_file(zip, f, write_theme(wb.Themes, opts)); ct.themes.push(f); add_rels(opts.wbrels, -1, "theme/theme1.xml", RELS.THEME); /* TODO: something more intelligent with styles */ f = "xl/styles." + wbext; zip_add_file(zip, f, write_sty(wb, f, opts)); ct.styles.push(f); add_rels(opts.wbrels, -1, "styles." + wbext, RELS.STY); if(wb.vbaraw && vbafmt) { f = "xl/vbaProject.bin"; zip_add_file(zip, f, wb.vbaraw); ct.vba.push(f); add_rels(opts.wbrels, -1, "vbaProject.bin", RELS.VBA); } f = "xl/metadata." + wbext; zip_add_file(zip, f, write_xlmeta(f)); ct.metadata.push(f); add_rels(opts.wbrels, -1, "metadata." + wbext, RELS.XLMETA); zip_add_file(zip, "[Content_Types].xml", write_ct(ct, opts)); zip_add_file(zip, '_rels/.rels', write_rels(opts.rels)); zip_add_file(zip, 'xl/_rels/workbook.' + wbext + '.rels', write_rels(opts.wbrels)); delete opts.revssf; delete opts.ssf; return zip; } function write_zip_xlsx(wb/*:Workbook*/, opts/*:WriteOpts*/)/*:ZIP*/ { _shapeid = 1024; if(wb && !wb.SSF) { wb.SSF = dup(table_fmt); } if(wb && wb.SSF) { make_ssf(); SSF_load_table(wb.SSF); // $FlowIgnore opts.revssf = evert_num(wb.SSF); opts.revssf[wb.SSF[65535]] = 0; opts.ssf = wb.SSF; } opts.rels = {}; opts.wbrels = {}; opts.Strings = /*::((*/[]/*:: :any):SST)*/; opts.Strings.Count = 0; opts.Strings.Unique = 0; if(browser_has_Map) opts.revStrings = new Map(); else { opts.revStrings = {}; opts.revStrings.foo = []; delete opts.revStrings.foo; } var wbext = "xml"; var vbafmt = VBAFMTS.indexOf(opts.bookType) > -1; var ct = new_ct(); fix_write_opts(opts = opts || {}); var zip = zip_new(); var f = "", rId = 0; opts.cellXfs = []; get_cell_style(opts.cellXfs, {}, {revssf:{"General":0}}); if(!wb.Props) wb.Props = {}; f = "docProps/core.xml"; zip_add_file(zip, f, write_core_props(wb.Props, opts)); ct.coreprops.push(f); add_rels(opts.rels, 2, f, RELS.CORE_PROPS); /*::if(!wb.Props) throw "unreachable"; */ f = "docProps/app.xml"; if(wb.Props && wb.Props.SheetNames){/* empty */} else if(!wb.Workbook || !wb.Workbook.Sheets) wb.Props.SheetNames = wb.SheetNames; else { var _sn = []; for(var _i = 0; _i < wb.SheetNames.length; ++_i) if((wb.Workbook.Sheets[_i]||{}).Hidden != 2) _sn.push(wb.SheetNames[_i]); wb.Props.SheetNames = _sn; } wb.Props.Worksheets = wb.Props.SheetNames.length; zip_add_file(zip, f, write_ext_props(wb.Props, opts)); ct.extprops.push(f); add_rels(opts.rels, 3, f, RELS.EXT_PROPS); if(wb.Custprops !== wb.Props && keys(wb.Custprops||{}).length > 0) { f = "docProps/custom.xml"; zip_add_file(zip, f, write_cust_props(wb.Custprops, opts)); ct.custprops.push(f); add_rels(opts.rels, 4, f, RELS.CUST_PROPS); } var people = ["SheetJ5"]; opts.tcid = 0; for(rId=1;rId <= wb.SheetNames.length; ++rId) { var wsrels = {'!id':{}}; var ws = wb.Sheets[wb.SheetNames[rId-1]]; var _type = (ws || {})["!type"] || "sheet"; switch(_type) { case "chart": /* falls through */ default: f = "xl/worksheets/sheet" + rId + "." + wbext; zip_add_file(zip, f, write_ws_xml(rId-1, opts, wb, wsrels)); ct.sheets.push(f); add_rels(opts.wbrels, -1, "worksheets/sheet" + rId + "." + wbext, RELS.WS[0]); } if(ws) { var comments = ws['!comments']; var need_vml = false; var cf = ""; if(comments && comments.length > 0) { var needtc = false; comments.forEach(function(carr) { carr[1].forEach(function(c) { if(c.T == true) needtc = true; }); }); if(needtc) { cf = "xl/threadedComments/threadedComment" + rId + "." + wbext; zip_add_file(zip, cf, write_tcmnt_xml(comments, people, opts)); ct.threadedcomments.push(cf); add_rels(wsrels, -1, "../threadedComments/threadedComment" + rId + "." + wbext, RELS.TCMNT); } cf = "xl/comments" + rId + "." + wbext; zip_add_file(zip, cf, write_comments_xml(comments, opts)); ct.comments.push(cf); add_rels(wsrels, -1, "../comments" + rId + "." + wbext, RELS.CMNT); need_vml = true; } if(ws['!legacy']) { if(need_vml) zip_add_file(zip, "xl/drawings/vmlDrawing" + (rId) + ".vml", write_comments_vml(rId, ws['!comments'])); } delete ws['!comments']; delete ws['!legacy']; } if(wsrels['!id'].rId1) zip_add_file(zip, get_rels_path(f), write_rels(wsrels)); } if(opts.Strings != null && opts.Strings.length > 0) { f = "xl/sharedStrings." + wbext; zip_add_file(zip, f, write_sst_xml(opts.Strings, opts)); ct.strs.push(f); add_rels(opts.wbrels, -1, "sharedStrings." + wbext, RELS.SST); } f = "xl/workbook." + wbext; zip_add_file(zip, f, write_wb_xml(wb, opts)); ct.workbooks.push(f); add_rels(opts.rels, 1, f, RELS.WB); /* TODO: something more intelligent with themes */ f = "xl/theme/theme1.xml"; zip_add_file(zip, f, write_theme(wb.Themes, opts)); ct.themes.push(f); add_rels(opts.wbrels, -1, "theme/theme1.xml", RELS.THEME); /* TODO: something more intelligent with styles */ f = "xl/styles." + wbext; zip_add_file(zip, f, write_sty_xml(wb, opts)); ct.styles.push(f); add_rels(opts.wbrels, -1, "styles." + wbext, RELS.STY); if(wb.vbaraw && vbafmt) { f = "xl/vbaProject.bin"; zip_add_file(zip, f, wb.vbaraw); ct.vba.push(f); add_rels(opts.wbrels, -1, "vbaProject.bin", RELS.VBA); } f = "xl/metadata." + wbext; zip_add_file(zip, f, write_xlmeta_xml()); ct.metadata.push(f); add_rels(opts.wbrels, -1, "metadata." + wbext, RELS.XLMETA); if(people.length > 1) { f = "xl/persons/person.xml"; zip_add_file(zip, f, write_people_xml(people, opts)); ct.people.push(f); add_rels(opts.wbrels, -1, "persons/person.xml", RELS.PEOPLE); } zip_add_file(zip, "[Content_Types].xml", write_ct(ct, opts)); zip_add_file(zip, '_rels/.rels', write_rels(opts.rels)); zip_add_file(zip, 'xl/_rels/workbook.' + wbext + '.rels', write_rels(opts.wbrels)); delete opts.revssf; delete opts.ssf; return zip; } function firstbyte(f/*:RawData*/,o/*:?TypeOpts*/)/*:Array*/ { var x = ""; switch((o||{}).type || "base64") { case 'buffer': return [f[0], f[1], f[2], f[3], f[4], f[5], f[6], f[7]]; case 'base64': x = Base64_decode(f.slice(0,12)); break; case 'binary': x = f; break; case 'array': return [f[0], f[1], f[2], f[3], f[4], f[5], f[6], f[7]]; default: throw new Error("Unrecognized type " + (o && o.type || "undefined")); } return [x.charCodeAt(0), x.charCodeAt(1), x.charCodeAt(2), x.charCodeAt(3), x.charCodeAt(4), x.charCodeAt(5), x.charCodeAt(6), x.charCodeAt(7)]; } function read_cfb(cfb/*:CFBContainer*/, opts/*:?ParseOpts*/)/*:Workbook*/ { if(CFB.find(cfb, "EncryptedPackage")) return parse_xlsxcfb(cfb, opts); return parse_xlscfb(cfb, opts); } function read_zip(data/*:RawData*/, opts/*:?ParseOpts*/)/*:Workbook*/ { var zip, d = data; var o = opts||{}; if(!o.type) o.type = (has_buf && Buffer.isBuffer(data)) ? "buffer" : "base64"; zip = zip_read(d, o); return parse_zip(zip, o); } function read_plaintext(data/*:string*/, o/*:ParseOpts*/)/*:Workbook*/ { var i = 0; main: while(i < data.length) switch(data.charCodeAt(i)) { case 0x0A: case 0x0D: case 0x20: ++i; break; case 0x3C: return parse_xlml(data.slice(i),o); default: break main; } return PRN.to_workbook(data, o); } function read_plaintext_raw(data/*:RawData*/, o/*:ParseOpts*/)/*:Workbook*/ { var str = "", bytes = firstbyte(data, o); switch(o.type) { case 'base64': str = Base64_decode(data); break; case 'binary': str = data; break; case 'buffer': str = data.toString('binary'); break; case 'array': str = cc2str(data); break; default: throw new Error("Unrecognized type " + o.type); } if(bytes[0] == 0xEF && bytes[1] == 0xBB && bytes[2] == 0xBF) str = utf8read(str); o.type = "binary"; return read_plaintext(str, o); } function read_utf16(data/*:RawData*/, o/*:ParseOpts*/)/*:Workbook*/ { var d = data; if(o.type == 'base64') d = Base64_decode(d); d = $cptable.utils.decode(1200, d.slice(2), 'str'); o.type = "binary"; return read_plaintext(d, o); } function bstrify(data/*:string*/)/*:string*/ { return !data.match(/[^\x00-\x7F]/) ? data : utf8write(data); } function read_prn(data, d, o, str) { if(str) { o.type = "string"; return PRN.to_workbook(data, o); } return PRN.to_workbook(d, o); } function readSync(data/*:RawData*/, opts/*:?ParseOpts*/)/*:Workbook*/ { reset_cp(); var o = opts||{}; if(typeof ArrayBuffer !== 'undefined' && data instanceof ArrayBuffer) return readSync(new Uint8Array(data), (o = dup(o), o.type = "array", o)); if(typeof Uint8Array !== 'undefined' && data instanceof Uint8Array && !o.type) o.type = typeof Deno !== "undefined" ? "buffer" : "array"; var d = data, n = [0,0,0,0], str = false; if(o.cellStyles) { o.cellNF = true; o.sheetStubs = true; } _ssfopts = {}; if(o.dateNF) _ssfopts.dateNF = o.dateNF; if(!o.type) o.type = (has_buf && Buffer.isBuffer(data)) ? "buffer" : "base64"; if(o.type == "file") { o.type = has_buf ? "buffer" : "binary"; d = read_binary(data); if(typeof Uint8Array !== 'undefined' && !has_buf) o.type = "array"; } if(o.type == "string") { str = true; o.type = "binary"; o.codepage = 65001; d = bstrify(data); } if(o.type == 'array' && typeof Uint8Array !== 'undefined' && data instanceof Uint8Array && typeof ArrayBuffer !== 'undefined') { // $FlowIgnore var ab=new ArrayBuffer(3), vu=new Uint8Array(ab); vu.foo="bar"; // $FlowIgnore if(!vu.foo) {o=dup(o); o.type='array'; return readSync(ab2a(d), o);} } switch((n = firstbyte(d, o))[0]) { case 0xD0: if(n[1] === 0xCF && n[2] === 0x11 && n[3] === 0xE0 && n[4] === 0xA1 && n[5] === 0xB1 && n[6] === 0x1A && n[7] === 0xE1) return read_cfb(CFB.read(d, o), o); break; case 0x09: if(n[1] <= 0x08) return parse_xlscfb(d, o); break; case 0x3C: return parse_xlml(d, o); case 0x49: if(n[1] === 0x49 && n[2] === 0x2a && n[3] === 0x00) throw new Error("TIFF Image File is not a spreadsheet"); if(n[1] === 0x44) return read_wb_ID(d, o); break; case 0x54: if(n[1] === 0x41 && n[2] === 0x42 && n[3] === 0x4C) return DIF.to_workbook(d, o); break; case 0x50: return (n[1] === 0x4B && n[2] < 0x09 && n[3] < 0x09) ? read_zip(d, o) : read_prn(data, d, o, str); case 0xEF: return n[3] === 0x3C ? parse_xlml(d, o) : read_prn(data, d, o, str); case 0xFF: if(n[1] === 0xFE) { return read_utf16(d, o); } else if(n[1] === 0x00 && n[2] === 0x02 && n[3] === 0x00) return WK_.to_workbook(d, o); break; case 0x00: if(n[1] === 0x00) { if(n[2] >= 0x02 && n[3] === 0x00) return WK_.to_workbook(d, o); if(n[2] === 0x00 && (n[3] === 0x08 || n[3] === 0x09)) return WK_.to_workbook(d, o); } break; case 0x03: case 0x83: case 0x8B: case 0x8C: return DBF.to_workbook(d, o); case 0x7B: if(n[1] === 0x5C && n[2] === 0x72 && n[3] === 0x74) return RTF.to_workbook(d, o); break; case 0x0A: case 0x0D: case 0x20: return read_plaintext_raw(d, o); case 0x89: if(n[1] === 0x50 && n[2] === 0x4E && n[3] === 0x47) throw new Error("PNG Image File is not a spreadsheet"); break; } if(DBF_SUPPORTED_VERSIONS.indexOf(n[0]) > -1 && n[2] <= 12 && n[3] <= 31) return DBF.to_workbook(d, o); return read_prn(data, d, o, str); } function readFileSync(filename/*:string*/, opts/*:?ParseOpts*/)/*:Workbook*/ { var o = opts||{}; o.type = 'file'; return readSync(filename, o); } function write_cfb_ctr(cfb/*:CFBContainer*/, o/*:WriteOpts*/)/*:any*/ { switch(o.type) { case "base64": case "binary": break; case "buffer": case "array": o.type = ""; break; case "file": return write_dl(o.file, CFB.write(cfb, {type:has_buf ? 'buffer' : ""})); case "string": throw new Error("'string' output type invalid for '" + o.bookType + "' files"); default: throw new Error("Unrecognized type " + o.type); } return CFB.write(cfb, o); } /*:: declare var encrypt_agile:any; */ function write_zip_type(wb/*:Workbook*/, opts/*:?WriteOpts*/)/*:any*/ { var o = dup(opts||{}); var z = write_zip(wb, o); return write_zip_denouement(z, o); } function write_zip_typeXLSX(wb/*:Workbook*/, opts/*:?WriteOpts*/)/*:any*/ { var o = dup(opts||{}); var z = write_zip_xlsx(wb, o); return write_zip_denouement(z, o); } function write_zip_denouement(z/*:any*/, o/*:?WriteOpts*/)/*:any*/ { var oopts = {}; var ftype = has_buf ? "nodebuffer" : (typeof Uint8Array !== "undefined" ? "array" : "string"); if(o.compression) oopts.compression = 'DEFLATE'; if(o.password) oopts.type = ftype; else switch(o.type) { case "base64": oopts.type = "base64"; break; case "binary": oopts.type = "string"; break; case "string": throw new Error("'string' output type invalid for '" + o.bookType + "' files"); case "buffer": case "file": oopts.type = ftype; break; default: throw new Error("Unrecognized type " + o.type); } var out = z.FullPaths ? CFB.write(z, {fileType:"zip", type: /*::(*/{"nodebuffer": "buffer", "string": "binary"}/*:: :any)*/[oopts.type] || oopts.type, compression: !!o.compression}) : z.generate(oopts); if(typeof Deno !== "undefined") { if(typeof out == "string") { if(o.type == "binary" || o.type == "base64") return out; out = new Uint8Array(s2ab(out)); } } /*jshint -W083 */ if(o.password && typeof encrypt_agile !== 'undefined') return write_cfb_ctr(encrypt_agile(out, o.password), o); // eslint-disable-line no-undef /*jshint +W083 */ if(o.type === "file") return write_dl(o.file, out); return o.type == "string" ? utf8read(/*::(*/out/*:: :any)*/) : out; } function write_cfb_type(wb/*:Workbook*/, opts/*:?WriteOpts*/)/*:any*/ { var o = opts||{}; var cfb/*:CFBContainer*/ = write_xlscfb(wb, o); return write_cfb_ctr(cfb, o); } function write_string_type(out/*:string*/, opts/*:WriteOpts*/, bom/*:?string*/)/*:any*/ { if(!bom) bom = ""; var o = bom + out; switch(opts.type) { case "base64": return Base64_encode(utf8write(o)); case "binary": return utf8write(o); case "string": return out; case "file": return write_dl(opts.file, o, 'utf8'); case "buffer": { if(has_buf) return Buffer_from(o, 'utf8'); else if(typeof TextEncoder !== "undefined") return new TextEncoder().encode(o); else return write_string_type(o, {type:'binary'}).split("").map(function(c) { return c.charCodeAt(0); }); } } throw new Error("Unrecognized type " + opts.type); } function write_stxt_type(out/*:string*/, opts/*:WriteOpts*/)/*:any*/ { switch(opts.type) { case "base64": return Base64_encode(out); case "binary": return out; case "string": return out; /* override in sheet_to_txt */ case "file": return write_dl(opts.file, out, 'binary'); case "buffer": { if(has_buf) return Buffer_from(out, 'binary'); else return out.split("").map(function(c) { return c.charCodeAt(0); }); } } throw new Error("Unrecognized type " + opts.type); } /* TODO: test consistency */ function write_binary_type(out, opts/*:WriteOpts*/)/*:any*/ { switch(opts.type) { case "string": case "base64": case "binary": var bstr = ""; // $FlowIgnore for(var i = 0; i < out.length; ++i) bstr += String.fromCharCode(out[i]); return opts.type == 'base64' ? Base64_encode(bstr) : opts.type == 'string' ? utf8read(bstr) : bstr; case "file": return write_dl(opts.file, out); case "buffer": return out; default: throw new Error("Unrecognized type " + opts.type); } } function writeSyncXLSX(wb/*:Workbook*/, opts/*:?WriteOpts*/) { reset_cp(); check_wb(wb); var o = dup(opts||{}); if(o.cellStyles) { o.cellNF = true; o.sheetStubs = true; } if(o.type == "array") { o.type = "binary"; var out/*:string*/ = (writeSyncXLSX(wb, o)/*:any*/); o.type = "array"; return s2ab(out); } return write_zip_typeXLSX(wb, o); } function writeSync(wb/*:Workbook*/, opts/*:?WriteOpts*/) { reset_cp(); check_wb(wb); var o = dup(opts||{}); if(o.cellStyles) { o.cellNF = true; o.sheetStubs = true; } if(o.type == "array") { o.type = "binary"; var out/*:string*/ = (writeSync(wb, o)/*:any*/); o.type = "array"; return s2ab(out); } var idx = 0; if(o.sheet) { if(typeof o.sheet == "number") idx = o.sheet; else idx = wb.SheetNames.indexOf(o.sheet); if(!wb.SheetNames[idx]) throw new Error("Sheet not found: " + o.sheet + " : " + (typeof o.sheet)); } switch(o.bookType || 'xlsb') { case 'xml': case 'xlml': return write_string_type(write_xlml(wb, o), o); case 'slk': case 'sylk': return write_string_type(SYLK.from_sheet(wb.Sheets[wb.SheetNames[idx]], o), o); case 'htm': case 'html': return write_string_type(sheet_to_html(wb.Sheets[wb.SheetNames[idx]], o), o); case 'txt': return write_stxt_type(sheet_to_txt(wb.Sheets[wb.SheetNames[idx]], o), o); case 'csv': return write_string_type(sheet_to_csv(wb.Sheets[wb.SheetNames[idx]], o), o, "\ufeff"); case 'dif': return write_string_type(DIF.from_sheet(wb.Sheets[wb.SheetNames[idx]], o), o); case 'dbf': return write_binary_type(DBF.from_sheet(wb.Sheets[wb.SheetNames[idx]], o), o); case 'prn': return write_string_type(PRN.from_sheet(wb.Sheets[wb.SheetNames[idx]], o), o); case 'rtf': return write_string_type(RTF.from_sheet(wb.Sheets[wb.SheetNames[idx]], o), o); case 'eth': return write_string_type(ETH.from_sheet(wb.Sheets[wb.SheetNames[idx]], o), o); case 'fods': return write_string_type(write_ods(wb, o), o); case 'wk1': return write_binary_type(WK_.sheet_to_wk1(wb.Sheets[wb.SheetNames[idx]], o), o); case 'wk3': return write_binary_type(WK_.book_to_wk3(wb, o), o); case 'biff2': if(!o.biff) o.biff = 2; /* falls through */ case 'biff3': if(!o.biff) o.biff = 3; /* falls through */ case 'biff4': if(!o.biff) o.biff = 4; return write_binary_type(write_biff_buf(wb, o), o); case 'biff5': if(!o.biff) o.biff = 5; /* falls through */ case 'biff8': case 'xla': case 'xls': if(!o.biff) o.biff = 8; return write_cfb_type(wb, o); case 'xlsx': case 'xlsm': case 'xlam': case 'xlsb': case 'numbers': case 'ods': return write_zip_type(wb, o); default: throw new Error ("Unrecognized bookType |" + o.bookType + "|"); } } function resolve_book_type(o/*:WriteFileOpts*/) { if(o.bookType) return; var _BT = { "xls": "biff8", "htm": "html", "slk": "sylk", "socialcalc": "eth", "Sh33tJS": "WTF" }; var ext = o.file.slice(o.file.lastIndexOf(".")).toLowerCase(); if(ext.match(/^\.[a-z]+$/)) o.bookType = ext.slice(1); o.bookType = _BT[o.bookType] || o.bookType; } function writeFileSync(wb/*:Workbook*/, filename/*:string*/, opts/*:?WriteFileOpts*/) { var o = opts||{}; o.type = 'file'; o.file = filename; resolve_book_type(o); return writeSync(wb, o); } function writeFileSyncXLSX(wb/*:Workbook*/, filename/*:string*/, opts/*:?WriteFileOpts*/) { var o = opts||{}; o.type = 'file'; o.file = filename; resolve_book_type(o); return writeSyncXLSX(wb, o); } function writeFileAsync(filename/*:string*/, wb/*:Workbook*/, opts/*:?WriteFileOpts*/, cb/*:?(e?:ErrnoError)=>void*/) { var o = opts||{}; o.type = 'file'; o.file = filename; resolve_book_type(o); o.type = 'buffer'; var _cb = cb; if(!(_cb instanceof Function)) _cb = (opts/*:any*/); return _fs.writeFile(filename, writeSync(wb, o), _cb); } /*:: type MJRObject = { row: any; isempty: boolean; }; */ function make_json_row(sheet/*:Worksheet*/, r/*:Range*/, R/*:number*/, cols/*:Array*/, header/*:number*/, hdr/*:Array*/, dense/*:boolean*/, o/*:Sheet2JSONOpts*/)/*:MJRObject*/ { var rr = encode_row(R); var defval = o.defval, raw = o.raw || !Object.prototype.hasOwnProperty.call(o, "raw"); var isempty = true; var row/*:any*/ = (header === 1) ? [] : {}; if(header !== 1) { if(Object.defineProperty) try { Object.defineProperty(row, '__rowNum__', {value:R, enumerable:false}); } catch(e) { row.__rowNum__ = R; } else row.__rowNum__ = R; } if(!dense || sheet[R]) for (var C = r.s.c; C <= r.e.c; ++C) { var val = dense ? sheet[R][C] : sheet[cols[C] + rr]; if(val === undefined || val.t === undefined) { if(defval === undefined) continue; if(hdr[C] != null) { row[hdr[C]] = defval; } continue; } var v = val.v; switch(val.t){ case 'z': if(v == null) break; continue; case 'e': v = (v == 0 ? null : void 0); break; case 's': case 'd': case 'b': case 'n': break; default: throw new Error('unrecognized type ' + val.t); } if(hdr[C] != null) { if(v == null) { if(val.t == "e" && v === null) row[hdr[C]] = null; else if(defval !== undefined) row[hdr[C]] = defval; else if(raw && v === null) row[hdr[C]] = null; else continue; } else { row[hdr[C]] = raw && (val.t !== "n" || (val.t === "n" && o.rawNumbers !== false)) ? v : format_cell(val,v,o); } if(v != null) isempty = false; } } return { row: row, isempty: isempty }; } function sheet_to_json(sheet/*:Worksheet*/, opts/*:?Sheet2JSONOpts*/) { if(sheet == null || sheet["!ref"] == null) return []; var val = {t:'n',v:0}, header = 0, offset = 1, hdr/*:Array*/ = [], v=0, vv=""; var r = {s:{r:0,c:0},e:{r:0,c:0}}; var o = opts || {}; var range = o.range != null ? o.range : sheet["!ref"]; if(o.header === 1) header = 1; else if(o.header === "A") header = 2; else if(Array.isArray(o.header)) header = 3; else if(o.header == null) header = 0; switch(typeof range) { case 'string': r = safe_decode_range(range); break; case 'number': r = safe_decode_range(sheet["!ref"]); r.s.r = range; break; default: r = range; } if(header > 0) offset = 0; var rr = encode_row(r.s.r); var cols/*:Array*/ = []; var out/*:Array*/ = []; var outi = 0, counter = 0; var dense = Array.isArray(sheet); var R = r.s.r, C = 0; var header_cnt = {}; if(dense && !sheet[R]) sheet[R] = []; var colinfo/*:Array*/ = o.skipHidden && sheet["!cols"] || []; var rowinfo/*:Array*/ = o.skipHidden && sheet["!rows"] || []; for(C = r.s.c; C <= r.e.c; ++C) { if(((colinfo[C]||{}).hidden)) continue; cols[C] = encode_col(C); val = dense ? sheet[R][C] : sheet[cols[C] + rr]; switch(header) { case 1: hdr[C] = C - r.s.c; break; case 2: hdr[C] = cols[C]; break; case 3: hdr[C] = o.header[C - r.s.c]; break; default: if(val == null) val = {w: "__EMPTY", t: "s"}; vv = v = format_cell(val, null, o); counter = header_cnt[v] || 0; if(!counter) header_cnt[v] = 1; else { do { vv = v + "_" + (counter++); } while(header_cnt[vv]); header_cnt[v] = counter; header_cnt[vv] = 1; } hdr[C] = vv; } } for (R = r.s.r + offset; R <= r.e.r; ++R) { if ((rowinfo[R]||{}).hidden) continue; var row = make_json_row(sheet, r, R, cols, header, hdr, dense, o); if((row.isempty === false) || (header === 1 ? o.blankrows !== false : !!o.blankrows)) out[outi++] = row.row; } out.length = outi; return out; } var qreg = /"/g; function make_csv_row(sheet/*:Worksheet*/, r/*:Range*/, R/*:number*/, cols/*:Array*/, fs/*:number*/, rs/*:number*/, FS/*:string*/, o/*:Sheet2CSVOpts*/)/*:?string*/ { var isempty = true; var row/*:Array*/ = [], txt = "", rr = encode_row(R); for(var C = r.s.c; C <= r.e.c; ++C) { if (!cols[C]) continue; var val = o.dense ? (sheet[R]||[])[C]: sheet[cols[C] + rr]; if(val == null) txt = ""; else if(val.v != null) { isempty = false; txt = ''+(o.rawNumbers && val.t == "n" ? val.v : format_cell(val, null, o)); for(var i = 0, cc = 0; i !== txt.length; ++i) if((cc = txt.charCodeAt(i)) === fs || cc === rs || cc === 34 || o.forceQuotes) {txt = "\"" + txt.replace(qreg, '""') + "\""; break; } if(txt == "ID") txt = '"ID"'; } else if(val.f != null && !val.F) { isempty = false; txt = '=' + val.f; if(txt.indexOf(",") >= 0) txt = '"' + txt.replace(qreg, '""') + '"'; } else txt = ""; /* NOTE: Excel CSV does not support array formulae */ row.push(txt); } if(o.blankrows === false && isempty) return null; return row.join(FS); } function sheet_to_csv(sheet/*:Worksheet*/, opts/*:?Sheet2CSVOpts*/)/*:string*/ { var out/*:Array*/ = []; var o = opts == null ? {} : opts; if(sheet == null || sheet["!ref"] == null) return ""; var r = safe_decode_range(sheet["!ref"]); var FS = o.FS !== undefined ? o.FS : ",", fs = FS.charCodeAt(0); var RS = o.RS !== undefined ? o.RS : "\n", rs = RS.charCodeAt(0); var endregex = new RegExp((FS=="|" ? "\\|" : FS)+"+$"); var row = "", cols/*:Array*/ = []; o.dense = Array.isArray(sheet); var colinfo/*:Array*/ = o.skipHidden && sheet["!cols"] || []; var rowinfo/*:Array*/ = o.skipHidden && sheet["!rows"] || []; for(var C = r.s.c; C <= r.e.c; ++C) if (!((colinfo[C]||{}).hidden)) cols[C] = encode_col(C); var w = 0; for(var R = r.s.r; R <= r.e.r; ++R) { if ((rowinfo[R]||{}).hidden) continue; row = make_csv_row(sheet, r, R, cols, fs, rs, FS, o); if(row == null) { continue; } if(o.strip) row = row.replace(endregex,""); if(row || (o.blankrows !== false)) out.push((w++ ? RS : "") + row); } delete o.dense; return out.join(""); } function sheet_to_txt(sheet/*:Worksheet*/, opts/*:?Sheet2CSVOpts*/) { if(!opts) opts = {}; opts.FS = "\t"; opts.RS = "\n"; var s = sheet_to_csv(sheet, opts); if(typeof $cptable == 'undefined' || opts.type == 'string') return s; var o = $cptable.utils.encode(1200, s, 'str'); return String.fromCharCode(255) + String.fromCharCode(254) + o; } function sheet_to_formulae(sheet/*:Worksheet*/)/*:Array*/ { var y = "", x, val=""; if(sheet == null || sheet["!ref"] == null) return []; var r = safe_decode_range(sheet['!ref']), rr = "", cols/*:Array*/ = [], C; var cmds/*:Array*/ = []; var dense = Array.isArray(sheet); for(C = r.s.c; C <= r.e.c; ++C) cols[C] = encode_col(C); for(var R = r.s.r; R <= r.e.r; ++R) { rr = encode_row(R); for(C = r.s.c; C <= r.e.c; ++C) { y = cols[C] + rr; x = dense ? (sheet[R]||[])[C] : sheet[y]; val = ""; if(x === undefined) continue; else if(x.F != null) { y = x.F; if(!x.f) continue; val = x.f; if(y.indexOf(":") == -1) y = y + ":" + y; } if(x.f != null) val = x.f; else if(x.t == 'z') continue; else if(x.t == 'n' && x.v != null) val = "" + x.v; else if(x.t == 'b') val = x.v ? "TRUE" : "FALSE"; else if(x.w !== undefined) val = "'" + x.w; else if(x.v === undefined) continue; else if(x.t == 's') val = "'" + x.v; else val = ""+x.v; cmds[cmds.length] = y + "=" + val; } } return cmds; } function sheet_add_json(_ws/*:?Worksheet*/, js/*:Array*/, opts)/*:Worksheet*/ { var o = opts || {}; var offset = +!o.skipHeader; var ws/*:Worksheet*/ = _ws || ({}/*:any*/); var _R = 0, _C = 0; if(ws && o.origin != null) { if(typeof o.origin == 'number') _R = o.origin; else { var _origin/*:CellAddress*/ = typeof o.origin == "string" ? decode_cell(o.origin) : o.origin; _R = _origin.r; _C = _origin.c; } } var cell/*:Cell*/; var range/*:Range*/ = ({s: {c:0, r:0}, e: {c:_C, r:_R + js.length - 1 + offset}}/*:any*/); if(ws['!ref']) { var _range = safe_decode_range(ws['!ref']); range.e.c = Math.max(range.e.c, _range.e.c); range.e.r = Math.max(range.e.r, _range.e.r); if(_R == -1) { _R = _range.e.r + 1; range.e.r = _R + js.length - 1 + offset; } } else { if(_R == -1) { _R = 0; range.e.r = js.length - 1 + offset; } } var hdr/*:Array*/ = o.header || [], C = 0; js.forEach(function (JS, R/*:number*/) { keys(JS).forEach(function(k) { if((C=hdr.indexOf(k)) == -1) hdr[C=hdr.length] = k; var v = JS[k]; var t = 'z'; var z = ""; var ref = encode_cell({c:_C + C,r:_R + R + offset}); cell = ws_get_cell_stub(ws, ref); if(v && typeof v === 'object' && !(v instanceof Date)){ ws[ref] = v; } else { if(typeof v == 'number') t = 'n'; else if(typeof v == 'boolean') t = 'b'; else if(typeof v == 'string') t = 's'; else if(v instanceof Date) { t = 'd'; if(!o.cellDates) { t = 'n'; v = datenum(v); } z = (o.dateNF || table_fmt[14]); } else if(v === null && o.nullError) { t = 'e'; v = 0; } if(!cell) ws[ref] = cell = ({t:t, v:v}/*:any*/); else { cell.t = t; cell.v = v; delete cell.w; delete cell.R; if(z) cell.z = z; } if(z) cell.z = z; } }); }); range.e.c = Math.max(range.e.c, _C + hdr.length - 1); var __R = encode_row(_R); if(offset) for(C = 0; C < hdr.length; ++C) ws[encode_col(C + _C) + __R] = {t:'s', v:hdr[C]}; ws['!ref'] = encode_range(range); return ws; } function json_to_sheet(js/*:Array*/, opts)/*:Worksheet*/ { return sheet_add_json(null, js, opts); } /* get cell, creating a stub if necessary */ function ws_get_cell_stub(ws/*:Worksheet*/, R, C/*:?number*/)/*:Cell*/ { /* A1 cell address */ if(typeof R == "string") { /* dense */ if(Array.isArray(ws)) { var RC = decode_cell(R); if(!ws[RC.r]) ws[RC.r] = []; return ws[RC.r][RC.c] || (ws[RC.r][RC.c] = {t:'z'}); } return ws[R] || (ws[R] = {t:'z'}); } /* cell address object */ if(typeof R != "number") return ws_get_cell_stub(ws, encode_cell(R)); /* R and C are 0-based indices */ return ws_get_cell_stub(ws, encode_cell({r:R,c:C||0})); } /* find sheet index for given name / validate index */ function wb_sheet_idx(wb/*:Workbook*/, sh/*:number|string*/) { if(typeof sh == "number") { if(sh >= 0 && wb.SheetNames.length > sh) return sh; throw new Error("Cannot find sheet # " + sh); } else if(typeof sh == "string") { var idx = wb.SheetNames.indexOf(sh); if(idx > -1) return idx; throw new Error("Cannot find sheet name |" + sh + "|"); } else throw new Error("Cannot find sheet |" + sh + "|"); } /* simple blank workbook object */ function book_new()/*:Workbook*/ { return { SheetNames: [], Sheets: {} }; } /* add a worksheet to the end of a given workbook */ function book_append_sheet(wb/*:Workbook*/, ws/*:Worksheet*/, name/*:?string*/, roll/*:?boolean*/)/*:string*/ { var i = 1; if(!name) for(; i <= 0xFFFF; ++i, name = undefined) if(wb.SheetNames.indexOf(name = "Sheet" + i) == -1) break; if(!name || wb.SheetNames.length >= 0xFFFF) throw new Error("Too many worksheets"); if(roll && wb.SheetNames.indexOf(name) >= 0) { var m = name.match(/(^.*?)(\d+)$/); i = m && +m[2] || 0; var root = m && m[1] || name; for(++i; i <= 0xFFFF; ++i) if(wb.SheetNames.indexOf(name = root + i) == -1) break; } check_ws_name(name); if(wb.SheetNames.indexOf(name) >= 0) throw new Error("Worksheet with name |" + name + "| already exists!"); wb.SheetNames.push(name); wb.Sheets[name] = ws; return name; } /* set sheet visibility (visible/hidden/very hidden) */ function book_set_sheet_visibility(wb/*:Workbook*/, sh/*:number|string*/, vis/*:number*/) { if(!wb.Workbook) wb.Workbook = {}; if(!wb.Workbook.Sheets) wb.Workbook.Sheets = []; var idx = wb_sheet_idx(wb, sh); // $FlowIgnore if(!wb.Workbook.Sheets[idx]) wb.Workbook.Sheets[idx] = {}; switch(vis) { case 0: case 1: case 2: break; default: throw new Error("Bad sheet visibility setting " + vis); } // $FlowIgnore wb.Workbook.Sheets[idx].Hidden = vis; } /* set number format */ function cell_set_number_format(cell/*:Cell*/, fmt/*:string|number*/) { cell.z = fmt; return cell; } /* set cell hyperlink */ function cell_set_hyperlink(cell/*:Cell*/, target/*:string*/, tooltip/*:?string*/) { if(!target) { delete cell.l; } else { cell.l = ({ Target: target }/*:Hyperlink*/); if(tooltip) cell.l.Tooltip = tooltip; } return cell; } function cell_set_internal_link(cell/*:Cell*/, range/*:string*/, tooltip/*:?string*/) { return cell_set_hyperlink(cell, "#" + range, tooltip); } /* add to cell comments */ function cell_add_comment(cell/*:Cell*/, text/*:string*/, author/*:?string*/) { if(!cell.c) cell.c = []; cell.c.push({t:text, a:author||"SheetJS"}); } /* set array formula and flush related cells */ function sheet_set_array_formula(ws/*:Worksheet*/, range, formula/*:string*/, dynamic/*:boolean*/) { var rng = typeof range != "string" ? range : safe_decode_range(range); var rngstr = typeof range == "string" ? range : encode_range(range); for(var R = rng.s.r; R <= rng.e.r; ++R) for(var C = rng.s.c; C <= rng.e.c; ++C) { var cell = ws_get_cell_stub(ws, R, C); cell.t = 'n'; cell.F = rngstr; delete cell.v; if(R == rng.s.r && C == rng.s.c) { cell.f = formula; if(dynamic) cell.D = true; } } return ws; } var utils/*:any*/ = { encode_col: encode_col, encode_row: encode_row, encode_cell: encode_cell, encode_range: encode_range, decode_col: decode_col, decode_row: decode_row, split_cell: split_cell, decode_cell: decode_cell, decode_range: decode_range, format_cell: format_cell, sheet_add_aoa: sheet_add_aoa, sheet_add_json: sheet_add_json, sheet_add_dom: sheet_add_dom, aoa_to_sheet: aoa_to_sheet, json_to_sheet: json_to_sheet, table_to_sheet: parse_dom_table, table_to_book: table_to_book, sheet_to_csv: sheet_to_csv, sheet_to_txt: sheet_to_txt, sheet_to_json: sheet_to_json, sheet_to_html: sheet_to_html, sheet_to_formulae: sheet_to_formulae, sheet_to_row_object_array: sheet_to_json, sheet_get_cell: ws_get_cell_stub, book_new: book_new, book_append_sheet: book_append_sheet, book_set_sheet_visibility: book_set_sheet_visibility, cell_set_number_format: cell_set_number_format, cell_set_hyperlink: cell_set_hyperlink, cell_set_internal_link: cell_set_internal_link, cell_add_comment: cell_add_comment, sheet_set_array_formula: sheet_set_array_formula, consts: { SHEET_VISIBLE: 0, SHEET_HIDDEN: 1, SHEET_VERY_HIDDEN: 2 } }; var _Readable; function set_readable(R) { _Readable = R; } function write_csv_stream(sheet/*:Worksheet*/, opts/*:?Sheet2CSVOpts*/) { var stream = _Readable(); var o = opts == null ? {} : opts; if(sheet == null || sheet["!ref"] == null) { stream.push(null); return stream; } var r = safe_decode_range(sheet["!ref"]); var FS = o.FS !== undefined ? o.FS : ",", fs = FS.charCodeAt(0); var RS = o.RS !== undefined ? o.RS : "\n", rs = RS.charCodeAt(0); var endregex = new RegExp((FS=="|" ? "\\|" : FS)+"+$"); var row/*:?string*/ = "", cols/*:Array*/ = []; o.dense = Array.isArray(sheet); var colinfo/*:Array*/ = o.skipHidden && sheet["!cols"] || []; var rowinfo/*:Array*/ = o.skipHidden && sheet["!rows"] || []; for(var C = r.s.c; C <= r.e.c; ++C) if (!((colinfo[C]||{}).hidden)) cols[C] = encode_col(C); var R = r.s.r; var BOM = false, w = 0; stream._read = function() { if(!BOM) { BOM = true; return stream.push("\uFEFF"); } while(R <= r.e.r) { ++R; if ((rowinfo[R-1]||{}).hidden) continue; row = make_csv_row(sheet, r, R-1, cols, fs, rs, FS, o); if(row != null) { if(o.strip) row = row.replace(endregex,""); if(row || (o.blankrows !== false)) return stream.push((w++ ? RS : "") + row); } } return stream.push(null); }; return stream; } function write_html_stream(ws/*:Worksheet*/, opts/*:?Sheet2HTMLOpts*/) { var stream = _Readable(); var o = opts || {}; var header = o.header != null ? o.header : HTML_BEGIN; var footer = o.footer != null ? o.footer : HTML_END; stream.push(header); var r = decode_range(ws['!ref']); o.dense = Array.isArray(ws); stream.push(make_html_preamble(ws, r, o)); var R = r.s.r; var end = false; stream._read = function() { if(R > r.e.r) { if(!end) { end = true; stream.push("" + footer); } return stream.push(null); } while(R <= r.e.r) { stream.push(make_html_row(ws, r, R, o)); ++R; break; } }; return stream; } function write_json_stream(sheet/*:Worksheet*/, opts/*:?Sheet2CSVOpts*/) { var stream = _Readable({objectMode:true}); if(sheet == null || sheet["!ref"] == null) { stream.push(null); return stream; } var val = {t:'n',v:0}, header = 0, offset = 1, hdr/*:Array*/ = [], v=0, vv=""; var r = {s:{r:0,c:0},e:{r:0,c:0}}; var o = opts || {}; var range = o.range != null ? o.range : sheet["!ref"]; if(o.header === 1) header = 1; else if(o.header === "A") header = 2; else if(Array.isArray(o.header)) header = 3; switch(typeof range) { case 'string': r = safe_decode_range(range); break; case 'number': r = safe_decode_range(sheet["!ref"]); r.s.r = range; break; default: r = range; } if(header > 0) offset = 0; var rr = encode_row(r.s.r); var cols/*:Array*/ = []; var counter = 0; var dense = Array.isArray(sheet); var R = r.s.r, C = 0; var header_cnt = {}; if(dense && !sheet[R]) sheet[R] = []; var colinfo/*:Array*/ = o.skipHidden && sheet["!cols"] || []; var rowinfo/*:Array*/ = o.skipHidden && sheet["!rows"] || []; for(C = r.s.c; C <= r.e.c; ++C) { if(((colinfo[C]||{}).hidden)) continue; cols[C] = encode_col(C); val = dense ? sheet[R][C] : sheet[cols[C] + rr]; switch(header) { case 1: hdr[C] = C - r.s.c; break; case 2: hdr[C] = cols[C]; break; case 3: hdr[C] = o.header[C - r.s.c]; break; default: if(val == null) val = {w: "__EMPTY", t: "s"}; vv = v = format_cell(val, null, o); counter = header_cnt[v] || 0; if(!counter) header_cnt[v] = 1; else { do { vv = v + "_" + (counter++); } while(header_cnt[vv]); header_cnt[v] = counter; header_cnt[vv] = 1; } hdr[C] = vv; } } R = r.s.r + offset; stream._read = function() { while(R <= r.e.r) { if ((rowinfo[R-1]||{}).hidden) continue; var row = make_json_row(sheet, r, R, cols, header, hdr, dense, o); ++R; if((row.isempty === false) || (header === 1 ? o.blankrows !== false : !!o.blankrows)) { stream.push(row.row); return; } } return stream.push(null); }; return stream; } var __stream = { to_json: write_json_stream, to_html: write_html_stream, to_csv: write_csv_stream, set_readable: set_readable }; const version = XLSX.version; /***/ }), /***/ "./node_modules/encoding/node_modules/iconv-lite/encodings/tables/big5-added.json": /*!****************************************************************************************!*\ !*** ./node_modules/encoding/node_modules/iconv-lite/encodings/tables/big5-added.json ***! \****************************************************************************************/ /***/ ((module) => { "use strict"; module.exports = /*#__PURE__*/JSON.parse('[["8740","䏰䰲䘃䖦䕸𧉧䵷䖳𧲱䳢𧳅㮕䜶䝄䱇䱀𤊿𣘗𧍒𦺋𧃒䱗𪍑䝏䗚䲅𧱬䴇䪤䚡𦬣爥𥩔𡩣𣸆𣽡晍囻"],["8767","綕夝𨮹㷴霴𧯯寛𡵞媤㘥𩺰嫑宷峼杮薓𩥅瑡璝㡵𡵓𣚞𦀡㻬"],["87a1","𥣞㫵竼龗𤅡𨤍𣇪𠪊𣉞䌊蒄龖鐯䤰蘓墖靊鈘秐稲晠権袝瑌篅枂稬剏遆㓦珄𥶹瓆鿇垳䤯呌䄱𣚎堘穲𧭥讏䚮𦺈䆁𥶙箮𢒼鿈𢓁𢓉𢓌鿉蔄𣖻䂴鿊䓡𪷿拁灮鿋"],["8840","㇀",4,"𠄌㇅𠃑𠃍㇆㇇𠃋𡿨㇈𠃊㇉㇊㇋㇌𠄎㇍㇎ĀÁǍÀĒÉĚÈŌÓǑÒ࿿Ê̄Ế࿿Ê̌ỀÊāáǎàɑēéěèīíǐìōóǒòūúǔùǖǘǚ"],["88a1","ǜü࿿ê̄ế࿿ê̌ềêɡ⏚⏛"],["8940","𪎩𡅅"],["8943","攊"],["8946","丽滝鵎釟"],["894c","𧜵撑会伨侨兖兴农凤务动医华发变团声处备夲头学实実岚庆总斉柾栄桥济炼电纤纬纺织经统缆缷艺苏药视设询车轧轮"],["89a1","琑糼緍楆竉刧"],["89ab","醌碸酞肼"],["89b0","贋胶𠧧"],["89b5","肟黇䳍鷉鸌䰾𩷶𧀎鸊𪄳㗁"],["89c1","溚舾甙"],["89c5","䤑马骏龙禇𨑬𡷊𠗐𢫦两亁亀亇亿仫伷㑌侽㹈倃傈㑽㒓㒥円夅凛凼刅争剹劐匧㗇厩㕑厰㕓参吣㕭㕲㚁咓咣咴咹哐哯唘唣唨㖘唿㖥㖿嗗㗅"],["8a40","𧶄唥"],["8a43","𠱂𠴕𥄫喐𢳆㧬𠍁蹆𤶸𩓥䁓𨂾睺𢰸㨴䟕𨅝𦧲𤷪擝𠵼𠾴𠳕𡃴撍蹾𠺖𠰋𠽤𢲩𨉖𤓓"],["8a64","𠵆𩩍𨃩䟴𤺧𢳂骲㩧𩗴㿭㔆𥋇𩟔𧣈𢵄鵮頕"],["8a76","䏙𦂥撴哣𢵌𢯊𡁷㧻𡁯"],["8aa1","𦛚𦜖𧦠擪𥁒𠱃蹨𢆡𨭌𠜱"],["8aac","䠋𠆩㿺塳𢶍"],["8ab2","𤗈𠓼𦂗𠽌𠶖啹䂻䎺"],["8abb","䪴𢩦𡂝膪飵𠶜捹㧾𢝵跀嚡摼㹃"],["8ac9","𪘁𠸉𢫏𢳉"],["8ace","𡃈𣧂㦒㨆𨊛㕸𥹉𢃇噒𠼱𢲲𩜠㒼氽𤸻"],["8adf","𧕴𢺋𢈈𪙛𨳍𠹺𠰴𦠜羓𡃏𢠃𢤹㗻𥇣𠺌𠾍𠺪㾓𠼰𠵇𡅏𠹌"],["8af6","𠺫𠮩𠵈𡃀𡄽㿹𢚖搲𠾭"],["8b40","𣏴𧘹𢯎𠵾𠵿𢱑𢱕㨘𠺘𡃇𠼮𪘲𦭐𨳒𨶙𨳊閪哌苄喹"],["8b55","𩻃鰦骶𧝞𢷮煀腭胬尜𦕲脴㞗卟𨂽醶𠻺𠸏𠹷𠻻㗝𤷫㘉𠳖嚯𢞵𡃉𠸐𠹸𡁸𡅈𨈇𡑕𠹹𤹐𢶤婔𡀝𡀞𡃵𡃶垜𠸑"],["8ba1","𧚔𨋍𠾵𠹻𥅾㜃𠾶𡆀𥋘𪊽𤧚𡠺𤅷𨉼墙剨㘚𥜽箲孨䠀䬬鼧䧧鰟鮍𥭴𣄽嗻㗲嚉丨夂𡯁屮靑𠂆乛亻㔾尣彑忄㣺扌攵歺氵氺灬爫丬犭𤣩罒礻糹罓𦉪㓁"],["8bde","𦍋耂肀𦘒𦥑卝衤见𧢲讠贝钅镸长门𨸏韦页风飞饣𩠐鱼鸟黄歯龜丷𠂇阝户钢"],["8c40","倻淾𩱳龦㷉袏𤅎灷峵䬠𥇍㕙𥴰愢𨨲辧釶熑朙玺𣊁𪄇㲋𡦀䬐磤琂冮𨜏䀉橣𪊺䈣蘏𠩯稪𩥇𨫪靕灍匤𢁾鏴盙𨧣龧矝亣俰傼丯众龨吴綋墒壐𡶶庒庙忂𢜒斋"],["8ca1","𣏹椙橃𣱣泿"],["8ca7","爀𤔅玌㻛𤨓嬕璹讃𥲤𥚕窓篬糃繬苸薗龩袐龪躹龫迏蕟駠鈡龬𨶹𡐿䁱䊢娚"],["8cc9","顨杫䉶圽"],["8cce","藖𤥻芿𧄍䲁𦵴嵻𦬕𦾾龭龮宖龯曧繛湗秊㶈䓃𣉖𢞖䎚䔶"],["8ce6","峕𣬚諹屸㴒𣕑嵸龲煗䕘𤃬𡸣䱷㥸㑊𠆤𦱁諌侴𠈹妿腬顖𩣺弻"],["8d40","𠮟"],["8d42","𢇁𨥭䄂䚻𩁹㼇龳𪆵䃸㟖䛷𦱆䅼𨚲𧏿䕭㣔𥒚䕡䔛䶉䱻䵶䗪㿈𤬏㙡䓞䒽䇭崾嵈嵖㷼㠏嶤嶹㠠㠸幂庽弥徃㤈㤔㤿㥍惗愽峥㦉憷憹懏㦸戬抐拥挘㧸嚱"],["8da1","㨃揢揻搇摚㩋擀崕嘡龟㪗斆㪽旿晓㫲暒㬢朖㭂枤栀㭘桊梄㭲㭱㭻椉楃牜楤榟榅㮼槖㯝橥橴橱檂㯬檙㯲檫檵櫔櫶殁毁毪汵沪㳋洂洆洦涁㳯涤涱渕渘温溆𨧀溻滢滚齿滨滩漤漴㵆𣽁澁澾㵪㵵熷岙㶊瀬㶑灐灔灯灿炉𠌥䏁㗱𠻘"],["8e40","𣻗垾𦻓焾𥟠㙎榢𨯩孴穉𥣡𩓙穥穽𥦬窻窰竂竃燑𦒍䇊竚竝竪䇯咲𥰁笋筕笩𥌎𥳾箢筯莜𥮴𦱿篐萡箒箸𥴠㶭𥱥蒒篺簆簵𥳁籄粃𤢂粦晽𤕸糉糇糦籴糳糵糎"],["8ea1","繧䔝𦹄絝𦻖璍綉綫焵綳緒𤁗𦀩緤㴓緵𡟹緥𨍭縝𦄡𦅚繮纒䌫鑬縧罀罁罇礶𦋐駡羗𦍑羣𡙡𠁨䕜𣝦䔃𨌺翺𦒉者耈耝耨耯𪂇𦳃耻耼聡𢜔䦉𦘦𣷣𦛨朥肧𨩈脇脚墰𢛶汿𦒘𤾸擧𡒊舘𡡞橓𤩥𤪕䑺舩𠬍𦩒𣵾俹𡓽蓢荢𦬊𤦧𣔰𡝳𣷸芪椛芳䇛"],["8f40","蕋苐茚𠸖𡞴㛁𣅽𣕚艻苢茘𣺋𦶣𦬅𦮗𣗎㶿茝嗬莅䔋𦶥莬菁菓㑾𦻔橗蕚㒖𦹂𢻯葘𥯤葱㷓䓤檧葊𣲵祘蒨𦮖𦹷𦹃蓞萏莑䒠蒓蓤𥲑䉀𥳀䕃蔴嫲𦺙䔧蕳䔖枿蘖"],["8fa1","𨘥𨘻藁𧂈蘂𡖂𧃍䕫䕪蘨㙈𡢢号𧎚虾蝱𪃸蟮𢰧螱蟚蠏噡虬桖䘏衅衆𧗠𣶹𧗤衞袜䙛袴袵揁装睷𧜏覇覊覦覩覧覼𨨥觧𧤤𧪽誜瞓釾誐𧩙竩𧬺𣾏䜓𧬸煼謌謟𥐰𥕥謿譌譍誩𤩺讐讛誯𡛟䘕衏貛𧵔𧶏貫㜥𧵓賖𧶘𧶽贒贃𡤐賛灜贑𤳉㻐起"],["9040","趩𨀂𡀔𤦊㭼𨆼𧄌竧躭躶軃鋔輙輭𨍥𨐒辥錃𪊟𠩐辳䤪𨧞𨔽𣶻廸𣉢迹𪀔𨚼𨔁𢌥㦀𦻗逷𨔼𧪾遡𨕬𨘋邨𨜓郄𨛦邮都酧㫰醩釄粬𨤳𡺉鈎沟鉁鉢𥖹銹𨫆𣲛𨬌𥗛"],["90a1","𠴱錬鍫𨫡𨯫炏嫃𨫢𨫥䥥鉄𨯬𨰹𨯿鍳鑛躼閅閦鐦閠濶䊹𢙺𨛘𡉼𣸮䧟氜陻隖䅬隣𦻕懚隶磵𨫠隽双䦡𦲸𠉴𦐐𩂯𩃥𤫑𡤕𣌊霱虂霶䨏䔽䖅𤫩灵孁霛靜𩇕靗孊𩇫靟鐥僐𣂷𣂼鞉鞟鞱鞾韀韒韠𥑬韮琜𩐳響韵𩐝𧥺䫑頴頳顋顦㬎𧅵㵑𠘰𤅜"],["9140","𥜆飊颷飈飇䫿𦴧𡛓喰飡飦飬鍸餹𤨩䭲𩡗𩤅駵騌騻騐驘𥜥㛄𩂱𩯕髠髢𩬅髴䰎鬔鬭𨘀倴鬴𦦨㣃𣁽魐魀𩴾婅𡡣鮎𤉋鰂鯿鰌𩹨鷔𩾷𪆒𪆫𪃡𪄣𪇟鵾鶃𪄴鸎梈"],["91a1","鷄𢅛𪆓𪈠𡤻𪈳鴹𪂹𪊴麐麕麞麢䴴麪麯𤍤黁㭠㧥㴝伲㞾𨰫鼂鼈䮖鐤𦶢鼗鼖鼹嚟嚊齅馸𩂋韲葿齢齩竜龎爖䮾𤥵𤦻煷𤧸𤍈𤩑玞𨯚𡣺禟𨥾𨸶鍩鏳𨩄鋬鎁鏋𨥬𤒹爗㻫睲穃烐𤑳𤏸煾𡟯炣𡢾𣖙㻇𡢅𥐯𡟸㜢𡛻𡠹㛡𡝴𡣑𥽋㜣𡛀坛𤨥𡏾𡊨"],["9240","𡏆𡒶蔃𣚦蔃葕𤦔𧅥𣸱𥕜𣻻𧁒䓴𣛮𩦝𦼦柹㜳㰕㷧塬𡤢栐䁗𣜿𤃡𤂋𤄏𦰡哋嚞𦚱嚒𠿟𠮨𠸍鏆𨬓鎜仸儫㠙𤐶亼𠑥𠍿佋侊𥙑婨𠆫𠏋㦙𠌊𠐔㐵伩𠋀𨺳𠉵諚𠈌亘"],["92a1","働儍侢伃𤨎𣺊佂倮偬傁俌俥偘僼兙兛兝兞湶𣖕𣸹𣺿浲𡢄𣺉冨凃𠗠䓝𠒣𠒒𠒑赺𨪜𠜎剙劤𠡳勡鍮䙺熌𤎌𠰠𤦬𡃤槑𠸝瑹㻞璙琔瑖玘䮎𤪼𤂍叐㖄爏𤃉喴𠍅响𠯆圝鉝雴鍦埝垍坿㘾壋媙𨩆𡛺𡝯𡜐娬妸銏婾嫏娒𥥆𡧳𡡡𤊕㛵洅瑃娡𥺃"],["9340","媁𨯗𠐓鏠璌𡌃焅䥲鐈𨧻鎽㞠尞岞幞幈𡦖𡥼𣫮廍孏𡤃𡤄㜁𡢠㛝𡛾㛓脪𨩇𡶺𣑲𨦨弌弎𡤧𡞫婫𡜻孄蘔𧗽衠恾𢡠𢘫忛㺸𢖯𢖾𩂈𦽳懀𠀾𠁆𢘛憙憘恵𢲛𢴇𤛔𩅍"],["93a1","摱𤙥𢭪㨩𢬢𣑐𩣪𢹸挷𪑛撶挱揑𤧣𢵧护𢲡搻敫楲㯴𣂎𣊭𤦉𣊫唍𣋠𡣙𩐿曎𣊉𣆳㫠䆐𥖄𨬢𥖏𡛼𥕛𥐥磮𣄃𡠪𣈴㑤𣈏𣆂𤋉暎𦴤晫䮓昰𧡰𡷫晣𣋒𣋡昞𥡲㣑𣠺𣞼㮙𣞢𣏾瓐㮖枏𤘪梶栞㯄檾㡣𣟕𤒇樳橒櫉欅𡤒攑梘橌㯗橺歗𣿀𣲚鎠鋲𨯪𨫋"],["9440","銉𨀞𨧜鑧涥漋𤧬浧𣽿㶏渄𤀼娽渊塇洤硂焻𤌚𤉶烱牐犇犔𤞏𤜥兹𤪤𠗫瑺𣻸𣙟𤩊𤤗𥿡㼆㺱𤫟𨰣𣼵悧㻳瓌琼鎇琷䒟𦷪䕑疃㽣𤳙𤴆㽘畕癳𪗆㬙瑨𨫌𤦫𤦎㫻"],["94a1","㷍𤩎㻿𤧅𤣳釺圲鍂𨫣𡡤僟𥈡𥇧睸𣈲眎眏睻𤚗𣞁㩞𤣰琸璛㺿𤪺𤫇䃈𤪖𦆮錇𥖁砞碍碈磒珐祙𧝁𥛣䄎禛蒖禥樭𣻺稺秴䅮𡛦䄲鈵秱𠵌𤦌𠊙𣶺𡝮㖗啫㕰㚪𠇔𠰍竢婙𢛵𥪯𥪜娍𠉛磰娪𥯆竾䇹籝籭䈑𥮳𥺼𥺦糍𤧹𡞰粎籼粮檲緜縇緓罎𦉡"],["9540","𦅜𧭈綗𥺂䉪𦭵𠤖柖𠁎𣗏埄𦐒𦏸𤥢翝笧𠠬𥫩𥵃笌𥸎駦虅驣樜𣐿㧢𤧷𦖭騟𦖠蒀𧄧𦳑䓪脷䐂胆脉腂𦞴飃𦩂艢艥𦩑葓𦶧蘐𧈛媆䅿𡡀嬫𡢡嫤𡣘蚠蜨𣶏蠭𧐢娂"],["95a1","衮佅袇袿裦襥襍𥚃襔𧞅𧞄𨯵𨯙𨮜𨧹㺭蒣䛵䛏㟲訽訜𩑈彍鈫𤊄旔焩烄𡡅鵭貟賩𧷜妚矃姰䍮㛔踪躧𤰉輰轊䋴汘澻𢌡䢛潹溋𡟚鯩㚵𤤯邻邗啱䤆醻鐄𨩋䁢𨫼鐧𨰝𨰻蓥訫閙閧閗閖𨴴瑅㻂𤣿𤩂𤏪㻧𣈥随𨻧𨹦𨹥㻌𤧭𤩸𣿮琒瑫㻼靁𩂰"],["9640","桇䨝𩂓𥟟靝鍨𨦉𨰦𨬯𦎾銺嬑譩䤼珹𤈛鞛靱餸𠼦巁𨯅𤪲頟𩓚鋶𩗗釥䓀𨭐𤩧𨭤飜𨩅㼀鈪䤥萔餻饍𧬆㷽馛䭯馪驜𨭥𥣈檏騡嫾騯𩣱䮐𩥈馼䮽䮗鍽塲𡌂堢𤦸"],["96a1","𡓨硄𢜟𣶸棅㵽鑘㤧慐𢞁𢥫愇鱏鱓鱻鰵鰐魿鯏𩸭鮟𪇵𪃾鴡䲮𤄄鸘䲰鴌𪆴𪃭𪃳𩤯鶥蒽𦸒𦿟𦮂藼䔳𦶤𦺄𦷰萠藮𦸀𣟗𦁤秢𣖜𣙀䤭𤧞㵢鏛銾鍈𠊿碹鉷鑍俤㑀遤𥕝砽硔碶硋𡝗𣇉𤥁㚚佲濚濙瀞瀞吔𤆵垻壳垊鴖埗焴㒯𤆬燫𦱀𤾗嬨𡞵𨩉"],["9740","愌嫎娋䊼𤒈㜬䭻𨧼鎻鎸𡣖𠼝葲𦳀𡐓𤋺𢰦𤏁妔𣶷𦝁綨𦅛𦂤𤦹𤦋𨧺鋥珢㻩璴𨭣𡢟㻡𤪳櫘珳珻㻖𤨾𤪔𡟙𤩦𠎧𡐤𤧥瑈𤤖炥𤥶銄珦鍟𠓾錱𨫎𨨖鎆𨯧𥗕䤵𨪂煫"],["97a1","𤥃𠳿嚤𠘚𠯫𠲸唂秄𡟺緾𡛂𤩐𡡒䔮鐁㜊𨫀𤦭妰𡢿𡢃𧒄媡㛢𣵛㚰鉟婹𨪁𡡢鍴㳍𠪴䪖㦊僴㵩㵌𡎜煵䋻𨈘渏𩃤䓫浗𧹏灧沯㳖𣿭𣸭渂漌㵯𠏵畑㚼㓈䚀㻚䡱姄鉮䤾轁𨰜𦯀堒埈㛖𡑒烾𤍢𤩱𢿣𡊰𢎽梹楧𡎘𣓥𧯴𣛟𨪃𣟖𣏺𤲟樚𣚭𦲷萾䓟䓎"],["9840","𦴦𦵑𦲂𦿞漗𧄉茽𡜺菭𦲀𧁓𡟛妉媂𡞳婡婱𡤅𤇼㜭姯𡜼㛇熎鎐暚𤊥婮娫𤊓樫𣻹𧜶𤑛𤋊焝𤉙𨧡侰𦴨峂𤓎𧹍𤎽樌𤉖𡌄炦焳𤏩㶥泟勇𤩏繥姫崯㷳彜𤩝𡟟綤萦"],["98a1","咅𣫺𣌀𠈔坾𠣕𠘙㿥𡾞𪊶瀃𩅛嵰玏糓𨩙𩐠俈翧狍猐𧫴猸猹𥛶獁獈㺩𧬘遬燵𤣲珡臶㻊県㻑沢国琙琞琟㻢㻰㻴㻺瓓㼎㽓畂畭畲疍㽼痈痜㿀癍㿗癴㿜発𤽜熈嘣覀塩䀝睃䀹条䁅㗛瞘䁪䁯属瞾矋売砘点砜䂨砹硇硑硦葈𥔵礳栃礲䄃"],["9940","䄉禑禙辻稆込䅧窑䆲窼艹䇄竏竛䇏両筢筬筻簒簛䉠䉺类粜䊌粸䊔糭输烀𠳏総緔緐緽羮羴犟䎗耠耥笹耮耱联㷌垴炠肷胩䏭脌猪脎脒畠脔䐁㬹腖腙腚"],["99a1","䐓堺腼膄䐥膓䐭膥埯臁臤艔䒏芦艶苊苘苿䒰荗险榊萅烵葤惣蒈䔄蒾蓡蓸蔐蔸蕒䔻蕯蕰藠䕷虲蚒蚲蛯际螋䘆䘗袮裿褤襇覑𧥧訩訸誔誴豑賔賲贜䞘塟跃䟭仮踺嗘坔蹱嗵躰䠷軎転軤軭軲辷迁迊迌逳駄䢭飠鈓䤞鈨鉘鉫銱銮銿"],["9a40","鋣鋫鋳鋴鋽鍃鎄鎭䥅䥑麿鐗匁鐝鐭鐾䥪鑔鑹锭関䦧间阳䧥枠䨤靀䨵鞲韂噔䫤惨颹䬙飱塄餎餙冴餜餷饂饝饢䭰駅䮝騼鬏窃魩鮁鯝鯱鯴䱭鰠㝯𡯂鵉鰺"],["9aa1","黾噐鶓鶽鷀鷼银辶鹻麬麱麽黆铜黢黱黸竈齄𠂔𠊷𠎠椚铃妬𠓗塀铁㞹𠗕𠘕𠙶𡚺块煳𠫂𠫍𠮿呪吆𠯋咞𠯻𠰻𠱓𠱥𠱼惧𠲍噺𠲵𠳝𠳭𠵯𠶲𠷈楕鰯螥𠸄𠸎𠻗𠾐𠼭𠹳尠𠾼帋𡁜𡁏𡁶朞𡁻𡂈𡂖㙇𡂿𡃓𡄯𡄻卤蒭𡋣𡍵𡌶讁𡕷𡘙𡟃𡟇乸炻𡠭𡥪"],["9b40","𡨭𡩅𡰪𡱰𡲬𡻈拃𡻕𡼕熘桕𢁅槩㛈𢉼𢏗𢏺𢜪𢡱𢥏苽𢥧𢦓𢫕覥𢫨辠𢬎鞸𢬿顇骽𢱌"],["9b62","𢲈𢲷𥯨𢴈𢴒𢶷𢶕𢹂𢽴𢿌𣀳𣁦𣌟𣏞徱晈暿𧩹𣕧𣗳爁𤦺矗𣘚𣜖纇𠍆墵朎"],["9ba1","椘𣪧𧙗𥿢𣸑𣺹𧗾𢂚䣐䪸𤄙𨪚𤋮𤌍𤀻𤌴𤎖𤩅𠗊凒𠘑妟𡺨㮾𣳿𤐄𤓖垈𤙴㦛𤜯𨗨𩧉㝢𢇃譞𨭎駖𤠒𤣻𤨕爉𤫀𠱸奥𤺥𤾆𠝹軚𥀬劏圿煱𥊙𥐙𣽊𤪧喼𥑆𥑮𦭒釔㑳𥔿𧘲𥕞䜘𥕢𥕦𥟇𤤿𥡝偦㓻𣏌惞𥤃䝼𨥈𥪮𥮉𥰆𡶐垡煑澶𦄂𧰒遖𦆲𤾚譢𦐂𦑊"],["9c40","嵛𦯷輶𦒄𡤜諪𤧶𦒈𣿯𦔒䯀𦖿𦚵𢜛鑥𥟡憕娧晉侻嚹𤔡𦛼乪𤤴陖涏𦲽㘘襷𦞙𦡮𦐑𦡞營𦣇筂𩃀𠨑𦤦鄄𦤹穅鷰𦧺騦𦨭㙟𦑩𠀡禃𦨴𦭛崬𣔙菏𦮝䛐𦲤画补𦶮墶"],["9ca1","㜜𢖍𧁋𧇍㱔𧊀𧊅銁𢅺𧊋錰𧋦𤧐氹钟𧑐𠻸蠧裵𢤦𨑳𡞱溸𤨪𡠠㦤㚹尐秣䔿暶𩲭𩢤襃𧟌𧡘囖䃟𡘊㦡𣜯𨃨𡏅熭荦𧧝𩆨婧䲷𧂯𨦫𧧽𧨊𧬋𧵦𤅺筃祾𨀉澵𪋟樃𨌘厢𦸇鎿栶靝𨅯𨀣𦦵𡏭𣈯𨁈嶅𨰰𨂃圕頣𨥉嶫𤦈斾槕叒𤪥𣾁㰑朶𨂐𨃴𨄮𡾡𨅏"],["9d40","𨆉𨆯𨈚𨌆𨌯𨎊㗊𨑨𨚪䣺揦𨥖砈鉕𨦸䏲𨧧䏟𨧨𨭆𨯔姸𨰉輋𨿅𩃬筑𩄐𩄼㷷𩅞𤫊运犏嚋𩓧𩗩𩖰𩖸𩜲𩣑𩥉𩥪𩧃𩨨𩬎𩵚𩶛纟𩻸𩼣䲤镇𪊓熢𪋿䶑递𪗋䶜𠲜达嗁"],["9da1","辺𢒰边𤪓䔉繿潖檱仪㓤𨬬𧢝㜺躀𡟵𨀤𨭬𨮙𧨾𦚯㷫𧙕𣲷𥘵𥥖亚𥺁𦉘嚿𠹭踎孭𣺈𤲞揞拐𡟶𡡻攰嘭𥱊吚𥌑㷆𩶘䱽嘢嘞罉𥻘奵𣵀蝰东𠿪𠵉𣚺脗鵞贘瘻鱅癎瞹鍅吲腈苷嘥脲萘肽嗪祢噃吖𠺝㗎嘅嗱曱𨋢㘭甴嗰喺咗啲𠱁𠲖廐𥅈𠹶𢱢"],["9e40","𠺢麫絚嗞𡁵抝靭咔賍燶酶揼掹揾啩𢭃鱲𢺳冚㓟𠶧冧呍唞唓癦踭𦢊疱肶蠄螆裇膶萜𡃁䓬猄𤜆宐茋𦢓噻𢛴𧴯𤆣𧵳𦻐𧊶酰𡇙鈈𣳼𪚩𠺬𠻹牦𡲢䝎𤿂𧿹𠿫䃺"],["9ea1","鱝攟𢶠䣳𤟠𩵼𠿬𠸊恢𧖣𠿭"],["9ead","𦁈𡆇熣纎鵐业丄㕷嬍沲卧㚬㧜卽㚥𤘘墚𤭮舭呋垪𥪕𠥹"],["9ec5","㩒𢑥獴𩺬䴉鯭𣳾𩼰䱛𤾩𩖞𩿞葜𣶶𧊲𦞳𣜠挮紥𣻷𣸬㨪逈勌㹴㙺䗩𠒎癀嫰𠺶硺𧼮墧䂿噼鮋嵴癔𪐴麅䳡痹㟻愙𣃚𤏲"],["9ef5","噝𡊩垧𤥣𩸆刴𧂮㖭汊鵼"],["9f40","籖鬹埞𡝬屓擓𩓐𦌵𧅤蚭𠴨𦴢𤫢𠵱"],["9f4f","凾𡼏嶎霃𡷑麁遌笟鬂峑箣扨挵髿篏鬪籾鬮籂粆鰕篼鬉鼗鰛𤤾齚啳寃俽麘俲剠㸆勑坧偖妷帒韈鶫轜呩鞴饀鞺匬愰"],["9fa1","椬叚鰊鴂䰻陁榀傦畆𡝭駚剳"],["9fae","酙隁酜"],["9fb2","酑𨺗捿𦴣櫊嘑醎畺抅𠏼獏籰𥰡𣳽"],["9fc1","𤤙盖鮝个𠳔莾衂"],["9fc9","届槀僭坺刟巵从氱𠇲伹咜哚劚趂㗾弌㗳"],["9fdb","歒酼龥鮗頮颴骺麨麄煺笔"],["9fe7","毺蠘罸"],["9feb","嘠𪙊蹷齓"],["9ff0","跔蹏鸜踁抂𨍽踨蹵竓𤩷稾磘泪詧瘇"],["a040","𨩚鼦泎蟖痃𪊲硓咢贌狢獱謭猂瓱賫𤪻蘯徺袠䒷"],["a055","𡠻𦸅"],["a058","詾𢔛"],["a05b","惽癧髗鵄鍮鮏蟵"],["a063","蠏賷猬霡鮰㗖犲䰇籑饊𦅙慙䰄麖慽"],["a073","坟慯抦戹拎㩜懢厪𣏵捤栂㗒"],["a0a1","嵗𨯂迚𨸹"],["a0a6","僙𡵆礆匲阸𠼻䁥"],["a0ae","矾"],["a0b0","糂𥼚糚稭聦聣絍甅瓲覔舚朌聢𧒆聛瓰脃眤覉𦟌畓𦻑螩蟎臈螌詉貭譃眫瓸蓚㘵榲趦"],["a0d4","覩瑨涹蟁𤀑瓧㷛煶悤憜㳑煢恷"],["a0e2","罱𨬭牐惩䭾删㰘𣳇𥻗𧙖𥔱𡥄𡋾𩤃𦷜𧂭峁𦆭𨨏𣙷𠃮𦡆𤼎䕢嬟𦍌齐麦𦉫"],["a3c0","␀",31,"␡"],["c6a1","①",9,"⑴",9,"ⅰ",9,"丶丿亅亠冂冖冫勹匸卩厶夊宀巛⼳广廴彐彡攴无疒癶辵隶¨ˆヽヾゝゞ〃仝々〆〇ー[]✽ぁ",23],["c740","す",58,"ァアィイ"],["c7a1","ゥ",81,"А",5,"ЁЖ",4],["c840","Л",26,"ёж",25,"⇧↸↹㇏𠃌乚𠂊刂䒑"],["c8a1","龰冈龱𧘇"],["c8cd","¬¦'"㈱№℡゛゜⺀⺄⺆⺇⺈⺊⺌⺍⺕⺜⺝⺥⺧⺪⺬⺮⺶⺼⺾⻆⻊⻌⻍⻏⻖⻗⻞⻣"],["c8f5","ʃɐɛɔɵœøŋʊɪ"],["f9fe","■"],["fa40","𠕇鋛𠗟𣿅蕌䊵珯况㙉𤥂𨧤鍄𡧛苮𣳈砼杄拟𤤳𨦪𠊠𦮳𡌅侫𢓭倈𦴩𧪄𣘀𤪱𢔓倩𠍾徤𠎀𠍇滛𠐟偽儁㑺儎顬㝃萖𤦤𠒇兠𣎴兪𠯿𢃼𠋥𢔰𠖎𣈳𡦃宂蝽𠖳𣲙冲冸"],["faa1","鴴凉减凑㳜凓𤪦决凢卂凭菍椾𣜭彻刋刦刼劵剗劔効勅簕蕂勠蘍𦬓包𨫞啉滙𣾀𠥔𣿬匳卄𠯢泋𡜦栛珕恊㺪㣌𡛨燝䒢卭却𨚫卾卿𡖖𡘓矦厓𨪛厠厫厮玧𥝲㽙玜叁叅汉义埾叙㪫𠮏叠𣿫𢶣叶𠱷吓灹唫晗浛呭𦭓𠵴啝咏咤䞦𡜍𠻝㶴𠵍"],["fb40","𨦼𢚘啇䳭启琗喆喩嘅𡣗𤀺䕒𤐵暳𡂴嘷曍𣊊暤暭噍噏磱囱鞇叾圀囯园𨭦㘣𡉏坆𤆥汮炋坂㚱𦱾埦𡐖堃𡑔𤍣堦𤯵塜墪㕡壠壜𡈼壻寿坃𪅐𤉸鏓㖡够梦㛃湙"],["fba1","𡘾娤啓𡚒蔅姉𠵎𦲁𦴪𡟜姙𡟻𡞲𦶦浱𡠨𡛕姹𦹅媫婣㛦𤦩婷㜈媖瑥嫓𦾡𢕔㶅𡤑㜲𡚸広勐孶斈孼𧨎䀄䡝𠈄寕慠𡨴𥧌𠖥寳宝䴐尅𡭄尓珎尔𡲥𦬨屉䣝岅峩峯嶋𡷹𡸷崐崘嵆𡺤岺巗苼㠭𤤁𢁉𢅳芇㠶㯂帮檊幵幺𤒼𠳓厦亷廐厨𡝱帉廴𨒂"],["fc40","廹廻㢠廼栾鐛弍𠇁弢㫞䢮𡌺强𦢈𢏐彘𢑱彣鞽𦹮彲鍀𨨶徧嶶㵟𥉐𡽪𧃸𢙨釖𠊞𨨩怱暅𡡷㥣㷇㘹垐𢞴祱㹀悞悤悳𤦂𤦏𧩓璤僡媠慤萤慂慈𦻒憁凴𠙖憇宪𣾷"],["fca1","𢡟懓𨮝𩥝懐㤲𢦀𢣁怣慜攞掋𠄘担𡝰拕𢸍捬𤧟㨗搸揸𡎎𡟼撐澊𢸶頔𤂌𥜝擡擥鑻㩦携㩗敍漖𤨨𤨣斅敭敟𣁾斵𤥀䬷旑䃘𡠩无旣忟𣐀昘𣇷𣇸晄𣆤𣆥晋𠹵晧𥇦晳晴𡸽𣈱𨗴𣇈𥌓矅𢣷馤朂𤎜𤨡㬫槺𣟂杞杧杢𤇍𩃭柗䓩栢湐鈼栁𣏦𦶠桝"],["fd40","𣑯槡樋𨫟楳棃𣗍椁椀㴲㨁𣘼㮀枬楡𨩊䋼椶榘㮡𠏉荣傐槹𣙙𢄪橅𣜃檝㯳枱櫈𩆜㰍欝𠤣惞欵歴𢟍溵𣫛𠎵𡥘㝀吡𣭚毡𣻼毜氷𢒋𤣱𦭑汚舦汹𣶼䓅𣶽𤆤𤤌𤤀"],["fda1","𣳉㛥㳫𠴲鮃𣇹𢒑羏样𦴥𦶡𦷫涖浜湼漄𤥿𤂅𦹲蔳𦽴凇沜渝萮𨬡港𣸯瑓𣾂秌湏媑𣁋濸㜍澝𣸰滺𡒗𤀽䕕鏰潄潜㵎潴𩅰㴻澟𤅄濓𤂑𤅕𤀹𣿰𣾴𤄿凟𤅖𤅗𤅀𦇝灋灾炧炁烌烕烖烟䄄㷨熴熖𤉷焫煅媈煊煮岜𤍥煏鍢𤋁焬𤑚𤨧𤨢熺𨯨炽爎"],["fe40","鑂爕夑鑃爤鍁𥘅爮牀𤥴梽牕牗㹕𣁄栍漽犂猪猫𤠣𨠫䣭𨠄猨献珏玪𠰺𦨮珉瑉𤇢𡛧𤨤昣㛅𤦷𤦍𤧻珷琕椃𤨦琹𠗃㻗瑜𢢭瑠𨺲瑇珤瑶莹瑬㜰瑴鏱樬璂䥓𤪌"],["fea1","𤅟𤩹𨮏孆𨰃𡢞瓈𡦈甎瓩甞𨻙𡩋寗𨺬鎅畍畊畧畮𤾂㼄𤴓疎瑝疞疴瘂瘬癑癏癯癶𦏵皐臯㟸𦤑𦤎皡皥皷盌𦾟葢𥂝𥅽𡸜眞眦着撯𥈠睘𣊬瞯𨥤𨥨𡛁矴砉𡍶𤨒棊碯磇磓隥礮𥗠磗礴碱𧘌辸袄𨬫𦂃𢘜禆褀椂禀𥡗禝𧬹礼禩渪𧄦㺨秆𩄍秔"]]'); /***/ }), /***/ "./node_modules/encoding/node_modules/iconv-lite/encodings/tables/cp936.json": /*!***********************************************************************************!*\ !*** ./node_modules/encoding/node_modules/iconv-lite/encodings/tables/cp936.json ***! \***********************************************************************************/ /***/ ((module) => { "use strict"; module.exports = /*#__PURE__*/JSON.parse('[["0","\\u0000",127,"€"],["8140","丂丄丅丆丏丒丗丟丠両丣並丩丮丯丱丳丵丷丼乀乁乂乄乆乊乑乕乗乚乛乢乣乤乥乧乨乪",5,"乲乴",9,"乿",6,"亇亊"],["8180","亐亖亗亙亜亝亞亣亪亯亰亱亴亶亷亸亹亼亽亾仈仌仏仐仒仚仛仜仠仢仦仧仩仭仮仯仱仴仸仹仺仼仾伀伂",6,"伋伌伒",4,"伜伝伡伣伨伩伬伭伮伱伳伵伷伹伻伾",4,"佄佅佇",5,"佒佔佖佡佢佦佨佪佫佭佮佱佲併佷佸佹佺佽侀侁侂侅來侇侊侌侎侐侒侓侕侖侘侙侚侜侞侟価侢"],["8240","侤侫侭侰",4,"侶",8,"俀俁係俆俇俈俉俋俌俍俒",4,"俙俛俠俢俤俥俧俫俬俰俲俴俵俶俷俹俻俼俽俿",11],["8280","個倎倐們倓倕倖倗倛倝倞倠倢倣値倧倫倯",10,"倻倽倿偀偁偂偄偅偆偉偊偋偍偐",4,"偖偗偘偙偛偝",7,"偦",5,"偭",8,"偸偹偺偼偽傁傂傃傄傆傇傉傊傋傌傎",20,"傤傦傪傫傭",4,"傳",6,"傼"],["8340","傽",17,"僐",5,"僗僘僙僛",10,"僨僩僪僫僯僰僱僲僴僶",4,"僼",9,"儈"],["8380","儉儊儌",5,"儓",13,"儢",28,"兂兇兊兌兎兏児兒兓兗兘兙兛兝",4,"兣兤兦內兩兪兯兲兺兾兿冃冄円冇冊冋冎冏冐冑冓冔冘冚冝冞冟冡冣冦",4,"冭冮冴冸冹冺冾冿凁凂凃凅凈凊凍凎凐凒",5],["8440","凘凙凚凜凞凟凢凣凥",5,"凬凮凱凲凴凷凾刄刅刉刋刌刏刐刓刔刕刜刞刟刡刢刣別刦刧刪刬刯刱刲刴刵刼刾剄",5,"剋剎剏剒剓剕剗剘"],["8480","剙剚剛剝剟剠剢剣剤剦剨剫剬剭剮剰剱剳",9,"剾劀劃",4,"劉",6,"劑劒劔",6,"劜劤劥劦劧劮劯劰労",9,"勀勁勂勄勅勆勈勊勌勍勎勏勑勓勔動勗務",5,"勠勡勢勣勥",10,"勱",7,"勻勼勽匁匂匃匄匇匉匊匋匌匎"],["8540","匑匒匓匔匘匛匜匞匟匢匤匥匧匨匩匫匬匭匯",9,"匼匽區卂卄卆卋卌卍卐協単卙卛卝卥卨卪卬卭卲卶卹卻卼卽卾厀厁厃厇厈厊厎厏"],["8580","厐",4,"厖厗厙厛厜厞厠厡厤厧厪厫厬厭厯",6,"厷厸厹厺厼厽厾叀參",4,"収叏叐叒叓叕叚叜叝叞叡叢叧叴叺叾叿吀吂吅吇吋吔吘吙吚吜吢吤吥吪吰吳吶吷吺吽吿呁呂呄呅呇呉呌呍呎呏呑呚呝",4,"呣呥呧呩",7,"呴呹呺呾呿咁咃咅咇咈咉咊咍咑咓咗咘咜咞咟咠咡"],["8640","咢咥咮咰咲咵咶咷咹咺咼咾哃哅哊哋哖哘哛哠",4,"哫哬哯哰哱哴",5,"哻哾唀唂唃唄唅唈唊",4,"唒唓唕",5,"唜唝唞唟唡唥唦"],["8680","唨唩唫唭唲唴唵唶唸唹唺唻唽啀啂啅啇啈啋",4,"啑啒啓啔啗",4,"啝啞啟啠啢啣啨啩啫啯",5,"啹啺啽啿喅喆喌喍喎喐喒喓喕喖喗喚喛喞喠",6,"喨",8,"喲喴営喸喺喼喿",4,"嗆嗇嗈嗊嗋嗎嗏嗐嗕嗗",4,"嗞嗠嗢嗧嗩嗭嗮嗰嗱嗴嗶嗸",4,"嗿嘂嘃嘄嘅"],["8740","嘆嘇嘊嘋嘍嘐",7,"嘙嘚嘜嘝嘠嘡嘢嘥嘦嘨嘩嘪嘫嘮嘯嘰嘳嘵嘷嘸嘺嘼嘽嘾噀",11,"噏",4,"噕噖噚噛噝",4],["8780","噣噥噦噧噭噮噯噰噲噳噴噵噷噸噹噺噽",7,"嚇",6,"嚐嚑嚒嚔",14,"嚤",10,"嚰",6,"嚸嚹嚺嚻嚽",12,"囋",8,"囕囖囘囙囜団囥",5,"囬囮囯囲図囶囷囸囻囼圀圁圂圅圇國",6],["8840","園",9,"圝圞圠圡圢圤圥圦圧圫圱圲圴",4,"圼圽圿坁坃坄坅坆坈坉坋坒",4,"坘坙坢坣坥坧坬坮坰坱坲坴坵坸坹坺坽坾坿垀"],["8880","垁垇垈垉垊垍",4,"垔",6,"垜垝垞垟垥垨垪垬垯垰垱垳垵垶垷垹",8,"埄",6,"埌埍埐埑埓埖埗埛埜埞埡埢埣埥",7,"埮埰埱埲埳埵埶執埻埼埾埿堁堃堄堅堈堉堊堌堎堏堐堒堓堔堖堗堘堚堛堜堝堟堢堣堥",4,"堫",4,"報堲堳場堶",7],["8940","堾",5,"塅",6,"塎塏塐塒塓塕塖塗塙",4,"塟",5,"塦",4,"塭",16,"塿墂墄墆墇墈墊墋墌"],["8980","墍",4,"墔",4,"墛墜墝墠",7,"墪",17,"墽墾墿壀壂壃壄壆",10,"壒壓壔壖",13,"壥",5,"壭壯壱売壴壵壷壸壺",7,"夃夅夆夈",4,"夎夐夑夒夓夗夘夛夝夞夠夡夢夣夦夨夬夰夲夳夵夶夻"],["8a40","夽夾夿奀奃奅奆奊奌奍奐奒奓奙奛",4,"奡奣奤奦",12,"奵奷奺奻奼奾奿妀妅妉妋妌妎妏妐妑妔妕妘妚妛妜妝妟妠妡妢妦"],["8a80","妧妬妭妰妱妳",5,"妺妼妽妿",6,"姇姈姉姌姍姎姏姕姖姙姛姞",4,"姤姦姧姩姪姫姭",11,"姺姼姽姾娀娂娊娋娍娎娏娐娒娔娕娖娗娙娚娛娝娞娡娢娤娦娧娨娪",6,"娳娵娷",4,"娽娾娿婁",4,"婇婈婋",9,"婖婗婘婙婛",5],["8b40","婡婣婤婥婦婨婩婫",8,"婸婹婻婼婽婾媀",17,"媓",6,"媜",13,"媫媬"],["8b80","媭",4,"媴媶媷媹",4,"媿嫀嫃",5,"嫊嫋嫍",4,"嫓嫕嫗嫙嫚嫛嫝嫞嫟嫢嫤嫥嫧嫨嫪嫬",4,"嫲",22,"嬊",11,"嬘",25,"嬳嬵嬶嬸",7,"孁",6],["8c40","孈",7,"孒孖孞孠孡孧孨孫孭孮孯孲孴孶孷學孹孻孼孾孿宂宆宊宍宎宐宑宒宔宖実宧宨宩宬宭宮宯宱宲宷宺宻宼寀寁寃寈寉寊寋寍寎寏"],["8c80","寑寔",8,"寠寢寣實寧審",4,"寯寱",6,"寽対尀専尃尅將專尋尌對導尐尒尓尗尙尛尞尟尠尡尣尦尨尩尪尫尭尮尯尰尲尳尵尶尷屃屄屆屇屌屍屒屓屔屖屗屘屚屛屜屝屟屢層屧",6,"屰屲",6,"屻屼屽屾岀岃",4,"岉岊岋岎岏岒岓岕岝",4,"岤",4],["8d40","岪岮岯岰岲岴岶岹岺岻岼岾峀峂峃峅",5,"峌",5,"峓",5,"峚",6,"峢峣峧峩峫峬峮峯峱",9,"峼",4],["8d80","崁崄崅崈",5,"崏",4,"崕崗崘崙崚崜崝崟",4,"崥崨崪崫崬崯",4,"崵",7,"崿",7,"嵈嵉嵍",10,"嵙嵚嵜嵞",10,"嵪嵭嵮嵰嵱嵲嵳嵵",12,"嶃",21,"嶚嶛嶜嶞嶟嶠"],["8e40","嶡",21,"嶸",12,"巆",6,"巎",12,"巜巟巠巣巤巪巬巭"],["8e80","巰巵巶巸",4,"巿帀帄帇帉帊帋帍帎帒帓帗帞",7,"帨",4,"帯帰帲",4,"帹帺帾帿幀幁幃幆",5,"幍",6,"幖",4,"幜幝幟幠幣",14,"幵幷幹幾庁庂広庅庈庉庌庍庎庒庘庛庝庡庢庣庤庨",4,"庮",4,"庴庺庻庼庽庿",6],["8f40","廆廇廈廋",5,"廔廕廗廘廙廚廜",11,"廩廫",8,"廵廸廹廻廼廽弅弆弇弉弌弍弎弐弒弔弖弙弚弜弝弞弡弢弣弤"],["8f80","弨弫弬弮弰弲",6,"弻弽弾弿彁",14,"彑彔彙彚彛彜彞彟彠彣彥彧彨彫彮彯彲彴彵彶彸彺彽彾彿徃徆徍徎徏徑従徔徖徚徛徝從徟徠徢",5,"復徫徬徯",5,"徶徸徹徺徻徾",4,"忇忈忊忋忎忓忔忕忚忛応忞忟忢忣忥忦忨忩忬忯忰忲忳忴忶忷忹忺忼怇"],["9040","怈怉怋怌怐怑怓怗怘怚怞怟怢怣怤怬怭怮怰",4,"怶",4,"怽怾恀恄",6,"恌恎恏恑恓恔恖恗恘恛恜恞恟恠恡恥恦恮恱恲恴恵恷恾悀"],["9080","悁悂悅悆悇悈悊悋悎悏悐悑悓悕悗悘悙悜悞悡悢悤悥悧悩悪悮悰悳悵悶悷悹悺悽",7,"惇惈惉惌",4,"惒惓惔惖惗惙惛惞惡",4,"惪惱惲惵惷惸惻",4,"愂愃愄愅愇愊愋愌愐",4,"愖愗愘愙愛愜愝愞愡愢愥愨愩愪愬",18,"慀",6],["9140","慇慉態慍慏慐慒慓慔慖",6,"慞慟慠慡慣慤慥慦慩",6,"慱慲慳慴慶慸",18,"憌憍憏",4,"憕"],["9180","憖",6,"憞",8,"憪憫憭",9,"憸",5,"憿懀懁懃",4,"應懌",4,"懓懕",16,"懧",13,"懶",8,"戀",5,"戇戉戓戔戙戜戝戞戠戣戦戧戨戩戫戭戯戰戱戲戵戶戸",4,"扂扄扅扆扊"],["9240","扏扐払扖扗扙扚扜",6,"扤扥扨扱扲扴扵扷扸扺扻扽抁抂抃抅抆抇抈抋",5,"抔抙抜抝択抣抦抧抩抪抭抮抯抰抲抳抴抶抷抸抺抾拀拁"],["9280","拃拋拏拑拕拝拞拠拡拤拪拫拰拲拵拸拹拺拻挀挃挄挅挆挊挋挌挍挏挐挒挓挔挕挗挘挙挜挦挧挩挬挭挮挰挱挳",5,"挻挼挾挿捀捁捄捇捈捊捑捒捓捔捖",7,"捠捤捥捦捨捪捫捬捯捰捲捳捴捵捸捹捼捽捾捿掁掃掄掅掆掋掍掑掓掔掕掗掙",6,"採掤掦掫掯掱掲掵掶掹掻掽掿揀"],["9340","揁揂揃揅揇揈揊揋揌揑揓揔揕揗",6,"揟揢揤",4,"揫揬揮揯揰揱揳揵揷揹揺揻揼揾搃搄搆",4,"損搎搑搒搕",5,"搝搟搢搣搤"],["9380","搥搧搨搩搫搮",5,"搵",4,"搻搼搾摀摂摃摉摋",6,"摓摕摖摗摙",4,"摟",7,"摨摪摫摬摮",9,"摻",6,"撃撆撈",8,"撓撔撗撘撚撛撜撝撟",4,"撥撦撧撨撪撫撯撱撲撳撴撶撹撻撽撾撿擁擃擄擆",6,"擏擑擓擔擕擖擙據"],["9440","擛擜擝擟擠擡擣擥擧",24,"攁",7,"攊",7,"攓",4,"攙",8],["9480","攢攣攤攦",4,"攬攭攰攱攲攳攷攺攼攽敀",4,"敆敇敊敋敍敎敐敒敓敔敗敘敚敜敟敠敡敤敥敧敨敩敪敭敮敯敱敳敵敶數",14,"斈斉斊斍斎斏斒斔斕斖斘斚斝斞斠斢斣斦斨斪斬斮斱",7,"斺斻斾斿旀旂旇旈旉旊旍旐旑旓旔旕旘",7,"旡旣旤旪旫"],["9540","旲旳旴旵旸旹旻",4,"昁昄昅昇昈昉昋昍昐昑昒昖昗昘昚昛昜昞昡昢昣昤昦昩昪昫昬昮昰昲昳昷",4,"昽昿晀時晄",6,"晍晎晐晑晘"],["9580","晙晛晜晝晞晠晢晣晥晧晩",4,"晱晲晳晵晸晹晻晼晽晿暀暁暃暅暆暈暉暊暋暍暎暏暐暒暓暔暕暘",4,"暞",8,"暩",4,"暯",4,"暵暶暷暸暺暻暼暽暿",25,"曚曞",7,"曧曨曪",5,"曱曵曶書曺曻曽朁朂會"],["9640","朄朅朆朇朌朎朏朑朒朓朖朘朙朚朜朞朠",5,"朧朩朮朰朲朳朶朷朸朹朻朼朾朿杁杄杅杇杊杋杍杒杔杕杗",4,"杝杢杣杤杦杧杫杬杮東杴杶"],["9680","杸杹杺杻杽枀枂枃枅枆枈枊枌枍枎枏枑枒枓枔枖枙枛枟枠枡枤枦枩枬枮枱枲枴枹",7,"柂柅",9,"柕柖柗柛柟柡柣柤柦柧柨柪柫柭柮柲柵",7,"柾栁栂栃栄栆栍栐栒栔栕栘",4,"栞栟栠栢",6,"栫",6,"栴栵栶栺栻栿桇桋桍桏桒桖",5],["9740","桜桝桞桟桪桬",7,"桵桸",8,"梂梄梇",7,"梐梑梒梔梕梖梘",9,"梣梤梥梩梪梫梬梮梱梲梴梶梷梸"],["9780","梹",6,"棁棃",5,"棊棌棎棏棐棑棓棔棖棗棙棛",4,"棡棢棤",9,"棯棲棳棴棶棷棸棻棽棾棿椀椂椃椄椆",4,"椌椏椑椓",11,"椡椢椣椥",7,"椮椯椱椲椳椵椶椷椸椺椻椼椾楀楁楃",16,"楕楖楘楙楛楜楟"],["9840","楡楢楤楥楧楨楩楪楬業楯楰楲",4,"楺楻楽楾楿榁榃榅榊榋榌榎",5,"榖榗榙榚榝",9,"榩榪榬榮榯榰榲榳榵榶榸榹榺榼榽"],["9880","榾榿槀槂",7,"構槍槏槑槒槓槕",5,"槜槝槞槡",11,"槮槯槰槱槳",9,"槾樀",9,"樋",11,"標",5,"樠樢",5,"権樫樬樭樮樰樲樳樴樶",6,"樿",4,"橅橆橈",7,"橑",6,"橚"],["9940","橜",4,"橢橣橤橦",10,"橲",6,"橺橻橽橾橿檁檂檃檅",8,"檏檒",4,"檘",7,"檡",5],["9980","檧檨檪檭",114,"欥欦欨",6],["9a40","欯欰欱欳欴欵欶欸欻欼欽欿歀歁歂歄歅歈歊歋歍",11,"歚",7,"歨歩歫",13,"歺歽歾歿殀殅殈"],["9a80","殌殎殏殐殑殔殕殗殘殙殜",4,"殢",7,"殫",7,"殶殸",6,"毀毃毄毆",4,"毌毎毐毑毘毚毜",4,"毢",7,"毬毭毮毰毱毲毴毶毷毸毺毻毼毾",6,"氈",4,"氎氒気氜氝氞氠氣氥氫氬氭氱氳氶氷氹氺氻氼氾氿汃汄汅汈汋",4,"汑汒汓汖汘"],["9b40","汙汚汢汣汥汦汧汫",4,"汱汳汵汷汸決汻汼汿沀沄沇沊沋沍沎沑沒沕沖沗沘沚沜沝沞沠沢沨沬沯沰沴沵沶沷沺泀況泂泃泆泇泈泋泍泎泏泑泒泘"],["9b80","泙泚泜泝泟泤泦泧泩泬泭泲泴泹泿洀洂洃洅洆洈洉洊洍洏洐洑洓洔洕洖洘洜洝洟",5,"洦洨洩洬洭洯洰洴洶洷洸洺洿浀浂浄浉浌浐浕浖浗浘浛浝浟浡浢浤浥浧浨浫浬浭浰浱浲浳浵浶浹浺浻浽",4,"涃涄涆涇涊涋涍涏涐涒涖",4,"涜涢涥涬涭涰涱涳涴涶涷涹",5,"淁淂淃淈淉淊"],["9c40","淍淎淏淐淒淓淔淕淗淚淛淜淟淢淣淥淧淨淩淪淭淯淰淲淴淵淶淸淺淽",7,"渆渇済渉渋渏渒渓渕渘渙減渜渞渟渢渦渧渨渪測渮渰渱渳渵"],["9c80","渶渷渹渻",7,"湅",7,"湏湐湑湒湕湗湙湚湜湝湞湠",10,"湬湭湯",14,"満溁溂溄溇溈溊",4,"溑",6,"溙溚溛溝溞溠溡溣溤溦溨溩溫溬溭溮溰溳溵溸溹溼溾溿滀滃滄滅滆滈滉滊滌滍滎滐滒滖滘滙滛滜滝滣滧滪",5],["9d40","滰滱滲滳滵滶滷滸滺",7,"漃漄漅漇漈漊",4,"漐漑漒漖",9,"漡漢漣漥漦漧漨漬漮漰漲漴漵漷",6,"漿潀潁潂"],["9d80","潃潄潅潈潉潊潌潎",9,"潙潚潛潝潟潠潡潣潤潥潧",5,"潯潰潱潳潵潶潷潹潻潽",6,"澅澆澇澊澋澏",12,"澝澞澟澠澢",4,"澨",10,"澴澵澷澸澺",5,"濁濃",5,"濊",6,"濓",10,"濟濢濣濤濥"],["9e40","濦",7,"濰",32,"瀒",7,"瀜",6,"瀤",6],["9e80","瀫",9,"瀶瀷瀸瀺",17,"灍灎灐",13,"灟",11,"灮灱灲灳灴灷灹灺灻災炁炂炃炄炆炇炈炋炌炍炏炐炑炓炗炘炚炛炞",12,"炰炲炴炵炶為炾炿烄烅烆烇烉烋",12,"烚"],["9f40","烜烝烞烠烡烢烣烥烪烮烰",6,"烸烺烻烼烾",10,"焋",4,"焑焒焔焗焛",10,"焧",7,"焲焳焴"],["9f80","焵焷",13,"煆煇煈煉煋煍煏",12,"煝煟",4,"煥煩",4,"煯煰煱煴煵煶煷煹煻煼煾",5,"熅",4,"熋熌熍熎熐熑熒熓熕熖熗熚",4,"熡",6,"熩熪熫熭",5,"熴熶熷熸熺",8,"燄",9,"燏",4],["a040","燖",9,"燡燢燣燤燦燨",5,"燯",9,"燺",11,"爇",19],["a080","爛爜爞",9,"爩爫爭爮爯爲爳爴爺爼爾牀",6,"牉牊牋牎牏牐牑牓牔牕牗牘牚牜牞牠牣牤牥牨牪牫牬牭牰牱牳牴牶牷牸牻牼牽犂犃犅",4,"犌犎犐犑犓",11,"犠",11,"犮犱犲犳犵犺",6,"狅狆狇狉狊狋狌狏狑狓狔狕狖狘狚狛"],["a1a1"," 、。·ˉˇ¨〃々—~‖…‘’“”〔〕〈",7,"〖〗【】±×÷∶∧∨∑∏∪∩∈∷√⊥∥∠⌒⊙∫∮≡≌≈∽∝≠≮≯≤≥∞∵∴♂♀°′″℃$¤¢£‰§№☆★○●◎◇◆□■△▲※→←↑↓〓"],["a2a1","ⅰ",9],["a2b1","⒈",19,"⑴",19,"①",9],["a2e5","㈠",9],["a2f1","Ⅰ",11],["a3a1","!"#¥%",88," ̄"],["a4a1","ぁ",82],["a5a1","ァ",85],["a6a1","Α",16,"Σ",6],["a6c1","α",16,"σ",6],["a6e0","︵︶︹︺︿﹀︽︾﹁﹂﹃﹄"],["a6ee","︻︼︷︸︱"],["a6f4","︳︴"],["a7a1","А",5,"ЁЖ",25],["a7d1","а",5,"ёж",25],["a840","ˊˋ˙–―‥‵℅℉↖↗↘↙∕∟∣≒≦≧⊿═",35,"▁",6],["a880","█",7,"▓▔▕▼▽◢◣◤◥☉⊕〒〝〞"],["a8a1","āáǎàēéěèīíǐìōóǒòūúǔùǖǘǚǜüêɑ"],["a8bd","ńň"],["a8c0","ɡ"],["a8c5","ㄅ",36],["a940","〡",8,"㊣㎎㎏㎜㎝㎞㎡㏄㏎㏑㏒㏕︰¬¦"],["a959","℡㈱"],["a95c","‐"],["a960","ー゛゜ヽヾ〆ゝゞ﹉",9,"﹔﹕﹖﹗﹙",8],["a980","﹢",4,"﹨﹩﹪﹫"],["a996","〇"],["a9a4","─",75],["aa40","狜狝狟狢",5,"狪狫狵狶狹狽狾狿猀猂猄",5,"猋猌猍猏猐猑猒猔猘猙猚猟猠猣猤猦猧猨猭猯猰猲猳猵猶猺猻猼猽獀",8],["aa80","獉獊獋獌獎獏獑獓獔獕獖獘",7,"獡",10,"獮獰獱"],["ab40","獲",11,"獿",4,"玅玆玈玊玌玍玏玐玒玓玔玕玗玘玙玚玜玝玞玠玡玣",5,"玪玬玭玱玴玵玶玸玹玼玽玾玿珁珃",4],["ab80","珋珌珎珒",6,"珚珛珜珝珟珡珢珣珤珦珨珪珫珬珮珯珰珱珳",4],["ac40","珸",10,"琄琇琈琋琌琍琎琑",8,"琜",5,"琣琤琧琩琫琭琯琱琲琷",4,"琽琾琿瑀瑂",11],["ac80","瑎",6,"瑖瑘瑝瑠",12,"瑮瑯瑱",4,"瑸瑹瑺"],["ad40","瑻瑼瑽瑿璂璄璅璆璈璉璊璌璍璏璑",10,"璝璟",7,"璪",15,"璻",12],["ad80","瓈",9,"瓓",8,"瓝瓟瓡瓥瓧",6,"瓰瓱瓲"],["ae40","瓳瓵瓸",6,"甀甁甂甃甅",7,"甎甐甒甔甕甖甗甛甝甞甠",4,"甦甧甪甮甴甶甹甼甽甿畁畂畃畄畆畇畉畊畍畐畑畒畓畕畖畗畘"],["ae80","畝",7,"畧畨畩畫",6,"畳畵當畷畺",4,"疀疁疂疄疅疇"],["af40","疈疉疊疌疍疎疐疓疕疘疛疜疞疢疦",4,"疭疶疷疺疻疿痀痁痆痋痌痎痏痐痑痓痗痙痚痜痝痟痠痡痥痩痬痭痮痯痲痳痵痶痷痸痺痻痽痾瘂瘄瘆瘇"],["af80","瘈瘉瘋瘍瘎瘏瘑瘒瘓瘔瘖瘚瘜瘝瘞瘡瘣瘧瘨瘬瘮瘯瘱瘲瘶瘷瘹瘺瘻瘽癁療癄"],["b040","癅",6,"癎",5,"癕癗",4,"癝癟癠癡癢癤",6,"癬癭癮癰",7,"癹発發癿皀皁皃皅皉皊皌皍皏皐皒皔皕皗皘皚皛"],["b080","皜",7,"皥",8,"皯皰皳皵",9,"盀盁盃啊阿埃挨哎唉哀皑癌蔼矮艾碍爱隘鞍氨安俺按暗岸胺案肮昂盎凹敖熬翱袄傲奥懊澳芭捌扒叭吧笆八疤巴拔跋靶把耙坝霸罢爸白柏百摆佰败拜稗斑班搬扳般颁板版扮拌伴瓣半办绊邦帮梆榜膀绑棒磅蚌镑傍谤苞胞包褒剥"],["b140","盄盇盉盋盌盓盕盙盚盜盝盞盠",4,"盦",7,"盰盳盵盶盷盺盻盽盿眀眂眃眅眆眊県眎",10,"眛眜眝眞眡眣眤眥眧眪眫"],["b180","眬眮眰",4,"眹眻眽眾眿睂睄睅睆睈",7,"睒",7,"睜薄雹保堡饱宝抱报暴豹鲍爆杯碑悲卑北辈背贝钡倍狈备惫焙被奔苯本笨崩绷甭泵蹦迸逼鼻比鄙笔彼碧蓖蔽毕毙毖币庇痹闭敝弊必辟壁臂避陛鞭边编贬扁便变卞辨辩辫遍标彪膘表鳖憋别瘪彬斌濒滨宾摈兵冰柄丙秉饼炳"],["b240","睝睞睟睠睤睧睩睪睭",11,"睺睻睼瞁瞂瞃瞆",5,"瞏瞐瞓",11,"瞡瞣瞤瞦瞨瞫瞭瞮瞯瞱瞲瞴瞶",4],["b280","瞼瞾矀",12,"矎",8,"矘矙矚矝",4,"矤病并玻菠播拨钵波博勃搏铂箔伯帛舶脖膊渤泊驳捕卜哺补埠不布步簿部怖擦猜裁材才财睬踩采彩菜蔡餐参蚕残惭惨灿苍舱仓沧藏操糙槽曹草厕策侧册测层蹭插叉茬茶查碴搽察岔差诧拆柴豺搀掺蝉馋谗缠铲产阐颤昌猖"],["b340","矦矨矪矯矰矱矲矴矵矷矹矺矻矼砃",5,"砊砋砎砏砐砓砕砙砛砞砠砡砢砤砨砪砫砮砯砱砲砳砵砶砽砿硁硂硃硄硆硈硉硊硋硍硏硑硓硔硘硙硚"],["b380","硛硜硞",11,"硯",7,"硸硹硺硻硽",6,"场尝常长偿肠厂敞畅唱倡超抄钞朝嘲潮巢吵炒车扯撤掣彻澈郴臣辰尘晨忱沉陈趁衬撑称城橙成呈乘程惩澄诚承逞骋秤吃痴持匙池迟弛驰耻齿侈尺赤翅斥炽充冲虫崇宠抽酬畴踌稠愁筹仇绸瞅丑臭初出橱厨躇锄雏滁除楚"],["b440","碄碅碆碈碊碋碏碐碒碔碕碖碙碝碞碠碢碤碦碨",7,"碵碶碷碸確碻碼碽碿磀磂磃磄磆磇磈磌磍磎磏磑磒磓磖磗磘磚",9],["b480","磤磥磦磧磩磪磫磭",4,"磳磵磶磸磹磻",5,"礂礃礄礆",6,"础储矗搐触处揣川穿椽传船喘串疮窗幢床闯创吹炊捶锤垂春椿醇唇淳纯蠢戳绰疵茨磁雌辞慈瓷词此刺赐次聪葱囱匆从丛凑粗醋簇促蹿篡窜摧崔催脆瘁粹淬翠村存寸磋撮搓措挫错搭达答瘩打大呆歹傣戴带殆代贷袋待逮"],["b540","礍",5,"礔",9,"礟",4,"礥",14,"礵",4,"礽礿祂祃祄祅祇祊",8,"祔祕祘祙祡祣"],["b580","祤祦祩祪祫祬祮祰",6,"祹祻",4,"禂禃禆禇禈禉禋禌禍禎禐禑禒怠耽担丹单郸掸胆旦氮但惮淡诞弹蛋当挡党荡档刀捣蹈倒岛祷导到稻悼道盗德得的蹬灯登等瞪凳邓堤低滴迪敌笛狄涤翟嫡抵底地蒂第帝弟递缔颠掂滇碘点典靛垫电佃甸店惦奠淀殿碉叼雕凋刁掉吊钓调跌爹碟蝶迭谍叠"],["b640","禓",6,"禛",11,"禨",10,"禴",4,"禼禿秂秄秅秇秈秊秌秎秏秐秓秔秖秗秙",5,"秠秡秢秥秨秪"],["b680","秬秮秱",6,"秹秺秼秾秿稁稄稅稇稈稉稊稌稏",4,"稕稖稘稙稛稜丁盯叮钉顶鼎锭定订丢东冬董懂动栋侗恫冻洞兜抖斗陡豆逗痘都督毒犊独读堵睹赌杜镀肚度渡妒端短锻段断缎堆兑队对墩吨蹲敦顿囤钝盾遁掇哆多夺垛躲朵跺舵剁惰堕蛾峨鹅俄额讹娥恶厄扼遏鄂饿恩而儿耳尔饵洱二"],["b740","稝稟稡稢稤",14,"稴稵稶稸稺稾穀",5,"穇",9,"穒",4,"穘",16],["b780","穩",6,"穱穲穳穵穻穼穽穾窂窅窇窉窊窋窌窎窏窐窓窔窙窚窛窞窡窢贰发罚筏伐乏阀法珐藩帆番翻樊矾钒繁凡烦反返范贩犯饭泛坊芳方肪房防妨仿访纺放菲非啡飞肥匪诽吠肺废沸费芬酚吩氛分纷坟焚汾粉奋份忿愤粪丰封枫蜂峰锋风疯烽逢冯缝讽奉凤佛否夫敷肤孵扶拂辐幅氟符伏俘服"],["b840","窣窤窧窩窪窫窮",4,"窴",10,"竀",10,"竌",9,"竗竘竚竛竜竝竡竢竤竧",5,"竮竰竱竲竳"],["b880","竴",4,"竻竼竾笀笁笂笅笇笉笌笍笎笐笒笓笖笗笘笚笜笝笟笡笢笣笧笩笭浮涪福袱弗甫抚辅俯釜斧脯腑府腐赴副覆赋复傅付阜父腹负富讣附妇缚咐噶嘎该改概钙盖溉干甘杆柑竿肝赶感秆敢赣冈刚钢缸肛纲岗港杠篙皋高膏羔糕搞镐稿告哥歌搁戈鸽胳疙割革葛格蛤阁隔铬个各给根跟耕更庚羹"],["b940","笯笰笲笴笵笶笷笹笻笽笿",5,"筆筈筊筍筎筓筕筗筙筜筞筟筡筣",10,"筯筰筳筴筶筸筺筼筽筿箁箂箃箄箆",6,"箎箏"],["b980","箑箒箓箖箘箙箚箛箞箟箠箣箤箥箮箯箰箲箳箵箶箷箹",7,"篂篃範埂耿梗工攻功恭龚供躬公宫弓巩汞拱贡共钩勾沟苟狗垢构购够辜菇咕箍估沽孤姑鼓古蛊骨谷股故顾固雇刮瓜剐寡挂褂乖拐怪棺关官冠观管馆罐惯灌贯光广逛瑰规圭硅归龟闺轨鬼诡癸桂柜跪贵刽辊滚棍锅郭国果裹过哈"],["ba40","篅篈築篊篋篍篎篏篐篒篔",4,"篛篜篞篟篠篢篣篤篧篨篩篫篬篭篯篰篲",4,"篸篹篺篻篽篿",7,"簈簉簊簍簎簐",5,"簗簘簙"],["ba80","簚",4,"簠",5,"簨簩簫",12,"簹",5,"籂骸孩海氦亥害骇酣憨邯韩含涵寒函喊罕翰撼捍旱憾悍焊汗汉夯杭航壕嚎豪毫郝好耗号浩呵喝荷菏核禾和何合盒貉阂河涸赫褐鹤贺嘿黑痕很狠恨哼亨横衡恒轰哄烘虹鸿洪宏弘红喉侯猴吼厚候后呼乎忽瑚壶葫胡蝴狐糊湖"],["bb40","籃",9,"籎",36,"籵",5,"籾",9],["bb80","粈粊",6,"粓粔粖粙粚粛粠粡粣粦粧粨粩粫粬粭粯粰粴",4,"粺粻弧虎唬护互沪户花哗华猾滑画划化话槐徊怀淮坏欢环桓还缓换患唤痪豢焕涣宦幻荒慌黄磺蝗簧皇凰惶煌晃幌恍谎灰挥辉徽恢蛔回毁悔慧卉惠晦贿秽会烩汇讳诲绘荤昏婚魂浑混豁活伙火获或惑霍货祸击圾基机畸稽积箕"],["bc40","粿糀糂糃糄糆糉糋糎",6,"糘糚糛糝糞糡",6,"糩",5,"糰",7,"糹糺糼",13,"紋",5],["bc80","紑",14,"紡紣紤紥紦紨紩紪紬紭紮細",6,"肌饥迹激讥鸡姬绩缉吉极棘辑籍集及急疾汲即嫉级挤几脊己蓟技冀季伎祭剂悸济寄寂计记既忌际妓继纪嘉枷夹佳家加荚颊贾甲钾假稼价架驾嫁歼监坚尖笺间煎兼肩艰奸缄茧检柬碱硷拣捡简俭剪减荐槛鉴践贱见键箭件"],["bd40","紷",54,"絯",7],["bd80","絸",32,"健舰剑饯渐溅涧建僵姜将浆江疆蒋桨奖讲匠酱降蕉椒礁焦胶交郊浇骄娇嚼搅铰矫侥脚狡角饺缴绞剿教酵轿较叫窖揭接皆秸街阶截劫节桔杰捷睫竭洁结解姐戒藉芥界借介疥诫届巾筋斤金今津襟紧锦仅谨进靳晋禁近烬浸"],["be40","継",12,"綧",6,"綯",42],["be80","線",32,"尽劲荆兢茎睛晶鲸京惊精粳经井警景颈静境敬镜径痉靖竟竞净炯窘揪究纠玖韭久灸九酒厩救旧臼舅咎就疚鞠拘狙疽居驹菊局咀矩举沮聚拒据巨具距踞锯俱句惧炬剧捐鹃娟倦眷卷绢撅攫抉掘倔爵觉决诀绝均菌钧军君峻"],["bf40","緻",62],["bf80","縺縼",4,"繂",4,"繈",21,"俊竣浚郡骏喀咖卡咯开揩楷凯慨刊堪勘坎砍看康慷糠扛抗亢炕考拷烤靠坷苛柯棵磕颗科壳咳可渴克刻客课肯啃垦恳坑吭空恐孔控抠口扣寇枯哭窟苦酷库裤夸垮挎跨胯块筷侩快宽款匡筐狂框矿眶旷况亏盔岿窥葵奎魁傀"],["c040","繞",35,"纃",23,"纜纝纞"],["c080","纮纴纻纼绖绤绬绹缊缐缞缷缹缻",6,"罃罆",9,"罒罓馈愧溃坤昆捆困括扩廓阔垃拉喇蜡腊辣啦莱来赖蓝婪栏拦篮阑兰澜谰揽览懒缆烂滥琅榔狼廊郎朗浪捞劳牢老佬姥酪烙涝勒乐雷镭蕾磊累儡垒擂肋类泪棱楞冷厘梨犁黎篱狸离漓理李里鲤礼莉荔吏栗丽厉励砾历利傈例俐"],["c140","罖罙罛罜罝罞罠罣",4,"罫罬罭罯罰罳罵罶罷罸罺罻罼罽罿羀羂",7,"羋羍羏",4,"羕",4,"羛羜羠羢羣羥羦羨",6,"羱"],["c180","羳",4,"羺羻羾翀翂翃翄翆翇翈翉翋翍翏",4,"翖翗翙",5,"翢翣痢立粒沥隶力璃哩俩联莲连镰廉怜涟帘敛脸链恋炼练粮凉梁粱良两辆量晾亮谅撩聊僚疗燎寥辽潦了撂镣廖料列裂烈劣猎琳林磷霖临邻鳞淋凛赁吝拎玲菱零龄铃伶羚凌灵陵岭领另令溜琉榴硫馏留刘瘤流柳六龙聋咙笼窿"],["c240","翤翧翨翪翫翬翭翯翲翴",6,"翽翾翿耂耇耈耉耊耎耏耑耓耚耛耝耞耟耡耣耤耫",5,"耲耴耹耺耼耾聀聁聄聅聇聈聉聎聏聐聑聓聕聖聗"],["c280","聙聛",13,"聫",5,"聲",11,"隆垄拢陇楼娄搂篓漏陋芦卢颅庐炉掳卤虏鲁麓碌露路赂鹿潞禄录陆戮驴吕铝侣旅履屡缕虑氯律率滤绿峦挛孪滦卵乱掠略抡轮伦仑沦纶论萝螺罗逻锣箩骡裸落洛骆络妈麻玛码蚂马骂嘛吗埋买麦卖迈脉瞒馒蛮满蔓曼慢漫"],["c340","聾肁肂肅肈肊肍",5,"肔肕肗肙肞肣肦肧肨肬肰肳肵肶肸肹肻胅胇",4,"胏",6,"胘胟胠胢胣胦胮胵胷胹胻胾胿脀脁脃脄脅脇脈脋"],["c380","脌脕脗脙脛脜脝脟",12,"脭脮脰脳脴脵脷脹",4,"脿谩芒茫盲氓忙莽猫茅锚毛矛铆卯茂冒帽貌贸么玫枚梅酶霉煤没眉媒镁每美昧寐妹媚门闷们萌蒙檬盟锰猛梦孟眯醚靡糜迷谜弥米秘觅泌蜜密幂棉眠绵冕免勉娩缅面苗描瞄藐秒渺庙妙蔑灭民抿皿敏悯闽明螟鸣铭名命谬摸"],["c440","腀",5,"腇腉腍腎腏腒腖腗腘腛",4,"腡腢腣腤腦腨腪腫腬腯腲腳腵腶腷腸膁膃",4,"膉膋膌膍膎膐膒",5,"膙膚膞",4,"膤膥"],["c480","膧膩膫",7,"膴",5,"膼膽膾膿臄臅臇臈臉臋臍",6,"摹蘑模膜磨摩魔抹末莫墨默沫漠寞陌谋牟某拇牡亩姆母墓暮幕募慕木目睦牧穆拿哪呐钠那娜纳氖乃奶耐奈南男难囊挠脑恼闹淖呢馁内嫩能妮霓倪泥尼拟你匿腻逆溺蔫拈年碾撵捻念娘酿鸟尿捏聂孽啮镊镍涅您柠狞凝宁"],["c540","臔",14,"臤臥臦臨臩臫臮",4,"臵",5,"臽臿舃與",4,"舎舏舑舓舕",5,"舝舠舤舥舦舧舩舮舲舺舼舽舿"],["c580","艀艁艂艃艅艆艈艊艌艍艎艐",7,"艙艛艜艝艞艠",7,"艩拧泞牛扭钮纽脓浓农弄奴努怒女暖虐疟挪懦糯诺哦欧鸥殴藕呕偶沤啪趴爬帕怕琶拍排牌徘湃派攀潘盘磐盼畔判叛乓庞旁耪胖抛咆刨炮袍跑泡呸胚培裴赔陪配佩沛喷盆砰抨烹澎彭蓬棚硼篷膨朋鹏捧碰坯砒霹批披劈琵毗"],["c640","艪艫艬艭艱艵艶艷艸艻艼芀芁芃芅芆芇芉芌芐芓芔芕芖芚芛芞芠芢芣芧芲芵芶芺芻芼芿苀苂苃苅苆苉苐苖苙苚苝苢苧苨苩苪苬苭苮苰苲苳苵苶苸"],["c680","苺苼",4,"茊茋茍茐茒茓茖茘茙茝",9,"茩茪茮茰茲茷茻茽啤脾疲皮匹痞僻屁譬篇偏片骗飘漂瓢票撇瞥拼频贫品聘乒坪苹萍平凭瓶评屏坡泼颇婆破魄迫粕剖扑铺仆莆葡菩蒲埔朴圃普浦谱曝瀑期欺栖戚妻七凄漆柒沏其棋奇歧畦崎脐齐旗祈祁骑起岂乞企启契砌器气迄弃汽泣讫掐"],["c740","茾茿荁荂荄荅荈荊",4,"荓荕",4,"荝荢荰",6,"荹荺荾",6,"莇莈莊莋莌莍莏莐莑莔莕莖莗莙莚莝莟莡",6,"莬莭莮"],["c780","莯莵莻莾莿菂菃菄菆菈菉菋菍菎菐菑菒菓菕菗菙菚菛菞菢菣菤菦菧菨菫菬菭恰洽牵扦钎铅千迁签仟谦乾黔钱钳前潜遣浅谴堑嵌欠歉枪呛腔羌墙蔷强抢橇锹敲悄桥瞧乔侨巧鞘撬翘峭俏窍切茄且怯窃钦侵亲秦琴勤芹擒禽寝沁青轻氢倾卿清擎晴氰情顷请庆琼穷秋丘邱球求囚酋泅趋区蛆曲躯屈驱渠"],["c840","菮華菳",4,"菺菻菼菾菿萀萂萅萇萈萉萊萐萒",5,"萙萚萛萞",5,"萩",7,"萲",5,"萹萺萻萾",7,"葇葈葉"],["c880","葊",6,"葒",4,"葘葝葞葟葠葢葤",4,"葪葮葯葰葲葴葷葹葻葼取娶龋趣去圈颧权醛泉全痊拳犬券劝缺炔瘸却鹊榷确雀裙群然燃冉染瓤壤攘嚷让饶扰绕惹热壬仁人忍韧任认刃妊纫扔仍日戎茸蓉荣融熔溶容绒冗揉柔肉茹蠕儒孺如辱乳汝入褥软阮蕊瑞锐闰润若弱撒洒萨腮鳃塞赛三叁"],["c940","葽",4,"蒃蒄蒅蒆蒊蒍蒏",7,"蒘蒚蒛蒝蒞蒟蒠蒢",12,"蒰蒱蒳蒵蒶蒷蒻蒼蒾蓀蓂蓃蓅蓆蓇蓈蓋蓌蓎蓏蓒蓔蓕蓗"],["c980","蓘",4,"蓞蓡蓢蓤蓧",4,"蓭蓮蓯蓱",10,"蓽蓾蔀蔁蔂伞散桑嗓丧搔骚扫嫂瑟色涩森僧莎砂杀刹沙纱傻啥煞筛晒珊苫杉山删煽衫闪陕擅赡膳善汕扇缮墒伤商赏晌上尚裳梢捎稍烧芍勺韶少哨邵绍奢赊蛇舌舍赦摄射慑涉社设砷申呻伸身深娠绅神沈审婶甚肾慎渗声生甥牲升绳"],["ca40","蔃",8,"蔍蔎蔏蔐蔒蔔蔕蔖蔘蔙蔛蔜蔝蔞蔠蔢",8,"蔭",9,"蔾",4,"蕄蕅蕆蕇蕋",10],["ca80","蕗蕘蕚蕛蕜蕝蕟",4,"蕥蕦蕧蕩",8,"蕳蕵蕶蕷蕸蕼蕽蕿薀薁省盛剩胜圣师失狮施湿诗尸虱十石拾时什食蚀实识史矢使屎驶始式示士世柿事拭誓逝势是嗜噬适仕侍释饰氏市恃室视试收手首守寿授售受瘦兽蔬枢梳殊抒输叔舒淑疏书赎孰熟薯暑曙署蜀黍鼠属术述树束戍竖墅庶数漱"],["cb40","薂薃薆薈",6,"薐",10,"薝",6,"薥薦薧薩薫薬薭薱",5,"薸薺",6,"藂",6,"藊",4,"藑藒"],["cb80","藔藖",5,"藝",6,"藥藦藧藨藪",14,"恕刷耍摔衰甩帅栓拴霜双爽谁水睡税吮瞬顺舜说硕朔烁斯撕嘶思私司丝死肆寺嗣四伺似饲巳松耸怂颂送宋讼诵搜艘擞嗽苏酥俗素速粟僳塑溯宿诉肃酸蒜算虽隋随绥髓碎岁穗遂隧祟孙损笋蓑梭唆缩琐索锁所塌他它她塔"],["cc40","藹藺藼藽藾蘀",4,"蘆",10,"蘒蘓蘔蘕蘗",15,"蘨蘪",13,"蘹蘺蘻蘽蘾蘿虀"],["cc80","虁",11,"虒虓處",4,"虛虜虝號虠虡虣",7,"獭挞蹋踏胎苔抬台泰酞太态汰坍摊贪瘫滩坛檀痰潭谭谈坦毯袒碳探叹炭汤塘搪堂棠膛唐糖倘躺淌趟烫掏涛滔绦萄桃逃淘陶讨套特藤腾疼誊梯剔踢锑提题蹄啼体替嚏惕涕剃屉天添填田甜恬舔腆挑条迢眺跳贴铁帖厅听烃"],["cd40","虭虯虰虲",6,"蚃",6,"蚎",4,"蚔蚖",5,"蚞",4,"蚥蚦蚫蚭蚮蚲蚳蚷蚸蚹蚻",4,"蛁蛂蛃蛅蛈蛌蛍蛒蛓蛕蛖蛗蛚蛜"],["cd80","蛝蛠蛡蛢蛣蛥蛦蛧蛨蛪蛫蛬蛯蛵蛶蛷蛺蛻蛼蛽蛿蜁蜄蜅蜆蜋蜌蜎蜏蜐蜑蜔蜖汀廷停亭庭挺艇通桐酮瞳同铜彤童桶捅筒统痛偷投头透凸秃突图徒途涂屠土吐兔湍团推颓腿蜕褪退吞屯臀拖托脱鸵陀驮驼椭妥拓唾挖哇蛙洼娃瓦袜歪外豌弯湾玩顽丸烷完碗挽晚皖惋宛婉万腕汪王亡枉网往旺望忘妄威"],["ce40","蜙蜛蜝蜟蜠蜤蜦蜧蜨蜪蜫蜬蜭蜯蜰蜲蜳蜵蜶蜸蜹蜺蜼蜽蝀",6,"蝊蝋蝍蝏蝐蝑蝒蝔蝕蝖蝘蝚",5,"蝡蝢蝦",7,"蝯蝱蝲蝳蝵"],["ce80","蝷蝸蝹蝺蝿螀螁螄螆螇螉螊螌螎",4,"螔螕螖螘",6,"螠",4,"巍微危韦违桅围唯惟为潍维苇萎委伟伪尾纬未蔚味畏胃喂魏位渭谓尉慰卫瘟温蚊文闻纹吻稳紊问嗡翁瓮挝蜗涡窝我斡卧握沃巫呜钨乌污诬屋无芜梧吾吴毋武五捂午舞伍侮坞戊雾晤物勿务悟误昔熙析西硒矽晰嘻吸锡牺"],["cf40","螥螦螧螩螪螮螰螱螲螴螶螷螸螹螻螼螾螿蟁",4,"蟇蟈蟉蟌",4,"蟔",6,"蟜蟝蟞蟟蟡蟢蟣蟤蟦蟧蟨蟩蟫蟬蟭蟯",9],["cf80","蟺蟻蟼蟽蟿蠀蠁蠂蠄",5,"蠋",7,"蠔蠗蠘蠙蠚蠜",4,"蠣稀息希悉膝夕惜熄烯溪汐犀檄袭席习媳喜铣洗系隙戏细瞎虾匣霞辖暇峡侠狭下厦夏吓掀锨先仙鲜纤咸贤衔舷闲涎弦嫌显险现献县腺馅羡宪陷限线相厢镶香箱襄湘乡翔祥详想响享项巷橡像向象萧硝霄削哮嚣销消宵淆晓"],["d040","蠤",13,"蠳",5,"蠺蠻蠽蠾蠿衁衂衃衆",5,"衎",5,"衕衖衘衚",6,"衦衧衪衭衯衱衳衴衵衶衸衹衺"],["d080","衻衼袀袃袆袇袉袊袌袎袏袐袑袓袔袕袗",4,"袝",4,"袣袥",5,"小孝校肖啸笑效楔些歇蝎鞋协挟携邪斜胁谐写械卸蟹懈泄泻谢屑薪芯锌欣辛新忻心信衅星腥猩惺兴刑型形邢行醒幸杏性姓兄凶胸匈汹雄熊休修羞朽嗅锈秀袖绣墟戌需虚嘘须徐许蓄酗叙旭序畜恤絮婿绪续轩喧宣悬旋玄"],["d140","袬袮袯袰袲",4,"袸袹袺袻袽袾袿裀裃裄裇裈裊裋裌裍裏裐裑裓裖裗裚",4,"裠裡裦裧裩",6,"裲裵裶裷裺裻製裿褀褁褃",5],["d180","褉褋",4,"褑褔",4,"褜",4,"褢褣褤褦褧褨褩褬褭褮褯褱褲褳褵褷选癣眩绚靴薛学穴雪血勋熏循旬询寻驯巡殉汛训讯逊迅压押鸦鸭呀丫芽牙蚜崖衙涯雅哑亚讶焉咽阉烟淹盐严研蜒岩延言颜阎炎沿奄掩眼衍演艳堰燕厌砚雁唁彦焰宴谚验殃央鸯秧杨扬佯疡羊洋阳氧仰痒养样漾邀腰妖瑶"],["d240","褸",8,"襂襃襅",24,"襠",5,"襧",19,"襼"],["d280","襽襾覀覂覄覅覇",26,"摇尧遥窑谣姚咬舀药要耀椰噎耶爷野冶也页掖业叶曳腋夜液一壹医揖铱依伊衣颐夷遗移仪胰疑沂宜姨彝椅蚁倚已乙矣以艺抑易邑屹亿役臆逸肄疫亦裔意毅忆义益溢诣议谊译异翼翌绎茵荫因殷音阴姻吟银淫寅饮尹引隐"],["d340","覢",30,"觃觍觓觔觕觗觘觙觛觝觟觠觡觢觤觧觨觩觪觬觭觮觰觱觲觴",6],["d380","觻",4,"訁",5,"計",21,"印英樱婴鹰应缨莹萤营荧蝇迎赢盈影颖硬映哟拥佣臃痈庸雍踊蛹咏泳涌永恿勇用幽优悠忧尤由邮铀犹油游酉有友右佑釉诱又幼迂淤于盂榆虞愚舆余俞逾鱼愉渝渔隅予娱雨与屿禹宇语羽玉域芋郁吁遇喻峪御愈欲狱育誉"],["d440","訞",31,"訿",8,"詉",21],["d480","詟",25,"詺",6,"浴寓裕预豫驭鸳渊冤元垣袁原援辕园员圆猿源缘远苑愿怨院曰约越跃钥岳粤月悦阅耘云郧匀陨允运蕴酝晕韵孕匝砸杂栽哉灾宰载再在咱攒暂赞赃脏葬遭糟凿藻枣早澡蚤躁噪造皂灶燥责择则泽贼怎增憎曾赠扎喳渣札轧"],["d540","誁",7,"誋",7,"誔",46],["d580","諃",32,"铡闸眨栅榨咋乍炸诈摘斋宅窄债寨瞻毡詹粘沾盏斩辗崭展蘸栈占战站湛绽樟章彰漳张掌涨杖丈帐账仗胀瘴障招昭找沼赵照罩兆肇召遮折哲蛰辙者锗蔗这浙珍斟真甄砧臻贞针侦枕疹诊震振镇阵蒸挣睁征狰争怔整拯正政"],["d640","諤",34,"謈",27],["d680","謤謥謧",30,"帧症郑证芝枝支吱蜘知肢脂汁之织职直植殖执值侄址指止趾只旨纸志挚掷至致置帜峙制智秩稚质炙痔滞治窒中盅忠钟衷终种肿重仲众舟周州洲诌粥轴肘帚咒皱宙昼骤珠株蛛朱猪诸诛逐竹烛煮拄瞩嘱主著柱助蛀贮铸筑"],["d740","譆",31,"譧",4,"譭",25],["d780","讇",24,"讬讱讻诇诐诪谉谞住注祝驻抓爪拽专砖转撰赚篆桩庄装妆撞壮状椎锥追赘坠缀谆准捉拙卓桌琢茁酌啄着灼浊兹咨资姿滋淄孜紫仔籽滓子自渍字鬃棕踪宗综总纵邹走奏揍租足卒族祖诅阻组钻纂嘴醉最罪尊遵昨左佐柞做作坐座"],["d840","谸",8,"豂豃豄豅豈豊豋豍",7,"豖豗豘豙豛",5,"豣",6,"豬",6,"豴豵豶豷豻",6,"貃貄貆貇"],["d880","貈貋貍",6,"貕貖貗貙",20,"亍丌兀丐廿卅丕亘丞鬲孬噩丨禺丿匕乇夭爻卮氐囟胤馗毓睾鼗丶亟鼐乜乩亓芈孛啬嘏仄厍厝厣厥厮靥赝匚叵匦匮匾赜卦卣刂刈刎刭刳刿剀剌剞剡剜蒯剽劂劁劐劓冂罔亻仃仉仂仨仡仫仞伛仳伢佤仵伥伧伉伫佞佧攸佚佝"],["d940","貮",62],["d980","賭",32,"佟佗伲伽佶佴侑侉侃侏佾佻侪佼侬侔俦俨俪俅俚俣俜俑俟俸倩偌俳倬倏倮倭俾倜倌倥倨偾偃偕偈偎偬偻傥傧傩傺僖儆僭僬僦僮儇儋仝氽佘佥俎龠汆籴兮巽黉馘冁夔勹匍訇匐凫夙兕亠兖亳衮袤亵脔裒禀嬴蠃羸冫冱冽冼"],["da40","贎",14,"贠赑赒赗赟赥赨赩赪赬赮赯赱赲赸",8,"趂趃趆趇趈趉趌",4,"趒趓趕",9,"趠趡"],["da80","趢趤",12,"趲趶趷趹趻趽跀跁跂跅跇跈跉跊跍跐跒跓跔凇冖冢冥讠讦讧讪讴讵讷诂诃诋诏诎诒诓诔诖诘诙诜诟诠诤诨诩诮诰诳诶诹诼诿谀谂谄谇谌谏谑谒谔谕谖谙谛谘谝谟谠谡谥谧谪谫谮谯谲谳谵谶卩卺阝阢阡阱阪阽阼陂陉陔陟陧陬陲陴隈隍隗隰邗邛邝邙邬邡邴邳邶邺"],["db40","跕跘跙跜跠跡跢跥跦跧跩跭跮跰跱跲跴跶跼跾",6,"踆踇踈踋踍踎踐踑踒踓踕",7,"踠踡踤",4,"踫踭踰踲踳踴踶踷踸踻踼踾"],["db80","踿蹃蹅蹆蹌",4,"蹓",5,"蹚",11,"蹧蹨蹪蹫蹮蹱邸邰郏郅邾郐郄郇郓郦郢郜郗郛郫郯郾鄄鄢鄞鄣鄱鄯鄹酃酆刍奂劢劬劭劾哿勐勖勰叟燮矍廴凵凼鬯厶弁畚巯坌垩垡塾墼壅壑圩圬圪圳圹圮圯坜圻坂坩垅坫垆坼坻坨坭坶坳垭垤垌垲埏垧垴垓垠埕埘埚埙埒垸埴埯埸埤埝"],["dc40","蹳蹵蹷",4,"蹽蹾躀躂躃躄躆躈",6,"躑躒躓躕",6,"躝躟",11,"躭躮躰躱躳",6,"躻",7],["dc80","軃",10,"軏",21,"堋堍埽埭堀堞堙塄堠塥塬墁墉墚墀馨鼙懿艹艽艿芏芊芨芄芎芑芗芙芫芸芾芰苈苊苣芘芷芮苋苌苁芩芴芡芪芟苄苎芤苡茉苷苤茏茇苜苴苒苘茌苻苓茑茚茆茔茕苠苕茜荑荛荜茈莒茼茴茱莛荞茯荏荇荃荟荀茗荠茭茺茳荦荥"],["dd40","軥",62],["dd80","輤",32,"荨茛荩荬荪荭荮莰荸莳莴莠莪莓莜莅荼莶莩荽莸荻莘莞莨莺莼菁萁菥菘堇萘萋菝菽菖萜萸萑萆菔菟萏萃菸菹菪菅菀萦菰菡葜葑葚葙葳蒇蒈葺蒉葸萼葆葩葶蒌蒎萱葭蓁蓍蓐蓦蒽蓓蓊蒿蒺蓠蒡蒹蒴蒗蓥蓣蔌甍蔸蓰蔹蔟蔺"],["de40","轅",32,"轪辀辌辒辝辠辡辢辤辥辦辧辪辬辭辮辯農辳辴辵辷辸辺辻込辿迀迃迆"],["de80","迉",4,"迏迒迖迗迚迠迡迣迧迬迯迱迲迴迵迶迺迻迼迾迿逇逈逌逎逓逕逘蕖蔻蓿蓼蕙蕈蕨蕤蕞蕺瞢蕃蕲蕻薤薨薇薏蕹薮薜薅薹薷薰藓藁藜藿蘧蘅蘩蘖蘼廾弈夼奁耷奕奚奘匏尢尥尬尴扌扪抟抻拊拚拗拮挢拶挹捋捃掭揶捱捺掎掴捭掬掊捩掮掼揲揸揠揿揄揞揎摒揆掾摅摁搋搛搠搌搦搡摞撄摭撖"],["df40","這逜連逤逥逧",5,"逰",4,"逷逹逺逽逿遀遃遅遆遈",4,"過達違遖遙遚遜",5,"遤遦遧適遪遫遬遯",4,"遶",6,"遾邁"],["df80","還邅邆邇邉邊邌",4,"邒邔邖邘邚邜邞邟邠邤邥邧邨邩邫邭邲邷邼邽邿郀摺撷撸撙撺擀擐擗擤擢攉攥攮弋忒甙弑卟叱叽叩叨叻吒吖吆呋呒呓呔呖呃吡呗呙吣吲咂咔呷呱呤咚咛咄呶呦咝哐咭哂咴哒咧咦哓哔呲咣哕咻咿哌哙哚哜咩咪咤哝哏哞唛哧唠哽唔哳唢唣唏唑唧唪啧喏喵啉啭啁啕唿啐唼"],["e040","郂郃郆郈郉郋郌郍郒郔郕郖郘郙郚郞郟郠郣郤郥郩郪郬郮郰郱郲郳郵郶郷郹郺郻郼郿鄀鄁鄃鄅",19,"鄚鄛鄜"],["e080","鄝鄟鄠鄡鄤",10,"鄰鄲",6,"鄺",8,"酄唷啖啵啶啷唳唰啜喋嗒喃喱喹喈喁喟啾嗖喑啻嗟喽喾喔喙嗪嗷嗉嘟嗑嗫嗬嗔嗦嗝嗄嗯嗥嗲嗳嗌嗍嗨嗵嗤辔嘞嘈嘌嘁嘤嘣嗾嘀嘧嘭噘嘹噗嘬噍噢噙噜噌噔嚆噤噱噫噻噼嚅嚓嚯囔囗囝囡囵囫囹囿圄圊圉圜帏帙帔帑帱帻帼"],["e140","酅酇酈酑酓酔酕酖酘酙酛酜酟酠酦酧酨酫酭酳酺酻酼醀",4,"醆醈醊醎醏醓",6,"醜",5,"醤",5,"醫醬醰醱醲醳醶醷醸醹醻"],["e180","醼",10,"釈釋釐釒",9,"針",8,"帷幄幔幛幞幡岌屺岍岐岖岈岘岙岑岚岜岵岢岽岬岫岱岣峁岷峄峒峤峋峥崂崃崧崦崮崤崞崆崛嵘崾崴崽嵬嵛嵯嵝嵫嵋嵊嵩嵴嶂嶙嶝豳嶷巅彳彷徂徇徉後徕徙徜徨徭徵徼衢彡犭犰犴犷犸狃狁狎狍狒狨狯狩狲狴狷猁狳猃狺"],["e240","釦",62],["e280","鈥",32,"狻猗猓猡猊猞猝猕猢猹猥猬猸猱獐獍獗獠獬獯獾舛夥飧夤夂饣饧",5,"饴饷饽馀馄馇馊馍馐馑馓馔馕庀庑庋庖庥庠庹庵庾庳赓廒廑廛廨廪膺忄忉忖忏怃忮怄忡忤忾怅怆忪忭忸怙怵怦怛怏怍怩怫怊怿怡恸恹恻恺恂"],["e340","鉆",45,"鉵",16],["e380","銆",7,"銏",24,"恪恽悖悚悭悝悃悒悌悛惬悻悱惝惘惆惚悴愠愦愕愣惴愀愎愫慊慵憬憔憧憷懔懵忝隳闩闫闱闳闵闶闼闾阃阄阆阈阊阋阌阍阏阒阕阖阗阙阚丬爿戕氵汔汜汊沣沅沐沔沌汨汩汴汶沆沩泐泔沭泷泸泱泗沲泠泖泺泫泮沱泓泯泾"],["e440","銨",5,"銯",24,"鋉",31],["e480","鋩",32,"洹洧洌浃浈洇洄洙洎洫浍洮洵洚浏浒浔洳涑浯涞涠浞涓涔浜浠浼浣渚淇淅淞渎涿淠渑淦淝淙渖涫渌涮渫湮湎湫溲湟溆湓湔渲渥湄滟溱溘滠漭滢溥溧溽溻溷滗溴滏溏滂溟潢潆潇漤漕滹漯漶潋潴漪漉漩澉澍澌潸潲潼潺濑"],["e540","錊",51,"錿",10],["e580","鍊",31,"鍫濉澧澹澶濂濡濮濞濠濯瀚瀣瀛瀹瀵灏灞宀宄宕宓宥宸甯骞搴寤寮褰寰蹇謇辶迓迕迥迮迤迩迦迳迨逅逄逋逦逑逍逖逡逵逶逭逯遄遑遒遐遨遘遢遛暹遴遽邂邈邃邋彐彗彖彘尻咫屐屙孱屣屦羼弪弩弭艴弼鬻屮妁妃妍妩妪妣"],["e640","鍬",34,"鎐",27],["e680","鎬",29,"鏋鏌鏍妗姊妫妞妤姒妲妯姗妾娅娆姝娈姣姘姹娌娉娲娴娑娣娓婀婧婊婕娼婢婵胬媪媛婷婺媾嫫媲嫒嫔媸嫠嫣嫱嫖嫦嫘嫜嬉嬗嬖嬲嬷孀尕尜孚孥孳孑孓孢驵驷驸驺驿驽骀骁骅骈骊骐骒骓骖骘骛骜骝骟骠骢骣骥骧纟纡纣纥纨纩"],["e740","鏎",7,"鏗",54],["e780","鐎",32,"纭纰纾绀绁绂绉绋绌绐绔绗绛绠绡绨绫绮绯绱绲缍绶绺绻绾缁缂缃缇缈缋缌缏缑缒缗缙缜缛缟缡",6,"缪缫缬缭缯",4,"缵幺畿巛甾邕玎玑玮玢玟珏珂珑玷玳珀珉珈珥珙顼琊珩珧珞玺珲琏琪瑛琦琥琨琰琮琬"],["e840","鐯",14,"鐿",43,"鑬鑭鑮鑯"],["e880","鑰",20,"钑钖钘铇铏铓铔铚铦铻锜锠琛琚瑁瑜瑗瑕瑙瑷瑭瑾璜璎璀璁璇璋璞璨璩璐璧瓒璺韪韫韬杌杓杞杈杩枥枇杪杳枘枧杵枨枞枭枋杷杼柰栉柘栊柩枰栌柙枵柚枳柝栀柃枸柢栎柁柽栲栳桠桡桎桢桄桤梃栝桕桦桁桧桀栾桊桉栩梵梏桴桷梓桫棂楮棼椟椠棹"],["e940","锧锳锽镃镈镋镕镚镠镮镴镵長",7,"門",42],["e980","閫",32,"椤棰椋椁楗棣椐楱椹楠楂楝榄楫榀榘楸椴槌榇榈槎榉楦楣楹榛榧榻榫榭槔榱槁槊槟榕槠榍槿樯槭樗樘橥槲橄樾檠橐橛樵檎橹樽樨橘橼檑檐檩檗檫猷獒殁殂殇殄殒殓殍殚殛殡殪轫轭轱轲轳轵轶轸轷轹轺轼轾辁辂辄辇辋"],["ea40","闌",27,"闬闿阇阓阘阛阞阠阣",6,"阫阬阭阯阰阷阸阹阺阾陁陃陊陎陏陑陒陓陖陗"],["ea80","陘陙陚陜陝陞陠陣陥陦陫陭",4,"陳陸",12,"隇隉隊辍辎辏辘辚軎戋戗戛戟戢戡戥戤戬臧瓯瓴瓿甏甑甓攴旮旯旰昊昙杲昃昕昀炅曷昝昴昱昶昵耆晟晔晁晏晖晡晗晷暄暌暧暝暾曛曜曦曩贲贳贶贻贽赀赅赆赈赉赇赍赕赙觇觊觋觌觎觏觐觑牮犟牝牦牯牾牿犄犋犍犏犒挈挲掰"],["eb40","隌階隑隒隓隕隖隚際隝",9,"隨",7,"隱隲隴隵隷隸隺隻隿雂雃雈雊雋雐雑雓雔雖",9,"雡",6,"雫"],["eb80","雬雭雮雰雱雲雴雵雸雺電雼雽雿霂霃霅霊霋霌霐霑霒霔霕霗",4,"霝霟霠搿擘耄毪毳毽毵毹氅氇氆氍氕氘氙氚氡氩氤氪氲攵敕敫牍牒牖爰虢刖肟肜肓肼朊肽肱肫肭肴肷胧胨胩胪胛胂胄胙胍胗朐胝胫胱胴胭脍脎胲胼朕脒豚脶脞脬脘脲腈腌腓腴腙腚腱腠腩腼腽腭腧塍媵膈膂膑滕膣膪臌朦臊膻"],["ec40","霡",8,"霫霬霮霯霱霳",4,"霺霻霼霽霿",18,"靔靕靗靘靚靜靝靟靣靤靦靧靨靪",7],["ec80","靲靵靷",4,"靽",7,"鞆",4,"鞌鞎鞏鞐鞓鞕鞖鞗鞙",4,"臁膦欤欷欹歃歆歙飑飒飓飕飙飚殳彀毂觳斐齑斓於旆旄旃旌旎旒旖炀炜炖炝炻烀炷炫炱烨烊焐焓焖焯焱煳煜煨煅煲煊煸煺熘熳熵熨熠燠燔燧燹爝爨灬焘煦熹戾戽扃扈扉礻祀祆祉祛祜祓祚祢祗祠祯祧祺禅禊禚禧禳忑忐"],["ed40","鞞鞟鞡鞢鞤",6,"鞬鞮鞰鞱鞳鞵",46],["ed80","韤韥韨韮",4,"韴韷",23,"怼恝恚恧恁恙恣悫愆愍慝憩憝懋懑戆肀聿沓泶淼矶矸砀砉砗砘砑斫砭砜砝砹砺砻砟砼砥砬砣砩硎硭硖硗砦硐硇硌硪碛碓碚碇碜碡碣碲碹碥磔磙磉磬磲礅磴礓礤礞礴龛黹黻黼盱眄眍盹眇眈眚眢眙眭眦眵眸睐睑睇睃睚睨"],["ee40","頏",62],["ee80","顎",32,"睢睥睿瞍睽瞀瞌瞑瞟瞠瞰瞵瞽町畀畎畋畈畛畲畹疃罘罡罟詈罨罴罱罹羁罾盍盥蠲钅钆钇钋钊钌钍钏钐钔钗钕钚钛钜钣钤钫钪钭钬钯钰钲钴钶",4,"钼钽钿铄铈",6,"铐铑铒铕铖铗铙铘铛铞铟铠铢铤铥铧铨铪"],["ef40","顯",5,"颋颎颒颕颙颣風",37,"飏飐飔飖飗飛飜飝飠",4],["ef80","飥飦飩",30,"铩铫铮铯铳铴铵铷铹铼铽铿锃锂锆锇锉锊锍锎锏锒",4,"锘锛锝锞锟锢锪锫锩锬锱锲锴锶锷锸锼锾锿镂锵镄镅镆镉镌镎镏镒镓镔镖镗镘镙镛镞镟镝镡镢镤",8,"镯镱镲镳锺矧矬雉秕秭秣秫稆嵇稃稂稞稔"],["f040","餈",4,"餎餏餑",28,"餯",26],["f080","饊",9,"饖",12,"饤饦饳饸饹饻饾馂馃馉稹稷穑黏馥穰皈皎皓皙皤瓞瓠甬鸠鸢鸨",4,"鸲鸱鸶鸸鸷鸹鸺鸾鹁鹂鹄鹆鹇鹈鹉鹋鹌鹎鹑鹕鹗鹚鹛鹜鹞鹣鹦",6,"鹱鹭鹳疒疔疖疠疝疬疣疳疴疸痄疱疰痃痂痖痍痣痨痦痤痫痧瘃痱痼痿瘐瘀瘅瘌瘗瘊瘥瘘瘕瘙"],["f140","馌馎馚",10,"馦馧馩",47],["f180","駙",32,"瘛瘼瘢瘠癀瘭瘰瘿瘵癃瘾瘳癍癞癔癜癖癫癯翊竦穸穹窀窆窈窕窦窠窬窨窭窳衤衩衲衽衿袂袢裆袷袼裉裢裎裣裥裱褚裼裨裾裰褡褙褓褛褊褴褫褶襁襦襻疋胥皲皴矜耒耔耖耜耠耢耥耦耧耩耨耱耋耵聃聆聍聒聩聱覃顸颀颃"],["f240","駺",62],["f280","騹",32,"颉颌颍颏颔颚颛颞颟颡颢颥颦虍虔虬虮虿虺虼虻蚨蚍蚋蚬蚝蚧蚣蚪蚓蚩蚶蛄蚵蛎蚰蚺蚱蚯蛉蛏蚴蛩蛱蛲蛭蛳蛐蜓蛞蛴蛟蛘蛑蜃蜇蛸蜈蜊蜍蜉蜣蜻蜞蜥蜮蜚蜾蝈蜴蜱蜩蜷蜿螂蜢蝽蝾蝻蝠蝰蝌蝮螋蝓蝣蝼蝤蝙蝥螓螯螨蟒"],["f340","驚",17,"驲骃骉骍骎骔骕骙骦骩",6,"骲骳骴骵骹骻骽骾骿髃髄髆",4,"髍髎髏髐髒體髕髖髗髙髚髛髜"],["f380","髝髞髠髢髣髤髥髧髨髩髪髬髮髰",8,"髺髼",6,"鬄鬅鬆蟆螈螅螭螗螃螫蟥螬螵螳蟋蟓螽蟑蟀蟊蟛蟪蟠蟮蠖蠓蟾蠊蠛蠡蠹蠼缶罂罄罅舐竺竽笈笃笄笕笊笫笏筇笸笪笙笮笱笠笥笤笳笾笞筘筚筅筵筌筝筠筮筻筢筲筱箐箦箧箸箬箝箨箅箪箜箢箫箴篑篁篌篝篚篥篦篪簌篾篼簏簖簋"],["f440","鬇鬉",5,"鬐鬑鬒鬔",10,"鬠鬡鬢鬤",10,"鬰鬱鬳",7,"鬽鬾鬿魀魆魊魋魌魎魐魒魓魕",5],["f480","魛",32,"簟簪簦簸籁籀臾舁舂舄臬衄舡舢舣舭舯舨舫舸舻舳舴舾艄艉艋艏艚艟艨衾袅袈裘裟襞羝羟羧羯羰羲籼敉粑粝粜粞粢粲粼粽糁糇糌糍糈糅糗糨艮暨羿翎翕翥翡翦翩翮翳糸絷綦綮繇纛麸麴赳趄趔趑趱赧赭豇豉酊酐酎酏酤"],["f540","魼",62],["f580","鮻",32,"酢酡酰酩酯酽酾酲酴酹醌醅醐醍醑醢醣醪醭醮醯醵醴醺豕鹾趸跫踅蹙蹩趵趿趼趺跄跖跗跚跞跎跏跛跆跬跷跸跣跹跻跤踉跽踔踝踟踬踮踣踯踺蹀踹踵踽踱蹉蹁蹂蹑蹒蹊蹰蹶蹼蹯蹴躅躏躔躐躜躞豸貂貊貅貘貔斛觖觞觚觜"],["f640","鯜",62],["f680","鰛",32,"觥觫觯訾謦靓雩雳雯霆霁霈霏霎霪霭霰霾龀龃龅",5,"龌黾鼋鼍隹隼隽雎雒瞿雠銎銮鋈錾鍪鏊鎏鐾鑫鱿鲂鲅鲆鲇鲈稣鲋鲎鲐鲑鲒鲔鲕鲚鲛鲞",5,"鲥",4,"鲫鲭鲮鲰",7,"鲺鲻鲼鲽鳄鳅鳆鳇鳊鳋"],["f740","鰼",62],["f780","鱻鱽鱾鲀鲃鲄鲉鲊鲌鲏鲓鲖鲗鲘鲙鲝鲪鲬鲯鲹鲾",4,"鳈鳉鳑鳒鳚鳛鳠鳡鳌",4,"鳓鳔鳕鳗鳘鳙鳜鳝鳟鳢靼鞅鞑鞒鞔鞯鞫鞣鞲鞴骱骰骷鹘骶骺骼髁髀髅髂髋髌髑魅魃魇魉魈魍魑飨餍餮饕饔髟髡髦髯髫髻髭髹鬈鬏鬓鬟鬣麽麾縻麂麇麈麋麒鏖麝麟黛黜黝黠黟黢黩黧黥黪黯鼢鼬鼯鼹鼷鼽鼾齄"],["f840","鳣",62],["f880","鴢",32],["f940","鵃",62],["f980","鶂",32],["fa40","鶣",62],["fa80","鷢",32],["fb40","鸃",27,"鸤鸧鸮鸰鸴鸻鸼鹀鹍鹐鹒鹓鹔鹖鹙鹝鹟鹠鹡鹢鹥鹮鹯鹲鹴",9,"麀"],["fb80","麁麃麄麅麆麉麊麌",5,"麔",8,"麞麠",5,"麧麨麩麪"],["fc40","麫",8,"麵麶麷麹麺麼麿",4,"黅黆黇黈黊黋黌黐黒黓黕黖黗黙黚點黡黣黤黦黨黫黬黭黮黰",8,"黺黽黿",6],["fc80","鼆",4,"鼌鼏鼑鼒鼔鼕鼖鼘鼚",5,"鼡鼣",8,"鼭鼮鼰鼱"],["fd40","鼲",4,"鼸鼺鼼鼿",4,"齅",10,"齒",38],["fd80","齹",5,"龁龂龍",11,"龜龝龞龡",4,"郎凉秊裏隣"],["fe40","兀嗀﨎﨏﨑﨓﨔礼﨟蘒﨡﨣﨤﨧﨨﨩"]]'); /***/ }), /***/ "./node_modules/encoding/node_modules/iconv-lite/encodings/tables/cp949.json": /*!***********************************************************************************!*\ !*** ./node_modules/encoding/node_modules/iconv-lite/encodings/tables/cp949.json ***! \***********************************************************************************/ /***/ ((module) => { "use strict"; module.exports = /*#__PURE__*/JSON.parse('[["0","\\u0000",127],["8141","갂갃갅갆갋",4,"갘갞갟갡갢갣갥",6,"갮갲갳갴"],["8161","갵갶갷갺갻갽갾갿걁",9,"걌걎",5,"걕"],["8181","걖걗걙걚걛걝",18,"걲걳걵걶걹걻",4,"겂겇겈겍겎겏겑겒겓겕",6,"겞겢",5,"겫겭겮겱",6,"겺겾겿곀곂곃곅곆곇곉곊곋곍",7,"곖곘",7,"곢곣곥곦곩곫곭곮곲곴곷",4,"곾곿괁괂괃괅괇",4,"괎괐괒괓"],["8241","괔괕괖괗괙괚괛괝괞괟괡",7,"괪괫괮",5],["8261","괶괷괹괺괻괽",6,"굆굈굊",5,"굑굒굓굕굖굗"],["8281","굙",7,"굢굤",7,"굮굯굱굲굷굸굹굺굾궀궃",4,"궊궋궍궎궏궑",10,"궞",5,"궥",17,"궸",7,"귂귃귅귆귇귉",6,"귒귔",7,"귝귞귟귡귢귣귥",18],["8341","귺귻귽귾긂",5,"긊긌긎",5,"긕",7],["8361","긝",18,"긲긳긵긶긹긻긼"],["8381","긽긾긿깂깄깇깈깉깋깏깑깒깓깕깗",4,"깞깢깣깤깦깧깪깫깭깮깯깱",6,"깺깾",5,"꺆",5,"꺍",46,"꺿껁껂껃껅",6,"껎껒",5,"껚껛껝",8],["8441","껦껧껩껪껬껮",5,"껵껶껷껹껺껻껽",8],["8461","꼆꼉꼊꼋꼌꼎꼏꼑",18],["8481","꼤",7,"꼮꼯꼱꼳꼵",6,"꼾꽀꽄꽅꽆꽇꽊",5,"꽑",10,"꽞",5,"꽦",18,"꽺",5,"꾁꾂꾃꾅꾆꾇꾉",6,"꾒꾓꾔꾖",5,"꾝",26,"꾺꾻꾽꾾"],["8541","꾿꿁",5,"꿊꿌꿏",4,"꿕",6,"꿝",4],["8561","꿢",5,"꿪",5,"꿲꿳꿵꿶꿷꿹",6,"뀂뀃"],["8581","뀅",6,"뀍뀎뀏뀑뀒뀓뀕",6,"뀞",9,"뀩",26,"끆끇끉끋끍끏끐끑끒끖끘끚끛끜끞",29,"끾끿낁낂낃낅",6,"낎낐낒",5,"낛낝낞낣낤"],["8641","낥낦낧낪낰낲낶낷낹낺낻낽",6,"냆냊",5,"냒"],["8661","냓냕냖냗냙",6,"냡냢냣냤냦",10],["8681","냱",22,"넊넍넎넏넑넔넕넖넗넚넞",4,"넦넧넩넪넫넭",6,"넶넺",5,"녂녃녅녆녇녉",6,"녒녓녖녗녙녚녛녝녞녟녡",22,"녺녻녽녾녿놁놃",4,"놊놌놎놏놐놑놕놖놗놙놚놛놝"],["8741","놞",9,"놩",15],["8761","놹",18,"뇍뇎뇏뇑뇒뇓뇕"],["8781","뇖",5,"뇞뇠",7,"뇪뇫뇭뇮뇯뇱",7,"뇺뇼뇾",5,"눆눇눉눊눍",6,"눖눘눚",5,"눡",18,"눵",6,"눽",26,"뉙뉚뉛뉝뉞뉟뉡",6,"뉪",4],["8841","뉯",4,"뉶",5,"뉽",6,"늆늇늈늊",4],["8861","늏늒늓늕늖늗늛",4,"늢늤늧늨늩늫늭늮늯늱늲늳늵늶늷"],["8881","늸",15,"닊닋닍닎닏닑닓",4,"닚닜닞닟닠닡닣닧닩닪닰닱닲닶닼닽닾댂댃댅댆댇댉",6,"댒댖",5,"댝",54,"덗덙덚덝덠덡덢덣"],["8941","덦덨덪덬덭덯덲덳덵덶덷덹",6,"뎂뎆",5,"뎍"],["8961","뎎뎏뎑뎒뎓뎕",10,"뎢",5,"뎩뎪뎫뎭"],["8981","뎮",21,"돆돇돉돊돍돏돑돒돓돖돘돚돜돞돟돡돢돣돥돦돧돩",18,"돽",18,"됑",6,"됙됚됛됝됞됟됡",6,"됪됬",7,"됵",15],["8a41","둅",10,"둒둓둕둖둗둙",6,"둢둤둦"],["8a61","둧",4,"둭",18,"뒁뒂"],["8a81","뒃",4,"뒉",19,"뒞",5,"뒥뒦뒧뒩뒪뒫뒭",7,"뒶뒸뒺",5,"듁듂듃듅듆듇듉",6,"듑듒듓듔듖",5,"듞듟듡듢듥듧",4,"듮듰듲",5,"듹",26,"딖딗딙딚딝"],["8b41","딞",5,"딦딫",4,"딲딳딵딶딷딹",6,"땂땆"],["8b61","땇땈땉땊땎땏땑땒땓땕",6,"땞땢",8],["8b81","땫",52,"떢떣떥떦떧떩떬떭떮떯떲떶",4,"떾떿뗁뗂뗃뗅",6,"뗎뗒",5,"뗙",18,"뗭",18],["8c41","똀",15,"똒똓똕똖똗똙",4],["8c61","똞",6,"똦",5,"똭",6,"똵",5],["8c81","똻",12,"뙉",26,"뙥뙦뙧뙩",50,"뚞뚟뚡뚢뚣뚥",5,"뚭뚮뚯뚰뚲",16],["8d41","뛃",16,"뛕",8],["8d61","뛞",17,"뛱뛲뛳뛵뛶뛷뛹뛺"],["8d81","뛻",4,"뜂뜃뜄뜆",33,"뜪뜫뜭뜮뜱",6,"뜺뜼",7,"띅띆띇띉띊띋띍",6,"띖",9,"띡띢띣띥띦띧띩",6,"띲띴띶",5,"띾띿랁랂랃랅",6,"랎랓랔랕랚랛랝랞"],["8e41","랟랡",6,"랪랮",5,"랶랷랹",8],["8e61","럂",4,"럈럊",19],["8e81","럞",13,"럮럯럱럲럳럵",6,"럾렂",4,"렊렋렍렎렏렑",6,"렚렜렞",5,"렦렧렩렪렫렭",6,"렶렺",5,"롁롂롃롅",11,"롒롔",7,"롞롟롡롢롣롥",6,"롮롰롲",5,"롹롺롻롽",7],["8f41","뢅",7,"뢎",17],["8f61","뢠",7,"뢩",6,"뢱뢲뢳뢵뢶뢷뢹",4],["8f81","뢾뢿룂룄룆",5,"룍룎룏룑룒룓룕",7,"룞룠룢",5,"룪룫룭룮룯룱",6,"룺룼룾",5,"뤅",18,"뤙",6,"뤡",26,"뤾뤿륁륂륃륅",6,"륍륎륐륒",5],["9041","륚륛륝륞륟륡",6,"륪륬륮",5,"륶륷륹륺륻륽"],["9061","륾",5,"릆릈릋릌릏",15],["9081","릟",12,"릮릯릱릲릳릵",6,"릾맀맂",5,"맊맋맍맓",4,"맚맜맟맠맢맦맧맩맪맫맭",6,"맶맻",4,"먂",5,"먉",11,"먖",33,"먺먻먽먾먿멁멃멄멅멆"],["9141","멇멊멌멏멐멑멒멖멗멙멚멛멝",6,"멦멪",5],["9161","멲멳멵멶멷멹",9,"몆몈몉몊몋몍",5],["9181","몓",20,"몪몭몮몯몱몳",4,"몺몼몾",5,"뫅뫆뫇뫉",14,"뫚",33,"뫽뫾뫿묁묂묃묅",7,"묎묐묒",5,"묙묚묛묝묞묟묡",6],["9241","묨묪묬",7,"묷묹묺묿",4,"뭆뭈뭊뭋뭌뭎뭑뭒"],["9261","뭓뭕뭖뭗뭙",7,"뭢뭤",7,"뭭",4],["9281","뭲",21,"뮉뮊뮋뮍뮎뮏뮑",18,"뮥뮦뮧뮩뮪뮫뮭",6,"뮵뮶뮸",7,"믁믂믃믅믆믇믉",6,"믑믒믔",35,"믺믻믽믾밁"],["9341","밃",4,"밊밎밐밒밓밙밚밠밡밢밣밦밨밪밫밬밮밯밲밳밵"],["9361","밶밷밹",6,"뱂뱆뱇뱈뱊뱋뱎뱏뱑",8],["9381","뱚뱛뱜뱞",37,"벆벇벉벊벍벏",4,"벖벘벛",4,"벢벣벥벦벩",6,"벲벶",5,"벾벿볁볂볃볅",7,"볎볒볓볔볖볗볙볚볛볝",22,"볷볹볺볻볽"],["9441","볾",5,"봆봈봊",5,"봑봒봓봕",8],["9461","봞",5,"봥",6,"봭",12],["9481","봺",5,"뵁",6,"뵊뵋뵍뵎뵏뵑",6,"뵚",9,"뵥뵦뵧뵩",22,"붂붃붅붆붋",4,"붒붔붖붗붘붛붝",6,"붥",10,"붱",6,"붹",24],["9541","뷒뷓뷖뷗뷙뷚뷛뷝",11,"뷪",5,"뷱"],["9561","뷲뷳뷵뷶뷷뷹",6,"븁븂븄븆",5,"븎븏븑븒븓"],["9581","븕",6,"븞븠",35,"빆빇빉빊빋빍빏",4,"빖빘빜빝빞빟빢빣빥빦빧빩빫",4,"빲빶",4,"빾빿뺁뺂뺃뺅",6,"뺎뺒",5,"뺚",13,"뺩",14],["9641","뺸",23,"뻒뻓"],["9661","뻕뻖뻙",6,"뻡뻢뻦",5,"뻭",8],["9681","뻶",10,"뼂",5,"뼊",13,"뼚뼞",33,"뽂뽃뽅뽆뽇뽉",6,"뽒뽓뽔뽖",44],["9741","뾃",16,"뾕",8],["9761","뾞",17,"뾱",7],["9781","뾹",11,"뿆",5,"뿎뿏뿑뿒뿓뿕",6,"뿝뿞뿠뿢",89,"쀽쀾쀿"],["9841","쁀",16,"쁒",5,"쁙쁚쁛"],["9861","쁝쁞쁟쁡",6,"쁪",15],["9881","쁺",21,"삒삓삕삖삗삙",6,"삢삤삦",5,"삮삱삲삷",4,"삾샂샃샄샆샇샊샋샍샎샏샑",6,"샚샞",5,"샦샧샩샪샫샭",6,"샶샸샺",5,"섁섂섃섅섆섇섉",6,"섑섒섓섔섖",5,"섡섢섥섨섩섪섫섮"],["9941","섲섳섴섵섷섺섻섽섾섿셁",6,"셊셎",5,"셖셗"],["9961","셙셚셛셝",6,"셦셪",5,"셱셲셳셵셶셷셹셺셻"],["9981","셼",8,"솆",5,"솏솑솒솓솕솗",4,"솞솠솢솣솤솦솧솪솫솭솮솯솱",11,"솾",5,"쇅쇆쇇쇉쇊쇋쇍",6,"쇕쇖쇙",6,"쇡쇢쇣쇥쇦쇧쇩",6,"쇲쇴",7,"쇾쇿숁숂숃숅",6,"숎숐숒",5,"숚숛숝숞숡숢숣"],["9a41","숤숥숦숧숪숬숮숰숳숵",16],["9a61","쉆쉇쉉",6,"쉒쉓쉕쉖쉗쉙",6,"쉡쉢쉣쉤쉦"],["9a81","쉧",4,"쉮쉯쉱쉲쉳쉵",6,"쉾슀슂",5,"슊",5,"슑",6,"슙슚슜슞",5,"슦슧슩슪슫슮",5,"슶슸슺",33,"싞싟싡싢싥",5,"싮싰싲싳싴싵싷싺싽싾싿쌁",6,"쌊쌋쌎쌏"],["9b41","쌐쌑쌒쌖쌗쌙쌚쌛쌝",6,"쌦쌧쌪",8],["9b61","쌳",17,"썆",7],["9b81","썎",25,"썪썫썭썮썯썱썳",4,"썺썻썾",5,"쎅쎆쎇쎉쎊쎋쎍",50,"쏁",22,"쏚"],["9c41","쏛쏝쏞쏡쏣",4,"쏪쏫쏬쏮",5,"쏶쏷쏹",5],["9c61","쏿",8,"쐉",6,"쐑",9],["9c81","쐛",8,"쐥",6,"쐭쐮쐯쐱쐲쐳쐵",6,"쐾",9,"쑉",26,"쑦쑧쑩쑪쑫쑭",6,"쑶쑷쑸쑺",5,"쒁",18,"쒕",6,"쒝",12],["9d41","쒪",13,"쒹쒺쒻쒽",8],["9d61","쓆",25],["9d81","쓠",8,"쓪",5,"쓲쓳쓵쓶쓷쓹쓻쓼쓽쓾씂",9,"씍씎씏씑씒씓씕",6,"씝",10,"씪씫씭씮씯씱",6,"씺씼씾",5,"앆앇앋앏앐앑앒앖앚앛앜앟앢앣앥앦앧앩",6,"앲앶",5,"앾앿얁얂얃얅얆얈얉얊얋얎얐얒얓얔"],["9e41","얖얙얚얛얝얞얟얡",7,"얪",9,"얶"],["9e61","얷얺얿",4,"엋엍엏엒엓엕엖엗엙",6,"엢엤엦엧"],["9e81","엨엩엪엫엯엱엲엳엵엸엹엺엻옂옃옄옉옊옋옍옎옏옑",6,"옚옝",6,"옦옧옩옪옫옯옱옲옶옸옺옼옽옾옿왂왃왅왆왇왉",6,"왒왖",5,"왞왟왡",10,"왭왮왰왲",5,"왺왻왽왾왿욁",6,"욊욌욎",5,"욖욗욙욚욛욝",6,"욦"],["9f41","욨욪",5,"욲욳욵욶욷욻",4,"웂웄웆",5,"웎"],["9f61","웏웑웒웓웕",6,"웞웟웢",5,"웪웫웭웮웯웱웲"],["9f81","웳",4,"웺웻웼웾",5,"윆윇윉윊윋윍",6,"윖윘윚",5,"윢윣윥윦윧윩",6,"윲윴윶윸윹윺윻윾윿읁읂읃읅",4,"읋읎읐읙읚읛읝읞읟읡",6,"읩읪읬",7,"읶읷읹읺읻읿잀잁잂잆잋잌잍잏잒잓잕잙잛",4,"잢잧",4,"잮잯잱잲잳잵잶잷"],["a041","잸잹잺잻잾쟂",5,"쟊쟋쟍쟏쟑",6,"쟙쟚쟛쟜"],["a061","쟞",5,"쟥쟦쟧쟩쟪쟫쟭",13],["a081","쟻",4,"젂젃젅젆젇젉젋",4,"젒젔젗",4,"젞젟젡젢젣젥",6,"젮젰젲",5,"젹젺젻젽젾젿졁",6,"졊졋졎",5,"졕",26,"졲졳졵졶졷졹졻",4,"좂좄좈좉좊좎",5,"좕",7,"좞좠좢좣좤"],["a141","좥좦좧좩",18,"좾좿죀죁"],["a161","죂죃죅죆죇죉죊죋죍",6,"죖죘죚",5,"죢죣죥"],["a181","죦",14,"죶",5,"죾죿줁줂줃줇",4,"줎 、。·‥…¨〃­―∥\∼‘’“”〔〕〈",9,"±×÷≠≤≥∞∴°′″℃Å¢£¥♂♀∠⊥⌒∂∇≡≒§※☆★○●◎◇◆□■△▲▽▼→←↑↓↔〓≪≫√∽∝∵∫∬∈∋⊆⊇⊂⊃∪∩∧∨¬"],["a241","줐줒",5,"줙",18],["a261","줭",6,"줵",18],["a281","쥈",7,"쥒쥓쥕쥖쥗쥙",6,"쥢쥤",7,"쥭쥮쥯⇒⇔∀∃´~ˇ˘˝˚˙¸˛¡¿ː∮∑∏¤℉‰◁◀▷▶♤♠♡♥♧♣⊙◈▣◐◑▒▤▥▨▧▦▩♨☏☎☜☞¶†‡↕↗↙↖↘♭♩♪♬㉿㈜№㏇™㏂㏘℡€®"],["a341","쥱쥲쥳쥵",6,"쥽",10,"즊즋즍즎즏"],["a361","즑",6,"즚즜즞",16],["a381","즯",16,"짂짃짅짆짉짋",4,"짒짔짗짘짛!",58,"₩]",32," ̄"],["a441","짞짟짡짣짥짦짨짩짪짫짮짲",5,"짺짻짽짾짿쨁쨂쨃쨄"],["a461","쨅쨆쨇쨊쨎",5,"쨕쨖쨗쨙",12],["a481","쨦쨧쨨쨪",28,"ㄱ",93],["a541","쩇",4,"쩎쩏쩑쩒쩓쩕",6,"쩞쩢",5,"쩩쩪"],["a561","쩫",17,"쩾",5,"쪅쪆"],["a581","쪇",16,"쪙",14,"ⅰ",9],["a5b0","Ⅰ",9],["a5c1","Α",16,"Σ",6],["a5e1","α",16,"σ",6],["a641","쪨",19,"쪾쪿쫁쫂쫃쫅"],["a661","쫆",5,"쫎쫐쫒쫔쫕쫖쫗쫚",5,"쫡",6],["a681","쫨쫩쫪쫫쫭",6,"쫵",18,"쬉쬊─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂┒┑┚┙┖┕┎┍┞┟┡┢┦┧┩┪┭┮┱┲┵┶┹┺┽┾╀╁╃",7],["a741","쬋",4,"쬑쬒쬓쬕쬖쬗쬙",6,"쬢",7],["a761","쬪",22,"쭂쭃쭄"],["a781","쭅쭆쭇쭊쭋쭍쭎쭏쭑",6,"쭚쭛쭜쭞",5,"쭥",7,"㎕㎖㎗ℓ㎘㏄㎣㎤㎥㎦㎙",9,"㏊㎍㎎㎏㏏㎈㎉㏈㎧㎨㎰",9,"㎀",4,"㎺",5,"㎐",4,"Ω㏀㏁㎊㎋㎌㏖㏅㎭㎮㎯㏛㎩㎪㎫㎬㏝㏐㏓㏃㏉㏜㏆"],["a841","쭭",10,"쭺",14],["a861","쮉",18,"쮝",6],["a881","쮤",19,"쮹",11,"ÆÐªĦ"],["a8a6","IJ"],["a8a8","ĿŁØŒºÞŦŊ"],["a8b1","㉠",27,"ⓐ",25,"①",14,"½⅓⅔¼¾⅛⅜⅝⅞"],["a941","쯅",14,"쯕",10],["a961","쯠쯡쯢쯣쯥쯦쯨쯪",18],["a981","쯽",14,"찎찏찑찒찓찕",6,"찞찟찠찣찤æđðħıijĸŀłøœßþŧŋʼn㈀",27,"⒜",25,"⑴",14,"¹²³⁴ⁿ₁₂₃₄"],["aa41","찥찦찪찫찭찯찱",6,"찺찿",4,"챆챇챉챊챋챍챎"],["aa61","챏",4,"챖챚",5,"챡챢챣챥챧챩",6,"챱챲"],["aa81","챳챴챶",29,"ぁ",82],["ab41","첔첕첖첗첚첛첝첞첟첡",6,"첪첮",5,"첶첷첹"],["ab61","첺첻첽",6,"쳆쳈쳊",5,"쳑쳒쳓쳕",5],["ab81","쳛",8,"쳥",6,"쳭쳮쳯쳱",12,"ァ",85],["ac41","쳾쳿촀촂",5,"촊촋촍촎촏촑",6,"촚촜촞촟촠"],["ac61","촡촢촣촥촦촧촩촪촫촭",11,"촺",4],["ac81","촿",28,"쵝쵞쵟А",5,"ЁЖ",25],["acd1","а",5,"ёж",25],["ad41","쵡쵢쵣쵥",6,"쵮쵰쵲",5,"쵹",7],["ad61","춁",6,"춉",10,"춖춗춙춚춛춝춞춟"],["ad81","춠춡춢춣춦춨춪",5,"춱",18,"췅"],["ae41","췆",5,"췍췎췏췑",16],["ae61","췢",5,"췩췪췫췭췮췯췱",6,"췺췼췾",4],["ae81","츃츅츆츇츉츊츋츍",6,"츕츖츗츘츚",5,"츢츣츥츦츧츩츪츫"],["af41","츬츭츮츯츲츴츶",19],["af61","칊",13,"칚칛칝칞칢",5,"칪칬"],["af81","칮",5,"칶칷칹칺칻칽",6,"캆캈캊",5,"캒캓캕캖캗캙"],["b041","캚",5,"캢캦",5,"캮",12],["b061","캻",5,"컂",19],["b081","컖",13,"컦컧컩컪컭",6,"컶컺",5,"가각간갇갈갉갊감",7,"같",4,"갠갤갬갭갯갰갱갸갹갼걀걋걍걔걘걜거걱건걷걸걺검겁것겄겅겆겉겊겋게겐겔겜겝겟겠겡겨격겪견겯결겸겹겻겼경곁계곈곌곕곗고곡곤곧골곪곬곯곰곱곳공곶과곽관괄괆"],["b141","켂켃켅켆켇켉",6,"켒켔켖",5,"켝켞켟켡켢켣"],["b161","켥",6,"켮켲",5,"켹",11],["b181","콅",14,"콖콗콙콚콛콝",6,"콦콨콪콫콬괌괍괏광괘괜괠괩괬괭괴괵괸괼굄굅굇굉교굔굘굡굣구국군굳굴굵굶굻굼굽굿궁궂궈궉권궐궜궝궤궷귀귁귄귈귐귑귓규균귤그극근귿글긁금급긋긍긔기긱긴긷길긺김깁깃깅깆깊까깍깎깐깔깖깜깝깟깠깡깥깨깩깬깰깸"],["b241","콭콮콯콲콳콵콶콷콹",6,"쾁쾂쾃쾄쾆",5,"쾍"],["b261","쾎",18,"쾢",5,"쾩"],["b281","쾪",5,"쾱",18,"쿅",6,"깹깻깼깽꺄꺅꺌꺼꺽꺾껀껄껌껍껏껐껑께껙껜껨껫껭껴껸껼꼇꼈꼍꼐꼬꼭꼰꼲꼴꼼꼽꼿꽁꽂꽃꽈꽉꽐꽜꽝꽤꽥꽹꾀꾄꾈꾐꾑꾕꾜꾸꾹꾼꿀꿇꿈꿉꿋꿍꿎꿔꿜꿨꿩꿰꿱꿴꿸뀀뀁뀄뀌뀐뀔뀜뀝뀨끄끅끈끊끌끎끓끔끕끗끙"],["b341","쿌",19,"쿢쿣쿥쿦쿧쿩"],["b361","쿪",5,"쿲쿴쿶",5,"쿽쿾쿿퀁퀂퀃퀅",5],["b381","퀋",5,"퀒",5,"퀙",19,"끝끼끽낀낄낌낍낏낑나낙낚난낟날낡낢남납낫",4,"낱낳내낵낸낼냄냅냇냈냉냐냑냔냘냠냥너넉넋넌널넒넓넘넙넛넜넝넣네넥넨넬넴넵넷넸넹녀녁년녈념녑녔녕녘녜녠노녹논놀놂놈놉놋농높놓놔놘놜놨뇌뇐뇔뇜뇝"],["b441","퀮",5,"퀶퀷퀹퀺퀻퀽",6,"큆큈큊",5],["b461","큑큒큓큕큖큗큙",6,"큡",10,"큮큯"],["b481","큱큲큳큵",6,"큾큿킀킂",18,"뇟뇨뇩뇬뇰뇹뇻뇽누눅눈눋눌눔눕눗눙눠눴눼뉘뉜뉠뉨뉩뉴뉵뉼늄늅늉느늑는늘늙늚늠늡늣능늦늪늬늰늴니닉닌닐닒님닙닛닝닢다닥닦단닫",4,"닳담답닷",4,"닿대댁댄댈댐댑댓댔댕댜더덕덖던덛덜덞덟덤덥"],["b541","킕",14,"킦킧킩킪킫킭",5],["b561","킳킶킸킺",5,"탂탃탅탆탇탊",5,"탒탖",4],["b581","탛탞탟탡탢탣탥",6,"탮탲",5,"탹",11,"덧덩덫덮데덱덴델뎀뎁뎃뎄뎅뎌뎐뎔뎠뎡뎨뎬도독돈돋돌돎돐돔돕돗동돛돝돠돤돨돼됐되된될됨됩됫됴두둑둔둘둠둡둣둥둬뒀뒈뒝뒤뒨뒬뒵뒷뒹듀듄듈듐듕드득든듣들듦듬듭듯등듸디딕딘딛딜딤딥딧딨딩딪따딱딴딸"],["b641","턅",7,"턎",17],["b661","턠",15,"턲턳턵턶턷턹턻턼턽턾"],["b681","턿텂텆",5,"텎텏텑텒텓텕",6,"텞텠텢",5,"텩텪텫텭땀땁땃땄땅땋때땍땐땔땜땝땟땠땡떠떡떤떨떪떫떰떱떳떴떵떻떼떽뗀뗄뗌뗍뗏뗐뗑뗘뗬또똑똔똘똥똬똴뙈뙤뙨뚜뚝뚠뚤뚫뚬뚱뛔뛰뛴뛸뜀뜁뜅뜨뜩뜬뜯뜰뜸뜹뜻띄띈띌띔띕띠띤띨띰띱띳띵라락란랄람랍랏랐랑랒랖랗"],["b741","텮",13,"텽",6,"톅톆톇톉톊"],["b761","톋",20,"톢톣톥톦톧"],["b781","톩",6,"톲톴톶톷톸톹톻톽톾톿퇁",14,"래랙랜랠램랩랫랬랭랴략랸럇량러럭런럴럼럽럿렀렁렇레렉렌렐렘렙렛렝려력련렬렴렵렷렸령례롄롑롓로록론롤롬롭롯롱롸롼뢍뢨뢰뢴뢸룀룁룃룅료룐룔룝룟룡루룩룬룰룸룹룻룽뤄뤘뤠뤼뤽륀륄륌륏륑류륙륜률륨륩"],["b841","퇐",7,"퇙",17],["b861","퇫",8,"퇵퇶퇷퇹",13],["b881","툈툊",5,"툑",24,"륫륭르륵른를름릅릇릉릊릍릎리릭린릴림립릿링마막만많",4,"맘맙맛망맞맡맣매맥맨맬맴맵맷맸맹맺먀먁먈먕머먹먼멀멂멈멉멋멍멎멓메멕멘멜멤멥멧멨멩며멱면멸몃몄명몇몌모목몫몬몰몲몸몹못몽뫄뫈뫘뫙뫼"],["b941","툪툫툮툯툱툲툳툵",6,"툾퉀퉂",5,"퉉퉊퉋퉌"],["b961","퉍",14,"퉝",6,"퉥퉦퉧퉨"],["b981","퉩",22,"튂튃튅튆튇튉튊튋튌묀묄묍묏묑묘묜묠묩묫무묵묶문묻물묽묾뭄뭅뭇뭉뭍뭏뭐뭔뭘뭡뭣뭬뮈뮌뮐뮤뮨뮬뮴뮷므믄믈믐믓미믹민믿밀밂밈밉밋밌밍및밑바",4,"받",4,"밤밥밧방밭배백밴밸뱀뱁뱃뱄뱅뱉뱌뱍뱐뱝버벅번벋벌벎범법벗"],["ba41","튍튎튏튒튓튔튖",5,"튝튞튟튡튢튣튥",6,"튭"],["ba61","튮튯튰튲",5,"튺튻튽튾틁틃",4,"틊틌",5],["ba81","틒틓틕틖틗틙틚틛틝",6,"틦",9,"틲틳틵틶틷틹틺벙벚베벡벤벧벨벰벱벳벴벵벼벽변별볍볏볐병볕볘볜보복볶본볼봄봅봇봉봐봔봤봬뵀뵈뵉뵌뵐뵘뵙뵤뵨부북분붇불붉붊붐붑붓붕붙붚붜붤붰붸뷔뷕뷘뷜뷩뷰뷴뷸븀븃븅브븍븐블븜븝븟비빅빈빌빎빔빕빗빙빚빛빠빡빤"],["bb41","틻",4,"팂팄팆",5,"팏팑팒팓팕팗",4,"팞팢팣"],["bb61","팤팦팧팪팫팭팮팯팱",6,"팺팾",5,"퍆퍇퍈퍉"],["bb81","퍊",31,"빨빪빰빱빳빴빵빻빼빽뺀뺄뺌뺍뺏뺐뺑뺘뺙뺨뻐뻑뻔뻗뻘뻠뻣뻤뻥뻬뼁뼈뼉뼘뼙뼛뼜뼝뽀뽁뽄뽈뽐뽑뽕뾔뾰뿅뿌뿍뿐뿔뿜뿟뿡쀼쁑쁘쁜쁠쁨쁩삐삑삔삘삠삡삣삥사삭삯산삳살삵삶삼삽삿샀상샅새색샌샐샘샙샛샜생샤"],["bc41","퍪",17,"퍾퍿펁펂펃펅펆펇"],["bc61","펈펉펊펋펎펒",5,"펚펛펝펞펟펡",6,"펪펬펮"],["bc81","펯",4,"펵펶펷펹펺펻펽",6,"폆폇폊",5,"폑",5,"샥샨샬샴샵샷샹섀섄섈섐섕서",4,"섣설섦섧섬섭섯섰성섶세섹센셀셈셉셋셌셍셔셕션셜셤셥셧셨셩셰셴셸솅소속솎손솔솖솜솝솟송솥솨솩솬솰솽쇄쇈쇌쇔쇗쇘쇠쇤쇨쇰쇱쇳쇼쇽숀숄숌숍숏숑수숙순숟술숨숩숫숭"],["bd41","폗폙",7,"폢폤",7,"폮폯폱폲폳폵폶폷"],["bd61","폸폹폺폻폾퐀퐂",5,"퐉",13],["bd81","퐗",5,"퐞",25,"숯숱숲숴쉈쉐쉑쉔쉘쉠쉥쉬쉭쉰쉴쉼쉽쉿슁슈슉슐슘슛슝스슥슨슬슭슴습슷승시식신싣실싫심십싯싱싶싸싹싻싼쌀쌈쌉쌌쌍쌓쌔쌕쌘쌜쌤쌥쌨쌩썅써썩썬썰썲썸썹썼썽쎄쎈쎌쏀쏘쏙쏜쏟쏠쏢쏨쏩쏭쏴쏵쏸쐈쐐쐤쐬쐰"],["be41","퐸",7,"푁푂푃푅",14],["be61","푔",7,"푝푞푟푡푢푣푥",7,"푮푰푱푲"],["be81","푳",4,"푺푻푽푾풁풃",4,"풊풌풎",5,"풕",8,"쐴쐼쐽쑈쑤쑥쑨쑬쑴쑵쑹쒀쒔쒜쒸쒼쓩쓰쓱쓴쓸쓺쓿씀씁씌씐씔씜씨씩씬씰씸씹씻씽아악안앉않알앍앎앓암압앗았앙앝앞애액앤앨앰앱앳앴앵야약얀얄얇얌얍얏양얕얗얘얜얠얩어억언얹얻얼얽얾엄",6,"엌엎"],["bf41","풞",10,"풪",14],["bf61","풹",18,"퓍퓎퓏퓑퓒퓓퓕"],["bf81","퓖",5,"퓝퓞퓠",7,"퓩퓪퓫퓭퓮퓯퓱",6,"퓹퓺퓼에엑엔엘엠엡엣엥여역엮연열엶엷염",5,"옅옆옇예옌옐옘옙옛옜오옥온올옭옮옰옳옴옵옷옹옻와왁완왈왐왑왓왔왕왜왝왠왬왯왱외왹왼욀욈욉욋욍요욕욘욜욤욥욧용우욱운울욹욺움웁웃웅워웍원월웜웝웠웡웨"],["c041","퓾",5,"픅픆픇픉픊픋픍",6,"픖픘",5],["c061","픞",25],["c081","픸픹픺픻픾픿핁핂핃핅",6,"핎핐핒",5,"핚핛핝핞핟핡핢핣웩웬웰웸웹웽위윅윈윌윔윕윗윙유육윤율윰윱윳융윷으윽은을읊음읍읏응",7,"읜읠읨읫이익인일읽읾잃임입잇있잉잊잎자작잔잖잗잘잚잠잡잣잤장잦재잭잰잴잼잽잿쟀쟁쟈쟉쟌쟎쟐쟘쟝쟤쟨쟬저적전절젊"],["c141","핤핦핧핪핬핮",5,"핶핷핹핺핻핽",6,"햆햊햋"],["c161","햌햍햎햏햑",19,"햦햧"],["c181","햨",31,"점접젓정젖제젝젠젤젬젭젯젱져젼졀졈졉졌졍졔조족존졸졺좀좁좃종좆좇좋좌좍좔좝좟좡좨좼좽죄죈죌죔죕죗죙죠죡죤죵주죽준줄줅줆줌줍줏중줘줬줴쥐쥑쥔쥘쥠쥡쥣쥬쥰쥴쥼즈즉즌즐즘즙즛증지직진짇질짊짐집짓"],["c241","헊헋헍헎헏헑헓",4,"헚헜헞",5,"헦헧헩헪헫헭헮"],["c261","헯",4,"헶헸헺",5,"혂혃혅혆혇혉",6,"혒"],["c281","혖",5,"혝혞혟혡혢혣혥",7,"혮",9,"혺혻징짖짙짚짜짝짠짢짤짧짬짭짯짰짱째짹짼쨀쨈쨉쨋쨌쨍쨔쨘쨩쩌쩍쩐쩔쩜쩝쩟쩠쩡쩨쩽쪄쪘쪼쪽쫀쫄쫌쫍쫏쫑쫓쫘쫙쫠쫬쫴쬈쬐쬔쬘쬠쬡쭁쭈쭉쭌쭐쭘쭙쭝쭤쭸쭹쮜쮸쯔쯤쯧쯩찌찍찐찔찜찝찡찢찧차착찬찮찰참찹찻"],["c341","혽혾혿홁홂홃홄홆홇홊홌홎홏홐홒홓홖홗홙홚홛홝",4],["c361","홢",4,"홨홪",5,"홲홳홵",11],["c381","횁횂횄횆",5,"횎횏횑횒횓횕",7,"횞횠횢",5,"횩횪찼창찾채책챈챌챔챕챗챘챙챠챤챦챨챰챵처척천철첨첩첫첬청체첵첸첼쳄쳅쳇쳉쳐쳔쳤쳬쳰촁초촉촌촐촘촙촛총촤촨촬촹최쵠쵤쵬쵭쵯쵱쵸춈추축춘출춤춥춧충춰췄췌췐취췬췰췸췹췻췽츄츈츌츔츙츠측츤츨츰츱츳층"],["c441","횫횭횮횯횱",7,"횺횼",7,"훆훇훉훊훋"],["c461","훍훎훏훐훒훓훕훖훘훚",5,"훡훢훣훥훦훧훩",4],["c481","훮훯훱훲훳훴훶",5,"훾훿휁휂휃휅",11,"휒휓휔치칙친칟칠칡침칩칫칭카칵칸칼캄캅캇캉캐캑캔캘캠캡캣캤캥캬캭컁커컥컨컫컬컴컵컷컸컹케켁켄켈켐켑켓켕켜켠켤켬켭켯켰켱켸코콕콘콜콤콥콧콩콰콱콴콸쾀쾅쾌쾡쾨쾰쿄쿠쿡쿤쿨쿰쿱쿳쿵쿼퀀퀄퀑퀘퀭퀴퀵퀸퀼"],["c541","휕휖휗휚휛휝휞휟휡",6,"휪휬휮",5,"휶휷휹"],["c561","휺휻휽",6,"흅흆흈흊",5,"흒흓흕흚",4],["c581","흟흢흤흦흧흨흪흫흭흮흯흱흲흳흵",6,"흾흿힀힂",5,"힊힋큄큅큇큉큐큔큘큠크큭큰클큼큽킁키킥킨킬킴킵킷킹타탁탄탈탉탐탑탓탔탕태택탠탤탬탭탯탰탱탸턍터턱턴털턺텀텁텃텄텅테텍텐텔템텝텟텡텨텬텼톄톈토톡톤톨톰톱톳통톺톼퇀퇘퇴퇸툇툉툐투툭툰툴툼툽툿퉁퉈퉜"],["c641","힍힎힏힑",6,"힚힜힞",5],["c6a1","퉤튀튁튄튈튐튑튕튜튠튤튬튱트특튼튿틀틂틈틉틋틔틘틜틤틥티틱틴틸팀팁팃팅파팍팎판팔팖팜팝팟팠팡팥패팩팬팰팸팹팻팼팽퍄퍅퍼퍽펀펄펌펍펏펐펑페펙펜펠펨펩펫펭펴편펼폄폅폈평폐폘폡폣포폭폰폴폼폽폿퐁"],["c7a1","퐈퐝푀푄표푠푤푭푯푸푹푼푿풀풂품풉풋풍풔풩퓌퓐퓔퓜퓟퓨퓬퓰퓸퓻퓽프픈플픔픕픗피픽핀필핌핍핏핑하학한할핥함합핫항해핵핸핼햄햅햇했행햐향허헉헌헐헒험헙헛헝헤헥헨헬헴헵헷헹혀혁현혈혐협혓혔형혜혠"],["c8a1","혤혭호혹혼홀홅홈홉홋홍홑화확환활홧황홰홱홴횃횅회획횐횔횝횟횡효횬횰횹횻후훅훈훌훑훔훗훙훠훤훨훰훵훼훽휀휄휑휘휙휜휠휨휩휫휭휴휵휸휼흄흇흉흐흑흔흖흗흘흙흠흡흣흥흩희흰흴흼흽힁히힉힌힐힘힙힛힝"],["caa1","伽佳假價加可呵哥嘉嫁家暇架枷柯歌珂痂稼苛茄街袈訶賈跏軻迦駕刻却各恪慤殼珏脚覺角閣侃刊墾奸姦干幹懇揀杆柬桿澗癎看磵稈竿簡肝艮艱諫間乫喝曷渴碣竭葛褐蝎鞨勘坎堪嵌感憾戡敢柑橄減甘疳監瞰紺邯鑑鑒龕"],["cba1","匣岬甲胛鉀閘剛堈姜岡崗康强彊慷江畺疆糠絳綱羌腔舡薑襁講鋼降鱇介价個凱塏愷愾慨改槪漑疥皆盖箇芥蓋豈鎧開喀客坑更粳羹醵倨去居巨拒据據擧渠炬祛距踞車遽鉅鋸乾件健巾建愆楗腱虔蹇鍵騫乞傑杰桀儉劍劒檢"],["cca1","瞼鈐黔劫怯迲偈憩揭擊格檄激膈覡隔堅牽犬甄絹繭肩見譴遣鵑抉決潔結缺訣兼慊箝謙鉗鎌京俓倞傾儆勁勍卿坰境庚徑慶憬擎敬景暻更梗涇炅烱璟璥瓊痙硬磬竟競絅經耕耿脛莖警輕逕鏡頃頸驚鯨係啓堺契季屆悸戒桂械"],["cda1","棨溪界癸磎稽系繫繼計誡谿階鷄古叩告呱固姑孤尻庫拷攷故敲暠枯槁沽痼皐睾稿羔考股膏苦苽菰藁蠱袴誥賈辜錮雇顧高鼓哭斛曲梏穀谷鵠困坤崑昆梱棍滾琨袞鯤汨滑骨供公共功孔工恐恭拱控攻珙空蚣貢鞏串寡戈果瓜"],["cea1","科菓誇課跨過鍋顆廓槨藿郭串冠官寬慣棺款灌琯瓘管罐菅觀貫關館刮恝括适侊光匡壙廣曠洸炚狂珖筐胱鑛卦掛罫乖傀塊壞怪愧拐槐魁宏紘肱轟交僑咬喬嬌嶠巧攪敎校橋狡皎矯絞翹膠蕎蛟較轎郊餃驕鮫丘久九仇俱具勾"],["cfa1","區口句咎嘔坵垢寇嶇廐懼拘救枸柩構歐毆毬求溝灸狗玖球瞿矩究絿耉臼舅舊苟衢謳購軀逑邱鉤銶駒驅鳩鷗龜國局菊鞠鞫麴君窘群裙軍郡堀屈掘窟宮弓穹窮芎躬倦券勸卷圈拳捲權淃眷厥獗蕨蹶闕机櫃潰詭軌饋句晷歸貴"],["d0a1","鬼龜叫圭奎揆槻珪硅窺竅糾葵規赳逵閨勻均畇筠菌鈞龜橘克剋劇戟棘極隙僅劤勤懃斤根槿瑾筋芹菫覲謹近饉契今妗擒昑檎琴禁禽芩衾衿襟金錦伋及急扱汲級給亘兢矜肯企伎其冀嗜器圻基埼夔奇妓寄岐崎己幾忌技旗旣"],["d1a1","朞期杞棋棄機欺氣汽沂淇玘琦琪璂璣畸畿碁磯祁祇祈祺箕紀綺羈耆耭肌記譏豈起錡錤飢饑騎騏驥麒緊佶吉拮桔金喫儺喇奈娜懦懶拏拿癩",5,"那樂",4,"諾酪駱亂卵暖欄煖爛蘭難鸞捏捺南嵐枏楠湳濫男藍襤拉"],["d2a1","納臘蠟衲囊娘廊",4,"乃來內奈柰耐冷女年撚秊念恬拈捻寧寗努勞奴弩怒擄櫓爐瑙盧",5,"駑魯",10,"濃籠聾膿農惱牢磊腦賂雷尿壘",7,"嫩訥杻紐勒",5,"能菱陵尼泥匿溺多茶"],["d3a1","丹亶但單團壇彖斷旦檀段湍短端簞緞蛋袒鄲鍛撻澾獺疸達啖坍憺擔曇淡湛潭澹痰聃膽蕁覃談譚錟沓畓答踏遝唐堂塘幢戇撞棠當糖螳黨代垈坮大對岱帶待戴擡玳臺袋貸隊黛宅德悳倒刀到圖堵塗導屠島嶋度徒悼挑掉搗桃"],["d4a1","棹櫂淘渡滔濤燾盜睹禱稻萄覩賭跳蹈逃途道都鍍陶韜毒瀆牘犢獨督禿篤纛讀墩惇敦旽暾沌焞燉豚頓乭突仝冬凍動同憧東桐棟洞潼疼瞳童胴董銅兜斗杜枓痘竇荳讀豆逗頭屯臀芚遁遯鈍得嶝橙燈登等藤謄鄧騰喇懶拏癩羅"],["d5a1","蘿螺裸邏樂洛烙珞絡落諾酪駱丹亂卵欄欒瀾爛蘭鸞剌辣嵐擥攬欖濫籃纜藍襤覽拉臘蠟廊朗浪狼琅瑯螂郞來崍徠萊冷掠略亮倆兩凉梁樑粮粱糧良諒輛量侶儷勵呂廬慮戾旅櫚濾礪藜蠣閭驢驪麗黎力曆歷瀝礫轢靂憐戀攣漣"],["d6a1","煉璉練聯蓮輦連鍊冽列劣洌烈裂廉斂殮濂簾獵令伶囹寧岺嶺怜玲笭羚翎聆逞鈴零靈領齡例澧禮醴隷勞怒撈擄櫓潞瀘爐盧老蘆虜路輅露魯鷺鹵碌祿綠菉錄鹿麓論壟弄朧瀧瓏籠聾儡瀨牢磊賂賚賴雷了僚寮廖料燎療瞭聊蓼"],["d7a1","遼鬧龍壘婁屢樓淚漏瘻累縷蔞褸鏤陋劉旒柳榴流溜瀏琉瑠留瘤硫謬類六戮陸侖倫崙淪綸輪律慄栗率隆勒肋凜凌楞稜綾菱陵俚利厘吏唎履悧李梨浬犁狸理璃異痢籬罹羸莉裏裡里釐離鯉吝潾燐璘藺躪隣鱗麟林淋琳臨霖砬"],["d8a1","立笠粒摩瑪痲碼磨馬魔麻寞幕漠膜莫邈万卍娩巒彎慢挽晩曼滿漫灣瞞萬蔓蠻輓饅鰻唜抹末沫茉襪靺亡妄忘忙望網罔芒茫莽輞邙埋妹媒寐昧枚梅每煤罵買賣邁魅脈貊陌驀麥孟氓猛盲盟萌冪覓免冕勉棉沔眄眠綿緬面麵滅"],["d9a1","蔑冥名命明暝椧溟皿瞑茗蓂螟酩銘鳴袂侮冒募姆帽慕摸摹暮某模母毛牟牡瑁眸矛耗芼茅謀謨貌木沐牧目睦穆鶩歿沒夢朦蒙卯墓妙廟描昴杳渺猫竗苗錨務巫憮懋戊拇撫无楙武毋無珷畝繆舞茂蕪誣貿霧鵡墨默們刎吻問文"],["daa1","汶紊紋聞蚊門雯勿沕物味媚尾嵋彌微未梶楣渼湄眉米美薇謎迷靡黴岷悶愍憫敏旻旼民泯玟珉緡閔密蜜謐剝博拍搏撲朴樸泊珀璞箔粕縛膊舶薄迫雹駁伴半反叛拌搬攀斑槃泮潘班畔瘢盤盼磐磻礬絆般蟠返頒飯勃拔撥渤潑"],["dba1","發跋醱鉢髮魃倣傍坊妨尨幇彷房放方旁昉枋榜滂磅紡肪膀舫芳蒡蚌訪謗邦防龐倍俳北培徘拜排杯湃焙盃背胚裴裵褙賠輩配陪伯佰帛柏栢白百魄幡樊煩燔番磻繁蕃藩飜伐筏罰閥凡帆梵氾汎泛犯範范法琺僻劈壁擘檗璧癖"],["dca1","碧蘗闢霹便卞弁變辨辯邊別瞥鱉鼈丙倂兵屛幷昞昺柄棅炳甁病秉竝輧餠騈保堡報寶普步洑湺潽珤甫菩補褓譜輔伏僕匐卜宓復服福腹茯蔔複覆輹輻馥鰒本乶俸奉封峯峰捧棒烽熢琫縫蓬蜂逢鋒鳳不付俯傅剖副否咐埠夫婦"],["dda1","孚孵富府復扶敷斧浮溥父符簿缶腐腑膚艀芙莩訃負賦賻赴趺部釜阜附駙鳧北分吩噴墳奔奮忿憤扮昐汾焚盆粉糞紛芬賁雰不佛弗彿拂崩朋棚硼繃鵬丕備匕匪卑妃婢庇悲憊扉批斐枇榧比毖毗毘沸泌琵痺砒碑秕秘粃緋翡肥"],["dea1","脾臂菲蜚裨誹譬費鄙非飛鼻嚬嬪彬斌檳殯浜濱瀕牝玭貧賓頻憑氷聘騁乍事些仕伺似使俟僿史司唆嗣四士奢娑寫寺射巳師徙思捨斜斯柶査梭死沙泗渣瀉獅砂社祀祠私篩紗絲肆舍莎蓑蛇裟詐詞謝賜赦辭邪飼駟麝削數朔索"],["dfa1","傘刪山散汕珊産疝算蒜酸霰乷撒殺煞薩三參杉森渗芟蔘衫揷澁鈒颯上傷像償商喪嘗孀尙峠常床庠廂想桑橡湘爽牀狀相祥箱翔裳觴詳象賞霜塞璽賽嗇塞穡索色牲生甥省笙墅壻嶼序庶徐恕抒捿敍暑曙書栖棲犀瑞筮絮緖署"],["e0a1","胥舒薯西誓逝鋤黍鼠夕奭席惜昔晳析汐淅潟石碩蓆釋錫仙僊先善嬋宣扇敾旋渲煽琁瑄璇璿癬禪線繕羨腺膳船蘚蟬詵跣選銑鐥饍鮮卨屑楔泄洩渫舌薛褻設說雪齧剡暹殲纖蟾贍閃陝攝涉燮葉城姓宬性惺成星晟猩珹盛省筬"],["e1a1","聖聲腥誠醒世勢歲洗稅笹細說貰召嘯塑宵小少巢所掃搔昭梳沼消溯瀟炤燒甦疏疎瘙笑篠簫素紹蔬蕭蘇訴逍遡邵銷韶騷俗屬束涑粟續謖贖速孫巽損蓀遜飡率宋悚松淞訟誦送頌刷殺灑碎鎖衰釗修受嗽囚垂壽嫂守岫峀帥愁"],["e2a1","戍手授搜收數樹殊水洙漱燧狩獸琇璲瘦睡秀穗竪粹綏綬繡羞脩茱蒐蓚藪袖誰讐輸遂邃酬銖銹隋隧隨雖需須首髓鬚叔塾夙孰宿淑潚熟琡璹肅菽巡徇循恂旬栒楯橓殉洵淳珣盾瞬筍純脣舜荀蓴蕣詢諄醇錞順馴戌術述鉥崇崧"],["e3a1","嵩瑟膝蝨濕拾習褶襲丞乘僧勝升承昇繩蠅陞侍匙嘶始媤尸屎屍市弑恃施是時枾柴猜矢示翅蒔蓍視試詩諡豕豺埴寔式息拭植殖湜熄篒蝕識軾食飾伸侁信呻娠宸愼新晨燼申神紳腎臣莘薪藎蜃訊身辛辰迅失室實悉審尋心沁"],["e4a1","沈深瀋甚芯諶什十拾雙氏亞俄兒啞娥峨我牙芽莪蛾衙訝阿雅餓鴉鵝堊岳嶽幄惡愕握樂渥鄂鍔顎鰐齷安岸按晏案眼雁鞍顔鮟斡謁軋閼唵岩巖庵暗癌菴闇壓押狎鴨仰央怏昻殃秧鴦厓哀埃崖愛曖涯碍艾隘靄厄扼掖液縊腋額"],["e5a1","櫻罌鶯鸚也倻冶夜惹揶椰爺耶若野弱掠略約若葯蒻藥躍亮佯兩凉壤孃恙揚攘敭暘梁楊樣洋瀁煬痒瘍禳穰糧羊良襄諒讓釀陽量養圄御於漁瘀禦語馭魚齬億憶抑檍臆偃堰彦焉言諺孼蘖俺儼嚴奄掩淹嶪業円予余勵呂女如廬"],["e6a1","旅歟汝濾璵礖礪與艅茹輿轝閭餘驪麗黎亦力域役易曆歷疫繹譯轢逆驛嚥堧姸娟宴年延憐戀捐挻撚椽沇沿涎涓淵演漣烟然煙煉燃燕璉硏硯秊筵緣練縯聯衍軟輦蓮連鉛鍊鳶列劣咽悅涅烈熱裂說閱厭廉念捻染殮炎焰琰艶苒"],["e7a1","簾閻髥鹽曄獵燁葉令囹塋寧嶺嶸影怜映暎楹榮永泳渶潁濚瀛瀯煐營獰玲瑛瑩瓔盈穎纓羚聆英詠迎鈴鍈零霙靈領乂倪例刈叡曳汭濊猊睿穢芮藝蘂禮裔詣譽豫醴銳隸霓預五伍俉傲午吾吳嗚塢墺奧娛寤悟惡懊敖旿晤梧汚澳"],["e8a1","烏熬獒筽蜈誤鰲鼇屋沃獄玉鈺溫瑥瘟穩縕蘊兀壅擁瓮甕癰翁邕雍饔渦瓦窩窪臥蛙蝸訛婉完宛梡椀浣玩琓琬碗緩翫脘腕莞豌阮頑曰往旺枉汪王倭娃歪矮外嵬巍猥畏了僚僥凹堯夭妖姚寥寮尿嶢拗搖撓擾料曜樂橈燎燿瑤療"],["e9a1","窈窯繇繞耀腰蓼蟯要謠遙遼邀饒慾欲浴縟褥辱俑傭冗勇埇墉容庸慂榕涌湧溶熔瑢用甬聳茸蓉踊鎔鏞龍于佑偶優又友右宇寓尤愚憂旴牛玗瑀盂祐禑禹紆羽芋藕虞迂遇郵釪隅雨雩勖彧旭昱栯煜稶郁頊云暈橒殞澐熉耘芸蕓"],["eaa1","運隕雲韻蔚鬱亐熊雄元原員圓園垣媛嫄寃怨愿援沅洹湲源爰猿瑗苑袁轅遠阮院願鴛月越鉞位偉僞危圍委威尉慰暐渭爲瑋緯胃萎葦蔿蝟衛褘謂違韋魏乳侑儒兪劉唯喩孺宥幼幽庾悠惟愈愉揄攸有杻柔柚柳楡楢油洧流游溜"],["eba1","濡猶猷琉瑜由留癒硫紐維臾萸裕誘諛諭踰蹂遊逾遺酉釉鍮類六堉戮毓肉育陸倫允奫尹崙淪潤玧胤贇輪鈗閏律慄栗率聿戎瀜絨融隆垠恩慇殷誾銀隱乙吟淫蔭陰音飮揖泣邑凝應膺鷹依倚儀宜意懿擬椅毅疑矣義艤薏蟻衣誼"],["eca1","議醫二以伊利吏夷姨履已弛彛怡易李梨泥爾珥理異痍痢移罹而耳肄苡荑裏裡貽貳邇里離飴餌匿溺瀷益翊翌翼謚人仁刃印吝咽因姻寅引忍湮燐璘絪茵藺蚓認隣靭靷鱗麟一佚佾壹日溢逸鎰馹任壬妊姙恁林淋稔臨荏賃入卄"],["eda1","立笠粒仍剩孕芿仔刺咨姉姿子字孜恣慈滋炙煮玆瓷疵磁紫者自茨蔗藉諮資雌作勺嚼斫昨灼炸爵綽芍酌雀鵲孱棧殘潺盞岑暫潛箴簪蠶雜丈仗匠場墻壯奬將帳庄張掌暲杖樟檣欌漿牆狀獐璋章粧腸臟臧莊葬蔣薔藏裝贓醬長"],["eea1","障再哉在宰才材栽梓渽滓災縡裁財載齋齎爭箏諍錚佇低儲咀姐底抵杵楮樗沮渚狙猪疽箸紵苧菹著藷詛貯躇這邸雎齟勣吊嫡寂摘敵滴狄炙的積笛籍績翟荻謫賊赤跡蹟迪迹適鏑佃佺傳全典前剪塡塼奠專展廛悛戰栓殿氈澱"],["efa1","煎琠田甸畑癲筌箋箭篆纏詮輾轉鈿銓錢鐫電顚顫餞切截折浙癤竊節絶占岾店漸点粘霑鮎點接摺蝶丁井亭停偵呈姃定幀庭廷征情挺政整旌晶晸柾楨檉正汀淀淨渟湞瀞炡玎珽町睛碇禎程穽精綎艇訂諪貞鄭酊釘鉦鋌錠霆靖"],["f0a1","靜頂鼎制劑啼堤帝弟悌提梯濟祭第臍薺製諸蹄醍除際霽題齊俎兆凋助嘲弔彫措操早晁曺曹朝條棗槽漕潮照燥爪璪眺祖祚租稠窕粗糟組繰肇藻蚤詔調趙躁造遭釣阻雕鳥族簇足鏃存尊卒拙猝倧宗從悰慫棕淙琮種終綜縱腫"],["f1a1","踪踵鍾鐘佐坐左座挫罪主住侏做姝胄呪周嗾奏宙州廚晝朱柱株注洲湊澍炷珠疇籌紂紬綢舟蛛註誅走躊輳週酎酒鑄駐竹粥俊儁准埈寯峻晙樽浚準濬焌畯竣蠢逡遵雋駿茁中仲衆重卽櫛楫汁葺增憎曾拯烝甑症繒蒸證贈之只"],["f2a1","咫地址志持指摯支旨智枝枳止池沚漬知砥祉祗紙肢脂至芝芷蜘誌識贄趾遲直稙稷織職唇嗔塵振搢晉晋桭榛殄津溱珍瑨璡畛疹盡眞瞋秦縉縝臻蔯袗診賑軫辰進鎭陣陳震侄叱姪嫉帙桎瓆疾秩窒膣蛭質跌迭斟朕什執潗緝輯"],["f3a1","鏶集徵懲澄且侘借叉嗟嵯差次此磋箚茶蹉車遮捉搾着窄錯鑿齪撰澯燦璨瓚竄簒纂粲纘讚贊鑽餐饌刹察擦札紮僭參塹慘慙懺斬站讒讖倉倡創唱娼廠彰愴敞昌昶暢槍滄漲猖瘡窓脹艙菖蒼債埰寀寨彩採砦綵菜蔡采釵冊柵策"],["f4a1","責凄妻悽處倜刺剔尺慽戚拓擲斥滌瘠脊蹠陟隻仟千喘天川擅泉淺玔穿舛薦賤踐遷釧闡阡韆凸哲喆徹撤澈綴輟轍鐵僉尖沾添甛瞻簽籤詹諂堞妾帖捷牒疊睫諜貼輒廳晴淸聽菁請靑鯖切剃替涕滯締諦逮遞體初剿哨憔抄招梢"],["f5a1","椒楚樵炒焦硝礁礎秒稍肖艸苕草蕉貂超酢醋醮促囑燭矗蜀觸寸忖村邨叢塚寵悤憁摠總聰蔥銃撮催崔最墜抽推椎楸樞湫皺秋芻萩諏趨追鄒酋醜錐錘鎚雛騶鰍丑畜祝竺筑築縮蓄蹙蹴軸逐春椿瑃出朮黜充忠沖蟲衝衷悴膵萃"],["f6a1","贅取吹嘴娶就炊翠聚脆臭趣醉驟鷲側仄厠惻測層侈値嗤峙幟恥梔治淄熾痔痴癡稚穉緇緻置致蚩輜雉馳齒則勅飭親七柒漆侵寢枕沈浸琛砧針鍼蟄秤稱快他咤唾墮妥惰打拖朶楕舵陀馱駝倬卓啄坼度托拓擢晫柝濁濯琢琸託"],["f7a1","鐸呑嘆坦彈憚歎灘炭綻誕奪脫探眈耽貪塔搭榻宕帑湯糖蕩兌台太怠態殆汰泰笞胎苔跆邰颱宅擇澤撑攄兎吐土討慟桶洞痛筒統通堆槌腿褪退頹偸套妬投透鬪慝特闖坡婆巴把播擺杷波派爬琶破罷芭跛頗判坂板版瓣販辦鈑"],["f8a1","阪八叭捌佩唄悖敗沛浿牌狽稗覇貝彭澎烹膨愎便偏扁片篇編翩遍鞭騙貶坪平枰萍評吠嬖幣廢弊斃肺蔽閉陛佈包匍匏咆哺圃布怖抛抱捕暴泡浦疱砲胞脯苞葡蒲袍褒逋鋪飽鮑幅暴曝瀑爆輻俵剽彪慓杓標漂瓢票表豹飇飄驃"],["f9a1","品稟楓諷豊風馮彼披疲皮被避陂匹弼必泌珌畢疋筆苾馝乏逼下何厦夏廈昰河瑕荷蝦賀遐霞鰕壑學虐謔鶴寒恨悍旱汗漢澣瀚罕翰閑閒限韓割轄函含咸啣喊檻涵緘艦銜陷鹹合哈盒蛤閤闔陜亢伉姮嫦巷恒抗杭桁沆港缸肛航"],["faa1","行降項亥偕咳垓奚孩害懈楷海瀣蟹解該諧邂駭骸劾核倖幸杏荇行享向嚮珦鄕響餉饗香噓墟虛許憲櫶獻軒歇險驗奕爀赫革俔峴弦懸晛泫炫玄玹現眩睍絃絢縣舷衒見賢鉉顯孑穴血頁嫌俠協夾峽挾浹狹脅脇莢鋏頰亨兄刑型"],["fba1","形泂滎瀅灐炯熒珩瑩荊螢衡逈邢鎣馨兮彗惠慧暳蕙蹊醯鞋乎互呼壕壺好岵弧戶扈昊晧毫浩淏湖滸澔濠濩灝狐琥瑚瓠皓祜糊縞胡芦葫蒿虎號蝴護豪鎬頀顥惑或酷婚昏混渾琿魂忽惚笏哄弘汞泓洪烘紅虹訌鴻化和嬅樺火畵"],["fca1","禍禾花華話譁貨靴廓擴攫確碻穫丸喚奐宦幻患換歡晥桓渙煥環紈還驩鰥活滑猾豁闊凰幌徨恍惶愰慌晃晄榥況湟滉潢煌璜皇篁簧荒蝗遑隍黃匯回廻徊恢悔懷晦會檜淮澮灰獪繪膾茴蛔誨賄劃獲宖橫鐄哮嚆孝效斅曉梟涍淆"],["fda1","爻肴酵驍侯候厚后吼喉嗅帿後朽煦珝逅勛勳塤壎焄熏燻薰訓暈薨喧暄煊萱卉喙毁彙徽揮暉煇諱輝麾休携烋畦虧恤譎鷸兇凶匈洶胸黑昕欣炘痕吃屹紇訖欠欽歆吸恰洽翕興僖凞喜噫囍姬嬉希憙憘戱晞曦熙熹熺犧禧稀羲詰"]]'); /***/ }), /***/ "./node_modules/encoding/node_modules/iconv-lite/encodings/tables/cp950.json": /*!***********************************************************************************!*\ !*** ./node_modules/encoding/node_modules/iconv-lite/encodings/tables/cp950.json ***! \***********************************************************************************/ /***/ ((module) => { "use strict"; module.exports = /*#__PURE__*/JSON.parse('[["0","\\u0000",127],["a140"," ,、。.‧;:?!︰…‥﹐﹑﹒·﹔﹕﹖﹗|–︱—︳╴︴﹏()︵︶{}︷︸〔〕︹︺【】︻︼《》︽︾〈〉︿﹀「」﹁﹂『』﹃﹄﹙﹚"],["a1a1","﹛﹜﹝﹞‘’“”〝〞‵′#&*※§〃○●△▲◎☆★◇◆□■▽▼㊣℅¯ ̄_ˍ﹉﹊﹍﹎﹋﹌﹟﹠﹡+-×÷±√<>=≦≧≠∞≒≡﹢",4,"~∩∪⊥∠∟⊿㏒㏑∫∮∵∴♀♂⊕⊙↑↓←→↖↗↙↘∥∣/"],["a240","\∕﹨$¥〒¢£%@℃℉﹩﹪﹫㏕㎜㎝㎞㏎㎡㎎㎏㏄°兙兛兞兝兡兣嗧瓩糎▁",7,"▏▎▍▌▋▊▉┼┴┬┤├▔─│▕┌┐└┘╭"],["a2a1","╮╰╯═╞╪╡◢◣◥◤╱╲╳0",9,"Ⅰ",9,"〡",8,"十卄卅A",25,"a",21],["a340","wxyzΑ",16,"Σ",6,"α",16,"σ",6,"ㄅ",10],["a3a1","ㄐ",25,"˙ˉˊˇˋ"],["a3e1","€"],["a440","一乙丁七乃九了二人儿入八几刀刁力匕十卜又三下丈上丫丸凡久么也乞于亡兀刃勺千叉口土士夕大女子孑孓寸小尢尸山川工己已巳巾干廾弋弓才"],["a4a1","丑丐不中丰丹之尹予云井互五亢仁什仃仆仇仍今介仄元允內六兮公冗凶分切刈勻勾勿化匹午升卅卞厄友及反壬天夫太夭孔少尤尺屯巴幻廿弔引心戈戶手扎支文斗斤方日曰月木欠止歹毋比毛氏水火爪父爻片牙牛犬王丙"],["a540","世丕且丘主乍乏乎以付仔仕他仗代令仙仞充兄冉冊冬凹出凸刊加功包匆北匝仟半卉卡占卯卮去可古右召叮叩叨叼司叵叫另只史叱台句叭叻四囚外"],["a5a1","央失奴奶孕它尼巨巧左市布平幼弁弘弗必戊打扔扒扑斥旦朮本未末札正母民氐永汁汀氾犯玄玉瓜瓦甘生用甩田由甲申疋白皮皿目矛矢石示禾穴立丞丟乒乓乩亙交亦亥仿伉伙伊伕伍伐休伏仲件任仰仳份企伋光兇兆先全"],["a640","共再冰列刑划刎刖劣匈匡匠印危吉吏同吊吐吁吋各向名合吃后吆吒因回囝圳地在圭圬圯圩夙多夷夸妄奸妃好她如妁字存宇守宅安寺尖屹州帆并年"],["a6a1","式弛忙忖戎戌戍成扣扛托收早旨旬旭曲曳有朽朴朱朵次此死氖汝汗汙江池汐汕污汛汍汎灰牟牝百竹米糸缶羊羽老考而耒耳聿肉肋肌臣自至臼舌舛舟艮色艾虫血行衣西阡串亨位住佇佗佞伴佛何估佐佑伽伺伸佃佔似但佣"],["a740","作你伯低伶余佝佈佚兌克免兵冶冷別判利刪刨劫助努劬匣即卵吝吭吞吾否呎吧呆呃吳呈呂君吩告吹吻吸吮吵吶吠吼呀吱含吟听囪困囤囫坊坑址坍"],["a7a1","均坎圾坐坏圻壯夾妝妒妨妞妣妙妖妍妤妓妊妥孝孜孚孛完宋宏尬局屁尿尾岐岑岔岌巫希序庇床廷弄弟彤形彷役忘忌志忍忱快忸忪戒我抄抗抖技扶抉扭把扼找批扳抒扯折扮投抓抑抆改攻攸旱更束李杏材村杜杖杞杉杆杠"],["a840","杓杗步每求汞沙沁沈沉沅沛汪決沐汰沌汨沖沒汽沃汲汾汴沆汶沍沔沘沂灶灼災灸牢牡牠狄狂玖甬甫男甸皂盯矣私秀禿究系罕肖肓肝肘肛肚育良芒"],["a8a1","芋芍見角言谷豆豕貝赤走足身車辛辰迂迆迅迄巡邑邢邪邦那酉釆里防阮阱阪阬並乖乳事些亞享京佯依侍佳使佬供例來侃佰併侈佩佻侖佾侏侑佺兔兒兕兩具其典冽函刻券刷刺到刮制剁劾劻卒協卓卑卦卷卸卹取叔受味呵"],["a940","咖呸咕咀呻呷咄咒咆呼咐呱呶和咚呢周咋命咎固垃坷坪坩坡坦坤坼夜奉奇奈奄奔妾妻委妹妮姑姆姐姍始姓姊妯妳姒姅孟孤季宗定官宜宙宛尚屈居"],["a9a1","屆岷岡岸岩岫岱岳帘帚帖帕帛帑幸庚店府底庖延弦弧弩往征彿彼忝忠忽念忿怏怔怯怵怖怪怕怡性怩怫怛或戕房戾所承拉拌拄抿拂抹拒招披拓拔拋拈抨抽押拐拙拇拍抵拚抱拘拖拗拆抬拎放斧於旺昔易昌昆昂明昀昏昕昊"],["aa40","昇服朋杭枋枕東果杳杷枇枝林杯杰板枉松析杵枚枓杼杪杲欣武歧歿氓氛泣注泳沱泌泥河沽沾沼波沫法泓沸泄油況沮泗泅泱沿治泡泛泊沬泯泜泖泠"],["aaa1","炕炎炒炊炙爬爭爸版牧物狀狎狙狗狐玩玨玟玫玥甽疝疙疚的盂盲直知矽社祀祁秉秈空穹竺糾罔羌羋者肺肥肢肱股肫肩肴肪肯臥臾舍芳芝芙芭芽芟芹花芬芥芯芸芣芰芾芷虎虱初表軋迎返近邵邸邱邶采金長門阜陀阿阻附"],["ab40","陂隹雨青非亟亭亮信侵侯便俠俑俏保促侶俘俟俊俗侮俐俄係俚俎俞侷兗冒冑冠剎剃削前剌剋則勇勉勃勁匍南卻厚叛咬哀咨哎哉咸咦咳哇哂咽咪品"],["aba1","哄哈咯咫咱咻咩咧咿囿垂型垠垣垢城垮垓奕契奏奎奐姜姘姿姣姨娃姥姪姚姦威姻孩宣宦室客宥封屎屏屍屋峙峒巷帝帥帟幽庠度建弈弭彥很待徊律徇後徉怒思怠急怎怨恍恰恨恢恆恃恬恫恪恤扁拜挖按拼拭持拮拽指拱拷"],["ac40","拯括拾拴挑挂政故斫施既春昭映昧是星昨昱昤曷柿染柱柔某柬架枯柵柩柯柄柑枴柚查枸柏柞柳枰柙柢柝柒歪殃殆段毒毗氟泉洋洲洪流津洌洱洞洗"],["aca1","活洽派洶洛泵洹洧洸洩洮洵洎洫炫為炳炬炯炭炸炮炤爰牲牯牴狩狠狡玷珊玻玲珍珀玳甚甭畏界畎畋疫疤疥疢疣癸皆皇皈盈盆盃盅省盹相眉看盾盼眇矜砂研砌砍祆祉祈祇禹禺科秒秋穿突竿竽籽紂紅紀紉紇約紆缸美羿耄"],["ad40","耐耍耑耶胖胥胚胃胄背胡胛胎胞胤胝致舢苧范茅苣苛苦茄若茂茉苒苗英茁苜苔苑苞苓苟苯茆虐虹虻虺衍衫要觔計訂訃貞負赴赳趴軍軌述迦迢迪迥"],["ada1","迭迫迤迨郊郎郁郃酋酊重閂限陋陌降面革韋韭音頁風飛食首香乘亳倌倍倣俯倦倥俸倩倖倆值借倚倒們俺倀倔倨俱倡個候倘俳修倭倪俾倫倉兼冤冥冢凍凌准凋剖剜剔剛剝匪卿原厝叟哨唐唁唷哼哥哲唆哺唔哩哭員唉哮哪"],["ae40","哦唧唇哽唏圃圄埂埔埋埃堉夏套奘奚娑娘娜娟娛娓姬娠娣娩娥娌娉孫屘宰害家宴宮宵容宸射屑展屐峭峽峻峪峨峰島崁峴差席師庫庭座弱徒徑徐恙"],["aea1","恣恥恐恕恭恩息悄悟悚悍悔悌悅悖扇拳挈拿捎挾振捕捂捆捏捉挺捐挽挪挫挨捍捌效敉料旁旅時晉晏晃晒晌晅晁書朔朕朗校核案框桓根桂桔栩梳栗桌桑栽柴桐桀格桃株桅栓栘桁殊殉殷氣氧氨氦氤泰浪涕消涇浦浸海浙涓"],["af40","浬涉浮浚浴浩涌涊浹涅浥涔烊烘烤烙烈烏爹特狼狹狽狸狷玆班琉珮珠珪珞畔畝畜畚留疾病症疲疳疽疼疹痂疸皋皰益盍盎眩真眠眨矩砰砧砸砝破砷"],["afa1","砥砭砠砟砲祕祐祠祟祖神祝祗祚秤秣秧租秦秩秘窄窈站笆笑粉紡紗紋紊素索純紐紕級紜納紙紛缺罟羔翅翁耆耘耕耙耗耽耿胱脂胰脅胭胴脆胸胳脈能脊胼胯臭臬舀舐航舫舨般芻茫荒荔荊茸荐草茵茴荏茲茹茶茗荀茱茨荃"],["b040","虔蚊蚪蚓蚤蚩蚌蚣蚜衰衷袁袂衽衹記訐討訌訕訊託訓訖訏訑豈豺豹財貢起躬軒軔軏辱送逆迷退迺迴逃追逅迸邕郡郝郢酒配酌釘針釗釜釙閃院陣陡"],["b0a1","陛陝除陘陞隻飢馬骨高鬥鬲鬼乾偺偽停假偃偌做偉健偶偎偕偵側偷偏倏偯偭兜冕凰剪副勒務勘動匐匏匙匿區匾參曼商啪啦啄啞啡啃啊唱啖問啕唯啤唸售啜唬啣唳啁啗圈國圉域堅堊堆埠埤基堂堵執培夠奢娶婁婉婦婪婀"],["b140","娼婢婚婆婊孰寇寅寄寂宿密尉專將屠屜屝崇崆崎崛崖崢崑崩崔崙崤崧崗巢常帶帳帷康庸庶庵庾張強彗彬彩彫得徙從徘御徠徜恿患悉悠您惋悴惦悽"],["b1a1","情悻悵惜悼惘惕惆惟悸惚惇戚戛扈掠控捲掖探接捷捧掘措捱掩掉掃掛捫推掄授掙採掬排掏掀捻捩捨捺敝敖救教敗啟敏敘敕敔斜斛斬族旋旌旎晝晚晤晨晦晞曹勗望梁梯梢梓梵桿桶梱梧梗械梃棄梭梆梅梔條梨梟梡梂欲殺"],["b240","毫毬氫涎涼淳淙液淡淌淤添淺清淇淋涯淑涮淞淹涸混淵淅淒渚涵淚淫淘淪深淮淨淆淄涪淬涿淦烹焉焊烽烯爽牽犁猜猛猖猓猙率琅琊球理現琍瓠瓶"],["b2a1","瓷甜產略畦畢異疏痔痕疵痊痍皎盔盒盛眷眾眼眶眸眺硫硃硎祥票祭移窒窕笠笨笛第符笙笞笮粒粗粕絆絃統紮紹紼絀細紳組累終紲紱缽羞羚翌翎習耜聊聆脯脖脣脫脩脰脤舂舵舷舶船莎莞莘荸莢莖莽莫莒莊莓莉莠荷荻荼"],["b340","莆莧處彪蛇蛀蚶蛄蚵蛆蛋蚱蚯蛉術袞袈被袒袖袍袋覓規訪訝訣訥許設訟訛訢豉豚販責貫貨貪貧赧赦趾趺軛軟這逍通逗連速逝逐逕逞造透逢逖逛途"],["b3a1","部郭都酗野釵釦釣釧釭釩閉陪陵陳陸陰陴陶陷陬雀雪雩章竟頂頃魚鳥鹵鹿麥麻傢傍傅備傑傀傖傘傚最凱割剴創剩勞勝勛博厥啻喀喧啼喊喝喘喂喜喪喔喇喋喃喳單喟唾喲喚喻喬喱啾喉喫喙圍堯堪場堤堰報堡堝堠壹壺奠"],["b440","婷媚婿媒媛媧孳孱寒富寓寐尊尋就嵌嵐崴嵇巽幅帽幀幃幾廊廁廂廄弼彭復循徨惑惡悲悶惠愜愣惺愕惰惻惴慨惱愎惶愉愀愒戟扉掣掌描揀揩揉揆揍"],["b4a1","插揣提握揖揭揮捶援揪換摒揚揹敞敦敢散斑斐斯普晰晴晶景暑智晾晷曾替期朝棺棕棠棘棗椅棟棵森棧棹棒棲棣棋棍植椒椎棉棚楮棻款欺欽殘殖殼毯氮氯氬港游湔渡渲湧湊渠渥渣減湛湘渤湖湮渭渦湯渴湍渺測湃渝渾滋"],["b540","溉渙湎湣湄湲湩湟焙焚焦焰無然煮焜牌犄犀猶猥猴猩琺琪琳琢琥琵琶琴琯琛琦琨甥甦畫番痢痛痣痙痘痞痠登發皖皓皴盜睏短硝硬硯稍稈程稅稀窘"],["b5a1","窗窖童竣等策筆筐筒答筍筋筏筑粟粥絞結絨絕紫絮絲絡給絢絰絳善翔翕耋聒肅腕腔腋腑腎脹腆脾腌腓腴舒舜菩萃菸萍菠菅萋菁華菱菴著萊菰萌菌菽菲菊萸萎萄菜萇菔菟虛蛟蛙蛭蛔蛛蛤蛐蛞街裁裂袱覃視註詠評詞証詁"],["b640","詔詛詐詆訴診訶詖象貂貯貼貳貽賁費賀貴買貶貿貸越超趁跎距跋跚跑跌跛跆軻軸軼辜逮逵週逸進逶鄂郵鄉郾酣酥量鈔鈕鈣鈉鈞鈍鈐鈇鈑閔閏開閑"],["b6a1","間閒閎隊階隋陽隅隆隍陲隄雁雅雄集雇雯雲韌項順須飧飪飯飩飲飭馮馭黃黍黑亂傭債傲傳僅傾催傷傻傯僇剿剷剽募勦勤勢勣匯嗟嗨嗓嗦嗎嗜嗇嗑嗣嗤嗯嗚嗡嗅嗆嗥嗉園圓塞塑塘塗塚塔填塌塭塊塢塒塋奧嫁嫉嫌媾媽媼"],["b740","媳嫂媲嵩嵯幌幹廉廈弒彙徬微愚意慈感想愛惹愁愈慎慌慄慍愾愴愧愍愆愷戡戢搓搾搞搪搭搽搬搏搜搔損搶搖搗搆敬斟新暗暉暇暈暖暄暘暍會榔業"],["b7a1","楚楷楠楔極椰概楊楨楫楞楓楹榆楝楣楛歇歲毀殿毓毽溢溯滓溶滂源溝滇滅溥溘溼溺溫滑準溜滄滔溪溧溴煎煙煩煤煉照煜煬煦煌煥煞煆煨煖爺牒猷獅猿猾瑯瑚瑕瑟瑞瑁琿瑙瑛瑜當畸瘀痰瘁痲痱痺痿痴痳盞盟睛睫睦睞督"],["b840","睹睪睬睜睥睨睢矮碎碰碗碘碌碉硼碑碓硿祺祿禁萬禽稜稚稠稔稟稞窟窠筷節筠筮筧粱粳粵經絹綑綁綏絛置罩罪署義羨群聖聘肆肄腱腰腸腥腮腳腫"],["b8a1","腹腺腦舅艇蒂葷落萱葵葦葫葉葬葛萼萵葡董葩葭葆虞虜號蛹蜓蜈蜇蜀蛾蛻蜂蜃蜆蜊衙裟裔裙補裘裝裡裊裕裒覜解詫該詳試詩詰誇詼詣誠話誅詭詢詮詬詹詻訾詨豢貊貉賊資賈賄貲賃賂賅跡跟跨路跳跺跪跤跦躲較載軾輊"],["b940","辟農運遊道遂達逼違遐遇遏過遍遑逾遁鄒鄗酬酪酩釉鈷鉗鈸鈽鉀鈾鉛鉋鉤鉑鈴鉉鉍鉅鈹鈿鉚閘隘隔隕雍雋雉雊雷電雹零靖靴靶預頑頓頊頒頌飼飴"],["b9a1","飽飾馳馱馴髡鳩麂鼎鼓鼠僧僮僥僖僭僚僕像僑僱僎僩兢凳劃劂匱厭嗾嘀嘛嘗嗽嘔嘆嘉嘍嘎嗷嘖嘟嘈嘐嗶團圖塵塾境墓墊塹墅塽壽夥夢夤奪奩嫡嫦嫩嫗嫖嫘嫣孵寞寧寡寥實寨寢寤察對屢嶄嶇幛幣幕幗幔廓廖弊彆彰徹慇"],["ba40","愿態慷慢慣慟慚慘慵截撇摘摔撤摸摟摺摑摧搴摭摻敲斡旗旖暢暨暝榜榨榕槁榮槓構榛榷榻榫榴槐槍榭槌榦槃榣歉歌氳漳演滾漓滴漩漾漠漬漏漂漢"],["baa1","滿滯漆漱漸漲漣漕漫漯澈漪滬漁滲滌滷熔熙煽熊熄熒爾犒犖獄獐瑤瑣瑪瑰瑭甄疑瘧瘍瘋瘉瘓盡監瞄睽睿睡磁碟碧碳碩碣禎福禍種稱窪窩竭端管箕箋筵算箝箔箏箸箇箄粹粽精綻綰綜綽綾綠緊綴網綱綺綢綿綵綸維緒緇綬"],["bb40","罰翠翡翟聞聚肇腐膀膏膈膊腿膂臧臺與舔舞艋蓉蒿蓆蓄蒙蒞蒲蒜蓋蒸蓀蓓蒐蒼蓑蓊蜿蜜蜻蜢蜥蜴蜘蝕蜷蜩裳褂裴裹裸製裨褚裯誦誌語誣認誡誓誤"],["bba1","說誥誨誘誑誚誧豪貍貌賓賑賒赫趙趕跼輔輒輕輓辣遠遘遜遣遙遞遢遝遛鄙鄘鄞酵酸酷酴鉸銀銅銘銖鉻銓銜銨鉼銑閡閨閩閣閥閤隙障際雌雒需靼鞅韶頗領颯颱餃餅餌餉駁骯骰髦魁魂鳴鳶鳳麼鼻齊億儀僻僵價儂儈儉儅凜"],["bc40","劇劈劉劍劊勰厲嘮嘻嘹嘲嘿嘴嘩噓噎噗噴嘶嘯嘰墀墟增墳墜墮墩墦奭嬉嫻嬋嫵嬌嬈寮寬審寫層履嶝嶔幢幟幡廢廚廟廝廣廠彈影德徵慶慧慮慝慕憂"],["bca1","慼慰慫慾憧憐憫憎憬憚憤憔憮戮摩摯摹撞撲撈撐撰撥撓撕撩撒撮播撫撚撬撙撢撳敵敷數暮暫暴暱樣樟槨樁樞標槽模樓樊槳樂樅槭樑歐歎殤毅毆漿潼澄潑潦潔澆潭潛潸潮澎潺潰潤澗潘滕潯潠潟熟熬熱熨牖犛獎獗瑩璋璃"],["bd40","瑾璀畿瘠瘩瘟瘤瘦瘡瘢皚皺盤瞎瞇瞌瞑瞋磋磅確磊碾磕碼磐稿稼穀稽稷稻窯窮箭箱範箴篆篇篁箠篌糊締練緯緻緘緬緝編緣線緞緩綞緙緲緹罵罷羯"],["bda1","翩耦膛膜膝膠膚膘蔗蔽蔚蓮蔬蔭蔓蔑蔣蔡蔔蓬蔥蓿蔆螂蝴蝶蝠蝦蝸蝨蝙蝗蝌蝓衛衝褐複褒褓褕褊誼諒談諄誕請諸課諉諂調誰論諍誶誹諛豌豎豬賠賞賦賤賬賭賢賣賜質賡赭趟趣踫踐踝踢踏踩踟踡踞躺輝輛輟輩輦輪輜輞"],["be40","輥適遮遨遭遷鄰鄭鄧鄱醇醉醋醃鋅銻銷鋪銬鋤鋁銳銼鋒鋇鋰銲閭閱霄霆震霉靠鞍鞋鞏頡頫頜颳養餓餒餘駝駐駟駛駑駕駒駙骷髮髯鬧魅魄魷魯鴆鴉"],["bea1","鴃麩麾黎墨齒儒儘儔儐儕冀冪凝劑劓勳噙噫噹噩噤噸噪器噥噱噯噬噢噶壁墾壇壅奮嬝嬴學寰導彊憲憑憩憊懍憶憾懊懈戰擅擁擋撻撼據擄擇擂操撿擒擔撾整曆曉暹曄曇暸樽樸樺橙橫橘樹橄橢橡橋橇樵機橈歙歷氅濂澱澡"],["bf40","濃澤濁澧澳激澹澶澦澠澴熾燉燐燒燈燕熹燎燙燜燃燄獨璜璣璘璟璞瓢甌甍瘴瘸瘺盧盥瞠瞞瞟瞥磨磚磬磧禦積穎穆穌穋窺篙簑築篤篛篡篩篦糕糖縊"],["bfa1","縑縈縛縣縞縝縉縐罹羲翰翱翮耨膳膩膨臻興艘艙蕊蕙蕈蕨蕩蕃蕉蕭蕪蕞螃螟螞螢融衡褪褲褥褫褡親覦諦諺諫諱謀諜諧諮諾謁謂諷諭諳諶諼豫豭貓賴蹄踱踴蹂踹踵輻輯輸輳辨辦遵遴選遲遼遺鄴醒錠錶鋸錳錯錢鋼錫錄錚"],["c040","錐錦錡錕錮錙閻隧隨險雕霎霑霖霍霓霏靛靜靦鞘頰頸頻頷頭頹頤餐館餞餛餡餚駭駢駱骸骼髻髭鬨鮑鴕鴣鴦鴨鴒鴛默黔龍龜優償儡儲勵嚎嚀嚐嚅嚇"],["c0a1","嚏壕壓壑壎嬰嬪嬤孺尷屨嶼嶺嶽嶸幫彌徽應懂懇懦懋戲戴擎擊擘擠擰擦擬擱擢擭斂斃曙曖檀檔檄檢檜櫛檣橾檗檐檠歜殮毚氈濘濱濟濠濛濤濫濯澀濬濡濩濕濮濰燧營燮燦燥燭燬燴燠爵牆獰獲璩環璦璨癆療癌盪瞳瞪瞰瞬"],["c140","瞧瞭矯磷磺磴磯礁禧禪穗窿簇簍篾篷簌篠糠糜糞糢糟糙糝縮績繆縷縲繃縫總縱繅繁縴縹繈縵縿縯罄翳翼聱聲聰聯聳臆臃膺臂臀膿膽臉膾臨舉艱薪"],["c1a1","薄蕾薜薑薔薯薛薇薨薊虧蟀蟑螳蟒蟆螫螻螺蟈蟋褻褶襄褸褽覬謎謗謙講謊謠謝謄謐豁谿豳賺賽購賸賻趨蹉蹋蹈蹊轄輾轂轅輿避遽還邁邂邀鄹醣醞醜鍍鎂錨鍵鍊鍥鍋錘鍾鍬鍛鍰鍚鍔闊闋闌闈闆隱隸雖霜霞鞠韓顆颶餵騁"],["c240","駿鮮鮫鮪鮭鴻鴿麋黏點黜黝黛鼾齋叢嚕嚮壙壘嬸彝懣戳擴擲擾攆擺擻擷斷曜朦檳檬櫃檻檸櫂檮檯歟歸殯瀉瀋濾瀆濺瀑瀏燻燼燾燸獷獵璧璿甕癖癘"],["c2a1","癒瞽瞿瞻瞼礎禮穡穢穠竄竅簫簧簪簞簣簡糧織繕繞繚繡繒繙罈翹翻職聶臍臏舊藏薩藍藐藉薰薺薹薦蟯蟬蟲蟠覆覲觴謨謹謬謫豐贅蹙蹣蹦蹤蹟蹕軀轉轍邇邃邈醫醬釐鎔鎊鎖鎢鎳鎮鎬鎰鎘鎚鎗闔闖闐闕離雜雙雛雞霤鞣鞦"],["c340","鞭韹額顏題顎顓颺餾餿餽餮馥騎髁鬃鬆魏魎魍鯊鯉鯽鯈鯀鵑鵝鵠黠鼕鼬儳嚥壞壟壢寵龐廬懲懷懶懵攀攏曠曝櫥櫝櫚櫓瀛瀟瀨瀚瀝瀕瀘爆爍牘犢獸"],["c3a1","獺璽瓊瓣疇疆癟癡矇礙禱穫穩簾簿簸簽簷籀繫繭繹繩繪羅繳羶羹羸臘藩藝藪藕藤藥藷蟻蠅蠍蟹蟾襠襟襖襞譁譜識證譚譎譏譆譙贈贊蹼蹲躇蹶蹬蹺蹴轔轎辭邊邋醱醮鏡鏑鏟鏃鏈鏜鏝鏖鏢鏍鏘鏤鏗鏨關隴難霪霧靡韜韻類"],["c440","願顛颼饅饉騖騙鬍鯨鯧鯖鯛鶉鵡鵲鵪鵬麒麗麓麴勸嚨嚷嚶嚴嚼壤孀孃孽寶巉懸懺攘攔攙曦朧櫬瀾瀰瀲爐獻瓏癢癥礦礪礬礫竇競籌籃籍糯糰辮繽繼"],["c4a1","纂罌耀臚艦藻藹蘑藺蘆蘋蘇蘊蠔蠕襤覺觸議譬警譯譟譫贏贍躉躁躅躂醴釋鐘鐃鏽闡霰飄饒饑馨騫騰騷騵鰓鰍鹹麵黨鼯齟齣齡儷儸囁囀囂夔屬巍懼懾攝攜斕曩櫻欄櫺殲灌爛犧瓖瓔癩矓籐纏續羼蘗蘭蘚蠣蠢蠡蠟襪襬覽譴"],["c540","護譽贓躊躍躋轟辯醺鐮鐳鐵鐺鐸鐲鐫闢霸霹露響顧顥饗驅驃驀騾髏魔魑鰭鰥鶯鶴鷂鶸麝黯鼙齜齦齧儼儻囈囊囉孿巔巒彎懿攤權歡灑灘玀瓤疊癮癬"],["c5a1","禳籠籟聾聽臟襲襯觼讀贖贗躑躓轡酈鑄鑑鑒霽霾韃韁顫饕驕驍髒鬚鱉鰱鰾鰻鷓鷗鼴齬齪龔囌巖戀攣攫攪曬欐瓚竊籤籣籥纓纖纔臢蘸蘿蠱變邐邏鑣鑠鑤靨顯饜驚驛驗髓體髑鱔鱗鱖鷥麟黴囑壩攬灞癱癲矗罐羈蠶蠹衢讓讒"],["c640","讖艷贛釀鑪靂靈靄韆顰驟鬢魘鱟鷹鷺鹼鹽鼇齷齲廳欖灣籬籮蠻觀躡釁鑲鑰顱饞髖鬣黌灤矚讚鑷韉驢驥纜讜躪釅鑽鑾鑼鱷鱸黷豔鑿鸚爨驪鬱鸛鸞籲"],["c940","乂乜凵匚厂万丌乇亍囗兀屮彳丏冇与丮亓仂仉仈冘勼卬厹圠夃夬尐巿旡殳毌气爿丱丼仨仜仩仡仝仚刌匜卌圢圣夗夯宁宄尒尻屴屳帄庀庂忉戉扐氕"],["c9a1","氶汃氿氻犮犰玊禸肊阞伎优伬仵伔仱伀价伈伝伂伅伢伓伄仴伒冱刓刉刐劦匢匟卍厊吇囡囟圮圪圴夼妀奼妅奻奾奷奿孖尕尥屼屺屻屾巟幵庄异弚彴忕忔忏扜扞扤扡扦扢扙扠扚扥旯旮朾朹朸朻机朿朼朳氘汆汒汜汏汊汔汋"],["ca40","汌灱牞犴犵玎甪癿穵网艸艼芀艽艿虍襾邙邗邘邛邔阢阤阠阣佖伻佢佉体佤伾佧佒佟佁佘伭伳伿佡冏冹刜刞刡劭劮匉卣卲厎厏吰吷吪呔呅吙吜吥吘"],["caa1","吽呏呁吨吤呇囮囧囥坁坅坌坉坋坒夆奀妦妘妠妗妎妢妐妏妧妡宎宒尨尪岍岏岈岋岉岒岊岆岓岕巠帊帎庋庉庌庈庍弅弝彸彶忒忑忐忭忨忮忳忡忤忣忺忯忷忻怀忴戺抃抌抎抏抔抇扱扻扺扰抁抈扷扽扲扴攷旰旴旳旲旵杅杇"],["cb40","杙杕杌杈杝杍杚杋毐氙氚汸汧汫沄沋沏汱汯汩沚汭沇沕沜汦汳汥汻沎灴灺牣犿犽狃狆狁犺狅玕玗玓玔玒町甹疔疕皁礽耴肕肙肐肒肜芐芏芅芎芑芓"],["cba1","芊芃芄豸迉辿邟邡邥邞邧邠阰阨阯阭丳侘佼侅佽侀侇佶佴侉侄佷佌侗佪侚佹侁佸侐侜侔侞侒侂侕佫佮冞冼冾刵刲刳剆刱劼匊匋匼厒厔咇呿咁咑咂咈呫呺呾呥呬呴呦咍呯呡呠咘呣呧呤囷囹坯坲坭坫坱坰坶垀坵坻坳坴坢"],["cc40","坨坽夌奅妵妺姏姎妲姌姁妶妼姃姖妱妽姀姈妴姇孢孥宓宕屄屇岮岤岠岵岯岨岬岟岣岭岢岪岧岝岥岶岰岦帗帔帙弨弢弣弤彔徂彾彽忞忥怭怦怙怲怋"],["cca1","怴怊怗怳怚怞怬怢怍怐怮怓怑怌怉怜戔戽抭抴拑抾抪抶拊抮抳抯抻抩抰抸攽斨斻昉旼昄昒昈旻昃昋昍昅旽昑昐曶朊枅杬枎枒杶杻枘枆构杴枍枌杺枟枑枙枃杽极杸杹枔欥殀歾毞氝沓泬泫泮泙沶泔沭泧沷泐泂沺泃泆泭泲"],["cd40","泒泝沴沊沝沀泞泀洰泍泇沰泹泏泩泑炔炘炅炓炆炄炑炖炂炚炃牪狖狋狘狉狜狒狔狚狌狑玤玡玭玦玢玠玬玝瓝瓨甿畀甾疌疘皯盳盱盰盵矸矼矹矻矺"],["cda1","矷祂礿秅穸穻竻籵糽耵肏肮肣肸肵肭舠芠苀芫芚芘芛芵芧芮芼芞芺芴芨芡芩苂芤苃芶芢虰虯虭虮豖迒迋迓迍迖迕迗邲邴邯邳邰阹阽阼阺陃俍俅俓侲俉俋俁俔俜俙侻侳俛俇俖侺俀侹俬剄剉勀勂匽卼厗厖厙厘咺咡咭咥哏"],["ce40","哃茍咷咮哖咶哅哆咠呰咼咢咾呲哞咰垵垞垟垤垌垗垝垛垔垘垏垙垥垚垕壴复奓姡姞姮娀姱姝姺姽姼姶姤姲姷姛姩姳姵姠姾姴姭宨屌峐峘峌峗峋峛"],["cea1","峞峚峉峇峊峖峓峔峏峈峆峎峟峸巹帡帢帣帠帤庰庤庢庛庣庥弇弮彖徆怷怹恔恲恞恅恓恇恉恛恌恀恂恟怤恄恘恦恮扂扃拏挍挋拵挎挃拫拹挏挌拸拶挀挓挔拺挕拻拰敁敃斪斿昶昡昲昵昜昦昢昳昫昺昝昴昹昮朏朐柁柲柈枺"],["cf40","柜枻柸柘柀枷柅柫柤柟枵柍枳柷柶柮柣柂枹柎柧柰枲柼柆柭柌枮柦柛柺柉柊柃柪柋欨殂殄殶毖毘毠氠氡洨洴洭洟洼洿洒洊泚洳洄洙洺洚洑洀洝浂"],["cfa1","洁洘洷洃洏浀洇洠洬洈洢洉洐炷炟炾炱炰炡炴炵炩牁牉牊牬牰牳牮狊狤狨狫狟狪狦狣玅珌珂珈珅玹玶玵玴珫玿珇玾珃珆玸珋瓬瓮甮畇畈疧疪癹盄眈眃眄眅眊盷盻盺矧矨砆砑砒砅砐砏砎砉砃砓祊祌祋祅祄秕种秏秖秎窀"],["d040","穾竑笀笁籺籸籹籿粀粁紃紈紁罘羑羍羾耇耎耏耔耷胘胇胠胑胈胂胐胅胣胙胜胊胕胉胏胗胦胍臿舡芔苙苾苹茇苨茀苕茺苫苖苴苬苡苲苵茌苻苶苰苪"],["d0a1","苤苠苺苳苭虷虴虼虳衁衎衧衪衩觓訄訇赲迣迡迮迠郱邽邿郕郅邾郇郋郈釔釓陔陏陑陓陊陎倞倅倇倓倢倰倛俵俴倳倷倬俶俷倗倜倠倧倵倯倱倎党冔冓凊凄凅凈凎剡剚剒剞剟剕剢勍匎厞唦哢唗唒哧哳哤唚哿唄唈哫唑唅哱"],["d140","唊哻哷哸哠唎唃唋圁圂埌堲埕埒垺埆垽垼垸垶垿埇埐垹埁夎奊娙娖娭娮娕娏娗娊娞娳孬宧宭宬尃屖屔峬峿峮峱峷崀峹帩帨庨庮庪庬弳弰彧恝恚恧"],["d1a1","恁悢悈悀悒悁悝悃悕悛悗悇悜悎戙扆拲挐捖挬捄捅挶捃揤挹捋捊挼挩捁挴捘捔捙挭捇挳捚捑挸捗捀捈敊敆旆旃旄旂晊晟晇晑朒朓栟栚桉栲栳栻桋桏栖栱栜栵栫栭栯桎桄栴栝栒栔栦栨栮桍栺栥栠欬欯欭欱欴歭肂殈毦毤"],["d240","毨毣毢毧氥浺浣浤浶洍浡涒浘浢浭浯涑涍淯浿涆浞浧浠涗浰浼浟涂涘洯浨涋浾涀涄洖涃浻浽浵涐烜烓烑烝烋缹烢烗烒烞烠烔烍烅烆烇烚烎烡牂牸"],["d2a1","牷牶猀狺狴狾狶狳狻猁珓珙珥珖玼珧珣珩珜珒珛珔珝珚珗珘珨瓞瓟瓴瓵甡畛畟疰痁疻痄痀疿疶疺皊盉眝眛眐眓眒眣眑眕眙眚眢眧砣砬砢砵砯砨砮砫砡砩砳砪砱祔祛祏祜祓祒祑秫秬秠秮秭秪秜秞秝窆窉窅窋窌窊窇竘笐"],["d340","笄笓笅笏笈笊笎笉笒粄粑粊粌粈粍粅紞紝紑紎紘紖紓紟紒紏紌罜罡罞罠罝罛羖羒翃翂翀耖耾耹胺胲胹胵脁胻脀舁舯舥茳茭荄茙荑茥荖茿荁茦茜茢"],["d3a1","荂荎茛茪茈茼荍茖茤茠茷茯茩荇荅荌荓茞茬荋茧荈虓虒蚢蚨蚖蚍蚑蚞蚇蚗蚆蚋蚚蚅蚥蚙蚡蚧蚕蚘蚎蚝蚐蚔衃衄衭衵衶衲袀衱衿衯袃衾衴衼訒豇豗豻貤貣赶赸趵趷趶軑軓迾迵适迿迻逄迼迶郖郠郙郚郣郟郥郘郛郗郜郤酐"],["d440","酎酏釕釢釚陜陟隼飣髟鬯乿偰偪偡偞偠偓偋偝偲偈偍偁偛偊偢倕偅偟偩偫偣偤偆偀偮偳偗偑凐剫剭剬剮勖勓匭厜啵啶唼啍啐唴唪啑啢唶唵唰啒啅"],["d4a1","唌唲啥啎唹啈唭唻啀啋圊圇埻堔埢埶埜埴堀埭埽堈埸堋埳埏堇埮埣埲埥埬埡堎埼堐埧堁堌埱埩埰堍堄奜婠婘婕婧婞娸娵婭婐婟婥婬婓婤婗婃婝婒婄婛婈媎娾婍娹婌婰婩婇婑婖婂婜孲孮寁寀屙崞崋崝崚崠崌崨崍崦崥崏"],["d540","崰崒崣崟崮帾帴庱庴庹庲庳弶弸徛徖徟悊悐悆悾悰悺惓惔惏惤惙惝惈悱惛悷惊悿惃惍惀挲捥掊掂捽掽掞掭掝掗掫掎捯掇掐据掯捵掜捭掮捼掤挻掟"],["d5a1","捸掅掁掑掍捰敓旍晥晡晛晙晜晢朘桹梇梐梜桭桮梮梫楖桯梣梬梩桵桴梲梏桷梒桼桫桲梪梀桱桾梛梖梋梠梉梤桸桻梑梌梊桽欶欳欷欸殑殏殍殎殌氪淀涫涴涳湴涬淩淢涷淶淔渀淈淠淟淖涾淥淜淝淛淴淊涽淭淰涺淕淂淏淉"],["d640","淐淲淓淽淗淍淣涻烺焍烷焗烴焌烰焄烳焐烼烿焆焓焀烸烶焋焂焎牾牻牼牿猝猗猇猑猘猊猈狿猏猞玈珶珸珵琄琁珽琇琀珺珼珿琌琋珴琈畤畣痎痒痏"],["d6a1","痋痌痑痐皏皉盓眹眯眭眱眲眴眳眽眥眻眵硈硒硉硍硊硌砦硅硐祤祧祩祪祣祫祡离秺秸秶秷窏窔窐笵筇笴笥笰笢笤笳笘笪笝笱笫笭笯笲笸笚笣粔粘粖粣紵紽紸紶紺絅紬紩絁絇紾紿絊紻紨罣羕羜羝羛翊翋翍翐翑翇翏翉耟"],["d740","耞耛聇聃聈脘脥脙脛脭脟脬脞脡脕脧脝脢舑舸舳舺舴舲艴莐莣莨莍荺荳莤荴莏莁莕莙荵莔莩荽莃莌莝莛莪莋荾莥莯莈莗莰荿莦莇莮荶莚虙虖蚿蚷"],["d7a1","蛂蛁蛅蚺蚰蛈蚹蚳蚸蛌蚴蚻蚼蛃蚽蚾衒袉袕袨袢袪袚袑袡袟袘袧袙袛袗袤袬袌袓袎覂觖觙觕訰訧訬訞谹谻豜豝豽貥赽赻赹趼跂趹趿跁軘軞軝軜軗軠軡逤逋逑逜逌逡郯郪郰郴郲郳郔郫郬郩酖酘酚酓酕釬釴釱釳釸釤釹釪"],["d840","釫釷釨釮镺閆閈陼陭陫陱陯隿靪頄飥馗傛傕傔傞傋傣傃傌傎傝偨傜傒傂傇兟凔匒匑厤厧喑喨喥喭啷噅喢喓喈喏喵喁喣喒喤啽喌喦啿喕喡喎圌堩堷"],["d8a1","堙堞堧堣堨埵塈堥堜堛堳堿堶堮堹堸堭堬堻奡媯媔媟婺媢媞婸媦婼媥媬媕媮娷媄媊媗媃媋媩婻婽媌媜媏媓媝寪寍寋寔寑寊寎尌尰崷嵃嵫嵁嵋崿崵嵑嵎嵕崳崺嵒崽崱嵙嵂崹嵉崸崼崲崶嵀嵅幄幁彘徦徥徫惉悹惌惢惎惄愔"],["d940","惲愊愖愅惵愓惸惼惾惁愃愘愝愐惿愄愋扊掔掱掰揎揥揨揯揃撝揳揊揠揶揕揲揵摡揟掾揝揜揄揘揓揂揇揌揋揈揰揗揙攲敧敪敤敜敨敥斌斝斞斮旐旒"],["d9a1","晼晬晻暀晱晹晪晲朁椌棓椄棜椪棬棪棱椏棖棷棫棤棶椓椐棳棡椇棌椈楰梴椑棯棆椔棸棐棽棼棨椋椊椗棎棈棝棞棦棴棑椆棔棩椕椥棇欹欻欿欼殔殗殙殕殽毰毲毳氰淼湆湇渟湉溈渼渽湅湢渫渿湁湝湳渜渳湋湀湑渻渃渮湞"],["da40","湨湜湡渱渨湠湱湫渹渢渰湓湥渧湸湤湷湕湹湒湦渵渶湚焠焞焯烻焮焱焣焥焢焲焟焨焺焛牋牚犈犉犆犅犋猒猋猰猢猱猳猧猲猭猦猣猵猌琮琬琰琫琖"],["daa1","琚琡琭琱琤琣琝琩琠琲瓻甯畯畬痧痚痡痦痝痟痤痗皕皒盚睆睇睄睍睅睊睎睋睌矞矬硠硤硥硜硭硱硪确硰硩硨硞硢祴祳祲祰稂稊稃稌稄窙竦竤筊笻筄筈筌筎筀筘筅粢粞粨粡絘絯絣絓絖絧絪絏絭絜絫絒絔絩絑絟絎缾缿罥"],["db40","罦羢羠羡翗聑聏聐胾胔腃腊腒腏腇脽腍脺臦臮臷臸臹舄舼舽舿艵茻菏菹萣菀菨萒菧菤菼菶萐菆菈菫菣莿萁菝菥菘菿菡菋菎菖菵菉萉萏菞萑萆菂菳"],["dba1","菕菺菇菑菪萓菃菬菮菄菻菗菢萛菛菾蛘蛢蛦蛓蛣蛚蛪蛝蛫蛜蛬蛩蛗蛨蛑衈衖衕袺裗袹袸裀袾袶袼袷袽袲褁裉覕覘覗觝觚觛詎詍訹詙詀詗詘詄詅詒詈詑詊詌詏豟貁貀貺貾貰貹貵趄趀趉跘跓跍跇跖跜跏跕跙跈跗跅軯軷軺"],["dc40","軹軦軮軥軵軧軨軶軫軱軬軴軩逭逴逯鄆鄬鄄郿郼鄈郹郻鄁鄀鄇鄅鄃酡酤酟酢酠鈁鈊鈥鈃鈚鈦鈏鈌鈀鈒釿釽鈆鈄鈧鈂鈜鈤鈙鈗鈅鈖镻閍閌閐隇陾隈"],["dca1","隉隃隀雂雈雃雱雰靬靰靮頇颩飫鳦黹亃亄亶傽傿僆傮僄僊傴僈僂傰僁傺傱僋僉傶傸凗剺剸剻剼嗃嗛嗌嗐嗋嗊嗝嗀嗔嗄嗩喿嗒喍嗏嗕嗢嗖嗈嗲嗍嗙嗂圔塓塨塤塏塍塉塯塕塎塝塙塥塛堽塣塱壼嫇嫄嫋媺媸媱媵媰媿嫈媻嫆"],["dd40","媷嫀嫊媴媶嫍媹媐寖寘寙尟尳嵱嵣嵊嵥嵲嵬嵞嵨嵧嵢巰幏幎幊幍幋廅廌廆廋廇彀徯徭惷慉慊愫慅愶愲愮慆愯慏愩慀戠酨戣戥戤揅揱揫搐搒搉搠搤"],["dda1","搳摃搟搕搘搹搷搢搣搌搦搰搨摁搵搯搊搚摀搥搧搋揧搛搮搡搎敯斒旓暆暌暕暐暋暊暙暔晸朠楦楟椸楎楢楱椿楅楪椹楂楗楙楺楈楉椵楬椳椽楥棰楸椴楩楀楯楄楶楘楁楴楌椻楋椷楜楏楑椲楒椯楻椼歆歅歃歂歈歁殛嗀毻毼"],["de40","毹毷毸溛滖滈溏滀溟溓溔溠溱溹滆滒溽滁溞滉溷溰滍溦滏溲溾滃滜滘溙溒溎溍溤溡溿溳滐滊溗溮溣煇煔煒煣煠煁煝煢煲煸煪煡煂煘煃煋煰煟煐煓"],["dea1","煄煍煚牏犍犌犑犐犎猼獂猻猺獀獊獉瑄瑊瑋瑒瑑瑗瑀瑏瑐瑎瑂瑆瑍瑔瓡瓿瓾瓽甝畹畷榃痯瘏瘃痷痾痼痹痸瘐痻痶痭痵痽皙皵盝睕睟睠睒睖睚睩睧睔睙睭矠碇碚碔碏碄碕碅碆碡碃硹碙碀碖硻祼禂祽祹稑稘稙稒稗稕稢稓"],["df40","稛稐窣窢窞竫筦筤筭筴筩筲筥筳筱筰筡筸筶筣粲粴粯綈綆綀綍絿綅絺綎絻綃絼綌綔綄絽綒罭罫罧罨罬羦羥羧翛翜耡腤腠腷腜腩腛腢腲朡腞腶腧腯"],["dfa1","腄腡舝艉艄艀艂艅蓱萿葖葶葹蒏蒍葥葑葀蒆葧萰葍葽葚葙葴葳葝蔇葞萷萺萴葺葃葸萲葅萩菙葋萯葂萭葟葰萹葎葌葒葯蓅蒎萻葇萶萳葨葾葄萫葠葔葮葐蜋蜄蛷蜌蛺蛖蛵蝍蛸蜎蜉蜁蛶蜍蜅裖裋裍裎裞裛裚裌裐覅覛觟觥觤"],["e040","觡觠觢觜触詶誆詿詡訿詷誂誄詵誃誁詴詺谼豋豊豥豤豦貆貄貅賌赨赩趑趌趎趏趍趓趔趐趒跰跠跬跱跮跐跩跣跢跧跲跫跴輆軿輁輀輅輇輈輂輋遒逿"],["e0a1","遄遉逽鄐鄍鄏鄑鄖鄔鄋鄎酮酯鉈鉒鈰鈺鉦鈳鉥鉞銃鈮鉊鉆鉭鉬鉏鉠鉧鉯鈶鉡鉰鈱鉔鉣鉐鉲鉎鉓鉌鉖鈲閟閜閞閛隒隓隑隗雎雺雽雸雵靳靷靸靲頏頍頎颬飶飹馯馲馰馵骭骫魛鳪鳭鳧麀黽僦僔僗僨僳僛僪僝僤僓僬僰僯僣僠"],["e140","凘劀劁勩勫匰厬嘧嘕嘌嘒嗼嘏嘜嘁嘓嘂嗺嘝嘄嗿嗹墉塼墐墘墆墁塿塴墋塺墇墑墎塶墂墈塻墔墏壾奫嫜嫮嫥嫕嫪嫚嫭嫫嫳嫢嫠嫛嫬嫞嫝嫙嫨嫟孷寠"],["e1a1","寣屣嶂嶀嵽嶆嵺嶁嵷嶊嶉嶈嵾嵼嶍嵹嵿幘幙幓廘廑廗廎廜廕廙廒廔彄彃彯徶愬愨慁慞慱慳慒慓慲慬憀慴慔慺慛慥愻慪慡慖戩戧戫搫摍摛摝摴摶摲摳摽摵摦撦摎撂摞摜摋摓摠摐摿搿摬摫摙摥摷敳斠暡暠暟朅朄朢榱榶槉"],["e240","榠槎榖榰榬榼榑榙榎榧榍榩榾榯榿槄榽榤槔榹槊榚槏榳榓榪榡榞槙榗榐槂榵榥槆歊歍歋殞殟殠毃毄毾滎滵滱漃漥滸漷滻漮漉潎漙漚漧漘漻漒滭漊"],["e2a1","漶潳滹滮漭潀漰漼漵滫漇漎潃漅滽滶漹漜滼漺漟漍漞漈漡熇熐熉熀熅熂熏煻熆熁熗牄牓犗犕犓獃獍獑獌瑢瑳瑱瑵瑲瑧瑮甀甂甃畽疐瘖瘈瘌瘕瘑瘊瘔皸瞁睼瞅瞂睮瞀睯睾瞃碲碪碴碭碨硾碫碞碥碠碬碢碤禘禊禋禖禕禔禓"],["e340","禗禈禒禐稫穊稰稯稨稦窨窫窬竮箈箜箊箑箐箖箍箌箛箎箅箘劄箙箤箂粻粿粼粺綧綷緂綣綪緁緀緅綝緎緄緆緋緌綯綹綖綼綟綦綮綩綡緉罳翢翣翥翞"],["e3a1","耤聝聜膉膆膃膇膍膌膋舕蒗蒤蒡蒟蒺蓎蓂蒬蒮蒫蒹蒴蓁蓍蒪蒚蒱蓐蒝蒧蒻蒢蒔蓇蓌蒛蒩蒯蒨蓖蒘蒶蓏蒠蓗蓔蓒蓛蒰蒑虡蜳蜣蜨蝫蝀蜮蜞蜡蜙蜛蝃蜬蝁蜾蝆蜠蜲蜪蜭蜼蜒蜺蜱蜵蝂蜦蜧蜸蜤蜚蜰蜑裷裧裱裲裺裾裮裼裶裻"],["e440","裰裬裫覝覡覟覞觩觫觨誫誙誋誒誏誖谽豨豩賕賏賗趖踉踂跿踍跽踊踃踇踆踅跾踀踄輐輑輎輍鄣鄜鄠鄢鄟鄝鄚鄤鄡鄛酺酲酹酳銥銤鉶銛鉺銠銔銪銍"],["e4a1","銦銚銫鉹銗鉿銣鋮銎銂銕銢鉽銈銡銊銆銌銙銧鉾銇銩銝銋鈭隞隡雿靘靽靺靾鞃鞀鞂靻鞄鞁靿韎韍頖颭颮餂餀餇馝馜駃馹馻馺駂馽駇骱髣髧鬾鬿魠魡魟鳱鳲鳵麧僿儃儰僸儆儇僶僾儋儌僽儊劋劌勱勯噈噂噌嘵噁噊噉噆噘"],["e540","噚噀嘳嘽嘬嘾嘸嘪嘺圚墫墝墱墠墣墯墬墥墡壿嫿嫴嫽嫷嫶嬃嫸嬂嫹嬁嬇嬅嬏屧嶙嶗嶟嶒嶢嶓嶕嶠嶜嶡嶚嶞幩幝幠幜緳廛廞廡彉徲憋憃慹憱憰憢憉"],["e5a1","憛憓憯憭憟憒憪憡憍慦憳戭摮摰撖撠撅撗撜撏撋撊撌撣撟摨撱撘敶敺敹敻斲斳暵暰暩暲暷暪暯樀樆樗槥槸樕槱槤樠槿槬槢樛樝槾樧槲槮樔槷槧橀樈槦槻樍槼槫樉樄樘樥樏槶樦樇槴樖歑殥殣殢殦氁氀毿氂潁漦潾澇濆澒"],["e640","澍澉澌潢潏澅潚澖潶潬澂潕潲潒潐潗澔澓潝漀潡潫潽潧澐潓澋潩潿澕潣潷潪潻熲熯熛熰熠熚熩熵熝熥熞熤熡熪熜熧熳犘犚獘獒獞獟獠獝獛獡獚獙"],["e6a1","獢璇璉璊璆璁瑽璅璈瑼瑹甈甇畾瘥瘞瘙瘝瘜瘣瘚瘨瘛皜皝皞皛瞍瞏瞉瞈磍碻磏磌磑磎磔磈磃磄磉禚禡禠禜禢禛歶稹窲窴窳箷篋箾箬篎箯箹篊箵糅糈糌糋緷緛緪緧緗緡縃緺緦緶緱緰緮緟罶羬羰羭翭翫翪翬翦翨聤聧膣膟"],["e740","膞膕膢膙膗舖艏艓艒艐艎艑蔤蔻蔏蔀蔩蔎蔉蔍蔟蔊蔧蔜蓻蔫蓺蔈蔌蓴蔪蓲蔕蓷蓫蓳蓼蔒蓪蓩蔖蓾蔨蔝蔮蔂蓽蔞蓶蔱蔦蓧蓨蓰蓯蓹蔘蔠蔰蔋蔙蔯虢"],["e7a1","蝖蝣蝤蝷蟡蝳蝘蝔蝛蝒蝡蝚蝑蝞蝭蝪蝐蝎蝟蝝蝯蝬蝺蝮蝜蝥蝏蝻蝵蝢蝧蝩衚褅褌褔褋褗褘褙褆褖褑褎褉覢覤覣觭觰觬諏諆誸諓諑諔諕誻諗誾諀諅諘諃誺誽諙谾豍貏賥賟賙賨賚賝賧趠趜趡趛踠踣踥踤踮踕踛踖踑踙踦踧"],["e840","踔踒踘踓踜踗踚輬輤輘輚輠輣輖輗遳遰遯遧遫鄯鄫鄩鄪鄲鄦鄮醅醆醊醁醂醄醀鋐鋃鋄鋀鋙銶鋏鋱鋟鋘鋩鋗鋝鋌鋯鋂鋨鋊鋈鋎鋦鋍鋕鋉鋠鋞鋧鋑鋓"],["e8a1","銵鋡鋆銴镼閬閫閮閰隤隢雓霅霈霂靚鞊鞎鞈韐韏頞頝頦頩頨頠頛頧颲餈飺餑餔餖餗餕駜駍駏駓駔駎駉駖駘駋駗駌骳髬髫髳髲髱魆魃魧魴魱魦魶魵魰魨魤魬鳼鳺鳽鳿鳷鴇鴀鳹鳻鴈鴅鴄麃黓鼏鼐儜儓儗儚儑凞匴叡噰噠噮"],["e940","噳噦噣噭噲噞噷圜圛壈墽壉墿墺壂墼壆嬗嬙嬛嬡嬔嬓嬐嬖嬨嬚嬠嬞寯嶬嶱嶩嶧嶵嶰嶮嶪嶨嶲嶭嶯嶴幧幨幦幯廩廧廦廨廥彋徼憝憨憖懅憴懆懁懌憺"],["e9a1","憿憸憌擗擖擐擏擉撽撉擃擛擳擙攳敿敼斢曈暾曀曊曋曏暽暻暺曌朣樴橦橉橧樲橨樾橝橭橶橛橑樨橚樻樿橁橪橤橐橏橔橯橩橠樼橞橖橕橍橎橆歕歔歖殧殪殫毈毇氄氃氆澭濋澣濇澼濎濈潞濄澽澞濊澨瀄澥澮澺澬澪濏澿澸"],["ea40","澢濉澫濍澯澲澰燅燂熿熸燖燀燁燋燔燊燇燏熽燘熼燆燚燛犝犞獩獦獧獬獥獫獪瑿璚璠璔璒璕璡甋疀瘯瘭瘱瘽瘳瘼瘵瘲瘰皻盦瞚瞝瞡瞜瞛瞢瞣瞕瞙"],["eaa1","瞗磝磩磥磪磞磣磛磡磢磭磟磠禤穄穈穇窶窸窵窱窷篞篣篧篝篕篥篚篨篹篔篪篢篜篫篘篟糒糔糗糐糑縒縡縗縌縟縠縓縎縜縕縚縢縋縏縖縍縔縥縤罃罻罼罺羱翯耪耩聬膱膦膮膹膵膫膰膬膴膲膷膧臲艕艖艗蕖蕅蕫蕍蕓蕡蕘"],["eb40","蕀蕆蕤蕁蕢蕄蕑蕇蕣蔾蕛蕱蕎蕮蕵蕕蕧蕠薌蕦蕝蕔蕥蕬虣虥虤螛螏螗螓螒螈螁螖螘蝹螇螣螅螐螑螝螄螔螜螚螉褞褦褰褭褮褧褱褢褩褣褯褬褟觱諠"],["eba1","諢諲諴諵諝謔諤諟諰諈諞諡諨諿諯諻貑貒貐賵賮賱賰賳赬赮趥趧踳踾踸蹀蹅踶踼踽蹁踰踿躽輶輮輵輲輹輷輴遶遹遻邆郺鄳鄵鄶醓醐醑醍醏錧錞錈錟錆錏鍺錸錼錛錣錒錁鍆錭錎錍鋋錝鋺錥錓鋹鋷錴錂錤鋿錩錹錵錪錔錌"],["ec40","錋鋾錉錀鋻錖閼闍閾閹閺閶閿閵閽隩雔霋霒霐鞙鞗鞔韰韸頵頯頲餤餟餧餩馞駮駬駥駤駰駣駪駩駧骹骿骴骻髶髺髹髷鬳鮀鮅鮇魼魾魻鮂鮓鮒鮐魺鮕"],["eca1","魽鮈鴥鴗鴠鴞鴔鴩鴝鴘鴢鴐鴙鴟麈麆麇麮麭黕黖黺鼒鼽儦儥儢儤儠儩勴嚓嚌嚍嚆嚄嚃噾嚂噿嚁壖壔壏壒嬭嬥嬲嬣嬬嬧嬦嬯嬮孻寱寲嶷幬幪徾徻懃憵憼懧懠懥懤懨懞擯擩擣擫擤擨斁斀斶旚曒檍檖檁檥檉檟檛檡檞檇檓檎"],["ed40","檕檃檨檤檑橿檦檚檅檌檒歛殭氉濌澩濴濔濣濜濭濧濦濞濲濝濢濨燡燱燨燲燤燰燢獳獮獯璗璲璫璐璪璭璱璥璯甐甑甒甏疄癃癈癉癇皤盩瞵瞫瞲瞷瞶"],["eda1","瞴瞱瞨矰磳磽礂磻磼磲礅磹磾礄禫禨穜穛穖穘穔穚窾竀竁簅簏篲簀篿篻簎篴簋篳簂簉簃簁篸篽簆篰篱簐簊糨縭縼繂縳顈縸縪繉繀繇縩繌縰縻縶繄縺罅罿罾罽翴翲耬膻臄臌臊臅臇膼臩艛艚艜薃薀薏薧薕薠薋薣蕻薤薚薞"],["ee40","蕷蕼薉薡蕺蕸蕗薎薖薆薍薙薝薁薢薂薈薅蕹蕶薘薐薟虨螾螪螭蟅螰螬螹螵螼螮蟉蟃蟂蟌螷螯蟄蟊螴螶螿螸螽蟞螲褵褳褼褾襁襒褷襂覭覯覮觲觳謞"],["eea1","謘謖謑謅謋謢謏謒謕謇謍謈謆謜謓謚豏豰豲豱豯貕貔賹赯蹎蹍蹓蹐蹌蹇轃轀邅遾鄸醚醢醛醙醟醡醝醠鎡鎃鎯鍤鍖鍇鍼鍘鍜鍶鍉鍐鍑鍠鍭鎏鍌鍪鍹鍗鍕鍒鍏鍱鍷鍻鍡鍞鍣鍧鎀鍎鍙闇闀闉闃闅閷隮隰隬霠霟霘霝霙鞚鞡鞜"],["ef40","鞞鞝韕韔韱顁顄顊顉顅顃餥餫餬餪餳餲餯餭餱餰馘馣馡騂駺駴駷駹駸駶駻駽駾駼騃骾髾髽鬁髼魈鮚鮨鮞鮛鮦鮡鮥鮤鮆鮢鮠鮯鴳鵁鵧鴶鴮鴯鴱鴸鴰"],["efa1","鵅鵂鵃鴾鴷鵀鴽翵鴭麊麉麍麰黈黚黻黿鼤鼣鼢齔龠儱儭儮嚘嚜嚗嚚嚝嚙奰嬼屩屪巀幭幮懘懟懭懮懱懪懰懫懖懩擿攄擽擸攁攃擼斔旛曚曛曘櫅檹檽櫡櫆檺檶檷櫇檴檭歞毉氋瀇瀌瀍瀁瀅瀔瀎濿瀀濻瀦濼濷瀊爁燿燹爃燽獶"],["f040","璸瓀璵瓁璾璶璻瓂甔甓癜癤癙癐癓癗癚皦皽盬矂瞺磿礌礓礔礉礐礒礑禭禬穟簜簩簙簠簟簭簝簦簨簢簥簰繜繐繖繣繘繢繟繑繠繗繓羵羳翷翸聵臑臒"],["f0a1","臐艟艞薴藆藀藃藂薳薵薽藇藄薿藋藎藈藅薱薶藒蘤薸薷薾虩蟧蟦蟢蟛蟫蟪蟥蟟蟳蟤蟔蟜蟓蟭蟘蟣螤蟗蟙蠁蟴蟨蟝襓襋襏襌襆襐襑襉謪謧謣謳謰謵譇謯謼謾謱謥謷謦謶謮謤謻謽謺豂豵貙貘貗賾贄贂贀蹜蹢蹠蹗蹖蹞蹥蹧"],["f140","蹛蹚蹡蹝蹩蹔轆轇轈轋鄨鄺鄻鄾醨醥醧醯醪鎵鎌鎒鎷鎛鎝鎉鎧鎎鎪鎞鎦鎕鎈鎙鎟鎍鎱鎑鎲鎤鎨鎴鎣鎥闒闓闑隳雗雚巂雟雘雝霣霢霥鞬鞮鞨鞫鞤鞪"],["f1a1","鞢鞥韗韙韖韘韺顐顑顒颸饁餼餺騏騋騉騍騄騑騊騅騇騆髀髜鬈鬄鬅鬩鬵魊魌魋鯇鯆鯃鮿鯁鮵鮸鯓鮶鯄鮹鮽鵜鵓鵏鵊鵛鵋鵙鵖鵌鵗鵒鵔鵟鵘鵚麎麌黟鼁鼀鼖鼥鼫鼪鼩鼨齌齕儴儵劖勷厴嚫嚭嚦嚧嚪嚬壚壝壛夒嬽嬾嬿巃幰"],["f240","徿懻攇攐攍攉攌攎斄旞旝曞櫧櫠櫌櫑櫙櫋櫟櫜櫐櫫櫏櫍櫞歠殰氌瀙瀧瀠瀖瀫瀡瀢瀣瀩瀗瀤瀜瀪爌爊爇爂爅犥犦犤犣犡瓋瓅璷瓃甖癠矉矊矄矱礝礛"],["f2a1","礡礜礗礞禰穧穨簳簼簹簬簻糬糪繶繵繸繰繷繯繺繲繴繨罋罊羃羆羷翽翾聸臗臕艤艡艣藫藱藭藙藡藨藚藗藬藲藸藘藟藣藜藑藰藦藯藞藢蠀蟺蠃蟶蟷蠉蠌蠋蠆蟼蠈蟿蠊蠂襢襚襛襗襡襜襘襝襙覈覷覶觶譐譈譊譀譓譖譔譋譕"],["f340","譑譂譒譗豃豷豶貚贆贇贉趬趪趭趫蹭蹸蹳蹪蹯蹻軂轒轑轏轐轓辴酀鄿醰醭鏞鏇鏏鏂鏚鏐鏹鏬鏌鏙鎩鏦鏊鏔鏮鏣鏕鏄鏎鏀鏒鏧镽闚闛雡霩霫霬霨霦"],["f3a1","鞳鞷鞶韝韞韟顜顙顝顗颿颽颻颾饈饇饃馦馧騚騕騥騝騤騛騢騠騧騣騞騜騔髂鬋鬊鬎鬌鬷鯪鯫鯠鯞鯤鯦鯢鯰鯔鯗鯬鯜鯙鯥鯕鯡鯚鵷鶁鶊鶄鶈鵱鶀鵸鶆鶋鶌鵽鵫鵴鵵鵰鵩鶅鵳鵻鶂鵯鵹鵿鶇鵨麔麑黀黼鼭齀齁齍齖齗齘匷嚲"],["f440","嚵嚳壣孅巆巇廮廯忀忁懹攗攖攕攓旟曨曣曤櫳櫰櫪櫨櫹櫱櫮櫯瀼瀵瀯瀷瀴瀱灂瀸瀿瀺瀹灀瀻瀳灁爓爔犨獽獼璺皫皪皾盭矌矎矏矍矲礥礣礧礨礤礩"],["f4a1","禲穮穬穭竷籉籈籊籇籅糮繻繾纁纀羺翿聹臛臙舋艨艩蘢藿蘁藾蘛蘀藶蘄蘉蘅蘌藽蠙蠐蠑蠗蠓蠖襣襦覹觷譠譪譝譨譣譥譧譭趮躆躈躄轙轖轗轕轘轚邍酃酁醷醵醲醳鐋鐓鏻鐠鐏鐔鏾鐕鐐鐨鐙鐍鏵鐀鏷鐇鐎鐖鐒鏺鐉鏸鐊鏿"],["f540","鏼鐌鏶鐑鐆闞闠闟霮霯鞹鞻韽韾顠顢顣顟飁飂饐饎饙饌饋饓騲騴騱騬騪騶騩騮騸騭髇髊髆鬐鬒鬑鰋鰈鯷鰅鰒鯸鱀鰇鰎鰆鰗鰔鰉鶟鶙鶤鶝鶒鶘鶐鶛"],["f5a1","鶠鶔鶜鶪鶗鶡鶚鶢鶨鶞鶣鶿鶩鶖鶦鶧麙麛麚黥黤黧黦鼰鼮齛齠齞齝齙龑儺儹劘劗囃嚽嚾孈孇巋巏廱懽攛欂櫼欃櫸欀灃灄灊灈灉灅灆爝爚爙獾甗癪矐礭礱礯籔籓糲纊纇纈纋纆纍罍羻耰臝蘘蘪蘦蘟蘣蘜蘙蘧蘮蘡蘠蘩蘞蘥"],["f640","蠩蠝蠛蠠蠤蠜蠫衊襭襩襮襫觺譹譸譅譺譻贐贔趯躎躌轞轛轝酆酄酅醹鐿鐻鐶鐩鐽鐼鐰鐹鐪鐷鐬鑀鐱闥闤闣霵霺鞿韡顤飉飆飀饘饖騹騽驆驄驂驁騺"],["f6a1","騿髍鬕鬗鬘鬖鬺魒鰫鰝鰜鰬鰣鰨鰩鰤鰡鶷鶶鶼鷁鷇鷊鷏鶾鷅鷃鶻鶵鷎鶹鶺鶬鷈鶱鶭鷌鶳鷍鶲鹺麜黫黮黭鼛鼘鼚鼱齎齥齤龒亹囆囅囋奱孋孌巕巑廲攡攠攦攢欋欈欉氍灕灖灗灒爞爟犩獿瓘瓕瓙瓗癭皭礵禴穰穱籗籜籙籛籚"],["f740","糴糱纑罏羇臞艫蘴蘵蘳蘬蘲蘶蠬蠨蠦蠪蠥襱覿覾觻譾讄讂讆讅譿贕躕躔躚躒躐躖躗轠轢酇鑌鑐鑊鑋鑏鑇鑅鑈鑉鑆霿韣顪顩飋饔饛驎驓驔驌驏驈驊"],["f7a1","驉驒驐髐鬙鬫鬻魖魕鱆鱈鰿鱄鰹鰳鱁鰼鰷鰴鰲鰽鰶鷛鷒鷞鷚鷋鷐鷜鷑鷟鷩鷙鷘鷖鷵鷕鷝麶黰鼵鼳鼲齂齫龕龢儽劙壨壧奲孍巘蠯彏戁戃戄攩攥斖曫欑欒欏毊灛灚爢玂玁玃癰矔籧籦纕艬蘺虀蘹蘼蘱蘻蘾蠰蠲蠮蠳襶襴襳觾"],["f840","讌讎讋讈豅贙躘轤轣醼鑢鑕鑝鑗鑞韄韅頀驖驙鬞鬟鬠鱒鱘鱐鱊鱍鱋鱕鱙鱌鱎鷻鷷鷯鷣鷫鷸鷤鷶鷡鷮鷦鷲鷰鷢鷬鷴鷳鷨鷭黂黐黲黳鼆鼜鼸鼷鼶齃齏"],["f8a1","齱齰齮齯囓囍孎屭攭曭曮欓灟灡灝灠爣瓛瓥矕礸禷禶籪纗羉艭虃蠸蠷蠵衋讔讕躞躟躠躝醾醽釂鑫鑨鑩雥靆靃靇韇韥驞髕魙鱣鱧鱦鱢鱞鱠鸂鷾鸇鸃鸆鸅鸀鸁鸉鷿鷽鸄麠鼞齆齴齵齶囔攮斸欘欙欗欚灢爦犪矘矙礹籩籫糶纚"],["f940","纘纛纙臠臡虆虇虈襹襺襼襻觿讘讙躥躤躣鑮鑭鑯鑱鑳靉顲饟鱨鱮鱭鸋鸍鸐鸏鸒鸑麡黵鼉齇齸齻齺齹圞灦籯蠼趲躦釃鑴鑸鑶鑵驠鱴鱳鱱鱵鸔鸓黶鼊"],["f9a1","龤灨灥糷虪蠾蠽蠿讞貜躩軉靋顳顴飌饡馫驤驦驧鬤鸕鸗齈戇欞爧虌躨钂钀钁驩驨鬮鸙爩虋讟钃鱹麷癵驫鱺鸝灩灪麤齾齉龘碁銹裏墻恒粧嫺╔╦╗╠╬╣╚╩╝╒╤╕╞╪╡╘╧╛╓╥╖╟╫╢╙╨╜║═╭╮╰╯▓"]]'); /***/ }), /***/ "./node_modules/encoding/node_modules/iconv-lite/encodings/tables/eucjp.json": /*!***********************************************************************************!*\ !*** ./node_modules/encoding/node_modules/iconv-lite/encodings/tables/eucjp.json ***! \***********************************************************************************/ /***/ ((module) => { "use strict"; module.exports = /*#__PURE__*/JSON.parse('[["0","\\u0000",127],["8ea1","。",62],["a1a1"," 、。,.・:;?!゛゜´`¨^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/\~∥|…‥‘’“”()〔〕[]{}〈",9,"+-±×÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇"],["a2a1","◆□■△▲▽▼※〒→←↑↓〓"],["a2ba","∈∋⊆⊇⊂⊃∪∩"],["a2ca","∧∨¬⇒⇔∀∃"],["a2dc","∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬"],["a2f2","ʼn♯♭♪†‡¶"],["a2fe","◯"],["a3b0","0",9],["a3c1","A",25],["a3e1","a",25],["a4a1","ぁ",82],["a5a1","ァ",85],["a6a1","Α",16,"Σ",6],["a6c1","α",16,"σ",6],["a7a1","А",5,"ЁЖ",25],["a7d1","а",5,"ёж",25],["a8a1","─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂"],["ada1","①",19,"Ⅰ",9],["adc0","㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡"],["addf","㍻〝〟№㏍℡㊤",4,"㈱㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪"],["b0a1","亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭"],["b1a1","院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応"],["b2a1","押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改"],["b3a1","魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱"],["b4a1","粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄"],["b5a1","機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京"],["b6a1","供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈"],["b7a1","掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲"],["b8a1","検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向"],["b9a1","后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿鋼閤降項香高鴻剛劫号合壕拷濠豪轟麹克刻告国穀酷鵠黒獄漉腰甑忽惚骨狛込"],["baa1","此頃今困坤墾婚恨懇昏昆根梱混痕紺艮魂些佐叉唆嵯左差査沙瑳砂詐鎖裟坐座挫債催再最哉塞妻宰彩才採栽歳済災采犀砕砦祭斎細菜裁載際剤在材罪財冴坂阪堺榊肴咲崎埼碕鷺作削咋搾昨朔柵窄策索錯桜鮭笹匙冊刷"],["bba1","察拶撮擦札殺薩雑皐鯖捌錆鮫皿晒三傘参山惨撒散桟燦珊産算纂蚕讃賛酸餐斬暫残仕仔伺使刺司史嗣四士始姉姿子屍市師志思指支孜斯施旨枝止死氏獅祉私糸紙紫肢脂至視詞詩試誌諮資賜雌飼歯事似侍児字寺慈持時"],["bca1","次滋治爾璽痔磁示而耳自蒔辞汐鹿式識鴫竺軸宍雫七叱執失嫉室悉湿漆疾質実蔀篠偲柴芝屡蕊縞舎写射捨赦斜煮社紗者謝車遮蛇邪借勺尺杓灼爵酌釈錫若寂弱惹主取守手朱殊狩珠種腫趣酒首儒受呪寿授樹綬需囚収周"],["bda1","宗就州修愁拾洲秀秋終繍習臭舟蒐衆襲讐蹴輯週酋酬集醜什住充十従戎柔汁渋獣縦重銃叔夙宿淑祝縮粛塾熟出術述俊峻春瞬竣舜駿准循旬楯殉淳準潤盾純巡遵醇順処初所暑曙渚庶緒署書薯藷諸助叙女序徐恕鋤除傷償"],["bea1","勝匠升召哨商唱嘗奨妾娼宵将小少尚庄床廠彰承抄招掌捷昇昌昭晶松梢樟樵沼消渉湘焼焦照症省硝礁祥称章笑粧紹肖菖蒋蕉衝裳訟証詔詳象賞醤鉦鍾鐘障鞘上丈丞乗冗剰城場壌嬢常情擾条杖浄状畳穣蒸譲醸錠嘱埴飾"],["bfa1","拭植殖燭織職色触食蝕辱尻伸信侵唇娠寝審心慎振新晋森榛浸深申疹真神秦紳臣芯薪親診身辛進針震人仁刃塵壬尋甚尽腎訊迅陣靭笥諏須酢図厨逗吹垂帥推水炊睡粋翠衰遂酔錐錘随瑞髄崇嵩数枢趨雛据杉椙菅頗雀裾"],["c0a1","澄摺寸世瀬畝是凄制勢姓征性成政整星晴棲栖正清牲生盛精聖声製西誠誓請逝醒青静斉税脆隻席惜戚斥昔析石積籍績脊責赤跡蹟碩切拙接摂折設窃節説雪絶舌蝉仙先千占宣専尖川戦扇撰栓栴泉浅洗染潜煎煽旋穿箭線"],["c1a1","繊羨腺舛船薦詮賎践選遷銭銑閃鮮前善漸然全禅繕膳糎噌塑岨措曾曽楚狙疏疎礎祖租粗素組蘇訴阻遡鼠僧創双叢倉喪壮奏爽宋層匝惣想捜掃挿掻操早曹巣槍槽漕燥争痩相窓糟総綜聡草荘葬蒼藻装走送遭鎗霜騒像増憎"],["c2a1","臓蔵贈造促側則即息捉束測足速俗属賊族続卒袖其揃存孫尊損村遜他多太汰詑唾堕妥惰打柁舵楕陀駄騨体堆対耐岱帯待怠態戴替泰滞胎腿苔袋貸退逮隊黛鯛代台大第醍題鷹滝瀧卓啄宅托択拓沢濯琢託鐸濁諾茸凧蛸只"],["c3a1","叩但達辰奪脱巽竪辿棚谷狸鱈樽誰丹単嘆坦担探旦歎淡湛炭短端箪綻耽胆蛋誕鍛団壇弾断暖檀段男談値知地弛恥智池痴稚置致蜘遅馳築畜竹筑蓄逐秩窒茶嫡着中仲宙忠抽昼柱注虫衷註酎鋳駐樗瀦猪苧著貯丁兆凋喋寵"],["c4a1","帖帳庁弔張彫徴懲挑暢朝潮牒町眺聴脹腸蝶調諜超跳銚長頂鳥勅捗直朕沈珍賃鎮陳津墜椎槌追鎚痛通塚栂掴槻佃漬柘辻蔦綴鍔椿潰坪壷嬬紬爪吊釣鶴亭低停偵剃貞呈堤定帝底庭廷弟悌抵挺提梯汀碇禎程締艇訂諦蹄逓"],["c5a1","邸鄭釘鼎泥摘擢敵滴的笛適鏑溺哲徹撤轍迭鉄典填天展店添纏甜貼転顛点伝殿澱田電兎吐堵塗妬屠徒斗杜渡登菟賭途都鍍砥砺努度土奴怒倒党冬凍刀唐塔塘套宕島嶋悼投搭東桃梼棟盗淘湯涛灯燈当痘祷等答筒糖統到"],["c6a1","董蕩藤討謄豆踏逃透鐙陶頭騰闘働動同堂導憧撞洞瞳童胴萄道銅峠鴇匿得徳涜特督禿篤毒独読栃橡凸突椴届鳶苫寅酉瀞噸屯惇敦沌豚遁頓呑曇鈍奈那内乍凪薙謎灘捺鍋楢馴縄畷南楠軟難汝二尼弐迩匂賑肉虹廿日乳入"],["c7a1","如尿韮任妊忍認濡禰祢寧葱猫熱年念捻撚燃粘乃廼之埜嚢悩濃納能脳膿農覗蚤巴把播覇杷波派琶破婆罵芭馬俳廃拝排敗杯盃牌背肺輩配倍培媒梅楳煤狽買売賠陪這蝿秤矧萩伯剥博拍柏泊白箔粕舶薄迫曝漠爆縛莫駁麦"],["c8a1","函箱硲箸肇筈櫨幡肌畑畠八鉢溌発醗髪伐罰抜筏閥鳩噺塙蛤隼伴判半反叛帆搬斑板氾汎版犯班畔繁般藩販範釆煩頒飯挽晩番盤磐蕃蛮匪卑否妃庇彼悲扉批披斐比泌疲皮碑秘緋罷肥被誹費避非飛樋簸備尾微枇毘琵眉美"],["c9a1","鼻柊稗匹疋髭彦膝菱肘弼必畢筆逼桧姫媛紐百謬俵彪標氷漂瓢票表評豹廟描病秒苗錨鋲蒜蛭鰭品彬斌浜瀕貧賓頻敏瓶不付埠夫婦富冨布府怖扶敷斧普浮父符腐膚芙譜負賦赴阜附侮撫武舞葡蕪部封楓風葺蕗伏副復幅服"],["caa1","福腹複覆淵弗払沸仏物鮒分吻噴墳憤扮焚奮粉糞紛雰文聞丙併兵塀幣平弊柄並蔽閉陛米頁僻壁癖碧別瞥蔑箆偏変片篇編辺返遍便勉娩弁鞭保舗鋪圃捕歩甫補輔穂募墓慕戊暮母簿菩倣俸包呆報奉宝峰峯崩庖抱捧放方朋"],["cba1","法泡烹砲縫胞芳萌蓬蜂褒訪豊邦鋒飽鳳鵬乏亡傍剖坊妨帽忘忙房暴望某棒冒紡肪膨謀貌貿鉾防吠頬北僕卜墨撲朴牧睦穆釦勃没殆堀幌奔本翻凡盆摩磨魔麻埋妹昧枚毎哩槙幕膜枕鮪柾鱒桝亦俣又抹末沫迄侭繭麿万慢満"],["cca1","漫蔓味未魅巳箕岬密蜜湊蓑稔脈妙粍民眠務夢無牟矛霧鵡椋婿娘冥名命明盟迷銘鳴姪牝滅免棉綿緬面麺摸模茂妄孟毛猛盲網耗蒙儲木黙目杢勿餅尤戻籾貰問悶紋門匁也冶夜爺耶野弥矢厄役約薬訳躍靖柳薮鑓愉愈油癒"],["cda1","諭輸唯佑優勇友宥幽悠憂揖有柚湧涌猶猷由祐裕誘遊邑郵雄融夕予余与誉輿預傭幼妖容庸揚揺擁曜楊様洋溶熔用窯羊耀葉蓉要謡踊遥陽養慾抑欲沃浴翌翼淀羅螺裸来莱頼雷洛絡落酪乱卵嵐欄濫藍蘭覧利吏履李梨理璃"],["cea1","痢裏裡里離陸律率立葎掠略劉流溜琉留硫粒隆竜龍侶慮旅虜了亮僚両凌寮料梁涼猟療瞭稜糧良諒遼量陵領力緑倫厘林淋燐琳臨輪隣鱗麟瑠塁涙累類令伶例冷励嶺怜玲礼苓鈴隷零霊麗齢暦歴列劣烈裂廉恋憐漣煉簾練聯"],["cfa1","蓮連錬呂魯櫓炉賂路露労婁廊弄朗楼榔浪漏牢狼篭老聾蝋郎六麓禄肋録論倭和話歪賄脇惑枠鷲亙亘鰐詫藁蕨椀湾碗腕"],["d0a1","弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗仞仭仟价伉佚估佛佝佗佇佶侈侏侘佻佩佰侑佯來侖儘俔俟俎俘俛俑俚俐俤俥倚倨倔倪倥倅伜俶倡倩倬俾俯們倆偃假會偕偐偈做偖偬偸傀傚傅傴傲"],["d1a1","僉僊傳僂僖僞僥僭僣僮價僵儉儁儂儖儕儔儚儡儺儷儼儻儿兀兒兌兔兢竸兩兪兮冀冂囘册冉冏冑冓冕冖冤冦冢冩冪冫决冱冲冰况冽凅凉凛几處凩凭凰凵凾刄刋刔刎刧刪刮刳刹剏剄剋剌剞剔剪剴剩剳剿剽劍劔劒剱劈劑辨"],["d2a1","辧劬劭劼劵勁勍勗勞勣勦飭勠勳勵勸勹匆匈甸匍匐匏匕匚匣匯匱匳匸區卆卅丗卉卍凖卞卩卮夘卻卷厂厖厠厦厥厮厰厶參簒雙叟曼燮叮叨叭叺吁吽呀听吭吼吮吶吩吝呎咏呵咎呟呱呷呰咒呻咀呶咄咐咆哇咢咸咥咬哄哈咨"],["d3a1","咫哂咤咾咼哘哥哦唏唔哽哮哭哺哢唹啀啣啌售啜啅啖啗唸唳啝喙喀咯喊喟啻啾喘喞單啼喃喩喇喨嗚嗅嗟嗄嗜嗤嗔嘔嗷嘖嗾嗽嘛嗹噎噐營嘴嘶嘲嘸噫噤嘯噬噪嚆嚀嚊嚠嚔嚏嚥嚮嚶嚴囂嚼囁囃囀囈囎囑囓囗囮囹圀囿圄圉"],["d4a1","圈國圍圓團圖嗇圜圦圷圸坎圻址坏坩埀垈坡坿垉垓垠垳垤垪垰埃埆埔埒埓堊埖埣堋堙堝塲堡塢塋塰毀塒堽塹墅墹墟墫墺壞墻墸墮壅壓壑壗壙壘壥壜壤壟壯壺壹壻壼壽夂夊夐夛梦夥夬夭夲夸夾竒奕奐奎奚奘奢奠奧奬奩"],["d5a1","奸妁妝佞侫妣妲姆姨姜妍姙姚娥娟娑娜娉娚婀婬婉娵娶婢婪媚媼媾嫋嫂媽嫣嫗嫦嫩嫖嫺嫻嬌嬋嬖嬲嫐嬪嬶嬾孃孅孀孑孕孚孛孥孩孰孳孵學斈孺宀它宦宸寃寇寉寔寐寤實寢寞寥寫寰寶寳尅將專對尓尠尢尨尸尹屁屆屎屓"],["d6a1","屐屏孱屬屮乢屶屹岌岑岔妛岫岻岶岼岷峅岾峇峙峩峽峺峭嶌峪崋崕崗嵜崟崛崑崔崢崚崙崘嵌嵒嵎嵋嵬嵳嵶嶇嶄嶂嶢嶝嶬嶮嶽嶐嶷嶼巉巍巓巒巖巛巫已巵帋帚帙帑帛帶帷幄幃幀幎幗幔幟幢幤幇幵并幺麼广庠廁廂廈廐廏"],["d7a1","廖廣廝廚廛廢廡廨廩廬廱廳廰廴廸廾弃弉彝彜弋弑弖弩弭弸彁彈彌彎弯彑彖彗彙彡彭彳彷徃徂彿徊很徑徇從徙徘徠徨徭徼忖忻忤忸忱忝悳忿怡恠怙怐怩怎怱怛怕怫怦怏怺恚恁恪恷恟恊恆恍恣恃恤恂恬恫恙悁悍惧悃悚"],["d8a1","悄悛悖悗悒悧悋惡悸惠惓悴忰悽惆悵惘慍愕愆惶惷愀惴惺愃愡惻惱愍愎慇愾愨愧慊愿愼愬愴愽慂慄慳慷慘慙慚慫慴慯慥慱慟慝慓慵憙憖憇憬憔憚憊憑憫憮懌懊應懷懈懃懆憺懋罹懍懦懣懶懺懴懿懽懼懾戀戈戉戍戌戔戛"],["d9a1","戞戡截戮戰戲戳扁扎扞扣扛扠扨扼抂抉找抒抓抖拔抃抔拗拑抻拏拿拆擔拈拜拌拊拂拇抛拉挌拮拱挧挂挈拯拵捐挾捍搜捏掖掎掀掫捶掣掏掉掟掵捫捩掾揩揀揆揣揉插揶揄搖搴搆搓搦搶攝搗搨搏摧摯摶摎攪撕撓撥撩撈撼"],["daa1","據擒擅擇撻擘擂擱擧舉擠擡抬擣擯攬擶擴擲擺攀擽攘攜攅攤攣攫攴攵攷收攸畋效敖敕敍敘敞敝敲數斂斃變斛斟斫斷旃旆旁旄旌旒旛旙无旡旱杲昊昃旻杳昵昶昴昜晏晄晉晁晞晝晤晧晨晟晢晰暃暈暎暉暄暘暝曁暹曉暾暼"],["dba1","曄暸曖曚曠昿曦曩曰曵曷朏朖朞朦朧霸朮朿朶杁朸朷杆杞杠杙杣杤枉杰枩杼杪枌枋枦枡枅枷柯枴柬枳柩枸柤柞柝柢柮枹柎柆柧檜栞框栩桀桍栲桎梳栫桙档桷桿梟梏梭梔條梛梃檮梹桴梵梠梺椏梍桾椁棊椈棘椢椦棡椌棍"],["dca1","棔棧棕椶椒椄棗棣椥棹棠棯椨椪椚椣椡棆楹楷楜楸楫楔楾楮椹楴椽楙椰楡楞楝榁楪榲榮槐榿槁槓榾槎寨槊槝榻槃榧樮榑榠榜榕榴槞槨樂樛槿權槹槲槧樅榱樞槭樔槫樊樒櫁樣樓橄樌橲樶橸橇橢橙橦橈樸樢檐檍檠檄檢檣"],["dda1","檗蘗檻櫃櫂檸檳檬櫞櫑櫟檪櫚櫪櫻欅蘖櫺欒欖鬱欟欸欷盜欹飮歇歃歉歐歙歔歛歟歡歸歹歿殀殄殃殍殘殕殞殤殪殫殯殲殱殳殷殼毆毋毓毟毬毫毳毯麾氈氓气氛氤氣汞汕汢汪沂沍沚沁沛汾汨汳沒沐泄泱泓沽泗泅泝沮沱沾"],["dea1","沺泛泯泙泪洟衍洶洫洽洸洙洵洳洒洌浣涓浤浚浹浙涎涕濤涅淹渕渊涵淇淦涸淆淬淞淌淨淒淅淺淙淤淕淪淮渭湮渮渙湲湟渾渣湫渫湶湍渟湃渺湎渤滿渝游溂溪溘滉溷滓溽溯滄溲滔滕溏溥滂溟潁漑灌滬滸滾漿滲漱滯漲滌"],["dfa1","漾漓滷澆潺潸澁澀潯潛濳潭澂潼潘澎澑濂潦澳澣澡澤澹濆澪濟濕濬濔濘濱濮濛瀉瀋濺瀑瀁瀏濾瀛瀚潴瀝瀘瀟瀰瀾瀲灑灣炙炒炯烱炬炸炳炮烟烋烝烙焉烽焜焙煥煕熈煦煢煌煖煬熏燻熄熕熨熬燗熹熾燒燉燔燎燠燬燧燵燼"],["e0a1","燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘牴牾犂犁犇犒犖犢犧犹犲狃狆狄狎狒狢狠狡狹狷倏猗猊猜猖猝猴猯猩猥猾獎獏默獗獪獨獰獸獵獻獺珈玳珎玻珀珥珮珞璢琅瑯琥珸琲琺瑕琿瑟瑙瑁瑜瑩瑰瑣瑪瑶瑾璋璞璧瓊瓏瓔珱"],["e1a1","瓠瓣瓧瓩瓮瓲瓰瓱瓸瓷甄甃甅甌甎甍甕甓甞甦甬甼畄畍畊畉畛畆畚畩畤畧畫畭畸當疆疇畴疊疉疂疔疚疝疥疣痂疳痃疵疽疸疼疱痍痊痒痙痣痞痾痿痼瘁痰痺痲痳瘋瘍瘉瘟瘧瘠瘡瘢瘤瘴瘰瘻癇癈癆癜癘癡癢癨癩癪癧癬癰"],["e2a1","癲癶癸發皀皃皈皋皎皖皓皙皚皰皴皸皹皺盂盍盖盒盞盡盥盧盪蘯盻眈眇眄眩眤眞眥眦眛眷眸睇睚睨睫睛睥睿睾睹瞎瞋瞑瞠瞞瞰瞶瞹瞿瞼瞽瞻矇矍矗矚矜矣矮矼砌砒礦砠礪硅碎硴碆硼碚碌碣碵碪碯磑磆磋磔碾碼磅磊磬"],["e3a1","磧磚磽磴礇礒礑礙礬礫祀祠祗祟祚祕祓祺祿禊禝禧齋禪禮禳禹禺秉秕秧秬秡秣稈稍稘稙稠稟禀稱稻稾稷穃穗穉穡穢穩龝穰穹穽窈窗窕窘窖窩竈窰窶竅竄窿邃竇竊竍竏竕竓站竚竝竡竢竦竭竰笂笏笊笆笳笘笙笞笵笨笶筐"],["e4a1","筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟箍箜箚箋箒箏筝箙篋篁篌篏箴篆篝篩簑簔篦篥籠簀簇簓篳篷簗簍篶簣簧簪簟簷簫簽籌籃籔籏籀籐籘籟籤籖籥籬籵粃粐粤粭粢粫粡粨粳粲粱粮粹粽糀糅糂糘糒糜糢鬻糯糲糴糶糺紆"],["e5a1","紂紜紕紊絅絋紮紲紿紵絆絳絖絎絲絨絮絏絣經綉絛綏絽綛綺綮綣綵緇綽綫總綢綯緜綸綟綰緘緝緤緞緻緲緡縅縊縣縡縒縱縟縉縋縢繆繦縻縵縹繃縷縲縺繧繝繖繞繙繚繹繪繩繼繻纃緕繽辮繿纈纉續纒纐纓纔纖纎纛纜缸缺"],["e6a1","罅罌罍罎罐网罕罔罘罟罠罨罩罧罸羂羆羃羈羇羌羔羞羝羚羣羯羲羹羮羶羸譱翅翆翊翕翔翡翦翩翳翹飜耆耄耋耒耘耙耜耡耨耿耻聊聆聒聘聚聟聢聨聳聲聰聶聹聽聿肄肆肅肛肓肚肭冐肬胛胥胙胝胄胚胖脉胯胱脛脩脣脯腋"],["e7a1","隋腆脾腓腑胼腱腮腥腦腴膃膈膊膀膂膠膕膤膣腟膓膩膰膵膾膸膽臀臂膺臉臍臑臙臘臈臚臟臠臧臺臻臾舁舂舅與舊舍舐舖舩舫舸舳艀艙艘艝艚艟艤艢艨艪艫舮艱艷艸艾芍芒芫芟芻芬苡苣苟苒苴苳苺莓范苻苹苞茆苜茉苙"],["e8a1","茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟莢莖茣莎莇莊荼莵荳荵莠莉莨菴萓菫菎菽萃菘萋菁菷萇菠菲萍萢萠莽萸蔆菻葭萪萼蕚蒄葷葫蒭葮蒂葩葆萬葯葹萵蓊葢蒹蒿蒟蓙蓍蒻蓚蓐蓁蓆蓖蒡蔡蓿蓴蔗蔘蔬蔟蔕蔔蓼蕀蕣蕘蕈"],["e9a1","蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛藪薇薜蕷蕾薐藉薺藏薹藐藕藝藥藜藹蘊蘓蘋藾藺蘆蘢蘚蘰蘿虍乕虔號虧虱蚓蚣蚩蚪蚋蚌蚶蚯蛄蛆蚰蛉蠣蚫蛔蛞蛩蛬蛟蛛蛯蜒蜆蜈蜀蜃蛻蜑蜉蜍蛹蜊蜴蜿蜷蜻蜥蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙"],["eaa1","蝓蝣蝪蠅螢螟螂螯蟋螽蟀蟐雖螫蟄螳蟇蟆螻蟯蟲蟠蠏蠍蟾蟶蟷蠎蟒蠑蠖蠕蠢蠡蠱蠶蠹蠧蠻衄衂衒衙衞衢衫袁衾袞衵衽袵衲袂袗袒袮袙袢袍袤袰袿袱裃裄裔裘裙裝裹褂裼裴裨裲褄褌褊褓襃褞褥褪褫襁襄褻褶褸襌褝襠襞"],["eba1","襦襤襭襪襯襴襷襾覃覈覊覓覘覡覩覦覬覯覲覺覽覿觀觚觜觝觧觴觸訃訖訐訌訛訝訥訶詁詛詒詆詈詼詭詬詢誅誂誄誨誡誑誥誦誚誣諄諍諂諚諫諳諧諤諱謔諠諢諷諞諛謌謇謚諡謖謐謗謠謳鞫謦謫謾謨譁譌譏譎證譖譛譚譫"],["eca1","譟譬譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈豌豎豐豕豢豬豸豺貂貉貅貊貍貎貔豼貘戝貭貪貽貲貳貮貶賈賁賤賣賚賽賺賻贄贅贊贇贏贍贐齎贓賍贔贖赧赭赱赳趁趙跂趾趺跏跚跖跌跛跋跪跫跟跣跼踈踉跿踝踞踐踟蹂踵踰踴蹊"],["eda1","蹇蹉蹌蹐蹈蹙蹤蹠踪蹣蹕蹶蹲蹼躁躇躅躄躋躊躓躑躔躙躪躡躬躰軆躱躾軅軈軋軛軣軼軻軫軾輊輅輕輒輙輓輜輟輛輌輦輳輻輹轅轂輾轌轉轆轎轗轜轢轣轤辜辟辣辭辯辷迚迥迢迪迯邇迴逅迹迺逑逕逡逍逞逖逋逧逶逵逹迸"],["eea1","遏遐遑遒逎遉逾遖遘遞遨遯遶隨遲邂遽邁邀邊邉邏邨邯邱邵郢郤扈郛鄂鄒鄙鄲鄰酊酖酘酣酥酩酳酲醋醉醂醢醫醯醪醵醴醺釀釁釉釋釐釖釟釡釛釼釵釶鈞釿鈔鈬鈕鈑鉞鉗鉅鉉鉤鉈銕鈿鉋鉐銜銖銓銛鉚鋏銹銷鋩錏鋺鍄錮"],["efa1","錙錢錚錣錺錵錻鍜鍠鍼鍮鍖鎰鎬鎭鎔鎹鏖鏗鏨鏥鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐鐶鐫鐵鐡鐺鑁鑒鑄鑛鑠鑢鑞鑪鈩鑰鑵鑷鑽鑚鑼鑾钁鑿閂閇閊閔閖閘閙閠閨閧閭閼閻閹閾闊濶闃闍闌闕闔闖關闡闥闢阡阨阮阯陂陌陏陋陷陜陞"],["f0a1","陝陟陦陲陬隍隘隕隗險隧隱隲隰隴隶隸隹雎雋雉雍襍雜霍雕雹霄霆霈霓霎霑霏霖霙霤霪霰霹霽霾靄靆靈靂靉靜靠靤靦靨勒靫靱靹鞅靼鞁靺鞆鞋鞏鞐鞜鞨鞦鞣鞳鞴韃韆韈韋韜韭齏韲竟韶韵頏頌頸頤頡頷頽顆顏顋顫顯顰"],["f1a1","顱顴顳颪颯颱颶飄飃飆飩飫餃餉餒餔餘餡餝餞餤餠餬餮餽餾饂饉饅饐饋饑饒饌饕馗馘馥馭馮馼駟駛駝駘駑駭駮駱駲駻駸騁騏騅駢騙騫騷驅驂驀驃騾驕驍驛驗驟驢驥驤驩驫驪骭骰骼髀髏髑髓體髞髟髢髣髦髯髫髮髴髱髷"],["f2a1","髻鬆鬘鬚鬟鬢鬣鬥鬧鬨鬩鬪鬮鬯鬲魄魃魏魍魎魑魘魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸鳧鳬鳰鴉鴈鳫鴃鴆鴪鴦鶯鴣鴟鵄鴕鴒鵁鴿鴾鵆鵈"],["f3a1","鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻鶸鶺鷆鷏鷂鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽麁麈麋麌麒麕麑麝麥麩麸麪麭靡黌黎黏黐黔黜點黝黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠"],["f4a1","堯槇遙瑤凜熙"],["f9a1","纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德"],["faa1","忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱"],["fba1","犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚"],["fca1","釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"],["fcf1","ⅰ",9,"¬¦'""],["8fa2af","˘ˇ¸˙˝¯˛˚~΄΅"],["8fa2c2","¡¦¿"],["8fa2eb","ºª©®™¤№"],["8fa6e1","ΆΈΉΊΪ"],["8fa6e7","Ό"],["8fa6e9","ΎΫ"],["8fa6ec","Ώ"],["8fa6f1","άέήίϊΐόςύϋΰώ"],["8fa7c2","Ђ",10,"ЎЏ"],["8fa7f2","ђ",10,"ўџ"],["8fa9a1","ÆĐ"],["8fa9a4","Ħ"],["8fa9a6","IJ"],["8fa9a8","ŁĿ"],["8fa9ab","ŊØŒ"],["8fa9af","ŦÞ"],["8fa9c1","æđðħıijĸłŀʼnŋøœßŧþ"],["8faaa1","ÁÀÄÂĂǍĀĄÅÃĆĈČÇĊĎÉÈËÊĚĖĒĘ"],["8faaba","ĜĞĢĠĤÍÌÏÎǏİĪĮĨĴĶĹĽĻŃŇŅÑÓÒÖÔǑŐŌÕŔŘŖŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙǕŴÝŸŶŹŽŻ"],["8faba1","áàäâăǎāąåãćĉčçċďéèëêěėēęǵĝğ"],["8fabbd","ġĥíìïîǐ"],["8fabc5","īįĩĵķĺľļńňņñóòöôǒőōõŕřŗśŝšşťţúùüûŭǔűūųůũǘǜǚǖŵýÿŷźžż"],["8fb0a1","丂丄丅丌丒丟丣两丨丫丮丯丰丵乀乁乄乇乑乚乜乣乨乩乴乵乹乿亍亖亗亝亯亹仃仐仚仛仠仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘佟佣佪佬佮佱佷佸佹佺佽佾侁侂侄"],["8fb1a1","侅侉侊侌侎侐侒侓侔侗侙侚侞侟侲侷侹侻侼侽侾俀俁俅俆俈俉俋俌俍俏俒俜俠俢俰俲俼俽俿倀倁倄倇倊倌倎倐倓倗倘倛倜倝倞倢倧倮倰倲倳倵偀偁偂偅偆偊偌偎偑偒偓偗偙偟偠偢偣偦偧偪偭偰偱倻傁傃傄傆傊傎傏傐"],["8fb2a1","傒傓傔傖傛傜傞",4,"傪傯傰傹傺傽僀僃僄僇僌僎僐僓僔僘僜僝僟僢僤僦僨僩僯僱僶僺僾儃儆儇儈儋儌儍儎僲儐儗儙儛儜儝儞儣儧儨儬儭儯儱儳儴儵儸儹兂兊兏兓兕兗兘兟兤兦兾冃冄冋冎冘冝冡冣冭冸冺冼冾冿凂"],["8fb3a1","凈减凑凒凓凕凘凞凢凥凮凲凳凴凷刁刂刅划刓刕刖刘刢刨刱刲刵刼剅剉剕剗剘剚剜剟剠剡剦剮剷剸剹劀劂劅劊劌劓劕劖劗劘劚劜劤劥劦劧劯劰劶劷劸劺劻劽勀勄勆勈勌勏勑勔勖勛勜勡勥勨勩勪勬勰勱勴勶勷匀匃匊匋"],["8fb4a1","匌匑匓匘匛匜匞匟匥匧匨匩匫匬匭匰匲匵匼匽匾卂卌卋卙卛卡卣卥卬卭卲卹卾厃厇厈厎厓厔厙厝厡厤厪厫厯厲厴厵厷厸厺厽叀叅叏叒叓叕叚叝叞叠另叧叵吂吓吚吡吧吨吪启吱吴吵呃呄呇呍呏呞呢呤呦呧呩呫呭呮呴呿"],["8fb5a1","咁咃咅咈咉咍咑咕咖咜咟咡咦咧咩咪咭咮咱咷咹咺咻咿哆哊响哎哠哪哬哯哶哼哾哿唀唁唅唈唉唌唍唎唕唪唫唲唵唶唻唼唽啁啇啉啊啍啐啑啘啚啛啞啠啡啤啦啿喁喂喆喈喎喏喑喒喓喔喗喣喤喭喲喿嗁嗃嗆嗉嗋嗌嗎嗑嗒"],["8fb6a1","嗓嗗嗘嗛嗞嗢嗩嗶嗿嘅嘈嘊嘍",5,"嘙嘬嘰嘳嘵嘷嘹嘻嘼嘽嘿噀噁噃噄噆噉噋噍噏噔噞噠噡噢噣噦噩噭噯噱噲噵嚄嚅嚈嚋嚌嚕嚙嚚嚝嚞嚟嚦嚧嚨嚩嚫嚬嚭嚱嚳嚷嚾囅囉囊囋囏囐囌囍囙囜囝囟囡囤",4,"囱囫园"],["8fb7a1","囶囷圁圂圇圊圌圑圕圚圛圝圠圢圣圤圥圩圪圬圮圯圳圴圽圾圿坅坆坌坍坒坢坥坧坨坫坭",4,"坳坴坵坷坹坺坻坼坾垁垃垌垔垗垙垚垜垝垞垟垡垕垧垨垩垬垸垽埇埈埌埏埕埝埞埤埦埧埩埭埰埵埶埸埽埾埿堃堄堈堉埡"],["8fb8a1","堌堍堛堞堟堠堦堧堭堲堹堿塉塌塍塏塐塕塟塡塤塧塨塸塼塿墀墁墇墈墉墊墌墍墏墐墔墖墝墠墡墢墦墩墱墲壄墼壂壈壍壎壐壒壔壖壚壝壡壢壩壳夅夆夋夌夒夓夔虁夝夡夣夤夨夯夰夳夵夶夿奃奆奒奓奙奛奝奞奟奡奣奫奭"],["8fb9a1","奯奲奵奶她奻奼妋妌妎妒妕妗妟妤妧妭妮妯妰妳妷妺妼姁姃姄姈姊姍姒姝姞姟姣姤姧姮姯姱姲姴姷娀娄娌娍娎娒娓娞娣娤娧娨娪娭娰婄婅婇婈婌婐婕婞婣婥婧婭婷婺婻婾媋媐媓媖媙媜媞媟媠媢媧媬媱媲媳媵媸媺媻媿"],["8fbaa1","嫄嫆嫈嫏嫚嫜嫠嫥嫪嫮嫵嫶嫽嬀嬁嬈嬗嬴嬙嬛嬝嬡嬥嬭嬸孁孋孌孒孖孞孨孮孯孼孽孾孿宁宄宆宊宎宐宑宓宔宖宨宩宬宭宯宱宲宷宺宼寀寁寍寏寖",4,"寠寯寱寴寽尌尗尞尟尣尦尩尫尬尮尰尲尵尶屙屚屜屢屣屧屨屩"],["8fbba1","屭屰屴屵屺屻屼屽岇岈岊岏岒岝岟岠岢岣岦岪岲岴岵岺峉峋峒峝峗峮峱峲峴崁崆崍崒崫崣崤崦崧崱崴崹崽崿嵂嵃嵆嵈嵕嵑嵙嵊嵟嵠嵡嵢嵤嵪嵭嵰嵹嵺嵾嵿嶁嶃嶈嶊嶒嶓嶔嶕嶙嶛嶟嶠嶧嶫嶰嶴嶸嶹巃巇巋巐巎巘巙巠巤"],["8fbca1","巩巸巹帀帇帍帒帔帕帘帟帠帮帨帲帵帾幋幐幉幑幖幘幛幜幞幨幪",4,"幰庀庋庎庢庤庥庨庪庬庱庳庽庾庿廆廌廋廎廑廒廔廕廜廞廥廫异弆弇弈弎弙弜弝弡弢弣弤弨弫弬弮弰弴弶弻弽弿彀彄彅彇彍彐彔彘彛彠彣彤彧"],["8fbda1","彯彲彴彵彸彺彽彾徉徍徏徖徜徝徢徧徫徤徬徯徰徱徸忄忇忈忉忋忐",4,"忞忡忢忨忩忪忬忭忮忯忲忳忶忺忼怇怊怍怓怔怗怘怚怟怤怭怳怵恀恇恈恉恌恑恔恖恗恝恡恧恱恾恿悂悆悈悊悎悑悓悕悘悝悞悢悤悥您悰悱悷"],["8fbea1","悻悾惂惄惈惉惊惋惎惏惔惕惙惛惝惞惢惥惲惵惸惼惽愂愇愊愌愐",4,"愖愗愙愜愞愢愪愫愰愱愵愶愷愹慁慅慆慉慞慠慬慲慸慻慼慿憀憁憃憄憋憍憒憓憗憘憜憝憟憠憥憨憪憭憸憹憼懀懁懂懎懏懕懜懝懞懟懡懢懧懩懥"],["8fbfa1","懬懭懯戁戃戄戇戓戕戜戠戢戣戧戩戫戹戽扂扃扄扆扌扐扑扒扔扖扚扜扤扭扯扳扺扽抍抎抏抐抦抨抳抶抷抺抾抿拄拎拕拖拚拪拲拴拼拽挃挄挊挋挍挐挓挖挘挩挪挭挵挶挹挼捁捂捃捄捆捊捋捎捒捓捔捘捛捥捦捬捭捱捴捵"],["8fc0a1","捸捼捽捿掂掄掇掊掐掔掕掙掚掞掤掦掭掮掯掽揁揅揈揎揑揓揔揕揜揠揥揪揬揲揳揵揸揹搉搊搐搒搔搘搞搠搢搤搥搩搪搯搰搵搽搿摋摏摑摒摓摔摚摛摜摝摟摠摡摣摭摳摴摻摽撅撇撏撐撑撘撙撛撝撟撡撣撦撨撬撳撽撾撿"],["8fc1a1","擄擉擊擋擌擎擐擑擕擗擤擥擩擪擭擰擵擷擻擿攁攄攈攉攊攏攓攔攖攙攛攞攟攢攦攩攮攱攺攼攽敃敇敉敐敒敔敟敠敧敫敺敽斁斅斊斒斕斘斝斠斣斦斮斲斳斴斿旂旈旉旎旐旔旖旘旟旰旲旴旵旹旾旿昀昄昈昉昍昑昒昕昖昝"],["8fc2a1","昞昡昢昣昤昦昩昪昫昬昮昰昱昳昹昷晀晅晆晊晌晑晎晗晘晙晛晜晠晡曻晪晫晬晾晳晵晿晷晸晹晻暀晼暋暌暍暐暒暙暚暛暜暟暠暤暭暱暲暵暻暿曀曂曃曈曌曎曏曔曛曟曨曫曬曮曺朅朇朎朓朙朜朠朢朳朾杅杇杈杌杔杕杝"],["8fc3a1","杦杬杮杴杶杻极构枎枏枑枓枖枘枙枛枰枱枲枵枻枼枽柹柀柂柃柅柈柉柒柗柙柜柡柦柰柲柶柷桒栔栙栝栟栨栧栬栭栯栰栱栳栻栿桄桅桊桌桕桗桘桛桫桮",4,"桵桹桺桻桼梂梄梆梈梖梘梚梜梡梣梥梩梪梮梲梻棅棈棌棏"],["8fc4a1","棐棑棓棖棙棜棝棥棨棪棫棬棭棰棱棵棶棻棼棽椆椉椊椐椑椓椖椗椱椳椵椸椻楂楅楉楎楗楛楣楤楥楦楨楩楬楰楱楲楺楻楿榀榍榒榖榘榡榥榦榨榫榭榯榷榸榺榼槅槈槑槖槗槢槥槮槯槱槳槵槾樀樁樃樏樑樕樚樝樠樤樨樰樲"],["8fc5a1","樴樷樻樾樿橅橆橉橊橎橐橑橒橕橖橛橤橧橪橱橳橾檁檃檆檇檉檋檑檛檝檞檟檥檫檯檰檱檴檽檾檿櫆櫉櫈櫌櫐櫔櫕櫖櫜櫝櫤櫧櫬櫰櫱櫲櫼櫽欂欃欆欇欉欏欐欑欗欛欞欤欨欫欬欯欵欶欻欿歆歊歍歒歖歘歝歠歧歫歮歰歵歽"],["8fc6a1","歾殂殅殗殛殟殠殢殣殨殩殬殭殮殰殸殹殽殾毃毄毉毌毖毚毡毣毦毧毮毱毷毹毿氂氄氅氉氍氎氐氒氙氟氦氧氨氬氮氳氵氶氺氻氿汊汋汍汏汒汔汙汛汜汫汭汯汴汶汸汹汻沅沆沇沉沔沕沗沘沜沟沰沲沴泂泆泍泏泐泑泒泔泖"],["8fc7a1","泚泜泠泧泩泫泬泮泲泴洄洇洊洎洏洑洓洚洦洧洨汧洮洯洱洹洼洿浗浞浟浡浥浧浯浰浼涂涇涑涒涔涖涗涘涪涬涴涷涹涽涿淄淈淊淎淏淖淛淝淟淠淢淥淩淯淰淴淶淼渀渄渞渢渧渲渶渹渻渼湄湅湈湉湋湏湑湒湓湔湗湜湝湞"],["8fc8a1","湢湣湨湳湻湽溍溓溙溠溧溭溮溱溳溻溿滀滁滃滇滈滊滍滎滏滫滭滮滹滻滽漄漈漊漌漍漖漘漚漛漦漩漪漯漰漳漶漻漼漭潏潑潒潓潗潙潚潝潞潡潢潨潬潽潾澃澇澈澋澌澍澐澒澓澔澖澚澟澠澥澦澧澨澮澯澰澵澶澼濅濇濈濊"],["8fc9a1","濚濞濨濩濰濵濹濼濽瀀瀅瀆瀇瀍瀗瀠瀣瀯瀴瀷瀹瀼灃灄灈灉灊灋灔灕灝灞灎灤灥灬灮灵灶灾炁炅炆炔",4,"炛炤炫炰炱炴炷烊烑烓烔烕烖烘烜烤烺焃",4,"焋焌焏焞焠焫焭焯焰焱焸煁煅煆煇煊煋煐煒煗煚煜煞煠"],["8fcaa1","煨煹熀熅熇熌熒熚熛熠熢熯熰熲熳熺熿燀燁燄燋燌燓燖燙燚燜燸燾爀爇爈爉爓爗爚爝爟爤爫爯爴爸爹牁牂牃牅牎牏牐牓牕牖牚牜牞牠牣牨牫牮牯牱牷牸牻牼牿犄犉犍犎犓犛犨犭犮犱犴犾狁狇狉狌狕狖狘狟狥狳狴狺狻"],["8fcba1","狾猂猄猅猇猋猍猒猓猘猙猞猢猤猧猨猬猱猲猵猺猻猽獃獍獐獒獖獘獝獞獟獠獦獧獩獫獬獮獯獱獷獹獼玀玁玃玅玆玎玐玓玕玗玘玜玞玟玠玢玥玦玪玫玭玵玷玹玼玽玿珅珆珉珋珌珏珒珓珖珙珝珡珣珦珧珩珴珵珷珹珺珻珽"],["8fcca1","珿琀琁琄琇琊琑琚琛琤琦琨",9,"琹瑀瑃瑄瑆瑇瑋瑍瑑瑒瑗瑝瑢瑦瑧瑨瑫瑭瑮瑱瑲璀璁璅璆璇璉璏璐璑璒璘璙璚璜璟璠璡璣璦璨璩璪璫璮璯璱璲璵璹璻璿瓈瓉瓌瓐瓓瓘瓚瓛瓞瓟瓤瓨瓪瓫瓯瓴瓺瓻瓼瓿甆"],["8fcda1","甒甖甗甠甡甤甧甩甪甯甶甹甽甾甿畀畃畇畈畎畐畒畗畞畟畡畯畱畹",5,"疁疅疐疒疓疕疙疜疢疤疴疺疿痀痁痄痆痌痎痏痗痜痟痠痡痤痧痬痮痯痱痹瘀瘂瘃瘄瘇瘈瘊瘌瘏瘒瘓瘕瘖瘙瘛瘜瘝瘞瘣瘥瘦瘩瘭瘲瘳瘵瘸瘹"],["8fcea1","瘺瘼癊癀癁癃癄癅癉癋癕癙癟癤癥癭癮癯癱癴皁皅皌皍皕皛皜皝皟皠皢",6,"皪皭皽盁盅盉盋盌盎盔盙盠盦盨盬盰盱盶盹盼眀眆眊眎眒眔眕眗眙眚眜眢眨眭眮眯眴眵眶眹眽眾睂睅睆睊睍睎睏睒睖睗睜睞睟睠睢"],["8fcfa1","睤睧睪睬睰睲睳睴睺睽瞀瞄瞌瞍瞔瞕瞖瞚瞟瞢瞧瞪瞮瞯瞱瞵瞾矃矉矑矒矕矙矞矟矠矤矦矪矬矰矱矴矸矻砅砆砉砍砎砑砝砡砢砣砭砮砰砵砷硃硄硇硈硌硎硒硜硞硠硡硣硤硨硪确硺硾碊碏碔碘碡碝碞碟碤碨碬碭碰碱碲碳"],["8fd0a1","碻碽碿磇磈磉磌磎磒磓磕磖磤磛磟磠磡磦磪磲磳礀磶磷磺磻磿礆礌礐礚礜礞礟礠礥礧礩礭礱礴礵礻礽礿祄祅祆祊祋祏祑祔祘祛祜祧祩祫祲祹祻祼祾禋禌禑禓禔禕禖禘禛禜禡禨禩禫禯禱禴禸离秂秄秇秈秊秏秔秖秚秝秞"],["8fd1a1","秠秢秥秪秫秭秱秸秼稂稃稇稉稊稌稑稕稛稞稡稧稫稭稯稰稴稵稸稹稺穄穅穇穈穌穕穖穙穜穝穟穠穥穧穪穭穵穸穾窀窂窅窆窊窋窐窑窔窞窠窣窬窳窵窹窻窼竆竉竌竎竑竛竨竩竫竬竱竴竻竽竾笇笔笟笣笧笩笪笫笭笮笯笰"],["8fd2a1","笱笴笽笿筀筁筇筎筕筠筤筦筩筪筭筯筲筳筷箄箉箎箐箑箖箛箞箠箥箬箯箰箲箵箶箺箻箼箽篂篅篈篊篔篖篗篙篚篛篨篪篲篴篵篸篹篺篼篾簁簂簃簄簆簉簋簌簎簏簙簛簠簥簦簨簬簱簳簴簶簹簺籆籊籕籑籒籓籙",5],["8fd3a1","籡籣籧籩籭籮籰籲籹籼籽粆粇粏粔粞粠粦粰粶粷粺粻粼粿糄糇糈糉糍糏糓糔糕糗糙糚糝糦糩糫糵紃紇紈紉紏紑紒紓紖紝紞紣紦紪紭紱紼紽紾絀絁絇絈絍絑絓絗絙絚絜絝絥絧絪絰絸絺絻絿綁綂綃綅綆綈綋綌綍綑綖綗綝"],["8fd4a1","綞綦綧綪綳綶綷綹緂",4,"緌緍緎緗緙縀緢緥緦緪緫緭緱緵緶緹緺縈縐縑縕縗縜縝縠縧縨縬縭縯縳縶縿繄繅繇繎繐繒繘繟繡繢繥繫繮繯繳繸繾纁纆纇纊纍纑纕纘纚纝纞缼缻缽缾缿罃罄罇罏罒罓罛罜罝罡罣罤罥罦罭"],["8fd5a1","罱罽罾罿羀羋羍羏羐羑羖羗羜羡羢羦羪羭羴羼羿翀翃翈翎翏翛翟翣翥翨翬翮翯翲翺翽翾翿耇耈耊耍耎耏耑耓耔耖耝耞耟耠耤耦耬耮耰耴耵耷耹耺耼耾聀聄聠聤聦聭聱聵肁肈肎肜肞肦肧肫肸肹胈胍胏胒胔胕胗胘胠胭胮"],["8fd6a1","胰胲胳胶胹胺胾脃脋脖脗脘脜脞脠脤脧脬脰脵脺脼腅腇腊腌腒腗腠腡腧腨腩腭腯腷膁膐膄膅膆膋膎膖膘膛膞膢膮膲膴膻臋臃臅臊臎臏臕臗臛臝臞臡臤臫臬臰臱臲臵臶臸臹臽臿舀舃舏舓舔舙舚舝舡舢舨舲舴舺艃艄艅艆"],["8fd7a1","艋艎艏艑艖艜艠艣艧艭艴艻艽艿芀芁芃芄芇芉芊芎芑芔芖芘芚芛芠芡芣芤芧芨芩芪芮芰芲芴芷芺芼芾芿苆苐苕苚苠苢苤苨苪苭苯苶苷苽苾茀茁茇茈茊茋荔茛茝茞茟茡茢茬茭茮茰茳茷茺茼茽荂荃荄荇荍荎荑荕荖荗荰荸"],["8fd8a1","荽荿莀莂莄莆莍莒莔莕莘莙莛莜莝莦莧莩莬莾莿菀菇菉菏菐菑菔菝荓菨菪菶菸菹菼萁萆萊萏萑萕萙莭萯萹葅葇葈葊葍葏葑葒葖葘葙葚葜葠葤葥葧葪葰葳葴葶葸葼葽蒁蒅蒒蒓蒕蒞蒦蒨蒩蒪蒯蒱蒴蒺蒽蒾蓀蓂蓇蓈蓌蓏蓓"],["8fd9a1","蓜蓧蓪蓯蓰蓱蓲蓷蔲蓺蓻蓽蔂蔃蔇蔌蔎蔐蔜蔞蔢蔣蔤蔥蔧蔪蔫蔯蔳蔴蔶蔿蕆蕏",4,"蕖蕙蕜",6,"蕤蕫蕯蕹蕺蕻蕽蕿薁薅薆薉薋薌薏薓薘薝薟薠薢薥薧薴薶薷薸薼薽薾薿藂藇藊藋藎薭藘藚藟藠藦藨藭藳藶藼"],["8fdaa1","藿蘀蘄蘅蘍蘎蘐蘑蘒蘘蘙蘛蘞蘡蘧蘩蘶蘸蘺蘼蘽虀虂虆虒虓虖虗虘虙虝虠",4,"虩虬虯虵虶虷虺蚍蚑蚖蚘蚚蚜蚡蚦蚧蚨蚭蚱蚳蚴蚵蚷蚸蚹蚿蛀蛁蛃蛅蛑蛒蛕蛗蛚蛜蛠蛣蛥蛧蚈蛺蛼蛽蜄蜅蜇蜋蜎蜏蜐蜓蜔蜙蜞蜟蜡蜣"],["8fdba1","蜨蜮蜯蜱蜲蜹蜺蜼蜽蜾蝀蝃蝅蝍蝘蝝蝡蝤蝥蝯蝱蝲蝻螃",6,"螋螌螐螓螕螗螘螙螞螠螣螧螬螭螮螱螵螾螿蟁蟈蟉蟊蟎蟕蟖蟙蟚蟜蟟蟢蟣蟤蟪蟫蟭蟱蟳蟸蟺蟿蠁蠃蠆蠉蠊蠋蠐蠙蠒蠓蠔蠘蠚蠛蠜蠞蠟蠨蠭蠮蠰蠲蠵"],["8fdca1","蠺蠼衁衃衅衈衉衊衋衎衑衕衖衘衚衜衟衠衤衩衱衹衻袀袘袚袛袜袟袠袨袪袺袽袾裀裊",4,"裑裒裓裛裞裧裯裰裱裵裷褁褆褍褎褏褕褖褘褙褚褜褠褦褧褨褰褱褲褵褹褺褾襀襂襅襆襉襏襒襗襚襛襜襡襢襣襫襮襰襳襵襺"],["8fdda1","襻襼襽覉覍覐覔覕覛覜覟覠覥覰覴覵覶覷覼觔",4,"觥觩觫觭觱觳觶觹觽觿訄訅訇訏訑訒訔訕訞訠訢訤訦訫訬訯訵訷訽訾詀詃詅詇詉詍詎詓詖詗詘詜詝詡詥詧詵詶詷詹詺詻詾詿誀誃誆誋誏誐誒誖誗誙誟誧誩誮誯誳"],["8fdea1","誶誷誻誾諃諆諈諉諊諑諓諔諕諗諝諟諬諰諴諵諶諼諿謅謆謋謑謜謞謟謊謭謰謷謼譂",4,"譈譒譓譔譙譍譞譣譭譶譸譹譼譾讁讄讅讋讍讏讔讕讜讞讟谸谹谽谾豅豇豉豋豏豑豓豔豗豘豛豝豙豣豤豦豨豩豭豳豵豶豻豾貆"],["8fdfa1","貇貋貐貒貓貙貛貜貤貹貺賅賆賉賋賏賖賕賙賝賡賨賬賯賰賲賵賷賸賾賿贁贃贉贒贗贛赥赩赬赮赿趂趄趈趍趐趑趕趞趟趠趦趫趬趯趲趵趷趹趻跀跅跆跇跈跊跎跑跔跕跗跙跤跥跧跬跰趼跱跲跴跽踁踄踅踆踋踑踔踖踠踡踢"],["8fe0a1","踣踦踧踱踳踶踷踸踹踽蹀蹁蹋蹍蹎蹏蹔蹛蹜蹝蹞蹡蹢蹩蹬蹭蹯蹰蹱蹹蹺蹻躂躃躉躐躒躕躚躛躝躞躢躧躩躭躮躳躵躺躻軀軁軃軄軇軏軑軔軜軨軮軰軱軷軹軺軭輀輂輇輈輏輐輖輗輘輞輠輡輣輥輧輨輬輭輮輴輵輶輷輺轀轁"],["8fe1a1","轃轇轏轑",4,"轘轝轞轥辝辠辡辤辥辦辵辶辸达迀迁迆迊迋迍运迒迓迕迠迣迤迨迮迱迵迶迻迾适逄逈逌逘逛逨逩逯逪逬逭逳逴逷逿遃遄遌遛遝遢遦遧遬遰遴遹邅邈邋邌邎邐邕邗邘邙邛邠邡邢邥邰邲邳邴邶邽郌邾郃"],["8fe2a1","郄郅郇郈郕郗郘郙郜郝郟郥郒郶郫郯郰郴郾郿鄀鄄鄅鄆鄈鄍鄐鄔鄖鄗鄘鄚鄜鄞鄠鄥鄢鄣鄧鄩鄮鄯鄱鄴鄶鄷鄹鄺鄼鄽酃酇酈酏酓酗酙酚酛酡酤酧酭酴酹酺酻醁醃醅醆醊醎醑醓醔醕醘醞醡醦醨醬醭醮醰醱醲醳醶醻醼醽醿"],["8fe3a1","釂釃釅釓釔釗釙釚釞釤釥釩釪釬",5,"釷釹釻釽鈀鈁鈄鈅鈆鈇鈉鈊鈌鈐鈒鈓鈖鈘鈜鈝鈣鈤鈥鈦鈨鈮鈯鈰鈳鈵鈶鈸鈹鈺鈼鈾鉀鉂鉃鉆鉇鉊鉍鉎鉏鉑鉘鉙鉜鉝鉠鉡鉥鉧鉨鉩鉮鉯鉰鉵",4,"鉻鉼鉽鉿銈銉銊銍銎銒銗"],["8fe4a1","銙銟銠銤銥銧銨銫銯銲銶銸銺銻銼銽銿",4,"鋅鋆鋇鋈鋋鋌鋍鋎鋐鋓鋕鋗鋘鋙鋜鋝鋟鋠鋡鋣鋥鋧鋨鋬鋮鋰鋹鋻鋿錀錂錈錍錑錔錕錜錝錞錟錡錤錥錧錩錪錳錴錶錷鍇鍈鍉鍐鍑鍒鍕鍗鍘鍚鍞鍤鍥鍧鍩鍪鍭鍯鍰鍱鍳鍴鍶"],["8fe5a1","鍺鍽鍿鎀鎁鎂鎈鎊鎋鎍鎏鎒鎕鎘鎛鎞鎡鎣鎤鎦鎨鎫鎴鎵鎶鎺鎩鏁鏄鏅鏆鏇鏉",4,"鏓鏙鏜鏞鏟鏢鏦鏧鏹鏷鏸鏺鏻鏽鐁鐂鐄鐈鐉鐍鐎鐏鐕鐖鐗鐟鐮鐯鐱鐲鐳鐴鐻鐿鐽鑃鑅鑈鑊鑌鑕鑙鑜鑟鑡鑣鑨鑫鑭鑮鑯鑱鑲钄钃镸镹"],["8fe6a1","镾閄閈閌閍閎閝閞閟閡閦閩閫閬閴閶閺閽閿闆闈闉闋闐闑闒闓闙闚闝闞闟闠闤闦阝阞阢阤阥阦阬阱阳阷阸阹阺阼阽陁陒陔陖陗陘陡陮陴陻陼陾陿隁隂隃隄隉隑隖隚隝隟隤隥隦隩隮隯隳隺雊雒嶲雘雚雝雞雟雩雯雱雺霂"],["8fe7a1","霃霅霉霚霛霝霡霢霣霨霱霳靁靃靊靎靏靕靗靘靚靛靣靧靪靮靳靶靷靸靻靽靿鞀鞉鞕鞖鞗鞙鞚鞞鞟鞢鞬鞮鞱鞲鞵鞶鞸鞹鞺鞼鞾鞿韁韄韅韇韉韊韌韍韎韐韑韔韗韘韙韝韞韠韛韡韤韯韱韴韷韸韺頇頊頙頍頎頔頖頜頞頠頣頦"],["8fe8a1","頫頮頯頰頲頳頵頥頾顄顇顊顑顒顓顖顗顙顚顢顣顥顦顪顬颫颭颮颰颴颷颸颺颻颿飂飅飈飌飡飣飥飦飧飪飳飶餂餇餈餑餕餖餗餚餛餜餟餢餦餧餫餱",4,"餹餺餻餼饀饁饆饇饈饍饎饔饘饙饛饜饞饟饠馛馝馟馦馰馱馲馵"],["8fe9a1","馹馺馽馿駃駉駓駔駙駚駜駞駧駪駫駬駰駴駵駹駽駾騂騃騄騋騌騐騑騖騞騠騢騣騤騧騭騮騳騵騶騸驇驁驄驊驋驌驎驑驔驖驝骪骬骮骯骲骴骵骶骹骻骾骿髁髃髆髈髎髐髒髕髖髗髛髜髠髤髥髧髩髬髲髳髵髹髺髽髿",4],["8feaa1","鬄鬅鬈鬉鬋鬌鬍鬎鬐鬒鬖鬙鬛鬜鬠鬦鬫鬭鬳鬴鬵鬷鬹鬺鬽魈魋魌魕魖魗魛魞魡魣魥魦魨魪",4,"魳魵魷魸魹魿鮀鮄鮅鮆鮇鮉鮊鮋鮍鮏鮐鮔鮚鮝鮞鮦鮧鮩鮬鮰鮱鮲鮷鮸鮻鮼鮾鮿鯁鯇鯈鯎鯐鯗鯘鯝鯟鯥鯧鯪鯫鯯鯳鯷鯸"],["8feba1","鯹鯺鯽鯿鰀鰂鰋鰏鰑鰖鰘鰙鰚鰜鰞鰢鰣鰦",4,"鰱鰵鰶鰷鰽鱁鱃鱄鱅鱉鱊鱎鱏鱐鱓鱔鱖鱘鱛鱝鱞鱟鱣鱩鱪鱜鱫鱨鱮鱰鱲鱵鱷鱻鳦鳲鳷鳹鴋鴂鴑鴗鴘鴜鴝鴞鴯鴰鴲鴳鴴鴺鴼鵅鴽鵂鵃鵇鵊鵓鵔鵟鵣鵢鵥鵩鵪鵫鵰鵶鵷鵻"],["8feca1","鵼鵾鶃鶄鶆鶊鶍鶎鶒鶓鶕鶖鶗鶘鶡鶪鶬鶮鶱鶵鶹鶼鶿鷃鷇鷉鷊鷔鷕鷖鷗鷚鷞鷟鷠鷥鷧鷩鷫鷮鷰鷳鷴鷾鸊鸂鸇鸎鸐鸑鸒鸕鸖鸙鸜鸝鹺鹻鹼麀麂麃麄麅麇麎麏麖麘麛麞麤麨麬麮麯麰麳麴麵黆黈黋黕黟黤黧黬黭黮黰黱黲黵"],["8feda1","黸黿鼂鼃鼉鼏鼐鼑鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿齁齃",4,"齓齕齖齗齘齚齝齞齨齩齭",4,"齳齵齺齽龏龐龑龒龔龖龗龞龡龢龣龥"]]'); /***/ }), /***/ "./node_modules/encoding/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json": /*!********************************************************************************************!*\ !*** ./node_modules/encoding/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json ***! \********************************************************************************************/ /***/ ((module) => { "use strict"; module.exports = /*#__PURE__*/JSON.parse('{"uChars":[128,165,169,178,184,216,226,235,238,244,248,251,253,258,276,284,300,325,329,334,364,463,465,467,469,471,473,475,477,506,594,610,712,716,730,930,938,962,970,1026,1104,1106,8209,8215,8218,8222,8231,8241,8244,8246,8252,8365,8452,8454,8458,8471,8482,8556,8570,8596,8602,8713,8720,8722,8726,8731,8737,8740,8742,8748,8751,8760,8766,8777,8781,8787,8802,8808,8816,8854,8858,8870,8896,8979,9322,9372,9548,9588,9616,9622,9634,9652,9662,9672,9676,9680,9702,9735,9738,9793,9795,11906,11909,11913,11917,11928,11944,11947,11951,11956,11960,11964,11979,12284,12292,12312,12319,12330,12351,12436,12447,12535,12543,12586,12842,12850,12964,13200,13215,13218,13253,13263,13267,13270,13384,13428,13727,13839,13851,14617,14703,14801,14816,14964,15183,15471,15585,16471,16736,17208,17325,17330,17374,17623,17997,18018,18212,18218,18301,18318,18760,18811,18814,18820,18823,18844,18848,18872,19576,19620,19738,19887,40870,59244,59336,59367,59413,59417,59423,59431,59437,59443,59452,59460,59478,59493,63789,63866,63894,63976,63986,64016,64018,64021,64025,64034,64037,64042,65074,65093,65107,65112,65127,65132,65375,65510,65536],"gbChars":[0,36,38,45,50,81,89,95,96,100,103,104,105,109,126,133,148,172,175,179,208,306,307,308,309,310,311,312,313,341,428,443,544,545,558,741,742,749,750,805,819,820,7922,7924,7925,7927,7934,7943,7944,7945,7950,8062,8148,8149,8152,8164,8174,8236,8240,8262,8264,8374,8380,8381,8384,8388,8390,8392,8393,8394,8396,8401,8406,8416,8419,8424,8437,8439,8445,8482,8485,8496,8521,8603,8936,8946,9046,9050,9063,9066,9076,9092,9100,9108,9111,9113,9131,9162,9164,9218,9219,11329,11331,11334,11336,11346,11361,11363,11366,11370,11372,11375,11389,11682,11686,11687,11692,11694,11714,11716,11723,11725,11730,11736,11982,11989,12102,12336,12348,12350,12384,12393,12395,12397,12510,12553,12851,12962,12973,13738,13823,13919,13933,14080,14298,14585,14698,15583,15847,16318,16434,16438,16481,16729,17102,17122,17315,17320,17402,17418,17859,17909,17911,17915,17916,17936,17939,17961,18664,18703,18814,18962,19043,33469,33470,33471,33484,33485,33490,33497,33501,33505,33513,33520,33536,33550,37845,37921,37948,38029,38038,38064,38065,38066,38069,38075,38076,38078,39108,39109,39113,39114,39115,39116,39265,39394,189000]}'); /***/ }), /***/ "./node_modules/encoding/node_modules/iconv-lite/encodings/tables/gbk-added.json": /*!***************************************************************************************!*\ !*** ./node_modules/encoding/node_modules/iconv-lite/encodings/tables/gbk-added.json ***! \***************************************************************************************/ /***/ ((module) => { "use strict"; module.exports = /*#__PURE__*/JSON.parse('[["a140","",62],["a180","",32],["a240","",62],["a280","",32],["a2ab","",5],["a2e3","€"],["a2ef",""],["a2fd",""],["a340","",62],["a380","",31," "],["a440","",62],["a480","",32],["a4f4","",10],["a540","",62],["a580","",32],["a5f7","",7],["a640","",62],["a680","",32],["a6b9","",7],["a6d9","",6],["a6ec",""],["a6f3",""],["a6f6","",8],["a740","",62],["a780","",32],["a7c2","",14],["a7f2","",12],["a896","",10],["a8bc","ḿ"],["a8bf","ǹ"],["a8c1",""],["a8ea","",20],["a958",""],["a95b",""],["a95d",""],["a989","〾⿰",11],["a997","",12],["a9f0","",14],["aaa1","",93],["aba1","",93],["aca1","",93],["ada1","",93],["aea1","",93],["afa1","",93],["d7fa","",4],["f8a1","",93],["f9a1","",93],["faa1","",93],["fba1","",93],["fca1","",93],["fda1","",93],["fe50","⺁⺄㑳㑇⺈⺋㖞㘚㘎⺌⺗㥮㤘㧏㧟㩳㧐㭎㱮㳠⺧⺪䁖䅟⺮䌷⺳⺶⺷䎱䎬⺻䏝䓖䙡䙌"],["fe80","䜣䜩䝼䞍⻊䥇䥺䥽䦂䦃䦅䦆䦟䦛䦷䦶䲣䲟䲠䲡䱷䲢䴓",6,"䶮",93],["8135f437",""]]'); /***/ }), /***/ "./node_modules/encoding/node_modules/iconv-lite/encodings/tables/shiftjis.json": /*!**************************************************************************************!*\ !*** ./node_modules/encoding/node_modules/iconv-lite/encodings/tables/shiftjis.json ***! \**************************************************************************************/ /***/ ((module) => { "use strict"; module.exports = /*#__PURE__*/JSON.parse('[["0","\\u0000",128],["a1","。",62],["8140"," 、。,.・:;?!゛゜´`¨^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/\~∥|…‥‘’“”()〔〕[]{}〈",9,"+-±×"],["8180","÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇◆□■△▲▽▼※〒→←↑↓〓"],["81b8","∈∋⊆⊇⊂⊃∪∩"],["81c8","∧∨¬⇒⇔∀∃"],["81da","∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬"],["81f0","ʼn♯♭♪†‡¶"],["81fc","◯"],["824f","0",9],["8260","A",25],["8281","a",25],["829f","ぁ",82],["8340","ァ",62],["8380","ム",22],["839f","Α",16,"Σ",6],["83bf","α",16,"σ",6],["8440","А",5,"ЁЖ",25],["8470","а",5,"ёж",7],["8480","о",17],["849f","─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂"],["8740","①",19,"Ⅰ",9],["875f","㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡"],["877e","㍻"],["8780","〝〟№㏍℡㊤",4,"㈱㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪"],["889f","亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭"],["8940","院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円"],["8980","園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改"],["8a40","魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫"],["8a80","橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄"],["8b40","機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救"],["8b80","朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈"],["8c40","掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨"],["8c80","劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向"],["8d40","后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿鋼閤降"],["8d80","項香高鴻剛劫号合壕拷濠豪轟麹克刻告国穀酷鵠黒獄漉腰甑忽惚骨狛込此頃今困坤墾婚恨懇昏昆根梱混痕紺艮魂些佐叉唆嵯左差査沙瑳砂詐鎖裟坐座挫債催再最哉塞妻宰彩才採栽歳済災采犀砕砦祭斎細菜裁載際剤在材罪財冴坂阪堺榊肴咲崎埼碕鷺作削咋搾昨朔柵窄策索錯桜鮭笹匙冊刷"],["8e40","察拶撮擦札殺薩雑皐鯖捌錆鮫皿晒三傘参山惨撒散桟燦珊産算纂蚕讃賛酸餐斬暫残仕仔伺使刺司史嗣四士始姉姿子屍市師志思指支孜斯施旨枝止"],["8e80","死氏獅祉私糸紙紫肢脂至視詞詩試誌諮資賜雌飼歯事似侍児字寺慈持時次滋治爾璽痔磁示而耳自蒔辞汐鹿式識鴫竺軸宍雫七叱執失嫉室悉湿漆疾質実蔀篠偲柴芝屡蕊縞舎写射捨赦斜煮社紗者謝車遮蛇邪借勺尺杓灼爵酌釈錫若寂弱惹主取守手朱殊狩珠種腫趣酒首儒受呪寿授樹綬需囚収周"],["8f40","宗就州修愁拾洲秀秋終繍習臭舟蒐衆襲讐蹴輯週酋酬集醜什住充十従戎柔汁渋獣縦重銃叔夙宿淑祝縮粛塾熟出術述俊峻春瞬竣舜駿准循旬楯殉淳"],["8f80","準潤盾純巡遵醇順処初所暑曙渚庶緒署書薯藷諸助叙女序徐恕鋤除傷償勝匠升召哨商唱嘗奨妾娼宵将小少尚庄床廠彰承抄招掌捷昇昌昭晶松梢樟樵沼消渉湘焼焦照症省硝礁祥称章笑粧紹肖菖蒋蕉衝裳訟証詔詳象賞醤鉦鍾鐘障鞘上丈丞乗冗剰城場壌嬢常情擾条杖浄状畳穣蒸譲醸錠嘱埴飾"],["9040","拭植殖燭織職色触食蝕辱尻伸信侵唇娠寝審心慎振新晋森榛浸深申疹真神秦紳臣芯薪親診身辛進針震人仁刃塵壬尋甚尽腎訊迅陣靭笥諏須酢図厨"],["9080","逗吹垂帥推水炊睡粋翠衰遂酔錐錘随瑞髄崇嵩数枢趨雛据杉椙菅頗雀裾澄摺寸世瀬畝是凄制勢姓征性成政整星晴棲栖正清牲生盛精聖声製西誠誓請逝醒青静斉税脆隻席惜戚斥昔析石積籍績脊責赤跡蹟碩切拙接摂折設窃節説雪絶舌蝉仙先千占宣専尖川戦扇撰栓栴泉浅洗染潜煎煽旋穿箭線"],["9140","繊羨腺舛船薦詮賎践選遷銭銑閃鮮前善漸然全禅繕膳糎噌塑岨措曾曽楚狙疏疎礎祖租粗素組蘇訴阻遡鼠僧創双叢倉喪壮奏爽宋層匝惣想捜掃挿掻"],["9180","操早曹巣槍槽漕燥争痩相窓糟総綜聡草荘葬蒼藻装走送遭鎗霜騒像増憎臓蔵贈造促側則即息捉束測足速俗属賊族続卒袖其揃存孫尊損村遜他多太汰詑唾堕妥惰打柁舵楕陀駄騨体堆対耐岱帯待怠態戴替泰滞胎腿苔袋貸退逮隊黛鯛代台大第醍題鷹滝瀧卓啄宅托択拓沢濯琢託鐸濁諾茸凧蛸只"],["9240","叩但達辰奪脱巽竪辿棚谷狸鱈樽誰丹単嘆坦担探旦歎淡湛炭短端箪綻耽胆蛋誕鍛団壇弾断暖檀段男談値知地弛恥智池痴稚置致蜘遅馳築畜竹筑蓄"],["9280","逐秩窒茶嫡着中仲宙忠抽昼柱注虫衷註酎鋳駐樗瀦猪苧著貯丁兆凋喋寵帖帳庁弔張彫徴懲挑暢朝潮牒町眺聴脹腸蝶調諜超跳銚長頂鳥勅捗直朕沈珍賃鎮陳津墜椎槌追鎚痛通塚栂掴槻佃漬柘辻蔦綴鍔椿潰坪壷嬬紬爪吊釣鶴亭低停偵剃貞呈堤定帝底庭廷弟悌抵挺提梯汀碇禎程締艇訂諦蹄逓"],["9340","邸鄭釘鼎泥摘擢敵滴的笛適鏑溺哲徹撤轍迭鉄典填天展店添纏甜貼転顛点伝殿澱田電兎吐堵塗妬屠徒斗杜渡登菟賭途都鍍砥砺努度土奴怒倒党冬"],["9380","凍刀唐塔塘套宕島嶋悼投搭東桃梼棟盗淘湯涛灯燈当痘祷等答筒糖統到董蕩藤討謄豆踏逃透鐙陶頭騰闘働動同堂導憧撞洞瞳童胴萄道銅峠鴇匿得徳涜特督禿篤毒独読栃橡凸突椴届鳶苫寅酉瀞噸屯惇敦沌豚遁頓呑曇鈍奈那内乍凪薙謎灘捺鍋楢馴縄畷南楠軟難汝二尼弐迩匂賑肉虹廿日乳入"],["9440","如尿韮任妊忍認濡禰祢寧葱猫熱年念捻撚燃粘乃廼之埜嚢悩濃納能脳膿農覗蚤巴把播覇杷波派琶破婆罵芭馬俳廃拝排敗杯盃牌背肺輩配倍培媒梅"],["9480","楳煤狽買売賠陪這蝿秤矧萩伯剥博拍柏泊白箔粕舶薄迫曝漠爆縛莫駁麦函箱硲箸肇筈櫨幡肌畑畠八鉢溌発醗髪伐罰抜筏閥鳩噺塙蛤隼伴判半反叛帆搬斑板氾汎版犯班畔繁般藩販範釆煩頒飯挽晩番盤磐蕃蛮匪卑否妃庇彼悲扉批披斐比泌疲皮碑秘緋罷肥被誹費避非飛樋簸備尾微枇毘琵眉美"],["9540","鼻柊稗匹疋髭彦膝菱肘弼必畢筆逼桧姫媛紐百謬俵彪標氷漂瓢票表評豹廟描病秒苗錨鋲蒜蛭鰭品彬斌浜瀕貧賓頻敏瓶不付埠夫婦富冨布府怖扶敷"],["9580","斧普浮父符腐膚芙譜負賦赴阜附侮撫武舞葡蕪部封楓風葺蕗伏副復幅服福腹複覆淵弗払沸仏物鮒分吻噴墳憤扮焚奮粉糞紛雰文聞丙併兵塀幣平弊柄並蔽閉陛米頁僻壁癖碧別瞥蔑箆偏変片篇編辺返遍便勉娩弁鞭保舗鋪圃捕歩甫補輔穂募墓慕戊暮母簿菩倣俸包呆報奉宝峰峯崩庖抱捧放方朋"],["9640","法泡烹砲縫胞芳萌蓬蜂褒訪豊邦鋒飽鳳鵬乏亡傍剖坊妨帽忘忙房暴望某棒冒紡肪膨謀貌貿鉾防吠頬北僕卜墨撲朴牧睦穆釦勃没殆堀幌奔本翻凡盆"],["9680","摩磨魔麻埋妹昧枚毎哩槙幕膜枕鮪柾鱒桝亦俣又抹末沫迄侭繭麿万慢満漫蔓味未魅巳箕岬密蜜湊蓑稔脈妙粍民眠務夢無牟矛霧鵡椋婿娘冥名命明盟迷銘鳴姪牝滅免棉綿緬面麺摸模茂妄孟毛猛盲網耗蒙儲木黙目杢勿餅尤戻籾貰問悶紋門匁也冶夜爺耶野弥矢厄役約薬訳躍靖柳薮鑓愉愈油癒"],["9740","諭輸唯佑優勇友宥幽悠憂揖有柚湧涌猶猷由祐裕誘遊邑郵雄融夕予余与誉輿預傭幼妖容庸揚揺擁曜楊様洋溶熔用窯羊耀葉蓉要謡踊遥陽養慾抑欲"],["9780","沃浴翌翼淀羅螺裸来莱頼雷洛絡落酪乱卵嵐欄濫藍蘭覧利吏履李梨理璃痢裏裡里離陸律率立葎掠略劉流溜琉留硫粒隆竜龍侶慮旅虜了亮僚両凌寮料梁涼猟療瞭稜糧良諒遼量陵領力緑倫厘林淋燐琳臨輪隣鱗麟瑠塁涙累類令伶例冷励嶺怜玲礼苓鈴隷零霊麗齢暦歴列劣烈裂廉恋憐漣煉簾練聯"],["9840","蓮連錬呂魯櫓炉賂路露労婁廊弄朗楼榔浪漏牢狼篭老聾蝋郎六麓禄肋録論倭和話歪賄脇惑枠鷲亙亘鰐詫藁蕨椀湾碗腕"],["989f","弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗仞仭仟价伉佚估佛佝佗佇佶侈侏侘佻佩佰侑佯來侖儘俔俟俎俘俛俑俚俐俤俥倚倨倔倪倥倅伜俶倡倩倬俾俯們倆偃假會偕偐偈做偖偬偸傀傚傅傴傲"],["9940","僉僊傳僂僖僞僥僭僣僮價僵儉儁儂儖儕儔儚儡儺儷儼儻儿兀兒兌兔兢竸兩兪兮冀冂囘册冉冏冑冓冕冖冤冦冢冩冪冫决冱冲冰况冽凅凉凛几處凩凭"],["9980","凰凵凾刄刋刔刎刧刪刮刳刹剏剄剋剌剞剔剪剴剩剳剿剽劍劔劒剱劈劑辨辧劬劭劼劵勁勍勗勞勣勦飭勠勳勵勸勹匆匈甸匍匐匏匕匚匣匯匱匳匸區卆卅丗卉卍凖卞卩卮夘卻卷厂厖厠厦厥厮厰厶參簒雙叟曼燮叮叨叭叺吁吽呀听吭吼吮吶吩吝呎咏呵咎呟呱呷呰咒呻咀呶咄咐咆哇咢咸咥咬哄哈咨"],["9a40","咫哂咤咾咼哘哥哦唏唔哽哮哭哺哢唹啀啣啌售啜啅啖啗唸唳啝喙喀咯喊喟啻啾喘喞單啼喃喩喇喨嗚嗅嗟嗄嗜嗤嗔嘔嗷嘖嗾嗽嘛嗹噎噐營嘴嘶嘲嘸"],["9a80","噫噤嘯噬噪嚆嚀嚊嚠嚔嚏嚥嚮嚶嚴囂嚼囁囃囀囈囎囑囓囗囮囹圀囿圄圉圈國圍圓團圖嗇圜圦圷圸坎圻址坏坩埀垈坡坿垉垓垠垳垤垪垰埃埆埔埒埓堊埖埣堋堙堝塲堡塢塋塰毀塒堽塹墅墹墟墫墺壞墻墸墮壅壓壑壗壙壘壥壜壤壟壯壺壹壻壼壽夂夊夐夛梦夥夬夭夲夸夾竒奕奐奎奚奘奢奠奧奬奩"],["9b40","奸妁妝佞侫妣妲姆姨姜妍姙姚娥娟娑娜娉娚婀婬婉娵娶婢婪媚媼媾嫋嫂媽嫣嫗嫦嫩嫖嫺嫻嬌嬋嬖嬲嫐嬪嬶嬾孃孅孀孑孕孚孛孥孩孰孳孵學斈孺宀"],["9b80","它宦宸寃寇寉寔寐寤實寢寞寥寫寰寶寳尅將專對尓尠尢尨尸尹屁屆屎屓屐屏孱屬屮乢屶屹岌岑岔妛岫岻岶岼岷峅岾峇峙峩峽峺峭嶌峪崋崕崗嵜崟崛崑崔崢崚崙崘嵌嵒嵎嵋嵬嵳嵶嶇嶄嶂嶢嶝嶬嶮嶽嶐嶷嶼巉巍巓巒巖巛巫已巵帋帚帙帑帛帶帷幄幃幀幎幗幔幟幢幤幇幵并幺麼广庠廁廂廈廐廏"],["9c40","廖廣廝廚廛廢廡廨廩廬廱廳廰廴廸廾弃弉彝彜弋弑弖弩弭弸彁彈彌彎弯彑彖彗彙彡彭彳彷徃徂彿徊很徑徇從徙徘徠徨徭徼忖忻忤忸忱忝悳忿怡恠"],["9c80","怙怐怩怎怱怛怕怫怦怏怺恚恁恪恷恟恊恆恍恣恃恤恂恬恫恙悁悍惧悃悚悄悛悖悗悒悧悋惡悸惠惓悴忰悽惆悵惘慍愕愆惶惷愀惴惺愃愡惻惱愍愎慇愾愨愧慊愿愼愬愴愽慂慄慳慷慘慙慚慫慴慯慥慱慟慝慓慵憙憖憇憬憔憚憊憑憫憮懌懊應懷懈懃懆憺懋罹懍懦懣懶懺懴懿懽懼懾戀戈戉戍戌戔戛"],["9d40","戞戡截戮戰戲戳扁扎扞扣扛扠扨扼抂抉找抒抓抖拔抃抔拗拑抻拏拿拆擔拈拜拌拊拂拇抛拉挌拮拱挧挂挈拯拵捐挾捍搜捏掖掎掀掫捶掣掏掉掟掵捫"],["9d80","捩掾揩揀揆揣揉插揶揄搖搴搆搓搦搶攝搗搨搏摧摯摶摎攪撕撓撥撩撈撼據擒擅擇撻擘擂擱擧舉擠擡抬擣擯攬擶擴擲擺攀擽攘攜攅攤攣攫攴攵攷收攸畋效敖敕敍敘敞敝敲數斂斃變斛斟斫斷旃旆旁旄旌旒旛旙无旡旱杲昊昃旻杳昵昶昴昜晏晄晉晁晞晝晤晧晨晟晢晰暃暈暎暉暄暘暝曁暹曉暾暼"],["9e40","曄暸曖曚曠昿曦曩曰曵曷朏朖朞朦朧霸朮朿朶杁朸朷杆杞杠杙杣杤枉杰枩杼杪枌枋枦枡枅枷柯枴柬枳柩枸柤柞柝柢柮枹柎柆柧檜栞框栩桀桍栲桎"],["9e80","梳栫桙档桷桿梟梏梭梔條梛梃檮梹桴梵梠梺椏梍桾椁棊椈棘椢椦棡椌棍棔棧棕椶椒椄棗棣椥棹棠棯椨椪椚椣椡棆楹楷楜楸楫楔楾楮椹楴椽楙椰楡楞楝榁楪榲榮槐榿槁槓榾槎寨槊槝榻槃榧樮榑榠榜榕榴槞槨樂樛槿權槹槲槧樅榱樞槭樔槫樊樒櫁樣樓橄樌橲樶橸橇橢橙橦橈樸樢檐檍檠檄檢檣"],["9f40","檗蘗檻櫃櫂檸檳檬櫞櫑櫟檪櫚櫪櫻欅蘖櫺欒欖鬱欟欸欷盜欹飮歇歃歉歐歙歔歛歟歡歸歹歿殀殄殃殍殘殕殞殤殪殫殯殲殱殳殷殼毆毋毓毟毬毫毳毯"],["9f80","麾氈氓气氛氤氣汞汕汢汪沂沍沚沁沛汾汨汳沒沐泄泱泓沽泗泅泝沮沱沾沺泛泯泙泪洟衍洶洫洽洸洙洵洳洒洌浣涓浤浚浹浙涎涕濤涅淹渕渊涵淇淦涸淆淬淞淌淨淒淅淺淙淤淕淪淮渭湮渮渙湲湟渾渣湫渫湶湍渟湃渺湎渤滿渝游溂溪溘滉溷滓溽溯滄溲滔滕溏溥滂溟潁漑灌滬滸滾漿滲漱滯漲滌"],["e040","漾漓滷澆潺潸澁澀潯潛濳潭澂潼潘澎澑濂潦澳澣澡澤澹濆澪濟濕濬濔濘濱濮濛瀉瀋濺瀑瀁瀏濾瀛瀚潴瀝瀘瀟瀰瀾瀲灑灣炙炒炯烱炬炸炳炮烟烋烝"],["e080","烙焉烽焜焙煥煕熈煦煢煌煖煬熏燻熄熕熨熬燗熹熾燒燉燔燎燠燬燧燵燼燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘牴牾犂犁犇犒犖犢犧犹犲狃狆狄狎狒狢狠狡狹狷倏猗猊猜猖猝猴猯猩猥猾獎獏默獗獪獨獰獸獵獻獺珈玳珎玻珀珥珮珞璢琅瑯琥珸琲琺瑕琿瑟瑙瑁瑜瑩瑰瑣瑪瑶瑾璋璞璧瓊瓏瓔珱"],["e140","瓠瓣瓧瓩瓮瓲瓰瓱瓸瓷甄甃甅甌甎甍甕甓甞甦甬甼畄畍畊畉畛畆畚畩畤畧畫畭畸當疆疇畴疊疉疂疔疚疝疥疣痂疳痃疵疽疸疼疱痍痊痒痙痣痞痾痿"],["e180","痼瘁痰痺痲痳瘋瘍瘉瘟瘧瘠瘡瘢瘤瘴瘰瘻癇癈癆癜癘癡癢癨癩癪癧癬癰癲癶癸發皀皃皈皋皎皖皓皙皚皰皴皸皹皺盂盍盖盒盞盡盥盧盪蘯盻眈眇眄眩眤眞眥眦眛眷眸睇睚睨睫睛睥睿睾睹瞎瞋瞑瞠瞞瞰瞶瞹瞿瞼瞽瞻矇矍矗矚矜矣矮矼砌砒礦砠礪硅碎硴碆硼碚碌碣碵碪碯磑磆磋磔碾碼磅磊磬"],["e240","磧磚磽磴礇礒礑礙礬礫祀祠祗祟祚祕祓祺祿禊禝禧齋禪禮禳禹禺秉秕秧秬秡秣稈稍稘稙稠稟禀稱稻稾稷穃穗穉穡穢穩龝穰穹穽窈窗窕窘窖窩竈窰"],["e280","窶竅竄窿邃竇竊竍竏竕竓站竚竝竡竢竦竭竰笂笏笊笆笳笘笙笞笵笨笶筐筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟箍箜箚箋箒箏筝箙篋篁篌篏箴篆篝篩簑簔篦篥籠簀簇簓篳篷簗簍篶簣簧簪簟簷簫簽籌籃籔籏籀籐籘籟籤籖籥籬籵粃粐粤粭粢粫粡粨粳粲粱粮粹粽糀糅糂糘糒糜糢鬻糯糲糴糶糺紆"],["e340","紂紜紕紊絅絋紮紲紿紵絆絳絖絎絲絨絮絏絣經綉絛綏絽綛綺綮綣綵緇綽綫總綢綯緜綸綟綰緘緝緤緞緻緲緡縅縊縣縡縒縱縟縉縋縢繆繦縻縵縹繃縷"],["e380","縲縺繧繝繖繞繙繚繹繪繩繼繻纃緕繽辮繿纈纉續纒纐纓纔纖纎纛纜缸缺罅罌罍罎罐网罕罔罘罟罠罨罩罧罸羂羆羃羈羇羌羔羞羝羚羣羯羲羹羮羶羸譱翅翆翊翕翔翡翦翩翳翹飜耆耄耋耒耘耙耜耡耨耿耻聊聆聒聘聚聟聢聨聳聲聰聶聹聽聿肄肆肅肛肓肚肭冐肬胛胥胙胝胄胚胖脉胯胱脛脩脣脯腋"],["e440","隋腆脾腓腑胼腱腮腥腦腴膃膈膊膀膂膠膕膤膣腟膓膩膰膵膾膸膽臀臂膺臉臍臑臙臘臈臚臟臠臧臺臻臾舁舂舅與舊舍舐舖舩舫舸舳艀艙艘艝艚艟艤"],["e480","艢艨艪艫舮艱艷艸艾芍芒芫芟芻芬苡苣苟苒苴苳苺莓范苻苹苞茆苜茉苙茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟莢莖茣莎莇莊荼莵荳荵莠莉莨菴萓菫菎菽萃菘萋菁菷萇菠菲萍萢萠莽萸蔆菻葭萪萼蕚蒄葷葫蒭葮蒂葩葆萬葯葹萵蓊葢蒹蒿蒟蓙蓍蒻蓚蓐蓁蓆蓖蒡蔡蓿蓴蔗蔘蔬蔟蔕蔔蓼蕀蕣蕘蕈"],["e540","蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛藪薇薜蕷蕾薐藉薺藏薹藐藕藝藥藜藹蘊蘓蘋藾藺蘆蘢蘚蘰蘿虍乕虔號虧虱蚓蚣蚩蚪蚋蚌蚶蚯蛄蛆蚰蛉蠣蚫蛔蛞蛩蛬"],["e580","蛟蛛蛯蜒蜆蜈蜀蜃蛻蜑蜉蜍蛹蜊蜴蜿蜷蜻蜥蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙蝓蝣蝪蠅螢螟螂螯蟋螽蟀蟐雖螫蟄螳蟇蟆螻蟯蟲蟠蠏蠍蟾蟶蟷蠎蟒蠑蠖蠕蠢蠡蠱蠶蠹蠧蠻衄衂衒衙衞衢衫袁衾袞衵衽袵衲袂袗袒袮袙袢袍袤袰袿袱裃裄裔裘裙裝裹褂裼裴裨裲褄褌褊褓襃褞褥褪褫襁襄褻褶褸襌褝襠襞"],["e640","襦襤襭襪襯襴襷襾覃覈覊覓覘覡覩覦覬覯覲覺覽覿觀觚觜觝觧觴觸訃訖訐訌訛訝訥訶詁詛詒詆詈詼詭詬詢誅誂誄誨誡誑誥誦誚誣諄諍諂諚諫諳諧"],["e680","諤諱謔諠諢諷諞諛謌謇謚諡謖謐謗謠謳鞫謦謫謾謨譁譌譏譎證譖譛譚譫譟譬譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈豌豎豐豕豢豬豸豺貂貉貅貊貍貎貔豼貘戝貭貪貽貲貳貮貶賈賁賤賣賚賽賺賻贄贅贊贇贏贍贐齎贓賍贔贖赧赭赱赳趁趙跂趾趺跏跚跖跌跛跋跪跫跟跣跼踈踉跿踝踞踐踟蹂踵踰踴蹊"],["e740","蹇蹉蹌蹐蹈蹙蹤蹠踪蹣蹕蹶蹲蹼躁躇躅躄躋躊躓躑躔躙躪躡躬躰軆躱躾軅軈軋軛軣軼軻軫軾輊輅輕輒輙輓輜輟輛輌輦輳輻輹轅轂輾轌轉轆轎轗轜"],["e780","轢轣轤辜辟辣辭辯辷迚迥迢迪迯邇迴逅迹迺逑逕逡逍逞逖逋逧逶逵逹迸遏遐遑遒逎遉逾遖遘遞遨遯遶隨遲邂遽邁邀邊邉邏邨邯邱邵郢郤扈郛鄂鄒鄙鄲鄰酊酖酘酣酥酩酳酲醋醉醂醢醫醯醪醵醴醺釀釁釉釋釐釖釟釡釛釼釵釶鈞釿鈔鈬鈕鈑鉞鉗鉅鉉鉤鉈銕鈿鉋鉐銜銖銓銛鉚鋏銹銷鋩錏鋺鍄錮"],["e840","錙錢錚錣錺錵錻鍜鍠鍼鍮鍖鎰鎬鎭鎔鎹鏖鏗鏨鏥鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐鐶鐫鐵鐡鐺鑁鑒鑄鑛鑠鑢鑞鑪鈩鑰鑵鑷鑽鑚鑼鑾钁鑿閂閇閊閔閖閘閙"],["e880","閠閨閧閭閼閻閹閾闊濶闃闍闌闕闔闖關闡闥闢阡阨阮阯陂陌陏陋陷陜陞陝陟陦陲陬隍隘隕隗險隧隱隲隰隴隶隸隹雎雋雉雍襍雜霍雕雹霄霆霈霓霎霑霏霖霙霤霪霰霹霽霾靄靆靈靂靉靜靠靤靦靨勒靫靱靹鞅靼鞁靺鞆鞋鞏鞐鞜鞨鞦鞣鞳鞴韃韆韈韋韜韭齏韲竟韶韵頏頌頸頤頡頷頽顆顏顋顫顯顰"],["e940","顱顴顳颪颯颱颶飄飃飆飩飫餃餉餒餔餘餡餝餞餤餠餬餮餽餾饂饉饅饐饋饑饒饌饕馗馘馥馭馮馼駟駛駝駘駑駭駮駱駲駻駸騁騏騅駢騙騫騷驅驂驀驃"],["e980","騾驕驍驛驗驟驢驥驤驩驫驪骭骰骼髀髏髑髓體髞髟髢髣髦髯髫髮髴髱髷髻鬆鬘鬚鬟鬢鬣鬥鬧鬨鬩鬪鬮鬯鬲魄魃魏魍魎魑魘魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸鳧鳬鳰鴉鴈鳫鴃鴆鴪鴦鶯鴣鴟鵄鴕鴒鵁鴿鴾鵆鵈"],["ea40","鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻鶸鶺鷆鷏鷂鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽麁麈麋麌麒麕麑麝麥麩麸麪麭靡黌黎黏黐黔黜點黝黠黥黨黯"],["ea80","黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠堯槇遙瑤凜熙"],["ed40","纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏"],["ed80","塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱"],["ee40","犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙"],["ee80","蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"],["eeef","ⅰ",9,"¬¦'""],["f040","",62],["f080","",124],["f140","",62],["f180","",124],["f240","",62],["f280","",124],["f340","",62],["f380","",124],["f440","",62],["f480","",124],["f540","",62],["f580","",124],["f640","",62],["f680","",124],["f740","",62],["f780","",124],["f840","",62],["f880","",124],["f940",""],["fa40","ⅰ",9,"Ⅰ",9,"¬¦'"㈱№℡∵纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊"],["fa80","兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯"],["fb40","涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神"],["fb80","祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙"],["fc40","髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"]]'); /***/ }) /******/ }); /************************************************************************/ /******/ // The module cache /******/ var __webpack_module_cache__ = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ var cachedModule = __webpack_module_cache__[moduleId]; /******/ if (cachedModule !== undefined) { /******/ if (cachedModule.error !== undefined) throw cachedModule.error; /******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed /******/ // no module.loaded needed /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ try { /******/ var execOptions = { id: moduleId, module: module, factory: __webpack_modules__[moduleId], require: __webpack_require__ }; /******/ __webpack_require__.i.forEach(function(handler) { handler(execOptions); }); /******/ module = execOptions.module; /******/ execOptions.factory.call(module.exports, module, module.exports, execOptions.require); /******/ } catch(e) { /******/ module.error = e; /******/ throw e; /******/ } /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = __webpack_modules__; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = __webpack_module_cache__; /******/ /******/ // expose the module execution interceptor /******/ __webpack_require__.i = []; /******/ /************************************************************************/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/get javascript update chunk filename */ /******/ (() => { /******/ // This function allow to reference all chunks /******/ __webpack_require__.hu = (chunkId) => { /******/ // return url for filenames based on template /******/ return "" + chunkId + "." + __webpack_require__.h() + ".hot-update.js"; /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/get update manifest filename */ /******/ (() => { /******/ __webpack_require__.hmrF = () => ("default." + __webpack_require__.h() + ".hot-update.json"); /******/ })(); /******/ /******/ /* webpack/runtime/getFullHash */ /******/ (() => { /******/ __webpack_require__.h = () => ("bb7dd4f77c64b4a6844a") /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/load script */ /******/ (() => { /******/ var inProgress = {}; /******/ var dataWebpackPrefix = "localization-editor:"; /******/ // loadScript function to load a script via script tag /******/ __webpack_require__.l = (url, done, key, chunkId) => { /******/ if(inProgress[url]) { inProgress[url].push(done); return; } /******/ var script, needAttach; /******/ if(key !== undefined) { /******/ var scripts = document.getElementsByTagName("script"); /******/ for(var i = 0; i < scripts.length; i++) { /******/ var s = scripts[i]; /******/ if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; } /******/ } /******/ } /******/ if(!script) { /******/ needAttach = true; /******/ script = document.createElement('script'); /******/ /******/ script.charset = 'utf-8'; /******/ script.timeout = 120; /******/ if (__webpack_require__.nc) { /******/ script.setAttribute("nonce", __webpack_require__.nc); /******/ } /******/ script.setAttribute("data-webpack", dataWebpackPrefix + key); /******/ /******/ script.src = url; /******/ } /******/ inProgress[url] = [done]; /******/ var onScriptComplete = (prev, event) => { /******/ // avoid mem leaks in IE. /******/ script.onerror = script.onload = null; /******/ clearTimeout(timeout); /******/ var doneFns = inProgress[url]; /******/ delete inProgress[url]; /******/ script.parentNode && script.parentNode.removeChild(script); /******/ doneFns && doneFns.forEach((fn) => (fn(event))); /******/ if(prev) return prev(event); /******/ } /******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000); /******/ script.onerror = onScriptComplete.bind(null, script.onerror); /******/ script.onload = onScriptComplete.bind(null, script.onload); /******/ needAttach && document.head.appendChild(script); /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/make namespace object */ /******/ (() => { /******/ // define __esModule on exports /******/ __webpack_require__.r = (exports) => { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hot module replacement */ /******/ (() => { /******/ var currentModuleData = {}; /******/ var installedModules = __webpack_require__.c; /******/ /******/ // module and require creation /******/ var currentChildModule; /******/ var currentParents = []; /******/ /******/ // status /******/ var registeredStatusHandlers = []; /******/ var currentStatus = "idle"; /******/ /******/ // while downloading /******/ var blockingPromises = 0; /******/ var blockingPromisesWaiting = []; /******/ /******/ // The update info /******/ var currentUpdateApplyHandlers; /******/ var queuedInvalidatedModules; /******/ /******/ __webpack_require__.hmrD = currentModuleData; /******/ /******/ __webpack_require__.i.push(function (options) { /******/ var module = options.module; /******/ var require = createRequire(options.require, options.id); /******/ module.hot = createModuleHotObject(options.id, module); /******/ module.parents = currentParents; /******/ module.children = []; /******/ currentParents = []; /******/ options.require = require; /******/ }); /******/ /******/ __webpack_require__.hmrC = {}; /******/ __webpack_require__.hmrI = {}; /******/ /******/ function createRequire(require, moduleId) { /******/ var me = installedModules[moduleId]; /******/ if (!me) return require; /******/ var fn = function (request) { /******/ if (me.hot.active) { /******/ if (installedModules[request]) { /******/ var parents = installedModules[request].parents; /******/ if (parents.indexOf(moduleId) === -1) { /******/ parents.push(moduleId); /******/ } /******/ } else { /******/ currentParents = [moduleId]; /******/ currentChildModule = request; /******/ } /******/ if (me.children.indexOf(request) === -1) { /******/ me.children.push(request); /******/ } /******/ } else { /******/ console.warn( /******/ "[HMR] unexpected require(" + /******/ request + /******/ ") from disposed module " + /******/ moduleId /******/ ); /******/ currentParents = []; /******/ } /******/ return require(request); /******/ }; /******/ var createPropertyDescriptor = function (name) { /******/ return { /******/ configurable: true, /******/ enumerable: true, /******/ get: function () { /******/ return require[name]; /******/ }, /******/ set: function (value) { /******/ require[name] = value; /******/ } /******/ }; /******/ }; /******/ for (var name in require) { /******/ if (Object.prototype.hasOwnProperty.call(require, name) && name !== "e") { /******/ Object.defineProperty(fn, name, createPropertyDescriptor(name)); /******/ } /******/ } /******/ fn.e = function (chunkId, fetchPriority) { /******/ return trackBlockingPromise(require.e(chunkId, fetchPriority)); /******/ }; /******/ return fn; /******/ } /******/ /******/ function createModuleHotObject(moduleId, me) { /******/ var _main = currentChildModule !== moduleId; /******/ var hot = { /******/ // private stuff /******/ _acceptedDependencies: {}, /******/ _acceptedErrorHandlers: {}, /******/ _declinedDependencies: {}, /******/ _selfAccepted: false, /******/ _selfDeclined: false, /******/ _selfInvalidated: false, /******/ _disposeHandlers: [], /******/ _main: _main, /******/ _requireSelf: function () { /******/ currentParents = me.parents.slice(); /******/ currentChildModule = _main ? undefined : moduleId; /******/ __webpack_require__(moduleId); /******/ }, /******/ /******/ // Module API /******/ active: true, /******/ accept: function (dep, callback, errorHandler) { /******/ if (dep === undefined) hot._selfAccepted = true; /******/ else if (typeof dep === "function") hot._selfAccepted = dep; /******/ else if (typeof dep === "object" && dep !== null) { /******/ for (var i = 0; i < dep.length; i++) { /******/ hot._acceptedDependencies[dep[i]] = callback || function () {}; /******/ hot._acceptedErrorHandlers[dep[i]] = errorHandler; /******/ } /******/ } else { /******/ hot._acceptedDependencies[dep] = callback || function () {}; /******/ hot._acceptedErrorHandlers[dep] = errorHandler; /******/ } /******/ }, /******/ decline: function (dep) { /******/ if (dep === undefined) hot._selfDeclined = true; /******/ else if (typeof dep === "object" && dep !== null) /******/ for (var i = 0; i < dep.length; i++) /******/ hot._declinedDependencies[dep[i]] = true; /******/ else hot._declinedDependencies[dep] = true; /******/ }, /******/ dispose: function (callback) { /******/ hot._disposeHandlers.push(callback); /******/ }, /******/ addDisposeHandler: function (callback) { /******/ hot._disposeHandlers.push(callback); /******/ }, /******/ removeDisposeHandler: function (callback) { /******/ var idx = hot._disposeHandlers.indexOf(callback); /******/ if (idx >= 0) hot._disposeHandlers.splice(idx, 1); /******/ }, /******/ invalidate: function () { /******/ this._selfInvalidated = true; /******/ switch (currentStatus) { /******/ case "idle": /******/ currentUpdateApplyHandlers = []; /******/ Object.keys(__webpack_require__.hmrI).forEach(function (key) { /******/ __webpack_require__.hmrI[key]( /******/ moduleId, /******/ currentUpdateApplyHandlers /******/ ); /******/ }); /******/ setStatus("ready"); /******/ break; /******/ case "ready": /******/ Object.keys(__webpack_require__.hmrI).forEach(function (key) { /******/ __webpack_require__.hmrI[key]( /******/ moduleId, /******/ currentUpdateApplyHandlers /******/ ); /******/ }); /******/ break; /******/ case "prepare": /******/ case "check": /******/ case "dispose": /******/ case "apply": /******/ (queuedInvalidatedModules = queuedInvalidatedModules || []).push( /******/ moduleId /******/ ); /******/ break; /******/ default: /******/ // ignore requests in error states /******/ break; /******/ } /******/ }, /******/ /******/ // Management API /******/ check: hotCheck, /******/ apply: hotApply, /******/ status: function (l) { /******/ if (!l) return currentStatus; /******/ registeredStatusHandlers.push(l); /******/ }, /******/ addStatusHandler: function (l) { /******/ registeredStatusHandlers.push(l); /******/ }, /******/ removeStatusHandler: function (l) { /******/ var idx = registeredStatusHandlers.indexOf(l); /******/ if (idx >= 0) registeredStatusHandlers.splice(idx, 1); /******/ }, /******/ /******/ // inherit from previous dispose call /******/ data: currentModuleData[moduleId] /******/ }; /******/ currentChildModule = undefined; /******/ return hot; /******/ } /******/ /******/ function setStatus(newStatus) { /******/ currentStatus = newStatus; /******/ var results = []; /******/ /******/ for (var i = 0; i < registeredStatusHandlers.length; i++) /******/ results[i] = registeredStatusHandlers[i].call(null, newStatus); /******/ /******/ return Promise.all(results).then(function () {}); /******/ } /******/ /******/ function unblock() { /******/ if (--blockingPromises === 0) { /******/ setStatus("ready").then(function () { /******/ if (blockingPromises === 0) { /******/ var list = blockingPromisesWaiting; /******/ blockingPromisesWaiting = []; /******/ for (var i = 0; i < list.length; i++) { /******/ list[i](); /******/ } /******/ } /******/ }); /******/ } /******/ } /******/ /******/ function trackBlockingPromise(promise) { /******/ switch (currentStatus) { /******/ case "ready": /******/ setStatus("prepare"); /******/ /* fallthrough */ /******/ case "prepare": /******/ blockingPromises++; /******/ promise.then(unblock, unblock); /******/ return promise; /******/ default: /******/ return promise; /******/ } /******/ } /******/ /******/ function waitForBlockingPromises(fn) { /******/ if (blockingPromises === 0) return fn(); /******/ return new Promise(function (resolve) { /******/ blockingPromisesWaiting.push(function () { /******/ resolve(fn()); /******/ }); /******/ }); /******/ } /******/ /******/ function hotCheck(applyOnUpdate) { /******/ if (currentStatus !== "idle") { /******/ throw new Error("check() is only allowed in idle status"); /******/ } /******/ return setStatus("check") /******/ .then(__webpack_require__.hmrM) /******/ .then(function (update) { /******/ if (!update) { /******/ return setStatus(applyInvalidatedModules() ? "ready" : "idle").then( /******/ function () { /******/ return null; /******/ } /******/ ); /******/ } /******/ /******/ return setStatus("prepare").then(function () { /******/ var updatedModules = []; /******/ currentUpdateApplyHandlers = []; /******/ /******/ return Promise.all( /******/ Object.keys(__webpack_require__.hmrC).reduce(function ( /******/ promises, /******/ key /******/ ) { /******/ __webpack_require__.hmrC[key]( /******/ update.c, /******/ update.r, /******/ update.m, /******/ promises, /******/ currentUpdateApplyHandlers, /******/ updatedModules /******/ ); /******/ return promises; /******/ }, []) /******/ ).then(function () { /******/ return waitForBlockingPromises(function () { /******/ if (applyOnUpdate) { /******/ return internalApply(applyOnUpdate); /******/ } /******/ return setStatus("ready").then(function () { /******/ return updatedModules; /******/ }); /******/ }); /******/ }); /******/ }); /******/ }); /******/ } /******/ /******/ function hotApply(options) { /******/ if (currentStatus !== "ready") { /******/ return Promise.resolve().then(function () { /******/ throw new Error( /******/ "apply() is only allowed in ready status (state: " + /******/ currentStatus + /******/ ")" /******/ ); /******/ }); /******/ } /******/ return internalApply(options); /******/ } /******/ /******/ function internalApply(options) { /******/ options = options || {}; /******/ /******/ applyInvalidatedModules(); /******/ /******/ var results = currentUpdateApplyHandlers.map(function (handler) { /******/ return handler(options); /******/ }); /******/ currentUpdateApplyHandlers = undefined; /******/ /******/ var errors = results /******/ .map(function (r) { /******/ return r.error; /******/ }) /******/ .filter(Boolean); /******/ /******/ if (errors.length > 0) { /******/ return setStatus("abort").then(function () { /******/ throw errors[0]; /******/ }); /******/ } /******/ /******/ // Now in "dispose" phase /******/ var disposePromise = setStatus("dispose"); /******/ /******/ results.forEach(function (result) { /******/ if (result.dispose) result.dispose(); /******/ }); /******/ /******/ // Now in "apply" phase /******/ var applyPromise = setStatus("apply"); /******/ /******/ var error; /******/ var reportError = function (err) { /******/ if (!error) error = err; /******/ }; /******/ /******/ var outdatedModules = []; /******/ results.forEach(function (result) { /******/ if (result.apply) { /******/ var modules = result.apply(reportError); /******/ if (modules) { /******/ for (var i = 0; i < modules.length; i++) { /******/ outdatedModules.push(modules[i]); /******/ } /******/ } /******/ } /******/ }); /******/ /******/ return Promise.all([disposePromise, applyPromise]).then(function () { /******/ // handle errors in accept handlers and self accepted module load /******/ if (error) { /******/ return setStatus("fail").then(function () { /******/ throw error; /******/ }); /******/ } /******/ /******/ if (queuedInvalidatedModules) { /******/ return internalApply(options).then(function (list) { /******/ outdatedModules.forEach(function (moduleId) { /******/ if (list.indexOf(moduleId) < 0) list.push(moduleId); /******/ }); /******/ return list; /******/ }); /******/ } /******/ /******/ return setStatus("idle").then(function () { /******/ return outdatedModules; /******/ }); /******/ }); /******/ } /******/ /******/ function applyInvalidatedModules() { /******/ if (queuedInvalidatedModules) { /******/ if (!currentUpdateApplyHandlers) currentUpdateApplyHandlers = []; /******/ Object.keys(__webpack_require__.hmrI).forEach(function (key) { /******/ queuedInvalidatedModules.forEach(function (moduleId) { /******/ __webpack_require__.hmrI[key]( /******/ moduleId, /******/ currentUpdateApplyHandlers /******/ ); /******/ }); /******/ }); /******/ queuedInvalidatedModules = undefined; /******/ return true; /******/ } /******/ } /******/ })(); /******/ /******/ /* webpack/runtime/publicPath */ /******/ (() => { /******/ __webpack_require__.p = ""; /******/ })(); /******/ /******/ /* webpack/runtime/jsonp chunk loading */ /******/ (() => { /******/ // no baseURI /******/ /******/ // object to store loaded and loading chunks /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded /******/ var installedChunks = __webpack_require__.hmrS_jsonp = __webpack_require__.hmrS_jsonp || { /******/ "default": 0 /******/ }; /******/ /******/ // no chunk on demand loading /******/ /******/ // no prefetching /******/ /******/ // no preloaded /******/ /******/ var currentUpdatedModulesList; /******/ var waitingUpdateResolves = {}; /******/ function loadUpdateChunk(chunkId, updatedModulesList) { /******/ currentUpdatedModulesList = updatedModulesList; /******/ return new Promise((resolve, reject) => { /******/ waitingUpdateResolves[chunkId] = resolve; /******/ // start update chunk loading /******/ var url = __webpack_require__.p + __webpack_require__.hu(chunkId); /******/ // create error before stack unwound to get useful stacktrace later /******/ var error = new Error(); /******/ var loadingEnded = (event) => { /******/ if(waitingUpdateResolves[chunkId]) { /******/ waitingUpdateResolves[chunkId] = undefined /******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); /******/ var realSrc = event && event.target && event.target.src; /******/ error.message = 'Loading hot update chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')'; /******/ error.name = 'ChunkLoadError'; /******/ error.type = errorType; /******/ error.request = realSrc; /******/ reject(error); /******/ } /******/ }; /******/ __webpack_require__.l(url, loadingEnded); /******/ }); /******/ } /******/ /******/ global["webpackHotUpdatelocalization_editor"] = (chunkId, moreModules, runtime) => { /******/ for(var moduleId in moreModules) { /******/ if(__webpack_require__.o(moreModules, moduleId)) { /******/ currentUpdate[moduleId] = moreModules[moduleId]; /******/ if(currentUpdatedModulesList) currentUpdatedModulesList.push(moduleId); /******/ } /******/ } /******/ if(runtime) currentUpdateRuntime.push(runtime); /******/ if(waitingUpdateResolves[chunkId]) { /******/ waitingUpdateResolves[chunkId](); /******/ waitingUpdateResolves[chunkId] = undefined; /******/ } /******/ }; /******/ /******/ var currentUpdateChunks; /******/ var currentUpdate; /******/ var currentUpdateRemovedChunks; /******/ var currentUpdateRuntime; /******/ function applyHandler(options) { /******/ if (__webpack_require__.f) delete __webpack_require__.f.jsonpHmr; /******/ currentUpdateChunks = undefined; /******/ function getAffectedModuleEffects(updateModuleId) { /******/ var outdatedModules = [updateModuleId]; /******/ var outdatedDependencies = {}; /******/ /******/ var queue = outdatedModules.map(function (id) { /******/ return { /******/ chain: [id], /******/ id: id /******/ }; /******/ }); /******/ while (queue.length > 0) { /******/ var queueItem = queue.pop(); /******/ var moduleId = queueItem.id; /******/ var chain = queueItem.chain; /******/ var module = __webpack_require__.c[moduleId]; /******/ if ( /******/ !module || /******/ (module.hot._selfAccepted && !module.hot._selfInvalidated) /******/ ) /******/ continue; /******/ if (module.hot._selfDeclined) { /******/ return { /******/ type: "self-declined", /******/ chain: chain, /******/ moduleId: moduleId /******/ }; /******/ } /******/ if (module.hot._main) { /******/ return { /******/ type: "unaccepted", /******/ chain: chain, /******/ moduleId: moduleId /******/ }; /******/ } /******/ for (var i = 0; i < module.parents.length; i++) { /******/ var parentId = module.parents[i]; /******/ var parent = __webpack_require__.c[parentId]; /******/ if (!parent) continue; /******/ if (parent.hot._declinedDependencies[moduleId]) { /******/ return { /******/ type: "declined", /******/ chain: chain.concat([parentId]), /******/ moduleId: moduleId, /******/ parentId: parentId /******/ }; /******/ } /******/ if (outdatedModules.indexOf(parentId) !== -1) continue; /******/ if (parent.hot._acceptedDependencies[moduleId]) { /******/ if (!outdatedDependencies[parentId]) /******/ outdatedDependencies[parentId] = []; /******/ addAllToSet(outdatedDependencies[parentId], [moduleId]); /******/ continue; /******/ } /******/ delete outdatedDependencies[parentId]; /******/ outdatedModules.push(parentId); /******/ queue.push({ /******/ chain: chain.concat([parentId]), /******/ id: parentId /******/ }); /******/ } /******/ } /******/ /******/ return { /******/ type: "accepted", /******/ moduleId: updateModuleId, /******/ outdatedModules: outdatedModules, /******/ outdatedDependencies: outdatedDependencies /******/ }; /******/ } /******/ /******/ function addAllToSet(a, b) { /******/ for (var i = 0; i < b.length; i++) { /******/ var item = b[i]; /******/ if (a.indexOf(item) === -1) a.push(item); /******/ } /******/ } /******/ /******/ // at begin all updates modules are outdated /******/ // the "outdated" status can propagate to parents if they don't accept the children /******/ var outdatedDependencies = {}; /******/ var outdatedModules = []; /******/ var appliedUpdate = {}; /******/ /******/ var warnUnexpectedRequire = function warnUnexpectedRequire(module) { /******/ console.warn( /******/ "[HMR] unexpected require(" + module.id + ") to disposed module" /******/ ); /******/ }; /******/ /******/ for (var moduleId in currentUpdate) { /******/ if (__webpack_require__.o(currentUpdate, moduleId)) { /******/ var newModuleFactory = currentUpdate[moduleId]; /******/ /** @type {TODO} */ /******/ var result = newModuleFactory /******/ ? getAffectedModuleEffects(moduleId) /******/ : { /******/ type: "disposed", /******/ moduleId: moduleId /******/ }; /******/ /** @type {Error|false} */ /******/ var abortError = false; /******/ var doApply = false; /******/ var doDispose = false; /******/ var chainInfo = ""; /******/ if (result.chain) { /******/ chainInfo = "\nUpdate propagation: " + result.chain.join(" -> "); /******/ } /******/ switch (result.type) { /******/ case "self-declined": /******/ if (options.onDeclined) options.onDeclined(result); /******/ if (!options.ignoreDeclined) /******/ abortError = new Error( /******/ "Aborted because of self decline: " + /******/ result.moduleId + /******/ chainInfo /******/ ); /******/ break; /******/ case "declined": /******/ if (options.onDeclined) options.onDeclined(result); /******/ if (!options.ignoreDeclined) /******/ abortError = new Error( /******/ "Aborted because of declined dependency: " + /******/ result.moduleId + /******/ " in " + /******/ result.parentId + /******/ chainInfo /******/ ); /******/ break; /******/ case "unaccepted": /******/ if (options.onUnaccepted) options.onUnaccepted(result); /******/ if (!options.ignoreUnaccepted) /******/ abortError = new Error( /******/ "Aborted because " + moduleId + " is not accepted" + chainInfo /******/ ); /******/ break; /******/ case "accepted": /******/ if (options.onAccepted) options.onAccepted(result); /******/ doApply = true; /******/ break; /******/ case "disposed": /******/ if (options.onDisposed) options.onDisposed(result); /******/ doDispose = true; /******/ break; /******/ default: /******/ throw new Error("Unexception type " + result.type); /******/ } /******/ if (abortError) { /******/ return { /******/ error: abortError /******/ }; /******/ } /******/ if (doApply) { /******/ appliedUpdate[moduleId] = newModuleFactory; /******/ addAllToSet(outdatedModules, result.outdatedModules); /******/ for (moduleId in result.outdatedDependencies) { /******/ if (__webpack_require__.o(result.outdatedDependencies, moduleId)) { /******/ if (!outdatedDependencies[moduleId]) /******/ outdatedDependencies[moduleId] = []; /******/ addAllToSet( /******/ outdatedDependencies[moduleId], /******/ result.outdatedDependencies[moduleId] /******/ ); /******/ } /******/ } /******/ } /******/ if (doDispose) { /******/ addAllToSet(outdatedModules, [result.moduleId]); /******/ appliedUpdate[moduleId] = warnUnexpectedRequire; /******/ } /******/ } /******/ } /******/ currentUpdate = undefined; /******/ /******/ // Store self accepted outdated modules to require them later by the module system /******/ var outdatedSelfAcceptedModules = []; /******/ for (var j = 0; j < outdatedModules.length; j++) { /******/ var outdatedModuleId = outdatedModules[j]; /******/ var module = __webpack_require__.c[outdatedModuleId]; /******/ if ( /******/ module && /******/ (module.hot._selfAccepted || module.hot._main) && /******/ // removed self-accepted modules should not be required /******/ appliedUpdate[outdatedModuleId] !== warnUnexpectedRequire && /******/ // when called invalidate self-accepting is not possible /******/ !module.hot._selfInvalidated /******/ ) { /******/ outdatedSelfAcceptedModules.push({ /******/ module: outdatedModuleId, /******/ require: module.hot._requireSelf, /******/ errorHandler: module.hot._selfAccepted /******/ }); /******/ } /******/ } /******/ /******/ var moduleOutdatedDependencies; /******/ /******/ return { /******/ dispose: function () { /******/ currentUpdateRemovedChunks.forEach(function (chunkId) { /******/ delete installedChunks[chunkId]; /******/ }); /******/ currentUpdateRemovedChunks = undefined; /******/ /******/ var idx; /******/ var queue = outdatedModules.slice(); /******/ while (queue.length > 0) { /******/ var moduleId = queue.pop(); /******/ var module = __webpack_require__.c[moduleId]; /******/ if (!module) continue; /******/ /******/ var data = {}; /******/ /******/ // Call dispose handlers /******/ var disposeHandlers = module.hot._disposeHandlers; /******/ for (j = 0; j < disposeHandlers.length; j++) { /******/ disposeHandlers[j].call(null, data); /******/ } /******/ __webpack_require__.hmrD[moduleId] = data; /******/ /******/ // disable module (this disables requires from this module) /******/ module.hot.active = false; /******/ /******/ // remove module from cache /******/ delete __webpack_require__.c[moduleId]; /******/ /******/ // when disposing there is no need to call dispose handler /******/ delete outdatedDependencies[moduleId]; /******/ /******/ // remove "parents" references from all children /******/ for (j = 0; j < module.children.length; j++) { /******/ var child = __webpack_require__.c[module.children[j]]; /******/ if (!child) continue; /******/ idx = child.parents.indexOf(moduleId); /******/ if (idx >= 0) { /******/ child.parents.splice(idx, 1); /******/ } /******/ } /******/ } /******/ /******/ // remove outdated dependency from module children /******/ var dependency; /******/ for (var outdatedModuleId in outdatedDependencies) { /******/ if (__webpack_require__.o(outdatedDependencies, outdatedModuleId)) { /******/ module = __webpack_require__.c[outdatedModuleId]; /******/ if (module) { /******/ moduleOutdatedDependencies = /******/ outdatedDependencies[outdatedModuleId]; /******/ for (j = 0; j < moduleOutdatedDependencies.length; j++) { /******/ dependency = moduleOutdatedDependencies[j]; /******/ idx = module.children.indexOf(dependency); /******/ if (idx >= 0) module.children.splice(idx, 1); /******/ } /******/ } /******/ } /******/ } /******/ }, /******/ apply: function (reportError) { /******/ // insert new code /******/ for (var updateModuleId in appliedUpdate) { /******/ if (__webpack_require__.o(appliedUpdate, updateModuleId)) { /******/ __webpack_require__.m[updateModuleId] = appliedUpdate[updateModuleId]; /******/ } /******/ } /******/ /******/ // run new runtime modules /******/ for (var i = 0; i < currentUpdateRuntime.length; i++) { /******/ currentUpdateRuntime[i](__webpack_require__); /******/ } /******/ /******/ // call accept handlers /******/ for (var outdatedModuleId in outdatedDependencies) { /******/ if (__webpack_require__.o(outdatedDependencies, outdatedModuleId)) { /******/ var module = __webpack_require__.c[outdatedModuleId]; /******/ if (module) { /******/ moduleOutdatedDependencies = /******/ outdatedDependencies[outdatedModuleId]; /******/ var callbacks = []; /******/ var errorHandlers = []; /******/ var dependenciesForCallbacks = []; /******/ for (var j = 0; j < moduleOutdatedDependencies.length; j++) { /******/ var dependency = moduleOutdatedDependencies[j]; /******/ var acceptCallback = /******/ module.hot._acceptedDependencies[dependency]; /******/ var errorHandler = /******/ module.hot._acceptedErrorHandlers[dependency]; /******/ if (acceptCallback) { /******/ if (callbacks.indexOf(acceptCallback) !== -1) continue; /******/ callbacks.push(acceptCallback); /******/ errorHandlers.push(errorHandler); /******/ dependenciesForCallbacks.push(dependency); /******/ } /******/ } /******/ for (var k = 0; k < callbacks.length; k++) { /******/ try { /******/ callbacks[k].call(null, moduleOutdatedDependencies); /******/ } catch (err) { /******/ if (typeof errorHandlers[k] === "function") { /******/ try { /******/ errorHandlers[k](err, { /******/ moduleId: outdatedModuleId, /******/ dependencyId: dependenciesForCallbacks[k] /******/ }); /******/ } catch (err2) { /******/ if (options.onErrored) { /******/ options.onErrored({ /******/ type: "accept-error-handler-errored", /******/ moduleId: outdatedModuleId, /******/ dependencyId: dependenciesForCallbacks[k], /******/ error: err2, /******/ originalError: err /******/ }); /******/ } /******/ if (!options.ignoreErrored) { /******/ reportError(err2); /******/ reportError(err); /******/ } /******/ } /******/ } else { /******/ if (options.onErrored) { /******/ options.onErrored({ /******/ type: "accept-errored", /******/ moduleId: outdatedModuleId, /******/ dependencyId: dependenciesForCallbacks[k], /******/ error: err /******/ }); /******/ } /******/ if (!options.ignoreErrored) { /******/ reportError(err); /******/ } /******/ } /******/ } /******/ } /******/ } /******/ } /******/ } /******/ /******/ // Load self accepted modules /******/ for (var o = 0; o < outdatedSelfAcceptedModules.length; o++) { /******/ var item = outdatedSelfAcceptedModules[o]; /******/ var moduleId = item.module; /******/ try { /******/ item.require(moduleId); /******/ } catch (err) { /******/ if (typeof item.errorHandler === "function") { /******/ try { /******/ item.errorHandler(err, { /******/ moduleId: moduleId, /******/ module: __webpack_require__.c[moduleId] /******/ }); /******/ } catch (err1) { /******/ if (options.onErrored) { /******/ options.onErrored({ /******/ type: "self-accept-error-handler-errored", /******/ moduleId: moduleId, /******/ error: err1, /******/ originalError: err /******/ }); /******/ } /******/ if (!options.ignoreErrored) { /******/ reportError(err1); /******/ reportError(err); /******/ } /******/ } /******/ } else { /******/ if (options.onErrored) { /******/ options.onErrored({ /******/ type: "self-accept-errored", /******/ moduleId: moduleId, /******/ error: err /******/ }); /******/ } /******/ if (!options.ignoreErrored) { /******/ reportError(err); /******/ } /******/ } /******/ } /******/ } /******/ /******/ return outdatedModules; /******/ } /******/ }; /******/ } /******/ __webpack_require__.hmrI.jsonp = function (moduleId, applyHandlers) { /******/ if (!currentUpdate) { /******/ currentUpdate = {}; /******/ currentUpdateRuntime = []; /******/ currentUpdateRemovedChunks = []; /******/ applyHandlers.push(applyHandler); /******/ } /******/ if (!__webpack_require__.o(currentUpdate, moduleId)) { /******/ currentUpdate[moduleId] = __webpack_require__.m[moduleId]; /******/ } /******/ }; /******/ __webpack_require__.hmrC.jsonp = function ( /******/ chunkIds, /******/ removedChunks, /******/ removedModules, /******/ promises, /******/ applyHandlers, /******/ updatedModulesList /******/ ) { /******/ applyHandlers.push(applyHandler); /******/ currentUpdateChunks = {}; /******/ currentUpdateRemovedChunks = removedChunks; /******/ currentUpdate = removedModules.reduce(function (obj, key) { /******/ obj[key] = false; /******/ return obj; /******/ }, {}); /******/ currentUpdateRuntime = []; /******/ chunkIds.forEach(function (chunkId) { /******/ if ( /******/ __webpack_require__.o(installedChunks, chunkId) && /******/ installedChunks[chunkId] !== undefined /******/ ) { /******/ promises.push(loadUpdateChunk(chunkId, updatedModulesList)); /******/ currentUpdateChunks[chunkId] = true; /******/ } else { /******/ currentUpdateChunks[chunkId] = false; /******/ } /******/ }); /******/ if (__webpack_require__.f) { /******/ __webpack_require__.f.jsonpHmr = function (chunkId, promises) { /******/ if ( /******/ currentUpdateChunks && /******/ __webpack_require__.o(currentUpdateChunks, chunkId) && /******/ !currentUpdateChunks[chunkId] /******/ ) { /******/ promises.push(loadUpdateChunk(chunkId)); /******/ currentUpdateChunks[chunkId] = true; /******/ } /******/ }; /******/ } /******/ }; /******/ /******/ __webpack_require__.hmrM = () => { /******/ if (typeof fetch === "undefined") throw new Error("No browser support: need fetch API"); /******/ return fetch(__webpack_require__.p + __webpack_require__.hmrF()).then((response) => { /******/ if(response.status === 404) return; // no update available /******/ if(!response.ok) throw new Error("Failed to fetch update manifest " + response.statusText); /******/ return response.json(); /******/ }); /******/ }; /******/ /******/ // no on chunks loaded /******/ /******/ // no jsonp function /******/ })(); /******/ /************************************************************************/ /******/ /******/ // module cache are used so entry inlining is disabled /******/ // startup /******/ // Load entry module and return exports /******/ var __webpack_exports__ = __webpack_require__("./src/panel/default/index.ts"); /******/ /******/ return __webpack_exports__; /******/ })() ; }); //# sourceMappingURL=default.js.map