PKT|[`[adapters/README.mdnuIw# axios // adapters The modules under `adapters/` are modules that handle dispatching a request and settling a returned `Promise` once a response is received. ## Example ```js var settle = require('./../core/settle'); module.exports = function myAdapter(config) { // At this point: // - config has been merged with defaults // - request transformers have already run // - request interceptors have already run // Make the request using config provided // Upon response settle the Promise return new Promise(function(resolve, reject) { var response = { data: responseData, status: request.status, statusText: request.statusText, headers: responseHeaders, config: config, request: request }; settle(resolve, reject, response); // From here: // - response transformers will run // - response interceptors will run }); } ``` PKT|[]Y `A7A7adapters/http.jsnu̗'use strict'; var utils = require('./../utils'); var settle = require('./../core/settle'); var buildFullPath = require('../core/buildFullPath'); var buildURL = require('./../helpers/buildURL'); var http = require('http'); var https = require('https'); var httpFollow = require('follow-redirects').http; var httpsFollow = require('follow-redirects').https; var url = require('url'); var zlib = require('zlib'); var VERSION = require('./../env/data').version; var transitionalDefaults = require('../defaults/transitional'); var AxiosError = require('../core/AxiosError'); var CanceledError = require('../cancel/CanceledError'); var isHttps = /https:?/; var supportedProtocols = [ 'http:', 'https:', 'file:' ]; /** * * @param {http.ClientRequestArgs} options * @param {AxiosProxyConfig} proxy * @param {string} location */ function setProxy(options, proxy, location) { options.hostname = proxy.host; options.host = proxy.host; options.port = proxy.port; options.path = location; // Basic proxy authorization if (proxy.auth) { var base64 = Buffer.from(proxy.auth.username + ':' + proxy.auth.password, 'utf8').toString('base64'); options.headers['Proxy-Authorization'] = 'Basic ' + base64; } // If a proxy is used, any redirects must also pass through the proxy options.beforeRedirect = function beforeRedirect(redirection) { redirection.headers.host = redirection.host; setProxy(redirection, proxy, redirection.href); }; } /*eslint consistent-return:0*/ module.exports = function httpAdapter(config) { return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) { var onCanceled; function done() { if (config.cancelToken) { config.cancelToken.unsubscribe(onCanceled); } if (config.signal) { config.signal.removeEventListener('abort', onCanceled); } } var resolve = function resolve(value) { done(); resolvePromise(value); }; var rejected = false; var reject = function reject(value) { done(); rejected = true; rejectPromise(value); }; var data = config.data; var headers = config.headers; var headerNames = {}; Object.keys(headers).forEach(function storeLowerName(name) { headerNames[name.toLowerCase()] = name; }); // Set User-Agent (required by some servers) // See https://github.com/axios/axios/issues/69 if ('user-agent' in headerNames) { // User-Agent is specified; handle case where no UA header is desired if (!headers[headerNames['user-agent']]) { delete headers[headerNames['user-agent']]; } // Otherwise, use specified value } else { // Only set header if it hasn't been set in config headers['User-Agent'] = 'axios/' + VERSION; } // support for https://www.npmjs.com/package/form-data api if (utils.isFormData(data) && utils.isFunction(data.getHeaders)) { Object.assign(headers, data.getHeaders()); } else if (data && !utils.isStream(data)) { if (Buffer.isBuffer(data)) { // Nothing to do... } else if (utils.isArrayBuffer(data)) { data = Buffer.from(new Uint8Array(data)); } else if (utils.isString(data)) { data = Buffer.from(data, 'utf-8'); } else { return reject(new AxiosError( 'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream', AxiosError.ERR_BAD_REQUEST, config )); } if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) { return reject(new AxiosError( 'Request body larger than maxBodyLength limit', AxiosError.ERR_BAD_REQUEST, config )); } // Add Content-Length header if data exists if (!headerNames['content-length']) { headers['Content-Length'] = data.length; } } // HTTP basic authentication var auth = undefined; if (config.auth) { var username = config.auth.username || ''; var password = config.auth.password || ''; auth = username + ':' + password; } // Parse url var fullPath = buildFullPath(config.baseURL, config.url); var parsed = url.parse(fullPath); var protocol = parsed.protocol || supportedProtocols[0]; if (supportedProtocols.indexOf(protocol) === -1) { return reject(new AxiosError( 'Unsupported protocol ' + protocol, AxiosError.ERR_BAD_REQUEST, config )); } if (!auth && parsed.auth) { var urlAuth = parsed.auth.split(':'); var urlUsername = urlAuth[0] || ''; var urlPassword = urlAuth[1] || ''; auth = urlUsername + ':' + urlPassword; } if (auth && headerNames.authorization) { delete headers[headerNames.authorization]; } var isHttpsRequest = isHttps.test(protocol); var agent = isHttpsRequest ? config.httpsAgent : config.httpAgent; try { buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\?/, ''); } catch (err) { var customErr = new Error(err.message); customErr.config = config; customErr.url = config.url; customErr.exists = true; reject(customErr); } var options = { path: buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\?/, ''), method: config.method.toUpperCase(), headers: headers, agent: agent, agents: { http: config.httpAgent, https: config.httpsAgent }, auth: auth }; if (config.socketPath) { options.socketPath = config.socketPath; } else { options.hostname = parsed.hostname; options.port = parsed.port; } var proxy = config.proxy; if (!proxy && proxy !== false) { var proxyEnv = protocol.slice(0, -1) + '_proxy'; var proxyUrl = process.env[proxyEnv] || process.env[proxyEnv.toUpperCase()]; if (proxyUrl) { var parsedProxyUrl = url.parse(proxyUrl); var noProxyEnv = process.env.no_proxy || process.env.NO_PROXY; var shouldProxy = true; if (noProxyEnv) { var noProxy = noProxyEnv.split(',').map(function trim(s) { return s.trim(); }); shouldProxy = !noProxy.some(function proxyMatch(proxyElement) { if (!proxyElement) { return false; } if (proxyElement === '*') { return true; } if (proxyElement[0] === '.' && parsed.hostname.substr(parsed.hostname.length - proxyElement.length) === proxyElement) { return true; } return parsed.hostname === proxyElement; }); } if (shouldProxy) { proxy = { host: parsedProxyUrl.hostname, port: parsedProxyUrl.port, protocol: parsedProxyUrl.protocol }; if (parsedProxyUrl.auth) { var proxyUrlAuth = parsedProxyUrl.auth.split(':'); proxy.auth = { username: proxyUrlAuth[0], password: proxyUrlAuth[1] }; } } } } if (proxy) { options.headers.host = parsed.hostname + (parsed.port ? ':' + parsed.port : ''); setProxy(options, proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path); } var transport; var isHttpsProxy = isHttpsRequest && (proxy ? isHttps.test(proxy.protocol) : true); if (config.transport) { transport = config.transport; } else if (config.maxRedirects === 0) { transport = isHttpsProxy ? https : http; } else { if (config.maxRedirects) { options.maxRedirects = config.maxRedirects; } if (config.beforeRedirect) { options.beforeRedirect = config.beforeRedirect; } transport = isHttpsProxy ? httpsFollow : httpFollow; } if (config.maxBodyLength > -1) { options.maxBodyLength = config.maxBodyLength; } if (config.insecureHTTPParser) { options.insecureHTTPParser = config.insecureHTTPParser; } // Create the request var req = transport.request(options, function handleResponse(res) { if (req.aborted) return; // uncompress the response body transparently if required var stream = res; // return the last request in case of redirects var lastRequest = res.req || req; // if no content, is HEAD request or decompress disabled we should not decompress if (res.statusCode !== 204 && lastRequest.method !== 'HEAD' && config.decompress !== false) { switch (res.headers['content-encoding']) { /*eslint default-case:0*/ case 'gzip': case 'compress': case 'deflate': // add the unzipper to the body stream processing pipeline stream = stream.pipe(zlib.createUnzip()); // remove the content-encoding in order to not confuse downstream operations delete res.headers['content-encoding']; break; } } var response = { status: res.statusCode, statusText: res.statusMessage, headers: res.headers, config: config, request: lastRequest }; if (config.responseType === 'stream') { response.data = stream; settle(resolve, reject, response); } else { var responseBuffer = []; var totalResponseBytes = 0; stream.on('data', function handleStreamData(chunk) { responseBuffer.push(chunk); totalResponseBytes += chunk.length; // make sure the content length is not over the maxContentLength if specified if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) { // stream.destoy() emit aborted event before calling reject() on Node.js v16 rejected = true; stream.destroy(); reject(new AxiosError('maxContentLength size of ' + config.maxContentLength + ' exceeded', AxiosError.ERR_BAD_RESPONSE, config, lastRequest)); } }); stream.on('aborted', function handlerStreamAborted() { if (rejected) { return; } stream.destroy(); reject(new AxiosError( 'maxContentLength size of ' + config.maxContentLength + ' exceeded', AxiosError.ERR_BAD_RESPONSE, config, lastRequest )); }); stream.on('error', function handleStreamError(err) { if (req.aborted) return; reject(AxiosError.from(err, null, config, lastRequest)); }); stream.on('end', function handleStreamEnd() { try { var responseData = responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer); if (config.responseType !== 'arraybuffer') { responseData = responseData.toString(config.responseEncoding); if (!config.responseEncoding || config.responseEncoding === 'utf8') { responseData = utils.stripBOM(responseData); } } response.data = responseData; } catch (err) { reject(AxiosError.from(err, null, config, response.request, response)); } settle(resolve, reject, response); }); } }); // Handle errors req.on('error', function handleRequestError(err) { // @todo remove // if (req.aborted && err.code !== AxiosError.ERR_FR_TOO_MANY_REDIRECTS) return; reject(AxiosError.from(err, null, config, req)); }); // set tcp keep alive to prevent drop connection by peer req.on('socket', function handleRequestSocket(socket) { // default interval of sending ack packet is 1 minute socket.setKeepAlive(true, 1000 * 60); }); // Handle request timeout if (config.timeout) { // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types. var timeout = parseInt(config.timeout, 10); if (isNaN(timeout)) { reject(new AxiosError( 'error trying to parse `config.timeout` to int', AxiosError.ERR_BAD_OPTION_VALUE, config, req )); return; } // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system. // And timer callback will be fired, and abort() will be invoked before connection, then get "socket hang up" and code ECONNRESET. // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up. // And then these socket which be hang up will devoring CPU little by little. // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect. req.setTimeout(timeout, function handleRequestTimeout() { req.abort(); var transitional = config.transitional || transitionalDefaults; reject(new AxiosError( 'timeout of ' + timeout + 'ms exceeded', transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, config, req )); }); } if (config.cancelToken || config.signal) { // Handle cancellation // eslint-disable-next-line func-names onCanceled = function(cancel) { if (req.aborted) return; req.abort(); reject(!cancel || (cancel && cancel.type) ? new CanceledError() : cancel); }; config.cancelToken && config.cancelToken.subscribe(onCanceled); if (config.signal) { config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled); } } // Send the request if (utils.isStream(data)) { data.on('error', function handleStreamError(err) { reject(AxiosError.from(err, config, null, req)); }).pipe(req); } else { req.end(data); } }); }; PKT|[~Aadapters/xhr.jsnuIw'use strict'; var utils = require('./../utils'); var settle = require('./../core/settle'); var cookies = require('./../helpers/cookies'); var buildURL = require('./../helpers/buildURL'); var buildFullPath = require('../core/buildFullPath'); var parseHeaders = require('./../helpers/parseHeaders'); var isURLSameOrigin = require('./../helpers/isURLSameOrigin'); var transitionalDefaults = require('../defaults/transitional'); var AxiosError = require('../core/AxiosError'); var CanceledError = require('../cancel/CanceledError'); var parseProtocol = require('../helpers/parseProtocol'); 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); }); }; PKT|[a cancel/CancelToken.jsnuIw'use strict'; var CanceledError = require('./CanceledError'); /** * 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; PKT|[!!!cancel/CanceledError.jsnuIw'use strict'; var AxiosError = require('../core/AxiosError'); var utils = require('../utils'); /** * 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; PKT|[Offcancel/isCancel.jsnuIw'use strict'; module.exports = function isCancel(value) { return !!(value && value.__CANCEL__); }; PKT|[Y core/Axios.jsnuIw'use strict'; var utils = require('./../utils'); var buildURL = require('../helpers/buildURL'); var InterceptorManager = require('./InterceptorManager'); var dispatchRequest = require('./dispatchRequest'); var mergeConfig = require('./mergeConfig'); var buildFullPath = require('./buildFullPath'); var validator = require('../helpers/validator'); 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; PKT|[3) core/AxiosError.jsnuIw'use strict'; var utils = require('../utils'); /** * 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; PKT|[%SScore/InterceptorManager.jsnuIw'use strict'; var utils = require('./../utils'); 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; PKT|[6core/README.mdnuIw# axios // core The modules found in `core/` should be modules that are specific to the domain logic of axios. These modules would most likely not make sense to be consumed outside of the axios module, as their logic is too specific. Some examples of core modules are: - Dispatching requests - Requests sent via `adapters/` (see lib/adapters/README.md) - Managing interceptors - Handling config PKT|[v۷core/buildFullPath.jsnuIw'use strict'; var isAbsoluteURL = require('../helpers/isAbsoluteURL'); var combineURLs = require('../helpers/combineURLs'); /** * 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; }; PKT|[ABѧ\\core/dispatchRequest.jsnuIw'use strict'; var utils = require('./../utils'); var transformData = require('./transformData'); var isCancel = require('../cancel/isCancel'); var defaults = require('../defaults'); var CanceledError = require('../cancel/CanceledError'); /** * 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); }); }; PKT|[ˣ core/mergeConfig.jsnuIw'use strict'; var utils = require('../utils'); /** * 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; }; PKT|[P\core/settle.jsnuIw'use strict'; var AxiosError = require('./AxiosError'); /** * 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 )); } }; PKT|[ֽ6}}core/transformData.jsnuIw'use strict'; var utils = require('./../utils'); var defaults = require('../defaults'); /** * 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; }; PKT|[FEJJdefaults/env/FormData.jsnuIw// eslint-disable-next-line strict module.exports = require('form-data'); PKT|[ ̰defaults/index.jsnuIw'use strict'; var utils = require('../utils'); var normalizeHeaderName = require('../helpers/normalizeHeaderName'); var AxiosError = require('../core/AxiosError'); var transitionalDefaults = require('./transitional'); var toFormData = require('../helpers/toFormData'); 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 = require('../adapters/xhr'); } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') { // For node use HTTP adapter adapter = require('../adapters/http'); } 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: require('./env/FormData') }, 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; PKT|[G&xxdefaults/transitional.jsnuIw'use strict'; module.exports = { silentJSONParsing: true, forcedJSONParsing: true, clarifyTimeoutError: false }; PKT|[ env/README.mdnuIw# axios // env The `data.js` file is updated automatically when the package version is upgrading. Please do not edit it manually. PKT|[ ++ env/data.jsnuIwmodule.exports = { "version": "0.27.2" };PKT|[^__helpers/README.mdnuIw# axios // helpers The modules found in `helpers/` should be generic modules that are _not_ specific to the domain logic of axios. These modules could theoretically be published to npm on their own and consumed by other modules or apps. Some examples of generic modules are things like: - Browser polyfills - Managing cookies - Parsing HTTP headers PKT|[helpers/bind.jsnuIw'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); }; }; PKT|[C>\llhelpers/buildURL.jsnuIw'use strict'; var utils = require('./../utils'); 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; }; PKT|[y||helpers/combineURLs.jsnuIw'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; }; PKT|[$bhelpers/cookies.jsnuIw'use strict'; var utils = require('./../utils'); 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() {} }; })() ); PKT|[chelpers/deprecatedMethod.jsnuIw'use strict'; /*eslint no-console:0*/ /** * Supply a warning to the developer that a method they are using * has been deprecated. * * @param {string} method The name of the deprecated method * @param {string} [instead] The alternate method to use if applicable * @param {string} [docs] The documentation URL to get further details */ module.exports = function deprecatedMethod(method, instead, docs) { try { console.warn( 'DEPRECATED method `' + method + '`.' + (instead ? ' Use `' + instead + '` instead.' : '') + ' This method will be removed in a future release.'); if (docs) { console.warn('For more information about usage see ' + docs); } } catch (e) { /* Ignore */ } }; PKT|[וY11helpers/isAbsoluteURL.jsnuIw'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 "://" 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); }; PKT|[K7uuhelpers/isAxiosError.jsnuIw'use strict'; var utils = require('./../utils'); /** * 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); }; PKT|[c(  helpers/isURLSameOrigin.jsnuIw'use strict'; var utils = require('./../utils'); 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; }; })() ); PKT|[\eehelpers/normalizeHeaderName.jsnuIw'use strict'; var utils = require('../utils'); 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]; } }); }; PKT|[$H::helpers/null.jsnuIw// eslint-disable-next-line strict module.exports = null; PKT|[o,qqhelpers/parseHeaders.jsnuIw'use strict'; var utils = require('./../utils'); // 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; }; PKT|[ 1Uhelpers/parseProtocol.jsnuIw'use strict'; module.exports = function parseProtocol(url) { var match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url); return match && match[1] || ''; }; PKT|[SD44helpers/spread.jsnuIw'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); }; }; PKT|[gvhelpers/toFormData.jsnuIw'use strict'; var utils = require('../utils'); /** * 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; PKT|[lNa helpers/validator.jsnuIw'use strict'; var VERSION = require('../env/data').version; var AxiosError = require('../core/AxiosError'); 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 }; PKT|[naxios.jsnuIw'use strict'; var utils = require('./utils'); var bind = require('./helpers/bind'); var Axios = require('./core/Axios'); var mergeConfig = require('./core/mergeConfig'); var defaults = require('./defaults'); /** * 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 = require('./cancel/CanceledError'); axios.CancelToken = require('./cancel/CancelToken'); axios.isCancel = require('./cancel/isCancel'); axios.VERSION = require('./env/data').version; axios.toFormData = require('./helpers/toFormData'); // Expose AxiosError class axios.AxiosError = require('../lib/core/AxiosError'); // alias for CanceledError for backward compatibility axios.Cancel = axios.CanceledError; // Expose all/spread axios.all = function all(promises) { return Promise.all(promises); }; axios.spread = require('./helpers/spread'); // Expose isAxiosError axios.isAxiosError = require('./helpers/isAxiosError'); module.exports = axios; // Allow use of default import syntax in TypeScript module.exports.default = axios; PKT|[[΄..utils.jsnuIw'use strict'; var bind = require('./helpers/bind'); // 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 }; PK|[%S S cli.jsnu̗#!/usr/bin/env node const fs = require('fs') const path = require('path') const minimist = require('minimist') const pkg = require('../package.json') const JSON5 = require('./') const argv = minimist(process.argv.slice(2), { alias: { 'convert': 'c', 'space': 's', 'validate': 'v', 'out-file': 'o', 'version': 'V', 'help': 'h', }, boolean: [ 'convert', 'validate', 'version', 'help', ], string: [ 'space', 'out-file', ], }) if (argv.version) { version() } else if (argv.help) { usage() } else { const inFilename = argv._[0] let readStream if (inFilename) { readStream = fs.createReadStream(inFilename) } else { readStream = process.stdin } let json5 = '' readStream.on('data', data => { json5 += data }) readStream.on('end', () => { let space if (argv.space === 't' || argv.space === 'tab') { space = '\t' } else { space = Number(argv.space) } let value try { value = JSON5.parse(json5) if (!argv.validate) { const json = JSON.stringify(value, null, space) let writeStream // --convert is for backward compatibility with v0.5.1. If // specified with and not --out-file, then a file with // the same name but with a .json extension will be written. if (argv.convert && inFilename && !argv.o) { const parsedFilename = path.parse(inFilename) const outFilename = path.format( Object.assign( parsedFilename, {base: path.basename(parsedFilename.base, parsedFilename.ext) + '.json'} ) ) writeStream = fs.createWriteStream(outFilename) } else if (argv.o) { writeStream = fs.createWriteStream(argv.o) } else { writeStream = process.stdout } writeStream.write(json) } } catch (err) { console.error(err.message) process.exit(1) } }) } function version () { console.log(pkg.version) } function usage () { console.log( ` Usage: json5 [options] If is not provided, then STDIN is used. Options: -s, --space The number of spaces to indent or 't' for tabs -o, --out-file [file] Output to the specified file, otherwise STDOUT -v, --validate Validate JSON5 but do not output JSON -V, --version Output the version number -h, --help Output usage information` ) } PK|[#ggg index.d.tsnuIwimport parse = require('./parse') import stringify = require('./stringify') export {parse, stringify} PK|[-6 index.jsnuIwconst parse = require('./parse') const stringify = require('./stringify') const JSON5 = { parse, stringify, } module.exports = JSON5 PK|[ht parse.d.tsnuIw/** * Parses a JSON5 string, constructing the JavaScript value or object described * by the string. * @template T The type of the return value. * @param text The string to parse as JSON5. * @param reviver A function that prescribes how the value originally produced * by parsing is transformed before being returned. * @returns The JavaScript value converted from the JSON5 string. */ declare function parse( text: string, reviver?: ((this: any, key: string, value: any) => any) | null, ): T export = parse PK|[lSSparse.jsnuIwconst util = require('./util') let source let parseState let stack let pos let line let column let token let key let root module.exports = function parse (text, reviver) { source = String(text) parseState = 'start' stack = [] pos = 0 line = 1 column = 0 token = undefined key = undefined root = undefined do { token = lex() // This code is unreachable. // if (!parseStates[parseState]) { // throw invalidParseState() // } parseStates[parseState]() } while (token.type !== 'eof') if (typeof reviver === 'function') { return internalize({'': root}, '', reviver) } return root } function internalize (holder, name, reviver) { const value = holder[name] if (value != null && typeof value === 'object') { for (const key in value) { const replacement = internalize(value, key, reviver) if (replacement === undefined) { delete value[key] } else { value[key] = replacement } } } return reviver.call(holder, name, value) } let lexState let buffer let doubleQuote let sign let c function lex () { lexState = 'default' buffer = '' doubleQuote = false sign = 1 for (;;) { c = peek() // This code is unreachable. // if (!lexStates[lexState]) { // throw invalidLexState(lexState) // } const token = lexStates[lexState]() if (token) { return token } } } function peek () { if (source[pos]) { return String.fromCodePoint(source.codePointAt(pos)) } } function read () { const c = peek() if (c === '\n') { line++ column = 0 } else if (c) { column += c.length } else { column++ } if (c) { pos += c.length } return c } const lexStates = { default () { switch (c) { case '\t': case '\v': case '\f': case ' ': case '\u00A0': case '\uFEFF': case '\n': case '\r': case '\u2028': case '\u2029': read() return case '/': read() lexState = 'comment' return case undefined: read() return newToken('eof') } if (util.isSpaceSeparator(c)) { read() return } // This code is unreachable. // if (!lexStates[parseState]) { // throw invalidLexState(parseState) // } return lexStates[parseState]() }, comment () { switch (c) { case '*': read() lexState = 'multiLineComment' return case '/': read() lexState = 'singleLineComment' return } throw invalidChar(read()) }, multiLineComment () { switch (c) { case '*': read() lexState = 'multiLineCommentAsterisk' return case undefined: throw invalidChar(read()) } read() }, multiLineCommentAsterisk () { switch (c) { case '*': read() return case '/': read() lexState = 'default' return case undefined: throw invalidChar(read()) } read() lexState = 'multiLineComment' }, singleLineComment () { switch (c) { case '\n': case '\r': case '\u2028': case '\u2029': read() lexState = 'default' return case undefined: read() return newToken('eof') } read() }, value () { switch (c) { case '{': case '[': return newToken('punctuator', read()) case 'n': read() literal('ull') return newToken('null', null) case 't': read() literal('rue') return newToken('boolean', true) case 'f': read() literal('alse') return newToken('boolean', false) case '-': case '+': if (read() === '-') { sign = -1 } lexState = 'sign' return case '.': buffer = read() lexState = 'decimalPointLeading' return case '0': buffer = read() lexState = 'zero' return case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': buffer = read() lexState = 'decimalInteger' return case 'I': read() literal('nfinity') return newToken('numeric', Infinity) case 'N': read() literal('aN') return newToken('numeric', NaN) case '"': case "'": doubleQuote = (read() === '"') buffer = '' lexState = 'string' return } throw invalidChar(read()) }, identifierNameStartEscape () { if (c !== 'u') { throw invalidChar(read()) } read() const u = unicodeEscape() switch (u) { case '$': case '_': break default: if (!util.isIdStartChar(u)) { throw invalidIdentifier() } break } buffer += u lexState = 'identifierName' }, identifierName () { switch (c) { case '$': case '_': case '\u200C': case '\u200D': buffer += read() return case '\\': read() lexState = 'identifierNameEscape' return } if (util.isIdContinueChar(c)) { buffer += read() return } return newToken('identifier', buffer) }, identifierNameEscape () { if (c !== 'u') { throw invalidChar(read()) } read() const u = unicodeEscape() switch (u) { case '$': case '_': case '\u200C': case '\u200D': break default: if (!util.isIdContinueChar(u)) { throw invalidIdentifier() } break } buffer += u lexState = 'identifierName' }, sign () { switch (c) { case '.': buffer = read() lexState = 'decimalPointLeading' return case '0': buffer = read() lexState = 'zero' return case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': buffer = read() lexState = 'decimalInteger' return case 'I': read() literal('nfinity') return newToken('numeric', sign * Infinity) case 'N': read() literal('aN') return newToken('numeric', NaN) } throw invalidChar(read()) }, zero () { switch (c) { case '.': buffer += read() lexState = 'decimalPoint' return case 'e': case 'E': buffer += read() lexState = 'decimalExponent' return case 'x': case 'X': buffer += read() lexState = 'hexadecimal' return } return newToken('numeric', sign * 0) }, decimalInteger () { switch (c) { case '.': buffer += read() lexState = 'decimalPoint' return case 'e': case 'E': buffer += read() lexState = 'decimalExponent' return } if (util.isDigit(c)) { buffer += read() return } return newToken('numeric', sign * Number(buffer)) }, decimalPointLeading () { if (util.isDigit(c)) { buffer += read() lexState = 'decimalFraction' return } throw invalidChar(read()) }, decimalPoint () { switch (c) { case 'e': case 'E': buffer += read() lexState = 'decimalExponent' return } if (util.isDigit(c)) { buffer += read() lexState = 'decimalFraction' return } return newToken('numeric', sign * Number(buffer)) }, decimalFraction () { switch (c) { case 'e': case 'E': buffer += read() lexState = 'decimalExponent' return } if (util.isDigit(c)) { buffer += read() return } return newToken('numeric', sign * Number(buffer)) }, decimalExponent () { switch (c) { case '+': case '-': buffer += read() lexState = 'decimalExponentSign' return } if (util.isDigit(c)) { buffer += read() lexState = 'decimalExponentInteger' return } throw invalidChar(read()) }, decimalExponentSign () { if (util.isDigit(c)) { buffer += read() lexState = 'decimalExponentInteger' return } throw invalidChar(read()) }, decimalExponentInteger () { if (util.isDigit(c)) { buffer += read() return } return newToken('numeric', sign * Number(buffer)) }, hexadecimal () { if (util.isHexDigit(c)) { buffer += read() lexState = 'hexadecimalInteger' return } throw invalidChar(read()) }, hexadecimalInteger () { if (util.isHexDigit(c)) { buffer += read() return } return newToken('numeric', sign * Number(buffer)) }, string () { switch (c) { case '\\': read() buffer += escape() return case '"': if (doubleQuote) { read() return newToken('string', buffer) } buffer += read() return case "'": if (!doubleQuote) { read() return newToken('string', buffer) } buffer += read() return case '\n': case '\r': throw invalidChar(read()) case '\u2028': case '\u2029': separatorChar(c) break case undefined: throw invalidChar(read()) } buffer += read() }, start () { switch (c) { case '{': case '[': return newToken('punctuator', read()) // This code is unreachable since the default lexState handles eof. // case undefined: // return newToken('eof') } lexState = 'value' }, beforePropertyName () { switch (c) { case '$': case '_': buffer = read() lexState = 'identifierName' return case '\\': read() lexState = 'identifierNameStartEscape' return case '}': return newToken('punctuator', read()) case '"': case "'": doubleQuote = (read() === '"') lexState = 'string' return } if (util.isIdStartChar(c)) { buffer += read() lexState = 'identifierName' return } throw invalidChar(read()) }, afterPropertyName () { if (c === ':') { return newToken('punctuator', read()) } throw invalidChar(read()) }, beforePropertyValue () { lexState = 'value' }, afterPropertyValue () { switch (c) { case ',': case '}': return newToken('punctuator', read()) } throw invalidChar(read()) }, beforeArrayValue () { if (c === ']') { return newToken('punctuator', read()) } lexState = 'value' }, afterArrayValue () { switch (c) { case ',': case ']': return newToken('punctuator', read()) } throw invalidChar(read()) }, end () { // This code is unreachable since it's handled by the default lexState. // if (c === undefined) { // read() // return newToken('eof') // } throw invalidChar(read()) }, } function newToken (type, value) { return { type, value, line, column, } } function literal (s) { for (const c of s) { const p = peek() if (p !== c) { throw invalidChar(read()) } read() } } function escape () { const c = peek() switch (c) { case 'b': read() return '\b' case 'f': read() return '\f' case 'n': read() return '\n' case 'r': read() return '\r' case 't': read() return '\t' case 'v': read() return '\v' case '0': read() if (util.isDigit(peek())) { throw invalidChar(read()) } return '\0' case 'x': read() return hexEscape() case 'u': read() return unicodeEscape() case '\n': case '\u2028': case '\u2029': read() return '' case '\r': read() if (peek() === '\n') { read() } return '' case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': throw invalidChar(read()) case undefined: throw invalidChar(read()) } return read() } function hexEscape () { let buffer = '' let c = peek() if (!util.isHexDigit(c)) { throw invalidChar(read()) } buffer += read() c = peek() if (!util.isHexDigit(c)) { throw invalidChar(read()) } buffer += read() return String.fromCodePoint(parseInt(buffer, 16)) } function unicodeEscape () { let buffer = '' let count = 4 while (count-- > 0) { const c = peek() if (!util.isHexDigit(c)) { throw invalidChar(read()) } buffer += read() } return String.fromCodePoint(parseInt(buffer, 16)) } const parseStates = { start () { if (token.type === 'eof') { throw invalidEOF() } push() }, beforePropertyName () { switch (token.type) { case 'identifier': case 'string': key = token.value parseState = 'afterPropertyName' return case 'punctuator': // This code is unreachable since it's handled by the lexState. // if (token.value !== '}') { // throw invalidToken() // } pop() return case 'eof': throw invalidEOF() } // This code is unreachable since it's handled by the lexState. // throw invalidToken() }, afterPropertyName () { // This code is unreachable since it's handled by the lexState. // if (token.type !== 'punctuator' || token.value !== ':') { // throw invalidToken() // } if (token.type === 'eof') { throw invalidEOF() } parseState = 'beforePropertyValue' }, beforePropertyValue () { if (token.type === 'eof') { throw invalidEOF() } push() }, beforeArrayValue () { if (token.type === 'eof') { throw invalidEOF() } if (token.type === 'punctuator' && token.value === ']') { pop() return } push() }, afterPropertyValue () { // This code is unreachable since it's handled by the lexState. // if (token.type !== 'punctuator') { // throw invalidToken() // } if (token.type === 'eof') { throw invalidEOF() } switch (token.value) { case ',': parseState = 'beforePropertyName' return case '}': pop() } // This code is unreachable since it's handled by the lexState. // throw invalidToken() }, afterArrayValue () { // This code is unreachable since it's handled by the lexState. // if (token.type !== 'punctuator') { // throw invalidToken() // } if (token.type === 'eof') { throw invalidEOF() } switch (token.value) { case ',': parseState = 'beforeArrayValue' return case ']': pop() } // This code is unreachable since it's handled by the lexState. // throw invalidToken() }, end () { // This code is unreachable since it's handled by the lexState. // if (token.type !== 'eof') { // throw invalidToken() // } }, } function push () { let value switch (token.type) { case 'punctuator': switch (token.value) { case '{': value = {} break case '[': value = [] break } break case 'null': case 'boolean': case 'numeric': case 'string': value = token.value break // This code is unreachable. // default: // throw invalidToken() } if (root === undefined) { root = value } else { const parent = stack[stack.length - 1] if (Array.isArray(parent)) { parent.push(value) } else { parent[key] = value } } if (value !== null && typeof value === 'object') { stack.push(value) if (Array.isArray(value)) { parseState = 'beforeArrayValue' } else { parseState = 'beforePropertyName' } } else { const current = stack[stack.length - 1] if (current == null) { parseState = 'end' } else if (Array.isArray(current)) { parseState = 'afterArrayValue' } else { parseState = 'afterPropertyValue' } } } function pop () { stack.pop() const current = stack[stack.length - 1] if (current == null) { parseState = 'end' } else if (Array.isArray(current)) { parseState = 'afterArrayValue' } else { parseState = 'afterPropertyValue' } } // This code is unreachable. // function invalidParseState () { // return new Error(`JSON5: invalid parse state '${parseState}'`) // } // This code is unreachable. // function invalidLexState (state) { // return new Error(`JSON5: invalid lex state '${state}'`) // } function invalidChar (c) { if (c === undefined) { return syntaxError(`JSON5: invalid end of input at ${line}:${column}`) } return syntaxError(`JSON5: invalid character '${formatChar(c)}' at ${line}:${column}`) } function invalidEOF () { return syntaxError(`JSON5: invalid end of input at ${line}:${column}`) } // This code is unreachable. // function invalidToken () { // if (token.type === 'eof') { // return syntaxError(`JSON5: invalid end of input at ${line}:${column}`) // } // const c = String.fromCodePoint(token.value.codePointAt(0)) // return syntaxError(`JSON5: invalid character '${formatChar(c)}' at ${line}:${column}`) // } function invalidIdentifier () { column -= 5 return syntaxError(`JSON5: invalid identifier character at ${line}:${column}`) } function separatorChar (c) { console.warn(`JSON5: '${formatChar(c)}' in strings is not valid ECMAScript; consider escaping`) } function formatChar (c) { const replacements = { "'": "\\'", '"': '\\"', '\\': '\\\\', '\b': '\\b', '\f': '\\f', '\n': '\\n', '\r': '\\r', '\t': '\\t', '\v': '\\v', '\0': '\\0', '\u2028': '\\u2028', '\u2029': '\\u2029', } if (replacements[c]) { return replacements[c] } if (c < ' ') { const hexString = c.charCodeAt(0).toString(16) return '\\x' + ('00' + hexString).substring(hexString.length) } return c } function syntaxError (message) { const err = new SyntaxError(message) err.lineNumber = line err.columnNumber = column return err } PK|[a͆ vv register.jsnuIwconst fs = require('fs') const JSON5 = require('./') // eslint-disable-next-line node/no-deprecated-api require.extensions['.json5'] = function (module, filename) { const content = fs.readFileSync(filename, 'utf8') try { module.exports = JSON5.parse(content) } catch (err) { err.message = filename + ': ' + err.message throw err } } PK|[l require.jsnuIw// This file is for backward compatibility with v0.5.1. require('./register') console.warn("'json5/require' is deprecated. Please use 'json5/register' instead.") PK|[RV==stringify.d.tsnuIwdeclare type StringifyOptions = { /** * A function that alters the behavior of the stringification process, or an * array of String and Number objects that serve as a allowlist for * selecting/filtering the properties of the value object to be included in * the JSON5 string. If this value is null or not provided, all properties * of the object are included in the resulting JSON5 string. */ replacer?: | ((this: any, key: string, value: any) => any) | (string | number)[] | null /** * A String or Number object that's used to insert white space into the * output JSON5 string for readability purposes. If this is a Number, it * indicates the number of space characters to use as white space; this * number is capped at 10 (if it is greater, the value is just 10). Values * less than 1 indicate that no space should be used. If this is a String, * the string (or the first 10 characters of the string, if it's longer than * that) is used as white space. If this parameter is not provided (or is * null), no white space is used. If white space is used, trailing commas * will be used in objects and arrays. */ space?: string | number | null /** * A String representing the quote character to use when serializing * strings. */ quote?: string | null } /** * Converts a JavaScript value to a JSON5 string. * @param value The value to convert to a JSON5 string. * @param replacer A function that alters the behavior of the stringification * process. If this value is null or not provided, all properties of the object * are included in the resulting JSON5 string. * @param space A String or Number object that's used to insert white space into * the output JSON5 string for readability purposes. If this is a Number, it * indicates the number of space characters to use as white space; this number * is capped at 10 (if it is greater, the value is just 10). Values less than 1 * indicate that no space should be used. If this is a String, the string (or * the first 10 characters of the string, if it's longer than that) is used as * white space. If this parameter is not provided (or is null), no white space * is used. If white space is used, trailing commas will be used in objects and * arrays. * @returns The JSON5 string converted from the JavaScript value. */ declare function stringify( value: any, replacer?: ((this: any, key: string, value: any) => any) | null, space?: string | number | null, ): string /** * Converts a JavaScript value to a JSON5 string. * @param value The value to convert to a JSON5 string. * @param replacer An array of String and Number objects that serve as a * allowlist for selecting/filtering the properties of the value object to be * included in the JSON5 string. If this value is null or not provided, all * properties of the object are included in the resulting JSON5 string. * @param space A String or Number object that's used to insert white space into * the output JSON5 string for readability purposes. If this is a Number, it * indicates the number of space characters to use as white space; this number * is capped at 10 (if it is greater, the value is just 10). Values less than 1 * indicate that no space should be used. If this is a String, the string (or * the first 10 characters of the string, if it's longer than that) is used as * white space. If this parameter is not provided (or is null), no white space * is used. If white space is used, trailing commas will be used in objects and * arrays. * @returns The JSON5 string converted from the JavaScript value. */ declare function stringify( value: any, replacer: (string | number)[], space?: string | number | null, ): string /** * Converts a JavaScript value to a JSON5 string. * @param value The value to convert to a JSON5 string. * @param options An object specifying options. * @returns The JSON5 string converted from the JavaScript value. */ declare function stringify(value: any, options: StringifyOptions): string export = stringify PK|[xGG stringify.jsnuIwconst util = require('./util') module.exports = function stringify (value, replacer, space) { const stack = [] let indent = '' let propertyList let replacerFunc let gap = '' let quote if ( replacer != null && typeof replacer === 'object' && !Array.isArray(replacer) ) { space = replacer.space quote = replacer.quote replacer = replacer.replacer } if (typeof replacer === 'function') { replacerFunc = replacer } else if (Array.isArray(replacer)) { propertyList = [] for (const v of replacer) { let item if (typeof v === 'string') { item = v } else if ( typeof v === 'number' || v instanceof String || v instanceof Number ) { item = String(v) } if (item !== undefined && propertyList.indexOf(item) < 0) { propertyList.push(item) } } } if (space instanceof Number) { space = Number(space) } else if (space instanceof String) { space = String(space) } if (typeof space === 'number') { if (space > 0) { space = Math.min(10, Math.floor(space)) gap = ' '.substr(0, space) } } else if (typeof space === 'string') { gap = space.substr(0, 10) } return serializeProperty('', {'': value}) function serializeProperty (key, holder) { let value = holder[key] if (value != null) { if (typeof value.toJSON5 === 'function') { value = value.toJSON5(key) } else if (typeof value.toJSON === 'function') { value = value.toJSON(key) } } if (replacerFunc) { value = replacerFunc.call(holder, key, value) } if (value instanceof Number) { value = Number(value) } else if (value instanceof String) { value = String(value) } else if (value instanceof Boolean) { value = value.valueOf() } switch (value) { case null: return 'null' case true: return 'true' case false: return 'false' } if (typeof value === 'string') { return quoteString(value, false) } if (typeof value === 'number') { return String(value) } if (typeof value === 'object') { return Array.isArray(value) ? serializeArray(value) : serializeObject(value) } return undefined } function quoteString (value) { const quotes = { "'": 0.1, '"': 0.2, } const replacements = { "'": "\\'", '"': '\\"', '\\': '\\\\', '\b': '\\b', '\f': '\\f', '\n': '\\n', '\r': '\\r', '\t': '\\t', '\v': '\\v', '\0': '\\0', '\u2028': '\\u2028', '\u2029': '\\u2029', } let product = '' for (let i = 0; i < value.length; i++) { const c = value[i] switch (c) { case "'": case '"': quotes[c]++ product += c continue case '\0': if (util.isDigit(value[i + 1])) { product += '\\x00' continue } } if (replacements[c]) { product += replacements[c] continue } if (c < ' ') { let hexString = c.charCodeAt(0).toString(16) product += '\\x' + ('00' + hexString).substring(hexString.length) continue } product += c } const quoteChar = quote || Object.keys(quotes).reduce((a, b) => (quotes[a] < quotes[b]) ? a : b) product = product.replace(new RegExp(quoteChar, 'g'), replacements[quoteChar]) return quoteChar + product + quoteChar } function serializeObject (value) { if (stack.indexOf(value) >= 0) { throw TypeError('Converting circular structure to JSON5') } stack.push(value) let stepback = indent indent = indent + gap let keys = propertyList || Object.keys(value) let partial = [] for (const key of keys) { const propertyString = serializeProperty(key, value) if (propertyString !== undefined) { let member = serializeKey(key) + ':' if (gap !== '') { member += ' ' } member += propertyString partial.push(member) } } let final if (partial.length === 0) { final = '{}' } else { let properties if (gap === '') { properties = partial.join(',') final = '{' + properties + '}' } else { let separator = ',\n' + indent properties = partial.join(separator) final = '{\n' + indent + properties + ',\n' + stepback + '}' } } stack.pop() indent = stepback return final } function serializeKey (key) { if (key.length === 0) { return quoteString(key, true) } const firstChar = String.fromCodePoint(key.codePointAt(0)) if (!util.isIdStartChar(firstChar)) { return quoteString(key, true) } for (let i = firstChar.length; i < key.length; i++) { if (!util.isIdContinueChar(String.fromCodePoint(key.codePointAt(i)))) { return quoteString(key, true) } } return key } function serializeArray (value) { if (stack.indexOf(value) >= 0) { throw TypeError('Converting circular structure to JSON5') } stack.push(value) let stepback = indent indent = indent + gap let partial = [] for (let i = 0; i < value.length; i++) { const propertyString = serializeProperty(String(i), value) partial.push((propertyString !== undefined) ? propertyString : 'null') } let final if (partial.length === 0) { final = '[]' } else { if (gap === '') { let properties = partial.join(',') final = '[' + properties + ']' } else { let separator = ',\n' + indent let properties = partial.join(separator) final = '[\n' + indent + properties + ',\n' + stepback + ']' } } stack.pop() indent = stepback return final } } PK|[Sy|| unicode.d.tsnuIwexport declare const Space_Separator: RegExp export declare const ID_Start: RegExp export declare const ID_Continue: RegExp PK|[M== unicode.jsnuIw// This is a generated file. Do not edit. module.exports.Space_Separator = /[\u1680\u2000-\u200A\u202F\u205F\u3000]/ module.exports.ID_Start = /[\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\u0561-\u0587\u05D0-\u05EA\u05F0-\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\u08A0-\u08B4\u08B6-\u08BD\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\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\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\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\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-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\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\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\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-\uAB65\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]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/ module.exports.ID_Continue = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\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\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/ PK|[?i$$ util.d.tsnuIwexport declare function isSpaceSeparator(c?: string): boolean export declare function isIdStartChar(c?: string): boolean export declare function isIdContinueChar(c?: string): boolean export declare function isDigit(c?: string): boolean export declare function isHexDigit(c?: string): boolean PK|[uuutil.jsnuIwconst unicode = require('../lib/unicode') module.exports = { isSpaceSeparator (c) { return typeof c === 'string' && unicode.Space_Separator.test(c) }, isIdStartChar (c) { return typeof c === 'string' && ( (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c === '$') || (c === '_') || unicode.ID_Start.test(c) ) }, isIdContinueChar (c) { return typeof c === 'string' && ( (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || (c === '$') || (c === '_') || (c === '\u200C') || (c === '\u200D') || unicode.ID_Continue.test(c) ) }, isDigit (c) { return typeof c === 'string' && /[0-9]/.test(c) }, isHexDigit (c) { return typeof c === 'string' && /[0-9A-Fa-f]/.test(c) }, } PK|[tBB deceiver.jsnuIwvar assert = require('assert'); var util = require('util'); var Buffer = require('buffer').Buffer; // Node.js version var mode = /^v0\.8\./.test(process.version) ? 'rusty' : /^v0\.(9|10)\./.test(process.version) ? 'old' : /^v0\.12\./.test(process.version) ? 'normal' : 'modern'; var HTTPParser; var methods; var reverseMethods; var kOnHeaders; var kOnHeadersComplete; var kOnMessageComplete; var kOnBody; if (mode === 'normal' || mode === 'modern') { HTTPParser = process.binding('http_parser').HTTPParser; methods = HTTPParser.methods; // v6 if (!methods) methods = process.binding('http_parser').methods; reverseMethods = {}; methods.forEach(function(method, index) { reverseMethods[method] = index; }); kOnHeaders = HTTPParser.kOnHeaders | 0; kOnHeadersComplete = HTTPParser.kOnHeadersComplete | 0; kOnMessageComplete = HTTPParser.kOnMessageComplete | 0; kOnBody = HTTPParser.kOnBody | 0; } else { kOnHeaders = 'onHeaders'; kOnHeadersComplete = 'onHeadersComplete'; kOnMessageComplete = 'onMessageComplete'; kOnBody = 'onBody'; } function Deceiver(socket, options) { this.socket = socket; this.options = options || {}; this.isClient = this.options.isClient; } module.exports = Deceiver; Deceiver.create = function create(stream, options) { return new Deceiver(stream, options); }; Deceiver.prototype._toHeaderList = function _toHeaderList(object) { var out = []; var keys = Object.keys(object); for (var i = 0; i < keys.length; i++) out.push(keys[i], object[keys[i]]); return out; }; Deceiver.prototype._isUpgrade = function _isUpgrade(request) { return request.method === 'CONNECT' || request.headers.upgrade || request.headers.connection && /(^|\W)upgrade(\W|$)/i.test(request.headers.connection); }; // TODO(indutny): support CONNECT if (mode === 'modern') { /* function parserOnHeadersComplete(versionMajor, versionMinor, headers, method, url, statusCode, statusMessage, upgrade, shouldKeepAlive) { */ Deceiver.prototype.emitRequest = function emitRequest(request) { var parser = this.socket.parser; assert(parser, 'No parser present'); parser.execute = null; var self = this; var method = reverseMethods[request.method]; parser.execute = function execute() { self._skipExecute(this); this[kOnHeadersComplete](1, 1, self._toHeaderList(request.headers), method, request.path, 0, '', self._isUpgrade(request), true); return 0; }; this._emitEmpty(); }; Deceiver.prototype.emitResponse = function emitResponse(response) { var parser = this.socket.parser; assert(parser, 'No parser present'); parser.execute = null; var self = this; parser.execute = function execute() { self._skipExecute(this); this[kOnHeadersComplete](1, 1, self._toHeaderList(response.headers), response.path, response.code, response.status, response.reason || '', self._isUpgrade(response), true); return 0; }; this._emitEmpty(); }; } else { /* `function parserOnHeadersComplete(info) {` info = { .versionMajor, .versionMinor, .url, .headers, .method, .statusCode, .statusMessage, .upgrade, .shouldKeepAlive } */ Deceiver.prototype.emitRequest = function emitRequest(request) { var parser = this.socket.parser; assert(parser, 'No parser present'); var method = request.method; if (reverseMethods) method = reverseMethods[method]; var info = { versionMajor: 1, versionMinor: 1, url: request.path, headers: this._toHeaderList(request.headers), method: method, statusCode: 0, statusMessage: '', upgrade: this._isUpgrade(request), shouldKeepAlive: true }; var self = this; parser.execute = function execute() { self._skipExecute(this); this[kOnHeadersComplete](info); return 0; }; this._emitEmpty(); }; Deceiver.prototype.emitResponse = function emitResponse(response) { var parser = this.socket.parser; assert(parser, 'No parser present'); var info = { versionMajor: 1, versionMinor: 1, url: response.path, headers: this._toHeaderList(response.headers), method: false, statusCode: response.status, statusMessage: response.reason || '', upgrade: this._isUpgrade(response), shouldKeepAlive: true }; var self = this; parser.execute = function execute() { self._skipExecute(this); this[kOnHeadersComplete](info); return 0; }; this._emitEmpty(); }; } Deceiver.prototype._skipExecute = function _skipExecute(parser) { var self = this; var oldExecute = parser.constructor.prototype.execute; var oldFinish = parser.constructor.prototype.finish; parser.execute = null; parser.finish = null; parser.execute = function execute(buffer, start, len) { // Parser reuse if (this.socket !== self.socket) { this.execute = oldExecute; this.finish = oldFinish; return this.execute(buffer, start, len); } if (start !== undefined) buffer = buffer.slice(start, start + len); self.emitBody(buffer); return len; }; parser.finish = function finish() { // Parser reuse if (this.socket !== self.socket) { this.execute = oldExecute; this.finish = oldFinish; return this.finish(); } this.execute = oldExecute; this.finish = oldFinish; self.emitMessageComplete(); }; }; Deceiver.prototype.emitBody = function emitBody(buffer) { var parser = this.socket.parser; assert(parser, 'No parser present'); parser[kOnBody](buffer, 0, buffer.length); }; Deceiver.prototype._emitEmpty = function _emitEmpty() { // Emit data to force out handling of UPGRADE var empty = new Buffer(0); if (this.socket.ondata) this.socket.ondata(empty, 0, 0); else this.socket.emit('data', empty); }; Deceiver.prototype.emitMessageComplete = function emitMessageComplete() { var parser = this.socket.parser; assert(parser, 'No parser present'); parser[kOnMessageComplete](); }; PK|[2%>compatibility/modules/class-wpml-jet-elements-table-header.phpnuȯ array( 'url' ) ); } /** * @param string $field * * @return string */ protected function get_title( $field ) { switch( $field ) { case 'pin_address': return esc_html__( 'Jet Map: Pin Address', 'jet-elements' ); case 'pin_desc': return esc_html__( 'Jet Map: Pin Description', 'jet-elements' ); case 'pin_link_title': return esc_html__( 'Jet Map: Link Text', 'jet-elements' ); case 'url': return esc_html__( 'Jet Map: Link', 'jet-elements' ); default: return ''; } } /** * @param string $field * * @return string */ protected function get_editor_type( $field ) { switch( $field ) { case 'pin_address': return 'LINE'; case 'pin_desc': return 'AREA'; case 'pin_link_title': return 'LINE'; case 'url': return 'LINK'; default: return ''; } } } PK|[%=compatibility/modules/class-wpml-jet-elements-team-member.phpnuȯ array( 'url' ) ); } /** * @param string $field * * @return string */ protected function get_title( $field ) { switch( $field ) { case 'item_title': return esc_html__( 'Jet Vertical Timeline: Item Title', 'jet-elements' ); case 'item_meta': return esc_html__( 'Jet Vertical Timeline: Item Meta', 'jet-elements' ); case 'item_desc': return esc_html__( 'Jet Vertical Timeline: Item Description', 'jet-elements' ); case 'item_point_text': return esc_html__( 'Jet Vertical Timeline: Item Point Text', 'jet-elements' ); case 'item_btn_text': return esc_html__( 'Jet Vertical Timeline: Item Button Text', 'jet-elements' ); case 'url': return esc_html__( 'Jet Vertical Timeline: Item Button Link', 'jet-elements' ); default: return ''; } } /** * @param string $field * * @return string */ protected function get_editor_type( $field ) { switch( $field ) { case 'item_title': case 'item_meta': case 'item_point_text': case 'item_btn_text': return 'LINE'; case 'item_desc': return 'AREA'; case 'url': return 'LINK'; default: return ''; } } } PK|[ue>compatibility/modules/class-wpml-jet-elements-table-footer.phpnuȯ array( 'url' ) ); } /** * @param string $field * * @return string */ protected function get_title( $field ) { switch( $field ) { case 'item_title': return esc_html__( 'Jet Price List: Item Title', 'jet-elements' ); case 'item_price': return esc_html__( 'Jet Price List: Item Price', 'jet-elements' ); case 'item_text': return esc_html__( 'Jet Price List: Item Description', 'jet-elements' ); case 'url': return esc_html__( 'Jet Price List: Item URL', 'jet-elements' ); default: return ''; } } /** * @param string $field * * @return string */ protected function get_editor_type( $field ) { switch( $field ) { case 'item_title': case 'item_price': return 'LINE'; case 'item_text': return 'AREA'; case 'url': return 'LINK'; default: return ''; } } } PK|[4Rw7compatibility/modules/class-wpml-jet-elements-table.phpnuȯ array( 'url' ) ); } /** * @param string $field * * @return string */ protected function get_title( $field ) { switch( $field ) { case 'item_name': return esc_html__( 'Jet Brands: Company Name', 'jet-elements' ); case 'item_desc': return esc_html__( 'Jet Brands: Company Description', 'jet-elements' ); case 'url': return esc_html__( 'Jet Brands: Company URL', 'jet-elements' ); default: return ''; } } /** * @param string $field * * @return string */ protected function get_editor_type( $field ) { switch( $field ) { case 'item_name': return 'LINE'; case 'item_desc': return 'AREA'; case 'url': return 'LINK'; default: return ''; } } } PK|[as Ccompatibility/modules/class-wpml-jet-elements-advanced-carousel.phpnuȯ array( 'url' ) ); } /** * @param string $field * * @return string */ protected function get_title( $field ) { switch( $field ) { case 'item_title': return esc_html__( 'Jet Horizontal Timeline: Item Title', 'jet-elements' ); case 'item_meta': return esc_html__( 'Jet Horizontal Timeline: Item Meta', 'jet-elements' ); case 'item_desc': return esc_html__( 'Jet Horizontal Timeline: Item Description', 'jet-elements' ); case 'item_point_text': return esc_html__( 'Jet Horizontal Timeline: Item Point Text', 'jet-elements' ); case 'item_btn_text': return esc_html__( 'Jet Horizontal Timeline: Item Button Text', 'jet-elements' ); case 'url': return esc_html__( 'Jet Horizontal Timeline: Item Button Link', 'jet-elements' ); default: return ''; } } /** * @param string $field * * @return string */ protected function get_editor_type( $field ) { switch( $field ) { case 'item_title': case 'item_meta': case 'item_point_text': case 'item_btn_text': return 'LINE'; case 'item_desc': return 'AREA'; case 'url': return 'LINK'; default: return ''; } } } PK|[)W;compatibility/modules/class-wpml-jet-elements-portfolio.phpnuȯ array( 'url' ) ); } /** * @param string $field * * @return string */ protected function get_title( $field ) { switch( $field ) { case 'item_category': return esc_html__( 'Jet Portfolio: Item Category', 'jet-elements' ); case 'item_title': return esc_html__( 'Jet Portfolio: Item Title', 'jet-elements' ); case 'item_desc': return esc_html__( 'Jet Portfolio: Item Description', 'jet-elements' ); case 'item_button_text': return esc_html__( 'Jet Portfolio: Item Link Text', 'jet-elements' ); case 'url': return esc_html__( 'Jet Portfolio: Item Link URL', 'jet-elements' ); default: return ''; } } /** * @param string $field * * @return string */ protected function get_editor_type( $field ) { switch( $field ) { case 'item_category': return 'LINE'; case 'item_title': return 'LINE'; case 'item_desc': return 'AREA'; case 'item_button_text': return 'LINE'; case 'url': return 'LINK'; default: return ''; } } } PK|[-=>compatibility/modules/class-wpml-jet-elements-testimonials.phpnuȯplugin_path( 'includes/lib/compatibility/modules/class-wpml-jet-elements-advanced-carousel.php' ); require jet_elements()->plugin_path( 'includes/lib/compatibility/modules/class-wpml-jet-elements-map.php' ); require jet_elements()->plugin_path( 'includes/lib/compatibility/modules/class-wpml-jet-elements-animated-text.php' ); require jet_elements()->plugin_path( 'includes/lib/compatibility/modules/class-wpml-jet-elements-brands.php' ); require jet_elements()->plugin_path( 'includes/lib/compatibility/modules/class-wpml-jet-elements-images-layout.php' ); require jet_elements()->plugin_path( 'includes/lib/compatibility/modules/class-wpml-jet-elements-pricing-table.php' ); require jet_elements()->plugin_path( 'includes/lib/compatibility/modules/class-wpml-jet-elements-slider.php' ); require jet_elements()->plugin_path( 'includes/lib/compatibility/modules/class-wpml-jet-elements-team-member.php' ); require jet_elements()->plugin_path( 'includes/lib/compatibility/modules/class-wpml-jet-elements-testimonials.php' ); require jet_elements()->plugin_path( 'includes/lib/compatibility/modules/class-wpml-jet-elements-image-comparison.php' ); require jet_elements()->plugin_path( 'includes/lib/compatibility/modules/class-wpml-jet-elements-scroll-navigation.php' ); require jet_elements()->plugin_path( 'includes/lib/compatibility/modules/class-wpml-jet-elements-portfolio.php' ); require jet_elements()->plugin_path( 'includes/lib/compatibility/modules/class-wpml-jet-elements-price-list.php' ); require jet_elements()->plugin_path( 'includes/lib/compatibility/modules/class-wpml-jet-elements-subscribe-form.php' ); require jet_elements()->plugin_path( 'includes/lib/compatibility/modules/class-wpml-jet-elements-timeline.php' ); require jet_elements()->plugin_path( 'includes/lib/compatibility/modules/class-wpml-jet-elements-table-header.php' ); require jet_elements()->plugin_path( 'includes/lib/compatibility/modules/class-wpml-jet-elements-table-footer.php' ); require jet_elements()->plugin_path( 'includes/lib/compatibility/modules/class-wpml-jet-elements-table.php' ); require jet_elements()->plugin_path( 'includes/lib/compatibility/modules/class-wpml-jet-elements-horizontal-timeline.php' ); require jet_elements()->plugin_path( 'includes/lib/compatibility/modules/class-wpml-jet-elements-bar-chart.php' ); require jet_elements()->plugin_path( 'includes/lib/compatibility/modules/class-wpml-jet-elements-pie-chart.php' ); require jet_elements()->plugin_path( 'includes/lib/compatibility/modules/class-wpml-jet-elements-line-chart.php' ); } /** * WPML media translation helper * * @param int $media_id ID * @return mixed|void */ public function wpml_translate_media_id( $media_id ) { if ( function_exists( 'apply_filters' ) && function_exists( 'wpml_object_id_filter' ) ) { $translated_id = apply_filters( 'wpml_object_id', $media_id, 'attachment', true ); return $translated_id ? $translated_id : $media_id; } return $media_id; } /** * Set WPML translated template. * * @param $template_id * * @return mixed|void */ public function set_wpml_translated_template_id( $template_id ) { $post_type = get_post_type( $template_id ); return apply_filters( 'wpml_object_id', $template_id, $post_type, true ); } /** * Set Polylang translated template. * * @param $template_id * * @return false|int|null */ public function set_pll_translated_template_id( $template_id ) { if ( function_exists( 'pll_get_post' ) ) { $translation_template_id = pll_get_post( $template_id ); if ( null === $translation_template_id ) { // the current language is not defined yet return $template_id; } elseif ( false === $translation_template_id ) { //no translation yet return $template_id; } elseif ( $translation_template_id > 0 ) { // return translated post id return $translation_template_id; } } return $template_id; } /** * Add jet-elements translation nodes * * @param array $nodes_to_translate * * @return array */ public function add_translatable_nodes( $nodes_to_translate ) { $nodes_to_translate[ 'jet-animated-box' ] = array( 'conditions' => array( 'widgetType' => 'jet-animated-box' ), 'fields' => array( array( 'field' => 'front_side_title', 'type' => esc_html__( 'Jet Animated Box: Front Title', 'jet-elements' ), 'editor_type' => 'LINE', ), array( 'field' => 'front_side_subtitle', 'type' => esc_html__( 'Jet Animated Box: Front SubTitle', 'jet-elements' ), 'editor_type' => 'LINE', ), array( 'field' => 'front_side_description', 'type' => esc_html__( 'Jet Animated Box: Front Description', 'jet-elements' ), 'editor_type' => 'AREA', ), array( 'field' => 'back_side_title', 'type' => esc_html__( 'Jet Animated Box: Back Title', 'jet-elements' ), 'editor_type' => 'LINE', ), array( 'field' => 'back_side_subtitle', 'type' => esc_html__( 'Jet Animated Box: Back SubTitle', 'jet-elements' ), 'editor_type' => 'LINE', ), array( 'field' => 'back_side_description', 'type' => esc_html__( 'Jet Animated Box: Back Description', 'jet-elements' ), 'editor_type' => 'AREA', ), array( 'field' => 'back_side_button_text', 'type' => esc_html__( 'Jet Animated Box: Button Text', 'jet-elements' ), 'editor_type' => 'LINE', ), 'back_side_button_link' => array( 'field' => 'url', 'type' => esc_html__( 'Jet Animated Box: Button Link', 'jet-elements' ), 'editor_type' => 'LINK', ), ), ); $nodes_to_translate[ 'jet-banner' ] = array( 'conditions' => array( 'widgetType' => 'jet-banner' ), 'fields' => array( array( 'field' => 'banner_title', 'type' => esc_html__( 'Jet Banner: Title', 'jet-elements' ), 'editor_type' => 'LINE', ), array( 'field' => 'banner_text', 'type' => esc_html__( 'Jet Banner: Description', 'jet-elements' ), 'editor_type' => 'AREA', ), array( 'field' => 'banner_link', 'type' => esc_html__( 'Jet Banner: Link', 'jet-elements' ), 'editor_type' => 'LINK', ), ), ); $nodes_to_translate[ 'jet-countdown-timer' ] = array( 'conditions' => array( 'widgetType' => 'jet-countdown-timer' ), 'fields' => array( array( 'field' => 'label_days', 'type' => esc_html__( 'Jet Countdown Timer: Label Days', 'jet-elements' ), 'editor_type' => 'LINE', ), array( 'field' => 'label_hours', 'type' => esc_html__( 'Jet Countdown Timer: Label Hours', 'jet-elements' ), 'editor_type' => 'LINE', ), array( 'field' => 'label_min', 'type' => esc_html__( 'Jet Countdown Timer: Label Min', 'jet-elements' ), 'editor_type' => 'LINE', ), array( 'field' => 'label_sec', 'type' => esc_html__( 'Jet Countdown Timer: Label Sec', 'jet-elements' ), 'editor_type' => 'LINE', ), array( 'field' => 'message_after_expire', 'type' => esc_html__( 'Jet Countdown Timer: Message After Expire', 'jet-elements' ), 'editor_type' => 'AREA', ), ), ); $nodes_to_translate[ 'jet-download-button' ] = array( 'conditions' => array( 'widgetType' => 'jet-download-button' ), 'fields' => array( array( 'field' => 'download_file', 'type' => esc_html__( 'Jet Download Button: Download ID', 'jet-elements' ), 'editor_type' => 'LINE', ), array( 'field' => 'download_label', 'type' => esc_html__( 'Jet Download Button: Label', 'jet-elements' ), 'editor_type' => 'LINE', ), ), ); $nodes_to_translate[ 'jet-circle-progress' ] = array( 'conditions' => array( 'widgetType' => 'jet-circle-progress' ), 'fields' => array( array( 'field' => 'title', 'type' => esc_html__( 'Jet Circle Progress: Title', 'jet-elements' ), 'editor_type' => 'LINE', ), array( 'field' => 'subtitle', 'type' => esc_html__( 'Jet Circle Progress: Subtitle', 'jet-elements' ), 'editor_type' => 'LINE', ), array( 'field' => 'prefix', 'type' => esc_html__( 'Jet Circle Progress: Prefix', 'jet-elements' ), 'editor_type' => 'LINE', ), array( 'field' => 'suffix', 'type' => esc_html__( 'Jet Circle Progress: Suffix', 'jet-elements' ), 'editor_type' => 'LINE', ), ), ); $nodes_to_translate[ 'jet-posts' ] = array( 'conditions' => array( 'widgetType' => 'jet-posts' ), 'fields' => array( array( 'field' => 'more_text', 'type' => esc_html__( 'Jet Posts: Read More Button Text', 'jet-elements' ), 'editor_type' => 'LINE', ), ), ); $nodes_to_translate[ 'jet-animated-text' ] = array( 'conditions' => array( 'widgetType' => 'jet-animated-text' ), 'fields' => array( array( 'field' => 'before_text_content', 'type' => esc_html__( 'Jet Animated Text: Before Text', 'jet-elements' ), 'editor_type' => 'LINE', ), array( 'field' => 'after_text_content', 'type' => esc_html__( 'Jet Animated Text: After Text', 'jet-elements' ), 'editor_type' => 'LINE', ), 'animated_text_link' => array( 'field' => 'url', 'type' => esc_html__( 'Jet Animated Text: Link', 'jet-elements' ), 'editor_type' => 'LINK', ), ), 'integration-class' => 'WPML_Jet_Elements_Animated_Text', ); $nodes_to_translate[ 'jet-carousel' ] = array( 'conditions' => array( 'widgetType' => 'jet-carousel' ), 'fields' => array(), 'integration-class' => 'WPML_Jet_Elements_Advanced_Carousel', ); $nodes_to_translate[ 'jet-map' ] = array( 'conditions' => array( 'widgetType' => 'jet-map' ), 'fields' => array( array( 'field' => 'map_center', 'type' => esc_html__( 'Jet Map: Map Center', 'jet-elements' ), 'editor_type' => 'LINE', ), ), 'integration-class' => 'WPML_Jet_Elements_Map', ); $nodes_to_translate[ 'jet-brands' ] = array( 'conditions' => array( 'widgetType' => 'jet-brands' ), 'fields' => array(), 'integration-class' => 'WPML_Jet_Elements_Brands', ); $nodes_to_translate[ 'jet-images-layout' ] = array( 'conditions' => array( 'widgetType' => 'jet-images-layout' ), 'fields' => array(), 'integration-class' => 'WPML_Jet_Elements_Images_Layout', ); $nodes_to_translate[ 'jet-pricing-table' ] = array( 'conditions' => array( 'widgetType' => 'jet-pricing-table' ), 'fields' => array( array( 'field' => 'title', 'type' => esc_html__( 'Jet Pricing Table: Title', 'jet-elements' ), 'editor_type' => 'LINE', ), array( 'field' => 'subtitle', 'type' => esc_html__( 'Jet Pricing Table: Subtitle', 'jet-elements' ), 'editor_type' => 'LINE', ), array( 'field' => 'price_prefix', 'type' => esc_html__( 'Jet Pricing Table: Price Prefix', 'jet-elements' ), 'editor_type' => 'LINE', ), array( 'field' => 'price', 'type' => esc_html__( 'Jet Pricing Table: Price', 'jet-elements' ), 'editor_type' => 'LINE', ), array( 'field' => 'price_suffix', 'type' => esc_html__( 'Jet Pricing Table: Price Suffix', 'jet-elements' ), 'editor_type' => 'LINE', ), array( 'field' => 'price_desc', 'type' => esc_html__( 'Jet Pricing Table: Price Description', 'jet-elements' ), 'editor_type' => 'AREA', ), array( 'field' => 'button_before', 'type' => esc_html__( 'Jet Pricing Table: Button Before', 'jet-elements' ), 'editor_type' => 'LINE', ), array( 'field' => 'button_text', 'type' => esc_html__( 'Jet Pricing Table: Button Text', 'jet-elements' ), 'editor_type' => 'LINE', ), array( 'field' => 'button_url', 'type' => esc_html__( 'Jet Pricing Table: Button URL', 'jet-elements' ), 'editor_type' => 'LINK', ), array( 'field' => 'button_after', 'type' => esc_html__( 'Jet Pricing Table: Button After', 'jet-elements' ), 'editor_type' => 'LINE', ), ), 'integration-class' => 'WPML_Jet_Elements_Pricing_Table', ); $nodes_to_translate[ 'jet-slider' ] = array( 'conditions' => array( 'widgetType' => 'jet-slider' ), 'fields' => array(), 'integration-class' => 'WPML_Jet_Elements_Slider', ); $nodes_to_translate[ 'jet-services' ] = array( 'conditions' => array( 'widgetType' => 'jet-services' ), 'fields' => array( array( 'field' => 'services_title', 'type' => esc_html__( 'Jet Services: Title', 'jet-elements' ), 'editor_type' => 'LINE', ), array( 'field' => 'services_description', 'type' => esc_html__( 'Jet Services: Description', 'jet-elements' ), 'editor_type' => 'AREA', ), array( 'field' => 'button_text', 'type' => esc_html__( 'Jet Services: Button Text', 'jet-elements' ), 'editor_type' => 'LINE', ), 'button_url' => array( 'field' => 'url', 'type' => esc_html__( 'Jet Services: Button Link', 'jet-elements' ), 'editor_type' => 'LINK', ), ), ); $nodes_to_translate[ 'jet-team-member' ] = array( 'conditions' => array( 'widgetType' => 'jet-team-member' ), 'fields' => array( array( 'field' => 'member_first_name', 'type' => esc_html__( 'Jet Team Member: First Name', 'jet-elements' ), 'editor_type' => 'LINE', ), array( 'field' => 'member_last_name', 'type' => esc_html__( 'Jet Team Member: Last Name', 'jet-elements' ), 'editor_type' => 'LINE', ), array( 'field' => 'member_position', 'type' => esc_html__( 'Jet Team Member: Position', 'jet-elements' ), 'editor_type' => 'LINE', ), array( 'field' => 'member_description', 'type' => esc_html__( 'Jet Team Member: Description', 'jet-elements' ), 'editor_type' => 'AREA', ), array( 'field' => 'button_text', 'type' => esc_html__( 'Jet Team Member: Button Text', 'jet-elements' ), 'editor_type' => 'LINE', ), 'button_url' => array( 'field' => 'url', 'type' => esc_html__( 'Jet Team Member: Button URL', 'jet-elements' ), 'editor_type' => 'LINK', ), ), 'integration-class' => 'WPML_Jet_Elements_Team_Member', ); $nodes_to_translate[ 'jet-testimonials' ] = array( 'conditions' => array( 'widgetType' => 'jet-testimonials' ), 'fields' => array(), 'integration-class' => 'WPML_Jet_Elements_Testimonials', ); $nodes_to_translate[ 'jet-button' ] = array( 'conditions' => array( 'widgetType' => 'jet-button' ), 'fields' => array( array( 'field' => 'button_label_normal', 'type' => esc_html__( 'Jet Button: Normal Label', 'jet-elements' ), 'editor_type' => 'LINE', ), array( 'field' => 'button_label_hover', 'type' => esc_html__( 'Jet Button: Hover Label', 'jet-elements' ), 'editor_type' => 'LINE', ), 'button_url' => array( 'field' => 'url', 'type' => esc_html__( 'Jet Button: Link', 'jet-elements' ), 'editor_type' => 'LINK', ), ), ); $nodes_to_translate[ 'jet-image-comparison' ] = array( 'conditions' => array( 'widgetType' => 'jet-image-comparison' ), 'fields' => array(), 'integration-class' => 'WPML_Jet_Elements_Image_Comparison', ); $nodes_to_translate[ 'jet-headline' ] = array( 'conditions' => array( 'widgetType' => 'jet-headline' ), 'fields' => array( array( 'field' => 'first_part', 'type' => esc_html__( 'Jet Headline: First Part', 'jet-elements' ), 'editor_type' => 'AREA', ), array( 'field' => 'second_part', 'type' => esc_html__( 'Jet Headline: Second Part', 'jet-elements' ), 'editor_type' => 'AREA', ), 'link' => array( 'field' => 'url', 'type' => esc_html__( 'Jet Headline: Link', 'jet-elements' ), 'editor_type' => 'LINK', ), ), ); $nodes_to_translate[ 'jet-scroll-navigation' ] = array( 'conditions' => array( 'widgetType' => 'jet-scroll-navigation' ), 'fields' => array(), 'integration-class' => 'WPML_Jet_Elements_Scroll_Navigation', ); $nodes_to_translate[ 'jet-subscribe-form' ] = array( 'conditions' => array( 'widgetType' => 'jet-subscribe-form' ), 'fields' => array( array( 'field' => 'submit_button_text', 'type' => esc_html__( 'Jet Subscribe Form: Submit Text', 'jet-elements' ), 'editor_type' => 'LINE', ), array( 'field' => 'submit_placeholder', 'type' => esc_html__( 'Jet Subscribe Form: Input Placeholder', 'jet-elements' ), 'editor_type' => 'LINE', ), array( 'field' => 'redirect_url', 'type' => esc_html__( 'Jet Subscribe Form: Redirect Url', 'jet-elements' ), 'editor_type' => 'LINE', ), ), 'integration-class' => 'WPML_Jet_Elements_Subscribe_Form', ); $nodes_to_translate[ 'jet-dropbar' ] = array( 'conditions' => array( 'widgetType' => 'jet-dropbar' ), 'fields' => array( array( 'field' => 'button_text', 'type' => esc_html__( 'Jet Dropbar: Button Text', 'jet-elements' ), 'editor_type' => 'LINE', ), array( 'field' => 'simple_content', 'type' => esc_html__( 'Jet Dropbar: Simple Text', 'jet-elements' ), 'editor_type' => 'AREA', ), ), ); $nodes_to_translate[ 'jet-portfolio' ] = array( 'conditions' => array( 'widgetType' => 'jet-portfolio' ), 'fields' => array( array( 'field' => 'all_filter_label', 'type' => esc_html__( 'Jet Portfolio: `All` Filter Label', 'jet-elements' ), 'editor_type' => 'LINE', ), array( 'field' => 'view_more_button_text', 'type' => esc_html__( 'Jet Portfolio: View More Button Text', 'jet-elements' ), 'editor_type' => 'LINE', ), ), 'integration-class' => 'WPML_Jet_Elements_Portfolio', ); $nodes_to_translate[ 'jet-price-list' ] = array( 'conditions' => array( 'widgetType' => 'jet-price-list' ), 'fields' => array(), 'integration-class' => 'WPML_Jet_Elements_Price_List', ); $nodes_to_translate[ 'jet-progress-bar' ] = array( 'conditions' => array( 'widgetType' => 'jet-progress-bar' ), 'fields' => array( array( 'field' => 'title', 'type' => esc_html__( 'Jet Progress Bar: Title', 'jet-elements' ), 'editor_type' => 'LINE', ), ), ); $nodes_to_translate[ 'jet-timeline' ] = array( 'conditions' => array( 'widgetType' => 'jet-timeline' ), 'fields' => array(), 'integration-class' => 'WPML_Jet_Elements_Timeline', ); $nodes_to_translate[ 'jet-weather' ] = array( 'conditions' => array( 'widgetType' => 'jet-weather' ), 'fields' => array( array( 'field' => 'location', 'type' => esc_html__( 'Jet Weather: Location', 'jet-elements' ), 'editor_type' => 'LINE', ), array( 'field' => 'custom_title', 'type' => esc_html__( 'Jet Weather: Custom title', 'jet-elements' ), 'editor_type' => 'LINE', ), ), ); $nodes_to_translate[ 'jet-table' ] = array( 'conditions' => array( 'widgetType' => 'jet-table' ), 'fields' => array(), 'integration-class' => array( 'WPML_Jet_Elements_Table_Header', 'WPML_Jet_Elements_Table_Footer', 'WPML_Jet_Elements_Table', ), ); $nodes_to_translate[ 'jet-horizontal-timeline' ] = array( 'conditions' => array( 'widgetType' => 'jet-horizontal-timeline' ), 'fields' => array(), 'integration-class' => 'WPML_Jet_Elements_Horizontal_Timeline', ); $nodes_to_translate['jet-bar-chart'] = array( 'conditions' => array( 'widgetType' => 'jet-bar-chart' ), 'fields' => array( array( 'field' => 'labels', 'type' => esc_html__( 'Jet Bar Chart: Labels', 'jet-elements' ), 'editor_type' => 'LINE', ), array( 'field' => 'chart_tooltip_prefix', 'type' => esc_html__( 'Jet Bar Chart: Tooltips Prefix', 'jet-elements' ), 'editor_type' => 'LINE', ), array( 'field' => 'chart_tooltip_suffix', 'type' => esc_html__( 'Jet Bar Chart: Tooltips Suffix', 'jet-elements' ), 'editor_type' => 'LINE', ), ), 'integration-class' => 'WPML_Jet_Elements_Bar_Chart', ); $nodes_to_translate['jet-pie-chart'] = array( 'conditions' => array( 'widgetType' => 'jet-pie-chart' ), 'fields' => array( array( 'field' => 'chart_title', 'type' => esc_html__( 'Jet Pie Chart: Title', 'jet-elements' ), 'editor_type' => 'LINE', ), array( 'field' => 'chart_tooltip_suffix', 'type' => esc_html__( 'Jet Pie Chart: Tooltips Suffix', 'jet-elements' ), 'editor_type' => 'LINE', ), ), 'integration-class' => 'WPML_Jet_Elements_Pie_Chart', ); $nodes_to_translate['jet-line-chart'] = array( 'conditions' => array( 'widgetType' => 'jet-line-chart' ), 'fields' => array( array( 'field' => 'labels', 'type' => esc_html__( 'Jet Line Chart: Labels', 'jet-elements' ), 'editor_type' => 'LINE', ), ), 'integration-class' => 'WPML_Jet_Elements_Line_Chart', ); $nodes_to_translate['jet-lottie'] = array( 'conditions' => array( 'widgetType' => 'jet-lottie' ), 'fields' => array( 'link' => array( 'field' => 'url', 'type' => esc_html__( 'Jet Lottie: Link', 'jet-elements' ), 'editor_type' => 'LINK', ), ), ); return $nodes_to_translate; } /** * Convert Elementor Popup ID * * @param array $data * @return array */ public function convert_popup_id( $data ) { foreach ( $data as &$item ) { if ( $this->is_jet_elements_widget( $item ) ) { array_walk_recursive( $item['settings'], function ( &$value ) { if ( false !== strpos( $value, '[elementor-tag' ) ) { $value = $this->convert_dynamic_tag( $value ); } } ); } $item['elements'] = $this->convert_popup_id( $item['elements'] ); } return $data; } public function is_jet_elements_widget( $data ) { $available_widgets = jet_elements_settings()->avaliable_widgets_slugs; return isset( $data['elType'] ) && 'widget' === $data['elType'] && in_array( $data['widgetType'], $available_widgets ); } private function convert_dynamic_tag( $tagString ) { preg_match( '/name="(.*?(?="))"/', $tagString, $tagNameMatch ); if ( ! $tagNameMatch || $tagNameMatch[1] !== 'popup' ) { return $tagString; } return preg_replace_callback( '/settings="(.*?(?="]))/', function( array $matches ) { $settings = json_decode( urldecode( $matches[1] ), true ); if ( ! isset( $settings['popup'] ) ) { return $matches[0]; } $settings['popup'] = apply_filters( 'wpml_object_id', $settings['popup'], get_post_type( $settings['popup'] ), true ); $replace = urlencode( json_encode( $settings ) ); return str_replace( $matches[1], $replace, $matches[0] ); }, $tagString ); } /** * Returns the instance. * * @since 1.0.0 * @return object */ public static function get_instance() { // If the single instance hasn't been set, set it now. if ( null == self::$instance ) { self::$instance = new self; } return self::$instance; } } } /** * Returns instance of Jet_Elements_Compatibility * * @return object */ function jet_elements_compatibility() { return Jet_Elements_Compatibility::get_instance(); } PKc}[W mr.jsnuIwvar bn = require('bn.js'); var brorand = require('brorand'); function MillerRabin(rand) { this.rand = rand || new brorand.Rand(); } module.exports = MillerRabin; MillerRabin.create = function create(rand) { return new MillerRabin(rand); }; MillerRabin.prototype._randbelow = function _randbelow(n) { var len = n.bitLength(); var min_bytes = Math.ceil(len / 8); // Generage random bytes until a number less than n is found. // This ensures that 0..n-1 have an equal probability of being selected. do var a = new bn(this.rand.generate(min_bytes)); while (a.cmp(n) >= 0); return a; }; MillerRabin.prototype._randrange = function _randrange(start, stop) { // Generate a random number greater than or equal to start and less than stop. var size = stop.sub(start); return start.add(this._randbelow(size)); }; MillerRabin.prototype.test = function test(n, k, cb) { var len = n.bitLength(); var red = bn.mont(n); var rone = new bn(1).toRed(red); if (!k) k = Math.max(1, (len / 48) | 0); // Find d and s, (n - 1) = (2 ^ s) * d; var n1 = n.subn(1); for (var s = 0; !n1.testn(s); s++) {} var d = n.shrn(s); var rn1 = n1.toRed(red); var prime = true; for (; k > 0; k--) { var a = this._randrange(new bn(2), n1); if (cb) cb(a); var x = a.toRed(red).redPow(d); if (x.cmp(rone) === 0 || x.cmp(rn1) === 0) continue; for (var i = 1; i < s; i++) { x = x.redSqr(); if (x.cmp(rone) === 0) return false; if (x.cmp(rn1) === 0) break; } if (i === s) return false; } return prime; }; MillerRabin.prototype.getDivisor = function getDivisor(n, k) { var len = n.bitLength(); var red = bn.mont(n); var rone = new bn(1).toRed(red); if (!k) k = Math.max(1, (len / 48) | 0); // Find d and s, (n - 1) = (2 ^ s) * d; var n1 = n.subn(1); for (var s = 0; !n1.testn(s); s++) {} var d = n.shrn(s); var rn1 = n1.toRed(red); for (; k > 0; k--) { var a = this._randrange(new bn(2), n1); var g = n.gcd(a); if (g.cmpn(1) !== 0) return g; var x = a.toRed(red).redPow(d); if (x.cmp(rone) === 0 || x.cmp(rn1) === 0) continue; for (var i = 1; i < s; i++) { x = x.redSqr(); if (x.cmp(rone) === 0) return x.fromRed().subn(1).gcd(n); if (x.cmp(rn1) === 0) break; } if (i === s) { x = x.redSqr(); return x.fromRed().subn(1).gcd(n); } } return false; }; PK9~[F0 constants.jsnuIw'use strict'; const {sep} = require('path'); const {platform} = process; exports.EV_ALL = 'all'; exports.EV_READY = 'ready'; exports.EV_ADD = 'add'; exports.EV_CHANGE = 'change'; exports.EV_ADD_DIR = 'addDir'; exports.EV_UNLINK = 'unlink'; exports.EV_UNLINK_DIR = 'unlinkDir'; exports.EV_RAW = 'raw'; exports.EV_ERROR = 'error'; exports.STR_DATA = 'data'; exports.STR_END = 'end'; exports.STR_CLOSE = 'close'; exports.FSEVENT_CREATED = 'created'; exports.FSEVENT_MODIFIED = 'modified'; exports.FSEVENT_DELETED = 'deleted'; exports.FSEVENT_MOVED = 'moved'; exports.FSEVENT_CLONED = 'cloned'; exports.FSEVENT_UNKNOWN = 'unknown'; exports.FSEVENT_TYPE_FILE = 'file'; exports.FSEVENT_TYPE_DIRECTORY = 'directory'; exports.FSEVENT_TYPE_SYMLINK = 'symlink'; exports.KEY_LISTENERS = 'listeners'; exports.KEY_ERR = 'errHandlers'; exports.KEY_RAW = 'rawEmitters'; exports.HANDLER_KEYS = [exports.KEY_LISTENERS, exports.KEY_ERR, exports.KEY_RAW]; exports.DOT_SLASH = `.${sep}`; exports.BACK_SLASH_RE = /\\/g; exports.DOUBLE_SLASH_RE = /\/\//; exports.SLASH_OR_BACK_SLASH_RE = /[/\\]/; exports.DOT_RE = /\..*\.(sw[px])$|~$|\.subl.*\.tmp/; exports.REPLACER_RE = /^\.[/\\]/; exports.SLASH = '/'; exports.SLASH_SLASH = '//'; exports.BRACE_START = '{'; exports.BANG = '!'; exports.ONE_DOT = '.'; exports.TWO_DOTS = '..'; exports.STAR = '*'; exports.GLOBSTAR = '**'; exports.ROOT_GLOBSTAR = '/**/*'; exports.SLASH_GLOBSTAR = '/**'; exports.DIR_SUFFIX = 'Dir'; exports.ANYMATCH_OPTS = {dot: true}; exports.STRING_TYPE = 'string'; exports.FUNCTION_TYPE = 'function'; exports.EMPTY_STR = ''; exports.EMPTY_FN = () => {}; exports.IDENTITY_FN = val => val; exports.isWindows = platform === 'win32'; exports.isMacos = platform === 'darwin'; exports.isLinux = platform === 'linux'; PK9~[??fsevents-handler.jsnuIw'use strict'; const fs = require('fs'); const sysPath = require('path'); const { promisify } = require('util'); let fsevents; try { fsevents = require('fsevents'); } catch (error) { if (process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR) console.error(error); } if (fsevents) { // TODO: real check const mtch = process.version.match(/v(\d+)\.(\d+)/); if (mtch && mtch[1] && mtch[2]) { const maj = Number.parseInt(mtch[1], 10); const min = Number.parseInt(mtch[2], 10); if (maj === 8 && min < 16) { fsevents = undefined; } } } const { EV_ADD, EV_CHANGE, EV_ADD_DIR, EV_UNLINK, EV_ERROR, STR_DATA, STR_END, FSEVENT_CREATED, FSEVENT_MODIFIED, FSEVENT_DELETED, FSEVENT_MOVED, // FSEVENT_CLONED, FSEVENT_UNKNOWN, FSEVENT_TYPE_FILE, FSEVENT_TYPE_DIRECTORY, FSEVENT_TYPE_SYMLINK, ROOT_GLOBSTAR, DIR_SUFFIX, DOT_SLASH, FUNCTION_TYPE, EMPTY_FN, IDENTITY_FN } = require('./constants'); const Depth = (value) => isNaN(value) ? {} : {depth: value}; const stat = promisify(fs.stat); const lstat = promisify(fs.lstat); const realpath = promisify(fs.realpath); const statMethods = { stat, lstat }; /** * @typedef {String} Path */ /** * @typedef {Object} FsEventsWatchContainer * @property {Set} listeners * @property {Function} rawEmitter * @property {{stop: Function}} watcher */ // fsevents instance helper functions /** * Object to hold per-process fsevents instances (may be shared across chokidar FSWatcher instances) * @type {Map} */ const FSEventsWatchers = new Map(); // Threshold of duplicate path prefixes at which to start // consolidating going forward const consolidateThreshhold = 10; const wrongEventFlags = new Set([ 69888, 70400, 71424, 72704, 73472, 131328, 131840, 262912 ]); /** * Instantiates the fsevents interface * @param {Path} path path to be watched * @param {Function} callback called when fsevents is bound and ready * @returns {{stop: Function}} new fsevents instance */ const createFSEventsInstance = (path, callback) => { const stop = fsevents.watch(path, callback); return {stop}; }; /** * Instantiates the fsevents interface or binds listeners to an existing one covering * the same file tree. * @param {Path} path - to be watched * @param {Path} realPath - real path for symlinks * @param {Function} listener - called when fsevents emits events * @param {Function} rawEmitter - passes data to listeners of the 'raw' event * @returns {Function} closer */ function setFSEventsListener(path, realPath, listener, rawEmitter) { let watchPath = sysPath.extname(path) ? sysPath.dirname(path) : path; const parentPath = sysPath.dirname(watchPath); let cont = FSEventsWatchers.get(watchPath); // If we've accumulated a substantial number of paths that // could have been consolidated by watching one directory // above the current one, create a watcher on the parent // path instead, so that we do consolidate going forward. if (couldConsolidate(parentPath)) { watchPath = parentPath; } const resolvedPath = sysPath.resolve(path); const hasSymlink = resolvedPath !== realPath; const filteredListener = (fullPath, flags, info) => { if (hasSymlink) fullPath = fullPath.replace(realPath, resolvedPath); if ( fullPath === resolvedPath || !fullPath.indexOf(resolvedPath + sysPath.sep) ) listener(fullPath, flags, info); }; // check if there is already a watcher on a parent path // modifies `watchPath` to the parent path when it finds a match let watchedParent = false; for (const watchedPath of FSEventsWatchers.keys()) { if (realPath.indexOf(sysPath.resolve(watchedPath) + sysPath.sep) === 0) { watchPath = watchedPath; cont = FSEventsWatchers.get(watchPath); watchedParent = true; break; } } if (cont || watchedParent) { cont.listeners.add(filteredListener); } else { cont = { listeners: new Set([filteredListener]), rawEmitter, watcher: createFSEventsInstance(watchPath, (fullPath, flags) => { if (!cont.listeners.size) return; const info = fsevents.getInfo(fullPath, flags); cont.listeners.forEach(list => { list(fullPath, flags, info); }); cont.rawEmitter(info.event, fullPath, info); }) }; FSEventsWatchers.set(watchPath, cont); } // removes this instance's listeners and closes the underlying fsevents // instance if there are no more listeners left return () => { const lst = cont.listeners; lst.delete(filteredListener); if (!lst.size) { FSEventsWatchers.delete(watchPath); if (cont.watcher) return cont.watcher.stop().then(() => { cont.rawEmitter = cont.watcher = undefined; Object.freeze(cont); }); } }; } // Decide whether or not we should start a new higher-level // parent watcher const couldConsolidate = (path) => { let count = 0; for (const watchPath of FSEventsWatchers.keys()) { if (watchPath.indexOf(path) === 0) { count++; if (count >= consolidateThreshhold) { return true; } } } return false; }; // returns boolean indicating whether fsevents can be used const canUse = () => fsevents && FSEventsWatchers.size < 128; // determines subdirectory traversal levels from root to path const calcDepth = (path, root) => { let i = 0; while (!path.indexOf(root) && (path = sysPath.dirname(path)) !== root) i++; return i; }; // returns boolean indicating whether the fsevents' event info has the same type // as the one returned by fs.stat const sameTypes = (info, stats) => ( info.type === FSEVENT_TYPE_DIRECTORY && stats.isDirectory() || info.type === FSEVENT_TYPE_SYMLINK && stats.isSymbolicLink() || info.type === FSEVENT_TYPE_FILE && stats.isFile() ) /** * @mixin */ class FsEventsHandler { /** * @param {import('../index').FSWatcher} fsw */ constructor(fsw) { this.fsw = fsw; } checkIgnored(path, stats) { const ipaths = this.fsw._ignoredPaths; if (this.fsw._isIgnored(path, stats)) { ipaths.add(path); if (stats && stats.isDirectory()) { ipaths.add(path + ROOT_GLOBSTAR); } return true; } ipaths.delete(path); ipaths.delete(path + ROOT_GLOBSTAR); } addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts) { const event = watchedDir.has(item) ? EV_CHANGE : EV_ADD; this.handleEvent(event, path, fullPath, realPath, parent, watchedDir, item, info, opts); } async checkExists(path, fullPath, realPath, parent, watchedDir, item, info, opts) { try { const stats = await stat(path) if (this.fsw.closed) return; if (sameTypes(info, stats)) { this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts); } else { this.handleEvent(EV_UNLINK, path, fullPath, realPath, parent, watchedDir, item, info, opts); } } catch (error) { if (error.code === 'EACCES') { this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts); } else { this.handleEvent(EV_UNLINK, path, fullPath, realPath, parent, watchedDir, item, info, opts); } } } handleEvent(event, path, fullPath, realPath, parent, watchedDir, item, info, opts) { if (this.fsw.closed || this.checkIgnored(path)) return; if (event === EV_UNLINK) { const isDirectory = info.type === FSEVENT_TYPE_DIRECTORY // suppress unlink events on never before seen files if (isDirectory || watchedDir.has(item)) { this.fsw._remove(parent, item, isDirectory); } } else { if (event === EV_ADD) { // track new directories if (info.type === FSEVENT_TYPE_DIRECTORY) this.fsw._getWatchedDir(path); if (info.type === FSEVENT_TYPE_SYMLINK && opts.followSymlinks) { // push symlinks back to the top of the stack to get handled const curDepth = opts.depth === undefined ? undefined : calcDepth(fullPath, realPath) + 1; return this._addToFsEvents(path, false, true, curDepth); } // track new paths // (other than symlinks being followed, which will be tracked soon) this.fsw._getWatchedDir(parent).add(item); } /** * @type {'add'|'addDir'|'unlink'|'unlinkDir'} */ const eventName = info.type === FSEVENT_TYPE_DIRECTORY ? event + DIR_SUFFIX : event; this.fsw._emit(eventName, path); if (eventName === EV_ADD_DIR) this._addToFsEvents(path, false, true); } } /** * Handle symlinks encountered during directory scan * @param {String} watchPath - file/dir path to be watched with fsevents * @param {String} realPath - real path (in case of symlinks) * @param {Function} transform - path transformer * @param {Function} globFilter - path filter in case a glob pattern was provided * @returns {Function} closer for the watcher instance */ _watchWithFsEvents(watchPath, realPath, transform, globFilter) { if (this.fsw.closed || this.fsw._isIgnored(watchPath)) return; const opts = this.fsw.options; const watchCallback = async (fullPath, flags, info) => { if (this.fsw.closed) return; if ( opts.depth !== undefined && calcDepth(fullPath, realPath) > opts.depth ) return; const path = transform(sysPath.join( watchPath, sysPath.relative(watchPath, fullPath) )); if (globFilter && !globFilter(path)) return; // ensure directories are tracked const parent = sysPath.dirname(path); const item = sysPath.basename(path); const watchedDir = this.fsw._getWatchedDir( info.type === FSEVENT_TYPE_DIRECTORY ? path : parent ); // correct for wrong events emitted if (wrongEventFlags.has(flags) || info.event === FSEVENT_UNKNOWN) { if (typeof opts.ignored === FUNCTION_TYPE) { let stats; try { stats = await stat(path); } catch (error) {} if (this.fsw.closed) return; if (this.checkIgnored(path, stats)) return; if (sameTypes(info, stats)) { this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts); } else { this.handleEvent(EV_UNLINK, path, fullPath, realPath, parent, watchedDir, item, info, opts); } } else { this.checkExists(path, fullPath, realPath, parent, watchedDir, item, info, opts); } } else { switch (info.event) { case FSEVENT_CREATED: case FSEVENT_MODIFIED: return this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts); case FSEVENT_DELETED: case FSEVENT_MOVED: return this.checkExists(path, fullPath, realPath, parent, watchedDir, item, info, opts); } } }; const closer = setFSEventsListener( watchPath, realPath, watchCallback, this.fsw._emitRaw ); this.fsw._emitReady(); return closer; } /** * Handle symlinks encountered during directory scan * @param {String} linkPath path to symlink * @param {String} fullPath absolute path to the symlink * @param {Function} transform pre-existing path transformer * @param {Number} curDepth level of subdirectories traversed to where symlink is * @returns {Promise} */ async _handleFsEventsSymlink(linkPath, fullPath, transform, curDepth) { // don't follow the same symlink more than once if (this.fsw.closed || this.fsw._symlinkPaths.has(fullPath)) return; this.fsw._symlinkPaths.set(fullPath, true); this.fsw._incrReadyCount(); try { const linkTarget = await realpath(linkPath); if (this.fsw.closed) return; if (this.fsw._isIgnored(linkTarget)) { return this.fsw._emitReady(); } this.fsw._incrReadyCount(); // add the linkTarget for watching with a wrapper for transform // that causes emitted paths to incorporate the link's path this._addToFsEvents(linkTarget || linkPath, (path) => { let aliasedPath = linkPath; if (linkTarget && linkTarget !== DOT_SLASH) { aliasedPath = path.replace(linkTarget, linkPath); } else if (path !== DOT_SLASH) { aliasedPath = sysPath.join(linkPath, path); } return transform(aliasedPath); }, false, curDepth); } catch(error) { if (this.fsw._handleError(error)) { return this.fsw._emitReady(); } } } /** * * @param {Path} newPath * @param {fs.Stats} stats */ emitAdd(newPath, stats, processPath, opts, forceAdd) { const pp = processPath(newPath); const isDir = stats.isDirectory(); const dirObj = this.fsw._getWatchedDir(sysPath.dirname(pp)); const base = sysPath.basename(pp); // ensure empty dirs get tracked if (isDir) this.fsw._getWatchedDir(pp); if (dirObj.has(base)) return; dirObj.add(base); if (!opts.ignoreInitial || forceAdd === true) { this.fsw._emit(isDir ? EV_ADD_DIR : EV_ADD, pp, stats); } } initWatch(realPath, path, wh, processPath) { if (this.fsw.closed) return; const closer = this._watchWithFsEvents( wh.watchPath, sysPath.resolve(realPath || wh.watchPath), processPath, wh.globFilter ); this.fsw._addPathCloser(path, closer); } /** * Handle added path with fsevents * @param {String} path file/dir path or glob pattern * @param {Function|Boolean=} transform converts working path to what the user expects * @param {Boolean=} forceAdd ensure add is emitted * @param {Number=} priorDepth Level of subdirectories already traversed. * @returns {Promise} */ async _addToFsEvents(path, transform, forceAdd, priorDepth) { if (this.fsw.closed) { return; } const opts = this.fsw.options; const processPath = typeof transform === FUNCTION_TYPE ? transform : IDENTITY_FN; const wh = this.fsw._getWatchHelpers(path); // evaluate what is at the path we're being asked to watch try { const stats = await statMethods[wh.statMethod](wh.watchPath); if (this.fsw.closed) return; if (this.fsw._isIgnored(wh.watchPath, stats)) { throw null; } if (stats.isDirectory()) { // emit addDir unless this is a glob parent if (!wh.globFilter) this.emitAdd(processPath(path), stats, processPath, opts, forceAdd); // don't recurse further if it would exceed depth setting if (priorDepth && priorDepth > opts.depth) return; // scan the contents of the dir this.fsw._readdirp(wh.watchPath, { fileFilter: entry => wh.filterPath(entry), directoryFilter: entry => wh.filterDir(entry), ...Depth(opts.depth - (priorDepth || 0)) }).on(STR_DATA, (entry) => { // need to check filterPath on dirs b/c filterDir is less restrictive if (this.fsw.closed) { return; } if (entry.stats.isDirectory() && !wh.filterPath(entry)) return; const joinedPath = sysPath.join(wh.watchPath, entry.path); const {fullPath} = entry; if (wh.followSymlinks && entry.stats.isSymbolicLink()) { // preserve the current depth here since it can't be derived from // real paths past the symlink const curDepth = opts.depth === undefined ? undefined : calcDepth(joinedPath, sysPath.resolve(wh.watchPath)) + 1; this._handleFsEventsSymlink(joinedPath, fullPath, processPath, curDepth); } else { this.emitAdd(joinedPath, entry.stats, processPath, opts, forceAdd); } }).on(EV_ERROR, EMPTY_FN).on(STR_END, () => { this.fsw._emitReady(); }); } else { this.emitAdd(wh.watchPath, stats, processPath, opts, forceAdd); this.fsw._emitReady(); } } catch (error) { if (!error || this.fsw._handleError(error)) { // TODO: Strange thing: "should not choke on an ignored watch path" will be failed without 2 ready calls -__- this.fsw._emitReady(); this.fsw._emitReady(); } } if (opts.persistent && forceAdd !== true) { if (typeof transform === FUNCTION_TYPE) { // realpath has already been resolved this.initWatch(undefined, path, wh, processPath); } else { let realPath; try { realPath = await realpath(wh.watchPath); } catch (e) {} this.initWatch(realPath, path, wh, processPath); } } } } module.exports = FsEventsHandler; module.exports.canUse = canUse; PK9~[8jaNNnodefs-handler.jsnuIw'use strict'; const fs = require('fs'); const sysPath = require('path'); const { promisify } = require('util'); const isBinaryPath = require('is-binary-path'); const { isWindows, isLinux, EMPTY_FN, EMPTY_STR, KEY_LISTENERS, KEY_ERR, KEY_RAW, HANDLER_KEYS, EV_CHANGE, EV_ADD, EV_ADD_DIR, EV_ERROR, STR_DATA, STR_END, BRACE_START, STAR } = require('./constants'); const THROTTLE_MODE_WATCH = 'watch'; const open = promisify(fs.open); const stat = promisify(fs.stat); const lstat = promisify(fs.lstat); const close = promisify(fs.close); const fsrealpath = promisify(fs.realpath); const statMethods = { lstat, stat }; // TODO: emit errors properly. Example: EMFILE on Macos. const foreach = (val, fn) => { if (val instanceof Set) { val.forEach(fn); } else { fn(val); } }; const addAndConvert = (main, prop, item) => { let container = main[prop]; if (!(container instanceof Set)) { main[prop] = container = new Set([container]); } container.add(item); }; const clearItem = cont => key => { const set = cont[key]; if (set instanceof Set) { set.clear(); } else { delete cont[key]; } }; const delFromSet = (main, prop, item) => { const container = main[prop]; if (container instanceof Set) { container.delete(item); } else if (container === item) { delete main[prop]; } }; const isEmptySet = (val) => val instanceof Set ? val.size === 0 : !val; /** * @typedef {String} Path */ // fs_watch helpers // object to hold per-process fs_watch instances // (may be shared across chokidar FSWatcher instances) /** * @typedef {Object} FsWatchContainer * @property {Set} listeners * @property {Set} errHandlers * @property {Set} rawEmitters * @property {fs.FSWatcher=} watcher * @property {Boolean=} watcherUnusable */ /** * @type {Map} */ const FsWatchInstances = new Map(); /** * Instantiates the fs_watch interface * @param {String} path to be watched * @param {Object} options to be passed to fs_watch * @param {Function} listener main event handler * @param {Function} errHandler emits info about errors * @param {Function} emitRaw emits raw event data * @returns {fs.FSWatcher} new fsevents instance */ function createFsWatchInstance(path, options, listener, errHandler, emitRaw) { const handleEvent = (rawEvent, evPath) => { listener(path); emitRaw(rawEvent, evPath, {watchedPath: path}); // emit based on events occurring for files from a directory's watcher in // case the file's watcher misses it (and rely on throttling to de-dupe) if (evPath && path !== evPath) { fsWatchBroadcast( sysPath.resolve(path, evPath), KEY_LISTENERS, sysPath.join(path, evPath) ); } }; try { return fs.watch(path, options, handleEvent); } catch (error) { errHandler(error); } } /** * Helper for passing fs_watch event data to a collection of listeners * @param {Path} fullPath absolute path bound to fs_watch instance * @param {String} type listener type * @param {*=} val1 arguments to be passed to listeners * @param {*=} val2 * @param {*=} val3 */ const fsWatchBroadcast = (fullPath, type, val1, val2, val3) => { const cont = FsWatchInstances.get(fullPath); if (!cont) return; foreach(cont[type], (listener) => { listener(val1, val2, val3); }); }; /** * Instantiates the fs_watch interface or binds listeners * to an existing one covering the same file system entry * @param {String} path * @param {String} fullPath absolute path * @param {Object} options to be passed to fs_watch * @param {Object} handlers container for event listener functions */ const setFsWatchListener = (path, fullPath, options, handlers) => { const {listener, errHandler, rawEmitter} = handlers; let cont = FsWatchInstances.get(fullPath); /** @type {fs.FSWatcher=} */ let watcher; if (!options.persistent) { watcher = createFsWatchInstance( path, options, listener, errHandler, rawEmitter ); return watcher.close.bind(watcher); } if (cont) { addAndConvert(cont, KEY_LISTENERS, listener); addAndConvert(cont, KEY_ERR, errHandler); addAndConvert(cont, KEY_RAW, rawEmitter); } else { watcher = createFsWatchInstance( path, options, fsWatchBroadcast.bind(null, fullPath, KEY_LISTENERS), errHandler, // no need to use broadcast here fsWatchBroadcast.bind(null, fullPath, KEY_RAW) ); if (!watcher) return; watcher.on(EV_ERROR, async (error) => { const broadcastErr = fsWatchBroadcast.bind(null, fullPath, KEY_ERR); cont.watcherUnusable = true; // documented since Node 10.4.1 // Workaround for https://github.com/joyent/node/issues/4337 if (isWindows && error.code === 'EPERM') { try { const fd = await open(path, 'r'); await close(fd); broadcastErr(error); } catch (err) {} } else { broadcastErr(error); } }); cont = { listeners: listener, errHandlers: errHandler, rawEmitters: rawEmitter, watcher }; FsWatchInstances.set(fullPath, cont); } // const index = cont.listeners.indexOf(listener); // removes this instance's listeners and closes the underlying fs_watch // instance if there are no more listeners left return () => { delFromSet(cont, KEY_LISTENERS, listener); delFromSet(cont, KEY_ERR, errHandler); delFromSet(cont, KEY_RAW, rawEmitter); if (isEmptySet(cont.listeners)) { // Check to protect against issue gh-730. // if (cont.watcherUnusable) { cont.watcher.close(); // } FsWatchInstances.delete(fullPath); HANDLER_KEYS.forEach(clearItem(cont)); cont.watcher = undefined; Object.freeze(cont); } }; }; // fs_watchFile helpers // object to hold per-process fs_watchFile instances // (may be shared across chokidar FSWatcher instances) const FsWatchFileInstances = new Map(); /** * Instantiates the fs_watchFile interface or binds listeners * to an existing one covering the same file system entry * @param {String} path to be watched * @param {String} fullPath absolute path * @param {Object} options options to be passed to fs_watchFile * @param {Object} handlers container for event listener functions * @returns {Function} closer */ const setFsWatchFileListener = (path, fullPath, options, handlers) => { const {listener, rawEmitter} = handlers; let cont = FsWatchFileInstances.get(fullPath); /* eslint-disable no-unused-vars, prefer-destructuring */ let listeners = new Set(); let rawEmitters = new Set(); const copts = cont && cont.options; if (copts && (copts.persistent < options.persistent || copts.interval > options.interval)) { // "Upgrade" the watcher to persistence or a quicker interval. // This creates some unlikely edge case issues if the user mixes // settings in a very weird way, but solving for those cases // doesn't seem worthwhile for the added complexity. listeners = cont.listeners; rawEmitters = cont.rawEmitters; fs.unwatchFile(fullPath); cont = undefined; } /* eslint-enable no-unused-vars, prefer-destructuring */ if (cont) { addAndConvert(cont, KEY_LISTENERS, listener); addAndConvert(cont, KEY_RAW, rawEmitter); } else { // TODO // listeners.add(listener); // rawEmitters.add(rawEmitter); cont = { listeners: listener, rawEmitters: rawEmitter, options, watcher: fs.watchFile(fullPath, options, (curr, prev) => { foreach(cont.rawEmitters, (rawEmitter) => { rawEmitter(EV_CHANGE, fullPath, {curr, prev}); }); const currmtime = curr.mtimeMs; if (curr.size !== prev.size || currmtime > prev.mtimeMs || currmtime === 0) { foreach(cont.listeners, (listener) => listener(path, curr)); } }) }; FsWatchFileInstances.set(fullPath, cont); } // const index = cont.listeners.indexOf(listener); // Removes this instance's listeners and closes the underlying fs_watchFile // instance if there are no more listeners left. return () => { delFromSet(cont, KEY_LISTENERS, listener); delFromSet(cont, KEY_RAW, rawEmitter); if (isEmptySet(cont.listeners)) { FsWatchFileInstances.delete(fullPath); fs.unwatchFile(fullPath); cont.options = cont.watcher = undefined; Object.freeze(cont); } }; }; /** * @mixin */ class NodeFsHandler { /** * @param {import("../index").FSWatcher} fsW */ constructor(fsW) { this.fsw = fsW; this._boundHandleError = (error) => fsW._handleError(error); } /** * Watch file for changes with fs_watchFile or fs_watch. * @param {String} path to file or dir * @param {Function} listener on fs change * @returns {Function} closer for the watcher instance */ _watchWithNodeFs(path, listener) { const opts = this.fsw.options; const directory = sysPath.dirname(path); const basename = sysPath.basename(path); const parent = this.fsw._getWatchedDir(directory); parent.add(basename); const absolutePath = sysPath.resolve(path); const options = {persistent: opts.persistent}; if (!listener) listener = EMPTY_FN; let closer; if (opts.usePolling) { options.interval = opts.enableBinaryInterval && isBinaryPath(basename) ? opts.binaryInterval : opts.interval; closer = setFsWatchFileListener(path, absolutePath, options, { listener, rawEmitter: this.fsw._emitRaw }); } else { closer = setFsWatchListener(path, absolutePath, options, { listener, errHandler: this._boundHandleError, rawEmitter: this.fsw._emitRaw }); } return closer; } /** * Watch a file and emit add event if warranted. * @param {Path} file Path * @param {fs.Stats} stats result of fs_stat * @param {Boolean} initialAdd was the file added at watch instantiation? * @returns {Function} closer for the watcher instance */ _handleFile(file, stats, initialAdd) { if (this.fsw.closed) { return; } const dirname = sysPath.dirname(file); const basename = sysPath.basename(file); const parent = this.fsw._getWatchedDir(dirname); // stats is always present let prevStats = stats; // if the file is already being watched, do nothing if (parent.has(basename)) return; const listener = async (path, newStats) => { if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file, 5)) return; if (!newStats || newStats.mtimeMs === 0) { try { const newStats = await stat(file); if (this.fsw.closed) return; // Check that change event was not fired because of changed only accessTime. const at = newStats.atimeMs; const mt = newStats.mtimeMs; if (!at || at <= mt || mt !== prevStats.mtimeMs) { this.fsw._emit(EV_CHANGE, file, newStats); } if (isLinux && prevStats.ino !== newStats.ino) { this.fsw._closeFile(path) prevStats = newStats; this.fsw._addPathCloser(path, this._watchWithNodeFs(file, listener)); } else { prevStats = newStats; } } catch (error) { // Fix issues where mtime is null but file is still present this.fsw._remove(dirname, basename); } // add is about to be emitted if file not already tracked in parent } else if (parent.has(basename)) { // Check that change event was not fired because of changed only accessTime. const at = newStats.atimeMs; const mt = newStats.mtimeMs; if (!at || at <= mt || mt !== prevStats.mtimeMs) { this.fsw._emit(EV_CHANGE, file, newStats); } prevStats = newStats; } } // kick off the watcher const closer = this._watchWithNodeFs(file, listener); // emit an add event if we're supposed to if (!(initialAdd && this.fsw.options.ignoreInitial) && this.fsw._isntIgnored(file)) { if (!this.fsw._throttle(EV_ADD, file, 0)) return; this.fsw._emit(EV_ADD, file, stats); } return closer; } /** * Handle symlinks encountered while reading a dir. * @param {Object} entry returned by readdirp * @param {String} directory path of dir being read * @param {String} path of this item * @param {String} item basename of this item * @returns {Promise} true if no more processing is needed for this entry. */ async _handleSymlink(entry, directory, path, item) { if (this.fsw.closed) { return; } const full = entry.fullPath; const dir = this.fsw._getWatchedDir(directory); if (!this.fsw.options.followSymlinks) { // watch symlink directly (don't follow) and detect changes this.fsw._incrReadyCount(); const linkPath = await fsrealpath(path); if (this.fsw.closed) return; if (dir.has(item)) { if (this.fsw._symlinkPaths.get(full) !== linkPath) { this.fsw._symlinkPaths.set(full, linkPath); this.fsw._emit(EV_CHANGE, path, entry.stats); } } else { dir.add(item); this.fsw._symlinkPaths.set(full, linkPath); this.fsw._emit(EV_ADD, path, entry.stats); } this.fsw._emitReady(); return true; } // don't follow the same symlink more than once if (this.fsw._symlinkPaths.has(full)) { return true; } this.fsw._symlinkPaths.set(full, true); } _handleRead(directory, initialAdd, wh, target, dir, depth, throttler) { // Normalize the directory name on Windows directory = sysPath.join(directory, EMPTY_STR); if (!wh.hasGlob) { throttler = this.fsw._throttle('readdir', directory, 1000); if (!throttler) return; } const previous = this.fsw._getWatchedDir(wh.path); const current = new Set(); let stream = this.fsw._readdirp(directory, { fileFilter: entry => wh.filterPath(entry), directoryFilter: entry => wh.filterDir(entry), depth: 0 }).on(STR_DATA, async (entry) => { if (this.fsw.closed) { stream = undefined; return; } const item = entry.path; let path = sysPath.join(directory, item); current.add(item); if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path, item)) { return; } if (this.fsw.closed) { stream = undefined; return; } // Files that present in current directory snapshot // but absent in previous are added to watch list and // emit `add` event. if (item === target || !target && !previous.has(item)) { this.fsw._incrReadyCount(); // ensure relativeness of path is preserved in case of watcher reuse path = sysPath.join(dir, sysPath.relative(dir, path)); this._addToNodeFs(path, initialAdd, wh, depth + 1); } }).on(EV_ERROR, this._boundHandleError); return new Promise(resolve => stream.once(STR_END, () => { if (this.fsw.closed) { stream = undefined; return; } const wasThrottled = throttler ? throttler.clear() : false; resolve(); // Files that absent in current directory snapshot // but present in previous emit `remove` event // and are removed from @watched[directory]. previous.getChildren().filter((item) => { return item !== directory && !current.has(item) && // in case of intersecting globs; // a path may have been filtered out of this readdir, but // shouldn't be removed because it matches a different glob (!wh.hasGlob || wh.filterPath({ fullPath: sysPath.resolve(directory, item) })); }).forEach((item) => { this.fsw._remove(directory, item); }); stream = undefined; // one more time for any missed in case changes came in extremely quickly if (wasThrottled) this._handleRead(directory, false, wh, target, dir, depth, throttler); }) ); } /** * Read directory to add / remove files from `@watched` list and re-read it on change. * @param {String} dir fs path * @param {fs.Stats} stats * @param {Boolean} initialAdd * @param {Number} depth relative to user-supplied path * @param {String} target child path targeted for watch * @param {Object} wh Common watch helpers for this path * @param {String} realpath * @returns {Promise} closer for the watcher instance. */ async _handleDir(dir, stats, initialAdd, depth, target, wh, realpath) { const parentDir = this.fsw._getWatchedDir(sysPath.dirname(dir)); const tracked = parentDir.has(sysPath.basename(dir)); if (!(initialAdd && this.fsw.options.ignoreInitial) && !target && !tracked) { if (!wh.hasGlob || wh.globFilter(dir)) this.fsw._emit(EV_ADD_DIR, dir, stats); } // ensure dir is tracked (harmless if redundant) parentDir.add(sysPath.basename(dir)); this.fsw._getWatchedDir(dir); let throttler; let closer; const oDepth = this.fsw.options.depth; if ((oDepth == null || depth <= oDepth) && !this.fsw._symlinkPaths.has(realpath)) { if (!target) { await this._handleRead(dir, initialAdd, wh, target, dir, depth, throttler); if (this.fsw.closed) return; } closer = this._watchWithNodeFs(dir, (dirPath, stats) => { // if current directory is removed, do nothing if (stats && stats.mtimeMs === 0) return; this._handleRead(dirPath, false, wh, target, dir, depth, throttler); }); } return closer; } /** * Handle added file, directory, or glob pattern. * Delegates call to _handleFile / _handleDir after checks. * @param {String} path to file or ir * @param {Boolean} initialAdd was the file added at watch instantiation? * @param {Object} priorWh depth relative to user-supplied path * @param {Number} depth Child path actually targeted for watch * @param {String=} target Child path actually targeted for watch * @returns {Promise} */ async _addToNodeFs(path, initialAdd, priorWh, depth, target) { const ready = this.fsw._emitReady; if (this.fsw._isIgnored(path) || this.fsw.closed) { ready(); return false; } const wh = this.fsw._getWatchHelpers(path, depth); if (!wh.hasGlob && priorWh) { wh.hasGlob = priorWh.hasGlob; wh.globFilter = priorWh.globFilter; wh.filterPath = entry => priorWh.filterPath(entry); wh.filterDir = entry => priorWh.filterDir(entry); } // evaluate what is at the path we're being asked to watch try { const stats = await statMethods[wh.statMethod](wh.watchPath); if (this.fsw.closed) return; if (this.fsw._isIgnored(wh.watchPath, stats)) { ready(); return false; } const follow = this.fsw.options.followSymlinks && !path.includes(STAR) && !path.includes(BRACE_START); let closer; if (stats.isDirectory()) { const absPath = sysPath.resolve(path); const targetPath = follow ? await fsrealpath(path) : path; if (this.fsw.closed) return; closer = await this._handleDir(wh.watchPath, stats, initialAdd, depth, target, wh, targetPath); if (this.fsw.closed) return; // preserve this symlink's target path if (absPath !== targetPath && targetPath !== undefined) { this.fsw._symlinkPaths.set(absPath, targetPath); } } else if (stats.isSymbolicLink()) { const targetPath = follow ? await fsrealpath(path) : path; if (this.fsw.closed) return; const parent = sysPath.dirname(wh.watchPath); this.fsw._getWatchedDir(parent).add(wh.watchPath); this.fsw._emit(EV_ADD, wh.watchPath, stats); closer = await this._handleDir(parent, stats, initialAdd, depth, path, wh, targetPath); if (this.fsw.closed) return; // preserve this symlink's target path if (targetPath !== undefined) { this.fsw._symlinkPaths.set(sysPath.resolve(path), targetPath); } } else { closer = this._handleFile(wh.watchPath, stats, initialAdd); } ready(); this.fsw._addPathCloser(path, closer); return false; } catch (error) { if (this.fsw._handleError(error)) { ready(); return path; } } } } module.exports = NodeFsHandler; PKT|[`[adapters/README.mdnuIwPKT|[]Y `A7A7adapters/http.jsnu̗PKT|[~AV;adapters/xhr.jsnuIwPKT|[a tXcancel/CancelToken.jsnuIwPKT|[!!!zbcancel/CanceledError.jsnuIwPKT|[Offdcancel/isCancel.jsnuIwPKT|[Y ecore/Axios.jsnuIwPKT|[3) wcore/AxiosError.jsnuIwPKT|[%SScore/InterceptorManager.jsnuIwPKT|[6Zcore/README.mdnuIwPKT|[v۷'core/buildFullPath.jsnuIwPKT|[ABѧ\\#core/dispatchRequest.jsnuIwPKT|[ˣ Ɠcore/mergeConfig.jsnuIwPKT|[P\core/settle.jsnuIwPKT|[ֽ6}} core/transformData.jsnuIwPKT|[FEJJ˦defaults/env/FormData.jsnuIwPKT|[ ̰]defaults/index.jsnuIwPKT|[G&xxdefaults/transitional.jsnuIwPKT|[ Eenv/README.mdnuIwPKT|[ ++ env/data.jsnuIwPKT|[^__khelpers/README.mdnuIwPKT|[ helpers/bind.jsnuIwPKT|[C>\llJhelpers/buildURL.jsnuIwPKT|[y||helpers/combineURLs.jsnuIwPKT|[$bhelpers/cookies.jsnuIwPKT|[chelpers/deprecatedMethod.jsnuIwPKT|[וY11helpers/isAbsoluteURL.jsnuIwPKT|[K7uu3helpers/isAxiosError.jsnuIwPKT|[c(  helpers/isURLSameOrigin.jsnuIwPKT|[\ee:helpers/normalizeHeaderName.jsnuIwPKT|[$H::helpers/null.jsnuIwPKT|[o,qqfhelpers/parseHeaders.jsnuIwPKT|[ 1Uhelpers/parseProtocol.jsnuIwPKT|[SD44helpers/spread.jsnuIwPKT|[gvshelpers/toFormData.jsnuIwPKT|[lNa helpers/validator.jsnuIwPKT|[naxios.jsnuIwPKT|[[΄...utils.jsnuIwPK|[%S S =.cli.jsnu̗PK|[#ggg 9index.d.tsnuIwPK|[-6 g:index.jsnuIwPK|[ht .;parse.d.tsnuIwPK|[lSS}=parse.jsnuIwPK|[a͆ vv Fregister.jsnuIwPK|[l require.jsnuIwPK|[RV==ԓstringify.d.tsnuIwPK|[xGG Ostringify.jsnuIwPK|[Sy|| ҿunicode.d.tsnuIwPK|[M== unicode.jsnuIwPK|[?i$$ util.d.tsnuIwPK|[uuutil.jsnuIwPK|[tBB deceiver.jsnuIwPK|[2%>compatibility/modules/class-wpml-jet-elements-table-header.phpnuȯPK|[11@!compatibility/modules/class-wpml-jet-elements-subscribe-form.phpnuȯPK|[bs5(%compatibility/modules/class-wpml-jet-elements-map.phpnuȯPK|[%=2*compatibility/modules/class-wpml-jet-elements-team-member.phpnuȯPK|[8:-compatibility/modules/class-wpml-jet-elements-timeline.phpnuȯPK|[ue>-4compatibility/modules/class-wpml-jet-elements-table-footer.phpnuȯPK|[t}<7compatibility/modules/class-wpml-jet-elements-price-list.phpnuȯPK|[4Rw7<compatibility/modules/class-wpml-jet-elements-table.phpnuȯPK|[e?@compatibility/modules/class-wpml-jet-elements-animated-text.phpnuȯPK|[l)<?Dcompatibility/modules/class-wpml-jet-elements-line-chart.phpnuȯPK|[hxCt~~8Gcompatibility/modules/class-wpml-jet-elements-slider.phpnuȯPK|[h[ **8Ocompatibility/modules/class-wpml-jet-elements-brands.phpnuȯPK|[as CTcompatibility/modules/class-wpml-jet-elements-advanced-carousel.phpnuȯPK|[V9;Ycompatibility/modules/class-wpml-jet-elements-pie-chart.phpnuȯPK|[DD?\compatibility/modules/class-wpml-jet-elements-images-layout.phpnuȯPK|[xBacompatibility/modules/class-wpml-jet-elements-image-comparison.phpnuȯPK|[~RCecompatibility/modules/class-wpml-jet-elements-scroll-navigation.phpnuȯPK|[vw11E~icompatibility/modules/class-wpml-jet-elements-horizontal-timeline.phpnuȯPK|[)W;$pcompatibility/modules/class-wpml-jet-elements-portfolio.phpnuȯPK|[-=>vcompatibility/modules/class-wpml-jet-elements-testimonials.phpnuȯPK|[NX?|compatibility/modules/class-wpml-jet-elements-pricing-table.phpnuȯPK|[%;ɀcompatibility/modules/class-wpml-jet-elements-bar-chart.phpnuȯPK|[ii2+compatibility/class-jet-elements-compatibility.phpnuȯPKc}[W Mmr.jsnuIwPK9~[F0 <constants.jsnuIwPK9~[??`fsevents-handler.jsnuIwPK9~[8jaNN(?nodefs-handler.jsnuIwPKOOj