action-miniprogram-ci/dist/index.js
2024-08-16 12:07:40 +08:00

57619 lines
2.0 MiB
Generated
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

require('./sourcemap-register.js');/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({
/***/ 3134:
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.preview = void 0;
const core = __importStar(__nccwpck_require__(2186));
const qrcode_1 = __nccwpck_require__(1265);
const fs_1 = __importDefault(__nccwpck_require__(7147));
const utils_1 = __nccwpck_require__(2930);
const cp = __importStar(__nccwpck_require__(2081));
const preview = (option) => __awaiter(void 0, void 0, void 0, function* () {
const previewArgs = [];
if (option.qrcodeFormat === 'terminal') {
previewArgs.push(...[
'--qrcode-format',
'image',
'--qrcode-output-dest',
option.qrcodeOutputDest
]);
}
else {
previewArgs.push(...['--qrcode-format', option.qrcodeFormat]);
if (option.qrcodeOutputDest) {
previewArgs.push(...['--qrcode-output-dest', option.qrcodeOutputDest]);
}
}
if (option.pagePath) {
previewArgs.push(...['--preview-page-path', option.pagePath]);
}
if (option.searchQuery) {
previewArgs.push(...['--preview-search-query', option.searchQuery]);
}
if (option.scene) {
previewArgs.push(...['--scene', `${option.scene}`]);
}
const command = [
'npx',
`miniprogram-ci@${option.ciVersion || '2.0.8'}`,
'preview',
...(0, utils_1.getArgs)(option),
...previewArgs
].join(' ');
core.info('Command:');
core.info(` ${command}`);
cp.execSync(command);
if (option.qrcodeFormat === 'terminal') {
const qrcodeData = yield (0, qrcode_1.getQrCode)(option.qrcodeOutputDest);
const qrcode = yield (0, qrcode_1.generate)(qrcodeData);
core.info(`Generate terminal qrcode:\n${qrcode}`);
fs_1.default.promises.unlink(option.qrcodeOutputDest);
return qrcode;
}
return '';
});
exports.preview = preview;
/***/ }),
/***/ 3245:
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.upload = void 0;
const core = __importStar(__nccwpck_require__(2186));
const utils_1 = __nccwpck_require__(2930);
const cp = __importStar(__nccwpck_require__(2081));
const upload = (option) => __awaiter(void 0, void 0, void 0, function* () {
const command = [
'npx',
`miniprogram-ci@${option.ciVersion || '2.0.8'}`,
'upload',
...(0, utils_1.getArgs)(option)
].join(' ');
core.info('Command:');
core.info(` ${command}`);
cp.execSync(command);
});
exports.upload = upload;
/***/ }),
/***/ 2930:
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.getArgs = void 0;
const core = __importStar(__nccwpck_require__(2186));
const getArgs = (option) => {
const args = [
'--project-type',
`'${option.type}'`,
'--appid',
`'${option.appid}'`,
'--project-path',
`'${option.projectPath}'`
];
if (option.privateKeyPath) {
args.push(...['--private-key-path', `'${option.privateKeyPath}'`]);
}
if (option.ignores) {
args.push(...['--project-ignores', `'${option.ignores.toString()}'`]);
}
if (option.version) {
args.push(...['--upload-version', `'${option.version}'`]);
}
if (option.desc) {
args.push(...['--upload-description', `'${option.desc}'`]);
}
if (option.threads) {
args.push(...['--threads', `${option.threads.toString()}`]);
}
if (option.robot) {
args.push(...['--robot', `${option.robot.toString()}`]);
}
if (option.setting) {
if (option.setting.es6) {
args.push(...['--enable-es6', `true`]);
}
if (option.setting.es7) {
args.push(...['--enable-es7', `true`]);
}
if (option.setting.autoPrefixWXSS) {
args.push(...['--enable-autoprefixwxss', `true`]);
}
if (option.setting.autoPrefixWXSS) {
args.push(...['--enable-autoprefixwxss', `true`]);
}
if (option.setting.autoPrefixWXSS) {
args.push(...['--enable-autoprefixwxss', `true`]);
}
if (option.setting.minifyWXSS) {
args.push(...['--enable-minify-wxss', `true`]);
}
if (option.setting.minifyWXML) {
args.push(...['--enable-minify-wxml', `true`]);
}
if (option.setting.minifyJS) {
args.push(...['--enable-minify-js', `true`]);
}
if (option.setting.minify) {
args.push(...['--enable-minify', `true`]);
}
}
core.debug(args.toString());
return args;
};
exports.getArgs = getArgs;
/***/ }),
/***/ 5143:
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.preview = void 0;
const core = __importStar(__nccwpck_require__(2186));
const qrcode_1 = __nccwpck_require__(1265);
const fs_1 = __importDefault(__nccwpck_require__(7147));
const utils_1 = __nccwpck_require__(4817);
const cp = __importStar(__nccwpck_require__(2081));
const preview = (option) => __awaiter(void 0, void 0, void 0, function* () {
cp.execSync([
'npx',
`tt-ide-cli@${option.ciVersion || '0.1.27'}`,
'set-app-config',
option.appid,
'--token',
option.privateKey
].join(' '));
const command = [
'npx',
`tt-ide-cli@${option.ciVersion || '0.1.27'}`,
'preview',
...(0, utils_1.getArgs)(option),
'--qrcode-output',
option.qrcodeOutputDest,
option.projectPath
].join(' ');
core.info('Command:');
core.info(` ${command}`);
cp.execSync(command);
cp.execSync(`npx ${`tt-ide-cli@${option.ciVersion || '0.1.27'}`} logout`);
if (option.qrcodeFormat === 'terminal') {
const qrcodeData = yield (0, qrcode_1.getQrCode)(option.qrcodeOutputDest);
const qrcode = yield (0, qrcode_1.generate)(qrcodeData);
core.info(`Generate terminal qrcode:\n${qrcode}`);
fs_1.default.promises.unlink(option.qrcodeOutputDest);
return qrcode;
}
return '';
});
exports.preview = preview;
/***/ }),
/***/ 3068:
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.upload = void 0;
const core = __importStar(__nccwpck_require__(2186));
const utils_1 = __nccwpck_require__(4817);
const cp = __importStar(__nccwpck_require__(2081));
const upload = (option) => __awaiter(void 0, void 0, void 0, function* () {
cp.execSync([
'npx',
`tt-ide-cli@${option.ciVersion || '0.1.27'}`,
'set-app-config',
option.appid,
'--token',
option.privateKey
].join(' '));
const command = [
'npx',
`tt-ide-cli@${option.ciVersion || '0.1.27'}`,
'upload',
...(0, utils_1.getArgs)(option),
option.projectPath
].join(' ');
core.info('Command:');
core.info(` ${command}`);
cp.execSync(command);
cp.execSync(`npx ${`tt-ide-cli@${option.ciVersion || '0.1.27'}`} logout`);
});
exports.upload = upload;
/***/ }),
/***/ 4817:
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.getArgs = void 0;
const core = __importStar(__nccwpck_require__(2186));
const getArgs = (option) => {
const args = [];
if (option.version) {
args.push(...[' --app-version', `'${option.version}'`]);
}
if (option.desc) {
args.push(...['--app-changelog', `'${option.desc}'`]);
}
core.debug(args.toString());
return args;
};
exports.getArgs = getArgs;
/***/ }),
/***/ 3109:
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
const core = __importStar(__nccwpck_require__(2186));
const index_1 = __nccwpck_require__(1606);
const type_1 = __nccwpck_require__(9241);
const path_1 = __importDefault(__nccwpck_require__(1017));
const fs = __importStar(__nccwpck_require__(7147));
const os = __importStar(__nccwpck_require__(2037));
const upload_1 = __nccwpck_require__(3245);
const preview_1 = __nccwpck_require__(3134);
const upload_2 = __nccwpck_require__(3068);
const preview_2 = __nccwpck_require__(5143);
const defaultPrivateKeyPath = '../private.key';
function run() {
var _a;
return __awaiter(this, void 0, void 0, function* () {
let autoPrivateKey = false;
let isTest = false;
let qrcode = '';
const workspace = process.env.GITHUB_WORKSPACE || __dirname;
let option;
try {
core.debug(new Date().toTimeString());
option = {
mode: (0, type_1.filterMode)((0, index_1.getInput)(index_1.Inputs.mode)),
platform: (0, type_1.filterPlatform)((0, index_1.getInput)(index_1.Inputs.platform)),
appid: '',
type: (0, type_1.filterType)((0, index_1.getInput)(index_1.Inputs.type)),
projectPath: (0, index_1.getInput)(index_1.Inputs.projectPath) || '',
privateKey: (0, index_1.getInput)(index_1.Inputs.privateKey),
privateKeyPath: (0, index_1.getInput)(index_1.Inputs.privateKeyPath),
ignores: (0, index_1.getInputAsArray)(index_1.Inputs.ignores),
version: (0, index_1.getInput)(index_1.Inputs.version) || '',
desc: (0, index_1.getInput)(index_1.Inputs.desc),
robot: (0, index_1.getInputAsInt)(index_1.Inputs.robot),
threads: (0, index_1.getInputAsInt)(index_1.Inputs.threads),
ciVersion: (0, index_1.getInput)(index_1.Inputs.ciVersion)
};
if ((0, index_1.getInput)(index_1.Inputs.mode) === 'test') {
isTest = true;
}
if (!option.projectPath) {
option.projectPath = './';
}
option.projectPath = path_1.default.resolve(workspace, `${option.projectPath}`);
if (option.privateKey) {
autoPrivateKey = true;
option.privateKeyPath = path_1.default.resolve(workspace, defaultPrivateKeyPath);
fs.writeFileSync(option.privateKeyPath, option.privateKey);
core.info('read privateKey success and write to privateKeyPath.');
option.privateKey = '';
}
else {
if (!option.privateKeyPath) {
throw Error('privateKey 和 privateKeyPath 不能都为空');
}
option.privateKeyPath = path_1.default.resolve(workspace, option.privateKeyPath);
}
if (((_a = option.ignores) === null || _a === void 0 ? void 0 : _a.length) === 0) {
option.ignores = ['node_modules/**/*'];
}
const projectConfig = JSON.parse(fs
.readFileSync(`${option.projectPath}/project.config.json`)
.toString('utf8'));
option.appid = projectConfig.appid;
option.setting = projectConfig.setting;
if (!option.version) {
option.version = (0, index_1.formatDate)(new Date(), 'YYYY.MMDD.HHmmss');
}
if (!option.desc) {
option.desc = 'fix some bug.';
}
if (!option.threads) {
option.threads = os.cpus().length;
}
// handler
if (isTest) {
// eslint-disable-next-line no-console
console.log('Test option:');
// eslint-disable-next-line no-console
console.log(`${(0, index_1.stringify)(option)}`);
qrcode = 'xxxxx\nx x x\nxxxxx';
}
else if (option.mode === 'upload') {
core.info('Options:');
core.info(`${(0, index_1.stringify)(option)}`);
if (option.platform === 'wechat') {
yield (0, upload_1.upload)(option);
}
else {
yield (0, upload_2.upload)(option);
}
}
else if (option.mode === 'preview') {
const previewOption = Object.assign(Object.assign({}, option), { qrcodeFormat: (0, type_1.filterQrcodeFormat)((0, index_1.getInput)(index_1.Inputs.qrcodeFormat)), qrcodeOutputDest: (0, index_1.getInput)(index_1.Inputs.qrcodeOutputDest) || './preview-qrcode.png', pagePath: (0, index_1.getInput)(index_1.Inputs.pagePath), searchQuery: (0, index_1.getInput)(index_1.Inputs.searchQuery), scene: (0, index_1.getInputAsInt)(index_1.Inputs.scene) });
previewOption.qrcodeOutputDest = path_1.default.resolve(workspace, previewOption.qrcodeOutputDest);
core.info('Options:');
core.info(`${(0, index_1.stringify)(previewOption)}`);
if (option.platform === 'wechat') {
qrcode = yield (0, preview_1.preview)(previewOption);
}
else {
qrcode = yield (0, preview_2.preview)(previewOption);
}
}
if (autoPrivateKey) {
fs.promises.unlink(option.privateKeyPath);
}
core.setOutput(index_1.Outputs.appid, option.appid);
core.setOutput(index_1.Outputs.version, option.version);
core.info(` ⚙ ::set-output:: appid=${option.appid}`);
core.info(` ⚙ ::set-output:: version=${option.version}`);
core.info(` ✅ Success - ${option.mode} done.`);
let outputTemplate = (0, index_1.getInput)(index_1.Inputs.output);
if (outputTemplate) {
const outputPath = path_1.default.resolve(workspace, (0, index_1.getInput)(index_1.Inputs.outputPath) || './output.txt');
outputTemplate = outputTemplate
.replace(/{appid}/g, option.appid)
.replace(/{version}/g, option.version)
.replace(/{qrcode}/g, qrcode);
fs.writeFileSync(outputPath, outputTemplate);
core.info(` ✅ Success - write output file to ${outputPath}.`);
}
}
catch (error) {
if (autoPrivateKey) {
fs.promises.unlink(defaultPrivateKeyPath);
}
if (error instanceof Error)
core.setFailed(error.message);
}
});
}
run();
/***/ }),
/***/ 9241:
/***/ ((__unused_webpack_module, exports) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.filterQrcodeFormat = exports.filterPlatform = exports.filterMode = exports.filterType = void 0;
const modeDic = ['upload', 'preview'];
const typeDic = [
'miniProgram',
'miniGame',
'miniProgramPlugin',
'miniGamePlugin'
];
const filterType = (type) => {
if (typeDic.find(item => item === type)) {
return type;
}
return 'miniProgram';
};
exports.filterType = filterType;
const filterMode = (type) => {
if (modeDic.find(item => item === type)) {
return type;
}
return 'upload';
};
exports.filterMode = filterMode;
const filterPlatform = (val) => {
return val === 'douyin' ? 'douyin' : 'wechat';
};
exports.filterPlatform = filterPlatform;
const qrcodeFormatDic = ['base64', 'image', 'terminal'];
const filterQrcodeFormat = (type) => {
if (qrcodeFormatDic.find(item => item === type)) {
return type;
}
return 'terminal';
};
exports.filterQrcodeFormat = filterQrcodeFormat;
/***/ }),
/***/ 5158:
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.getInputAsBool = exports.getInputAsInt = exports.getInputAsArray = exports.getInput = void 0;
const core = __importStar(__nccwpck_require__(2186));
function getInput(name, options) {
const get = core.getInput(name, options);
return get || undefined;
}
exports.getInput = getInput;
function getInputAsArray(name, options) {
return core
.getInput(name, options)
.split('\n')
.map(s => s.replace(/^!\s+/, '!').trim())
.filter(x => x !== '');
}
exports.getInputAsArray = getInputAsArray;
function getInputAsInt(name, options) {
const value = parseInt(core.getInput(name, options));
if (isNaN(value) || value < 0) {
return undefined;
}
return value;
}
exports.getInputAsInt = getInputAsInt;
function getInputAsBool(name, options) {
const result = core.getInput(name, options);
return result.toLowerCase() === 'true';
}
exports.getInputAsBool = getInputAsBool;
/***/ }),
/***/ 2842:
/***/ ((__unused_webpack_module, exports) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.Outputs = exports.Inputs = void 0;
/* eslint-disable no-shadow */
var Inputs;
(function (Inputs) {
Inputs["mode"] = "mode";
Inputs["platform"] = "platform";
Inputs["type"] = "type";
Inputs["projectPath"] = "project-path";
Inputs["privateKey"] = "private-key";
Inputs["privateKeyPath"] = "private-key-path";
Inputs["ignores"] = "ignores";
Inputs["version"] = "version";
Inputs["desc"] = "desc";
Inputs["robot"] = "robot";
Inputs["threads"] = "threads";
// preview input
Inputs["qrcodeFormat"] = "qrcode-format";
Inputs["qrcodeOutputDest"] = "qrcode-output-dest";
Inputs["pagePath"] = "page-path";
Inputs["searchQuery"] = "search-query";
Inputs["scene"] = "scene";
// output
Inputs["output"] = "output";
Inputs["outputPath"] = "output-path";
Inputs["ciVersion"] = "ci-version";
})(Inputs = exports.Inputs || (exports.Inputs = {}));
var Outputs;
(function (Outputs) {
Outputs["appid"] = "appid";
Outputs["version"] = "version";
Outputs["outputPath"] = "outputPath";
})(Outputs = exports.Outputs || (exports.Outputs = {}));
/***/ }),
/***/ 1264:
/***/ ((__unused_webpack_module, exports) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.formatDate = void 0;
const padZero = (n) => {
return n < 10 ? `0${n}` : n.toString();
};
const formatDate = (date, format) => {
const map = {
YYYY: date.getFullYear(),
MM: padZero(date.getMonth() + 1),
DD: padZero(date.getDate()),
HH: padZero(date.getHours()),
mm: padZero(date.getMinutes()),
ss: padZero(date.getSeconds())
};
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
return format.replace(/YYYY|MM|DD|HH|mm|ss/g, matched => map[matched]);
};
exports.formatDate = formatDate;
/***/ }),
/***/ 1606:
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.stringify = void 0;
__exportStar(__nccwpck_require__(5158), exports);
__exportStar(__nccwpck_require__(2842), exports);
__exportStar(__nccwpck_require__(1264), exports);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const stringify = (obj) => {
return JSON.stringify(obj, null, 2);
};
exports.stringify = stringify;
/***/ }),
/***/ 1265:
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.generate = exports.getQrCode = void 0;
const jimp_1 = __importDefault(__nccwpck_require__(3794));
const jsqr_1 = __importDefault(__nccwpck_require__(6416));
const qrcode_terminal_1 = __importDefault(__nccwpck_require__(6718));
const getQrCode = (path) => __awaiter(void 0, void 0, void 0, function* () {
const jimp = yield jimp_1.default.read(path);
const pixels = Uint8ClampedArray.from(jimp.bitmap.data);
const qrcode = (0, jsqr_1.default)(pixels, jimp.getWidth(), jimp.getHeight());
if (!qrcode) {
throw Error(`get '${path}' file data failure`);
}
return qrcode;
});
exports.getQrCode = getQrCode;
const generate = (qrcode) => __awaiter(void 0, void 0, void 0, function* () {
return new Promise(RES => {
qrcode_terminal_1.default.generate(qrcode.data, {
small: true
}, (res) => {
RES(res.trim());
});
});
});
exports.generate = generate;
/***/ }),
/***/ 7351:
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.issue = exports.issueCommand = void 0;
const os = __importStar(__nccwpck_require__(2037));
const utils_1 = __nccwpck_require__(5278);
/**
* Commands
*
* Command Format:
* ::name key=value,key=value::message
*
* Examples:
* ::warning::This is the message
* ::set-env name=MY_VAR::some value
*/
function issueCommand(command, properties, message) {
const cmd = new Command(command, properties, message);
process.stdout.write(cmd.toString() + os.EOL);
}
exports.issueCommand = issueCommand;
function issue(name, message = '') {
issueCommand(name, {}, message);
}
exports.issue = issue;
const CMD_STRING = '::';
class Command {
constructor(command, properties, message) {
if (!command) {
command = 'missing.command';
}
this.command = command;
this.properties = properties;
this.message = message;
}
toString() {
let cmdStr = CMD_STRING + this.command;
if (this.properties && Object.keys(this.properties).length > 0) {
cmdStr += ' ';
let first = true;
for (const key in this.properties) {
if (this.properties.hasOwnProperty(key)) {
const val = this.properties[key];
if (val) {
if (first) {
first = false;
}
else {
cmdStr += ',';
}
cmdStr += `${key}=${escapeProperty(val)}`;
}
}
}
}
cmdStr += `${CMD_STRING}${escapeData(this.message)}`;
return cmdStr;
}
}
function escapeData(s) {
return utils_1.toCommandValue(s)
.replace(/%/g, '%25')
.replace(/\r/g, '%0D')
.replace(/\n/g, '%0A');
}
function escapeProperty(s) {
return utils_1.toCommandValue(s)
.replace(/%/g, '%25')
.replace(/\r/g, '%0D')
.replace(/\n/g, '%0A')
.replace(/:/g, '%3A')
.replace(/,/g, '%2C');
}
//# sourceMappingURL=command.js.map
/***/ }),
/***/ 2186:
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0;
const command_1 = __nccwpck_require__(7351);
const file_command_1 = __nccwpck_require__(717);
const utils_1 = __nccwpck_require__(5278);
const os = __importStar(__nccwpck_require__(2037));
const path = __importStar(__nccwpck_require__(1017));
const oidc_utils_1 = __nccwpck_require__(8041);
/**
* The code to exit an action
*/
var ExitCode;
(function (ExitCode) {
/**
* A code indicating that the action was successful
*/
ExitCode[ExitCode["Success"] = 0] = "Success";
/**
* A code indicating that the action was a failure
*/
ExitCode[ExitCode["Failure"] = 1] = "Failure";
})(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
//-----------------------------------------------------------------------
// Variables
//-----------------------------------------------------------------------
/**
* Sets env variable for this action and future actions in the job
* @param name the name of the variable to set
* @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function exportVariable(name, val) {
const convertedVal = utils_1.toCommandValue(val);
process.env[name] = convertedVal;
const filePath = process.env['GITHUB_ENV'] || '';
if (filePath) {
return file_command_1.issueFileCommand('ENV', file_command_1.prepareKeyValueMessage(name, val));
}
command_1.issueCommand('set-env', { name }, convertedVal);
}
exports.exportVariable = exportVariable;
/**
* Registers a secret which will get masked from logs
* @param secret value of the secret
*/
function setSecret(secret) {
command_1.issueCommand('add-mask', {}, secret);
}
exports.setSecret = setSecret;
/**
* Prepends inputPath to the PATH (for this action and future actions)
* @param inputPath
*/
function addPath(inputPath) {
const filePath = process.env['GITHUB_PATH'] || '';
if (filePath) {
file_command_1.issueFileCommand('PATH', inputPath);
}
else {
command_1.issueCommand('add-path', {}, inputPath);
}
process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
}
exports.addPath = addPath;
/**
* Gets the value of an input.
* Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.
* Returns an empty string if the value is not defined.
*
* @param name name of the input to get
* @param options optional. See InputOptions.
* @returns string
*/
function getInput(name, options) {
const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
if (options && options.required && !val) {
throw new Error(`Input required and not supplied: ${name}`);
}
if (options && options.trimWhitespace === false) {
return val;
}
return val.trim();
}
exports.getInput = getInput;
/**
* Gets the values of an multiline input. Each value is also trimmed.
*
* @param name name of the input to get
* @param options optional. See InputOptions.
* @returns string[]
*
*/
function getMultilineInput(name, options) {
const inputs = getInput(name, options)
.split('\n')
.filter(x => x !== '');
if (options && options.trimWhitespace === false) {
return inputs;
}
return inputs.map(input => input.trim());
}
exports.getMultilineInput = getMultilineInput;
/**
* Gets the input value of the boolean type in the YAML 1.2 "core schema" specification.
* Support boolean input list: `true | True | TRUE | false | False | FALSE` .
* The return value is also in boolean type.
* ref: https://yaml.org/spec/1.2/spec.html#id2804923
*
* @param name name of the input to get
* @param options optional. See InputOptions.
* @returns boolean
*/
function getBooleanInput(name, options) {
const trueValue = ['true', 'True', 'TRUE'];
const falseValue = ['false', 'False', 'FALSE'];
const val = getInput(name, options);
if (trueValue.includes(val))
return true;
if (falseValue.includes(val))
return false;
throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name}\n` +
`Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
}
exports.getBooleanInput = getBooleanInput;
/**
* Sets the value of an output.
*
* @param name name of the output to set
* @param value value to store. Non-string values will be converted to a string via JSON.stringify
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function setOutput(name, value) {
const filePath = process.env['GITHUB_OUTPUT'] || '';
if (filePath) {
return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value));
}
process.stdout.write(os.EOL);
command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value));
}
exports.setOutput = setOutput;
/**
* Enables or disables the echoing of commands into stdout for the rest of the step.
* Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.
*
*/
function setCommandEcho(enabled) {
command_1.issue('echo', enabled ? 'on' : 'off');
}
exports.setCommandEcho = setCommandEcho;
//-----------------------------------------------------------------------
// Results
//-----------------------------------------------------------------------
/**
* Sets the action status to failed.
* When the action exits it will be with an exit code of 1
* @param message add error issue message
*/
function setFailed(message) {
process.exitCode = ExitCode.Failure;
error(message);
}
exports.setFailed = setFailed;
//-----------------------------------------------------------------------
// Logging Commands
//-----------------------------------------------------------------------
/**
* Gets whether Actions Step Debug is on or not
*/
function isDebug() {
return process.env['RUNNER_DEBUG'] === '1';
}
exports.isDebug = isDebug;
/**
* Writes debug message to user log
* @param message debug message
*/
function debug(message) {
command_1.issueCommand('debug', {}, message);
}
exports.debug = debug;
/**
* Adds an error issue
* @param message error issue message. Errors will be converted to string via toString()
* @param properties optional properties to add to the annotation.
*/
function error(message, properties = {}) {
command_1.issueCommand('error', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
}
exports.error = error;
/**
* Adds a warning issue
* @param message warning issue message. Errors will be converted to string via toString()
* @param properties optional properties to add to the annotation.
*/
function warning(message, properties = {}) {
command_1.issueCommand('warning', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
}
exports.warning = warning;
/**
* Adds a notice issue
* @param message notice issue message. Errors will be converted to string via toString()
* @param properties optional properties to add to the annotation.
*/
function notice(message, properties = {}) {
command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);
}
exports.notice = notice;
/**
* Writes info to log with console.log.
* @param message info message
*/
function info(message) {
process.stdout.write(message + os.EOL);
}
exports.info = info;
/**
* Begin an output group.
*
* Output until the next `groupEnd` will be foldable in this group
*
* @param name The name of the output group
*/
function startGroup(name) {
command_1.issue('group', name);
}
exports.startGroup = startGroup;
/**
* End an output group.
*/
function endGroup() {
command_1.issue('endgroup');
}
exports.endGroup = endGroup;
/**
* Wrap an asynchronous function call in a group.
*
* Returns the same type as the function itself.
*
* @param name The name of the group
* @param fn The function to wrap in the group
*/
function group(name, fn) {
return __awaiter(this, void 0, void 0, function* () {
startGroup(name);
let result;
try {
result = yield fn();
}
finally {
endGroup();
}
return result;
});
}
exports.group = group;
//-----------------------------------------------------------------------
// Wrapper action state
//-----------------------------------------------------------------------
/**
* Saves state for current action, the state can only be retrieved by this action's post job execution.
*
* @param name name of the state to store
* @param value value to store. Non-string values will be converted to a string via JSON.stringify
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function saveState(name, value) {
const filePath = process.env['GITHUB_STATE'] || '';
if (filePath) {
return file_command_1.issueFileCommand('STATE', file_command_1.prepareKeyValueMessage(name, value));
}
command_1.issueCommand('save-state', { name }, utils_1.toCommandValue(value));
}
exports.saveState = saveState;
/**
* Gets the value of an state set by this action's main execution.
*
* @param name name of the state to get
* @returns string
*/
function getState(name) {
return process.env[`STATE_${name}`] || '';
}
exports.getState = getState;
function getIDToken(aud) {
return __awaiter(this, void 0, void 0, function* () {
return yield oidc_utils_1.OidcClient.getIDToken(aud);
});
}
exports.getIDToken = getIDToken;
/**
* Summary exports
*/
var summary_1 = __nccwpck_require__(1327);
Object.defineProperty(exports, "summary", ({ enumerable: true, get: function () { return summary_1.summary; } }));
/**
* @deprecated use core.summary
*/
var summary_2 = __nccwpck_require__(1327);
Object.defineProperty(exports, "markdownSummary", ({ enumerable: true, get: function () { return summary_2.markdownSummary; } }));
/**
* Path exports
*/
var path_utils_1 = __nccwpck_require__(2981);
Object.defineProperty(exports, "toPosixPath", ({ enumerable: true, get: function () { return path_utils_1.toPosixPath; } }));
Object.defineProperty(exports, "toWin32Path", ({ enumerable: true, get: function () { return path_utils_1.toWin32Path; } }));
Object.defineProperty(exports, "toPlatformPath", ({ enumerable: true, get: function () { return path_utils_1.toPlatformPath; } }));
//# sourceMappingURL=core.js.map
/***/ }),
/***/ 717:
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
"use strict";
// For internal use, subject to change.
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.prepareKeyValueMessage = exports.issueFileCommand = void 0;
// We use any as a valid input type
/* eslint-disable @typescript-eslint/no-explicit-any */
const fs = __importStar(__nccwpck_require__(7147));
const os = __importStar(__nccwpck_require__(2037));
const uuid_1 = __nccwpck_require__(5840);
const utils_1 = __nccwpck_require__(5278);
function issueFileCommand(command, message) {
const filePath = process.env[`GITHUB_${command}`];
if (!filePath) {
throw new Error(`Unable to find environment variable for file command ${command}`);
}
if (!fs.existsSync(filePath)) {
throw new Error(`Missing file at path: ${filePath}`);
}
fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {
encoding: 'utf8'
});
}
exports.issueFileCommand = issueFileCommand;
function prepareKeyValueMessage(key, value) {
const delimiter = `ghadelimiter_${uuid_1.v4()}`;
const convertedValue = utils_1.toCommandValue(value);
// These should realistically never happen, but just in case someone finds a
// way to exploit uuid generation let's not allow keys or values that contain
// the delimiter.
if (key.includes(delimiter)) {
throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`);
}
if (convertedValue.includes(delimiter)) {
throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`);
}
return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;
}
exports.prepareKeyValueMessage = prepareKeyValueMessage;
//# sourceMappingURL=file-command.js.map
/***/ }),
/***/ 8041:
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.OidcClient = void 0;
const http_client_1 = __nccwpck_require__(6255);
const auth_1 = __nccwpck_require__(5526);
const core_1 = __nccwpck_require__(2186);
class OidcClient {
static createHttpClient(allowRetry = true, maxRetry = 10) {
const requestOptions = {
allowRetries: allowRetry,
maxRetries: maxRetry
};
return new http_client_1.HttpClient('actions/oidc-client', [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions);
}
static getRequestToken() {
const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'];
if (!token) {
throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable');
}
return token;
}
static getIDTokenUrl() {
const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL'];
if (!runtimeUrl) {
throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable');
}
return runtimeUrl;
}
static getCall(id_token_url) {
var _a;
return __awaiter(this, void 0, void 0, function* () {
const httpclient = OidcClient.createHttpClient();
const res = yield httpclient
.getJson(id_token_url)
.catch(error => {
throw new Error(`Failed to get ID Token. \n
Error Code : ${error.statusCode}\n
Error Message: ${error.result.message}`);
});
const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;
if (!id_token) {
throw new Error('Response json body do not have ID Token field');
}
return id_token;
});
}
static getIDToken(audience) {
return __awaiter(this, void 0, void 0, function* () {
try {
// New ID Token is requested from action service
let id_token_url = OidcClient.getIDTokenUrl();
if (audience) {
const encodedAudience = encodeURIComponent(audience);
id_token_url = `${id_token_url}&audience=${encodedAudience}`;
}
core_1.debug(`ID token url is ${id_token_url}`);
const id_token = yield OidcClient.getCall(id_token_url);
core_1.setSecret(id_token);
return id_token;
}
catch (error) {
throw new Error(`Error message: ${error.message}`);
}
});
}
}
exports.OidcClient = OidcClient;
//# sourceMappingURL=oidc-utils.js.map
/***/ }),
/***/ 2981:
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0;
const path = __importStar(__nccwpck_require__(1017));
/**
* toPosixPath converts the given path to the posix form. On Windows, \\ will be
* replaced with /.
*
* @param pth. Path to transform.
* @return string Posix path.
*/
function toPosixPath(pth) {
return pth.replace(/[\\]/g, '/');
}
exports.toPosixPath = toPosixPath;
/**
* toWin32Path converts the given path to the win32 form. On Linux, / will be
* replaced with \\.
*
* @param pth. Path to transform.
* @return string Win32 path.
*/
function toWin32Path(pth) {
return pth.replace(/[/]/g, '\\');
}
exports.toWin32Path = toWin32Path;
/**
* toPlatformPath converts the given path to a platform-specific path. It does
* this by replacing instances of / and \ with the platform-specific path
* separator.
*
* @param pth The path to platformize.
* @return string The platform-specific path.
*/
function toPlatformPath(pth) {
return pth.replace(/[/\\]/g, path.sep);
}
exports.toPlatformPath = toPlatformPath;
//# sourceMappingURL=path-utils.js.map
/***/ }),
/***/ 1327:
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0;
const os_1 = __nccwpck_require__(2037);
const fs_1 = __nccwpck_require__(7147);
const { access, appendFile, writeFile } = fs_1.promises;
exports.SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY';
exports.SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary';
class Summary {
constructor() {
this._buffer = '';
}
/**
* Finds the summary file path from the environment, rejects if env var is not found or file does not exist
* Also checks r/w permissions.
*
* @returns step summary file path
*/
filePath() {
return __awaiter(this, void 0, void 0, function* () {
if (this._filePath) {
return this._filePath;
}
const pathFromEnv = process.env[exports.SUMMARY_ENV_VAR];
if (!pathFromEnv) {
throw new Error(`Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);
}
try {
yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK);
}
catch (_a) {
throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`);
}
this._filePath = pathFromEnv;
return this._filePath;
});
}
/**
* Wraps content in an HTML tag, adding any HTML attributes
*
* @param {string} tag HTML tag to wrap
* @param {string | null} content content within the tag
* @param {[attribute: string]: string} attrs key-value list of HTML attributes to add
*
* @returns {string} content wrapped in HTML element
*/
wrap(tag, content, attrs = {}) {
const htmlAttrs = Object.entries(attrs)
.map(([key, value]) => ` ${key}="${value}"`)
.join('');
if (!content) {
return `<${tag}${htmlAttrs}>`;
}
return `<${tag}${htmlAttrs}>${content}</${tag}>`;
}
/**
* Writes text in the buffer to the summary buffer file and empties buffer. Will append by default.
*
* @param {SummaryWriteOptions} [options] (optional) options for write operation
*
* @returns {Promise<Summary>} summary instance
*/
write(options) {
return __awaiter(this, void 0, void 0, function* () {
const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite);
const filePath = yield this.filePath();
const writeFunc = overwrite ? writeFile : appendFile;
yield writeFunc(filePath, this._buffer, { encoding: 'utf8' });
return this.emptyBuffer();
});
}
/**
* Clears the summary buffer and wipes the summary file
*
* @returns {Summary} summary instance
*/
clear() {
return __awaiter(this, void 0, void 0, function* () {
return this.emptyBuffer().write({ overwrite: true });
});
}
/**
* Returns the current summary buffer as a string
*
* @returns {string} string of summary buffer
*/
stringify() {
return this._buffer;
}
/**
* If the summary buffer is empty
*
* @returns {boolen} true if the buffer is empty
*/
isEmptyBuffer() {
return this._buffer.length === 0;
}
/**
* Resets the summary buffer without writing to summary file
*
* @returns {Summary} summary instance
*/
emptyBuffer() {
this._buffer = '';
return this;
}
/**
* Adds raw text to the summary buffer
*
* @param {string} text content to add
* @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false)
*
* @returns {Summary} summary instance
*/
addRaw(text, addEOL = false) {
this._buffer += text;
return addEOL ? this.addEOL() : this;
}
/**
* Adds the operating system-specific end-of-line marker to the buffer
*
* @returns {Summary} summary instance
*/
addEOL() {
return this.addRaw(os_1.EOL);
}
/**
* Adds an HTML codeblock to the summary buffer
*
* @param {string} code content to render within fenced code block
* @param {string} lang (optional) language to syntax highlight code
*
* @returns {Summary} summary instance
*/
addCodeBlock(code, lang) {
const attrs = Object.assign({}, (lang && { lang }));
const element = this.wrap('pre', this.wrap('code', code), attrs);
return this.addRaw(element).addEOL();
}
/**
* Adds an HTML list to the summary buffer
*
* @param {string[]} items list of items to render
* @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false)
*
* @returns {Summary} summary instance
*/
addList(items, ordered = false) {
const tag = ordered ? 'ol' : 'ul';
const listItems = items.map(item => this.wrap('li', item)).join('');
const element = this.wrap(tag, listItems);
return this.addRaw(element).addEOL();
}
/**
* Adds an HTML table to the summary buffer
*
* @param {SummaryTableCell[]} rows table rows
*
* @returns {Summary} summary instance
*/
addTable(rows) {
const tableBody = rows
.map(row => {
const cells = row
.map(cell => {
if (typeof cell === 'string') {
return this.wrap('td', cell);
}
const { header, data, colspan, rowspan } = cell;
const tag = header ? 'th' : 'td';
const attrs = Object.assign(Object.assign({}, (colspan && { colspan })), (rowspan && { rowspan }));
return this.wrap(tag, data, attrs);
})
.join('');
return this.wrap('tr', cells);
})
.join('');
const element = this.wrap('table', tableBody);
return this.addRaw(element).addEOL();
}
/**
* Adds a collapsable HTML details element to the summary buffer
*
* @param {string} label text for the closed state
* @param {string} content collapsable content
*
* @returns {Summary} summary instance
*/
addDetails(label, content) {
const element = this.wrap('details', this.wrap('summary', label) + content);
return this.addRaw(element).addEOL();
}
/**
* Adds an HTML image tag to the summary buffer
*
* @param {string} src path to the image you to embed
* @param {string} alt text description of the image
* @param {SummaryImageOptions} options (optional) addition image attributes
*
* @returns {Summary} summary instance
*/
addImage(src, alt, options) {
const { width, height } = options || {};
const attrs = Object.assign(Object.assign({}, (width && { width })), (height && { height }));
const element = this.wrap('img', null, Object.assign({ src, alt }, attrs));
return this.addRaw(element).addEOL();
}
/**
* Adds an HTML section heading element
*
* @param {string} text heading text
* @param {number | string} [level=1] (optional) the heading level, default: 1
*
* @returns {Summary} summary instance
*/
addHeading(text, level) {
const tag = `h${level}`;
const allowedTag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag)
? tag
: 'h1';
const element = this.wrap(allowedTag, text);
return this.addRaw(element).addEOL();
}
/**
* Adds an HTML thematic break (<hr>) to the summary buffer
*
* @returns {Summary} summary instance
*/
addSeparator() {
const element = this.wrap('hr', null);
return this.addRaw(element).addEOL();
}
/**
* Adds an HTML line break (<br>) to the summary buffer
*
* @returns {Summary} summary instance
*/
addBreak() {
const element = this.wrap('br', null);
return this.addRaw(element).addEOL();
}
/**
* Adds an HTML blockquote to the summary buffer
*
* @param {string} text quote text
* @param {string} cite (optional) citation url
*
* @returns {Summary} summary instance
*/
addQuote(text, cite) {
const attrs = Object.assign({}, (cite && { cite }));
const element = this.wrap('blockquote', text, attrs);
return this.addRaw(element).addEOL();
}
/**
* Adds an HTML anchor tag to the summary buffer
*
* @param {string} text link text/content
* @param {string} href hyperlink
*
* @returns {Summary} summary instance
*/
addLink(text, href) {
const element = this.wrap('a', text, { href });
return this.addRaw(element).addEOL();
}
}
const _summary = new Summary();
/**
* @deprecated use `core.summary`
*/
exports.markdownSummary = _summary;
exports.summary = _summary;
//# sourceMappingURL=summary.js.map
/***/ }),
/***/ 5278:
/***/ ((__unused_webpack_module, exports) => {
"use strict";
// We use any as a valid input type
/* eslint-disable @typescript-eslint/no-explicit-any */
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.toCommandProperties = exports.toCommandValue = void 0;
/**
* Sanitizes an input into a string so it can be passed into issueCommand safely
* @param input input to sanitize into a string
*/
function toCommandValue(input) {
if (input === null || input === undefined) {
return '';
}
else if (typeof input === 'string' || input instanceof String) {
return input;
}
return JSON.stringify(input);
}
exports.toCommandValue = toCommandValue;
/**
*
* @param annotationProperties
* @returns The command properties to send with the actual annotation command
* See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646
*/
function toCommandProperties(annotationProperties) {
if (!Object.keys(annotationProperties).length) {
return {};
}
return {
title: annotationProperties.title,
file: annotationProperties.file,
line: annotationProperties.startLine,
endLine: annotationProperties.endLine,
col: annotationProperties.startColumn,
endColumn: annotationProperties.endColumn
};
}
exports.toCommandProperties = toCommandProperties;
//# sourceMappingURL=utils.js.map
/***/ }),
/***/ 5526:
/***/ (function(__unused_webpack_module, exports) {
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0;
class BasicCredentialHandler {
constructor(username, password) {
this.username = username;
this.password = password;
}
prepareRequest(options) {
if (!options.headers) {
throw Error('The request has no headers');
}
options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`;
}
// This handler cannot handle 401
canHandleAuthentication() {
return false;
}
handleAuthentication() {
return __awaiter(this, void 0, void 0, function* () {
throw new Error('not implemented');
});
}
}
exports.BasicCredentialHandler = BasicCredentialHandler;
class BearerCredentialHandler {
constructor(token) {
this.token = token;
}
// currently implements pre-authorization
// TODO: support preAuth = false where it hooks on 401
prepareRequest(options) {
if (!options.headers) {
throw Error('The request has no headers');
}
options.headers['Authorization'] = `Bearer ${this.token}`;
}
// This handler cannot handle 401
canHandleAuthentication() {
return false;
}
handleAuthentication() {
return __awaiter(this, void 0, void 0, function* () {
throw new Error('not implemented');
});
}
}
exports.BearerCredentialHandler = BearerCredentialHandler;
class PersonalAccessTokenCredentialHandler {
constructor(token) {
this.token = token;
}
// currently implements pre-authorization
// TODO: support preAuth = false where it hooks on 401
prepareRequest(options) {
if (!options.headers) {
throw Error('The request has no headers');
}
options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`;
}
// This handler cannot handle 401
canHandleAuthentication() {
return false;
}
handleAuthentication() {
return __awaiter(this, void 0, void 0, function* () {
throw new Error('not implemented');
});
}
}
exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler;
//# sourceMappingURL=auth.js.map
/***/ }),
/***/ 6255:
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
"use strict";
/* eslint-disable @typescript-eslint/no-explicit-any */
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0;
const http = __importStar(__nccwpck_require__(3685));
const https = __importStar(__nccwpck_require__(5687));
const pm = __importStar(__nccwpck_require__(9835));
const tunnel = __importStar(__nccwpck_require__(4294));
var HttpCodes;
(function (HttpCodes) {
HttpCodes[HttpCodes["OK"] = 200] = "OK";
HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests";
HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
var Headers;
(function (Headers) {
Headers["Accept"] = "accept";
Headers["ContentType"] = "content-type";
})(Headers = exports.Headers || (exports.Headers = {}));
var MediaTypes;
(function (MediaTypes) {
MediaTypes["ApplicationJson"] = "application/json";
})(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {}));
/**
* Returns the proxy URL, depending upon the supplied url and proxy environment variables.
* @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
*/
function getProxyUrl(serverUrl) {
const proxyUrl = pm.getProxyUrl(new URL(serverUrl));
return proxyUrl ? proxyUrl.href : '';
}
exports.getProxyUrl = getProxyUrl;
const HttpRedirectCodes = [
HttpCodes.MovedPermanently,
HttpCodes.ResourceMoved,
HttpCodes.SeeOther,
HttpCodes.TemporaryRedirect,
HttpCodes.PermanentRedirect
];
const HttpResponseRetryCodes = [
HttpCodes.BadGateway,
HttpCodes.ServiceUnavailable,
HttpCodes.GatewayTimeout
];
const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
const ExponentialBackoffCeiling = 10;
const ExponentialBackoffTimeSlice = 5;
class HttpClientError extends Error {
constructor(message, statusCode) {
super(message);
this.name = 'HttpClientError';
this.statusCode = statusCode;
Object.setPrototypeOf(this, HttpClientError.prototype);
}
}
exports.HttpClientError = HttpClientError;
class HttpClientResponse {
constructor(message) {
this.message = message;
}
readBody() {
return __awaiter(this, void 0, void 0, function* () {
return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
let output = Buffer.alloc(0);
this.message.on('data', (chunk) => {
output = Buffer.concat([output, chunk]);
});
this.message.on('end', () => {
resolve(output.toString());
});
}));
});
}
readBodyBuffer() {
return __awaiter(this, void 0, void 0, function* () {
return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
const chunks = [];
this.message.on('data', (chunk) => {
chunks.push(chunk);
});
this.message.on('end', () => {
resolve(Buffer.concat(chunks));
});
}));
});
}
}
exports.HttpClientResponse = HttpClientResponse;
function isHttps(requestUrl) {
const parsedUrl = new URL(requestUrl);
return parsedUrl.protocol === 'https:';
}
exports.isHttps = isHttps;
class HttpClient {
constructor(userAgent, handlers, requestOptions) {
this._ignoreSslError = false;
this._allowRedirects = true;
this._allowRedirectDowngrade = false;
this._maxRedirects = 50;
this._allowRetries = false;
this._maxRetries = 1;
this._keepAlive = false;
this._disposed = false;
this.userAgent = userAgent;
this.handlers = handlers || [];
this.requestOptions = requestOptions;
if (requestOptions) {
if (requestOptions.ignoreSslError != null) {
this._ignoreSslError = requestOptions.ignoreSslError;
}
this._socketTimeout = requestOptions.socketTimeout;
if (requestOptions.allowRedirects != null) {
this._allowRedirects = requestOptions.allowRedirects;
}
if (requestOptions.allowRedirectDowngrade != null) {
this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
}
if (requestOptions.maxRedirects != null) {
this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
}
if (requestOptions.keepAlive != null) {
this._keepAlive = requestOptions.keepAlive;
}
if (requestOptions.allowRetries != null) {
this._allowRetries = requestOptions.allowRetries;
}
if (requestOptions.maxRetries != null) {
this._maxRetries = requestOptions.maxRetries;
}
}
}
options(requestUrl, additionalHeaders) {
return __awaiter(this, void 0, void 0, function* () {
return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
});
}
get(requestUrl, additionalHeaders) {
return __awaiter(this, void 0, void 0, function* () {
return this.request('GET', requestUrl, null, additionalHeaders || {});
});
}
del(requestUrl, additionalHeaders) {
return __awaiter(this, void 0, void 0, function* () {
return this.request('DELETE', requestUrl, null, additionalHeaders || {});
});
}
post(requestUrl, data, additionalHeaders) {
return __awaiter(this, void 0, void 0, function* () {
return this.request('POST', requestUrl, data, additionalHeaders || {});
});
}
patch(requestUrl, data, additionalHeaders) {
return __awaiter(this, void 0, void 0, function* () {
return this.request('PATCH', requestUrl, data, additionalHeaders || {});
});
}
put(requestUrl, data, additionalHeaders) {
return __awaiter(this, void 0, void 0, function* () {
return this.request('PUT', requestUrl, data, additionalHeaders || {});
});
}
head(requestUrl, additionalHeaders) {
return __awaiter(this, void 0, void 0, function* () {
return this.request('HEAD', requestUrl, null, additionalHeaders || {});
});
}
sendStream(verb, requestUrl, stream, additionalHeaders) {
return __awaiter(this, void 0, void 0, function* () {
return this.request(verb, requestUrl, stream, additionalHeaders);
});
}
/**
* Gets a typed object from an endpoint
* Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise
*/
getJson(requestUrl, additionalHeaders = {}) {
return __awaiter(this, void 0, void 0, function* () {
additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
const res = yield this.get(requestUrl, additionalHeaders);
return this._processResponse(res, this.requestOptions);
});
}
postJson(requestUrl, obj, additionalHeaders = {}) {
return __awaiter(this, void 0, void 0, function* () {
const data = JSON.stringify(obj, null, 2);
additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
const res = yield this.post(requestUrl, data, additionalHeaders);
return this._processResponse(res, this.requestOptions);
});
}
putJson(requestUrl, obj, additionalHeaders = {}) {
return __awaiter(this, void 0, void 0, function* () {
const data = JSON.stringify(obj, null, 2);
additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
const res = yield this.put(requestUrl, data, additionalHeaders);
return this._processResponse(res, this.requestOptions);
});
}
patchJson(requestUrl, obj, additionalHeaders = {}) {
return __awaiter(this, void 0, void 0, function* () {
const data = JSON.stringify(obj, null, 2);
additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
const res = yield this.patch(requestUrl, data, additionalHeaders);
return this._processResponse(res, this.requestOptions);
});
}
/**
* Makes a raw http request.
* All other methods such as get, post, patch, and request ultimately call this.
* Prefer get, del, post and patch
*/
request(verb, requestUrl, data, headers) {
return __awaiter(this, void 0, void 0, function* () {
if (this._disposed) {
throw new Error('Client has already been disposed.');
}
const parsedUrl = new URL(requestUrl);
let info = this._prepareRequest(verb, parsedUrl, headers);
// Only perform retries on reads since writes may not be idempotent.
const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb)
? this._maxRetries + 1
: 1;
let numTries = 0;
let response;
do {
response = yield this.requestRaw(info, data);
// Check if it's an authentication challenge
if (response &&
response.message &&
response.message.statusCode === HttpCodes.Unauthorized) {
let authenticationHandler;
for (const handler of this.handlers) {
if (handler.canHandleAuthentication(response)) {
authenticationHandler = handler;
break;
}
}
if (authenticationHandler) {
return authenticationHandler.handleAuthentication(this, info, data);
}
else {
// We have received an unauthorized response but have no handlers to handle it.
// Let the response return to the caller.
return response;
}
}
let redirectsRemaining = this._maxRedirects;
while (response.message.statusCode &&
HttpRedirectCodes.includes(response.message.statusCode) &&
this._allowRedirects &&
redirectsRemaining > 0) {
const redirectUrl = response.message.headers['location'];
if (!redirectUrl) {
// if there's no location to redirect to, we won't
break;
}
const parsedRedirectUrl = new URL(redirectUrl);
if (parsedUrl.protocol === 'https:' &&
parsedUrl.protocol !== parsedRedirectUrl.protocol &&
!this._allowRedirectDowngrade) {
throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.');
}
// we need to finish reading the response before reassigning response
// which will leak the open socket.
yield response.readBody();
// strip authorization header if redirected to a different hostname
if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {
for (const header in headers) {
// header names are case insensitive
if (header.toLowerCase() === 'authorization') {
delete headers[header];
}
}
}
// let's make the request with the new redirectUrl
info = this._prepareRequest(verb, parsedRedirectUrl, headers);
response = yield this.requestRaw(info, data);
redirectsRemaining--;
}
if (!response.message.statusCode ||
!HttpResponseRetryCodes.includes(response.message.statusCode)) {
// If not a retry code, return immediately instead of retrying
return response;
}
numTries += 1;
if (numTries < maxTries) {
yield response.readBody();
yield this._performExponentialBackoff(numTries);
}
} while (numTries < maxTries);
return response;
});
}
/**
* Needs to be called if keepAlive is set to true in request options.
*/
dispose() {
if (this._agent) {
this._agent.destroy();
}
this._disposed = true;
}
/**
* Raw request.
* @param info
* @param data
*/
requestRaw(info, data) {
return __awaiter(this, void 0, void 0, function* () {
return new Promise((resolve, reject) => {
function callbackForResult(err, res) {
if (err) {
reject(err);
}
else if (!res) {
// If `err` is not passed, then `res` must be passed.
reject(new Error('Unknown error'));
}
else {
resolve(res);
}
}
this.requestRawWithCallback(info, data, callbackForResult);
});
});
}
/**
* Raw request with callback.
* @param info
* @param data
* @param onResult
*/
requestRawWithCallback(info, data, onResult) {
if (typeof data === 'string') {
if (!info.options.headers) {
info.options.headers = {};
}
info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');
}
let callbackCalled = false;
function handleResult(err, res) {
if (!callbackCalled) {
callbackCalled = true;
onResult(err, res);
}
}
const req = info.httpModule.request(info.options, (msg) => {
const res = new HttpClientResponse(msg);
handleResult(undefined, res);
});
let socket;
req.on('socket', sock => {
socket = sock;
});
// If we ever get disconnected, we want the socket to timeout eventually
req.setTimeout(this._socketTimeout || 3 * 60000, () => {
if (socket) {
socket.end();
}
handleResult(new Error(`Request timeout: ${info.options.path}`));
});
req.on('error', function (err) {
// err has statusCode property
// res should have headers
handleResult(err);
});
if (data && typeof data === 'string') {
req.write(data, 'utf8');
}
if (data && typeof data !== 'string') {
data.on('close', function () {
req.end();
});
data.pipe(req);
}
else {
req.end();
}
}
/**
* Gets an http agent. This function is useful when you need an http agent that handles
* routing through a proxy server - depending upon the url and proxy environment variables.
* @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
*/
getAgent(serverUrl) {
const parsedUrl = new URL(serverUrl);
return this._getAgent(parsedUrl);
}
_prepareRequest(method, requestUrl, headers) {
const info = {};
info.parsedUrl = requestUrl;
const usingSsl = info.parsedUrl.protocol === 'https:';
info.httpModule = usingSsl ? https : http;
const defaultPort = usingSsl ? 443 : 80;
info.options = {};
info.options.host = info.parsedUrl.hostname;
info.options.port = info.parsedUrl.port
? parseInt(info.parsedUrl.port)
: defaultPort;
info.options.path =
(info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
info.options.method = method;
info.options.headers = this._mergeHeaders(headers);
if (this.userAgent != null) {
info.options.headers['user-agent'] = this.userAgent;
}
info.options.agent = this._getAgent(info.parsedUrl);
// gives handlers an opportunity to participate
if (this.handlers) {
for (const handler of this.handlers) {
handler.prepareRequest(info.options);
}
}
return info;
}
_mergeHeaders(headers) {
if (this.requestOptions && this.requestOptions.headers) {
return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {}));
}
return lowercaseKeys(headers || {});
}
_getExistingOrDefaultHeader(additionalHeaders, header, _default) {
let clientHeader;
if (this.requestOptions && this.requestOptions.headers) {
clientHeader = lowercaseKeys(this.requestOptions.headers)[header];
}
return additionalHeaders[header] || clientHeader || _default;
}
_getAgent(parsedUrl) {
let agent;
const proxyUrl = pm.getProxyUrl(parsedUrl);
const useProxy = proxyUrl && proxyUrl.hostname;
if (this._keepAlive && useProxy) {
agent = this._proxyAgent;
}
if (this._keepAlive && !useProxy) {
agent = this._agent;
}
// if agent is already assigned use that agent.
if (agent) {
return agent;
}
const usingSsl = parsedUrl.protocol === 'https:';
let maxSockets = 100;
if (this.requestOptions) {
maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
}
// This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis.
if (proxyUrl && proxyUrl.hostname) {
const agentOptions = {
maxSockets,
keepAlive: this._keepAlive,
proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && {
proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`
})), { host: proxyUrl.hostname, port: proxyUrl.port })
};
let tunnelAgent;
const overHttps = proxyUrl.protocol === 'https:';
if (usingSsl) {
tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
}
else {
tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
}
agent = tunnelAgent(agentOptions);
this._proxyAgent = agent;
}
// if reusing agent across request and tunneling agent isn't assigned create a new agent
if (this._keepAlive && !agent) {
const options = { keepAlive: this._keepAlive, maxSockets };
agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
this._agent = agent;
}
// if not using private agent and tunnel agent isn't setup then use global agent
if (!agent) {
agent = usingSsl ? https.globalAgent : http.globalAgent;
}
if (usingSsl && this._ignoreSslError) {
// we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
// http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
// we have to cast it to any and change it directly
agent.options = Object.assign(agent.options || {}, {
rejectUnauthorized: false
});
}
return agent;
}
_performExponentialBackoff(retryNumber) {
return __awaiter(this, void 0, void 0, function* () {
retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
return new Promise(resolve => setTimeout(() => resolve(), ms));
});
}
_processResponse(res, options) {
return __awaiter(this, void 0, void 0, function* () {
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
const statusCode = res.message.statusCode || 0;
const response = {
statusCode,
result: null,
headers: {}
};
// not found leads to null obj returned
if (statusCode === HttpCodes.NotFound) {
resolve(response);
}
// get the result from the body
function dateTimeDeserializer(key, value) {
if (typeof value === 'string') {
const a = new Date(value);
if (!isNaN(a.valueOf())) {
return a;
}
}
return value;
}
let obj;
let contents;
try {
contents = yield res.readBody();
if (contents && contents.length > 0) {
if (options && options.deserializeDates) {
obj = JSON.parse(contents, dateTimeDeserializer);
}
else {
obj = JSON.parse(contents);
}
response.result = obj;
}
response.headers = res.message.headers;
}
catch (err) {
// Invalid resource (contents not json); leaving result obj null
}
// note that 3xx redirects are handled by the http layer.
if (statusCode > 299) {
let msg;
// if exception/error in body, attempt to get better error
if (obj && obj.message) {
msg = obj.message;
}
else if (contents && contents.length > 0) {
// it may be the case that the exception is in the body message as string
msg = contents;
}
else {
msg = `Failed request: (${statusCode})`;
}
const err = new HttpClientError(msg, statusCode);
err.result = response.result;
reject(err);
}
else {
resolve(response);
}
}));
});
}
}
exports.HttpClient = HttpClient;
const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 9835:
/***/ ((__unused_webpack_module, exports) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.checkBypass = exports.getProxyUrl = void 0;
function getProxyUrl(reqUrl) {
const usingSsl = reqUrl.protocol === 'https:';
if (checkBypass(reqUrl)) {
return undefined;
}
const proxyVar = (() => {
if (usingSsl) {
return process.env['https_proxy'] || process.env['HTTPS_PROXY'];
}
else {
return process.env['http_proxy'] || process.env['HTTP_PROXY'];
}
})();
if (proxyVar) {
try {
return new URL(proxyVar);
}
catch (_a) {
if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://'))
return new URL(`http://${proxyVar}`);
}
}
else {
return undefined;
}
}
exports.getProxyUrl = getProxyUrl;
function checkBypass(reqUrl) {
if (!reqUrl.hostname) {
return false;
}
const reqHost = reqUrl.hostname;
if (isLoopbackAddress(reqHost)) {
return true;
}
const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
if (!noProxy) {
return false;
}
// Determine the request port
let reqPort;
if (reqUrl.port) {
reqPort = Number(reqUrl.port);
}
else if (reqUrl.protocol === 'http:') {
reqPort = 80;
}
else if (reqUrl.protocol === 'https:') {
reqPort = 443;
}
// Format the request hostname and hostname with port
const upperReqHosts = [reqUrl.hostname.toUpperCase()];
if (typeof reqPort === 'number') {
upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
}
// Compare request host against noproxy
for (const upperNoProxyItem of noProxy
.split(',')
.map(x => x.trim().toUpperCase())
.filter(x => x)) {
if (upperNoProxyItem === '*' ||
upperReqHosts.some(x => x === upperNoProxyItem ||
x.endsWith(`.${upperNoProxyItem}`) ||
(upperNoProxyItem.startsWith('.') &&
x.endsWith(`${upperNoProxyItem}`)))) {
return true;
}
}
return false;
}
exports.checkBypass = checkBypass;
function isLoopbackAddress(host) {
const hostLower = host.toLowerCase();
return (hostLower === 'localhost' ||
hostLower.startsWith('127.') ||
hostLower.startsWith('[::1]') ||
hostLower.startsWith('[0:0:0:0:0:0:0:1]'));
}
//# sourceMappingURL=proxy.js.map
/***/ }),
/***/ 4858:
/***/ ((module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _bmpJs = _interopRequireDefault(__nccwpck_require__(9030));
var _utils = __nccwpck_require__(7403);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const MIME_TYPE = "image/bmp";
const MIME_TYPE_SECOND = "image/x-ms-bmp";
function toAGBR(image) {
return (0, _utils.scan)(image, 0, 0, image.bitmap.width, image.bitmap.height, function (x, y, index) {
const red = this.bitmap.data[index + 0];
const green = this.bitmap.data[index + 1];
const blue = this.bitmap.data[index + 2];
const alpha = this.bitmap.data[index + 3];
this.bitmap.data[index + 0] = alpha;
this.bitmap.data[index + 1] = blue;
this.bitmap.data[index + 2] = green;
this.bitmap.data[index + 3] = red;
}).bitmap;
}
function fromAGBR(bitmap) {
return (0, _utils.scan)({
bitmap
}, 0, 0, bitmap.width, bitmap.height, function (x, y, index) {
const alpha = this.bitmap.data[index + 0];
const blue = this.bitmap.data[index + 1];
const green = this.bitmap.data[index + 2];
const red = this.bitmap.data[index + 3];
this.bitmap.data[index + 0] = red;
this.bitmap.data[index + 1] = green;
this.bitmap.data[index + 2] = blue;
this.bitmap.data[index + 3] = bitmap.is_with_alpha ? alpha : 0xff;
}).bitmap;
}
const decode = data => fromAGBR(_bmpJs.default.decode(data));
const encode = image => _bmpJs.default.encode(toAGBR(image)).data;
var _default = () => ({
mime: {
[MIME_TYPE]: ["bmp"]
},
constants: {
MIME_BMP: MIME_TYPE,
MIME_X_MS_BMP: MIME_TYPE_SECOND
},
decoders: {
[MIME_TYPE]: decode,
[MIME_TYPE_SECOND]: decode
},
encoders: {
[MIME_TYPE]: encode,
[MIME_TYPE_SECOND]: encode
}
});
exports["default"] = _default;
module.exports = exports.default;
module.exports["default"] = exports.default;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 8284:
/***/ ((__unused_webpack_module, exports) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.add = add;
exports.darken = darken;
exports.difference = difference;
exports.dstOver = dstOver;
exports.exclusion = exclusion;
exports.hardLight = hardLight;
exports.lighten = lighten;
exports.multiply = multiply;
exports.overlay = overlay;
exports.screen = screen;
exports.srcOver = srcOver;
function srcOver(src, dst) {
let ops = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
src.a *= ops;
const a = dst.a + src.a - dst.a * src.a;
const r = (src.r * src.a + dst.r * dst.a * (1 - src.a)) / a;
const g = (src.g * src.a + dst.g * dst.a * (1 - src.a)) / a;
const b = (src.b * src.a + dst.b * dst.a * (1 - src.a)) / a;
return {
r,
g,
b,
a
};
}
function dstOver(src, dst) {
let ops = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
src.a *= ops;
const a = dst.a + src.a - dst.a * src.a;
const r = (dst.r * dst.a + src.r * src.a * (1 - dst.a)) / a;
const g = (dst.g * dst.a + src.g * src.a * (1 - dst.a)) / a;
const b = (dst.b * dst.a + src.b * src.a * (1 - dst.a)) / a;
return {
r,
g,
b,
a
};
}
function multiply(src, dst) {
let ops = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
src.a *= ops;
const a = dst.a + src.a - dst.a * src.a;
const sra = src.r * src.a;
const sga = src.g * src.a;
const sba = src.b * src.a;
const dra = dst.r * dst.a;
const dga = dst.g * dst.a;
const dba = dst.b * dst.a;
const r = (sra * dra + sra * (1 - dst.a) + dra * (1 - src.a)) / a;
const g = (sga * dga + sga * (1 - dst.a) + dga * (1 - src.a)) / a;
const b = (sba * dba + sba * (1 - dst.a) + dba * (1 - src.a)) / a;
return {
r,
g,
b,
a
};
}
function add(src, dst) {
let ops = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
src.a *= ops;
const a = dst.a + src.a - dst.a * src.a;
const sra = src.r * src.a;
const sga = src.g * src.a;
const sba = src.b * src.a;
const dra = dst.r * dst.a;
const dga = dst.g * dst.a;
const dba = dst.b * dst.a;
const r = (sra + dra) / a;
const g = (sga + dga) / a;
const b = (sba + dba) / a;
return {
r,
g,
b,
a
};
}
function screen(src, dst) {
let ops = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
src.a *= ops;
const a = dst.a + src.a - dst.a * src.a;
const sra = src.r * src.a;
const sga = src.g * src.a;
const sba = src.b * src.a;
const dra = dst.r * dst.a;
const dga = dst.g * dst.a;
const dba = dst.b * dst.a;
const r = (sra * dst.a + dra * src.a - sra * dra + sra * (1 - dst.a) + dra * (1 - src.a)) / a;
const g = (sga * dst.a + dga * src.a - sga * dga + sga * (1 - dst.a) + dga * (1 - src.a)) / a;
const b = (sba * dst.a + dba * src.a - sba * dba + sba * (1 - dst.a) + dba * (1 - src.a)) / a;
return {
r,
g,
b,
a
};
}
function overlay(src, dst) {
let ops = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
src.a *= ops;
const a = dst.a + src.a - dst.a * src.a;
const sra = src.r * src.a;
const sga = src.g * src.a;
const sba = src.b * src.a;
const dra = dst.r * dst.a;
const dga = dst.g * dst.a;
const dba = dst.b * dst.a;
const r = (2 * dra <= dst.a ? 2 * sra * dra + sra * (1 - dst.a) + dra * (1 - src.a) : sra * (1 + dst.a) + dra * (1 + src.a) - 2 * dra * sra - dst.a * src.a) / a;
const g = (2 * dga <= dst.a ? 2 * sga * dga + sga * (1 - dst.a) + dga * (1 - src.a) : sga * (1 + dst.a) + dga * (1 + src.a) - 2 * dga * sga - dst.a * src.a) / a;
const b = (2 * dba <= dst.a ? 2 * sba * dba + sba * (1 - dst.a) + dba * (1 - src.a) : sba * (1 + dst.a) + dba * (1 + src.a) - 2 * dba * sba - dst.a * src.a) / a;
return {
r,
g,
b,
a
};
}
function darken(src, dst) {
let ops = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
src.a *= ops;
const a = dst.a + src.a - dst.a * src.a;
const sra = src.r * src.a;
const sga = src.g * src.a;
const sba = src.b * src.a;
const dra = dst.r * dst.a;
const dga = dst.g * dst.a;
const dba = dst.b * dst.a;
const r = (Math.min(sra * dst.a, dra * src.a) + sra * (1 - dst.a) + dra * (1 - src.a)) / a;
const g = (Math.min(sga * dst.a, dga * src.a) + sga * (1 - dst.a) + dga * (1 - src.a)) / a;
const b = (Math.min(sba * dst.a, dba * src.a) + sba * (1 - dst.a) + dba * (1 - src.a)) / a;
return {
r,
g,
b,
a
};
}
function lighten(src, dst) {
let ops = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
src.a *= ops;
const a = dst.a + src.a - dst.a * src.a;
const sra = src.r * src.a;
const sga = src.g * src.a;
const sba = src.b * src.a;
const dra = dst.r * dst.a;
const dga = dst.g * dst.a;
const dba = dst.b * dst.a;
const r = (Math.max(sra * dst.a, dra * src.a) + sra * (1 - dst.a) + dra * (1 - src.a)) / a;
const g = (Math.max(sga * dst.a, dga * src.a) + sga * (1 - dst.a) + dga * (1 - src.a)) / a;
const b = (Math.max(sba * dst.a, dba * src.a) + sba * (1 - dst.a) + dba * (1 - src.a)) / a;
return {
r,
g,
b,
a
};
}
function hardLight(src, dst) {
let ops = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
src.a *= ops;
const a = dst.a + src.a - dst.a * src.a;
const sra = src.r * src.a;
const sga = src.g * src.a;
const sba = src.b * src.a;
const dra = dst.r * dst.a;
const dga = dst.g * dst.a;
const dba = dst.b * dst.a;
const r = (2 * sra <= src.a ? 2 * sra * dra + sra * (1 - dst.a) + dra * (1 - src.a) : sra * (1 + dst.a) + dra * (1 + src.a) - 2 * dra * sra - dst.a * src.a) / a;
const g = (2 * sga <= src.a ? 2 * sga * dga + sga * (1 - dst.a) + dga * (1 - src.a) : sga * (1 + dst.a) + dga * (1 + src.a) - 2 * dga * sga - dst.a * src.a) / a;
const b = (2 * sba <= src.a ? 2 * sba * dba + sba * (1 - dst.a) + dba * (1 - src.a) : sba * (1 + dst.a) + dba * (1 + src.a) - 2 * dba * sba - dst.a * src.a) / a;
return {
r,
g,
b,
a
};
}
function difference(src, dst) {
let ops = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
src.a *= ops;
const a = dst.a + src.a - dst.a * src.a;
const sra = src.r * src.a;
const sga = src.g * src.a;
const sba = src.b * src.a;
const dra = dst.r * dst.a;
const dga = dst.g * dst.a;
const dba = dst.b * dst.a;
const r = (sra + dra - 2 * Math.min(sra * dst.a, dra * src.a)) / a;
const g = (sga + dga - 2 * Math.min(sga * dst.a, dga * src.a)) / a;
const b = (sba + dba - 2 * Math.min(sba * dst.a, dba * src.a)) / a;
return {
r,
g,
b,
a
};
}
function exclusion(src, dst) {
let ops = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
src.a *= ops;
const a = dst.a + src.a - dst.a * src.a;
const sra = src.r * src.a;
const sga = src.g * src.a;
const sba = src.b * src.a;
const dra = dst.r * dst.a;
const dga = dst.g * dst.a;
const dba = dst.b * dst.a;
const r = (sra * dst.a + dra * src.a - 2 * sra * dra + sra * (1 - dst.a) + dra * (1 - src.a)) / a;
const g = (sga * dst.a + dga * src.a - 2 * sga * dga + sga * (1 - dst.a) + dga * (1 - src.a)) / a;
const b = (sba * dst.a + dba * src.a - 2 * sba * dba + sba * (1 - dst.a) + dba * (1 - src.a)) / a;
return {
r,
g,
b,
a
};
}
//# sourceMappingURL=composite-modes.js.map
/***/ }),
/***/ 5141:
/***/ ((module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = composite;
var _utils = __nccwpck_require__(7403);
var constants = _interopRequireWildcard(__nccwpck_require__(4619));
var compositeModes = _interopRequireWildcard(__nccwpck_require__(8284));
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
/**
* Composites a source image over to this image respecting alpha channels
* @param {Jimp} src the source Jimp instance
* @param {number} x the x position to blit the image
* @param {number} y the y position to blit the image
* @param {object} options determine what mode to use
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
* @returns {Jimp} this for chaining of methods
*/
function composite(src, x, y) {
let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
let cb = arguments.length > 4 ? arguments[4] : undefined;
if (typeof options === "function") {
cb = options;
options = {};
}
if (!(src instanceof this.constructor)) {
return _utils.throwError.call(this, "The source must be a Jimp image", cb);
}
if (typeof x !== "number" || typeof y !== "number") {
return _utils.throwError.call(this, "x and y must be numbers", cb);
}
let {
mode,
opacitySource,
opacityDest
} = options;
if (!mode) {
mode = constants.BLEND_SOURCE_OVER;
}
if (typeof opacitySource !== "number" || opacitySource < 0 || opacitySource > 1) {
opacitySource = 1.0;
}
if (typeof opacityDest !== "number" || opacityDest < 0 || opacityDest > 1) {
opacityDest = 1.0;
}
// eslint-disable-next-line import/namespace
const blendmode = compositeModes[mode];
// round input
x = Math.round(x);
y = Math.round(y);
const baseImage = this;
if (opacityDest !== 1.0) {
baseImage.opacity(opacityDest);
}
src.scanQuiet(0, 0, src.bitmap.width, src.bitmap.height, function (sx, sy, idx) {
const dstIdx = baseImage.getPixelIndex(x + sx, y + sy, constants.EDGE_CROP);
if (dstIdx === -1) {
// Skip target pixels outside of dst
return;
}
const blended = blendmode({
r: this.bitmap.data[idx + 0] / 255,
g: this.bitmap.data[idx + 1] / 255,
b: this.bitmap.data[idx + 2] / 255,
a: this.bitmap.data[idx + 3] / 255
}, {
r: baseImage.bitmap.data[dstIdx + 0] / 255,
g: baseImage.bitmap.data[dstIdx + 1] / 255,
b: baseImage.bitmap.data[dstIdx + 2] / 255,
a: baseImage.bitmap.data[dstIdx + 3] / 255
}, opacitySource);
baseImage.bitmap.data[dstIdx + 0] = this.constructor.limit255(blended.r * 255);
baseImage.bitmap.data[dstIdx + 1] = this.constructor.limit255(blended.g * 255);
baseImage.bitmap.data[dstIdx + 2] = this.constructor.limit255(blended.b * 255);
baseImage.bitmap.data[dstIdx + 3] = this.constructor.limit255(blended.a * 255);
});
if ((0, _utils.isNodePattern)(cb)) {
cb.call(this, null, this);
}
return this;
}
module.exports = exports.default;
module.exports["default"] = exports.default;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 4619:
/***/ ((__unused_webpack_module, exports) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.VERTICAL_ALIGN_TOP = exports.VERTICAL_ALIGN_MIDDLE = exports.VERTICAL_ALIGN_BOTTOM = exports.HORIZONTAL_ALIGN_RIGHT = exports.HORIZONTAL_ALIGN_LEFT = exports.HORIZONTAL_ALIGN_CENTER = exports.EDGE_WRAP = exports.EDGE_EXTEND = exports.EDGE_CROP = exports.BLEND_SOURCE_OVER = exports.BLEND_SCREEN = exports.BLEND_OVERLAY = exports.BLEND_MULTIPLY = exports.BLEND_LIGHTEN = exports.BLEND_HARDLIGHT = exports.BLEND_EXCLUSION = exports.BLEND_DIFFERENCE = exports.BLEND_DESTINATION_OVER = exports.BLEND_DARKEN = exports.BLEND_ADD = exports.AUTO = void 0;
// used to auto resizing etc.
const AUTO = -1;
// Align modes for cover, contain, bit masks
exports.AUTO = AUTO;
const HORIZONTAL_ALIGN_LEFT = 1;
exports.HORIZONTAL_ALIGN_LEFT = HORIZONTAL_ALIGN_LEFT;
const HORIZONTAL_ALIGN_CENTER = 2;
exports.HORIZONTAL_ALIGN_CENTER = HORIZONTAL_ALIGN_CENTER;
const HORIZONTAL_ALIGN_RIGHT = 4;
exports.HORIZONTAL_ALIGN_RIGHT = HORIZONTAL_ALIGN_RIGHT;
const VERTICAL_ALIGN_TOP = 8;
exports.VERTICAL_ALIGN_TOP = VERTICAL_ALIGN_TOP;
const VERTICAL_ALIGN_MIDDLE = 16;
exports.VERTICAL_ALIGN_MIDDLE = VERTICAL_ALIGN_MIDDLE;
const VERTICAL_ALIGN_BOTTOM = 32;
// blend modes
exports.VERTICAL_ALIGN_BOTTOM = VERTICAL_ALIGN_BOTTOM;
const BLEND_SOURCE_OVER = "srcOver";
exports.BLEND_SOURCE_OVER = BLEND_SOURCE_OVER;
const BLEND_DESTINATION_OVER = "dstOver";
exports.BLEND_DESTINATION_OVER = BLEND_DESTINATION_OVER;
const BLEND_MULTIPLY = "multiply";
exports.BLEND_MULTIPLY = BLEND_MULTIPLY;
const BLEND_ADD = "add";
exports.BLEND_ADD = BLEND_ADD;
const BLEND_SCREEN = "screen";
exports.BLEND_SCREEN = BLEND_SCREEN;
const BLEND_OVERLAY = "overlay";
exports.BLEND_OVERLAY = BLEND_OVERLAY;
const BLEND_DARKEN = "darken";
exports.BLEND_DARKEN = BLEND_DARKEN;
const BLEND_LIGHTEN = "lighten";
exports.BLEND_LIGHTEN = BLEND_LIGHTEN;
const BLEND_HARDLIGHT = "hardLight";
exports.BLEND_HARDLIGHT = BLEND_HARDLIGHT;
const BLEND_DIFFERENCE = "difference";
exports.BLEND_DIFFERENCE = BLEND_DIFFERENCE;
const BLEND_EXCLUSION = "exclusion";
// Edge Handling
exports.BLEND_EXCLUSION = BLEND_EXCLUSION;
const EDGE_EXTEND = 1;
exports.EDGE_EXTEND = EDGE_EXTEND;
const EDGE_WRAP = 2;
exports.EDGE_WRAP = EDGE_WRAP;
const EDGE_CROP = 3;
exports.EDGE_CROP = EDGE_CROP;
//# sourceMappingURL=constants.js.map
/***/ }),
/***/ 678:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.addConstants = addConstants;
exports.addJimpMethods = addJimpMethods;
Object.defineProperty(exports, "addType", ({
enumerable: true,
get: function () {
return MIME.addType;
}
}));
exports["default"] = void 0;
exports.jimpEvChange = jimpEvChange;
exports.jimpEvMethod = jimpEvMethod;
var _fs = _interopRequireDefault(__nccwpck_require__(7147));
var _path = _interopRequireDefault(__nccwpck_require__(1017));
var _events = _interopRequireDefault(__nccwpck_require__(2361));
var _utils = __nccwpck_require__(7403);
var _anyBase = _interopRequireDefault(__nccwpck_require__(8720));
var _pixelmatch = _interopRequireDefault(__nccwpck_require__(6097));
var _tinycolor = _interopRequireDefault(__nccwpck_require__(7476));
var _phash = _interopRequireDefault(__nccwpck_require__(7025));
var _request = _interopRequireDefault(__nccwpck_require__(4310));
var _composite = _interopRequireDefault(__nccwpck_require__(5141));
var _promisify = _interopRequireDefault(__nccwpck_require__(6826));
var MIME = _interopRequireWildcard(__nccwpck_require__(3153));
var _imageBitmap = __nccwpck_require__(3946);
var constants = _interopRequireWildcard(__nccwpck_require__(4619));
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
const alphabet = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_";
// an array storing the maximum string length of hashes at various bases
// 0 and 1 do not exist as possible hash lengths
const maxHashLength = [NaN, NaN];
for (let i = 2; i < 65; i++) {
const maxHash = (0, _anyBase.default)(_anyBase.default.BIN, alphabet.slice(0, i))(new Array(64 + 1).join("1"));
maxHashLength.push(maxHash.length);
}
// no operation
function noop() {}
// error checking methods
function isArrayBuffer(test) {
return Object.prototype.toString.call(test).toLowerCase().indexOf("arraybuffer") > -1;
}
// Prepare a Buffer object from the arrayBuffer. Necessary in the browser > node conversion,
// But this function is not useful when running in node directly
function bufferFromArrayBuffer(arrayBuffer) {
const buffer = Buffer.alloc(arrayBuffer.byteLength);
const view = new Uint8Array(arrayBuffer);
for (let i = 0; i < buffer.length; ++i) {
buffer[i] = view[i];
}
return buffer;
}
function loadFromURL(options, cb) {
(0, _request.default)(options, (err, data) => {
if (err) {
return cb(err);
}
if (typeof data === "object" && Buffer.isBuffer(data)) {
return cb(null, data);
}
if (typeof data === "object" && isArrayBuffer(data)) {
return cb(null, bufferFromArrayBuffer(data));
}
return new Error(`Could not load Buffer from <${options.url}>`);
});
}
function loadBufferFromPath(src, cb) {
if (_fs.default && typeof _fs.default.readFile === "function" && !src.match(/^(http|ftp)s?:\/\/./)) {
_fs.default.readFile(src, cb);
} else {
loadFromURL({
url: src
}, cb);
}
}
function isRawRGBAData(obj) {
return obj && typeof obj === "object" && typeof obj.width === "number" && typeof obj.height === "number" && (Buffer.isBuffer(obj.data) || obj.data instanceof Uint8Array || typeof Uint8ClampedArray === "function" && obj.data instanceof Uint8ClampedArray) && (obj.data.length === obj.width * obj.height * 4 || obj.data.length === obj.width * obj.height * 3);
}
function makeRGBABufferFromRGB(buffer) {
if (buffer.length % 3 !== 0) {
throw new Error("Buffer length is incorrect");
}
const rgbaBuffer = Buffer.allocUnsafe(buffer.length / 3 * 4);
let j = 0;
for (let i = 0; i < buffer.length; i++) {
rgbaBuffer[j] = buffer[i];
if ((i + 1) % 3 === 0) {
rgbaBuffer[++j] = 255;
}
j++;
}
return rgbaBuffer;
}
const emptyBitmap = {
data: null,
width: null,
height: null
};
/**
* Jimp constructor (from a file)
* @param path a path to the image
* @param {function(Error, Jimp)} cb (optional) a function to call when the image is parsed to a bitmap
*/
/**
* Jimp constructor (from a url with options)
* @param options { url, otherOptions}
* @param {function(Error, Jimp)} cb (optional) a function to call when the image is parsed to a bitmap
*/
/**
* Jimp constructor (from another Jimp image or raw image data)
* @param image a Jimp image to clone
* @param {function(Error, Jimp)} cb a function to call when the image is parsed to a bitmap
*/
/**
* Jimp constructor (from a Buffer)
* @param data a Buffer containing the image data
* @param {function(Error, Jimp)} cb a function to call when the image is parsed to a bitmap
*/
/**
* Jimp constructor (to generate a new image)
* @param w the width of the image
* @param h the height of the image
* @param {function(Error, Jimp)} cb (optional) a function to call when the image is parsed to a bitmap
*/
/**
* Jimp constructor (to generate a new image)
* @param w the width of the image
* @param h the height of the image
* @param background color to fill the image with
* @param {function(Error, Jimp)} cb (optional) a function to call when the image is parsed to a bitmap
*/
class Jimp extends _events.default {
// An object representing a bitmap in memory, comprising:
// - data: a buffer of the bitmap data
// - width: the width of the image in pixels
// - height: the height of the image in pixels
// Default colour to use for new pixels
// Default MIME is PNG
// Exif data for the image
// Whether Transparency supporting formats will be exported as RGB or RGBA
constructor() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
super();
_defineProperty(this, "bitmap", emptyBitmap);
_defineProperty(this, "_background", 0x00000000);
_defineProperty(this, "_originalMime", Jimp.MIME_PNG);
_defineProperty(this, "_exif", null);
_defineProperty(this, "_rgba", true);
_defineProperty(this, "writeAsync", path => (0, _promisify.default)(this.write, this, path));
_defineProperty(this, "getBase64Async", mime => (0, _promisify.default)(this.getBase64, this, mime));
_defineProperty(this, "getBuffer", _imageBitmap.getBuffer);
_defineProperty(this, "getBufferAsync", _imageBitmap.getBufferAsync);
_defineProperty(this, "getPixelColour", this.getPixelColor);
_defineProperty(this, "setPixelColour", this.setPixelColor);
const jimpInstance = this;
let cb = noop;
if (isArrayBuffer(args[0])) {
args[0] = bufferFromArrayBuffer(args[0]);
}
function finish() {
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
const [err] = args;
const evData = err || {};
evData.methodName = "constructor";
setTimeout(() => {
// run on next tick.
if (err && cb === noop) {
jimpInstance.emitError("constructor", err);
} else if (!err) {
jimpInstance.emitMulti("constructor", "initialized");
}
cb.call(jimpInstance, ...args);
}, 1);
}
if (typeof args[0] === "number" && typeof args[1] === "number" || parseInt(args[0], 10) && parseInt(args[1], 10)) {
// create a new image
const w = parseInt(args[0], 10);
const h = parseInt(args[1], 10);
cb = args[2];
// with a hex color
if (typeof args[2] === "number") {
this._background = args[2];
cb = args[3];
}
// with a css color
if (typeof args[2] === "string") {
this._background = Jimp.cssColorToHex(args[2]);
cb = args[3];
}
if (typeof cb === "undefined") {
cb = noop;
}
if (typeof cb !== "function") {
return _utils.throwError.call(this, "cb must be a function", finish);
}
this.bitmap = {
data: Buffer.alloc(w * h * 4),
width: w,
height: h
};
for (let i = 0; i < this.bitmap.data.length; i += 4) {
this.bitmap.data.writeUInt32BE(this._background, i);
}
finish(null, this);
} else if (typeof args[0] === "object" && args[0].url) {
cb = args[1] || noop;
if (typeof cb !== "function") {
return _utils.throwError.call(this, "cb must be a function", finish);
}
loadFromURL(args[0], (err, data) => {
if (err) {
return _utils.throwError.call(this, err, finish);
}
this.parseBitmap(data, args[0].url, finish);
});
} else if (args[0] instanceof Jimp) {
// clone an existing Jimp
const [original] = args;
cb = args[1];
if (typeof cb === "undefined") {
cb = noop;
}
if (typeof cb !== "function") {
return _utils.throwError.call(this, "cb must be a function", finish);
}
this.bitmap = {
data: Buffer.from(original.bitmap.data),
width: original.bitmap.width,
height: original.bitmap.height
};
this._quality = original._quality;
this._deflateLevel = original._deflateLevel;
this._deflateStrategy = original._deflateStrategy;
this._filterType = original._filterType;
this._rgba = original._rgba;
this._background = original._background;
this._originalMime = original._originalMime;
finish(null, this);
} else if (isRawRGBAData(args[0])) {
const [imageData] = args;
cb = args[1] || noop;
const isRGBA = imageData.width * imageData.height * 4 === imageData.data.length;
const buffer = isRGBA ? Buffer.from(imageData.data) : makeRGBABufferFromRGB(imageData.data);
this.bitmap = {
data: buffer,
width: imageData.width,
height: imageData.height
};
finish(null, this);
} else if (typeof args[0] === "string") {
// read from a path
const path = args[0];
cb = args[1];
if (typeof cb === "undefined") {
cb = noop;
}
if (typeof cb !== "function") {
return _utils.throwError.call(this, "cb must be a function", finish);
}
loadBufferFromPath(path, (err, data) => {
if (err) {
return _utils.throwError.call(this, err, finish);
}
this.parseBitmap(data, path, finish);
});
} else if (typeof args[0] === "object" && Buffer.isBuffer(args[0])) {
// read from a buffer
const data = args[0];
cb = args[1];
if (typeof cb !== "function") {
return _utils.throwError.call(this, "cb must be a function", finish);
}
this.parseBitmap(data, null, finish);
} else {
// Allow client libs to add new ways to build a Jimp object.
// Extra constructors must be added by `Jimp.appendConstructorOption()`
cb = args[args.length - 1];
if (typeof cb !== "function") {
// TODO: try to solve the args after cb problem.
cb = args[args.length - 2];
if (typeof cb !== "function") {
cb = noop;
}
}
const extraConstructor = Jimp.__extraConstructors.find(c => c.test(...args));
if (extraConstructor) {
new Promise((resolve, reject) => {
extraConstructor.run.call(this, resolve, reject, ...args);
}).then(() => finish(null, this)).catch(finish);
} else {
return _utils.throwError.call(this, "No matching constructor overloading was found. " + "Please see the docs for how to call the Jimp constructor.", finish);
}
}
}
/**
* Parse a bitmap with the loaded image types.
*
* @param {Buffer} data raw image data
* @param {string} path optional path to file
* @param {function(Error, Jimp)} finish (optional) a callback for when complete
* @memberof Jimp
*/
parseBitmap(data, path, finish) {
_imageBitmap.parseBitmap.call(this, data, null, finish);
}
/**
* Sets the type of the image (RGB or RGBA) when saving in a format that supports transparency (default is RGBA)
* @param {boolean} bool A Boolean, true to use RGBA or false to use RGB
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
* @returns {Jimp} this for chaining of methods
*/
rgba(bool, cb) {
if (typeof bool !== "boolean") {
return _utils.throwError.call(this, "bool must be a boolean, true for RGBA or false for RGB", cb);
}
this._rgba = bool;
if ((0, _utils.isNodePattern)(cb)) {
cb.call(this, null, this);
}
return this;
}
/**
* Emit for multiple listeners
* @param {string} methodName name of the method to emit an error for
* @param {string} eventName name of the eventName to emit an error for
* @param {object} data to emit
*/
emitMulti(methodName, eventName) {
let data = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
data = Object.assign(data, {
methodName,
eventName
});
this.emit("any", data);
if (methodName) {
this.emit(methodName, data);
}
this.emit(eventName, data);
}
emitError(methodName, err) {
this.emitMulti(methodName, "error", err);
}
/**
* Get the current height of the image
* @return {number} height of the image
*/
getHeight() {
return this.bitmap.height;
}
/**
* Get the current width of the image
* @return {number} width of the image
*/
getWidth() {
return this.bitmap.width;
}
/**
* Nicely format Jimp object when sent to the console e.g. console.log(image)
* @returns {string} pretty printed
*/
inspect() {
return "<Jimp " + (this.bitmap === emptyBitmap ? "pending..." : this.bitmap.width + "x" + this.bitmap.height) + ">";
}
/**
* Nicely format Jimp object when converted to a string
* @returns {string} pretty printed
*/
toString() {
return "[object Jimp]";
}
/**
* Returns the original MIME of the image (default: "image/png")
* @returns {string} the MIME
*/
getMIME() {
const mime = this._originalMime || Jimp.MIME_PNG;
return mime;
}
/**
* Returns the appropriate file extension for the original MIME of the image (default: "png")
* @returns {string} the file extension
*/
getExtension() {
const mime = this.getMIME();
return MIME.getExtension(mime);
}
/**
* Writes the image to a file
* @param {string} path a path to the destination file
* @param {function(Error, Jimp)} cb (optional) a function to call when the image is saved to disk
* @returns {Jimp} this for chaining of methods
*/
write(path, cb) {
if (!_fs.default || !_fs.default.createWriteStream) {
throw new Error("Cant access the filesystem. You can use the getBase64 method.");
}
if (typeof path !== "string") {
return _utils.throwError.call(this, "path must be a string", cb);
}
if (typeof cb === "undefined") {
cb = noop;
}
if (typeof cb !== "function") {
return _utils.throwError.call(this, "cb must be a function", cb);
}
const mime = MIME.getType(path) || this.getMIME();
const pathObj = _path.default.parse(path);
if (pathObj.dir) {
_fs.default.mkdirSync(pathObj.dir, {
recursive: true
});
}
this.getBuffer(mime, (err, buffer) => {
if (err) {
return _utils.throwError.call(this, err, cb);
}
const stream = _fs.default.createWriteStream(path);
stream.on("open", () => {
stream.write(buffer);
stream.end();
}).on("error", err => {
return _utils.throwError.call(this, err, cb);
});
stream.on("finish", () => {
cb.call(this, null, this);
});
});
return this;
}
/**
* Converts the image to a base 64 string
* @param {string} mime the mime type of the image data to be created
* @param {function(Error, Jimp)} cb a Node-style function to call with the buffer as the second argument
* @returns {Jimp} this for chaining of methods
*/
getBase64(mime, cb) {
if (mime === Jimp.AUTO) {
// allow auto MIME detection
mime = this.getMIME();
}
if (typeof mime !== "string") {
return _utils.throwError.call(this, "mime must be a string", cb);
}
if (typeof cb !== "function") {
return _utils.throwError.call(this, "cb must be a function", cb);
}
this.getBuffer(mime, function (err, data) {
if (err) {
return _utils.throwError.call(this, err, cb);
}
const src = "data:" + mime + ";base64," + data.toString("base64");
cb.call(this, null, src);
});
return this;
}
/**
* Generates a perceptual hash of the image <https://en.wikipedia.org/wiki/Perceptual_hashing>. And pads the string. Can configure base.
* @param {number} base (optional) a number between 2 and 64 representing the base for the hash (e.g. 2 is binary, 10 is decimal, 16 is hex, 64 is base 64). Defaults to 64.
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
* @returns {string} a string representing the hash
*/
hash(base, cb) {
base = base || 64;
if (typeof base === "function") {
cb = base;
base = 64;
}
if (typeof base !== "number") {
return _utils.throwError.call(this, "base must be a number", cb);
}
if (base < 2 || base > 64) {
return _utils.throwError.call(this, "base must be a number between 2 and 64", cb);
}
let hash = this.pHash();
hash = (0, _anyBase.default)(_anyBase.default.BIN, alphabet.slice(0, base))(hash);
while (hash.length < maxHashLength[base]) {
hash = "0" + hash; // pad out with leading zeros
}
if ((0, _utils.isNodePattern)(cb)) {
cb.call(this, null, hash);
}
return hash;
}
/**
* Calculates the perceptual hash
* @returns {number} the perceptual hash
*/
pHash() {
const pHash = new _phash.default();
return pHash.getHash(this);
}
/**
* Calculates the hamming distance of the current image and a hash based on their perceptual hash
* @param {hash} compareHash hash to compare to
* @returns {number} a number ranging from 0 to 1, 0 means they are believed to be identical
*/
distanceFromHash(compareHash) {
const pHash = new _phash.default();
const currentHash = pHash.getHash(this);
return pHash.distance(currentHash, compareHash);
}
/**
* Converts the image to a buffer
* @param {string} mime the mime type of the image buffer to be created
* @param {function(Error, Jimp)} cb a Node-style function to call with the buffer as the second argument
* @returns {Jimp} this for chaining of methods
*/
/**
* Returns the offset of a pixel in the bitmap buffer
* @param {number} x the x coordinate
* @param {number} y the y coordinate
* @param {number} edgeHandling (optional) define how to sum pixels from outside the border
* @param {number} cb (optional) a callback for when complete
* @returns {number} the index of the pixel or -1 if not found
*/
getPixelIndex(x, y, edgeHandling, cb) {
let xi;
let yi;
if (typeof edgeHandling === "function" && typeof cb === "undefined") {
cb = edgeHandling;
edgeHandling = null;
}
if (!edgeHandling) {
edgeHandling = Jimp.EDGE_EXTEND;
}
if (typeof x !== "number" || typeof y !== "number") {
return _utils.throwError.call(this, "x and y must be numbers", cb);
}
// round input
x = Math.round(x);
y = Math.round(y);
xi = x;
yi = y;
if (edgeHandling === Jimp.EDGE_EXTEND) {
if (x < 0) xi = 0;
if (x >= this.bitmap.width) xi = this.bitmap.width - 1;
if (y < 0) yi = 0;
if (y >= this.bitmap.height) yi = this.bitmap.height - 1;
}
if (edgeHandling === Jimp.EDGE_WRAP) {
if (x < 0) {
xi = this.bitmap.width + x;
}
if (x >= this.bitmap.width) {
xi = x % this.bitmap.width;
}
if (y < 0) {
yi = this.bitmap.height + y;
}
if (y >= this.bitmap.height) {
yi = y % this.bitmap.height;
}
}
let i = this.bitmap.width * yi + xi << 2;
// if out of bounds index is -1
if (xi < 0 || xi >= this.bitmap.width) {
i = -1;
}
if (yi < 0 || yi >= this.bitmap.height) {
i = -1;
}
if ((0, _utils.isNodePattern)(cb)) {
cb.call(this, null, i);
}
return i;
}
/**
* Returns the hex colour value of a pixel
* @param {number} x the x coordinate
* @param {number} y the y coordinate
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
* @returns {number} the color of the pixel
*/
getPixelColor(x, y, cb) {
if (typeof x !== "number" || typeof y !== "number") return _utils.throwError.call(this, "x and y must be numbers", cb);
// round input
x = Math.round(x);
y = Math.round(y);
const idx = this.getPixelIndex(x, y);
const hex = this.bitmap.data.readUInt32BE(idx);
if ((0, _utils.isNodePattern)(cb)) {
cb.call(this, null, hex);
}
return hex;
}
/**
* Returns the hex colour value of a pixel
* @param {number} hex color to set
* @param {number} x the x coordinate
* @param {number} y the y coordinate
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
* @returns {number} the index of the pixel or -1 if not found
*/
setPixelColor(hex, x, y, cb) {
if (typeof hex !== "number" || typeof x !== "number" || typeof y !== "number") return _utils.throwError.call(this, "hex, x and y must be numbers", cb);
// round input
x = Math.round(x);
y = Math.round(y);
const idx = this.getPixelIndex(x, y);
this.bitmap.data.writeUInt32BE(hex, idx);
if ((0, _utils.isNodePattern)(cb)) {
cb.call(this, null, this);
}
return this;
}
/**
* Determine if the image contains opaque pixels.
* @return {boolean} hasAlpha whether the image contains opaque pixels
*/
hasAlpha() {
for (let yIndex = 0; yIndex < this.bitmap.height; yIndex++) {
for (let xIndex = 0; xIndex < this.bitmap.width; xIndex++) {
const idx = this.bitmap.width * yIndex + xIndex << 2;
const alpha = this.bitmap.data[idx + 3];
if (alpha !== 0xff) {
return true;
}
}
}
return false;
}
/**
* Iterate scan through a region of the bitmap
* @param {number} x the x coordinate to begin the scan at
* @param {number} y the y coordinate to begin the scan at
* @param w the width of the scan region
* @param h the height of the scan region
* @returns {IterableIterator<{x: number, y: number, idx: number, image: Jimp}>}
*/
scanIterator(x, y, w, h) {
if (typeof x !== "number" || typeof y !== "number") {
return _utils.throwError.call(this, "x and y must be numbers");
}
if (typeof w !== "number" || typeof h !== "number") {
return _utils.throwError.call(this, "w and h must be numbers");
}
return (0, _utils.scanIterator)(this, x, y, w, h);
}
}
function addConstants(constants) {
let jimpInstance = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Jimp;
Object.entries(constants).forEach(_ref => {
let [name, value] = _ref;
jimpInstance[name] = value;
});
}
function addJimpMethods(methods) {
let jimpInstance = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Jimp;
Object.entries(methods).forEach(_ref2 => {
let [name, value] = _ref2;
jimpInstance.prototype[name] = value;
});
}
addConstants(constants);
addJimpMethods({
composite: _composite.default
});
Jimp.__extraConstructors = [];
/**
* Allow client libs to add new ways to build a Jimp object.
* @param {string} name identify the extra constructor.
* @param {function} test a function that returns true when it accepts the arguments passed to the main constructor.
* @param {function} run where the magic happens.
*/
Jimp.appendConstructorOption = function (name, test, run) {
Jimp.__extraConstructors.push({
name,
test,
run
});
};
/**
* Read an image from a file or a Buffer. Takes the same args as the constructor
* @returns {Promise} a promise
*/
Jimp.read = function () {
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
args[_key3] = arguments[_key3];
}
return new Promise((resolve, reject) => {
// eslint-disable-next-line no-new
new Jimp(...args, (err, image) => {
if (err) reject(err);else resolve(image);
});
});
};
Jimp.create = Jimp.read;
/**
* A static helper method that converts RGBA values to a single integer value
* @param {number} r the red value (0-255)
* @param {number} g the green value (0-255)
* @param {number} b the blue value (0-255)
* @param {number} a the alpha value (0-255)
* @param {function(Error, Jimp)} cb (optional) A callback for when complete
* @returns {number} an single integer colour value
*/
Jimp.rgbaToInt = function (r, g, b, a, cb) {
if (typeof r !== "number" || typeof g !== "number" || typeof b !== "number" || typeof a !== "number") {
return _utils.throwError.call(this, "r, g, b and a must be numbers", cb);
}
if (r < 0 || r > 255) {
return _utils.throwError.call(this, "r must be between 0 and 255", cb);
}
if (g < 0 || g > 255) {
_utils.throwError.call(this, "g must be between 0 and 255", cb);
}
if (b < 0 || b > 255) {
return _utils.throwError.call(this, "b must be between 0 and 255", cb);
}
if (a < 0 || a > 255) {
return _utils.throwError.call(this, "a must be between 0 and 255", cb);
}
r = Math.round(r);
b = Math.round(b);
g = Math.round(g);
a = Math.round(a);
const i = r * Math.pow(256, 3) + g * Math.pow(256, 2) + b * Math.pow(256, 1) + a * Math.pow(256, 0);
if ((0, _utils.isNodePattern)(cb)) {
cb.call(this, null, i);
}
return i;
};
/**
* A static helper method that converts RGBA values to a single integer value
* @param {number} i a single integer value representing an RGBA colour (e.g. 0xFF0000FF for red)
* @param {function(Error, Jimp)} cb (optional) A callback for when complete
* @returns {object} an object with the properties r, g, b and a representing RGBA values
*/
Jimp.intToRGBA = function (i, cb) {
if (typeof i !== "number") {
return _utils.throwError.call(this, "i must be a number", cb);
}
const rgba = {};
rgba.r = Math.floor(i / Math.pow(256, 3));
rgba.g = Math.floor((i - rgba.r * Math.pow(256, 3)) / Math.pow(256, 2));
rgba.b = Math.floor((i - rgba.r * Math.pow(256, 3) - rgba.g * Math.pow(256, 2)) / Math.pow(256, 1));
rgba.a = Math.floor((i - rgba.r * Math.pow(256, 3) - rgba.g * Math.pow(256, 2) - rgba.b * Math.pow(256, 1)) / Math.pow(256, 0));
if ((0, _utils.isNodePattern)(cb)) {
cb.call(this, null, rgba);
}
return rgba;
};
/**
* Converts a css color (Hex, 8-digit (RGBA) Hex, RGB, RGBA, HSL, HSLA, HSV, HSVA, Named) to a hex number
* @param {string} cssColor a number
* @returns {number} a hex number representing a color
*/
Jimp.cssColorToHex = function (cssColor) {
cssColor = cssColor || 0; // 0, null, undefined, NaN
if (typeof cssColor === "number") return Number(cssColor);
return parseInt((0, _tinycolor.default)(cssColor).toHex8(), 16);
};
/**
* Limits a number to between 0 or 255
* @param {number} n a number
* @returns {number} the number limited to between 0 or 255
*/
Jimp.limit255 = function (n) {
n = Math.max(n, 0);
n = Math.min(n, 255);
return n;
};
/**
* Diffs two images and returns
* @param {Jimp} img1 a Jimp image to compare
* @param {Jimp} img2 a Jimp image to compare
* @param {number} threshold (optional) a number, 0 to 1, the smaller the value the more sensitive the comparison (default: 0.1)
* @returns {object} an object { percent: percent similar, diff: a Jimp image highlighting differences }
*/
Jimp.diff = function (img1, img2) {
let threshold = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0.1;
if (!(img1 instanceof Jimp) || !(img2 instanceof Jimp)) return _utils.throwError.call(this, "img1 and img2 must be an Jimp images");
const bmp1 = img1.bitmap;
const bmp2 = img2.bitmap;
if (bmp1.width !== bmp2.width || bmp1.height !== bmp2.height) {
if (bmp1.width * bmp1.height > bmp2.width * bmp2.height) {
// img1 is bigger
img1 = img1.cloneQuiet().resize(bmp2.width, bmp2.height);
} else {
// img2 is bigger (or they are the same in area)
img2 = img2.cloneQuiet().resize(bmp1.width, bmp1.height);
}
}
if (typeof threshold !== "number" || threshold < 0 || threshold > 1) {
return _utils.throwError.call(this, "threshold must be a number between 0 and 1");
}
const diff = new Jimp(bmp1.width, bmp1.height, 0xffffffff);
const numDiffPixels = (0, _pixelmatch.default)(bmp1.data, bmp2.data, diff.bitmap.data, diff.bitmap.width, diff.bitmap.height, {
threshold
});
return {
percent: numDiffPixels / (diff.bitmap.width * diff.bitmap.height),
image: diff
};
};
/**
* Calculates the hamming distance of two images based on their perceptual hash
* @param {Jimp} img1 a Jimp image to compare
* @param {Jimp} img2 a Jimp image to compare
* @returns {number} a number ranging from 0 to 1, 0 means they are believed to be identical
*/
Jimp.distance = function (img1, img2) {
const phash = new _phash.default();
const hash1 = phash.getHash(img1);
const hash2 = phash.getHash(img2);
return phash.distance(hash1, hash2);
};
/**
* Calculates the hamming distance of two images based on their perceptual hash
* @param {hash} hash1 a pHash
* @param {hash} hash2 a pHash
* @returns {number} a number ranging from 0 to 1, 0 means they are believed to be identical
*/
Jimp.compareHashes = function (hash1, hash2) {
const phash = new _phash.default();
return phash.distance(hash1, hash2);
};
/**
* Compute color difference
* 0 means no difference, 1 means maximum difference.
* @param {number} rgba1: first color to compare.
* @param {number} rgba2: second color to compare.
* Both parameters must be an color object {r:val, g:val, b:val, a:val}
* Where `a` is optional and `val` is an integer between 0 and 255.
* @returns {number} float between 0 and 1.
*/
Jimp.colorDiff = function (rgba1, rgba2) {
const pow = n => Math.pow(n, 2);
const {
max
} = Math;
const maxVal = 255 * 255 * 3;
if (rgba1.a !== 0 && !rgba1.a) {
rgba1.a = 255;
}
if (rgba2.a !== 0 && !rgba2.a) {
rgba2.a = 255;
}
return (max(pow(rgba1.r - rgba2.r), pow(rgba1.r - rgba2.r - rgba1.a + rgba2.a)) + max(pow(rgba1.g - rgba2.g), pow(rgba1.g - rgba2.g - rgba1.a + rgba2.a)) + max(pow(rgba1.b - rgba2.b), pow(rgba1.b - rgba2.b - rgba1.a + rgba2.a))) / maxVal;
};
/**
* Helper to create Jimp methods that emit events before and after its execution.
* @param {string} methodName The name to be appended to Jimp prototype.
* @param {string} evName The event name to be called.
* It will be prefixed by `before-` and emitted when on method call.
* It will be appended by `ed` and emitted after the method run.
* @param {function} method A function implementing the method itself.
* It will also create a quiet version that will not emit events, to not
* mess the user code with many `changed` event calls. You can call with
* `methodName + "Quiet"`.
*
* The emitted event comes with a object parameter to the listener with the
* `methodName` as one attribute.
*/
function jimpEvMethod(methodName, evName, method) {
const evNameBefore = "before-" + evName;
const evNameAfter = evName.replace(/e$/, "") + "ed";
Jimp.prototype[methodName] = function () {
let wrappedCb;
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
args[_key4] = arguments[_key4];
}
const cb = args[method.length - 1];
const jimpInstance = this;
if (typeof cb === "function") {
wrappedCb = function () {
for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
args[_key5] = arguments[_key5];
}
const [err, data] = args;
if (err) {
jimpInstance.emitError(methodName, err);
} else {
jimpInstance.emitMulti(methodName, evNameAfter, {
[methodName]: data
});
}
cb.apply(this, args);
};
args[args.length - 1] = wrappedCb;
} else {
wrappedCb = false;
}
this.emitMulti(methodName, evNameBefore);
let result;
try {
result = method.apply(this, args);
if (!wrappedCb) {
this.emitMulti(methodName, evNameAfter, {
[methodName]: result
});
}
} catch (error) {
error.methodName = methodName;
this.emitError(methodName, error);
}
return result;
};
Jimp.prototype[methodName + "Quiet"] = method;
}
/**
* Creates a new image that is a clone of this one.
* @param {function(Error, Jimp)} cb (optional) A callback for when complete
* @returns the new image
*/
jimpEvMethod("clone", "clone", function (cb) {
const clone = new Jimp(this);
if ((0, _utils.isNodePattern)(cb)) {
cb.call(clone, null, clone);
}
return clone;
});
/**
* Simplify jimpEvMethod call for the common `change` evName.
* @param {string} methodName name of the method
* @param {function} method to watch changes for
*/
function jimpEvChange(methodName, method) {
jimpEvMethod(methodName, "change", method);
}
/**
* Sets the type of the image (RGB or RGBA) when saving as PNG format (default is RGBA)
* @param b A Boolean, true to use RGBA or false to use RGB
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
* @returns {Jimp} this for chaining of methods
*/
jimpEvChange("background", function (hex, cb) {
if (typeof hex !== "number") {
return _utils.throwError.call(this, "hex must be a hexadecimal rgba value", cb);
}
this._background = hex;
if ((0, _utils.isNodePattern)(cb)) {
cb.call(this, null, this);
}
return this;
});
/**
* Scans through a region of the bitmap, calling a function for each pixel.
* @param {number} x the x coordinate to begin the scan at
* @param {number} y the y coordinate to begin the scan at
* @param w the width of the scan region
* @param h the height of the scan region
* @param f a function to call on even pixel; the (x, y) position of the pixel
* and the index of the pixel in the bitmap buffer are passed to the function
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
* @returns {Jimp} this for chaining of methods
*/
jimpEvChange("scan", function (x, y, w, h, f, cb) {
if (typeof x !== "number" || typeof y !== "number") {
return _utils.throwError.call(this, "x and y must be numbers", cb);
}
if (typeof w !== "number" || typeof h !== "number") {
return _utils.throwError.call(this, "w and h must be numbers", cb);
}
if (typeof f !== "function") {
return _utils.throwError.call(this, "f must be a function", cb);
}
const result = (0, _utils.scan)(this, x, y, w, h, f);
if ((0, _utils.isNodePattern)(cb)) {
cb.call(this, null, result);
}
return result;
});
if (process.env.ENVIRONMENT === "BROWSER") {
// For use in a web browser or web worker
/* global self */
let gl;
if (typeof window !== "undefined" && typeof window === "object") {
gl = window;
}
if (typeof self !== "undefined" && typeof self === "object") {
gl = self;
}
gl.Jimp = Jimp;
gl.Buffer = Buffer;
}
var _default = Jimp;
exports["default"] = _default;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 7025:
/***/ ((module, exports) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
/*
Copyright (c) 2011 Elliot Shepherd
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
// https://code.google.com/p/ironchef-team21/source/browse/ironchef_team21/src/ImagePHash.java
/*
* pHash-like image hash.
* Author: Elliot Shepherd (elliot@jarofworms.com
* Based On: http://www.hackerfactor.com/blog/index.php?/archives/432-Looks-Like-It.html
*/
function ImagePHash(size, smallerSize) {
this.size = this.size || size;
this.smallerSize = this.smallerSize || smallerSize;
initCoefficients(this.size);
}
ImagePHash.prototype.size = 32;
ImagePHash.prototype.smallerSize = 8;
ImagePHash.prototype.distance = function (s1, s2) {
let counter = 0;
for (let k = 0; k < s1.length; k++) {
if (s1[k] !== s2[k]) {
counter++;
}
}
return counter / s1.length;
};
// Returns a 'binary string' (like. 001010111011100010) which is easy to do a hamming distance on.
ImagePHash.prototype.getHash = function (img) {
/* 1. Reduce size.
* Like Average Hash, pHash starts with a small image.
* However, the image is larger than 8x8; 32x32 is a good size.
* This is really done to simplify the DCT computation and not
* because it is needed to reduce the high frequencies.
*/
img = img.clone().resize(this.size, this.size);
/* 2. Reduce color.
* The image is reduced to a grayscale just to further simplify
* the number of computations.
*/
img.grayscale();
const vals = [];
for (let x = 0; x < img.bitmap.width; x++) {
vals[x] = [];
for (let y = 0; y < img.bitmap.height; y++) {
vals[x][y] = intToRGBA(img.getPixelColor(x, y)).b;
}
}
/* 3. Compute the DCT.
* The DCT separates the image into a collection of frequencies
* and scalars. While JPEG uses an 8x8 DCT, this algorithm uses
* a 32x32 DCT.
*/
const dctVals = applyDCT(vals, this.size);
/* 4. Reduce the DCT.
* This is the magic step. While the DCT is 32x32, just keep the
* top-left 8x8. Those represent the lowest frequencies in the
* picture.
*/
/* 5. Compute the average value.
* Like the Average Hash, compute the mean DCT value (using only
* the 8x8 DCT low-frequency values and excluding the first term
* since the DC coefficient can be significantly different from
* the other values and will throw off the average).
*/
let total = 0;
for (let x = 0; x < this.smallerSize; x++) {
for (let y = 0; y < this.smallerSize; y++) {
total += dctVals[x][y];
}
}
const avg = total / (this.smallerSize * this.smallerSize);
/* 6. Further reduce the DCT.
* This is the magic step. Set the 64 hash bits to 0 or 1
* depending on whether each of the 64 DCT values is above or
* below the average value. The result doesn't tell us the
* actual low frequencies; it just tells us the very-rough
* relative scale of the frequencies to the mean. The result
* will not vary as long as the overall structure of the image
* remains the same; this can survive gamma and color histogram
* adjustments without a problem.
*/
let hash = "";
for (let x = 0; x < this.smallerSize; x++) {
for (let y = 0; y < this.smallerSize; y++) {
hash += dctVals[x][y] > avg ? "1" : "0";
}
}
return hash;
};
// DCT function stolen from http://stackoverflow.com/questions/4240490/problems-with-dct-and-idct-algorithm-in-java
function intToRGBA(i) {
const rgba = {};
rgba.r = Math.floor(i / Math.pow(256, 3));
rgba.g = Math.floor((i - rgba.r * Math.pow(256, 3)) / Math.pow(256, 2));
rgba.b = Math.floor((i - rgba.r * Math.pow(256, 3) - rgba.g * Math.pow(256, 2)) / Math.pow(256, 1));
rgba.a = Math.floor((i - rgba.r * Math.pow(256, 3) - rgba.g * Math.pow(256, 2) - rgba.b * Math.pow(256, 1)) / Math.pow(256, 0));
return rgba;
}
const c = [];
function initCoefficients(size) {
for (let i = 1; i < size; i++) {
c[i] = 1;
}
c[0] = 1 / Math.sqrt(2.0);
}
function applyDCT(f, size) {
const N = size;
const F = [];
for (let u = 0; u < N; u++) {
F[u] = [];
for (let v = 0; v < N; v++) {
let sum = 0;
for (let i = 0; i < N; i++) {
for (let j = 0; j < N; j++) {
sum += Math.cos((2 * i + 1) / (2.0 * N) * u * Math.PI) * Math.cos((2 * j + 1) / (2.0 * N) * v * Math.PI) * f[i][j];
}
}
sum *= c[u] * c[v] / 4;
F[u][v] = sum;
}
}
return F;
}
var _default = ImagePHash;
exports["default"] = _default;
module.exports = exports.default;
module.exports["default"] = exports.default;
//# sourceMappingURL=phash.js.map
/***/ }),
/***/ 4310:
/***/ ((module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
__nccwpck_require__(2340);
var _default = (_ref, cb) => {
let {
url,
...options
} = _ref;
fetch(url, options).then(response => {
if (response.ok) {
return response.arrayBuffer().catch(error => {
throw new Error(`Response is not a buffer for url ${url}. Error: ${error.message}`);
});
}
throw new Error(`HTTP Status ${response.status} for url ${url}`);
}).then(data => cb(null, data)).catch(error => cb(error));
};
exports["default"] = _default;
module.exports = exports.default;
module.exports["default"] = exports.default;
//# sourceMappingURL=request.js.map
/***/ }),
/***/ 3946:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.getBuffer = getBuffer;
exports.getBufferAsync = getBufferAsync;
exports.parseBitmap = parseBitmap;
var _fileType = _interopRequireDefault(__nccwpck_require__(4930));
var _exifParser = _interopRequireDefault(__nccwpck_require__(6621));
var _utils = __nccwpck_require__(7403);
var constants = _interopRequireWildcard(__nccwpck_require__(4619));
var MIME = _interopRequireWildcard(__nccwpck_require__(3153));
var _promisify = _interopRequireDefault(__nccwpck_require__(6826));
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
async function getMIMEFromBuffer(buffer, path) {
const fileTypeFromBuffer = await _fileType.default.fromBuffer(buffer);
if (fileTypeFromBuffer) {
// If fileType returns something for buffer, then return the mime given
return fileTypeFromBuffer.mime;
}
if (path) {
// If a path is supplied, and fileType yields no results, then retry with MIME
// Path can be either a file path or a url
return MIME.getType(path);
}
return null;
}
/*
* Obtains image orientation from EXIF metadata.
*
* @param img {Jimp} a Jimp image object
* @returns {number} a number 1-8 representing EXIF orientation,
* in particular 1 if orientation tag is missing
*/
function getExifOrientation(img) {
return img._exif && img._exif.tags && img._exif.tags.Orientation || 1;
}
/**
* Returns a function which translates EXIF-rotated coordinates into
* non-rotated ones.
*
* Transformation reference: http://sylvana.net/jpegcrop/exif_orientation.html.
*
* @param img {Jimp} a Jimp image object
* @returns {function} transformation function for transformBitmap().
*/
function getExifOrientationTransformation(img) {
const w = img.getWidth();
const h = img.getHeight();
switch (getExifOrientation(img)) {
case 1:
// Horizontal (normal)
// does not need to be supported here
return null;
case 2:
// Mirror horizontal
return function (x, y) {
return [w - x - 1, y];
};
case 3:
// Rotate 180
return function (x, y) {
return [w - x - 1, h - y - 1];
};
case 4:
// Mirror vertical
return function (x, y) {
return [x, h - y - 1];
};
case 5:
// Mirror horizontal and rotate 270 CW
return function (x, y) {
return [y, x];
};
case 6:
// Rotate 90 CW
return function (x, y) {
return [y, h - x - 1];
};
case 7:
// Mirror horizontal and rotate 90 CW
return function (x, y) {
return [w - y - 1, h - x - 1];
};
case 8:
// Rotate 270 CW
return function (x, y) {
return [w - y - 1, x];
};
default:
return null;
}
}
/*
* Transforms bitmap in place (moves pixels around) according to given
* transformation function.
*
* @param img {Jimp} a Jimp image object, which bitmap is supposed to
* be transformed
* @param width {number} bitmap width after the transformation
* @param height {number} bitmap height after the transformation
* @param transformation {function} transformation function which defines pixel
* mapping between new and source bitmap. It takes a pair of coordinates
* in the target, and returns a respective pair of coordinates in
* the source bitmap, i.e. has following form:
* `function(new_x, new_y) { return [src_x, src_y] }`.
*/
function transformBitmap(img, width, height, transformation) {
// Underscore-prefixed values are related to the source bitmap
// Their counterparts with no prefix are related to the target bitmap
const _data = img.bitmap.data;
const _width = img.bitmap.width;
const data = Buffer.alloc(_data.length);
for (let x = 0; x < width; x++) {
for (let y = 0; y < height; y++) {
const [_x, _y] = transformation(x, y);
const idx = width * y + x << 2;
const _idx = _width * _y + _x << 2;
const pixel = _data.readUInt32BE(_idx);
data.writeUInt32BE(pixel, idx);
}
}
img.bitmap.data = data;
img.bitmap.width = width;
img.bitmap.height = height;
}
/*
* Automagically rotates an image based on its EXIF data (if present).
* @param img {Jimp} a Jimp image object
*/
function exifRotate(img) {
if (getExifOrientation(img) < 2) return;
const transformation = getExifOrientationTransformation(img);
const swapDimensions = getExifOrientation(img) > 4;
const newWidth = swapDimensions ? img.bitmap.height : img.bitmap.width;
const newHeight = swapDimensions ? img.bitmap.width : img.bitmap.height;
transformBitmap(img, newWidth, newHeight, transformation);
}
// parses a bitmap from the constructor to the JIMP bitmap property
async function parseBitmap(data, path, cb) {
const mime = await getMIMEFromBuffer(data, path);
if (typeof mime !== "string") {
return cb(new Error("Could not find MIME for Buffer <" + path + ">"));
}
this._originalMime = mime.toLowerCase();
try {
const mime = this.getMIME();
if (this.constructor.decoders[mime]) {
this.bitmap = this.constructor.decoders[mime](data);
} else {
return _utils.throwError.call(this, "Unsupported MIME type: " + mime, cb);
}
} catch (error) {
return cb.call(this, error, this);
}
try {
this._exif = _exifParser.default.create(data).parse();
exifRotate(this); // EXIF data
} catch (error) {
/* meh */
}
cb.call(this, null, this);
return this;
}
function compositeBitmapOverBackground(Jimp, image) {
return new Jimp(image.bitmap.width, image.bitmap.height, image._background).composite(image, 0, 0).bitmap;
}
/**
* Converts the image to a buffer
* @param {(string|number)} mime the mime type of the image buffer to be created
* @param {function(Error, Jimp)} cb a Node-style function to call with the buffer as the second argument
* @returns {Jimp} this for chaining of methods
*/
function getBuffer(mime, cb) {
if (mime === constants.AUTO) {
// allow auto MIME detection
mime = this.getMIME();
}
if (typeof mime !== "string") {
return _utils.throwError.call(this, "mime must be a string", cb);
}
if (typeof cb !== "function") {
return _utils.throwError.call(this, "cb must be a function", cb);
}
mime = mime.toLowerCase();
if (this._rgba && this.constructor.hasAlpha[mime]) {
this.bitmap.data = Buffer.from(this.bitmap.data);
} else {
// when format doesn't support alpha
// composite onto a new image so that the background shows through alpha channels
this.bitmap.data = compositeBitmapOverBackground(this.constructor, this).data;
}
if (this.constructor.encoders[mime]) {
const buffer = this.constructor.encoders[mime](this);
// Typically, buffers return a string or map. However, the gif library "gifwrap" seemingly returns promises.
if (buffer instanceof Promise) {
// trigger the callback when the promise has been resolved
buffer.then(buff => {
cb.call(this, null, buff);
});
} else {
cb.call(this, null, buffer);
}
} else {
return _utils.throwError.call(this, "Unsupported MIME type: " + mime, cb);
}
return this;
}
function getBufferAsync(mime) {
return (0, _promisify.default)(getBuffer, this, mime);
}
//# sourceMappingURL=image-bitmap.js.map
/***/ }),
/***/ 3153:
/***/ ((__unused_webpack_module, exports) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.getType = exports.getExtension = exports.addType = void 0;
const mimeTypes = {};
const findType = extension => Object.entries(mimeTypes).find(type => type[1].includes(extension)) || [];
const addType = (mime, extensions) => {
mimeTypes[mime] = extensions;
};
/**
* Lookup a mime type based on extension
* @param {string} path path to find extension for
* @returns {string} mime found mime type
*/
exports.addType = addType;
const getType = path => {
const pathParts = path.split("/").slice(-1);
const extension = pathParts[pathParts.length - 1].split(".").pop();
const type = findType(extension);
return type[0];
};
/**
* Return file extension associated with a mime type
* @param {string} type mime type to look up
* @returns {string} extension file extension
*/
exports.getType = getType;
const getExtension = type => (mimeTypes[type.toLowerCase()] || [])[0];
exports.getExtension = getExtension;
//# sourceMappingURL=mime.js.map
/***/ }),
/***/ 6826:
/***/ ((module, exports) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
const promisify = function (fun, ctx) {
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
args[_key - 2] = arguments[_key];
}
return new Promise((resolve, reject) => {
args.push((err, data) => {
if (err) {
reject(err);
}
resolve(data);
});
fun.bind(ctx)(...args);
});
};
var _default = promisify;
exports["default"] = _default;
module.exports = exports.default;
module.exports["default"] = exports.default;
//# sourceMappingURL=promisify.js.map
/***/ }),
/***/ 9472:
/***/ ((module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = configure;
var _core = _interopRequireWildcard(__nccwpck_require__(678));
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function configure(configuration) {
let jimpInstance = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _core.default;
const jimpConfig = {
hasAlpha: {},
encoders: {},
decoders: {},
class: {},
constants: {}
};
function addToConfig(newConfig) {
Object.entries(newConfig).forEach(_ref => {
let [key, value] = _ref;
jimpConfig[key] = {
...jimpConfig[key],
...value
};
});
}
function addImageType(typeModule) {
const type = typeModule();
if (Array.isArray(type.mime)) {
(0, _core.addType)(...type.mime);
} else {
Object.entries(type.mime).forEach(mimeType => (0, _core.addType)(...mimeType));
}
delete type.mime;
addToConfig(type);
}
function addPlugin(pluginModule) {
const plugin = pluginModule(_core.jimpEvChange) || {};
if (!plugin.class && !plugin.constants) {
// Default to class function
addToConfig({
class: plugin
});
} else {
addToConfig(plugin);
}
}
if (configuration.types) {
configuration.types.forEach(addImageType);
jimpInstance.decoders = {
...jimpInstance.decoders,
...jimpConfig.decoders
};
jimpInstance.encoders = {
...jimpInstance.encoders,
...jimpConfig.encoders
};
jimpInstance.hasAlpha = {
...jimpInstance.hasAlpha,
...jimpConfig.hasAlpha
};
}
if (configuration.plugins) {
configuration.plugins.forEach(addPlugin);
}
(0, _core.addJimpMethods)(jimpConfig.class, jimpInstance);
(0, _core.addConstants)(jimpConfig.constants, jimpInstance);
return _core.default;
}
module.exports = exports.default;
module.exports["default"] = exports.default;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 8257:
/***/ ((module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _omggif = _interopRequireDefault(__nccwpck_require__(9717));
var _gifwrap = __nccwpck_require__(7304);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const MIME_TYPE = "image/gif";
var _default = () => ({
mime: {
[MIME_TYPE]: ["gif"]
},
constants: {
MIME_GIF: MIME_TYPE
},
decoders: {
[MIME_TYPE]: data => {
const gifObj = new _omggif.default.GifReader(data);
const gifData = Buffer.alloc(gifObj.width * gifObj.height * 4);
gifObj.decodeAndBlitFrameRGBA(0, gifData);
return {
data: gifData,
width: gifObj.width,
height: gifObj.height
};
}
},
encoders: {
[MIME_TYPE]: data => {
const bitmap = new _gifwrap.BitmapImage(data.bitmap);
_gifwrap.GifUtil.quantizeDekker(bitmap, 256);
const newFrame = new _gifwrap.GifFrame(bitmap);
const gifCodec = new _gifwrap.GifCodec();
return gifCodec.encodeGif([newFrame], {}).then(newGif => {
return newGif.buffer;
});
}
}
});
exports["default"] = _default;
module.exports = exports.default;
module.exports["default"] = exports.default;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 5177:
/***/ ((module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _jpegJs = _interopRequireDefault(__nccwpck_require__(8541));
var _utils = __nccwpck_require__(7403);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const MIME_TYPE = "image/jpeg";
var _default = () => ({
mime: {
[MIME_TYPE]: ["jpeg", "jpg", "jpe"]
},
constants: {
MIME_JPEG: MIME_TYPE
},
decoders: {
[MIME_TYPE]: _jpegJs.default.decode
},
encoders: {
[MIME_TYPE]: image => _jpegJs.default.encode(image.bitmap, image._quality).data
},
class: {
// The quality to be used when saving JPEG images
_quality: 100,
/**
* Sets the quality of the image when saving as JPEG format (default is 100)
* @param {number} n The quality to use 0-100
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
* @returns {Jimp} this for chaining of methods
*/
quality(n, cb) {
if (typeof n !== "number") {
return _utils.throwError.call(this, "n must be a number", cb);
}
if (n < 0 || n > 100) {
return _utils.throwError.call(this, "n must be a number 0 - 100", cb);
}
this._quality = Math.round(n);
if ((0, _utils.isNodePattern)(cb)) {
cb.call(this, null, this);
}
return this;
}
}
});
exports["default"] = _default;
module.exports = exports.default;
module.exports["default"] = exports.default;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 1485:
/***/ ((module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _utils = __nccwpck_require__(7403);
var _default = () => ({
/**
* Blits a source image on to this image
* @param {Jimp} src the source Jimp instance
* @param {number} x the x position to blit the image
* @param {number} y the y position to blit the image
* @param {number} srcx (optional) the x position from which to crop the source image
* @param {number} srcy (optional) the y position from which to crop the source image
* @param {number} srcw (optional) the width to which to crop the source image
* @param {number} srch (optional) the height to which to crop the source image
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
* @returns {Jimp} this for chaining of methods
*/
blit(src, x, y, srcx, srcy, srcw, srch, cb) {
if (!(src instanceof this.constructor)) {
return _utils.throwError.call(this, "The source must be a Jimp image", cb);
}
if (typeof x !== "number" || typeof y !== "number") {
return _utils.throwError.call(this, "x and y must be numbers", cb);
}
if (typeof srcx === "function") {
cb = srcx;
srcx = 0;
srcy = 0;
srcw = src.bitmap.width;
srch = src.bitmap.height;
} else if (typeof srcx === typeof srcy && typeof srcy === typeof srcw && typeof srcw === typeof srch) {
srcx = srcx || 0;
srcy = srcy || 0;
srcw = srcw || src.bitmap.width;
srch = srch || src.bitmap.height;
} else {
return _utils.throwError.call(this, "srcx, srcy, srcw, srch must be numbers", cb);
}
// round input
x = Math.round(x);
y = Math.round(y);
// round input
srcx = Math.round(srcx);
srcy = Math.round(srcy);
srcw = Math.round(srcw);
srch = Math.round(srch);
const maxWidth = this.bitmap.width;
const maxHeight = this.bitmap.height;
const baseImage = this;
src.scanQuiet(srcx, srcy, srcw, srch, function (sx, sy, idx) {
const xOffset = x + sx - srcx;
const yOffset = y + sy - srcy;
if (xOffset >= 0 && yOffset >= 0 && maxWidth - xOffset > 0 && maxHeight - yOffset > 0) {
const dstIdx = baseImage.getPixelIndex(xOffset, yOffset);
const src = {
r: this.bitmap.data[idx],
g: this.bitmap.data[idx + 1],
b: this.bitmap.data[idx + 2],
a: this.bitmap.data[idx + 3]
};
const dst = {
r: baseImage.bitmap.data[dstIdx],
g: baseImage.bitmap.data[dstIdx + 1],
b: baseImage.bitmap.data[dstIdx + 2],
a: baseImage.bitmap.data[dstIdx + 3]
};
baseImage.bitmap.data[dstIdx] = (src.a * (src.r - dst.r) - dst.r + 255 >> 8) + dst.r;
baseImage.bitmap.data[dstIdx + 1] = (src.a * (src.g - dst.g) - dst.g + 255 >> 8) + dst.g;
baseImage.bitmap.data[dstIdx + 2] = (src.a * (src.b - dst.b) - dst.b + 255 >> 8) + dst.b;
baseImage.bitmap.data[dstIdx + 3] = this.constructor.limit255(dst.a + src.a);
}
});
if ((0, _utils.isNodePattern)(cb)) {
cb.call(this, null, this);
}
return this;
}
});
exports["default"] = _default;
module.exports = exports.default;
module.exports["default"] = exports.default;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 5803:
/***/ ((__unused_webpack_module, exports) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.shgTable = exports.mulTable = void 0;
const mulTable = [1, 57, 41, 21, 203, 34, 97, 73, 227, 91, 149, 62, 105, 45, 39, 137, 241, 107, 3, 173, 39, 71, 65, 238, 219, 101, 187, 87, 81, 151, 141, 133, 249, 117, 221, 209, 197, 187, 177, 169, 5, 153, 73, 139, 133, 127, 243, 233, 223, 107, 103, 99, 191, 23, 177, 171, 165, 159, 77, 149, 9, 139, 135, 131, 253, 245, 119, 231, 224, 109, 211, 103, 25, 195, 189, 23, 45, 175, 171, 83, 81, 79, 155, 151, 147, 9, 141, 137, 67, 131, 129, 251, 123, 30, 235, 115, 113, 221, 217, 53, 13, 51, 50, 49, 193, 189, 185, 91, 179, 175, 43, 169, 83, 163, 5, 79, 155, 19, 75, 147, 145, 143, 35, 69, 17, 67, 33, 65, 255, 251, 247, 243, 239, 59, 29, 229, 113, 111, 219, 27, 213, 105, 207, 51, 201, 199, 49, 193, 191, 47, 93, 183, 181, 179, 11, 87, 43, 85, 167, 165, 163, 161, 159, 157, 155, 77, 19, 75, 37, 73, 145, 143, 141, 35, 138, 137, 135, 67, 33, 131, 129, 255, 63, 250, 247, 61, 121, 239, 237, 117, 29, 229, 227, 225, 111, 55, 109, 216, 213, 211, 209, 207, 205, 203, 201, 199, 197, 195, 193, 48, 190, 47, 93, 185, 183, 181, 179, 178, 176, 175, 173, 171, 85, 21, 167, 165, 41, 163, 161, 5, 79, 157, 78, 154, 153, 19, 75, 149, 74, 147, 73, 144, 143, 71, 141, 140, 139, 137, 17, 135, 134, 133, 66, 131, 65, 129, 1];
exports.mulTable = mulTable;
const shgTable = [0, 9, 10, 10, 14, 12, 14, 14, 16, 15, 16, 15, 16, 15, 15, 17, 18, 17, 12, 18, 16, 17, 17, 19, 19, 18, 19, 18, 18, 19, 19, 19, 20, 19, 20, 20, 20, 20, 20, 20, 15, 20, 19, 20, 20, 20, 21, 21, 21, 20, 20, 20, 21, 18, 21, 21, 21, 21, 20, 21, 17, 21, 21, 21, 22, 22, 21, 22, 22, 21, 22, 21, 19, 22, 22, 19, 20, 22, 22, 21, 21, 21, 22, 22, 22, 18, 22, 22, 21, 22, 22, 23, 22, 20, 23, 22, 22, 23, 23, 21, 19, 21, 21, 21, 23, 23, 23, 22, 23, 23, 21, 23, 22, 23, 18, 22, 23, 20, 22, 23, 23, 23, 21, 22, 20, 22, 21, 22, 24, 24, 24, 24, 24, 22, 21, 24, 23, 23, 24, 21, 24, 23, 24, 22, 24, 24, 22, 24, 24, 22, 23, 24, 24, 24, 20, 23, 22, 23, 24, 24, 24, 24, 24, 24, 24, 23, 21, 23, 22, 23, 24, 24, 24, 22, 24, 24, 24, 23, 22, 24, 24, 25, 23, 25, 25, 23, 24, 25, 25, 24, 22, 25, 25, 25, 24, 23, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 23, 25, 23, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 24, 22, 25, 25, 23, 25, 25, 20, 24, 25, 24, 25, 25, 22, 24, 25, 24, 25, 24, 25, 25, 24, 25, 25, 25, 25, 22, 25, 25, 25, 24, 25, 24, 25, 18];
exports.shgTable = shgTable;
//# sourceMappingURL=blur-tables.js.map
/***/ }),
/***/ 6223:
/***/ ((module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _utils = __nccwpck_require__(7403);
var _blurTables = __nccwpck_require__(5803);
/*
Superfast Blur (0.5)
http://www.quasimondo.com/BoxBlurForCanvas/FastBlur.js
Copyright (c) 2011 Mario Klingemann
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
*/
var _default = () => ({
/**
* A fast blur algorithm that produces similar effect to a Gaussian blur - but MUCH quicker
* @param {number} r the pixel radius of the blur
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
* @returns {Jimp} this for chaining of methods
*/
blur(r, cb) {
if (typeof r !== "number") return _utils.throwError.call(this, "r must be a number", cb);
if (r < 1) return _utils.throwError.call(this, "r must be greater than 0", cb);
let rsum;
let gsum;
let bsum;
let asum;
let x;
let y;
let i;
let p;
let p1;
let p2;
let yp;
let yi;
let yw;
let pa;
const wm = this.bitmap.width - 1;
const hm = this.bitmap.height - 1;
// const wh = this.bitmap.width * this.bitmap.height;
const rad1 = r + 1;
const mulSum = _blurTables.mulTable[r];
const shgSum = _blurTables.shgTable[r];
const red = [];
const green = [];
const blue = [];
const alpha = [];
const vmin = [];
const vmax = [];
let iterations = 2;
while (iterations-- > 0) {
yi = 0;
yw = 0;
for (y = 0; y < this.bitmap.height; y++) {
rsum = this.bitmap.data[yw] * rad1;
gsum = this.bitmap.data[yw + 1] * rad1;
bsum = this.bitmap.data[yw + 2] * rad1;
asum = this.bitmap.data[yw + 3] * rad1;
for (i = 1; i <= r; i++) {
p = yw + ((i > wm ? wm : i) << 2);
rsum += this.bitmap.data[p++];
gsum += this.bitmap.data[p++];
bsum += this.bitmap.data[p++];
asum += this.bitmap.data[p];
}
for (x = 0; x < this.bitmap.width; x++) {
red[yi] = rsum;
green[yi] = gsum;
blue[yi] = bsum;
alpha[yi] = asum;
if (y === 0) {
vmin[x] = ((p = x + rad1) < wm ? p : wm) << 2;
vmax[x] = (p = x - r) > 0 ? p << 2 : 0;
}
p1 = yw + vmin[x];
p2 = yw + vmax[x];
rsum += this.bitmap.data[p1++] - this.bitmap.data[p2++];
gsum += this.bitmap.data[p1++] - this.bitmap.data[p2++];
bsum += this.bitmap.data[p1++] - this.bitmap.data[p2++];
asum += this.bitmap.data[p1] - this.bitmap.data[p2];
yi++;
}
yw += this.bitmap.width << 2;
}
for (x = 0; x < this.bitmap.width; x++) {
yp = x;
rsum = red[yp] * rad1;
gsum = green[yp] * rad1;
bsum = blue[yp] * rad1;
asum = alpha[yp] * rad1;
for (i = 1; i <= r; i++) {
yp += i > hm ? 0 : this.bitmap.width;
rsum += red[yp];
gsum += green[yp];
bsum += blue[yp];
asum += alpha[yp];
}
yi = x << 2;
for (y = 0; y < this.bitmap.height; y++) {
pa = asum * mulSum >>> shgSum;
this.bitmap.data[yi + 3] = pa;
// normalize alpha
if (pa > 255) {
this.bitmap.data[yi + 3] = 255;
}
if (pa > 0) {
pa = 255 / pa;
this.bitmap.data[yi] = (rsum * mulSum >>> shgSum) * pa;
this.bitmap.data[yi + 1] = (gsum * mulSum >>> shgSum) * pa;
this.bitmap.data[yi + 2] = (bsum * mulSum >>> shgSum) * pa;
} else {
this.bitmap.data[yi + 2] = 0;
this.bitmap.data[yi + 1] = 0;
this.bitmap.data[yi] = 0;
}
if (x === 0) {
vmin[y] = ((p = y + rad1) < hm ? p : hm) * this.bitmap.width;
vmax[y] = (p = y - r) > 0 ? p * this.bitmap.width : 0;
}
p1 = x + vmin[y];
p2 = x + vmax[y];
rsum += red[p1] - red[p2];
gsum += green[p1] - green[p2];
bsum += blue[p1] - blue[p2];
asum += alpha[p1] - alpha[p2];
yi += this.bitmap.width << 2;
}
}
}
if ((0, _utils.isNodePattern)(cb)) {
cb.call(this, null, this);
}
return this;
}
});
exports["default"] = _default;
module.exports = exports.default;
module.exports["default"] = exports.default;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 2005:
/***/ ((module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _utils = __nccwpck_require__(7403);
/**
* Creates a circle out of an image.
* @param {function(Error, Jimp)} options (optional) radius, x, y
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
* @returns {Jimp} this for chaining of methods
*/
var _default = () => ({
circle() {
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
let cb = arguments.length > 1 ? arguments[1] : undefined;
if (typeof options === "function") {
cb = options;
options = {};
}
const radius = options.radius || (this.bitmap.width > this.bitmap.height ? this.bitmap.height : this.bitmap.width) / 2;
const center = {
x: typeof options.x === "number" ? options.x : this.bitmap.width / 2,
y: typeof options.y === "number" ? options.y : this.bitmap.height / 2
};
this.scanQuiet(0, 0, this.bitmap.width, this.bitmap.height, function (x, y, idx) {
const curR = Math.sqrt(Math.pow(x - center.x, 2) + Math.pow(y - center.y, 2));
if (radius - curR <= 0.0) {
this.bitmap.data[idx + 3] = 0;
} else if (radius - curR < 1.0) {
this.bitmap.data[idx + 3] = 255 * (radius - curR);
}
});
if ((0, _utils.isNodePattern)(cb)) {
cb.call(this, null, this);
}
return this;
}
});
exports["default"] = _default;
module.exports = exports.default;
module.exports["default"] = exports.default;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 5432:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = exports.ColorActionName = void 0;
var _tinycolor = _interopRequireDefault(__nccwpck_require__(7476));
var _utils = __nccwpck_require__(7403);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function applyKernel(im, kernel, x, y) {
const value = [0, 0, 0];
const size = (kernel.length - 1) / 2;
for (let kx = 0; kx < kernel.length; kx += 1) {
for (let ky = 0; ky < kernel[kx].length; ky += 1) {
const idx = im.getPixelIndex(x + kx - size, y + ky - size);
value[0] += im.bitmap.data[idx] * kernel[kx][ky];
value[1] += im.bitmap.data[idx + 1] * kernel[kx][ky];
value[2] += im.bitmap.data[idx + 2] * kernel[kx][ky];
}
}
return value;
}
const isDef = v => typeof v !== "undefined" && v !== null;
function greyscale(cb) {
this.scanQuiet(0, 0, this.bitmap.width, this.bitmap.height, function (x, y, idx) {
const grey = parseInt(0.2126 * this.bitmap.data[idx] + 0.7152 * this.bitmap.data[idx + 1] + 0.0722 * this.bitmap.data[idx + 2], 10);
this.bitmap.data[idx] = grey;
this.bitmap.data[idx + 1] = grey;
this.bitmap.data[idx + 2] = grey;
});
if ((0, _utils.isNodePattern)(cb)) {
cb.call(this, null, this);
}
return this;
}
function mix(clr, clr2) {
let p = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 50;
return {
r: (clr2.r - clr.r) * (p / 100) + clr.r,
g: (clr2.g - clr.g) * (p / 100) + clr.g,
b: (clr2.b - clr.b) * (p / 100) + clr.b
};
}
function colorFn(actions, cb) {
if (!actions || !Array.isArray(actions)) {
return _utils.throwError.call(this, "actions must be an array", cb);
}
actions = actions.map(action => {
if (action.apply === "xor" || action.apply === "mix") {
action.params[0] = (0, _tinycolor.default)(action.params[0]).toRgb();
}
return action;
});
this.scanQuiet(0, 0, this.bitmap.width, this.bitmap.height, (x, y, idx) => {
let clr = {
r: this.bitmap.data[idx],
g: this.bitmap.data[idx + 1],
b: this.bitmap.data[idx + 2]
};
const colorModifier = (i, amount) => this.constructor.limit255(clr[i] + amount);
actions.forEach(action => {
if (action.apply === "mix") {
clr = mix(clr, action.params[0], action.params[1]);
} else if (action.apply === "tint") {
clr = mix(clr, {
r: 255,
g: 255,
b: 255
}, action.params[0]);
} else if (action.apply === "shade") {
clr = mix(clr, {
r: 0,
g: 0,
b: 0
}, action.params[0]);
} else if (action.apply === "xor") {
clr = {
r: clr.r ^ action.params[0].r,
g: clr.g ^ action.params[0].g,
b: clr.b ^ action.params[0].b
};
} else if (action.apply === "red") {
clr.r = colorModifier("r", action.params[0]);
} else if (action.apply === "green") {
clr.g = colorModifier("g", action.params[0]);
} else if (action.apply === "blue") {
clr.b = colorModifier("b", action.params[0]);
} else {
if (action.apply === "hue") {
action.apply = "spin";
}
clr = (0, _tinycolor.default)(clr);
if (!clr[action.apply]) {
return _utils.throwError.call(this, "action " + action.apply + " not supported", cb);
}
clr = clr[action.apply](...action.params).toRgb();
}
});
this.bitmap.data[idx] = clr.r;
this.bitmap.data[idx + 1] = clr.g;
this.bitmap.data[idx + 2] = clr.b;
});
if ((0, _utils.isNodePattern)(cb)) {
cb.call(this, null, this);
}
return this;
}
const ColorActionName = Object.freeze({
LIGHTEN: "lighten",
BRIGHTEN: "brighten",
DARKEN: "darken",
DESATURATE: "desaturate",
SATURATE: "saturate",
GREYSCALE: "greyscale",
SPIN: "spin",
HUE: "hue",
MIX: "mix",
TINT: "tint",
SHADE: "shade",
XOR: "xor",
RED: "red",
GREEN: "green",
BLUE: "blue"
});
exports.ColorActionName = ColorActionName;
var _default = () => ({
/**
* Adjusts the brightness of the image
* @param {number} val the amount to adjust the brightness, a number between -1 and +1
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
* @returns {Jimp }this for chaining of methods
*/
brightness(val, cb) {
if (typeof val !== "number") {
return _utils.throwError.call(this, "val must be numbers", cb);
}
if (val < -1 || val > +1) {
return _utils.throwError.call(this, "val must be a number between -1 and +1", cb);
}
this.scanQuiet(0, 0, this.bitmap.width, this.bitmap.height, function (x, y, idx) {
if (val < 0.0) {
this.bitmap.data[idx] *= 1 + val;
this.bitmap.data[idx + 1] *= 1 + val;
this.bitmap.data[idx + 2] *= 1 + val;
} else {
this.bitmap.data[idx] += (255 - this.bitmap.data[idx]) * val;
this.bitmap.data[idx + 1] += (255 - this.bitmap.data[idx + 1]) * val;
this.bitmap.data[idx + 2] += (255 - this.bitmap.data[idx + 2]) * val;
}
});
if ((0, _utils.isNodePattern)(cb)) {
cb.call(this, null, this);
}
return this;
},
/**
* Adjusts the contrast of the image
* @param {number} val the amount to adjust the contrast, a number between -1 and +1
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
* @returns {Jimp }this for chaining of methods
*/
contrast(val, cb) {
if (typeof val !== "number") {
return _utils.throwError.call(this, "val must be numbers", cb);
}
if (val < -1 || val > +1) {
return _utils.throwError.call(this, "val must be a number between -1 and +1", cb);
}
const factor = (val + 1) / (1 - val);
function adjust(value) {
value = Math.floor(factor * (value - 127) + 127);
return value < 0 ? 0 : value > 255 ? 255 : value;
}
this.scanQuiet(0, 0, this.bitmap.width, this.bitmap.height, function (x, y, idx) {
this.bitmap.data[idx] = adjust(this.bitmap.data[idx]);
this.bitmap.data[idx + 1] = adjust(this.bitmap.data[idx + 1]);
this.bitmap.data[idx + 2] = adjust(this.bitmap.data[idx + 2]);
});
if ((0, _utils.isNodePattern)(cb)) {
cb.call(this, null, this);
}
return this;
},
/**
* Apply a posterize effect
* @param {number} n the amount to adjust the contrast, minimum threshold is two
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
* @returns {Jimp }this for chaining of methods
*/
posterize(n, cb) {
if (typeof n !== "number") {
return _utils.throwError.call(this, "n must be numbers", cb);
}
if (n < 2) {
n = 2;
} // minimum of 2 levels
this.scanQuiet(0, 0, this.bitmap.width, this.bitmap.height, function (x, y, idx) {
this.bitmap.data[idx] = Math.floor(this.bitmap.data[idx] / 255 * (n - 1)) / (n - 1) * 255;
this.bitmap.data[idx + 1] = Math.floor(this.bitmap.data[idx + 1] / 255 * (n - 1)) / (n - 1) * 255;
this.bitmap.data[idx + 2] = Math.floor(this.bitmap.data[idx + 2] / 255 * (n - 1)) / (n - 1) * 255;
});
if ((0, _utils.isNodePattern)(cb)) {
cb.call(this, null, this);
}
return this;
},
/**
* Removes colour from the image using ITU Rec 709 luminance values
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
* @returns {Jimp }this for chaining of methods
*/
greyscale,
// Alias of greyscale for our American friends
grayscale: greyscale,
/**
* Multiplies the opacity of each pixel by a factor between 0 and 1
* @param {number} f A number, the factor by which to multiply the opacity of each pixel
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
* @returns {Jimp }this for chaining of methods
*/
opacity(f, cb) {
if (typeof f !== "number") return _utils.throwError.call(this, "f must be a number", cb);
if (f < 0 || f > 1) return _utils.throwError.call(this, "f must be a number from 0 to 1", cb);
this.scanQuiet(0, 0, this.bitmap.width, this.bitmap.height, function (x, y, idx) {
const v = this.bitmap.data[idx + 3] * f;
this.bitmap.data[idx + 3] = v;
});
if ((0, _utils.isNodePattern)(cb)) {
cb.call(this, null, this);
}
return this;
},
/**
* Applies a sepia tone to the image
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
* @returns {Jimp }this for chaining of methods
*/
sepia(cb) {
this.scanQuiet(0, 0, this.bitmap.width, this.bitmap.height, function (x, y, idx) {
let red = this.bitmap.data[idx];
let green = this.bitmap.data[idx + 1];
let blue = this.bitmap.data[idx + 2];
red = red * 0.393 + green * 0.769 + blue * 0.189;
green = red * 0.349 + green * 0.686 + blue * 0.168;
blue = red * 0.272 + green * 0.534 + blue * 0.131;
this.bitmap.data[idx] = red < 255 ? red : 255;
this.bitmap.data[idx + 1] = green < 255 ? green : 255;
this.bitmap.data[idx + 2] = blue < 255 ? blue : 255;
});
if ((0, _utils.isNodePattern)(cb)) {
cb.call(this, null, this);
}
return this;
},
/**
* Fades each pixel by a factor between 0 and 1
* @param {number} f A number from 0 to 1. 0 will haven no effect. 1 will turn the image completely transparent.
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
* @returns {Jimp }this for chaining of methods
*/
fade(f, cb) {
if (typeof f !== "number") {
return _utils.throwError.call(this, "f must be a number", cb);
}
if (f < 0 || f > 1) {
return _utils.throwError.call(this, "f must be a number from 0 to 1", cb);
}
// this method is an alternative to opacity (which may be deprecated)
this.opacity(1 - f);
if ((0, _utils.isNodePattern)(cb)) {
cb.call(this, null, this);
}
return this;
},
/**
* Adds each element of the image to its local neighbors, weighted by the kernel
* @param {array} kernel a matrix to weight the neighbors sum
* @param {number} edgeHandling (optional) define how to sum pixels from outside the border
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
* @returns {Jimp }this for chaining of methods
*/
convolution(kernel, edgeHandling, cb) {
if (typeof edgeHandling === "function" && typeof cb === "undefined") {
cb = edgeHandling;
edgeHandling = null;
}
if (!edgeHandling) {
edgeHandling = this.constructor.EDGE_EXTEND;
}
const newData = Buffer.from(this.bitmap.data);
const kRows = kernel.length;
const kCols = kernel[0].length;
const rowEnd = Math.floor(kRows / 2);
const colEnd = Math.floor(kCols / 2);
const rowIni = -rowEnd;
const colIni = -colEnd;
let weight;
let rSum;
let gSum;
let bSum;
let ri;
let gi;
let bi;
let xi;
let yi;
let idxi;
this.scanQuiet(0, 0, this.bitmap.width, this.bitmap.height, function (x, y, idx) {
bSum = 0;
gSum = 0;
rSum = 0;
for (let row = rowIni; row <= rowEnd; row++) {
for (let col = colIni; col <= colEnd; col++) {
xi = x + col;
yi = y + row;
weight = kernel[row + rowEnd][col + colEnd];
idxi = this.getPixelIndex(xi, yi, edgeHandling);
if (idxi === -1) {
bi = 0;
gi = 0;
ri = 0;
} else {
ri = this.bitmap.data[idxi + 0];
gi = this.bitmap.data[idxi + 1];
bi = this.bitmap.data[idxi + 2];
}
rSum += weight * ri;
gSum += weight * gi;
bSum += weight * bi;
}
}
if (rSum < 0) {
rSum = 0;
}
if (gSum < 0) {
gSum = 0;
}
if (bSum < 0) {
bSum = 0;
}
if (rSum > 255) {
rSum = 255;
}
if (gSum > 255) {
gSum = 255;
}
if (bSum > 255) {
bSum = 255;
}
newData[idx + 0] = rSum;
newData[idx + 1] = gSum;
newData[idx + 2] = bSum;
});
this.bitmap.data = newData;
if ((0, _utils.isNodePattern)(cb)) {
cb.call(this, null, this);
}
return this;
},
/**
* Set the alpha channel on every pixel to fully opaque
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
* @returns {Jimp }this for chaining of methods
*/
opaque(cb) {
this.scanQuiet(0, 0, this.bitmap.width, this.bitmap.height, function (x, y, idx) {
this.bitmap.data[idx + 3] = 255;
});
if ((0, _utils.isNodePattern)(cb)) {
cb.call(this, null, this);
}
return this;
},
/**
* Pixelates the image or a region
* @param {number} size the size of the pixels
* @param {number} x (optional) the x position of the region to pixelate
* @param {number} y (optional) the y position of the region to pixelate
* @param {number} w (optional) the width of the region to pixelate
* @param {number} h (optional) the height of the region to pixelate
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
* @returns {Jimp }this for chaining of methods
*/
pixelate(size, x, y, w, h, cb) {
if (typeof x === "function") {
cb = x;
h = null;
w = null;
y = null;
x = null;
} else {
if (typeof size !== "number") {
return _utils.throwError.call(this, "size must be a number", cb);
}
if (isDef(x) && typeof x !== "number") {
return _utils.throwError.call(this, "x must be a number", cb);
}
if (isDef(y) && typeof y !== "number") {
return _utils.throwError.call(this, "y must be a number", cb);
}
if (isDef(w) && typeof w !== "number") {
return _utils.throwError.call(this, "w must be a number", cb);
}
if (isDef(h) && typeof h !== "number") {
return _utils.throwError.call(this, "h must be a number", cb);
}
}
const kernel = [[1 / 16, 2 / 16, 1 / 16], [2 / 16, 4 / 16, 2 / 16], [1 / 16, 2 / 16, 1 / 16]];
x = x || 0;
y = y || 0;
w = isDef(w) ? w : this.bitmap.width - x;
h = isDef(h) ? h : this.bitmap.height - y;
const source = this.cloneQuiet();
this.scanQuiet(x, y, w, h, function (xx, yx, idx) {
xx = size * Math.floor(xx / size);
yx = size * Math.floor(yx / size);
const value = applyKernel(source, kernel, xx, yx);
this.bitmap.data[idx] = value[0];
this.bitmap.data[idx + 1] = value[1];
this.bitmap.data[idx + 2] = value[2];
});
if ((0, _utils.isNodePattern)(cb)) {
cb.call(this, null, this);
}
return this;
},
/**
* Applies a convolution kernel to the image or a region
* @param {array} kernel the convolution kernel
* @param {number} x (optional) the x position of the region to apply convolution to
* @param {number} y (optional) the y position of the region to apply convolution to
* @param {number} w (optional) the width of the region to apply convolution to
* @param {number} h (optional) the height of the region to apply convolution to
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
* @returns {Jimp} this for chaining of methods
*/
convolute(kernel, x, y, w, h, cb) {
if (!Array.isArray(kernel)) return _utils.throwError.call(this, "the kernel must be an array", cb);
if (typeof x === "function") {
cb = x;
x = null;
y = null;
w = null;
h = null;
} else {
if (isDef(x) && typeof x !== "number") {
return _utils.throwError.call(this, "x must be a number", cb);
}
if (isDef(y) && typeof y !== "number") {
return _utils.throwError.call(this, "y must be a number", cb);
}
if (isDef(w) && typeof w !== "number") {
return _utils.throwError.call(this, "w must be a number", cb);
}
if (isDef(h) && typeof h !== "number") {
return _utils.throwError.call(this, "h must be a number", cb);
}
}
x = isDef(x) ? x : 0;
y = isDef(y) ? y : 0;
w = isDef(w) ? w : this.bitmap.width - x;
h = isDef(h) ? h : this.bitmap.height - y;
const source = this.cloneQuiet();
this.scanQuiet(x, y, w, h, function (xx, yx, idx) {
const value = applyKernel(source, kernel, xx, yx);
this.bitmap.data[idx] = this.constructor.limit255(value[0]);
this.bitmap.data[idx + 1] = this.constructor.limit255(value[1]);
this.bitmap.data[idx + 2] = this.constructor.limit255(value[2]);
});
if ((0, _utils.isNodePattern)(cb)) {
cb.call(this, null, this);
}
return this;
},
/**
* Apply multiple color modification rules
* @param {array} actions list of color modification rules, in following format: { apply: '<rule-name>', params: [ <rule-parameters> ] }
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
* @returns {Jimp }this for chaining of methods
*/
color: colorFn,
colour: colorFn
});
exports["default"] = _default;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 7125:
/***/ ((module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _utils = __nccwpck_require__(7403);
/**
* Scale the image to the given width and height keeping the aspect ratio. Some parts of the image may be letter boxed.
* @param {number} w the width to resize the image to
* @param {number} h the height to resize the image to
* @param {number} alignBits (optional) A bitmask for horizontal and vertical alignment
* @param {string} mode (optional) a scaling method (e.g. Jimp.RESIZE_BEZIER)
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
* @returns {Jimp} this for chaining of methods
*/
var _default = () => ({
contain(w, h, alignBits, mode, cb) {
if (typeof w !== "number" || typeof h !== "number") {
return _utils.throwError.call(this, "w and h must be numbers", cb);
}
// permit any sort of optional parameters combination
if (typeof alignBits === "string") {
if (typeof mode === "function" && typeof cb === "undefined") cb = mode;
mode = alignBits;
alignBits = null;
}
if (typeof alignBits === "function") {
if (typeof cb === "undefined") cb = alignBits;
mode = null;
alignBits = null;
}
if (typeof mode === "function" && typeof cb === "undefined") {
cb = mode;
mode = null;
}
alignBits = alignBits || this.constructor.HORIZONTAL_ALIGN_CENTER | this.constructor.VERTICAL_ALIGN_MIDDLE;
const hbits = alignBits & (1 << 3) - 1;
const vbits = alignBits >> 3;
// check if more flags than one is in the bit sets
if (!(hbits !== 0 && !(hbits & hbits - 1) || vbits !== 0 && !(vbits & vbits - 1))) {
return _utils.throwError.call(this, "only use one flag per alignment direction", cb);
}
const alignH = hbits >> 1; // 0, 1, 2
const alignV = vbits >> 1; // 0, 1, 2
const f = w / h > this.bitmap.width / this.bitmap.height ? h / this.bitmap.height : w / this.bitmap.width;
const c = this.cloneQuiet().scale(f, mode);
this.resize(w, h, mode);
this.scanQuiet(0, 0, this.bitmap.width, this.bitmap.height, function (x, y, idx) {
this.bitmap.data.writeUInt32BE(this._background, idx);
});
this.blit(c, (this.bitmap.width - c.bitmap.width) / 2 * alignH, (this.bitmap.height - c.bitmap.height) / 2 * alignV);
if ((0, _utils.isNodePattern)(cb)) {
cb.call(this, null, this);
}
return this;
}
});
exports["default"] = _default;
module.exports = exports.default;
module.exports["default"] = exports.default;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 937:
/***/ ((module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _utils = __nccwpck_require__(7403);
/**
* Scale the image so the given width and height keeping the aspect ratio. Some parts of the image may be clipped.
* @param {number} w the width to resize the image to
* @param {number} h the height to resize the image to
* @param {number} alignBits (optional) A bitmask for horizontal and vertical alignment
* @param {string} mode (optional) a scaling method (e.g. Jimp.RESIZE_BEZIER)
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
* @returns {Jimp} this for chaining of methods
*/
var _default = () => ({
cover(w, h, alignBits, mode, cb) {
if (typeof w !== "number" || typeof h !== "number") {
return _utils.throwError.call(this, "w and h must be numbers", cb);
}
if (alignBits && typeof alignBits === "function" && typeof cb === "undefined") {
cb = alignBits;
alignBits = null;
mode = null;
} else if (typeof mode === "function" && typeof cb === "undefined") {
cb = mode;
mode = null;
}
alignBits = alignBits || this.constructor.HORIZONTAL_ALIGN_CENTER | this.constructor.VERTICAL_ALIGN_MIDDLE;
const hbits = alignBits & (1 << 3) - 1;
const vbits = alignBits >> 3;
// check if more flags than one is in the bit sets
if (!(hbits !== 0 && !(hbits & hbits - 1) || vbits !== 0 && !(vbits & vbits - 1))) return _utils.throwError.call(this, "only use one flag per alignment direction", cb);
const alignH = hbits >> 1; // 0, 1, 2
const alignV = vbits >> 1; // 0, 1, 2
const f = w / h > this.bitmap.width / this.bitmap.height ? w / this.bitmap.width : h / this.bitmap.height;
this.scale(f, mode);
this.crop((this.bitmap.width - w) / 2 * alignH, (this.bitmap.height - h) / 2 * alignV, w, h);
if ((0, _utils.isNodePattern)(cb)) {
cb.call(this, null, this);
}
return this;
}
});
exports["default"] = _default;
module.exports = exports.default;
module.exports["default"] = exports.default;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 1623:
/***/ ((module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = pluginCrop;
var _utils = __nccwpck_require__(7403);
/* eslint-disable no-labels */
function pluginCrop(event) {
/**
* Crops the image at a given point to a give size
* @param {number} x the x coordinate to crop form
* @param {number} y the y coordinate to crop form
* @param w the width of the crop region
* @param h the height of the crop region
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
* @returns {Jimp} this for chaining of methods
*/
event("crop", function (x, y, w, h, cb) {
if (typeof x !== "number" || typeof y !== "number") return _utils.throwError.call(this, "x and y must be numbers", cb);
if (typeof w !== "number" || typeof h !== "number") return _utils.throwError.call(this, "w and h must be numbers", cb);
// round input
x = Math.round(x);
y = Math.round(y);
w = Math.round(w);
h = Math.round(h);
if (x === 0 && w === this.bitmap.width) {
// shortcut
const start = w * y + x << 2;
const end = start + (h * w << 2);
this.bitmap.data = this.bitmap.data.slice(start, end);
} else {
const bitmap = Buffer.allocUnsafe(w * h * 4);
let offset = 0;
this.scanQuiet(x, y, w, h, function (x, y, idx) {
const data = this.bitmap.data.readUInt32BE(idx, true);
bitmap.writeUInt32BE(data, offset, true);
offset += 4;
});
this.bitmap.data = bitmap;
}
this.bitmap.width = w;
this.bitmap.height = h;
if ((0, _utils.isNodePattern)(cb)) {
cb.call(this, null, this);
}
return this;
});
return {
class: {
/**
* Autocrop same color borders from this image
* @param {number} tolerance (optional): a percent value of tolerance for pixels color difference (default: 0.0002%)
* @param {boolean} cropOnlyFrames (optional): flag to crop only real frames: all 4 sides of the image must have some border (default: true)
* @param {function(Error, Jimp)} cb (optional): a callback for when complete (default: no callback)
* @returns {Jimp} this for chaining of methods
*/
autocrop() {
const w = this.bitmap.width;
const h = this.bitmap.height;
const minPixelsPerSide = 1; // to avoid cropping completely the image, resulting in an invalid 0 sized image
let cb; // callback
let leaveBorder = 0; // Amount of pixels in border to leave
let tolerance = 0.0002; // percent of color difference tolerance (default value)
let cropOnlyFrames = true; // flag to force cropping only if the image has a real "frame"
// i.e. all 4 sides have some border (default value)
let cropSymmetric = false; // flag to force cropping top be symmetric.
// i.e. north and south / east and west are cropped by the same value
let ignoreSides = {
north: false,
south: false,
east: false,
west: false
};
// parse arguments
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
for (let a = 0, len = args.length; a < len; a++) {
if (typeof args[a] === "number") {
// tolerance value passed
tolerance = args[a];
}
if (typeof args[a] === "boolean") {
// cropOnlyFrames value passed
cropOnlyFrames = args[a];
}
if (typeof args[a] === "function") {
// callback value passed
cb = args[a];
}
if (typeof args[a] === "object") {
// config object passed
const config = args[a];
if (typeof config.tolerance !== "undefined") {
({
tolerance
} = config);
}
if (typeof config.cropOnlyFrames !== "undefined") {
({
cropOnlyFrames
} = config);
}
if (typeof config.cropSymmetric !== "undefined") {
({
cropSymmetric
} = config);
}
if (typeof config.leaveBorder !== "undefined") {
({
leaveBorder
} = config);
}
if (typeof config.ignoreSides !== "undefined") {
({
ignoreSides
} = config);
}
}
}
/**
* All borders must be of the same color as the top left pixel, to be cropped.
* It should be possible to crop borders each with a different color,
* but since there are many ways for corners to intersect, it would
* introduce unnecessary complexity to the algorithm.
*/
// scan each side for same color borders
let colorTarget = this.getPixelColor(0, 0); // top left pixel color is the target color
const rgba1 = this.constructor.intToRGBA(colorTarget);
// for north and east sides
let northPixelsToCrop = 0;
let eastPixelsToCrop = 0;
let southPixelsToCrop = 0;
let westPixelsToCrop = 0;
// north side (scan rows from north to south)
colorTarget = this.getPixelColor(0, 0);
if (!ignoreSides.north) {
north: for (let y = 0; y < h - minPixelsPerSide; y++) {
for (let x = 0; x < w; x++) {
const colorXY = this.getPixelColor(x, y);
const rgba2 = this.constructor.intToRGBA(colorXY);
if (this.constructor.colorDiff(rgba1, rgba2) > tolerance) {
// this pixel is too distant from the first one: abort this side scan
break north;
}
}
// this row contains all pixels with the same color: increment this side pixels to crop
northPixelsToCrop++;
}
}
// west side (scan columns from west to east)
colorTarget = this.getPixelColor(w, 0);
if (!ignoreSides.west) {
west: for (let x = 0; x < w - minPixelsPerSide; x++) {
for (let y = 0 + northPixelsToCrop; y < h; y++) {
const colorXY = this.getPixelColor(x, y);
const rgba2 = this.constructor.intToRGBA(colorXY);
if (this.constructor.colorDiff(rgba1, rgba2) > tolerance) {
// this pixel is too distant from the first one: abort this side scan
break west;
}
}
// this column contains all pixels with the same color: increment this side pixels to crop
westPixelsToCrop++;
}
}
// south side (scan rows from south to north)
colorTarget = this.getPixelColor(0, h);
if (!ignoreSides.south) {
south: for (let y = h - 1; y >= northPixelsToCrop + minPixelsPerSide; y--) {
for (let x = w - eastPixelsToCrop - 1; x >= 0; x--) {
const colorXY = this.getPixelColor(x, y);
const rgba2 = this.constructor.intToRGBA(colorXY);
if (this.constructor.colorDiff(rgba1, rgba2) > tolerance) {
// this pixel is too distant from the first one: abort this side scan
break south;
}
}
// this row contains all pixels with the same color: increment this side pixels to crop
southPixelsToCrop++;
}
}
// east side (scan columns from east to west)
colorTarget = this.getPixelColor(w, h);
if (!ignoreSides.east) {
east: for (let x = w - 1; x >= 0 + westPixelsToCrop + minPixelsPerSide; x--) {
for (let y = h - 1; y >= 0 + northPixelsToCrop; y--) {
const colorXY = this.getPixelColor(x, y);
const rgba2 = this.constructor.intToRGBA(colorXY);
if (this.constructor.colorDiff(rgba1, rgba2) > tolerance) {
// this pixel is too distant from the first one: abort this side scan
break east;
}
}
// this column contains all pixels with the same color: increment this side pixels to crop
eastPixelsToCrop++;
}
}
// decide if a crop is needed
let doCrop = false;
// apply leaveBorder
westPixelsToCrop -= leaveBorder;
eastPixelsToCrop -= leaveBorder;
northPixelsToCrop -= leaveBorder;
southPixelsToCrop -= leaveBorder;
if (cropSymmetric) {
const horizontal = Math.min(eastPixelsToCrop, westPixelsToCrop);
const vertical = Math.min(northPixelsToCrop, southPixelsToCrop);
westPixelsToCrop = horizontal;
eastPixelsToCrop = horizontal;
northPixelsToCrop = vertical;
southPixelsToCrop = vertical;
}
// make sure that crops are >= 0
westPixelsToCrop = westPixelsToCrop >= 0 ? westPixelsToCrop : 0;
eastPixelsToCrop = eastPixelsToCrop >= 0 ? eastPixelsToCrop : 0;
northPixelsToCrop = northPixelsToCrop >= 0 ? northPixelsToCrop : 0;
southPixelsToCrop = southPixelsToCrop >= 0 ? southPixelsToCrop : 0;
// safety checks
const widthOfRemainingPixels = w - (westPixelsToCrop + eastPixelsToCrop);
const heightOfRemainingPixels = h - (southPixelsToCrop + northPixelsToCrop);
if (cropOnlyFrames) {
// crop image if all sides should be cropped
doCrop = eastPixelsToCrop !== 0 && northPixelsToCrop !== 0 && westPixelsToCrop !== 0 && southPixelsToCrop !== 0;
} else {
// crop image if at least one side should be cropped
doCrop = eastPixelsToCrop !== 0 || northPixelsToCrop !== 0 || westPixelsToCrop !== 0 || southPixelsToCrop !== 0;
}
if (doCrop) {
// do the real crop
this.crop(westPixelsToCrop, northPixelsToCrop, widthOfRemainingPixels, heightOfRemainingPixels);
}
if ((0, _utils.isNodePattern)(cb)) {
cb.call(this, null, this);
}
return this;
}
}
};
}
module.exports = exports.default;
module.exports["default"] = exports.default;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 6096:
/***/ ((module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _utils = __nccwpck_require__(7403);
/**
* Displaces the image based on the provided displacement map
* @param {object} map the source Jimp instance
* @param {number} offset the maximum displacement value
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
* @returns {Jimp} this for chaining of methods
*/
var _default = () => ({
displace(map, offset, cb) {
if (typeof map !== "object" || map.constructor !== this.constructor) {
return _utils.throwError.call(this, "The source must be a Jimp image", cb);
}
if (typeof offset !== "number") {
return _utils.throwError.call(this, "factor must be a number", cb);
}
const source = this.cloneQuiet();
this.scanQuiet(0, 0, this.bitmap.width, this.bitmap.height, function (x, y, idx) {
let displacement = map.bitmap.data[idx] / 256 * offset;
displacement = Math.round(displacement);
const ids = this.getPixelIndex(x + displacement, y);
this.bitmap.data[ids] = source.bitmap.data[idx];
this.bitmap.data[ids + 1] = source.bitmap.data[idx + 1];
this.bitmap.data[ids + 2] = source.bitmap.data[idx + 2];
});
if ((0, _utils.isNodePattern)(cb)) {
cb.call(this, null, this);
}
return this;
}
});
exports["default"] = _default;
module.exports = exports.default;
module.exports["default"] = exports.default;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 5808:
/***/ ((module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _utils = __nccwpck_require__(7403);
/**
* Apply a ordered dithering effect
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
* @returns {Jimp} this for chaining of methods
*/
function dither(cb) {
const rgb565Matrix = [1, 9, 3, 11, 13, 5, 15, 7, 4, 12, 2, 10, 16, 8, 14, 6];
this.scanQuiet(0, 0, this.bitmap.width, this.bitmap.height, function (x, y, idx) {
const thresholdId = ((y & 3) << 2) + x % 4;
const dither = rgb565Matrix[thresholdId];
this.bitmap.data[idx] = Math.min(this.bitmap.data[idx] + dither, 0xff);
this.bitmap.data[idx + 1] = Math.min(this.bitmap.data[idx + 1] + dither, 0xff);
this.bitmap.data[idx + 2] = Math.min(this.bitmap.data[idx + 2] + dither, 0xff);
});
if ((0, _utils.isNodePattern)(cb)) {
cb.call(this, null, this);
}
return this;
}
var _default = () => ({
dither565: dither,
dither16: dither
});
exports["default"] = _default;
module.exports = exports.default;
module.exports["default"] = exports.default;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 1885:
/***/ ((module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _utils = __nccwpck_require__(7403);
/**
* Creates a circle out of an image.
* @param {object} options (optional) r: radius of effect
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
* @returns {Jimp} this for chaining of methods
*/
var _default = () => ({
fisheye() {
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
r: 2.5
};
let cb = arguments.length > 1 ? arguments[1] : undefined;
if (typeof options === "function") {
cb = options;
options = {
r: 2.5
};
}
const source = this.cloneQuiet();
const {
width,
height
} = source.bitmap;
source.scanQuiet(0, 0, width, height, (x, y) => {
const hx = x / width;
const hy = y / height;
const r = Math.sqrt(Math.pow(hx - 0.5, 2) + Math.pow(hy - 0.5, 2));
const rn = 2 * Math.pow(r, options.r);
const cosA = (hx - 0.5) / r;
const sinA = (hy - 0.5) / r;
const newX = Math.round((rn * cosA + 0.5) * width);
const newY = Math.round((rn * sinA + 0.5) * height);
const color = source.getPixelColor(newX, newY);
this.setPixelColor(color, x, y);
});
/* Set center pixel color, otherwise it will be transparent */
this.setPixelColor(source.getPixelColor(width / 2, height / 2), width / 2, height / 2);
if ((0, _utils.isNodePattern)(cb)) {
cb.call(this, null, this);
}
return this;
}
});
exports["default"] = _default;
module.exports = exports.default;
module.exports["default"] = exports.default;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 2818:
/***/ ((module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _utils = __nccwpck_require__(7403);
/**
* Flip the image horizontally
* @param {boolean} horizontal a Boolean, if true the image will be flipped horizontally
* @param {boolean} vertical a Boolean, if true the image will be flipped vertically
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
* @returns {Jimp} this for chaining of methods
*/
function flipFn(horizontal, vertical, cb) {
if (typeof horizontal !== "boolean" || typeof vertical !== "boolean") return _utils.throwError.call(this, "horizontal and vertical must be Booleans", cb);
const bitmap = Buffer.alloc(this.bitmap.data.length);
this.scanQuiet(0, 0, this.bitmap.width, this.bitmap.height, function (x, y, idx) {
const _x = horizontal ? this.bitmap.width - 1 - x : x;
const _y = vertical ? this.bitmap.height - 1 - y : y;
const _idx = this.bitmap.width * _y + _x << 2;
const data = this.bitmap.data.readUInt32BE(idx);
bitmap.writeUInt32BE(data, _idx);
});
this.bitmap.data = Buffer.from(bitmap);
if ((0, _utils.isNodePattern)(cb)) {
cb.call(this, null, this);
}
return this;
}
var _default = () => ({
flip: flipFn,
mirror: flipFn
});
exports["default"] = _default;
module.exports = exports.default;
module.exports["default"] = exports.default;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 2135:
/***/ ((module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _utils = __nccwpck_require__(7403);
/**
* Applies a true Gaussian blur to the image (warning: this is VERY slow)
* @param {number} r the pixel radius of the blur
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
* @returns {Jimp} this for chaining of methods
*/
var _default = () => ({
gaussian(r, cb) {
// http://blog.ivank.net/fastest-gaussian-blur.html
if (typeof r !== "number") {
return _utils.throwError.call(this, "r must be a number", cb);
}
if (r < 1) {
return _utils.throwError.call(this, "r must be greater than 0", cb);
}
const rs = Math.ceil(r * 2.57); // significant radius
const range = rs * 2 + 1;
const rr2 = r * r * 2;
const rr2pi = rr2 * Math.PI;
const weights = [];
for (let y = 0; y < range; y++) {
weights[y] = [];
for (let x = 0; x < range; x++) {
const dsq = (x - rs) ** 2 + (y - rs) ** 2;
weights[y][x] = Math.exp(-dsq / rr2) / rr2pi;
}
}
for (let y = 0; y < this.bitmap.height; y++) {
for (let x = 0; x < this.bitmap.width; x++) {
let red = 0;
let green = 0;
let blue = 0;
let alpha = 0;
let wsum = 0;
for (let iy = 0; iy < range; iy++) {
for (let ix = 0; ix < range; ix++) {
const x1 = Math.min(this.bitmap.width - 1, Math.max(0, ix + x - rs));
const y1 = Math.min(this.bitmap.height - 1, Math.max(0, iy + y - rs));
const weight = weights[iy][ix];
const idx = y1 * this.bitmap.width + x1 << 2;
red += this.bitmap.data[idx] * weight;
green += this.bitmap.data[idx + 1] * weight;
blue += this.bitmap.data[idx + 2] * weight;
alpha += this.bitmap.data[idx + 3] * weight;
wsum += weight;
}
const idx = y * this.bitmap.width + x << 2;
this.bitmap.data[idx] = Math.round(red / wsum);
this.bitmap.data[idx + 1] = Math.round(green / wsum);
this.bitmap.data[idx + 2] = Math.round(blue / wsum);
this.bitmap.data[idx + 3] = Math.round(alpha / wsum);
}
}
}
if ((0, _utils.isNodePattern)(cb)) {
cb.call(this, null, this);
}
return this;
}
});
exports["default"] = _default;
module.exports = exports.default;
module.exports["default"] = exports.default;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 9534:
/***/ ((module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _utils = __nccwpck_require__(7403);
/**
* Inverts the image
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
* @returns {Jimp} this for chaining of methods
*/
var _default = () => ({
invert(cb) {
this.scanQuiet(0, 0, this.bitmap.width, this.bitmap.height, function (x, y, idx) {
this.bitmap.data[idx] = 255 - this.bitmap.data[idx];
this.bitmap.data[idx + 1] = 255 - this.bitmap.data[idx + 1];
this.bitmap.data[idx + 2] = 255 - this.bitmap.data[idx + 2];
});
if ((0, _utils.isNodePattern)(cb)) {
cb.call(this, null, this);
}
return this;
}
});
exports["default"] = _default;
module.exports = exports.default;
module.exports["default"] = exports.default;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 497:
/***/ ((module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _utils = __nccwpck_require__(7403);
/**
* Masks a source image on to this image using average pixel colour. A completely black pixel on the mask will turn a pixel in the image completely transparent.
* @param {Jimp} src the source Jimp instance
* @param {number} x the horizontal position to blit the image
* @param {number} y the vertical position to blit the image
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
* @returns {Jimp} this for chaining of methods
*/
var _default = () => ({
mask(src) {
let x = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
let y = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
let cb = arguments.length > 3 ? arguments[3] : undefined;
if (!(src instanceof this.constructor)) {
return _utils.throwError.call(this, "The source must be a Jimp image", cb);
}
if (typeof x !== "number" || typeof y !== "number") {
return _utils.throwError.call(this, "x and y must be numbers", cb);
}
// round input
x = Math.round(x);
y = Math.round(y);
const w = this.bitmap.width;
const h = this.bitmap.height;
const baseImage = this;
src.scanQuiet(0, 0, src.bitmap.width, src.bitmap.height, function (sx, sy, idx) {
const destX = x + sx;
const destY = y + sy;
if (destX >= 0 && destY >= 0 && destX < w && destY < h) {
const dstIdx = baseImage.getPixelIndex(destX, destY);
const {
data
} = this.bitmap;
const avg = (data[idx + 0] + data[idx + 1] + data[idx + 2]) / 3;
baseImage.bitmap.data[dstIdx + 3] *= avg / 255;
}
});
if ((0, _utils.isNodePattern)(cb)) {
cb.call(this, null, this);
}
return this;
}
});
exports["default"] = _default;
module.exports = exports.default;
module.exports["default"] = exports.default;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 7022:
/***/ ((module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _utils = __nccwpck_require__(7403);
/**
* Get an image's histogram
* @return {object} An object with an array of color occurrence counts for each channel (r,g,b)
*/
function histogram() {
const histogram = {
r: new Array(256).fill(0),
g: new Array(256).fill(0),
b: new Array(256).fill(0)
};
this.scanQuiet(0, 0, this.bitmap.width, this.bitmap.height, function (x, y, index) {
histogram.r[this.bitmap.data[index + 0]]++;
histogram.g[this.bitmap.data[index + 1]]++;
histogram.b[this.bitmap.data[index + 2]]++;
});
return histogram;
}
/**
* Normalize values
* @param {integer} value Pixel channel value.
* @param {integer} min Minimum value for channel
* @param {integer} max Maximum value for channel
* @return {integer} normalized values
*/
const normalize = function (value, min, max) {
return (value - min) * 255 / (max - min);
};
const getBounds = function (histogramChannel) {
return [histogramChannel.findIndex(value => value > 0), 255 - histogramChannel.slice().reverse().findIndex(value => value > 0)];
};
/**
* Normalizes the image
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
* @returns {Jimp} this for chaining of methods
*/
var _default = () => ({
normalize(cb) {
const h = histogram.call(this);
// store bounds (minimum and maximum values)
const bounds = {
r: getBounds(h.r),
g: getBounds(h.g),
b: getBounds(h.b)
};
// apply value transformations
this.scanQuiet(0, 0, this.bitmap.width, this.bitmap.height, function (x, y, idx) {
const r = this.bitmap.data[idx + 0];
const g = this.bitmap.data[idx + 1];
const b = this.bitmap.data[idx + 2];
this.bitmap.data[idx + 0] = normalize(r, bounds.r[0], bounds.r[1]);
this.bitmap.data[idx + 1] = normalize(g, bounds.g[0], bounds.g[1]);
this.bitmap.data[idx + 2] = normalize(b, bounds.b[0], bounds.b[1]);
});
if ((0, _utils.isNodePattern)(cb)) {
cb.call(this, null, this);
}
return this;
}
});
exports["default"] = _default;
module.exports = exports.default;
module.exports["default"] = exports.default;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 7996:
/***/ ((module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _path = _interopRequireDefault(__nccwpck_require__(1017));
var _loadBmfont = _interopRequireDefault(__nccwpck_require__(9919));
var _utils = __nccwpck_require__(7403);
var _measureText = __nccwpck_require__(4803);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function xOffsetBasedOnAlignment(constants, font, line, maxWidth, alignment) {
if (alignment === constants.HORIZONTAL_ALIGN_LEFT) {
return 0;
}
if (alignment === constants.HORIZONTAL_ALIGN_CENTER) {
return (maxWidth - (0, _measureText.measureText)(font, line)) / 2;
}
return maxWidth - (0, _measureText.measureText)(font, line);
}
function drawCharacter(image, font, x, y, char) {
if (char.width > 0 && char.height > 0) {
const characterPage = font.pages[char.page];
image.blit(characterPage, x + char.xoffset, y + char.yoffset, char.x, char.y, char.width, char.height);
}
return image;
}
function printText(font, x, y, text, defaultCharWidth) {
for (let i = 0; i < text.length; i++) {
let char;
if (font.chars[text[i]]) {
char = text[i];
} else if (/\s/.test(text[i])) {
char = "";
} else {
char = "?";
}
const fontChar = font.chars[char] || {};
const fontKerning = font.kernings[char];
drawCharacter(this, font, x, y, fontChar || {});
const kerning = fontKerning && fontKerning[text[i + 1]] ? fontKerning[text[i + 1]] : 0;
x += kerning + (fontChar.xadvance || defaultCharWidth);
}
}
function loadPages(Jimp, dir, pages) {
const newPages = pages.map(page => {
return Jimp.read(dir + "/" + page);
});
return Promise.all(newPages);
}
const dir = process.env.DIRNAME || `${__dirname}/../`;
var _default = () => ({
constants: {
measureText: _measureText.measureText,
measureTextHeight: _measureText.measureTextHeight,
FONT_SANS_8_BLACK: _path.default.join(dir, "fonts/open-sans/open-sans-8-black/open-sans-8-black.fnt"),
FONT_SANS_10_BLACK: _path.default.join(dir, "fonts/open-sans/open-sans-10-black/open-sans-10-black.fnt"),
FONT_SANS_12_BLACK: _path.default.join(dir, "fonts/open-sans/open-sans-12-black/open-sans-12-black.fnt"),
FONT_SANS_14_BLACK: _path.default.join(dir, "fonts/open-sans/open-sans-14-black/open-sans-14-black.fnt"),
FONT_SANS_16_BLACK: _path.default.join(dir, "fonts/open-sans/open-sans-16-black/open-sans-16-black.fnt"),
FONT_SANS_32_BLACK: _path.default.join(dir, "fonts/open-sans/open-sans-32-black/open-sans-32-black.fnt"),
FONT_SANS_64_BLACK: _path.default.join(dir, "fonts/open-sans/open-sans-64-black/open-sans-64-black.fnt"),
FONT_SANS_128_BLACK: _path.default.join(dir, "fonts/open-sans/open-sans-128-black/open-sans-128-black.fnt"),
FONT_SANS_8_WHITE: _path.default.join(dir, "fonts/open-sans/open-sans-8-white/open-sans-8-white.fnt"),
FONT_SANS_16_WHITE: _path.default.join(dir, "fonts/open-sans/open-sans-16-white/open-sans-16-white.fnt"),
FONT_SANS_32_WHITE: _path.default.join(dir, "fonts/open-sans/open-sans-32-white/open-sans-32-white.fnt"),
FONT_SANS_64_WHITE: _path.default.join(dir, "fonts/open-sans/open-sans-64-white/open-sans-64-white.fnt"),
FONT_SANS_128_WHITE: _path.default.join(dir, "fonts/open-sans/open-sans-128-white/open-sans-128-white.fnt"),
/**
* Loads a bitmap font from a file
* @param {string} file the file path of a .fnt file
* @param {function(Error, Jimp)} cb (optional) a function to call when the font is loaded
* @returns {Promise} a promise
*/
loadFont(file, cb) {
if (typeof file !== "string") return _utils.throwError.call(this, "file must be a string", cb);
return new Promise((resolve, reject) => {
cb = cb || function (err, font) {
if (err) reject(err);else resolve(font);
};
(0, _loadBmfont.default)(file, (err, font) => {
const chars = {};
const kernings = {};
if (err) {
return _utils.throwError.call(this, err, cb);
}
for (let i = 0; i < font.chars.length; i++) {
chars[String.fromCharCode(font.chars[i].id)] = font.chars[i];
}
for (let i = 0; i < font.kernings.length; i++) {
const firstString = String.fromCharCode(font.kernings[i].first);
kernings[firstString] = kernings[firstString] || {};
kernings[firstString][String.fromCharCode(font.kernings[i].second)] = font.kernings[i].amount;
}
loadPages(this, _path.default.dirname(file), font.pages).then(pages => {
cb(null, {
chars,
kernings,
pages,
common: font.common,
info: font.info
});
});
});
});
}
},
class: {
/**
* Draws a text on a image on a given boundary
* @param {Jimp} font a bitmap font loaded from `Jimp.loadFont` command
* @param {number} x the x position to start drawing the text
* @param {number} y the y position to start drawing the text
* @param {any} text the text to draw (string or object with `text`, `alignmentX`, and/or `alignmentY`)
* @param {number} maxWidth (optional) the boundary width to draw in
* @param {number} maxHeight (optional) the boundary height to draw in
* @param {function(Error, Jimp)} cb (optional) a function to call when the text is written
* @returns {Jimp} this for chaining of methods
*/
print(font, x, y, text, maxWidth, maxHeight, cb) {
if (typeof maxWidth === "function" && typeof cb === "undefined") {
cb = maxWidth;
maxWidth = Infinity;
}
if (typeof maxWidth === "undefined") {
maxWidth = Infinity;
}
if (typeof maxHeight === "function" && typeof cb === "undefined") {
cb = maxHeight;
maxHeight = Infinity;
}
if (typeof maxHeight === "undefined") {
maxHeight = Infinity;
}
if (typeof font !== "object") {
return _utils.throwError.call(this, "font must be a Jimp loadFont", cb);
}
if (typeof x !== "number" || typeof y !== "number" || typeof maxWidth !== "number") {
return _utils.throwError.call(this, "x, y and maxWidth must be numbers", cb);
}
if (typeof maxWidth !== "number") {
return _utils.throwError.call(this, "maxWidth must be a number", cb);
}
if (typeof maxHeight !== "number") {
return _utils.throwError.call(this, "maxHeight must be a number", cb);
}
let alignmentX;
let alignmentY;
if (typeof text === "object" && text.text !== null && text.text !== undefined) {
alignmentX = text.alignmentX || this.constructor.HORIZONTAL_ALIGN_LEFT;
alignmentY = text.alignmentY || this.constructor.VERTICAL_ALIGN_TOP;
({
text
} = text);
} else {
alignmentX = this.constructor.HORIZONTAL_ALIGN_LEFT;
alignmentY = this.constructor.VERTICAL_ALIGN_TOP;
text = text.toString();
}
if (maxHeight !== Infinity && alignmentY === this.constructor.VERTICAL_ALIGN_BOTTOM) {
y += maxHeight - (0, _measureText.measureTextHeight)(font, text, maxWidth);
} else if (maxHeight !== Infinity && alignmentY === this.constructor.VERTICAL_ALIGN_MIDDLE) {
y += maxHeight / 2 - (0, _measureText.measureTextHeight)(font, text, maxWidth) / 2;
}
const defaultCharWidth = Object.entries(font.chars)[0][1].xadvance;
const {
lines,
longestLine
} = (0, _measureText.splitLines)(font, text, maxWidth);
lines.forEach(line => {
const lineString = line.join(" ");
const alignmentWidth = xOffsetBasedOnAlignment(this.constructor, font, lineString, maxWidth, alignmentX);
printText.call(this, font, x + alignmentWidth, y, lineString, defaultCharWidth);
y += font.common.lineHeight;
});
if ((0, _utils.isNodePattern)(cb)) {
cb.call(this, null, this, {
x: x + longestLine,
y
});
}
return this;
}
}
});
exports["default"] = _default;
module.exports = exports.default;
module.exports["default"] = exports.default;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 4803:
/***/ ((__unused_webpack_module, exports) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.measureText = measureText;
exports.measureTextHeight = measureTextHeight;
exports.splitLines = splitLines;
function measureText(font, text) {
let x = 0;
for (let i = 0; i < text.length; i++) {
if (font.chars[text[i]]) {
const kerning = font.kernings[text[i]] && font.kernings[text[i]][text[i + 1]] ? font.kernings[text[i]][text[i + 1]] : 0;
x += (font.chars[text[i]].xadvance || 0) + kerning;
}
}
return x;
}
function splitLines(font, text, maxWidth) {
const words = text.split(" ");
const lines = [];
let currentLine = [];
let longestLine = 0;
words.forEach(word => {
const line = [...currentLine, word].join(" ");
const length = measureText(font, line);
if (length <= maxWidth) {
if (length > longestLine) {
longestLine = length;
}
currentLine.push(word);
} else {
lines.push(currentLine);
currentLine = [word];
}
});
lines.push(currentLine);
return {
lines,
longestLine
};
}
function measureTextHeight(font, text, maxWidth) {
const {
lines
} = splitLines(font, text, maxWidth);
return lines.length * font.common.lineHeight;
}
//# sourceMappingURL=measure-text.js.map
/***/ }),
/***/ 5555:
/***/ ((module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _utils = __nccwpck_require__(7403);
var _resize = _interopRequireDefault(__nccwpck_require__(391));
var _resize2 = _interopRequireDefault(__nccwpck_require__(1846));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var _default = () => ({
constants: {
RESIZE_NEAREST_NEIGHBOR: "nearestNeighbor",
RESIZE_BILINEAR: "bilinearInterpolation",
RESIZE_BICUBIC: "bicubicInterpolation",
RESIZE_HERMITE: "hermiteInterpolation",
RESIZE_BEZIER: "bezierInterpolation"
},
class: {
/**
* Resizes the image to a set width and height using a 2-pass bilinear algorithm
* @param {number} w the width to resize the image to (or Jimp.AUTO)
* @param {number} h the height to resize the image to (or Jimp.AUTO)
* @param {string} mode (optional) a scaling method (e.g. Jimp.RESIZE_BEZIER)
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
* @returns {Jimp} this for chaining of methods
*/
resize(w, h, mode, cb) {
if (typeof w !== "number" || typeof h !== "number") {
return _utils.throwError.call(this, "w and h must be numbers", cb);
}
if (typeof mode === "function" && typeof cb === "undefined") {
cb = mode;
mode = null;
}
if (w === this.constructor.AUTO && h === this.constructor.AUTO) {
return _utils.throwError.call(this, "w and h cannot both be set to auto", cb);
}
if (w === this.constructor.AUTO) {
w = this.bitmap.width * (h / this.bitmap.height);
}
if (h === this.constructor.AUTO) {
h = this.bitmap.height * (w / this.bitmap.width);
}
if (w < 0 || h < 0) {
return _utils.throwError.call(this, "w and h must be positive numbers", cb);
}
// round inputs
w = Math.round(w) || 1;
h = Math.round(h) || 1;
if (typeof _resize2.default[mode] === "function") {
const dst = {
data: Buffer.alloc(w * h * 4),
width: w,
height: h
};
_resize2.default[mode](this.bitmap, dst);
this.bitmap = dst;
} else {
const image = this;
const resize = new _resize.default(this.bitmap.width, this.bitmap.height, w, h, true, true, buffer => {
image.bitmap.data = Buffer.from(buffer);
image.bitmap.width = w;
image.bitmap.height = h;
});
resize.resize(this.bitmap.data);
}
if ((0, _utils.isNodePattern)(cb)) {
cb.call(this, null, this);
}
return this;
}
}
});
exports["default"] = _default;
module.exports = exports.default;
module.exports["default"] = exports.default;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 391:
/***/ ((module, exports) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
// JavaScript Image Resizer (c) 2012 - Grant Galitz
// Released to public domain 29 July 2013: https://github.com/grantgalitz/JS-Image-Resizer/issues/4
function Resize(widthOriginal, heightOriginal, targetWidth, targetHeight, blendAlpha, interpolationPass, resizeCallback) {
this.widthOriginal = Math.abs(Math.floor(widthOriginal) || 0);
this.heightOriginal = Math.abs(Math.floor(heightOriginal) || 0);
this.targetWidth = Math.abs(Math.floor(targetWidth) || 0);
this.targetHeight = Math.abs(Math.floor(targetHeight) || 0);
this.colorChannels = blendAlpha ? 4 : 3;
this.interpolationPass = Boolean(interpolationPass);
this.resizeCallback = typeof resizeCallback === "function" ? resizeCallback : function () {};
this.targetWidthMultipliedByChannels = this.targetWidth * this.colorChannels;
this.originalWidthMultipliedByChannels = this.widthOriginal * this.colorChannels;
this.originalHeightMultipliedByChannels = this.heightOriginal * this.colorChannels;
this.widthPassResultSize = this.targetWidthMultipliedByChannels * this.heightOriginal;
this.finalResultSize = this.targetWidthMultipliedByChannels * this.targetHeight;
this.initialize();
}
Resize.prototype.initialize = function () {
// Perform some checks:
if (this.widthOriginal > 0 && this.heightOriginal > 0 && this.targetWidth > 0 && this.targetHeight > 0) {
this.configurePasses();
} else {
throw new Error("Invalid settings specified for the resizer.");
}
};
Resize.prototype.configurePasses = function () {
if (this.widthOriginal === this.targetWidth) {
// Bypass the width resizer pass:
this.resizeWidth = this.bypassResizer;
} else {
// Setup the width resizer pass:
this.ratioWeightWidthPass = this.widthOriginal / this.targetWidth;
if (this.ratioWeightWidthPass < 1 && this.interpolationPass) {
this.initializeFirstPassBuffers(true);
this.resizeWidth = this.colorChannels === 4 ? this.resizeWidthInterpolatedRGBA : this.resizeWidthInterpolatedRGB;
} else {
this.initializeFirstPassBuffers(false);
this.resizeWidth = this.colorChannels === 4 ? this.resizeWidthRGBA : this.resizeWidthRGB;
}
}
if (this.heightOriginal === this.targetHeight) {
// Bypass the height resizer pass:
this.resizeHeight = this.bypassResizer;
} else {
// Setup the height resizer pass:
this.ratioWeightHeightPass = this.heightOriginal / this.targetHeight;
if (this.ratioWeightHeightPass < 1 && this.interpolationPass) {
this.initializeSecondPassBuffers(true);
this.resizeHeight = this.resizeHeightInterpolated;
} else {
this.initializeSecondPassBuffers(false);
this.resizeHeight = this.colorChannels === 4 ? this.resizeHeightRGBA : this.resizeHeightRGB;
}
}
};
Resize.prototype._resizeWidthInterpolatedRGBChannels = function (buffer, fourthChannel) {
const channelsNum = fourthChannel ? 4 : 3;
const ratioWeight = this.ratioWeightWidthPass;
const outputBuffer = this.widthBuffer;
let weight = 0;
let finalOffset = 0;
let pixelOffset = 0;
let firstWeight = 0;
let secondWeight = 0;
let targetPosition;
// Handle for only one interpolation input being valid for start calculation:
for (targetPosition = 0; weight < 1 / 3; targetPosition += channelsNum, weight += ratioWeight) {
for (finalOffset = targetPosition, pixelOffset = 0; finalOffset < this.widthPassResultSize; pixelOffset += this.originalWidthMultipliedByChannels, finalOffset += this.targetWidthMultipliedByChannels) {
outputBuffer[finalOffset] = buffer[pixelOffset];
outputBuffer[finalOffset + 1] = buffer[pixelOffset + 1];
outputBuffer[finalOffset + 2] = buffer[pixelOffset + 2];
if (fourthChannel) outputBuffer[finalOffset + 3] = buffer[pixelOffset + 3];
}
}
// Adjust for overshoot of the last pass's counter:
weight -= 1 / 3;
let interpolationWidthSourceReadStop;
for (interpolationWidthSourceReadStop = this.widthOriginal - 1; weight < interpolationWidthSourceReadStop; targetPosition += channelsNum, weight += ratioWeight) {
// Calculate weightings:
secondWeight = weight % 1;
firstWeight = 1 - secondWeight;
// Interpolate:
for (finalOffset = targetPosition, pixelOffset = Math.floor(weight) * channelsNum; finalOffset < this.widthPassResultSize; pixelOffset += this.originalWidthMultipliedByChannels, finalOffset += this.targetWidthMultipliedByChannels) {
outputBuffer[finalOffset + 0] = buffer[pixelOffset + 0] * firstWeight + buffer[pixelOffset + channelsNum + 0] * secondWeight;
outputBuffer[finalOffset + 1] = buffer[pixelOffset + 1] * firstWeight + buffer[pixelOffset + channelsNum + 1] * secondWeight;
outputBuffer[finalOffset + 2] = buffer[pixelOffset + 2] * firstWeight + buffer[pixelOffset + channelsNum + 2] * secondWeight;
if (fourthChannel) outputBuffer[finalOffset + 3] = buffer[pixelOffset + 3] * firstWeight + buffer[pixelOffset + channelsNum + 3] * secondWeight;
}
}
// Handle for only one interpolation input being valid for end calculation:
for (interpolationWidthSourceReadStop = this.originalWidthMultipliedByChannels - channelsNum; targetPosition < this.targetWidthMultipliedByChannels; targetPosition += channelsNum) {
for (finalOffset = targetPosition, pixelOffset = interpolationWidthSourceReadStop; finalOffset < this.widthPassResultSize; pixelOffset += this.originalWidthMultipliedByChannels, finalOffset += this.targetWidthMultipliedByChannels) {
outputBuffer[finalOffset] = buffer[pixelOffset];
outputBuffer[finalOffset + 1] = buffer[pixelOffset + 1];
outputBuffer[finalOffset + 2] = buffer[pixelOffset + 2];
if (fourthChannel) outputBuffer[finalOffset + 3] = buffer[pixelOffset + 3];
}
}
return outputBuffer;
};
Resize.prototype._resizeWidthRGBChannels = function (buffer, fourthChannel) {
const channelsNum = fourthChannel ? 4 : 3;
const ratioWeight = this.ratioWeightWidthPass;
const ratioWeightDivisor = 1 / ratioWeight;
const nextLineOffsetOriginalWidth = this.originalWidthMultipliedByChannels - channelsNum + 1;
const nextLineOffsetTargetWidth = this.targetWidthMultipliedByChannels - channelsNum + 1;
const output = this.outputWidthWorkBench;
const outputBuffer = this.widthBuffer;
const trustworthyColorsCount = this.outputWidthWorkBenchOpaquePixelsCount;
let weight = 0;
let amountToNext = 0;
let actualPosition = 0;
let currentPosition = 0;
let line = 0;
let pixelOffset = 0;
let outputOffset = 0;
let multiplier = 1;
let r = 0;
let g = 0;
let b = 0;
let a = 0;
do {
for (line = 0; line < this.originalHeightMultipliedByChannels;) {
output[line++] = 0;
output[line++] = 0;
output[line++] = 0;
if (fourthChannel) {
output[line++] = 0;
trustworthyColorsCount[line / channelsNum - 1] = 0;
}
}
weight = ratioWeight;
do {
amountToNext = 1 + actualPosition - currentPosition;
multiplier = Math.min(weight, amountToNext);
for (line = 0, pixelOffset = actualPosition; line < this.originalHeightMultipliedByChannels; pixelOffset += nextLineOffsetOriginalWidth) {
r = buffer[pixelOffset];
g = buffer[++pixelOffset];
b = buffer[++pixelOffset];
a = fourthChannel ? buffer[++pixelOffset] : 255;
// Ignore RGB values if pixel is completely transparent
output[line++] += (a ? r : 0) * multiplier;
output[line++] += (a ? g : 0) * multiplier;
output[line++] += (a ? b : 0) * multiplier;
if (fourthChannel) {
output[line++] += a * multiplier;
trustworthyColorsCount[line / channelsNum - 1] += a ? multiplier : 0;
}
}
if (weight >= amountToNext) {
actualPosition += channelsNum;
currentPosition = actualPosition;
weight -= amountToNext;
} else {
currentPosition += weight;
break;
}
} while (weight > 0 && actualPosition < this.originalWidthMultipliedByChannels);
for (line = 0, pixelOffset = outputOffset; line < this.originalHeightMultipliedByChannels; pixelOffset += nextLineOffsetTargetWidth) {
weight = fourthChannel ? trustworthyColorsCount[line / channelsNum] : 1;
multiplier = fourthChannel ? weight ? 1 / weight : 0 : ratioWeightDivisor;
outputBuffer[pixelOffset] = output[line++] * multiplier;
outputBuffer[++pixelOffset] = output[line++] * multiplier;
outputBuffer[++pixelOffset] = output[line++] * multiplier;
if (fourthChannel) outputBuffer[++pixelOffset] = output[line++] * ratioWeightDivisor;
}
outputOffset += channelsNum;
} while (outputOffset < this.targetWidthMultipliedByChannels);
return outputBuffer;
};
Resize.prototype._resizeHeightRGBChannels = function (buffer, fourthChannel) {
const ratioWeight = this.ratioWeightHeightPass;
const ratioWeightDivisor = 1 / ratioWeight;
const output = this.outputHeightWorkBench;
const outputBuffer = this.heightBuffer;
const trustworthyColorsCount = this.outputHeightWorkBenchOpaquePixelsCount;
let weight = 0;
let amountToNext = 0;
let actualPosition = 0;
let currentPosition = 0;
let pixelOffset = 0;
let outputOffset = 0;
let caret = 0;
let multiplier = 1;
let r = 0;
let g = 0;
let b = 0;
let a = 0;
do {
for (pixelOffset = 0; pixelOffset < this.targetWidthMultipliedByChannels;) {
output[pixelOffset++] = 0;
output[pixelOffset++] = 0;
output[pixelOffset++] = 0;
if (fourthChannel) {
output[pixelOffset++] = 0;
trustworthyColorsCount[pixelOffset / 4 - 1] = 0;
}
}
weight = ratioWeight;
do {
amountToNext = 1 + actualPosition - currentPosition;
multiplier = Math.min(weight, amountToNext);
caret = actualPosition;
for (pixelOffset = 0; pixelOffset < this.targetWidthMultipliedByChannels;) {
r = buffer[caret++];
g = buffer[caret++];
b = buffer[caret++];
a = fourthChannel ? buffer[caret++] : 255;
// Ignore RGB values if pixel is completely transparent
output[pixelOffset++] += (a ? r : 0) * multiplier;
output[pixelOffset++] += (a ? g : 0) * multiplier;
output[pixelOffset++] += (a ? b : 0) * multiplier;
if (fourthChannel) {
output[pixelOffset++] += a * multiplier;
trustworthyColorsCount[pixelOffset / 4 - 1] += a ? multiplier : 0;
}
}
if (weight >= amountToNext) {
actualPosition = caret;
currentPosition = actualPosition;
weight -= amountToNext;
} else {
currentPosition += weight;
break;
}
} while (weight > 0 && actualPosition < this.widthPassResultSize);
for (pixelOffset = 0; pixelOffset < this.targetWidthMultipliedByChannels;) {
weight = fourthChannel ? trustworthyColorsCount[pixelOffset / 4] : 1;
multiplier = fourthChannel ? weight ? 1 / weight : 0 : ratioWeightDivisor;
outputBuffer[outputOffset++] = Math.round(output[pixelOffset++] * multiplier);
outputBuffer[outputOffset++] = Math.round(output[pixelOffset++] * multiplier);
outputBuffer[outputOffset++] = Math.round(output[pixelOffset++] * multiplier);
if (fourthChannel) {
outputBuffer[outputOffset++] = Math.round(output[pixelOffset++] * ratioWeightDivisor);
}
}
} while (outputOffset < this.finalResultSize);
return outputBuffer;
};
Resize.prototype.resizeWidthInterpolatedRGB = function (buffer) {
return this._resizeWidthInterpolatedRGBChannels(buffer, false);
};
Resize.prototype.resizeWidthInterpolatedRGBA = function (buffer) {
return this._resizeWidthInterpolatedRGBChannels(buffer, true);
};
Resize.prototype.resizeWidthRGB = function (buffer) {
return this._resizeWidthRGBChannels(buffer, false);
};
Resize.prototype.resizeWidthRGBA = function (buffer) {
return this._resizeWidthRGBChannels(buffer, true);
};
Resize.prototype.resizeHeightInterpolated = function (buffer) {
const ratioWeight = this.ratioWeightHeightPass;
const outputBuffer = this.heightBuffer;
let weight = 0;
let finalOffset = 0;
let pixelOffset = 0;
let pixelOffsetAccumulated = 0;
let pixelOffsetAccumulated2 = 0;
let firstWeight = 0;
let secondWeight = 0;
let interpolationHeightSourceReadStop;
// Handle for only one interpolation input being valid for start calculation:
for (; weight < 1 / 3; weight += ratioWeight) {
for (pixelOffset = 0; pixelOffset < this.targetWidthMultipliedByChannels;) {
outputBuffer[finalOffset++] = Math.round(buffer[pixelOffset++]);
}
}
// Adjust for overshoot of the last pass's counter:
weight -= 1 / 3;
for (interpolationHeightSourceReadStop = this.heightOriginal - 1; weight < interpolationHeightSourceReadStop; weight += ratioWeight) {
// Calculate weightings:
secondWeight = weight % 1;
firstWeight = 1 - secondWeight;
// Interpolate:
pixelOffsetAccumulated = Math.floor(weight) * this.targetWidthMultipliedByChannels;
pixelOffsetAccumulated2 = pixelOffsetAccumulated + this.targetWidthMultipliedByChannels;
for (pixelOffset = 0; pixelOffset < this.targetWidthMultipliedByChannels; ++pixelOffset) {
outputBuffer[finalOffset++] = Math.round(buffer[pixelOffsetAccumulated++] * firstWeight + buffer[pixelOffsetAccumulated2++] * secondWeight);
}
}
// Handle for only one interpolation input being valid for end calculation:
while (finalOffset < this.finalResultSize) {
for (pixelOffset = 0, pixelOffsetAccumulated = interpolationHeightSourceReadStop * this.targetWidthMultipliedByChannels; pixelOffset < this.targetWidthMultipliedByChannels; ++pixelOffset) {
outputBuffer[finalOffset++] = Math.round(buffer[pixelOffsetAccumulated++]);
}
}
return outputBuffer;
};
Resize.prototype.resizeHeightRGB = function (buffer) {
return this._resizeHeightRGBChannels(buffer, false);
};
Resize.prototype.resizeHeightRGBA = function (buffer) {
return this._resizeHeightRGBChannels(buffer, true);
};
Resize.prototype.resize = function (buffer) {
this.resizeCallback(this.resizeHeight(this.resizeWidth(buffer)));
};
Resize.prototype.bypassResizer = function (buffer) {
// Just return the buffer passed:
return buffer;
};
Resize.prototype.initializeFirstPassBuffers = function (BILINEARAlgo) {
// Initialize the internal width pass buffers:
this.widthBuffer = this.generateFloatBuffer(this.widthPassResultSize);
if (!BILINEARAlgo) {
this.outputWidthWorkBench = this.generateFloatBuffer(this.originalHeightMultipliedByChannels);
if (this.colorChannels > 3) {
this.outputWidthWorkBenchOpaquePixelsCount = this.generateFloat64Buffer(this.heightOriginal);
}
}
};
Resize.prototype.initializeSecondPassBuffers = function (BILINEARAlgo) {
// Initialize the internal height pass buffers:
this.heightBuffer = this.generateUint8Buffer(this.finalResultSize);
if (!BILINEARAlgo) {
this.outputHeightWorkBench = this.generateFloatBuffer(this.targetWidthMultipliedByChannels);
if (this.colorChannels > 3) {
this.outputHeightWorkBenchOpaquePixelsCount = this.generateFloat64Buffer(this.targetWidth);
}
}
};
Resize.prototype.generateFloatBuffer = function (bufferLength) {
// Generate a float32 typed array buffer:
try {
return new Float32Array(bufferLength);
} catch (error) {
return [];
}
};
Resize.prototype.generateFloat64Buffer = function (bufferLength) {
// Generate a float64 typed array buffer:
try {
return new Float64Array(bufferLength);
} catch (error) {
return [];
}
};
Resize.prototype.generateUint8Buffer = function (bufferLength) {
// Generate a uint8 typed array buffer:
try {
return new Uint8Array(bufferLength);
} catch (error) {
return [];
}
};
var _default = Resize;
exports["default"] = _default;
module.exports = exports.default;
module.exports["default"] = exports.default;
//# sourceMappingURL=resize.js.map
/***/ }),
/***/ 1846:
/***/ ((module, exports) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
/**
* Copyright (c) 2015 Guyon Roche
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:</p>
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
const operations = {
nearestNeighbor(src, dst) {
const wSrc = src.width;
const hSrc = src.height;
const wDst = dst.width;
const hDst = dst.height;
const bufSrc = src.data;
const bufDst = dst.data;
for (let i = 0; i < hDst; i++) {
for (let j = 0; j < wDst; j++) {
let posDst = (i * wDst + j) * 4;
const iSrc = Math.floor(i * hSrc / hDst);
const jSrc = Math.floor(j * wSrc / wDst);
let posSrc = (iSrc * wSrc + jSrc) * 4;
bufDst[posDst++] = bufSrc[posSrc++];
bufDst[posDst++] = bufSrc[posSrc++];
bufDst[posDst++] = bufSrc[posSrc++];
bufDst[posDst++] = bufSrc[posSrc++];
}
}
},
bilinearInterpolation(src, dst) {
const wSrc = src.width;
const hSrc = src.height;
const wDst = dst.width;
const hDst = dst.height;
const bufSrc = src.data;
const bufDst = dst.data;
const interpolate = function (k, kMin, vMin, kMax, vMax) {
// special case - k is integer
if (kMin === kMax) {
return vMin;
}
return Math.round((k - kMin) * vMax + (kMax - k) * vMin);
};
const assign = function (pos, offset, x, xMin, xMax, y, yMin, yMax) {
let posMin = (yMin * wSrc + xMin) * 4 + offset;
let posMax = (yMin * wSrc + xMax) * 4 + offset;
const vMin = interpolate(x, xMin, bufSrc[posMin], xMax, bufSrc[posMax]);
// special case, y is integer
if (yMax === yMin) {
bufDst[pos + offset] = vMin;
} else {
posMin = (yMax * wSrc + xMin) * 4 + offset;
posMax = (yMax * wSrc + xMax) * 4 + offset;
const vMax = interpolate(x, xMin, bufSrc[posMin], xMax, bufSrc[posMax]);
bufDst[pos + offset] = interpolate(y, yMin, vMin, yMax, vMax);
}
};
for (let i = 0; i < hDst; i++) {
for (let j = 0; j < wDst; j++) {
const posDst = (i * wDst + j) * 4;
// x & y in src coordinates
const x = j * wSrc / wDst;
const xMin = Math.floor(x);
const xMax = Math.min(Math.ceil(x), wSrc - 1);
const y = i * hSrc / hDst;
const yMin = Math.floor(y);
const yMax = Math.min(Math.ceil(y), hSrc - 1);
assign(posDst, 0, x, xMin, xMax, y, yMin, yMax);
assign(posDst, 1, x, xMin, xMax, y, yMin, yMax);
assign(posDst, 2, x, xMin, xMax, y, yMin, yMax);
assign(posDst, 3, x, xMin, xMax, y, yMin, yMax);
}
}
},
_interpolate2D(src, dst, options, interpolate) {
const bufSrc = src.data;
const bufDst = dst.data;
const wSrc = src.width;
const hSrc = src.height;
const wDst = dst.width;
const hDst = dst.height;
// when dst smaller than src/2, interpolate first to a multiple between 0.5 and 1.0 src, then sum squares
const wM = Math.max(1, Math.floor(wSrc / wDst));
const wDst2 = wDst * wM;
const hM = Math.max(1, Math.floor(hSrc / hDst));
const hDst2 = hDst * hM;
// ===========================================================
// Pass 1 - interpolate rows
// buf1 has width of dst2 and height of src
const buf1 = Buffer.alloc(wDst2 * hSrc * 4);
for (let i = 0; i < hSrc; i++) {
for (let j = 0; j < wDst2; j++) {
// i in src coords, j in dst coords
// calculate x in src coords
// this interpolation requires 4 sample points and the two inner ones must be real
// the outer points can be fudged for the edges.
// therefore (wSrc-1)/wDst2
const x = j * (wSrc - 1) / wDst2;
const xPos = Math.floor(x);
const t = x - xPos;
const srcPos = (i * wSrc + xPos) * 4;
const buf1Pos = (i * wDst2 + j) * 4;
for (let k = 0; k < 4; k++) {
const kPos = srcPos + k;
const x0 = xPos > 0 ? bufSrc[kPos - 4] : 2 * bufSrc[kPos] - bufSrc[kPos + 4];
const x1 = bufSrc[kPos];
const x2 = bufSrc[kPos + 4];
const x3 = xPos < wSrc - 2 ? bufSrc[kPos + 8] : 2 * bufSrc[kPos + 4] - bufSrc[kPos];
buf1[buf1Pos + k] = interpolate(x0, x1, x2, x3, t);
}
}
}
// this._writeFile(wDst2, hSrc, buf1, "out/buf1.jpg");
// ===========================================================
// Pass 2 - interpolate columns
// buf2 has width and height of dst2
const buf2 = Buffer.alloc(wDst2 * hDst2 * 4);
for (let i = 0; i < hDst2; i++) {
for (let j = 0; j < wDst2; j++) {
// i&j in dst2 coords
// calculate y in buf1 coords
// this interpolation requires 4 sample points and the two inner ones must be real
// the outer points can be fudged for the edges.
// therefore (hSrc-1)/hDst2
const y = i * (hSrc - 1) / hDst2;
const yPos = Math.floor(y);
const t = y - yPos;
const buf1Pos = (yPos * wDst2 + j) * 4;
const buf2Pos = (i * wDst2 + j) * 4;
for (let k = 0; k < 4; k++) {
const kPos = buf1Pos + k;
const y0 = yPos > 0 ? buf1[kPos - wDst2 * 4] : 2 * buf1[kPos] - buf1[kPos + wDst2 * 4];
const y1 = buf1[kPos];
const y2 = buf1[kPos + wDst2 * 4];
const y3 = yPos < hSrc - 2 ? buf1[kPos + wDst2 * 8] : 2 * buf1[kPos + wDst2 * 4] - buf1[kPos];
buf2[buf2Pos + k] = interpolate(y0, y1, y2, y3, t);
}
}
}
// this._writeFile(wDst2, hDst2, buf2, "out/buf2.jpg");
// ===========================================================
// Pass 3 - scale to dst
const m = wM * hM;
if (m > 1) {
for (let i = 0; i < hDst; i++) {
for (let j = 0; j < wDst; j++) {
// i&j in dst bounded coords
let r = 0;
let g = 0;
let b = 0;
let a = 0;
let realColors = 0;
for (let y = 0; y < hM; y++) {
const yPos = i * hM + y;
for (let x = 0; x < wM; x++) {
const xPos = j * wM + x;
const xyPos = (yPos * wDst2 + xPos) * 4;
const pixelAlpha = buf2[xyPos + 3];
if (pixelAlpha) {
r += buf2[xyPos];
g += buf2[xyPos + 1];
b += buf2[xyPos + 2];
realColors++;
}
a += pixelAlpha;
}
}
const pos = (i * wDst + j) * 4;
bufDst[pos] = realColors ? Math.round(r / realColors) : 0;
bufDst[pos + 1] = realColors ? Math.round(g / realColors) : 0;
bufDst[pos + 2] = realColors ? Math.round(b / realColors) : 0;
bufDst[pos + 3] = Math.round(a / m);
}
}
} else {
// replace dst buffer with buf2
dst.data = buf2;
}
},
bicubicInterpolation(src, dst, options) {
const interpolateCubic = function (x0, x1, x2, x3, t) {
const a0 = x3 - x2 - x0 + x1;
const a1 = x0 - x1 - a0;
const a2 = x2 - x0;
const a3 = x1;
return Math.max(0, Math.min(255, a0 * (t * t * t) + a1 * (t * t) + a2 * t + a3));
};
return this._interpolate2D(src, dst, options, interpolateCubic);
},
hermiteInterpolation(src, dst, options) {
const interpolateHermite = function (x0, x1, x2, x3, t) {
const c0 = x1;
const c1 = 0.5 * (x2 - x0);
const c2 = x0 - 2.5 * x1 + 2 * x2 - 0.5 * x3;
const c3 = 0.5 * (x3 - x0) + 1.5 * (x1 - x2);
return Math.max(0, Math.min(255, Math.round(((c3 * t + c2) * t + c1) * t + c0)));
};
return this._interpolate2D(src, dst, options, interpolateHermite);
},
bezierInterpolation(src, dst, options) {
// between 2 points y(n), y(n+1), use next points out, y(n-1), y(n+2)
// to predict control points (a & b) to be placed at n+0.5
// ya(n) = y(n) + (y(n+1)-y(n-1))/4
// yb(n) = y(n+1) - (y(n+2)-y(n))/4
// then use std bezier to interpolate [n,n+1)
// y(n+t) = y(n)*(1-t)^3 + 3 * ya(n)*(1-t)^2*t + 3 * yb(n)*(1-t)*t^2 + y(n+1)*t^3
// note the 3* factor for the two control points
// for edge cases, can choose:
// y(-1) = y(0) - 2*(y(1)-y(0))
// y(w) = y(w-1) + 2*(y(w-1)-y(w-2))
// but can go with y(-1) = y(0) and y(w) = y(w-1)
const interpolateBezier = function (x0, x1, x2, x3, t) {
// x1, x2 are the knots, use x0 and x3 to calculate control points
const cp1 = x1 + (x2 - x0) / 4;
const cp2 = x2 - (x3 - x1) / 4;
const nt = 1 - t;
const c0 = x1 * nt * nt * nt;
const c1 = 3 * cp1 * nt * nt * t;
const c2 = 3 * cp2 * nt * t * t;
const c3 = x2 * t * t * t;
return Math.max(0, Math.min(255, Math.round(c0 + c1 + c2 + c3)));
};
return this._interpolate2D(src, dst, options, interpolateBezier);
}
};
var _default = operations;
exports["default"] = _default;
module.exports = exports.default;
module.exports["default"] = exports.default;
//# sourceMappingURL=resize2.js.map
/***/ }),
/***/ 6880:
/***/ ((module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _utils = __nccwpck_require__(7403);
/**
* Rotates an image counter-clockwise by multiple of 90 degrees. NB: 'this' must be a Jimp object.
*
* This function is based on matrix rotation. Check this to get an initial idea how it works: https://stackoverflow.com/a/8664879/10561909
*
* @param {number} deg the number of degrees to rotate the image by, it should be a multiple of 90
*/
function matrixRotate(deg) {
if (Math.abs(deg) % 90 !== 0) {
throw new Error("Unsupported matrix rotation degree");
}
deg %= 360;
if (Math.abs(deg) === 0) {
// no rotation for 0, 360, -360, 720, -720, ...
return;
}
const w = this.bitmap.width;
const h = this.bitmap.height;
// decide which rotation angle to use
let angle;
switch (deg) {
// 90 degree & -270 degree are same
case 90:
case -270:
angle = 90;
break;
case 180:
case -180:
angle = 180;
break;
case 270:
case -90:
angle = -90;
break;
default:
throw new Error("Unsupported matrix rotation degree");
}
// After this switch block, angle will be 90, 180 or -90
// calculate the new width and height
const nW = angle === 180 ? w : h;
const nH = angle === 180 ? h : w;
const dstBuffer = Buffer.alloc(this.bitmap.data.length);
// function to translate the x, y coordinate to the index of the pixel in the buffer
function createIdxTranslationFunction(w, h) {
return function (x, y) {
return y * w + x << 2;
};
}
const srcIdxFunction = createIdxTranslationFunction(w, h);
const dstIdxFunction = createIdxTranslationFunction(nW, nH);
for (let x = 0; x < w; x++) {
for (let y = 0; y < h; y++) {
const srcIdx = srcIdxFunction(x, y);
const pixelRGBA = this.bitmap.data.readUInt32BE(srcIdx);
let dstIdx;
switch (angle) {
case 90:
dstIdx = dstIdxFunction(y, w - x - 1);
break;
case -90:
dstIdx = dstIdxFunction(h - y - 1, x);
break;
case 180:
dstIdx = dstIdxFunction(w - x - 1, h - y - 1);
break;
default:
throw new Error("Unsupported matrix rotation angle");
}
dstBuffer.writeUInt32BE(pixelRGBA, dstIdx);
}
}
this.bitmap.data = dstBuffer;
this.bitmap.width = nW;
this.bitmap.height = nH;
}
/**
* Rotates an image counter-clockwise by an arbitrary number of degrees. NB: 'this' must be a Jimp object.
* @param {number} deg the number of degrees to rotate the image by
* @param {string|boolean} mode (optional) resize mode or a boolean, if false then the width and height of the image will not be changed
*/
function advancedRotate(deg, mode) {
deg %= 360;
const rad = deg * Math.PI / 180;
const cosine = Math.cos(rad);
const sine = Math.sin(rad);
// the final width and height will change if resize == true
let w = this.bitmap.width;
let h = this.bitmap.height;
if (mode === true || typeof mode === "string") {
// resize the image to it maximum dimension and blit the existing image
// onto the center so that when it is rotated the image is kept in bounds
// http://stackoverflow.com/questions/3231176/how-to-get-size-of-a-rotated-rectangle
// Plus 1 border pixel to ensure to show all rotated result for some cases.
w = Math.ceil(Math.abs(this.bitmap.width * cosine) + Math.abs(this.bitmap.height * sine)) + 1;
h = Math.ceil(Math.abs(this.bitmap.width * sine) + Math.abs(this.bitmap.height * cosine)) + 1;
// Ensure destination to have even size to a better result.
if (w % 2 !== 0) {
w++;
}
if (h % 2 !== 0) {
h++;
}
const c = this.cloneQuiet();
this.scanQuiet(0, 0, this.bitmap.width, this.bitmap.height, function (x, y, idx) {
this.bitmap.data.writeUInt32BE(this._background, idx);
});
const max = Math.max(w, h, this.bitmap.width, this.bitmap.height);
this.resize(max, max, mode);
this.blit(c, this.bitmap.width / 2 - c.bitmap.width / 2, this.bitmap.height / 2 - c.bitmap.height / 2);
}
const bW = this.bitmap.width;
const bH = this.bitmap.height;
const dstBuffer = Buffer.alloc(this.bitmap.data.length);
function createTranslationFunction(deltaX, deltaY) {
return function (x, y) {
return {
x: x + deltaX,
y: y + deltaY
};
};
}
const translate2Cartesian = createTranslationFunction(-(bW / 2), -(bH / 2));
const translate2Screen = createTranslationFunction(bW / 2 + 0.5, bH / 2 + 0.5);
for (let y = 1; y <= bH; y++) {
for (let x = 1; x <= bW; x++) {
const cartesian = translate2Cartesian(x, y);
const source = translate2Screen(cosine * cartesian.x - sine * cartesian.y, cosine * cartesian.y + sine * cartesian.x);
const dstIdx = bW * (y - 1) + x - 1 << 2;
if (source.x >= 0 && source.x < bW && source.y >= 0 && source.y < bH) {
const srcIdx = (bW * (source.y | 0) + source.x | 0) << 2;
const pixelRGBA = this.bitmap.data.readUInt32BE(srcIdx);
dstBuffer.writeUInt32BE(pixelRGBA, dstIdx);
} else {
// reset off-image pixels
dstBuffer.writeUInt32BE(this._background, dstIdx);
}
}
}
this.bitmap.data = dstBuffer;
if (mode === true || typeof mode === "string") {
// now crop the image to the final size
const x = bW / 2 - w / 2;
const y = bH / 2 - h / 2;
this.crop(x, y, w, h);
}
}
var _default = () => ({
/**
* Rotates the image counter-clockwise by a number of degrees. By default the width and height of the image will be resized appropriately.
* @param {number} deg the number of degrees to rotate the image by
* @param {string|boolean} mode (optional) resize mode or a boolean, if false then the width and height of the image will not be changed
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
* @returns {Jimp} this for chaining of methods
*/
rotate(deg, mode, cb) {
// enable overloading
if (typeof mode === "undefined" || mode === null) {
// e.g. image.resize(120);
// e.g. image.resize(120, null, cb);
// e.g. image.resize(120, undefined, cb);
mode = true;
}
if (typeof mode === "function" && typeof cb === "undefined") {
// e.g. image.resize(120, cb);
cb = mode;
mode = true;
}
if (typeof deg !== "number") {
return _utils.throwError.call(this, "deg must be a number", cb);
}
if (typeof mode !== "boolean" && typeof mode !== "string") {
return _utils.throwError.call(this, "mode must be a boolean or a string", cb);
}
// use matrixRotate if the angle is a multiple of 90 degrees (eg: 180 or -90) and resize is allowed or not needed.
const matrixRotateAllowed = deg % 90 === 0 && (mode || this.bitmap.width === this.bitmap.height || deg % 180 === 0);
if (matrixRotateAllowed) {
matrixRotate.call(this, deg);
} else {
advancedRotate.call(this, deg, mode, cb);
}
if ((0, _utils.isNodePattern)(cb)) {
cb.call(this, null, this);
}
return this;
}
});
exports["default"] = _default;
module.exports = exports.default;
module.exports["default"] = exports.default;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 8212:
/***/ ((module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _utils = __nccwpck_require__(7403);
var _default = () => ({
/**
* Uniformly scales the image by a factor.
* @param {number} f the factor to scale the image by
* @param {string} mode (optional) a scaling method (e.g. Jimp.RESIZE_BEZIER)
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
* @returns {Jimp} this for chaining of methods
*/
scale(f, mode, cb) {
if (typeof f !== "number") {
return _utils.throwError.call(this, "f must be a number", cb);
}
if (f < 0) {
return _utils.throwError.call(this, "f must be a positive number", cb);
}
if (typeof mode === "function" && typeof cb === "undefined") {
cb = mode;
mode = null;
}
const w = this.bitmap.width * f;
const h = this.bitmap.height * f;
this.resize(w, h, mode);
if ((0, _utils.isNodePattern)(cb)) {
cb.call(this, null, this);
}
return this;
},
/**
* Scale the image to the largest size that fits inside the rectangle that has the given width and height.
* @param {number} w the width to resize the image to
* @param {number} h the height to resize the image to
* @param {string} mode (optional) a scaling method (e.g. Jimp.RESIZE_BEZIER)
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
* @returns {Jimp} this for chaining of methods
*/
scaleToFit(w, h, mode, cb) {
if (typeof w !== "number" || typeof h !== "number") {
return _utils.throwError.call(this, "w and h must be numbers", cb);
}
if (typeof mode === "function" && typeof cb === "undefined") {
cb = mode;
mode = null;
}
const f = w / h > this.bitmap.width / this.bitmap.height ? h / this.bitmap.height : w / this.bitmap.width;
this.scale(f, mode);
if ((0, _utils.isNodePattern)(cb)) {
cb.call(this, null, this);
}
return this;
}
});
exports["default"] = _default;
module.exports = exports.default;
module.exports["default"] = exports.default;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 8178:
/***/ ((module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _utils = __nccwpck_require__(7403);
/**
* Creates a circle out of an image.
* @param {function(Error, Jimp)} options (optional)
* opacity - opacity of the shadow between 0 and 1
* size,- of the shadow
* blur - how blurry the shadow is
* x- x position of shadow
* y - y position of shadow
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
* @returns {Jimp} this for chaining of methods
*/
var _default = () => ({
shadow() {
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
let cb = arguments.length > 1 ? arguments[1] : undefined;
if (typeof options === "function") {
cb = options;
options = {};
}
const {
opacity = 0.7,
size = 1.1,
x = -25,
y = 25,
blur = 5
} = options;
// clone the image
const orig = this.clone();
const shadow = this.clone();
// turn all it's pixels black
shadow.scan(0, 0, shadow.bitmap.width, shadow.bitmap.height, (x, y, idx) => {
shadow.bitmap.data[idx] = 0x00;
shadow.bitmap.data[idx + 1] = 0x00;
shadow.bitmap.data[idx + 2] = 0x00;
// up the opacity a little,
shadow.bitmap.data[idx + 3] = shadow.constructor.limit255(shadow.bitmap.data[idx + 3] * opacity);
this.bitmap.data[idx] = 0x00;
this.bitmap.data[idx + 1] = 0x00;
this.bitmap.data[idx + 2] = 0x00;
this.bitmap.data[idx + 3] = 0x00;
});
// enlarge it. This creates a "shadow".
shadow.resize(shadow.bitmap.width * size, shadow.bitmap.height * size).blur(blur);
// Then blit the "shadow" onto the background and the image on top of that.
this.composite(shadow, x, y);
this.composite(orig, 0, 0);
if ((0, _utils.isNodePattern)(cb)) {
cb.call(this, null, this);
}
return this;
}
});
exports["default"] = _default;
module.exports = exports.default;
module.exports["default"] = exports.default;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 897:
/***/ ((module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _utils = __nccwpck_require__(7403);
/**
* Applies a minimum color threshold to a greyscale image. Converts image to greyscale by default
* @param {number} options object
* max: A number auto limited between 0 - 255
* replace: (optional) A number auto limited between 0 - 255 (default 255)
* autoGreyscale: (optional) A boolean whether to apply greyscale beforehand (default true)
* @param {number} cb (optional) a callback for when complete
* @return {this} this for chaining of methods
*/
var _default = () => ({
threshold(_ref, cb) {
let {
max,
replace = 255,
autoGreyscale = true
} = _ref;
if (typeof max !== "number") {
return _utils.throwError.call(this, "max must be a number", cb);
}
if (typeof replace !== "number") {
return _utils.throwError.call(this, "replace must be a number", cb);
}
if (typeof autoGreyscale !== "boolean") {
return _utils.throwError.call(this, "autoGreyscale must be a boolean", cb);
}
max = this.constructor.limit255(max);
replace = this.constructor.limit255(replace);
if (autoGreyscale) {
this.greyscale();
}
this.scanQuiet(0, 0, this.bitmap.width, this.bitmap.height, (x, y, idx) => {
const grey = this.bitmap.data[idx] < max ? this.bitmap.data[idx] : replace;
this.bitmap.data[idx] = grey;
this.bitmap.data[idx + 1] = grey;
this.bitmap.data[idx + 2] = grey;
});
if ((0, _utils.isNodePattern)(cb)) {
cb.call(this, null, this);
}
return this;
}
});
exports["default"] = _default;
module.exports = exports.default;
module.exports["default"] = exports.default;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 4976:
/***/ ((module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _timm = __nccwpck_require__(3567);
var _pluginBlit = _interopRequireDefault(__nccwpck_require__(1485));
var _pluginBlur = _interopRequireDefault(__nccwpck_require__(6223));
var _pluginCircle = _interopRequireDefault(__nccwpck_require__(2005));
var _pluginColor = _interopRequireDefault(__nccwpck_require__(5432));
var _pluginContain = _interopRequireDefault(__nccwpck_require__(7125));
var _pluginCover = _interopRequireDefault(__nccwpck_require__(937));
var _pluginCrop = _interopRequireDefault(__nccwpck_require__(1623));
var _pluginDisplace = _interopRequireDefault(__nccwpck_require__(6096));
var _pluginDither = _interopRequireDefault(__nccwpck_require__(5808));
var _pluginFisheye = _interopRequireDefault(__nccwpck_require__(1885));
var _pluginFlip = _interopRequireDefault(__nccwpck_require__(2818));
var _pluginGaussian = _interopRequireDefault(__nccwpck_require__(2135));
var _pluginInvert = _interopRequireDefault(__nccwpck_require__(9534));
var _pluginMask = _interopRequireDefault(__nccwpck_require__(497));
var _pluginNormalize = _interopRequireDefault(__nccwpck_require__(7022));
var _pluginPrint = _interopRequireDefault(__nccwpck_require__(7996));
var _pluginResize = _interopRequireDefault(__nccwpck_require__(5555));
var _pluginRotate = _interopRequireDefault(__nccwpck_require__(6880));
var _pluginScale = _interopRequireDefault(__nccwpck_require__(8212));
var _pluginShadow = _interopRequireDefault(__nccwpck_require__(8178));
var _pluginThreshold = _interopRequireDefault(__nccwpck_require__(897));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const plugins = [_pluginBlit.default, _pluginBlur.default, _pluginCircle.default, _pluginColor.default, _pluginContain.default, _pluginCover.default, _pluginCrop.default, _pluginDisplace.default, _pluginDither.default, _pluginFisheye.default, _pluginFlip.default, _pluginGaussian.default, _pluginInvert.default, _pluginMask.default, _pluginNormalize.default, _pluginPrint.default, _pluginResize.default, _pluginRotate.default, _pluginScale.default, _pluginShadow.default, _pluginThreshold.default];
var _default = jimpEvChange => {
const initializedPlugins = plugins.map(pluginModule => {
let plugin = pluginModule(jimpEvChange) || {};
if (!plugin.class && !plugin.constants) {
// Default to class function
plugin = {
class: plugin
};
}
return plugin;
});
return (0, _timm.mergeDeep)(...initializedPlugins);
};
exports["default"] = _default;
module.exports = exports.default;
module.exports["default"] = exports.default;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 7657:
/***/ ((module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _pngjs = __nccwpck_require__(6413);
var _utils = __nccwpck_require__(7403);
const MIME_TYPE = "image/png";
// PNG filter types
const PNG_FILTER_AUTO = -1;
const PNG_FILTER_NONE = 0;
const PNG_FILTER_SUB = 1;
const PNG_FILTER_UP = 2;
const PNG_FILTER_AVERAGE = 3;
const PNG_FILTER_PATH = 4;
var _default = () => ({
mime: {
[MIME_TYPE]: ["png"]
},
constants: {
MIME_PNG: MIME_TYPE,
PNG_FILTER_AUTO,
PNG_FILTER_NONE,
PNG_FILTER_SUB,
PNG_FILTER_UP,
PNG_FILTER_AVERAGE,
PNG_FILTER_PATH
},
hasAlpha: {
[MIME_TYPE]: true
},
decoders: {
[MIME_TYPE]: _pngjs.PNG.sync.read
},
encoders: {
[MIME_TYPE](data) {
const png = new _pngjs.PNG({
width: data.bitmap.width,
height: data.bitmap.height
});
png.data = data.bitmap.data;
return _pngjs.PNG.sync.write(png, {
deflateLevel: data._deflateLevel,
deflateStrategy: data._deflateStrategy,
filterType: data._filterType,
colorType: typeof data._colorType === "number" ? data._colorType : data._rgba ? 6 : 2,
inputHasAlpha: data._rgba
});
}
},
class: {
_deflateLevel: 9,
_deflateStrategy: 3,
_filterType: PNG_FILTER_AUTO,
_colorType: null,
/**
* Sets the deflate level used when saving as PNG format (default is 9)
* @param {number} l Deflate level to use 0-9. 0 is no compression. 9 (default) is maximum compression.
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
* @returns {Jimp} this for chaining of methods
*/
deflateLevel(l, cb) {
if (typeof l !== "number") {
return _utils.throwError.call(this, "l must be a number", cb);
}
if (l < 0 || l > 9) {
return _utils.throwError.call(this, "l must be a number 0 - 9", cb);
}
this._deflateLevel = Math.round(l);
if ((0, _utils.isNodePattern)(cb)) {
cb.call(this, null, this);
}
return this;
},
/**
* Sets the deflate strategy used when saving as PNG format (default is 3)
* @param {number} s Deflate strategy to use 0-3.
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
* @returns {Jimp} this for chaining of methods
*/
deflateStrategy(s, cb) {
if (typeof s !== "number") {
return _utils.throwError.call(this, "s must be a number", cb);
}
if (s < 0 || s > 3) {
return _utils.throwError.call(this, "s must be a number 0 - 3", cb);
}
this._deflateStrategy = Math.round(s);
if ((0, _utils.isNodePattern)(cb)) {
cb.call(this, null, this);
}
return this;
},
/**
* Sets the filter type used when saving as PNG format (default is automatic filters)
* @param {number} f The quality to use -1-4.
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
* @returns {Jimp} this for chaining of methods
*/
filterType(f, cb) {
if (typeof f !== "number") {
return _utils.throwError.call(this, "n must be a number", cb);
}
if (f < -1 || f > 4) {
return _utils.throwError.call(this, "n must be -1 (auto) or a number 0 - 4", cb);
}
this._filterType = Math.round(f);
if ((0, _utils.isNodePattern)(cb)) {
cb.call(this, null, this);
}
return this;
},
/**
* Sets the color type used when saving as PNG format
* @param {number} s color type to use 0, 2, 4, 6.
* @param {function(Error, Jimp)} cb (optional) a callback for when complete
* @returns {Jimp} this for chaining of methods
*/
colorType(s, cb) {
if (typeof s !== "number") {
return _utils.throwError.call(this, "s must be a number", cb);
}
if (s !== 0 && s !== 2 && s !== 4 && s !== 6) {
return _utils.throwError.call(this, "s must be a number 0, 2, 4, 6.", cb);
}
this._colorType = Math.round(s);
if ((0, _utils.isNodePattern)(cb)) {
cb.call(this, null, this);
}
return this;
}
}
});
exports["default"] = _default;
module.exports = exports.default;
module.exports["default"] = exports.default;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 6447:
/***/ ((module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _utif = _interopRequireDefault(__nccwpck_require__(2783));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const MIME_TYPE = "image/tiff";
var _default = () => ({
mime: {
[MIME_TYPE]: ["tiff", "tif"]
},
constants: {
MIME_TIFF: MIME_TYPE
},
decoders: {
[MIME_TYPE]: data => {
const ifds = _utif.default.decode(data);
const page = ifds[0];
ifds.forEach(ifd => {
_utif.default.decodeImage(data, ifd);
});
const rgba = _utif.default.toRGBA8(page);
return {
data: Buffer.from(rgba),
width: page.t256[0],
height: page.t257[0]
};
}
},
encoders: {
[MIME_TYPE]: image => {
const tiff = _utif.default.encodeImage(image.bitmap.data, image.bitmap.width, image.bitmap.height);
return Buffer.from(tiff);
}
}
});
exports["default"] = _default;
module.exports = exports.default;
module.exports["default"] = exports.default;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 770:
/***/ ((module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _timm = __nccwpck_require__(3567);
var _jpeg = _interopRequireDefault(__nccwpck_require__(5177));
var _png = _interopRequireDefault(__nccwpck_require__(7657));
var _bmp = _interopRequireDefault(__nccwpck_require__(4858));
var _tiff = _interopRequireDefault(__nccwpck_require__(6447));
var _gif = _interopRequireDefault(__nccwpck_require__(8257));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var _default = () => (0, _timm.mergeDeep)((0, _jpeg.default)(), (0, _png.default)(), (0, _bmp.default)(), (0, _tiff.default)(), (0, _gif.default)());
exports["default"] = _default;
module.exports = exports.default;
module.exports["default"] = exports.default;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 7403:
/***/ ((__unused_webpack_module, exports) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.isNodePattern = isNodePattern;
exports.scan = scan;
exports.scanIterator = scanIterator;
exports.throwError = throwError;
function isNodePattern(cb) {
if (typeof cb === "undefined") {
return false;
}
if (typeof cb !== "function") {
throw new TypeError("Callback must be a function");
}
return true;
}
function throwError(error, cb) {
if (typeof error === "string") {
error = new Error(error);
}
if (typeof cb === "function") {
return cb.call(this, error);
}
throw error;
}
function scan(image, x, y, w, h, f) {
// round input
x = Math.round(x);
y = Math.round(y);
w = Math.round(w);
h = Math.round(h);
for (let _y = y; _y < y + h; _y++) {
for (let _x = x; _x < x + w; _x++) {
const idx = image.bitmap.width * _y + _x << 2;
f.call(image, _x, _y, idx);
}
}
return image;
}
function* scanIterator(image, x, y, w, h) {
// round input
x = Math.round(x);
y = Math.round(y);
w = Math.round(w);
h = Math.round(h);
for (let _y = y; _y < y + h; _y++) {
for (let _x = x; _x < x + w; _x++) {
const idx = image.bitmap.width * _y + _x << 2;
yield {
x: _x,
y: _y,
idx,
image
};
}
}
}
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 8720:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
var Converter = __nccwpck_require__(1605);
/**
* Function get source and destination alphabet and return convert function
*
* @param {string|Array} srcAlphabet
* @param {string|Array} dstAlphabet
*
* @returns {function(number|Array)}
*/
function anyBase(srcAlphabet, dstAlphabet) {
var converter = new Converter(srcAlphabet, dstAlphabet);
/**
* Convert function
*
* @param {string|Array} number
*
* @return {string|Array} number
*/
return function (number) {
return converter.convert(number);
}
};
anyBase.BIN = '01';
anyBase.OCT = '01234567';
anyBase.DEC = '0123456789';
anyBase.HEX = '0123456789abcdef';
module.exports = anyBase;
/***/ }),
/***/ 1605:
/***/ ((module) => {
"use strict";
/**
* Converter
*
* @param {string|Array} srcAlphabet
* @param {string|Array} dstAlphabet
* @constructor
*/
function Converter(srcAlphabet, dstAlphabet) {
if (!srcAlphabet || !dstAlphabet || !srcAlphabet.length || !dstAlphabet.length) {
throw new Error('Bad alphabet');
}
this.srcAlphabet = srcAlphabet;
this.dstAlphabet = dstAlphabet;
}
/**
* Convert number from source alphabet to destination alphabet
*
* @param {string|Array} number - number represented as a string or array of points
*
* @returns {string|Array}
*/
Converter.prototype.convert = function(number) {
var i, divide, newlen,
numberMap = {},
fromBase = this.srcAlphabet.length,
toBase = this.dstAlphabet.length,
length = number.length,
result = typeof number === 'string' ? '' : [];
if (!this.isValid(number)) {
throw new Error('Number "' + number + '" contains of non-alphabetic digits (' + this.srcAlphabet + ')');
}
if (this.srcAlphabet === this.dstAlphabet) {
return number;
}
for (i = 0; i < length; i++) {
numberMap[i] = this.srcAlphabet.indexOf(number[i]);
}
do {
divide = 0;
newlen = 0;
for (i = 0; i < length; i++) {
divide = divide * fromBase + numberMap[i];
if (divide >= toBase) {
numberMap[newlen++] = parseInt(divide / toBase, 10);
divide = divide % toBase;
} else if (newlen > 0) {
numberMap[newlen++] = 0;
}
}
length = newlen;
result = this.dstAlphabet.slice(divide, divide + 1).concat(result);
} while (newlen !== 0);
return result;
};
/**
* Valid number with source alphabet
*
* @param {number} number
*
* @returns {boolean}
*/
Converter.prototype.isValid = function(number) {
var i = 0;
for (; i < number.length; ++i) {
if (this.srcAlphabet.indexOf(number[i]) === -1) {
return false;
}
}
return true;
};
module.exports = Converter;
/***/ }),
/***/ 9030:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
/**
* @author shaozilee
*
* support 1bit 4bit 8bit 24bit decode
* encode with 24bit
*
*/
var encode = __nccwpck_require__(4551),
decode = __nccwpck_require__(2767);
module.exports = {
encode: encode,
decode: decode
};
/***/ }),
/***/ 2767:
/***/ ((module) => {
/**
* @author shaozilee
*
* Bmp format decoder,support 1bit 4bit 8bit 24bit bmp
*
*/
function BmpDecoder(buffer,is_with_alpha) {
this.pos = 0;
this.buffer = buffer;
this.is_with_alpha = !!is_with_alpha;
this.bottom_up = true;
this.flag = this.buffer.toString("utf-8", 0, this.pos += 2);
if (this.flag != "BM") throw new Error("Invalid BMP File");
this.parseHeader();
this.parseRGBA();
}
BmpDecoder.prototype.parseHeader = function() {
this.fileSize = this.buffer.readUInt32LE(this.pos);
this.pos += 4;
this.reserved = this.buffer.readUInt32LE(this.pos);
this.pos += 4;
this.offset = this.buffer.readUInt32LE(this.pos);
this.pos += 4;
this.headerSize = this.buffer.readUInt32LE(this.pos);
this.pos += 4;
this.width = this.buffer.readUInt32LE(this.pos);
this.pos += 4;
this.height = this.buffer.readInt32LE(this.pos);
this.pos += 4;
this.planes = this.buffer.readUInt16LE(this.pos);
this.pos += 2;
this.bitPP = this.buffer.readUInt16LE(this.pos);
this.pos += 2;
this.compress = this.buffer.readUInt32LE(this.pos);
this.pos += 4;
this.rawSize = this.buffer.readUInt32LE(this.pos);
this.pos += 4;
this.hr = this.buffer.readUInt32LE(this.pos);
this.pos += 4;
this.vr = this.buffer.readUInt32LE(this.pos);
this.pos += 4;
this.colors = this.buffer.readUInt32LE(this.pos);
this.pos += 4;
this.importantColors = this.buffer.readUInt32LE(this.pos);
this.pos += 4;
if(this.bitPP === 16 && this.is_with_alpha){
this.bitPP = 15
}
if (this.bitPP < 15) {
var len = this.colors === 0 ? 1 << this.bitPP : this.colors;
this.palette = new Array(len);
for (var i = 0; i < len; i++) {
var blue = this.buffer.readUInt8(this.pos++);
var green = this.buffer.readUInt8(this.pos++);
var red = this.buffer.readUInt8(this.pos++);
var quad = this.buffer.readUInt8(this.pos++);
this.palette[i] = {
red: red,
green: green,
blue: blue,
quad: quad
};
}
}
if(this.height < 0) {
this.height *= -1;
this.bottom_up = false;
}
}
BmpDecoder.prototype.parseRGBA = function() {
var bitn = "bit" + this.bitPP;
var len = this.width * this.height * 4;
this.data = new Buffer(len);
this[bitn]();
};
BmpDecoder.prototype.bit1 = function() {
var xlen = Math.ceil(this.width / 8);
var mode = xlen%4;
var y = this.height >= 0 ? this.height - 1 : -this.height
for (var y = this.height - 1; y >= 0; y--) {
var line = this.bottom_up ? y : this.height - 1 - y
for (var x = 0; x < xlen; x++) {
var b = this.buffer.readUInt8(this.pos++);
var location = line * this.width * 4 + x*8*4;
for (var i = 0; i < 8; i++) {
if(x*8+i<this.width){
var rgb = this.palette[((b>>(7-i))&0x1)];
this.data[location+i*4] = 0;
this.data[location+i*4 + 1] = rgb.blue;
this.data[location+i*4 + 2] = rgb.green;
this.data[location+i*4 + 3] = rgb.red;
}else{
break;
}
}
}
if (mode != 0){
this.pos+=(4 - mode);
}
}
};
BmpDecoder.prototype.bit4 = function() {
//RLE-4
if(this.compress == 2){
this.data.fill(0xff);
var location = 0;
var lines = this.bottom_up?this.height-1:0;
var low_nibble = false;//for all count of pixel
while(location<this.data.length){
var a = this.buffer.readUInt8(this.pos++);
var b = this.buffer.readUInt8(this.pos++);
//absolute mode
if(a == 0){
if(b == 0){//line end
if(this.bottom_up){
lines--;
}else{
lines++;
}
location = lines*this.width*4;
low_nibble = false;
continue;
}else if(b == 1){//image end
break;
}else if(b ==2){
//offset x,y
var x = this.buffer.readUInt8(this.pos++);
var y = this.buffer.readUInt8(this.pos++);
if(this.bottom_up){
lines-=y;
}else{
lines+=y;
}
location +=(y*this.width*4+x*4);
}else{
var c = this.buffer.readUInt8(this.pos++);
for(var i=0;i<b;i++){
if (low_nibble) {
setPixelData.call(this, (c & 0x0f));
} else {
setPixelData.call(this, (c & 0xf0)>>4);
}
if ((i & 1) && (i+1 < b)){
c = this.buffer.readUInt8(this.pos++);
}
low_nibble = !low_nibble;
}
if ((((b+1) >> 1) & 1 ) == 1){
this.pos++
}
}
}else{//encoded mode
for (var i = 0; i < a; i++) {
if (low_nibble) {
setPixelData.call(this, (b & 0x0f));
} else {
setPixelData.call(this, (b & 0xf0)>>4);
}
low_nibble = !low_nibble;
}
}
}
function setPixelData(rgbIndex){
var rgb = this.palette[rgbIndex];
this.data[location] = 0;
this.data[location + 1] = rgb.blue;
this.data[location + 2] = rgb.green;
this.data[location + 3] = rgb.red;
location+=4;
}
}else{
var xlen = Math.ceil(this.width/2);
var mode = xlen%4;
for (var y = this.height - 1; y >= 0; y--) {
var line = this.bottom_up ? y : this.height - 1 - y
for (var x = 0; x < xlen; x++) {
var b = this.buffer.readUInt8(this.pos++);
var location = line * this.width * 4 + x*2*4;
var before = b>>4;
var after = b&0x0F;
var rgb = this.palette[before];
this.data[location] = 0;
this.data[location + 1] = rgb.blue;
this.data[location + 2] = rgb.green;
this.data[location + 3] = rgb.red;
if(x*2+1>=this.width)break;
rgb = this.palette[after];
this.data[location+4] = 0;
this.data[location+4 + 1] = rgb.blue;
this.data[location+4 + 2] = rgb.green;
this.data[location+4 + 3] = rgb.red;
}
if (mode != 0){
this.pos+=(4 - mode);
}
}
}
};
BmpDecoder.prototype.bit8 = function() {
//RLE-8
if(this.compress == 1){
this.data.fill(0xff);
var location = 0;
var lines = this.bottom_up?this.height-1:0;
while(location<this.data.length){
var a = this.buffer.readUInt8(this.pos++);
var b = this.buffer.readUInt8(this.pos++);
//absolute mode
if(a == 0){
if(b == 0){//line end
if(this.bottom_up){
lines--;
}else{
lines++;
}
location = lines*this.width*4;
continue;
}else if(b == 1){//image end
break;
}else if(b ==2){
//offset x,y
var x = this.buffer.readUInt8(this.pos++);
var y = this.buffer.readUInt8(this.pos++);
if(this.bottom_up){
lines-=y;
}else{
lines+=y;
}
location +=(y*this.width*4+x*4);
}else{
for(var i=0;i<b;i++){
var c = this.buffer.readUInt8(this.pos++);
setPixelData.call(this, c);
}
if(b&1 == 1){
this.pos++;
}
}
}else{//encoded mode
for (var i = 0; i < a; i++) {
setPixelData.call(this, b);
}
}
}
function setPixelData(rgbIndex){
var rgb = this.palette[rgbIndex];
this.data[location] = 0;
this.data[location + 1] = rgb.blue;
this.data[location + 2] = rgb.green;
this.data[location + 3] = rgb.red;
location+=4;
}
}else {
var mode = this.width % 4;
for (var y = this.height - 1; y >= 0; y--) {
var line = this.bottom_up ? y : this.height - 1 - y
for (var x = 0; x < this.width; x++) {
var b = this.buffer.readUInt8(this.pos++);
var location = line * this.width * 4 + x * 4;
if (b < this.palette.length) {
var rgb = this.palette[b];
this.data[location] = 0;
this.data[location + 1] = rgb.blue;
this.data[location + 2] = rgb.green;
this.data[location + 3] = rgb.red;
} else {
this.data[location] = 0;
this.data[location + 1] = 0xFF;
this.data[location + 2] = 0xFF;
this.data[location + 3] = 0xFF;
}
}
if (mode != 0) {
this.pos += (4 - mode);
}
}
}
};
BmpDecoder.prototype.bit15 = function() {
var dif_w =this.width % 3;
var _11111 = parseInt("11111", 2),_1_5 = _11111;
for (var y = this.height - 1; y >= 0; y--) {
var line = this.bottom_up ? y : this.height - 1 - y
for (var x = 0; x < this.width; x++) {
var B = this.buffer.readUInt16LE(this.pos);
this.pos+=2;
var blue = (B & _1_5) / _1_5 * 255 | 0;
var green = (B >> 5 & _1_5 ) / _1_5 * 255 | 0;
var red = (B >> 10 & _1_5) / _1_5 * 255 | 0;
var alpha = (B>>15)?0xFF:0x00;
var location = line * this.width * 4 + x * 4;
this.data[location] = alpha;
this.data[location + 1] = blue;
this.data[location + 2] = green;
this.data[location + 3] = red;
}
//skip extra bytes
this.pos += dif_w;
}
};
BmpDecoder.prototype.bit16 = function() {
var dif_w =(this.width % 2)*2;
//default xrgb555
this.maskRed = 0x7C00;
this.maskGreen = 0x3E0;
this.maskBlue =0x1F;
this.mask0 = 0;
if(this.compress == 3){
this.maskRed = this.buffer.readUInt32LE(this.pos);
this.pos+=4;
this.maskGreen = this.buffer.readUInt32LE(this.pos);
this.pos+=4;
this.maskBlue = this.buffer.readUInt32LE(this.pos);
this.pos+=4;
this.mask0 = this.buffer.readUInt32LE(this.pos);
this.pos+=4;
}
var ns=[0,0,0];
for (var i=0;i<16;i++){
if ((this.maskRed>>i)&0x01) ns[0]++;
if ((this.maskGreen>>i)&0x01) ns[1]++;
if ((this.maskBlue>>i)&0x01) ns[2]++;
}
ns[1]+=ns[0]; ns[2]+=ns[1]; ns[0]=8-ns[0]; ns[1]-=8; ns[2]-=8;
for (var y = this.height - 1; y >= 0; y--) {
var line = this.bottom_up ? y : this.height - 1 - y;
for (var x = 0; x < this.width; x++) {
var B = this.buffer.readUInt16LE(this.pos);
this.pos+=2;
var blue = (B&this.maskBlue)<<ns[0];
var green = (B&this.maskGreen)>>ns[1];
var red = (B&this.maskRed)>>ns[2];
var location = line * this.width * 4 + x * 4;
this.data[location] = 0;
this.data[location + 1] = blue;
this.data[location + 2] = green;
this.data[location + 3] = red;
}
//skip extra bytes
this.pos += dif_w;
}
};
BmpDecoder.prototype.bit24 = function() {
for (var y = this.height - 1; y >= 0; y--) {
var line = this.bottom_up ? y : this.height - 1 - y
for (var x = 0; x < this.width; x++) {
//Little Endian rgb
var blue = this.buffer.readUInt8(this.pos++);
var green = this.buffer.readUInt8(this.pos++);
var red = this.buffer.readUInt8(this.pos++);
var location = line * this.width * 4 + x * 4;
this.data[location] = 0;
this.data[location + 1] = blue;
this.data[location + 2] = green;
this.data[location + 3] = red;
}
//skip extra bytes
this.pos += (this.width % 4);
}
};
/**
* add 32bit decode func
* @author soubok
*/
BmpDecoder.prototype.bit32 = function() {
//BI_BITFIELDS
if(this.compress == 3){
this.maskRed = this.buffer.readUInt32LE(this.pos);
this.pos+=4;
this.maskGreen = this.buffer.readUInt32LE(this.pos);
this.pos+=4;
this.maskBlue = this.buffer.readUInt32LE(this.pos);
this.pos+=4;
this.mask0 = this.buffer.readUInt32LE(this.pos);
this.pos+=4;
for (var y = this.height - 1; y >= 0; y--) {
var line = this.bottom_up ? y : this.height - 1 - y;
for (var x = 0; x < this.width; x++) {
//Little Endian rgba
var alpha = this.buffer.readUInt8(this.pos++);
var blue = this.buffer.readUInt8(this.pos++);
var green = this.buffer.readUInt8(this.pos++);
var red = this.buffer.readUInt8(this.pos++);
var location = line * this.width * 4 + x * 4;
this.data[location] = alpha;
this.data[location + 1] = blue;
this.data[location + 2] = green;
this.data[location + 3] = red;
}
}
}else{
for (var y = this.height - 1; y >= 0; y--) {
var line = this.bottom_up ? y : this.height - 1 - y;
for (var x = 0; x < this.width; x++) {
//Little Endian argb
var blue = this.buffer.readUInt8(this.pos++);
var green = this.buffer.readUInt8(this.pos++);
var red = this.buffer.readUInt8(this.pos++);
var alpha = this.buffer.readUInt8(this.pos++);
var location = line * this.width * 4 + x * 4;
this.data[location] = alpha;
this.data[location + 1] = blue;
this.data[location + 2] = green;
this.data[location + 3] = red;
}
}
}
};
BmpDecoder.prototype.getData = function() {
return this.data;
};
module.exports = function(bmpData) {
var decoder = new BmpDecoder(bmpData);
return decoder;
};
/***/ }),
/***/ 4551:
/***/ ((module) => {
/**
* @author shaozilee
*
* BMP format encoder,encode 24bit BMP
* Not support quality compression
*
*/
function BmpEncoder(imgData){
this.buffer = imgData.data;
this.width = imgData.width;
this.height = imgData.height;
this.extraBytes = this.width%4;
this.rgbSize = this.height*(3*this.width+this.extraBytes);
this.headerInfoSize = 40;
this.data = [];
/******************header***********************/
this.flag = "BM";
this.reserved = 0;
this.offset = 54;
this.fileSize = this.rgbSize+this.offset;
this.planes = 1;
this.bitPP = 24;
this.compress = 0;
this.hr = 0;
this.vr = 0;
this.colors = 0;
this.importantColors = 0;
}
BmpEncoder.prototype.encode = function() {
var tempBuffer = new Buffer(this.offset+this.rgbSize);
this.pos = 0;
tempBuffer.write(this.flag,this.pos,2);this.pos+=2;
tempBuffer.writeUInt32LE(this.fileSize,this.pos);this.pos+=4;
tempBuffer.writeUInt32LE(this.reserved,this.pos);this.pos+=4;
tempBuffer.writeUInt32LE(this.offset,this.pos);this.pos+=4;
tempBuffer.writeUInt32LE(this.headerInfoSize,this.pos);this.pos+=4;
tempBuffer.writeUInt32LE(this.width,this.pos);this.pos+=4;
tempBuffer.writeInt32LE(-this.height,this.pos);this.pos+=4;
tempBuffer.writeUInt16LE(this.planes,this.pos);this.pos+=2;
tempBuffer.writeUInt16LE(this.bitPP,this.pos);this.pos+=2;
tempBuffer.writeUInt32LE(this.compress,this.pos);this.pos+=4;
tempBuffer.writeUInt32LE(this.rgbSize,this.pos);this.pos+=4;
tempBuffer.writeUInt32LE(this.hr,this.pos);this.pos+=4;
tempBuffer.writeUInt32LE(this.vr,this.pos);this.pos+=4;
tempBuffer.writeUInt32LE(this.colors,this.pos);this.pos+=4;
tempBuffer.writeUInt32LE(this.importantColors,this.pos);this.pos+=4;
var i=0;
var rowBytes = 3*this.width+this.extraBytes;
for (var y = 0; y <this.height; y++){
for (var x = 0; x < this.width; x++){
var p = this.pos+y*rowBytes+x*3;
i++;//a
tempBuffer[p]= this.buffer[i++];//b
tempBuffer[p+1] = this.buffer[i++];//g
tempBuffer[p+2] = this.buffer[i++];//r
}
if(this.extraBytes>0){
var fillOffset = this.pos+y*rowBytes+this.width*3;
tempBuffer.fill(0,fillOffset,fillOffset+this.extraBytes);
}
}
return tempBuffer;
};
module.exports = function(imgData, quality) {
if (typeof quality === 'undefined') quality = 100;
var encoder = new BmpEncoder(imgData);
var data = encoder.encode();
return {
data: data,
width: imgData.width,
height: imgData.height
};
};
/***/ }),
/***/ 4664:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
var Buffer = (__nccwpck_require__(4300).Buffer); // for use with browserify
module.exports = function (a, b) {
if (!Buffer.isBuffer(a)) return undefined;
if (!Buffer.isBuffer(b)) return undefined;
if (typeof a.equals === 'function') return a.equals(b);
if (a.length !== b.length) return false;
for (var i = 0; i < a.length; i++) {
if (a[i] !== b[i]) return false;
}
return true;
};
/***/ }),
/***/ 6621:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
var Parser = __nccwpck_require__(4898);
function getGlobal() {
return (1,eval)('this');
}
module.exports = {
create: function(buffer, global) {
global = global || getGlobal();
if(buffer instanceof global.ArrayBuffer) {
var DOMBufferStream = __nccwpck_require__(4674);
return new Parser(new DOMBufferStream(buffer, 0, buffer.byteLength, true, global));
} else {
var NodeBufferStream = __nccwpck_require__(7525);
return new Parser(new NodeBufferStream(buffer, 0, buffer.length, true));
}
}
};
/***/ }),
/***/ 7525:
/***/ ((module) => {
function BufferStream(buffer, offset, length, bigEndian) {
this.buffer = buffer;
this.offset = offset || 0;
length = typeof length === 'number' ? length : buffer.length;
this.endPosition = this.offset + length;
this.setBigEndian(bigEndian);
}
BufferStream.prototype = {
setBigEndian: function(bigEndian) {
this.bigEndian = !!bigEndian;
},
nextUInt8: function() {
var value = this.buffer.readUInt8(this.offset);
this.offset += 1;
return value;
},
nextInt8: function() {
var value = this.buffer.readInt8(this.offset);
this.offset += 1;
return value;
},
nextUInt16: function() {
var value = this.bigEndian ? this.buffer.readUInt16BE(this.offset) : this.buffer.readUInt16LE(this.offset);
this.offset += 2;
return value;
},
nextUInt32: function() {
var value = this.bigEndian ? this.buffer.readUInt32BE(this.offset) : this.buffer.readUInt32LE(this.offset);
this.offset += 4;
return value;
},
nextInt16: function() {
var value = this.bigEndian ? this.buffer.readInt16BE(this.offset) : this.buffer.readInt16LE(this.offset);
this.offset += 2;
return value;
},
nextInt32: function() {
var value = this.bigEndian ? this.buffer.readInt32BE(this.offset) : this.buffer.readInt32LE(this.offset);
this.offset += 4;
return value;
},
nextFloat: function() {
var value = this.bigEndian ? this.buffer.readFloatBE(this.offset) : this.buffer.readFloatLE(this.offset);
this.offset += 4;
return value;
},
nextDouble: function() {
var value = this.bigEndian ? this.buffer.readDoubleBE(this.offset) : this.buffer.readDoubleLE(this.offset);
this.offset += 8;
return value;
},
nextBuffer: function(length) {
var value = this.buffer.slice(this.offset, this.offset + length);
this.offset += length;
return value;
},
remainingLength: function() {
return this.endPosition - this.offset;
},
nextString: function(length) {
var value = this.buffer.toString('utf8', this.offset, this.offset + length);
this.offset += length;
return value;
},
mark: function() {
var self = this;
return {
openWithOffset: function(offset) {
offset = (offset || 0) + this.offset;
return new BufferStream(self.buffer, offset, self.endPosition - offset, self.bigEndian);
},
offset: this.offset
};
},
offsetFrom: function(marker) {
return this.offset - marker.offset;
},
skip: function(amount) {
this.offset += amount;
},
branch: function(offset, length) {
length = typeof length === 'number' ? length : this.endPosition - (this.offset + offset);
return new BufferStream(this.buffer, this.offset + offset, length, this.bigEndian);
}
};
module.exports = BufferStream;
/***/ }),
/***/ 610:
/***/ ((module) => {
function parseNumber(s) {
return parseInt(s, 10);
}
//in seconds
var hours = 3600;
var minutes = 60;
//take date (year, month, day) and time (hour, minutes, seconds) digits in UTC
//and return a timestamp in seconds
function parseDateTimeParts(dateParts, timeParts) {
dateParts = dateParts.map(parseNumber);
timeParts = timeParts.map(parseNumber);
var year = dateParts[0];
var month = dateParts[1] - 1;
var day = dateParts[2];
var hours = timeParts[0];
var minutes = timeParts[1];
var seconds = timeParts[2];
var date = Date.UTC(year, month, day, hours, minutes, seconds, 0);
var timestamp = date / 1000;
return timestamp;
}
//parse date with "2004-09-04T23:39:06-08:00" format,
//one of the formats supported by ISO 8601, and
//convert to utc timestamp in seconds
function parseDateWithTimezoneFormat(dateTimeStr) {
var dateParts = dateTimeStr.substr(0, 10).split('-');
var timeParts = dateTimeStr.substr(11, 8).split(':');
var timezoneStr = dateTimeStr.substr(19, 6);
var timezoneParts = timezoneStr.split(':').map(parseNumber);
var timezoneOffset = (timezoneParts[0] * hours) +
(timezoneParts[1] * minutes);
var timestamp = parseDateTimeParts(dateParts, timeParts);
//minus because the timezoneOffset describes
//how much the described time is ahead of UTC
timestamp -= timezoneOffset;
if(typeof timestamp === 'number' && !isNaN(timestamp)) {
return timestamp;
}
}
//parse date with "YYYY:MM:DD hh:mm:ss" format, convert to utc timestamp in seconds
function parseDateWithSpecFormat(dateTimeStr) {
var parts = dateTimeStr.split(' '),
dateParts = parts[0].split(':'),
timeParts = parts[1].split(':');
var timestamp = parseDateTimeParts(dateParts, timeParts);
if(typeof timestamp === 'number' && !isNaN(timestamp)) {
return timestamp;
}
}
function parseExifDate(dateTimeStr) {
//some easy checks to determine two common date formats
//is the date in the standard "YYYY:MM:DD hh:mm:ss" format?
var isSpecFormat = dateTimeStr.length === 19 &&
dateTimeStr.charAt(4) === ':';
//is the date in the non-standard format,
//"2004-09-04T23:39:06-08:00" to include a timezone?
var isTimezoneFormat = dateTimeStr.length === 25 &&
dateTimeStr.charAt(10) === 'T';
var timestamp;
if(isTimezoneFormat) {
return parseDateWithTimezoneFormat(dateTimeStr);
}
else if(isSpecFormat) {
return parseDateWithSpecFormat(dateTimeStr);
}
}
module.exports = {
parseDateWithSpecFormat: parseDateWithSpecFormat,
parseDateWithTimezoneFormat: parseDateWithTimezoneFormat,
parseExifDate: parseExifDate
};
/***/ }),
/***/ 4674:
/***/ ((module) => {
/*jslint browser: true, devel: true, bitwise: false, debug: true, eqeq: false, es5: true, evil: false, forin: false, newcap: false, nomen: true, plusplus: true, regexp: false, unparam: false, sloppy: true, stupid: false, sub: false, todo: true, vars: true, white: true */
function DOMBufferStream(arrayBuffer, offset, length, bigEndian, global, parentOffset) {
this.global = global;
offset = offset || 0;
length = length || (arrayBuffer.byteLength - offset);
this.arrayBuffer = arrayBuffer.slice(offset, offset + length);
this.view = new global.DataView(this.arrayBuffer, 0, this.arrayBuffer.byteLength);
this.setBigEndian(bigEndian);
this.offset = 0;
this.parentOffset = (parentOffset || 0) + offset;
}
DOMBufferStream.prototype = {
setBigEndian: function(bigEndian) {
this.littleEndian = !bigEndian;
},
nextUInt8: function() {
var value = this.view.getUint8(this.offset);
this.offset += 1;
return value;
},
nextInt8: function() {
var value = this.view.getInt8(this.offset);
this.offset += 1;
return value;
},
nextUInt16: function() {
var value = this.view.getUint16(this.offset, this.littleEndian);
this.offset += 2;
return value;
},
nextUInt32: function() {
var value = this.view.getUint32(this.offset, this.littleEndian);
this.offset += 4;
return value;
},
nextInt16: function() {
var value = this.view.getInt16(this.offset, this.littleEndian);
this.offset += 2;
return value;
},
nextInt32: function() {
var value = this.view.getInt32(this.offset, this.littleEndian);
this.offset += 4;
return value;
},
nextFloat: function() {
var value = this.view.getFloat32(this.offset, this.littleEndian);
this.offset += 4;
return value;
},
nextDouble: function() {
var value = this.view.getFloat64(this.offset, this.littleEndian);
this.offset += 8;
return value;
},
nextBuffer: function(length) {
//this won't work in IE10
var value = this.arrayBuffer.slice(this.offset, this.offset + length);
this.offset += length;
return value;
},
remainingLength: function() {
return this.arrayBuffer.byteLength - this.offset;
},
nextString: function(length) {
var value = this.arrayBuffer.slice(this.offset, this.offset + length);
value = String.fromCharCode.apply(null, new this.global.Uint8Array(value));
this.offset += length;
return value;
},
mark: function() {
var self = this;
return {
openWithOffset: function(offset) {
offset = (offset || 0) + this.offset;
return new DOMBufferStream(self.arrayBuffer, offset, self.arrayBuffer.byteLength - offset, !self.littleEndian, self.global, self.parentOffset);
},
offset: this.offset,
getParentOffset: function() {
return self.parentOffset;
}
};
},
offsetFrom: function(marker) {
return this.parentOffset + this.offset - (marker.offset + marker.getParentOffset());
},
skip: function(amount) {
this.offset += amount;
},
branch: function(offset, length) {
length = typeof length === 'number' ? length : this.arrayBuffer.byteLength - (this.offset + offset);
return new DOMBufferStream(this.arrayBuffer, this.offset + offset, length, !this.littleEndian, this.global, this.parentOffset);
}
};
module.exports = DOMBufferStream;
/***/ }),
/***/ 1494:
/***/ ((module) => {
module.exports = {
exif : {
0x0001 : "InteropIndex",
0x0002 : "InteropVersion",
0x000B : "ProcessingSoftware",
0x00FE : "SubfileType",
0x00FF : "OldSubfileType",
0x0100 : "ImageWidth",
0x0101 : "ImageHeight",
0x0102 : "BitsPerSample",
0x0103 : "Compression",
0x0106 : "PhotometricInterpretation",
0x0107 : "Thresholding",
0x0108 : "CellWidth",
0x0109 : "CellLength",
0x010A : "FillOrder",
0x010D : "DocumentName",
0x010E : "ImageDescription",
0x010F : "Make",
0x0110 : "Model",
0x0111 : "StripOffsets",
0x0112 : "Orientation",
0x0115 : "SamplesPerPixel",
0x0116 : "RowsPerStrip",
0x0117 : "StripByteCounts",
0x0118 : "MinSampleValue",
0x0119 : "MaxSampleValue",
0x011A : "XResolution",
0x011B : "YResolution",
0x011C : "PlanarConfiguration",
0x011D : "PageName",
0x011E : "XPosition",
0x011F : "YPosition",
0x0120 : "FreeOffsets",
0x0121 : "FreeByteCounts",
0x0122 : "GrayResponseUnit",
0x0123 : "GrayResponseCurve",
0x0124 : "T4Options",
0x0125 : "T6Options",
0x0128 : "ResolutionUnit",
0x0129 : "PageNumber",
0x012C : "ColorResponseUnit",
0x012D : "TransferFunction",
0x0131 : "Software",
0x0132 : "ModifyDate",
0x013B : "Artist",
0x013C : "HostComputer",
0x013D : "Predictor",
0x013E : "WhitePoint",
0x013F : "PrimaryChromaticities",
0x0140 : "ColorMap",
0x0141 : "HalftoneHints",
0x0142 : "TileWidth",
0x0143 : "TileLength",
0x0144 : "TileOffsets",
0x0145 : "TileByteCounts",
0x0146 : "BadFaxLines",
0x0147 : "CleanFaxData",
0x0148 : "ConsecutiveBadFaxLines",
0x014A : "SubIFD",
0x014C : "InkSet",
0x014D : "InkNames",
0x014E : "NumberofInks",
0x0150 : "DotRange",
0x0151 : "TargetPrinter",
0x0152 : "ExtraSamples",
0x0153 : "SampleFormat",
0x0154 : "SMinSampleValue",
0x0155 : "SMaxSampleValue",
0x0156 : "TransferRange",
0x0157 : "ClipPath",
0x0158 : "XClipPathUnits",
0x0159 : "YClipPathUnits",
0x015A : "Indexed",
0x015B : "JPEGTables",
0x015F : "OPIProxy",
0x0190 : "GlobalParametersIFD",
0x0191 : "ProfileType",
0x0192 : "FaxProfile",
0x0193 : "CodingMethods",
0x0194 : "VersionYear",
0x0195 : "ModeNumber",
0x01B1 : "Decode",
0x01B2 : "DefaultImageColor",
0x01B3 : "T82Options",
0x01B5 : "JPEGTables",
0x0200 : "JPEGProc",
0x0201 : "ThumbnailOffset",
0x0202 : "ThumbnailLength",
0x0203 : "JPEGRestartInterval",
0x0205 : "JPEGLosslessPredictors",
0x0206 : "JPEGPointTransforms",
0x0207 : "JPEGQTables",
0x0208 : "JPEGDCTables",
0x0209 : "JPEGACTables",
0x0211 : "YCbCrCoefficients",
0x0212 : "YCbCrSubSampling",
0x0213 : "YCbCrPositioning",
0x0214 : "ReferenceBlackWhite",
0x022F : "StripRowCounts",
0x02BC : "ApplicationNotes",
0x03E7 : "USPTOMiscellaneous",
0x1000 : "RelatedImageFileFormat",
0x1001 : "RelatedImageWidth",
0x1002 : "RelatedImageHeight",
0x4746 : "Rating",
0x4747 : "XP_DIP_XML",
0x4748 : "StitchInfo",
0x4749 : "RatingPercent",
0x800D : "ImageID",
0x80A3 : "WangTag1",
0x80A4 : "WangAnnotation",
0x80A5 : "WangTag3",
0x80A6 : "WangTag4",
0x80E3 : "Matteing",
0x80E4 : "DataType",
0x80E5 : "ImageDepth",
0x80E6 : "TileDepth",
0x827D : "Model2",
0x828D : "CFARepeatPatternDim",
0x828E : "CFAPattern2",
0x828F : "BatteryLevel",
0x8290 : "KodakIFD",
0x8298 : "Copyright",
0x829A : "ExposureTime",
0x829D : "FNumber",
0x82A5 : "MDFileTag",
0x82A6 : "MDScalePixel",
0x82A7 : "MDColorTable",
0x82A8 : "MDLabName",
0x82A9 : "MDSampleInfo",
0x82AA : "MDPrepDate",
0x82AB : "MDPrepTime",
0x82AC : "MDFileUnits",
0x830E : "PixelScale",
0x8335 : "AdventScale",
0x8336 : "AdventRevision",
0x835C : "UIC1Tag",
0x835D : "UIC2Tag",
0x835E : "UIC3Tag",
0x835F : "UIC4Tag",
0x83BB : "IPTC-NAA",
0x847E : "IntergraphPacketData",
0x847F : "IntergraphFlagRegisters",
0x8480 : "IntergraphMatrix",
0x8481 : "INGRReserved",
0x8482 : "ModelTiePoint",
0x84E0 : "Site",
0x84E1 : "ColorSequence",
0x84E2 : "IT8Header",
0x84E3 : "RasterPadding",
0x84E4 : "BitsPerRunLength",
0x84E5 : "BitsPerExtendedRunLength",
0x84E6 : "ColorTable",
0x84E7 : "ImageColorIndicator",
0x84E8 : "BackgroundColorIndicator",
0x84E9 : "ImageColorValue",
0x84EA : "BackgroundColorValue",
0x84EB : "PixelIntensityRange",
0x84EC : "TransparencyIndicator",
0x84ED : "ColorCharacterization",
0x84EE : "HCUsage",
0x84EF : "TrapIndicator",
0x84F0 : "CMYKEquivalent",
0x8546 : "SEMInfo",
0x8568 : "AFCP_IPTC",
0x85B8 : "PixelMagicJBIGOptions",
0x85D8 : "ModelTransform",
0x8602 : "WB_GRGBLevels",
0x8606 : "LeafData",
0x8649 : "PhotoshopSettings",
0x8769 : "ExifOffset",
0x8773 : "ICC_Profile",
0x877F : "TIFF_FXExtensions",
0x8780 : "MultiProfiles",
0x8781 : "SharedData",
0x8782 : "T88Options",
0x87AC : "ImageLayer",
0x87AF : "GeoTiffDirectory",
0x87B0 : "GeoTiffDoubleParams",
0x87B1 : "GeoTiffAsciiParams",
0x8822 : "ExposureProgram",
0x8824 : "SpectralSensitivity",
0x8825 : "GPSInfo",
0x8827 : "ISO",
0x8828 : "Opto-ElectricConvFactor",
0x8829 : "Interlace",
0x882A : "TimeZoneOffset",
0x882B : "SelfTimerMode",
0x8830 : "SensitivityType",
0x8831 : "StandardOutputSensitivity",
0x8832 : "RecommendedExposureIndex",
0x8833 : "ISOSpeed",
0x8834 : "ISOSpeedLatitudeyyy",
0x8835 : "ISOSpeedLatitudezzz",
0x885C : "FaxRecvParams",
0x885D : "FaxSubAddress",
0x885E : "FaxRecvTime",
0x888A : "LeafSubIFD",
0x9000 : "ExifVersion",
0x9003 : "DateTimeOriginal",
0x9004 : "CreateDate",
0x9101 : "ComponentsConfiguration",
0x9102 : "CompressedBitsPerPixel",
0x9201 : "ShutterSpeedValue",
0x9202 : "ApertureValue",
0x9203 : "BrightnessValue",
0x9204 : "ExposureCompensation",
0x9205 : "MaxApertureValue",
0x9206 : "SubjectDistance",
0x9207 : "MeteringMode",
0x9208 : "LightSource",
0x9209 : "Flash",
0x920A : "FocalLength",
0x920B : "FlashEnergy",
0x920C : "SpatialFrequencyResponse",
0x920D : "Noise",
0x920E : "FocalPlaneXResolution",
0x920F : "FocalPlaneYResolution",
0x9210 : "FocalPlaneResolutionUnit",
0x9211 : "ImageNumber",
0x9212 : "SecurityClassification",
0x9213 : "ImageHistory",
0x9214 : "SubjectArea",
0x9215 : "ExposureIndex",
0x9216 : "TIFF-EPStandardID",
0x9217 : "SensingMethod",
0x923A : "CIP3DataFile",
0x923B : "CIP3Sheet",
0x923C : "CIP3Side",
0x923F : "StoNits",
0x927C : "MakerNote",
0x9286 : "UserComment",
0x9290 : "SubSecTime",
0x9291 : "SubSecTimeOriginal",
0x9292 : "SubSecTimeDigitized",
0x932F : "MSDocumentText",
0x9330 : "MSPropertySetStorage",
0x9331 : "MSDocumentTextPosition",
0x935C : "ImageSourceData",
0x9C9B : "XPTitle",
0x9C9C : "XPComment",
0x9C9D : "XPAuthor",
0x9C9E : "XPKeywords",
0x9C9F : "XPSubject",
0xA000 : "FlashpixVersion",
0xA001 : "ColorSpace",
0xA002 : "ExifImageWidth",
0xA003 : "ExifImageHeight",
0xA004 : "RelatedSoundFile",
0xA005 : "InteropOffset",
0xA20B : "FlashEnergy",
0xA20C : "SpatialFrequencyResponse",
0xA20D : "Noise",
0xA20E : "FocalPlaneXResolution",
0xA20F : "FocalPlaneYResolution",
0xA210 : "FocalPlaneResolutionUnit",
0xA211 : "ImageNumber",
0xA212 : "SecurityClassification",
0xA213 : "ImageHistory",
0xA214 : "SubjectLocation",
0xA215 : "ExposureIndex",
0xA216 : "TIFF-EPStandardID",
0xA217 : "SensingMethod",
0xA300 : "FileSource",
0xA301 : "SceneType",
0xA302 : "CFAPattern",
0xA401 : "CustomRendered",
0xA402 : "ExposureMode",
0xA403 : "WhiteBalance",
0xA404 : "DigitalZoomRatio",
0xA405 : "FocalLengthIn35mmFormat",
0xA406 : "SceneCaptureType",
0xA407 : "GainControl",
0xA408 : "Contrast",
0xA409 : "Saturation",
0xA40A : "Sharpness",
0xA40B : "DeviceSettingDescription",
0xA40C : "SubjectDistanceRange",
0xA420 : "ImageUniqueID",
0xA430 : "OwnerName",
0xA431 : "SerialNumber",
0xA432 : "LensInfo",
0xA433 : "LensMake",
0xA434 : "LensModel",
0xA435 : "LensSerialNumber",
0xA480 : "GDALMetadata",
0xA481 : "GDALNoData",
0xA500 : "Gamma",
0xAFC0 : "ExpandSoftware",
0xAFC1 : "ExpandLens",
0xAFC2 : "ExpandFilm",
0xAFC3 : "ExpandFilterLens",
0xAFC4 : "ExpandScanner",
0xAFC5 : "ExpandFlashLamp",
0xBC01 : "PixelFormat",
0xBC02 : "Transformation",
0xBC03 : "Uncompressed",
0xBC04 : "ImageType",
0xBC80 : "ImageWidth",
0xBC81 : "ImageHeight",
0xBC82 : "WidthResolution",
0xBC83 : "HeightResolution",
0xBCC0 : "ImageOffset",
0xBCC1 : "ImageByteCount",
0xBCC2 : "AlphaOffset",
0xBCC3 : "AlphaByteCount",
0xBCC4 : "ImageDataDiscard",
0xBCC5 : "AlphaDataDiscard",
0xC427 : "OceScanjobDesc",
0xC428 : "OceApplicationSelector",
0xC429 : "OceIDNumber",
0xC42A : "OceImageLogic",
0xC44F : "Annotations",
0xC4A5 : "PrintIM",
0xC580 : "USPTOOriginalContentType",
0xC612 : "DNGVersion",
0xC613 : "DNGBackwardVersion",
0xC614 : "UniqueCameraModel",
0xC615 : "LocalizedCameraModel",
0xC616 : "CFAPlaneColor",
0xC617 : "CFALayout",
0xC618 : "LinearizationTable",
0xC619 : "BlackLevelRepeatDim",
0xC61A : "BlackLevel",
0xC61B : "BlackLevelDeltaH",
0xC61C : "BlackLevelDeltaV",
0xC61D : "WhiteLevel",
0xC61E : "DefaultScale",
0xC61F : "DefaultCropOrigin",
0xC620 : "DefaultCropSize",
0xC621 : "ColorMatrix1",
0xC622 : "ColorMatrix2",
0xC623 : "CameraCalibration1",
0xC624 : "CameraCalibration2",
0xC625 : "ReductionMatrix1",
0xC626 : "ReductionMatrix2",
0xC627 : "AnalogBalance",
0xC628 : "AsShotNeutral",
0xC629 : "AsShotWhiteXY",
0xC62A : "BaselineExposure",
0xC62B : "BaselineNoise",
0xC62C : "BaselineSharpness",
0xC62D : "BayerGreenSplit",
0xC62E : "LinearResponseLimit",
0xC62F : "CameraSerialNumber",
0xC630 : "DNGLensInfo",
0xC631 : "ChromaBlurRadius",
0xC632 : "AntiAliasStrength",
0xC633 : "ShadowScale",
0xC634 : "DNGPrivateData",
0xC635 : "MakerNoteSafety",
0xC640 : "RawImageSegmentation",
0xC65A : "CalibrationIlluminant1",
0xC65B : "CalibrationIlluminant2",
0xC65C : "BestQualityScale",
0xC65D : "RawDataUniqueID",
0xC660 : "AliasLayerMetadata",
0xC68B : "OriginalRawFileName",
0xC68C : "OriginalRawFileData",
0xC68D : "ActiveArea",
0xC68E : "MaskedAreas",
0xC68F : "AsShotICCProfile",
0xC690 : "AsShotPreProfileMatrix",
0xC691 : "CurrentICCProfile",
0xC692 : "CurrentPreProfileMatrix",
0xC6BF : "ColorimetricReference",
0xC6D2 : "PanasonicTitle",
0xC6D3 : "PanasonicTitle2",
0xC6F3 : "CameraCalibrationSig",
0xC6F4 : "ProfileCalibrationSig",
0xC6F5 : "ProfileIFD",
0xC6F6 : "AsShotProfileName",
0xC6F7 : "NoiseReductionApplied",
0xC6F8 : "ProfileName",
0xC6F9 : "ProfileHueSatMapDims",
0xC6FA : "ProfileHueSatMapData1",
0xC6FB : "ProfileHueSatMapData2",
0xC6FC : "ProfileToneCurve",
0xC6FD : "ProfileEmbedPolicy",
0xC6FE : "ProfileCopyright",
0xC714 : "ForwardMatrix1",
0xC715 : "ForwardMatrix2",
0xC716 : "PreviewApplicationName",
0xC717 : "PreviewApplicationVersion",
0xC718 : "PreviewSettingsName",
0xC719 : "PreviewSettingsDigest",
0xC71A : "PreviewColorSpace",
0xC71B : "PreviewDateTime",
0xC71C : "RawImageDigest",
0xC71D : "OriginalRawFileDigest",
0xC71E : "SubTileBlockSize",
0xC71F : "RowInterleaveFactor",
0xC725 : "ProfileLookTableDims",
0xC726 : "ProfileLookTableData",
0xC740 : "OpcodeList1",
0xC741 : "OpcodeList2",
0xC74E : "OpcodeList3",
0xC761 : "NoiseProfile",
0xC763 : "TimeCodes",
0xC764 : "FrameRate",
0xC772 : "TStop",
0xC789 : "ReelName",
0xC791 : "OriginalDefaultFinalSize",
0xC792 : "OriginalBestQualitySize",
0xC793 : "OriginalDefaultCropSize",
0xC7A1 : "CameraLabel",
0xC7A3 : "ProfileHueSatMapEncoding",
0xC7A4 : "ProfileLookTableEncoding",
0xC7A5 : "BaselineExposureOffset",
0xC7A6 : "DefaultBlackRender",
0xC7A7 : "NewRawImageDigest",
0xC7A8 : "RawToPreviewGain",
0xC7B5 : "DefaultUserCrop",
0xEA1C : "Padding",
0xEA1D : "OffsetSchema",
0xFDE8 : "OwnerName",
0xFDE9 : "SerialNumber",
0xFDEA : "Lens",
0xFE00 : "KDC_IFD",
0xFE4C : "RawFile",
0xFE4D : "Converter",
0xFE4E : "WhiteBalance",
0xFE51 : "Exposure",
0xFE52 : "Shadows",
0xFE53 : "Brightness",
0xFE54 : "Contrast",
0xFE55 : "Saturation",
0xFE56 : "Sharpness",
0xFE57 : "Smoothness",
0xFE58 : "MoireFilter"
},
gps : {
0x0000 : 'GPSVersionID',
0x0001 : 'GPSLatitudeRef',
0x0002 : 'GPSLatitude',
0x0003 : 'GPSLongitudeRef',
0x0004 : 'GPSLongitude',
0x0005 : 'GPSAltitudeRef',
0x0006 : 'GPSAltitude',
0x0007 : 'GPSTimeStamp',
0x0008 : 'GPSSatellites',
0x0009 : 'GPSStatus',
0x000A : 'GPSMeasureMode',
0x000B : 'GPSDOP',
0x000C : 'GPSSpeedRef',
0x000D : 'GPSSpeed',
0x000E : 'GPSTrackRef',
0x000F : 'GPSTrack',
0x0010 : 'GPSImgDirectionRef',
0x0011 : 'GPSImgDirection',
0x0012 : 'GPSMapDatum',
0x0013 : 'GPSDestLatitudeRef',
0x0014 : 'GPSDestLatitude',
0x0015 : 'GPSDestLongitudeRef',
0x0016 : 'GPSDestLongitude',
0x0017 : 'GPSDestBearingRef',
0x0018 : 'GPSDestBearing',
0x0019 : 'GPSDestDistanceRef',
0x001A : 'GPSDestDistance',
0x001B : 'GPSProcessingMethod',
0x001C : 'GPSAreaInformation',
0x001D : 'GPSDateStamp',
0x001E : 'GPSDifferential',
0x001F : 'GPSHPositioningError'
}
};
/***/ }),
/***/ 5506:
/***/ ((module) => {
/*jslint browser: true, devel: true, bitwise: false, debug: true, eqeq: false, es5: true, evil: false, forin: false, newcap: false, nomen: true, plusplus: true, regexp: false, unparam: false, sloppy: true, stupid: false, sub: false, todo: true, vars: true, white: true */
function readExifValue(format, stream) {
switch(format) {
case 1: return stream.nextUInt8();
case 3: return stream.nextUInt16();
case 4: return stream.nextUInt32();
case 5: return [stream.nextUInt32(), stream.nextUInt32()];
case 6: return stream.nextInt8();
case 8: return stream.nextUInt16();
case 9: return stream.nextUInt32();
case 10: return [stream.nextInt32(), stream.nextInt32()];
case 11: return stream.nextFloat();
case 12: return stream.nextDouble();
default: throw new Error('Invalid format while decoding: ' + format);
}
}
function getBytesPerComponent(format) {
switch(format) {
case 1:
case 2:
case 6:
case 7:
return 1;
case 3:
case 8:
return 2;
case 4:
case 9:
case 11:
return 4;
case 5:
case 10:
case 12:
return 8;
default:
return 0;
}
}
function readExifTag(tiffMarker, stream) {
var tagType = stream.nextUInt16(),
format = stream.nextUInt16(),
bytesPerComponent = getBytesPerComponent(format),
components = stream.nextUInt32(),
valueBytes = bytesPerComponent * components,
values,
value,
c;
/* if the value is bigger then 4 bytes, the value is in the data section of the IFD
and the value present in the tag is the offset starting from the tiff header. So we replace the stream
with a stream that is located at the given offset in the data section. s*/
if(valueBytes > 4) {
stream = tiffMarker.openWithOffset(stream.nextUInt32());
}
//we don't want to read strings as arrays
if(format === 2) {
values = stream.nextString(components);
//cut off \0 characters
var lastNull = values.indexOf('\0');
if(lastNull !== -1) {
values = values.substr(0, lastNull);
}
}
else if(format === 7) {
values = stream.nextBuffer(components);
}
else if(format !== 0) {
values = [];
for(c = 0; c < components; ++c) {
values.push(readExifValue(format, stream));
}
}
//since our stream is a stateful object, we need to skip remaining bytes
//so our offset stays correct
if(valueBytes < 4) {
stream.skip(4 - valueBytes);
}
return [tagType, values, format];
}
function readIFDSection(tiffMarker, stream, iterator) {
var numberOfEntries = stream.nextUInt16(), tag, i;
for(i = 0; i < numberOfEntries; ++i) {
tag = readExifTag(tiffMarker, stream);
iterator(tag[0], tag[1], tag[2]);
}
}
function readHeader(stream) {
var exifHeader = stream.nextString(6);
if(exifHeader !== 'Exif\0\0') {
throw new Error('Invalid EXIF header');
}
var tiffMarker = stream.mark();
var tiffHeader = stream.nextUInt16();
if(tiffHeader === 0x4949) {
stream.setBigEndian(false);
} else if(tiffHeader === 0x4D4D) {
stream.setBigEndian(true);
} else {
throw new Error('Invalid TIFF header');
}
if(stream.nextUInt16() !== 0x002A) {
throw new Error('Invalid TIFF data');
}
return tiffMarker;
}
module.exports = {
IFD0: 1,
IFD1: 2,
GPSIFD: 3,
SubIFD: 4,
InteropIFD: 5,
parseTags: function(stream, iterator) {
var tiffMarker;
try {
tiffMarker = readHeader(stream);
} catch(e) {
return false; //ignore APP1 sections with invalid headers
}
var subIfdOffset, gpsOffset, interopOffset;
var ifd0Stream = tiffMarker.openWithOffset(stream.nextUInt32()),
IFD0 = this.IFD0;
readIFDSection(tiffMarker, ifd0Stream, function(tagType, value, format) {
switch(tagType) {
case 0x8825: gpsOffset = value[0]; break;
case 0x8769: subIfdOffset = value[0]; break;
default: iterator(IFD0, tagType, value, format); break;
}
});
var ifd1Offset = ifd0Stream.nextUInt32();
if(ifd1Offset !== 0) {
var ifd1Stream = tiffMarker.openWithOffset(ifd1Offset);
readIFDSection(tiffMarker, ifd1Stream, iterator.bind(null, this.IFD1));
}
if(gpsOffset) {
var gpsStream = tiffMarker.openWithOffset(gpsOffset);
readIFDSection(tiffMarker, gpsStream, iterator.bind(null, this.GPSIFD));
}
if(subIfdOffset) {
var subIfdStream = tiffMarker.openWithOffset(subIfdOffset), InteropIFD = this.InteropIFD;
readIFDSection(tiffMarker, subIfdStream, function(tagType, value, format) {
if(tagType === 0xA005) {
interopOffset = value[0];
} else {
iterator(InteropIFD, tagType, value, format);
}
});
}
if(interopOffset) {
var interopStream = tiffMarker.openWithOffset(interopOffset);
readIFDSection(tiffMarker, interopStream, iterator.bind(null, this.InteropIFD));
}
return true;
}
};
/***/ }),
/***/ 1659:
/***/ ((module) => {
/*jslint browser: true, devel: true, bitwise: false, debug: true, eqeq: false, es5: true, evil: false, forin: false, newcap: false, nomen: true, plusplus: true, regexp: false, unparam: false, sloppy: true, stupid: false, sub: false, todo: true, vars: true, white: true */
module.exports = {
parseSections: function(stream, iterator) {
var len, markerType;
stream.setBigEndian(true);
//stop reading the stream at the SOS (Start of Stream) marker,
//because its length is not stored in the header so we can't
//know where to jump to. The only marker after that is just EOI (End Of Image) anyway
while(stream.remainingLength() > 0 && markerType !== 0xDA) {
if(stream.nextUInt8() !== 0xFF) {
throw new Error('Invalid JPEG section offset');
}
markerType = stream.nextUInt8();
//don't read size from markers that have no datas
if((markerType >= 0xD0 && markerType <= 0xD9) || markerType === 0xDA) {
len = 0;
} else {
len = stream.nextUInt16() - 2;
}
iterator(markerType, stream.branch(0, len));
stream.skip(len);
}
},
//stream should be located after SOF section size and in big endian mode, like passed to parseSections iterator
getSizeFromSOFSection: function(stream) {
stream.skip(1);
return {
height: stream.nextUInt16(),
width: stream.nextUInt16()
};
},
getSectionName: function(markerType) {
var name, index;
switch(markerType) {
case 0xD8: name = 'SOI'; break;
case 0xC4: name = 'DHT'; break;
case 0xDB: name = 'DQT'; break;
case 0xDD: name = 'DRI'; break;
case 0xDA: name = 'SOS'; break;
case 0xFE: name = 'COM'; break;
case 0xD9: name = 'EOI'; break;
default:
if(markerType >= 0xE0 && markerType <= 0xEF) {
name = 'APP';
index = markerType - 0xE0;
}
else if(markerType >= 0xC0 && markerType <= 0xCF && markerType !== 0xC4 && markerType !== 0xC8 && markerType !== 0xCC) {
name = 'SOF';
index = markerType - 0xC0;
}
else if(markerType >= 0xD0 && markerType <= 0xD7) {
name = 'RST';
index = markerType - 0xD0;
}
break;
}
var nameStruct = {
name: name
};
if(typeof index === 'number') {
nameStruct.index = index;
}
return nameStruct;
}
};
/***/ }),
/***/ 4898:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
/*jslint browser: true, devel: true, bitwise: false, debug: true, eqeq: false, es5: true, evil: false, forin: false, newcap: false, nomen: true, plusplus: true, regexp: false, unparam: false, sloppy: true, stupid: false, sub: false, todo: true, vars: true, white: true */
var jpeg = __nccwpck_require__(1659),
exif = __nccwpck_require__(5506),
simplify = __nccwpck_require__(8062);
function ExifResult(startMarker, tags, imageSize, thumbnailOffset, thumbnailLength, thumbnailType, app1Offset) {
this.startMarker = startMarker;
this.tags = tags;
this.imageSize = imageSize;
this.thumbnailOffset = thumbnailOffset;
this.thumbnailLength = thumbnailLength;
this.thumbnailType = thumbnailType;
this.app1Offset = app1Offset;
}
ExifResult.prototype = {
hasThumbnail: function(mime) {
if(!this.thumbnailOffset || !this.thumbnailLength) {
return false;
}
if(typeof mime !== 'string') {
return true;
}
if(mime.toLowerCase().trim() === 'image/jpeg') {
return this.thumbnailType === 6;
}
if(mime.toLowerCase().trim() === 'image/tiff') {
return this.thumbnailType === 1;
}
return false;
},
getThumbnailOffset: function() {
return this.app1Offset + 6 + this.thumbnailOffset;
},
getThumbnailLength: function() {
return this.thumbnailLength;
},
getThumbnailBuffer: function() {
return this._getThumbnailStream().nextBuffer(this.thumbnailLength);
},
_getThumbnailStream: function() {
return this.startMarker.openWithOffset(this.getThumbnailOffset());
},
getImageSize: function() {
return this.imageSize;
},
getThumbnailSize: function() {
var stream = this._getThumbnailStream(), size;
jpeg.parseSections(stream, function(sectionType, sectionStream) {
if(jpeg.getSectionName(sectionType).name === 'SOF') {
size = jpeg.getSizeFromSOFSection(sectionStream);
}
});
return size;
}
};
function Parser(stream) {
this.stream = stream;
this.flags = {
readBinaryTags: false,
resolveTagNames: true,
simplifyValues: true,
imageSize: true,
hidePointers: true,
returnTags: true
};
}
Parser.prototype = {
enableBinaryFields: function(enable) {
this.flags.readBinaryTags = !!enable;
return this;
},
enablePointers: function(enable) {
this.flags.hidePointers = !enable;
return this;
},
enableTagNames: function(enable) {
this.flags.resolveTagNames = !!enable;
return this;
},
enableImageSize: function(enable) {
this.flags.imageSize = !!enable;
return this;
},
enableReturnTags: function(enable) {
this.flags.returnTags = !!enable;
return this;
},
enableSimpleValues: function(enable) {
this.flags.simplifyValues = !!enable;
return this;
},
parse: function() {
var start = this.stream.mark(),
stream = start.openWithOffset(0),
flags = this.flags,
tags,
imageSize,
thumbnailOffset,
thumbnailLength,
thumbnailType,
app1Offset,
tagNames,
getTagValue, setTagValue;
if(flags.resolveTagNames) {
tagNames = __nccwpck_require__(1494);
}
if(flags.resolveTagNames) {
tags = {};
getTagValue = function(t) {
return tags[t.name];
};
setTagValue = function(t, value) {
tags[t.name] = value;
};
} else {
tags = [];
getTagValue = function(t) {
var i;
for(i = 0; i < tags.length; ++i) {
if(tags[i].type === t.type && tags[i].section === t.section) {
return tags.value;
}
}
};
setTagValue = function(t, value) {
var i;
for(i = 0; i < tags.length; ++i) {
if(tags[i].type === t.type && tags[i].section === t.section) {
tags.value = value;
return;
}
}
};
}
jpeg.parseSections(stream, function(sectionType, sectionStream) {
var validExifHeaders, sectionOffset = sectionStream.offsetFrom(start);
if(sectionType === 0xE1) {
validExifHeaders = exif.parseTags(sectionStream, function(ifdSection, tagType, value, format) {
//ignore binary fields if disabled
if(!flags.readBinaryTags && format === 7) {
return;
}
if(tagType === 0x0201) {
thumbnailOffset = value[0];
if(flags.hidePointers) {return;}
} else if(tagType === 0x0202) {
thumbnailLength = value[0];
if(flags.hidePointers) {return;}
} else if(tagType === 0x0103) {
thumbnailType = value[0];
if(flags.hidePointers) {return;}
}
//if flag is set to not store tags, return here after storing pointers
if(!flags.returnTags) {
return;
}
if(flags.simplifyValues) {
value = simplify.simplifyValue(value, format);
}
if(flags.resolveTagNames) {
var sectionTagNames = ifdSection === exif.GPSIFD ? tagNames.gps : tagNames.exif;
var name = sectionTagNames[tagType];
if(!name) {
name = tagNames.exif[tagType];
}
if (!tags.hasOwnProperty(name)) {
tags[name] = value;
}
} else {
tags.push({
section: ifdSection,
type: tagType,
value: value
});
}
});
if(validExifHeaders) {
app1Offset = sectionOffset;
}
}
else if(flags.imageSize && jpeg.getSectionName(sectionType).name === 'SOF') {
imageSize = jpeg.getSizeFromSOFSection(sectionStream);
}
});
if(flags.simplifyValues) {
simplify.castDegreeValues(getTagValue, setTagValue);
simplify.castDateValues(getTagValue, setTagValue);
}
return new ExifResult(start, tags, imageSize, thumbnailOffset, thumbnailLength, thumbnailType, app1Offset);
}
};
module.exports = Parser;
/***/ }),
/***/ 8062:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
var exif = __nccwpck_require__(5506);
var date = __nccwpck_require__(610);
var degreeTags = [{
section: exif.GPSIFD,
type: 0x0002,
name: 'GPSLatitude',
refType: 0x0001,
refName: 'GPSLatitudeRef',
posVal: 'N'
},
{
section: exif.GPSIFD,
type: 0x0004,
name: 'GPSLongitude',
refType: 0x0003,
refName: 'GPSLongitudeRef',
posVal: 'E'
}];
var dateTags = [{
section: exif.SubIFD,
type: 0x0132,
name: 'ModifyDate'
},
{
section: exif.SubIFD,
type: 0x9003,
name: 'DateTimeOriginal'
},
{
section: exif.SubIFD,
type: 0x9004,
name: 'CreateDate'
},
{
section: exif.SubIFD,
type: 0x0132,
name : 'ModifyDate',
}];
module.exports = {
castDegreeValues: function(getTagValue, setTagValue) {
degreeTags.forEach(function(t) {
var degreeVal = getTagValue(t);
if(degreeVal) {
var degreeRef = getTagValue({section: t.section, type: t.refType, name: t.refName});
var degreeNumRef = degreeRef === t.posVal ? 1 : -1;
var degree = (degreeVal[0] + (degreeVal[1] / 60) + (degreeVal[2] / 3600)) * degreeNumRef;
setTagValue(t, degree);
}
});
},
castDateValues: function(getTagValue, setTagValue) {
dateTags.forEach(function(t) {
var dateStrVal = getTagValue(t);
if(dateStrVal) {
//some easy checks to determine two common date formats
var timestamp = date.parseExifDate(dateStrVal);
if(typeof timestamp !== 'undefined') {
setTagValue(t, timestamp);
}
}
});
},
simplifyValue: function(values, format) {
if(Array.isArray(values)) {
values = values.map(function(value) {
if(format === 10 || format === 5) {
return value[0] / value[1];
}
return value;
});
if(values.length === 1) {
values = values[0];
}
}
return values;
}
};
/***/ }),
/***/ 4126:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
"use strict";
const Token = __nccwpck_require__(4261);
const strtok3 = __nccwpck_require__(3026);
const {
stringToBytes,
tarHeaderChecksumMatches,
uint32SyncSafeToken
} = __nccwpck_require__(4875);
const supported = __nccwpck_require__(7860);
const minimumBytes = 4100; // A fair amount of file-types are detectable within this range
async function fromStream(stream) {
const tokenizer = await strtok3.fromStream(stream);
try {
return await fromTokenizer(tokenizer);
} finally {
await tokenizer.close();
}
}
async function fromBuffer(input) {
if (!(input instanceof Uint8Array || input instanceof ArrayBuffer || Buffer.isBuffer(input))) {
throw new TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`Buffer\` or \`ArrayBuffer\`, got \`${typeof input}\``);
}
const buffer = input instanceof Buffer ? input : Buffer.from(input);
if (!(buffer && buffer.length > 1)) {
return;
}
const tokenizer = strtok3.fromBuffer(buffer);
return fromTokenizer(tokenizer);
}
function _check(buffer, headers, options) {
options = {
offset: 0,
...options
};
for (const [index, header] of headers.entries()) {
// If a bitmask is set
if (options.mask) {
// If header doesn't equal `buf` with bits masked off
if (header !== (options.mask[index] & buffer[index + options.offset])) {
return false;
}
} else if (header !== buffer[index + options.offset]) {
return false;
}
}
return true;
}
async function fromTokenizer(tokenizer) {
try {
return _fromTokenizer(tokenizer);
} catch (error) {
if (!(error instanceof strtok3.EndOfStreamError)) {
throw error;
}
}
}
async function _fromTokenizer(tokenizer) {
let buffer = Buffer.alloc(minimumBytes);
const bytesRead = 12;
const check = (header, options) => _check(buffer, header, options);
const checkString = (header, options) => check(stringToBytes(header), options);
// Keep reading until EOF if the file size is unknown.
if (!tokenizer.fileInfo.size) {
tokenizer.fileInfo.size = Number.MAX_SAFE_INTEGER;
}
await tokenizer.peekBuffer(buffer, {length: bytesRead, mayBeLess: true});
// -- 2-byte signatures --
if (check([0x42, 0x4D])) {
return {
ext: 'bmp',
mime: 'image/bmp'
};
}
if (check([0x0B, 0x77])) {
return {
ext: 'ac3',
mime: 'audio/vnd.dolby.dd-raw'
};
}
if (check([0x78, 0x01])) {
return {
ext: 'dmg',
mime: 'application/x-apple-diskimage'
};
}
if (check([0x4D, 0x5A])) {
return {
ext: 'exe',
mime: 'application/x-msdownload'
};
}
if (check([0x25, 0x21])) {
await tokenizer.peekBuffer(buffer, {length: 24, mayBeLess: true});
if (checkString('PS-Adobe-', {offset: 2}) &&
checkString(' EPSF-', {offset: 14})) {
return {
ext: 'eps',
mime: 'application/eps'
};
}
return {
ext: 'ps',
mime: 'application/postscript'
};
}
if (
check([0x1F, 0xA0]) ||
check([0x1F, 0x9D])
) {
return {
ext: 'Z',
mime: 'application/x-compress'
};
}
// -- 3-byte signatures --
if (check([0xFF, 0xD8, 0xFF])) {
return {
ext: 'jpg',
mime: 'image/jpeg'
};
}
if (check([0x49, 0x49, 0xBC])) {
return {
ext: 'jxr',
mime: 'image/vnd.ms-photo'
};
}
if (check([0x1F, 0x8B, 0x8])) {
return {
ext: 'gz',
mime: 'application/gzip'
};
}
if (check([0x42, 0x5A, 0x68])) {
return {
ext: 'bz2',
mime: 'application/x-bzip2'
};
}
if (checkString('ID3')) {
await tokenizer.ignore(6); // Skip ID3 header until the header size
const id3HeaderLen = await tokenizer.readToken(uint32SyncSafeToken);
if (tokenizer.position + id3HeaderLen > tokenizer.fileInfo.size) {
// Guess file type based on ID3 header for backward compatibility
return {
ext: 'mp3',
mime: 'audio/mpeg'
};
}
await tokenizer.ignore(id3HeaderLen);
return fromTokenizer(tokenizer); // Skip ID3 header, recursion
}
// Musepack, SV7
if (checkString('MP+')) {
return {
ext: 'mpc',
mime: 'audio/x-musepack'
};
}
if (
(buffer[0] === 0x43 || buffer[0] === 0x46) &&
check([0x57, 0x53], {offset: 1})
) {
return {
ext: 'swf',
mime: 'application/x-shockwave-flash'
};
}
// -- 4-byte signatures --
if (check([0x47, 0x49, 0x46])) {
return {
ext: 'gif',
mime: 'image/gif'
};
}
if (checkString('FLIF')) {
return {
ext: 'flif',
mime: 'image/flif'
};
}
if (checkString('8BPS')) {
return {
ext: 'psd',
mime: 'image/vnd.adobe.photoshop'
};
}
if (checkString('WEBP', {offset: 8})) {
return {
ext: 'webp',
mime: 'image/webp'
};
}
// Musepack, SV8
if (checkString('MPCK')) {
return {
ext: 'mpc',
mime: 'audio/x-musepack'
};
}
if (checkString('FORM')) {
return {
ext: 'aif',
mime: 'audio/aiff'
};
}
if (checkString('icns', {offset: 0})) {
return {
ext: 'icns',
mime: 'image/icns'
};
}
// Zip-based file formats
// Need to be before the `zip` check
if (check([0x50, 0x4B, 0x3, 0x4])) { // Local file header signature
try {
while (tokenizer.position + 30 < tokenizer.fileInfo.size) {
await tokenizer.readBuffer(buffer, {length: 30});
// https://en.wikipedia.org/wiki/Zip_(file_format)#File_headers
const zipHeader = {
compressedSize: buffer.readUInt32LE(18),
uncompressedSize: buffer.readUInt32LE(22),
filenameLength: buffer.readUInt16LE(26),
extraFieldLength: buffer.readUInt16LE(28)
};
zipHeader.filename = await tokenizer.readToken(new Token.StringType(zipHeader.filenameLength, 'utf-8'));
await tokenizer.ignore(zipHeader.extraFieldLength);
// Assumes signed `.xpi` from addons.mozilla.org
if (zipHeader.filename === 'META-INF/mozilla.rsa') {
return {
ext: 'xpi',
mime: 'application/x-xpinstall'
};
}
if (zipHeader.filename.endsWith('.rels') || zipHeader.filename.endsWith('.xml')) {
const type = zipHeader.filename.split('/')[0];
switch (type) {
case '_rels':
break;
case 'word':
return {
ext: 'docx',
mime: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
};
case 'ppt':
return {
ext: 'pptx',
mime: 'application/vnd.openxmlformats-officedocument.presentationml.presentation'
};
case 'xl':
return {
ext: 'xlsx',
mime: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
};
default:
break;
}
}
if (zipHeader.filename.startsWith('xl/')) {
return {
ext: 'xlsx',
mime: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
};
}
if (zipHeader.filename.startsWith('3D/') && zipHeader.filename.endsWith('.model')) {
return {
ext: '3mf',
mime: 'model/3mf'
};
}
// The docx, xlsx and pptx file types extend the Office Open XML file format:
// https://en.wikipedia.org/wiki/Office_Open_XML_file_formats
// We look for:
// - one entry named '[Content_Types].xml' or '_rels/.rels',
// - one entry indicating specific type of file.
// MS Office, OpenOffice and LibreOffice may put the parts in different order, so the check should not rely on it.
if (zipHeader.filename === 'mimetype' && zipHeader.compressedSize === zipHeader.uncompressedSize) {
const mimeType = await tokenizer.readToken(new Token.StringType(zipHeader.compressedSize, 'utf-8'));
switch (mimeType) {
case 'application/epub+zip':
return {
ext: 'epub',
mime: 'application/epub+zip'
};
case 'application/vnd.oasis.opendocument.text':
return {
ext: 'odt',
mime: 'application/vnd.oasis.opendocument.text'
};
case 'application/vnd.oasis.opendocument.spreadsheet':
return {
ext: 'ods',
mime: 'application/vnd.oasis.opendocument.spreadsheet'
};
case 'application/vnd.oasis.opendocument.presentation':
return {
ext: 'odp',
mime: 'application/vnd.oasis.opendocument.presentation'
};
default:
}
}
// Try to find next header manually when current one is corrupted
if (zipHeader.compressedSize === 0) {
let nextHeaderIndex = -1;
while (nextHeaderIndex < 0 && (tokenizer.position < tokenizer.fileInfo.size)) {
await tokenizer.peekBuffer(buffer, {mayBeLess: true});
nextHeaderIndex = buffer.indexOf('504B0304', 0, 'hex');
// Move position to the next header if found, skip the whole buffer otherwise
await tokenizer.ignore(nextHeaderIndex >= 0 ? nextHeaderIndex : buffer.length);
}
} else {
await tokenizer.ignore(zipHeader.compressedSize);
}
}
} catch (error) {
if (!(error instanceof strtok3.EndOfStreamError)) {
throw error;
}
}
return {
ext: 'zip',
mime: 'application/zip'
};
}
if (checkString('OggS')) {
// This is an OGG container
await tokenizer.ignore(28);
const type = Buffer.alloc(8);
await tokenizer.readBuffer(type);
// Needs to be before `ogg` check
if (_check(type, [0x4F, 0x70, 0x75, 0x73, 0x48, 0x65, 0x61, 0x64])) {
return {
ext: 'opus',
mime: 'audio/opus'
};
}
// If ' theora' in header.
if (_check(type, [0x80, 0x74, 0x68, 0x65, 0x6F, 0x72, 0x61])) {
return {
ext: 'ogv',
mime: 'video/ogg'
};
}
// If '\x01video' in header.
if (_check(type, [0x01, 0x76, 0x69, 0x64, 0x65, 0x6F, 0x00])) {
return {
ext: 'ogm',
mime: 'video/ogg'
};
}
// If ' FLAC' in header https://xiph.org/flac/faq.html
if (_check(type, [0x7F, 0x46, 0x4C, 0x41, 0x43])) {
return {
ext: 'oga',
mime: 'audio/ogg'
};
}
// 'Speex ' in header https://en.wikipedia.org/wiki/Speex
if (_check(type, [0x53, 0x70, 0x65, 0x65, 0x78, 0x20, 0x20])) {
return {
ext: 'spx',
mime: 'audio/ogg'
};
}
// If '\x01vorbis' in header
if (_check(type, [0x01, 0x76, 0x6F, 0x72, 0x62, 0x69, 0x73])) {
return {
ext: 'ogg',
mime: 'audio/ogg'
};
}
// Default OGG container https://www.iana.org/assignments/media-types/application/ogg
return {
ext: 'ogx',
mime: 'application/ogg'
};
}
if (
check([0x50, 0x4B]) &&
(buffer[2] === 0x3 || buffer[2] === 0x5 || buffer[2] === 0x7) &&
(buffer[3] === 0x4 || buffer[3] === 0x6 || buffer[3] === 0x8)
) {
return {
ext: 'zip',
mime: 'application/zip'
};
}
//
// File Type Box (https://en.wikipedia.org/wiki/ISO_base_media_file_format)
// It's not required to be first, but it's recommended to be. Almost all ISO base media files start with `ftyp` box.
// `ftyp` box must contain a brand major identifier, which must consist of ISO 8859-1 printable characters.
// Here we check for 8859-1 printable characters (for simplicity, it's a mask which also catches one non-printable character).
if (
checkString('ftyp', {offset: 4}) &&
(buffer[8] & 0x60) !== 0x00 // Brand major, first character ASCII?
) {
// They all can have MIME `video/mp4` except `application/mp4` special-case which is hard to detect.
// For some cases, we're specific, everything else falls to `video/mp4` with `mp4` extension.
const brandMajor = buffer.toString('binary', 8, 12).replace('\0', ' ').trim();
switch (brandMajor) {
case 'avif':
return {ext: 'avif', mime: 'image/avif'};
case 'mif1':
return {ext: 'heic', mime: 'image/heif'};
case 'msf1':
return {ext: 'heic', mime: 'image/heif-sequence'};
case 'heic':
case 'heix':
return {ext: 'heic', mime: 'image/heic'};
case 'hevc':
case 'hevx':
return {ext: 'heic', mime: 'image/heic-sequence'};
case 'qt':
return {ext: 'mov', mime: 'video/quicktime'};
case 'M4V':
case 'M4VH':
case 'M4VP':
return {ext: 'm4v', mime: 'video/x-m4v'};
case 'M4P':
return {ext: 'm4p', mime: 'video/mp4'};
case 'M4B':
return {ext: 'm4b', mime: 'audio/mp4'};
case 'M4A':
return {ext: 'm4a', mime: 'audio/x-m4a'};
case 'F4V':
return {ext: 'f4v', mime: 'video/mp4'};
case 'F4P':
return {ext: 'f4p', mime: 'video/mp4'};
case 'F4A':
return {ext: 'f4a', mime: 'audio/mp4'};
case 'F4B':
return {ext: 'f4b', mime: 'audio/mp4'};
case 'crx':
return {ext: 'cr3', mime: 'image/x-canon-cr3'};
default:
if (brandMajor.startsWith('3g')) {
if (brandMajor.startsWith('3g2')) {
return {ext: '3g2', mime: 'video/3gpp2'};
}
return {ext: '3gp', mime: 'video/3gpp'};
}
return {ext: 'mp4', mime: 'video/mp4'};
}
}
if (checkString('MThd')) {
return {
ext: 'mid',
mime: 'audio/midi'
};
}
if (
checkString('wOFF') &&
(
check([0x00, 0x01, 0x00, 0x00], {offset: 4}) ||
checkString('OTTO', {offset: 4})
)
) {
return {
ext: 'woff',
mime: 'font/woff'
};
}
if (
checkString('wOF2') &&
(
check([0x00, 0x01, 0x00, 0x00], {offset: 4}) ||
checkString('OTTO', {offset: 4})
)
) {
return {
ext: 'woff2',
mime: 'font/woff2'
};
}
if (check([0xD4, 0xC3, 0xB2, 0xA1]) || check([0xA1, 0xB2, 0xC3, 0xD4])) {
return {
ext: 'pcap',
mime: 'application/vnd.tcpdump.pcap'
};
}
// Sony DSD Stream File (DSF)
if (checkString('DSD ')) {
return {
ext: 'dsf',
mime: 'audio/x-dsf' // Non-standard
};
}
if (checkString('LZIP')) {
return {
ext: 'lz',
mime: 'application/x-lzip'
};
}
if (checkString('fLaC')) {
return {
ext: 'flac',
mime: 'audio/x-flac'
};
}
if (check([0x42, 0x50, 0x47, 0xFB])) {
return {
ext: 'bpg',
mime: 'image/bpg'
};
}
if (checkString('wvpk')) {
return {
ext: 'wv',
mime: 'audio/wavpack'
};
}
if (checkString('%PDF')) {
await tokenizer.ignore(1350);
const maxBufferSize = 10 * 1024 * 1024;
const buffer = Buffer.alloc(Math.min(maxBufferSize, tokenizer.fileInfo.size));
await tokenizer.readBuffer(buffer, {mayBeLess: true});
// Check if this is an Adobe Illustrator file
if (buffer.includes(Buffer.from('AIPrivateData'))) {
return {
ext: 'ai',
mime: 'application/postscript'
};
}
// Assume this is just a normal PDF
return {
ext: 'pdf',
mime: 'application/pdf'
};
}
if (check([0x00, 0x61, 0x73, 0x6D])) {
return {
ext: 'wasm',
mime: 'application/wasm'
};
}
// TIFF, little-endian type
if (check([0x49, 0x49, 0x2A, 0x0])) {
if (checkString('CR', {offset: 8})) {
return {
ext: 'cr2',
mime: 'image/x-canon-cr2'
};
}
if (check([0x1C, 0x00, 0xFE, 0x00], {offset: 8}) || check([0x1F, 0x00, 0x0B, 0x00], {offset: 8})) {
return {
ext: 'nef',
mime: 'image/x-nikon-nef'
};
}
if (
check([0x08, 0x00, 0x00, 0x00], {offset: 4}) &&
(check([0x2D, 0x00, 0xFE, 0x00], {offset: 8}) ||
check([0x27, 0x00, 0xFE, 0x00], {offset: 8}))
) {
return {
ext: 'dng',
mime: 'image/x-adobe-dng'
};
}
buffer = Buffer.alloc(24);
await tokenizer.peekBuffer(buffer);
if (
(check([0x10, 0xFB, 0x86, 0x01], {offset: 4}) || check([0x08, 0x00, 0x00, 0x00], {offset: 4})) &&
// This pattern differentiates ARW from other TIFF-ish file types:
check([0x00, 0xFE, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x01], {offset: 9})
) {
return {
ext: 'arw',
mime: 'image/x-sony-arw'
};
}
return {
ext: 'tif',
mime: 'image/tiff'
};
}
// TIFF, big-endian type
if (check([0x4D, 0x4D, 0x0, 0x2A])) {
return {
ext: 'tif',
mime: 'image/tiff'
};
}
if (checkString('MAC ')) {
return {
ext: 'ape',
mime: 'audio/ape'
};
}
// https://github.com/threatstack/libmagic/blob/master/magic/Magdir/matroska
if (check([0x1A, 0x45, 0xDF, 0xA3])) { // Root element: EBML
async function readField() {
const msb = await tokenizer.peekNumber(Token.UINT8);
let mask = 0x80;
let ic = 0; // 0 = A, 1 = B, 2 = C, 3 = D
while ((msb & mask) === 0 && mask !== 0) {
++ic;
mask >>= 1;
}
const id = Buffer.alloc(ic + 1);
await tokenizer.readBuffer(id);
return id;
}
async function readElement() {
const id = await readField();
const lenField = await readField();
lenField[0] ^= 0x80 >> (lenField.length - 1);
const nrLen = Math.min(6, lenField.length); // JavaScript can max read 6 bytes integer
return {
id: id.readUIntBE(0, id.length),
len: lenField.readUIntBE(lenField.length - nrLen, nrLen)
};
}
async function readChildren(level, children) {
while (children > 0) {
const e = await readElement();
if (e.id === 0x4282) {
return tokenizer.readToken(new Token.StringType(e.len, 'utf-8')); // Return DocType
}
await tokenizer.ignore(e.len); // ignore payload
--children;
}
}
const re = await readElement();
const docType = await readChildren(1, re.len);
switch (docType) {
case 'webm':
return {
ext: 'webm',
mime: 'video/webm'
};
case 'matroska':
return {
ext: 'mkv',
mime: 'video/x-matroska'
};
default:
return;
}
}
// RIFF file format which might be AVI, WAV, QCP, etc
if (check([0x52, 0x49, 0x46, 0x46])) {
if (check([0x41, 0x56, 0x49], {offset: 8})) {
return {
ext: 'avi',
mime: 'video/vnd.avi'
};
}
if (check([0x57, 0x41, 0x56, 0x45], {offset: 8})) {
return {
ext: 'wav',
mime: 'audio/vnd.wave'
};
}
// QLCM, QCP file
if (check([0x51, 0x4C, 0x43, 0x4D], {offset: 8})) {
return {
ext: 'qcp',
mime: 'audio/qcelp'
};
}
}
if (checkString('SQLi')) {
return {
ext: 'sqlite',
mime: 'application/x-sqlite3'
};
}
if (check([0x4E, 0x45, 0x53, 0x1A])) {
return {
ext: 'nes',
mime: 'application/x-nintendo-nes-rom'
};
}
if (checkString('Cr24')) {
return {
ext: 'crx',
mime: 'application/x-google-chrome-extension'
};
}
if (
checkString('MSCF') ||
checkString('ISc(')
) {
return {
ext: 'cab',
mime: 'application/vnd.ms-cab-compressed'
};
}
if (check([0xED, 0xAB, 0xEE, 0xDB])) {
return {
ext: 'rpm',
mime: 'application/x-rpm'
};
}
if (check([0xC5, 0xD0, 0xD3, 0xC6])) {
return {
ext: 'eps',
mime: 'application/eps'
};
}
if (check([0x28, 0xB5, 0x2F, 0xFD])) {
return {
ext: 'zst',
mime: 'application/zstd'
};
}
// -- 5-byte signatures --
if (check([0x4F, 0x54, 0x54, 0x4F, 0x00])) {
return {
ext: 'otf',
mime: 'font/otf'
};
}
if (checkString('#!AMR')) {
return {
ext: 'amr',
mime: 'audio/amr'
};
}
if (checkString('{\\rtf')) {
return {
ext: 'rtf',
mime: 'application/rtf'
};
}
if (check([0x46, 0x4C, 0x56, 0x01])) {
return {
ext: 'flv',
mime: 'video/x-flv'
};
}
if (checkString('IMPM')) {
return {
ext: 'it',
mime: 'audio/x-it'
};
}
if (
checkString('-lh0-', {offset: 2}) ||
checkString('-lh1-', {offset: 2}) ||
checkString('-lh2-', {offset: 2}) ||
checkString('-lh3-', {offset: 2}) ||
checkString('-lh4-', {offset: 2}) ||
checkString('-lh5-', {offset: 2}) ||
checkString('-lh6-', {offset: 2}) ||
checkString('-lh7-', {offset: 2}) ||
checkString('-lzs-', {offset: 2}) ||
checkString('-lz4-', {offset: 2}) ||
checkString('-lz5-', {offset: 2}) ||
checkString('-lhd-', {offset: 2})
) {
return {
ext: 'lzh',
mime: 'application/x-lzh-compressed'
};
}
// MPEG program stream (PS or MPEG-PS)
if (check([0x00, 0x00, 0x01, 0xBA])) {
// MPEG-PS, MPEG-1 Part 1
if (check([0x21], {offset: 4, mask: [0xF1]})) {
return {
ext: 'mpg', // May also be .ps, .mpeg
mime: 'video/MP1S'
};
}
// MPEG-PS, MPEG-2 Part 1
if (check([0x44], {offset: 4, mask: [0xC4]})) {
return {
ext: 'mpg', // May also be .mpg, .m2p, .vob or .sub
mime: 'video/MP2P'
};
}
}
if (checkString('ITSF')) {
return {
ext: 'chm',
mime: 'application/vnd.ms-htmlhelp'
};
}
// -- 6-byte signatures --
if (check([0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00])) {
return {
ext: 'xz',
mime: 'application/x-xz'
};
}
if (checkString('<?xml ')) {
return {
ext: 'xml',
mime: 'application/xml'
};
}
if (check([0x37, 0x7A, 0xBC, 0xAF, 0x27, 0x1C])) {
return {
ext: '7z',
mime: 'application/x-7z-compressed'
};
}
if (
check([0x52, 0x61, 0x72, 0x21, 0x1A, 0x7]) &&
(buffer[6] === 0x0 || buffer[6] === 0x1)
) {
return {
ext: 'rar',
mime: 'application/x-rar-compressed'
};
}
if (checkString('solid ')) {
return {
ext: 'stl',
mime: 'model/stl'
};
}
// -- 7-byte signatures --
if (checkString('BLENDER')) {
return {
ext: 'blend',
mime: 'application/x-blender'
};
}
if (checkString('!<arch>')) {
await tokenizer.ignore(8);
const str = await tokenizer.readToken(new Token.StringType(13, 'ascii'));
if (str === 'debian-binary') {
return {
ext: 'deb',
mime: 'application/x-deb'
};
}
return {
ext: 'ar',
mime: 'application/x-unix-archive'
};
}
// -- 8-byte signatures --
if (check([0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A])) {
// APNG format (https://wiki.mozilla.org/APNG_Specification)
// 1. Find the first IDAT (image data) chunk (49 44 41 54)
// 2. Check if there is an "acTL" chunk before the IDAT one (61 63 54 4C)
// Offset calculated as follows:
// - 8 bytes: PNG signature
// - 4 (length) + 4 (chunk type) + 13 (chunk data) + 4 (CRC): IHDR chunk
await tokenizer.ignore(8); // ignore PNG signature
async function readChunkHeader() {
return {
length: await tokenizer.readToken(Token.INT32_BE),
type: await tokenizer.readToken(new Token.StringType(4, 'binary'))
};
}
do {
const chunk = await readChunkHeader();
if (chunk.length < 0) {
return; // Invalid chunk length
}
switch (chunk.type) {
case 'IDAT':
return {
ext: 'png',
mime: 'image/png'
};
case 'acTL':
return {
ext: 'apng',
mime: 'image/apng'
};
default:
await tokenizer.ignore(chunk.length + 4); // Ignore chunk-data + CRC
}
} while (tokenizer.position + 8 < tokenizer.fileInfo.size);
return {
ext: 'png',
mime: 'image/png'
};
}
if (check([0x41, 0x52, 0x52, 0x4F, 0x57, 0x31, 0x00, 0x00])) {
return {
ext: 'arrow',
mime: 'application/x-apache-arrow'
};
}
if (check([0x67, 0x6C, 0x54, 0x46, 0x02, 0x00, 0x00, 0x00])) {
return {
ext: 'glb',
mime: 'model/gltf-binary'
};
}
// `mov` format variants
if (
check([0x66, 0x72, 0x65, 0x65], {offset: 4}) || // `free`
check([0x6D, 0x64, 0x61, 0x74], {offset: 4}) || // `mdat` MJPEG
check([0x6D, 0x6F, 0x6F, 0x76], {offset: 4}) || // `moov`
check([0x77, 0x69, 0x64, 0x65], {offset: 4}) // `wide`
) {
return {
ext: 'mov',
mime: 'video/quicktime'
};
}
// -- 9-byte signatures --
if (check([0x49, 0x49, 0x52, 0x4F, 0x08, 0x00, 0x00, 0x00, 0x18])) {
return {
ext: 'orf',
mime: 'image/x-olympus-orf'
};
}
if (checkString('gimp xcf ')) {
return {
ext: 'xcf',
mime: 'image/x-xcf'
};
}
// -- 12-byte signatures --
if (check([0x49, 0x49, 0x55, 0x00, 0x18, 0x00, 0x00, 0x00, 0x88, 0xE7, 0x74, 0xD8])) {
return {
ext: 'rw2',
mime: 'image/x-panasonic-rw2'
};
}
// ASF_Header_Object first 80 bytes
if (check([0x30, 0x26, 0xB2, 0x75, 0x8E, 0x66, 0xCF, 0x11, 0xA6, 0xD9])) {
async function readHeader() {
const guid = Buffer.alloc(16);
await tokenizer.readBuffer(guid);
return {
id: guid,
size: Number(await tokenizer.readToken(Token.UINT64_LE))
};
}
await tokenizer.ignore(30);
// Search for header should be in first 1KB of file.
while (tokenizer.position + 24 < tokenizer.fileInfo.size) {
const header = await readHeader();
let payload = header.size - 24;
if (_check(header.id, [0x91, 0x07, 0xDC, 0xB7, 0xB7, 0xA9, 0xCF, 0x11, 0x8E, 0xE6, 0x00, 0xC0, 0x0C, 0x20, 0x53, 0x65])) {
// Sync on Stream-Properties-Object (B7DC0791-A9B7-11CF-8EE6-00C00C205365)
const typeId = Buffer.alloc(16);
payload -= await tokenizer.readBuffer(typeId);
if (_check(typeId, [0x40, 0x9E, 0x69, 0xF8, 0x4D, 0x5B, 0xCF, 0x11, 0xA8, 0xFD, 0x00, 0x80, 0x5F, 0x5C, 0x44, 0x2B])) {
// Found audio:
return {
ext: 'asf',
mime: 'audio/x-ms-asf'
};
}
if (_check(typeId, [0xC0, 0xEF, 0x19, 0xBC, 0x4D, 0x5B, 0xCF, 0x11, 0xA8, 0xFD, 0x00, 0x80, 0x5F, 0x5C, 0x44, 0x2B])) {
// Found video:
return {
ext: 'asf',
mime: 'video/x-ms-asf'
};
}
break;
}
await tokenizer.ignore(payload);
}
// Default to ASF generic extension
return {
ext: 'asf',
mime: 'application/vnd.ms-asf'
};
}
if (check([0xAB, 0x4B, 0x54, 0x58, 0x20, 0x31, 0x31, 0xBB, 0x0D, 0x0A, 0x1A, 0x0A])) {
return {
ext: 'ktx',
mime: 'image/ktx'
};
}
if ((check([0x7E, 0x10, 0x04]) || check([0x7E, 0x18, 0x04])) && check([0x30, 0x4D, 0x49, 0x45], {offset: 4})) {
return {
ext: 'mie',
mime: 'application/x-mie'
};
}
if (check([0x27, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], {offset: 2})) {
return {
ext: 'shp',
mime: 'application/x-esri-shape'
};
}
if (check([0x00, 0x00, 0x00, 0x0C, 0x6A, 0x50, 0x20, 0x20, 0x0D, 0x0A, 0x87, 0x0A])) {
// JPEG-2000 family
await tokenizer.ignore(20);
const type = await tokenizer.readToken(new Token.StringType(4, 'ascii'));
switch (type) {
case 'jp2 ':
return {
ext: 'jp2',
mime: 'image/jp2'
};
case 'jpx ':
return {
ext: 'jpx',
mime: 'image/jpx'
};
case 'jpm ':
return {
ext: 'jpm',
mime: 'image/jpm'
};
case 'mjp2':
return {
ext: 'mj2',
mime: 'image/mj2'
};
default:
return;
}
}
if (
check([0xFF, 0x0A]) ||
check([0x00, 0x00, 0x00, 0x0C, 0x4A, 0x58, 0x4C, 0x20, 0x0D, 0x0A, 0x87, 0x0A])
) {
return {
ext: 'jxl',
mime: 'image/jxl'
};
}
// -- Unsafe signatures --
if (
check([0x0, 0x0, 0x1, 0xBA]) ||
check([0x0, 0x0, 0x1, 0xB3])
) {
return {
ext: 'mpg',
mime: 'video/mpeg'
};
}
if (check([0x00, 0x01, 0x00, 0x00, 0x00])) {
return {
ext: 'ttf',
mime: 'font/ttf'
};
}
if (check([0x00, 0x00, 0x01, 0x00])) {
return {
ext: 'ico',
mime: 'image/x-icon'
};
}
if (check([0x00, 0x00, 0x02, 0x00])) {
return {
ext: 'cur',
mime: 'image/x-icon'
};
}
if (check([0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1])) {
// Detected Microsoft Compound File Binary File (MS-CFB) Format.
return {
ext: 'cfb',
mime: 'application/x-cfb'
};
}
// Increase sample size from 12 to 256.
await tokenizer.peekBuffer(buffer, {length: Math.min(256, tokenizer.fileInfo.size), mayBeLess: true});
// -- 15-byte signatures --
if (checkString('BEGIN:')) {
if (checkString('VCARD', {offset: 6})) {
return {
ext: 'vcf',
mime: 'text/vcard'
};
}
if (checkString('VCALENDAR', {offset: 6})) {
return {
ext: 'ics',
mime: 'text/calendar'
};
}
}
// `raf` is here just to keep all the raw image detectors together.
if (checkString('FUJIFILMCCD-RAW')) {
return {
ext: 'raf',
mime: 'image/x-fujifilm-raf'
};
}
if (checkString('Extended Module:')) {
return {
ext: 'xm',
mime: 'audio/x-xm'
};
}
if (checkString('Creative Voice File')) {
return {
ext: 'voc',
mime: 'audio/x-voc'
};
}
if (check([0x04, 0x00, 0x00, 0x00]) && buffer.length >= 16) { // Rough & quick check Pickle/ASAR
const jsonSize = buffer.readUInt32LE(12);
if (jsonSize > 12 && buffer.length >= jsonSize + 16) {
try {
const header = buffer.slice(16, jsonSize + 16).toString();
const json = JSON.parse(header);
// Check if Pickle is ASAR
if (json.files) { // Final check, assuring Pickle/ASAR format
return {
ext: 'asar',
mime: 'application/x-asar'
};
}
} catch (_) {
}
}
}
if (check([0x06, 0x0E, 0x2B, 0x34, 0x02, 0x05, 0x01, 0x01, 0x0D, 0x01, 0x02, 0x01, 0x01, 0x02])) {
return {
ext: 'mxf',
mime: 'application/mxf'
};
}
if (checkString('SCRM', {offset: 44})) {
return {
ext: 's3m',
mime: 'audio/x-s3m'
};
}
if (check([0x47], {offset: 4}) && (check([0x47], {offset: 192}) || check([0x47], {offset: 196}))) {
return {
ext: 'mts',
mime: 'video/mp2t'
};
}
if (check([0x42, 0x4F, 0x4F, 0x4B, 0x4D, 0x4F, 0x42, 0x49], {offset: 60})) {
return {
ext: 'mobi',
mime: 'application/x-mobipocket-ebook'
};
}
if (check([0x44, 0x49, 0x43, 0x4D], {offset: 128})) {
return {
ext: 'dcm',
mime: 'application/dicom'
};
}
if (check([0x4C, 0x00, 0x00, 0x00, 0x01, 0x14, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46])) {
return {
ext: 'lnk',
mime: 'application/x.ms.shortcut' // Invented by us
};
}
if (check([0x62, 0x6F, 0x6F, 0x6B, 0x00, 0x00, 0x00, 0x00, 0x6D, 0x61, 0x72, 0x6B, 0x00, 0x00, 0x00, 0x00])) {
return {
ext: 'alias',
mime: 'application/x.apple.alias' // Invented by us
};
}
if (
check([0x4C, 0x50], {offset: 34}) &&
(
check([0x00, 0x00, 0x01], {offset: 8}) ||
check([0x01, 0x00, 0x02], {offset: 8}) ||
check([0x02, 0x00, 0x02], {offset: 8})
)
) {
return {
ext: 'eot',
mime: 'application/vnd.ms-fontobject'
};
}
if (check([0x06, 0x06, 0xED, 0xF5, 0xD8, 0x1D, 0x46, 0xE5, 0xBD, 0x31, 0xEF, 0xE7, 0xFE, 0x74, 0xB7, 0x1D])) {
return {
ext: 'indd',
mime: 'application/x-indesign'
};
}
// Increase sample size from 256 to 512
await tokenizer.peekBuffer(buffer, {length: Math.min(512, tokenizer.fileInfo.size), mayBeLess: true});
// Requires a buffer size of 512 bytes
if (tarHeaderChecksumMatches(buffer)) {
return {
ext: 'tar',
mime: 'application/x-tar'
};
}
if (check([0xFF, 0xFE, 0xFF, 0x0E, 0x53, 0x00, 0x6B, 0x00, 0x65, 0x00, 0x74, 0x00, 0x63, 0x00, 0x68, 0x00, 0x55, 0x00, 0x70, 0x00, 0x20, 0x00, 0x4D, 0x00, 0x6F, 0x00, 0x64, 0x00, 0x65, 0x00, 0x6C, 0x00])) {
return {
ext: 'skp',
mime: 'application/vnd.sketchup.skp'
};
}
if (checkString('-----BEGIN PGP MESSAGE-----')) {
return {
ext: 'pgp',
mime: 'application/pgp-encrypted'
};
}
// Check MPEG 1 or 2 Layer 3 header, or 'layer 0' for ADTS (MPEG sync-word 0xFFE)
if (buffer.length >= 2 && check([0xFF, 0xE0], {offset: 0, mask: [0xFF, 0xE0]})) {
if (check([0x10], {offset: 1, mask: [0x16]})) {
// Check for (ADTS) MPEG-2
if (check([0x08], {offset: 1, mask: [0x08]})) {
return {
ext: 'aac',
mime: 'audio/aac'
};
}
// Must be (ADTS) MPEG-4
return {
ext: 'aac',
mime: 'audio/aac'
};
}
// MPEG 1 or 2 Layer 3 header
// Check for MPEG layer 3
if (check([0x02], {offset: 1, mask: [0x06]})) {
return {
ext: 'mp3',
mime: 'audio/mpeg'
};
}
// Check for MPEG layer 2
if (check([0x04], {offset: 1, mask: [0x06]})) {
return {
ext: 'mp2',
mime: 'audio/mpeg'
};
}
// Check for MPEG layer 1
if (check([0x06], {offset: 1, mask: [0x06]})) {
return {
ext: 'mp1',
mime: 'audio/mpeg'
};
}
}
}
const stream = readableStream => new Promise((resolve, reject) => {
// Using `eval` to work around issues when bundling with Webpack
const stream = eval('require')('stream'); // eslint-disable-line no-eval
readableStream.on('error', reject);
readableStream.once('readable', async () => {
// Set up output stream
const pass = new stream.PassThrough();
let outputStream;
if (stream.pipeline) {
outputStream = stream.pipeline(readableStream, pass, () => {
});
} else {
outputStream = readableStream.pipe(pass);
}
// Read the input stream and detect the filetype
const chunk = readableStream.read(minimumBytes) || readableStream.read() || Buffer.alloc(0);
try {
const fileType = await fromBuffer(chunk);
pass.fileType = fileType;
} catch (error) {
reject(error);
}
resolve(outputStream);
});
});
const fileType = {
fromStream,
fromTokenizer,
fromBuffer,
stream
};
Object.defineProperty(fileType, 'extensions', {
get() {
return new Set(supported.extensions);
}
});
Object.defineProperty(fileType, 'mimeTypes', {
get() {
return new Set(supported.mimeTypes);
}
});
module.exports = fileType;
/***/ }),
/***/ 4930:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
"use strict";
const strtok3 = __nccwpck_require__(8569);
const core = __nccwpck_require__(4126);
async function fromFile(path) {
const tokenizer = await strtok3.fromFile(path);
try {
return await core.fromTokenizer(tokenizer);
} finally {
await tokenizer.close();
}
}
const fileType = {
fromFile
};
Object.assign(fileType, core);
Object.defineProperty(fileType, 'extensions', {
get() {
return core.extensions;
}
});
Object.defineProperty(fileType, 'mimeTypes', {
get() {
return core.mimeTypes;
}
});
module.exports = fileType;
/***/ }),
/***/ 7860:
/***/ ((module) => {
"use strict";
module.exports = {
extensions: [
'jpg',
'png',
'apng',
'gif',
'webp',
'flif',
'xcf',
'cr2',
'cr3',
'orf',
'arw',
'dng',
'nef',
'rw2',
'raf',
'tif',
'bmp',
'icns',
'jxr',
'psd',
'indd',
'zip',
'tar',
'rar',
'gz',
'bz2',
'7z',
'dmg',
'mp4',
'mid',
'mkv',
'webm',
'mov',
'avi',
'mpg',
'mp2',
'mp3',
'm4a',
'oga',
'ogg',
'ogv',
'opus',
'flac',
'wav',
'spx',
'amr',
'pdf',
'epub',
'exe',
'swf',
'rtf',
'wasm',
'woff',
'woff2',
'eot',
'ttf',
'otf',
'ico',
'flv',
'ps',
'xz',
'sqlite',
'nes',
'crx',
'xpi',
'cab',
'deb',
'ar',
'rpm',
'Z',
'lz',
'cfb',
'mxf',
'mts',
'blend',
'bpg',
'docx',
'pptx',
'xlsx',
'3gp',
'3g2',
'jp2',
'jpm',
'jpx',
'mj2',
'aif',
'qcp',
'odt',
'ods',
'odp',
'xml',
'mobi',
'heic',
'cur',
'ktx',
'ape',
'wv',
'dcm',
'ics',
'glb',
'pcap',
'dsf',
'lnk',
'alias',
'voc',
'ac3',
'm4v',
'm4p',
'm4b',
'f4v',
'f4p',
'f4b',
'f4a',
'mie',
'asf',
'ogm',
'ogx',
'mpc',
'arrow',
'shp',
'aac',
'mp1',
'it',
's3m',
'xm',
'ai',
'skp',
'avif',
'eps',
'lzh',
'pgp',
'asar',
'stl',
'chm',
'3mf',
'zst',
'jxl',
'vcf'
],
mimeTypes: [
'image/jpeg',
'image/png',
'image/gif',
'image/webp',
'image/flif',
'image/x-xcf',
'image/x-canon-cr2',
'image/x-canon-cr3',
'image/tiff',
'image/bmp',
'image/vnd.ms-photo',
'image/vnd.adobe.photoshop',
'application/x-indesign',
'application/epub+zip',
'application/x-xpinstall',
'application/vnd.oasis.opendocument.text',
'application/vnd.oasis.opendocument.spreadsheet',
'application/vnd.oasis.opendocument.presentation',
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'application/vnd.openxmlformats-officedocument.presentationml.presentation',
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'application/zip',
'application/x-tar',
'application/x-rar-compressed',
'application/gzip',
'application/x-bzip2',
'application/x-7z-compressed',
'application/x-apple-diskimage',
'application/x-apache-arrow',
'video/mp4',
'audio/midi',
'video/x-matroska',
'video/webm',
'video/quicktime',
'video/vnd.avi',
'audio/vnd.wave',
'audio/qcelp',
'audio/x-ms-asf',
'video/x-ms-asf',
'application/vnd.ms-asf',
'video/mpeg',
'video/3gpp',
'audio/mpeg',
'audio/mp4', // RFC 4337
'audio/opus',
'video/ogg',
'audio/ogg',
'application/ogg',
'audio/x-flac',
'audio/ape',
'audio/wavpack',
'audio/amr',
'application/pdf',
'application/x-msdownload',
'application/x-shockwave-flash',
'application/rtf',
'application/wasm',
'font/woff',
'font/woff2',
'application/vnd.ms-fontobject',
'font/ttf',
'font/otf',
'image/x-icon',
'video/x-flv',
'application/postscript',
'application/eps',
'application/x-xz',
'application/x-sqlite3',
'application/x-nintendo-nes-rom',
'application/x-google-chrome-extension',
'application/vnd.ms-cab-compressed',
'application/x-deb',
'application/x-unix-archive',
'application/x-rpm',
'application/x-compress',
'application/x-lzip',
'application/x-cfb',
'application/x-mie',
'application/mxf',
'video/mp2t',
'application/x-blender',
'image/bpg',
'image/jp2',
'image/jpx',
'image/jpm',
'image/mj2',
'audio/aiff',
'application/xml',
'application/x-mobipocket-ebook',
'image/heif',
'image/heif-sequence',
'image/heic',
'image/heic-sequence',
'image/icns',
'image/ktx',
'application/dicom',
'audio/x-musepack',
'text/calendar',
'text/vcard',
'model/gltf-binary',
'application/vnd.tcpdump.pcap',
'audio/x-dsf', // Non-standard
'application/x.ms.shortcut', // Invented by us
'application/x.apple.alias', // Invented by us
'audio/x-voc',
'audio/vnd.dolby.dd-raw',
'audio/x-m4a',
'image/apng',
'image/x-olympus-orf',
'image/x-sony-arw',
'image/x-adobe-dng',
'image/x-nikon-nef',
'image/x-panasonic-rw2',
'image/x-fujifilm-raf',
'video/x-m4v',
'video/3gpp2',
'application/x-esri-shape',
'audio/aac',
'audio/x-it',
'audio/x-s3m',
'audio/x-xm',
'video/MP1S',
'video/MP2P',
'application/vnd.sketchup.skp',
'image/avif',
'application/x-lzh-compressed',
'application/pgp-encrypted',
'application/x-asar',
'model/stl',
'application/vnd.ms-htmlhelp',
'model/3mf',
'image/jxl',
'application/zstd'
]
};
/***/ }),
/***/ 4875:
/***/ ((__unused_webpack_module, exports) => {
"use strict";
exports.stringToBytes = string => [...string].map(character => character.charCodeAt(0));
/**
Checks whether the TAR checksum is valid.
@param {Buffer} buffer - The TAR header `[offset ... offset + 512]`.
@param {number} offset - TAR header offset.
@returns {boolean} `true` if the TAR checksum is valid, otherwise `false`.
*/
exports.tarHeaderChecksumMatches = (buffer, offset = 0) => {
const readSum = parseInt(buffer.toString('utf8', 148, 154).replace(/\0.*$/, '').trim(), 8); // Read sum in header
if (isNaN(readSum)) {
return false;
}
let sum = 8 * 0x20; // Initialize signed bit sum
for (let i = offset; i < offset + 148; i++) {
sum += buffer[i];
}
for (let i = offset + 156; i < offset + 512; i++) {
sum += buffer[i];
}
return readSum === sum;
};
/**
ID3 UINT32 sync-safe tokenizer token.
28 bits (representing up to 256MB) integer, the msb is 0 to avoid "false syncsignals".
*/
exports.uint32SyncSafeToken = {
get: (buffer, offset) => {
return (buffer[offset + 3] & 0x7F) | ((buffer[offset + 2]) << 7) | ((buffer[offset + 1]) << 14) | ((buffer[offset]) << 21);
},
len: 4
};
/***/ }),
/***/ 2540:
/***/ ((module) => {
"use strict";
/** @class BitmapImage */
class BitmapImage {
/**
* BitmapImage is a class that hold an RGBA (red, green, blue, alpha) representation of an image. It's shape is borrowed from the Jimp package to make it easy to transfer GIF image frames into Jimp and Jimp images into GIF image frames. Each instance has a `bitmap` property having the following properties:
*
* Property | Description
* --- | ---
* bitmap.width | width of image in pixels
* bitmap.height | height of image in pixels
* bitmap.data | a Buffer whose every four bytes represents a pixel, each sequential byte of a pixel corresponding to the red, green, blue, and alpha values of the pixel
*
* Its constructor supports the following signatures:
*
* * new BitmapImage(bitmap: { width: number, height: number, data: Buffer })
* * new BitmapImage(bitmapImage: BitmapImage)
* * new BitmapImage(width: number, height: number, buffer: Buffer)
* * new BitmapImage(width: number, height: number, backgroundRGBA?: number)
*
* When a `BitmapImage` is provided, the constructed `BitmapImage` is a deep clone of the provided one, so that each image's pixel data can subsequently be modified without affecting each other.
*
* `backgroundRGBA` is an optional parameter representing a pixel as a single number. In hex, the number is as follows: 0xRRGGBBAA, where RR is the red byte, GG the green byte, BB, the blue byte, and AA the alpha value. An AA of 0x00 is considered transparent, and all non-zero AA values are treated as opaque.
*/
constructor(...args) {
// don't confirm the number of args, because a subclass may have
// additional args and pass them all to the superclass
if (args.length === 0) {
throw new Error("constructor requires parameters");
}
const firstArg = args[0];
if (firstArg !== null && typeof firstArg === 'object') {
if (firstArg instanceof BitmapImage) {
// copy a provided BitmapImage
const sourceBitmap = firstArg.bitmap;
this.bitmap = {
width: sourceBitmap.width,
height: sourceBitmap.height,
data: new Buffer(sourceBitmap.width * sourceBitmap.height * 4)
};
sourceBitmap.data.copy(this.bitmap.data);
}
else if (firstArg.width && firstArg.height && firstArg.data) {
// share a provided bitmap
this.bitmap = firstArg;
}
else {
throw new Error("unrecognized constructor parameters");
}
}
else if (typeof firstArg === 'number' && typeof args[1] === 'number')
{
const width = firstArg;
const height = args[1];
const thirdArg = args[2];
this.bitmap = { width, height };
if (Buffer.isBuffer(thirdArg)) {
this.bitmap.data = thirdArg;
}
else {
this.bitmap.data = new Buffer(width * height * 4);
if (typeof thirdArg === 'number') {
this.fillRGBA(thirdArg);
}
}
}
else {
throw new Error("unrecognized constructor parameters");
}
}
/**
* Copy a square portion of this image into another image.
*
* @param {BitmapImage} toImage Image into which to copy the square
* @param {number} toX x-coord in toImage of upper-left corner of receiving square
* @param {number} toY y-coord in toImage of upper-left corner of receiving square
* @param {number} fromX x-coord in this image of upper-left corner of source square
* @param {number} fromY y-coord in this image of upper-left corner of source square
* @return {BitmapImage} The present image to allow for chaining.
*/
blit(toImage, toX, toY, fromX, fromY, fromWidth, fromHeight) {
if (fromX + fromWidth > this.bitmap.width) {
throw new Error("copy exceeds width of source bitmap");
}
if (toX + fromWidth > toImage.bitmap.width) {
throw new Error("copy exceeds width of target bitmap");
}
if (fromY + fromHeight > this.bitmap.height) {
throw new Error("copy exceeds height of source bitmap");
}
if (toY + fromHeight > toImage.bitmap.height) {
throw new Erro("copy exceeds height of target bitmap");
}
const sourceBuf = this.bitmap.data;
const targetBuf = toImage.bitmap.data;
const sourceByteWidth = this.bitmap.width * 4;
const targetByteWidth = toImage.bitmap.width * 4;
const copyByteWidth = fromWidth * 4;
let si = fromY * sourceByteWidth + fromX * 4;
let ti = toY * targetByteWidth + toX * 4;
while (--fromHeight >= 0) {
sourceBuf.copy(targetBuf, ti, si, si + copyByteWidth);
si += sourceByteWidth;
ti += targetByteWidth;
}
return this;
}
/**
* Fills the image with a single color.
*
* @param {number} rgba Color with which to fill image, expressed as a singlenumber in the form 0xRRGGBBAA, where AA is 0x00 for transparent and any other value for opaque.
* @return {BitmapImage} The present image to allow for chaining.
*/
fillRGBA(rgba) {
const buf = this.bitmap.data;
const bufByteWidth = this.bitmap.height * 4;
let bi = 0;
while (bi < bufByteWidth) {
buf.writeUInt32BE(rgba, bi);
bi += 4;
}
while (bi < buf.length) {
buf.copy(buf, bi, 0, bufByteWidth);
bi += bufByteWidth;
}
return this;
}
/**
* Gets the RGBA number of the pixel at the given coordinate in the form 0xRRGGBBAA, where AA is the alpha value, with alpha 0x00 encoding to transparency in GIFs.
*
* @param {number} x x-coord of pixel
* @param {number} y y-coord of pixel
* @return {number} RGBA of pixel in 0xRRGGBBAA form
*/
getRGBA(x, y) {
const bi = (y * this.bitmap.width + x) * 4;
return this.bitmap.data.readUInt32BE(bi);
}
/**
* Gets a set of all RGBA colors found within the image.
*
* @return {Set} Set of all RGBA colors that the image contains.
*/
getRGBASet() {
const rgbaSet = new Set();
const buf = this.bitmap.data;
for (let bi = 0; bi < buf.length; bi += 4) {
rgbaSet.add(buf.readUInt32BE(bi, true));
}
return rgbaSet;
}
/**
* Converts the image to greyscale using inferred Adobe metrics.
*
* @return {BitmapImage} The present image to allow for chaining.
*/
greyscale() {
const buf = this.bitmap.data;
this.scan(0, 0, this.bitmap.width, this.bitmap.height, (x, y, idx) => {
const grey = Math.round(
0.299 * buf[idx] +
0.587 * buf[idx + 1] +
0.114 * buf[idx + 2]
);
buf[idx] = grey;
buf[idx + 1] = grey;
buf[idx + 2] = grey;
});
return this;
}
/**
* Reframes the image as if placing a frame around the original image and replacing the original image with the newly framed image. When the new frame is strictly within the boundaries of the original image, this method crops the image. When any of the new boundaries exceed those of the original image, the `fillRGBA` must be provided to indicate the color with which to fill the extra space added to the image.
*
* @param {number} xOffset The x-coord offset of the upper-left pixel of the desired image relative to the present image.
* @param {number} yOffset The y-coord offset of the upper-left pixel of the desired image relative to the present image.
* @param {number} width The width of the new image after reframing
* @param {number} height The height of the new image after reframing
* @param {number} fillRGBA The color with which to fill space added to the image as a result of the reframing, in 0xRRGGBBAA format, where AA is 0x00 to indicate transparent and a non-zero value to indicate opaque. This parameter is only required when the reframing exceeds the original boundaries (i.e. does not simply perform a crop).
* @return {BitmapImage} The present image to allow for chaining.
*/
reframe(xOffset, yOffset, width, height, fillRGBA) {
const cropX = (xOffset < 0 ? 0 : xOffset);
const cropY = (yOffset < 0 ? 0 : yOffset);
const cropWidth = (width + cropX > this.bitmap.width ?
this.bitmap.width - cropX : width);
const cropHeight = (height + cropY > this.bitmap.height ?
this.bitmap.height - cropY : height);
const newX = (xOffset < 0 ? -xOffset : 0);
const newY = (yOffset < 0 ? -yOffset : 0);
let image;
if (fillRGBA === undefined) {
if (cropX !== xOffset || cropY != yOffset ||
cropWidth !== width || cropHeight !== height)
{
throw new GifError(`fillRGBA required for this reframing`);
}
image = new BitmapImage(width, height);
}
else {
image = new BitmapImage(width, height, fillRGBA);
}
this.blit(image, newX, newY, cropX, cropY, cropWidth, cropHeight);
this.bitmap = image.bitmap;
return this;
}
/**
* Scales the image size up by an integer factor. Each pixel of the original image becomes a square of the same color in the new image having a size of `factor` x `factor` pixels.
*
* @param {number} factor The factor by which to scale up the image. Must be an integer >= 1.
* @return {BitmapImage} The present image to allow for chaining.
*/
scale(factor) {
if (factor === 1) {
return;
}
if (!Number.isInteger(factor) || factor < 1) {
throw new Error("the scale must be an integer >= 1");
}
const sourceWidth = this.bitmap.width;
const sourceHeight = this.bitmap.height;
const destByteWidth = sourceWidth * factor * 4;
const sourceBuf = this.bitmap.data;
const destBuf = new Buffer(sourceHeight * destByteWidth * factor);
let sourceIndex = 0;
let priorDestRowIndex;
let destIndex = 0;
for (let y = 0; y < sourceHeight; ++y) {
priorDestRowIndex = destIndex;
for (let x = 0; x < sourceWidth; ++x) {
const color = sourceBuf.readUInt32BE(sourceIndex, true);
for (let cx = 0; cx < factor; ++cx) {
destBuf.writeUInt32BE(color, destIndex);
destIndex += 4;
}
sourceIndex += 4;
}
for (let cy = 1; cy < factor; ++cy) {
destBuf.copy(destBuf, destIndex, priorDestRowIndex, destIndex);
destIndex += destByteWidth;
priorDestRowIndex += destByteWidth;
}
}
this.bitmap = {
width: sourceWidth * factor,
height: sourceHeight * factor,
data: destBuf
};
return this;
}
/**
* Scans all coordinates of the image, handing each in turn to the provided handler function.
*
* @param {function} scanHandler A function(x: number, y: number, bi: number) to be called for each pixel of the image with that pixel's x-coord, y-coord, and index into the `data` buffer. The function accesses the pixel at this coordinate by accessing the `this.data` at index `bi`.
* @see scanAllIndexes
*/
scanAllCoords(scanHandler) {
const width = this.bitmap.width;
const bufferLength = this.bitmap.data.length;
let x = 0;
let y = 0;
for (let bi = 0; bi < bufferLength; bi += 4) {
scanHandler(x, y, bi);
if (++x === width) {
x = 0;
++y;
}
}
}
/**
* Scans all pixels of the image, handing the index of each in turn to the provided handler function. Runs a bit faster than `scanAllCoords()`, should the handler not need pixel coordinates.
*
* @param {function} scanHandler A function(bi: number) to be called for each pixel of the image with that pixel's index into the `data` buffer. The pixels is found at index 'bi' within `this.data`.
* @see scanAllCoords
*/
scanAllIndexes(scanHandler) {
const bufferLength = this.bitmap.data.length;
for (let bi = 0; bi < bufferLength; bi += 4) {
scanHandler(bi);
}
}
}
module.exports = BitmapImage;
/***/ }),
/***/ 4345:
/***/ ((__unused_webpack_module, exports) => {
"use strict";
/** @class Gif */
class Gif {
// width - width of GIF in pixels
// height - height of GIF in pixels
// loops - 0 = unending; (n > 0) = iterate n times
// usesTransparency - whether any frames have transparent pixels
// colorScope - scope of color tables in GIF
// frames - array of frames
// buffer - GIF-formatted data
/**
* Gif is a class representing an encoded GIF. It is intended to be a read-only representation of a byte-encoded GIF. Only encoders and decoders should be creating instances of this class.
*
* Property | Description
* --- | ---
* width | width of the GIF at its widest
* height | height of the GIF at its highest
* loops | the number of times the GIF should loop before stopping; 0 => loop indefinitely
* usesTransparency | boolean indicating whether at least one frame contains at least one transparent pixel
* colorScope | the scope of the color tables as encoded within the GIF; either Gif.GlobalColorsOnly (== 1) or Gif.LocalColorsOnly (== 2).
* frames | a array of GifFrame instances, one for each frame of the GIF
* buffer | a Buffer holding the encoding's byte data
*
* Its constructor should only ever be called by the GIF encoder or decoder.
*
* @param {Buffer} buffer A Buffer containing the encoded bytes
* @param {GifFrame[]} frames Array of frames found in the encoding
* @param {object} spec Properties of the encoding as listed above
*/
constructor(buffer, frames, spec) {
this.width = spec.width;
this.height = spec.height;
this.loops = spec.loops;
this.usesTransparency = spec.usesTransparency;
this.colorScope = spec.colorScope;
this.frames = frames;
this.buffer = buffer;
}
}
Gif.GlobalColorsPreferred = 0;
Gif.GlobalColorsOnly = 1;
Gif.LocalColorsOnly = 2;
/** @class GifError */
class GifError extends Error {
/**
* GifError is a class representing a GIF-related error
*
* @param {string|Error} messageOrError
*/
constructor(messageOrError) {
super(messageOrError);
if (messageOrError instanceof Error) {
this.stack = 'Gif' + messageOrError.stack;
}
}
}
exports.Gif = Gif;
exports.GifError = GifError;
/***/ }),
/***/ 1445:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
const Omggif = __nccwpck_require__(9717);
const { Gif, GifError } = __nccwpck_require__(4345);
// allow circular dependency with GifUtil
function GifUtil() {
const data = __nccwpck_require__(4511);
GifUtil = function () {
return data;
};
return data;
}
const { GifFrame } = __nccwpck_require__(1756);
const PER_GIF_OVERHEAD = 200; // these are guesses at upper limits
const PER_FRAME_OVERHEAD = 100;
// Note: I experimented with accepting a global color table when encoding and returning the global color table when decoding. Doing this properly greatly increased the complexity of the code and the amount of clock cycles required. The main issue is that each frame can specify any color of the global color table to be transparent within the frame, while this GIF library strives to hide GIF formatting details from its clients. E.g. it's possible to have 256 colors in the global color table and different transparencies in each frame, requiring clients to either provide per-frame transparency indexes, or for arcane reasons that won't be apparent to client developers, encode some GIFs with local color tables that previously decoded with global tables.
/** @class GifCodec */
class GifCodec
{
// _transparentRGBA - RGB given to transparent pixels (alpha=0) on decode; defaults to null indicating 0x000000, which is fastest
/**
* GifCodec is a class that both encodes and decodes GIFs. It implements both the `encode()` method expected of an encoder and the `decode()` method expected of a decoder, and it wraps the `omggif` GIF encoder/decoder package. GifCodec serves as this library's default encoder and decoder, but it's possible to wrap other GIF encoders and decoders for use by `gifwrap` as well. GifCodec will not encode GIFs with interlacing.
*
* Instances of this class are stateless and can be shared across multiple encodings and decodings.
*
* Its constructor takes one option argument:
*
* @param {object} options Optionally takes an objection whose only possible property is `transparentRGB`. Images are internally represented in RGBA format, where A is the alpha value of a pixel. When `transparentRGB` is provided, this RGB value (excluding alpha) is assigned to transparent pixels, which are also given alpha value 0x00. (All opaque pixels are given alpha value 0xFF). The RGB color of transparent pixels shouldn't matter for most applications. Defaults to 0x000000.
*/
constructor(options = {}) {
this._transparentRGB = null; // 0x000000
if (typeof options.transparentRGB === 'number' &&
options.transparentRGB !== 0)
{
this._transparentRGBA = options.transparentRGB * 256;
}
this._testInitialBufferSize = 0; // assume no buffer scaling test
}
/**
* Decodes a GIF from a Buffer to yield an instance of Gif. Transparent pixels of the GIF are given alpha values of 0x00, and opaque pixels are given alpha values of 0xFF. The RGB values of transparent pixels default to 0x000000 but can be overridden by the constructor's `transparentRGB` option.
*
* @param {Buffer} buffer Bytes of an encoded GIF to decode.
* @return {Promise} A Promise that resolves to an instance of the Gif class, representing the encoded GIF.
* @throws {GifError} Error upon encountered an encoding-related problem with a GIF, so that the caller can distinguish between software errors and problems with GIFs.
*/
decodeGif(buffer) {
try {
let reader;
try {
reader = new Omggif.GifReader(buffer);
}
catch (err) {
throw new GifError(err);
}
const frameCount = reader.numFrames();
const frames = [];
const spec = {
width: reader.width,
height: reader.height,
loops: reader.loopCount()
};
spec.usesTransparency = false;
for (let i = 0; i < frameCount; ++i) {
const frameInfo =
this._decodeFrame(reader, i, spec.usesTransparency);
frames.push(frameInfo.frame);
if (frameInfo.usesTransparency) {
spec.usesTransparency = true;
}
}
return Promise.resolve(new Gif(buffer, frames, spec));
}
catch (err) {
return Promise.reject(err);
}
}
/**
* Encodes a GIF from provided frames. Each pixel having an alpha value of 0x00 renders as transparent within the encoding, while all pixels of non-zero alpha value render as opaque.
*
* @param {GifFrame[]} frames Array of frames to encode
* @param {object} spec An optional object that may provide values for `loops` and `colorScope`, as defined for the Gif class. However, `colorSpace` may also take the value Gif.GlobalColorsPreferred (== 0) to indicate that the encoder should attempt to create only a global color table. `loop` defaults to 0, looping indefinitely. Set `loop` to null to disable looping, playing only once. `colorScope` defaults to Gif.GlobalColorsPreferred.
* @return {Promise} A Promise that resolves to an instance of the Gif class, representing the encoded GIF.
* @throws {GifError} Error upon encountered an encoding-related problem with a GIF, so that the caller can distinguish between software errors and problems with GIFs.
*/
encodeGif(frames, spec = {}) {
try {
if (frames === null || frames.length === 0) {
throw new GifError("there are no frames");
}
const dims = GifUtil().getMaxDimensions(frames);
spec = Object.assign({}, spec); // don't munge caller's spec
spec.width = dims.maxWidth;
spec.height = dims.maxHeight;
if (spec.loops === undefined) {
spec.loops = 0;
}
spec.colorScope = spec.colorScope || Gif.GlobalColorsPreferred;
return Promise.resolve(this._encodeGif(frames, spec));
}
catch (err) {
return Promise.reject(err);
}
}
_decodeFrame(reader, frameIndex, alreadyUsedTransparency) {
let info, buffer;
try {
info = reader.frameInfo(frameIndex);
buffer = new Buffer(reader.width * reader.height * 4);
reader.decodeAndBlitFrameRGBA(frameIndex, buffer);
if (info.width !== reader.width || info.height !== reader.height) {
if (info.y) {
// skip unused rows
buffer = buffer.slice(info.y * reader.width * 4);
}
if (reader.width > info.width) {
// skip scanstride
for (let ii = 0; ii < info.height; ++ii) {
buffer.copy(buffer, ii * info.width * 4,
(info.x + ii * reader.width) * 4,
(info.x + ii * reader.width) * 4 + info.width * 4);
}
}
// trim buffer to size
buffer = buffer.slice(0, info.width * info.height * 4);
}
}
catch (err) {
throw new GifError(err);
}
let usesTransparency = false;
if (this._transparentRGBA === null) {
if (!alreadyUsedTransparency) {
for (let i = 3; i < buffer.length; i += 4) {
if (buffer[i] === 0) {
usesTransparency = true;
i = buffer.length;
}
}
}
}
else {
for (let i = 3; i < buffer.length; i += 4) {
if (buffer[i] === 0) {
buffer.writeUInt32BE(this._transparentRGBA, i - 3);
usesTransparency = true; // GIF might encode unused index
}
}
}
const frame = new GifFrame(info.width, info.height, buffer, {
xOffset: info.x,
yOffset: info.y,
disposalMethod: info.disposal,
interlaced: info.interlaced,
delayCentisecs: info.delay
});
return { frame, usesTransparency };
}
_encodeGif(frames, spec) {
let colorInfo;
if (spec.colorScope === Gif.LocalColorsOnly) {
colorInfo = GifUtil().getColorInfo(frames, 0);
}
else {
colorInfo = GifUtil().getColorInfo(frames, 256);
if (!colorInfo.colors) { // if global palette impossible
if (spec.colorScope === Gif.GlobalColorsOnly) {
throw new GifError(
"Too many color indexes for global color table");
}
spec.colorScope = Gif.LocalColorsOnly
}
}
spec.usesTransparency = colorInfo.usesTransparency;
const localPalettes = colorInfo.palettes;
if (spec.colorScope === Gif.LocalColorsOnly) {
const localSizeEst = 2000; //this._getSizeEstimateLocal(localPalettes, frames);
return _encodeLocal(frames, spec, localSizeEst, localPalettes);
}
const globalSizeEst = 2000; //this._getSizeEstimateGlobal(colorInfo, frames);
return _encodeGlobal(frames, spec, globalSizeEst, colorInfo);
}
_getSizeEstimateGlobal(globalPalette, frames) {
if (this._testInitialBufferSize > 0) {
return this._testInitialBufferSize;
}
let sizeEst = PER_GIF_OVERHEAD + 3*256 /* max palette size*/;
const pixelBitWidth = _getPixelBitWidth(globalPalette);
frames.forEach(frame => {
sizeEst += _getFrameSizeEst(frame, pixelBitWidth);
});
return sizeEst; // should be the upper limit
}
_getSizeEstimateLocal(palettes, frames) {
if (this._testInitialBufferSize > 0) {
return this._testInitialBufferSize;
}
let sizeEst = PER_GIF_OVERHEAD;
for (let i = 0; i < frames.length; ++i ) {
const palette = palettes[i];
const pixelBitWidth = _getPixelBitWidth(palette);
sizeEst += _getFrameSizeEst(frames[i], pixelBitWidth);
}
return sizeEst; // should be the upper limit
}
}
exports.GifCodec = GifCodec;
function _colorLookupLinear(colors, color) {
const index = colors.indexOf(color);
return (index === -1 ? null : index);
}
function _colorLookupBinary(colors, color) {
// adapted from https://stackoverflow.com/a/10264318/650894
var lo = 0, hi = colors.length - 1, mid;
while (lo <= hi) {
mid = Math.floor((lo + hi)/2);
if (colors[mid] > color)
hi = mid - 1;
else if (colors[mid] < color)
lo = mid + 1;
else
return mid;
}
return null;
}
function _encodeGlobal(frames, spec, bufferSizeEst, globalPalette) {
// would be inefficient for frames to lookup colors in extended palette
const extendedGlobalPalette = {
colors: globalPalette.colors.slice(),
usesTransparency: globalPalette.usesTransparency
};
_extendPaletteToPowerOf2(extendedGlobalPalette);
const options = {
palette: extendedGlobalPalette.colors,
loop: spec.loops
};
let buffer = new Buffer(bufferSizeEst);
let gifWriter;
try {
gifWriter = new Omggif.GifWriter(buffer, spec.width, spec.height,
options);
}
catch (err) {
throw new GifError(err);
}
for (let i = 0; i < frames.length; ++i) {
buffer = _writeFrame(gifWriter, i, frames[i], globalPalette, false);
}
return new Gif(buffer.slice(0, gifWriter.end()), frames, spec);
}
function _encodeLocal(frames, spec, bufferSizeEst, localPalettes) {
const options = {
loop: spec.loops
};
let buffer = new Buffer(bufferSizeEst);
let gifWriter;
try {
gifWriter = new Omggif.GifWriter(buffer, spec.width, spec.height,
options);
}
catch (err) {
throw new GifError(err);
}
for (let i = 0; i < frames.length; ++i) {
buffer = _writeFrame(gifWriter, i, frames[i], localPalettes[i], true);
}
return new Gif(buffer.slice(0, gifWriter.end()), frames, spec);
}
function _extendPaletteToPowerOf2(palette) {
const colors = palette.colors;
if (palette.usesTransparency) {
colors.push(0);
}
const colorCount = colors.length;
let powerOf2 = 2;
while (colorCount > powerOf2) {
powerOf2 <<= 1;
}
colors.length = powerOf2;
colors.fill(0, colorCount);
}
function _getFrameSizeEst(frame, pixelBitWidth) {
let byteLength = frame.bitmap.width * frame.bitmap.height;
byteLength = Math.ceil(byteLength * pixelBitWidth / 8);
byteLength += Math.ceil(byteLength / 255); // add block size bytes
// assume maximum palete size because it might get extended for power of 2
return (PER_FRAME_OVERHEAD + byteLength + 3 * 256 /* largest palette */);
}
function _getIndexedImage(frameIndex, frame, palette) {
const colors = palette.colors;
const colorToIndexFunc = (colors.length <= 8 ? // guess at the break-even
_colorLookupLinear : _colorLookupBinary);
const colorBuffer = frame.bitmap.data;
const indexBuffer = new Buffer(colorBuffer.length/4);
let transparentIndex = colors.length;
let i = 0, j = 0;
while (i < colorBuffer.length) {
if (colorBuffer[i + 3] !== 0) {
const color = (colorBuffer.readUInt32BE(i, true) >> 8) & 0xFFFFFF;
// caller guarantees that the color will be in the palette
indexBuffer[j] = colorToIndexFunc(colors, color);
}
else {
indexBuffer[j] = transparentIndex;
}
i += 4; // skip alpha
++j;
}
if (palette.usesTransparency) {
if (transparentIndex === 256) {
throw new GifError(`Frame ${frameIndex} already has 256 colors` +
`and so can't use transparency`);
}
}
else {
transparentIndex = null;
}
return { buffer: indexBuffer, transparentIndex };
}
function _getPixelBitWidth(palette) {
let indexCount = palette.indexCount;
let pixelBitWidth = 0;
--indexCount; // start at maximum index
while (indexCount) {
++pixelBitWidth;
indexCount >>= 1;
}
return (pixelBitWidth > 0 ? pixelBitWidth : 1);
}
function _writeFrame(gifWriter, frameIndex, frame, palette, isLocalPalette) {
if (frame.interlaced) {
throw new GifError("writing interlaced GIFs is not supported");
}
const frameInfo = _getIndexedImage(frameIndex, frame, palette);
const options = {
delay: frame.delayCentisecs,
disposal: frame.disposalMethod,
transparent: frameInfo.transparentIndex
};
if (isLocalPalette) {
_extendPaletteToPowerOf2(palette); // ok 'cause palette never used again
options.palette = palette.colors;
}
try {
let buffer = gifWriter.getOutputBuffer();
let startOfFrame = gifWriter.getOutputBufferPosition();
let endOfFrame;
let tryAgain = true;
while (tryAgain) {
endOfFrame = gifWriter.addFrame(frame.xOffset, frame.yOffset,
frame.bitmap.width, frame.bitmap.height, frameInfo.buffer, options);
tryAgain = false;
if (endOfFrame >= buffer.length - 1) {
const biggerBuffer = new Buffer(buffer.length * 1.5);
buffer.copy(biggerBuffer);
gifWriter.setOutputBuffer(biggerBuffer);
gifWriter.setOutputBufferPosition(startOfFrame);
buffer = biggerBuffer;
tryAgain = true;
}
}
return buffer;
}
catch (err) {
throw new GifError(err);
}
}
/***/ }),
/***/ 1756:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
const BitmapImage = __nccwpck_require__(2540);
const { GifError } = __nccwpck_require__(4345);
/** @class GifFrame */
class GifFrame extends BitmapImage {
// xOffset - x offset of bitmap on GIF (defaults to 0)
// yOffset - y offset of bitmap on GIF (defaults to 0)
// disposalMethod - pixel disposal method when handling partial images
// delayCentisecs - duration of frame in hundredths of a second
// interlaced - whether the image is interlaced (defaults to false)
/**
* GifFrame is a class representing an image frame of a GIF. GIFs contain one or more instances of GifFrame.
*
* Property | Description
* --- | ---
* xOffset | x-coord of position within GIF at which to render the image (defaults to 0)
* yOffset | y-coord of position within GIF at which to render the image (defaults to 0)
* disposalMethod | GIF disposal method; only relevant when the frames aren't all the same size (defaults to 2, disposing to background color)
* delayCentisecs | duration of the frame in hundreths of a second
* interlaced | boolean indicating whether the frame renders interlaced
*
* Its constructor supports the following signatures:
*
* * new GifFrame(bitmap: {width: number, height: number, data: Buffer}, options?)
* * new GifFrame(bitmapImage: BitmapImage, options?)
* * new GifFrame(width: number, height: number, buffer: Buffer, options?)
* * new GifFrame(width: number, height: number, backgroundRGBA?: number, options?)
* * new GifFrame(frame: GifFrame)
*
* See the base class BitmapImage for a discussion of all parameters but `options` and `frame`. `options` is an optional argument providing initial values for the above-listed GifFrame properties. Each property within option is itself optional.
*
* Provide a `frame` to the constructor to create a clone of the provided frame. The new frame includes a copy of the provided frame's pixel data so that each can subsequently be modified without affecting each other.
*/
constructor(...args) {
super(...args);
if (args[0] instanceof GifFrame) {
// copy a provided GifFrame
const source = args[0];
this.xOffset = source.xOffset;
this.yOffset = source.yOffset;
this.disposalMethod = source.disposalMethod;
this.delayCentisecs = source.delayCentisecs;
this.interlaced = source.interlaced;
}
else {
const lastArg = args[args.length - 1];
let options = {};
if (typeof lastArg === 'object' && !(lastArg instanceof BitmapImage)) {
options = lastArg;
}
this.xOffset = options.xOffset || 0;
this.yOffset = options.yOffset || 0;
this.disposalMethod = (options.disposalMethod !== undefined ?
options.disposalMethod : GifFrame.DisposeToBackgroundColor);
this.delayCentisecs = options.delayCentisecs || 8;
this.interlaced = options.interlaced || false;
}
}
/**
* Get a summary of the colors found within the frame. The return value is an object of the following form:
*
* Property | Description
* --- | ---
* colors | An array of all the opaque colors found within the frame. Each color is given as an RGB number of the form 0xRRGGBB. The array is sorted by increasing number. Will be an empty array when the image is completely transparent.
* usesTransparency | boolean indicating whether there are any transparent pixels within the frame. A pixel is considered transparent if its alpha value is 0x00.
* indexCount | The number of color indexes required to represent this palette of colors. It is equal to the number of opaque colors plus one if the image includes transparency.
*
* @return {object} An object representing a color palette as described above.
*/
getPalette() {
// returns with colors sorted low to high
const colorSet = new Set();
const buf = this.bitmap.data;
let i = 0;
let usesTransparency = false;
while (i < buf.length) {
if (buf[i + 3] === 0) {
usesTransparency = true;
}
else {
// can eliminate the bitshift by starting one byte prior
const color = (buf.readUInt32BE(i, true) >> 8) & 0xFFFFFF;
colorSet.add(color);
}
i += 4; // skip alpha
}
const colors = new Array(colorSet.size);
const iter = colorSet.values();
for (i = 0; i < colors.length; ++i) {
colors[i] = iter.next().value;
}
colors.sort((a, b) => (a - b));
let indexCount = colors.length;
if (usesTransparency) {
++indexCount;
}
return { colors, usesTransparency, indexCount };
}
}
GifFrame.DisposeToAnything = 0;
GifFrame.DisposeNothing = 1;
GifFrame.DisposeToBackgroundColor = 2;
GifFrame.DisposeToPrevious = 3;
exports.GifFrame = GifFrame;
/***/ }),
/***/ 4511:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
/** @namespace GifUtil */
const fs = __nccwpck_require__(7147);
const ImageQ = __nccwpck_require__(8622);
const BitmapImage = __nccwpck_require__(2540);
const { GifFrame } = __nccwpck_require__(1756);
const { GifError } = __nccwpck_require__(4345);
const { GifCodec } = __nccwpck_require__(1445);
const INVALID_SUFFIXES = ['.jpg', '.jpeg', '.png', '.bmp'];
const defaultCodec = new GifCodec();
/**
* cloneFrames() clones provided frames. It's a utility method for cloning an entire array of frames at once.
*
* @function cloneFrames
* @memberof GifUtil
* @param {GifFrame[]} frames An array of GifFrame instances to clone
* @return {GifFrame[]} An array of GifFrame clones of the provided frames.
*/
exports.cloneFrames = function (frames) {
let clones = [];
frames.forEach(frame => {
clones.push(new GifFrame(frame));
});
return clones;
}
/**
* getColorInfo() gets information about the colors used in the provided frames. The method is able to return an array of all colors found across all frames.
*
* `maxGlobalIndex` controls whether the computation short-circuits to avoid doing work that the caller doesn't need. The method only returns `colors` and `indexCount` for the colors across all frames when the number of indexes required to store the colors and transparency in a GIF (which is the value of `indexCount`) is less than or equal to `maxGlobalIndex`. Such short-circuiting is useful when the caller just needs to determine whether any frame includes transparency.
*
* @function getColorInfo
* @memberof GifUtil
* @param {GifFrame[]} frames Frames to examine for color and transparency.
* @param {number} maxGlobalIndex Maximum number of color indexes (including one for transparency) allowed among the returned compilation of colors. `colors` and `indexCount` are not returned if the number of color indexes required to accommodate all frames exceeds this number. Returns `colors` and `indexCount` by default.
* @returns {object} Object containing at least `palettes` and `usesTransparency`. `palettes` is an array of all the palettes returned by GifFrame#getPalette(). `usesTransparency` indicates whether at least one frame uses transparency. If `maxGlobalIndex` is not exceeded, the object also contains `colors`, an array of all colors (RGB) found across all palettes, sorted by increasing value, and `indexCount` indicating the number of indexes required to store the colors and the transparency in a GIF.
* @throws {GifError} When any frame requires more than 256 color indexes.
*/
exports.getColorInfo = function (frames, maxGlobalIndex) {
let usesTransparency = false;
const palettes = [];
for (let i = 0; i < frames.length; ++i) {
let palette = frames[i].getPalette();
if (palette.usesTransparency) {
usesTransparency = true;
}
if (palette.indexCount > 256) {
throw new GifError(`Frame ${i} uses more than 256 color indexes`);
}
palettes.push(palette);
}
if (maxGlobalIndex === 0) {
return { usesTransparency, palettes };
}
const globalColorSet = new Set();
palettes.forEach(palette => {
palette.colors.forEach(color => {
globalColorSet.add(color);
});
});
let indexCount = globalColorSet.size;
if (usesTransparency) {
// odd that GIF requires a color table entry at transparent index
++indexCount;
}
if (maxGlobalIndex && indexCount > maxGlobalIndex) {
return { usesTransparency, palettes };
}
const colors = new Array(globalColorSet.size);
const iter = globalColorSet.values();
for (let i = 0; i < colors.length; ++i) {
colors[i] = iter.next().value;
}
colors.sort((a, b) => (a - b));
return { colors, indexCount, usesTransparency, palettes };
};
/**
* copyAsJimp() returns a Jimp that contains a copy of the provided bitmap image (which may be either a BitmapImage or a GifFrame). Modifying the Jimp does not affect the provided bitmap image. This method serves as a macro for simplifying working with Jimp.
*
* @function copyAsJimp
* @memberof GifUtil
* @param {object} Reference to the Jimp package, keeping this library from being dependent on Jimp.
* @param {bitmapImageToCopy} Instance of BitmapImage (may be a GifUtil) with which to source the Jimp.
* @return {object} An new instance of Jimp containing a copy of the image in bitmapImageToCopy.
*/
exports.copyAsJimp = function (jimp, bitmapImageToCopy) {
return exports.shareAsJimp(jimp, new BitmapImage(bitmapImageToCopy));
};
/**
* getMaxDimensions() returns the pixel width and height required to accommodate all of the provided frames, according to the offsets and dimensions of each frame.
*
* @function getMaxDimensions
* @memberof GifUtil
* @param {GifFrame[]} frames Frames to measure for their aggregate maximum dimensions.
* @return {object} An object of the form {maxWidth, maxHeight} indicating the maximum width and height required to accommodate all frames.
*/
exports.getMaxDimensions = function (frames) {
let maxWidth = 0, maxHeight = 0;
frames.forEach(frame => {
const width = frame.xOffset + frame.bitmap.width;
if (width > maxWidth) {
maxWidth = width;
}
const height = frame.yOffset + frame.bitmap.height;
if (height > maxHeight) {
maxHeight = height;
}
});
return { maxWidth, maxHeight };
};
/**
* Quantizes colors so that there are at most a given number of color indexes (including transparency) across all provided images. Uses an algorithm by Anthony Dekker.
*
* The method treats different RGBA combinations as different colors, so if the frame has multiple alpha values or multiple RGB values for an alpha value, the caller may first want to normalize them by converting all transparent pixels to the same RGBA values.
*
* The method may increase the number of colors if there are fewer than the provided maximum.
*
* @function quantizeDekker
* @memberof GifUtil
* @param {BitmapImage|BitmapImage[]} imageOrImages Image or array of images (such as GifFrame instances) to be color-quantized. Quantizing across multiple images ensures color consistency from frame to frame.
* @param {number} maxColorIndexes The maximum number of color indexes that will exist in the palette after completing quantization. Defaults to 256.
* @param {object} dither (optional) An object configuring the dithering to apply. The properties are as followings, imported from the [`image-q` package](https://github.com/ibezkrovnyi/image-quantization) without explanation: { `ditherAlgorithm`: One of 'FloydSteinberg', 'FalseFloydSteinberg', 'Stucki', 'Atkinson', 'Jarvis', 'Burkes', 'Sierra', 'TwoSierra', 'SierraLite'; `minimumColorDistanceToDither`: (optional) A number defaulting to 0; `serpentine`: (optional) A boolean defaulting to true; `calculateErrorLikeGIMP`: (optional) A boolean defaulting to false. }
*/
exports.quantizeDekker = function (imageOrImages, maxColorIndexes, dither) {
maxColorIndexes = maxColorIndexes || 256;
_quantize(imageOrImages, 'NeuQuantFloat', maxColorIndexes, 0, dither);
}
/**
* Quantizes colors so that there are at most a given number of color indexes (including transparency) across all provided images. Uses an algorithm by Leon Sorokin. This quantization method differs from the other two by likely never increasing the number of colors, should there be fewer than the provided maximum.
*
* The method treats different RGBA combinations as different colors, so if the frame has multiple alpha values or multiple RGB values for an alpha value, the caller may first want to normalize them by converting all transparent pixels to the same RGBA values.
*
* @function quantizeSorokin
* @memberof GifUtil
* @param {BitmapImage|BitmapImage[]} imageOrImages Image or array of images (such as GifFrame instances) to be color-quantized. Quantizing across multiple images ensures color consistency from frame to frame.
* @param {number} maxColorIndexes The maximum number of color indexes that will exist in the palette after completing quantization. Defaults to 256.
* @param {string} histogram (optional) Histogram method: 'top-pop' for global top-population, 'min-pop' for minimum-population threshhold within subregions. Defaults to 'min-pop'.
* @param {object} dither (optional) An object configuring the dithering to apply, as explained for `quantizeDekker()`.
*/
exports.quantizeSorokin = function (imageOrImages, maxColorIndexes, histogram, dither) {
maxColorIndexes = maxColorIndexes || 256;
histogram = histogram || 'min-pop';
let histogramID;
switch (histogram) {
case 'min-pop':
histogramID = 2;
break;
case 'top-pop':
histogramID = 1;
break
default:
throw new Error(`Invalid quantizeSorokin histogram '${histogram}'`);
}
_quantize(imageOrImages, 'RGBQuant', maxColorIndexes, histogramID, dither);
}
/**
* Quantizes colors so that there are at most a given number of color indexes (including transparency) across all provided images. Uses an algorithm by Xiaolin Wu.
*
* The method treats different RGBA combinations as different colors, so if the frame has multiple alpha values or multiple RGB values for an alpha value, the caller may first want to normalize them by converting all transparent pixels to the same RGBA values.
*
* The method may increase the number of colors if there are fewer than the provided maximum.
*
* @function quantizeWu
* @memberof GifUtil
* @param {BitmapImage|BitmapImage[]} imageOrImages Image or array of images (such as GifFrame instances) to be color-quantized. Quantizing across multiple images ensures color consistency from frame to frame.
* @param {number} maxColorIndexes The maximum number of color indexes that will exist in the palette after completing quantization. Defaults to 256.
* @param {number} significantBits (optional) This is the number of significant high bits in each RGB color channel. Takes integer values from 1 through 8. Higher values correspond to higher quality. Defaults to 5.
* @param {object} dither (optional) An object configuring the dithering to apply, as explained for `quantizeDekker()`.
*/
exports.quantizeWu = function (imageOrImages, maxColorIndexes, significantBits, dither) {
maxColorIndexes = maxColorIndexes || 256;
significantBits = significantBits || 5;
if (significantBits < 1 || significantBits > 8) {
throw new Error("Invalid quantization quality");
}
_quantize(imageOrImages, 'WuQuant', maxColorIndexes, significantBits, dither);
}
/**
* read() decodes an encoded GIF, whether provided as a filename or as a byte buffer.
*
* @function read
* @memberof GifUtil
* @param {string|Buffer} source Source to decode. When a string, it's the GIF filename to load and parse. When a Buffer, it's an encoded GIF to parse.
* @param {object} decoder An optional GIF decoder object implementing the `decode` method of class GifCodec. When provided, the method decodes the GIF using this decoder. When not provided, the method uses GifCodec.
* @return {Promise} A Promise that resolves to an instance of the Gif class, representing the decoded GIF.
*/
exports.read = function (source, decoder) {
decoder = decoder || defaultCodec;
if (Buffer.isBuffer(source)) {
return decoder.decodeGif(source);
}
return _readBinary(source)
.then(buffer => {
return decoder.decodeGif(buffer);
});
};
/**
* shareAsJimp() returns a Jimp that shares a bitmap with the provided bitmap image (which may be either a BitmapImage or a GifFrame). Modifying the image in either the Jimp or the BitmapImage affects the other objects. This method serves as a macro for simplifying working with Jimp.
*
* @function shareAsJimp
* @memberof GifUtil
* @param {object} Reference to the Jimp package, keeping this library from being dependent on Jimp.
* @param {bitmapImageToShare} Instance of BitmapImage (may be a GifUtil) with which to source the Jimp.
* @return {object} An new instance of Jimp that shares the image in bitmapImageToShare.
*/
exports.shareAsJimp = function (jimp, bitmapImageToShare) {
const jimpImage = new jimp(bitmapImageToShare.bitmap.width,
bitmapImageToShare.bitmap.height, 0);
jimpImage.bitmap.data = bitmapImageToShare.bitmap.data;
return jimpImage;
};
/**
* write() encodes a GIF and saves it as a file.
*
* @function write
* @memberof GifUtil
* @param {string} path Filename to write GIF out as. Will overwrite an existing file.
* @param {GifFrame[]} frames Array of frames to be written into GIF.
* @param {object} spec An optional object that may provide values for `loops` and `colorScope`, as defined for the Gif class. However, `colorSpace` may also take the value Gif.GlobalColorsPreferred (== 0) to indicate that the encoder should attempt to create only a global color table. `loop` defaults to 0, looping indefinitely, and `colorScope` defaults to Gif.GlobalColorsPreferred.
* @param {object} encoder An optional GIF encoder object implementing the `encode` method of class GifCodec. When provided, the method encodes the GIF using this encoder. When not provided, the method uses GifCodec.
* @return {Promise} A Promise that resolves to an instance of the Gif class, representing the encoded GIF.
*/
exports.write = function (path, frames, spec, encoder) {
encoder = encoder || defaultCodec;
const matches = path.match(/\.[a-zA-Z]+$/); // prevent accidents
if (matches !== null &&
INVALID_SUFFIXES.includes(matches[0].toLowerCase()))
{
throw new Error(`GIF '${path}' has an unexpected suffix`);
}
return encoder.encodeGif(frames, spec)
.then(gif => {
return _writeBinary(path, gif.buffer)
.then(() => {
return gif;
});
});
};
function _quantize(imageOrImages, method, maxColorIndexes, modifier, dither) {
const images = Array.isArray(imageOrImages) ? imageOrImages : [imageOrImages];
const ditherAlgs = [
'FloydSteinberg',
'FalseFloydSteinberg',
'Stucki',
'Atkinson',
'Jarvis',
'Burkes',
'Sierra',
'TwoSierra',
'SierraLite'
];
if (dither) {
if (ditherAlgs.indexOf(dither.ditherAlgorithm) < 0) {
throw new Error(`Invalid ditherAlgorithm '${dither.ditherAlgorithm}'`);
}
if (dither.serpentine === undefined) {
dither.serpentine = true;
}
if (dither.minimumColorDistanceToDither === undefined) {
dither.minimumColorDistanceToDither = 0;
}
if (dither.calculateErrorLikeGIMP === undefined) {
dither.calculateErrorLikeGIMP = false;
}
}
const distCalculator = new ImageQ.distance.Euclidean();
const quantizer = new ImageQ.palette[method](distCalculator, maxColorIndexes, modifier);
let imageMaker;
if (dither) {
imageMaker = new ImageQ.image.ErrorDiffusionArray(
distCalculator,
ImageQ.image.ErrorDiffusionArrayKernel[dither.ditherAlgorithm],
dither.serpentine,
dither.minimumColorDistanceToDither,
dither.calculateErrorLikeGIMP
);
}
else {
imageMaker = new ImageQ.image.NearestColor(distCalculator);
}
const inputContainers = [];
images.forEach(image => {
const imageBuf = image.bitmap.data;
const inputBuf = new ArrayBuffer(imageBuf.length);
const inputArray = new Uint32Array(inputBuf);
for (let bi = 0, ai = 0; bi < imageBuf.length; bi += 4, ++ai) {
inputArray[ai] = imageBuf.readUInt32LE(bi, true);
}
const inputContainer = ImageQ.utils.PointContainer.fromUint32Array(
inputArray, image.bitmap.width, image.bitmap.height);
quantizer.sample(inputContainer);
inputContainers.push(inputContainer);
});
const limitedPalette = quantizer.quantizeSync();
for (let i = 0; i < images.length; ++i) {
const imageBuf = images[i].bitmap.data;
const outputContainer = imageMaker.quantizeSync(inputContainers[i], limitedPalette);
const outputArray = outputContainer.toUint32Array();
for (let bi = 0, ai = 0; bi < imageBuf.length; bi += 4, ++ai) {
imageBuf.writeUInt32LE(outputArray[ai], bi);
}
}
}
function _readBinary(path) {
// TBD: add support for URLs
return new Promise((resolve, reject) => {
fs.readFile(path, (err, buffer) => {
if (err) {
return reject(err);
}
return resolve(buffer);
});
});
}
function _writeBinary(path, buffer) {
// TBD: add support for URLs
return new Promise((resolve, reject) => {
fs.writeFile(path, buffer, err => {
if (err) {
return reject(err);
}
return resolve();
});
});
}
/***/ }),
/***/ 7304:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
"use strict";
const BitmapImage = __nccwpck_require__(2540);
const { Gif, GifError } = __nccwpck_require__(4345);
const { GifCodec } = __nccwpck_require__(1445);
const { GifFrame } = __nccwpck_require__(1756);
const GifUtil = __nccwpck_require__(4511);
module.exports = {
BitmapImage,
Gif,
GifCodec,
GifFrame,
GifUtil,
GifError
};
/***/ }),
/***/ 3092:
/***/ ((__unused_webpack_module, exports) => {
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
exports.read = function (buffer, offset, isLE, mLen, nBytes) {
var e, m
var eLen = (nBytes * 8) - mLen - 1
var eMax = (1 << eLen) - 1
var eBias = eMax >> 1
var nBits = -7
var i = isLE ? (nBytes - 1) : 0
var d = isLE ? -1 : 1
var s = buffer[offset + i]
i += d
e = s & ((1 << (-nBits)) - 1)
s >>= (-nBits)
nBits += eLen
for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}
m = e & ((1 << (-nBits)) - 1)
e >>= (-nBits)
nBits += mLen
for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}
if (e === 0) {
e = 1 - eBias
} else if (e === eMax) {
return m ? NaN : ((s ? -1 : 1) * Infinity)
} else {
m = m + Math.pow(2, mLen)
e = e - eBias
}
return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
}
exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
var e, m, c
var eLen = (nBytes * 8) - mLen - 1
var eMax = (1 << eLen) - 1
var eBias = eMax >> 1
var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
var i = isLE ? 0 : (nBytes - 1)
var d = isLE ? 1 : -1
var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
value = Math.abs(value)
if (isNaN(value) || value === Infinity) {
m = isNaN(value) ? 1 : 0
e = eMax
} else {
e = Math.floor(Math.log(value) / Math.LN2)
if (value * (c = Math.pow(2, -e)) < 1) {
e--
c *= 2
}
if (e + eBias >= 1) {
value += rt / c
} else {
value += rt * Math.pow(2, 1 - eBias)
}
if (value * c >= 2) {
e++
c /= 2
}
if (e + eBias >= eMax) {
m = 0
e = eMax
} else if (e + eBias >= 1) {
m = ((value * c) - 1) * Math.pow(2, mLen)
e = e + eBias
} else {
m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
e = 0
}
}
for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
e = (e << mLen) | m
eLen += mLen
for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
buffer[offset + i - d] |= s * 128
}
/***/ }),
/***/ 2340:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
"use strict";
var realFetch = __nccwpck_require__(467);
module.exports = function(url, options) {
if (/^\/\//.test(url)) {
url = 'https:' + url;
}
return realFetch.call(this, url, options);
};
if (!global.fetch) {
global.fetch = module.exports;
global.Response = realFetch.Response;
global.Headers = realFetch.Headers;
global.Request = realFetch.Request;
}
/***/ }),
/***/ 3794:
/***/ ((module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _custom = _interopRequireDefault(__nccwpck_require__(9472));
var _types = _interopRequireDefault(__nccwpck_require__(770));
var _plugins = _interopRequireDefault(__nccwpck_require__(4976));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var _default = (0, _custom.default)({
types: [_types.default],
plugins: [_plugins.default]
});
exports["default"] = _default;
module.exports = exports.default;
module.exports["default"] = exports.default;
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 8541:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
var encode = __nccwpck_require__(9179),
decode = __nccwpck_require__(5066);
module.exports = {
encode: encode,
decode: decode
};
/***/ }),
/***/ 5066:
/***/ ((module) => {
/* -*- tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- /
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
/*
Copyright 2011 notmasteryet
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// - The JPEG specification can be found in the ITU CCITT Recommendation T.81
// (www.w3.org/Graphics/JPEG/itu-t81.pdf)
// - The JFIF specification can be found in the JPEG File Interchange Format
// (www.w3.org/Graphics/JPEG/jfif3.pdf)
// - The Adobe Application-Specific JPEG markers in the Supporting the DCT Filters
// in PostScript Level 2, Technical Note #5116
// (partners.adobe.com/public/developer/en/ps/sdk/5116.DCT_Filter.pdf)
var JpegImage = (function jpegImage() {
"use strict";
var dctZigZag = new Int32Array([
0,
1, 8,
16, 9, 2,
3, 10, 17, 24,
32, 25, 18, 11, 4,
5, 12, 19, 26, 33, 40,
48, 41, 34, 27, 20, 13, 6,
7, 14, 21, 28, 35, 42, 49, 56,
57, 50, 43, 36, 29, 22, 15,
23, 30, 37, 44, 51, 58,
59, 52, 45, 38, 31,
39, 46, 53, 60,
61, 54, 47,
55, 62,
63
]);
var dctCos1 = 4017 // cos(pi/16)
var dctSin1 = 799 // sin(pi/16)
var dctCos3 = 3406 // cos(3*pi/16)
var dctSin3 = 2276 // sin(3*pi/16)
var dctCos6 = 1567 // cos(6*pi/16)
var dctSin6 = 3784 // sin(6*pi/16)
var dctSqrt2 = 5793 // sqrt(2)
var dctSqrt1d2 = 2896 // sqrt(2) / 2
function constructor() {
}
function buildHuffmanTable(codeLengths, values) {
var k = 0, code = [], i, j, length = 16;
while (length > 0 && !codeLengths[length - 1])
length--;
code.push({children: [], index: 0});
var p = code[0], q;
for (i = 0; i < length; i++) {
for (j = 0; j < codeLengths[i]; j++) {
p = code.pop();
p.children[p.index] = values[k];
while (p.index > 0) {
if (code.length === 0)
throw new Error('Could not recreate Huffman Table');
p = code.pop();
}
p.index++;
code.push(p);
while (code.length <= i) {
code.push(q = {children: [], index: 0});
p.children[p.index] = q.children;
p = q;
}
k++;
}
if (i + 1 < length) {
// p here points to last code
code.push(q = {children: [], index: 0});
p.children[p.index] = q.children;
p = q;
}
}
return code[0].children;
}
function decodeScan(data, offset,
frame, components, resetInterval,
spectralStart, spectralEnd,
successivePrev, successive, opts) {
var precision = frame.precision;
var samplesPerLine = frame.samplesPerLine;
var scanLines = frame.scanLines;
var mcusPerLine = frame.mcusPerLine;
var progressive = frame.progressive;
var maxH = frame.maxH, maxV = frame.maxV;
var startOffset = offset, bitsData = 0, bitsCount = 0;
function readBit() {
if (bitsCount > 0) {
bitsCount--;
return (bitsData >> bitsCount) & 1;
}
bitsData = data[offset++];
if (bitsData == 0xFF) {
var nextByte = data[offset++];
if (nextByte) {
throw new Error("unexpected marker: " + ((bitsData << 8) | nextByte).toString(16));
}
// unstuff 0
}
bitsCount = 7;
return bitsData >>> 7;
}
function decodeHuffman(tree) {
var node = tree, bit;
while ((bit = readBit()) !== null) {
node = node[bit];
if (typeof node === 'number')
return node;
if (typeof node !== 'object')
throw new Error("invalid huffman sequence");
}
return null;
}
function receive(length) {
var n = 0;
while (length > 0) {
var bit = readBit();
if (bit === null) return;
n = (n << 1) | bit;
length--;
}
return n;
}
function receiveAndExtend(length) {
var n = receive(length);
if (n >= 1 << (length - 1))
return n;
return n + (-1 << length) + 1;
}
function decodeBaseline(component, zz) {
var t = decodeHuffman(component.huffmanTableDC);
var diff = t === 0 ? 0 : receiveAndExtend(t);
zz[0]= (component.pred += diff);
var k = 1;
while (k < 64) {
var rs = decodeHuffman(component.huffmanTableAC);
var s = rs & 15, r = rs >> 4;
if (s === 0) {
if (r < 15)
break;
k += 16;
continue;
}
k += r;
var z = dctZigZag[k];
zz[z] = receiveAndExtend(s);
k++;
}
}
function decodeDCFirst(component, zz) {
var t = decodeHuffman(component.huffmanTableDC);
var diff = t === 0 ? 0 : (receiveAndExtend(t) << successive);
zz[0] = (component.pred += diff);
}
function decodeDCSuccessive(component, zz) {
zz[0] |= readBit() << successive;
}
var eobrun = 0;
function decodeACFirst(component, zz) {
if (eobrun > 0) {
eobrun--;
return;
}
var k = spectralStart, e = spectralEnd;
while (k <= e) {
var rs = decodeHuffman(component.huffmanTableAC);
var s = rs & 15, r = rs >> 4;
if (s === 0) {
if (r < 15) {
eobrun = receive(r) + (1 << r) - 1;
break;
}
k += 16;
continue;
}
k += r;
var z = dctZigZag[k];
zz[z] = receiveAndExtend(s) * (1 << successive);
k++;
}
}
var successiveACState = 0, successiveACNextValue;
function decodeACSuccessive(component, zz) {
var k = spectralStart, e = spectralEnd, r = 0;
while (k <= e) {
var z = dctZigZag[k];
var direction = zz[z] < 0 ? -1 : 1;
switch (successiveACState) {
case 0: // initial state
var rs = decodeHuffman(component.huffmanTableAC);
var s = rs & 15, r = rs >> 4;
if (s === 0) {
if (r < 15) {
eobrun = receive(r) + (1 << r);
successiveACState = 4;
} else {
r = 16;
successiveACState = 1;
}
} else {
if (s !== 1)
throw new Error("invalid ACn encoding");
successiveACNextValue = receiveAndExtend(s);
successiveACState = r ? 2 : 3;
}
continue;
case 1: // skipping r zero items
case 2:
if (zz[z])
zz[z] += (readBit() << successive) * direction;
else {
r--;
if (r === 0)
successiveACState = successiveACState == 2 ? 3 : 0;
}
break;
case 3: // set value for a zero item
if (zz[z])
zz[z] += (readBit() << successive) * direction;
else {
zz[z] = successiveACNextValue << successive;
successiveACState = 0;
}
break;
case 4: // eob
if (zz[z])
zz[z] += (readBit() << successive) * direction;
break;
}
k++;
}
if (successiveACState === 4) {
eobrun--;
if (eobrun === 0)
successiveACState = 0;
}
}
function decodeMcu(component, decode, mcu, row, col) {
var mcuRow = (mcu / mcusPerLine) | 0;
var mcuCol = mcu % mcusPerLine;
var blockRow = mcuRow * component.v + row;
var blockCol = mcuCol * component.h + col;
// If the block is missing and we're in tolerant mode, just skip it.
if (component.blocks[blockRow] === undefined && opts.tolerantDecoding)
return;
decode(component, component.blocks[blockRow][blockCol]);
}
function decodeBlock(component, decode, mcu) {
var blockRow = (mcu / component.blocksPerLine) | 0;
var blockCol = mcu % component.blocksPerLine;
// If the block is missing and we're in tolerant mode, just skip it.
if (component.blocks[blockRow] === undefined && opts.tolerantDecoding)
return;
decode(component, component.blocks[blockRow][blockCol]);
}
var componentsLength = components.length;
var component, i, j, k, n;
var decodeFn;
if (progressive) {
if (spectralStart === 0)
decodeFn = successivePrev === 0 ? decodeDCFirst : decodeDCSuccessive;
else
decodeFn = successivePrev === 0 ? decodeACFirst : decodeACSuccessive;
} else {
decodeFn = decodeBaseline;
}
var mcu = 0, marker;
var mcuExpected;
if (componentsLength == 1) {
mcuExpected = components[0].blocksPerLine * components[0].blocksPerColumn;
} else {
mcuExpected = mcusPerLine * frame.mcusPerColumn;
}
if (!resetInterval) resetInterval = mcuExpected;
var h, v;
while (mcu < mcuExpected) {
// reset interval stuff
for (i = 0; i < componentsLength; i++)
components[i].pred = 0;
eobrun = 0;
if (componentsLength == 1) {
component = components[0];
for (n = 0; n < resetInterval; n++) {
decodeBlock(component, decodeFn, mcu);
mcu++;
}
} else {
for (n = 0; n < resetInterval; n++) {
for (i = 0; i < componentsLength; i++) {
component = components[i];
h = component.h;
v = component.v;
for (j = 0; j < v; j++) {
for (k = 0; k < h; k++) {
decodeMcu(component, decodeFn, mcu, j, k);
}
}
}
mcu++;
// If we've reached our expected MCU's, stop decoding
if (mcu === mcuExpected) break;
}
}
if (mcu === mcuExpected) {
// Skip trailing bytes at the end of the scan - until we reach the next marker
do {
if (data[offset] === 0xFF) {
if (data[offset + 1] !== 0x00) {
break;
}
}
offset += 1;
} while (offset < data.length - 2);
}
// find marker
bitsCount = 0;
marker = (data[offset] << 8) | data[offset + 1];
if (marker < 0xFF00) {
throw new Error("marker was not found");
}
if (marker >= 0xFFD0 && marker <= 0xFFD7) { // RSTx
offset += 2;
}
else
break;
}
return offset - startOffset;
}
function buildComponentData(frame, component) {
var lines = [];
var blocksPerLine = component.blocksPerLine;
var blocksPerColumn = component.blocksPerColumn;
var samplesPerLine = blocksPerLine << 3;
// Only 1 used per invocation of this function and garbage collected after invocation, so no need to account for its memory footprint.
var R = new Int32Array(64), r = new Uint8Array(64);
// A port of poppler's IDCT method which in turn is taken from:
// Christoph Loeffler, Adriaan Ligtenberg, George S. Moschytz,
// "Practical Fast 1-D DCT Algorithms with 11 Multiplications",
// IEEE Intl. Conf. on Acoustics, Speech & Signal Processing, 1989,
// 988-991.
function quantizeAndInverse(zz, dataOut, dataIn) {
var qt = component.quantizationTable;
var v0, v1, v2, v3, v4, v5, v6, v7, t;
var p = dataIn;
var i;
// dequant
for (i = 0; i < 64; i++)
p[i] = zz[i] * qt[i];
// inverse DCT on rows
for (i = 0; i < 8; ++i) {
var row = 8 * i;
// check for all-zero AC coefficients
if (p[1 + row] == 0 && p[2 + row] == 0 && p[3 + row] == 0 &&
p[4 + row] == 0 && p[5 + row] == 0 && p[6 + row] == 0 &&
p[7 + row] == 0) {
t = (dctSqrt2 * p[0 + row] + 512) >> 10;
p[0 + row] = t;
p[1 + row] = t;
p[2 + row] = t;
p[3 + row] = t;
p[4 + row] = t;
p[5 + row] = t;
p[6 + row] = t;
p[7 + row] = t;
continue;
}
// stage 4
v0 = (dctSqrt2 * p[0 + row] + 128) >> 8;
v1 = (dctSqrt2 * p[4 + row] + 128) >> 8;
v2 = p[2 + row];
v3 = p[6 + row];
v4 = (dctSqrt1d2 * (p[1 + row] - p[7 + row]) + 128) >> 8;
v7 = (dctSqrt1d2 * (p[1 + row] + p[7 + row]) + 128) >> 8;
v5 = p[3 + row] << 4;
v6 = p[5 + row] << 4;
// stage 3
t = (v0 - v1+ 1) >> 1;
v0 = (v0 + v1 + 1) >> 1;
v1 = t;
t = (v2 * dctSin6 + v3 * dctCos6 + 128) >> 8;
v2 = (v2 * dctCos6 - v3 * dctSin6 + 128) >> 8;
v3 = t;
t = (v4 - v6 + 1) >> 1;
v4 = (v4 + v6 + 1) >> 1;
v6 = t;
t = (v7 + v5 + 1) >> 1;
v5 = (v7 - v5 + 1) >> 1;
v7 = t;
// stage 2
t = (v0 - v3 + 1) >> 1;
v0 = (v0 + v3 + 1) >> 1;
v3 = t;
t = (v1 - v2 + 1) >> 1;
v1 = (v1 + v2 + 1) >> 1;
v2 = t;
t = (v4 * dctSin3 + v7 * dctCos3 + 2048) >> 12;
v4 = (v4 * dctCos3 - v7 * dctSin3 + 2048) >> 12;
v7 = t;
t = (v5 * dctSin1 + v6 * dctCos1 + 2048) >> 12;
v5 = (v5 * dctCos1 - v6 * dctSin1 + 2048) >> 12;
v6 = t;
// stage 1
p[0 + row] = v0 + v7;
p[7 + row] = v0 - v7;
p[1 + row] = v1 + v6;
p[6 + row] = v1 - v6;
p[2 + row] = v2 + v5;
p[5 + row] = v2 - v5;
p[3 + row] = v3 + v4;
p[4 + row] = v3 - v4;
}
// inverse DCT on columns
for (i = 0; i < 8; ++i) {
var col = i;
// check for all-zero AC coefficients
if (p[1*8 + col] == 0 && p[2*8 + col] == 0 && p[3*8 + col] == 0 &&
p[4*8 + col] == 0 && p[5*8 + col] == 0 && p[6*8 + col] == 0 &&
p[7*8 + col] == 0) {
t = (dctSqrt2 * dataIn[i+0] + 8192) >> 14;
p[0*8 + col] = t;
p[1*8 + col] = t;
p[2*8 + col] = t;
p[3*8 + col] = t;
p[4*8 + col] = t;
p[5*8 + col] = t;
p[6*8 + col] = t;
p[7*8 + col] = t;
continue;
}
// stage 4
v0 = (dctSqrt2 * p[0*8 + col] + 2048) >> 12;
v1 = (dctSqrt2 * p[4*8 + col] + 2048) >> 12;
v2 = p[2*8 + col];
v3 = p[6*8 + col];
v4 = (dctSqrt1d2 * (p[1*8 + col] - p[7*8 + col]) + 2048) >> 12;
v7 = (dctSqrt1d2 * (p[1*8 + col] + p[7*8 + col]) + 2048) >> 12;
v5 = p[3*8 + col];
v6 = p[5*8 + col];
// stage 3
t = (v0 - v1 + 1) >> 1;
v0 = (v0 + v1 + 1) >> 1;
v1 = t;
t = (v2 * dctSin6 + v3 * dctCos6 + 2048) >> 12;
v2 = (v2 * dctCos6 - v3 * dctSin6 + 2048) >> 12;
v3 = t;
t = (v4 - v6 + 1) >> 1;
v4 = (v4 + v6 + 1) >> 1;
v6 = t;
t = (v7 + v5 + 1) >> 1;
v5 = (v7 - v5 + 1) >> 1;
v7 = t;
// stage 2
t = (v0 - v3 + 1) >> 1;
v0 = (v0 + v3 + 1) >> 1;
v3 = t;
t = (v1 - v2 + 1) >> 1;
v1 = (v1 + v2 + 1) >> 1;
v2 = t;
t = (v4 * dctSin3 + v7 * dctCos3 + 2048) >> 12;
v4 = (v4 * dctCos3 - v7 * dctSin3 + 2048) >> 12;
v7 = t;
t = (v5 * dctSin1 + v6 * dctCos1 + 2048) >> 12;
v5 = (v5 * dctCos1 - v6 * dctSin1 + 2048) >> 12;
v6 = t;
// stage 1
p[0*8 + col] = v0 + v7;
p[7*8 + col] = v0 - v7;
p[1*8 + col] = v1 + v6;
p[6*8 + col] = v1 - v6;
p[2*8 + col] = v2 + v5;
p[5*8 + col] = v2 - v5;
p[3*8 + col] = v3 + v4;
p[4*8 + col] = v3 - v4;
}
// convert to 8-bit integers
for (i = 0; i < 64; ++i) {
var sample = 128 + ((p[i] + 8) >> 4);
dataOut[i] = sample < 0 ? 0 : sample > 0xFF ? 0xFF : sample;
}
}
requestMemoryAllocation(samplesPerLine * blocksPerColumn * 8);
var i, j;
for (var blockRow = 0; blockRow < blocksPerColumn; blockRow++) {
var scanLine = blockRow << 3;
for (i = 0; i < 8; i++)
lines.push(new Uint8Array(samplesPerLine));
for (var blockCol = 0; blockCol < blocksPerLine; blockCol++) {
quantizeAndInverse(component.blocks[blockRow][blockCol], r, R);
var offset = 0, sample = blockCol << 3;
for (j = 0; j < 8; j++) {
var line = lines[scanLine + j];
for (i = 0; i < 8; i++)
line[sample + i] = r[offset++];
}
}
}
return lines;
}
function clampTo8bit(a) {
return a < 0 ? 0 : a > 255 ? 255 : a;
}
constructor.prototype = {
load: function load(path) {
var xhr = new XMLHttpRequest();
xhr.open("GET", path, true);
xhr.responseType = "arraybuffer";
xhr.onload = (function() {
// TODO catch parse error
var data = new Uint8Array(xhr.response || xhr.mozResponseArrayBuffer);
this.parse(data);
if (this.onload)
this.onload();
}).bind(this);
xhr.send(null);
},
parse: function parse(data) {
var maxResolutionInPixels = this.opts.maxResolutionInMP * 1000 * 1000;
var offset = 0, length = data.length;
function readUint16() {
var value = (data[offset] << 8) | data[offset + 1];
offset += 2;
return value;
}
function readDataBlock() {
var length = readUint16();
var array = data.subarray(offset, offset + length - 2);
offset += array.length;
return array;
}
function prepareComponents(frame) {
// According to the JPEG standard, the sampling factor must be between 1 and 4
// See https://github.com/libjpeg-turbo/libjpeg-turbo/blob/9abeff46d87bd201a952e276f3e4339556a403a3/libjpeg.txt#L1138-L1146
var maxH = 1, maxV = 1;
var component, componentId;
for (componentId in frame.components) {
if (frame.components.hasOwnProperty(componentId)) {
component = frame.components[componentId];
if (maxH < component.h) maxH = component.h;
if (maxV < component.v) maxV = component.v;
}
}
var mcusPerLine = Math.ceil(frame.samplesPerLine / 8 / maxH);
var mcusPerColumn = Math.ceil(frame.scanLines / 8 / maxV);
for (componentId in frame.components) {
if (frame.components.hasOwnProperty(componentId)) {
component = frame.components[componentId];
var blocksPerLine = Math.ceil(Math.ceil(frame.samplesPerLine / 8) * component.h / maxH);
var blocksPerColumn = Math.ceil(Math.ceil(frame.scanLines / 8) * component.v / maxV);
var blocksPerLineForMcu = mcusPerLine * component.h;
var blocksPerColumnForMcu = mcusPerColumn * component.v;
var blocksToAllocate = blocksPerColumnForMcu * blocksPerLineForMcu;
var blocks = [];
// Each block is a Int32Array of length 64 (4 x 64 = 256 bytes)
requestMemoryAllocation(blocksToAllocate * 256);
for (var i = 0; i < blocksPerColumnForMcu; i++) {
var row = [];
for (var j = 0; j < blocksPerLineForMcu; j++)
row.push(new Int32Array(64));
blocks.push(row);
}
component.blocksPerLine = blocksPerLine;
component.blocksPerColumn = blocksPerColumn;
component.blocks = blocks;
}
}
frame.maxH = maxH;
frame.maxV = maxV;
frame.mcusPerLine = mcusPerLine;
frame.mcusPerColumn = mcusPerColumn;
}
var jfif = null;
var adobe = null;
var pixels = null;
var frame, resetInterval;
var quantizationTables = [], frames = [];
var huffmanTablesAC = [], huffmanTablesDC = [];
var fileMarker = readUint16();
var malformedDataOffset = -1;
this.comments = [];
if (fileMarker != 0xFFD8) { // SOI (Start of Image)
throw new Error("SOI not found");
}
fileMarker = readUint16();
while (fileMarker != 0xFFD9) { // EOI (End of image)
var i, j, l;
switch(fileMarker) {
case 0xFF00: break;
case 0xFFE0: // APP0 (Application Specific)
case 0xFFE1: // APP1
case 0xFFE2: // APP2
case 0xFFE3: // APP3
case 0xFFE4: // APP4
case 0xFFE5: // APP5
case 0xFFE6: // APP6
case 0xFFE7: // APP7
case 0xFFE8: // APP8
case 0xFFE9: // APP9
case 0xFFEA: // APP10
case 0xFFEB: // APP11
case 0xFFEC: // APP12
case 0xFFED: // APP13
case 0xFFEE: // APP14
case 0xFFEF: // APP15
case 0xFFFE: // COM (Comment)
var appData = readDataBlock();
if (fileMarker === 0xFFFE) {
var comment = String.fromCharCode.apply(null, appData);
this.comments.push(comment);
}
if (fileMarker === 0xFFE0) {
if (appData[0] === 0x4A && appData[1] === 0x46 && appData[2] === 0x49 &&
appData[3] === 0x46 && appData[4] === 0) { // 'JFIF\x00'
jfif = {
version: { major: appData[5], minor: appData[6] },
densityUnits: appData[7],
xDensity: (appData[8] << 8) | appData[9],
yDensity: (appData[10] << 8) | appData[11],
thumbWidth: appData[12],
thumbHeight: appData[13],
thumbData: appData.subarray(14, 14 + 3 * appData[12] * appData[13])
};
}
}
// TODO APP1 - Exif
if (fileMarker === 0xFFE1) {
if (appData[0] === 0x45 &&
appData[1] === 0x78 &&
appData[2] === 0x69 &&
appData[3] === 0x66 &&
appData[4] === 0) { // 'EXIF\x00'
this.exifBuffer = appData.subarray(5, appData.length);
}
}
if (fileMarker === 0xFFEE) {
if (appData[0] === 0x41 && appData[1] === 0x64 && appData[2] === 0x6F &&
appData[3] === 0x62 && appData[4] === 0x65 && appData[5] === 0) { // 'Adobe\x00'
adobe = {
version: appData[6],
flags0: (appData[7] << 8) | appData[8],
flags1: (appData[9] << 8) | appData[10],
transformCode: appData[11]
};
}
}
break;
case 0xFFDB: // DQT (Define Quantization Tables)
var quantizationTablesLength = readUint16();
var quantizationTablesEnd = quantizationTablesLength + offset - 2;
while (offset < quantizationTablesEnd) {
var quantizationTableSpec = data[offset++];
requestMemoryAllocation(64 * 4);
var tableData = new Int32Array(64);
if ((quantizationTableSpec >> 4) === 0) { // 8 bit values
for (j = 0; j < 64; j++) {
var z = dctZigZag[j];
tableData[z] = data[offset++];
}
} else if ((quantizationTableSpec >> 4) === 1) { //16 bit
for (j = 0; j < 64; j++) {
var z = dctZigZag[j];
tableData[z] = readUint16();
}
} else
throw new Error("DQT: invalid table spec");
quantizationTables[quantizationTableSpec & 15] = tableData;
}
break;
case 0xFFC0: // SOF0 (Start of Frame, Baseline DCT)
case 0xFFC1: // SOF1 (Start of Frame, Extended DCT)
case 0xFFC2: // SOF2 (Start of Frame, Progressive DCT)
readUint16(); // skip data length
frame = {};
frame.extended = (fileMarker === 0xFFC1);
frame.progressive = (fileMarker === 0xFFC2);
frame.precision = data[offset++];
frame.scanLines = readUint16();
frame.samplesPerLine = readUint16();
frame.components = {};
frame.componentsOrder = [];
var pixelsInFrame = frame.scanLines * frame.samplesPerLine;
if (pixelsInFrame > maxResolutionInPixels) {
var exceededAmount = Math.ceil((pixelsInFrame - maxResolutionInPixels) / 1e6);
throw new Error(`maxResolutionInMP limit exceeded by ${exceededAmount}MP`);
}
var componentsCount = data[offset++], componentId;
var maxH = 0, maxV = 0;
for (i = 0; i < componentsCount; i++) {
componentId = data[offset];
var h = data[offset + 1] >> 4;
var v = data[offset + 1] & 15;
var qId = data[offset + 2];
if ( h <= 0 || v <= 0 ) {
throw new Error('Invalid sampling factor, expected values above 0');
}
frame.componentsOrder.push(componentId);
frame.components[componentId] = {
h: h,
v: v,
quantizationIdx: qId
};
offset += 3;
}
prepareComponents(frame);
frames.push(frame);
break;
case 0xFFC4: // DHT (Define Huffman Tables)
var huffmanLength = readUint16();
for (i = 2; i < huffmanLength;) {
var huffmanTableSpec = data[offset++];
var codeLengths = new Uint8Array(16);
var codeLengthSum = 0;
for (j = 0; j < 16; j++, offset++) {
codeLengthSum += (codeLengths[j] = data[offset]);
}
requestMemoryAllocation(16 + codeLengthSum);
var huffmanValues = new Uint8Array(codeLengthSum);
for (j = 0; j < codeLengthSum; j++, offset++)
huffmanValues[j] = data[offset];
i += 17 + codeLengthSum;
((huffmanTableSpec >> 4) === 0 ?
huffmanTablesDC : huffmanTablesAC)[huffmanTableSpec & 15] =
buildHuffmanTable(codeLengths, huffmanValues);
}
break;
case 0xFFDD: // DRI (Define Restart Interval)
readUint16(); // skip data length
resetInterval = readUint16();
break;
case 0xFFDC: // Number of Lines marker
readUint16() // skip data length
readUint16() // Ignore this data since it represents the image height
break;
case 0xFFDA: // SOS (Start of Scan)
var scanLength = readUint16();
var selectorsCount = data[offset++];
var components = [], component;
for (i = 0; i < selectorsCount; i++) {
component = frame.components[data[offset++]];
var tableSpec = data[offset++];
component.huffmanTableDC = huffmanTablesDC[tableSpec >> 4];
component.huffmanTableAC = huffmanTablesAC[tableSpec & 15];
components.push(component);
}
var spectralStart = data[offset++];
var spectralEnd = data[offset++];
var successiveApproximation = data[offset++];
var processed = decodeScan(data, offset,
frame, components, resetInterval,
spectralStart, spectralEnd,
successiveApproximation >> 4, successiveApproximation & 15, this.opts);
offset += processed;
break;
case 0xFFFF: // Fill bytes
if (data[offset] !== 0xFF) { // Avoid skipping a valid marker.
offset--;
}
break;
default:
if (data[offset - 3] == 0xFF &&
data[offset - 2] >= 0xC0 && data[offset - 2] <= 0xFE) {
// could be incorrect encoding -- last 0xFF byte of the previous
// block was eaten by the encoder
offset -= 3;
break;
}
else if (fileMarker === 0xE0 || fileMarker == 0xE1) {
// Recover from malformed APP1 markers popular in some phone models.
// See https://github.com/eugeneware/jpeg-js/issues/82
if (malformedDataOffset !== -1) {
throw new Error(`first unknown JPEG marker at offset ${malformedDataOffset.toString(16)}, second unknown JPEG marker ${fileMarker.toString(16)} at offset ${(offset - 1).toString(16)}`);
}
malformedDataOffset = offset - 1;
const nextOffset = readUint16();
if (data[offset + nextOffset - 2] === 0xFF) {
offset += nextOffset - 2;
break;
}
}
throw new Error("unknown JPEG marker " + fileMarker.toString(16));
}
fileMarker = readUint16();
}
if (frames.length != 1)
throw new Error("only single frame JPEGs supported");
// set each frame's components quantization table
for (var i = 0; i < frames.length; i++) {
var cp = frames[i].components;
for (var j in cp) {
cp[j].quantizationTable = quantizationTables[cp[j].quantizationIdx];
delete cp[j].quantizationIdx;
}
}
this.width = frame.samplesPerLine;
this.height = frame.scanLines;
this.jfif = jfif;
this.adobe = adobe;
this.components = [];
for (var i = 0; i < frame.componentsOrder.length; i++) {
var component = frame.components[frame.componentsOrder[i]];
this.components.push({
lines: buildComponentData(frame, component),
scaleX: component.h / frame.maxH,
scaleY: component.v / frame.maxV
});
}
},
getData: function getData(width, height) {
var scaleX = this.width / width, scaleY = this.height / height;
var component1, component2, component3, component4;
var component1Line, component2Line, component3Line, component4Line;
var x, y;
var offset = 0;
var Y, Cb, Cr, K, C, M, Ye, R, G, B;
var colorTransform;
var dataLength = width * height * this.components.length;
requestMemoryAllocation(dataLength);
var data = new Uint8Array(dataLength);
switch (this.components.length) {
case 1:
component1 = this.components[0];
for (y = 0; y < height; y++) {
component1Line = component1.lines[0 | (y * component1.scaleY * scaleY)];
for (x = 0; x < width; x++) {
Y = component1Line[0 | (x * component1.scaleX * scaleX)];
data[offset++] = Y;
}
}
break;
case 2:
// PDF might compress two component data in custom colorspace
component1 = this.components[0];
component2 = this.components[1];
for (y = 0; y < height; y++) {
component1Line = component1.lines[0 | (y * component1.scaleY * scaleY)];
component2Line = component2.lines[0 | (y * component2.scaleY * scaleY)];
for (x = 0; x < width; x++) {
Y = component1Line[0 | (x * component1.scaleX * scaleX)];
data[offset++] = Y;
Y = component2Line[0 | (x * component2.scaleX * scaleX)];
data[offset++] = Y;
}
}
break;
case 3:
// The default transform for three components is true
colorTransform = true;
// The adobe transform marker overrides any previous setting
if (this.adobe && this.adobe.transformCode)
colorTransform = true;
else if (typeof this.opts.colorTransform !== 'undefined')
colorTransform = !!this.opts.colorTransform;
component1 = this.components[0];
component2 = this.components[1];
component3 = this.components[2];
for (y = 0; y < height; y++) {
component1Line = component1.lines[0 | (y * component1.scaleY * scaleY)];
component2Line = component2.lines[0 | (y * component2.scaleY * scaleY)];
component3Line = component3.lines[0 | (y * component3.scaleY * scaleY)];
for (x = 0; x < width; x++) {
if (!colorTransform) {
R = component1Line[0 | (x * component1.scaleX * scaleX)];
G = component2Line[0 | (x * component2.scaleX * scaleX)];
B = component3Line[0 | (x * component3.scaleX * scaleX)];
} else {
Y = component1Line[0 | (x * component1.scaleX * scaleX)];
Cb = component2Line[0 | (x * component2.scaleX * scaleX)];
Cr = component3Line[0 | (x * component3.scaleX * scaleX)];
R = clampTo8bit(Y + 1.402 * (Cr - 128));
G = clampTo8bit(Y - 0.3441363 * (Cb - 128) - 0.71413636 * (Cr - 128));
B = clampTo8bit(Y + 1.772 * (Cb - 128));
}
data[offset++] = R;
data[offset++] = G;
data[offset++] = B;
}
}
break;
case 4:
if (!this.adobe)
throw new Error('Unsupported color mode (4 components)');
// The default transform for four components is false
colorTransform = false;
// The adobe transform marker overrides any previous setting
if (this.adobe && this.adobe.transformCode)
colorTransform = true;
else if (typeof this.opts.colorTransform !== 'undefined')
colorTransform = !!this.opts.colorTransform;
component1 = this.components[0];
component2 = this.components[1];
component3 = this.components[2];
component4 = this.components[3];
for (y = 0; y < height; y++) {
component1Line = component1.lines[0 | (y * component1.scaleY * scaleY)];
component2Line = component2.lines[0 | (y * component2.scaleY * scaleY)];
component3Line = component3.lines[0 | (y * component3.scaleY * scaleY)];
component4Line = component4.lines[0 | (y * component4.scaleY * scaleY)];
for (x = 0; x < width; x++) {
if (!colorTransform) {
C = component1Line[0 | (x * component1.scaleX * scaleX)];
M = component2Line[0 | (x * component2.scaleX * scaleX)];
Ye = component3Line[0 | (x * component3.scaleX * scaleX)];
K = component4Line[0 | (x * component4.scaleX * scaleX)];
} else {
Y = component1Line[0 | (x * component1.scaleX * scaleX)];
Cb = component2Line[0 | (x * component2.scaleX * scaleX)];
Cr = component3Line[0 | (x * component3.scaleX * scaleX)];
K = component4Line[0 | (x * component4.scaleX * scaleX)];
C = 255 - clampTo8bit(Y + 1.402 * (Cr - 128));
M = 255 - clampTo8bit(Y - 0.3441363 * (Cb - 128) - 0.71413636 * (Cr - 128));
Ye = 255 - clampTo8bit(Y + 1.772 * (Cb - 128));
}
data[offset++] = 255-C;
data[offset++] = 255-M;
data[offset++] = 255-Ye;
data[offset++] = 255-K;
}
}
break;
default:
throw new Error('Unsupported color mode');
}
return data;
},
copyToImageData: function copyToImageData(imageData, formatAsRGBA) {
var width = imageData.width, height = imageData.height;
var imageDataArray = imageData.data;
var data = this.getData(width, height);
var i = 0, j = 0, x, y;
var Y, K, C, M, R, G, B;
switch (this.components.length) {
case 1:
for (y = 0; y < height; y++) {
for (x = 0; x < width; x++) {
Y = data[i++];
imageDataArray[j++] = Y;
imageDataArray[j++] = Y;
imageDataArray[j++] = Y;
if (formatAsRGBA) {
imageDataArray[j++] = 255;
}
}
}
break;
case 3:
for (y = 0; y < height; y++) {
for (x = 0; x < width; x++) {
R = data[i++];
G = data[i++];
B = data[i++];
imageDataArray[j++] = R;
imageDataArray[j++] = G;
imageDataArray[j++] = B;
if (formatAsRGBA) {
imageDataArray[j++] = 255;
}
}
}
break;
case 4:
for (y = 0; y < height; y++) {
for (x = 0; x < width; x++) {
C = data[i++];
M = data[i++];
Y = data[i++];
K = data[i++];
R = 255 - clampTo8bit(C * (1 - K / 255) + K);
G = 255 - clampTo8bit(M * (1 - K / 255) + K);
B = 255 - clampTo8bit(Y * (1 - K / 255) + K);
imageDataArray[j++] = R;
imageDataArray[j++] = G;
imageDataArray[j++] = B;
if (formatAsRGBA) {
imageDataArray[j++] = 255;
}
}
}
break;
default:
throw new Error('Unsupported color mode');
}
}
};
// We cap the amount of memory used by jpeg-js to avoid unexpected OOMs from untrusted content.
var totalBytesAllocated = 0;
var maxMemoryUsageBytes = 0;
function requestMemoryAllocation(increaseAmount = 0) {
var totalMemoryImpactBytes = totalBytesAllocated + increaseAmount;
if (totalMemoryImpactBytes > maxMemoryUsageBytes) {
var exceededAmount = Math.ceil((totalMemoryImpactBytes - maxMemoryUsageBytes) / 1024 / 1024);
throw new Error(`maxMemoryUsageInMB limit exceeded by at least ${exceededAmount}MB`);
}
totalBytesAllocated = totalMemoryImpactBytes;
}
constructor.resetMaxMemoryUsage = function (maxMemoryUsageBytes_) {
totalBytesAllocated = 0;
maxMemoryUsageBytes = maxMemoryUsageBytes_;
};
constructor.getBytesAllocated = function () {
return totalBytesAllocated;
};
constructor.requestMemoryAllocation = requestMemoryAllocation;
return constructor;
})();
if (true) {
module.exports = decode;
} else {}
function decode(jpegData, userOpts = {}) {
var defaultOpts = {
// "undefined" means "Choose whether to transform colors based on the images color model."
colorTransform: undefined,
useTArray: false,
formatAsRGBA: true,
tolerantDecoding: true,
maxResolutionInMP: 100, // Don't decode more than 100 megapixels
maxMemoryUsageInMB: 512, // Don't decode if memory footprint is more than 512MB
};
var opts = {...defaultOpts, ...userOpts};
var arr = new Uint8Array(jpegData);
var decoder = new JpegImage();
decoder.opts = opts;
// If this constructor ever supports async decoding this will need to be done differently.
// Until then, treating as singleton limit is fine.
JpegImage.resetMaxMemoryUsage(opts.maxMemoryUsageInMB * 1024 * 1024);
decoder.parse(arr);
var channels = (opts.formatAsRGBA) ? 4 : 3;
var bytesNeeded = decoder.width * decoder.height * channels;
try {
JpegImage.requestMemoryAllocation(bytesNeeded);
var image = {
width: decoder.width,
height: decoder.height,
exifBuffer: decoder.exifBuffer,
data: opts.useTArray ?
new Uint8Array(bytesNeeded) :
Buffer.alloc(bytesNeeded)
};
if(decoder.comments.length > 0) {
image["comments"] = decoder.comments;
}
} catch (err) {
if (err instanceof RangeError) {
throw new Error("Could not allocate enough memory for the image. " +
"Required: " + bytesNeeded);
}
if (err instanceof ReferenceError) {
if (err.message === "Buffer is not defined") {
throw new Error("Buffer is not globally defined in this environment. " +
"Consider setting useTArray to true");
}
}
throw err;
}
decoder.copyToImageData(image, opts.formatAsRGBA);
return image;
}
/***/ }),
/***/ 9179:
/***/ ((module) => {
/*
Copyright (c) 2008, Adobe Systems Incorporated
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Adobe Systems Incorporated nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
JPEG encoder ported to JavaScript and optimized by Andreas Ritter, www.bytestrom.eu, 11/2009
Basic GUI blocking jpeg encoder
*/
var btoa = btoa || function(buf) {
return Buffer.from(buf).toString('base64');
};
function JPEGEncoder(quality) {
var self = this;
var fround = Math.round;
var ffloor = Math.floor;
var YTable = new Array(64);
var UVTable = new Array(64);
var fdtbl_Y = new Array(64);
var fdtbl_UV = new Array(64);
var YDC_HT;
var UVDC_HT;
var YAC_HT;
var UVAC_HT;
var bitcode = new Array(65535);
var category = new Array(65535);
var outputfDCTQuant = new Array(64);
var DU = new Array(64);
var byteout = [];
var bytenew = 0;
var bytepos = 7;
var YDU = new Array(64);
var UDU = new Array(64);
var VDU = new Array(64);
var clt = new Array(256);
var RGB_YUV_TABLE = new Array(2048);
var currentQuality;
var ZigZag = [
0, 1, 5, 6,14,15,27,28,
2, 4, 7,13,16,26,29,42,
3, 8,12,17,25,30,41,43,
9,11,18,24,31,40,44,53,
10,19,23,32,39,45,52,54,
20,22,33,38,46,51,55,60,
21,34,37,47,50,56,59,61,
35,36,48,49,57,58,62,63
];
var std_dc_luminance_nrcodes = [0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0];
var std_dc_luminance_values = [0,1,2,3,4,5,6,7,8,9,10,11];
var std_ac_luminance_nrcodes = [0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,0x7d];
var std_ac_luminance_values = [
0x01,0x02,0x03,0x00,0x04,0x11,0x05,0x12,
0x21,0x31,0x41,0x06,0x13,0x51,0x61,0x07,
0x22,0x71,0x14,0x32,0x81,0x91,0xa1,0x08,
0x23,0x42,0xb1,0xc1,0x15,0x52,0xd1,0xf0,
0x24,0x33,0x62,0x72,0x82,0x09,0x0a,0x16,
0x17,0x18,0x19,0x1a,0x25,0x26,0x27,0x28,
0x29,0x2a,0x34,0x35,0x36,0x37,0x38,0x39,
0x3a,0x43,0x44,0x45,0x46,0x47,0x48,0x49,
0x4a,0x53,0x54,0x55,0x56,0x57,0x58,0x59,
0x5a,0x63,0x64,0x65,0x66,0x67,0x68,0x69,
0x6a,0x73,0x74,0x75,0x76,0x77,0x78,0x79,
0x7a,0x83,0x84,0x85,0x86,0x87,0x88,0x89,
0x8a,0x92,0x93,0x94,0x95,0x96,0x97,0x98,
0x99,0x9a,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,
0xa8,0xa9,0xaa,0xb2,0xb3,0xb4,0xb5,0xb6,
0xb7,0xb8,0xb9,0xba,0xc2,0xc3,0xc4,0xc5,
0xc6,0xc7,0xc8,0xc9,0xca,0xd2,0xd3,0xd4,
0xd5,0xd6,0xd7,0xd8,0xd9,0xda,0xe1,0xe2,
0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,0xe9,0xea,
0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,0xf8,
0xf9,0xfa
];
var std_dc_chrominance_nrcodes = [0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0];
var std_dc_chrominance_values = [0,1,2,3,4,5,6,7,8,9,10,11];
var std_ac_chrominance_nrcodes = [0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,0x77];
var std_ac_chrominance_values = [
0x00,0x01,0x02,0x03,0x11,0x04,0x05,0x21,
0x31,0x06,0x12,0x41,0x51,0x07,0x61,0x71,
0x13,0x22,0x32,0x81,0x08,0x14,0x42,0x91,
0xa1,0xb1,0xc1,0x09,0x23,0x33,0x52,0xf0,
0x15,0x62,0x72,0xd1,0x0a,0x16,0x24,0x34,
0xe1,0x25,0xf1,0x17,0x18,0x19,0x1a,0x26,
0x27,0x28,0x29,0x2a,0x35,0x36,0x37,0x38,
0x39,0x3a,0x43,0x44,0x45,0x46,0x47,0x48,
0x49,0x4a,0x53,0x54,0x55,0x56,0x57,0x58,
0x59,0x5a,0x63,0x64,0x65,0x66,0x67,0x68,
0x69,0x6a,0x73,0x74,0x75,0x76,0x77,0x78,
0x79,0x7a,0x82,0x83,0x84,0x85,0x86,0x87,
0x88,0x89,0x8a,0x92,0x93,0x94,0x95,0x96,
0x97,0x98,0x99,0x9a,0xa2,0xa3,0xa4,0xa5,
0xa6,0xa7,0xa8,0xa9,0xaa,0xb2,0xb3,0xb4,
0xb5,0xb6,0xb7,0xb8,0xb9,0xba,0xc2,0xc3,
0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xd2,
0xd3,0xd4,0xd5,0xd6,0xd7,0xd8,0xd9,0xda,
0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,0xe9,
0xea,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,0xf8,
0xf9,0xfa
];
function initQuantTables(sf){
var YQT = [
16, 11, 10, 16, 24, 40, 51, 61,
12, 12, 14, 19, 26, 58, 60, 55,
14, 13, 16, 24, 40, 57, 69, 56,
14, 17, 22, 29, 51, 87, 80, 62,
18, 22, 37, 56, 68,109,103, 77,
24, 35, 55, 64, 81,104,113, 92,
49, 64, 78, 87,103,121,120,101,
72, 92, 95, 98,112,100,103, 99
];
for (var i = 0; i < 64; i++) {
var t = ffloor((YQT[i]*sf+50)/100);
if (t < 1) {
t = 1;
} else if (t > 255) {
t = 255;
}
YTable[ZigZag[i]] = t;
}
var UVQT = [
17, 18, 24, 47, 99, 99, 99, 99,
18, 21, 26, 66, 99, 99, 99, 99,
24, 26, 56, 99, 99, 99, 99, 99,
47, 66, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99
];
for (var j = 0; j < 64; j++) {
var u = ffloor((UVQT[j]*sf+50)/100);
if (u < 1) {
u = 1;
} else if (u > 255) {
u = 255;
}
UVTable[ZigZag[j]] = u;
}
var aasf = [
1.0, 1.387039845, 1.306562965, 1.175875602,
1.0, 0.785694958, 0.541196100, 0.275899379
];
var k = 0;
for (var row = 0; row < 8; row++)
{
for (var col = 0; col < 8; col++)
{
fdtbl_Y[k] = (1.0 / (YTable [ZigZag[k]] * aasf[row] * aasf[col] * 8.0));
fdtbl_UV[k] = (1.0 / (UVTable[ZigZag[k]] * aasf[row] * aasf[col] * 8.0));
k++;
}
}
}
function computeHuffmanTbl(nrcodes, std_table){
var codevalue = 0;
var pos_in_table = 0;
var HT = new Array();
for (var k = 1; k <= 16; k++) {
for (var j = 1; j <= nrcodes[k]; j++) {
HT[std_table[pos_in_table]] = [];
HT[std_table[pos_in_table]][0] = codevalue;
HT[std_table[pos_in_table]][1] = k;
pos_in_table++;
codevalue++;
}
codevalue*=2;
}
return HT;
}
function initHuffmanTbl()
{
YDC_HT = computeHuffmanTbl(std_dc_luminance_nrcodes,std_dc_luminance_values);
UVDC_HT = computeHuffmanTbl(std_dc_chrominance_nrcodes,std_dc_chrominance_values);
YAC_HT = computeHuffmanTbl(std_ac_luminance_nrcodes,std_ac_luminance_values);
UVAC_HT = computeHuffmanTbl(std_ac_chrominance_nrcodes,std_ac_chrominance_values);
}
function initCategoryNumber()
{
var nrlower = 1;
var nrupper = 2;
for (var cat = 1; cat <= 15; cat++) {
//Positive numbers
for (var nr = nrlower; nr<nrupper; nr++) {
category[32767+nr] = cat;
bitcode[32767+nr] = [];
bitcode[32767+nr][1] = cat;
bitcode[32767+nr][0] = nr;
}
//Negative numbers
for (var nrneg =-(nrupper-1); nrneg<=-nrlower; nrneg++) {
category[32767+nrneg] = cat;
bitcode[32767+nrneg] = [];
bitcode[32767+nrneg][1] = cat;
bitcode[32767+nrneg][0] = nrupper-1+nrneg;
}
nrlower <<= 1;
nrupper <<= 1;
}
}
function initRGBYUVTable() {
for(var i = 0; i < 256;i++) {
RGB_YUV_TABLE[i] = 19595 * i;
RGB_YUV_TABLE[(i+ 256)>>0] = 38470 * i;
RGB_YUV_TABLE[(i+ 512)>>0] = 7471 * i + 0x8000;
RGB_YUV_TABLE[(i+ 768)>>0] = -11059 * i;
RGB_YUV_TABLE[(i+1024)>>0] = -21709 * i;
RGB_YUV_TABLE[(i+1280)>>0] = 32768 * i + 0x807FFF;
RGB_YUV_TABLE[(i+1536)>>0] = -27439 * i;
RGB_YUV_TABLE[(i+1792)>>0] = - 5329 * i;
}
}
// IO functions
function writeBits(bs)
{
var value = bs[0];
var posval = bs[1]-1;
while ( posval >= 0 ) {
if (value & (1 << posval) ) {
bytenew |= (1 << bytepos);
}
posval--;
bytepos--;
if (bytepos < 0) {
if (bytenew == 0xFF) {
writeByte(0xFF);
writeByte(0);
}
else {
writeByte(bytenew);
}
bytepos=7;
bytenew=0;
}
}
}
function writeByte(value)
{
//byteout.push(clt[value]); // write char directly instead of converting later
byteout.push(value);
}
function writeWord(value)
{
writeByte((value>>8)&0xFF);
writeByte((value )&0xFF);
}
// DCT & quantization core
function fDCTQuant(data, fdtbl)
{
var d0, d1, d2, d3, d4, d5, d6, d7;
/* Pass 1: process rows. */
var dataOff=0;
var i;
var I8 = 8;
var I64 = 64;
for (i=0; i<I8; ++i)
{
d0 = data[dataOff];
d1 = data[dataOff+1];
d2 = data[dataOff+2];
d3 = data[dataOff+3];
d4 = data[dataOff+4];
d5 = data[dataOff+5];
d6 = data[dataOff+6];
d7 = data[dataOff+7];
var tmp0 = d0 + d7;
var tmp7 = d0 - d7;
var tmp1 = d1 + d6;
var tmp6 = d1 - d6;
var tmp2 = d2 + d5;
var tmp5 = d2 - d5;
var tmp3 = d3 + d4;
var tmp4 = d3 - d4;
/* Even part */
var tmp10 = tmp0 + tmp3; /* phase 2 */
var tmp13 = tmp0 - tmp3;
var tmp11 = tmp1 + tmp2;
var tmp12 = tmp1 - tmp2;
data[dataOff] = tmp10 + tmp11; /* phase 3 */
data[dataOff+4] = tmp10 - tmp11;
var z1 = (tmp12 + tmp13) * 0.707106781; /* c4 */
data[dataOff+2] = tmp13 + z1; /* phase 5 */
data[dataOff+6] = tmp13 - z1;
/* Odd part */
tmp10 = tmp4 + tmp5; /* phase 2 */
tmp11 = tmp5 + tmp6;
tmp12 = tmp6 + tmp7;
/* The rotator is modified from fig 4-8 to avoid extra negations. */
var z5 = (tmp10 - tmp12) * 0.382683433; /* c6 */
var z2 = 0.541196100 * tmp10 + z5; /* c2-c6 */
var z4 = 1.306562965 * tmp12 + z5; /* c2+c6 */
var z3 = tmp11 * 0.707106781; /* c4 */
var z11 = tmp7 + z3; /* phase 5 */
var z13 = tmp7 - z3;
data[dataOff+5] = z13 + z2; /* phase 6 */
data[dataOff+3] = z13 - z2;
data[dataOff+1] = z11 + z4;
data[dataOff+7] = z11 - z4;
dataOff += 8; /* advance pointer to next row */
}
/* Pass 2: process columns. */
dataOff = 0;
for (i=0; i<I8; ++i)
{
d0 = data[dataOff];
d1 = data[dataOff + 8];
d2 = data[dataOff + 16];
d3 = data[dataOff + 24];
d4 = data[dataOff + 32];
d5 = data[dataOff + 40];
d6 = data[dataOff + 48];
d7 = data[dataOff + 56];
var tmp0p2 = d0 + d7;
var tmp7p2 = d0 - d7;
var tmp1p2 = d1 + d6;
var tmp6p2 = d1 - d6;
var tmp2p2 = d2 + d5;
var tmp5p2 = d2 - d5;
var tmp3p2 = d3 + d4;
var tmp4p2 = d3 - d4;
/* Even part */
var tmp10p2 = tmp0p2 + tmp3p2; /* phase 2 */
var tmp13p2 = tmp0p2 - tmp3p2;
var tmp11p2 = tmp1p2 + tmp2p2;
var tmp12p2 = tmp1p2 - tmp2p2;
data[dataOff] = tmp10p2 + tmp11p2; /* phase 3 */
data[dataOff+32] = tmp10p2 - tmp11p2;
var z1p2 = (tmp12p2 + tmp13p2) * 0.707106781; /* c4 */
data[dataOff+16] = tmp13p2 + z1p2; /* phase 5 */
data[dataOff+48] = tmp13p2 - z1p2;
/* Odd part */
tmp10p2 = tmp4p2 + tmp5p2; /* phase 2 */
tmp11p2 = tmp5p2 + tmp6p2;
tmp12p2 = tmp6p2 + tmp7p2;
/* The rotator is modified from fig 4-8 to avoid extra negations. */
var z5p2 = (tmp10p2 - tmp12p2) * 0.382683433; /* c6 */
var z2p2 = 0.541196100 * tmp10p2 + z5p2; /* c2-c6 */
var z4p2 = 1.306562965 * tmp12p2 + z5p2; /* c2+c6 */
var z3p2 = tmp11p2 * 0.707106781; /* c4 */
var z11p2 = tmp7p2 + z3p2; /* phase 5 */
var z13p2 = tmp7p2 - z3p2;
data[dataOff+40] = z13p2 + z2p2; /* phase 6 */
data[dataOff+24] = z13p2 - z2p2;
data[dataOff+ 8] = z11p2 + z4p2;
data[dataOff+56] = z11p2 - z4p2;
dataOff++; /* advance pointer to next column */
}
// Quantize/descale the coefficients
var fDCTQuant;
for (i=0; i<I64; ++i)
{
// Apply the quantization and scaling factor & Round to nearest integer
fDCTQuant = data[i]*fdtbl[i];
outputfDCTQuant[i] = (fDCTQuant > 0.0) ? ((fDCTQuant + 0.5)|0) : ((fDCTQuant - 0.5)|0);
//outputfDCTQuant[i] = fround(fDCTQuant);
}
return outputfDCTQuant;
}
function writeAPP0()
{
writeWord(0xFFE0); // marker
writeWord(16); // length
writeByte(0x4A); // J
writeByte(0x46); // F
writeByte(0x49); // I
writeByte(0x46); // F
writeByte(0); // = "JFIF",'\0'
writeByte(1); // versionhi
writeByte(1); // versionlo
writeByte(0); // xyunits
writeWord(1); // xdensity
writeWord(1); // ydensity
writeByte(0); // thumbnwidth
writeByte(0); // thumbnheight
}
function writeAPP1(exifBuffer) {
if (!exifBuffer) return;
writeWord(0xFFE1); // APP1 marker
if (exifBuffer[0] === 0x45 &&
exifBuffer[1] === 0x78 &&
exifBuffer[2] === 0x69 &&
exifBuffer[3] === 0x66) {
// Buffer already starts with EXIF, just use it directly
writeWord(exifBuffer.length + 2); // length is buffer + length itself!
} else {
// Buffer doesn't start with EXIF, write it for them
writeWord(exifBuffer.length + 5 + 2); // length is buffer + EXIF\0 + length itself!
writeByte(0x45); // E
writeByte(0x78); // X
writeByte(0x69); // I
writeByte(0x66); // F
writeByte(0); // = "EXIF",'\0'
}
for (var i = 0; i < exifBuffer.length; i++) {
writeByte(exifBuffer[i]);
}
}
function writeSOF0(width, height)
{
writeWord(0xFFC0); // marker
writeWord(17); // length, truecolor YUV JPG
writeByte(8); // precision
writeWord(height);
writeWord(width);
writeByte(3); // nrofcomponents
writeByte(1); // IdY
writeByte(0x11); // HVY
writeByte(0); // QTY
writeByte(2); // IdU
writeByte(0x11); // HVU
writeByte(1); // QTU
writeByte(3); // IdV
writeByte(0x11); // HVV
writeByte(1); // QTV
}
function writeDQT()
{
writeWord(0xFFDB); // marker
writeWord(132); // length
writeByte(0);
for (var i=0; i<64; i++) {
writeByte(YTable[i]);
}
writeByte(1);
for (var j=0; j<64; j++) {
writeByte(UVTable[j]);
}
}
function writeDHT()
{
writeWord(0xFFC4); // marker
writeWord(0x01A2); // length
writeByte(0); // HTYDCinfo
for (var i=0; i<16; i++) {
writeByte(std_dc_luminance_nrcodes[i+1]);
}
for (var j=0; j<=11; j++) {
writeByte(std_dc_luminance_values[j]);
}
writeByte(0x10); // HTYACinfo
for (var k=0; k<16; k++) {
writeByte(std_ac_luminance_nrcodes[k+1]);
}
for (var l=0; l<=161; l++) {
writeByte(std_ac_luminance_values[l]);
}
writeByte(1); // HTUDCinfo
for (var m=0; m<16; m++) {
writeByte(std_dc_chrominance_nrcodes[m+1]);
}
for (var n=0; n<=11; n++) {
writeByte(std_dc_chrominance_values[n]);
}
writeByte(0x11); // HTUACinfo
for (var o=0; o<16; o++) {
writeByte(std_ac_chrominance_nrcodes[o+1]);
}
for (var p=0; p<=161; p++) {
writeByte(std_ac_chrominance_values[p]);
}
}
function writeCOM(comments)
{
if (typeof comments === "undefined" || comments.constructor !== Array) return;
comments.forEach(e => {
if (typeof e !== "string") return;
writeWord(0xFFFE); // marker
var l = e.length;
writeWord(l + 2); // length itself as well
var i;
for (i = 0; i < l; i++)
writeByte(e.charCodeAt(i));
});
}
function writeSOS()
{
writeWord(0xFFDA); // marker
writeWord(12); // length
writeByte(3); // nrofcomponents
writeByte(1); // IdY
writeByte(0); // HTY
writeByte(2); // IdU
writeByte(0x11); // HTU
writeByte(3); // IdV
writeByte(0x11); // HTV
writeByte(0); // Ss
writeByte(0x3f); // Se
writeByte(0); // Bf
}
function processDU(CDU, fdtbl, DC, HTDC, HTAC){
var EOB = HTAC[0x00];
var M16zeroes = HTAC[0xF0];
var pos;
var I16 = 16;
var I63 = 63;
var I64 = 64;
var DU_DCT = fDCTQuant(CDU, fdtbl);
//ZigZag reorder
for (var j=0;j<I64;++j) {
DU[ZigZag[j]]=DU_DCT[j];
}
var Diff = DU[0] - DC; DC = DU[0];
//Encode DC
if (Diff==0) {
writeBits(HTDC[0]); // Diff might be 0
} else {
pos = 32767+Diff;
writeBits(HTDC[category[pos]]);
writeBits(bitcode[pos]);
}
//Encode ACs
var end0pos = 63; // was const... which is crazy
for (; (end0pos>0)&&(DU[end0pos]==0); end0pos--) {};
//end0pos = first element in reverse order !=0
if ( end0pos == 0) {
writeBits(EOB);
return DC;
}
var i = 1;
var lng;
while ( i <= end0pos ) {
var startpos = i;
for (; (DU[i]==0) && (i<=end0pos); ++i) {}
var nrzeroes = i-startpos;
if ( nrzeroes >= I16 ) {
lng = nrzeroes>>4;
for (var nrmarker=1; nrmarker <= lng; ++nrmarker)
writeBits(M16zeroes);
nrzeroes = nrzeroes&0xF;
}
pos = 32767+DU[i];
writeBits(HTAC[(nrzeroes<<4)+category[pos]]);
writeBits(bitcode[pos]);
i++;
}
if ( end0pos != I63 ) {
writeBits(EOB);
}
return DC;
}
function initCharLookupTable(){
var sfcc = String.fromCharCode;
for(var i=0; i < 256; i++){ ///// ACHTUNG // 255
clt[i] = sfcc(i);
}
}
this.encode = function(image,quality) // image data object
{
var time_start = new Date().getTime();
if(quality) setQuality(quality);
// Initialize bit writer
byteout = new Array();
bytenew=0;
bytepos=7;
// Add JPEG headers
writeWord(0xFFD8); // SOI
writeAPP0();
writeCOM(image.comments);
writeAPP1(image.exifBuffer);
writeDQT();
writeSOF0(image.width,image.height);
writeDHT();
writeSOS();
// Encode 8x8 macroblocks
var DCY=0;
var DCU=0;
var DCV=0;
bytenew=0;
bytepos=7;
this.encode.displayName = "_encode_";
var imageData = image.data;
var width = image.width;
var height = image.height;
var quadWidth = width*4;
var tripleWidth = width*3;
var x, y = 0;
var r, g, b;
var start,p, col,row,pos;
while(y < height){
x = 0;
while(x < quadWidth){
start = quadWidth * y + x;
p = start;
col = -1;
row = 0;
for(pos=0; pos < 64; pos++){
row = pos >> 3;// /8
col = ( pos & 7 ) * 4; // %8
p = start + ( row * quadWidth ) + col;
if(y+row >= height){ // padding bottom
p-= (quadWidth*(y+1+row-height));
}
if(x+col >= quadWidth){ // padding right
p-= ((x+col) - quadWidth +4)
}
r = imageData[ p++ ];
g = imageData[ p++ ];
b = imageData[ p++ ];
/* // calculate YUV values dynamically
YDU[pos]=((( 0.29900)*r+( 0.58700)*g+( 0.11400)*b))-128; //-0x80
UDU[pos]=(((-0.16874)*r+(-0.33126)*g+( 0.50000)*b));
VDU[pos]=((( 0.50000)*r+(-0.41869)*g+(-0.08131)*b));
*/
// use lookup table (slightly faster)
YDU[pos] = ((RGB_YUV_TABLE[r] + RGB_YUV_TABLE[(g + 256)>>0] + RGB_YUV_TABLE[(b + 512)>>0]) >> 16)-128;
UDU[pos] = ((RGB_YUV_TABLE[(r + 768)>>0] + RGB_YUV_TABLE[(g + 1024)>>0] + RGB_YUV_TABLE[(b + 1280)>>0]) >> 16)-128;
VDU[pos] = ((RGB_YUV_TABLE[(r + 1280)>>0] + RGB_YUV_TABLE[(g + 1536)>>0] + RGB_YUV_TABLE[(b + 1792)>>0]) >> 16)-128;
}
DCY = processDU(YDU, fdtbl_Y, DCY, YDC_HT, YAC_HT);
DCU = processDU(UDU, fdtbl_UV, DCU, UVDC_HT, UVAC_HT);
DCV = processDU(VDU, fdtbl_UV, DCV, UVDC_HT, UVAC_HT);
x+=32;
}
y+=8;
}
////////////////////////////////////////////////////////////////
// Do the bit alignment of the EOI marker
if ( bytepos >= 0 ) {
var fillbits = [];
fillbits[1] = bytepos+1;
fillbits[0] = (1<<(bytepos+1))-1;
writeBits(fillbits);
}
writeWord(0xFFD9); //EOI
if (false) {}
return Buffer.from(byteout);
var jpegDataUri = 'data:image/jpeg;base64,' + btoa(byteout.join(''));
byteout = [];
// benchmarking
var duration = new Date().getTime() - time_start;
//console.log('Encoding time: '+ duration + 'ms');
//
return jpegDataUri
}
function setQuality(quality){
if (quality <= 0) {
quality = 1;
}
if (quality > 100) {
quality = 100;
}
if(currentQuality == quality) return // don't recalc if unchanged
var sf = 0;
if (quality < 50) {
sf = Math.floor(5000 / quality);
} else {
sf = Math.floor(200 - quality*2);
}
initQuantTables(sf);
currentQuality = quality;
//console.log('Quality set to: '+quality +'%');
}
function init(){
var time_start = new Date().getTime();
if(!quality) quality = 50;
// Create tables
initCharLookupTable()
initHuffmanTbl();
initCategoryNumber();
initRGBYUVTable();
setQuality(quality);
var duration = new Date().getTime() - time_start;
//console.log('Initialization '+ duration + 'ms');
}
init();
};
if (true) {
module.exports = encode;
} else {}
function encode(imgData, qu) {
if (typeof qu === 'undefined') qu = 50;
var encoder = new JPEGEncoder(qu);
var data = encoder.encode(imgData, qu);
return {
data: data,
width: imgData.width,
height: imgData.height,
};
}
// helper function to get the imageData of an existing image on the current page.
function getImageDataFromImage(idOrElement){
var theImg = (typeof(idOrElement)=='string')? document.getElementById(idOrElement):idOrElement;
var cvs = document.createElement('canvas');
cvs.width = theImg.width;
cvs.height = theImg.height;
var ctx = cvs.getContext("2d");
ctx.drawImage(theImg,0,0);
return (ctx.getImageData(0, 0, cvs.width, cvs.height));
}
/***/ }),
/***/ 6416:
/***/ (function(module) {
(function webpackUniversalModuleDefinition(root, factory) {
if(true)
module.exports = factory();
else {}
})(typeof self !== 'undefined' ? self : this, function() {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __nested_webpack_require_568__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __nested_webpack_require_568__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __nested_webpack_require_568__.m = modules;
/******/
/******/ // expose the module cache
/******/ __nested_webpack_require_568__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __nested_webpack_require_568__.d = function(exports, name, getter) {
/******/ if(!__nested_webpack_require_568__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __nested_webpack_require_568__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __nested_webpack_require_568__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __nested_webpack_require_568__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __nested_webpack_require_568__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __nested_webpack_require_568__(__nested_webpack_require_568__.s = 3);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports, __nccwpck_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var BitMatrix = /** @class */ (function () {
function BitMatrix(data, width) {
this.width = width;
this.height = data.length / width;
this.data = data;
}
BitMatrix.createEmpty = function (width, height) {
return new BitMatrix(new Uint8ClampedArray(width * height), width);
};
BitMatrix.prototype.get = function (x, y) {
if (x < 0 || x >= this.width || y < 0 || y >= this.height) {
return false;
}
return !!this.data[y * this.width + x];
};
BitMatrix.prototype.set = function (x, y, v) {
this.data[y * this.width + x] = v ? 1 : 0;
};
BitMatrix.prototype.setRegion = function (left, top, width, height, v) {
for (var y = top; y < top + height; y++) {
for (var x = left; x < left + width; x++) {
this.set(x, y, !!v);
}
}
};
return BitMatrix;
}());
exports.BitMatrix = BitMatrix;
/***/ }),
/* 1 */
/***/ (function(module, exports, __nested_webpack_require_3952__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var GenericGFPoly_1 = __nested_webpack_require_3952__(2);
function addOrSubtractGF(a, b) {
return a ^ b; // tslint:disable-line:no-bitwise
}
exports.addOrSubtractGF = addOrSubtractGF;
var GenericGF = /** @class */ (function () {
function GenericGF(primitive, size, genBase) {
this.primitive = primitive;
this.size = size;
this.generatorBase = genBase;
this.expTable = new Array(this.size);
this.logTable = new Array(this.size);
var x = 1;
for (var i = 0; i < this.size; i++) {
this.expTable[i] = x;
x = x * 2;
if (x >= this.size) {
x = (x ^ this.primitive) & (this.size - 1); // tslint:disable-line:no-bitwise
}
}
for (var i = 0; i < this.size - 1; i++) {
this.logTable[this.expTable[i]] = i;
}
this.zero = new GenericGFPoly_1.default(this, Uint8ClampedArray.from([0]));
this.one = new GenericGFPoly_1.default(this, Uint8ClampedArray.from([1]));
}
GenericGF.prototype.multiply = function (a, b) {
if (a === 0 || b === 0) {
return 0;
}
return this.expTable[(this.logTable[a] + this.logTable[b]) % (this.size - 1)];
};
GenericGF.prototype.inverse = function (a) {
if (a === 0) {
throw new Error("Can't invert 0");
}
return this.expTable[this.size - this.logTable[a] - 1];
};
GenericGF.prototype.buildMonomial = function (degree, coefficient) {
if (degree < 0) {
throw new Error("Invalid monomial degree less than 0");
}
if (coefficient === 0) {
return this.zero;
}
var coefficients = new Uint8ClampedArray(degree + 1);
coefficients[0] = coefficient;
return new GenericGFPoly_1.default(this, coefficients);
};
GenericGF.prototype.log = function (a) {
if (a === 0) {
throw new Error("Can't take log(0)");
}
return this.logTable[a];
};
GenericGF.prototype.exp = function (a) {
return this.expTable[a];
};
return GenericGF;
}());
exports.default = GenericGF;
/***/ }),
/* 2 */
/***/ (function(module, exports, __nested_webpack_require_6272__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var GenericGF_1 = __nested_webpack_require_6272__(1);
var GenericGFPoly = /** @class */ (function () {
function GenericGFPoly(field, coefficients) {
if (coefficients.length === 0) {
throw new Error("No coefficients.");
}
this.field = field;
var coefficientsLength = coefficients.length;
if (coefficientsLength > 1 && coefficients[0] === 0) {
// Leading term must be non-zero for anything except the constant polynomial "0"
var firstNonZero = 1;
while (firstNonZero < coefficientsLength && coefficients[firstNonZero] === 0) {
firstNonZero++;
}
if (firstNonZero === coefficientsLength) {
this.coefficients = field.zero.coefficients;
}
else {
this.coefficients = new Uint8ClampedArray(coefficientsLength - firstNonZero);
for (var i = 0; i < this.coefficients.length; i++) {
this.coefficients[i] = coefficients[firstNonZero + i];
}
}
}
else {
this.coefficients = coefficients;
}
}
GenericGFPoly.prototype.degree = function () {
return this.coefficients.length - 1;
};
GenericGFPoly.prototype.isZero = function () {
return this.coefficients[0] === 0;
};
GenericGFPoly.prototype.getCoefficient = function (degree) {
return this.coefficients[this.coefficients.length - 1 - degree];
};
GenericGFPoly.prototype.addOrSubtract = function (other) {
var _a;
if (this.isZero()) {
return other;
}
if (other.isZero()) {
return this;
}
var smallerCoefficients = this.coefficients;
var largerCoefficients = other.coefficients;
if (smallerCoefficients.length > largerCoefficients.length) {
_a = [largerCoefficients, smallerCoefficients], smallerCoefficients = _a[0], largerCoefficients = _a[1];
}
var sumDiff = new Uint8ClampedArray(largerCoefficients.length);
var lengthDiff = largerCoefficients.length - smallerCoefficients.length;
for (var i = 0; i < lengthDiff; i++) {
sumDiff[i] = largerCoefficients[i];
}
for (var i = lengthDiff; i < largerCoefficients.length; i++) {
sumDiff[i] = GenericGF_1.addOrSubtractGF(smallerCoefficients[i - lengthDiff], largerCoefficients[i]);
}
return new GenericGFPoly(this.field, sumDiff);
};
GenericGFPoly.prototype.multiply = function (scalar) {
if (scalar === 0) {
return this.field.zero;
}
if (scalar === 1) {
return this;
}
var size = this.coefficients.length;
var product = new Uint8ClampedArray(size);
for (var i = 0; i < size; i++) {
product[i] = this.field.multiply(this.coefficients[i], scalar);
}
return new GenericGFPoly(this.field, product);
};
GenericGFPoly.prototype.multiplyPoly = function (other) {
if (this.isZero() || other.isZero()) {
return this.field.zero;
}
var aCoefficients = this.coefficients;
var aLength = aCoefficients.length;
var bCoefficients = other.coefficients;
var bLength = bCoefficients.length;
var product = new Uint8ClampedArray(aLength + bLength - 1);
for (var i = 0; i < aLength; i++) {
var aCoeff = aCoefficients[i];
for (var j = 0; j < bLength; j++) {
product[i + j] = GenericGF_1.addOrSubtractGF(product[i + j], this.field.multiply(aCoeff, bCoefficients[j]));
}
}
return new GenericGFPoly(this.field, product);
};
GenericGFPoly.prototype.multiplyByMonomial = function (degree, coefficient) {
if (degree < 0) {
throw new Error("Invalid degree less than 0");
}
if (coefficient === 0) {
return this.field.zero;
}
var size = this.coefficients.length;
var product = new Uint8ClampedArray(size + degree);
for (var i = 0; i < size; i++) {
product[i] = this.field.multiply(this.coefficients[i], coefficient);
}
return new GenericGFPoly(this.field, product);
};
GenericGFPoly.prototype.evaluateAt = function (a) {
var result = 0;
if (a === 0) {
// Just return the x^0 coefficient
return this.getCoefficient(0);
}
var size = this.coefficients.length;
if (a === 1) {
// Just the sum of the coefficients
this.coefficients.forEach(function (coefficient) {
result = GenericGF_1.addOrSubtractGF(result, coefficient);
});
return result;
}
result = this.coefficients[0];
for (var i = 1; i < size; i++) {
result = GenericGF_1.addOrSubtractGF(this.field.multiply(a, result), this.coefficients[i]);
}
return result;
};
return GenericGFPoly;
}());
exports.default = GenericGFPoly;
/***/ }),
/* 3 */
/***/ (function(module, exports, __nested_webpack_require_11547__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var binarizer_1 = __nested_webpack_require_11547__(4);
var decoder_1 = __nested_webpack_require_11547__(5);
var extractor_1 = __nested_webpack_require_11547__(11);
var locator_1 = __nested_webpack_require_11547__(12);
function scan(matrix) {
var locations = locator_1.locate(matrix);
if (!locations) {
return null;
}
for (var _i = 0, locations_1 = locations; _i < locations_1.length; _i++) {
var location_1 = locations_1[_i];
var extracted = extractor_1.extract(matrix, location_1);
var decoded = decoder_1.decode(extracted.matrix);
if (decoded) {
return {
binaryData: decoded.bytes,
data: decoded.text,
chunks: decoded.chunks,
version: decoded.version,
location: {
topRightCorner: extracted.mappingFunction(location_1.dimension, 0),
topLeftCorner: extracted.mappingFunction(0, 0),
bottomRightCorner: extracted.mappingFunction(location_1.dimension, location_1.dimension),
bottomLeftCorner: extracted.mappingFunction(0, location_1.dimension),
topRightFinderPattern: location_1.topRight,
topLeftFinderPattern: location_1.topLeft,
bottomLeftFinderPattern: location_1.bottomLeft,
bottomRightAlignmentPattern: location_1.alignmentPattern,
},
};
}
}
return null;
}
var defaultOptions = {
inversionAttempts: "attemptBoth",
};
function jsQR(data, width, height, providedOptions) {
if (providedOptions === void 0) { providedOptions = {}; }
var options = defaultOptions;
Object.keys(options || {}).forEach(function (opt) {
options[opt] = providedOptions[opt] || options[opt];
});
var shouldInvert = options.inversionAttempts === "attemptBoth" || options.inversionAttempts === "invertFirst";
var tryInvertedFirst = options.inversionAttempts === "onlyInvert" || options.inversionAttempts === "invertFirst";
var _a = binarizer_1.binarize(data, width, height, shouldInvert), binarized = _a.binarized, inverted = _a.inverted;
var result = scan(tryInvertedFirst ? inverted : binarized);
if (!result && (options.inversionAttempts === "attemptBoth" || options.inversionAttempts === "invertFirst")) {
result = scan(tryInvertedFirst ? binarized : inverted);
}
return result;
}
jsQR.default = jsQR;
exports.default = jsQR;
/***/ }),
/* 4 */
/***/ (function(module, exports, __nested_webpack_require_14168__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var BitMatrix_1 = __nested_webpack_require_14168__(0);
var REGION_SIZE = 8;
var MIN_DYNAMIC_RANGE = 24;
function numBetween(value, min, max) {
return value < min ? min : value > max ? max : value;
}
// Like BitMatrix but accepts arbitry Uint8 values
var Matrix = /** @class */ (function () {
function Matrix(width, height) {
this.width = width;
this.data = new Uint8ClampedArray(width * height);
}
Matrix.prototype.get = function (x, y) {
return this.data[y * this.width + x];
};
Matrix.prototype.set = function (x, y, value) {
this.data[y * this.width + x] = value;
};
return Matrix;
}());
function binarize(data, width, height, returnInverted) {
if (data.length !== width * height * 4) {
throw new Error("Malformed data passed to binarizer.");
}
// Convert image to greyscale
var greyscalePixels = new Matrix(width, height);
for (var x = 0; x < width; x++) {
for (var y = 0; y < height; y++) {
var r = data[((y * width + x) * 4) + 0];
var g = data[((y * width + x) * 4) + 1];
var b = data[((y * width + x) * 4) + 2];
greyscalePixels.set(x, y, 0.2126 * r + 0.7152 * g + 0.0722 * b);
}
}
var horizontalRegionCount = Math.ceil(width / REGION_SIZE);
var verticalRegionCount = Math.ceil(height / REGION_SIZE);
var blackPoints = new Matrix(horizontalRegionCount, verticalRegionCount);
for (var verticalRegion = 0; verticalRegion < verticalRegionCount; verticalRegion++) {
for (var hortizontalRegion = 0; hortizontalRegion < horizontalRegionCount; hortizontalRegion++) {
var sum = 0;
var min = Infinity;
var max = 0;
for (var y = 0; y < REGION_SIZE; y++) {
for (var x = 0; x < REGION_SIZE; x++) {
var pixelLumosity = greyscalePixels.get(hortizontalRegion * REGION_SIZE + x, verticalRegion * REGION_SIZE + y);
sum += pixelLumosity;
min = Math.min(min, pixelLumosity);
max = Math.max(max, pixelLumosity);
}
}
var average = sum / (Math.pow(REGION_SIZE, 2));
if (max - min <= MIN_DYNAMIC_RANGE) {
// If variation within the block is low, assume this is a block with only light or only
// dark pixels. In that case we do not want to use the average, as it would divide this
// low contrast area into black and white pixels, essentially creating data out of noise.
//
// Default the blackpoint for these blocks to be half the min - effectively white them out
average = min / 2;
if (verticalRegion > 0 && hortizontalRegion > 0) {
// Correct the "white background" assumption for blocks that have neighbors by comparing
// the pixels in this block to the previously calculated black points. This is based on
// the fact that dark barcode symbology is always surrounded by some amount of light
// background for which reasonable black point estimates were made. The bp estimated at
// the boundaries is used for the interior.
// The (min < bp) is arbitrary but works better than other heuristics that were tried.
var averageNeighborBlackPoint = (blackPoints.get(hortizontalRegion, verticalRegion - 1) +
(2 * blackPoints.get(hortizontalRegion - 1, verticalRegion)) +
blackPoints.get(hortizontalRegion - 1, verticalRegion - 1)) / 4;
if (min < averageNeighborBlackPoint) {
average = averageNeighborBlackPoint;
}
}
}
blackPoints.set(hortizontalRegion, verticalRegion, average);
}
}
var binarized = BitMatrix_1.BitMatrix.createEmpty(width, height);
var inverted = null;
if (returnInverted) {
inverted = BitMatrix_1.BitMatrix.createEmpty(width, height);
}
for (var verticalRegion = 0; verticalRegion < verticalRegionCount; verticalRegion++) {
for (var hortizontalRegion = 0; hortizontalRegion < horizontalRegionCount; hortizontalRegion++) {
var left = numBetween(hortizontalRegion, 2, horizontalRegionCount - 3);
var top_1 = numBetween(verticalRegion, 2, verticalRegionCount - 3);
var sum = 0;
for (var xRegion = -2; xRegion <= 2; xRegion++) {
for (var yRegion = -2; yRegion <= 2; yRegion++) {
sum += blackPoints.get(left + xRegion, top_1 + yRegion);
}
}
var threshold = sum / 25;
for (var xRegion = 0; xRegion < REGION_SIZE; xRegion++) {
for (var yRegion = 0; yRegion < REGION_SIZE; yRegion++) {
var x = hortizontalRegion * REGION_SIZE + xRegion;
var y = verticalRegion * REGION_SIZE + yRegion;
var lum = greyscalePixels.get(x, y);
binarized.set(x, y, lum <= threshold);
if (returnInverted) {
inverted.set(x, y, !(lum <= threshold));
}
}
}
}
}
if (returnInverted) {
return { binarized: binarized, inverted: inverted };
}
return { binarized: binarized };
}
exports.binarize = binarize;
/***/ }),
/* 5 */
/***/ (function(module, exports, __nested_webpack_require_19864__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var BitMatrix_1 = __nested_webpack_require_19864__(0);
var decodeData_1 = __nested_webpack_require_19864__(6);
var reedsolomon_1 = __nested_webpack_require_19864__(9);
var version_1 = __nested_webpack_require_19864__(10);
// tslint:disable:no-bitwise
function numBitsDiffering(x, y) {
var z = x ^ y;
var bitCount = 0;
while (z) {
bitCount++;
z &= z - 1;
}
return bitCount;
}
function pushBit(bit, byte) {
return (byte << 1) | bit;
}
// tslint:enable:no-bitwise
var FORMAT_INFO_TABLE = [
{ bits: 0x5412, formatInfo: { errorCorrectionLevel: 1, dataMask: 0 } },
{ bits: 0x5125, formatInfo: { errorCorrectionLevel: 1, dataMask: 1 } },
{ bits: 0x5E7C, formatInfo: { errorCorrectionLevel: 1, dataMask: 2 } },
{ bits: 0x5B4B, formatInfo: { errorCorrectionLevel: 1, dataMask: 3 } },
{ bits: 0x45F9, formatInfo: { errorCorrectionLevel: 1, dataMask: 4 } },
{ bits: 0x40CE, formatInfo: { errorCorrectionLevel: 1, dataMask: 5 } },
{ bits: 0x4F97, formatInfo: { errorCorrectionLevel: 1, dataMask: 6 } },
{ bits: 0x4AA0, formatInfo: { errorCorrectionLevel: 1, dataMask: 7 } },
{ bits: 0x77C4, formatInfo: { errorCorrectionLevel: 0, dataMask: 0 } },
{ bits: 0x72F3, formatInfo: { errorCorrectionLevel: 0, dataMask: 1 } },
{ bits: 0x7DAA, formatInfo: { errorCorrectionLevel: 0, dataMask: 2 } },
{ bits: 0x789D, formatInfo: { errorCorrectionLevel: 0, dataMask: 3 } },
{ bits: 0x662F, formatInfo: { errorCorrectionLevel: 0, dataMask: 4 } },
{ bits: 0x6318, formatInfo: { errorCorrectionLevel: 0, dataMask: 5 } },
{ bits: 0x6C41, formatInfo: { errorCorrectionLevel: 0, dataMask: 6 } },
{ bits: 0x6976, formatInfo: { errorCorrectionLevel: 0, dataMask: 7 } },
{ bits: 0x1689, formatInfo: { errorCorrectionLevel: 3, dataMask: 0 } },
{ bits: 0x13BE, formatInfo: { errorCorrectionLevel: 3, dataMask: 1 } },
{ bits: 0x1CE7, formatInfo: { errorCorrectionLevel: 3, dataMask: 2 } },
{ bits: 0x19D0, formatInfo: { errorCorrectionLevel: 3, dataMask: 3 } },
{ bits: 0x0762, formatInfo: { errorCorrectionLevel: 3, dataMask: 4 } },
{ bits: 0x0255, formatInfo: { errorCorrectionLevel: 3, dataMask: 5 } },
{ bits: 0x0D0C, formatInfo: { errorCorrectionLevel: 3, dataMask: 6 } },
{ bits: 0x083B, formatInfo: { errorCorrectionLevel: 3, dataMask: 7 } },
{ bits: 0x355F, formatInfo: { errorCorrectionLevel: 2, dataMask: 0 } },
{ bits: 0x3068, formatInfo: { errorCorrectionLevel: 2, dataMask: 1 } },
{ bits: 0x3F31, formatInfo: { errorCorrectionLevel: 2, dataMask: 2 } },
{ bits: 0x3A06, formatInfo: { errorCorrectionLevel: 2, dataMask: 3 } },
{ bits: 0x24B4, formatInfo: { errorCorrectionLevel: 2, dataMask: 4 } },
{ bits: 0x2183, formatInfo: { errorCorrectionLevel: 2, dataMask: 5 } },
{ bits: 0x2EDA, formatInfo: { errorCorrectionLevel: 2, dataMask: 6 } },
{ bits: 0x2BED, formatInfo: { errorCorrectionLevel: 2, dataMask: 7 } },
];
var DATA_MASKS = [
function (p) { return ((p.y + p.x) % 2) === 0; },
function (p) { return (p.y % 2) === 0; },
function (p) { return p.x % 3 === 0; },
function (p) { return (p.y + p.x) % 3 === 0; },
function (p) { return (Math.floor(p.y / 2) + Math.floor(p.x / 3)) % 2 === 0; },
function (p) { return ((p.x * p.y) % 2) + ((p.x * p.y) % 3) === 0; },
function (p) { return ((((p.y * p.x) % 2) + (p.y * p.x) % 3) % 2) === 0; },
function (p) { return ((((p.y + p.x) % 2) + (p.y * p.x) % 3) % 2) === 0; },
];
function buildFunctionPatternMask(version) {
var dimension = 17 + 4 * version.versionNumber;
var matrix = BitMatrix_1.BitMatrix.createEmpty(dimension, dimension);
matrix.setRegion(0, 0, 9, 9, true); // Top left finder pattern + separator + format
matrix.setRegion(dimension - 8, 0, 8, 9, true); // Top right finder pattern + separator + format
matrix.setRegion(0, dimension - 8, 9, 8, true); // Bottom left finder pattern + separator + format
// Alignment patterns
for (var _i = 0, _a = version.alignmentPatternCenters; _i < _a.length; _i++) {
var x = _a[_i];
for (var _b = 0, _c = version.alignmentPatternCenters; _b < _c.length; _b++) {
var y = _c[_b];
if (!(x === 6 && y === 6 || x === 6 && y === dimension - 7 || x === dimension - 7 && y === 6)) {
matrix.setRegion(x - 2, y - 2, 5, 5, true);
}
}
}
matrix.setRegion(6, 9, 1, dimension - 17, true); // Vertical timing pattern
matrix.setRegion(9, 6, dimension - 17, 1, true); // Horizontal timing pattern
if (version.versionNumber > 6) {
matrix.setRegion(dimension - 11, 0, 3, 6, true); // Version info, top right
matrix.setRegion(0, dimension - 11, 6, 3, true); // Version info, bottom left
}
return matrix;
}
function readCodewords(matrix, version, formatInfo) {
var dataMask = DATA_MASKS[formatInfo.dataMask];
var dimension = matrix.height;
var functionPatternMask = buildFunctionPatternMask(version);
var codewords = [];
var currentByte = 0;
var bitsRead = 0;
// Read columns in pairs, from right to left
var readingUp = true;
for (var columnIndex = dimension - 1; columnIndex > 0; columnIndex -= 2) {
if (columnIndex === 6) { // Skip whole column with vertical alignment pattern;
columnIndex--;
}
for (var i = 0; i < dimension; i++) {
var y = readingUp ? dimension - 1 - i : i;
for (var columnOffset = 0; columnOffset < 2; columnOffset++) {
var x = columnIndex - columnOffset;
if (!functionPatternMask.get(x, y)) {
bitsRead++;
var bit = matrix.get(x, y);
if (dataMask({ y: y, x: x })) {
bit = !bit;
}
currentByte = pushBit(bit, currentByte);
if (bitsRead === 8) { // Whole bytes
codewords.push(currentByte);
bitsRead = 0;
currentByte = 0;
}
}
}
}
readingUp = !readingUp;
}
return codewords;
}
function readVersion(matrix) {
var dimension = matrix.height;
var provisionalVersion = Math.floor((dimension - 17) / 4);
if (provisionalVersion <= 6) { // 6 and under dont have version info in the QR code
return version_1.VERSIONS[provisionalVersion - 1];
}
var topRightVersionBits = 0;
for (var y = 5; y >= 0; y--) {
for (var x = dimension - 9; x >= dimension - 11; x--) {
topRightVersionBits = pushBit(matrix.get(x, y), topRightVersionBits);
}
}
var bottomLeftVersionBits = 0;
for (var x = 5; x >= 0; x--) {
for (var y = dimension - 9; y >= dimension - 11; y--) {
bottomLeftVersionBits = pushBit(matrix.get(x, y), bottomLeftVersionBits);
}
}
var bestDifference = Infinity;
var bestVersion;
for (var _i = 0, VERSIONS_1 = version_1.VERSIONS; _i < VERSIONS_1.length; _i++) {
var version = VERSIONS_1[_i];
if (version.infoBits === topRightVersionBits || version.infoBits === bottomLeftVersionBits) {
return version;
}
var difference = numBitsDiffering(topRightVersionBits, version.infoBits);
if (difference < bestDifference) {
bestVersion = version;
bestDifference = difference;
}
difference = numBitsDiffering(bottomLeftVersionBits, version.infoBits);
if (difference < bestDifference) {
bestVersion = version;
bestDifference = difference;
}
}
// We can tolerate up to 3 bits of error since no two version info codewords will
// differ in less than 8 bits.
if (bestDifference <= 3) {
return bestVersion;
}
}
function readFormatInformation(matrix) {
var topLeftFormatInfoBits = 0;
for (var x = 0; x <= 8; x++) {
if (x !== 6) { // Skip timing pattern bit
topLeftFormatInfoBits = pushBit(matrix.get(x, 8), topLeftFormatInfoBits);
}
}
for (var y = 7; y >= 0; y--) {
if (y !== 6) { // Skip timing pattern bit
topLeftFormatInfoBits = pushBit(matrix.get(8, y), topLeftFormatInfoBits);
}
}
var dimension = matrix.height;
var topRightBottomRightFormatInfoBits = 0;
for (var y = dimension - 1; y >= dimension - 7; y--) { // bottom left
topRightBottomRightFormatInfoBits = pushBit(matrix.get(8, y), topRightBottomRightFormatInfoBits);
}
for (var x = dimension - 8; x < dimension; x++) { // top right
topRightBottomRightFormatInfoBits = pushBit(matrix.get(x, 8), topRightBottomRightFormatInfoBits);
}
var bestDifference = Infinity;
var bestFormatInfo = null;
for (var _i = 0, FORMAT_INFO_TABLE_1 = FORMAT_INFO_TABLE; _i < FORMAT_INFO_TABLE_1.length; _i++) {
var _a = FORMAT_INFO_TABLE_1[_i], bits = _a.bits, formatInfo = _a.formatInfo;
if (bits === topLeftFormatInfoBits || bits === topRightBottomRightFormatInfoBits) {
return formatInfo;
}
var difference = numBitsDiffering(topLeftFormatInfoBits, bits);
if (difference < bestDifference) {
bestFormatInfo = formatInfo;
bestDifference = difference;
}
if (topLeftFormatInfoBits !== topRightBottomRightFormatInfoBits) { // also try the other option
difference = numBitsDiffering(topRightBottomRightFormatInfoBits, bits);
if (difference < bestDifference) {
bestFormatInfo = formatInfo;
bestDifference = difference;
}
}
}
// Hamming distance of the 32 masked codes is 7, by construction, so <= 3 bits differing means we found a match
if (bestDifference <= 3) {
return bestFormatInfo;
}
return null;
}
function getDataBlocks(codewords, version, ecLevel) {
var ecInfo = version.errorCorrectionLevels[ecLevel];
var dataBlocks = [];
var totalCodewords = 0;
ecInfo.ecBlocks.forEach(function (block) {
for (var i = 0; i < block.numBlocks; i++) {
dataBlocks.push({ numDataCodewords: block.dataCodewordsPerBlock, codewords: [] });
totalCodewords += block.dataCodewordsPerBlock + ecInfo.ecCodewordsPerBlock;
}
});
// In some cases the QR code will be malformed enough that we pull off more or less than we should.
// If we pull off less there's nothing we can do.
// If we pull off more we can safely truncate
if (codewords.length < totalCodewords) {
return null;
}
codewords = codewords.slice(0, totalCodewords);
var shortBlockSize = ecInfo.ecBlocks[0].dataCodewordsPerBlock;
// Pull codewords to fill the blocks up to the minimum size
for (var i = 0; i < shortBlockSize; i++) {
for (var _i = 0, dataBlocks_1 = dataBlocks; _i < dataBlocks_1.length; _i++) {
var dataBlock = dataBlocks_1[_i];
dataBlock.codewords.push(codewords.shift());
}
}
// If there are any large blocks, pull codewords to fill the last element of those
if (ecInfo.ecBlocks.length > 1) {
var smallBlockCount = ecInfo.ecBlocks[0].numBlocks;
var largeBlockCount = ecInfo.ecBlocks[1].numBlocks;
for (var i = 0; i < largeBlockCount; i++) {
dataBlocks[smallBlockCount + i].codewords.push(codewords.shift());
}
}
// Add the rest of the codewords to the blocks. These are the error correction codewords.
while (codewords.length > 0) {
for (var _a = 0, dataBlocks_2 = dataBlocks; _a < dataBlocks_2.length; _a++) {
var dataBlock = dataBlocks_2[_a];
dataBlock.codewords.push(codewords.shift());
}
}
return dataBlocks;
}
function decodeMatrix(matrix) {
var version = readVersion(matrix);
if (!version) {
return null;
}
var formatInfo = readFormatInformation(matrix);
if (!formatInfo) {
return null;
}
var codewords = readCodewords(matrix, version, formatInfo);
var dataBlocks = getDataBlocks(codewords, version, formatInfo.errorCorrectionLevel);
if (!dataBlocks) {
return null;
}
// Count total number of data bytes
var totalBytes = dataBlocks.reduce(function (a, b) { return a + b.numDataCodewords; }, 0);
var resultBytes = new Uint8ClampedArray(totalBytes);
var resultIndex = 0;
for (var _i = 0, dataBlocks_3 = dataBlocks; _i < dataBlocks_3.length; _i++) {
var dataBlock = dataBlocks_3[_i];
var correctedBytes = reedsolomon_1.decode(dataBlock.codewords, dataBlock.codewords.length - dataBlock.numDataCodewords);
if (!correctedBytes) {
return null;
}
for (var i = 0; i < dataBlock.numDataCodewords; i++) {
resultBytes[resultIndex++] = correctedBytes[i];
}
}
try {
return decodeData_1.decode(resultBytes, version.versionNumber);
}
catch (_a) {
return null;
}
}
function decode(matrix) {
if (matrix == null) {
return null;
}
var result = decodeMatrix(matrix);
if (result) {
return result;
}
// Decoding didn't work, try mirroring the QR across the topLeft -> bottomRight line.
for (var x = 0; x < matrix.width; x++) {
for (var y = x + 1; y < matrix.height; y++) {
if (matrix.get(x, y) !== matrix.get(y, x)) {
matrix.set(x, y, !matrix.get(x, y));
matrix.set(y, x, !matrix.get(y, x));
}
}
}
return decodeMatrix(matrix);
}
exports.decode = decode;
/***/ }),
/* 6 */
/***/ (function(module, exports, __nested_webpack_require_33675__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
// tslint:disable:no-bitwise
var BitStream_1 = __nested_webpack_require_33675__(7);
var shiftJISTable_1 = __nested_webpack_require_33675__(8);
var Mode;
(function (Mode) {
Mode["Numeric"] = "numeric";
Mode["Alphanumeric"] = "alphanumeric";
Mode["Byte"] = "byte";
Mode["Kanji"] = "kanji";
Mode["ECI"] = "eci";
})(Mode = exports.Mode || (exports.Mode = {}));
var ModeByte;
(function (ModeByte) {
ModeByte[ModeByte["Terminator"] = 0] = "Terminator";
ModeByte[ModeByte["Numeric"] = 1] = "Numeric";
ModeByte[ModeByte["Alphanumeric"] = 2] = "Alphanumeric";
ModeByte[ModeByte["Byte"] = 4] = "Byte";
ModeByte[ModeByte["Kanji"] = 8] = "Kanji";
ModeByte[ModeByte["ECI"] = 7] = "ECI";
// StructuredAppend = 0x3,
// FNC1FirstPosition = 0x5,
// FNC1SecondPosition = 0x9,
})(ModeByte || (ModeByte = {}));
function decodeNumeric(stream, size) {
var bytes = [];
var text = "";
var characterCountSize = [10, 12, 14][size];
var length = stream.readBits(characterCountSize);
// Read digits in groups of 3
while (length >= 3) {
var num = stream.readBits(10);
if (num >= 1000) {
throw new Error("Invalid numeric value above 999");
}
var a = Math.floor(num / 100);
var b = Math.floor(num / 10) % 10;
var c = num % 10;
bytes.push(48 + a, 48 + b, 48 + c);
text += a.toString() + b.toString() + c.toString();
length -= 3;
}
// If the number of digits aren't a multiple of 3, the remaining digits are special cased.
if (length === 2) {
var num = stream.readBits(7);
if (num >= 100) {
throw new Error("Invalid numeric value above 99");
}
var a = Math.floor(num / 10);
var b = num % 10;
bytes.push(48 + a, 48 + b);
text += a.toString() + b.toString();
}
else if (length === 1) {
var num = stream.readBits(4);
if (num >= 10) {
throw new Error("Invalid numeric value above 9");
}
bytes.push(48 + num);
text += num.toString();
}
return { bytes: bytes, text: text };
}
var AlphanumericCharacterCodes = [
"0", "1", "2", "3", "4", "5", "6", "7", "8",
"9", "A", "B", "C", "D", "E", "F", "G", "H",
"I", "J", "K", "L", "M", "N", "O", "P", "Q",
"R", "S", "T", "U", "V", "W", "X", "Y", "Z",
" ", "$", "%", "*", "+", "-", ".", "/", ":",
];
function decodeAlphanumeric(stream, size) {
var bytes = [];
var text = "";
var characterCountSize = [9, 11, 13][size];
var length = stream.readBits(characterCountSize);
while (length >= 2) {
var v = stream.readBits(11);
var a = Math.floor(v / 45);
var b = v % 45;
bytes.push(AlphanumericCharacterCodes[a].charCodeAt(0), AlphanumericCharacterCodes[b].charCodeAt(0));
text += AlphanumericCharacterCodes[a] + AlphanumericCharacterCodes[b];
length -= 2;
}
if (length === 1) {
var a = stream.readBits(6);
bytes.push(AlphanumericCharacterCodes[a].charCodeAt(0));
text += AlphanumericCharacterCodes[a];
}
return { bytes: bytes, text: text };
}
function decodeByte(stream, size) {
var bytes = [];
var text = "";
var characterCountSize = [8, 16, 16][size];
var length = stream.readBits(characterCountSize);
for (var i = 0; i < length; i++) {
var b = stream.readBits(8);
bytes.push(b);
}
try {
text += decodeURIComponent(bytes.map(function (b) { return "%" + ("0" + b.toString(16)).substr(-2); }).join(""));
}
catch (_a) {
// failed to decode
}
return { bytes: bytes, text: text };
}
function decodeKanji(stream, size) {
var bytes = [];
var text = "";
var characterCountSize = [8, 10, 12][size];
var length = stream.readBits(characterCountSize);
for (var i = 0; i < length; i++) {
var k = stream.readBits(13);
var c = (Math.floor(k / 0xC0) << 8) | (k % 0xC0);
if (c < 0x1F00) {
c += 0x8140;
}
else {
c += 0xC140;
}
bytes.push(c >> 8, c & 0xFF);
text += String.fromCharCode(shiftJISTable_1.shiftJISTable[c]);
}
return { bytes: bytes, text: text };
}
function decode(data, version) {
var _a, _b, _c, _d;
var stream = new BitStream_1.BitStream(data);
// There are 3 'sizes' based on the version. 1-9 is small (0), 10-26 is medium (1) and 27-40 is large (2).
var size = version <= 9 ? 0 : version <= 26 ? 1 : 2;
var result = {
text: "",
bytes: [],
chunks: [],
version: version,
};
while (stream.available() >= 4) {
var mode = stream.readBits(4);
if (mode === ModeByte.Terminator) {
return result;
}
else if (mode === ModeByte.ECI) {
if (stream.readBits(1) === 0) {
result.chunks.push({
type: Mode.ECI,
assignmentNumber: stream.readBits(7),
});
}
else if (stream.readBits(1) === 0) {
result.chunks.push({
type: Mode.ECI,
assignmentNumber: stream.readBits(14),
});
}
else if (stream.readBits(1) === 0) {
result.chunks.push({
type: Mode.ECI,
assignmentNumber: stream.readBits(21),
});
}
else {
// ECI data seems corrupted
result.chunks.push({
type: Mode.ECI,
assignmentNumber: -1,
});
}
}
else if (mode === ModeByte.Numeric) {
var numericResult = decodeNumeric(stream, size);
result.text += numericResult.text;
(_a = result.bytes).push.apply(_a, numericResult.bytes);
result.chunks.push({
type: Mode.Numeric,
text: numericResult.text,
});
}
else if (mode === ModeByte.Alphanumeric) {
var alphanumericResult = decodeAlphanumeric(stream, size);
result.text += alphanumericResult.text;
(_b = result.bytes).push.apply(_b, alphanumericResult.bytes);
result.chunks.push({
type: Mode.Alphanumeric,
text: alphanumericResult.text,
});
}
else if (mode === ModeByte.Byte) {
var byteResult = decodeByte(stream, size);
result.text += byteResult.text;
(_c = result.bytes).push.apply(_c, byteResult.bytes);
result.chunks.push({
type: Mode.Byte,
bytes: byteResult.bytes,
text: byteResult.text,
});
}
else if (mode === ModeByte.Kanji) {
var kanjiResult = decodeKanji(stream, size);
result.text += kanjiResult.text;
(_d = result.bytes).push.apply(_d, kanjiResult.bytes);
result.chunks.push({
type: Mode.Kanji,
bytes: kanjiResult.bytes,
text: kanjiResult.text,
});
}
}
// If there is no data left, or the remaining bits are all 0, then that counts as a termination marker
if (stream.available() === 0 || stream.readBits(stream.available()) === 0) {
return result;
}
}
exports.decode = decode;
/***/ }),
/* 7 */
/***/ (function(module, exports, __nccwpck_require__) {
"use strict";
// tslint:disable:no-bitwise
Object.defineProperty(exports, "__esModule", { value: true });
var BitStream = /** @class */ (function () {
function BitStream(bytes) {
this.byteOffset = 0;
this.bitOffset = 0;
this.bytes = bytes;
}
BitStream.prototype.readBits = function (numBits) {
if (numBits < 1 || numBits > 32 || numBits > this.available()) {
throw new Error("Cannot read " + numBits.toString() + " bits");
}
var result = 0;
// First, read remainder from current byte
if (this.bitOffset > 0) {
var bitsLeft = 8 - this.bitOffset;
var toRead = numBits < bitsLeft ? numBits : bitsLeft;
var bitsToNotRead = bitsLeft - toRead;
var mask = (0xFF >> (8 - toRead)) << bitsToNotRead;
result = (this.bytes[this.byteOffset] & mask) >> bitsToNotRead;
numBits -= toRead;
this.bitOffset += toRead;
if (this.bitOffset === 8) {
this.bitOffset = 0;
this.byteOffset++;
}
}
// Next read whole bytes
if (numBits > 0) {
while (numBits >= 8) {
result = (result << 8) | (this.bytes[this.byteOffset] & 0xFF);
this.byteOffset++;
numBits -= 8;
}
// Finally read a partial byte
if (numBits > 0) {
var bitsToNotRead = 8 - numBits;
var mask = (0xFF >> bitsToNotRead) << bitsToNotRead;
result = (result << numBits) | ((this.bytes[this.byteOffset] & mask) >> bitsToNotRead);
this.bitOffset += numBits;
}
}
return result;
};
BitStream.prototype.available = function () {
return 8 * (this.bytes.length - this.byteOffset) - this.bitOffset;
};
return BitStream;
}());
exports.BitStream = BitStream;
/***/ }),
/* 8 */
/***/ (function(module, exports, __nccwpck_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.shiftJISTable = {
0x20: 0x0020,
0x21: 0x0021,
0x22: 0x0022,
0x23: 0x0023,
0x24: 0x0024,
0x25: 0x0025,
0x26: 0x0026,
0x27: 0x0027,
0x28: 0x0028,
0x29: 0x0029,
0x2A: 0x002A,
0x2B: 0x002B,
0x2C: 0x002C,
0x2D: 0x002D,
0x2E: 0x002E,
0x2F: 0x002F,
0x30: 0x0030,
0x31: 0x0031,
0x32: 0x0032,
0x33: 0x0033,
0x34: 0x0034,
0x35: 0x0035,
0x36: 0x0036,
0x37: 0x0037,
0x38: 0x0038,
0x39: 0x0039,
0x3A: 0x003A,
0x3B: 0x003B,
0x3C: 0x003C,
0x3D: 0x003D,
0x3E: 0x003E,
0x3F: 0x003F,
0x40: 0x0040,
0x41: 0x0041,
0x42: 0x0042,
0x43: 0x0043,
0x44: 0x0044,
0x45: 0x0045,
0x46: 0x0046,
0x47: 0x0047,
0x48: 0x0048,
0x49: 0x0049,
0x4A: 0x004A,
0x4B: 0x004B,
0x4C: 0x004C,
0x4D: 0x004D,
0x4E: 0x004E,
0x4F: 0x004F,
0x50: 0x0050,
0x51: 0x0051,
0x52: 0x0052,
0x53: 0x0053,
0x54: 0x0054,
0x55: 0x0055,
0x56: 0x0056,
0x57: 0x0057,
0x58: 0x0058,
0x59: 0x0059,
0x5A: 0x005A,
0x5B: 0x005B,
0x5C: 0x00A5,
0x5D: 0x005D,
0x5E: 0x005E,
0x5F: 0x005F,
0x60: 0x0060,
0x61: 0x0061,
0x62: 0x0062,
0x63: 0x0063,
0x64: 0x0064,
0x65: 0x0065,
0x66: 0x0066,
0x67: 0x0067,
0x68: 0x0068,
0x69: 0x0069,
0x6A: 0x006A,
0x6B: 0x006B,
0x6C: 0x006C,
0x6D: 0x006D,
0x6E: 0x006E,
0x6F: 0x006F,
0x70: 0x0070,
0x71: 0x0071,
0x72: 0x0072,
0x73: 0x0073,
0x74: 0x0074,
0x75: 0x0075,
0x76: 0x0076,
0x77: 0x0077,
0x78: 0x0078,
0x79: 0x0079,
0x7A: 0x007A,
0x7B: 0x007B,
0x7C: 0x007C,
0x7D: 0x007D,
0x7E: 0x203E,
0x8140: 0x3000,
0x8141: 0x3001,
0x8142: 0x3002,
0x8143: 0xFF0C,
0x8144: 0xFF0E,
0x8145: 0x30FB,
0x8146: 0xFF1A,
0x8147: 0xFF1B,
0x8148: 0xFF1F,
0x8149: 0xFF01,
0x814A: 0x309B,
0x814B: 0x309C,
0x814C: 0x00B4,
0x814D: 0xFF40,
0x814E: 0x00A8,
0x814F: 0xFF3E,
0x8150: 0xFFE3,
0x8151: 0xFF3F,
0x8152: 0x30FD,
0x8153: 0x30FE,
0x8154: 0x309D,
0x8155: 0x309E,
0x8156: 0x3003,
0x8157: 0x4EDD,
0x8158: 0x3005,
0x8159: 0x3006,
0x815A: 0x3007,
0x815B: 0x30FC,
0x815C: 0x2015,
0x815D: 0x2010,
0x815E: 0xFF0F,
0x815F: 0x005C,
0x8160: 0x301C,
0x8161: 0x2016,
0x8162: 0xFF5C,
0x8163: 0x2026,
0x8164: 0x2025,
0x8165: 0x2018,
0x8166: 0x2019,
0x8167: 0x201C,
0x8168: 0x201D,
0x8169: 0xFF08,
0x816A: 0xFF09,
0x816B: 0x3014,
0x816C: 0x3015,
0x816D: 0xFF3B,
0x816E: 0xFF3D,
0x816F: 0xFF5B,
0x8170: 0xFF5D,
0x8171: 0x3008,
0x8172: 0x3009,
0x8173: 0x300A,
0x8174: 0x300B,
0x8175: 0x300C,
0x8176: 0x300D,
0x8177: 0x300E,
0x8178: 0x300F,
0x8179: 0x3010,
0x817A: 0x3011,
0x817B: 0xFF0B,
0x817C: 0x2212,
0x817D: 0x00B1,
0x817E: 0x00D7,
0x8180: 0x00F7,
0x8181: 0xFF1D,
0x8182: 0x2260,
0x8183: 0xFF1C,
0x8184: 0xFF1E,
0x8185: 0x2266,
0x8186: 0x2267,
0x8187: 0x221E,
0x8188: 0x2234,
0x8189: 0x2642,
0x818A: 0x2640,
0x818B: 0x00B0,
0x818C: 0x2032,
0x818D: 0x2033,
0x818E: 0x2103,
0x818F: 0xFFE5,
0x8190: 0xFF04,
0x8191: 0x00A2,
0x8192: 0x00A3,
0x8193: 0xFF05,
0x8194: 0xFF03,
0x8195: 0xFF06,
0x8196: 0xFF0A,
0x8197: 0xFF20,
0x8198: 0x00A7,
0x8199: 0x2606,
0x819A: 0x2605,
0x819B: 0x25CB,
0x819C: 0x25CF,
0x819D: 0x25CE,
0x819E: 0x25C7,
0x819F: 0x25C6,
0x81A0: 0x25A1,
0x81A1: 0x25A0,
0x81A2: 0x25B3,
0x81A3: 0x25B2,
0x81A4: 0x25BD,
0x81A5: 0x25BC,
0x81A6: 0x203B,
0x81A7: 0x3012,
0x81A8: 0x2192,
0x81A9: 0x2190,
0x81AA: 0x2191,
0x81AB: 0x2193,
0x81AC: 0x3013,
0x81B8: 0x2208,
0x81B9: 0x220B,
0x81BA: 0x2286,
0x81BB: 0x2287,
0x81BC: 0x2282,
0x81BD: 0x2283,
0x81BE: 0x222A,
0x81BF: 0x2229,
0x81C8: 0x2227,
0x81C9: 0x2228,
0x81CA: 0x00AC,
0x81CB: 0x21D2,
0x81CC: 0x21D4,
0x81CD: 0x2200,
0x81CE: 0x2203,
0x81DA: 0x2220,
0x81DB: 0x22A5,
0x81DC: 0x2312,
0x81DD: 0x2202,
0x81DE: 0x2207,
0x81DF: 0x2261,
0x81E0: 0x2252,
0x81E1: 0x226A,
0x81E2: 0x226B,
0x81E3: 0x221A,
0x81E4: 0x223D,
0x81E5: 0x221D,
0x81E6: 0x2235,
0x81E7: 0x222B,
0x81E8: 0x222C,
0x81F0: 0x212B,
0x81F1: 0x2030,
0x81F2: 0x266F,
0x81F3: 0x266D,
0x81F4: 0x266A,
0x81F5: 0x2020,
0x81F6: 0x2021,
0x81F7: 0x00B6,
0x81FC: 0x25EF,
0x824F: 0xFF10,
0x8250: 0xFF11,
0x8251: 0xFF12,
0x8252: 0xFF13,
0x8253: 0xFF14,
0x8254: 0xFF15,
0x8255: 0xFF16,
0x8256: 0xFF17,
0x8257: 0xFF18,
0x8258: 0xFF19,
0x8260: 0xFF21,
0x8261: 0xFF22,
0x8262: 0xFF23,
0x8263: 0xFF24,
0x8264: 0xFF25,
0x8265: 0xFF26,
0x8266: 0xFF27,
0x8267: 0xFF28,
0x8268: 0xFF29,
0x8269: 0xFF2A,
0x826A: 0xFF2B,
0x826B: 0xFF2C,
0x826C: 0xFF2D,
0x826D: 0xFF2E,
0x826E: 0xFF2F,
0x826F: 0xFF30,
0x8270: 0xFF31,
0x8271: 0xFF32,
0x8272: 0xFF33,
0x8273: 0xFF34,
0x8274: 0xFF35,
0x8275: 0xFF36,
0x8276: 0xFF37,
0x8277: 0xFF38,
0x8278: 0xFF39,
0x8279: 0xFF3A,
0x8281: 0xFF41,
0x8282: 0xFF42,
0x8283: 0xFF43,
0x8284: 0xFF44,
0x8285: 0xFF45,
0x8286: 0xFF46,
0x8287: 0xFF47,
0x8288: 0xFF48,
0x8289: 0xFF49,
0x828A: 0xFF4A,
0x828B: 0xFF4B,
0x828C: 0xFF4C,
0x828D: 0xFF4D,
0x828E: 0xFF4E,
0x828F: 0xFF4F,
0x8290: 0xFF50,
0x8291: 0xFF51,
0x8292: 0xFF52,
0x8293: 0xFF53,
0x8294: 0xFF54,
0x8295: 0xFF55,
0x8296: 0xFF56,
0x8297: 0xFF57,
0x8298: 0xFF58,
0x8299: 0xFF59,
0x829A: 0xFF5A,
0x829F: 0x3041,
0x82A0: 0x3042,
0x82A1: 0x3043,
0x82A2: 0x3044,
0x82A3: 0x3045,
0x82A4: 0x3046,
0x82A5: 0x3047,
0x82A6: 0x3048,
0x82A7: 0x3049,
0x82A8: 0x304A,
0x82A9: 0x304B,
0x82AA: 0x304C,
0x82AB: 0x304D,
0x82AC: 0x304E,
0x82AD: 0x304F,
0x82AE: 0x3050,
0x82AF: 0x3051,
0x82B0: 0x3052,
0x82B1: 0x3053,
0x82B2: 0x3054,
0x82B3: 0x3055,
0x82B4: 0x3056,
0x82B5: 0x3057,
0x82B6: 0x3058,
0x82B7: 0x3059,
0x82B8: 0x305A,
0x82B9: 0x305B,
0x82BA: 0x305C,
0x82BB: 0x305D,
0x82BC: 0x305E,
0x82BD: 0x305F,
0x82BE: 0x3060,
0x82BF: 0x3061,
0x82C0: 0x3062,
0x82C1: 0x3063,
0x82C2: 0x3064,
0x82C3: 0x3065,
0x82C4: 0x3066,
0x82C5: 0x3067,
0x82C6: 0x3068,
0x82C7: 0x3069,
0x82C8: 0x306A,
0x82C9: 0x306B,
0x82CA: 0x306C,
0x82CB: 0x306D,
0x82CC: 0x306E,
0x82CD: 0x306F,
0x82CE: 0x3070,
0x82CF: 0x3071,
0x82D0: 0x3072,
0x82D1: 0x3073,
0x82D2: 0x3074,
0x82D3: 0x3075,
0x82D4: 0x3076,
0x82D5: 0x3077,
0x82D6: 0x3078,
0x82D7: 0x3079,
0x82D8: 0x307A,
0x82D9: 0x307B,
0x82DA: 0x307C,
0x82DB: 0x307D,
0x82DC: 0x307E,
0x82DD: 0x307F,
0x82DE: 0x3080,
0x82DF: 0x3081,
0x82E0: 0x3082,
0x82E1: 0x3083,
0x82E2: 0x3084,
0x82E3: 0x3085,
0x82E4: 0x3086,
0x82E5: 0x3087,
0x82E6: 0x3088,
0x82E7: 0x3089,
0x82E8: 0x308A,
0x82E9: 0x308B,
0x82EA: 0x308C,
0x82EB: 0x308D,
0x82EC: 0x308E,
0x82ED: 0x308F,
0x82EE: 0x3090,
0x82EF: 0x3091,
0x82F0: 0x3092,
0x82F1: 0x3093,
0x8340: 0x30A1,
0x8341: 0x30A2,
0x8342: 0x30A3,
0x8343: 0x30A4,
0x8344: 0x30A5,
0x8345: 0x30A6,
0x8346: 0x30A7,
0x8347: 0x30A8,
0x8348: 0x30A9,
0x8349: 0x30AA,
0x834A: 0x30AB,
0x834B: 0x30AC,
0x834C: 0x30AD,
0x834D: 0x30AE,
0x834E: 0x30AF,
0x834F: 0x30B0,
0x8350: 0x30B1,
0x8351: 0x30B2,
0x8352: 0x30B3,
0x8353: 0x30B4,
0x8354: 0x30B5,
0x8355: 0x30B6,
0x8356: 0x30B7,
0x8357: 0x30B8,
0x8358: 0x30B9,
0x8359: 0x30BA,
0x835A: 0x30BB,
0x835B: 0x30BC,
0x835C: 0x30BD,
0x835D: 0x30BE,
0x835E: 0x30BF,
0x835F: 0x30C0,
0x8360: 0x30C1,
0x8361: 0x30C2,
0x8362: 0x30C3,
0x8363: 0x30C4,
0x8364: 0x30C5,
0x8365: 0x30C6,
0x8366: 0x30C7,
0x8367: 0x30C8,
0x8368: 0x30C9,
0x8369: 0x30CA,
0x836A: 0x30CB,
0x836B: 0x30CC,
0x836C: 0x30CD,
0x836D: 0x30CE,
0x836E: 0x30CF,
0x836F: 0x30D0,
0x8370: 0x30D1,
0x8371: 0x30D2,
0x8372: 0x30D3,
0x8373: 0x30D4,
0x8374: 0x30D5,
0x8375: 0x30D6,
0x8376: 0x30D7,
0x8377: 0x30D8,
0x8378: 0x30D9,
0x8379: 0x30DA,
0x837A: 0x30DB,
0x837B: 0x30DC,
0x837C: 0x30DD,
0x837D: 0x30DE,
0x837E: 0x30DF,
0x8380: 0x30E0,
0x8381: 0x30E1,
0x8382: 0x30E2,
0x8383: 0x30E3,
0x8384: 0x30E4,
0x8385: 0x30E5,
0x8386: 0x30E6,
0x8387: 0x30E7,
0x8388: 0x30E8,
0x8389: 0x30E9,
0x838A: 0x30EA,
0x838B: 0x30EB,
0x838C: 0x30EC,
0x838D: 0x30ED,
0x838E: 0x30EE,
0x838F: 0x30EF,
0x8390: 0x30F0,
0x8391: 0x30F1,
0x8392: 0x30F2,
0x8393: 0x30F3,
0x8394: 0x30F4,
0x8395: 0x30F5,
0x8396: 0x30F6,
0x839F: 0x0391,
0x83A0: 0x0392,
0x83A1: 0x0393,
0x83A2: 0x0394,
0x83A3: 0x0395,
0x83A4: 0x0396,
0x83A5: 0x0397,
0x83A6: 0x0398,
0x83A7: 0x0399,
0x83A8: 0x039A,
0x83A9: 0x039B,
0x83AA: 0x039C,
0x83AB: 0x039D,
0x83AC: 0x039E,
0x83AD: 0x039F,
0x83AE: 0x03A0,
0x83AF: 0x03A1,
0x83B0: 0x03A3,
0x83B1: 0x03A4,
0x83B2: 0x03A5,
0x83B3: 0x03A6,
0x83B4: 0x03A7,
0x83B5: 0x03A8,
0x83B6: 0x03A9,
0x83BF: 0x03B1,
0x83C0: 0x03B2,
0x83C1: 0x03B3,
0x83C2: 0x03B4,
0x83C3: 0x03B5,
0x83C4: 0x03B6,
0x83C5: 0x03B7,
0x83C6: 0x03B8,
0x83C7: 0x03B9,
0x83C8: 0x03BA,
0x83C9: 0x03BB,
0x83CA: 0x03BC,
0x83CB: 0x03BD,
0x83CC: 0x03BE,
0x83CD: 0x03BF,
0x83CE: 0x03C0,
0x83CF: 0x03C1,
0x83D0: 0x03C3,
0x83D1: 0x03C4,
0x83D2: 0x03C5,
0x83D3: 0x03C6,
0x83D4: 0x03C7,
0x83D5: 0x03C8,
0x83D6: 0x03C9,
0x8440: 0x0410,
0x8441: 0x0411,
0x8442: 0x0412,
0x8443: 0x0413,
0x8444: 0x0414,
0x8445: 0x0415,
0x8446: 0x0401,
0x8447: 0x0416,
0x8448: 0x0417,
0x8449: 0x0418,
0x844A: 0x0419,
0x844B: 0x041A,
0x844C: 0x041B,
0x844D: 0x041C,
0x844E: 0x041D,
0x844F: 0x041E,
0x8450: 0x041F,
0x8451: 0x0420,
0x8452: 0x0421,
0x8453: 0x0422,
0x8454: 0x0423,
0x8455: 0x0424,
0x8456: 0x0425,
0x8457: 0x0426,
0x8458: 0x0427,
0x8459: 0x0428,
0x845A: 0x0429,
0x845B: 0x042A,
0x845C: 0x042B,
0x845D: 0x042C,
0x845E: 0x042D,
0x845F: 0x042E,
0x8460: 0x042F,
0x8470: 0x0430,
0x8471: 0x0431,
0x8472: 0x0432,
0x8473: 0x0433,
0x8474: 0x0434,
0x8475: 0x0435,
0x8476: 0x0451,
0x8477: 0x0436,
0x8478: 0x0437,
0x8479: 0x0438,
0x847A: 0x0439,
0x847B: 0x043A,
0x847C: 0x043B,
0x847D: 0x043C,
0x847E: 0x043D,
0x8480: 0x043E,
0x8481: 0x043F,
0x8482: 0x0440,
0x8483: 0x0441,
0x8484: 0x0442,
0x8485: 0x0443,
0x8486: 0x0444,
0x8487: 0x0445,
0x8488: 0x0446,
0x8489: 0x0447,
0x848A: 0x0448,
0x848B: 0x0449,
0x848C: 0x044A,
0x848D: 0x044B,
0x848E: 0x044C,
0x848F: 0x044D,
0x8490: 0x044E,
0x8491: 0x044F,
0x849F: 0x2500,
0x84A0: 0x2502,
0x84A1: 0x250C,
0x84A2: 0x2510,
0x84A3: 0x2518,
0x84A4: 0x2514,
0x84A5: 0x251C,
0x84A6: 0x252C,
0x84A7: 0x2524,
0x84A8: 0x2534,
0x84A9: 0x253C,
0x84AA: 0x2501,
0x84AB: 0x2503,
0x84AC: 0x250F,
0x84AD: 0x2513,
0x84AE: 0x251B,
0x84AF: 0x2517,
0x84B0: 0x2523,
0x84B1: 0x2533,
0x84B2: 0x252B,
0x84B3: 0x253B,
0x84B4: 0x254B,
0x84B5: 0x2520,
0x84B6: 0x252F,
0x84B7: 0x2528,
0x84B8: 0x2537,
0x84B9: 0x253F,
0x84BA: 0x251D,
0x84BB: 0x2530,
0x84BC: 0x2525,
0x84BD: 0x2538,
0x84BE: 0x2542,
0x889F: 0x4E9C,
0x88A0: 0x5516,
0x88A1: 0x5A03,
0x88A2: 0x963F,
0x88A3: 0x54C0,
0x88A4: 0x611B,
0x88A5: 0x6328,
0x88A6: 0x59F6,
0x88A7: 0x9022,
0x88A8: 0x8475,
0x88A9: 0x831C,
0x88AA: 0x7A50,
0x88AB: 0x60AA,
0x88AC: 0x63E1,
0x88AD: 0x6E25,
0x88AE: 0x65ED,
0x88AF: 0x8466,
0x88B0: 0x82A6,
0x88B1: 0x9BF5,
0x88B2: 0x6893,
0x88B3: 0x5727,
0x88B4: 0x65A1,
0x88B5: 0x6271,
0x88B6: 0x5B9B,
0x88B7: 0x59D0,
0x88B8: 0x867B,
0x88B9: 0x98F4,
0x88BA: 0x7D62,
0x88BB: 0x7DBE,
0x88BC: 0x9B8E,
0x88BD: 0x6216,
0x88BE: 0x7C9F,
0x88BF: 0x88B7,
0x88C0: 0x5B89,
0x88C1: 0x5EB5,
0x88C2: 0x6309,
0x88C3: 0x6697,
0x88C4: 0x6848,
0x88C5: 0x95C7,
0x88C6: 0x978D,
0x88C7: 0x674F,
0x88C8: 0x4EE5,
0x88C9: 0x4F0A,
0x88CA: 0x4F4D,
0x88CB: 0x4F9D,
0x88CC: 0x5049,
0x88CD: 0x56F2,
0x88CE: 0x5937,
0x88CF: 0x59D4,
0x88D0: 0x5A01,
0x88D1: 0x5C09,
0x88D2: 0x60DF,
0x88D3: 0x610F,
0x88D4: 0x6170,
0x88D5: 0x6613,
0x88D6: 0x6905,
0x88D7: 0x70BA,
0x88D8: 0x754F,
0x88D9: 0x7570,
0x88DA: 0x79FB,
0x88DB: 0x7DAD,
0x88DC: 0x7DEF,
0x88DD: 0x80C3,
0x88DE: 0x840E,
0x88DF: 0x8863,
0x88E0: 0x8B02,
0x88E1: 0x9055,
0x88E2: 0x907A,
0x88E3: 0x533B,
0x88E4: 0x4E95,
0x88E5: 0x4EA5,
0x88E6: 0x57DF,
0x88E7: 0x80B2,
0x88E8: 0x90C1,
0x88E9: 0x78EF,
0x88EA: 0x4E00,
0x88EB: 0x58F1,
0x88EC: 0x6EA2,
0x88ED: 0x9038,
0x88EE: 0x7A32,
0x88EF: 0x8328,
0x88F0: 0x828B,
0x88F1: 0x9C2F,
0x88F2: 0x5141,
0x88F3: 0x5370,
0x88F4: 0x54BD,
0x88F5: 0x54E1,
0x88F6: 0x56E0,
0x88F7: 0x59FB,
0x88F8: 0x5F15,
0x88F9: 0x98F2,
0x88FA: 0x6DEB,
0x88FB: 0x80E4,
0x88FC: 0x852D,
0x8940: 0x9662,
0x8941: 0x9670,
0x8942: 0x96A0,
0x8943: 0x97FB,
0x8944: 0x540B,
0x8945: 0x53F3,
0x8946: 0x5B87,
0x8947: 0x70CF,
0x8948: 0x7FBD,
0x8949: 0x8FC2,
0x894A: 0x96E8,
0x894B: 0x536F,
0x894C: 0x9D5C,
0x894D: 0x7ABA,
0x894E: 0x4E11,
0x894F: 0x7893,
0x8950: 0x81FC,
0x8951: 0x6E26,
0x8952: 0x5618,
0x8953: 0x5504,
0x8954: 0x6B1D,
0x8955: 0x851A,
0x8956: 0x9C3B,
0x8957: 0x59E5,
0x8958: 0x53A9,
0x8959: 0x6D66,
0x895A: 0x74DC,
0x895B: 0x958F,
0x895C: 0x5642,
0x895D: 0x4E91,
0x895E: 0x904B,
0x895F: 0x96F2,
0x8960: 0x834F,
0x8961: 0x990C,
0x8962: 0x53E1,
0x8963: 0x55B6,
0x8964: 0x5B30,
0x8965: 0x5F71,
0x8966: 0x6620,
0x8967: 0x66F3,
0x8968: 0x6804,
0x8969: 0x6C38,
0x896A: 0x6CF3,
0x896B: 0x6D29,
0x896C: 0x745B,
0x896D: 0x76C8,
0x896E: 0x7A4E,
0x896F: 0x9834,
0x8970: 0x82F1,
0x8971: 0x885B,
0x8972: 0x8A60,
0x8973: 0x92ED,
0x8974: 0x6DB2,
0x8975: 0x75AB,
0x8976: 0x76CA,
0x8977: 0x99C5,
0x8978: 0x60A6,
0x8979: 0x8B01,
0x897A: 0x8D8A,
0x897B: 0x95B2,
0x897C: 0x698E,
0x897D: 0x53AD,
0x897E: 0x5186,
0x8980: 0x5712,
0x8981: 0x5830,
0x8982: 0x5944,
0x8983: 0x5BB4,
0x8984: 0x5EF6,
0x8985: 0x6028,
0x8986: 0x63A9,
0x8987: 0x63F4,
0x8988: 0x6CBF,
0x8989: 0x6F14,
0x898A: 0x708E,
0x898B: 0x7114,
0x898C: 0x7159,
0x898D: 0x71D5,
0x898E: 0x733F,
0x898F: 0x7E01,
0x8990: 0x8276,
0x8991: 0x82D1,
0x8992: 0x8597,
0x8993: 0x9060,
0x8994: 0x925B,
0x8995: 0x9D1B,
0x8996: 0x5869,
0x8997: 0x65BC,
0x8998: 0x6C5A,
0x8999: 0x7525,
0x899A: 0x51F9,
0x899B: 0x592E,
0x899C: 0x5965,
0x899D: 0x5F80,
0x899E: 0x5FDC,
0x899F: 0x62BC,
0x89A0: 0x65FA,
0x89A1: 0x6A2A,
0x89A2: 0x6B27,
0x89A3: 0x6BB4,
0x89A4: 0x738B,
0x89A5: 0x7FC1,
0x89A6: 0x8956,
0x89A7: 0x9D2C,
0x89A8: 0x9D0E,
0x89A9: 0x9EC4,
0x89AA: 0x5CA1,
0x89AB: 0x6C96,
0x89AC: 0x837B,
0x89AD: 0x5104,
0x89AE: 0x5C4B,
0x89AF: 0x61B6,
0x89B0: 0x81C6,
0x89B1: 0x6876,
0x89B2: 0x7261,
0x89B3: 0x4E59,
0x89B4: 0x4FFA,
0x89B5: 0x5378,
0x89B6: 0x6069,
0x89B7: 0x6E29,
0x89B8: 0x7A4F,
0x89B9: 0x97F3,
0x89BA: 0x4E0B,
0x89BB: 0x5316,
0x89BC: 0x4EEE,
0x89BD: 0x4F55,
0x89BE: 0x4F3D,
0x89BF: 0x4FA1,
0x89C0: 0x4F73,
0x89C1: 0x52A0,
0x89C2: 0x53EF,
0x89C3: 0x5609,
0x89C4: 0x590F,
0x89C5: 0x5AC1,
0x89C6: 0x5BB6,
0x89C7: 0x5BE1,
0x89C8: 0x79D1,
0x89C9: 0x6687,
0x89CA: 0x679C,
0x89CB: 0x67B6,
0x89CC: 0x6B4C,
0x89CD: 0x6CB3,
0x89CE: 0x706B,
0x89CF: 0x73C2,
0x89D0: 0x798D,
0x89D1: 0x79BE,
0x89D2: 0x7A3C,
0x89D3: 0x7B87,
0x89D4: 0x82B1,
0x89D5: 0x82DB,
0x89D6: 0x8304,
0x89D7: 0x8377,
0x89D8: 0x83EF,
0x89D9: 0x83D3,
0x89DA: 0x8766,
0x89DB: 0x8AB2,
0x89DC: 0x5629,
0x89DD: 0x8CA8,
0x89DE: 0x8FE6,
0x89DF: 0x904E,
0x89E0: 0x971E,
0x89E1: 0x868A,
0x89E2: 0x4FC4,
0x89E3: 0x5CE8,
0x89E4: 0x6211,
0x89E5: 0x7259,
0x89E6: 0x753B,
0x89E7: 0x81E5,
0x89E8: 0x82BD,
0x89E9: 0x86FE,
0x89EA: 0x8CC0,
0x89EB: 0x96C5,
0x89EC: 0x9913,
0x89ED: 0x99D5,
0x89EE: 0x4ECB,
0x89EF: 0x4F1A,
0x89F0: 0x89E3,
0x89F1: 0x56DE,
0x89F2: 0x584A,
0x89F3: 0x58CA,
0x89F4: 0x5EFB,
0x89F5: 0x5FEB,
0x89F6: 0x602A,
0x89F7: 0x6094,
0x89F8: 0x6062,
0x89F9: 0x61D0,
0x89FA: 0x6212,
0x89FB: 0x62D0,
0x89FC: 0x6539,
0x8A40: 0x9B41,
0x8A41: 0x6666,
0x8A42: 0x68B0,
0x8A43: 0x6D77,
0x8A44: 0x7070,
0x8A45: 0x754C,
0x8A46: 0x7686,
0x8A47: 0x7D75,
0x8A48: 0x82A5,
0x8A49: 0x87F9,
0x8A4A: 0x958B,
0x8A4B: 0x968E,
0x8A4C: 0x8C9D,
0x8A4D: 0x51F1,
0x8A4E: 0x52BE,
0x8A4F: 0x5916,
0x8A50: 0x54B3,
0x8A51: 0x5BB3,
0x8A52: 0x5D16,
0x8A53: 0x6168,
0x8A54: 0x6982,
0x8A55: 0x6DAF,
0x8A56: 0x788D,
0x8A57: 0x84CB,
0x8A58: 0x8857,
0x8A59: 0x8A72,
0x8A5A: 0x93A7,
0x8A5B: 0x9AB8,
0x8A5C: 0x6D6C,
0x8A5D: 0x99A8,
0x8A5E: 0x86D9,
0x8A5F: 0x57A3,
0x8A60: 0x67FF,
0x8A61: 0x86CE,
0x8A62: 0x920E,
0x8A63: 0x5283,
0x8A64: 0x5687,
0x8A65: 0x5404,
0x8A66: 0x5ED3,
0x8A67: 0x62E1,
0x8A68: 0x64B9,
0x8A69: 0x683C,
0x8A6A: 0x6838,
0x8A6B: 0x6BBB,
0x8A6C: 0x7372,
0x8A6D: 0x78BA,
0x8A6E: 0x7A6B,
0x8A6F: 0x899A,
0x8A70: 0x89D2,
0x8A71: 0x8D6B,
0x8A72: 0x8F03,
0x8A73: 0x90ED,
0x8A74: 0x95A3,
0x8A75: 0x9694,
0x8A76: 0x9769,
0x8A77: 0x5B66,
0x8A78: 0x5CB3,
0x8A79: 0x697D,
0x8A7A: 0x984D,
0x8A7B: 0x984E,
0x8A7C: 0x639B,
0x8A7D: 0x7B20,
0x8A7E: 0x6A2B,
0x8A80: 0x6A7F,
0x8A81: 0x68B6,
0x8A82: 0x9C0D,
0x8A83: 0x6F5F,
0x8A84: 0x5272,
0x8A85: 0x559D,
0x8A86: 0x6070,
0x8A87: 0x62EC,
0x8A88: 0x6D3B,
0x8A89: 0x6E07,
0x8A8A: 0x6ED1,
0x8A8B: 0x845B,
0x8A8C: 0x8910,
0x8A8D: 0x8F44,
0x8A8E: 0x4E14,
0x8A8F: 0x9C39,
0x8A90: 0x53F6,
0x8A91: 0x691B,
0x8A92: 0x6A3A,
0x8A93: 0x9784,
0x8A94: 0x682A,
0x8A95: 0x515C,
0x8A96: 0x7AC3,
0x8A97: 0x84B2,
0x8A98: 0x91DC,
0x8A99: 0x938C,
0x8A9A: 0x565B,
0x8A9B: 0x9D28,
0x8A9C: 0x6822,
0x8A9D: 0x8305,
0x8A9E: 0x8431,
0x8A9F: 0x7CA5,
0x8AA0: 0x5208,
0x8AA1: 0x82C5,
0x8AA2: 0x74E6,
0x8AA3: 0x4E7E,
0x8AA4: 0x4F83,
0x8AA5: 0x51A0,
0x8AA6: 0x5BD2,
0x8AA7: 0x520A,
0x8AA8: 0x52D8,
0x8AA9: 0x52E7,
0x8AAA: 0x5DFB,
0x8AAB: 0x559A,
0x8AAC: 0x582A,
0x8AAD: 0x59E6,
0x8AAE: 0x5B8C,
0x8AAF: 0x5B98,
0x8AB0: 0x5BDB,
0x8AB1: 0x5E72,
0x8AB2: 0x5E79,
0x8AB3: 0x60A3,
0x8AB4: 0x611F,
0x8AB5: 0x6163,
0x8AB6: 0x61BE,
0x8AB7: 0x63DB,
0x8AB8: 0x6562,
0x8AB9: 0x67D1,
0x8ABA: 0x6853,
0x8ABB: 0x68FA,
0x8ABC: 0x6B3E,
0x8ABD: 0x6B53,
0x8ABE: 0x6C57,
0x8ABF: 0x6F22,
0x8AC0: 0x6F97,
0x8AC1: 0x6F45,
0x8AC2: 0x74B0,
0x8AC3: 0x7518,
0x8AC4: 0x76E3,
0x8AC5: 0x770B,
0x8AC6: 0x7AFF,
0x8AC7: 0x7BA1,
0x8AC8: 0x7C21,
0x8AC9: 0x7DE9,
0x8ACA: 0x7F36,
0x8ACB: 0x7FF0,
0x8ACC: 0x809D,
0x8ACD: 0x8266,
0x8ACE: 0x839E,
0x8ACF: 0x89B3,
0x8AD0: 0x8ACC,
0x8AD1: 0x8CAB,
0x8AD2: 0x9084,
0x8AD3: 0x9451,
0x8AD4: 0x9593,
0x8AD5: 0x9591,
0x8AD6: 0x95A2,
0x8AD7: 0x9665,
0x8AD8: 0x97D3,
0x8AD9: 0x9928,
0x8ADA: 0x8218,
0x8ADB: 0x4E38,
0x8ADC: 0x542B,
0x8ADD: 0x5CB8,
0x8ADE: 0x5DCC,
0x8ADF: 0x73A9,
0x8AE0: 0x764C,
0x8AE1: 0x773C,
0x8AE2: 0x5CA9,
0x8AE3: 0x7FEB,
0x8AE4: 0x8D0B,
0x8AE5: 0x96C1,
0x8AE6: 0x9811,
0x8AE7: 0x9854,
0x8AE8: 0x9858,
0x8AE9: 0x4F01,
0x8AEA: 0x4F0E,
0x8AEB: 0x5371,
0x8AEC: 0x559C,
0x8AED: 0x5668,
0x8AEE: 0x57FA,
0x8AEF: 0x5947,
0x8AF0: 0x5B09,
0x8AF1: 0x5BC4,
0x8AF2: 0x5C90,
0x8AF3: 0x5E0C,
0x8AF4: 0x5E7E,
0x8AF5: 0x5FCC,
0x8AF6: 0x63EE,
0x8AF7: 0x673A,
0x8AF8: 0x65D7,
0x8AF9: 0x65E2,
0x8AFA: 0x671F,
0x8AFB: 0x68CB,
0x8AFC: 0x68C4,
0x8B40: 0x6A5F,
0x8B41: 0x5E30,
0x8B42: 0x6BC5,
0x8B43: 0x6C17,
0x8B44: 0x6C7D,
0x8B45: 0x757F,
0x8B46: 0x7948,
0x8B47: 0x5B63,
0x8B48: 0x7A00,
0x8B49: 0x7D00,
0x8B4A: 0x5FBD,
0x8B4B: 0x898F,
0x8B4C: 0x8A18,
0x8B4D: 0x8CB4,
0x8B4E: 0x8D77,
0x8B4F: 0x8ECC,
0x8B50: 0x8F1D,
0x8B51: 0x98E2,
0x8B52: 0x9A0E,
0x8B53: 0x9B3C,
0x8B54: 0x4E80,
0x8B55: 0x507D,
0x8B56: 0x5100,
0x8B57: 0x5993,
0x8B58: 0x5B9C,
0x8B59: 0x622F,
0x8B5A: 0x6280,
0x8B5B: 0x64EC,
0x8B5C: 0x6B3A,
0x8B5D: 0x72A0,
0x8B5E: 0x7591,
0x8B5F: 0x7947,
0x8B60: 0x7FA9,
0x8B61: 0x87FB,
0x8B62: 0x8ABC,
0x8B63: 0x8B70,
0x8B64: 0x63AC,
0x8B65: 0x83CA,
0x8B66: 0x97A0,
0x8B67: 0x5409,
0x8B68: 0x5403,
0x8B69: 0x55AB,
0x8B6A: 0x6854,
0x8B6B: 0x6A58,
0x8B6C: 0x8A70,
0x8B6D: 0x7827,
0x8B6E: 0x6775,
0x8B6F: 0x9ECD,
0x8B70: 0x5374,
0x8B71: 0x5BA2,
0x8B72: 0x811A,
0x8B73: 0x8650,
0x8B74: 0x9006,
0x8B75: 0x4E18,
0x8B76: 0x4E45,
0x8B77: 0x4EC7,
0x8B78: 0x4F11,
0x8B79: 0x53CA,
0x8B7A: 0x5438,
0x8B7B: 0x5BAE,
0x8B7C: 0x5F13,
0x8B7D: 0x6025,
0x8B7E: 0x6551,
0x8B80: 0x673D,
0x8B81: 0x6C42,
0x8B82: 0x6C72,
0x8B83: 0x6CE3,
0x8B84: 0x7078,
0x8B85: 0x7403,
0x8B86: 0x7A76,
0x8B87: 0x7AAE,
0x8B88: 0x7B08,
0x8B89: 0x7D1A,
0x8B8A: 0x7CFE,
0x8B8B: 0x7D66,
0x8B8C: 0x65E7,
0x8B8D: 0x725B,
0x8B8E: 0x53BB,
0x8B8F: 0x5C45,
0x8B90: 0x5DE8,
0x8B91: 0x62D2,
0x8B92: 0x62E0,
0x8B93: 0x6319,
0x8B94: 0x6E20,
0x8B95: 0x865A,
0x8B96: 0x8A31,
0x8B97: 0x8DDD,
0x8B98: 0x92F8,
0x8B99: 0x6F01,
0x8B9A: 0x79A6,
0x8B9B: 0x9B5A,
0x8B9C: 0x4EA8,
0x8B9D: 0x4EAB,
0x8B9E: 0x4EAC,
0x8B9F: 0x4F9B,
0x8BA0: 0x4FA0,
0x8BA1: 0x50D1,
0x8BA2: 0x5147,
0x8BA3: 0x7AF6,
0x8BA4: 0x5171,
0x8BA5: 0x51F6,
0x8BA6: 0x5354,
0x8BA7: 0x5321,
0x8BA8: 0x537F,
0x8BA9: 0x53EB,
0x8BAA: 0x55AC,
0x8BAB: 0x5883,
0x8BAC: 0x5CE1,
0x8BAD: 0x5F37,
0x8BAE: 0x5F4A,
0x8BAF: 0x602F,
0x8BB0: 0x6050,
0x8BB1: 0x606D,
0x8BB2: 0x631F,
0x8BB3: 0x6559,
0x8BB4: 0x6A4B,
0x8BB5: 0x6CC1,
0x8BB6: 0x72C2,
0x8BB7: 0x72ED,
0x8BB8: 0x77EF,
0x8BB9: 0x80F8,
0x8BBA: 0x8105,
0x8BBB: 0x8208,
0x8BBC: 0x854E,
0x8BBD: 0x90F7,
0x8BBE: 0x93E1,
0x8BBF: 0x97FF,
0x8BC0: 0x9957,
0x8BC1: 0x9A5A,
0x8BC2: 0x4EF0,
0x8BC3: 0x51DD,
0x8BC4: 0x5C2D,
0x8BC5: 0x6681,
0x8BC6: 0x696D,
0x8BC7: 0x5C40,
0x8BC8: 0x66F2,
0x8BC9: 0x6975,
0x8BCA: 0x7389,
0x8BCB: 0x6850,
0x8BCC: 0x7C81,
0x8BCD: 0x50C5,
0x8BCE: 0x52E4,
0x8BCF: 0x5747,
0x8BD0: 0x5DFE,
0x8BD1: 0x9326,
0x8BD2: 0x65A4,
0x8BD3: 0x6B23,
0x8BD4: 0x6B3D,
0x8BD5: 0x7434,
0x8BD6: 0x7981,
0x8BD7: 0x79BD,
0x8BD8: 0x7B4B,
0x8BD9: 0x7DCA,
0x8BDA: 0x82B9,
0x8BDB: 0x83CC,
0x8BDC: 0x887F,
0x8BDD: 0x895F,
0x8BDE: 0x8B39,
0x8BDF: 0x8FD1,
0x8BE0: 0x91D1,
0x8BE1: 0x541F,
0x8BE2: 0x9280,
0x8BE3: 0x4E5D,
0x8BE4: 0x5036,
0x8BE5: 0x53E5,
0x8BE6: 0x533A,
0x8BE7: 0x72D7,
0x8BE8: 0x7396,
0x8BE9: 0x77E9,
0x8BEA: 0x82E6,
0x8BEB: 0x8EAF,
0x8BEC: 0x99C6,
0x8BED: 0x99C8,
0x8BEE: 0x99D2,
0x8BEF: 0x5177,
0x8BF0: 0x611A,
0x8BF1: 0x865E,
0x8BF2: 0x55B0,
0x8BF3: 0x7A7A,
0x8BF4: 0x5076,
0x8BF5: 0x5BD3,
0x8BF6: 0x9047,
0x8BF7: 0x9685,
0x8BF8: 0x4E32,
0x8BF9: 0x6ADB,
0x8BFA: 0x91E7,
0x8BFB: 0x5C51,
0x8BFC: 0x5C48,
0x8C40: 0x6398,
0x8C41: 0x7A9F,
0x8C42: 0x6C93,
0x8C43: 0x9774,
0x8C44: 0x8F61,
0x8C45: 0x7AAA,
0x8C46: 0x718A,
0x8C47: 0x9688,
0x8C48: 0x7C82,
0x8C49: 0x6817,
0x8C4A: 0x7E70,
0x8C4B: 0x6851,
0x8C4C: 0x936C,
0x8C4D: 0x52F2,
0x8C4E: 0x541B,
0x8C4F: 0x85AB,
0x8C50: 0x8A13,
0x8C51: 0x7FA4,
0x8C52: 0x8ECD,
0x8C53: 0x90E1,
0x8C54: 0x5366,
0x8C55: 0x8888,
0x8C56: 0x7941,
0x8C57: 0x4FC2,
0x8C58: 0x50BE,
0x8C59: 0x5211,
0x8C5A: 0x5144,
0x8C5B: 0x5553,
0x8C5C: 0x572D,
0x8C5D: 0x73EA,
0x8C5E: 0x578B,
0x8C5F: 0x5951,
0x8C60: 0x5F62,
0x8C61: 0x5F84,
0x8C62: 0x6075,
0x8C63: 0x6176,
0x8C64: 0x6167,
0x8C65: 0x61A9,
0x8C66: 0x63B2,
0x8C67: 0x643A,
0x8C68: 0x656C,
0x8C69: 0x666F,
0x8C6A: 0x6842,
0x8C6B: 0x6E13,
0x8C6C: 0x7566,
0x8C6D: 0x7A3D,
0x8C6E: 0x7CFB,
0x8C6F: 0x7D4C,
0x8C70: 0x7D99,
0x8C71: 0x7E4B,
0x8C72: 0x7F6B,
0x8C73: 0x830E,
0x8C74: 0x834A,
0x8C75: 0x86CD,
0x8C76: 0x8A08,
0x8C77: 0x8A63,
0x8C78: 0x8B66,
0x8C79: 0x8EFD,
0x8C7A: 0x981A,
0x8C7B: 0x9D8F,
0x8C7C: 0x82B8,
0x8C7D: 0x8FCE,
0x8C7E: 0x9BE8,
0x8C80: 0x5287,
0x8C81: 0x621F,
0x8C82: 0x6483,
0x8C83: 0x6FC0,
0x8C84: 0x9699,
0x8C85: 0x6841,
0x8C86: 0x5091,
0x8C87: 0x6B20,
0x8C88: 0x6C7A,
0x8C89: 0x6F54,
0x8C8A: 0x7A74,
0x8C8B: 0x7D50,
0x8C8C: 0x8840,
0x8C8D: 0x8A23,
0x8C8E: 0x6708,
0x8C8F: 0x4EF6,
0x8C90: 0x5039,
0x8C91: 0x5026,
0x8C92: 0x5065,
0x8C93: 0x517C,
0x8C94: 0x5238,
0x8C95: 0x5263,
0x8C96: 0x55A7,
0x8C97: 0x570F,
0x8C98: 0x5805,
0x8C99: 0x5ACC,
0x8C9A: 0x5EFA,
0x8C9B: 0x61B2,
0x8C9C: 0x61F8,
0x8C9D: 0x62F3,
0x8C9E: 0x6372,
0x8C9F: 0x691C,
0x8CA0: 0x6A29,
0x8CA1: 0x727D,
0x8CA2: 0x72AC,
0x8CA3: 0x732E,
0x8CA4: 0x7814,
0x8CA5: 0x786F,
0x8CA6: 0x7D79,
0x8CA7: 0x770C,
0x8CA8: 0x80A9,
0x8CA9: 0x898B,
0x8CAA: 0x8B19,
0x8CAB: 0x8CE2,
0x8CAC: 0x8ED2,
0x8CAD: 0x9063,
0x8CAE: 0x9375,
0x8CAF: 0x967A,
0x8CB0: 0x9855,
0x8CB1: 0x9A13,
0x8CB2: 0x9E78,
0x8CB3: 0x5143,
0x8CB4: 0x539F,
0x8CB5: 0x53B3,
0x8CB6: 0x5E7B,
0x8CB7: 0x5F26,
0x8CB8: 0x6E1B,
0x8CB9: 0x6E90,
0x8CBA: 0x7384,
0x8CBB: 0x73FE,
0x8CBC: 0x7D43,
0x8CBD: 0x8237,
0x8CBE: 0x8A00,
0x8CBF: 0x8AFA,
0x8CC0: 0x9650,
0x8CC1: 0x4E4E,
0x8CC2: 0x500B,
0x8CC3: 0x53E4,
0x8CC4: 0x547C,
0x8CC5: 0x56FA,
0x8CC6: 0x59D1,
0x8CC7: 0x5B64,
0x8CC8: 0x5DF1,
0x8CC9: 0x5EAB,
0x8CCA: 0x5F27,
0x8CCB: 0x6238,
0x8CCC: 0x6545,
0x8CCD: 0x67AF,
0x8CCE: 0x6E56,
0x8CCF: 0x72D0,
0x8CD0: 0x7CCA,
0x8CD1: 0x88B4,
0x8CD2: 0x80A1,
0x8CD3: 0x80E1,
0x8CD4: 0x83F0,
0x8CD5: 0x864E,
0x8CD6: 0x8A87,
0x8CD7: 0x8DE8,
0x8CD8: 0x9237,
0x8CD9: 0x96C7,
0x8CDA: 0x9867,
0x8CDB: 0x9F13,
0x8CDC: 0x4E94,
0x8CDD: 0x4E92,
0x8CDE: 0x4F0D,
0x8CDF: 0x5348,
0x8CE0: 0x5449,
0x8CE1: 0x543E,
0x8CE2: 0x5A2F,
0x8CE3: 0x5F8C,
0x8CE4: 0x5FA1,
0x8CE5: 0x609F,
0x8CE6: 0x68A7,
0x8CE7: 0x6A8E,
0x8CE8: 0x745A,
0x8CE9: 0x7881,
0x8CEA: 0x8A9E,
0x8CEB: 0x8AA4,
0x8CEC: 0x8B77,
0x8CED: 0x9190,
0x8CEE: 0x4E5E,
0x8CEF: 0x9BC9,
0x8CF0: 0x4EA4,
0x8CF1: 0x4F7C,
0x8CF2: 0x4FAF,
0x8CF3: 0x5019,
0x8CF4: 0x5016,
0x8CF5: 0x5149,
0x8CF6: 0x516C,
0x8CF7: 0x529F,
0x8CF8: 0x52B9,
0x8CF9: 0x52FE,
0x8CFA: 0x539A,
0x8CFB: 0x53E3,
0x8CFC: 0x5411,
0x8D40: 0x540E,
0x8D41: 0x5589,
0x8D42: 0x5751,
0x8D43: 0x57A2,
0x8D44: 0x597D,
0x8D45: 0x5B54,
0x8D46: 0x5B5D,
0x8D47: 0x5B8F,
0x8D48: 0x5DE5,
0x8D49: 0x5DE7,
0x8D4A: 0x5DF7,
0x8D4B: 0x5E78,
0x8D4C: 0x5E83,
0x8D4D: 0x5E9A,
0x8D4E: 0x5EB7,
0x8D4F: 0x5F18,
0x8D50: 0x6052,
0x8D51: 0x614C,
0x8D52: 0x6297,
0x8D53: 0x62D8,
0x8D54: 0x63A7,
0x8D55: 0x653B,
0x8D56: 0x6602,
0x8D57: 0x6643,
0x8D58: 0x66F4,
0x8D59: 0x676D,
0x8D5A: 0x6821,
0x8D5B: 0x6897,
0x8D5C: 0x69CB,
0x8D5D: 0x6C5F,
0x8D5E: 0x6D2A,
0x8D5F: 0x6D69,
0x8D60: 0x6E2F,
0x8D61: 0x6E9D,
0x8D62: 0x7532,
0x8D63: 0x7687,
0x8D64: 0x786C,
0x8D65: 0x7A3F,
0x8D66: 0x7CE0,
0x8D67: 0x7D05,
0x8D68: 0x7D18,
0x8D69: 0x7D5E,
0x8D6A: 0x7DB1,
0x8D6B: 0x8015,
0x8D6C: 0x8003,
0x8D6D: 0x80AF,
0x8D6E: 0x80B1,
0x8D6F: 0x8154,
0x8D70: 0x818F,
0x8D71: 0x822A,
0x8D72: 0x8352,
0x8D73: 0x884C,
0x8D74: 0x8861,
0x8D75: 0x8B1B,
0x8D76: 0x8CA2,
0x8D77: 0x8CFC,
0x8D78: 0x90CA,
0x8D79: 0x9175,
0x8D7A: 0x9271,
0x8D7B: 0x783F,
0x8D7C: 0x92FC,
0x8D7D: 0x95A4,
0x8D7E: 0x964D,
0x8D80: 0x9805,
0x8D81: 0x9999,
0x8D82: 0x9AD8,
0x8D83: 0x9D3B,
0x8D84: 0x525B,
0x8D85: 0x52AB,
0x8D86: 0x53F7,
0x8D87: 0x5408,
0x8D88: 0x58D5,
0x8D89: 0x62F7,
0x8D8A: 0x6FE0,
0x8D8B: 0x8C6A,
0x8D8C: 0x8F5F,
0x8D8D: 0x9EB9,
0x8D8E: 0x514B,
0x8D8F: 0x523B,
0x8D90: 0x544A,
0x8D91: 0x56FD,
0x8D92: 0x7A40,
0x8D93: 0x9177,
0x8D94: 0x9D60,
0x8D95: 0x9ED2,
0x8D96: 0x7344,
0x8D97: 0x6F09,
0x8D98: 0x8170,
0x8D99: 0x7511,
0x8D9A: 0x5FFD,
0x8D9B: 0x60DA,
0x8D9C: 0x9AA8,
0x8D9D: 0x72DB,
0x8D9E: 0x8FBC,
0x8D9F: 0x6B64,
0x8DA0: 0x9803,
0x8DA1: 0x4ECA,
0x8DA2: 0x56F0,
0x8DA3: 0x5764,
0x8DA4: 0x58BE,
0x8DA5: 0x5A5A,
0x8DA6: 0x6068,
0x8DA7: 0x61C7,
0x8DA8: 0x660F,
0x8DA9: 0x6606,
0x8DAA: 0x6839,
0x8DAB: 0x68B1,
0x8DAC: 0x6DF7,
0x8DAD: 0x75D5,
0x8DAE: 0x7D3A,
0x8DAF: 0x826E,
0x8DB0: 0x9B42,
0x8DB1: 0x4E9B,
0x8DB2: 0x4F50,
0x8DB3: 0x53C9,
0x8DB4: 0x5506,
0x8DB5: 0x5D6F,
0x8DB6: 0x5DE6,
0x8DB7: 0x5DEE,
0x8DB8: 0x67FB,
0x8DB9: 0x6C99,
0x8DBA: 0x7473,
0x8DBB: 0x7802,
0x8DBC: 0x8A50,
0x8DBD: 0x9396,
0x8DBE: 0x88DF,
0x8DBF: 0x5750,
0x8DC0: 0x5EA7,
0x8DC1: 0x632B,
0x8DC2: 0x50B5,
0x8DC3: 0x50AC,
0x8DC4: 0x518D,
0x8DC5: 0x6700,
0x8DC6: 0x54C9,
0x8DC7: 0x585E,
0x8DC8: 0x59BB,
0x8DC9: 0x5BB0,
0x8DCA: 0x5F69,
0x8DCB: 0x624D,
0x8DCC: 0x63A1,
0x8DCD: 0x683D,
0x8DCE: 0x6B73,
0x8DCF: 0x6E08,
0x8DD0: 0x707D,
0x8DD1: 0x91C7,
0x8DD2: 0x7280,
0x8DD3: 0x7815,
0x8DD4: 0x7826,
0x8DD5: 0x796D,
0x8DD6: 0x658E,
0x8DD7: 0x7D30,
0x8DD8: 0x83DC,
0x8DD9: 0x88C1,
0x8DDA: 0x8F09,
0x8DDB: 0x969B,
0x8DDC: 0x5264,
0x8DDD: 0x5728,
0x8DDE: 0x6750,
0x8DDF: 0x7F6A,
0x8DE0: 0x8CA1,
0x8DE1: 0x51B4,
0x8DE2: 0x5742,
0x8DE3: 0x962A,
0x8DE4: 0x583A,
0x8DE5: 0x698A,
0x8DE6: 0x80B4,
0x8DE7: 0x54B2,
0x8DE8: 0x5D0E,
0x8DE9: 0x57FC,
0x8DEA: 0x7895,
0x8DEB: 0x9DFA,
0x8DEC: 0x4F5C,
0x8DED: 0x524A,
0x8DEE: 0x548B,
0x8DEF: 0x643E,
0x8DF0: 0x6628,
0x8DF1: 0x6714,
0x8DF2: 0x67F5,
0x8DF3: 0x7A84,
0x8DF4: 0x7B56,
0x8DF5: 0x7D22,
0x8DF6: 0x932F,
0x8DF7: 0x685C,
0x8DF8: 0x9BAD,
0x8DF9: 0x7B39,
0x8DFA: 0x5319,
0x8DFB: 0x518A,
0x8DFC: 0x5237,
0x8E40: 0x5BDF,
0x8E41: 0x62F6,
0x8E42: 0x64AE,
0x8E43: 0x64E6,
0x8E44: 0x672D,
0x8E45: 0x6BBA,
0x8E46: 0x85A9,
0x8E47: 0x96D1,
0x8E48: 0x7690,
0x8E49: 0x9BD6,
0x8E4A: 0x634C,
0x8E4B: 0x9306,
0x8E4C: 0x9BAB,
0x8E4D: 0x76BF,
0x8E4E: 0x6652,
0x8E4F: 0x4E09,
0x8E50: 0x5098,
0x8E51: 0x53C2,
0x8E52: 0x5C71,
0x8E53: 0x60E8,
0x8E54: 0x6492,
0x8E55: 0x6563,
0x8E56: 0x685F,
0x8E57: 0x71E6,
0x8E58: 0x73CA,
0x8E59: 0x7523,
0x8E5A: 0x7B97,
0x8E5B: 0x7E82,
0x8E5C: 0x8695,
0x8E5D: 0x8B83,
0x8E5E: 0x8CDB,
0x8E5F: 0x9178,
0x8E60: 0x9910,
0x8E61: 0x65AC,
0x8E62: 0x66AB,
0x8E63: 0x6B8B,
0x8E64: 0x4ED5,
0x8E65: 0x4ED4,
0x8E66: 0x4F3A,
0x8E67: 0x4F7F,
0x8E68: 0x523A,
0x8E69: 0x53F8,
0x8E6A: 0x53F2,
0x8E6B: 0x55E3,
0x8E6C: 0x56DB,
0x8E6D: 0x58EB,
0x8E6E: 0x59CB,
0x8E6F: 0x59C9,
0x8E70: 0x59FF,
0x8E71: 0x5B50,
0x8E72: 0x5C4D,
0x8E73: 0x5E02,
0x8E74: 0x5E2B,
0x8E75: 0x5FD7,
0x8E76: 0x601D,
0x8E77: 0x6307,
0x8E78: 0x652F,
0x8E79: 0x5B5C,
0x8E7A: 0x65AF,
0x8E7B: 0x65BD,
0x8E7C: 0x65E8,
0x8E7D: 0x679D,
0x8E7E: 0x6B62,
0x8E80: 0x6B7B,
0x8E81: 0x6C0F,
0x8E82: 0x7345,
0x8E83: 0x7949,
0x8E84: 0x79C1,
0x8E85: 0x7CF8,
0x8E86: 0x7D19,
0x8E87: 0x7D2B,
0x8E88: 0x80A2,
0x8E89: 0x8102,
0x8E8A: 0x81F3,
0x8E8B: 0x8996,
0x8E8C: 0x8A5E,
0x8E8D: 0x8A69,
0x8E8E: 0x8A66,
0x8E8F: 0x8A8C,
0x8E90: 0x8AEE,
0x8E91: 0x8CC7,
0x8E92: 0x8CDC,
0x8E93: 0x96CC,
0x8E94: 0x98FC,
0x8E95: 0x6B6F,
0x8E96: 0x4E8B,
0x8E97: 0x4F3C,
0x8E98: 0x4F8D,
0x8E99: 0x5150,
0x8E9A: 0x5B57,
0x8E9B: 0x5BFA,
0x8E9C: 0x6148,
0x8E9D: 0x6301,
0x8E9E: 0x6642,
0x8E9F: 0x6B21,
0x8EA0: 0x6ECB,
0x8EA1: 0x6CBB,
0x8EA2: 0x723E,
0x8EA3: 0x74BD,
0x8EA4: 0x75D4,
0x8EA5: 0x78C1,
0x8EA6: 0x793A,
0x8EA7: 0x800C,
0x8EA8: 0x8033,
0x8EA9: 0x81EA,
0x8EAA: 0x8494,
0x8EAB: 0x8F9E,
0x8EAC: 0x6C50,
0x8EAD: 0x9E7F,
0x8EAE: 0x5F0F,
0x8EAF: 0x8B58,
0x8EB0: 0x9D2B,
0x8EB1: 0x7AFA,
0x8EB2: 0x8EF8,
0x8EB3: 0x5B8D,
0x8EB4: 0x96EB,
0x8EB5: 0x4E03,
0x8EB6: 0x53F1,
0x8EB7: 0x57F7,
0x8EB8: 0x5931,
0x8EB9: 0x5AC9,
0x8EBA: 0x5BA4,
0x8EBB: 0x6089,
0x8EBC: 0x6E7F,
0x8EBD: 0x6F06,
0x8EBE: 0x75BE,
0x8EBF: 0x8CEA,
0x8EC0: 0x5B9F,
0x8EC1: 0x8500,
0x8EC2: 0x7BE0,
0x8EC3: 0x5072,
0x8EC4: 0x67F4,
0x8EC5: 0x829D,
0x8EC6: 0x5C61,
0x8EC7: 0x854A,
0x8EC8: 0x7E1E,
0x8EC9: 0x820E,
0x8ECA: 0x5199,
0x8ECB: 0x5C04,
0x8ECC: 0x6368,
0x8ECD: 0x8D66,
0x8ECE: 0x659C,
0x8ECF: 0x716E,
0x8ED0: 0x793E,
0x8ED1: 0x7D17,
0x8ED2: 0x8005,
0x8ED3: 0x8B1D,
0x8ED4: 0x8ECA,
0x8ED5: 0x906E,
0x8ED6: 0x86C7,
0x8ED7: 0x90AA,
0x8ED8: 0x501F,
0x8ED9: 0x52FA,
0x8EDA: 0x5C3A,
0x8EDB: 0x6753,
0x8EDC: 0x707C,
0x8EDD: 0x7235,
0x8EDE: 0x914C,
0x8EDF: 0x91C8,
0x8EE0: 0x932B,
0x8EE1: 0x82E5,
0x8EE2: 0x5BC2,
0x8EE3: 0x5F31,
0x8EE4: 0x60F9,
0x8EE5: 0x4E3B,
0x8EE6: 0x53D6,
0x8EE7: 0x5B88,
0x8EE8: 0x624B,
0x8EE9: 0x6731,
0x8EEA: 0x6B8A,
0x8EEB: 0x72E9,
0x8EEC: 0x73E0,
0x8EED: 0x7A2E,
0x8EEE: 0x816B,
0x8EEF: 0x8DA3,
0x8EF0: 0x9152,
0x8EF1: 0x9996,
0x8EF2: 0x5112,
0x8EF3: 0x53D7,
0x8EF4: 0x546A,
0x8EF5: 0x5BFF,
0x8EF6: 0x6388,
0x8EF7: 0x6A39,
0x8EF8: 0x7DAC,
0x8EF9: 0x9700,
0x8EFA: 0x56DA,
0x8EFB: 0x53CE,
0x8EFC: 0x5468,
0x8F40: 0x5B97,
0x8F41: 0x5C31,
0x8F42: 0x5DDE,
0x8F43: 0x4FEE,
0x8F44: 0x6101,
0x8F45: 0x62FE,
0x8F46: 0x6D32,
0x8F47: 0x79C0,
0x8F48: 0x79CB,
0x8F49: 0x7D42,
0x8F4A: 0x7E4D,
0x8F4B: 0x7FD2,
0x8F4C: 0x81ED,
0x8F4D: 0x821F,
0x8F4E: 0x8490,
0x8F4F: 0x8846,
0x8F50: 0x8972,
0x8F51: 0x8B90,
0x8F52: 0x8E74,
0x8F53: 0x8F2F,
0x8F54: 0x9031,
0x8F55: 0x914B,
0x8F56: 0x916C,
0x8F57: 0x96C6,
0x8F58: 0x919C,
0x8F59: 0x4EC0,
0x8F5A: 0x4F4F,
0x8F5B: 0x5145,
0x8F5C: 0x5341,
0x8F5D: 0x5F93,
0x8F5E: 0x620E,
0x8F5F: 0x67D4,
0x8F60: 0x6C41,
0x8F61: 0x6E0B,
0x8F62: 0x7363,
0x8F63: 0x7E26,
0x8F64: 0x91CD,
0x8F65: 0x9283,
0x8F66: 0x53D4,
0x8F67: 0x5919,
0x8F68: 0x5BBF,
0x8F69: 0x6DD1,
0x8F6A: 0x795D,
0x8F6B: 0x7E2E,
0x8F6C: 0x7C9B,
0x8F6D: 0x587E,
0x8F6E: 0x719F,
0x8F6F: 0x51FA,
0x8F70: 0x8853,
0x8F71: 0x8FF0,
0x8F72: 0x4FCA,
0x8F73: 0x5CFB,
0x8F74: 0x6625,
0x8F75: 0x77AC,
0x8F76: 0x7AE3,
0x8F77: 0x821C,
0x8F78: 0x99FF,
0x8F79: 0x51C6,
0x8F7A: 0x5FAA,
0x8F7B: 0x65EC,
0x8F7C: 0x696F,
0x8F7D: 0x6B89,
0x8F7E: 0x6DF3,
0x8F80: 0x6E96,
0x8F81: 0x6F64,
0x8F82: 0x76FE,
0x8F83: 0x7D14,
0x8F84: 0x5DE1,
0x8F85: 0x9075,
0x8F86: 0x9187,
0x8F87: 0x9806,
0x8F88: 0x51E6,
0x8F89: 0x521D,
0x8F8A: 0x6240,
0x8F8B: 0x6691,
0x8F8C: 0x66D9,
0x8F8D: 0x6E1A,
0x8F8E: 0x5EB6,
0x8F8F: 0x7DD2,
0x8F90: 0x7F72,
0x8F91: 0x66F8,
0x8F92: 0x85AF,
0x8F93: 0x85F7,
0x8F94: 0x8AF8,
0x8F95: 0x52A9,
0x8F96: 0x53D9,
0x8F97: 0x5973,
0x8F98: 0x5E8F,
0x8F99: 0x5F90,
0x8F9A: 0x6055,
0x8F9B: 0x92E4,
0x8F9C: 0x9664,
0x8F9D: 0x50B7,
0x8F9E: 0x511F,
0x8F9F: 0x52DD,
0x8FA0: 0x5320,
0x8FA1: 0x5347,
0x8FA2: 0x53EC,
0x8FA3: 0x54E8,
0x8FA4: 0x5546,
0x8FA5: 0x5531,
0x8FA6: 0x5617,
0x8FA7: 0x5968,
0x8FA8: 0x59BE,
0x8FA9: 0x5A3C,
0x8FAA: 0x5BB5,
0x8FAB: 0x5C06,
0x8FAC: 0x5C0F,
0x8FAD: 0x5C11,
0x8FAE: 0x5C1A,
0x8FAF: 0x5E84,
0x8FB0: 0x5E8A,
0x8FB1: 0x5EE0,
0x8FB2: 0x5F70,
0x8FB3: 0x627F,
0x8FB4: 0x6284,
0x8FB5: 0x62DB,
0x8FB6: 0x638C,
0x8FB7: 0x6377,
0x8FB8: 0x6607,
0x8FB9: 0x660C,
0x8FBA: 0x662D,
0x8FBB: 0x6676,
0x8FBC: 0x677E,
0x8FBD: 0x68A2,
0x8FBE: 0x6A1F,
0x8FBF: 0x6A35,
0x8FC0: 0x6CBC,
0x8FC1: 0x6D88,
0x8FC2: 0x6E09,
0x8FC3: 0x6E58,
0x8FC4: 0x713C,
0x8FC5: 0x7126,
0x8FC6: 0x7167,
0x8FC7: 0x75C7,
0x8FC8: 0x7701,
0x8FC9: 0x785D,
0x8FCA: 0x7901,
0x8FCB: 0x7965,
0x8FCC: 0x79F0,
0x8FCD: 0x7AE0,
0x8FCE: 0x7B11,
0x8FCF: 0x7CA7,
0x8FD0: 0x7D39,
0x8FD1: 0x8096,
0x8FD2: 0x83D6,
0x8FD3: 0x848B,
0x8FD4: 0x8549,
0x8FD5: 0x885D,
0x8FD6: 0x88F3,
0x8FD7: 0x8A1F,
0x8FD8: 0x8A3C,
0x8FD9: 0x8A54,
0x8FDA: 0x8A73,
0x8FDB: 0x8C61,
0x8FDC: 0x8CDE,
0x8FDD: 0x91A4,
0x8FDE: 0x9266,
0x8FDF: 0x937E,
0x8FE0: 0x9418,
0x8FE1: 0x969C,
0x8FE2: 0x9798,
0x8FE3: 0x4E0A,
0x8FE4: 0x4E08,
0x8FE5: 0x4E1E,
0x8FE6: 0x4E57,
0x8FE7: 0x5197,
0x8FE8: 0x5270,
0x8FE9: 0x57CE,
0x8FEA: 0x5834,
0x8FEB: 0x58CC,
0x8FEC: 0x5B22,
0x8FED: 0x5E38,
0x8FEE: 0x60C5,
0x8FEF: 0x64FE,
0x8FF0: 0x6761,
0x8FF1: 0x6756,
0x8FF2: 0x6D44,
0x8FF3: 0x72B6,
0x8FF4: 0x7573,
0x8FF5: 0x7A63,
0x8FF6: 0x84B8,
0x8FF7: 0x8B72,
0x8FF8: 0x91B8,
0x8FF9: 0x9320,
0x8FFA: 0x5631,
0x8FFB: 0x57F4,
0x8FFC: 0x98FE,
0x9040: 0x62ED,
0x9041: 0x690D,
0x9042: 0x6B96,
0x9043: 0x71ED,
0x9044: 0x7E54,
0x9045: 0x8077,
0x9046: 0x8272,
0x9047: 0x89E6,
0x9048: 0x98DF,
0x9049: 0x8755,
0x904A: 0x8FB1,
0x904B: 0x5C3B,
0x904C: 0x4F38,
0x904D: 0x4FE1,
0x904E: 0x4FB5,
0x904F: 0x5507,
0x9050: 0x5A20,
0x9051: 0x5BDD,
0x9052: 0x5BE9,
0x9053: 0x5FC3,
0x9054: 0x614E,
0x9055: 0x632F,
0x9056: 0x65B0,
0x9057: 0x664B,
0x9058: 0x68EE,
0x9059: 0x699B,
0x905A: 0x6D78,
0x905B: 0x6DF1,
0x905C: 0x7533,
0x905D: 0x75B9,
0x905E: 0x771F,
0x905F: 0x795E,
0x9060: 0x79E6,
0x9061: 0x7D33,
0x9062: 0x81E3,
0x9063: 0x82AF,
0x9064: 0x85AA,
0x9065: 0x89AA,
0x9066: 0x8A3A,
0x9067: 0x8EAB,
0x9068: 0x8F9B,
0x9069: 0x9032,
0x906A: 0x91DD,
0x906B: 0x9707,
0x906C: 0x4EBA,
0x906D: 0x4EC1,
0x906E: 0x5203,
0x906F: 0x5875,
0x9070: 0x58EC,
0x9071: 0x5C0B,
0x9072: 0x751A,
0x9073: 0x5C3D,
0x9074: 0x814E,
0x9075: 0x8A0A,
0x9076: 0x8FC5,
0x9077: 0x9663,
0x9078: 0x976D,
0x9079: 0x7B25,
0x907A: 0x8ACF,
0x907B: 0x9808,
0x907C: 0x9162,
0x907D: 0x56F3,
0x907E: 0x53A8,
0x9080: 0x9017,
0x9081: 0x5439,
0x9082: 0x5782,
0x9083: 0x5E25,
0x9084: 0x63A8,
0x9085: 0x6C34,
0x9086: 0x708A,
0x9087: 0x7761,
0x9088: 0x7C8B,
0x9089: 0x7FE0,
0x908A: 0x8870,
0x908B: 0x9042,
0x908C: 0x9154,
0x908D: 0x9310,
0x908E: 0x9318,
0x908F: 0x968F,
0x9090: 0x745E,
0x9091: 0x9AC4,
0x9092: 0x5D07,
0x9093: 0x5D69,
0x9094: 0x6570,
0x9095: 0x67A2,
0x9096: 0x8DA8,
0x9097: 0x96DB,
0x9098: 0x636E,
0x9099: 0x6749,
0x909A: 0x6919,
0x909B: 0x83C5,
0x909C: 0x9817,
0x909D: 0x96C0,
0x909E: 0x88FE,
0x909F: 0x6F84,
0x90A0: 0x647A,
0x90A1: 0x5BF8,
0x90A2: 0x4E16,
0x90A3: 0x702C,
0x90A4: 0x755D,
0x90A5: 0x662F,
0x90A6: 0x51C4,
0x90A7: 0x5236,
0x90A8: 0x52E2,
0x90A9: 0x59D3,
0x90AA: 0x5F81,
0x90AB: 0x6027,
0x90AC: 0x6210,
0x90AD: 0x653F,
0x90AE: 0x6574,
0x90AF: 0x661F,
0x90B0: 0x6674,
0x90B1: 0x68F2,
0x90B2: 0x6816,
0x90B3: 0x6B63,
0x90B4: 0x6E05,
0x90B5: 0x7272,
0x90B6: 0x751F,
0x90B7: 0x76DB,
0x90B8: 0x7CBE,
0x90B9: 0x8056,
0x90BA: 0x58F0,
0x90BB: 0x88FD,
0x90BC: 0x897F,
0x90BD: 0x8AA0,
0x90BE: 0x8A93,
0x90BF: 0x8ACB,
0x90C0: 0x901D,
0x90C1: 0x9192,
0x90C2: 0x9752,
0x90C3: 0x9759,
0x90C4: 0x6589,
0x90C5: 0x7A0E,
0x90C6: 0x8106,
0x90C7: 0x96BB,
0x90C8: 0x5E2D,
0x90C9: 0x60DC,
0x90CA: 0x621A,
0x90CB: 0x65A5,
0x90CC: 0x6614,
0x90CD: 0x6790,
0x90CE: 0x77F3,
0x90CF: 0x7A4D,
0x90D0: 0x7C4D,
0x90D1: 0x7E3E,
0x90D2: 0x810A,
0x90D3: 0x8CAC,
0x90D4: 0x8D64,
0x90D5: 0x8DE1,
0x90D6: 0x8E5F,
0x90D7: 0x78A9,
0x90D8: 0x5207,
0x90D9: 0x62D9,
0x90DA: 0x63A5,
0x90DB: 0x6442,
0x90DC: 0x6298,
0x90DD: 0x8A2D,
0x90DE: 0x7A83,
0x90DF: 0x7BC0,
0x90E0: 0x8AAC,
0x90E1: 0x96EA,
0x90E2: 0x7D76,
0x90E3: 0x820C,
0x90E4: 0x8749,
0x90E5: 0x4ED9,
0x90E6: 0x5148,
0x90E7: 0x5343,
0x90E8: 0x5360,
0x90E9: 0x5BA3,
0x90EA: 0x5C02,
0x90EB: 0x5C16,
0x90EC: 0x5DDD,
0x90ED: 0x6226,
0x90EE: 0x6247,
0x90EF: 0x64B0,
0x90F0: 0x6813,
0x90F1: 0x6834,
0x90F2: 0x6CC9,
0x90F3: 0x6D45,
0x90F4: 0x6D17,
0x90F5: 0x67D3,
0x90F6: 0x6F5C,
0x90F7: 0x714E,
0x90F8: 0x717D,
0x90F9: 0x65CB,
0x90FA: 0x7A7F,
0x90FB: 0x7BAD,
0x90FC: 0x7DDA,
0x9140: 0x7E4A,
0x9141: 0x7FA8,
0x9142: 0x817A,
0x9143: 0x821B,
0x9144: 0x8239,
0x9145: 0x85A6,
0x9146: 0x8A6E,
0x9147: 0x8CCE,
0x9148: 0x8DF5,
0x9149: 0x9078,
0x914A: 0x9077,
0x914B: 0x92AD,
0x914C: 0x9291,
0x914D: 0x9583,
0x914E: 0x9BAE,
0x914F: 0x524D,
0x9150: 0x5584,
0x9151: 0x6F38,
0x9152: 0x7136,
0x9153: 0x5168,
0x9154: 0x7985,
0x9155: 0x7E55,
0x9156: 0x81B3,
0x9157: 0x7CCE,
0x9158: 0x564C,
0x9159: 0x5851,
0x915A: 0x5CA8,
0x915B: 0x63AA,
0x915C: 0x66FE,
0x915D: 0x66FD,
0x915E: 0x695A,
0x915F: 0x72D9,
0x9160: 0x758F,
0x9161: 0x758E,
0x9162: 0x790E,
0x9163: 0x7956,
0x9164: 0x79DF,
0x9165: 0x7C97,
0x9166: 0x7D20,
0x9167: 0x7D44,
0x9168: 0x8607,
0x9169: 0x8A34,
0x916A: 0x963B,
0x916B: 0x9061,
0x916C: 0x9F20,
0x916D: 0x50E7,
0x916E: 0x5275,
0x916F: 0x53CC,
0x9170: 0x53E2,
0x9171: 0x5009,
0x9172: 0x55AA,
0x9173: 0x58EE,
0x9174: 0x594F,
0x9175: 0x723D,
0x9176: 0x5B8B,
0x9177: 0x5C64,
0x9178: 0x531D,
0x9179: 0x60E3,
0x917A: 0x60F3,
0x917B: 0x635C,
0x917C: 0x6383,
0x917D: 0x633F,
0x917E: 0x63BB,
0x9180: 0x64CD,
0x9181: 0x65E9,
0x9182: 0x66F9,
0x9183: 0x5DE3,
0x9184: 0x69CD,
0x9185: 0x69FD,
0x9186: 0x6F15,
0x9187: 0x71E5,
0x9188: 0x4E89,
0x9189: 0x75E9,
0x918A: 0x76F8,
0x918B: 0x7A93,
0x918C: 0x7CDF,
0x918D: 0x7DCF,
0x918E: 0x7D9C,
0x918F: 0x8061,
0x9190: 0x8349,
0x9191: 0x8358,
0x9192: 0x846C,
0x9193: 0x84BC,
0x9194: 0x85FB,
0x9195: 0x88C5,
0x9196: 0x8D70,
0x9197: 0x9001,
0x9198: 0x906D,
0x9199: 0x9397,
0x919A: 0x971C,
0x919B: 0x9A12,
0x919C: 0x50CF,
0x919D: 0x5897,
0x919E: 0x618E,
0x919F: 0x81D3,
0x91A0: 0x8535,
0x91A1: 0x8D08,
0x91A2: 0x9020,
0x91A3: 0x4FC3,
0x91A4: 0x5074,
0x91A5: 0x5247,
0x91A6: 0x5373,
0x91A7: 0x606F,
0x91A8: 0x6349,
0x91A9: 0x675F,
0x91AA: 0x6E2C,
0x91AB: 0x8DB3,
0x91AC: 0x901F,
0x91AD: 0x4FD7,
0x91AE: 0x5C5E,
0x91AF: 0x8CCA,
0x91B0: 0x65CF,
0x91B1: 0x7D9A,
0x91B2: 0x5352,
0x91B3: 0x8896,
0x91B4: 0x5176,
0x91B5: 0x63C3,
0x91B6: 0x5B58,
0x91B7: 0x5B6B,
0x91B8: 0x5C0A,
0x91B9: 0x640D,
0x91BA: 0x6751,
0x91BB: 0x905C,
0x91BC: 0x4ED6,
0x91BD: 0x591A,
0x91BE: 0x592A,
0x91BF: 0x6C70,
0x91C0: 0x8A51,
0x91C1: 0x553E,
0x91C2: 0x5815,
0x91C3: 0x59A5,
0x91C4: 0x60F0,
0x91C5: 0x6253,
0x91C6: 0x67C1,
0x91C7: 0x8235,
0x91C8: 0x6955,
0x91C9: 0x9640,
0x91CA: 0x99C4,
0x91CB: 0x9A28,
0x91CC: 0x4F53,
0x91CD: 0x5806,
0x91CE: 0x5BFE,
0x91CF: 0x8010,
0x91D0: 0x5CB1,
0x91D1: 0x5E2F,
0x91D2: 0x5F85,
0x91D3: 0x6020,
0x91D4: 0x614B,
0x91D5: 0x6234,
0x91D6: 0x66FF,
0x91D7: 0x6CF0,
0x91D8: 0x6EDE,
0x91D9: 0x80CE,
0x91DA: 0x817F,
0x91DB: 0x82D4,
0x91DC: 0x888B,
0x91DD: 0x8CB8,
0x91DE: 0x9000,
0x91DF: 0x902E,
0x91E0: 0x968A,
0x91E1: 0x9EDB,
0x91E2: 0x9BDB,
0x91E3: 0x4EE3,
0x91E4: 0x53F0,
0x91E5: 0x5927,
0x91E6: 0x7B2C,
0x91E7: 0x918D,
0x91E8: 0x984C,
0x91E9: 0x9DF9,
0x91EA: 0x6EDD,
0x91EB: 0x7027,
0x91EC: 0x5353,
0x91ED: 0x5544,
0x91EE: 0x5B85,
0x91EF: 0x6258,
0x91F0: 0x629E,
0x91F1: 0x62D3,
0x91F2: 0x6CA2,
0x91F3: 0x6FEF,
0x91F4: 0x7422,
0x91F5: 0x8A17,
0x91F6: 0x9438,
0x91F7: 0x6FC1,
0x91F8: 0x8AFE,
0x91F9: 0x8338,
0x91FA: 0x51E7,
0x91FB: 0x86F8,
0x91FC: 0x53EA,
0x9240: 0x53E9,
0x9241: 0x4F46,
0x9242: 0x9054,
0x9243: 0x8FB0,
0x9244: 0x596A,
0x9245: 0x8131,
0x9246: 0x5DFD,
0x9247: 0x7AEA,
0x9248: 0x8FBF,
0x9249: 0x68DA,
0x924A: 0x8C37,
0x924B: 0x72F8,
0x924C: 0x9C48,
0x924D: 0x6A3D,
0x924E: 0x8AB0,
0x924F: 0x4E39,
0x9250: 0x5358,
0x9251: 0x5606,
0x9252: 0x5766,
0x9253: 0x62C5,
0x9254: 0x63A2,
0x9255: 0x65E6,
0x9256: 0x6B4E,
0x9257: 0x6DE1,
0x9258: 0x6E5B,
0x9259: 0x70AD,
0x925A: 0x77ED,
0x925B: 0x7AEF,
0x925C: 0x7BAA,
0x925D: 0x7DBB,
0x925E: 0x803D,
0x925F: 0x80C6,
0x9260: 0x86CB,
0x9261: 0x8A95,
0x9262: 0x935B,
0x9263: 0x56E3,
0x9264: 0x58C7,
0x9265: 0x5F3E,
0x9266: 0x65AD,
0x9267: 0x6696,
0x9268: 0x6A80,
0x9269: 0x6BB5,
0x926A: 0x7537,
0x926B: 0x8AC7,
0x926C: 0x5024,
0x926D: 0x77E5,
0x926E: 0x5730,
0x926F: 0x5F1B,
0x9270: 0x6065,
0x9271: 0x667A,
0x9272: 0x6C60,
0x9273: 0x75F4,
0x9274: 0x7A1A,
0x9275: 0x7F6E,
0x9276: 0x81F4,
0x9277: 0x8718,
0x9278: 0x9045,
0x9279: 0x99B3,
0x927A: 0x7BC9,
0x927B: 0x755C,
0x927C: 0x7AF9,
0x927D: 0x7B51,
0x927E: 0x84C4,
0x9280: 0x9010,
0x9281: 0x79E9,
0x9282: 0x7A92,
0x9283: 0x8336,
0x9284: 0x5AE1,
0x9285: 0x7740,
0x9286: 0x4E2D,
0x9287: 0x4EF2,
0x9288: 0x5B99,
0x9289: 0x5FE0,
0x928A: 0x62BD,
0x928B: 0x663C,
0x928C: 0x67F1,
0x928D: 0x6CE8,
0x928E: 0x866B,
0x928F: 0x8877,
0x9290: 0x8A3B,
0x9291: 0x914E,
0x9292: 0x92F3,
0x9293: 0x99D0,
0x9294: 0x6A17,
0x9295: 0x7026,
0x9296: 0x732A,
0x9297: 0x82E7,
0x9298: 0x8457,
0x9299: 0x8CAF,
0x929A: 0x4E01,
0x929B: 0x5146,
0x929C: 0x51CB,
0x929D: 0x558B,
0x929E: 0x5BF5,
0x929F: 0x5E16,
0x92A0: 0x5E33,
0x92A1: 0x5E81,
0x92A2: 0x5F14,
0x92A3: 0x5F35,
0x92A4: 0x5F6B,
0x92A5: 0x5FB4,
0x92A6: 0x61F2,
0x92A7: 0x6311,
0x92A8: 0x66A2,
0x92A9: 0x671D,
0x92AA: 0x6F6E,
0x92AB: 0x7252,
0x92AC: 0x753A,
0x92AD: 0x773A,
0x92AE: 0x8074,
0x92AF: 0x8139,
0x92B0: 0x8178,
0x92B1: 0x8776,
0x92B2: 0x8ABF,
0x92B3: 0x8ADC,
0x92B4: 0x8D85,
0x92B5: 0x8DF3,
0x92B6: 0x929A,
0x92B7: 0x9577,
0x92B8: 0x9802,
0x92B9: 0x9CE5,
0x92BA: 0x52C5,
0x92BB: 0x6357,
0x92BC: 0x76F4,
0x92BD: 0x6715,
0x92BE: 0x6C88,
0x92BF: 0x73CD,
0x92C0: 0x8CC3,
0x92C1: 0x93AE,
0x92C2: 0x9673,
0x92C3: 0x6D25,
0x92C4: 0x589C,
0x92C5: 0x690E,
0x92C6: 0x69CC,
0x92C7: 0x8FFD,
0x92C8: 0x939A,
0x92C9: 0x75DB,
0x92CA: 0x901A,
0x92CB: 0x585A,
0x92CC: 0x6802,
0x92CD: 0x63B4,
0x92CE: 0x69FB,
0x92CF: 0x4F43,
0x92D0: 0x6F2C,
0x92D1: 0x67D8,
0x92D2: 0x8FBB,
0x92D3: 0x8526,
0x92D4: 0x7DB4,
0x92D5: 0x9354,
0x92D6: 0x693F,
0x92D7: 0x6F70,
0x92D8: 0x576A,
0x92D9: 0x58F7,
0x92DA: 0x5B2C,
0x92DB: 0x7D2C,
0x92DC: 0x722A,
0x92DD: 0x540A,
0x92DE: 0x91E3,
0x92DF: 0x9DB4,
0x92E0: 0x4EAD,
0x92E1: 0x4F4E,
0x92E2: 0x505C,
0x92E3: 0x5075,
0x92E4: 0x5243,
0x92E5: 0x8C9E,
0x92E6: 0x5448,
0x92E7: 0x5824,
0x92E8: 0x5B9A,
0x92E9: 0x5E1D,
0x92EA: 0x5E95,
0x92EB: 0x5EAD,
0x92EC: 0x5EF7,
0x92ED: 0x5F1F,
0x92EE: 0x608C,
0x92EF: 0x62B5,
0x92F0: 0x633A,
0x92F1: 0x63D0,
0x92F2: 0x68AF,
0x92F3: 0x6C40,
0x92F4: 0x7887,
0x92F5: 0x798E,
0x92F6: 0x7A0B,
0x92F7: 0x7DE0,
0x92F8: 0x8247,
0x92F9: 0x8A02,
0x92FA: 0x8AE6,
0x92FB: 0x8E44,
0x92FC: 0x9013,
0x9340: 0x90B8,
0x9341: 0x912D,
0x9342: 0x91D8,
0x9343: 0x9F0E,
0x9344: 0x6CE5,
0x9345: 0x6458,
0x9346: 0x64E2,
0x9347: 0x6575,
0x9348: 0x6EF4,
0x9349: 0x7684,
0x934A: 0x7B1B,
0x934B: 0x9069,
0x934C: 0x93D1,
0x934D: 0x6EBA,
0x934E: 0x54F2,
0x934F: 0x5FB9,
0x9350: 0x64A4,
0x9351: 0x8F4D,
0x9352: 0x8FED,
0x9353: 0x9244,
0x9354: 0x5178,
0x9355: 0x586B,
0x9356: 0x5929,
0x9357: 0x5C55,
0x9358: 0x5E97,
0x9359: 0x6DFB,
0x935A: 0x7E8F,
0x935B: 0x751C,
0x935C: 0x8CBC,
0x935D: 0x8EE2,
0x935E: 0x985B,
0x935F: 0x70B9,
0x9360: 0x4F1D,
0x9361: 0x6BBF,
0x9362: 0x6FB1,
0x9363: 0x7530,
0x9364: 0x96FB,
0x9365: 0x514E,
0x9366: 0x5410,
0x9367: 0x5835,
0x9368: 0x5857,
0x9369: 0x59AC,
0x936A: 0x5C60,
0x936B: 0x5F92,
0x936C: 0x6597,
0x936D: 0x675C,
0x936E: 0x6E21,
0x936F: 0x767B,
0x9370: 0x83DF,
0x9371: 0x8CED,
0x9372: 0x9014,
0x9373: 0x90FD,
0x9374: 0x934D,
0x9375: 0x7825,
0x9376: 0x783A,
0x9377: 0x52AA,
0x9378: 0x5EA6,
0x9379: 0x571F,
0x937A: 0x5974,
0x937B: 0x6012,
0x937C: 0x5012,
0x937D: 0x515A,
0x937E: 0x51AC,
0x9380: 0x51CD,
0x9381: 0x5200,
0x9382: 0x5510,
0x9383: 0x5854,
0x9384: 0x5858,
0x9385: 0x5957,
0x9386: 0x5B95,
0x9387: 0x5CF6,
0x9388: 0x5D8B,
0x9389: 0x60BC,
0x938A: 0x6295,
0x938B: 0x642D,
0x938C: 0x6771,
0x938D: 0x6843,
0x938E: 0x68BC,
0x938F: 0x68DF,
0x9390: 0x76D7,
0x9391: 0x6DD8,
0x9392: 0x6E6F,
0x9393: 0x6D9B,
0x9394: 0x706F,
0x9395: 0x71C8,
0x9396: 0x5F53,
0x9397: 0x75D8,
0x9398: 0x7977,
0x9399: 0x7B49,
0x939A: 0x7B54,
0x939B: 0x7B52,
0x939C: 0x7CD6,
0x939D: 0x7D71,
0x939E: 0x5230,
0x939F: 0x8463,
0x93A0: 0x8569,
0x93A1: 0x85E4,
0x93A2: 0x8A0E,
0x93A3: 0x8B04,
0x93A4: 0x8C46,
0x93A5: 0x8E0F,
0x93A6: 0x9003,
0x93A7: 0x900F,
0x93A8: 0x9419,
0x93A9: 0x9676,
0x93AA: 0x982D,
0x93AB: 0x9A30,
0x93AC: 0x95D8,
0x93AD: 0x50CD,
0x93AE: 0x52D5,
0x93AF: 0x540C,
0x93B0: 0x5802,
0x93B1: 0x5C0E,
0x93B2: 0x61A7,
0x93B3: 0x649E,
0x93B4: 0x6D1E,
0x93B5: 0x77B3,
0x93B6: 0x7AE5,
0x93B7: 0x80F4,
0x93B8: 0x8404,
0x93B9: 0x9053,
0x93BA: 0x9285,
0x93BB: 0x5CE0,
0x93BC: 0x9D07,
0x93BD: 0x533F,
0x93BE: 0x5F97,
0x93BF: 0x5FB3,
0x93C0: 0x6D9C,
0x93C1: 0x7279,
0x93C2: 0x7763,
0x93C3: 0x79BF,
0x93C4: 0x7BE4,
0x93C5: 0x6BD2,
0x93C6: 0x72EC,
0x93C7: 0x8AAD,
0x93C8: 0x6803,
0x93C9: 0x6A61,
0x93CA: 0x51F8,
0x93CB: 0x7A81,
0x93CC: 0x6934,
0x93CD: 0x5C4A,
0x93CE: 0x9CF6,
0x93CF: 0x82EB,
0x93D0: 0x5BC5,
0x93D1: 0x9149,
0x93D2: 0x701E,
0x93D3: 0x5678,
0x93D4: 0x5C6F,
0x93D5: 0x60C7,
0x93D6: 0x6566,
0x93D7: 0x6C8C,
0x93D8: 0x8C5A,
0x93D9: 0x9041,
0x93DA: 0x9813,
0x93DB: 0x5451,
0x93DC: 0x66C7,
0x93DD: 0x920D,
0x93DE: 0x5948,
0x93DF: 0x90A3,
0x93E0: 0x5185,
0x93E1: 0x4E4D,
0x93E2: 0x51EA,
0x93E3: 0x8599,
0x93E4: 0x8B0E,
0x93E5: 0x7058,
0x93E6: 0x637A,
0x93E7: 0x934B,
0x93E8: 0x6962,
0x93E9: 0x99B4,
0x93EA: 0x7E04,
0x93EB: 0x7577,
0x93EC: 0x5357,
0x93ED: 0x6960,
0x93EE: 0x8EDF,
0x93EF: 0x96E3,
0x93F0: 0x6C5D,
0x93F1: 0x4E8C,
0x93F2: 0x5C3C,
0x93F3: 0x5F10,
0x93F4: 0x8FE9,
0x93F5: 0x5302,
0x93F6: 0x8CD1,
0x93F7: 0x8089,
0x93F8: 0x8679,
0x93F9: 0x5EFF,
0x93FA: 0x65E5,
0x93FB: 0x4E73,
0x93FC: 0x5165,
0x9440: 0x5982,
0x9441: 0x5C3F,
0x9442: 0x97EE,
0x9443: 0x4EFB,
0x9444: 0x598A,
0x9445: 0x5FCD,
0x9446: 0x8A8D,
0x9447: 0x6FE1,
0x9448: 0x79B0,
0x9449: 0x7962,
0x944A: 0x5BE7,
0x944B: 0x8471,
0x944C: 0x732B,
0x944D: 0x71B1,
0x944E: 0x5E74,
0x944F: 0x5FF5,
0x9450: 0x637B,
0x9451: 0x649A,
0x9452: 0x71C3,
0x9453: 0x7C98,
0x9454: 0x4E43,
0x9455: 0x5EFC,
0x9456: 0x4E4B,
0x9457: 0x57DC,
0x9458: 0x56A2,
0x9459: 0x60A9,
0x945A: 0x6FC3,
0x945B: 0x7D0D,
0x945C: 0x80FD,
0x945D: 0x8133,
0x945E: 0x81BF,
0x945F: 0x8FB2,
0x9460: 0x8997,
0x9461: 0x86A4,
0x9462: 0x5DF4,
0x9463: 0x628A,
0x9464: 0x64AD,
0x9465: 0x8987,
0x9466: 0x6777,
0x9467: 0x6CE2,
0x9468: 0x6D3E,
0x9469: 0x7436,
0x946A: 0x7834,
0x946B: 0x5A46,
0x946C: 0x7F75,
0x946D: 0x82AD,
0x946E: 0x99AC,
0x946F: 0x4FF3,
0x9470: 0x5EC3,
0x9471: 0x62DD,
0x9472: 0x6392,
0x9473: 0x6557,
0x9474: 0x676F,
0x9475: 0x76C3,
0x9476: 0x724C,
0x9477: 0x80CC,
0x9478: 0x80BA,
0x9479: 0x8F29,
0x947A: 0x914D,
0x947B: 0x500D,
0x947C: 0x57F9,
0x947D: 0x5A92,
0x947E: 0x6885,
0x9480: 0x6973,
0x9481: 0x7164,
0x9482: 0x72FD,
0x9483: 0x8CB7,
0x9484: 0x58F2,
0x9485: 0x8CE0,
0x9486: 0x966A,
0x9487: 0x9019,
0x9488: 0x877F,
0x9489: 0x79E4,
0x948A: 0x77E7,
0x948B: 0x8429,
0x948C: 0x4F2F,
0x948D: 0x5265,
0x948E: 0x535A,
0x948F: 0x62CD,
0x9490: 0x67CF,
0x9491: 0x6CCA,
0x9492: 0x767D,
0x9493: 0x7B94,
0x9494: 0x7C95,
0x9495: 0x8236,
0x9496: 0x8584,
0x9497: 0x8FEB,
0x9498: 0x66DD,
0x9499: 0x6F20,
0x949A: 0x7206,
0x949B: 0x7E1B,
0x949C: 0x83AB,
0x949D: 0x99C1,
0x949E: 0x9EA6,
0x949F: 0x51FD,
0x94A0: 0x7BB1,
0x94A1: 0x7872,
0x94A2: 0x7BB8,
0x94A3: 0x8087,
0x94A4: 0x7B48,
0x94A5: 0x6AE8,
0x94A6: 0x5E61,
0x94A7: 0x808C,
0x94A8: 0x7551,
0x94A9: 0x7560,
0x94AA: 0x516B,
0x94AB: 0x9262,
0x94AC: 0x6E8C,
0x94AD: 0x767A,
0x94AE: 0x9197,
0x94AF: 0x9AEA,
0x94B0: 0x4F10,
0x94B1: 0x7F70,
0x94B2: 0x629C,
0x94B3: 0x7B4F,
0x94B4: 0x95A5,
0x94B5: 0x9CE9,
0x94B6: 0x567A,
0x94B7: 0x5859,
0x94B8: 0x86E4,
0x94B9: 0x96BC,
0x94BA: 0x4F34,
0x94BB: 0x5224,
0x94BC: 0x534A,
0x94BD: 0x53CD,
0x94BE: 0x53DB,
0x94BF: 0x5E06,
0x94C0: 0x642C,
0x94C1: 0x6591,
0x94C2: 0x677F,
0x94C3: 0x6C3E,
0x94C4: 0x6C4E,
0x94C5: 0x7248,
0x94C6: 0x72AF,
0x94C7: 0x73ED,
0x94C8: 0x7554,
0x94C9: 0x7E41,
0x94CA: 0x822C,
0x94CB: 0x85E9,
0x94CC: 0x8CA9,
0x94CD: 0x7BC4,
0x94CE: 0x91C6,
0x94CF: 0x7169,
0x94D0: 0x9812,
0x94D1: 0x98EF,
0x94D2: 0x633D,
0x94D3: 0x6669,
0x94D4: 0x756A,
0x94D5: 0x76E4,
0x94D6: 0x78D0,
0x94D7: 0x8543,
0x94D8: 0x86EE,
0x94D9: 0x532A,
0x94DA: 0x5351,
0x94DB: 0x5426,
0x94DC: 0x5983,
0x94DD: 0x5E87,
0x94DE: 0x5F7C,
0x94DF: 0x60B2,
0x94E0: 0x6249,
0x94E1: 0x6279,
0x94E2: 0x62AB,
0x94E3: 0x6590,
0x94E4: 0x6BD4,
0x94E5: 0x6CCC,
0x94E6: 0x75B2,
0x94E7: 0x76AE,
0x94E8: 0x7891,
0x94E9: 0x79D8,
0x94EA: 0x7DCB,
0x94EB: 0x7F77,
0x94EC: 0x80A5,
0x94ED: 0x88AB,
0x94EE: 0x8AB9,
0x94EF: 0x8CBB,
0x94F0: 0x907F,
0x94F1: 0x975E,
0x94F2: 0x98DB,
0x94F3: 0x6A0B,
0x94F4: 0x7C38,
0x94F5: 0x5099,
0x94F6: 0x5C3E,
0x94F7: 0x5FAE,
0x94F8: 0x6787,
0x94F9: 0x6BD8,
0x94FA: 0x7435,
0x94FB: 0x7709,
0x94FC: 0x7F8E,
0x9540: 0x9F3B,
0x9541: 0x67CA,
0x9542: 0x7A17,
0x9543: 0x5339,
0x9544: 0x758B,
0x9545: 0x9AED,
0x9546: 0x5F66,
0x9547: 0x819D,
0x9548: 0x83F1,
0x9549: 0x8098,
0x954A: 0x5F3C,
0x954B: 0x5FC5,
0x954C: 0x7562,
0x954D: 0x7B46,
0x954E: 0x903C,
0x954F: 0x6867,
0x9550: 0x59EB,
0x9551: 0x5A9B,
0x9552: 0x7D10,
0x9553: 0x767E,
0x9554: 0x8B2C,
0x9555: 0x4FF5,
0x9556: 0x5F6A,
0x9557: 0x6A19,
0x9558: 0x6C37,
0x9559: 0x6F02,
0x955A: 0x74E2,
0x955B: 0x7968,
0x955C: 0x8868,
0x955D: 0x8A55,
0x955E: 0x8C79,
0x955F: 0x5EDF,
0x9560: 0x63CF,
0x9561: 0x75C5,
0x9562: 0x79D2,
0x9563: 0x82D7,
0x9564: 0x9328,
0x9565: 0x92F2,
0x9566: 0x849C,
0x9567: 0x86ED,
0x9568: 0x9C2D,
0x9569: 0x54C1,
0x956A: 0x5F6C,
0x956B: 0x658C,
0x956C: 0x6D5C,
0x956D: 0x7015,
0x956E: 0x8CA7,
0x956F: 0x8CD3,
0x9570: 0x983B,
0x9571: 0x654F,
0x9572: 0x74F6,
0x9573: 0x4E0D,
0x9574: 0x4ED8,
0x9575: 0x57E0,
0x9576: 0x592B,
0x9577: 0x5A66,
0x9578: 0x5BCC,
0x9579: 0x51A8,
0x957A: 0x5E03,
0x957B: 0x5E9C,
0x957C: 0x6016,
0x957D: 0x6276,
0x957E: 0x6577,
0x9580: 0x65A7,
0x9581: 0x666E,
0x9582: 0x6D6E,
0x9583: 0x7236,
0x9584: 0x7B26,
0x9585: 0x8150,
0x9586: 0x819A,
0x9587: 0x8299,
0x9588: 0x8B5C,
0x9589: 0x8CA0,
0x958A: 0x8CE6,
0x958B: 0x8D74,
0x958C: 0x961C,
0x958D: 0x9644,
0x958E: 0x4FAE,
0x958F: 0x64AB,
0x9590: 0x6B66,
0x9591: 0x821E,
0x9592: 0x8461,
0x9593: 0x856A,
0x9594: 0x90E8,
0x9595: 0x5C01,
0x9596: 0x6953,
0x9597: 0x98A8,
0x9598: 0x847A,
0x9599: 0x8557,
0x959A: 0x4F0F,
0x959B: 0x526F,
0x959C: 0x5FA9,
0x959D: 0x5E45,
0x959E: 0x670D,
0x959F: 0x798F,
0x95A0: 0x8179,
0x95A1: 0x8907,
0x95A2: 0x8986,
0x95A3: 0x6DF5,
0x95A4: 0x5F17,
0x95A5: 0x6255,
0x95A6: 0x6CB8,
0x95A7: 0x4ECF,
0x95A8: 0x7269,
0x95A9: 0x9B92,
0x95AA: 0x5206,
0x95AB: 0x543B,
0x95AC: 0x5674,
0x95AD: 0x58B3,
0x95AE: 0x61A4,
0x95AF: 0x626E,
0x95B0: 0x711A,
0x95B1: 0x596E,
0x95B2: 0x7C89,
0x95B3: 0x7CDE,
0x95B4: 0x7D1B,
0x95B5: 0x96F0,
0x95B6: 0x6587,
0x95B7: 0x805E,
0x95B8: 0x4E19,
0x95B9: 0x4F75,
0x95BA: 0x5175,
0x95BB: 0x5840,
0x95BC: 0x5E63,
0x95BD: 0x5E73,
0x95BE: 0x5F0A,
0x95BF: 0x67C4,
0x95C0: 0x4E26,
0x95C1: 0x853D,
0x95C2: 0x9589,
0x95C3: 0x965B,
0x95C4: 0x7C73,
0x95C5: 0x9801,
0x95C6: 0x50FB,
0x95C7: 0x58C1,
0x95C8: 0x7656,
0x95C9: 0x78A7,
0x95CA: 0x5225,
0x95CB: 0x77A5,
0x95CC: 0x8511,
0x95CD: 0x7B86,
0x95CE: 0x504F,
0x95CF: 0x5909,
0x95D0: 0x7247,
0x95D1: 0x7BC7,
0x95D2: 0x7DE8,
0x95D3: 0x8FBA,
0x95D4: 0x8FD4,
0x95D5: 0x904D,
0x95D6: 0x4FBF,
0x95D7: 0x52C9,
0x95D8: 0x5A29,
0x95D9: 0x5F01,
0x95DA: 0x97AD,
0x95DB: 0x4FDD,
0x95DC: 0x8217,
0x95DD: 0x92EA,
0x95DE: 0x5703,
0x95DF: 0x6355,
0x95E0: 0x6B69,
0x95E1: 0x752B,
0x95E2: 0x88DC,
0x95E3: 0x8F14,
0x95E4: 0x7A42,
0x95E5: 0x52DF,
0x95E6: 0x5893,
0x95E7: 0x6155,
0x95E8: 0x620A,
0x95E9: 0x66AE,
0x95EA: 0x6BCD,
0x95EB: 0x7C3F,
0x95EC: 0x83E9,
0x95ED: 0x5023,
0x95EE: 0x4FF8,
0x95EF: 0x5305,
0x95F0: 0x5446,
0x95F1: 0x5831,
0x95F2: 0x5949,
0x95F3: 0x5B9D,
0x95F4: 0x5CF0,
0x95F5: 0x5CEF,
0x95F6: 0x5D29,
0x95F7: 0x5E96,
0x95F8: 0x62B1,
0x95F9: 0x6367,
0x95FA: 0x653E,
0x95FB: 0x65B9,
0x95FC: 0x670B,
0x9640: 0x6CD5,
0x9641: 0x6CE1,
0x9642: 0x70F9,
0x9643: 0x7832,
0x9644: 0x7E2B,
0x9645: 0x80DE,
0x9646: 0x82B3,
0x9647: 0x840C,
0x9648: 0x84EC,
0x9649: 0x8702,
0x964A: 0x8912,
0x964B: 0x8A2A,
0x964C: 0x8C4A,
0x964D: 0x90A6,
0x964E: 0x92D2,
0x964F: 0x98FD,
0x9650: 0x9CF3,
0x9651: 0x9D6C,
0x9652: 0x4E4F,
0x9653: 0x4EA1,
0x9654: 0x508D,
0x9655: 0x5256,
0x9656: 0x574A,
0x9657: 0x59A8,
0x9658: 0x5E3D,
0x9659: 0x5FD8,
0x965A: 0x5FD9,
0x965B: 0x623F,
0x965C: 0x66B4,
0x965D: 0x671B,
0x965E: 0x67D0,
0x965F: 0x68D2,
0x9660: 0x5192,
0x9661: 0x7D21,
0x9662: 0x80AA,
0x9663: 0x81A8,
0x9664: 0x8B00,
0x9665: 0x8C8C,
0x9666: 0x8CBF,
0x9667: 0x927E,
0x9668: 0x9632,
0x9669: 0x5420,
0x966A: 0x982C,
0x966B: 0x5317,
0x966C: 0x50D5,
0x966D: 0x535C,
0x966E: 0x58A8,
0x966F: 0x64B2,
0x9670: 0x6734,
0x9671: 0x7267,
0x9672: 0x7766,
0x9673: 0x7A46,
0x9674: 0x91E6,
0x9675: 0x52C3,
0x9676: 0x6CA1,
0x9677: 0x6B86,
0x9678: 0x5800,
0x9679: 0x5E4C,
0x967A: 0x5954,
0x967B: 0x672C,
0x967C: 0x7FFB,
0x967D: 0x51E1,
0x967E: 0x76C6,
0x9680: 0x6469,
0x9681: 0x78E8,
0x9682: 0x9B54,
0x9683: 0x9EBB,
0x9684: 0x57CB,
0x9685: 0x59B9,
0x9686: 0x6627,
0x9687: 0x679A,
0x9688: 0x6BCE,
0x9689: 0x54E9,
0x968A: 0x69D9,
0x968B: 0x5E55,
0x968C: 0x819C,
0x968D: 0x6795,
0x968E: 0x9BAA,
0x968F: 0x67FE,
0x9690: 0x9C52,
0x9691: 0x685D,
0x9692: 0x4EA6,
0x9693: 0x4FE3,
0x9694: 0x53C8,
0x9695: 0x62B9,
0x9696: 0x672B,
0x9697: 0x6CAB,
0x9698: 0x8FC4,
0x9699: 0x4FAD,
0x969A: 0x7E6D,
0x969B: 0x9EBF,
0x969C: 0x4E07,
0x969D: 0x6162,
0x969E: 0x6E80,
0x969F: 0x6F2B,
0x96A0: 0x8513,
0x96A1: 0x5473,
0x96A2: 0x672A,
0x96A3: 0x9B45,
0x96A4: 0x5DF3,
0x96A5: 0x7B95,
0x96A6: 0x5CAC,
0x96A7: 0x5BC6,
0x96A8: 0x871C,
0x96A9: 0x6E4A,
0x96AA: 0x84D1,
0x96AB: 0x7A14,
0x96AC: 0x8108,
0x96AD: 0x5999,
0x96AE: 0x7C8D,
0x96AF: 0x6C11,
0x96B0: 0x7720,
0x96B1: 0x52D9,
0x96B2: 0x5922,
0x96B3: 0x7121,
0x96B4: 0x725F,
0x96B5: 0x77DB,
0x96B6: 0x9727,
0x96B7: 0x9D61,
0x96B8: 0x690B,
0x96B9: 0x5A7F,
0x96BA: 0x5A18,
0x96BB: 0x51A5,
0x96BC: 0x540D,
0x96BD: 0x547D,
0x96BE: 0x660E,
0x96BF: 0x76DF,
0x96C0: 0x8FF7,
0x96C1: 0x9298,
0x96C2: 0x9CF4,
0x96C3: 0x59EA,
0x96C4: 0x725D,
0x96C5: 0x6EC5,
0x96C6: 0x514D,
0x96C7: 0x68C9,
0x96C8: 0x7DBF,
0x96C9: 0x7DEC,
0x96CA: 0x9762,
0x96CB: 0x9EBA,
0x96CC: 0x6478,
0x96CD: 0x6A21,
0x96CE: 0x8302,
0x96CF: 0x5984,
0x96D0: 0x5B5F,
0x96D1: 0x6BDB,
0x96D2: 0x731B,
0x96D3: 0x76F2,
0x96D4: 0x7DB2,
0x96D5: 0x8017,
0x96D6: 0x8499,
0x96D7: 0x5132,
0x96D8: 0x6728,
0x96D9: 0x9ED9,
0x96DA: 0x76EE,
0x96DB: 0x6762,
0x96DC: 0x52FF,
0x96DD: 0x9905,
0x96DE: 0x5C24,
0x96DF: 0x623B,
0x96E0: 0x7C7E,
0x96E1: 0x8CB0,
0x96E2: 0x554F,
0x96E3: 0x60B6,
0x96E4: 0x7D0B,
0x96E5: 0x9580,
0x96E6: 0x5301,
0x96E7: 0x4E5F,
0x96E8: 0x51B6,
0x96E9: 0x591C,
0x96EA: 0x723A,
0x96EB: 0x8036,
0x96EC: 0x91CE,
0x96ED: 0x5F25,
0x96EE: 0x77E2,
0x96EF: 0x5384,
0x96F0: 0x5F79,
0x96F1: 0x7D04,
0x96F2: 0x85AC,
0x96F3: 0x8A33,
0x96F4: 0x8E8D,
0x96F5: 0x9756,
0x96F6: 0x67F3,
0x96F7: 0x85AE,
0x96F8: 0x9453,
0x96F9: 0x6109,
0x96FA: 0x6108,
0x96FB: 0x6CB9,
0x96FC: 0x7652,
0x9740: 0x8AED,
0x9741: 0x8F38,
0x9742: 0x552F,
0x9743: 0x4F51,
0x9744: 0x512A,
0x9745: 0x52C7,
0x9746: 0x53CB,
0x9747: 0x5BA5,
0x9748: 0x5E7D,
0x9749: 0x60A0,
0x974A: 0x6182,
0x974B: 0x63D6,
0x974C: 0x6709,
0x974D: 0x67DA,
0x974E: 0x6E67,
0x974F: 0x6D8C,
0x9750: 0x7336,
0x9751: 0x7337,
0x9752: 0x7531,
0x9753: 0x7950,
0x9754: 0x88D5,
0x9755: 0x8A98,
0x9756: 0x904A,
0x9757: 0x9091,
0x9758: 0x90F5,
0x9759: 0x96C4,
0x975A: 0x878D,
0x975B: 0x5915,
0x975C: 0x4E88,
0x975D: 0x4F59,
0x975E: 0x4E0E,
0x975F: 0x8A89,
0x9760: 0x8F3F,
0x9761: 0x9810,
0x9762: 0x50AD,
0x9763: 0x5E7C,
0x9764: 0x5996,
0x9765: 0x5BB9,
0x9766: 0x5EB8,
0x9767: 0x63DA,
0x9768: 0x63FA,
0x9769: 0x64C1,
0x976A: 0x66DC,
0x976B: 0x694A,
0x976C: 0x69D8,
0x976D: 0x6D0B,
0x976E: 0x6EB6,
0x976F: 0x7194,
0x9770: 0x7528,
0x9771: 0x7AAF,
0x9772: 0x7F8A,
0x9773: 0x8000,
0x9774: 0x8449,
0x9775: 0x84C9,
0x9776: 0x8981,
0x9777: 0x8B21,
0x9778: 0x8E0A,
0x9779: 0x9065,
0x977A: 0x967D,
0x977B: 0x990A,
0x977C: 0x617E,
0x977D: 0x6291,
0x977E: 0x6B32,
0x9780: 0x6C83,
0x9781: 0x6D74,
0x9782: 0x7FCC,
0x9783: 0x7FFC,
0x9784: 0x6DC0,
0x9785: 0x7F85,
0x9786: 0x87BA,
0x9787: 0x88F8,
0x9788: 0x6765,
0x9789: 0x83B1,
0x978A: 0x983C,
0x978B: 0x96F7,
0x978C: 0x6D1B,
0x978D: 0x7D61,
0x978E: 0x843D,
0x978F: 0x916A,
0x9790: 0x4E71,
0x9791: 0x5375,
0x9792: 0x5D50,
0x9793: 0x6B04,
0x9794: 0x6FEB,
0x9795: 0x85CD,
0x9796: 0x862D,
0x9797: 0x89A7,
0x9798: 0x5229,
0x9799: 0x540F,
0x979A: 0x5C65,
0x979B: 0x674E,
0x979C: 0x68A8,
0x979D: 0x7406,
0x979E: 0x7483,
0x979F: 0x75E2,
0x97A0: 0x88CF,
0x97A1: 0x88E1,
0x97A2: 0x91CC,
0x97A3: 0x96E2,
0x97A4: 0x9678,
0x97A5: 0x5F8B,
0x97A6: 0x7387,
0x97A7: 0x7ACB,
0x97A8: 0x844E,
0x97A9: 0x63A0,
0x97AA: 0x7565,
0x97AB: 0x5289,
0x97AC: 0x6D41,
0x97AD: 0x6E9C,
0x97AE: 0x7409,
0x97AF: 0x7559,
0x97B0: 0x786B,
0x97B1: 0x7C92,
0x97B2: 0x9686,
0x97B3: 0x7ADC,
0x97B4: 0x9F8D,
0x97B5: 0x4FB6,
0x97B6: 0x616E,
0x97B7: 0x65C5,
0x97B8: 0x865C,
0x97B9: 0x4E86,
0x97BA: 0x4EAE,
0x97BB: 0x50DA,
0x97BC: 0x4E21,
0x97BD: 0x51CC,
0x97BE: 0x5BEE,
0x97BF: 0x6599,
0x97C0: 0x6881,
0x97C1: 0x6DBC,
0x97C2: 0x731F,
0x97C3: 0x7642,
0x97C4: 0x77AD,
0x97C5: 0x7A1C,
0x97C6: 0x7CE7,
0x97C7: 0x826F,
0x97C8: 0x8AD2,
0x97C9: 0x907C,
0x97CA: 0x91CF,
0x97CB: 0x9675,
0x97CC: 0x9818,
0x97CD: 0x529B,
0x97CE: 0x7DD1,
0x97CF: 0x502B,
0x97D0: 0x5398,
0x97D1: 0x6797,
0x97D2: 0x6DCB,
0x97D3: 0x71D0,
0x97D4: 0x7433,
0x97D5: 0x81E8,
0x97D6: 0x8F2A,
0x97D7: 0x96A3,
0x97D8: 0x9C57,
0x97D9: 0x9E9F,
0x97DA: 0x7460,
0x97DB: 0x5841,
0x97DC: 0x6D99,
0x97DD: 0x7D2F,
0x97DE: 0x985E,
0x97DF: 0x4EE4,
0x97E0: 0x4F36,
0x97E1: 0x4F8B,
0x97E2: 0x51B7,
0x97E3: 0x52B1,
0x97E4: 0x5DBA,
0x97E5: 0x601C,
0x97E6: 0x73B2,
0x97E7: 0x793C,
0x97E8: 0x82D3,
0x97E9: 0x9234,
0x97EA: 0x96B7,
0x97EB: 0x96F6,
0x97EC: 0x970A,
0x97ED: 0x9E97,
0x97EE: 0x9F62,
0x97EF: 0x66A6,
0x97F0: 0x6B74,
0x97F1: 0x5217,
0x97F2: 0x52A3,
0x97F3: 0x70C8,
0x97F4: 0x88C2,
0x97F5: 0x5EC9,
0x97F6: 0x604B,
0x97F7: 0x6190,
0x97F8: 0x6F23,
0x97F9: 0x7149,
0x97FA: 0x7C3E,
0x97FB: 0x7DF4,
0x97FC: 0x806F,
0x9840: 0x84EE,
0x9841: 0x9023,
0x9842: 0x932C,
0x9843: 0x5442,
0x9844: 0x9B6F,
0x9845: 0x6AD3,
0x9846: 0x7089,
0x9847: 0x8CC2,
0x9848: 0x8DEF,
0x9849: 0x9732,
0x984A: 0x52B4,
0x984B: 0x5A41,
0x984C: 0x5ECA,
0x984D: 0x5F04,
0x984E: 0x6717,
0x984F: 0x697C,
0x9850: 0x6994,
0x9851: 0x6D6A,
0x9852: 0x6F0F,
0x9853: 0x7262,
0x9854: 0x72FC,
0x9855: 0x7BED,
0x9856: 0x8001,
0x9857: 0x807E,
0x9858: 0x874B,
0x9859: 0x90CE,
0x985A: 0x516D,
0x985B: 0x9E93,
0x985C: 0x7984,
0x985D: 0x808B,
0x985E: 0x9332,
0x985F: 0x8AD6,
0x9860: 0x502D,
0x9861: 0x548C,
0x9862: 0x8A71,
0x9863: 0x6B6A,
0x9864: 0x8CC4,
0x9865: 0x8107,
0x9866: 0x60D1,
0x9867: 0x67A0,
0x9868: 0x9DF2,
0x9869: 0x4E99,
0x986A: 0x4E98,
0x986B: 0x9C10,
0x986C: 0x8A6B,
0x986D: 0x85C1,
0x986E: 0x8568,
0x986F: 0x6900,
0x9870: 0x6E7E,
0x9871: 0x7897,
0x9872: 0x8155,
0x989F: 0x5F0C,
0x98A0: 0x4E10,
0x98A1: 0x4E15,
0x98A2: 0x4E2A,
0x98A3: 0x4E31,
0x98A4: 0x4E36,
0x98A5: 0x4E3C,
0x98A6: 0x4E3F,
0x98A7: 0x4E42,
0x98A8: 0x4E56,
0x98A9: 0x4E58,
0x98AA: 0x4E82,
0x98AB: 0x4E85,
0x98AC: 0x8C6B,
0x98AD: 0x4E8A,
0x98AE: 0x8212,
0x98AF: 0x5F0D,
0x98B0: 0x4E8E,
0x98B1: 0x4E9E,
0x98B2: 0x4E9F,
0x98B3: 0x4EA0,
0x98B4: 0x4EA2,
0x98B5: 0x4EB0,
0x98B6: 0x4EB3,
0x98B7: 0x4EB6,
0x98B8: 0x4ECE,
0x98B9: 0x4ECD,
0x98BA: 0x4EC4,
0x98BB: 0x4EC6,
0x98BC: 0x4EC2,
0x98BD: 0x4ED7,
0x98BE: 0x4EDE,
0x98BF: 0x4EED,
0x98C0: 0x4EDF,
0x98C1: 0x4EF7,
0x98C2: 0x4F09,
0x98C3: 0x4F5A,
0x98C4: 0x4F30,
0x98C5: 0x4F5B,
0x98C6: 0x4F5D,
0x98C7: 0x4F57,
0x98C8: 0x4F47,
0x98C9: 0x4F76,
0x98CA: 0x4F88,
0x98CB: 0x4F8F,
0x98CC: 0x4F98,
0x98CD: 0x4F7B,
0x98CE: 0x4F69,
0x98CF: 0x4F70,
0x98D0: 0x4F91,
0x98D1: 0x4F6F,
0x98D2: 0x4F86,
0x98D3: 0x4F96,
0x98D4: 0x5118,
0x98D5: 0x4FD4,
0x98D6: 0x4FDF,
0x98D7: 0x4FCE,
0x98D8: 0x4FD8,
0x98D9: 0x4FDB,
0x98DA: 0x4FD1,
0x98DB: 0x4FDA,
0x98DC: 0x4FD0,
0x98DD: 0x4FE4,
0x98DE: 0x4FE5,
0x98DF: 0x501A,
0x98E0: 0x5028,
0x98E1: 0x5014,
0x98E2: 0x502A,
0x98E3: 0x5025,
0x98E4: 0x5005,
0x98E5: 0x4F1C,
0x98E6: 0x4FF6,
0x98E7: 0x5021,
0x98E8: 0x5029,
0x98E9: 0x502C,
0x98EA: 0x4FFE,
0x98EB: 0x4FEF,
0x98EC: 0x5011,
0x98ED: 0x5006,
0x98EE: 0x5043,
0x98EF: 0x5047,
0x98F0: 0x6703,
0x98F1: 0x5055,
0x98F2: 0x5050,
0x98F3: 0x5048,
0x98F4: 0x505A,
0x98F5: 0x5056,
0x98F6: 0x506C,
0x98F7: 0x5078,
0x98F8: 0x5080,
0x98F9: 0x509A,
0x98FA: 0x5085,
0x98FB: 0x50B4,
0x98FC: 0x50B2,
0x9940: 0x50C9,
0x9941: 0x50CA,
0x9942: 0x50B3,
0x9943: 0x50C2,
0x9944: 0x50D6,
0x9945: 0x50DE,
0x9946: 0x50E5,
0x9947: 0x50ED,
0x9948: 0x50E3,
0x9949: 0x50EE,
0x994A: 0x50F9,
0x994B: 0x50F5,
0x994C: 0x5109,
0x994D: 0x5101,
0x994E: 0x5102,
0x994F: 0x5116,
0x9950: 0x5115,
0x9951: 0x5114,
0x9952: 0x511A,
0x9953: 0x5121,
0x9954: 0x513A,
0x9955: 0x5137,
0x9956: 0x513C,
0x9957: 0x513B,
0x9958: 0x513F,
0x9959: 0x5140,
0x995A: 0x5152,
0x995B: 0x514C,
0x995C: 0x5154,
0x995D: 0x5162,
0x995E: 0x7AF8,
0x995F: 0x5169,
0x9960: 0x516A,
0x9961: 0x516E,
0x9962: 0x5180,
0x9963: 0x5182,
0x9964: 0x56D8,
0x9965: 0x518C,
0x9966: 0x5189,
0x9967: 0x518F,
0x9968: 0x5191,
0x9969: 0x5193,
0x996A: 0x5195,
0x996B: 0x5196,
0x996C: 0x51A4,
0x996D: 0x51A6,
0x996E: 0x51A2,
0x996F: 0x51A9,
0x9970: 0x51AA,
0x9971: 0x51AB,
0x9972: 0x51B3,
0x9973: 0x51B1,
0x9974: 0x51B2,
0x9975: 0x51B0,
0x9976: 0x51B5,
0x9977: 0x51BD,
0x9978: 0x51C5,
0x9979: 0x51C9,
0x997A: 0x51DB,
0x997B: 0x51E0,
0x997C: 0x8655,
0x997D: 0x51E9,
0x997E: 0x51ED,
0x9980: 0x51F0,
0x9981: 0x51F5,
0x9982: 0x51FE,
0x9983: 0x5204,
0x9984: 0x520B,
0x9985: 0x5214,
0x9986: 0x520E,
0x9987: 0x5227,
0x9988: 0x522A,
0x9989: 0x522E,
0x998A: 0x5233,
0x998B: 0x5239,
0x998C: 0x524F,
0x998D: 0x5244,
0x998E: 0x524B,
0x998F: 0x524C,
0x9990: 0x525E,
0x9991: 0x5254,
0x9992: 0x526A,
0x9993: 0x5274,
0x9994: 0x5269,
0x9995: 0x5273,
0x9996: 0x527F,
0x9997: 0x527D,
0x9998: 0x528D,
0x9999: 0x5294,
0x999A: 0x5292,
0x999B: 0x5271,
0x999C: 0x5288,
0x999D: 0x5291,
0x999E: 0x8FA8,
0x999F: 0x8FA7,
0x99A0: 0x52AC,
0x99A1: 0x52AD,
0x99A2: 0x52BC,
0x99A3: 0x52B5,
0x99A4: 0x52C1,
0x99A5: 0x52CD,
0x99A6: 0x52D7,
0x99A7: 0x52DE,
0x99A8: 0x52E3,
0x99A9: 0x52E6,
0x99AA: 0x98ED,
0x99AB: 0x52E0,
0x99AC: 0x52F3,
0x99AD: 0x52F5,
0x99AE: 0x52F8,
0x99AF: 0x52F9,
0x99B0: 0x5306,
0x99B1: 0x5308,
0x99B2: 0x7538,
0x99B3: 0x530D,
0x99B4: 0x5310,
0x99B5: 0x530F,
0x99B6: 0x5315,
0x99B7: 0x531A,
0x99B8: 0x5323,
0x99B9: 0x532F,
0x99BA: 0x5331,
0x99BB: 0x5333,
0x99BC: 0x5338,
0x99BD: 0x5340,
0x99BE: 0x5346,
0x99BF: 0x5345,
0x99C0: 0x4E17,
0x99C1: 0x5349,
0x99C2: 0x534D,
0x99C3: 0x51D6,
0x99C4: 0x535E,
0x99C5: 0x5369,
0x99C6: 0x536E,
0x99C7: 0x5918,
0x99C8: 0x537B,
0x99C9: 0x5377,
0x99CA: 0x5382,
0x99CB: 0x5396,
0x99CC: 0x53A0,
0x99CD: 0x53A6,
0x99CE: 0x53A5,
0x99CF: 0x53AE,
0x99D0: 0x53B0,
0x99D1: 0x53B6,
0x99D2: 0x53C3,
0x99D3: 0x7C12,
0x99D4: 0x96D9,
0x99D5: 0x53DF,
0x99D6: 0x66FC,
0x99D7: 0x71EE,
0x99D8: 0x53EE,
0x99D9: 0x53E8,
0x99DA: 0x53ED,
0x99DB: 0x53FA,
0x99DC: 0x5401,
0x99DD: 0x543D,
0x99DE: 0x5440,
0x99DF: 0x542C,
0x99E0: 0x542D,
0x99E1: 0x543C,
0x99E2: 0x542E,
0x99E3: 0x5436,
0x99E4: 0x5429,
0x99E5: 0x541D,
0x99E6: 0x544E,
0x99E7: 0x548F,
0x99E8: 0x5475,
0x99E9: 0x548E,
0x99EA: 0x545F,
0x99EB: 0x5471,
0x99EC: 0x5477,
0x99ED: 0x5470,
0x99EE: 0x5492,
0x99EF: 0x547B,
0x99F0: 0x5480,
0x99F1: 0x5476,
0x99F2: 0x5484,
0x99F3: 0x5490,
0x99F4: 0x5486,
0x99F5: 0x54C7,
0x99F6: 0x54A2,
0x99F7: 0x54B8,
0x99F8: 0x54A5,
0x99F9: 0x54AC,
0x99FA: 0x54C4,
0x99FB: 0x54C8,
0x99FC: 0x54A8,
0x9A40: 0x54AB,
0x9A41: 0x54C2,
0x9A42: 0x54A4,
0x9A43: 0x54BE,
0x9A44: 0x54BC,
0x9A45: 0x54D8,
0x9A46: 0x54E5,
0x9A47: 0x54E6,
0x9A48: 0x550F,
0x9A49: 0x5514,
0x9A4A: 0x54FD,
0x9A4B: 0x54EE,
0x9A4C: 0x54ED,
0x9A4D: 0x54FA,
0x9A4E: 0x54E2,
0x9A4F: 0x5539,
0x9A50: 0x5540,
0x9A51: 0x5563,
0x9A52: 0x554C,
0x9A53: 0x552E,
0x9A54: 0x555C,
0x9A55: 0x5545,
0x9A56: 0x5556,
0x9A57: 0x5557,
0x9A58: 0x5538,
0x9A59: 0x5533,
0x9A5A: 0x555D,
0x9A5B: 0x5599,
0x9A5C: 0x5580,
0x9A5D: 0x54AF,
0x9A5E: 0x558A,
0x9A5F: 0x559F,
0x9A60: 0x557B,
0x9A61: 0x557E,
0x9A62: 0x5598,
0x9A63: 0x559E,
0x9A64: 0x55AE,
0x9A65: 0x557C,
0x9A66: 0x5583,
0x9A67: 0x55A9,
0x9A68: 0x5587,
0x9A69: 0x55A8,
0x9A6A: 0x55DA,
0x9A6B: 0x55C5,
0x9A6C: 0x55DF,
0x9A6D: 0x55C4,
0x9A6E: 0x55DC,
0x9A6F: 0x55E4,
0x9A70: 0x55D4,
0x9A71: 0x5614,
0x9A72: 0x55F7,
0x9A73: 0x5616,
0x9A74: 0x55FE,
0x9A75: 0x55FD,
0x9A76: 0x561B,
0x9A77: 0x55F9,
0x9A78: 0x564E,
0x9A79: 0x5650,
0x9A7A: 0x71DF,
0x9A7B: 0x5634,
0x9A7C: 0x5636,
0x9A7D: 0x5632,
0x9A7E: 0x5638,
0x9A80: 0x566B,
0x9A81: 0x5664,
0x9A82: 0x562F,
0x9A83: 0x566C,
0x9A84: 0x566A,
0x9A85: 0x5686,
0x9A86: 0x5680,
0x9A87: 0x568A,
0x9A88: 0x56A0,
0x9A89: 0x5694,
0x9A8A: 0x568F,
0x9A8B: 0x56A5,
0x9A8C: 0x56AE,
0x9A8D: 0x56B6,
0x9A8E: 0x56B4,
0x9A8F: 0x56C2,
0x9A90: 0x56BC,
0x9A91: 0x56C1,
0x9A92: 0x56C3,
0x9A93: 0x56C0,
0x9A94: 0x56C8,
0x9A95: 0x56CE,
0x9A96: 0x56D1,
0x9A97: 0x56D3,
0x9A98: 0x56D7,
0x9A99: 0x56EE,
0x9A9A: 0x56F9,
0x9A9B: 0x5700,
0x9A9C: 0x56FF,
0x9A9D: 0x5704,
0x9A9E: 0x5709,
0x9A9F: 0x5708,
0x9AA0: 0x570B,
0x9AA1: 0x570D,
0x9AA2: 0x5713,
0x9AA3: 0x5718,
0x9AA4: 0x5716,
0x9AA5: 0x55C7,
0x9AA6: 0x571C,
0x9AA7: 0x5726,
0x9AA8: 0x5737,
0x9AA9: 0x5738,
0x9AAA: 0x574E,
0x9AAB: 0x573B,
0x9AAC: 0x5740,
0x9AAD: 0x574F,
0x9AAE: 0x5769,
0x9AAF: 0x57C0,
0x9AB0: 0x5788,
0x9AB1: 0x5761,
0x9AB2: 0x577F,
0x9AB3: 0x5789,
0x9AB4: 0x5793,
0x9AB5: 0x57A0,
0x9AB6: 0x57B3,
0x9AB7: 0x57A4,
0x9AB8: 0x57AA,
0x9AB9: 0x57B0,
0x9ABA: 0x57C3,
0x9ABB: 0x57C6,
0x9ABC: 0x57D4,
0x9ABD: 0x57D2,
0x9ABE: 0x57D3,
0x9ABF: 0x580A,
0x9AC0: 0x57D6,
0x9AC1: 0x57E3,
0x9AC2: 0x580B,
0x9AC3: 0x5819,
0x9AC4: 0x581D,
0x9AC5: 0x5872,
0x9AC6: 0x5821,
0x9AC7: 0x5862,
0x9AC8: 0x584B,
0x9AC9: 0x5870,
0x9ACA: 0x6BC0,
0x9ACB: 0x5852,
0x9ACC: 0x583D,
0x9ACD: 0x5879,
0x9ACE: 0x5885,
0x9ACF: 0x58B9,
0x9AD0: 0x589F,
0x9AD1: 0x58AB,
0x9AD2: 0x58BA,
0x9AD3: 0x58DE,
0x9AD4: 0x58BB,
0x9AD5: 0x58B8,
0x9AD6: 0x58AE,
0x9AD7: 0x58C5,
0x9AD8: 0x58D3,
0x9AD9: 0x58D1,
0x9ADA: 0x58D7,
0x9ADB: 0x58D9,
0x9ADC: 0x58D8,
0x9ADD: 0x58E5,
0x9ADE: 0x58DC,
0x9ADF: 0x58E4,
0x9AE0: 0x58DF,
0x9AE1: 0x58EF,
0x9AE2: 0x58FA,
0x9AE3: 0x58F9,
0x9AE4: 0x58FB,
0x9AE5: 0x58FC,
0x9AE6: 0x58FD,
0x9AE7: 0x5902,
0x9AE8: 0x590A,
0x9AE9: 0x5910,
0x9AEA: 0x591B,
0x9AEB: 0x68A6,
0x9AEC: 0x5925,
0x9AED: 0x592C,
0x9AEE: 0x592D,
0x9AEF: 0x5932,
0x9AF0: 0x5938,
0x9AF1: 0x593E,
0x9AF2: 0x7AD2,
0x9AF3: 0x5955,
0x9AF4: 0x5950,
0x9AF5: 0x594E,
0x9AF6: 0x595A,
0x9AF7: 0x5958,
0x9AF8: 0x5962,
0x9AF9: 0x5960,
0x9AFA: 0x5967,
0x9AFB: 0x596C,
0x9AFC: 0x5969,
0x9B40: 0x5978,
0x9B41: 0x5981,
0x9B42: 0x599D,
0x9B43: 0x4F5E,
0x9B44: 0x4FAB,
0x9B45: 0x59A3,
0x9B46: 0x59B2,
0x9B47: 0x59C6,
0x9B48: 0x59E8,
0x9B49: 0x59DC,
0x9B4A: 0x598D,
0x9B4B: 0x59D9,
0x9B4C: 0x59DA,
0x9B4D: 0x5A25,
0x9B4E: 0x5A1F,
0x9B4F: 0x5A11,
0x9B50: 0x5A1C,
0x9B51: 0x5A09,
0x9B52: 0x5A1A,
0x9B53: 0x5A40,
0x9B54: 0x5A6C,
0x9B55: 0x5A49,
0x9B56: 0x5A35,
0x9B57: 0x5A36,
0x9B58: 0x5A62,
0x9B59: 0x5A6A,
0x9B5A: 0x5A9A,
0x9B5B: 0x5ABC,
0x9B5C: 0x5ABE,
0x9B5D: 0x5ACB,
0x9B5E: 0x5AC2,
0x9B5F: 0x5ABD,
0x9B60: 0x5AE3,
0x9B61: 0x5AD7,
0x9B62: 0x5AE6,
0x9B63: 0x5AE9,
0x9B64: 0x5AD6,
0x9B65: 0x5AFA,
0x9B66: 0x5AFB,
0x9B67: 0x5B0C,
0x9B68: 0x5B0B,
0x9B69: 0x5B16,
0x9B6A: 0x5B32,
0x9B6B: 0x5AD0,
0x9B6C: 0x5B2A,
0x9B6D: 0x5B36,
0x9B6E: 0x5B3E,
0x9B6F: 0x5B43,
0x9B70: 0x5B45,
0x9B71: 0x5B40,
0x9B72: 0x5B51,
0x9B73: 0x5B55,
0x9B74: 0x5B5A,
0x9B75: 0x5B5B,
0x9B76: 0x5B65,
0x9B77: 0x5B69,
0x9B78: 0x5B70,
0x9B79: 0x5B73,
0x9B7A: 0x5B75,
0x9B7B: 0x5B78,
0x9B7C: 0x6588,
0x9B7D: 0x5B7A,
0x9B7E: 0x5B80,
0x9B80: 0x5B83,
0x9B81: 0x5BA6,
0x9B82: 0x5BB8,
0x9B83: 0x5BC3,
0x9B84: 0x5BC7,
0x9B85: 0x5BC9,
0x9B86: 0x5BD4,
0x9B87: 0x5BD0,
0x9B88: 0x5BE4,
0x9B89: 0x5BE6,
0x9B8A: 0x5BE2,
0x9B8B: 0x5BDE,
0x9B8C: 0x5BE5,
0x9B8D: 0x5BEB,
0x9B8E: 0x5BF0,
0x9B8F: 0x5BF6,
0x9B90: 0x5BF3,
0x9B91: 0x5C05,
0x9B92: 0x5C07,
0x9B93: 0x5C08,
0x9B94: 0x5C0D,
0x9B95: 0x5C13,
0x9B96: 0x5C20,
0x9B97: 0x5C22,
0x9B98: 0x5C28,
0x9B99: 0x5C38,
0x9B9A: 0x5C39,
0x9B9B: 0x5C41,
0x9B9C: 0x5C46,
0x9B9D: 0x5C4E,
0x9B9E: 0x5C53,
0x9B9F: 0x5C50,
0x9BA0: 0x5C4F,
0x9BA1: 0x5B71,
0x9BA2: 0x5C6C,
0x9BA3: 0x5C6E,
0x9BA4: 0x4E62,
0x9BA5: 0x5C76,
0x9BA6: 0x5C79,
0x9BA7: 0x5C8C,
0x9BA8: 0x5C91,
0x9BA9: 0x5C94,
0x9BAA: 0x599B,
0x9BAB: 0x5CAB,
0x9BAC: 0x5CBB,
0x9BAD: 0x5CB6,
0x9BAE: 0x5CBC,
0x9BAF: 0x5CB7,
0x9BB0: 0x5CC5,
0x9BB1: 0x5CBE,
0x9BB2: 0x5CC7,
0x9BB3: 0x5CD9,
0x9BB4: 0x5CE9,
0x9BB5: 0x5CFD,
0x9BB6: 0x5CFA,
0x9BB7: 0x5CED,
0x9BB8: 0x5D8C,
0x9BB9: 0x5CEA,
0x9BBA: 0x5D0B,
0x9BBB: 0x5D15,
0x9BBC: 0x5D17,
0x9BBD: 0x5D5C,
0x9BBE: 0x5D1F,
0x9BBF: 0x5D1B,
0x9BC0: 0x5D11,
0x9BC1: 0x5D14,
0x9BC2: 0x5D22,
0x9BC3: 0x5D1A,
0x9BC4: 0x5D19,
0x9BC5: 0x5D18,
0x9BC6: 0x5D4C,
0x9BC7: 0x5D52,
0x9BC8: 0x5D4E,
0x9BC9: 0x5D4B,
0x9BCA: 0x5D6C,
0x9BCB: 0x5D73,
0x9BCC: 0x5D76,
0x9BCD: 0x5D87,
0x9BCE: 0x5D84,
0x9BCF: 0x5D82,
0x9BD0: 0x5DA2,
0x9BD1: 0x5D9D,
0x9BD2: 0x5DAC,
0x9BD3: 0x5DAE,
0x9BD4: 0x5DBD,
0x9BD5: 0x5D90,
0x9BD6: 0x5DB7,
0x9BD7: 0x5DBC,
0x9BD8: 0x5DC9,
0x9BD9: 0x5DCD,
0x9BDA: 0x5DD3,
0x9BDB: 0x5DD2,
0x9BDC: 0x5DD6,
0x9BDD: 0x5DDB,
0x9BDE: 0x5DEB,
0x9BDF: 0x5DF2,
0x9BE0: 0x5DF5,
0x9BE1: 0x5E0B,
0x9BE2: 0x5E1A,
0x9BE3: 0x5E19,
0x9BE4: 0x5E11,
0x9BE5: 0x5E1B,
0x9BE6: 0x5E36,
0x9BE7: 0x5E37,
0x9BE8: 0x5E44,
0x9BE9: 0x5E43,
0x9BEA: 0x5E40,
0x9BEB: 0x5E4E,
0x9BEC: 0x5E57,
0x9BED: 0x5E54,
0x9BEE: 0x5E5F,
0x9BEF: 0x5E62,
0x9BF0: 0x5E64,
0x9BF1: 0x5E47,
0x9BF2: 0x5E75,
0x9BF3: 0x5E76,
0x9BF4: 0x5E7A,
0x9BF5: 0x9EBC,
0x9BF6: 0x5E7F,
0x9BF7: 0x5EA0,
0x9BF8: 0x5EC1,
0x9BF9: 0x5EC2,
0x9BFA: 0x5EC8,
0x9BFB: 0x5ED0,
0x9BFC: 0x5ECF,
0x9C40: 0x5ED6,
0x9C41: 0x5EE3,
0x9C42: 0x5EDD,
0x9C43: 0x5EDA,
0x9C44: 0x5EDB,
0x9C45: 0x5EE2,
0x9C46: 0x5EE1,
0x9C47: 0x5EE8,
0x9C48: 0x5EE9,
0x9C49: 0x5EEC,
0x9C4A: 0x5EF1,
0x9C4B: 0x5EF3,
0x9C4C: 0x5EF0,
0x9C4D: 0x5EF4,
0x9C4E: 0x5EF8,
0x9C4F: 0x5EFE,
0x9C50: 0x5F03,
0x9C51: 0x5F09,
0x9C52: 0x5F5D,
0x9C53: 0x5F5C,
0x9C54: 0x5F0B,
0x9C55: 0x5F11,
0x9C56: 0x5F16,
0x9C57: 0x5F29,
0x9C58: 0x5F2D,
0x9C59: 0x5F38,
0x9C5A: 0x5F41,
0x9C5B: 0x5F48,
0x9C5C: 0x5F4C,
0x9C5D: 0x5F4E,
0x9C5E: 0x5F2F,
0x9C5F: 0x5F51,
0x9C60: 0x5F56,
0x9C61: 0x5F57,
0x9C62: 0x5F59,
0x9C63: 0x5F61,
0x9C64: 0x5F6D,
0x9C65: 0x5F73,
0x9C66: 0x5F77,
0x9C67: 0x5F83,
0x9C68: 0x5F82,
0x9C69: 0x5F7F,
0x9C6A: 0x5F8A,
0x9C6B: 0x5F88,
0x9C6C: 0x5F91,
0x9C6D: 0x5F87,
0x9C6E: 0x5F9E,
0x9C6F: 0x5F99,
0x9C70: 0x5F98,
0x9C71: 0x5FA0,
0x9C72: 0x5FA8,
0x9C73: 0x5FAD,
0x9C74: 0x5FBC,
0x9C75: 0x5FD6,
0x9C76: 0x5FFB,
0x9C77: 0x5FE4,
0x9C78: 0x5FF8,
0x9C79: 0x5FF1,
0x9C7A: 0x5FDD,
0x9C7B: 0x60B3,
0x9C7C: 0x5FFF,
0x9C7D: 0x6021,
0x9C7E: 0x6060,
0x9C80: 0x6019,
0x9C81: 0x6010,
0x9C82: 0x6029,
0x9C83: 0x600E,
0x9C84: 0x6031,
0x9C85: 0x601B,
0x9C86: 0x6015,
0x9C87: 0x602B,
0x9C88: 0x6026,
0x9C89: 0x600F,
0x9C8A: 0x603A,
0x9C8B: 0x605A,
0x9C8C: 0x6041,
0x9C8D: 0x606A,
0x9C8E: 0x6077,
0x9C8F: 0x605F,
0x9C90: 0x604A,
0x9C91: 0x6046,
0x9C92: 0x604D,
0x9C93: 0x6063,
0x9C94: 0x6043,
0x9C95: 0x6064,
0x9C96: 0x6042,
0x9C97: 0x606C,
0x9C98: 0x606B,
0x9C99: 0x6059,
0x9C9A: 0x6081,
0x9C9B: 0x608D,
0x9C9C: 0x60E7,
0x9C9D: 0x6083,
0x9C9E: 0x609A,
0x9C9F: 0x6084,
0x9CA0: 0x609B,
0x9CA1: 0x6096,
0x9CA2: 0x6097,
0x9CA3: 0x6092,
0x9CA4: 0x60A7,
0x9CA5: 0x608B,
0x9CA6: 0x60E1,
0x9CA7: 0x60B8,
0x9CA8: 0x60E0,
0x9CA9: 0x60D3,
0x9CAA: 0x60B4,
0x9CAB: 0x5FF0,
0x9CAC: 0x60BD,
0x9CAD: 0x60C6,
0x9CAE: 0x60B5,
0x9CAF: 0x60D8,
0x9CB0: 0x614D,
0x9CB1: 0x6115,
0x9CB2: 0x6106,
0x9CB3: 0x60F6,
0x9CB4: 0x60F7,
0x9CB5: 0x6100,
0x9CB6: 0x60F4,
0x9CB7: 0x60FA,
0x9CB8: 0x6103,
0x9CB9: 0x6121,
0x9CBA: 0x60FB,
0x9CBB: 0x60F1,
0x9CBC: 0x610D,
0x9CBD: 0x610E,
0x9CBE: 0x6147,
0x9CBF: 0x613E,
0x9CC0: 0x6128,
0x9CC1: 0x6127,
0x9CC2: 0x614A,
0x9CC3: 0x613F,
0x9CC4: 0x613C,
0x9CC5: 0x612C,
0x9CC6: 0x6134,
0x9CC7: 0x613D,
0x9CC8: 0x6142,
0x9CC9: 0x6144,
0x9CCA: 0x6173,
0x9CCB: 0x6177,
0x9CCC: 0x6158,
0x9CCD: 0x6159,
0x9CCE: 0x615A,
0x9CCF: 0x616B,
0x9CD0: 0x6174,
0x9CD1: 0x616F,
0x9CD2: 0x6165,
0x9CD3: 0x6171,
0x9CD4: 0x615F,
0x9CD5: 0x615D,
0x9CD6: 0x6153,
0x9CD7: 0x6175,
0x9CD8: 0x6199,
0x9CD9: 0x6196,
0x9CDA: 0x6187,
0x9CDB: 0x61AC,
0x9CDC: 0x6194,
0x9CDD: 0x619A,
0x9CDE: 0x618A,
0x9CDF: 0x6191,
0x9CE0: 0x61AB,
0x9CE1: 0x61AE,
0x9CE2: 0x61CC,
0x9CE3: 0x61CA,
0x9CE4: 0x61C9,
0x9CE5: 0x61F7,
0x9CE6: 0x61C8,
0x9CE7: 0x61C3,
0x9CE8: 0x61C6,
0x9CE9: 0x61BA,
0x9CEA: 0x61CB,
0x9CEB: 0x7F79,
0x9CEC: 0x61CD,
0x9CED: 0x61E6,
0x9CEE: 0x61E3,
0x9CEF: 0x61F6,
0x9CF0: 0x61FA,
0x9CF1: 0x61F4,
0x9CF2: 0x61FF,
0x9CF3: 0x61FD,
0x9CF4: 0x61FC,
0x9CF5: 0x61FE,
0x9CF6: 0x6200,
0x9CF7: 0x6208,
0x9CF8: 0x6209,
0x9CF9: 0x620D,
0x9CFA: 0x620C,
0x9CFB: 0x6214,
0x9CFC: 0x621B,
0x9D40: 0x621E,
0x9D41: 0x6221,
0x9D42: 0x622A,
0x9D43: 0x622E,
0x9D44: 0x6230,
0x9D45: 0x6232,
0x9D46: 0x6233,
0x9D47: 0x6241,
0x9D48: 0x624E,
0x9D49: 0x625E,
0x9D4A: 0x6263,
0x9D4B: 0x625B,
0x9D4C: 0x6260,
0x9D4D: 0x6268,
0x9D4E: 0x627C,
0x9D4F: 0x6282,
0x9D50: 0x6289,
0x9D51: 0x627E,
0x9D52: 0x6292,
0x9D53: 0x6293,
0x9D54: 0x6296,
0x9D55: 0x62D4,
0x9D56: 0x6283,
0x9D57: 0x6294,
0x9D58: 0x62D7,
0x9D59: 0x62D1,
0x9D5A: 0x62BB,
0x9D5B: 0x62CF,
0x9D5C: 0x62FF,
0x9D5D: 0x62C6,
0x9D5E: 0x64D4,
0x9D5F: 0x62C8,
0x9D60: 0x62DC,
0x9D61: 0x62CC,
0x9D62: 0x62CA,
0x9D63: 0x62C2,
0x9D64: 0x62C7,
0x9D65: 0x629B,
0x9D66: 0x62C9,
0x9D67: 0x630C,
0x9D68: 0x62EE,
0x9D69: 0x62F1,
0x9D6A: 0x6327,
0x9D6B: 0x6302,
0x9D6C: 0x6308,
0x9D6D: 0x62EF,
0x9D6E: 0x62F5,
0x9D6F: 0x6350,
0x9D70: 0x633E,
0x9D71: 0x634D,
0x9D72: 0x641C,
0x9D73: 0x634F,
0x9D74: 0x6396,
0x9D75: 0x638E,
0x9D76: 0x6380,
0x9D77: 0x63AB,
0x9D78: 0x6376,
0x9D79: 0x63A3,
0x9D7A: 0x638F,
0x9D7B: 0x6389,
0x9D7C: 0x639F,
0x9D7D: 0x63B5,
0x9D7E: 0x636B,
0x9D80: 0x6369,
0x9D81: 0x63BE,
0x9D82: 0x63E9,
0x9D83: 0x63C0,
0x9D84: 0x63C6,
0x9D85: 0x63E3,
0x9D86: 0x63C9,
0x9D87: 0x63D2,
0x9D88: 0x63F6,
0x9D89: 0x63C4,
0x9D8A: 0x6416,
0x9D8B: 0x6434,
0x9D8C: 0x6406,
0x9D8D: 0x6413,
0x9D8E: 0x6426,
0x9D8F: 0x6436,
0x9D90: 0x651D,
0x9D91: 0x6417,
0x9D92: 0x6428,
0x9D93: 0x640F,
0x9D94: 0x6467,
0x9D95: 0x646F,
0x9D96: 0x6476,
0x9D97: 0x644E,
0x9D98: 0x652A,
0x9D99: 0x6495,
0x9D9A: 0x6493,
0x9D9B: 0x64A5,
0x9D9C: 0x64A9,
0x9D9D: 0x6488,
0x9D9E: 0x64BC,
0x9D9F: 0x64DA,
0x9DA0: 0x64D2,
0x9DA1: 0x64C5,
0x9DA2: 0x64C7,
0x9DA3: 0x64BB,
0x9DA4: 0x64D8,
0x9DA5: 0x64C2,
0x9DA6: 0x64F1,
0x9DA7: 0x64E7,
0x9DA8: 0x8209,
0x9DA9: 0x64E0,
0x9DAA: 0x64E1,
0x9DAB: 0x62AC,
0x9DAC: 0x64E3,
0x9DAD: 0x64EF,
0x9DAE: 0x652C,
0x9DAF: 0x64F6,
0x9DB0: 0x64F4,
0x9DB1: 0x64F2,
0x9DB2: 0x64FA,
0x9DB3: 0x6500,
0x9DB4: 0x64FD,
0x9DB5: 0x6518,
0x9DB6: 0x651C,
0x9DB7: 0x6505,
0x9DB8: 0x6524,
0x9DB9: 0x6523,
0x9DBA: 0x652B,
0x9DBB: 0x6534,
0x9DBC: 0x6535,
0x9DBD: 0x6537,
0x9DBE: 0x6536,
0x9DBF: 0x6538,
0x9DC0: 0x754B,
0x9DC1: 0x6548,
0x9DC2: 0x6556,
0x9DC3: 0x6555,
0x9DC4: 0x654D,
0x9DC5: 0x6558,
0x9DC6: 0x655E,
0x9DC7: 0x655D,
0x9DC8: 0x6572,
0x9DC9: 0x6578,
0x9DCA: 0x6582,
0x9DCB: 0x6583,
0x9DCC: 0x8B8A,
0x9DCD: 0x659B,
0x9DCE: 0x659F,
0x9DCF: 0x65AB,
0x9DD0: 0x65B7,
0x9DD1: 0x65C3,
0x9DD2: 0x65C6,
0x9DD3: 0x65C1,
0x9DD4: 0x65C4,
0x9DD5: 0x65CC,
0x9DD6: 0x65D2,
0x9DD7: 0x65DB,
0x9DD8: 0x65D9,
0x9DD9: 0x65E0,
0x9DDA: 0x65E1,
0x9DDB: 0x65F1,
0x9DDC: 0x6772,
0x9DDD: 0x660A,
0x9DDE: 0x6603,
0x9DDF: 0x65FB,
0x9DE0: 0x6773,
0x9DE1: 0x6635,
0x9DE2: 0x6636,
0x9DE3: 0x6634,
0x9DE4: 0x661C,
0x9DE5: 0x664F,
0x9DE6: 0x6644,
0x9DE7: 0x6649,
0x9DE8: 0x6641,
0x9DE9: 0x665E,
0x9DEA: 0x665D,
0x9DEB: 0x6664,
0x9DEC: 0x6667,
0x9DED: 0x6668,
0x9DEE: 0x665F,
0x9DEF: 0x6662,
0x9DF0: 0x6670,
0x9DF1: 0x6683,
0x9DF2: 0x6688,
0x9DF3: 0x668E,
0x9DF4: 0x6689,
0x9DF5: 0x6684,
0x9DF6: 0x6698,
0x9DF7: 0x669D,
0x9DF8: 0x66C1,
0x9DF9: 0x66B9,
0x9DFA: 0x66C9,
0x9DFB: 0x66BE,
0x9DFC: 0x66BC,
0x9E40: 0x66C4,
0x9E41: 0x66B8,
0x9E42: 0x66D6,
0x9E43: 0x66DA,
0x9E44: 0x66E0,
0x9E45: 0x663F,
0x9E46: 0x66E6,
0x9E47: 0x66E9,
0x9E48: 0x66F0,
0x9E49: 0x66F5,
0x9E4A: 0x66F7,
0x9E4B: 0x670F,
0x9E4C: 0x6716,
0x9E4D: 0x671E,
0x9E4E: 0x6726,
0x9E4F: 0x6727,
0x9E50: 0x9738,
0x9E51: 0x672E,
0x9E52: 0x673F,
0x9E53: 0x6736,
0x9E54: 0x6741,
0x9E55: 0x6738,
0x9E56: 0x6737,
0x9E57: 0x6746,
0x9E58: 0x675E,
0x9E59: 0x6760,
0x9E5A: 0x6759,
0x9E5B: 0x6763,
0x9E5C: 0x6764,
0x9E5D: 0x6789,
0x9E5E: 0x6770,
0x9E5F: 0x67A9,
0x9E60: 0x677C,
0x9E61: 0x676A,
0x9E62: 0x678C,
0x9E63: 0x678B,
0x9E64: 0x67A6,
0x9E65: 0x67A1,
0x9E66: 0x6785,
0x9E67: 0x67B7,
0x9E68: 0x67EF,
0x9E69: 0x67B4,
0x9E6A: 0x67EC,
0x9E6B: 0x67B3,
0x9E6C: 0x67E9,
0x9E6D: 0x67B8,
0x9E6E: 0x67E4,
0x9E6F: 0x67DE,
0x9E70: 0x67DD,
0x9E71: 0x67E2,
0x9E72: 0x67EE,
0x9E73: 0x67B9,
0x9E74: 0x67CE,
0x9E75: 0x67C6,
0x9E76: 0x67E7,
0x9E77: 0x6A9C,
0x9E78: 0x681E,
0x9E79: 0x6846,
0x9E7A: 0x6829,
0x9E7B: 0x6840,
0x9E7C: 0x684D,
0x9E7D: 0x6832,
0x9E7E: 0x684E,
0x9E80: 0x68B3,
0x9E81: 0x682B,
0x9E82: 0x6859,
0x9E83: 0x6863,
0x9E84: 0x6877,
0x9E85: 0x687F,
0x9E86: 0x689F,
0x9E87: 0x688F,
0x9E88: 0x68AD,
0x9E89: 0x6894,
0x9E8A: 0x689D,
0x9E8B: 0x689B,
0x9E8C: 0x6883,
0x9E8D: 0x6AAE,
0x9E8E: 0x68B9,
0x9E8F: 0x6874,
0x9E90: 0x68B5,
0x9E91: 0x68A0,
0x9E92: 0x68BA,
0x9E93: 0x690F,
0x9E94: 0x688D,
0x9E95: 0x687E,
0x9E96: 0x6901,
0x9E97: 0x68CA,
0x9E98: 0x6908,
0x9E99: 0x68D8,
0x9E9A: 0x6922,
0x9E9B: 0x6926,
0x9E9C: 0x68E1,
0x9E9D: 0x690C,
0x9E9E: 0x68CD,
0x9E9F: 0x68D4,
0x9EA0: 0x68E7,
0x9EA1: 0x68D5,
0x9EA2: 0x6936,
0x9EA3: 0x6912,
0x9EA4: 0x6904,
0x9EA5: 0x68D7,
0x9EA6: 0x68E3,
0x9EA7: 0x6925,
0x9EA8: 0x68F9,
0x9EA9: 0x68E0,
0x9EAA: 0x68EF,
0x9EAB: 0x6928,
0x9EAC: 0x692A,
0x9EAD: 0x691A,
0x9EAE: 0x6923,
0x9EAF: 0x6921,
0x9EB0: 0x68C6,
0x9EB1: 0x6979,
0x9EB2: 0x6977,
0x9EB3: 0x695C,
0x9EB4: 0x6978,
0x9EB5: 0x696B,
0x9EB6: 0x6954,
0x9EB7: 0x697E,
0x9EB8: 0x696E,
0x9EB9: 0x6939,
0x9EBA: 0x6974,
0x9EBB: 0x693D,
0x9EBC: 0x6959,
0x9EBD: 0x6930,
0x9EBE: 0x6961,
0x9EBF: 0x695E,
0x9EC0: 0x695D,
0x9EC1: 0x6981,
0x9EC2: 0x696A,
0x9EC3: 0x69B2,
0x9EC4: 0x69AE,
0x9EC5: 0x69D0,
0x9EC6: 0x69BF,
0x9EC7: 0x69C1,
0x9EC8: 0x69D3,
0x9EC9: 0x69BE,
0x9ECA: 0x69CE,
0x9ECB: 0x5BE8,
0x9ECC: 0x69CA,
0x9ECD: 0x69DD,
0x9ECE: 0x69BB,
0x9ECF: 0x69C3,
0x9ED0: 0x69A7,
0x9ED1: 0x6A2E,
0x9ED2: 0x6991,
0x9ED3: 0x69A0,
0x9ED4: 0x699C,
0x9ED5: 0x6995,
0x9ED6: 0x69B4,
0x9ED7: 0x69DE,
0x9ED8: 0x69E8,
0x9ED9: 0x6A02,
0x9EDA: 0x6A1B,
0x9EDB: 0x69FF,
0x9EDC: 0x6B0A,
0x9EDD: 0x69F9,
0x9EDE: 0x69F2,
0x9EDF: 0x69E7,
0x9EE0: 0x6A05,
0x9EE1: 0x69B1,
0x9EE2: 0x6A1E,
0x9EE3: 0x69ED,
0x9EE4: 0x6A14,
0x9EE5: 0x69EB,
0x9EE6: 0x6A0A,
0x9EE7: 0x6A12,
0x9EE8: 0x6AC1,
0x9EE9: 0x6A23,
0x9EEA: 0x6A13,
0x9EEB: 0x6A44,
0x9EEC: 0x6A0C,
0x9EED: 0x6A72,
0x9EEE: 0x6A36,
0x9EEF: 0x6A78,
0x9EF0: 0x6A47,
0x9EF1: 0x6A62,
0x9EF2: 0x6A59,
0x9EF3: 0x6A66,
0x9EF4: 0x6A48,
0x9EF5: 0x6A38,
0x9EF6: 0x6A22,
0x9EF7: 0x6A90,
0x9EF8: 0x6A8D,
0x9EF9: 0x6AA0,
0x9EFA: 0x6A84,
0x9EFB: 0x6AA2,
0x9EFC: 0x6AA3,
0x9F40: 0x6A97,
0x9F41: 0x8617,
0x9F42: 0x6ABB,
0x9F43: 0x6AC3,
0x9F44: 0x6AC2,
0x9F45: 0x6AB8,
0x9F46: 0x6AB3,
0x9F47: 0x6AAC,
0x9F48: 0x6ADE,
0x9F49: 0x6AD1,
0x9F4A: 0x6ADF,
0x9F4B: 0x6AAA,
0x9F4C: 0x6ADA,
0x9F4D: 0x6AEA,
0x9F4E: 0x6AFB,
0x9F4F: 0x6B05,
0x9F50: 0x8616,
0x9F51: 0x6AFA,
0x9F52: 0x6B12,
0x9F53: 0x6B16,
0x9F54: 0x9B31,
0x9F55: 0x6B1F,
0x9F56: 0x6B38,
0x9F57: 0x6B37,
0x9F58: 0x76DC,
0x9F59: 0x6B39,
0x9F5A: 0x98EE,
0x9F5B: 0x6B47,
0x9F5C: 0x6B43,
0x9F5D: 0x6B49,
0x9F5E: 0x6B50,
0x9F5F: 0x6B59,
0x9F60: 0x6B54,
0x9F61: 0x6B5B,
0x9F62: 0x6B5F,
0x9F63: 0x6B61,
0x9F64: 0x6B78,
0x9F65: 0x6B79,
0x9F66: 0x6B7F,
0x9F67: 0x6B80,
0x9F68: 0x6B84,
0x9F69: 0x6B83,
0x9F6A: 0x6B8D,
0x9F6B: 0x6B98,
0x9F6C: 0x6B95,
0x9F6D: 0x6B9E,
0x9F6E: 0x6BA4,
0x9F6F: 0x6BAA,
0x9F70: 0x6BAB,
0x9F71: 0x6BAF,
0x9F72: 0x6BB2,
0x9F73: 0x6BB1,
0x9F74: 0x6BB3,
0x9F75: 0x6BB7,
0x9F76: 0x6BBC,
0x9F77: 0x6BC6,
0x9F78: 0x6BCB,
0x9F79: 0x6BD3,
0x9F7A: 0x6BDF,
0x9F7B: 0x6BEC,
0x9F7C: 0x6BEB,
0x9F7D: 0x6BF3,
0x9F7E: 0x6BEF,
0x9F80: 0x9EBE,
0x9F81: 0x6C08,
0x9F82: 0x6C13,
0x9F83: 0x6C14,
0x9F84: 0x6C1B,
0x9F85: 0x6C24,
0x9F86: 0x6C23,
0x9F87: 0x6C5E,
0x9F88: 0x6C55,
0x9F89: 0x6C62,
0x9F8A: 0x6C6A,
0x9F8B: 0x6C82,
0x9F8C: 0x6C8D,
0x9F8D: 0x6C9A,
0x9F8E: 0x6C81,
0x9F8F: 0x6C9B,
0x9F90: 0x6C7E,
0x9F91: 0x6C68,
0x9F92: 0x6C73,
0x9F93: 0x6C92,
0x9F94: 0x6C90,
0x9F95: 0x6CC4,
0x9F96: 0x6CF1,
0x9F97: 0x6CD3,
0x9F98: 0x6CBD,
0x9F99: 0x6CD7,
0x9F9A: 0x6CC5,
0x9F9B: 0x6CDD,
0x9F9C: 0x6CAE,
0x9F9D: 0x6CB1,
0x9F9E: 0x6CBE,
0x9F9F: 0x6CBA,
0x9FA0: 0x6CDB,
0x9FA1: 0x6CEF,
0x9FA2: 0x6CD9,
0x9FA3: 0x6CEA,
0x9FA4: 0x6D1F,
0x9FA5: 0x884D,
0x9FA6: 0x6D36,
0x9FA7: 0x6D2B,
0x9FA8: 0x6D3D,
0x9FA9: 0x6D38,
0x9FAA: 0x6D19,
0x9FAB: 0x6D35,
0x9FAC: 0x6D33,
0x9FAD: 0x6D12,
0x9FAE: 0x6D0C,
0x9FAF: 0x6D63,
0x9FB0: 0x6D93,
0x9FB1: 0x6D64,
0x9FB2: 0x6D5A,
0x9FB3: 0x6D79,
0x9FB4: 0x6D59,
0x9FB5: 0x6D8E,
0x9FB6: 0x6D95,
0x9FB7: 0x6FE4,
0x9FB8: 0x6D85,
0x9FB9: 0x6DF9,
0x9FBA: 0x6E15,
0x9FBB: 0x6E0A,
0x9FBC: 0x6DB5,
0x9FBD: 0x6DC7,
0x9FBE: 0x6DE6,
0x9FBF: 0x6DB8,
0x9FC0: 0x6DC6,
0x9FC1: 0x6DEC,
0x9FC2: 0x6DDE,
0x9FC3: 0x6DCC,
0x9FC4: 0x6DE8,
0x9FC5: 0x6DD2,
0x9FC6: 0x6DC5,
0x9FC7: 0x6DFA,
0x9FC8: 0x6DD9,
0x9FC9: 0x6DE4,
0x9FCA: 0x6DD5,
0x9FCB: 0x6DEA,
0x9FCC: 0x6DEE,
0x9FCD: 0x6E2D,
0x9FCE: 0x6E6E,
0x9FCF: 0x6E2E,
0x9FD0: 0x6E19,
0x9FD1: 0x6E72,
0x9FD2: 0x6E5F,
0x9FD3: 0x6E3E,
0x9FD4: 0x6E23,
0x9FD5: 0x6E6B,
0x9FD6: 0x6E2B,
0x9FD7: 0x6E76,
0x9FD8: 0x6E4D,
0x9FD9: 0x6E1F,
0x9FDA: 0x6E43,
0x9FDB: 0x6E3A,
0x9FDC: 0x6E4E,
0x9FDD: 0x6E24,
0x9FDE: 0x6EFF,
0x9FDF: 0x6E1D,
0x9FE0: 0x6E38,
0x9FE1: 0x6E82,
0x9FE2: 0x6EAA,
0x9FE3: 0x6E98,
0x9FE4: 0x6EC9,
0x9FE5: 0x6EB7,
0x9FE6: 0x6ED3,
0x9FE7: 0x6EBD,
0x9FE8: 0x6EAF,
0x9FE9: 0x6EC4,
0x9FEA: 0x6EB2,
0x9FEB: 0x6ED4,
0x9FEC: 0x6ED5,
0x9FED: 0x6E8F,
0x9FEE: 0x6EA5,
0x9FEF: 0x6EC2,
0x9FF0: 0x6E9F,
0x9FF1: 0x6F41,
0x9FF2: 0x6F11,
0x9FF3: 0x704C,
0x9FF4: 0x6EEC,
0x9FF5: 0x6EF8,
0x9FF6: 0x6EFE,
0x9FF7: 0x6F3F,
0x9FF8: 0x6EF2,
0x9FF9: 0x6F31,
0x9FFA: 0x6EEF,
0x9FFB: 0x6F32,
0x9FFC: 0x6ECC,
0xA1: 0xFF61,
0xA2: 0xFF62,
0xA3: 0xFF63,
0xA4: 0xFF64,
0xA5: 0xFF65,
0xA6: 0xFF66,
0xA7: 0xFF67,
0xA8: 0xFF68,
0xA9: 0xFF69,
0xAA: 0xFF6A,
0xAB: 0xFF6B,
0xAC: 0xFF6C,
0xAD: 0xFF6D,
0xAE: 0xFF6E,
0xAF: 0xFF6F,
0xB0: 0xFF70,
0xB1: 0xFF71,
0xB2: 0xFF72,
0xB3: 0xFF73,
0xB4: 0xFF74,
0xB5: 0xFF75,
0xB6: 0xFF76,
0xB7: 0xFF77,
0xB8: 0xFF78,
0xB9: 0xFF79,
0xBA: 0xFF7A,
0xBB: 0xFF7B,
0xBC: 0xFF7C,
0xBD: 0xFF7D,
0xBE: 0xFF7E,
0xBF: 0xFF7F,
0xC0: 0xFF80,
0xC1: 0xFF81,
0xC2: 0xFF82,
0xC3: 0xFF83,
0xC4: 0xFF84,
0xC5: 0xFF85,
0xC6: 0xFF86,
0xC7: 0xFF87,
0xC8: 0xFF88,
0xC9: 0xFF89,
0xCA: 0xFF8A,
0xCB: 0xFF8B,
0xCC: 0xFF8C,
0xCD: 0xFF8D,
0xCE: 0xFF8E,
0xCF: 0xFF8F,
0xD0: 0xFF90,
0xD1: 0xFF91,
0xD2: 0xFF92,
0xD3: 0xFF93,
0xD4: 0xFF94,
0xD5: 0xFF95,
0xD6: 0xFF96,
0xD7: 0xFF97,
0xD8: 0xFF98,
0xD9: 0xFF99,
0xDA: 0xFF9A,
0xDB: 0xFF9B,
0xDC: 0xFF9C,
0xDD: 0xFF9D,
0xDE: 0xFF9E,
0xDF: 0xFF9F,
0xE040: 0x6F3E,
0xE041: 0x6F13,
0xE042: 0x6EF7,
0xE043: 0x6F86,
0xE044: 0x6F7A,
0xE045: 0x6F78,
0xE046: 0x6F81,
0xE047: 0x6F80,
0xE048: 0x6F6F,
0xE049: 0x6F5B,
0xE04A: 0x6FF3,
0xE04B: 0x6F6D,
0xE04C: 0x6F82,
0xE04D: 0x6F7C,
0xE04E: 0x6F58,
0xE04F: 0x6F8E,
0xE050: 0x6F91,
0xE051: 0x6FC2,
0xE052: 0x6F66,
0xE053: 0x6FB3,
0xE054: 0x6FA3,
0xE055: 0x6FA1,
0xE056: 0x6FA4,
0xE057: 0x6FB9,
0xE058: 0x6FC6,
0xE059: 0x6FAA,
0xE05A: 0x6FDF,
0xE05B: 0x6FD5,
0xE05C: 0x6FEC,
0xE05D: 0x6FD4,
0xE05E: 0x6FD8,
0xE05F: 0x6FF1,
0xE060: 0x6FEE,
0xE061: 0x6FDB,
0xE062: 0x7009,
0xE063: 0x700B,
0xE064: 0x6FFA,
0xE065: 0x7011,
0xE066: 0x7001,
0xE067: 0x700F,
0xE068: 0x6FFE,
0xE069: 0x701B,
0xE06A: 0x701A,
0xE06B: 0x6F74,
0xE06C: 0x701D,
0xE06D: 0x7018,
0xE06E: 0x701F,
0xE06F: 0x7030,
0xE070: 0x703E,
0xE071: 0x7032,
0xE072: 0x7051,
0xE073: 0x7063,
0xE074: 0x7099,
0xE075: 0x7092,
0xE076: 0x70AF,
0xE077: 0x70F1,
0xE078: 0x70AC,
0xE079: 0x70B8,
0xE07A: 0x70B3,
0xE07B: 0x70AE,
0xE07C: 0x70DF,
0xE07D: 0x70CB,
0xE07E: 0x70DD,
0xE080: 0x70D9,
0xE081: 0x7109,
0xE082: 0x70FD,
0xE083: 0x711C,
0xE084: 0x7119,
0xE085: 0x7165,
0xE086: 0x7155,
0xE087: 0x7188,
0xE088: 0x7166,
0xE089: 0x7162,
0xE08A: 0x714C,
0xE08B: 0x7156,
0xE08C: 0x716C,
0xE08D: 0x718F,
0xE08E: 0x71FB,
0xE08F: 0x7184,
0xE090: 0x7195,
0xE091: 0x71A8,
0xE092: 0x71AC,
0xE093: 0x71D7,
0xE094: 0x71B9,
0xE095: 0x71BE,
0xE096: 0x71D2,
0xE097: 0x71C9,
0xE098: 0x71D4,
0xE099: 0x71CE,
0xE09A: 0x71E0,
0xE09B: 0x71EC,
0xE09C: 0x71E7,
0xE09D: 0x71F5,
0xE09E: 0x71FC,
0xE09F: 0x71F9,
0xE0A0: 0x71FF,
0xE0A1: 0x720D,
0xE0A2: 0x7210,
0xE0A3: 0x721B,
0xE0A4: 0x7228,
0xE0A5: 0x722D,
0xE0A6: 0x722C,
0xE0A7: 0x7230,
0xE0A8: 0x7232,
0xE0A9: 0x723B,
0xE0AA: 0x723C,
0xE0AB: 0x723F,
0xE0AC: 0x7240,
0xE0AD: 0x7246,
0xE0AE: 0x724B,
0xE0AF: 0x7258,
0xE0B0: 0x7274,
0xE0B1: 0x727E,
0xE0B2: 0x7282,
0xE0B3: 0x7281,
0xE0B4: 0x7287,
0xE0B5: 0x7292,
0xE0B6: 0x7296,
0xE0B7: 0x72A2,
0xE0B8: 0x72A7,
0xE0B9: 0x72B9,
0xE0BA: 0x72B2,
0xE0BB: 0x72C3,
0xE0BC: 0x72C6,
0xE0BD: 0x72C4,
0xE0BE: 0x72CE,
0xE0BF: 0x72D2,
0xE0C0: 0x72E2,
0xE0C1: 0x72E0,
0xE0C2: 0x72E1,
0xE0C3: 0x72F9,
0xE0C4: 0x72F7,
0xE0C5: 0x500F,
0xE0C6: 0x7317,
0xE0C7: 0x730A,
0xE0C8: 0x731C,
0xE0C9: 0x7316,
0xE0CA: 0x731D,
0xE0CB: 0x7334,
0xE0CC: 0x732F,
0xE0CD: 0x7329,
0xE0CE: 0x7325,
0xE0CF: 0x733E,
0xE0D0: 0x734E,
0xE0D1: 0x734F,
0xE0D2: 0x9ED8,
0xE0D3: 0x7357,
0xE0D4: 0x736A,
0xE0D5: 0x7368,
0xE0D6: 0x7370,
0xE0D7: 0x7378,
0xE0D8: 0x7375,
0xE0D9: 0x737B,
0xE0DA: 0x737A,
0xE0DB: 0x73C8,
0xE0DC: 0x73B3,
0xE0DD: 0x73CE,
0xE0DE: 0x73BB,
0xE0DF: 0x73C0,
0xE0E0: 0x73E5,
0xE0E1: 0x73EE,
0xE0E2: 0x73DE,
0xE0E3: 0x74A2,
0xE0E4: 0x7405,
0xE0E5: 0x746F,
0xE0E6: 0x7425,
0xE0E7: 0x73F8,
0xE0E8: 0x7432,
0xE0E9: 0x743A,
0xE0EA: 0x7455,
0xE0EB: 0x743F,
0xE0EC: 0x745F,
0xE0ED: 0x7459,
0xE0EE: 0x7441,
0xE0EF: 0x745C,
0xE0F0: 0x7469,
0xE0F1: 0x7470,
0xE0F2: 0x7463,
0xE0F3: 0x746A,
0xE0F4: 0x7476,
0xE0F5: 0x747E,
0xE0F6: 0x748B,
0xE0F7: 0x749E,
0xE0F8: 0x74A7,
0xE0F9: 0x74CA,
0xE0FA: 0x74CF,
0xE0FB: 0x74D4,
0xE0FC: 0x73F1,
0xE140: 0x74E0,
0xE141: 0x74E3,
0xE142: 0x74E7,
0xE143: 0x74E9,
0xE144: 0x74EE,
0xE145: 0x74F2,
0xE146: 0x74F0,
0xE147: 0x74F1,
0xE148: 0x74F8,
0xE149: 0x74F7,
0xE14A: 0x7504,
0xE14B: 0x7503,
0xE14C: 0x7505,
0xE14D: 0x750C,
0xE14E: 0x750E,
0xE14F: 0x750D,
0xE150: 0x7515,
0xE151: 0x7513,
0xE152: 0x751E,
0xE153: 0x7526,
0xE154: 0x752C,
0xE155: 0x753C,
0xE156: 0x7544,
0xE157: 0x754D,
0xE158: 0x754A,
0xE159: 0x7549,
0xE15A: 0x755B,
0xE15B: 0x7546,
0xE15C: 0x755A,
0xE15D: 0x7569,
0xE15E: 0x7564,
0xE15F: 0x7567,
0xE160: 0x756B,
0xE161: 0x756D,
0xE162: 0x7578,
0xE163: 0x7576,
0xE164: 0x7586,
0xE165: 0x7587,
0xE166: 0x7574,
0xE167: 0x758A,
0xE168: 0x7589,
0xE169: 0x7582,
0xE16A: 0x7594,
0xE16B: 0x759A,
0xE16C: 0x759D,
0xE16D: 0x75A5,
0xE16E: 0x75A3,
0xE16F: 0x75C2,
0xE170: 0x75B3,
0xE171: 0x75C3,
0xE172: 0x75B5,
0xE173: 0x75BD,
0xE174: 0x75B8,
0xE175: 0x75BC,
0xE176: 0x75B1,
0xE177: 0x75CD,
0xE178: 0x75CA,
0xE179: 0x75D2,
0xE17A: 0x75D9,
0xE17B: 0x75E3,
0xE17C: 0x75DE,
0xE17D: 0x75FE,
0xE17E: 0x75FF,
0xE180: 0x75FC,
0xE181: 0x7601,
0xE182: 0x75F0,
0xE183: 0x75FA,
0xE184: 0x75F2,
0xE185: 0x75F3,
0xE186: 0x760B,
0xE187: 0x760D,
0xE188: 0x7609,
0xE189: 0x761F,
0xE18A: 0x7627,
0xE18B: 0x7620,
0xE18C: 0x7621,
0xE18D: 0x7622,
0xE18E: 0x7624,
0xE18F: 0x7634,
0xE190: 0x7630,
0xE191: 0x763B,
0xE192: 0x7647,
0xE193: 0x7648,
0xE194: 0x7646,
0xE195: 0x765C,
0xE196: 0x7658,
0xE197: 0x7661,
0xE198: 0x7662,
0xE199: 0x7668,
0xE19A: 0x7669,
0xE19B: 0x766A,
0xE19C: 0x7667,
0xE19D: 0x766C,
0xE19E: 0x7670,
0xE19F: 0x7672,
0xE1A0: 0x7676,
0xE1A1: 0x7678,
0xE1A2: 0x767C,
0xE1A3: 0x7680,
0xE1A4: 0x7683,
0xE1A5: 0x7688,
0xE1A6: 0x768B,
0xE1A7: 0x768E,
0xE1A8: 0x7696,
0xE1A9: 0x7693,
0xE1AA: 0x7699,
0xE1AB: 0x769A,
0xE1AC: 0x76B0,
0xE1AD: 0x76B4,
0xE1AE: 0x76B8,
0xE1AF: 0x76B9,
0xE1B0: 0x76BA,
0xE1B1: 0x76C2,
0xE1B2: 0x76CD,
0xE1B3: 0x76D6,
0xE1B4: 0x76D2,
0xE1B5: 0x76DE,
0xE1B6: 0x76E1,
0xE1B7: 0x76E5,
0xE1B8: 0x76E7,
0xE1B9: 0x76EA,
0xE1BA: 0x862F,
0xE1BB: 0x76FB,
0xE1BC: 0x7708,
0xE1BD: 0x7707,
0xE1BE: 0x7704,
0xE1BF: 0x7729,
0xE1C0: 0x7724,
0xE1C1: 0x771E,
0xE1C2: 0x7725,
0xE1C3: 0x7726,
0xE1C4: 0x771B,
0xE1C5: 0x7737,
0xE1C6: 0x7738,
0xE1C7: 0x7747,
0xE1C8: 0x775A,
0xE1C9: 0x7768,
0xE1CA: 0x776B,
0xE1CB: 0x775B,
0xE1CC: 0x7765,
0xE1CD: 0x777F,
0xE1CE: 0x777E,
0xE1CF: 0x7779,
0xE1D0: 0x778E,
0xE1D1: 0x778B,
0xE1D2: 0x7791,
0xE1D3: 0x77A0,
0xE1D4: 0x779E,
0xE1D5: 0x77B0,
0xE1D6: 0x77B6,
0xE1D7: 0x77B9,
0xE1D8: 0x77BF,
0xE1D9: 0x77BC,
0xE1DA: 0x77BD,
0xE1DB: 0x77BB,
0xE1DC: 0x77C7,
0xE1DD: 0x77CD,
0xE1DE: 0x77D7,
0xE1DF: 0x77DA,
0xE1E0: 0x77DC,
0xE1E1: 0x77E3,
0xE1E2: 0x77EE,
0xE1E3: 0x77FC,
0xE1E4: 0x780C,
0xE1E5: 0x7812,
0xE1E6: 0x7926,
0xE1E7: 0x7820,
0xE1E8: 0x792A,
0xE1E9: 0x7845,
0xE1EA: 0x788E,
0xE1EB: 0x7874,
0xE1EC: 0x7886,
0xE1ED: 0x787C,
0xE1EE: 0x789A,
0xE1EF: 0x788C,
0xE1F0: 0x78A3,
0xE1F1: 0x78B5,
0xE1F2: 0x78AA,
0xE1F3: 0x78AF,
0xE1F4: 0x78D1,
0xE1F5: 0x78C6,
0xE1F6: 0x78CB,
0xE1F7: 0x78D4,
0xE1F8: 0x78BE,
0xE1F9: 0x78BC,
0xE1FA: 0x78C5,
0xE1FB: 0x78CA,
0xE1FC: 0x78EC,
0xE240: 0x78E7,
0xE241: 0x78DA,
0xE242: 0x78FD,
0xE243: 0x78F4,
0xE244: 0x7907,
0xE245: 0x7912,
0xE246: 0x7911,
0xE247: 0x7919,
0xE248: 0x792C,
0xE249: 0x792B,
0xE24A: 0x7940,
0xE24B: 0x7960,
0xE24C: 0x7957,
0xE24D: 0x795F,
0xE24E: 0x795A,
0xE24F: 0x7955,
0xE250: 0x7953,
0xE251: 0x797A,
0xE252: 0x797F,
0xE253: 0x798A,
0xE254: 0x799D,
0xE255: 0x79A7,
0xE256: 0x9F4B,
0xE257: 0x79AA,
0xE258: 0x79AE,
0xE259: 0x79B3,
0xE25A: 0x79B9,
0xE25B: 0x79BA,
0xE25C: 0x79C9,
0xE25D: 0x79D5,
0xE25E: 0x79E7,
0xE25F: 0x79EC,
0xE260: 0x79E1,
0xE261: 0x79E3,
0xE262: 0x7A08,
0xE263: 0x7A0D,
0xE264: 0x7A18,
0xE265: 0x7A19,
0xE266: 0x7A20,
0xE267: 0x7A1F,
0xE268: 0x7980,
0xE269: 0x7A31,
0xE26A: 0x7A3B,
0xE26B: 0x7A3E,
0xE26C: 0x7A37,
0xE26D: 0x7A43,
0xE26E: 0x7A57,
0xE26F: 0x7A49,
0xE270: 0x7A61,
0xE271: 0x7A62,
0xE272: 0x7A69,
0xE273: 0x9F9D,
0xE274: 0x7A70,
0xE275: 0x7A79,
0xE276: 0x7A7D,
0xE277: 0x7A88,
0xE278: 0x7A97,
0xE279: 0x7A95,
0xE27A: 0x7A98,
0xE27B: 0x7A96,
0xE27C: 0x7AA9,
0xE27D: 0x7AC8,
0xE27E: 0x7AB0,
0xE280: 0x7AB6,
0xE281: 0x7AC5,
0xE282: 0x7AC4,
0xE283: 0x7ABF,
0xE284: 0x9083,
0xE285: 0x7AC7,
0xE286: 0x7ACA,
0xE287: 0x7ACD,
0xE288: 0x7ACF,
0xE289: 0x7AD5,
0xE28A: 0x7AD3,
0xE28B: 0x7AD9,
0xE28C: 0x7ADA,
0xE28D: 0x7ADD,
0xE28E: 0x7AE1,
0xE28F: 0x7AE2,
0xE290: 0x7AE6,
0xE291: 0x7AED,
0xE292: 0x7AF0,
0xE293: 0x7B02,
0xE294: 0x7B0F,
0xE295: 0x7B0A,
0xE296: 0x7B06,
0xE297: 0x7B33,
0xE298: 0x7B18,
0xE299: 0x7B19,
0xE29A: 0x7B1E,
0xE29B: 0x7B35,
0xE29C: 0x7B28,
0xE29D: 0x7B36,
0xE29E: 0x7B50,
0xE29F: 0x7B7A,
0xE2A0: 0x7B04,
0xE2A1: 0x7B4D,
0xE2A2: 0x7B0B,
0xE2A3: 0x7B4C,
0xE2A4: 0x7B45,
0xE2A5: 0x7B75,
0xE2A6: 0x7B65,
0xE2A7: 0x7B74,
0xE2A8: 0x7B67,
0xE2A9: 0x7B70,
0xE2AA: 0x7B71,
0xE2AB: 0x7B6C,
0xE2AC: 0x7B6E,
0xE2AD: 0x7B9D,
0xE2AE: 0x7B98,
0xE2AF: 0x7B9F,
0xE2B0: 0x7B8D,
0xE2B1: 0x7B9C,
0xE2B2: 0x7B9A,
0xE2B3: 0x7B8B,
0xE2B4: 0x7B92,
0xE2B5: 0x7B8F,
0xE2B6: 0x7B5D,
0xE2B7: 0x7B99,
0xE2B8: 0x7BCB,
0xE2B9: 0x7BC1,
0xE2BA: 0x7BCC,
0xE2BB: 0x7BCF,
0xE2BC: 0x7BB4,
0xE2BD: 0x7BC6,
0xE2BE: 0x7BDD,
0xE2BF: 0x7BE9,
0xE2C0: 0x7C11,
0xE2C1: 0x7C14,
0xE2C2: 0x7BE6,
0xE2C3: 0x7BE5,
0xE2C4: 0x7C60,
0xE2C5: 0x7C00,
0xE2C6: 0x7C07,
0xE2C7: 0x7C13,
0xE2C8: 0x7BF3,
0xE2C9: 0x7BF7,
0xE2CA: 0x7C17,
0xE2CB: 0x7C0D,
0xE2CC: 0x7BF6,
0xE2CD: 0x7C23,
0xE2CE: 0x7C27,
0xE2CF: 0x7C2A,
0xE2D0: 0x7C1F,
0xE2D1: 0x7C37,
0xE2D2: 0x7C2B,
0xE2D3: 0x7C3D,
0xE2D4: 0x7C4C,
0xE2D5: 0x7C43,
0xE2D6: 0x7C54,
0xE2D7: 0x7C4F,
0xE2D8: 0x7C40,
0xE2D9: 0x7C50,
0xE2DA: 0x7C58,
0xE2DB: 0x7C5F,
0xE2DC: 0x7C64,
0xE2DD: 0x7C56,
0xE2DE: 0x7C65,
0xE2DF: 0x7C6C,
0xE2E0: 0x7C75,
0xE2E1: 0x7C83,
0xE2E2: 0x7C90,
0xE2E3: 0x7CA4,
0xE2E4: 0x7CAD,
0xE2E5: 0x7CA2,
0xE2E6: 0x7CAB,
0xE2E7: 0x7CA1,
0xE2E8: 0x7CA8,
0xE2E9: 0x7CB3,
0xE2EA: 0x7CB2,
0xE2EB: 0x7CB1,
0xE2EC: 0x7CAE,
0xE2ED: 0x7CB9,
0xE2EE: 0x7CBD,
0xE2EF: 0x7CC0,
0xE2F0: 0x7CC5,
0xE2F1: 0x7CC2,
0xE2F2: 0x7CD8,
0xE2F3: 0x7CD2,
0xE2F4: 0x7CDC,
0xE2F5: 0x7CE2,
0xE2F6: 0x9B3B,
0xE2F7: 0x7CEF,
0xE2F8: 0x7CF2,
0xE2F9: 0x7CF4,
0xE2FA: 0x7CF6,
0xE2FB: 0x7CFA,
0xE2FC: 0x7D06,
0xE340: 0x7D02,
0xE341: 0x7D1C,
0xE342: 0x7D15,
0xE343: 0x7D0A,
0xE344: 0x7D45,
0xE345: 0x7D4B,
0xE346: 0x7D2E,
0xE347: 0x7D32,
0xE348: 0x7D3F,
0xE349: 0x7D35,
0xE34A: 0x7D46,
0xE34B: 0x7D73,
0xE34C: 0x7D56,
0xE34D: 0x7D4E,
0xE34E: 0x7D72,
0xE34F: 0x7D68,
0xE350: 0x7D6E,
0xE351: 0x7D4F,
0xE352: 0x7D63,
0xE353: 0x7D93,
0xE354: 0x7D89,
0xE355: 0x7D5B,
0xE356: 0x7D8F,
0xE357: 0x7D7D,
0xE358: 0x7D9B,
0xE359: 0x7DBA,
0xE35A: 0x7DAE,
0xE35B: 0x7DA3,
0xE35C: 0x7DB5,
0xE35D: 0x7DC7,
0xE35E: 0x7DBD,
0xE35F: 0x7DAB,
0xE360: 0x7E3D,
0xE361: 0x7DA2,
0xE362: 0x7DAF,
0xE363: 0x7DDC,
0xE364: 0x7DB8,
0xE365: 0x7D9F,
0xE366: 0x7DB0,
0xE367: 0x7DD8,
0xE368: 0x7DDD,
0xE369: 0x7DE4,
0xE36A: 0x7DDE,
0xE36B: 0x7DFB,
0xE36C: 0x7DF2,
0xE36D: 0x7DE1,
0xE36E: 0x7E05,
0xE36F: 0x7E0A,
0xE370: 0x7E23,
0xE371: 0x7E21,
0xE372: 0x7E12,
0xE373: 0x7E31,
0xE374: 0x7E1F,
0xE375: 0x7E09,
0xE376: 0x7E0B,
0xE377: 0x7E22,
0xE378: 0x7E46,
0xE379: 0x7E66,
0xE37A: 0x7E3B,
0xE37B: 0x7E35,
0xE37C: 0x7E39,
0xE37D: 0x7E43,
0xE37E: 0x7E37,
0xE380: 0x7E32,
0xE381: 0x7E3A,
0xE382: 0x7E67,
0xE383: 0x7E5D,
0xE384: 0x7E56,
0xE385: 0x7E5E,
0xE386: 0x7E59,
0xE387: 0x7E5A,
0xE388: 0x7E79,
0xE389: 0x7E6A,
0xE38A: 0x7E69,
0xE38B: 0x7E7C,
0xE38C: 0x7E7B,
0xE38D: 0x7E83,
0xE38E: 0x7DD5,
0xE38F: 0x7E7D,
0xE390: 0x8FAE,
0xE391: 0x7E7F,
0xE392: 0x7E88,
0xE393: 0x7E89,
0xE394: 0x7E8C,
0xE395: 0x7E92,
0xE396: 0x7E90,
0xE397: 0x7E93,
0xE398: 0x7E94,
0xE399: 0x7E96,
0xE39A: 0x7E8E,
0xE39B: 0x7E9B,
0xE39C: 0x7E9C,
0xE39D: 0x7F38,
0xE39E: 0x7F3A,
0xE39F: 0x7F45,
0xE3A0: 0x7F4C,
0xE3A1: 0x7F4D,
0xE3A2: 0x7F4E,
0xE3A3: 0x7F50,
0xE3A4: 0x7F51,
0xE3A5: 0x7F55,
0xE3A6: 0x7F54,
0xE3A7: 0x7F58,
0xE3A8: 0x7F5F,
0xE3A9: 0x7F60,
0xE3AA: 0x7F68,
0xE3AB: 0x7F69,
0xE3AC: 0x7F67,
0xE3AD: 0x7F78,
0xE3AE: 0x7F82,
0xE3AF: 0x7F86,
0xE3B0: 0x7F83,
0xE3B1: 0x7F88,
0xE3B2: 0x7F87,
0xE3B3: 0x7F8C,
0xE3B4: 0x7F94,
0xE3B5: 0x7F9E,
0xE3B6: 0x7F9D,
0xE3B7: 0x7F9A,
0xE3B8: 0x7FA3,
0xE3B9: 0x7FAF,
0xE3BA: 0x7FB2,
0xE3BB: 0x7FB9,
0xE3BC: 0x7FAE,
0xE3BD: 0x7FB6,
0xE3BE: 0x7FB8,
0xE3BF: 0x8B71,
0xE3C0: 0x7FC5,
0xE3C1: 0x7FC6,
0xE3C2: 0x7FCA,
0xE3C3: 0x7FD5,
0xE3C4: 0x7FD4,
0xE3C5: 0x7FE1,
0xE3C6: 0x7FE6,
0xE3C7: 0x7FE9,
0xE3C8: 0x7FF3,
0xE3C9: 0x7FF9,
0xE3CA: 0x98DC,
0xE3CB: 0x8006,
0xE3CC: 0x8004,
0xE3CD: 0x800B,
0xE3CE: 0x8012,
0xE3CF: 0x8018,
0xE3D0: 0x8019,
0xE3D1: 0x801C,
0xE3D2: 0x8021,
0xE3D3: 0x8028,
0xE3D4: 0x803F,
0xE3D5: 0x803B,
0xE3D6: 0x804A,
0xE3D7: 0x8046,
0xE3D8: 0x8052,
0xE3D9: 0x8058,
0xE3DA: 0x805A,
0xE3DB: 0x805F,
0xE3DC: 0x8062,
0xE3DD: 0x8068,
0xE3DE: 0x8073,
0xE3DF: 0x8072,
0xE3E0: 0x8070,
0xE3E1: 0x8076,
0xE3E2: 0x8079,
0xE3E3: 0x807D,
0xE3E4: 0x807F,
0xE3E5: 0x8084,
0xE3E6: 0x8086,
0xE3E7: 0x8085,
0xE3E8: 0x809B,
0xE3E9: 0x8093,
0xE3EA: 0x809A,
0xE3EB: 0x80AD,
0xE3EC: 0x5190,
0xE3ED: 0x80AC,
0xE3EE: 0x80DB,
0xE3EF: 0x80E5,
0xE3F0: 0x80D9,
0xE3F1: 0x80DD,
0xE3F2: 0x80C4,
0xE3F3: 0x80DA,
0xE3F4: 0x80D6,
0xE3F5: 0x8109,
0xE3F6: 0x80EF,
0xE3F7: 0x80F1,
0xE3F8: 0x811B,
0xE3F9: 0x8129,
0xE3FA: 0x8123,
0xE3FB: 0x812F,
0xE3FC: 0x814B,
0xE440: 0x968B,
0xE441: 0x8146,
0xE442: 0x813E,
0xE443: 0x8153,
0xE444: 0x8151,
0xE445: 0x80FC,
0xE446: 0x8171,
0xE447: 0x816E,
0xE448: 0x8165,
0xE449: 0x8166,
0xE44A: 0x8174,
0xE44B: 0x8183,
0xE44C: 0x8188,
0xE44D: 0x818A,
0xE44E: 0x8180,
0xE44F: 0x8182,
0xE450: 0x81A0,
0xE451: 0x8195,
0xE452: 0x81A4,
0xE453: 0x81A3,
0xE454: 0x815F,
0xE455: 0x8193,
0xE456: 0x81A9,
0xE457: 0x81B0,
0xE458: 0x81B5,
0xE459: 0x81BE,
0xE45A: 0x81B8,
0xE45B: 0x81BD,
0xE45C: 0x81C0,
0xE45D: 0x81C2,
0xE45E: 0x81BA,
0xE45F: 0x81C9,
0xE460: 0x81CD,
0xE461: 0x81D1,
0xE462: 0x81D9,
0xE463: 0x81D8,
0xE464: 0x81C8,
0xE465: 0x81DA,
0xE466: 0x81DF,
0xE467: 0x81E0,
0xE468: 0x81E7,
0xE469: 0x81FA,
0xE46A: 0x81FB,
0xE46B: 0x81FE,
0xE46C: 0x8201,
0xE46D: 0x8202,
0xE46E: 0x8205,
0xE46F: 0x8207,
0xE470: 0x820A,
0xE471: 0x820D,
0xE472: 0x8210,
0xE473: 0x8216,
0xE474: 0x8229,
0xE475: 0x822B,
0xE476: 0x8238,
0xE477: 0x8233,
0xE478: 0x8240,
0xE479: 0x8259,
0xE47A: 0x8258,
0xE47B: 0x825D,
0xE47C: 0x825A,
0xE47D: 0x825F,
0xE47E: 0x8264,
0xE480: 0x8262,
0xE481: 0x8268,
0xE482: 0x826A,
0xE483: 0x826B,
0xE484: 0x822E,
0xE485: 0x8271,
0xE486: 0x8277,
0xE487: 0x8278,
0xE488: 0x827E,
0xE489: 0x828D,
0xE48A: 0x8292,
0xE48B: 0x82AB,
0xE48C: 0x829F,
0xE48D: 0x82BB,
0xE48E: 0x82AC,
0xE48F: 0x82E1,
0xE490: 0x82E3,
0xE491: 0x82DF,
0xE492: 0x82D2,
0xE493: 0x82F4,
0xE494: 0x82F3,
0xE495: 0x82FA,
0xE496: 0x8393,
0xE497: 0x8303,
0xE498: 0x82FB,
0xE499: 0x82F9,
0xE49A: 0x82DE,
0xE49B: 0x8306,
0xE49C: 0x82DC,
0xE49D: 0x8309,
0xE49E: 0x82D9,
0xE49F: 0x8335,
0xE4A0: 0x8334,
0xE4A1: 0x8316,
0xE4A2: 0x8332,
0xE4A3: 0x8331,
0xE4A4: 0x8340,
0xE4A5: 0x8339,
0xE4A6: 0x8350,
0xE4A7: 0x8345,
0xE4A8: 0x832F,
0xE4A9: 0x832B,
0xE4AA: 0x8317,
0xE4AB: 0x8318,
0xE4AC: 0x8385,
0xE4AD: 0x839A,
0xE4AE: 0x83AA,
0xE4AF: 0x839F,
0xE4B0: 0x83A2,
0xE4B1: 0x8396,
0xE4B2: 0x8323,
0xE4B3: 0x838E,
0xE4B4: 0x8387,
0xE4B5: 0x838A,
0xE4B6: 0x837C,
0xE4B7: 0x83B5,
0xE4B8: 0x8373,
0xE4B9: 0x8375,
0xE4BA: 0x83A0,
0xE4BB: 0x8389,
0xE4BC: 0x83A8,
0xE4BD: 0x83F4,
0xE4BE: 0x8413,
0xE4BF: 0x83EB,
0xE4C0: 0x83CE,
0xE4C1: 0x83FD,
0xE4C2: 0x8403,
0xE4C3: 0x83D8,
0xE4C4: 0x840B,
0xE4C5: 0x83C1,
0xE4C6: 0x83F7,
0xE4C7: 0x8407,
0xE4C8: 0x83E0,
0xE4C9: 0x83F2,
0xE4CA: 0x840D,
0xE4CB: 0x8422,
0xE4CC: 0x8420,
0xE4CD: 0x83BD,
0xE4CE: 0x8438,
0xE4CF: 0x8506,
0xE4D0: 0x83FB,
0xE4D1: 0x846D,
0xE4D2: 0x842A,
0xE4D3: 0x843C,
0xE4D4: 0x855A,
0xE4D5: 0x8484,
0xE4D6: 0x8477,
0xE4D7: 0x846B,
0xE4D8: 0x84AD,
0xE4D9: 0x846E,
0xE4DA: 0x8482,
0xE4DB: 0x8469,
0xE4DC: 0x8446,
0xE4DD: 0x842C,
0xE4DE: 0x846F,
0xE4DF: 0x8479,
0xE4E0: 0x8435,
0xE4E1: 0x84CA,
0xE4E2: 0x8462,
0xE4E3: 0x84B9,
0xE4E4: 0x84BF,
0xE4E5: 0x849F,
0xE4E6: 0x84D9,
0xE4E7: 0x84CD,
0xE4E8: 0x84BB,
0xE4E9: 0x84DA,
0xE4EA: 0x84D0,
0xE4EB: 0x84C1,
0xE4EC: 0x84C6,
0xE4ED: 0x84D6,
0xE4EE: 0x84A1,
0xE4EF: 0x8521,
0xE4F0: 0x84FF,
0xE4F1: 0x84F4,
0xE4F2: 0x8517,
0xE4F3: 0x8518,
0xE4F4: 0x852C,
0xE4F5: 0x851F,
0xE4F6: 0x8515,
0xE4F7: 0x8514,
0xE4F8: 0x84FC,
0xE4F9: 0x8540,
0xE4FA: 0x8563,
0xE4FB: 0x8558,
0xE4FC: 0x8548,
0xE540: 0x8541,
0xE541: 0x8602,
0xE542: 0x854B,
0xE543: 0x8555,
0xE544: 0x8580,
0xE545: 0x85A4,
0xE546: 0x8588,
0xE547: 0x8591,
0xE548: 0x858A,
0xE549: 0x85A8,
0xE54A: 0x856D,
0xE54B: 0x8594,
0xE54C: 0x859B,
0xE54D: 0x85EA,
0xE54E: 0x8587,
0xE54F: 0x859C,
0xE550: 0x8577,
0xE551: 0x857E,
0xE552: 0x8590,
0xE553: 0x85C9,
0xE554: 0x85BA,
0xE555: 0x85CF,
0xE556: 0x85B9,
0xE557: 0x85D0,
0xE558: 0x85D5,
0xE559: 0x85DD,
0xE55A: 0x85E5,
0xE55B: 0x85DC,
0xE55C: 0x85F9,
0xE55D: 0x860A,
0xE55E: 0x8613,
0xE55F: 0x860B,
0xE560: 0x85FE,
0xE561: 0x85FA,
0xE562: 0x8606,
0xE563: 0x8622,
0xE564: 0x861A,
0xE565: 0x8630,
0xE566: 0x863F,
0xE567: 0x864D,
0xE568: 0x4E55,
0xE569: 0x8654,
0xE56A: 0x865F,
0xE56B: 0x8667,
0xE56C: 0x8671,
0xE56D: 0x8693,
0xE56E: 0x86A3,
0xE56F: 0x86A9,
0xE570: 0x86AA,
0xE571: 0x868B,
0xE572: 0x868C,
0xE573: 0x86B6,
0xE574: 0x86AF,
0xE575: 0x86C4,
0xE576: 0x86C6,
0xE577: 0x86B0,
0xE578: 0x86C9,
0xE579: 0x8823,
0xE57A: 0x86AB,
0xE57B: 0x86D4,
0xE57C: 0x86DE,
0xE57D: 0x86E9,
0xE57E: 0x86EC,
0xE580: 0x86DF,
0xE581: 0x86DB,
0xE582: 0x86EF,
0xE583: 0x8712,
0xE584: 0x8706,
0xE585: 0x8708,
0xE586: 0x8700,
0xE587: 0x8703,
0xE588: 0x86FB,
0xE589: 0x8711,
0xE58A: 0x8709,
0xE58B: 0x870D,
0xE58C: 0x86F9,
0xE58D: 0x870A,
0xE58E: 0x8734,
0xE58F: 0x873F,
0xE590: 0x8737,
0xE591: 0x873B,
0xE592: 0x8725,
0xE593: 0x8729,
0xE594: 0x871A,
0xE595: 0x8760,
0xE596: 0x875F,
0xE597: 0x8778,
0xE598: 0x874C,
0xE599: 0x874E,
0xE59A: 0x8774,
0xE59B: 0x8757,
0xE59C: 0x8768,
0xE59D: 0x876E,
0xE59E: 0x8759,
0xE59F: 0x8753,
0xE5A0: 0x8763,
0xE5A1: 0x876A,
0xE5A2: 0x8805,
0xE5A3: 0x87A2,
0xE5A4: 0x879F,
0xE5A5: 0x8782,
0xE5A6: 0x87AF,
0xE5A7: 0x87CB,
0xE5A8: 0x87BD,
0xE5A9: 0x87C0,
0xE5AA: 0x87D0,
0xE5AB: 0x96D6,
0xE5AC: 0x87AB,
0xE5AD: 0x87C4,
0xE5AE: 0x87B3,
0xE5AF: 0x87C7,
0xE5B0: 0x87C6,
0xE5B1: 0x87BB,
0xE5B2: 0x87EF,
0xE5B3: 0x87F2,
0xE5B4: 0x87E0,
0xE5B5: 0x880F,
0xE5B6: 0x880D,
0xE5B7: 0x87FE,
0xE5B8: 0x87F6,
0xE5B9: 0x87F7,
0xE5BA: 0x880E,
0xE5BB: 0x87D2,
0xE5BC: 0x8811,
0xE5BD: 0x8816,
0xE5BE: 0x8815,
0xE5BF: 0x8822,
0xE5C0: 0x8821,
0xE5C1: 0x8831,
0xE5C2: 0x8836,
0xE5C3: 0x8839,
0xE5C4: 0x8827,
0xE5C5: 0x883B,
0xE5C6: 0x8844,
0xE5C7: 0x8842,
0xE5C8: 0x8852,
0xE5C9: 0x8859,
0xE5CA: 0x885E,
0xE5CB: 0x8862,
0xE5CC: 0x886B,
0xE5CD: 0x8881,
0xE5CE: 0x887E,
0xE5CF: 0x889E,
0xE5D0: 0x8875,
0xE5D1: 0x887D,
0xE5D2: 0x88B5,
0xE5D3: 0x8872,
0xE5D4: 0x8882,
0xE5D5: 0x8897,
0xE5D6: 0x8892,
0xE5D7: 0x88AE,
0xE5D8: 0x8899,
0xE5D9: 0x88A2,
0xE5DA: 0x888D,
0xE5DB: 0x88A4,
0xE5DC: 0x88B0,
0xE5DD: 0x88BF,
0xE5DE: 0x88B1,
0xE5DF: 0x88C3,
0xE5E0: 0x88C4,
0xE5E1: 0x88D4,
0xE5E2: 0x88D8,
0xE5E3: 0x88D9,
0xE5E4: 0x88DD,
0xE5E5: 0x88F9,
0xE5E6: 0x8902,
0xE5E7: 0x88FC,
0xE5E8: 0x88F4,
0xE5E9: 0x88E8,
0xE5EA: 0x88F2,
0xE5EB: 0x8904,
0xE5EC: 0x890C,
0xE5ED: 0x890A,
0xE5EE: 0x8913,
0xE5EF: 0x8943,
0xE5F0: 0x891E,
0xE5F1: 0x8925,
0xE5F2: 0x892A,
0xE5F3: 0x892B,
0xE5F4: 0x8941,
0xE5F5: 0x8944,
0xE5F6: 0x893B,
0xE5F7: 0x8936,
0xE5F8: 0x8938,
0xE5F9: 0x894C,
0xE5FA: 0x891D,
0xE5FB: 0x8960,
0xE5FC: 0x895E,
0xE640: 0x8966,
0xE641: 0x8964,
0xE642: 0x896D,
0xE643: 0x896A,
0xE644: 0x896F,
0xE645: 0x8974,
0xE646: 0x8977,
0xE647: 0x897E,
0xE648: 0x8983,
0xE649: 0x8988,
0xE64A: 0x898A,
0xE64B: 0x8993,
0xE64C: 0x8998,
0xE64D: 0x89A1,
0xE64E: 0x89A9,
0xE64F: 0x89A6,
0xE650: 0x89AC,
0xE651: 0x89AF,
0xE652: 0x89B2,
0xE653: 0x89BA,
0xE654: 0x89BD,
0xE655: 0x89BF,
0xE656: 0x89C0,
0xE657: 0x89DA,
0xE658: 0x89DC,
0xE659: 0x89DD,
0xE65A: 0x89E7,
0xE65B: 0x89F4,
0xE65C: 0x89F8,
0xE65D: 0x8A03,
0xE65E: 0x8A16,
0xE65F: 0x8A10,
0xE660: 0x8A0C,
0xE661: 0x8A1B,
0xE662: 0x8A1D,
0xE663: 0x8A25,
0xE664: 0x8A36,
0xE665: 0x8A41,
0xE666: 0x8A5B,
0xE667: 0x8A52,
0xE668: 0x8A46,
0xE669: 0x8A48,
0xE66A: 0x8A7C,
0xE66B: 0x8A6D,
0xE66C: 0x8A6C,
0xE66D: 0x8A62,
0xE66E: 0x8A85,
0xE66F: 0x8A82,
0xE670: 0x8A84,
0xE671: 0x8AA8,
0xE672: 0x8AA1,
0xE673: 0x8A91,
0xE674: 0x8AA5,
0xE675: 0x8AA6,
0xE676: 0x8A9A,
0xE677: 0x8AA3,
0xE678: 0x8AC4,
0xE679: 0x8ACD,
0xE67A: 0x8AC2,
0xE67B: 0x8ADA,
0xE67C: 0x8AEB,
0xE67D: 0x8AF3,
0xE67E: 0x8AE7,
0xE680: 0x8AE4,
0xE681: 0x8AF1,
0xE682: 0x8B14,
0xE683: 0x8AE0,
0xE684: 0x8AE2,
0xE685: 0x8AF7,
0xE686: 0x8ADE,
0xE687: 0x8ADB,
0xE688: 0x8B0C,
0xE689: 0x8B07,
0xE68A: 0x8B1A,
0xE68B: 0x8AE1,
0xE68C: 0x8B16,
0xE68D: 0x8B10,
0xE68E: 0x8B17,
0xE68F: 0x8B20,
0xE690: 0x8B33,
0xE691: 0x97AB,
0xE692: 0x8B26,
0xE693: 0x8B2B,
0xE694: 0x8B3E,
0xE695: 0x8B28,
0xE696: 0x8B41,
0xE697: 0x8B4C,
0xE698: 0x8B4F,
0xE699: 0x8B4E,
0xE69A: 0x8B49,
0xE69B: 0x8B56,
0xE69C: 0x8B5B,
0xE69D: 0x8B5A,
0xE69E: 0x8B6B,
0xE69F: 0x8B5F,
0xE6A0: 0x8B6C,
0xE6A1: 0x8B6F,
0xE6A2: 0x8B74,
0xE6A3: 0x8B7D,
0xE6A4: 0x8B80,
0xE6A5: 0x8B8C,
0xE6A6: 0x8B8E,
0xE6A7: 0x8B92,
0xE6A8: 0x8B93,
0xE6A9: 0x8B96,
0xE6AA: 0x8B99,
0xE6AB: 0x8B9A,
0xE6AC: 0x8C3A,
0xE6AD: 0x8C41,
0xE6AE: 0x8C3F,
0xE6AF: 0x8C48,
0xE6B0: 0x8C4C,
0xE6B1: 0x8C4E,
0xE6B2: 0x8C50,
0xE6B3: 0x8C55,
0xE6B4: 0x8C62,
0xE6B5: 0x8C6C,
0xE6B6: 0x8C78,
0xE6B7: 0x8C7A,
0xE6B8: 0x8C82,
0xE6B9: 0x8C89,
0xE6BA: 0x8C85,
0xE6BB: 0x8C8A,
0xE6BC: 0x8C8D,
0xE6BD: 0x8C8E,
0xE6BE: 0x8C94,
0xE6BF: 0x8C7C,
0xE6C0: 0x8C98,
0xE6C1: 0x621D,
0xE6C2: 0x8CAD,
0xE6C3: 0x8CAA,
0xE6C4: 0x8CBD,
0xE6C5: 0x8CB2,
0xE6C6: 0x8CB3,
0xE6C7: 0x8CAE,
0xE6C8: 0x8CB6,
0xE6C9: 0x8CC8,
0xE6CA: 0x8CC1,
0xE6CB: 0x8CE4,
0xE6CC: 0x8CE3,
0xE6CD: 0x8CDA,
0xE6CE: 0x8CFD,
0xE6CF: 0x8CFA,
0xE6D0: 0x8CFB,
0xE6D1: 0x8D04,
0xE6D2: 0x8D05,
0xE6D3: 0x8D0A,
0xE6D4: 0x8D07,
0xE6D5: 0x8D0F,
0xE6D6: 0x8D0D,
0xE6D7: 0x8D10,
0xE6D8: 0x9F4E,
0xE6D9: 0x8D13,
0xE6DA: 0x8CCD,
0xE6DB: 0x8D14,
0xE6DC: 0x8D16,
0xE6DD: 0x8D67,
0xE6DE: 0x8D6D,
0xE6DF: 0x8D71,
0xE6E0: 0x8D73,
0xE6E1: 0x8D81,
0xE6E2: 0x8D99,
0xE6E3: 0x8DC2,
0xE6E4: 0x8DBE,
0xE6E5: 0x8DBA,
0xE6E6: 0x8DCF,
0xE6E7: 0x8DDA,
0xE6E8: 0x8DD6,
0xE6E9: 0x8DCC,
0xE6EA: 0x8DDB,
0xE6EB: 0x8DCB,
0xE6EC: 0x8DEA,
0xE6ED: 0x8DEB,
0xE6EE: 0x8DDF,
0xE6EF: 0x8DE3,
0xE6F0: 0x8DFC,
0xE6F1: 0x8E08,
0xE6F2: 0x8E09,
0xE6F3: 0x8DFF,
0xE6F4: 0x8E1D,
0xE6F5: 0x8E1E,
0xE6F6: 0x8E10,
0xE6F7: 0x8E1F,
0xE6F8: 0x8E42,
0xE6F9: 0x8E35,
0xE6FA: 0x8E30,
0xE6FB: 0x8E34,
0xE6FC: 0x8E4A,
0xE740: 0x8E47,
0xE741: 0x8E49,
0xE742: 0x8E4C,
0xE743: 0x8E50,
0xE744: 0x8E48,
0xE745: 0x8E59,
0xE746: 0x8E64,
0xE747: 0x8E60,
0xE748: 0x8E2A,
0xE749: 0x8E63,
0xE74A: 0x8E55,
0xE74B: 0x8E76,
0xE74C: 0x8E72,
0xE74D: 0x8E7C,
0xE74E: 0x8E81,
0xE74F: 0x8E87,
0xE750: 0x8E85,
0xE751: 0x8E84,
0xE752: 0x8E8B,
0xE753: 0x8E8A,
0xE754: 0x8E93,
0xE755: 0x8E91,
0xE756: 0x8E94,
0xE757: 0x8E99,
0xE758: 0x8EAA,
0xE759: 0x8EA1,
0xE75A: 0x8EAC,
0xE75B: 0x8EB0,
0xE75C: 0x8EC6,
0xE75D: 0x8EB1,
0xE75E: 0x8EBE,
0xE75F: 0x8EC5,
0xE760: 0x8EC8,
0xE761: 0x8ECB,
0xE762: 0x8EDB,
0xE763: 0x8EE3,
0xE764: 0x8EFC,
0xE765: 0x8EFB,
0xE766: 0x8EEB,
0xE767: 0x8EFE,
0xE768: 0x8F0A,
0xE769: 0x8F05,
0xE76A: 0x8F15,
0xE76B: 0x8F12,
0xE76C: 0x8F19,
0xE76D: 0x8F13,
0xE76E: 0x8F1C,
0xE76F: 0x8F1F,
0xE770: 0x8F1B,
0xE771: 0x8F0C,
0xE772: 0x8F26,
0xE773: 0x8F33,
0xE774: 0x8F3B,
0xE775: 0x8F39,
0xE776: 0x8F45,
0xE777: 0x8F42,
0xE778: 0x8F3E,
0xE779: 0x8F4C,
0xE77A: 0x8F49,
0xE77B: 0x8F46,
0xE77C: 0x8F4E,
0xE77D: 0x8F57,
0xE77E: 0x8F5C,
0xE780: 0x8F62,
0xE781: 0x8F63,
0xE782: 0x8F64,
0xE783: 0x8F9C,
0xE784: 0x8F9F,
0xE785: 0x8FA3,
0xE786: 0x8FAD,
0xE787: 0x8FAF,
0xE788: 0x8FB7,
0xE789: 0x8FDA,
0xE78A: 0x8FE5,
0xE78B: 0x8FE2,
0xE78C: 0x8FEA,
0xE78D: 0x8FEF,
0xE78E: 0x9087,
0xE78F: 0x8FF4,
0xE790: 0x9005,
0xE791: 0x8FF9,
0xE792: 0x8FFA,
0xE793: 0x9011,
0xE794: 0x9015,
0xE795: 0x9021,
0xE796: 0x900D,
0xE797: 0x901E,
0xE798: 0x9016,
0xE799: 0x900B,
0xE79A: 0x9027,
0xE79B: 0x9036,
0xE79C: 0x9035,
0xE79D: 0x9039,
0xE79E: 0x8FF8,
0xE79F: 0x904F,
0xE7A0: 0x9050,
0xE7A1: 0x9051,
0xE7A2: 0x9052,
0xE7A3: 0x900E,
0xE7A4: 0x9049,
0xE7A5: 0x903E,
0xE7A6: 0x9056,
0xE7A7: 0x9058,
0xE7A8: 0x905E,
0xE7A9: 0x9068,
0xE7AA: 0x906F,
0xE7AB: 0x9076,
0xE7AC: 0x96A8,
0xE7AD: 0x9072,
0xE7AE: 0x9082,
0xE7AF: 0x907D,
0xE7B0: 0x9081,
0xE7B1: 0x9080,
0xE7B2: 0x908A,
0xE7B3: 0x9089,
0xE7B4: 0x908F,
0xE7B5: 0x90A8,
0xE7B6: 0x90AF,
0xE7B7: 0x90B1,
0xE7B8: 0x90B5,
0xE7B9: 0x90E2,
0xE7BA: 0x90E4,
0xE7BB: 0x6248,
0xE7BC: 0x90DB,
0xE7BD: 0x9102,
0xE7BE: 0x9112,
0xE7BF: 0x9119,
0xE7C0: 0x9132,
0xE7C1: 0x9130,
0xE7C2: 0x914A,
0xE7C3: 0x9156,
0xE7C4: 0x9158,
0xE7C5: 0x9163,
0xE7C6: 0x9165,
0xE7C7: 0x9169,
0xE7C8: 0x9173,
0xE7C9: 0x9172,
0xE7CA: 0x918B,
0xE7CB: 0x9189,
0xE7CC: 0x9182,
0xE7CD: 0x91A2,
0xE7CE: 0x91AB,
0xE7CF: 0x91AF,
0xE7D0: 0x91AA,
0xE7D1: 0x91B5,
0xE7D2: 0x91B4,
0xE7D3: 0x91BA,
0xE7D4: 0x91C0,
0xE7D5: 0x91C1,
0xE7D6: 0x91C9,
0xE7D7: 0x91CB,
0xE7D8: 0x91D0,
0xE7D9: 0x91D6,
0xE7DA: 0x91DF,
0xE7DB: 0x91E1,
0xE7DC: 0x91DB,
0xE7DD: 0x91FC,
0xE7DE: 0x91F5,
0xE7DF: 0x91F6,
0xE7E0: 0x921E,
0xE7E1: 0x91FF,
0xE7E2: 0x9214,
0xE7E3: 0x922C,
0xE7E4: 0x9215,
0xE7E5: 0x9211,
0xE7E6: 0x925E,
0xE7E7: 0x9257,
0xE7E8: 0x9245,
0xE7E9: 0x9249,
0xE7EA: 0x9264,
0xE7EB: 0x9248,
0xE7EC: 0x9295,
0xE7ED: 0x923F,
0xE7EE: 0x924B,
0xE7EF: 0x9250,
0xE7F0: 0x929C,
0xE7F1: 0x9296,
0xE7F2: 0x9293,
0xE7F3: 0x929B,
0xE7F4: 0x925A,
0xE7F5: 0x92CF,
0xE7F6: 0x92B9,
0xE7F7: 0x92B7,
0xE7F8: 0x92E9,
0xE7F9: 0x930F,
0xE7FA: 0x92FA,
0xE7FB: 0x9344,
0xE7FC: 0x932E,
0xE840: 0x9319,
0xE841: 0x9322,
0xE842: 0x931A,
0xE843: 0x9323,
0xE844: 0x933A,
0xE845: 0x9335,
0xE846: 0x933B,
0xE847: 0x935C,
0xE848: 0x9360,
0xE849: 0x937C,
0xE84A: 0x936E,
0xE84B: 0x9356,
0xE84C: 0x93B0,
0xE84D: 0x93AC,
0xE84E: 0x93AD,
0xE84F: 0x9394,
0xE850: 0x93B9,
0xE851: 0x93D6,
0xE852: 0x93D7,
0xE853: 0x93E8,
0xE854: 0x93E5,
0xE855: 0x93D8,
0xE856: 0x93C3,
0xE857: 0x93DD,
0xE858: 0x93D0,
0xE859: 0x93C8,
0xE85A: 0x93E4,
0xE85B: 0x941A,
0xE85C: 0x9414,
0xE85D: 0x9413,
0xE85E: 0x9403,
0xE85F: 0x9407,
0xE860: 0x9410,
0xE861: 0x9436,
0xE862: 0x942B,
0xE863: 0x9435,
0xE864: 0x9421,
0xE865: 0x943A,
0xE866: 0x9441,
0xE867: 0x9452,
0xE868: 0x9444,
0xE869: 0x945B,
0xE86A: 0x9460,
0xE86B: 0x9462,
0xE86C: 0x945E,
0xE86D: 0x946A,
0xE86E: 0x9229,
0xE86F: 0x9470,
0xE870: 0x9475,
0xE871: 0x9477,
0xE872: 0x947D,
0xE873: 0x945A,
0xE874: 0x947C,
0xE875: 0x947E,
0xE876: 0x9481,
0xE877: 0x947F,
0xE878: 0x9582,
0xE879: 0x9587,
0xE87A: 0x958A,
0xE87B: 0x9594,
0xE87C: 0x9596,
0xE87D: 0x9598,
0xE87E: 0x9599,
0xE880: 0x95A0,
0xE881: 0x95A8,
0xE882: 0x95A7,
0xE883: 0x95AD,
0xE884: 0x95BC,
0xE885: 0x95BB,
0xE886: 0x95B9,
0xE887: 0x95BE,
0xE888: 0x95CA,
0xE889: 0x6FF6,
0xE88A: 0x95C3,
0xE88B: 0x95CD,
0xE88C: 0x95CC,
0xE88D: 0x95D5,
0xE88E: 0x95D4,
0xE88F: 0x95D6,
0xE890: 0x95DC,
0xE891: 0x95E1,
0xE892: 0x95E5,
0xE893: 0x95E2,
0xE894: 0x9621,
0xE895: 0x9628,
0xE896: 0x962E,
0xE897: 0x962F,
0xE898: 0x9642,
0xE899: 0x964C,
0xE89A: 0x964F,
0xE89B: 0x964B,
0xE89C: 0x9677,
0xE89D: 0x965C,
0xE89E: 0x965E,
0xE89F: 0x965D,
0xE8A0: 0x965F,
0xE8A1: 0x9666,
0xE8A2: 0x9672,
0xE8A3: 0x966C,
0xE8A4: 0x968D,
0xE8A5: 0x9698,
0xE8A6: 0x9695,
0xE8A7: 0x9697,
0xE8A8: 0x96AA,
0xE8A9: 0x96A7,
0xE8AA: 0x96B1,
0xE8AB: 0x96B2,
0xE8AC: 0x96B0,
0xE8AD: 0x96B4,
0xE8AE: 0x96B6,
0xE8AF: 0x96B8,
0xE8B0: 0x96B9,
0xE8B1: 0x96CE,
0xE8B2: 0x96CB,
0xE8B3: 0x96C9,
0xE8B4: 0x96CD,
0xE8B5: 0x894D,
0xE8B6: 0x96DC,
0xE8B7: 0x970D,
0xE8B8: 0x96D5,
0xE8B9: 0x96F9,
0xE8BA: 0x9704,
0xE8BB: 0x9706,
0xE8BC: 0x9708,
0xE8BD: 0x9713,
0xE8BE: 0x970E,
0xE8BF: 0x9711,
0xE8C0: 0x970F,
0xE8C1: 0x9716,
0xE8C2: 0x9719,
0xE8C3: 0x9724,
0xE8C4: 0x972A,
0xE8C5: 0x9730,
0xE8C6: 0x9739,
0xE8C7: 0x973D,
0xE8C8: 0x973E,
0xE8C9: 0x9744,
0xE8CA: 0x9746,
0xE8CB: 0x9748,
0xE8CC: 0x9742,
0xE8CD: 0x9749,
0xE8CE: 0x975C,
0xE8CF: 0x9760,
0xE8D0: 0x9764,
0xE8D1: 0x9766,
0xE8D2: 0x9768,
0xE8D3: 0x52D2,
0xE8D4: 0x976B,
0xE8D5: 0x9771,
0xE8D6: 0x9779,
0xE8D7: 0x9785,
0xE8D8: 0x977C,
0xE8D9: 0x9781,
0xE8DA: 0x977A,
0xE8DB: 0x9786,
0xE8DC: 0x978B,
0xE8DD: 0x978F,
0xE8DE: 0x9790,
0xE8DF: 0x979C,
0xE8E0: 0x97A8,
0xE8E1: 0x97A6,
0xE8E2: 0x97A3,
0xE8E3: 0x97B3,
0xE8E4: 0x97B4,
0xE8E5: 0x97C3,
0xE8E6: 0x97C6,
0xE8E7: 0x97C8,
0xE8E8: 0x97CB,
0xE8E9: 0x97DC,
0xE8EA: 0x97ED,
0xE8EB: 0x9F4F,
0xE8EC: 0x97F2,
0xE8ED: 0x7ADF,
0xE8EE: 0x97F6,
0xE8EF: 0x97F5,
0xE8F0: 0x980F,
0xE8F1: 0x980C,
0xE8F2: 0x9838,
0xE8F3: 0x9824,
0xE8F4: 0x9821,
0xE8F5: 0x9837,
0xE8F6: 0x983D,
0xE8F7: 0x9846,
0xE8F8: 0x984F,
0xE8F9: 0x984B,
0xE8FA: 0x986B,
0xE8FB: 0x986F,
0xE8FC: 0x9870,
0xE940: 0x9871,
0xE941: 0x9874,
0xE942: 0x9873,
0xE943: 0x98AA,
0xE944: 0x98AF,
0xE945: 0x98B1,
0xE946: 0x98B6,
0xE947: 0x98C4,
0xE948: 0x98C3,
0xE949: 0x98C6,
0xE94A: 0x98E9,
0xE94B: 0x98EB,
0xE94C: 0x9903,
0xE94D: 0x9909,
0xE94E: 0x9912,
0xE94F: 0x9914,
0xE950: 0x9918,
0xE951: 0x9921,
0xE952: 0x991D,
0xE953: 0x991E,
0xE954: 0x9924,
0xE955: 0x9920,
0xE956: 0x992C,
0xE957: 0x992E,
0xE958: 0x993D,
0xE959: 0x993E,
0xE95A: 0x9942,
0xE95B: 0x9949,
0xE95C: 0x9945,
0xE95D: 0x9950,
0xE95E: 0x994B,
0xE95F: 0x9951,
0xE960: 0x9952,
0xE961: 0x994C,
0xE962: 0x9955,
0xE963: 0x9997,
0xE964: 0x9998,
0xE965: 0x99A5,
0xE966: 0x99AD,
0xE967: 0x99AE,
0xE968: 0x99BC,
0xE969: 0x99DF,
0xE96A: 0x99DB,
0xE96B: 0x99DD,
0xE96C: 0x99D8,
0xE96D: 0x99D1,
0xE96E: 0x99ED,
0xE96F: 0x99EE,
0xE970: 0x99F1,
0xE971: 0x99F2,
0xE972: 0x99FB,
0xE973: 0x99F8,
0xE974: 0x9A01,
0xE975: 0x9A0F,
0xE976: 0x9A05,
0xE977: 0x99E2,
0xE978: 0x9A19,
0xE979: 0x9A2B,
0xE97A: 0x9A37,
0xE97B: 0x9A45,
0xE97C: 0x9A42,
0xE97D: 0x9A40,
0xE97E: 0x9A43,
0xE980: 0x9A3E,
0xE981: 0x9A55,
0xE982: 0x9A4D,
0xE983: 0x9A5B,
0xE984: 0x9A57,
0xE985: 0x9A5F,
0xE986: 0x9A62,
0xE987: 0x9A65,
0xE988: 0x9A64,
0xE989: 0x9A69,
0xE98A: 0x9A6B,
0xE98B: 0x9A6A,
0xE98C: 0x9AAD,
0xE98D: 0x9AB0,
0xE98E: 0x9ABC,
0xE98F: 0x9AC0,
0xE990: 0x9ACF,
0xE991: 0x9AD1,
0xE992: 0x9AD3,
0xE993: 0x9AD4,
0xE994: 0x9ADE,
0xE995: 0x9ADF,
0xE996: 0x9AE2,
0xE997: 0x9AE3,
0xE998: 0x9AE6,
0xE999: 0x9AEF,
0xE99A: 0x9AEB,
0xE99B: 0x9AEE,
0xE99C: 0x9AF4,
0xE99D: 0x9AF1,
0xE99E: 0x9AF7,
0xE99F: 0x9AFB,
0xE9A0: 0x9B06,
0xE9A1: 0x9B18,
0xE9A2: 0x9B1A,
0xE9A3: 0x9B1F,
0xE9A4: 0x9B22,
0xE9A5: 0x9B23,
0xE9A6: 0x9B25,
0xE9A7: 0x9B27,
0xE9A8: 0x9B28,
0xE9A9: 0x9B29,
0xE9AA: 0x9B2A,
0xE9AB: 0x9B2E,
0xE9AC: 0x9B2F,
0xE9AD: 0x9B32,
0xE9AE: 0x9B44,
0xE9AF: 0x9B43,
0xE9B0: 0x9B4F,
0xE9B1: 0x9B4D,
0xE9B2: 0x9B4E,
0xE9B3: 0x9B51,
0xE9B4: 0x9B58,
0xE9B5: 0x9B74,
0xE9B6: 0x9B93,
0xE9B7: 0x9B83,
0xE9B8: 0x9B91,
0xE9B9: 0x9B96,
0xE9BA: 0x9B97,
0xE9BB: 0x9B9F,
0xE9BC: 0x9BA0,
0xE9BD: 0x9BA8,
0xE9BE: 0x9BB4,
0xE9BF: 0x9BC0,
0xE9C0: 0x9BCA,
0xE9C1: 0x9BB9,
0xE9C2: 0x9BC6,
0xE9C3: 0x9BCF,
0xE9C4: 0x9BD1,
0xE9C5: 0x9BD2,
0xE9C6: 0x9BE3,
0xE9C7: 0x9BE2,
0xE9C8: 0x9BE4,
0xE9C9: 0x9BD4,
0xE9CA: 0x9BE1,
0xE9CB: 0x9C3A,
0xE9CC: 0x9BF2,
0xE9CD: 0x9BF1,
0xE9CE: 0x9BF0,
0xE9CF: 0x9C15,
0xE9D0: 0x9C14,
0xE9D1: 0x9C09,
0xE9D2: 0x9C13,
0xE9D3: 0x9C0C,
0xE9D4: 0x9C06,
0xE9D5: 0x9C08,
0xE9D6: 0x9C12,
0xE9D7: 0x9C0A,
0xE9D8: 0x9C04,
0xE9D9: 0x9C2E,
0xE9DA: 0x9C1B,
0xE9DB: 0x9C25,
0xE9DC: 0x9C24,
0xE9DD: 0x9C21,
0xE9DE: 0x9C30,
0xE9DF: 0x9C47,
0xE9E0: 0x9C32,
0xE9E1: 0x9C46,
0xE9E2: 0x9C3E,
0xE9E3: 0x9C5A,
0xE9E4: 0x9C60,
0xE9E5: 0x9C67,
0xE9E6: 0x9C76,
0xE9E7: 0x9C78,
0xE9E8: 0x9CE7,
0xE9E9: 0x9CEC,
0xE9EA: 0x9CF0,
0xE9EB: 0x9D09,
0xE9EC: 0x9D08,
0xE9ED: 0x9CEB,
0xE9EE: 0x9D03,
0xE9EF: 0x9D06,
0xE9F0: 0x9D2A,
0xE9F1: 0x9D26,
0xE9F2: 0x9DAF,
0xE9F3: 0x9D23,
0xE9F4: 0x9D1F,
0xE9F5: 0x9D44,
0xE9F6: 0x9D15,
0xE9F7: 0x9D12,
0xE9F8: 0x9D41,
0xE9F9: 0x9D3F,
0xE9FA: 0x9D3E,
0xE9FB: 0x9D46,
0xE9FC: 0x9D48,
0xEA40: 0x9D5D,
0xEA41: 0x9D5E,
0xEA42: 0x9D64,
0xEA43: 0x9D51,
0xEA44: 0x9D50,
0xEA45: 0x9D59,
0xEA46: 0x9D72,
0xEA47: 0x9D89,
0xEA48: 0x9D87,
0xEA49: 0x9DAB,
0xEA4A: 0x9D6F,
0xEA4B: 0x9D7A,
0xEA4C: 0x9D9A,
0xEA4D: 0x9DA4,
0xEA4E: 0x9DA9,
0xEA4F: 0x9DB2,
0xEA50: 0x9DC4,
0xEA51: 0x9DC1,
0xEA52: 0x9DBB,
0xEA53: 0x9DB8,
0xEA54: 0x9DBA,
0xEA55: 0x9DC6,
0xEA56: 0x9DCF,
0xEA57: 0x9DC2,
0xEA58: 0x9DD9,
0xEA59: 0x9DD3,
0xEA5A: 0x9DF8,
0xEA5B: 0x9DE6,
0xEA5C: 0x9DED,
0xEA5D: 0x9DEF,
0xEA5E: 0x9DFD,
0xEA5F: 0x9E1A,
0xEA60: 0x9E1B,
0xEA61: 0x9E1E,
0xEA62: 0x9E75,
0xEA63: 0x9E79,
0xEA64: 0x9E7D,
0xEA65: 0x9E81,
0xEA66: 0x9E88,
0xEA67: 0x9E8B,
0xEA68: 0x9E8C,
0xEA69: 0x9E92,
0xEA6A: 0x9E95,
0xEA6B: 0x9E91,
0xEA6C: 0x9E9D,
0xEA6D: 0x9EA5,
0xEA6E: 0x9EA9,
0xEA6F: 0x9EB8,
0xEA70: 0x9EAA,
0xEA71: 0x9EAD,
0xEA72: 0x9761,
0xEA73: 0x9ECC,
0xEA74: 0x9ECE,
0xEA75: 0x9ECF,
0xEA76: 0x9ED0,
0xEA77: 0x9ED4,
0xEA78: 0x9EDC,
0xEA79: 0x9EDE,
0xEA7A: 0x9EDD,
0xEA7B: 0x9EE0,
0xEA7C: 0x9EE5,
0xEA7D: 0x9EE8,
0xEA7E: 0x9EEF,
0xEA80: 0x9EF4,
0xEA81: 0x9EF6,
0xEA82: 0x9EF7,
0xEA83: 0x9EF9,
0xEA84: 0x9EFB,
0xEA85: 0x9EFC,
0xEA86: 0x9EFD,
0xEA87: 0x9F07,
0xEA88: 0x9F08,
0xEA89: 0x76B7,
0xEA8A: 0x9F15,
0xEA8B: 0x9F21,
0xEA8C: 0x9F2C,
0xEA8D: 0x9F3E,
0xEA8E: 0x9F4A,
0xEA8F: 0x9F52,
0xEA90: 0x9F54,
0xEA91: 0x9F63,
0xEA92: 0x9F5F,
0xEA93: 0x9F60,
0xEA94: 0x9F61,
0xEA95: 0x9F66,
0xEA96: 0x9F67,
0xEA97: 0x9F6C,
0xEA98: 0x9F6A,
0xEA99: 0x9F77,
0xEA9A: 0x9F72,
0xEA9B: 0x9F76,
0xEA9C: 0x9F95,
0xEA9D: 0x9F9C,
0xEA9E: 0x9FA0,
0xEA9F: 0x582F,
0xEAA0: 0x69C7,
0xEAA1: 0x9059,
0xEAA2: 0x7464,
0xEAA3: 0x51DC,
0xEAA4: 0x7199,
};
/***/ }),
/* 9 */
/***/ (function(module, exports, __nested_webpack_require_183922__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var GenericGF_1 = __nested_webpack_require_183922__(1);
var GenericGFPoly_1 = __nested_webpack_require_183922__(2);
function runEuclideanAlgorithm(field, a, b, R) {
var _a;
// Assume a's degree is >= b's
if (a.degree() < b.degree()) {
_a = [b, a], a = _a[0], b = _a[1];
}
var rLast = a;
var r = b;
var tLast = field.zero;
var t = field.one;
// Run Euclidean algorithm until r's degree is less than R/2
while (r.degree() >= R / 2) {
var rLastLast = rLast;
var tLastLast = tLast;
rLast = r;
tLast = t;
// Divide rLastLast by rLast, with quotient in q and remainder in r
if (rLast.isZero()) {
// Euclidean algorithm already terminated?
return null;
}
r = rLastLast;
var q = field.zero;
var denominatorLeadingTerm = rLast.getCoefficient(rLast.degree());
var dltInverse = field.inverse(denominatorLeadingTerm);
while (r.degree() >= rLast.degree() && !r.isZero()) {
var degreeDiff = r.degree() - rLast.degree();
var scale = field.multiply(r.getCoefficient(r.degree()), dltInverse);
q = q.addOrSubtract(field.buildMonomial(degreeDiff, scale));
r = r.addOrSubtract(rLast.multiplyByMonomial(degreeDiff, scale));
}
t = q.multiplyPoly(tLast).addOrSubtract(tLastLast);
if (r.degree() >= rLast.degree()) {
return null;
}
}
var sigmaTildeAtZero = t.getCoefficient(0);
if (sigmaTildeAtZero === 0) {
return null;
}
var inverse = field.inverse(sigmaTildeAtZero);
return [t.multiply(inverse), r.multiply(inverse)];
}
function findErrorLocations(field, errorLocator) {
// This is a direct application of Chien's search
var numErrors = errorLocator.degree();
if (numErrors === 1) {
return [errorLocator.getCoefficient(1)];
}
var result = new Array(numErrors);
var errorCount = 0;
for (var i = 1; i < field.size && errorCount < numErrors; i++) {
if (errorLocator.evaluateAt(i) === 0) {
result[errorCount] = field.inverse(i);
errorCount++;
}
}
if (errorCount !== numErrors) {
return null;
}
return result;
}
function findErrorMagnitudes(field, errorEvaluator, errorLocations) {
// This is directly applying Forney's Formula
var s = errorLocations.length;
var result = new Array(s);
for (var i = 0; i < s; i++) {
var xiInverse = field.inverse(errorLocations[i]);
var denominator = 1;
for (var j = 0; j < s; j++) {
if (i !== j) {
denominator = field.multiply(denominator, GenericGF_1.addOrSubtractGF(1, field.multiply(errorLocations[j], xiInverse)));
}
}
result[i] = field.multiply(errorEvaluator.evaluateAt(xiInverse), field.inverse(denominator));
if (field.generatorBase !== 0) {
result[i] = field.multiply(result[i], xiInverse);
}
}
return result;
}
function decode(bytes, twoS) {
var outputBytes = new Uint8ClampedArray(bytes.length);
outputBytes.set(bytes);
var field = new GenericGF_1.default(0x011D, 256, 0); // x^8 + x^4 + x^3 + x^2 + 1
var poly = new GenericGFPoly_1.default(field, outputBytes);
var syndromeCoefficients = new Uint8ClampedArray(twoS);
var error = false;
for (var s = 0; s < twoS; s++) {
var evaluation = poly.evaluateAt(field.exp(s + field.generatorBase));
syndromeCoefficients[syndromeCoefficients.length - 1 - s] = evaluation;
if (evaluation !== 0) {
error = true;
}
}
if (!error) {
return outputBytes;
}
var syndrome = new GenericGFPoly_1.default(field, syndromeCoefficients);
var sigmaOmega = runEuclideanAlgorithm(field, field.buildMonomial(twoS, 1), syndrome, twoS);
if (sigmaOmega === null) {
return null;
}
var errorLocations = findErrorLocations(field, sigmaOmega[0]);
if (errorLocations == null) {
return null;
}
var errorMagnitudes = findErrorMagnitudes(field, sigmaOmega[1], errorLocations);
for (var i = 0; i < errorLocations.length; i++) {
var position = outputBytes.length - 1 - field.log(errorLocations[i]);
if (position < 0) {
return null;
}
outputBytes[position] = GenericGF_1.addOrSubtractGF(outputBytes[position], errorMagnitudes[i]);
}
return outputBytes;
}
exports.decode = decode;
/***/ }),
/* 10 */
/***/ (function(module, exports, __nccwpck_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.VERSIONS = [
{
infoBits: null,
versionNumber: 1,
alignmentPatternCenters: [],
errorCorrectionLevels: [
{
ecCodewordsPerBlock: 7,
ecBlocks: [{ numBlocks: 1, dataCodewordsPerBlock: 19 }],
},
{
ecCodewordsPerBlock: 10,
ecBlocks: [{ numBlocks: 1, dataCodewordsPerBlock: 16 }],
},
{
ecCodewordsPerBlock: 13,
ecBlocks: [{ numBlocks: 1, dataCodewordsPerBlock: 13 }],
},
{
ecCodewordsPerBlock: 17,
ecBlocks: [{ numBlocks: 1, dataCodewordsPerBlock: 9 }],
},
],
},
{
infoBits: null,
versionNumber: 2,
alignmentPatternCenters: [6, 18],
errorCorrectionLevels: [
{
ecCodewordsPerBlock: 10,
ecBlocks: [{ numBlocks: 1, dataCodewordsPerBlock: 34 }],
},
{
ecCodewordsPerBlock: 16,
ecBlocks: [{ numBlocks: 1, dataCodewordsPerBlock: 28 }],
},
{
ecCodewordsPerBlock: 22,
ecBlocks: [{ numBlocks: 1, dataCodewordsPerBlock: 22 }],
},
{
ecCodewordsPerBlock: 28,
ecBlocks: [{ numBlocks: 1, dataCodewordsPerBlock: 16 }],
},
],
},
{
infoBits: null,
versionNumber: 3,
alignmentPatternCenters: [6, 22],
errorCorrectionLevels: [
{
ecCodewordsPerBlock: 15,
ecBlocks: [{ numBlocks: 1, dataCodewordsPerBlock: 55 }],
},
{
ecCodewordsPerBlock: 26,
ecBlocks: [{ numBlocks: 1, dataCodewordsPerBlock: 44 }],
},
{
ecCodewordsPerBlock: 18,
ecBlocks: [{ numBlocks: 2, dataCodewordsPerBlock: 17 }],
},
{
ecCodewordsPerBlock: 22,
ecBlocks: [{ numBlocks: 2, dataCodewordsPerBlock: 13 }],
},
],
},
{
infoBits: null,
versionNumber: 4,
alignmentPatternCenters: [6, 26],
errorCorrectionLevels: [
{
ecCodewordsPerBlock: 20,
ecBlocks: [{ numBlocks: 1, dataCodewordsPerBlock: 80 }],
},
{
ecCodewordsPerBlock: 18,
ecBlocks: [{ numBlocks: 2, dataCodewordsPerBlock: 32 }],
},
{
ecCodewordsPerBlock: 26,
ecBlocks: [{ numBlocks: 2, dataCodewordsPerBlock: 24 }],
},
{
ecCodewordsPerBlock: 16,
ecBlocks: [{ numBlocks: 4, dataCodewordsPerBlock: 9 }],
},
],
},
{
infoBits: null,
versionNumber: 5,
alignmentPatternCenters: [6, 30],
errorCorrectionLevels: [
{
ecCodewordsPerBlock: 26,
ecBlocks: [{ numBlocks: 1, dataCodewordsPerBlock: 108 }],
},
{
ecCodewordsPerBlock: 24,
ecBlocks: [{ numBlocks: 2, dataCodewordsPerBlock: 43 }],
},
{
ecCodewordsPerBlock: 18,
ecBlocks: [
{ numBlocks: 2, dataCodewordsPerBlock: 15 },
{ numBlocks: 2, dataCodewordsPerBlock: 16 },
],
},
{
ecCodewordsPerBlock: 22,
ecBlocks: [
{ numBlocks: 2, dataCodewordsPerBlock: 11 },
{ numBlocks: 2, dataCodewordsPerBlock: 12 },
],
},
],
},
{
infoBits: null,
versionNumber: 6,
alignmentPatternCenters: [6, 34],
errorCorrectionLevels: [
{
ecCodewordsPerBlock: 18,
ecBlocks: [{ numBlocks: 2, dataCodewordsPerBlock: 68 }],
},
{
ecCodewordsPerBlock: 16,
ecBlocks: [{ numBlocks: 4, dataCodewordsPerBlock: 27 }],
},
{
ecCodewordsPerBlock: 24,
ecBlocks: [{ numBlocks: 4, dataCodewordsPerBlock: 19 }],
},
{
ecCodewordsPerBlock: 28,
ecBlocks: [{ numBlocks: 4, dataCodewordsPerBlock: 15 }],
},
],
},
{
infoBits: 0x07C94,
versionNumber: 7,
alignmentPatternCenters: [6, 22, 38],
errorCorrectionLevels: [
{
ecCodewordsPerBlock: 20,
ecBlocks: [{ numBlocks: 2, dataCodewordsPerBlock: 78 }],
},
{
ecCodewordsPerBlock: 18,
ecBlocks: [{ numBlocks: 4, dataCodewordsPerBlock: 31 }],
},
{
ecCodewordsPerBlock: 18,
ecBlocks: [
{ numBlocks: 2, dataCodewordsPerBlock: 14 },
{ numBlocks: 4, dataCodewordsPerBlock: 15 },
],
},
{
ecCodewordsPerBlock: 26,
ecBlocks: [
{ numBlocks: 4, dataCodewordsPerBlock: 13 },
{ numBlocks: 1, dataCodewordsPerBlock: 14 },
],
},
],
},
{
infoBits: 0x085BC,
versionNumber: 8,
alignmentPatternCenters: [6, 24, 42],
errorCorrectionLevels: [
{
ecCodewordsPerBlock: 24,
ecBlocks: [{ numBlocks: 2, dataCodewordsPerBlock: 97 }],
},
{
ecCodewordsPerBlock: 22,
ecBlocks: [
{ numBlocks: 2, dataCodewordsPerBlock: 38 },
{ numBlocks: 2, dataCodewordsPerBlock: 39 },
],
},
{
ecCodewordsPerBlock: 22,
ecBlocks: [
{ numBlocks: 4, dataCodewordsPerBlock: 18 },
{ numBlocks: 2, dataCodewordsPerBlock: 19 },
],
},
{
ecCodewordsPerBlock: 26,
ecBlocks: [
{ numBlocks: 4, dataCodewordsPerBlock: 14 },
{ numBlocks: 2, dataCodewordsPerBlock: 15 },
],
},
],
},
{
infoBits: 0x09A99,
versionNumber: 9,
alignmentPatternCenters: [6, 26, 46],
errorCorrectionLevels: [
{
ecCodewordsPerBlock: 30,
ecBlocks: [{ numBlocks: 2, dataCodewordsPerBlock: 116 }],
},
{
ecCodewordsPerBlock: 22,
ecBlocks: [
{ numBlocks: 3, dataCodewordsPerBlock: 36 },
{ numBlocks: 2, dataCodewordsPerBlock: 37 },
],
},
{
ecCodewordsPerBlock: 20,
ecBlocks: [
{ numBlocks: 4, dataCodewordsPerBlock: 16 },
{ numBlocks: 4, dataCodewordsPerBlock: 17 },
],
},
{
ecCodewordsPerBlock: 24,
ecBlocks: [
{ numBlocks: 4, dataCodewordsPerBlock: 12 },
{ numBlocks: 4, dataCodewordsPerBlock: 13 },
],
},
],
},
{
infoBits: 0x0A4D3,
versionNumber: 10,
alignmentPatternCenters: [6, 28, 50],
errorCorrectionLevels: [
{
ecCodewordsPerBlock: 18,
ecBlocks: [
{ numBlocks: 2, dataCodewordsPerBlock: 68 },
{ numBlocks: 2, dataCodewordsPerBlock: 69 },
],
},
{
ecCodewordsPerBlock: 26,
ecBlocks: [
{ numBlocks: 4, dataCodewordsPerBlock: 43 },
{ numBlocks: 1, dataCodewordsPerBlock: 44 },
],
},
{
ecCodewordsPerBlock: 24,
ecBlocks: [
{ numBlocks: 6, dataCodewordsPerBlock: 19 },
{ numBlocks: 2, dataCodewordsPerBlock: 20 },
],
},
{
ecCodewordsPerBlock: 28,
ecBlocks: [
{ numBlocks: 6, dataCodewordsPerBlock: 15 },
{ numBlocks: 2, dataCodewordsPerBlock: 16 },
],
},
],
},
{
infoBits: 0x0BBF6,
versionNumber: 11,
alignmentPatternCenters: [6, 30, 54],
errorCorrectionLevels: [
{
ecCodewordsPerBlock: 20,
ecBlocks: [{ numBlocks: 4, dataCodewordsPerBlock: 81 }],
},
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 1, dataCodewordsPerBlock: 50 },
{ numBlocks: 4, dataCodewordsPerBlock: 51 },
],
},
{
ecCodewordsPerBlock: 28,
ecBlocks: [
{ numBlocks: 4, dataCodewordsPerBlock: 22 },
{ numBlocks: 4, dataCodewordsPerBlock: 23 },
],
},
{
ecCodewordsPerBlock: 24,
ecBlocks: [
{ numBlocks: 3, dataCodewordsPerBlock: 12 },
{ numBlocks: 8, dataCodewordsPerBlock: 13 },
],
},
],
},
{
infoBits: 0x0C762,
versionNumber: 12,
alignmentPatternCenters: [6, 32, 58],
errorCorrectionLevels: [
{
ecCodewordsPerBlock: 24,
ecBlocks: [
{ numBlocks: 2, dataCodewordsPerBlock: 92 },
{ numBlocks: 2, dataCodewordsPerBlock: 93 },
],
},
{
ecCodewordsPerBlock: 22,
ecBlocks: [
{ numBlocks: 6, dataCodewordsPerBlock: 36 },
{ numBlocks: 2, dataCodewordsPerBlock: 37 },
],
},
{
ecCodewordsPerBlock: 26,
ecBlocks: [
{ numBlocks: 4, dataCodewordsPerBlock: 20 },
{ numBlocks: 6, dataCodewordsPerBlock: 21 },
],
},
{
ecCodewordsPerBlock: 28,
ecBlocks: [
{ numBlocks: 7, dataCodewordsPerBlock: 14 },
{ numBlocks: 4, dataCodewordsPerBlock: 15 },
],
},
],
},
{
infoBits: 0x0D847,
versionNumber: 13,
alignmentPatternCenters: [6, 34, 62],
errorCorrectionLevels: [
{
ecCodewordsPerBlock: 26,
ecBlocks: [{ numBlocks: 4, dataCodewordsPerBlock: 107 }],
},
{
ecCodewordsPerBlock: 22,
ecBlocks: [
{ numBlocks: 8, dataCodewordsPerBlock: 37 },
{ numBlocks: 1, dataCodewordsPerBlock: 38 },
],
},
{
ecCodewordsPerBlock: 24,
ecBlocks: [
{ numBlocks: 8, dataCodewordsPerBlock: 20 },
{ numBlocks: 4, dataCodewordsPerBlock: 21 },
],
},
{
ecCodewordsPerBlock: 22,
ecBlocks: [
{ numBlocks: 12, dataCodewordsPerBlock: 11 },
{ numBlocks: 4, dataCodewordsPerBlock: 12 },
],
},
],
},
{
infoBits: 0x0E60D,
versionNumber: 14,
alignmentPatternCenters: [6, 26, 46, 66],
errorCorrectionLevels: [
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 3, dataCodewordsPerBlock: 115 },
{ numBlocks: 1, dataCodewordsPerBlock: 116 },
],
},
{
ecCodewordsPerBlock: 24,
ecBlocks: [
{ numBlocks: 4, dataCodewordsPerBlock: 40 },
{ numBlocks: 5, dataCodewordsPerBlock: 41 },
],
},
{
ecCodewordsPerBlock: 20,
ecBlocks: [
{ numBlocks: 11, dataCodewordsPerBlock: 16 },
{ numBlocks: 5, dataCodewordsPerBlock: 17 },
],
},
{
ecCodewordsPerBlock: 24,
ecBlocks: [
{ numBlocks: 11, dataCodewordsPerBlock: 12 },
{ numBlocks: 5, dataCodewordsPerBlock: 13 },
],
},
],
},
{
infoBits: 0x0F928,
versionNumber: 15,
alignmentPatternCenters: [6, 26, 48, 70],
errorCorrectionLevels: [
{
ecCodewordsPerBlock: 22,
ecBlocks: [
{ numBlocks: 5, dataCodewordsPerBlock: 87 },
{ numBlocks: 1, dataCodewordsPerBlock: 88 },
],
},
{
ecCodewordsPerBlock: 24,
ecBlocks: [
{ numBlocks: 5, dataCodewordsPerBlock: 41 },
{ numBlocks: 5, dataCodewordsPerBlock: 42 },
],
},
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 5, dataCodewordsPerBlock: 24 },
{ numBlocks: 7, dataCodewordsPerBlock: 25 },
],
},
{
ecCodewordsPerBlock: 24,
ecBlocks: [
{ numBlocks: 11, dataCodewordsPerBlock: 12 },
{ numBlocks: 7, dataCodewordsPerBlock: 13 },
],
},
],
},
{
infoBits: 0x10B78,
versionNumber: 16,
alignmentPatternCenters: [6, 26, 50, 74],
errorCorrectionLevels: [
{
ecCodewordsPerBlock: 24,
ecBlocks: [
{ numBlocks: 5, dataCodewordsPerBlock: 98 },
{ numBlocks: 1, dataCodewordsPerBlock: 99 },
],
},
{
ecCodewordsPerBlock: 28,
ecBlocks: [
{ numBlocks: 7, dataCodewordsPerBlock: 45 },
{ numBlocks: 3, dataCodewordsPerBlock: 46 },
],
},
{
ecCodewordsPerBlock: 24,
ecBlocks: [
{ numBlocks: 15, dataCodewordsPerBlock: 19 },
{ numBlocks: 2, dataCodewordsPerBlock: 20 },
],
},
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 3, dataCodewordsPerBlock: 15 },
{ numBlocks: 13, dataCodewordsPerBlock: 16 },
],
},
],
},
{
infoBits: 0x1145D,
versionNumber: 17,
alignmentPatternCenters: [6, 30, 54, 78],
errorCorrectionLevels: [
{
ecCodewordsPerBlock: 28,
ecBlocks: [
{ numBlocks: 1, dataCodewordsPerBlock: 107 },
{ numBlocks: 5, dataCodewordsPerBlock: 108 },
],
},
{
ecCodewordsPerBlock: 28,
ecBlocks: [
{ numBlocks: 10, dataCodewordsPerBlock: 46 },
{ numBlocks: 1, dataCodewordsPerBlock: 47 },
],
},
{
ecCodewordsPerBlock: 28,
ecBlocks: [
{ numBlocks: 1, dataCodewordsPerBlock: 22 },
{ numBlocks: 15, dataCodewordsPerBlock: 23 },
],
},
{
ecCodewordsPerBlock: 28,
ecBlocks: [
{ numBlocks: 2, dataCodewordsPerBlock: 14 },
{ numBlocks: 17, dataCodewordsPerBlock: 15 },
],
},
],
},
{
infoBits: 0x12A17,
versionNumber: 18,
alignmentPatternCenters: [6, 30, 56, 82],
errorCorrectionLevels: [
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 5, dataCodewordsPerBlock: 120 },
{ numBlocks: 1, dataCodewordsPerBlock: 121 },
],
},
{
ecCodewordsPerBlock: 26,
ecBlocks: [
{ numBlocks: 9, dataCodewordsPerBlock: 43 },
{ numBlocks: 4, dataCodewordsPerBlock: 44 },
],
},
{
ecCodewordsPerBlock: 28,
ecBlocks: [
{ numBlocks: 17, dataCodewordsPerBlock: 22 },
{ numBlocks: 1, dataCodewordsPerBlock: 23 },
],
},
{
ecCodewordsPerBlock: 28,
ecBlocks: [
{ numBlocks: 2, dataCodewordsPerBlock: 14 },
{ numBlocks: 19, dataCodewordsPerBlock: 15 },
],
},
],
},
{
infoBits: 0x13532,
versionNumber: 19,
alignmentPatternCenters: [6, 30, 58, 86],
errorCorrectionLevels: [
{
ecCodewordsPerBlock: 28,
ecBlocks: [
{ numBlocks: 3, dataCodewordsPerBlock: 113 },
{ numBlocks: 4, dataCodewordsPerBlock: 114 },
],
},
{
ecCodewordsPerBlock: 26,
ecBlocks: [
{ numBlocks: 3, dataCodewordsPerBlock: 44 },
{ numBlocks: 11, dataCodewordsPerBlock: 45 },
],
},
{
ecCodewordsPerBlock: 26,
ecBlocks: [
{ numBlocks: 17, dataCodewordsPerBlock: 21 },
{ numBlocks: 4, dataCodewordsPerBlock: 22 },
],
},
{
ecCodewordsPerBlock: 26,
ecBlocks: [
{ numBlocks: 9, dataCodewordsPerBlock: 13 },
{ numBlocks: 16, dataCodewordsPerBlock: 14 },
],
},
],
},
{
infoBits: 0x149A6,
versionNumber: 20,
alignmentPatternCenters: [6, 34, 62, 90],
errorCorrectionLevels: [
{
ecCodewordsPerBlock: 28,
ecBlocks: [
{ numBlocks: 3, dataCodewordsPerBlock: 107 },
{ numBlocks: 5, dataCodewordsPerBlock: 108 },
],
},
{
ecCodewordsPerBlock: 26,
ecBlocks: [
{ numBlocks: 3, dataCodewordsPerBlock: 41 },
{ numBlocks: 13, dataCodewordsPerBlock: 42 },
],
},
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 15, dataCodewordsPerBlock: 24 },
{ numBlocks: 5, dataCodewordsPerBlock: 25 },
],
},
{
ecCodewordsPerBlock: 28,
ecBlocks: [
{ numBlocks: 15, dataCodewordsPerBlock: 15 },
{ numBlocks: 10, dataCodewordsPerBlock: 16 },
],
},
],
},
{
infoBits: 0x15683,
versionNumber: 21,
alignmentPatternCenters: [6, 28, 50, 72, 94],
errorCorrectionLevels: [
{
ecCodewordsPerBlock: 28,
ecBlocks: [
{ numBlocks: 4, dataCodewordsPerBlock: 116 },
{ numBlocks: 4, dataCodewordsPerBlock: 117 },
],
},
{
ecCodewordsPerBlock: 26,
ecBlocks: [{ numBlocks: 17, dataCodewordsPerBlock: 42 }],
},
{
ecCodewordsPerBlock: 28,
ecBlocks: [
{ numBlocks: 17, dataCodewordsPerBlock: 22 },
{ numBlocks: 6, dataCodewordsPerBlock: 23 },
],
},
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 19, dataCodewordsPerBlock: 16 },
{ numBlocks: 6, dataCodewordsPerBlock: 17 },
],
},
],
},
{
infoBits: 0x168C9,
versionNumber: 22,
alignmentPatternCenters: [6, 26, 50, 74, 98],
errorCorrectionLevels: [
{
ecCodewordsPerBlock: 28,
ecBlocks: [
{ numBlocks: 2, dataCodewordsPerBlock: 111 },
{ numBlocks: 7, dataCodewordsPerBlock: 112 },
],
},
{
ecCodewordsPerBlock: 28,
ecBlocks: [{ numBlocks: 17, dataCodewordsPerBlock: 46 }],
},
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 7, dataCodewordsPerBlock: 24 },
{ numBlocks: 16, dataCodewordsPerBlock: 25 },
],
},
{
ecCodewordsPerBlock: 24,
ecBlocks: [{ numBlocks: 34, dataCodewordsPerBlock: 13 }],
},
],
},
{
infoBits: 0x177EC,
versionNumber: 23,
alignmentPatternCenters: [6, 30, 54, 74, 102],
errorCorrectionLevels: [
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 4, dataCodewordsPerBlock: 121 },
{ numBlocks: 5, dataCodewordsPerBlock: 122 },
],
},
{
ecCodewordsPerBlock: 28,
ecBlocks: [
{ numBlocks: 4, dataCodewordsPerBlock: 47 },
{ numBlocks: 14, dataCodewordsPerBlock: 48 },
],
},
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 11, dataCodewordsPerBlock: 24 },
{ numBlocks: 14, dataCodewordsPerBlock: 25 },
],
},
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 16, dataCodewordsPerBlock: 15 },
{ numBlocks: 14, dataCodewordsPerBlock: 16 },
],
},
],
},
{
infoBits: 0x18EC4,
versionNumber: 24,
alignmentPatternCenters: [6, 28, 54, 80, 106],
errorCorrectionLevels: [
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 6, dataCodewordsPerBlock: 117 },
{ numBlocks: 4, dataCodewordsPerBlock: 118 },
],
},
{
ecCodewordsPerBlock: 28,
ecBlocks: [
{ numBlocks: 6, dataCodewordsPerBlock: 45 },
{ numBlocks: 14, dataCodewordsPerBlock: 46 },
],
},
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 11, dataCodewordsPerBlock: 24 },
{ numBlocks: 16, dataCodewordsPerBlock: 25 },
],
},
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 30, dataCodewordsPerBlock: 16 },
{ numBlocks: 2, dataCodewordsPerBlock: 17 },
],
},
],
},
{
infoBits: 0x191E1,
versionNumber: 25,
alignmentPatternCenters: [6, 32, 58, 84, 110],
errorCorrectionLevels: [
{
ecCodewordsPerBlock: 26,
ecBlocks: [
{ numBlocks: 8, dataCodewordsPerBlock: 106 },
{ numBlocks: 4, dataCodewordsPerBlock: 107 },
],
},
{
ecCodewordsPerBlock: 28,
ecBlocks: [
{ numBlocks: 8, dataCodewordsPerBlock: 47 },
{ numBlocks: 13, dataCodewordsPerBlock: 48 },
],
},
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 7, dataCodewordsPerBlock: 24 },
{ numBlocks: 22, dataCodewordsPerBlock: 25 },
],
},
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 22, dataCodewordsPerBlock: 15 },
{ numBlocks: 13, dataCodewordsPerBlock: 16 },
],
},
],
},
{
infoBits: 0x1AFAB,
versionNumber: 26,
alignmentPatternCenters: [6, 30, 58, 86, 114],
errorCorrectionLevels: [
{
ecCodewordsPerBlock: 28,
ecBlocks: [
{ numBlocks: 10, dataCodewordsPerBlock: 114 },
{ numBlocks: 2, dataCodewordsPerBlock: 115 },
],
},
{
ecCodewordsPerBlock: 28,
ecBlocks: [
{ numBlocks: 19, dataCodewordsPerBlock: 46 },
{ numBlocks: 4, dataCodewordsPerBlock: 47 },
],
},
{
ecCodewordsPerBlock: 28,
ecBlocks: [
{ numBlocks: 28, dataCodewordsPerBlock: 22 },
{ numBlocks: 6, dataCodewordsPerBlock: 23 },
],
},
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 33, dataCodewordsPerBlock: 16 },
{ numBlocks: 4, dataCodewordsPerBlock: 17 },
],
},
],
},
{
infoBits: 0x1B08E,
versionNumber: 27,
alignmentPatternCenters: [6, 34, 62, 90, 118],
errorCorrectionLevels: [
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 8, dataCodewordsPerBlock: 122 },
{ numBlocks: 4, dataCodewordsPerBlock: 123 },
],
},
{
ecCodewordsPerBlock: 28,
ecBlocks: [
{ numBlocks: 22, dataCodewordsPerBlock: 45 },
{ numBlocks: 3, dataCodewordsPerBlock: 46 },
],
},
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 8, dataCodewordsPerBlock: 23 },
{ numBlocks: 26, dataCodewordsPerBlock: 24 },
],
},
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 12, dataCodewordsPerBlock: 15 },
{ numBlocks: 28, dataCodewordsPerBlock: 16 },
],
},
],
},
{
infoBits: 0x1CC1A,
versionNumber: 28,
alignmentPatternCenters: [6, 26, 50, 74, 98, 122],
errorCorrectionLevels: [
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 3, dataCodewordsPerBlock: 117 },
{ numBlocks: 10, dataCodewordsPerBlock: 118 },
],
},
{
ecCodewordsPerBlock: 28,
ecBlocks: [
{ numBlocks: 3, dataCodewordsPerBlock: 45 },
{ numBlocks: 23, dataCodewordsPerBlock: 46 },
],
},
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 4, dataCodewordsPerBlock: 24 },
{ numBlocks: 31, dataCodewordsPerBlock: 25 },
],
},
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 11, dataCodewordsPerBlock: 15 },
{ numBlocks: 31, dataCodewordsPerBlock: 16 },
],
},
],
},
{
infoBits: 0x1D33F,
versionNumber: 29,
alignmentPatternCenters: [6, 30, 54, 78, 102, 126],
errorCorrectionLevels: [
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 7, dataCodewordsPerBlock: 116 },
{ numBlocks: 7, dataCodewordsPerBlock: 117 },
],
},
{
ecCodewordsPerBlock: 28,
ecBlocks: [
{ numBlocks: 21, dataCodewordsPerBlock: 45 },
{ numBlocks: 7, dataCodewordsPerBlock: 46 },
],
},
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 1, dataCodewordsPerBlock: 23 },
{ numBlocks: 37, dataCodewordsPerBlock: 24 },
],
},
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 19, dataCodewordsPerBlock: 15 },
{ numBlocks: 26, dataCodewordsPerBlock: 16 },
],
},
],
},
{
infoBits: 0x1ED75,
versionNumber: 30,
alignmentPatternCenters: [6, 26, 52, 78, 104, 130],
errorCorrectionLevels: [
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 5, dataCodewordsPerBlock: 115 },
{ numBlocks: 10, dataCodewordsPerBlock: 116 },
],
},
{
ecCodewordsPerBlock: 28,
ecBlocks: [
{ numBlocks: 19, dataCodewordsPerBlock: 47 },
{ numBlocks: 10, dataCodewordsPerBlock: 48 },
],
},
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 15, dataCodewordsPerBlock: 24 },
{ numBlocks: 25, dataCodewordsPerBlock: 25 },
],
},
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 23, dataCodewordsPerBlock: 15 },
{ numBlocks: 25, dataCodewordsPerBlock: 16 },
],
},
],
},
{
infoBits: 0x1F250,
versionNumber: 31,
alignmentPatternCenters: [6, 30, 56, 82, 108, 134],
errorCorrectionLevels: [
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 13, dataCodewordsPerBlock: 115 },
{ numBlocks: 3, dataCodewordsPerBlock: 116 },
],
},
{
ecCodewordsPerBlock: 28,
ecBlocks: [
{ numBlocks: 2, dataCodewordsPerBlock: 46 },
{ numBlocks: 29, dataCodewordsPerBlock: 47 },
],
},
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 42, dataCodewordsPerBlock: 24 },
{ numBlocks: 1, dataCodewordsPerBlock: 25 },
],
},
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 23, dataCodewordsPerBlock: 15 },
{ numBlocks: 28, dataCodewordsPerBlock: 16 },
],
},
],
},
{
infoBits: 0x209D5,
versionNumber: 32,
alignmentPatternCenters: [6, 34, 60, 86, 112, 138],
errorCorrectionLevels: [
{
ecCodewordsPerBlock: 30,
ecBlocks: [{ numBlocks: 17, dataCodewordsPerBlock: 115 }],
},
{
ecCodewordsPerBlock: 28,
ecBlocks: [
{ numBlocks: 10, dataCodewordsPerBlock: 46 },
{ numBlocks: 23, dataCodewordsPerBlock: 47 },
],
},
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 10, dataCodewordsPerBlock: 24 },
{ numBlocks: 35, dataCodewordsPerBlock: 25 },
],
},
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 19, dataCodewordsPerBlock: 15 },
{ numBlocks: 35, dataCodewordsPerBlock: 16 },
],
},
],
},
{
infoBits: 0x216F0,
versionNumber: 33,
alignmentPatternCenters: [6, 30, 58, 86, 114, 142],
errorCorrectionLevels: [
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 17, dataCodewordsPerBlock: 115 },
{ numBlocks: 1, dataCodewordsPerBlock: 116 },
],
},
{
ecCodewordsPerBlock: 28,
ecBlocks: [
{ numBlocks: 14, dataCodewordsPerBlock: 46 },
{ numBlocks: 21, dataCodewordsPerBlock: 47 },
],
},
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 29, dataCodewordsPerBlock: 24 },
{ numBlocks: 19, dataCodewordsPerBlock: 25 },
],
},
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 11, dataCodewordsPerBlock: 15 },
{ numBlocks: 46, dataCodewordsPerBlock: 16 },
],
},
],
},
{
infoBits: 0x228BA,
versionNumber: 34,
alignmentPatternCenters: [6, 34, 62, 90, 118, 146],
errorCorrectionLevels: [
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 13, dataCodewordsPerBlock: 115 },
{ numBlocks: 6, dataCodewordsPerBlock: 116 },
],
},
{
ecCodewordsPerBlock: 28,
ecBlocks: [
{ numBlocks: 14, dataCodewordsPerBlock: 46 },
{ numBlocks: 23, dataCodewordsPerBlock: 47 },
],
},
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 44, dataCodewordsPerBlock: 24 },
{ numBlocks: 7, dataCodewordsPerBlock: 25 },
],
},
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 59, dataCodewordsPerBlock: 16 },
{ numBlocks: 1, dataCodewordsPerBlock: 17 },
],
},
],
},
{
infoBits: 0x2379F,
versionNumber: 35,
alignmentPatternCenters: [6, 30, 54, 78, 102, 126, 150],
errorCorrectionLevels: [
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 12, dataCodewordsPerBlock: 121 },
{ numBlocks: 7, dataCodewordsPerBlock: 122 },
],
},
{
ecCodewordsPerBlock: 28,
ecBlocks: [
{ numBlocks: 12, dataCodewordsPerBlock: 47 },
{ numBlocks: 26, dataCodewordsPerBlock: 48 },
],
},
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 39, dataCodewordsPerBlock: 24 },
{ numBlocks: 14, dataCodewordsPerBlock: 25 },
],
},
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 22, dataCodewordsPerBlock: 15 },
{ numBlocks: 41, dataCodewordsPerBlock: 16 },
],
},
],
},
{
infoBits: 0x24B0B,
versionNumber: 36,
alignmentPatternCenters: [6, 24, 50, 76, 102, 128, 154],
errorCorrectionLevels: [
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 6, dataCodewordsPerBlock: 121 },
{ numBlocks: 14, dataCodewordsPerBlock: 122 },
],
},
{
ecCodewordsPerBlock: 28,
ecBlocks: [
{ numBlocks: 6, dataCodewordsPerBlock: 47 },
{ numBlocks: 34, dataCodewordsPerBlock: 48 },
],
},
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 46, dataCodewordsPerBlock: 24 },
{ numBlocks: 10, dataCodewordsPerBlock: 25 },
],
},
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 2, dataCodewordsPerBlock: 15 },
{ numBlocks: 64, dataCodewordsPerBlock: 16 },
],
},
],
},
{
infoBits: 0x2542E,
versionNumber: 37,
alignmentPatternCenters: [6, 28, 54, 80, 106, 132, 158],
errorCorrectionLevels: [
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 17, dataCodewordsPerBlock: 122 },
{ numBlocks: 4, dataCodewordsPerBlock: 123 },
],
},
{
ecCodewordsPerBlock: 28,
ecBlocks: [
{ numBlocks: 29, dataCodewordsPerBlock: 46 },
{ numBlocks: 14, dataCodewordsPerBlock: 47 },
],
},
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 49, dataCodewordsPerBlock: 24 },
{ numBlocks: 10, dataCodewordsPerBlock: 25 },
],
},
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 24, dataCodewordsPerBlock: 15 },
{ numBlocks: 46, dataCodewordsPerBlock: 16 },
],
},
],
},
{
infoBits: 0x26A64,
versionNumber: 38,
alignmentPatternCenters: [6, 32, 58, 84, 110, 136, 162],
errorCorrectionLevels: [
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 4, dataCodewordsPerBlock: 122 },
{ numBlocks: 18, dataCodewordsPerBlock: 123 },
],
},
{
ecCodewordsPerBlock: 28,
ecBlocks: [
{ numBlocks: 13, dataCodewordsPerBlock: 46 },
{ numBlocks: 32, dataCodewordsPerBlock: 47 },
],
},
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 48, dataCodewordsPerBlock: 24 },
{ numBlocks: 14, dataCodewordsPerBlock: 25 },
],
},
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 42, dataCodewordsPerBlock: 15 },
{ numBlocks: 32, dataCodewordsPerBlock: 16 },
],
},
],
},
{
infoBits: 0x27541,
versionNumber: 39,
alignmentPatternCenters: [6, 26, 54, 82, 110, 138, 166],
errorCorrectionLevels: [
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 20, dataCodewordsPerBlock: 117 },
{ numBlocks: 4, dataCodewordsPerBlock: 118 },
],
},
{
ecCodewordsPerBlock: 28,
ecBlocks: [
{ numBlocks: 40, dataCodewordsPerBlock: 47 },
{ numBlocks: 7, dataCodewordsPerBlock: 48 },
],
},
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 43, dataCodewordsPerBlock: 24 },
{ numBlocks: 22, dataCodewordsPerBlock: 25 },
],
},
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 10, dataCodewordsPerBlock: 15 },
{ numBlocks: 67, dataCodewordsPerBlock: 16 },
],
},
],
},
{
infoBits: 0x28C69,
versionNumber: 40,
alignmentPatternCenters: [6, 30, 58, 86, 114, 142, 170],
errorCorrectionLevels: [
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 19, dataCodewordsPerBlock: 118 },
{ numBlocks: 6, dataCodewordsPerBlock: 119 },
],
},
{
ecCodewordsPerBlock: 28,
ecBlocks: [
{ numBlocks: 18, dataCodewordsPerBlock: 47 },
{ numBlocks: 31, dataCodewordsPerBlock: 48 },
],
},
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 34, dataCodewordsPerBlock: 24 },
{ numBlocks: 34, dataCodewordsPerBlock: 25 },
],
},
{
ecCodewordsPerBlock: 30,
ecBlocks: [
{ numBlocks: 20, dataCodewordsPerBlock: 15 },
{ numBlocks: 61, dataCodewordsPerBlock: 16 },
],
},
],
},
];
/***/ }),
/* 11 */
/***/ (function(module, exports, __nested_webpack_require_231645__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var BitMatrix_1 = __nested_webpack_require_231645__(0);
function squareToQuadrilateral(p1, p2, p3, p4) {
var dx3 = p1.x - p2.x + p3.x - p4.x;
var dy3 = p1.y - p2.y + p3.y - p4.y;
if (dx3 === 0 && dy3 === 0) { // Affine
return {
a11: p2.x - p1.x,
a12: p2.y - p1.y,
a13: 0,
a21: p3.x - p2.x,
a22: p3.y - p2.y,
a23: 0,
a31: p1.x,
a32: p1.y,
a33: 1,
};
}
else {
var dx1 = p2.x - p3.x;
var dx2 = p4.x - p3.x;
var dy1 = p2.y - p3.y;
var dy2 = p4.y - p3.y;
var denominator = dx1 * dy2 - dx2 * dy1;
var a13 = (dx3 * dy2 - dx2 * dy3) / denominator;
var a23 = (dx1 * dy3 - dx3 * dy1) / denominator;
return {
a11: p2.x - p1.x + a13 * p2.x,
a12: p2.y - p1.y + a13 * p2.y,
a13: a13,
a21: p4.x - p1.x + a23 * p4.x,
a22: p4.y - p1.y + a23 * p4.y,
a23: a23,
a31: p1.x,
a32: p1.y,
a33: 1,
};
}
}
function quadrilateralToSquare(p1, p2, p3, p4) {
// Here, the adjoint serves as the inverse:
var sToQ = squareToQuadrilateral(p1, p2, p3, p4);
return {
a11: sToQ.a22 * sToQ.a33 - sToQ.a23 * sToQ.a32,
a12: sToQ.a13 * sToQ.a32 - sToQ.a12 * sToQ.a33,
a13: sToQ.a12 * sToQ.a23 - sToQ.a13 * sToQ.a22,
a21: sToQ.a23 * sToQ.a31 - sToQ.a21 * sToQ.a33,
a22: sToQ.a11 * sToQ.a33 - sToQ.a13 * sToQ.a31,
a23: sToQ.a13 * sToQ.a21 - sToQ.a11 * sToQ.a23,
a31: sToQ.a21 * sToQ.a32 - sToQ.a22 * sToQ.a31,
a32: sToQ.a12 * sToQ.a31 - sToQ.a11 * sToQ.a32,
a33: sToQ.a11 * sToQ.a22 - sToQ.a12 * sToQ.a21,
};
}
function times(a, b) {
return {
a11: a.a11 * b.a11 + a.a21 * b.a12 + a.a31 * b.a13,
a12: a.a12 * b.a11 + a.a22 * b.a12 + a.a32 * b.a13,
a13: a.a13 * b.a11 + a.a23 * b.a12 + a.a33 * b.a13,
a21: a.a11 * b.a21 + a.a21 * b.a22 + a.a31 * b.a23,
a22: a.a12 * b.a21 + a.a22 * b.a22 + a.a32 * b.a23,
a23: a.a13 * b.a21 + a.a23 * b.a22 + a.a33 * b.a23,
a31: a.a11 * b.a31 + a.a21 * b.a32 + a.a31 * b.a33,
a32: a.a12 * b.a31 + a.a22 * b.a32 + a.a32 * b.a33,
a33: a.a13 * b.a31 + a.a23 * b.a32 + a.a33 * b.a33,
};
}
function extract(image, location) {
var qToS = quadrilateralToSquare({ x: 3.5, y: 3.5 }, { x: location.dimension - 3.5, y: 3.5 }, { x: location.dimension - 6.5, y: location.dimension - 6.5 }, { x: 3.5, y: location.dimension - 3.5 });
var sToQ = squareToQuadrilateral(location.topLeft, location.topRight, location.alignmentPattern, location.bottomLeft);
var transform = times(sToQ, qToS);
var matrix = BitMatrix_1.BitMatrix.createEmpty(location.dimension, location.dimension);
var mappingFunction = function (x, y) {
var denominator = transform.a13 * x + transform.a23 * y + transform.a33;
return {
x: (transform.a11 * x + transform.a21 * y + transform.a31) / denominator,
y: (transform.a12 * x + transform.a22 * y + transform.a32) / denominator,
};
};
for (var y = 0; y < location.dimension; y++) {
for (var x = 0; x < location.dimension; x++) {
var xValue = x + 0.5;
var yValue = y + 0.5;
var sourcePixel = mappingFunction(xValue, yValue);
matrix.set(x, y, image.get(Math.floor(sourcePixel.x), Math.floor(sourcePixel.y)));
}
}
return {
matrix: matrix,
mappingFunction: mappingFunction,
};
}
exports.extract = extract;
/***/ }),
/* 12 */
/***/ (function(module, exports, __nccwpck_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var MAX_FINDERPATTERNS_TO_SEARCH = 4;
var MIN_QUAD_RATIO = 0.5;
var MAX_QUAD_RATIO = 1.5;
var distance = function (a, b) { return Math.sqrt(Math.pow((b.x - a.x), 2) + Math.pow((b.y - a.y), 2)); };
function sum(values) {
return values.reduce(function (a, b) { return a + b; });
}
// Takes three finder patterns and organizes them into topLeft, topRight, etc
function reorderFinderPatterns(pattern1, pattern2, pattern3) {
var _a, _b, _c, _d;
// Find distances between pattern centers
var oneTwoDistance = distance(pattern1, pattern2);
var twoThreeDistance = distance(pattern2, pattern3);
var oneThreeDistance = distance(pattern1, pattern3);
var bottomLeft;
var topLeft;
var topRight;
// Assume one closest to other two is B; A and C will just be guesses at first
if (twoThreeDistance >= oneTwoDistance && twoThreeDistance >= oneThreeDistance) {
_a = [pattern2, pattern1, pattern3], bottomLeft = _a[0], topLeft = _a[1], topRight = _a[2];
}
else if (oneThreeDistance >= twoThreeDistance && oneThreeDistance >= oneTwoDistance) {
_b = [pattern1, pattern2, pattern3], bottomLeft = _b[0], topLeft = _b[1], topRight = _b[2];
}
else {
_c = [pattern1, pattern3, pattern2], bottomLeft = _c[0], topLeft = _c[1], topRight = _c[2];
}
// Use cross product to figure out whether bottomLeft (A) and topRight (C) are correct or flipped in relation to topLeft (B)
// This asks whether BC x BA has a positive z component, which is the arrangement we want. If it's negative, then
// we've got it flipped around and should swap topRight and bottomLeft.
if (((topRight.x - topLeft.x) * (bottomLeft.y - topLeft.y)) - ((topRight.y - topLeft.y) * (bottomLeft.x - topLeft.x)) < 0) {
_d = [topRight, bottomLeft], bottomLeft = _d[0], topRight = _d[1];
}
return { bottomLeft: bottomLeft, topLeft: topLeft, topRight: topRight };
}
// Computes the dimension (number of modules on a side) of the QR Code based on the position of the finder patterns
function computeDimension(topLeft, topRight, bottomLeft, matrix) {
var moduleSize = (sum(countBlackWhiteRun(topLeft, bottomLeft, matrix, 5)) / 7 + // Divide by 7 since the ratio is 1:1:3:1:1
sum(countBlackWhiteRun(topLeft, topRight, matrix, 5)) / 7 +
sum(countBlackWhiteRun(bottomLeft, topLeft, matrix, 5)) / 7 +
sum(countBlackWhiteRun(topRight, topLeft, matrix, 5)) / 7) / 4;
if (moduleSize < 1) {
throw new Error("Invalid module size");
}
var topDimension = Math.round(distance(topLeft, topRight) / moduleSize);
var sideDimension = Math.round(distance(topLeft, bottomLeft) / moduleSize);
var dimension = Math.floor((topDimension + sideDimension) / 2) + 7;
switch (dimension % 4) {
case 0:
dimension++;
break;
case 2:
dimension--;
break;
}
return { dimension: dimension, moduleSize: moduleSize };
}
// Takes an origin point and an end point and counts the sizes of the black white run from the origin towards the end point.
// Returns an array of elements, representing the pixel size of the black white run.
// Uses a variant of http://en.wikipedia.org/wiki/Bresenham's_line_algorithm
function countBlackWhiteRunTowardsPoint(origin, end, matrix, length) {
var switchPoints = [{ x: Math.floor(origin.x), y: Math.floor(origin.y) }];
var steep = Math.abs(end.y - origin.y) > Math.abs(end.x - origin.x);
var fromX;
var fromY;
var toX;
var toY;
if (steep) {
fromX = Math.floor(origin.y);
fromY = Math.floor(origin.x);
toX = Math.floor(end.y);
toY = Math.floor(end.x);
}
else {
fromX = Math.floor(origin.x);
fromY = Math.floor(origin.y);
toX = Math.floor(end.x);
toY = Math.floor(end.y);
}
var dx = Math.abs(toX - fromX);
var dy = Math.abs(toY - fromY);
var error = Math.floor(-dx / 2);
var xStep = fromX < toX ? 1 : -1;
var yStep = fromY < toY ? 1 : -1;
var currentPixel = true;
// Loop up until x == toX, but not beyond
for (var x = fromX, y = fromY; x !== toX + xStep; x += xStep) {
// Does current pixel mean we have moved white to black or vice versa?
// Scanning black in state 0,2 and white in state 1, so if we find the wrong
// color, advance to next state or end if we are in state 2 already
var realX = steep ? y : x;
var realY = steep ? x : y;
if (matrix.get(realX, realY) !== currentPixel) {
currentPixel = !currentPixel;
switchPoints.push({ x: realX, y: realY });
if (switchPoints.length === length + 1) {
break;
}
}
error += dy;
if (error > 0) {
if (y === toY) {
break;
}
y += yStep;
error -= dx;
}
}
var distances = [];
for (var i = 0; i < length; i++) {
if (switchPoints[i] && switchPoints[i + 1]) {
distances.push(distance(switchPoints[i], switchPoints[i + 1]));
}
else {
distances.push(0);
}
}
return distances;
}
// Takes an origin point and an end point and counts the sizes of the black white run in the origin point
// along the line that intersects with the end point. Returns an array of elements, representing the pixel sizes
// of the black white run. Takes a length which represents the number of switches from black to white to look for.
function countBlackWhiteRun(origin, end, matrix, length) {
var _a;
var rise = end.y - origin.y;
var run = end.x - origin.x;
var towardsEnd = countBlackWhiteRunTowardsPoint(origin, end, matrix, Math.ceil(length / 2));
var awayFromEnd = countBlackWhiteRunTowardsPoint(origin, { x: origin.x - run, y: origin.y - rise }, matrix, Math.ceil(length / 2));
var middleValue = towardsEnd.shift() + awayFromEnd.shift() - 1; // Substract one so we don't double count a pixel
return (_a = awayFromEnd.concat(middleValue)).concat.apply(_a, towardsEnd);
}
// Takes in a black white run and an array of expected ratios. Returns the average size of the run as well as the "error" -
// that is the amount the run diverges from the expected ratio
function scoreBlackWhiteRun(sequence, ratios) {
var averageSize = sum(sequence) / sum(ratios);
var error = 0;
ratios.forEach(function (ratio, i) {
error += Math.pow((sequence[i] - ratio * averageSize), 2);
});
return { averageSize: averageSize, error: error };
}
// Takes an X,Y point and an array of sizes and scores the point against those ratios.
// For example for a finder pattern takes the ratio list of 1:1:3:1:1 and checks horizontal, vertical and diagonal ratios
// against that.
function scorePattern(point, ratios, matrix) {
try {
var horizontalRun = countBlackWhiteRun(point, { x: -1, y: point.y }, matrix, ratios.length);
var verticalRun = countBlackWhiteRun(point, { x: point.x, y: -1 }, matrix, ratios.length);
var topLeftPoint = {
x: Math.max(0, point.x - point.y) - 1,
y: Math.max(0, point.y - point.x) - 1,
};
var topLeftBottomRightRun = countBlackWhiteRun(point, topLeftPoint, matrix, ratios.length);
var bottomLeftPoint = {
x: Math.min(matrix.width, point.x + point.y) + 1,
y: Math.min(matrix.height, point.y + point.x) + 1,
};
var bottomLeftTopRightRun = countBlackWhiteRun(point, bottomLeftPoint, matrix, ratios.length);
var horzError = scoreBlackWhiteRun(horizontalRun, ratios);
var vertError = scoreBlackWhiteRun(verticalRun, ratios);
var diagDownError = scoreBlackWhiteRun(topLeftBottomRightRun, ratios);
var diagUpError = scoreBlackWhiteRun(bottomLeftTopRightRun, ratios);
var ratioError = Math.sqrt(horzError.error * horzError.error +
vertError.error * vertError.error +
diagDownError.error * diagDownError.error +
diagUpError.error * diagUpError.error);
var avgSize = (horzError.averageSize + vertError.averageSize + diagDownError.averageSize + diagUpError.averageSize) / 4;
var sizeError = (Math.pow((horzError.averageSize - avgSize), 2) +
Math.pow((vertError.averageSize - avgSize), 2) +
Math.pow((diagDownError.averageSize - avgSize), 2) +
Math.pow((diagUpError.averageSize - avgSize), 2)) / avgSize;
return ratioError + sizeError;
}
catch (_a) {
return Infinity;
}
}
function recenterLocation(matrix, p) {
var leftX = Math.round(p.x);
while (matrix.get(leftX, Math.round(p.y))) {
leftX--;
}
var rightX = Math.round(p.x);
while (matrix.get(rightX, Math.round(p.y))) {
rightX++;
}
var x = (leftX + rightX) / 2;
var topY = Math.round(p.y);
while (matrix.get(Math.round(x), topY)) {
topY--;
}
var bottomY = Math.round(p.y);
while (matrix.get(Math.round(x), bottomY)) {
bottomY++;
}
var y = (topY + bottomY) / 2;
return { x: x, y: y };
}
function locate(matrix) {
var finderPatternQuads = [];
var activeFinderPatternQuads = [];
var alignmentPatternQuads = [];
var activeAlignmentPatternQuads = [];
var _loop_1 = function (y) {
var length_1 = 0;
var lastBit = false;
var scans = [0, 0, 0, 0, 0];
var _loop_2 = function (x) {
var v = matrix.get(x, y);
if (v === lastBit) {
length_1++;
}
else {
scans = [scans[1], scans[2], scans[3], scans[4], length_1];
length_1 = 1;
lastBit = v;
// Do the last 5 color changes ~ match the expected ratio for a finder pattern? 1:1:3:1:1 of b:w:b:w:b
var averageFinderPatternBlocksize = sum(scans) / 7;
var validFinderPattern = Math.abs(scans[0] - averageFinderPatternBlocksize) < averageFinderPatternBlocksize &&
Math.abs(scans[1] - averageFinderPatternBlocksize) < averageFinderPatternBlocksize &&
Math.abs(scans[2] - 3 * averageFinderPatternBlocksize) < 3 * averageFinderPatternBlocksize &&
Math.abs(scans[3] - averageFinderPatternBlocksize) < averageFinderPatternBlocksize &&
Math.abs(scans[4] - averageFinderPatternBlocksize) < averageFinderPatternBlocksize &&
!v; // And make sure the current pixel is white since finder patterns are bordered in white
// Do the last 3 color changes ~ match the expected ratio for an alignment pattern? 1:1:1 of w:b:w
var averageAlignmentPatternBlocksize = sum(scans.slice(-3)) / 3;
var validAlignmentPattern = Math.abs(scans[2] - averageAlignmentPatternBlocksize) < averageAlignmentPatternBlocksize &&
Math.abs(scans[3] - averageAlignmentPatternBlocksize) < averageAlignmentPatternBlocksize &&
Math.abs(scans[4] - averageAlignmentPatternBlocksize) < averageAlignmentPatternBlocksize &&
v; // Is the current pixel black since alignment patterns are bordered in black
if (validFinderPattern) {
// Compute the start and end x values of the large center black square
var endX_1 = x - scans[3] - scans[4];
var startX_1 = endX_1 - scans[2];
var line = { startX: startX_1, endX: endX_1, y: y };
// Is there a quad directly above the current spot? If so, extend it with the new line. Otherwise, create a new quad with
// that line as the starting point.
var matchingQuads = activeFinderPatternQuads.filter(function (q) {
return (startX_1 >= q.bottom.startX && startX_1 <= q.bottom.endX) ||
(endX_1 >= q.bottom.startX && startX_1 <= q.bottom.endX) ||
(startX_1 <= q.bottom.startX && endX_1 >= q.bottom.endX && ((scans[2] / (q.bottom.endX - q.bottom.startX)) < MAX_QUAD_RATIO &&
(scans[2] / (q.bottom.endX - q.bottom.startX)) > MIN_QUAD_RATIO));
});
if (matchingQuads.length > 0) {
matchingQuads[0].bottom = line;
}
else {
activeFinderPatternQuads.push({ top: line, bottom: line });
}
}
if (validAlignmentPattern) {
// Compute the start and end x values of the center black square
var endX_2 = x - scans[4];
var startX_2 = endX_2 - scans[3];
var line = { startX: startX_2, y: y, endX: endX_2 };
// Is there a quad directly above the current spot? If so, extend it with the new line. Otherwise, create a new quad with
// that line as the starting point.
var matchingQuads = activeAlignmentPatternQuads.filter(function (q) {
return (startX_2 >= q.bottom.startX && startX_2 <= q.bottom.endX) ||
(endX_2 >= q.bottom.startX && startX_2 <= q.bottom.endX) ||
(startX_2 <= q.bottom.startX && endX_2 >= q.bottom.endX && ((scans[2] / (q.bottom.endX - q.bottom.startX)) < MAX_QUAD_RATIO &&
(scans[2] / (q.bottom.endX - q.bottom.startX)) > MIN_QUAD_RATIO));
});
if (matchingQuads.length > 0) {
matchingQuads[0].bottom = line;
}
else {
activeAlignmentPatternQuads.push({ top: line, bottom: line });
}
}
}
};
for (var x = -1; x <= matrix.width; x++) {
_loop_2(x);
}
finderPatternQuads.push.apply(finderPatternQuads, activeFinderPatternQuads.filter(function (q) { return q.bottom.y !== y && q.bottom.y - q.top.y >= 2; }));
activeFinderPatternQuads = activeFinderPatternQuads.filter(function (q) { return q.bottom.y === y; });
alignmentPatternQuads.push.apply(alignmentPatternQuads, activeAlignmentPatternQuads.filter(function (q) { return q.bottom.y !== y; }));
activeAlignmentPatternQuads = activeAlignmentPatternQuads.filter(function (q) { return q.bottom.y === y; });
};
for (var y = 0; y <= matrix.height; y++) {
_loop_1(y);
}
finderPatternQuads.push.apply(finderPatternQuads, activeFinderPatternQuads.filter(function (q) { return q.bottom.y - q.top.y >= 2; }));
alignmentPatternQuads.push.apply(alignmentPatternQuads, activeAlignmentPatternQuads);
var finderPatternGroups = finderPatternQuads
.filter(function (q) { return q.bottom.y - q.top.y >= 2; }) // All quads must be at least 2px tall since the center square is larger than a block
.map(function (q) {
var x = (q.top.startX + q.top.endX + q.bottom.startX + q.bottom.endX) / 4;
var y = (q.top.y + q.bottom.y + 1) / 2;
if (!matrix.get(Math.round(x), Math.round(y))) {
return;
}
var lengths = [q.top.endX - q.top.startX, q.bottom.endX - q.bottom.startX, q.bottom.y - q.top.y + 1];
var size = sum(lengths) / lengths.length;
var score = scorePattern({ x: Math.round(x), y: Math.round(y) }, [1, 1, 3, 1, 1], matrix);
return { score: score, x: x, y: y, size: size };
})
.filter(function (q) { return !!q; }) // Filter out any rejected quads from above
.sort(function (a, b) { return a.score - b.score; })
// Now take the top finder pattern options and try to find 2 other options with a similar size.
.map(function (point, i, finderPatterns) {
if (i > MAX_FINDERPATTERNS_TO_SEARCH) {
return null;
}
var otherPoints = finderPatterns
.filter(function (p, ii) { return i !== ii; })
.map(function (p) { return ({ x: p.x, y: p.y, score: p.score + (Math.pow((p.size - point.size), 2)) / point.size, size: p.size }); })
.sort(function (a, b) { return a.score - b.score; });
if (otherPoints.length < 2) {
return null;
}
var score = point.score + otherPoints[0].score + otherPoints[1].score;
return { points: [point].concat(otherPoints.slice(0, 2)), score: score };
})
.filter(function (q) { return !!q; }) // Filter out any rejected finder patterns from above
.sort(function (a, b) { return a.score - b.score; });
if (finderPatternGroups.length === 0) {
return null;
}
var _a = reorderFinderPatterns(finderPatternGroups[0].points[0], finderPatternGroups[0].points[1], finderPatternGroups[0].points[2]), topRight = _a.topRight, topLeft = _a.topLeft, bottomLeft = _a.bottomLeft;
var alignment = findAlignmentPattern(matrix, alignmentPatternQuads, topRight, topLeft, bottomLeft);
var result = [];
if (alignment) {
result.push({
alignmentPattern: { x: alignment.alignmentPattern.x, y: alignment.alignmentPattern.y },
bottomLeft: { x: bottomLeft.x, y: bottomLeft.y },
dimension: alignment.dimension,
topLeft: { x: topLeft.x, y: topLeft.y },
topRight: { x: topRight.x, y: topRight.y },
});
}
// We normally use the center of the quads as the location of the tracking points, which is optimal for most cases and will account
// for a skew in the image. However, In some cases, a slight skew might not be real and instead be caused by image compression
// errors and/or low resolution. For those cases, we'd be better off centering the point exactly in the middle of the black area. We
// compute and return the location data for the naively centered points as it is little additional work and allows for multiple
// attempts at decoding harder images.
var midTopRight = recenterLocation(matrix, topRight);
var midTopLeft = recenterLocation(matrix, topLeft);
var midBottomLeft = recenterLocation(matrix, bottomLeft);
var centeredAlignment = findAlignmentPattern(matrix, alignmentPatternQuads, midTopRight, midTopLeft, midBottomLeft);
if (centeredAlignment) {
result.push({
alignmentPattern: { x: centeredAlignment.alignmentPattern.x, y: centeredAlignment.alignmentPattern.y },
bottomLeft: { x: midBottomLeft.x, y: midBottomLeft.y },
topLeft: { x: midTopLeft.x, y: midTopLeft.y },
topRight: { x: midTopRight.x, y: midTopRight.y },
dimension: centeredAlignment.dimension,
});
}
if (result.length === 0) {
return null;
}
return result;
}
exports.locate = locate;
function findAlignmentPattern(matrix, alignmentPatternQuads, topRight, topLeft, bottomLeft) {
var _a;
// Now that we've found the three finder patterns we can determine the blockSize and the size of the QR code.
// We'll use these to help find the alignment pattern but also later when we do the extraction.
var dimension;
var moduleSize;
try {
(_a = computeDimension(topLeft, topRight, bottomLeft, matrix), dimension = _a.dimension, moduleSize = _a.moduleSize);
}
catch (e) {
return null;
}
// Now find the alignment pattern
var bottomRightFinderPattern = {
x: topRight.x - topLeft.x + bottomLeft.x,
y: topRight.y - topLeft.y + bottomLeft.y,
};
var modulesBetweenFinderPatterns = ((distance(topLeft, bottomLeft) + distance(topLeft, topRight)) / 2 / moduleSize);
var correctionToTopLeft = 1 - (3 / modulesBetweenFinderPatterns);
var expectedAlignmentPattern = {
x: topLeft.x + correctionToTopLeft * (bottomRightFinderPattern.x - topLeft.x),
y: topLeft.y + correctionToTopLeft * (bottomRightFinderPattern.y - topLeft.y),
};
var alignmentPatterns = alignmentPatternQuads
.map(function (q) {
var x = (q.top.startX + q.top.endX + q.bottom.startX + q.bottom.endX) / 4;
var y = (q.top.y + q.bottom.y + 1) / 2;
if (!matrix.get(Math.floor(x), Math.floor(y))) {
return;
}
var lengths = [q.top.endX - q.top.startX, q.bottom.endX - q.bottom.startX, (q.bottom.y - q.top.y + 1)];
var size = sum(lengths) / lengths.length;
var sizeScore = scorePattern({ x: Math.floor(x), y: Math.floor(y) }, [1, 1, 1], matrix);
var score = sizeScore + distance({ x: x, y: y }, expectedAlignmentPattern);
return { x: x, y: y, score: score };
})
.filter(function (v) { return !!v; })
.sort(function (a, b) { return a.score - b.score; });
// If there are less than 15 modules between finder patterns it's a version 1 QR code and as such has no alignmemnt pattern
// so we can only use our best guess.
var alignmentPattern = modulesBetweenFinderPatterns >= 15 && alignmentPatterns.length ? alignmentPatterns[0] : expectedAlignmentPattern;
return { alignmentPattern: alignmentPattern, dimension: dimension };
}
/***/ })
/******/ ])["default"];
});
/***/ }),
/***/ 9919:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
var fs = __nccwpck_require__(7147)
var url = __nccwpck_require__(7310)
var path = __nccwpck_require__(1017)
var request = __nccwpck_require__(6130)
var parseASCII = __nccwpck_require__(5807)
var parseXML = __nccwpck_require__(1199)
var readBinary = __nccwpck_require__(4563)
var mime = __nccwpck_require__(5018)
var noop = function() {}
var isBinary = __nccwpck_require__(9597)
function parseFont(file, data, cb) {
var result, binary
if (isBinary(data)) {
if (typeof data === 'string') data = Buffer.from(data, 'binary')
binary = true
} else data = data.toString().trim()
try {
if (binary) result = readBinary(data)
else if (/json/.test(mime.lookup(file)) || data.charAt(0) === '{')
result = JSON.parse(data)
else if (/xml/.test(mime.lookup(file)) || data.charAt(0) === '<')
result = parseXML(data)
else result = parseASCII(data)
} catch (e) {
cb(e)
cb = noop
}
cb(null, result)
}
module.exports = function loadFont(opt, cb) {
cb = typeof cb === 'function' ? cb : noop
if (typeof opt === 'string') opt = { uri: opt, url: opt }
else if (!opt) opt = {}
var file = opt.uri || opt.url
function handleData(err, data) {
if (err) return cb(err)
parseFont(file, data.body || data, cb)
}
if (url.parse(file).host) {
request(opt, handleData)
} else {
fs.readFile(file, opt, handleData)
}
}
/***/ }),
/***/ 9597:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
var equal = __nccwpck_require__(4664)
var HEADER = Buffer.from([66, 77, 70, 3])
module.exports = function(buf) {
if (typeof buf === 'string')
return buf.substring(0, 3) === 'BMF'
return buf.length > 4 && equal(buf.slice(0, 4), HEADER)
}
/***/ }),
/***/ 5018:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
var path = __nccwpck_require__(1017);
var fs = __nccwpck_require__(7147);
function Mime() {
// Map of extension -> mime type
this.types = Object.create(null);
// Map of mime type -> extension
this.extensions = Object.create(null);
}
/**
* Define mimetype -> extension mappings. Each key is a mime-type that maps
* to an array of extensions associated with the type. The first extension is
* used as the default extension for the type.
*
* e.g. mime.define({'audio/ogg', ['oga', 'ogg', 'spx']});
*
* @param map (Object) type definitions
*/
Mime.prototype.define = function (map) {
for (var type in map) {
var exts = map[type];
for (var i = 0; i < exts.length; i++) {
if (process.env.DEBUG_MIME && this.types[exts[i]]) {
console.warn((this._loading || "define()").replace(/.*\//, ''), 'changes "' + exts[i] + '" extension type from ' +
this.types[exts[i]] + ' to ' + type);
}
this.types[exts[i]] = type;
}
// Default extension is the first one we encounter
if (!this.extensions[type]) {
this.extensions[type] = exts[0];
}
}
};
/**
* Load an Apache2-style ".types" file
*
* This may be called multiple times (it's expected). Where files declare
* overlapping types/extensions, the last file wins.
*
* @param file (String) path of file to load.
*/
Mime.prototype.load = function(file) {
this._loading = file;
// Read file and split into lines
var map = {},
content = fs.readFileSync(file, 'ascii'),
lines = content.split(/[\r\n]+/);
lines.forEach(function(line) {
// Clean up whitespace/comments, and split into fields
var fields = line.replace(/\s*#.*|^\s*|\s*$/g, '').split(/\s+/);
map[fields.shift()] = fields;
});
this.define(map);
this._loading = null;
};
/**
* Lookup a mime type based on extension
*/
Mime.prototype.lookup = function(path, fallback) {
var ext = path.replace(/^.*[\.\/\\]/, '').toLowerCase();
return this.types[ext] || fallback || this.default_type;
};
/**
* Return file extension associated with a mime type
*/
Mime.prototype.extension = function(mimeType) {
var type = mimeType.match(/^\s*([^;\s]*)(?:;|\s|$)/)[1].toLowerCase();
return this.extensions[type];
};
// Default instance
var mime = new Mime();
// Define built-in types
mime.define(__nccwpck_require__(5799));
// Default type
mime.default_type = mime.lookup('bin');
//
// Additional API specific to the default instance
//
mime.Mime = Mime;
/**
* Lookup a charset based on mime type.
*/
mime.charsets = {
lookup: function(mimeType, fallback) {
// Assume text types are utf8
return (/^text\/|^application\/(javascript|json)/).test(mimeType) ? 'UTF-8' : fallback;
}
};
module.exports = mime;
/***/ }),
/***/ 467:
/***/ ((module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var Stream = _interopDefault(__nccwpck_require__(2781));
var http = _interopDefault(__nccwpck_require__(3685));
var Url = _interopDefault(__nccwpck_require__(7310));
var whatwgUrl = _interopDefault(__nccwpck_require__(8665));
var https = _interopDefault(__nccwpck_require__(5687));
var zlib = _interopDefault(__nccwpck_require__(9796));
// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js
// fix for "Readable" isn't a named export issue
const Readable = Stream.Readable;
const BUFFER = Symbol('buffer');
const TYPE = Symbol('type');
class Blob {
constructor() {
this[TYPE] = '';
const blobParts = arguments[0];
const options = arguments[1];
const buffers = [];
let size = 0;
if (blobParts) {
const a = blobParts;
const length = Number(a.length);
for (let i = 0; i < length; i++) {
const element = a[i];
let buffer;
if (element instanceof Buffer) {
buffer = element;
} else if (ArrayBuffer.isView(element)) {
buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);
} else if (element instanceof ArrayBuffer) {
buffer = Buffer.from(element);
} else if (element instanceof Blob) {
buffer = element[BUFFER];
} else {
buffer = Buffer.from(typeof element === 'string' ? element : String(element));
}
size += buffer.length;
buffers.push(buffer);
}
}
this[BUFFER] = Buffer.concat(buffers);
let type = options && options.type !== undefined && String(options.type).toLowerCase();
if (type && !/[^\u0020-\u007E]/.test(type)) {
this[TYPE] = type;
}
}
get size() {
return this[BUFFER].length;
}
get type() {
return this[TYPE];
}
text() {
return Promise.resolve(this[BUFFER].toString());
}
arrayBuffer() {
const buf = this[BUFFER];
const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
return Promise.resolve(ab);
}
stream() {
const readable = new Readable();
readable._read = function () {};
readable.push(this[BUFFER]);
readable.push(null);
return readable;
}
toString() {
return '[object Blob]';
}
slice() {
const size = this.size;
const start = arguments[0];
const end = arguments[1];
let relativeStart, relativeEnd;
if (start === undefined) {
relativeStart = 0;
} else if (start < 0) {
relativeStart = Math.max(size + start, 0);
} else {
relativeStart = Math.min(start, size);
}
if (end === undefined) {
relativeEnd = size;
} else if (end < 0) {
relativeEnd = Math.max(size + end, 0);
} else {
relativeEnd = Math.min(end, size);
}
const span = Math.max(relativeEnd - relativeStart, 0);
const buffer = this[BUFFER];
const slicedBuffer = buffer.slice(relativeStart, relativeStart + span);
const blob = new Blob([], { type: arguments[2] });
blob[BUFFER] = slicedBuffer;
return blob;
}
}
Object.defineProperties(Blob.prototype, {
size: { enumerable: true },
type: { enumerable: true },
slice: { enumerable: true }
});
Object.defineProperty(Blob.prototype, Symbol.toStringTag, {
value: 'Blob',
writable: false,
enumerable: false,
configurable: true
});
/**
* fetch-error.js
*
* FetchError interface for operational errors
*/
/**
* Create FetchError instance
*
* @param String message Error message for human
* @param String type Error type for machine
* @param String systemError For Node.js system error
* @return FetchError
*/
function FetchError(message, type, systemError) {
Error.call(this, message);
this.message = message;
this.type = type;
// when err.type is `system`, err.code contains system error code
if (systemError) {
this.code = this.errno = systemError.code;
}
// hide custom error implementation details from end-users
Error.captureStackTrace(this, this.constructor);
}
FetchError.prototype = Object.create(Error.prototype);
FetchError.prototype.constructor = FetchError;
FetchError.prototype.name = 'FetchError';
let convert;
try {
convert = (__nccwpck_require__(2877).convert);
} catch (e) {}
const INTERNALS = Symbol('Body internals');
// fix an issue where "PassThrough" isn't a named export for node <10
const PassThrough = Stream.PassThrough;
/**
* Body mixin
*
* Ref: https://fetch.spec.whatwg.org/#body
*
* @param Stream body Readable stream
* @param Object opts Response options
* @return Void
*/
function Body(body) {
var _this = this;
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
_ref$size = _ref.size;
let size = _ref$size === undefined ? 0 : _ref$size;
var _ref$timeout = _ref.timeout;
let timeout = _ref$timeout === undefined ? 0 : _ref$timeout;
if (body == null) {
// body is undefined or null
body = null;
} else if (isURLSearchParams(body)) {
// body is a URLSearchParams
body = Buffer.from(body.toString());
} else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
// body is ArrayBuffer
body = Buffer.from(body);
} else if (ArrayBuffer.isView(body)) {
// body is ArrayBufferView
body = Buffer.from(body.buffer, body.byteOffset, body.byteLength);
} else if (body instanceof Stream) ; else {
// none of the above
// coerce to string then buffer
body = Buffer.from(String(body));
}
this[INTERNALS] = {
body,
disturbed: false,
error: null
};
this.size = size;
this.timeout = timeout;
if (body instanceof Stream) {
body.on('error', function (err) {
const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);
_this[INTERNALS].error = error;
});
}
}
Body.prototype = {
get body() {
return this[INTERNALS].body;
},
get bodyUsed() {
return this[INTERNALS].disturbed;
},
/**
* Decode response as ArrayBuffer
*
* @return Promise
*/
arrayBuffer() {
return consumeBody.call(this).then(function (buf) {
return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
});
},
/**
* Return raw response as Blob
*
* @return Promise
*/
blob() {
let ct = this.headers && this.headers.get('content-type') || '';
return consumeBody.call(this).then(function (buf) {
return Object.assign(
// Prevent copying
new Blob([], {
type: ct.toLowerCase()
}), {
[BUFFER]: buf
});
});
},
/**
* Decode response as json
*
* @return Promise
*/
json() {
var _this2 = this;
return consumeBody.call(this).then(function (buffer) {
try {
return JSON.parse(buffer.toString());
} catch (err) {
return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));
}
});
},
/**
* Decode response as text
*
* @return Promise
*/
text() {
return consumeBody.call(this).then(function (buffer) {
return buffer.toString();
});
},
/**
* Decode response as buffer (non-spec api)
*
* @return Promise
*/
buffer() {
return consumeBody.call(this);
},
/**
* Decode response as text, while automatically detecting the encoding and
* trying to decode to UTF-8 (non-spec api)
*
* @return Promise
*/
textConverted() {
var _this3 = this;
return consumeBody.call(this).then(function (buffer) {
return convertBody(buffer, _this3.headers);
});
}
};
// In browsers, all properties are enumerable.
Object.defineProperties(Body.prototype, {
body: { enumerable: true },
bodyUsed: { enumerable: true },
arrayBuffer: { enumerable: true },
blob: { enumerable: true },
json: { enumerable: true },
text: { enumerable: true }
});
Body.mixIn = function (proto) {
for (const name of Object.getOwnPropertyNames(Body.prototype)) {
// istanbul ignore else: future proof
if (!(name in proto)) {
const desc = Object.getOwnPropertyDescriptor(Body.prototype, name);
Object.defineProperty(proto, name, desc);
}
}
};
/**
* Consume and convert an entire Body to a Buffer.
*
* Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body
*
* @return Promise
*/
function consumeBody() {
var _this4 = this;
if (this[INTERNALS].disturbed) {
return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));
}
this[INTERNALS].disturbed = true;
if (this[INTERNALS].error) {
return Body.Promise.reject(this[INTERNALS].error);
}
let body = this.body;
// body is null
if (body === null) {
return Body.Promise.resolve(Buffer.alloc(0));
}
// body is blob
if (isBlob(body)) {
body = body.stream();
}
// body is buffer
if (Buffer.isBuffer(body)) {
return Body.Promise.resolve(body);
}
// istanbul ignore if: should never happen
if (!(body instanceof Stream)) {
return Body.Promise.resolve(Buffer.alloc(0));
}
// body is stream
// get ready to actually consume the body
let accum = [];
let accumBytes = 0;
let abort = false;
return new Body.Promise(function (resolve, reject) {
let resTimeout;
// allow timeout on slow response body
if (_this4.timeout) {
resTimeout = setTimeout(function () {
abort = true;
reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));
}, _this4.timeout);
}
// handle stream errors
body.on('error', function (err) {
if (err.name === 'AbortError') {
// if the request was aborted, reject with this Error
abort = true;
reject(err);
} else {
// other errors, such as incorrect content-encoding
reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));
}
});
body.on('data', function (chunk) {
if (abort || chunk === null) {
return;
}
if (_this4.size && accumBytes + chunk.length > _this4.size) {
abort = true;
reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));
return;
}
accumBytes += chunk.length;
accum.push(chunk);
});
body.on('end', function () {
if (abort) {
return;
}
clearTimeout(resTimeout);
try {
resolve(Buffer.concat(accum, accumBytes));
} catch (err) {
// handle streams that have accumulated too much data (issue #414)
reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));
}
});
});
}
/**
* Detect buffer encoding and convert to target encoding
* ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding
*
* @param Buffer buffer Incoming buffer
* @param String encoding Target encoding
* @return String
*/
function convertBody(buffer, headers) {
if (typeof convert !== 'function') {
throw new Error('The package `encoding` must be installed to use the textConverted() function');
}
const ct = headers.get('content-type');
let charset = 'utf-8';
let res, str;
// header
if (ct) {
res = /charset=([^;]*)/i.exec(ct);
}
// no charset in content type, peek at response body for at most 1024 bytes
str = buffer.slice(0, 1024).toString();
// html5
if (!res && str) {
res = /<meta.+?charset=(['"])(.+?)\1/i.exec(str);
}
// html4
if (!res && str) {
res = /<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(str);
if (!res) {
res = /<meta[\s]+?content=(['"])(.+?)\1[\s]+?http-equiv=(['"])content-type\3/i.exec(str);
if (res) {
res.pop(); // drop last quote
}
}
if (res) {
res = /charset=(.*)/i.exec(res.pop());
}
}
// xml
if (!res && str) {
res = /<\?xml.+?encoding=(['"])(.+?)\1/i.exec(str);
}
// found charset
if (res) {
charset = res.pop();
// prevent decode issues when sites use incorrect encoding
// ref: https://hsivonen.fi/encoding-menu/
if (charset === 'gb2312' || charset === 'gbk') {
charset = 'gb18030';
}
}
// turn raw buffers into a single utf-8 buffer
return convert(buffer, 'UTF-8', charset).toString();
}
/**
* Detect a URLSearchParams object
* ref: https://github.com/bitinn/node-fetch/issues/296#issuecomment-307598143
*
* @param Object obj Object to detect by type or brand
* @return String
*/
function isURLSearchParams(obj) {
// Duck-typing as a necessary condition.
if (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {
return false;
}
// Brand-checking and more duck-typing as optional condition.
return obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';
}
/**
* Check if `obj` is a W3C `Blob` object (which `File` inherits from)
* @param {*} obj
* @return {boolean}
*/
function isBlob(obj) {
return typeof obj === 'object' && typeof obj.arrayBuffer === 'function' && typeof obj.type === 'string' && typeof obj.stream === 'function' && typeof obj.constructor === 'function' && typeof obj.constructor.name === 'string' && /^(Blob|File)$/.test(obj.constructor.name) && /^(Blob|File)$/.test(obj[Symbol.toStringTag]);
}
/**
* Clone body given Res/Req instance
*
* @param Mixed instance Response or Request instance
* @return Mixed
*/
function clone(instance) {
let p1, p2;
let body = instance.body;
// don't allow cloning a used body
if (instance.bodyUsed) {
throw new Error('cannot clone body after it is used');
}
// check that body is a stream and not form-data object
// note: we can't clone the form-data object without having it as a dependency
if (body instanceof Stream && typeof body.getBoundary !== 'function') {
// tee instance body
p1 = new PassThrough();
p2 = new PassThrough();
body.pipe(p1);
body.pipe(p2);
// set instance body to teed body and return the other teed body
instance[INTERNALS].body = p1;
body = p2;
}
return body;
}
/**
* Performs the operation "extract a `Content-Type` value from |object|" as
* specified in the specification:
* https://fetch.spec.whatwg.org/#concept-bodyinit-extract
*
* This function assumes that instance.body is present.
*
* @param Mixed instance Any options.body input
*/
function extractContentType(body) {
if (body === null) {
// body is null
return null;
} else if (typeof body === 'string') {
// body is string
return 'text/plain;charset=UTF-8';
} else if (isURLSearchParams(body)) {
// body is a URLSearchParams
return 'application/x-www-form-urlencoded;charset=UTF-8';
} else if (isBlob(body)) {
// body is blob
return body.type || null;
} else if (Buffer.isBuffer(body)) {
// body is buffer
return null;
} else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
// body is ArrayBuffer
return null;
} else if (ArrayBuffer.isView(body)) {
// body is ArrayBufferView
return null;
} else if (typeof body.getBoundary === 'function') {
// detect form data input from form-data module
return `multipart/form-data;boundary=${body.getBoundary()}`;
} else if (body instanceof Stream) {
// body is stream
// can't really do much about this
return null;
} else {
// Body constructor defaults other things to string
return 'text/plain;charset=UTF-8';
}
}
/**
* The Fetch Standard treats this as if "total bytes" is a property on the body.
* For us, we have to explicitly get it with a function.
*
* ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes
*
* @param Body instance Instance of Body
* @return Number? Number of bytes, or null if not possible
*/
function getTotalBytes(instance) {
const body = instance.body;
if (body === null) {
// body is null
return 0;
} else if (isBlob(body)) {
return body.size;
} else if (Buffer.isBuffer(body)) {
// body is buffer
return body.length;
} else if (body && typeof body.getLengthSync === 'function') {
// detect form data input from form-data module
if (body._lengthRetrievers && body._lengthRetrievers.length == 0 || // 1.x
body.hasKnownLength && body.hasKnownLength()) {
// 2.x
return body.getLengthSync();
}
return null;
} else {
// body is stream
return null;
}
}
/**
* Write a Body to a Node.js WritableStream (e.g. http.Request) object.
*
* @param Body instance Instance of Body
* @return Void
*/
function writeToStream(dest, instance) {
const body = instance.body;
if (body === null) {
// body is null
dest.end();
} else if (isBlob(body)) {
body.stream().pipe(dest);
} else if (Buffer.isBuffer(body)) {
// body is buffer
dest.write(body);
dest.end();
} else {
// body is stream
body.pipe(dest);
}
}
// expose Promise
Body.Promise = global.Promise;
/**
* headers.js
*
* Headers class offers convenient helpers
*/
const invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/;
const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/;
function validateName(name) {
name = `${name}`;
if (invalidTokenRegex.test(name) || name === '') {
throw new TypeError(`${name} is not a legal HTTP header name`);
}
}
function validateValue(value) {
value = `${value}`;
if (invalidHeaderCharRegex.test(value)) {
throw new TypeError(`${value} is not a legal HTTP header value`);
}
}
/**
* Find the key in the map object given a header name.
*
* Returns undefined if not found.
*
* @param String name Header name
* @return String|Undefined
*/
function find(map, name) {
name = name.toLowerCase();
for (const key in map) {
if (key.toLowerCase() === name) {
return key;
}
}
return undefined;
}
const MAP = Symbol('map');
class Headers {
/**
* Headers class
*
* @param Object headers Response headers
* @return Void
*/
constructor() {
let init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
this[MAP] = Object.create(null);
if (init instanceof Headers) {
const rawHeaders = init.raw();
const headerNames = Object.keys(rawHeaders);
for (const headerName of headerNames) {
for (const value of rawHeaders[headerName]) {
this.append(headerName, value);
}
}
return;
}
// We don't worry about converting prop to ByteString here as append()
// will handle it.
if (init == null) ; else if (typeof init === 'object') {
const method = init[Symbol.iterator];
if (method != null) {
if (typeof method !== 'function') {
throw new TypeError('Header pairs must be iterable');
}
// sequence<sequence<ByteString>>
// Note: per spec we have to first exhaust the lists then process them
const pairs = [];
for (const pair of init) {
if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {
throw new TypeError('Each header pair must be iterable');
}
pairs.push(Array.from(pair));
}
for (const pair of pairs) {
if (pair.length !== 2) {
throw new TypeError('Each header pair must be a name/value tuple');
}
this.append(pair[0], pair[1]);
}
} else {
// record<ByteString, ByteString>
for (const key of Object.keys(init)) {
const value = init[key];
this.append(key, value);
}
}
} else {
throw new TypeError('Provided initializer must be an object');
}
}
/**
* Return combined header value given name
*
* @param String name Header name
* @return Mixed
*/
get(name) {
name = `${name}`;
validateName(name);
const key = find(this[MAP], name);
if (key === undefined) {
return null;
}
return this[MAP][key].join(', ');
}
/**
* Iterate over all headers
*
* @param Function callback Executed for each item with parameters (value, name, thisArg)
* @param Boolean thisArg `this` context for callback function
* @return Void
*/
forEach(callback) {
let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
let pairs = getHeaders(this);
let i = 0;
while (i < pairs.length) {
var _pairs$i = pairs[i];
const name = _pairs$i[0],
value = _pairs$i[1];
callback.call(thisArg, value, name, this);
pairs = getHeaders(this);
i++;
}
}
/**
* Overwrite header values given name
*
* @param String name Header name
* @param String value Header value
* @return Void
*/
set(name, value) {
name = `${name}`;
value = `${value}`;
validateName(name);
validateValue(value);
const key = find(this[MAP], name);
this[MAP][key !== undefined ? key : name] = [value];
}
/**
* Append a value onto existing header
*
* @param String name Header name
* @param String value Header value
* @return Void
*/
append(name, value) {
name = `${name}`;
value = `${value}`;
validateName(name);
validateValue(value);
const key = find(this[MAP], name);
if (key !== undefined) {
this[MAP][key].push(value);
} else {
this[MAP][name] = [value];
}
}
/**
* Check for header name existence
*
* @param String name Header name
* @return Boolean
*/
has(name) {
name = `${name}`;
validateName(name);
return find(this[MAP], name) !== undefined;
}
/**
* Delete all header values given name
*
* @param String name Header name
* @return Void
*/
delete(name) {
name = `${name}`;
validateName(name);
const key = find(this[MAP], name);
if (key !== undefined) {
delete this[MAP][key];
}
}
/**
* Return raw headers (non-spec api)
*
* @return Object
*/
raw() {
return this[MAP];
}
/**
* Get an iterator on keys.
*
* @return Iterator
*/
keys() {
return createHeadersIterator(this, 'key');
}
/**
* Get an iterator on values.
*
* @return Iterator
*/
values() {
return createHeadersIterator(this, 'value');
}
/**
* Get an iterator on entries.
*
* This is the default iterator of the Headers object.
*
* @return Iterator
*/
[Symbol.iterator]() {
return createHeadersIterator(this, 'key+value');
}
}
Headers.prototype.entries = Headers.prototype[Symbol.iterator];
Object.defineProperty(Headers.prototype, Symbol.toStringTag, {
value: 'Headers',
writable: false,
enumerable: false,
configurable: true
});
Object.defineProperties(Headers.prototype, {
get: { enumerable: true },
forEach: { enumerable: true },
set: { enumerable: true },
append: { enumerable: true },
has: { enumerable: true },
delete: { enumerable: true },
keys: { enumerable: true },
values: { enumerable: true },
entries: { enumerable: true }
});
function getHeaders(headers) {
let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';
const keys = Object.keys(headers[MAP]).sort();
return keys.map(kind === 'key' ? function (k) {
return k.toLowerCase();
} : kind === 'value' ? function (k) {
return headers[MAP][k].join(', ');
} : function (k) {
return [k.toLowerCase(), headers[MAP][k].join(', ')];
});
}
const INTERNAL = Symbol('internal');
function createHeadersIterator(target, kind) {
const iterator = Object.create(HeadersIteratorPrototype);
iterator[INTERNAL] = {
target,
kind,
index: 0
};
return iterator;
}
const HeadersIteratorPrototype = Object.setPrototypeOf({
next() {
// istanbul ignore if
if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {
throw new TypeError('Value of `this` is not a HeadersIterator');
}
var _INTERNAL = this[INTERNAL];
const target = _INTERNAL.target,
kind = _INTERNAL.kind,
index = _INTERNAL.index;
const values = getHeaders(target, kind);
const len = values.length;
if (index >= len) {
return {
value: undefined,
done: true
};
}
this[INTERNAL].index = index + 1;
return {
value: values[index],
done: false
};
}
}, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));
Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {
value: 'HeadersIterator',
writable: false,
enumerable: false,
configurable: true
});
/**
* Export the Headers object in a form that Node.js can consume.
*
* @param Headers headers
* @return Object
*/
function exportNodeCompatibleHeaders(headers) {
const obj = Object.assign({ __proto__: null }, headers[MAP]);
// http.request() only supports string as Host header. This hack makes
// specifying custom Host header possible.
const hostHeaderKey = find(headers[MAP], 'Host');
if (hostHeaderKey !== undefined) {
obj[hostHeaderKey] = obj[hostHeaderKey][0];
}
return obj;
}
/**
* Create a Headers object from an object of headers, ignoring those that do
* not conform to HTTP grammar productions.
*
* @param Object obj Object of headers
* @return Headers
*/
function createHeadersLenient(obj) {
const headers = new Headers();
for (const name of Object.keys(obj)) {
if (invalidTokenRegex.test(name)) {
continue;
}
if (Array.isArray(obj[name])) {
for (const val of obj[name]) {
if (invalidHeaderCharRegex.test(val)) {
continue;
}
if (headers[MAP][name] === undefined) {
headers[MAP][name] = [val];
} else {
headers[MAP][name].push(val);
}
}
} else if (!invalidHeaderCharRegex.test(obj[name])) {
headers[MAP][name] = [obj[name]];
}
}
return headers;
}
const INTERNALS$1 = Symbol('Response internals');
// fix an issue where "STATUS_CODES" aren't a named export for node <10
const STATUS_CODES = http.STATUS_CODES;
/**
* Response class
*
* @param Stream body Readable stream
* @param Object opts Response options
* @return Void
*/
class Response {
constructor() {
let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
Body.call(this, body, opts);
const status = opts.status || 200;
const headers = new Headers(opts.headers);
if (body != null && !headers.has('Content-Type')) {
const contentType = extractContentType(body);
if (contentType) {
headers.append('Content-Type', contentType);
}
}
this[INTERNALS$1] = {
url: opts.url,
status,
statusText: opts.statusText || STATUS_CODES[status],
headers,
counter: opts.counter
};
}
get url() {
return this[INTERNALS$1].url || '';
}
get status() {
return this[INTERNALS$1].status;
}
/**
* Convenience property representing if the request ended normally
*/
get ok() {
return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;
}
get redirected() {
return this[INTERNALS$1].counter > 0;
}
get statusText() {
return this[INTERNALS$1].statusText;
}
get headers() {
return this[INTERNALS$1].headers;
}
/**
* Clone this response
*
* @return Response
*/
clone() {
return new Response(clone(this), {
url: this.url,
status: this.status,
statusText: this.statusText,
headers: this.headers,
ok: this.ok,
redirected: this.redirected
});
}
}
Body.mixIn(Response.prototype);
Object.defineProperties(Response.prototype, {
url: { enumerable: true },
status: { enumerable: true },
ok: { enumerable: true },
redirected: { enumerable: true },
statusText: { enumerable: true },
headers: { enumerable: true },
clone: { enumerable: true }
});
Object.defineProperty(Response.prototype, Symbol.toStringTag, {
value: 'Response',
writable: false,
enumerable: false,
configurable: true
});
const INTERNALS$2 = Symbol('Request internals');
const URL = Url.URL || whatwgUrl.URL;
// fix an issue where "format", "parse" aren't a named export for node <10
const parse_url = Url.parse;
const format_url = Url.format;
/**
* Wrapper around `new URL` to handle arbitrary URLs
*
* @param {string} urlStr
* @return {void}
*/
function parseURL(urlStr) {
/*
Check whether the URL is absolute or not
Scheme: https://tools.ietf.org/html/rfc3986#section-3.1
Absolute URL: https://tools.ietf.org/html/rfc3986#section-4.3
*/
if (/^[a-zA-Z][a-zA-Z\d+\-.]*:/.exec(urlStr)) {
urlStr = new URL(urlStr).toString();
}
// Fallback to old implementation for arbitrary URLs
return parse_url(urlStr);
}
const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
/**
* Check if a value is an instance of Request.
*
* @param Mixed input
* @return Boolean
*/
function isRequest(input) {
return typeof input === 'object' && typeof input[INTERNALS$2] === 'object';
}
function isAbortSignal(signal) {
const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);
return !!(proto && proto.constructor.name === 'AbortSignal');
}
/**
* Request class
*
* @param Mixed input Url or Request instance
* @param Object init Custom options
* @return Void
*/
class Request {
constructor(input) {
let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
let parsedURL;
// normalize input
if (!isRequest(input)) {
if (input && input.href) {
// in order to support Node.js' Url objects; though WHATWG's URL objects
// will fall into this branch also (since their `toString()` will return
// `href` property anyway)
parsedURL = parseURL(input.href);
} else {
// coerce input to a string before attempting to parse
parsedURL = parseURL(`${input}`);
}
input = {};
} else {
parsedURL = parseURL(input.url);
}
let method = init.method || input.method || 'GET';
method = method.toUpperCase();
if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {
throw new TypeError('Request with GET/HEAD method cannot have body');
}
let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;
Body.call(this, inputBody, {
timeout: init.timeout || input.timeout || 0,
size: init.size || input.size || 0
});
const headers = new Headers(init.headers || input.headers || {});
if (inputBody != null && !headers.has('Content-Type')) {
const contentType = extractContentType(inputBody);
if (contentType) {
headers.append('Content-Type', contentType);
}
}
let signal = isRequest(input) ? input.signal : null;
if ('signal' in init) signal = init.signal;
if (signal != null && !isAbortSignal(signal)) {
throw new TypeError('Expected signal to be an instanceof AbortSignal');
}
this[INTERNALS$2] = {
method,
redirect: init.redirect || input.redirect || 'follow',
headers,
parsedURL,
signal
};
// node-fetch-only options
this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;
this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;
this.counter = init.counter || input.counter || 0;
this.agent = init.agent || input.agent;
}
get method() {
return this[INTERNALS$2].method;
}
get url() {
return format_url(this[INTERNALS$2].parsedURL);
}
get headers() {
return this[INTERNALS$2].headers;
}
get redirect() {
return this[INTERNALS$2].redirect;
}
get signal() {
return this[INTERNALS$2].signal;
}
/**
* Clone this request
*
* @return Request
*/
clone() {
return new Request(this);
}
}
Body.mixIn(Request.prototype);
Object.defineProperty(Request.prototype, Symbol.toStringTag, {
value: 'Request',
writable: false,
enumerable: false,
configurable: true
});
Object.defineProperties(Request.prototype, {
method: { enumerable: true },
url: { enumerable: true },
headers: { enumerable: true },
redirect: { enumerable: true },
clone: { enumerable: true },
signal: { enumerable: true }
});
/**
* Convert a Request to Node.js http request options.
*
* @param Request A Request instance
* @return Object The options object to be passed to http.request
*/
function getNodeRequestOptions(request) {
const parsedURL = request[INTERNALS$2].parsedURL;
const headers = new Headers(request[INTERNALS$2].headers);
// fetch step 1.3
if (!headers.has('Accept')) {
headers.set('Accept', '*/*');
}
// Basic fetch
if (!parsedURL.protocol || !parsedURL.hostname) {
throw new TypeError('Only absolute URLs are supported');
}
if (!/^https?:$/.test(parsedURL.protocol)) {
throw new TypeError('Only HTTP(S) protocols are supported');
}
if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {
throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');
}
// HTTP-network-or-cache fetch steps 2.4-2.7
let contentLengthValue = null;
if (request.body == null && /^(POST|PUT)$/i.test(request.method)) {
contentLengthValue = '0';
}
if (request.body != null) {
const totalBytes = getTotalBytes(request);
if (typeof totalBytes === 'number') {
contentLengthValue = String(totalBytes);
}
}
if (contentLengthValue) {
headers.set('Content-Length', contentLengthValue);
}
// HTTP-network-or-cache fetch step 2.11
if (!headers.has('User-Agent')) {
headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');
}
// HTTP-network-or-cache fetch step 2.15
if (request.compress && !headers.has('Accept-Encoding')) {
headers.set('Accept-Encoding', 'gzip,deflate');
}
let agent = request.agent;
if (typeof agent === 'function') {
agent = agent(parsedURL);
}
if (!headers.has('Connection') && !agent) {
headers.set('Connection', 'close');
}
// HTTP-network fetch step 4.2
// chunked encoding is handled by Node.js
return Object.assign({}, parsedURL, {
method: request.method,
headers: exportNodeCompatibleHeaders(headers),
agent
});
}
/**
* abort-error.js
*
* AbortError interface for cancelled requests
*/
/**
* Create AbortError instance
*
* @param String message Error message for human
* @return AbortError
*/
function AbortError(message) {
Error.call(this, message);
this.type = 'aborted';
this.message = message;
// hide custom error implementation details from end-users
Error.captureStackTrace(this, this.constructor);
}
AbortError.prototype = Object.create(Error.prototype);
AbortError.prototype.constructor = AbortError;
AbortError.prototype.name = 'AbortError';
const URL$1 = Url.URL || whatwgUrl.URL;
// fix an issue where "PassThrough", "resolve" aren't a named export for node <10
const PassThrough$1 = Stream.PassThrough;
const isDomainOrSubdomain = function isDomainOrSubdomain(destination, original) {
const orig = new URL$1(original).hostname;
const dest = new URL$1(destination).hostname;
return orig === dest || orig[orig.length - dest.length - 1] === '.' && orig.endsWith(dest);
};
/**
* isSameProtocol reports whether the two provided URLs use the same protocol.
*
* Both domains must already be in canonical form.
* @param {string|URL} original
* @param {string|URL} destination
*/
const isSameProtocol = function isSameProtocol(destination, original) {
const orig = new URL$1(original).protocol;
const dest = new URL$1(destination).protocol;
return orig === dest;
};
/**
* Fetch function
*
* @param Mixed url Absolute url or Request instance
* @param Object opts Fetch options
* @return Promise
*/
function fetch(url, opts) {
// allow custom promise
if (!fetch.Promise) {
throw new Error('native promise missing, set fetch.Promise to your favorite alternative');
}
Body.Promise = fetch.Promise;
// wrap http.request into fetch
return new fetch.Promise(function (resolve, reject) {
// build request object
const request = new Request(url, opts);
const options = getNodeRequestOptions(request);
const send = (options.protocol === 'https:' ? https : http).request;
const signal = request.signal;
let response = null;
const abort = function abort() {
let error = new AbortError('The user aborted a request.');
reject(error);
if (request.body && request.body instanceof Stream.Readable) {
destroyStream(request.body, error);
}
if (!response || !response.body) return;
response.body.emit('error', error);
};
if (signal && signal.aborted) {
abort();
return;
}
const abortAndFinalize = function abortAndFinalize() {
abort();
finalize();
};
// send request
const req = send(options);
let reqTimeout;
if (signal) {
signal.addEventListener('abort', abortAndFinalize);
}
function finalize() {
req.abort();
if (signal) signal.removeEventListener('abort', abortAndFinalize);
clearTimeout(reqTimeout);
}
if (request.timeout) {
req.once('socket', function (socket) {
reqTimeout = setTimeout(function () {
reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));
finalize();
}, request.timeout);
});
}
req.on('error', function (err) {
reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
if (response && response.body) {
destroyStream(response.body, err);
}
finalize();
});
fixResponseChunkedTransferBadEnding(req, function (err) {
if (signal && signal.aborted) {
return;
}
if (response && response.body) {
destroyStream(response.body, err);
}
});
/* c8 ignore next 18 */
if (parseInt(process.version.substring(1)) < 14) {
// Before Node.js 14, pipeline() does not fully support async iterators and does not always
// properly handle when the socket close/end events are out of order.
req.on('socket', function (s) {
s.addListener('close', function (hadError) {
// if a data listener is still present we didn't end cleanly
const hasDataListener = s.listenerCount('data') > 0;
// if end happened before close but the socket didn't emit an error, do it now
if (response && hasDataListener && !hadError && !(signal && signal.aborted)) {
const err = new Error('Premature close');
err.code = 'ERR_STREAM_PREMATURE_CLOSE';
response.body.emit('error', err);
}
});
});
}
req.on('response', function (res) {
clearTimeout(reqTimeout);
const headers = createHeadersLenient(res.headers);
// HTTP fetch step 5
if (fetch.isRedirect(res.statusCode)) {
// HTTP fetch step 5.2
const location = headers.get('Location');
// HTTP fetch step 5.3
let locationURL = null;
try {
locationURL = location === null ? null : new URL$1(location, request.url).toString();
} catch (err) {
// error here can only be invalid URL in Location: header
// do not throw when options.redirect == manual
// let the user extract the errorneous redirect URL
if (request.redirect !== 'manual') {
reject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, 'invalid-redirect'));
finalize();
return;
}
}
// HTTP fetch step 5.5
switch (request.redirect) {
case 'error':
reject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect'));
finalize();
return;
case 'manual':
// node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.
if (locationURL !== null) {
// handle corrupted header
try {
headers.set('Location', locationURL);
} catch (err) {
// istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request
reject(err);
}
}
break;
case 'follow':
// HTTP-redirect fetch step 2
if (locationURL === null) {
break;
}
// HTTP-redirect fetch step 5
if (request.counter >= request.follow) {
reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));
finalize();
return;
}
// HTTP-redirect fetch step 6 (counter increment)
// Create a new Request object.
const requestOpts = {
headers: new Headers(request.headers),
follow: request.follow,
counter: request.counter + 1,
agent: request.agent,
compress: request.compress,
method: request.method,
body: request.body,
signal: request.signal,
timeout: request.timeout,
size: request.size
};
if (!isDomainOrSubdomain(request.url, locationURL) || !isSameProtocol(request.url, locationURL)) {
for (const name of ['authorization', 'www-authenticate', 'cookie', 'cookie2']) {
requestOpts.headers.delete(name);
}
}
// HTTP-redirect fetch step 9
if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
finalize();
return;
}
// HTTP-redirect fetch step 11
if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {
requestOpts.method = 'GET';
requestOpts.body = undefined;
requestOpts.headers.delete('content-length');
}
// HTTP-redirect fetch step 15
resolve(fetch(new Request(locationURL, requestOpts)));
finalize();
return;
}
}
// prepare response
res.once('end', function () {
if (signal) signal.removeEventListener('abort', abortAndFinalize);
});
let body = res.pipe(new PassThrough$1());
const response_options = {
url: request.url,
status: res.statusCode,
statusText: res.statusMessage,
headers: headers,
size: request.size,
timeout: request.timeout,
counter: request.counter
};
// HTTP-network fetch step 12.1.1.3
const codings = headers.get('Content-Encoding');
// HTTP-network fetch step 12.1.1.4: handle content codings
// in following scenarios we ignore compression support
// 1. compression support is disabled
// 2. HEAD request
// 3. no Content-Encoding header
// 4. no content response (204)
// 5. content not modified response (304)
if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {
response = new Response(body, response_options);
resolve(response);
return;
}
// For Node v6+
// Be less strict when decoding compressed responses, since sometimes
// servers send slightly invalid responses that are still accepted
// by common browsers.
// Always using Z_SYNC_FLUSH is what cURL does.
const zlibOptions = {
flush: zlib.Z_SYNC_FLUSH,
finishFlush: zlib.Z_SYNC_FLUSH
};
// for gzip
if (codings == 'gzip' || codings == 'x-gzip') {
body = body.pipe(zlib.createGunzip(zlibOptions));
response = new Response(body, response_options);
resolve(response);
return;
}
// for deflate
if (codings == 'deflate' || codings == 'x-deflate') {
// handle the infamous raw deflate response from old servers
// a hack for old IIS and Apache servers
const raw = res.pipe(new PassThrough$1());
raw.once('data', function (chunk) {
// see http://stackoverflow.com/questions/37519828
if ((chunk[0] & 0x0F) === 0x08) {
body = body.pipe(zlib.createInflate());
} else {
body = body.pipe(zlib.createInflateRaw());
}
response = new Response(body, response_options);
resolve(response);
});
raw.on('end', function () {
// some old IIS servers return zero-length OK deflate responses, so 'data' is never emitted.
if (!response) {
response = new Response(body, response_options);
resolve(response);
}
});
return;
}
// for br
if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {
body = body.pipe(zlib.createBrotliDecompress());
response = new Response(body, response_options);
resolve(response);
return;
}
// otherwise, use response as-is
response = new Response(body, response_options);
resolve(response);
});
writeToStream(req, request);
});
}
function fixResponseChunkedTransferBadEnding(request, errorCallback) {
let socket;
request.on('socket', function (s) {
socket = s;
});
request.on('response', function (response) {
const headers = response.headers;
if (headers['transfer-encoding'] === 'chunked' && !headers['content-length']) {
response.once('close', function (hadError) {
// tests for socket presence, as in some situations the
// the 'socket' event is not triggered for the request
// (happens in deno), avoids `TypeError`
// if a data listener is still present we didn't end cleanly
const hasDataListener = socket && socket.listenerCount('data') > 0;
if (hasDataListener && !hadError) {
const err = new Error('Premature close');
err.code = 'ERR_STREAM_PREMATURE_CLOSE';
errorCallback(err);
}
});
}
});
}
function destroyStream(stream, err) {
if (stream.destroy) {
stream.destroy(err);
} else {
// node < 8
stream.emit('error', err);
stream.end();
}
}
/**
* Redirect code matching
*
* @param Number code Status code
* @return Boolean
*/
fetch.isRedirect = function (code) {
return code === 301 || code === 302 || code === 303 || code === 307 || code === 308;
};
// expose Promise
fetch.Promise = global.Promise;
module.exports = exports = fetch;
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports["default"] = exports;
exports.Headers = Headers;
exports.Request = Request;
exports.Response = Response;
exports.FetchError = FetchError;
/***/ }),
/***/ 9717:
/***/ ((__unused_webpack_module, exports) => {
"use strict";
// (c) Dean McNamee <dean@gmail.com>, 2013.
//
// https://github.com/deanm/omggif
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//
// omggif is a JavaScript implementation of a GIF 89a encoder and decoder,
// including animation and compression. It does not rely on any specific
// underlying system, so should run in the browser, Node, or Plask.
function GifWriter(buf, width, height, gopts) {
var p = 0;
var gopts = gopts === undefined ? { } : gopts;
var loop_count = gopts.loop === undefined ? null : gopts.loop;
var global_palette = gopts.palette === undefined ? null : gopts.palette;
if (width <= 0 || height <= 0 || width > 65535 || height > 65535)
throw new Error("Width/Height invalid.");
function check_palette_and_num_colors(palette) {
var num_colors = palette.length;
if (num_colors < 2 || num_colors > 256 || num_colors & (num_colors-1)) {
throw new Error(
"Invalid code/color length, must be power of 2 and 2 .. 256.");
}
return num_colors;
}
// - Header.
buf[p++] = 0x47; buf[p++] = 0x49; buf[p++] = 0x46; // GIF
buf[p++] = 0x38; buf[p++] = 0x39; buf[p++] = 0x61; // 89a
// Handling of Global Color Table (palette) and background index.
var gp_num_colors_pow2 = 0;
var background = 0;
if (global_palette !== null) {
var gp_num_colors = check_palette_and_num_colors(global_palette);
while (gp_num_colors >>= 1) ++gp_num_colors_pow2;
gp_num_colors = 1 << gp_num_colors_pow2;
--gp_num_colors_pow2;
if (gopts.background !== undefined) {
background = gopts.background;
if (background >= gp_num_colors)
throw new Error("Background index out of range.");
// The GIF spec states that a background index of 0 should be ignored, so
// this is probably a mistake and you really want to set it to another
// slot in the palette. But actually in the end most browsers, etc end
// up ignoring this almost completely (including for dispose background).
if (background === 0)
throw new Error("Background index explicitly passed as 0.");
}
}
// - Logical Screen Descriptor.
// NOTE(deanm): w/h apparently ignored by implementations, but set anyway.
buf[p++] = width & 0xff; buf[p++] = width >> 8 & 0xff;
buf[p++] = height & 0xff; buf[p++] = height >> 8 & 0xff;
// NOTE: Indicates 0-bpp original color resolution (unused?).
buf[p++] = (global_palette !== null ? 0x80 : 0) | // Global Color Table Flag.
gp_num_colors_pow2; // NOTE: No sort flag (unused?).
buf[p++] = background; // Background Color Index.
buf[p++] = 0; // Pixel aspect ratio (unused?).
// - Global Color Table
if (global_palette !== null) {
for (var i = 0, il = global_palette.length; i < il; ++i) {
var rgb = global_palette[i];
buf[p++] = rgb >> 16 & 0xff;
buf[p++] = rgb >> 8 & 0xff;
buf[p++] = rgb & 0xff;
}
}
if (loop_count !== null) { // Netscape block for looping.
if (loop_count < 0 || loop_count > 65535)
throw new Error("Loop count invalid.")
// Extension code, label, and length.
buf[p++] = 0x21; buf[p++] = 0xff; buf[p++] = 0x0b;
// NETSCAPE2.0
buf[p++] = 0x4e; buf[p++] = 0x45; buf[p++] = 0x54; buf[p++] = 0x53;
buf[p++] = 0x43; buf[p++] = 0x41; buf[p++] = 0x50; buf[p++] = 0x45;
buf[p++] = 0x32; buf[p++] = 0x2e; buf[p++] = 0x30;
// Sub-block
buf[p++] = 0x03; buf[p++] = 0x01;
buf[p++] = loop_count & 0xff; buf[p++] = loop_count >> 8 & 0xff;
buf[p++] = 0x00; // Terminator.
}
var ended = false;
this.addFrame = function(x, y, w, h, indexed_pixels, opts) {
if (ended === true) { --p; ended = false; } // Un-end.
opts = opts === undefined ? { } : opts;
// TODO(deanm): Bounds check x, y. Do they need to be within the virtual
// canvas width/height, I imagine?
if (x < 0 || y < 0 || x > 65535 || y > 65535)
throw new Error("x/y invalid.")
if (w <= 0 || h <= 0 || w > 65535 || h > 65535)
throw new Error("Width/Height invalid.")
if (indexed_pixels.length < w * h)
throw new Error("Not enough pixels for the frame size.");
var using_local_palette = true;
var palette = opts.palette;
if (palette === undefined || palette === null) {
using_local_palette = false;
palette = global_palette;
}
if (palette === undefined || palette === null)
throw new Error("Must supply either a local or global palette.");
var num_colors = check_palette_and_num_colors(palette);
// Compute the min_code_size (power of 2), destroying num_colors.
var min_code_size = 0;
while (num_colors >>= 1) ++min_code_size;
num_colors = 1 << min_code_size; // Now we can easily get it back.
var delay = opts.delay === undefined ? 0 : opts.delay;
// From the spec:
// 0 - No disposal specified. The decoder is
// not required to take any action.
// 1 - Do not dispose. The graphic is to be left
// in place.
// 2 - Restore to background color. The area used by the
// graphic must be restored to the background color.
// 3 - Restore to previous. The decoder is required to
// restore the area overwritten by the graphic with
// what was there prior to rendering the graphic.
// 4-7 - To be defined.
// NOTE(deanm): Dispose background doesn't really work, apparently most
// browsers ignore the background palette index and clear to transparency.
var disposal = opts.disposal === undefined ? 0 : opts.disposal;
if (disposal < 0 || disposal > 3) // 4-7 is reserved.
throw new Error("Disposal out of range.");
var use_transparency = false;
var transparent_index = 0;
if (opts.transparent !== undefined && opts.transparent !== null) {
use_transparency = true;
transparent_index = opts.transparent;
if (transparent_index < 0 || transparent_index >= num_colors)
throw new Error("Transparent color index.");
}
if (disposal !== 0 || use_transparency || delay !== 0) {
// - Graphics Control Extension
buf[p++] = 0x21; buf[p++] = 0xf9; // Extension / Label.
buf[p++] = 4; // Byte size.
buf[p++] = disposal << 2 | (use_transparency === true ? 1 : 0);
buf[p++] = delay & 0xff; buf[p++] = delay >> 8 & 0xff;
buf[p++] = transparent_index; // Transparent color index.
buf[p++] = 0; // Block Terminator.
}
// - Image Descriptor
buf[p++] = 0x2c; // Image Seperator.
buf[p++] = x & 0xff; buf[p++] = x >> 8 & 0xff; // Left.
buf[p++] = y & 0xff; buf[p++] = y >> 8 & 0xff; // Top.
buf[p++] = w & 0xff; buf[p++] = w >> 8 & 0xff;
buf[p++] = h & 0xff; buf[p++] = h >> 8 & 0xff;
// NOTE: No sort flag (unused?).
// TODO(deanm): Support interlace.
buf[p++] = using_local_palette === true ? (0x80 | (min_code_size-1)) : 0;
// - Local Color Table
if (using_local_palette === true) {
for (var i = 0, il = palette.length; i < il; ++i) {
var rgb = palette[i];
buf[p++] = rgb >> 16 & 0xff;
buf[p++] = rgb >> 8 & 0xff;
buf[p++] = rgb & 0xff;
}
}
p = GifWriterOutputLZWCodeStream(
buf, p, min_code_size < 2 ? 2 : min_code_size, indexed_pixels);
return p;
};
this.end = function() {
if (ended === false) {
buf[p++] = 0x3b; // Trailer.
ended = true;
}
return p;
};
this.getOutputBuffer = function() { return buf; };
this.setOutputBuffer = function(v) { buf = v; };
this.getOutputBufferPosition = function() { return p; };
this.setOutputBufferPosition = function(v) { p = v; };
}
// Main compression routine, palette indexes -> LZW code stream.
// |index_stream| must have at least one entry.
function GifWriterOutputLZWCodeStream(buf, p, min_code_size, index_stream) {
buf[p++] = min_code_size;
var cur_subblock = p++; // Pointing at the length field.
var clear_code = 1 << min_code_size;
var code_mask = clear_code - 1;
var eoi_code = clear_code + 1;
var next_code = eoi_code + 1;
var cur_code_size = min_code_size + 1; // Number of bits per code.
var cur_shift = 0;
// We have at most 12-bit codes, so we should have to hold a max of 19
// bits here (and then we would write out).
var cur = 0;
function emit_bytes_to_buffer(bit_block_size) {
while (cur_shift >= bit_block_size) {
buf[p++] = cur & 0xff;
cur >>= 8; cur_shift -= 8;
if (p === cur_subblock + 256) { // Finished a subblock.
buf[cur_subblock] = 255;
cur_subblock = p++;
}
}
}
function emit_code(c) {
cur |= c << cur_shift;
cur_shift += cur_code_size;
emit_bytes_to_buffer(8);
}
// I am not an expert on the topic, and I don't want to write a thesis.
// However, it is good to outline here the basic algorithm and the few data
// structures and optimizations here that make this implementation fast.
// The basic idea behind LZW is to build a table of previously seen runs
// addressed by a short id (herein called output code). All data is
// referenced by a code, which represents one or more values from the
// original input stream. All input bytes can be referenced as the same
// value as an output code. So if you didn't want any compression, you
// could more or less just output the original bytes as codes (there are
// some details to this, but it is the idea). In order to achieve
// compression, values greater then the input range (codes can be up to
// 12-bit while input only 8-bit) represent a sequence of previously seen
// inputs. The decompressor is able to build the same mapping while
// decoding, so there is always a shared common knowledge between the
// encoding and decoder, which is also important for "timing" aspects like
// how to handle variable bit width code encoding.
//
// One obvious but very important consequence of the table system is there
// is always a unique id (at most 12-bits) to map the runs. 'A' might be
// 4, then 'AA' might be 10, 'AAA' 11, 'AAAA' 12, etc. This relationship
// can be used for an effecient lookup strategy for the code mapping. We
// need to know if a run has been seen before, and be able to map that run
// to the output code. Since we start with known unique ids (input bytes),
// and then from those build more unique ids (table entries), we can
// continue this chain (almost like a linked list) to always have small
// integer values that represent the current byte chains in the encoder.
// This means instead of tracking the input bytes (AAAABCD) to know our
// current state, we can track the table entry for AAAABC (it is guaranteed
// to exist by the nature of the algorithm) and the next character D.
// Therefor the tuple of (table_entry, byte) is guaranteed to also be
// unique. This allows us to create a simple lookup key for mapping input
// sequences to codes (table indices) without having to store or search
// any of the code sequences. So if 'AAAA' has a table entry of 12, the
// tuple of ('AAAA', K) for any input byte K will be unique, and can be our
// key. This leads to a integer value at most 20-bits, which can always
// fit in an SMI value and be used as a fast sparse array / object key.
// Output code for the current contents of the index buffer.
var ib_code = index_stream[0] & code_mask; // Load first input index.
var code_table = { }; // Key'd on our 20-bit "tuple".
emit_code(clear_code); // Spec says first code should be a clear code.
// First index already loaded, process the rest of the stream.
for (var i = 1, il = index_stream.length; i < il; ++i) {
var k = index_stream[i] & code_mask;
var cur_key = ib_code << 8 | k; // (prev, k) unique tuple.
var cur_code = code_table[cur_key]; // buffer + k.
// Check if we have to create a new code table entry.
if (cur_code === undefined) { // We don't have buffer + k.
// Emit index buffer (without k).
// This is an inline version of emit_code, because this is the core
// writing routine of the compressor (and V8 cannot inline emit_code
// because it is a closure here in a different context). Additionally
// we can call emit_byte_to_buffer less often, because we can have
// 30-bits (from our 31-bit signed SMI), and we know our codes will only
// be 12-bits, so can safely have 18-bits there without overflow.
// emit_code(ib_code);
cur |= ib_code << cur_shift;
cur_shift += cur_code_size;
while (cur_shift >= 8) {
buf[p++] = cur & 0xff;
cur >>= 8; cur_shift -= 8;
if (p === cur_subblock + 256) { // Finished a subblock.
buf[cur_subblock] = 255;
cur_subblock = p++;
}
}
if (next_code === 4096) { // Table full, need a clear.
emit_code(clear_code);
next_code = eoi_code + 1;
cur_code_size = min_code_size + 1;
code_table = { };
} else { // Table not full, insert a new entry.
// Increase our variable bit code sizes if necessary. This is a bit
// tricky as it is based on "timing" between the encoding and
// decoder. From the encoders perspective this should happen after
// we've already emitted the index buffer and are about to create the
// first table entry that would overflow our current code bit size.
if (next_code >= (1 << cur_code_size)) ++cur_code_size;
code_table[cur_key] = next_code++; // Insert into code table.
}
ib_code = k; // Index buffer to single input k.
} else {
ib_code = cur_code; // Index buffer to sequence in code table.
}
}
emit_code(ib_code); // There will still be something in the index buffer.
emit_code(eoi_code); // End Of Information.
// Flush / finalize the sub-blocks stream to the buffer.
emit_bytes_to_buffer(1);
// Finish the sub-blocks, writing out any unfinished lengths and
// terminating with a sub-block of length 0. If we have already started
// but not yet used a sub-block it can just become the terminator.
if (cur_subblock + 1 === p) { // Started but unused.
buf[cur_subblock] = 0;
} else { // Started and used, write length and additional terminator block.
buf[cur_subblock] = p - cur_subblock - 1;
buf[p++] = 0;
}
return p;
}
function GifReader(buf) {
var p = 0;
// - Header (GIF87a or GIF89a).
if (buf[p++] !== 0x47 || buf[p++] !== 0x49 || buf[p++] !== 0x46 ||
buf[p++] !== 0x38 || (buf[p++]+1 & 0xfd) !== 0x38 || buf[p++] !== 0x61) {
throw new Error("Invalid GIF 87a/89a header.");
}
// - Logical Screen Descriptor.
var width = buf[p++] | buf[p++] << 8;
var height = buf[p++] | buf[p++] << 8;
var pf0 = buf[p++]; // <Packed Fields>.
var global_palette_flag = pf0 >> 7;
var num_global_colors_pow2 = pf0 & 0x7;
var num_global_colors = 1 << (num_global_colors_pow2 + 1);
var background = buf[p++];
buf[p++]; // Pixel aspect ratio (unused?).
var global_palette_offset = null;
var global_palette_size = null;
if (global_palette_flag) {
global_palette_offset = p;
global_palette_size = num_global_colors;
p += num_global_colors * 3; // Seek past palette.
}
var no_eof = true;
var frames = [ ];
var delay = 0;
var transparent_index = null;
var disposal = 0; // 0 - No disposal specified.
var loop_count = null;
this.width = width;
this.height = height;
while (no_eof && p < buf.length) {
switch (buf[p++]) {
case 0x21: // Graphics Control Extension Block
switch (buf[p++]) {
case 0xff: // Application specific block
// Try if it's a Netscape block (with animation loop counter).
if (buf[p ] !== 0x0b || // 21 FF already read, check block size.
// NETSCAPE2.0
buf[p+1 ] == 0x4e && buf[p+2 ] == 0x45 && buf[p+3 ] == 0x54 &&
buf[p+4 ] == 0x53 && buf[p+5 ] == 0x43 && buf[p+6 ] == 0x41 &&
buf[p+7 ] == 0x50 && buf[p+8 ] == 0x45 && buf[p+9 ] == 0x32 &&
buf[p+10] == 0x2e && buf[p+11] == 0x30 &&
// Sub-block
buf[p+12] == 0x03 && buf[p+13] == 0x01 && buf[p+16] == 0) {
p += 14;
loop_count = buf[p++] | buf[p++] << 8;
p++; // Skip terminator.
} else { // We don't know what it is, just try to get past it.
p += 12;
while (true) { // Seek through subblocks.
var block_size = buf[p++];
// Bad block size (ex: undefined from an out of bounds read).
if (!(block_size >= 0)) throw Error("Invalid block size");
if (block_size === 0) break; // 0 size is terminator
p += block_size;
}
}
break;
case 0xf9: // Graphics Control Extension
if (buf[p++] !== 0x4 || buf[p+4] !== 0)
throw new Error("Invalid graphics extension block.");
var pf1 = buf[p++];
delay = buf[p++] | buf[p++] << 8;
transparent_index = buf[p++];
if ((pf1 & 1) === 0) transparent_index = null;
disposal = pf1 >> 2 & 0x7;
p++; // Skip terminator.
break;
case 0xfe: // Comment Extension.
while (true) { // Seek through subblocks.
var block_size = buf[p++];
// Bad block size (ex: undefined from an out of bounds read).
if (!(block_size >= 0)) throw Error("Invalid block size");
if (block_size === 0) break; // 0 size is terminator
// console.log(buf.slice(p, p+block_size).toString('ascii'));
p += block_size;
}
break;
default:
throw new Error(
"Unknown graphic control label: 0x" + buf[p-1].toString(16));
}
break;
case 0x2c: // Image Descriptor.
var x = buf[p++] | buf[p++] << 8;
var y = buf[p++] | buf[p++] << 8;
var w = buf[p++] | buf[p++] << 8;
var h = buf[p++] | buf[p++] << 8;
var pf2 = buf[p++];
var local_palette_flag = pf2 >> 7;
var interlace_flag = pf2 >> 6 & 1;
var num_local_colors_pow2 = pf2 & 0x7;
var num_local_colors = 1 << (num_local_colors_pow2 + 1);
var palette_offset = global_palette_offset;
var palette_size = global_palette_size;
var has_local_palette = false;
if (local_palette_flag) {
var has_local_palette = true;
palette_offset = p; // Override with local palette.
palette_size = num_local_colors;
p += num_local_colors * 3; // Seek past palette.
}
var data_offset = p;
p++; // codesize
while (true) {
var block_size = buf[p++];
// Bad block size (ex: undefined from an out of bounds read).
if (!(block_size >= 0)) throw Error("Invalid block size");
if (block_size === 0) break; // 0 size is terminator
p += block_size;
}
frames.push({x: x, y: y, width: w, height: h,
has_local_palette: has_local_palette,
palette_offset: palette_offset,
palette_size: palette_size,
data_offset: data_offset,
data_length: p - data_offset,
transparent_index: transparent_index,
interlaced: !!interlace_flag,
delay: delay,
disposal: disposal});
break;
case 0x3b: // Trailer Marker (end of file).
no_eof = false;
break;
default:
throw new Error("Unknown gif block: 0x" + buf[p-1].toString(16));
break;
}
}
this.numFrames = function() {
return frames.length;
};
this.loopCount = function() {
return loop_count;
};
this.frameInfo = function(frame_num) {
if (frame_num < 0 || frame_num >= frames.length)
throw new Error("Frame index out of range.");
return frames[frame_num];
}
this.decodeAndBlitFrameBGRA = function(frame_num, pixels) {
var frame = this.frameInfo(frame_num);
var num_pixels = frame.width * frame.height;
var index_stream = new Uint8Array(num_pixels); // At most 8-bit indices.
GifReaderLZWOutputIndexStream(
buf, frame.data_offset, index_stream, num_pixels);
var palette_offset = frame.palette_offset;
// NOTE(deanm): It seems to be much faster to compare index to 256 than
// to === null. Not sure why, but CompareStub_EQ_STRICT shows up high in
// the profile, not sure if it's related to using a Uint8Array.
var trans = frame.transparent_index;
if (trans === null) trans = 256;
// We are possibly just blitting to a portion of the entire frame.
// That is a subrect within the framerect, so the additional pixels
// must be skipped over after we finished a scanline.
var framewidth = frame.width;
var framestride = width - framewidth;
var xleft = framewidth; // Number of subrect pixels left in scanline.
// Output indicies of the top left and bottom right corners of the subrect.
var opbeg = ((frame.y * width) + frame.x) * 4;
var opend = ((frame.y + frame.height) * width + frame.x) * 4;
var op = opbeg;
var scanstride = framestride * 4;
// Use scanstride to skip past the rows when interlacing. This is skipping
// 7 rows for the first two passes, then 3 then 1.
if (frame.interlaced === true) {
scanstride += width * 4 * 7; // Pass 1.
}
var interlaceskip = 8; // Tracking the row interval in the current pass.
for (var i = 0, il = index_stream.length; i < il; ++i) {
var index = index_stream[i];
if (xleft === 0) { // Beginning of new scan line
op += scanstride;
xleft = framewidth;
if (op >= opend) { // Catch the wrap to switch passes when interlacing.
scanstride = framestride * 4 + width * 4 * (interlaceskip-1);
// interlaceskip / 2 * 4 is interlaceskip << 1.
op = opbeg + (framewidth + framestride) * (interlaceskip << 1);
interlaceskip >>= 1;
}
}
if (index === trans) {
op += 4;
} else {
var r = buf[palette_offset + index * 3];
var g = buf[palette_offset + index * 3 + 1];
var b = buf[palette_offset + index * 3 + 2];
pixels[op++] = b;
pixels[op++] = g;
pixels[op++] = r;
pixels[op++] = 255;
}
--xleft;
}
};
// I will go to copy and paste hell one day...
this.decodeAndBlitFrameRGBA = function(frame_num, pixels) {
var frame = this.frameInfo(frame_num);
var num_pixels = frame.width * frame.height;
var index_stream = new Uint8Array(num_pixels); // At most 8-bit indices.
GifReaderLZWOutputIndexStream(
buf, frame.data_offset, index_stream, num_pixels);
var palette_offset = frame.palette_offset;
// NOTE(deanm): It seems to be much faster to compare index to 256 than
// to === null. Not sure why, but CompareStub_EQ_STRICT shows up high in
// the profile, not sure if it's related to using a Uint8Array.
var trans = frame.transparent_index;
if (trans === null) trans = 256;
// We are possibly just blitting to a portion of the entire frame.
// That is a subrect within the framerect, so the additional pixels
// must be skipped over after we finished a scanline.
var framewidth = frame.width;
var framestride = width - framewidth;
var xleft = framewidth; // Number of subrect pixels left in scanline.
// Output indicies of the top left and bottom right corners of the subrect.
var opbeg = ((frame.y * width) + frame.x) * 4;
var opend = ((frame.y + frame.height) * width + frame.x) * 4;
var op = opbeg;
var scanstride = framestride * 4;
// Use scanstride to skip past the rows when interlacing. This is skipping
// 7 rows for the first two passes, then 3 then 1.
if (frame.interlaced === true) {
scanstride += width * 4 * 7; // Pass 1.
}
var interlaceskip = 8; // Tracking the row interval in the current pass.
for (var i = 0, il = index_stream.length; i < il; ++i) {
var index = index_stream[i];
if (xleft === 0) { // Beginning of new scan line
op += scanstride;
xleft = framewidth;
if (op >= opend) { // Catch the wrap to switch passes when interlacing.
scanstride = framestride * 4 + width * 4 * (interlaceskip-1);
// interlaceskip / 2 * 4 is interlaceskip << 1.
op = opbeg + (framewidth + framestride) * (interlaceskip << 1);
interlaceskip >>= 1;
}
}
if (index === trans) {
op += 4;
} else {
var r = buf[palette_offset + index * 3];
var g = buf[palette_offset + index * 3 + 1];
var b = buf[palette_offset + index * 3 + 2];
pixels[op++] = r;
pixels[op++] = g;
pixels[op++] = b;
pixels[op++] = 255;
}
--xleft;
}
};
}
function GifReaderLZWOutputIndexStream(code_stream, p, output, output_length) {
var min_code_size = code_stream[p++];
var clear_code = 1 << min_code_size;
var eoi_code = clear_code + 1;
var next_code = eoi_code + 1;
var cur_code_size = min_code_size + 1; // Number of bits per code.
// NOTE: This shares the same name as the encoder, but has a different
// meaning here. Here this masks each code coming from the code stream.
var code_mask = (1 << cur_code_size) - 1;
var cur_shift = 0;
var cur = 0;
var op = 0; // Output pointer.
var subblock_size = code_stream[p++];
// TODO(deanm): Would using a TypedArray be any faster? At least it would
// solve the fast mode / backing store uncertainty.
// var code_table = Array(4096);
var code_table = new Int32Array(4096); // Can be signed, we only use 20 bits.
var prev_code = null; // Track code-1.
while (true) {
// Read up to two bytes, making sure we always 12-bits for max sized code.
while (cur_shift < 16) {
if (subblock_size === 0) break; // No more data to be read.
cur |= code_stream[p++] << cur_shift;
cur_shift += 8;
if (subblock_size === 1) { // Never let it get to 0 to hold logic above.
subblock_size = code_stream[p++]; // Next subblock.
} else {
--subblock_size;
}
}
// TODO(deanm): We should never really get here, we should have received
// and EOI.
if (cur_shift < cur_code_size)
break;
var code = cur & code_mask;
cur >>= cur_code_size;
cur_shift -= cur_code_size;
// TODO(deanm): Maybe should check that the first code was a clear code,
// at least this is what you're supposed to do. But actually our encoder
// now doesn't emit a clear code first anyway.
if (code === clear_code) {
// We don't actually have to clear the table. This could be a good idea
// for greater error checking, but we don't really do any anyway. We
// will just track it with next_code and overwrite old entries.
next_code = eoi_code + 1;
cur_code_size = min_code_size + 1;
code_mask = (1 << cur_code_size) - 1;
// Don't update prev_code ?
prev_code = null;
continue;
} else if (code === eoi_code) {
break;
}
// We have a similar situation as the decoder, where we want to store
// variable length entries (code table entries), but we want to do in a
// faster manner than an array of arrays. The code below stores sort of a
// linked list within the code table, and then "chases" through it to
// construct the dictionary entries. When a new entry is created, just the
// last byte is stored, and the rest (prefix) of the entry is only
// referenced by its table entry. Then the code chases through the
// prefixes until it reaches a single byte code. We have to chase twice,
// first to compute the length, and then to actually copy the data to the
// output (backwards, since we know the length). The alternative would be
// storing something in an intermediate stack, but that doesn't make any
// more sense. I implemented an approach where it also stored the length
// in the code table, although it's a bit tricky because you run out of
// bits (12 + 12 + 8), but I didn't measure much improvements (the table
// entries are generally not the long). Even when I created benchmarks for
// very long table entries the complexity did not seem worth it.
// The code table stores the prefix entry in 12 bits and then the suffix
// byte in 8 bits, so each entry is 20 bits.
var chase_code = code < next_code ? code : prev_code;
// Chase what we will output, either {CODE} or {CODE-1}.
var chase_length = 0;
var chase = chase_code;
while (chase > clear_code) {
chase = code_table[chase] >> 8;
++chase_length;
}
var k = chase;
var op_end = op + chase_length + (chase_code !== code ? 1 : 0);
if (op_end > output_length) {
console.log("Warning, gif stream longer than expected.");
return;
}
// Already have the first byte from the chase, might as well write it fast.
output[op++] = k;
op += chase_length;
var b = op; // Track pointer, writing backwards.
if (chase_code !== code) // The case of emitting {CODE-1} + k.
output[op++] = k;
chase = chase_code;
while (chase_length--) {
chase = code_table[chase];
output[--b] = chase & 0xff; // Write backwards.
chase >>= 8; // Pull down to the prefix code.
}
if (prev_code !== null && next_code < 4096) {
code_table[next_code++] = prev_code << 8 | k;
// TODO(deanm): Figure out this clearing vs code growth logic better. I
// have an feeling that it should just happen somewhere else, for now it
// is awkward between when we grow past the max and then hit a clear code.
// For now just check if we hit the max 12-bits (then a clear code should
// follow, also of course encoded in 12-bits).
if (next_code >= code_mask+1 && cur_code_size < 12) {
++cur_code_size;
code_mask = code_mask << 1 | 1;
}
}
prev_code = code;
}
if (op !== output_length) {
console.log("Warning, gif stream shorter than expected.");
}
return output;
}
// CommonJS.
try { exports.GifWriter = GifWriter; exports.GifReader = GifReader } catch(e) {}
/***/ }),
/***/ 1726:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
"use strict";
// Top level file is just a mixin of submodules & constants
var assign = (__nccwpck_require__(5483).assign);
var deflate = __nccwpck_require__(7265);
var inflate = __nccwpck_require__(6522);
var constants = __nccwpck_require__(8282);
var pako = {};
assign(pako, deflate, inflate, constants);
module.exports = pako;
/***/ }),
/***/ 7265:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
var zlib_deflate = __nccwpck_require__(978);
var utils = __nccwpck_require__(5483);
var strings = __nccwpck_require__(2380);
var msg = __nccwpck_require__(1890);
var ZStream = __nccwpck_require__(6442);
var toString = Object.prototype.toString;
/* Public constants ==========================================================*/
/* ===========================================================================*/
var Z_NO_FLUSH = 0;
var Z_FINISH = 4;
var Z_OK = 0;
var Z_STREAM_END = 1;
var Z_SYNC_FLUSH = 2;
var Z_DEFAULT_COMPRESSION = -1;
var Z_DEFAULT_STRATEGY = 0;
var Z_DEFLATED = 8;
/* ===========================================================================*/
/**
* class Deflate
*
* Generic JS-style wrapper for zlib calls. If you don't need
* streaming behaviour - use more simple functions: [[deflate]],
* [[deflateRaw]] and [[gzip]].
**/
/* internal
* Deflate.chunks -> Array
*
* Chunks of output data, if [[Deflate#onData]] not overridden.
**/
/**
* Deflate.result -> Uint8Array|Array
*
* Compressed result, generated by default [[Deflate#onData]]
* and [[Deflate#onEnd]] handlers. Filled after you push last chunk
* (call [[Deflate#push]] with `Z_FINISH` / `true` param) or if you
* push a chunk with explicit flush (call [[Deflate#push]] with
* `Z_SYNC_FLUSH` param).
**/
/**
* Deflate.err -> Number
*
* Error code after deflate finished. 0 (Z_OK) on success.
* You will not need it in real life, because deflate errors
* are possible only on wrong options or bad `onData` / `onEnd`
* custom handlers.
**/
/**
* Deflate.msg -> String
*
* Error message, if [[Deflate.err]] != 0
**/
/**
* new Deflate(options)
* - options (Object): zlib deflate options.
*
* Creates new deflator instance with specified params. Throws exception
* on bad params. Supported options:
*
* - `level`
* - `windowBits`
* - `memLevel`
* - `strategy`
* - `dictionary`
*
* [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)
* for more information on these.
*
* Additional options, for internal needs:
*
* - `chunkSize` - size of generated data chunks (16K by default)
* - `raw` (Boolean) - do raw deflate
* - `gzip` (Boolean) - create gzip wrapper
* - `to` (String) - if equal to 'string', then result will be "binary string"
* (each char code [0..255])
* - `header` (Object) - custom header for gzip
* - `text` (Boolean) - true if compressed data believed to be text
* - `time` (Number) - modification time, unix timestamp
* - `os` (Number) - operation system code
* - `extra` (Array) - array of bytes with extra data (max 65536)
* - `name` (String) - file name (binary string)
* - `comment` (String) - comment (binary string)
* - `hcrc` (Boolean) - true if header crc should be added
*
* ##### Example:
*
* ```javascript
* var pako = require('pako')
* , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9])
* , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]);
*
* var deflate = new pako.Deflate({ level: 3});
*
* deflate.push(chunk1, false);
* deflate.push(chunk2, true); // true -> last chunk
*
* if (deflate.err) { throw new Error(deflate.err); }
*
* console.log(deflate.result);
* ```
**/
function Deflate(options) {
if (!(this instanceof Deflate)) return new Deflate(options);
this.options = utils.assign({
level: Z_DEFAULT_COMPRESSION,
method: Z_DEFLATED,
chunkSize: 16384,
windowBits: 15,
memLevel: 8,
strategy: Z_DEFAULT_STRATEGY,
to: ''
}, options || {});
var opt = this.options;
if (opt.raw && (opt.windowBits > 0)) {
opt.windowBits = -opt.windowBits;
}
else if (opt.gzip && (opt.windowBits > 0) && (opt.windowBits < 16)) {
opt.windowBits += 16;
}
this.err = 0; // error code, if happens (0 = Z_OK)
this.msg = ''; // error message
this.ended = false; // used to avoid multiple onEnd() calls
this.chunks = []; // chunks of compressed data
this.strm = new ZStream();
this.strm.avail_out = 0;
var status = zlib_deflate.deflateInit2(
this.strm,
opt.level,
opt.method,
opt.windowBits,
opt.memLevel,
opt.strategy
);
if (status !== Z_OK) {
throw new Error(msg[status]);
}
if (opt.header) {
zlib_deflate.deflateSetHeader(this.strm, opt.header);
}
if (opt.dictionary) {
var dict;
// Convert data if needed
if (typeof opt.dictionary === 'string') {
// If we need to compress text, change encoding to utf8.
dict = strings.string2buf(opt.dictionary);
} else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') {
dict = new Uint8Array(opt.dictionary);
} else {
dict = opt.dictionary;
}
status = zlib_deflate.deflateSetDictionary(this.strm, dict);
if (status !== Z_OK) {
throw new Error(msg[status]);
}
this._dict_set = true;
}
}
/**
* Deflate#push(data[, mode]) -> Boolean
* - data (Uint8Array|Array|ArrayBuffer|String): input data. Strings will be
* converted to utf8 byte sequence.
* - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes.
* See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH.
*
* Sends input data to deflate pipe, generating [[Deflate#onData]] calls with
* new compressed chunks. Returns `true` on success. The last data block must have
* mode Z_FINISH (or `true`). That will flush internal pending buffers and call
* [[Deflate#onEnd]]. For interim explicit flushes (without ending the stream) you
* can use mode Z_SYNC_FLUSH, keeping the compression context.
*
* On fail call [[Deflate#onEnd]] with error code and return false.
*
* We strongly recommend to use `Uint8Array` on input for best speed (output
* array format is detected automatically). Also, don't skip last param and always
* use the same type in your code (boolean or number). That will improve JS speed.
*
* For regular `Array`-s make sure all elements are [0..255].
*
* ##### Example
*
* ```javascript
* push(chunk, false); // push one of data chunks
* ...
* push(chunk, true); // push last chunk
* ```
**/
Deflate.prototype.push = function (data, mode) {
var strm = this.strm;
var chunkSize = this.options.chunkSize;
var status, _mode;
if (this.ended) { return false; }
_mode = (mode === ~~mode) ? mode : ((mode === true) ? Z_FINISH : Z_NO_FLUSH);
// Convert data if needed
if (typeof data === 'string') {
// If we need to compress text, change encoding to utf8.
strm.input = strings.string2buf(data);
} else if (toString.call(data) === '[object ArrayBuffer]') {
strm.input = new Uint8Array(data);
} else {
strm.input = data;
}
strm.next_in = 0;
strm.avail_in = strm.input.length;
do {
if (strm.avail_out === 0) {
strm.output = new utils.Buf8(chunkSize);
strm.next_out = 0;
strm.avail_out = chunkSize;
}
status = zlib_deflate.deflate(strm, _mode); /* no bad return value */
if (status !== Z_STREAM_END && status !== Z_OK) {
this.onEnd(status);
this.ended = true;
return false;
}
if (strm.avail_out === 0 || (strm.avail_in === 0 && (_mode === Z_FINISH || _mode === Z_SYNC_FLUSH))) {
if (this.options.to === 'string') {
this.onData(strings.buf2binstring(utils.shrinkBuf(strm.output, strm.next_out)));
} else {
this.onData(utils.shrinkBuf(strm.output, strm.next_out));
}
}
} while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== Z_STREAM_END);
// Finalize on the last chunk.
if (_mode === Z_FINISH) {
status = zlib_deflate.deflateEnd(this.strm);
this.onEnd(status);
this.ended = true;
return status === Z_OK;
}
// callback interim results if Z_SYNC_FLUSH.
if (_mode === Z_SYNC_FLUSH) {
this.onEnd(Z_OK);
strm.avail_out = 0;
return true;
}
return true;
};
/**
* Deflate#onData(chunk) -> Void
* - chunk (Uint8Array|Array|String): output data. Type of array depends
* on js engine support. When string output requested, each chunk
* will be string.
*
* By default, stores data blocks in `chunks[]` property and glue
* those in `onEnd`. Override this handler, if you need another behaviour.
**/
Deflate.prototype.onData = function (chunk) {
this.chunks.push(chunk);
};
/**
* Deflate#onEnd(status) -> Void
* - status (Number): deflate status. 0 (Z_OK) on success,
* other if not.
*
* Called once after you tell deflate that the input stream is
* complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH)
* or if an error happened. By default - join collected chunks,
* free memory and fill `results` / `err` properties.
**/
Deflate.prototype.onEnd = function (status) {
// On success - join
if (status === Z_OK) {
if (this.options.to === 'string') {
this.result = this.chunks.join('');
} else {
this.result = utils.flattenChunks(this.chunks);
}
}
this.chunks = [];
this.err = status;
this.msg = this.strm.msg;
};
/**
* deflate(data[, options]) -> Uint8Array|Array|String
* - data (Uint8Array|Array|String): input data to compress.
* - options (Object): zlib deflate options.
*
* Compress `data` with deflate algorithm and `options`.
*
* Supported options are:
*
* - level
* - windowBits
* - memLevel
* - strategy
* - dictionary
*
* [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)
* for more information on these.
*
* Sugar (options):
*
* - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify
* negative windowBits implicitly.
* - `to` (String) - if equal to 'string', then result will be "binary string"
* (each char code [0..255])
*
* ##### Example:
*
* ```javascript
* var pako = require('pako')
* , data = Uint8Array([1,2,3,4,5,6,7,8,9]);
*
* console.log(pako.deflate(data));
* ```
**/
function deflate(input, options) {
var deflator = new Deflate(options);
deflator.push(input, true);
// That will never happens, if you don't cheat with options :)
if (deflator.err) { throw deflator.msg || msg[deflator.err]; }
return deflator.result;
}
/**
* deflateRaw(data[, options]) -> Uint8Array|Array|String
* - data (Uint8Array|Array|String): input data to compress.
* - options (Object): zlib deflate options.
*
* The same as [[deflate]], but creates raw data, without wrapper
* (header and adler32 crc).
**/
function deflateRaw(input, options) {
options = options || {};
options.raw = true;
return deflate(input, options);
}
/**
* gzip(data[, options]) -> Uint8Array|Array|String
* - data (Uint8Array|Array|String): input data to compress.
* - options (Object): zlib deflate options.
*
* The same as [[deflate]], but create gzip wrapper instead of
* deflate one.
**/
function gzip(input, options) {
options = options || {};
options.gzip = true;
return deflate(input, options);
}
exports.Deflate = Deflate;
exports.deflate = deflate;
exports.deflateRaw = deflateRaw;
exports.gzip = gzip;
/***/ }),
/***/ 6522:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
var zlib_inflate = __nccwpck_require__(409);
var utils = __nccwpck_require__(5483);
var strings = __nccwpck_require__(2380);
var c = __nccwpck_require__(8282);
var msg = __nccwpck_require__(1890);
var ZStream = __nccwpck_require__(6442);
var GZheader = __nccwpck_require__(5105);
var toString = Object.prototype.toString;
/**
* class Inflate
*
* Generic JS-style wrapper for zlib calls. If you don't need
* streaming behaviour - use more simple functions: [[inflate]]
* and [[inflateRaw]].
**/
/* internal
* inflate.chunks -> Array
*
* Chunks of output data, if [[Inflate#onData]] not overridden.
**/
/**
* Inflate.result -> Uint8Array|Array|String
*
* Uncompressed result, generated by default [[Inflate#onData]]
* and [[Inflate#onEnd]] handlers. Filled after you push last chunk
* (call [[Inflate#push]] with `Z_FINISH` / `true` param) or if you
* push a chunk with explicit flush (call [[Inflate#push]] with
* `Z_SYNC_FLUSH` param).
**/
/**
* Inflate.err -> Number
*
* Error code after inflate finished. 0 (Z_OK) on success.
* Should be checked if broken data possible.
**/
/**
* Inflate.msg -> String
*
* Error message, if [[Inflate.err]] != 0
**/
/**
* new Inflate(options)
* - options (Object): zlib inflate options.
*
* Creates new inflator instance with specified params. Throws exception
* on bad params. Supported options:
*
* - `windowBits`
* - `dictionary`
*
* [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)
* for more information on these.
*
* Additional options, for internal needs:
*
* - `chunkSize` - size of generated data chunks (16K by default)
* - `raw` (Boolean) - do raw inflate
* - `to` (String) - if equal to 'string', then result will be converted
* from utf8 to utf16 (javascript) string. When string output requested,
* chunk length can differ from `chunkSize`, depending on content.
*
* By default, when no options set, autodetect deflate/gzip data format via
* wrapper header.
*
* ##### Example:
*
* ```javascript
* var pako = require('pako')
* , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9])
* , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]);
*
* var inflate = new pako.Inflate({ level: 3});
*
* inflate.push(chunk1, false);
* inflate.push(chunk2, true); // true -> last chunk
*
* if (inflate.err) { throw new Error(inflate.err); }
*
* console.log(inflate.result);
* ```
**/
function Inflate(options) {
if (!(this instanceof Inflate)) return new Inflate(options);
this.options = utils.assign({
chunkSize: 16384,
windowBits: 0,
to: ''
}, options || {});
var opt = this.options;
// Force window size for `raw` data, if not set directly,
// because we have no header for autodetect.
if (opt.raw && (opt.windowBits >= 0) && (opt.windowBits < 16)) {
opt.windowBits = -opt.windowBits;
if (opt.windowBits === 0) { opt.windowBits = -15; }
}
// If `windowBits` not defined (and mode not raw) - set autodetect flag for gzip/deflate
if ((opt.windowBits >= 0) && (opt.windowBits < 16) &&
!(options && options.windowBits)) {
opt.windowBits += 32;
}
// Gzip header has no info about windows size, we can do autodetect only
// for deflate. So, if window size not set, force it to max when gzip possible
if ((opt.windowBits > 15) && (opt.windowBits < 48)) {
// bit 3 (16) -> gzipped data
// bit 4 (32) -> autodetect gzip/deflate
if ((opt.windowBits & 15) === 0) {
opt.windowBits |= 15;
}
}
this.err = 0; // error code, if happens (0 = Z_OK)
this.msg = ''; // error message
this.ended = false; // used to avoid multiple onEnd() calls
this.chunks = []; // chunks of compressed data
this.strm = new ZStream();
this.strm.avail_out = 0;
var status = zlib_inflate.inflateInit2(
this.strm,
opt.windowBits
);
if (status !== c.Z_OK) {
throw new Error(msg[status]);
}
this.header = new GZheader();
zlib_inflate.inflateGetHeader(this.strm, this.header);
// Setup dictionary
if (opt.dictionary) {
// Convert data if needed
if (typeof opt.dictionary === 'string') {
opt.dictionary = strings.string2buf(opt.dictionary);
} else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') {
opt.dictionary = new Uint8Array(opt.dictionary);
}
if (opt.raw) { //In raw mode we need to set the dictionary early
status = zlib_inflate.inflateSetDictionary(this.strm, opt.dictionary);
if (status !== c.Z_OK) {
throw new Error(msg[status]);
}
}
}
}
/**
* Inflate#push(data[, mode]) -> Boolean
* - data (Uint8Array|Array|ArrayBuffer|String): input data
* - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes.
* See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH.
*
* Sends input data to inflate pipe, generating [[Inflate#onData]] calls with
* new output chunks. Returns `true` on success. The last data block must have
* mode Z_FINISH (or `true`). That will flush internal pending buffers and call
* [[Inflate#onEnd]]. For interim explicit flushes (without ending the stream) you
* can use mode Z_SYNC_FLUSH, keeping the decompression context.
*
* On fail call [[Inflate#onEnd]] with error code and return false.
*
* We strongly recommend to use `Uint8Array` on input for best speed (output
* format is detected automatically). Also, don't skip last param and always
* use the same type in your code (boolean or number). That will improve JS speed.
*
* For regular `Array`-s make sure all elements are [0..255].
*
* ##### Example
*
* ```javascript
* push(chunk, false); // push one of data chunks
* ...
* push(chunk, true); // push last chunk
* ```
**/
Inflate.prototype.push = function (data, mode) {
var strm = this.strm;
var chunkSize = this.options.chunkSize;
var dictionary = this.options.dictionary;
var status, _mode;
var next_out_utf8, tail, utf8str;
// Flag to properly process Z_BUF_ERROR on testing inflate call
// when we check that all output data was flushed.
var allowBufError = false;
if (this.ended) { return false; }
_mode = (mode === ~~mode) ? mode : ((mode === true) ? c.Z_FINISH : c.Z_NO_FLUSH);
// Convert data if needed
if (typeof data === 'string') {
// Only binary strings can be decompressed on practice
strm.input = strings.binstring2buf(data);
} else if (toString.call(data) === '[object ArrayBuffer]') {
strm.input = new Uint8Array(data);
} else {
strm.input = data;
}
strm.next_in = 0;
strm.avail_in = strm.input.length;
do {
if (strm.avail_out === 0) {
strm.output = new utils.Buf8(chunkSize);
strm.next_out = 0;
strm.avail_out = chunkSize;
}
status = zlib_inflate.inflate(strm, c.Z_NO_FLUSH); /* no bad return value */
if (status === c.Z_NEED_DICT && dictionary) {
status = zlib_inflate.inflateSetDictionary(this.strm, dictionary);
}
if (status === c.Z_BUF_ERROR && allowBufError === true) {
status = c.Z_OK;
allowBufError = false;
}
if (status !== c.Z_STREAM_END && status !== c.Z_OK) {
this.onEnd(status);
this.ended = true;
return false;
}
if (strm.next_out) {
if (strm.avail_out === 0 || status === c.Z_STREAM_END || (strm.avail_in === 0 && (_mode === c.Z_FINISH || _mode === c.Z_SYNC_FLUSH))) {
if (this.options.to === 'string') {
next_out_utf8 = strings.utf8border(strm.output, strm.next_out);
tail = strm.next_out - next_out_utf8;
utf8str = strings.buf2string(strm.output, next_out_utf8);
// move tail
strm.next_out = tail;
strm.avail_out = chunkSize - tail;
if (tail) { utils.arraySet(strm.output, strm.output, next_out_utf8, tail, 0); }
this.onData(utf8str);
} else {
this.onData(utils.shrinkBuf(strm.output, strm.next_out));
}
}
}
// When no more input data, we should check that internal inflate buffers
// are flushed. The only way to do it when avail_out = 0 - run one more
// inflate pass. But if output data not exists, inflate return Z_BUF_ERROR.
// Here we set flag to process this error properly.
//
// NOTE. Deflate does not return error in this case and does not needs such
// logic.
if (strm.avail_in === 0 && strm.avail_out === 0) {
allowBufError = true;
}
} while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== c.Z_STREAM_END);
if (status === c.Z_STREAM_END) {
_mode = c.Z_FINISH;
}
// Finalize on the last chunk.
if (_mode === c.Z_FINISH) {
status = zlib_inflate.inflateEnd(this.strm);
this.onEnd(status);
this.ended = true;
return status === c.Z_OK;
}
// callback interim results if Z_SYNC_FLUSH.
if (_mode === c.Z_SYNC_FLUSH) {
this.onEnd(c.Z_OK);
strm.avail_out = 0;
return true;
}
return true;
};
/**
* Inflate#onData(chunk) -> Void
* - chunk (Uint8Array|Array|String): output data. Type of array depends
* on js engine support. When string output requested, each chunk
* will be string.
*
* By default, stores data blocks in `chunks[]` property and glue
* those in `onEnd`. Override this handler, if you need another behaviour.
**/
Inflate.prototype.onData = function (chunk) {
this.chunks.push(chunk);
};
/**
* Inflate#onEnd(status) -> Void
* - status (Number): inflate status. 0 (Z_OK) on success,
* other if not.
*
* Called either after you tell inflate that the input stream is
* complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH)
* or if an error happened. By default - join collected chunks,
* free memory and fill `results` / `err` properties.
**/
Inflate.prototype.onEnd = function (status) {
// On success - join
if (status === c.Z_OK) {
if (this.options.to === 'string') {
// Glue & convert here, until we teach pako to send
// utf8 aligned strings to onData
this.result = this.chunks.join('');
} else {
this.result = utils.flattenChunks(this.chunks);
}
}
this.chunks = [];
this.err = status;
this.msg = this.strm.msg;
};
/**
* inflate(data[, options]) -> Uint8Array|Array|String
* - data (Uint8Array|Array|String): input data to decompress.
* - options (Object): zlib inflate options.
*
* Decompress `data` with inflate/ungzip and `options`. Autodetect
* format via wrapper header by default. That's why we don't provide
* separate `ungzip` method.
*
* Supported options are:
*
* - windowBits
*
* [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)
* for more information.
*
* Sugar (options):
*
* - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify
* negative windowBits implicitly.
* - `to` (String) - if equal to 'string', then result will be converted
* from utf8 to utf16 (javascript) string. When string output requested,
* chunk length can differ from `chunkSize`, depending on content.
*
*
* ##### Example:
*
* ```javascript
* var pako = require('pako')
* , input = pako.deflate([1,2,3,4,5,6,7,8,9])
* , output;
*
* try {
* output = pako.inflate(input);
* } catch (err)
* console.log(err);
* }
* ```
**/
function inflate(input, options) {
var inflator = new Inflate(options);
inflator.push(input, true);
// That will never happens, if you don't cheat with options :)
if (inflator.err) { throw inflator.msg || msg[inflator.err]; }
return inflator.result;
}
/**
* inflateRaw(data[, options]) -> Uint8Array|Array|String
* - data (Uint8Array|Array|String): input data to decompress.
* - options (Object): zlib inflate options.
*
* The same as [[inflate]], but creates raw data, without wrapper
* (header and adler32 crc).
**/
function inflateRaw(input, options) {
options = options || {};
options.raw = true;
return inflate(input, options);
}
/**
* ungzip(data[, options]) -> Uint8Array|Array|String
* - data (Uint8Array|Array|String): input data to decompress.
* - options (Object): zlib inflate options.
*
* Just shortcut to [[inflate]], because it autodetects format
* by header.content. Done for convenience.
**/
exports.Inflate = Inflate;
exports.inflate = inflate;
exports.inflateRaw = inflateRaw;
exports.ungzip = inflate;
/***/ }),
/***/ 5483:
/***/ ((__unused_webpack_module, exports) => {
"use strict";
var TYPED_OK = (typeof Uint8Array !== 'undefined') &&
(typeof Uint16Array !== 'undefined') &&
(typeof Int32Array !== 'undefined');
function _has(obj, key) {
return Object.prototype.hasOwnProperty.call(obj, key);
}
exports.assign = function (obj /*from1, from2, from3, ...*/) {
var sources = Array.prototype.slice.call(arguments, 1);
while (sources.length) {
var source = sources.shift();
if (!source) { continue; }
if (typeof source !== 'object') {
throw new TypeError(source + 'must be non-object');
}
for (var p in source) {
if (_has(source, p)) {
obj[p] = source[p];
}
}
}
return obj;
};
// reduce buffer size, avoiding mem copy
exports.shrinkBuf = function (buf, size) {
if (buf.length === size) { return buf; }
if (buf.subarray) { return buf.subarray(0, size); }
buf.length = size;
return buf;
};
var fnTyped = {
arraySet: function (dest, src, src_offs, len, dest_offs) {
if (src.subarray && dest.subarray) {
dest.set(src.subarray(src_offs, src_offs + len), dest_offs);
return;
}
// Fallback to ordinary array
for (var i = 0; i < len; i++) {
dest[dest_offs + i] = src[src_offs + i];
}
},
// Join array of chunks to single array.
flattenChunks: function (chunks) {
var i, l, len, pos, chunk, result;
// calculate data length
len = 0;
for (i = 0, l = chunks.length; i < l; i++) {
len += chunks[i].length;
}
// join chunks
result = new Uint8Array(len);
pos = 0;
for (i = 0, l = chunks.length; i < l; i++) {
chunk = chunks[i];
result.set(chunk, pos);
pos += chunk.length;
}
return result;
}
};
var fnUntyped = {
arraySet: function (dest, src, src_offs, len, dest_offs) {
for (var i = 0; i < len; i++) {
dest[dest_offs + i] = src[src_offs + i];
}
},
// Join array of chunks to single array.
flattenChunks: function (chunks) {
return [].concat.apply([], chunks);
}
};
// Enable/Disable typed arrays use, for testing
//
exports.setTyped = function (on) {
if (on) {
exports.Buf8 = Uint8Array;
exports.Buf16 = Uint16Array;
exports.Buf32 = Int32Array;
exports.assign(exports, fnTyped);
} else {
exports.Buf8 = Array;
exports.Buf16 = Array;
exports.Buf32 = Array;
exports.assign(exports, fnUntyped);
}
};
exports.setTyped(TYPED_OK);
/***/ }),
/***/ 2380:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
// String encode/decode helpers
var utils = __nccwpck_require__(5483);
// Quick check if we can use fast array to bin string conversion
//
// - apply(Array) can fail on Android 2.2
// - apply(Uint8Array) can fail on iOS 5.1 Safari
//
var STR_APPLY_OK = true;
var STR_APPLY_UIA_OK = true;
try { String.fromCharCode.apply(null, [ 0 ]); } catch (__) { STR_APPLY_OK = false; }
try { String.fromCharCode.apply(null, new Uint8Array(1)); } catch (__) { STR_APPLY_UIA_OK = false; }
// Table with utf8 lengths (calculated by first byte of sequence)
// Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS,
// because max possible codepoint is 0x10ffff
var _utf8len = new utils.Buf8(256);
for (var q = 0; q < 256; q++) {
_utf8len[q] = (q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1);
}
_utf8len[254] = _utf8len[254] = 1; // Invalid sequence start
// convert string to array (typed, when possible)
exports.string2buf = function (str) {
var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0;
// count binary size
for (m_pos = 0; m_pos < str_len; m_pos++) {
c = str.charCodeAt(m_pos);
if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {
c2 = str.charCodeAt(m_pos + 1);
if ((c2 & 0xfc00) === 0xdc00) {
c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);
m_pos++;
}
}
buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4;
}
// allocate buffer
buf = new utils.Buf8(buf_len);
// convert
for (i = 0, m_pos = 0; i < buf_len; m_pos++) {
c = str.charCodeAt(m_pos);
if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {
c2 = str.charCodeAt(m_pos + 1);
if ((c2 & 0xfc00) === 0xdc00) {
c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);
m_pos++;
}
}
if (c < 0x80) {
/* one byte */
buf[i++] = c;
} else if (c < 0x800) {
/* two bytes */
buf[i++] = 0xC0 | (c >>> 6);
buf[i++] = 0x80 | (c & 0x3f);
} else if (c < 0x10000) {
/* three bytes */
buf[i++] = 0xE0 | (c >>> 12);
buf[i++] = 0x80 | (c >>> 6 & 0x3f);
buf[i++] = 0x80 | (c & 0x3f);
} else {
/* four bytes */
buf[i++] = 0xf0 | (c >>> 18);
buf[i++] = 0x80 | (c >>> 12 & 0x3f);
buf[i++] = 0x80 | (c >>> 6 & 0x3f);
buf[i++] = 0x80 | (c & 0x3f);
}
}
return buf;
};
// Helper (used in 2 places)
function buf2binstring(buf, len) {
// On Chrome, the arguments in a function call that are allowed is `65534`.
// If the length of the buffer is smaller than that, we can use this optimization,
// otherwise we will take a slower path.
if (len < 65534) {
if ((buf.subarray && STR_APPLY_UIA_OK) || (!buf.subarray && STR_APPLY_OK)) {
return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len));
}
}
var result = '';
for (var i = 0; i < len; i++) {
result += String.fromCharCode(buf[i]);
}
return result;
}
// Convert byte array to binary string
exports.buf2binstring = function (buf) {
return buf2binstring(buf, buf.length);
};
// Convert binary string (typed, when possible)
exports.binstring2buf = function (str) {
var buf = new utils.Buf8(str.length);
for (var i = 0, len = buf.length; i < len; i++) {
buf[i] = str.charCodeAt(i);
}
return buf;
};
// convert array to string
exports.buf2string = function (buf, max) {
var i, out, c, c_len;
var len = max || buf.length;
// Reserve max possible length (2 words per char)
// NB: by unknown reasons, Array is significantly faster for
// String.fromCharCode.apply than Uint16Array.
var utf16buf = new Array(len * 2);
for (out = 0, i = 0; i < len;) {
c = buf[i++];
// quick process ascii
if (c < 0x80) { utf16buf[out++] = c; continue; }
c_len = _utf8len[c];
// skip 5 & 6 byte codes
if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len - 1; continue; }
// apply mask on first byte
c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07;
// join the rest
while (c_len > 1 && i < len) {
c = (c << 6) | (buf[i++] & 0x3f);
c_len--;
}
// terminated by end of string?
if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; }
if (c < 0x10000) {
utf16buf[out++] = c;
} else {
c -= 0x10000;
utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff);
utf16buf[out++] = 0xdc00 | (c & 0x3ff);
}
}
return buf2binstring(utf16buf, out);
};
// Calculate max possible position in utf8 buffer,
// that will not break sequence. If that's not possible
// - (very small limits) return max size as is.
//
// buf[] - utf8 bytes array
// max - length limit (mandatory);
exports.utf8border = function (buf, max) {
var pos;
max = max || buf.length;
if (max > buf.length) { max = buf.length; }
// go back from last position, until start of sequence found
pos = max - 1;
while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; }
// Very small and broken sequence,
// return max, because we should return something anyway.
if (pos < 0) { return max; }
// If we came to start of buffer - that means buffer is too small,
// return max too.
if (pos === 0) { return max; }
return (pos + _utf8len[buf[pos]] > max) ? pos : max;
};
/***/ }),
/***/ 6924:
/***/ ((module) => {
"use strict";
// Note: adler32 takes 12% for level 0 and 2% for level 6.
// It isn't worth it to make additional optimizations as in original.
// Small size is preferable.
// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
function adler32(adler, buf, len, pos) {
var s1 = (adler & 0xffff) |0,
s2 = ((adler >>> 16) & 0xffff) |0,
n = 0;
while (len !== 0) {
// Set limit ~ twice less than 5552, to keep
// s2 in 31-bits, because we force signed ints.
// in other case %= will fail.
n = len > 2000 ? 2000 : len;
len -= n;
do {
s1 = (s1 + buf[pos++]) |0;
s2 = (s2 + s1) |0;
} while (--n);
s1 %= 65521;
s2 %= 65521;
}
return (s1 | (s2 << 16)) |0;
}
module.exports = adler32;
/***/ }),
/***/ 8282:
/***/ ((module) => {
"use strict";
// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
module.exports = {
/* Allowed flush values; see deflate() and inflate() below for details */
Z_NO_FLUSH: 0,
Z_PARTIAL_FLUSH: 1,
Z_SYNC_FLUSH: 2,
Z_FULL_FLUSH: 3,
Z_FINISH: 4,
Z_BLOCK: 5,
Z_TREES: 6,
/* Return codes for the compression/decompression functions. Negative values
* are errors, positive values are used for special but normal events.
*/
Z_OK: 0,
Z_STREAM_END: 1,
Z_NEED_DICT: 2,
Z_ERRNO: -1,
Z_STREAM_ERROR: -2,
Z_DATA_ERROR: -3,
//Z_MEM_ERROR: -4,
Z_BUF_ERROR: -5,
//Z_VERSION_ERROR: -6,
/* compression levels */
Z_NO_COMPRESSION: 0,
Z_BEST_SPEED: 1,
Z_BEST_COMPRESSION: 9,
Z_DEFAULT_COMPRESSION: -1,
Z_FILTERED: 1,
Z_HUFFMAN_ONLY: 2,
Z_RLE: 3,
Z_FIXED: 4,
Z_DEFAULT_STRATEGY: 0,
/* Possible values of the data_type field (though see inflate()) */
Z_BINARY: 0,
Z_TEXT: 1,
//Z_ASCII: 1, // = Z_TEXT (deprecated)
Z_UNKNOWN: 2,
/* The deflate compression method */
Z_DEFLATED: 8
//Z_NULL: null // Use -1 or null inline, depending on var type
};
/***/ }),
/***/ 7242:
/***/ ((module) => {
"use strict";
// Note: we can't get significant speed boost here.
// So write code to minimize size - no pregenerated tables
// and array tools dependencies.
// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
// Use ordinary array, since untyped makes no boost here
function makeTable() {
var c, table = [];
for (var n = 0; n < 256; n++) {
c = n;
for (var k = 0; k < 8; k++) {
c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));
}
table[n] = c;
}
return table;
}
// Create table on load. Just 255 signed longs. Not a problem.
var crcTable = makeTable();
function crc32(crc, buf, len, pos) {
var t = crcTable,
end = pos + len;
crc ^= -1;
for (var i = pos; i < end; i++) {
crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF];
}
return (crc ^ (-1)); // >>> 0;
}
module.exports = crc32;
/***/ }),
/***/ 978:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
var utils = __nccwpck_require__(5483);
var trees = __nccwpck_require__(8754);
var adler32 = __nccwpck_require__(6924);
var crc32 = __nccwpck_require__(7242);
var msg = __nccwpck_require__(1890);
/* Public constants ==========================================================*/
/* ===========================================================================*/
/* Allowed flush values; see deflate() and inflate() below for details */
var Z_NO_FLUSH = 0;
var Z_PARTIAL_FLUSH = 1;
//var Z_SYNC_FLUSH = 2;
var Z_FULL_FLUSH = 3;
var Z_FINISH = 4;
var Z_BLOCK = 5;
//var Z_TREES = 6;
/* Return codes for the compression/decompression functions. Negative values
* are errors, positive values are used for special but normal events.
*/
var Z_OK = 0;
var Z_STREAM_END = 1;
//var Z_NEED_DICT = 2;
//var Z_ERRNO = -1;
var Z_STREAM_ERROR = -2;
var Z_DATA_ERROR = -3;
//var Z_MEM_ERROR = -4;
var Z_BUF_ERROR = -5;
//var Z_VERSION_ERROR = -6;
/* compression levels */
//var Z_NO_COMPRESSION = 0;
//var Z_BEST_SPEED = 1;
//var Z_BEST_COMPRESSION = 9;
var Z_DEFAULT_COMPRESSION = -1;
var Z_FILTERED = 1;
var Z_HUFFMAN_ONLY = 2;
var Z_RLE = 3;
var Z_FIXED = 4;
var Z_DEFAULT_STRATEGY = 0;
/* Possible values of the data_type field (though see inflate()) */
//var Z_BINARY = 0;
//var Z_TEXT = 1;
//var Z_ASCII = 1; // = Z_TEXT
var Z_UNKNOWN = 2;
/* The deflate compression method */
var Z_DEFLATED = 8;
/*============================================================================*/
var MAX_MEM_LEVEL = 9;
/* Maximum value for memLevel in deflateInit2 */
var MAX_WBITS = 15;
/* 32K LZ77 window */
var DEF_MEM_LEVEL = 8;
var LENGTH_CODES = 29;
/* number of length codes, not counting the special END_BLOCK code */
var LITERALS = 256;
/* number of literal bytes 0..255 */
var L_CODES = LITERALS + 1 + LENGTH_CODES;
/* number of Literal or Length codes, including the END_BLOCK code */
var D_CODES = 30;
/* number of distance codes */
var BL_CODES = 19;
/* number of codes used to transfer the bit lengths */
var HEAP_SIZE = 2 * L_CODES + 1;
/* maximum heap size */
var MAX_BITS = 15;
/* All codes must not exceed MAX_BITS bits */
var MIN_MATCH = 3;
var MAX_MATCH = 258;
var MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1);
var PRESET_DICT = 0x20;
var INIT_STATE = 42;
var EXTRA_STATE = 69;
var NAME_STATE = 73;
var COMMENT_STATE = 91;
var HCRC_STATE = 103;
var BUSY_STATE = 113;
var FINISH_STATE = 666;
var BS_NEED_MORE = 1; /* block not completed, need more input or more output */
var BS_BLOCK_DONE = 2; /* block flush performed */
var BS_FINISH_STARTED = 3; /* finish started, need only more output at next deflate */
var BS_FINISH_DONE = 4; /* finish done, accept no more input or output */
var OS_CODE = 0x03; // Unix :) . Don't detect, use this default.
function err(strm, errorCode) {
strm.msg = msg[errorCode];
return errorCode;
}
function rank(f) {
return ((f) << 1) - ((f) > 4 ? 9 : 0);
}
function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }
/* =========================================================================
* Flush as much pending output as possible. All deflate() output goes
* through this function so some applications may wish to modify it
* to avoid allocating a large strm->output buffer and copying into it.
* (See also read_buf()).
*/
function flush_pending(strm) {
var s = strm.state;
//_tr_flush_bits(s);
var len = s.pending;
if (len > strm.avail_out) {
len = strm.avail_out;
}
if (len === 0) { return; }
utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out);
strm.next_out += len;
s.pending_out += len;
strm.total_out += len;
strm.avail_out -= len;
s.pending -= len;
if (s.pending === 0) {
s.pending_out = 0;
}
}
function flush_block_only(s, last) {
trees._tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last);
s.block_start = s.strstart;
flush_pending(s.strm);
}
function put_byte(s, b) {
s.pending_buf[s.pending++] = b;
}
/* =========================================================================
* Put a short in the pending buffer. The 16-bit value is put in MSB order.
* IN assertion: the stream state is correct and there is enough room in
* pending_buf.
*/
function putShortMSB(s, b) {
// put_byte(s, (Byte)(b >> 8));
// put_byte(s, (Byte)(b & 0xff));
s.pending_buf[s.pending++] = (b >>> 8) & 0xff;
s.pending_buf[s.pending++] = b & 0xff;
}
/* ===========================================================================
* Read a new buffer from the current input stream, update the adler32
* and total number of bytes read. All deflate() input goes through
* this function so some applications may wish to modify it to avoid
* allocating a large strm->input buffer and copying from it.
* (See also flush_pending()).
*/
function read_buf(strm, buf, start, size) {
var len = strm.avail_in;
if (len > size) { len = size; }
if (len === 0) { return 0; }
strm.avail_in -= len;
// zmemcpy(buf, strm->next_in, len);
utils.arraySet(buf, strm.input, strm.next_in, len, start);
if (strm.state.wrap === 1) {
strm.adler = adler32(strm.adler, buf, len, start);
}
else if (strm.state.wrap === 2) {
strm.adler = crc32(strm.adler, buf, len, start);
}
strm.next_in += len;
strm.total_in += len;
return len;
}
/* ===========================================================================
* Set match_start to the longest match starting at the given string and
* return its length. Matches shorter or equal to prev_length are discarded,
* in which case the result is equal to prev_length and match_start is
* garbage.
* IN assertions: cur_match is the head of the hash chain for the current
* string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1
* OUT assertion: the match length is not greater than s->lookahead.
*/
function longest_match(s, cur_match) {
var chain_length = s.max_chain_length; /* max hash chain length */
var scan = s.strstart; /* current string */
var match; /* matched string */
var len; /* length of current match */
var best_len = s.prev_length; /* best match length so far */
var nice_match = s.nice_match; /* stop if match long enough */
var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ?
s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/;
var _win = s.window; // shortcut
var wmask = s.w_mask;
var prev = s.prev;
/* Stop when cur_match becomes <= limit. To simplify the code,
* we prevent matches with the string of window index 0.
*/
var strend = s.strstart + MAX_MATCH;
var scan_end1 = _win[scan + best_len - 1];
var scan_end = _win[scan + best_len];
/* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
* It is easy to get rid of this optimization if necessary.
*/
// Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
/* Do not waste too much time if we already have a good match: */
if (s.prev_length >= s.good_match) {
chain_length >>= 2;
}
/* Do not look for matches beyond the end of the input. This is necessary
* to make deflate deterministic.
*/
if (nice_match > s.lookahead) { nice_match = s.lookahead; }
// Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
do {
// Assert(cur_match < s->strstart, "no future");
match = cur_match;
/* Skip to next match if the match length cannot increase
* or if the match length is less than 2. Note that the checks below
* for insufficient lookahead only occur occasionally for performance
* reasons. Therefore uninitialized memory will be accessed, and
* conditional jumps will be made that depend on those values.
* However the length of the match is limited to the lookahead, so
* the output of deflate is not affected by the uninitialized values.
*/
if (_win[match + best_len] !== scan_end ||
_win[match + best_len - 1] !== scan_end1 ||
_win[match] !== _win[scan] ||
_win[++match] !== _win[scan + 1]) {
continue;
}
/* The check at best_len-1 can be removed because it will be made
* again later. (This heuristic is not always a win.)
* It is not necessary to compare scan[2] and match[2] since they
* are always equal when the other bytes match, given that
* the hash keys are equal and that HASH_BITS >= 8.
*/
scan += 2;
match++;
// Assert(*scan == *match, "match[2]?");
/* We check for insufficient lookahead only every 8th comparison;
* the 256th check will be made at strstart+258.
*/
do {
/*jshint noempty:false*/
} while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
scan < strend);
// Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
len = MAX_MATCH - (strend - scan);
scan = strend - MAX_MATCH;
if (len > best_len) {
s.match_start = cur_match;
best_len = len;
if (len >= nice_match) {
break;
}
scan_end1 = _win[scan + best_len - 1];
scan_end = _win[scan + best_len];
}
} while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);
if (best_len <= s.lookahead) {
return best_len;
}
return s.lookahead;
}
/* ===========================================================================
* Fill the window when the lookahead becomes insufficient.
* Updates strstart and lookahead.
*
* IN assertion: lookahead < MIN_LOOKAHEAD
* OUT assertions: strstart <= window_size-MIN_LOOKAHEAD
* At least one byte has been read, or avail_in == 0; reads are
* performed for at least two bytes (required for the zip translate_eol
* option -- not supported here).
*/
function fill_window(s) {
var _w_size = s.w_size;
var p, n, m, more, str;
//Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead");
do {
more = s.window_size - s.lookahead - s.strstart;
// JS ints have 32 bit, block below not needed
/* Deal with !@#$% 64K limit: */
//if (sizeof(int) <= 2) {
// if (more == 0 && s->strstart == 0 && s->lookahead == 0) {
// more = wsize;
//
// } else if (more == (unsigned)(-1)) {
// /* Very unlikely, but possible on 16 bit machine if
// * strstart == 0 && lookahead == 1 (input done a byte at time)
// */
// more--;
// }
//}
/* If the window is almost full and there is insufficient lookahead,
* move the upper half to the lower one to make room in the upper half.
*/
if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {
utils.arraySet(s.window, s.window, _w_size, _w_size, 0);
s.match_start -= _w_size;
s.strstart -= _w_size;
/* we now have strstart >= MAX_DIST */
s.block_start -= _w_size;
/* Slide the hash table (could be avoided with 32 bit values
at the expense of memory usage). We slide even when level == 0
to keep the hash table consistent if we switch back to level > 0
later. (Using level 0 permanently is not an optimal usage of
zlib, so we don't care about this pathological case.)
*/
n = s.hash_size;
p = n;
do {
m = s.head[--p];
s.head[p] = (m >= _w_size ? m - _w_size : 0);
} while (--n);
n = _w_size;
p = n;
do {
m = s.prev[--p];
s.prev[p] = (m >= _w_size ? m - _w_size : 0);
/* If n is not on any hash chain, prev[n] is garbage but
* its value will never be used.
*/
} while (--n);
more += _w_size;
}
if (s.strm.avail_in === 0) {
break;
}
/* If there was no sliding:
* strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&
* more == window_size - lookahead - strstart
* => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)
* => more >= window_size - 2*WSIZE + 2
* In the BIG_MEM or MMAP case (not yet supported),
* window_size == input_size + MIN_LOOKAHEAD &&
* strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.
* Otherwise, window_size == 2*WSIZE so more >= 2.
* If there was sliding, more >= WSIZE. So in all cases, more >= 2.
*/
//Assert(more >= 2, "more < 2");
n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);
s.lookahead += n;
/* Initialize the hash value now that we have some input: */
if (s.lookahead + s.insert >= MIN_MATCH) {
str = s.strstart - s.insert;
s.ins_h = s.window[str];
/* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */
s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;
//#if MIN_MATCH != 3
// Call update_hash() MIN_MATCH-3 more times
//#endif
while (s.insert) {
/* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */
s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;
s.prev[str & s.w_mask] = s.head[s.ins_h];
s.head[s.ins_h] = str;
str++;
s.insert--;
if (s.lookahead + s.insert < MIN_MATCH) {
break;
}
}
}
/* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,
* but this is not important since only literal bytes will be emitted.
*/
} while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);
/* If the WIN_INIT bytes after the end of the current data have never been
* written, then zero those bytes in order to avoid memory check reports of
* the use of uninitialized (or uninitialised as Julian writes) bytes by
* the longest match routines. Update the high water mark for the next
* time through here. WIN_INIT is set to MAX_MATCH since the longest match
* routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.
*/
// if (s.high_water < s.window_size) {
// var curr = s.strstart + s.lookahead;
// var init = 0;
//
// if (s.high_water < curr) {
// /* Previous high water mark below current data -- zero WIN_INIT
// * bytes or up to end of window, whichever is less.
// */
// init = s.window_size - curr;
// if (init > WIN_INIT)
// init = WIN_INIT;
// zmemzero(s->window + curr, (unsigned)init);
// s->high_water = curr + init;
// }
// else if (s->high_water < (ulg)curr + WIN_INIT) {
// /* High water mark at or above current data, but below current data
// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up
// * to end of window, whichever is less.
// */
// init = (ulg)curr + WIN_INIT - s->high_water;
// if (init > s->window_size - s->high_water)
// init = s->window_size - s->high_water;
// zmemzero(s->window + s->high_water, (unsigned)init);
// s->high_water += init;
// }
// }
//
// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,
// "not enough room for search");
}
/* ===========================================================================
* Copy without compression as much as possible from the input stream, return
* the current block state.
* This function does not insert new strings in the dictionary since
* uncompressible data is probably not useful. This function is used
* only for the level=0 compression option.
* NOTE: this function should be optimized to avoid extra copying from
* window to pending_buf.
*/
function deflate_stored(s, flush) {
/* Stored blocks are limited to 0xffff bytes, pending_buf is limited
* to pending_buf_size, and each stored block has a 5 byte header:
*/
var max_block_size = 0xffff;
if (max_block_size > s.pending_buf_size - 5) {
max_block_size = s.pending_buf_size - 5;
}
/* Copy as much as possible from input to output: */
for (;;) {
/* Fill the window as much as possible: */
if (s.lookahead <= 1) {
//Assert(s->strstart < s->w_size+MAX_DIST(s) ||
// s->block_start >= (long)s->w_size, "slide too late");
// if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) ||
// s.block_start >= s.w_size)) {
// throw new Error("slide too late");
// }
fill_window(s);
if (s.lookahead === 0 && flush === Z_NO_FLUSH) {
return BS_NEED_MORE;
}
if (s.lookahead === 0) {
break;
}
/* flush the current block */
}
//Assert(s->block_start >= 0L, "block gone");
// if (s.block_start < 0) throw new Error("block gone");
s.strstart += s.lookahead;
s.lookahead = 0;
/* Emit a stored block if pending_buf will be full: */
var max_start = s.block_start + max_block_size;
if (s.strstart === 0 || s.strstart >= max_start) {
/* strstart == 0 is possible when wraparound on 16-bit machine */
s.lookahead = s.strstart - max_start;
s.strstart = max_start;
/*** FLUSH_BLOCK(s, 0); ***/
flush_block_only(s, false);
if (s.strm.avail_out === 0) {
return BS_NEED_MORE;
}
/***/
}
/* Flush if we may have to slide, otherwise block_start may become
* negative and the data will be gone:
*/
if (s.strstart - s.block_start >= (s.w_size - MIN_LOOKAHEAD)) {
/*** FLUSH_BLOCK(s, 0); ***/
flush_block_only(s, false);
if (s.strm.avail_out === 0) {
return BS_NEED_MORE;
}
/***/
}
}
s.insert = 0;
if (flush === Z_FINISH) {
/*** FLUSH_BLOCK(s, 1); ***/
flush_block_only(s, true);
if (s.strm.avail_out === 0) {
return BS_FINISH_STARTED;
}
/***/
return BS_FINISH_DONE;
}
if (s.strstart > s.block_start) {
/*** FLUSH_BLOCK(s, 0); ***/
flush_block_only(s, false);
if (s.strm.avail_out === 0) {
return BS_NEED_MORE;
}
/***/
}
return BS_NEED_MORE;
}
/* ===========================================================================
* Compress as much as possible from the input stream, return the current
* block state.
* This function does not perform lazy evaluation of matches and inserts
* new strings in the dictionary only for unmatched strings or for short
* matches. It is used only for the fast compression options.
*/
function deflate_fast(s, flush) {
var hash_head; /* head of the hash chain */
var bflush; /* set if current block must be flushed */
for (;;) {
/* Make sure that we always have enough lookahead, except
* at the end of the input file. We need MAX_MATCH bytes
* for the next match, plus MIN_MATCH bytes to insert the
* string following the next match.
*/
if (s.lookahead < MIN_LOOKAHEAD) {
fill_window(s);
if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {
return BS_NEED_MORE;
}
if (s.lookahead === 0) {
break; /* flush the current block */
}
}
/* Insert the string window[strstart .. strstart+2] in the
* dictionary, and set hash_head to the head of the hash chain:
*/
hash_head = 0/*NIL*/;
if (s.lookahead >= MIN_MATCH) {
/*** INSERT_STRING(s, s.strstart, hash_head); ***/
s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
s.head[s.ins_h] = s.strstart;
/***/
}
/* Find the longest match, discarding those <= prev_length.
* At this point we have always match_length < MIN_MATCH
*/
if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {
/* To simplify the code, we prevent matches with the string
* of window index 0 (in particular we have to avoid a match
* of the string with itself at the start of the input file).
*/
s.match_length = longest_match(s, hash_head);
/* longest_match() sets match_start */
}
if (s.match_length >= MIN_MATCH) {
// check_match(s, s.strstart, s.match_start, s.match_length); // for debug only
/*** _tr_tally_dist(s, s.strstart - s.match_start,
s.match_length - MIN_MATCH, bflush); ***/
bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);
s.lookahead -= s.match_length;
/* Insert new strings in the hash table only if the match length
* is not too large. This saves time but degrades compression.
*/
if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {
s.match_length--; /* string at strstart already in table */
do {
s.strstart++;
/*** INSERT_STRING(s, s.strstart, hash_head); ***/
s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
s.head[s.ins_h] = s.strstart;
/***/
/* strstart never exceeds WSIZE-MAX_MATCH, so there are
* always MIN_MATCH bytes ahead.
*/
} while (--s.match_length !== 0);
s.strstart++;
} else
{
s.strstart += s.match_length;
s.match_length = 0;
s.ins_h = s.window[s.strstart];
/* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */
s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;
//#if MIN_MATCH != 3
// Call UPDATE_HASH() MIN_MATCH-3 more times
//#endif
/* If lookahead < MIN_MATCH, ins_h is garbage, but it does not
* matter since it will be recomputed at next deflate call.
*/
}
} else {
/* No match, output a literal byte */
//Tracevv((stderr,"%c", s.window[s.strstart]));
/*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/
bflush = trees._tr_tally(s, 0, s.window[s.strstart]);
s.lookahead--;
s.strstart++;
}
if (bflush) {
/*** FLUSH_BLOCK(s, 0); ***/
flush_block_only(s, false);
if (s.strm.avail_out === 0) {
return BS_NEED_MORE;
}
/***/
}
}
s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);
if (flush === Z_FINISH) {
/*** FLUSH_BLOCK(s, 1); ***/
flush_block_only(s, true);
if (s.strm.avail_out === 0) {
return BS_FINISH_STARTED;
}
/***/
return BS_FINISH_DONE;
}
if (s.last_lit) {
/*** FLUSH_BLOCK(s, 0); ***/
flush_block_only(s, false);
if (s.strm.avail_out === 0) {
return BS_NEED_MORE;
}
/***/
}
return BS_BLOCK_DONE;
}
/* ===========================================================================
* Same as above, but achieves better compression. We use a lazy
* evaluation for matches: a match is finally adopted only if there is
* no better match at the next window position.
*/
function deflate_slow(s, flush) {
var hash_head; /* head of hash chain */
var bflush; /* set if current block must be flushed */
var max_insert;
/* Process the input block. */
for (;;) {
/* Make sure that we always have enough lookahead, except
* at the end of the input file. We need MAX_MATCH bytes
* for the next match, plus MIN_MATCH bytes to insert the
* string following the next match.
*/
if (s.lookahead < MIN_LOOKAHEAD) {
fill_window(s);
if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {
return BS_NEED_MORE;
}
if (s.lookahead === 0) { break; } /* flush the current block */
}
/* Insert the string window[strstart .. strstart+2] in the
* dictionary, and set hash_head to the head of the hash chain:
*/
hash_head = 0/*NIL*/;
if (s.lookahead >= MIN_MATCH) {
/*** INSERT_STRING(s, s.strstart, hash_head); ***/
s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
s.head[s.ins_h] = s.strstart;
/***/
}
/* Find the longest match, discarding those <= prev_length.
*/
s.prev_length = s.match_length;
s.prev_match = s.match_start;
s.match_length = MIN_MATCH - 1;
if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&
s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {
/* To simplify the code, we prevent matches with the string
* of window index 0 (in particular we have to avoid a match
* of the string with itself at the start of the input file).
*/
s.match_length = longest_match(s, hash_head);
/* longest_match() sets match_start */
if (s.match_length <= 5 &&
(s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {
/* If prev_match is also MIN_MATCH, match_start is garbage
* but we will ignore the current match anyway.
*/
s.match_length = MIN_MATCH - 1;
}
}
/* If there was a match at the previous step and the current
* match is not better, output the previous match:
*/
if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {
max_insert = s.strstart + s.lookahead - MIN_MATCH;
/* Do not insert strings in hash table beyond this. */
//check_match(s, s.strstart-1, s.prev_match, s.prev_length);
/***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,
s.prev_length - MIN_MATCH, bflush);***/
bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);
/* Insert in hash table all strings up to the end of the match.
* strstart-1 and strstart are already inserted. If there is not
* enough lookahead, the last two strings are not inserted in
* the hash table.
*/
s.lookahead -= s.prev_length - 1;
s.prev_length -= 2;
do {
if (++s.strstart <= max_insert) {
/*** INSERT_STRING(s, s.strstart, hash_head); ***/
s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
s.head[s.ins_h] = s.strstart;
/***/
}
} while (--s.prev_length !== 0);
s.match_available = 0;
s.match_length = MIN_MATCH - 1;
s.strstart++;
if (bflush) {
/*** FLUSH_BLOCK(s, 0); ***/
flush_block_only(s, false);
if (s.strm.avail_out === 0) {
return BS_NEED_MORE;
}
/***/
}
} else if (s.match_available) {
/* If there was no match at the previous position, output a
* single literal. If there was a match but the current match
* is longer, truncate the previous match to a single literal.
*/
//Tracevv((stderr,"%c", s->window[s->strstart-1]));
/*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/
bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);
if (bflush) {
/*** FLUSH_BLOCK_ONLY(s, 0) ***/
flush_block_only(s, false);
/***/
}
s.strstart++;
s.lookahead--;
if (s.strm.avail_out === 0) {
return BS_NEED_MORE;
}
} else {
/* There is no previous match to compare with, wait for
* the next step to decide.
*/
s.match_available = 1;
s.strstart++;
s.lookahead--;
}
}
//Assert (flush != Z_NO_FLUSH, "no flush?");
if (s.match_available) {
//Tracevv((stderr,"%c", s->window[s->strstart-1]));
/*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/
bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);
s.match_available = 0;
}
s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;
if (flush === Z_FINISH) {
/*** FLUSH_BLOCK(s, 1); ***/
flush_block_only(s, true);
if (s.strm.avail_out === 0) {
return BS_FINISH_STARTED;
}
/***/
return BS_FINISH_DONE;
}
if (s.last_lit) {
/*** FLUSH_BLOCK(s, 0); ***/
flush_block_only(s, false);
if (s.strm.avail_out === 0) {
return BS_NEED_MORE;
}
/***/
}
return BS_BLOCK_DONE;
}
/* ===========================================================================
* For Z_RLE, simply look for runs of bytes, generate matches only of distance
* one. Do not maintain a hash table. (It will be regenerated if this run of
* deflate switches away from Z_RLE.)
*/
function deflate_rle(s, flush) {
var bflush; /* set if current block must be flushed */
var prev; /* byte at distance one to match */
var scan, strend; /* scan goes up to strend for length of run */
var _win = s.window;
for (;;) {
/* Make sure that we always have enough lookahead, except
* at the end of the input file. We need MAX_MATCH bytes
* for the longest run, plus one for the unrolled loop.
*/
if (s.lookahead <= MAX_MATCH) {
fill_window(s);
if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {
return BS_NEED_MORE;
}
if (s.lookahead === 0) { break; } /* flush the current block */
}
/* See how many times the previous byte repeats */
s.match_length = 0;
if (s.lookahead >= MIN_MATCH && s.strstart > 0) {
scan = s.strstart - 1;
prev = _win[scan];
if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {
strend = s.strstart + MAX_MATCH;
do {
/*jshint noempty:false*/
} while (prev === _win[++scan] && prev === _win[++scan] &&
prev === _win[++scan] && prev === _win[++scan] &&
prev === _win[++scan] && prev === _win[++scan] &&
prev === _win[++scan] && prev === _win[++scan] &&
scan < strend);
s.match_length = MAX_MATCH - (strend - scan);
if (s.match_length > s.lookahead) {
s.match_length = s.lookahead;
}
}
//Assert(scan <= s->window+(uInt)(s->window_size-1), "wild scan");
}
/* Emit match if have run of MIN_MATCH or longer, else emit literal */
if (s.match_length >= MIN_MATCH) {
//check_match(s, s.strstart, s.strstart - 1, s.match_length);
/*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/
bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);
s.lookahead -= s.match_length;
s.strstart += s.match_length;
s.match_length = 0;
} else {
/* No match, output a literal byte */
//Tracevv((stderr,"%c", s->window[s->strstart]));
/*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/
bflush = trees._tr_tally(s, 0, s.window[s.strstart]);
s.lookahead--;
s.strstart++;
}
if (bflush) {
/*** FLUSH_BLOCK(s, 0); ***/
flush_block_only(s, false);
if (s.strm.avail_out === 0) {
return BS_NEED_MORE;
}
/***/
}
}
s.insert = 0;
if (flush === Z_FINISH) {
/*** FLUSH_BLOCK(s, 1); ***/
flush_block_only(s, true);
if (s.strm.avail_out === 0) {
return BS_FINISH_STARTED;
}
/***/
return BS_FINISH_DONE;
}
if (s.last_lit) {
/*** FLUSH_BLOCK(s, 0); ***/
flush_block_only(s, false);
if (s.strm.avail_out === 0) {
return BS_NEED_MORE;
}
/***/
}
return BS_BLOCK_DONE;
}
/* ===========================================================================
* For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table.
* (It will be regenerated if this run of deflate switches away from Huffman.)
*/
function deflate_huff(s, flush) {
var bflush; /* set if current block must be flushed */
for (;;) {
/* Make sure that we have a literal to write. */
if (s.lookahead === 0) {
fill_window(s);
if (s.lookahead === 0) {
if (flush === Z_NO_FLUSH) {
return BS_NEED_MORE;
}
break; /* flush the current block */
}
}
/* Output a literal byte */
s.match_length = 0;
//Tracevv((stderr,"%c", s->window[s->strstart]));
/*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/
bflush = trees._tr_tally(s, 0, s.window[s.strstart]);
s.lookahead--;
s.strstart++;
if (bflush) {
/*** FLUSH_BLOCK(s, 0); ***/
flush_block_only(s, false);
if (s.strm.avail_out === 0) {
return BS_NEED_MORE;
}
/***/
}
}
s.insert = 0;
if (flush === Z_FINISH) {
/*** FLUSH_BLOCK(s, 1); ***/
flush_block_only(s, true);
if (s.strm.avail_out === 0) {
return BS_FINISH_STARTED;
}
/***/
return BS_FINISH_DONE;
}
if (s.last_lit) {
/*** FLUSH_BLOCK(s, 0); ***/
flush_block_only(s, false);
if (s.strm.avail_out === 0) {
return BS_NEED_MORE;
}
/***/
}
return BS_BLOCK_DONE;
}
/* Values for max_lazy_match, good_match and max_chain_length, depending on
* the desired pack level (0..9). The values given below have been tuned to
* exclude worst case performance for pathological files. Better values may be
* found for specific files.
*/
function Config(good_length, max_lazy, nice_length, max_chain, func) {
this.good_length = good_length;
this.max_lazy = max_lazy;
this.nice_length = nice_length;
this.max_chain = max_chain;
this.func = func;
}
var configuration_table;
configuration_table = [
/* good lazy nice chain */
new Config(0, 0, 0, 0, deflate_stored), /* 0 store only */
new Config(4, 4, 8, 4, deflate_fast), /* 1 max speed, no lazy matches */
new Config(4, 5, 16, 8, deflate_fast), /* 2 */
new Config(4, 6, 32, 32, deflate_fast), /* 3 */
new Config(4, 4, 16, 16, deflate_slow), /* 4 lazy matches */
new Config(8, 16, 32, 32, deflate_slow), /* 5 */
new Config(8, 16, 128, 128, deflate_slow), /* 6 */
new Config(8, 32, 128, 256, deflate_slow), /* 7 */
new Config(32, 128, 258, 1024, deflate_slow), /* 8 */
new Config(32, 258, 258, 4096, deflate_slow) /* 9 max compression */
];
/* ===========================================================================
* Initialize the "longest match" routines for a new zlib stream
*/
function lm_init(s) {
s.window_size = 2 * s.w_size;
/*** CLEAR_HASH(s); ***/
zero(s.head); // Fill with NIL (= 0);
/* Set the default configuration parameters:
*/
s.max_lazy_match = configuration_table[s.level].max_lazy;
s.good_match = configuration_table[s.level].good_length;
s.nice_match = configuration_table[s.level].nice_length;
s.max_chain_length = configuration_table[s.level].max_chain;
s.strstart = 0;
s.block_start = 0;
s.lookahead = 0;
s.insert = 0;
s.match_length = s.prev_length = MIN_MATCH - 1;
s.match_available = 0;
s.ins_h = 0;
}
function DeflateState() {
this.strm = null; /* pointer back to this zlib stream */
this.status = 0; /* as the name implies */
this.pending_buf = null; /* output still pending */
this.pending_buf_size = 0; /* size of pending_buf */
this.pending_out = 0; /* next pending byte to output to the stream */
this.pending = 0; /* nb of bytes in the pending buffer */
this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */
this.gzhead = null; /* gzip header information to write */
this.gzindex = 0; /* where in extra, name, or comment */
this.method = Z_DEFLATED; /* can only be DEFLATED */
this.last_flush = -1; /* value of flush param for previous deflate call */
this.w_size = 0; /* LZ77 window size (32K by default) */
this.w_bits = 0; /* log2(w_size) (8..16) */
this.w_mask = 0; /* w_size - 1 */
this.window = null;
/* Sliding window. Input bytes are read into the second half of the window,
* and move to the first half later to keep a dictionary of at least wSize
* bytes. With this organization, matches are limited to a distance of
* wSize-MAX_MATCH bytes, but this ensures that IO is always
* performed with a length multiple of the block size.
*/
this.window_size = 0;
/* Actual size of window: 2*wSize, except when the user input buffer
* is directly used as sliding window.
*/
this.prev = null;
/* Link to older string with same hash index. To limit the size of this
* array to 64K, this link is maintained only for the last 32K strings.
* An index in this array is thus a window index modulo 32K.
*/
this.head = null; /* Heads of the hash chains or NIL. */
this.ins_h = 0; /* hash index of string to be inserted */
this.hash_size = 0; /* number of elements in hash table */
this.hash_bits = 0; /* log2(hash_size) */
this.hash_mask = 0; /* hash_size-1 */
this.hash_shift = 0;
/* Number of bits by which ins_h must be shifted at each input
* step. It must be such that after MIN_MATCH steps, the oldest
* byte no longer takes part in the hash key, that is:
* hash_shift * MIN_MATCH >= hash_bits
*/
this.block_start = 0;
/* Window position at the beginning of the current output block. Gets
* negative when the window is moved backwards.
*/
this.match_length = 0; /* length of best match */
this.prev_match = 0; /* previous match */
this.match_available = 0; /* set if previous match exists */
this.strstart = 0; /* start of string to insert */
this.match_start = 0; /* start of matching string */
this.lookahead = 0; /* number of valid bytes ahead in window */
this.prev_length = 0;
/* Length of the best match at previous step. Matches not greater than this
* are discarded. This is used in the lazy match evaluation.
*/
this.max_chain_length = 0;
/* To speed up deflation, hash chains are never searched beyond this
* length. A higher limit improves compression ratio but degrades the
* speed.
*/
this.max_lazy_match = 0;
/* Attempt to find a better match only when the current match is strictly
* smaller than this value. This mechanism is used only for compression
* levels >= 4.
*/
// That's alias to max_lazy_match, don't use directly
//this.max_insert_length = 0;
/* Insert new strings in the hash table only if the match length is not
* greater than this length. This saves time but degrades compression.
* max_insert_length is used only for compression levels <= 3.
*/
this.level = 0; /* compression level (1..9) */
this.strategy = 0; /* favor or force Huffman coding*/
this.good_match = 0;
/* Use a faster search when the previous match is longer than this */
this.nice_match = 0; /* Stop searching when current match exceeds this */
/* used by trees.c: */
/* Didn't use ct_data typedef below to suppress compiler warning */
// struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */
// struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */
// struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */
// Use flat array of DOUBLE size, with interleaved fata,
// because JS does not support effective
this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2);
this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2);
this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2);
zero(this.dyn_ltree);
zero(this.dyn_dtree);
zero(this.bl_tree);
this.l_desc = null; /* desc. for literal tree */
this.d_desc = null; /* desc. for distance tree */
this.bl_desc = null; /* desc. for bit length tree */
//ush bl_count[MAX_BITS+1];
this.bl_count = new utils.Buf16(MAX_BITS + 1);
/* number of codes at each bit length for an optimal tree */
//int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */
this.heap = new utils.Buf16(2 * L_CODES + 1); /* heap used to build the Huffman trees */
zero(this.heap);
this.heap_len = 0; /* number of elements in the heap */
this.heap_max = 0; /* element of largest frequency */
/* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.
* The same heap array is used to build all trees.
*/
this.depth = new utils.Buf16(2 * L_CODES + 1); //uch depth[2*L_CODES+1];
zero(this.depth);
/* Depth of each subtree used as tie breaker for trees of equal frequency
*/
this.l_buf = 0; /* buffer index for literals or lengths */
this.lit_bufsize = 0;
/* Size of match buffer for literals/lengths. There are 4 reasons for
* limiting lit_bufsize to 64K:
* - frequencies can be kept in 16 bit counters
* - if compression is not successful for the first block, all input
* data is still in the window so we can still emit a stored block even
* when input comes from standard input. (This can also be done for
* all blocks if lit_bufsize is not greater than 32K.)
* - if compression is not successful for a file smaller than 64K, we can
* even emit a stored file instead of a stored block (saving 5 bytes).
* This is applicable only for zip (not gzip or zlib).
* - creating new Huffman trees less frequently may not provide fast
* adaptation to changes in the input data statistics. (Take for
* example a binary file with poorly compressible code followed by
* a highly compressible string table.) Smaller buffer sizes give
* fast adaptation but have of course the overhead of transmitting
* trees more frequently.
* - I can't count above 4
*/
this.last_lit = 0; /* running index in l_buf */
this.d_buf = 0;
/* Buffer index for distances. To simplify the code, d_buf and l_buf have
* the same number of elements. To use different lengths, an extra flag
* array would be necessary.
*/
this.opt_len = 0; /* bit length of current block with optimal trees */
this.static_len = 0; /* bit length of current block with static trees */
this.matches = 0; /* number of string matches in current block */
this.insert = 0; /* bytes at end of window left to insert */
this.bi_buf = 0;
/* Output buffer. bits are inserted starting at the bottom (least
* significant bits).
*/
this.bi_valid = 0;
/* Number of valid bits in bi_buf. All bits above the last valid bit
* are always zero.
*/
// Used for window memory init. We safely ignore it for JS. That makes
// sense only for pointers and memory check tools.
//this.high_water = 0;
/* High water mark offset in window for initialized bytes -- bytes above
* this are set to zero in order to avoid memory check warnings when
* longest match routines access bytes past the input. This is then
* updated to the new high water mark.
*/
}
function deflateResetKeep(strm) {
var s;
if (!strm || !strm.state) {
return err(strm, Z_STREAM_ERROR);
}
strm.total_in = strm.total_out = 0;
strm.data_type = Z_UNKNOWN;
s = strm.state;
s.pending = 0;
s.pending_out = 0;
if (s.wrap < 0) {
s.wrap = -s.wrap;
/* was made negative by deflate(..., Z_FINISH); */
}
s.status = (s.wrap ? INIT_STATE : BUSY_STATE);
strm.adler = (s.wrap === 2) ?
0 // crc32(0, Z_NULL, 0)
:
1; // adler32(0, Z_NULL, 0)
s.last_flush = Z_NO_FLUSH;
trees._tr_init(s);
return Z_OK;
}
function deflateReset(strm) {
var ret = deflateResetKeep(strm);
if (ret === Z_OK) {
lm_init(strm.state);
}
return ret;
}
function deflateSetHeader(strm, head) {
if (!strm || !strm.state) { return Z_STREAM_ERROR; }
if (strm.state.wrap !== 2) { return Z_STREAM_ERROR; }
strm.state.gzhead = head;
return Z_OK;
}
function deflateInit2(strm, level, method, windowBits, memLevel, strategy) {
if (!strm) { // === Z_NULL
return Z_STREAM_ERROR;
}
var wrap = 1;
if (level === Z_DEFAULT_COMPRESSION) {
level = 6;
}
if (windowBits < 0) { /* suppress zlib wrapper */
wrap = 0;
windowBits = -windowBits;
}
else if (windowBits > 15) {
wrap = 2; /* write gzip wrapper instead */
windowBits -= 16;
}
if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED ||
windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||
strategy < 0 || strategy > Z_FIXED) {
return err(strm, Z_STREAM_ERROR);
}
if (windowBits === 8) {
windowBits = 9;
}
/* until 256-byte window bug fixed */
var s = new DeflateState();
strm.state = s;
s.strm = strm;
s.wrap = wrap;
s.gzhead = null;
s.w_bits = windowBits;
s.w_size = 1 << s.w_bits;
s.w_mask = s.w_size - 1;
s.hash_bits = memLevel + 7;
s.hash_size = 1 << s.hash_bits;
s.hash_mask = s.hash_size - 1;
s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH);
s.window = new utils.Buf8(s.w_size * 2);
s.head = new utils.Buf16(s.hash_size);
s.prev = new utils.Buf16(s.w_size);
// Don't need mem init magic for JS.
//s.high_water = 0; /* nothing written to s->window yet */
s.lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */
s.pending_buf_size = s.lit_bufsize * 4;
//overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);
//s->pending_buf = (uchf *) overlay;
s.pending_buf = new utils.Buf8(s.pending_buf_size);
// It is offset from `s.pending_buf` (size is `s.lit_bufsize * 2`)
//s->d_buf = overlay + s->lit_bufsize/sizeof(ush);
s.d_buf = 1 * s.lit_bufsize;
//s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize;
s.l_buf = (1 + 2) * s.lit_bufsize;
s.level = level;
s.strategy = strategy;
s.method = method;
return deflateReset(strm);
}
function deflateInit(strm, level) {
return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);
}
function deflate(strm, flush) {
var old_flush, s;
var beg, val; // for gzip header write only
if (!strm || !strm.state ||
flush > Z_BLOCK || flush < 0) {
return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;
}
s = strm.state;
if (!strm.output ||
(!strm.input && strm.avail_in !== 0) ||
(s.status === FINISH_STATE && flush !== Z_FINISH)) {
return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR);
}
s.strm = strm; /* just in case */
old_flush = s.last_flush;
s.last_flush = flush;
/* Write the header */
if (s.status === INIT_STATE) {
if (s.wrap === 2) { // GZIP header
strm.adler = 0; //crc32(0L, Z_NULL, 0);
put_byte(s, 31);
put_byte(s, 139);
put_byte(s, 8);
if (!s.gzhead) { // s->gzhead == Z_NULL
put_byte(s, 0);
put_byte(s, 0);
put_byte(s, 0);
put_byte(s, 0);
put_byte(s, 0);
put_byte(s, s.level === 9 ? 2 :
(s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?
4 : 0));
put_byte(s, OS_CODE);
s.status = BUSY_STATE;
}
else {
put_byte(s, (s.gzhead.text ? 1 : 0) +
(s.gzhead.hcrc ? 2 : 0) +
(!s.gzhead.extra ? 0 : 4) +
(!s.gzhead.name ? 0 : 8) +
(!s.gzhead.comment ? 0 : 16)
);
put_byte(s, s.gzhead.time & 0xff);
put_byte(s, (s.gzhead.time >> 8) & 0xff);
put_byte(s, (s.gzhead.time >> 16) & 0xff);
put_byte(s, (s.gzhead.time >> 24) & 0xff);
put_byte(s, s.level === 9 ? 2 :
(s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?
4 : 0));
put_byte(s, s.gzhead.os & 0xff);
if (s.gzhead.extra && s.gzhead.extra.length) {
put_byte(s, s.gzhead.extra.length & 0xff);
put_byte(s, (s.gzhead.extra.length >> 8) & 0xff);
}
if (s.gzhead.hcrc) {
strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0);
}
s.gzindex = 0;
s.status = EXTRA_STATE;
}
}
else // DEFLATE header
{
var header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8;
var level_flags = -1;
if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) {
level_flags = 0;
} else if (s.level < 6) {
level_flags = 1;
} else if (s.level === 6) {
level_flags = 2;
} else {
level_flags = 3;
}
header |= (level_flags << 6);
if (s.strstart !== 0) { header |= PRESET_DICT; }
header += 31 - (header % 31);
s.status = BUSY_STATE;
putShortMSB(s, header);
/* Save the adler32 of the preset dictionary: */
if (s.strstart !== 0) {
putShortMSB(s, strm.adler >>> 16);
putShortMSB(s, strm.adler & 0xffff);
}
strm.adler = 1; // adler32(0L, Z_NULL, 0);
}
}
//#ifdef GZIP
if (s.status === EXTRA_STATE) {
if (s.gzhead.extra/* != Z_NULL*/) {
beg = s.pending; /* start of bytes to update crc */
while (s.gzindex < (s.gzhead.extra.length & 0xffff)) {
if (s.pending === s.pending_buf_size) {
if (s.gzhead.hcrc && s.pending > beg) {
strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
}
flush_pending(strm);
beg = s.pending;
if (s.pending === s.pending_buf_size) {
break;
}
}
put_byte(s, s.gzhead.extra[s.gzindex] & 0xff);
s.gzindex++;
}
if (s.gzhead.hcrc && s.pending > beg) {
strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
}
if (s.gzindex === s.gzhead.extra.length) {
s.gzindex = 0;
s.status = NAME_STATE;
}
}
else {
s.status = NAME_STATE;
}
}
if (s.status === NAME_STATE) {
if (s.gzhead.name/* != Z_NULL*/) {
beg = s.pending; /* start of bytes to update crc */
//int val;
do {
if (s.pending === s.pending_buf_size) {
if (s.gzhead.hcrc && s.pending > beg) {
strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
}
flush_pending(strm);
beg = s.pending;
if (s.pending === s.pending_buf_size) {
val = 1;
break;
}
}
// JS specific: little magic to add zero terminator to end of string
if (s.gzindex < s.gzhead.name.length) {
val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff;
} else {
val = 0;
}
put_byte(s, val);
} while (val !== 0);
if (s.gzhead.hcrc && s.pending > beg) {
strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
}
if (val === 0) {
s.gzindex = 0;
s.status = COMMENT_STATE;
}
}
else {
s.status = COMMENT_STATE;
}
}
if (s.status === COMMENT_STATE) {
if (s.gzhead.comment/* != Z_NULL*/) {
beg = s.pending; /* start of bytes to update crc */
//int val;
do {
if (s.pending === s.pending_buf_size) {
if (s.gzhead.hcrc && s.pending > beg) {
strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
}
flush_pending(strm);
beg = s.pending;
if (s.pending === s.pending_buf_size) {
val = 1;
break;
}
}
// JS specific: little magic to add zero terminator to end of string
if (s.gzindex < s.gzhead.comment.length) {
val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff;
} else {
val = 0;
}
put_byte(s, val);
} while (val !== 0);
if (s.gzhead.hcrc && s.pending > beg) {
strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
}
if (val === 0) {
s.status = HCRC_STATE;
}
}
else {
s.status = HCRC_STATE;
}
}
if (s.status === HCRC_STATE) {
if (s.gzhead.hcrc) {
if (s.pending + 2 > s.pending_buf_size) {
flush_pending(strm);
}
if (s.pending + 2 <= s.pending_buf_size) {
put_byte(s, strm.adler & 0xff);
put_byte(s, (strm.adler >> 8) & 0xff);
strm.adler = 0; //crc32(0L, Z_NULL, 0);
s.status = BUSY_STATE;
}
}
else {
s.status = BUSY_STATE;
}
}
//#endif
/* Flush as much pending output as possible */
if (s.pending !== 0) {
flush_pending(strm);
if (strm.avail_out === 0) {
/* Since avail_out is 0, deflate will be called again with
* more output space, but possibly with both pending and
* avail_in equal to zero. There won't be anything to do,
* but this is not an error situation so make sure we
* return OK instead of BUF_ERROR at next call of deflate:
*/
s.last_flush = -1;
return Z_OK;
}
/* Make sure there is something to do and avoid duplicate consecutive
* flushes. For repeated and useless calls with Z_FINISH, we keep
* returning Z_STREAM_END instead of Z_BUF_ERROR.
*/
} else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) &&
flush !== Z_FINISH) {
return err(strm, Z_BUF_ERROR);
}
/* User must not provide more input after the first FINISH: */
if (s.status === FINISH_STATE && strm.avail_in !== 0) {
return err(strm, Z_BUF_ERROR);
}
/* Start a new block or continue the current one.
*/
if (strm.avail_in !== 0 || s.lookahead !== 0 ||
(flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) {
var bstate = (s.strategy === Z_HUFFMAN_ONLY) ? deflate_huff(s, flush) :
(s.strategy === Z_RLE ? deflate_rle(s, flush) :
configuration_table[s.level].func(s, flush));
if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) {
s.status = FINISH_STATE;
}
if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {
if (strm.avail_out === 0) {
s.last_flush = -1;
/* avoid BUF_ERROR next call, see above */
}
return Z_OK;
/* If flush != Z_NO_FLUSH && avail_out == 0, the next call
* of deflate should use the same flush parameter to make sure
* that the flush is complete. So we don't have to output an
* empty block here, this will be done at next call. This also
* ensures that for a very small output buffer, we emit at most
* one empty block.
*/
}
if (bstate === BS_BLOCK_DONE) {
if (flush === Z_PARTIAL_FLUSH) {
trees._tr_align(s);
}
else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */
trees._tr_stored_block(s, 0, 0, false);
/* For a full flush, this empty block will be recognized
* as a special marker by inflate_sync().
*/
if (flush === Z_FULL_FLUSH) {
/*** CLEAR_HASH(s); ***/ /* forget history */
zero(s.head); // Fill with NIL (= 0);
if (s.lookahead === 0) {
s.strstart = 0;
s.block_start = 0;
s.insert = 0;
}
}
}
flush_pending(strm);
if (strm.avail_out === 0) {
s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */
return Z_OK;
}
}
}
//Assert(strm->avail_out > 0, "bug2");
//if (strm.avail_out <= 0) { throw new Error("bug2");}
if (flush !== Z_FINISH) { return Z_OK; }
if (s.wrap <= 0) { return Z_STREAM_END; }
/* Write the trailer */
if (s.wrap === 2) {
put_byte(s, strm.adler & 0xff);
put_byte(s, (strm.adler >> 8) & 0xff);
put_byte(s, (strm.adler >> 16) & 0xff);
put_byte(s, (strm.adler >> 24) & 0xff);
put_byte(s, strm.total_in & 0xff);
put_byte(s, (strm.total_in >> 8) & 0xff);
put_byte(s, (strm.total_in >> 16) & 0xff);
put_byte(s, (strm.total_in >> 24) & 0xff);
}
else
{
putShortMSB(s, strm.adler >>> 16);
putShortMSB(s, strm.adler & 0xffff);
}
flush_pending(strm);
/* If avail_out is zero, the application will call deflate again
* to flush the rest.
*/
if (s.wrap > 0) { s.wrap = -s.wrap; }
/* write the trailer only once! */
return s.pending !== 0 ? Z_OK : Z_STREAM_END;
}
function deflateEnd(strm) {
var status;
if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {
return Z_STREAM_ERROR;
}
status = strm.state.status;
if (status !== INIT_STATE &&
status !== EXTRA_STATE &&
status !== NAME_STATE &&
status !== COMMENT_STATE &&
status !== HCRC_STATE &&
status !== BUSY_STATE &&
status !== FINISH_STATE
) {
return err(strm, Z_STREAM_ERROR);
}
strm.state = null;
return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK;
}
/* =========================================================================
* Initializes the compression dictionary from the given byte
* sequence without producing any compressed output.
*/
function deflateSetDictionary(strm, dictionary) {
var dictLength = dictionary.length;
var s;
var str, n;
var wrap;
var avail;
var next;
var input;
var tmpDict;
if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {
return Z_STREAM_ERROR;
}
s = strm.state;
wrap = s.wrap;
if (wrap === 2 || (wrap === 1 && s.status !== INIT_STATE) || s.lookahead) {
return Z_STREAM_ERROR;
}
/* when using zlib wrappers, compute Adler-32 for provided dictionary */
if (wrap === 1) {
/* adler32(strm->adler, dictionary, dictLength); */
strm.adler = adler32(strm.adler, dictionary, dictLength, 0);
}
s.wrap = 0; /* avoid computing Adler-32 in read_buf */
/* if dictionary would fill window, just replace the history */
if (dictLength >= s.w_size) {
if (wrap === 0) { /* already empty otherwise */
/*** CLEAR_HASH(s); ***/
zero(s.head); // Fill with NIL (= 0);
s.strstart = 0;
s.block_start = 0;
s.insert = 0;
}
/* use the tail */
// dictionary = dictionary.slice(dictLength - s.w_size);
tmpDict = new utils.Buf8(s.w_size);
utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0);
dictionary = tmpDict;
dictLength = s.w_size;
}
/* insert dictionary into window and hash */
avail = strm.avail_in;
next = strm.next_in;
input = strm.input;
strm.avail_in = dictLength;
strm.next_in = 0;
strm.input = dictionary;
fill_window(s);
while (s.lookahead >= MIN_MATCH) {
str = s.strstart;
n = s.lookahead - (MIN_MATCH - 1);
do {
/* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */
s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;
s.prev[str & s.w_mask] = s.head[s.ins_h];
s.head[s.ins_h] = str;
str++;
} while (--n);
s.strstart = str;
s.lookahead = MIN_MATCH - 1;
fill_window(s);
}
s.strstart += s.lookahead;
s.block_start = s.strstart;
s.insert = s.lookahead;
s.lookahead = 0;
s.match_length = s.prev_length = MIN_MATCH - 1;
s.match_available = 0;
strm.next_in = next;
strm.input = input;
strm.avail_in = avail;
s.wrap = wrap;
return Z_OK;
}
exports.deflateInit = deflateInit;
exports.deflateInit2 = deflateInit2;
exports.deflateReset = deflateReset;
exports.deflateResetKeep = deflateResetKeep;
exports.deflateSetHeader = deflateSetHeader;
exports.deflate = deflate;
exports.deflateEnd = deflateEnd;
exports.deflateSetDictionary = deflateSetDictionary;
exports.deflateInfo = 'pako deflate (from Nodeca project)';
/* Not implemented
exports.deflateBound = deflateBound;
exports.deflateCopy = deflateCopy;
exports.deflateParams = deflateParams;
exports.deflatePending = deflatePending;
exports.deflatePrime = deflatePrime;
exports.deflateTune = deflateTune;
*/
/***/ }),
/***/ 5105:
/***/ ((module) => {
"use strict";
// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
function GZheader() {
/* true if compressed data believed to be text */
this.text = 0;
/* modification time */
this.time = 0;
/* extra flags (not used when writing a gzip file) */
this.xflags = 0;
/* operating system */
this.os = 0;
/* pointer to extra field or Z_NULL if none */
this.extra = null;
/* extra field length (valid if extra != Z_NULL) */
this.extra_len = 0; // Actually, we don't need it in JS,
// but leave for few code modifications
//
// Setup limits is not necessary because in js we should not preallocate memory
// for inflate use constant limit in 65536 bytes
//
/* space at extra (only when reading header) */
// this.extra_max = 0;
/* pointer to zero-terminated file name or Z_NULL */
this.name = '';
/* space at name (only when reading header) */
// this.name_max = 0;
/* pointer to zero-terminated comment or Z_NULL */
this.comment = '';
/* space at comment (only when reading header) */
// this.comm_max = 0;
/* true if there was or will be a header crc */
this.hcrc = 0;
/* true when done reading gzip header (not used when writing a gzip file) */
this.done = false;
}
module.exports = GZheader;
/***/ }),
/***/ 5349:
/***/ ((module) => {
"use strict";
// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
// See state defs from inflate.js
var BAD = 30; /* got a data error -- remain here until reset */
var TYPE = 12; /* i: waiting for type bits, including last-flag bit */
/*
Decode literal, length, and distance codes and write out the resulting
literal and match bytes until either not enough input or output is
available, an end-of-block is encountered, or a data error is encountered.
When large enough input and output buffers are supplied to inflate(), for
example, a 16K input buffer and a 64K output buffer, more than 95% of the
inflate execution time is spent in this routine.
Entry assumptions:
state.mode === LEN
strm.avail_in >= 6
strm.avail_out >= 258
start >= strm.avail_out
state.bits < 8
On return, state.mode is one of:
LEN -- ran out of enough output space or enough available input
TYPE -- reached end of block code, inflate() to interpret next block
BAD -- error in block data
Notes:
- The maximum input bits used by a length/distance pair is 15 bits for the
length code, 5 bits for the length extra, 15 bits for the distance code,
and 13 bits for the distance extra. This totals 48 bits, or six bytes.
Therefore if strm.avail_in >= 6, then there is enough input to avoid
checking for available input while decoding.
- The maximum bytes that a single length/distance pair can output is 258
bytes, which is the maximum length that can be coded. inflate_fast()
requires strm.avail_out >= 258 for each loop to avoid checking for
output space.
*/
module.exports = function inflate_fast(strm, start) {
var state;
var _in; /* local strm.input */
var last; /* have enough input while in < last */
var _out; /* local strm.output */
var beg; /* inflate()'s initial strm.output */
var end; /* while out < end, enough space available */
//#ifdef INFLATE_STRICT
var dmax; /* maximum distance from zlib header */
//#endif
var wsize; /* window size or zero if not using window */
var whave; /* valid bytes in the window */
var wnext; /* window write index */
// Use `s_window` instead `window`, avoid conflict with instrumentation tools
var s_window; /* allocated sliding window, if wsize != 0 */
var hold; /* local strm.hold */
var bits; /* local strm.bits */
var lcode; /* local strm.lencode */
var dcode; /* local strm.distcode */
var lmask; /* mask for first level of length codes */
var dmask; /* mask for first level of distance codes */
var here; /* retrieved table entry */
var op; /* code bits, operation, extra bits, or */
/* window position, window bytes to copy */
var len; /* match length, unused bytes */
var dist; /* match distance */
var from; /* where to copy match from */
var from_source;
var input, output; // JS specific, because we have no pointers
/* copy state to local variables */
state = strm.state;
//here = state.here;
_in = strm.next_in;
input = strm.input;
last = _in + (strm.avail_in - 5);
_out = strm.next_out;
output = strm.output;
beg = _out - (start - strm.avail_out);
end = _out + (strm.avail_out - 257);
//#ifdef INFLATE_STRICT
dmax = state.dmax;
//#endif
wsize = state.wsize;
whave = state.whave;
wnext = state.wnext;
s_window = state.window;
hold = state.hold;
bits = state.bits;
lcode = state.lencode;
dcode = state.distcode;
lmask = (1 << state.lenbits) - 1;
dmask = (1 << state.distbits) - 1;
/* decode literals and length/distances until end-of-block or not enough
input data or output space */
top:
do {
if (bits < 15) {
hold += input[_in++] << bits;
bits += 8;
hold += input[_in++] << bits;
bits += 8;
}
here = lcode[hold & lmask];
dolen:
for (;;) { // Goto emulation
op = here >>> 24/*here.bits*/;
hold >>>= op;
bits -= op;
op = (here >>> 16) & 0xff/*here.op*/;
if (op === 0) { /* literal */
//Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
// "inflate: literal '%c'\n" :
// "inflate: literal 0x%02x\n", here.val));
output[_out++] = here & 0xffff/*here.val*/;
}
else if (op & 16) { /* length base */
len = here & 0xffff/*here.val*/;
op &= 15; /* number of extra bits */
if (op) {
if (bits < op) {
hold += input[_in++] << bits;
bits += 8;
}
len += hold & ((1 << op) - 1);
hold >>>= op;
bits -= op;
}
//Tracevv((stderr, "inflate: length %u\n", len));
if (bits < 15) {
hold += input[_in++] << bits;
bits += 8;
hold += input[_in++] << bits;
bits += 8;
}
here = dcode[hold & dmask];
dodist:
for (;;) { // goto emulation
op = here >>> 24/*here.bits*/;
hold >>>= op;
bits -= op;
op = (here >>> 16) & 0xff/*here.op*/;
if (op & 16) { /* distance base */
dist = here & 0xffff/*here.val*/;
op &= 15; /* number of extra bits */
if (bits < op) {
hold += input[_in++] << bits;
bits += 8;
if (bits < op) {
hold += input[_in++] << bits;
bits += 8;
}
}
dist += hold & ((1 << op) - 1);
//#ifdef INFLATE_STRICT
if (dist > dmax) {
strm.msg = 'invalid distance too far back';
state.mode = BAD;
break top;
}
//#endif
hold >>>= op;
bits -= op;
//Tracevv((stderr, "inflate: distance %u\n", dist));
op = _out - beg; /* max distance in output */
if (dist > op) { /* see if copy from window */
op = dist - op; /* distance back in window */
if (op > whave) {
if (state.sane) {
strm.msg = 'invalid distance too far back';
state.mode = BAD;
break top;
}
// (!) This block is disabled in zlib defaults,
// don't enable it for binary compatibility
//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
// if (len <= op - whave) {
// do {
// output[_out++] = 0;
// } while (--len);
// continue top;
// }
// len -= op - whave;
// do {
// output[_out++] = 0;
// } while (--op > whave);
// if (op === 0) {
// from = _out - dist;
// do {
// output[_out++] = output[from++];
// } while (--len);
// continue top;
// }
//#endif
}
from = 0; // window index
from_source = s_window;
if (wnext === 0) { /* very common case */
from += wsize - op;
if (op < len) { /* some from window */
len -= op;
do {
output[_out++] = s_window[from++];
} while (--op);
from = _out - dist; /* rest from output */
from_source = output;
}
}
else if (wnext < op) { /* wrap around window */
from += wsize + wnext - op;
op -= wnext;
if (op < len) { /* some from end of window */
len -= op;
do {
output[_out++] = s_window[from++];
} while (--op);
from = 0;
if (wnext < len) { /* some from start of window */
op = wnext;
len -= op;
do {
output[_out++] = s_window[from++];
} while (--op);
from = _out - dist; /* rest from output */
from_source = output;
}
}
}
else { /* contiguous in window */
from += wnext - op;
if (op < len) { /* some from window */
len -= op;
do {
output[_out++] = s_window[from++];
} while (--op);
from = _out - dist; /* rest from output */
from_source = output;
}
}
while (len > 2) {
output[_out++] = from_source[from++];
output[_out++] = from_source[from++];
output[_out++] = from_source[from++];
len -= 3;
}
if (len) {
output[_out++] = from_source[from++];
if (len > 1) {
output[_out++] = from_source[from++];
}
}
}
else {
from = _out - dist; /* copy direct from output */
do { /* minimum length is three */
output[_out++] = output[from++];
output[_out++] = output[from++];
output[_out++] = output[from++];
len -= 3;
} while (len > 2);
if (len) {
output[_out++] = output[from++];
if (len > 1) {
output[_out++] = output[from++];
}
}
}
}
else if ((op & 64) === 0) { /* 2nd level distance code */
here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];
continue dodist;
}
else {
strm.msg = 'invalid distance code';
state.mode = BAD;
break top;
}
break; // need to emulate goto via "continue"
}
}
else if ((op & 64) === 0) { /* 2nd level length code */
here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];
continue dolen;
}
else if (op & 32) { /* end-of-block */
//Tracevv((stderr, "inflate: end of block\n"));
state.mode = TYPE;
break top;
}
else {
strm.msg = 'invalid literal/length code';
state.mode = BAD;
break top;
}
break; // need to emulate goto via "continue"
}
} while (_in < last && _out < end);
/* return unused bytes (on entry, bits < 8, so in won't go too far back) */
len = bits >> 3;
_in -= len;
bits -= len << 3;
hold &= (1 << bits) - 1;
/* update state and return */
strm.next_in = _in;
strm.next_out = _out;
strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last));
strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end));
state.hold = hold;
state.bits = bits;
return;
};
/***/ }),
/***/ 409:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
var utils = __nccwpck_require__(5483);
var adler32 = __nccwpck_require__(6924);
var crc32 = __nccwpck_require__(7242);
var inflate_fast = __nccwpck_require__(5349);
var inflate_table = __nccwpck_require__(6895);
var CODES = 0;
var LENS = 1;
var DISTS = 2;
/* Public constants ==========================================================*/
/* ===========================================================================*/
/* Allowed flush values; see deflate() and inflate() below for details */
//var Z_NO_FLUSH = 0;
//var Z_PARTIAL_FLUSH = 1;
//var Z_SYNC_FLUSH = 2;
//var Z_FULL_FLUSH = 3;
var Z_FINISH = 4;
var Z_BLOCK = 5;
var Z_TREES = 6;
/* Return codes for the compression/decompression functions. Negative values
* are errors, positive values are used for special but normal events.
*/
var Z_OK = 0;
var Z_STREAM_END = 1;
var Z_NEED_DICT = 2;
//var Z_ERRNO = -1;
var Z_STREAM_ERROR = -2;
var Z_DATA_ERROR = -3;
var Z_MEM_ERROR = -4;
var Z_BUF_ERROR = -5;
//var Z_VERSION_ERROR = -6;
/* The deflate compression method */
var Z_DEFLATED = 8;
/* STATES ====================================================================*/
/* ===========================================================================*/
var HEAD = 1; /* i: waiting for magic header */
var FLAGS = 2; /* i: waiting for method and flags (gzip) */
var TIME = 3; /* i: waiting for modification time (gzip) */
var OS = 4; /* i: waiting for extra flags and operating system (gzip) */
var EXLEN = 5; /* i: waiting for extra length (gzip) */
var EXTRA = 6; /* i: waiting for extra bytes (gzip) */
var NAME = 7; /* i: waiting for end of file name (gzip) */
var COMMENT = 8; /* i: waiting for end of comment (gzip) */
var HCRC = 9; /* i: waiting for header crc (gzip) */
var DICTID = 10; /* i: waiting for dictionary check value */
var DICT = 11; /* waiting for inflateSetDictionary() call */
var TYPE = 12; /* i: waiting for type bits, including last-flag bit */
var TYPEDO = 13; /* i: same, but skip check to exit inflate on new block */
var STORED = 14; /* i: waiting for stored size (length and complement) */
var COPY_ = 15; /* i/o: same as COPY below, but only first time in */
var COPY = 16; /* i/o: waiting for input or output to copy stored block */
var TABLE = 17; /* i: waiting for dynamic block table lengths */
var LENLENS = 18; /* i: waiting for code length code lengths */
var CODELENS = 19; /* i: waiting for length/lit and distance code lengths */
var LEN_ = 20; /* i: same as LEN below, but only first time in */
var LEN = 21; /* i: waiting for length/lit/eob code */
var LENEXT = 22; /* i: waiting for length extra bits */
var DIST = 23; /* i: waiting for distance code */
var DISTEXT = 24; /* i: waiting for distance extra bits */
var MATCH = 25; /* o: waiting for output space to copy string */
var LIT = 26; /* o: waiting for output space to write literal */
var CHECK = 27; /* i: waiting for 32-bit check value */
var LENGTH = 28; /* i: waiting for 32-bit length (gzip) */
var DONE = 29; /* finished check, done -- remain here until reset */
var BAD = 30; /* got a data error -- remain here until reset */
var MEM = 31; /* got an inflate() memory error -- remain here until reset */
var SYNC = 32; /* looking for synchronization bytes to restart inflate() */
/* ===========================================================================*/
var ENOUGH_LENS = 852;
var ENOUGH_DISTS = 592;
//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);
var MAX_WBITS = 15;
/* 32K LZ77 window */
var DEF_WBITS = MAX_WBITS;
function zswap32(q) {
return (((q >>> 24) & 0xff) +
((q >>> 8) & 0xff00) +
((q & 0xff00) << 8) +
((q & 0xff) << 24));
}
function InflateState() {
this.mode = 0; /* current inflate mode */
this.last = false; /* true if processing last block */
this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */
this.havedict = false; /* true if dictionary provided */
this.flags = 0; /* gzip header method and flags (0 if zlib) */
this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */
this.check = 0; /* protected copy of check value */
this.total = 0; /* protected copy of output count */
// TODO: may be {}
this.head = null; /* where to save gzip header information */
/* sliding window */
this.wbits = 0; /* log base 2 of requested window size */
this.wsize = 0; /* window size or zero if not using window */
this.whave = 0; /* valid bytes in the window */
this.wnext = 0; /* window write index */
this.window = null; /* allocated sliding window, if needed */
/* bit accumulator */
this.hold = 0; /* input bit accumulator */
this.bits = 0; /* number of bits in "in" */
/* for string and stored block copying */
this.length = 0; /* literal or length of data to copy */
this.offset = 0; /* distance back to copy string from */
/* for table and code decoding */
this.extra = 0; /* extra bits needed */
/* fixed and dynamic code tables */
this.lencode = null; /* starting table for length/literal codes */
this.distcode = null; /* starting table for distance codes */
this.lenbits = 0; /* index bits for lencode */
this.distbits = 0; /* index bits for distcode */
/* dynamic table building */
this.ncode = 0; /* number of code length code lengths */
this.nlen = 0; /* number of length code lengths */
this.ndist = 0; /* number of distance code lengths */
this.have = 0; /* number of code lengths in lens[] */
this.next = null; /* next available space in codes[] */
this.lens = new utils.Buf16(320); /* temporary storage for code lengths */
this.work = new utils.Buf16(288); /* work area for code table building */
/*
because we don't have pointers in js, we use lencode and distcode directly
as buffers so we don't need codes
*/
//this.codes = new utils.Buf32(ENOUGH); /* space for code tables */
this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */
this.distdyn = null; /* dynamic table for distance codes (JS specific) */
this.sane = 0; /* if false, allow invalid distance too far */
this.back = 0; /* bits back of last unprocessed length/lit */
this.was = 0; /* initial length of match */
}
function inflateResetKeep(strm) {
var state;
if (!strm || !strm.state) { return Z_STREAM_ERROR; }
state = strm.state;
strm.total_in = strm.total_out = state.total = 0;
strm.msg = ''; /*Z_NULL*/
if (state.wrap) { /* to support ill-conceived Java test suite */
strm.adler = state.wrap & 1;
}
state.mode = HEAD;
state.last = 0;
state.havedict = 0;
state.dmax = 32768;
state.head = null/*Z_NULL*/;
state.hold = 0;
state.bits = 0;
//state.lencode = state.distcode = state.next = state.codes;
state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS);
state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS);
state.sane = 1;
state.back = -1;
//Tracev((stderr, "inflate: reset\n"));
return Z_OK;
}
function inflateReset(strm) {
var state;
if (!strm || !strm.state) { return Z_STREAM_ERROR; }
state = strm.state;
state.wsize = 0;
state.whave = 0;
state.wnext = 0;
return inflateResetKeep(strm);
}
function inflateReset2(strm, windowBits) {
var wrap;
var state;
/* get the state */
if (!strm || !strm.state) { return Z_STREAM_ERROR; }
state = strm.state;
/* extract wrap request from windowBits parameter */
if (windowBits < 0) {
wrap = 0;
windowBits = -windowBits;
}
else {
wrap = (windowBits >> 4) + 1;
if (windowBits < 48) {
windowBits &= 15;
}
}
/* set number of window bits, free window if different */
if (windowBits && (windowBits < 8 || windowBits > 15)) {
return Z_STREAM_ERROR;
}
if (state.window !== null && state.wbits !== windowBits) {
state.window = null;
}
/* update state and reset the rest of it */
state.wrap = wrap;
state.wbits = windowBits;
return inflateReset(strm);
}
function inflateInit2(strm, windowBits) {
var ret;
var state;
if (!strm) { return Z_STREAM_ERROR; }
//strm.msg = Z_NULL; /* in case we return an error */
state = new InflateState();
//if (state === Z_NULL) return Z_MEM_ERROR;
//Tracev((stderr, "inflate: allocated\n"));
strm.state = state;
state.window = null/*Z_NULL*/;
ret = inflateReset2(strm, windowBits);
if (ret !== Z_OK) {
strm.state = null/*Z_NULL*/;
}
return ret;
}
function inflateInit(strm) {
return inflateInit2(strm, DEF_WBITS);
}
/*
Return state with length and distance decoding tables and index sizes set to
fixed code decoding. Normally this returns fixed tables from inffixed.h.
If BUILDFIXED is defined, then instead this routine builds the tables the
first time it's called, and returns those tables the first time and
thereafter. This reduces the size of the code by about 2K bytes, in
exchange for a little execution time. However, BUILDFIXED should not be
used for threaded applications, since the rewriting of the tables and virgin
may not be thread-safe.
*/
var virgin = true;
var lenfix, distfix; // We have no pointers in JS, so keep tables separate
function fixedtables(state) {
/* build fixed huffman tables if first call (may not be thread safe) */
if (virgin) {
var sym;
lenfix = new utils.Buf32(512);
distfix = new utils.Buf32(32);
/* literal/length table */
sym = 0;
while (sym < 144) { state.lens[sym++] = 8; }
while (sym < 256) { state.lens[sym++] = 9; }
while (sym < 280) { state.lens[sym++] = 7; }
while (sym < 288) { state.lens[sym++] = 8; }
inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 });
/* distance table */
sym = 0;
while (sym < 32) { state.lens[sym++] = 5; }
inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 });
/* do this just once */
virgin = false;
}
state.lencode = lenfix;
state.lenbits = 9;
state.distcode = distfix;
state.distbits = 5;
}
/*
Update the window with the last wsize (normally 32K) bytes written before
returning. If window does not exist yet, create it. This is only called
when a window is already in use, or when output has been written during this
inflate call, but the end of the deflate stream has not been reached yet.
It is also called to create a window for dictionary data when a dictionary
is loaded.
Providing output buffers larger than 32K to inflate() should provide a speed
advantage, since only the last 32K of output is copied to the sliding window
upon return from inflate(), and since all distances after the first 32K of
output will fall in the output data, making match copies simpler and faster.
The advantage may be dependent on the size of the processor's data caches.
*/
function updatewindow(strm, src, end, copy) {
var dist;
var state = strm.state;
/* if it hasn't been done already, allocate space for the window */
if (state.window === null) {
state.wsize = 1 << state.wbits;
state.wnext = 0;
state.whave = 0;
state.window = new utils.Buf8(state.wsize);
}
/* copy state->wsize or less output bytes into the circular window */
if (copy >= state.wsize) {
utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);
state.wnext = 0;
state.whave = state.wsize;
}
else {
dist = state.wsize - state.wnext;
if (dist > copy) {
dist = copy;
}
//zmemcpy(state->window + state->wnext, end - copy, dist);
utils.arraySet(state.window, src, end - copy, dist, state.wnext);
copy -= dist;
if (copy) {
//zmemcpy(state->window, end - copy, copy);
utils.arraySet(state.window, src, end - copy, copy, 0);
state.wnext = copy;
state.whave = state.wsize;
}
else {
state.wnext += dist;
if (state.wnext === state.wsize) { state.wnext = 0; }
if (state.whave < state.wsize) { state.whave += dist; }
}
}
return 0;
}
function inflate(strm, flush) {
var state;
var input, output; // input/output buffers
var next; /* next input INDEX */
var put; /* next output INDEX */
var have, left; /* available input and output */
var hold; /* bit buffer */
var bits; /* bits in bit buffer */
var _in, _out; /* save starting available input and output */
var copy; /* number of stored or match bytes to copy */
var from; /* where to copy match bytes from */
var from_source;
var here = 0; /* current decoding table entry */
var here_bits, here_op, here_val; // paked "here" denormalized (JS specific)
//var last; /* parent table entry */
var last_bits, last_op, last_val; // paked "last" denormalized (JS specific)
var len; /* length to copy for repeats, bits to drop */
var ret; /* return code */
var hbuf = new utils.Buf8(4); /* buffer for gzip header crc calculation */
var opts;
var n; // temporary var for NEED_BITS
var order = /* permutation of code lengths */
[ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ];
if (!strm || !strm.state || !strm.output ||
(!strm.input && strm.avail_in !== 0)) {
return Z_STREAM_ERROR;
}
state = strm.state;
if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */
//--- LOAD() ---
put = strm.next_out;
output = strm.output;
left = strm.avail_out;
next = strm.next_in;
input = strm.input;
have = strm.avail_in;
hold = state.hold;
bits = state.bits;
//---
_in = have;
_out = left;
ret = Z_OK;
inf_leave: // goto emulation
for (;;) {
switch (state.mode) {
case HEAD:
if (state.wrap === 0) {
state.mode = TYPEDO;
break;
}
//=== NEEDBITS(16);
while (bits < 16) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */
state.check = 0/*crc32(0L, Z_NULL, 0)*/;
//=== CRC2(state.check, hold);
hbuf[0] = hold & 0xff;
hbuf[1] = (hold >>> 8) & 0xff;
state.check = crc32(state.check, hbuf, 2, 0);
//===//
//=== INITBITS();
hold = 0;
bits = 0;
//===//
state.mode = FLAGS;
break;
}
state.flags = 0; /* expect zlib header */
if (state.head) {
state.head.done = false;
}
if (!(state.wrap & 1) || /* check if zlib header allowed */
(((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) {
strm.msg = 'incorrect header check';
state.mode = BAD;
break;
}
if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) {
strm.msg = 'unknown compression method';
state.mode = BAD;
break;
}
//--- DROPBITS(4) ---//
hold >>>= 4;
bits -= 4;
//---//
len = (hold & 0x0f)/*BITS(4)*/ + 8;
if (state.wbits === 0) {
state.wbits = len;
}
else if (len > state.wbits) {
strm.msg = 'invalid window size';
state.mode = BAD;
break;
}
state.dmax = 1 << len;
//Tracev((stderr, "inflate: zlib header ok\n"));
strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;
state.mode = hold & 0x200 ? DICTID : TYPE;
//=== INITBITS();
hold = 0;
bits = 0;
//===//
break;
case FLAGS:
//=== NEEDBITS(16); */
while (bits < 16) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
state.flags = hold;
if ((state.flags & 0xff) !== Z_DEFLATED) {
strm.msg = 'unknown compression method';
state.mode = BAD;
break;
}
if (state.flags & 0xe000) {
strm.msg = 'unknown header flags set';
state.mode = BAD;
break;
}
if (state.head) {
state.head.text = ((hold >> 8) & 1);
}
if (state.flags & 0x0200) {
//=== CRC2(state.check, hold);
hbuf[0] = hold & 0xff;
hbuf[1] = (hold >>> 8) & 0xff;
state.check = crc32(state.check, hbuf, 2, 0);
//===//
}
//=== INITBITS();
hold = 0;
bits = 0;
//===//
state.mode = TIME;
/* falls through */
case TIME:
//=== NEEDBITS(32); */
while (bits < 32) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
if (state.head) {
state.head.time = hold;
}
if (state.flags & 0x0200) {
//=== CRC4(state.check, hold)
hbuf[0] = hold & 0xff;
hbuf[1] = (hold >>> 8) & 0xff;
hbuf[2] = (hold >>> 16) & 0xff;
hbuf[3] = (hold >>> 24) & 0xff;
state.check = crc32(state.check, hbuf, 4, 0);
//===
}
//=== INITBITS();
hold = 0;
bits = 0;
//===//
state.mode = OS;
/* falls through */
case OS:
//=== NEEDBITS(16); */
while (bits < 16) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
if (state.head) {
state.head.xflags = (hold & 0xff);
state.head.os = (hold >> 8);
}
if (state.flags & 0x0200) {
//=== CRC2(state.check, hold);
hbuf[0] = hold & 0xff;
hbuf[1] = (hold >>> 8) & 0xff;
state.check = crc32(state.check, hbuf, 2, 0);
//===//
}
//=== INITBITS();
hold = 0;
bits = 0;
//===//
state.mode = EXLEN;
/* falls through */
case EXLEN:
if (state.flags & 0x0400) {
//=== NEEDBITS(16); */
while (bits < 16) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
state.length = hold;
if (state.head) {
state.head.extra_len = hold;
}
if (state.flags & 0x0200) {
//=== CRC2(state.check, hold);
hbuf[0] = hold & 0xff;
hbuf[1] = (hold >>> 8) & 0xff;
state.check = crc32(state.check, hbuf, 2, 0);
//===//
}
//=== INITBITS();
hold = 0;
bits = 0;
//===//
}
else if (state.head) {
state.head.extra = null/*Z_NULL*/;
}
state.mode = EXTRA;
/* falls through */
case EXTRA:
if (state.flags & 0x0400) {
copy = state.length;
if (copy > have) { copy = have; }
if (copy) {
if (state.head) {
len = state.head.extra_len - state.length;
if (!state.head.extra) {
// Use untyped array for more convenient processing later
state.head.extra = new Array(state.head.extra_len);
}
utils.arraySet(
state.head.extra,
input,
next,
// extra field is limited to 65536 bytes
// - no need for additional size check
copy,
/*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/
len
);
//zmemcpy(state.head.extra + len, next,
// len + copy > state.head.extra_max ?
// state.head.extra_max - len : copy);
}
if (state.flags & 0x0200) {
state.check = crc32(state.check, input, copy, next);
}
have -= copy;
next += copy;
state.length -= copy;
}
if (state.length) { break inf_leave; }
}
state.length = 0;
state.mode = NAME;
/* falls through */
case NAME:
if (state.flags & 0x0800) {
if (have === 0) { break inf_leave; }
copy = 0;
do {
// TODO: 2 or 1 bytes?
len = input[next + copy++];
/* use constant limit because in js we should not preallocate memory */
if (state.head && len &&
(state.length < 65536 /*state.head.name_max*/)) {
state.head.name += String.fromCharCode(len);
}
} while (len && copy < have);
if (state.flags & 0x0200) {
state.check = crc32(state.check, input, copy, next);
}
have -= copy;
next += copy;
if (len) { break inf_leave; }
}
else if (state.head) {
state.head.name = null;
}
state.length = 0;
state.mode = COMMENT;
/* falls through */
case COMMENT:
if (state.flags & 0x1000) {
if (have === 0) { break inf_leave; }
copy = 0;
do {
len = input[next + copy++];
/* use constant limit because in js we should not preallocate memory */
if (state.head && len &&
(state.length < 65536 /*state.head.comm_max*/)) {
state.head.comment += String.fromCharCode(len);
}
} while (len && copy < have);
if (state.flags & 0x0200) {
state.check = crc32(state.check, input, copy, next);
}
have -= copy;
next += copy;
if (len) { break inf_leave; }
}
else if (state.head) {
state.head.comment = null;
}
state.mode = HCRC;
/* falls through */
case HCRC:
if (state.flags & 0x0200) {
//=== NEEDBITS(16); */
while (bits < 16) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
if (hold !== (state.check & 0xffff)) {
strm.msg = 'header crc mismatch';
state.mode = BAD;
break;
}
//=== INITBITS();
hold = 0;
bits = 0;
//===//
}
if (state.head) {
state.head.hcrc = ((state.flags >> 9) & 1);
state.head.done = true;
}
strm.adler = state.check = 0;
state.mode = TYPE;
break;
case DICTID:
//=== NEEDBITS(32); */
while (bits < 32) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
strm.adler = state.check = zswap32(hold);
//=== INITBITS();
hold = 0;
bits = 0;
//===//
state.mode = DICT;
/* falls through */
case DICT:
if (state.havedict === 0) {
//--- RESTORE() ---
strm.next_out = put;
strm.avail_out = left;
strm.next_in = next;
strm.avail_in = have;
state.hold = hold;
state.bits = bits;
//---
return Z_NEED_DICT;
}
strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;
state.mode = TYPE;
/* falls through */
case TYPE:
if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; }
/* falls through */
case TYPEDO:
if (state.last) {
//--- BYTEBITS() ---//
hold >>>= bits & 7;
bits -= bits & 7;
//---//
state.mode = CHECK;
break;
}
//=== NEEDBITS(3); */
while (bits < 3) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
state.last = (hold & 0x01)/*BITS(1)*/;
//--- DROPBITS(1) ---//
hold >>>= 1;
bits -= 1;
//---//
switch ((hold & 0x03)/*BITS(2)*/) {
case 0: /* stored block */
//Tracev((stderr, "inflate: stored block%s\n",
// state.last ? " (last)" : ""));
state.mode = STORED;
break;
case 1: /* fixed block */
fixedtables(state);
//Tracev((stderr, "inflate: fixed codes block%s\n",
// state.last ? " (last)" : ""));
state.mode = LEN_; /* decode codes */
if (flush === Z_TREES) {
//--- DROPBITS(2) ---//
hold >>>= 2;
bits -= 2;
//---//
break inf_leave;
}
break;
case 2: /* dynamic block */
//Tracev((stderr, "inflate: dynamic codes block%s\n",
// state.last ? " (last)" : ""));
state.mode = TABLE;
break;
case 3:
strm.msg = 'invalid block type';
state.mode = BAD;
}
//--- DROPBITS(2) ---//
hold >>>= 2;
bits -= 2;
//---//
break;
case STORED:
//--- BYTEBITS() ---// /* go to byte boundary */
hold >>>= bits & 7;
bits -= bits & 7;
//---//
//=== NEEDBITS(32); */
while (bits < 32) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) {
strm.msg = 'invalid stored block lengths';
state.mode = BAD;
break;
}
state.length = hold & 0xffff;
//Tracev((stderr, "inflate: stored length %u\n",
// state.length));
//=== INITBITS();
hold = 0;
bits = 0;
//===//
state.mode = COPY_;
if (flush === Z_TREES) { break inf_leave; }
/* falls through */
case COPY_:
state.mode = COPY;
/* falls through */
case COPY:
copy = state.length;
if (copy) {
if (copy > have) { copy = have; }
if (copy > left) { copy = left; }
if (copy === 0) { break inf_leave; }
//--- zmemcpy(put, next, copy); ---
utils.arraySet(output, input, next, copy, put);
//---//
have -= copy;
next += copy;
left -= copy;
put += copy;
state.length -= copy;
break;
}
//Tracev((stderr, "inflate: stored end\n"));
state.mode = TYPE;
break;
case TABLE:
//=== NEEDBITS(14); */
while (bits < 14) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257;
//--- DROPBITS(5) ---//
hold >>>= 5;
bits -= 5;
//---//
state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1;
//--- DROPBITS(5) ---//
hold >>>= 5;
bits -= 5;
//---//
state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4;
//--- DROPBITS(4) ---//
hold >>>= 4;
bits -= 4;
//---//
//#ifndef PKZIP_BUG_WORKAROUND
if (state.nlen > 286 || state.ndist > 30) {
strm.msg = 'too many length or distance symbols';
state.mode = BAD;
break;
}
//#endif
//Tracev((stderr, "inflate: table sizes ok\n"));
state.have = 0;
state.mode = LENLENS;
/* falls through */
case LENLENS:
while (state.have < state.ncode) {
//=== NEEDBITS(3);
while (bits < 3) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
state.lens[order[state.have++]] = (hold & 0x07);//BITS(3);
//--- DROPBITS(3) ---//
hold >>>= 3;
bits -= 3;
//---//
}
while (state.have < 19) {
state.lens[order[state.have++]] = 0;
}
// We have separate tables & no pointers. 2 commented lines below not needed.
//state.next = state.codes;
//state.lencode = state.next;
// Switch to use dynamic table
state.lencode = state.lendyn;
state.lenbits = 7;
opts = { bits: state.lenbits };
ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);
state.lenbits = opts.bits;
if (ret) {
strm.msg = 'invalid code lengths set';
state.mode = BAD;
break;
}
//Tracev((stderr, "inflate: code lengths ok\n"));
state.have = 0;
state.mode = CODELENS;
/* falls through */
case CODELENS:
while (state.have < state.nlen + state.ndist) {
for (;;) {
here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/
here_bits = here >>> 24;
here_op = (here >>> 16) & 0xff;
here_val = here & 0xffff;
if ((here_bits) <= bits) { break; }
//--- PULLBYTE() ---//
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
//---//
}
if (here_val < 16) {
//--- DROPBITS(here.bits) ---//
hold >>>= here_bits;
bits -= here_bits;
//---//
state.lens[state.have++] = here_val;
}
else {
if (here_val === 16) {
//=== NEEDBITS(here.bits + 2);
n = here_bits + 2;
while (bits < n) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
//--- DROPBITS(here.bits) ---//
hold >>>= here_bits;
bits -= here_bits;
//---//
if (state.have === 0) {
strm.msg = 'invalid bit length repeat';
state.mode = BAD;
break;
}
len = state.lens[state.have - 1];
copy = 3 + (hold & 0x03);//BITS(2);
//--- DROPBITS(2) ---//
hold >>>= 2;
bits -= 2;
//---//
}
else if (here_val === 17) {
//=== NEEDBITS(here.bits + 3);
n = here_bits + 3;
while (bits < n) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
//--- DROPBITS(here.bits) ---//
hold >>>= here_bits;
bits -= here_bits;
//---//
len = 0;
copy = 3 + (hold & 0x07);//BITS(3);
//--- DROPBITS(3) ---//
hold >>>= 3;
bits -= 3;
//---//
}
else {
//=== NEEDBITS(here.bits + 7);
n = here_bits + 7;
while (bits < n) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
//--- DROPBITS(here.bits) ---//
hold >>>= here_bits;
bits -= here_bits;
//---//
len = 0;
copy = 11 + (hold & 0x7f);//BITS(7);
//--- DROPBITS(7) ---//
hold >>>= 7;
bits -= 7;
//---//
}
if (state.have + copy > state.nlen + state.ndist) {
strm.msg = 'invalid bit length repeat';
state.mode = BAD;
break;
}
while (copy--) {
state.lens[state.have++] = len;
}
}
}
/* handle error breaks in while */
if (state.mode === BAD) { break; }
/* check for end-of-block code (better have one) */
if (state.lens[256] === 0) {
strm.msg = 'invalid code -- missing end-of-block';
state.mode = BAD;
break;
}
/* build code tables -- note: do not change the lenbits or distbits
values here (9 and 6) without reading the comments in inftrees.h
concerning the ENOUGH constants, which depend on those values */
state.lenbits = 9;
opts = { bits: state.lenbits };
ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts);
// We have separate tables & no pointers. 2 commented lines below not needed.
// state.next_index = opts.table_index;
state.lenbits = opts.bits;
// state.lencode = state.next;
if (ret) {
strm.msg = 'invalid literal/lengths set';
state.mode = BAD;
break;
}
state.distbits = 6;
//state.distcode.copy(state.codes);
// Switch to use dynamic table
state.distcode = state.distdyn;
opts = { bits: state.distbits };
ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts);
// We have separate tables & no pointers. 2 commented lines below not needed.
// state.next_index = opts.table_index;
state.distbits = opts.bits;
// state.distcode = state.next;
if (ret) {
strm.msg = 'invalid distances set';
state.mode = BAD;
break;
}
//Tracev((stderr, 'inflate: codes ok\n'));
state.mode = LEN_;
if (flush === Z_TREES) { break inf_leave; }
/* falls through */
case LEN_:
state.mode = LEN;
/* falls through */
case LEN:
if (have >= 6 && left >= 258) {
//--- RESTORE() ---
strm.next_out = put;
strm.avail_out = left;
strm.next_in = next;
strm.avail_in = have;
state.hold = hold;
state.bits = bits;
//---
inflate_fast(strm, _out);
//--- LOAD() ---
put = strm.next_out;
output = strm.output;
left = strm.avail_out;
next = strm.next_in;
input = strm.input;
have = strm.avail_in;
hold = state.hold;
bits = state.bits;
//---
if (state.mode === TYPE) {
state.back = -1;
}
break;
}
state.back = 0;
for (;;) {
here = state.lencode[hold & ((1 << state.lenbits) - 1)]; /*BITS(state.lenbits)*/
here_bits = here >>> 24;
here_op = (here >>> 16) & 0xff;
here_val = here & 0xffff;
if (here_bits <= bits) { break; }
//--- PULLBYTE() ---//
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
//---//
}
if (here_op && (here_op & 0xf0) === 0) {
last_bits = here_bits;
last_op = here_op;
last_val = here_val;
for (;;) {
here = state.lencode[last_val +
((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];
here_bits = here >>> 24;
here_op = (here >>> 16) & 0xff;
here_val = here & 0xffff;
if ((last_bits + here_bits) <= bits) { break; }
//--- PULLBYTE() ---//
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
//---//
}
//--- DROPBITS(last.bits) ---//
hold >>>= last_bits;
bits -= last_bits;
//---//
state.back += last_bits;
}
//--- DROPBITS(here.bits) ---//
hold >>>= here_bits;
bits -= here_bits;
//---//
state.back += here_bits;
state.length = here_val;
if (here_op === 0) {
//Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
// "inflate: literal '%c'\n" :
// "inflate: literal 0x%02x\n", here.val));
state.mode = LIT;
break;
}
if (here_op & 32) {
//Tracevv((stderr, "inflate: end of block\n"));
state.back = -1;
state.mode = TYPE;
break;
}
if (here_op & 64) {
strm.msg = 'invalid literal/length code';
state.mode = BAD;
break;
}
state.extra = here_op & 15;
state.mode = LENEXT;
/* falls through */
case LENEXT:
if (state.extra) {
//=== NEEDBITS(state.extra);
n = state.extra;
while (bits < n) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
state.length += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;
//--- DROPBITS(state.extra) ---//
hold >>>= state.extra;
bits -= state.extra;
//---//
state.back += state.extra;
}
//Tracevv((stderr, "inflate: length %u\n", state.length));
state.was = state.length;
state.mode = DIST;
/* falls through */
case DIST:
for (;;) {
here = state.distcode[hold & ((1 << state.distbits) - 1)];/*BITS(state.distbits)*/
here_bits = here >>> 24;
here_op = (here >>> 16) & 0xff;
here_val = here & 0xffff;
if ((here_bits) <= bits) { break; }
//--- PULLBYTE() ---//
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
//---//
}
if ((here_op & 0xf0) === 0) {
last_bits = here_bits;
last_op = here_op;
last_val = here_val;
for (;;) {
here = state.distcode[last_val +
((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];
here_bits = here >>> 24;
here_op = (here >>> 16) & 0xff;
here_val = here & 0xffff;
if ((last_bits + here_bits) <= bits) { break; }
//--- PULLBYTE() ---//
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
//---//
}
//--- DROPBITS(last.bits) ---//
hold >>>= last_bits;
bits -= last_bits;
//---//
state.back += last_bits;
}
//--- DROPBITS(here.bits) ---//
hold >>>= here_bits;
bits -= here_bits;
//---//
state.back += here_bits;
if (here_op & 64) {
strm.msg = 'invalid distance code';
state.mode = BAD;
break;
}
state.offset = here_val;
state.extra = (here_op) & 15;
state.mode = DISTEXT;
/* falls through */
case DISTEXT:
if (state.extra) {
//=== NEEDBITS(state.extra);
n = state.extra;
while (bits < n) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
state.offset += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;
//--- DROPBITS(state.extra) ---//
hold >>>= state.extra;
bits -= state.extra;
//---//
state.back += state.extra;
}
//#ifdef INFLATE_STRICT
if (state.offset > state.dmax) {
strm.msg = 'invalid distance too far back';
state.mode = BAD;
break;
}
//#endif
//Tracevv((stderr, "inflate: distance %u\n", state.offset));
state.mode = MATCH;
/* falls through */
case MATCH:
if (left === 0) { break inf_leave; }
copy = _out - left;
if (state.offset > copy) { /* copy from window */
copy = state.offset - copy;
if (copy > state.whave) {
if (state.sane) {
strm.msg = 'invalid distance too far back';
state.mode = BAD;
break;
}
// (!) This block is disabled in zlib defaults,
// don't enable it for binary compatibility
//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
// Trace((stderr, "inflate.c too far\n"));
// copy -= state.whave;
// if (copy > state.length) { copy = state.length; }
// if (copy > left) { copy = left; }
// left -= copy;
// state.length -= copy;
// do {
// output[put++] = 0;
// } while (--copy);
// if (state.length === 0) { state.mode = LEN; }
// break;
//#endif
}
if (copy > state.wnext) {
copy -= state.wnext;
from = state.wsize - copy;
}
else {
from = state.wnext - copy;
}
if (copy > state.length) { copy = state.length; }
from_source = state.window;
}
else { /* copy from output */
from_source = output;
from = put - state.offset;
copy = state.length;
}
if (copy > left) { copy = left; }
left -= copy;
state.length -= copy;
do {
output[put++] = from_source[from++];
} while (--copy);
if (state.length === 0) { state.mode = LEN; }
break;
case LIT:
if (left === 0) { break inf_leave; }
output[put++] = state.length;
left--;
state.mode = LEN;
break;
case CHECK:
if (state.wrap) {
//=== NEEDBITS(32);
while (bits < 32) {
if (have === 0) { break inf_leave; }
have--;
// Use '|' instead of '+' to make sure that result is signed
hold |= input[next++] << bits;
bits += 8;
}
//===//
_out -= left;
strm.total_out += _out;
state.total += _out;
if (_out) {
strm.adler = state.check =
/*UPDATE(state.check, put - _out, _out);*/
(state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out));
}
_out = left;
// NB: crc32 stored as signed 32-bit int, zswap32 returns signed too
if ((state.flags ? hold : zswap32(hold)) !== state.check) {
strm.msg = 'incorrect data check';
state.mode = BAD;
break;
}
//=== INITBITS();
hold = 0;
bits = 0;
//===//
//Tracev((stderr, "inflate: check matches trailer\n"));
}
state.mode = LENGTH;
/* falls through */
case LENGTH:
if (state.wrap && state.flags) {
//=== NEEDBITS(32);
while (bits < 32) {
if (have === 0) { break inf_leave; }
have--;
hold += input[next++] << bits;
bits += 8;
}
//===//
if (hold !== (state.total & 0xffffffff)) {
strm.msg = 'incorrect length check';
state.mode = BAD;
break;
}
//=== INITBITS();
hold = 0;
bits = 0;
//===//
//Tracev((stderr, "inflate: length matches trailer\n"));
}
state.mode = DONE;
/* falls through */
case DONE:
ret = Z_STREAM_END;
break inf_leave;
case BAD:
ret = Z_DATA_ERROR;
break inf_leave;
case MEM:
return Z_MEM_ERROR;
case SYNC:
/* falls through */
default:
return Z_STREAM_ERROR;
}
}
// inf_leave <- here is real place for "goto inf_leave", emulated via "break inf_leave"
/*
Return from inflate(), updating the total counts and the check value.
If there was no progress during the inflate() call, return a buffer
error. Call updatewindow() to create and/or update the window state.
Note: a memory error from inflate() is non-recoverable.
*/
//--- RESTORE() ---
strm.next_out = put;
strm.avail_out = left;
strm.next_in = next;
strm.avail_in = have;
state.hold = hold;
state.bits = bits;
//---
if (state.wsize || (_out !== strm.avail_out && state.mode < BAD &&
(state.mode < CHECK || flush !== Z_FINISH))) {
if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) {
state.mode = MEM;
return Z_MEM_ERROR;
}
}
_in -= strm.avail_in;
_out -= strm.avail_out;
strm.total_in += _in;
strm.total_out += _out;
state.total += _out;
if (state.wrap && _out) {
strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/
(state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out));
}
strm.data_type = state.bits + (state.last ? 64 : 0) +
(state.mode === TYPE ? 128 : 0) +
(state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);
if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) {
ret = Z_BUF_ERROR;
}
return ret;
}
function inflateEnd(strm) {
if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/) {
return Z_STREAM_ERROR;
}
var state = strm.state;
if (state.window) {
state.window = null;
}
strm.state = null;
return Z_OK;
}
function inflateGetHeader(strm, head) {
var state;
/* check state */
if (!strm || !strm.state) { return Z_STREAM_ERROR; }
state = strm.state;
if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; }
/* save header structure */
state.head = head;
head.done = false;
return Z_OK;
}
function inflateSetDictionary(strm, dictionary) {
var dictLength = dictionary.length;
var state;
var dictid;
var ret;
/* check state */
if (!strm /* == Z_NULL */ || !strm.state /* == Z_NULL */) { return Z_STREAM_ERROR; }
state = strm.state;
if (state.wrap !== 0 && state.mode !== DICT) {
return Z_STREAM_ERROR;
}
/* check for correct dictionary identifier */
if (state.mode === DICT) {
dictid = 1; /* adler32(0, null, 0)*/
/* dictid = adler32(dictid, dictionary, dictLength); */
dictid = adler32(dictid, dictionary, dictLength, 0);
if (dictid !== state.check) {
return Z_DATA_ERROR;
}
}
/* copy dictionary to window using updatewindow(), which will amend the
existing dictionary if appropriate */
ret = updatewindow(strm, dictionary, dictLength, dictLength);
if (ret) {
state.mode = MEM;
return Z_MEM_ERROR;
}
state.havedict = 1;
// Tracev((stderr, "inflate: dictionary set\n"));
return Z_OK;
}
exports.inflateReset = inflateReset;
exports.inflateReset2 = inflateReset2;
exports.inflateResetKeep = inflateResetKeep;
exports.inflateInit = inflateInit;
exports.inflateInit2 = inflateInit2;
exports.inflate = inflate;
exports.inflateEnd = inflateEnd;
exports.inflateGetHeader = inflateGetHeader;
exports.inflateSetDictionary = inflateSetDictionary;
exports.inflateInfo = 'pako inflate (from Nodeca project)';
/* Not implemented
exports.inflateCopy = inflateCopy;
exports.inflateGetDictionary = inflateGetDictionary;
exports.inflateMark = inflateMark;
exports.inflatePrime = inflatePrime;
exports.inflateSync = inflateSync;
exports.inflateSyncPoint = inflateSyncPoint;
exports.inflateUndermine = inflateUndermine;
*/
/***/ }),
/***/ 6895:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
"use strict";
// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
var utils = __nccwpck_require__(5483);
var MAXBITS = 15;
var ENOUGH_LENS = 852;
var ENOUGH_DISTS = 592;
//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);
var CODES = 0;
var LENS = 1;
var DISTS = 2;
var lbase = [ /* Length codes 257..285 base */
3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0
];
var lext = [ /* Length codes 257..285 extra */
16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78
];
var dbase = [ /* Distance codes 0..29 base */
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
8193, 12289, 16385, 24577, 0, 0
];
var dext = [ /* Distance codes 0..29 extra */
16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,
23, 23, 24, 24, 25, 25, 26, 26, 27, 27,
28, 28, 29, 29, 64, 64
];
module.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts)
{
var bits = opts.bits;
//here = opts.here; /* table entry for duplication */
var len = 0; /* a code's length in bits */
var sym = 0; /* index of code symbols */
var min = 0, max = 0; /* minimum and maximum code lengths */
var root = 0; /* number of index bits for root table */
var curr = 0; /* number of index bits for current table */
var drop = 0; /* code bits to drop for sub-table */
var left = 0; /* number of prefix codes available */
var used = 0; /* code entries in table used */
var huff = 0; /* Huffman code */
var incr; /* for incrementing code, index */
var fill; /* index for replicating entries */
var low; /* low bits for current root entry */
var mask; /* mask for low root bits */
var next; /* next available space in table */
var base = null; /* base value table to use */
var base_index = 0;
// var shoextra; /* extra bits table to use */
var end; /* use base and extra for symbol > end */
var count = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* number of codes of each length */
var offs = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* offsets in table for each length */
var extra = null;
var extra_index = 0;
var here_bits, here_op, here_val;
/*
Process a set of code lengths to create a canonical Huffman code. The
code lengths are lens[0..codes-1]. Each length corresponds to the
symbols 0..codes-1. The Huffman code is generated by first sorting the
symbols by length from short to long, and retaining the symbol order
for codes with equal lengths. Then the code starts with all zero bits
for the first code of the shortest length, and the codes are integer
increments for the same length, and zeros are appended as the length
increases. For the deflate format, these bits are stored backwards
from their more natural integer increment ordering, and so when the
decoding tables are built in the large loop below, the integer codes
are incremented backwards.
This routine assumes, but does not check, that all of the entries in
lens[] are in the range 0..MAXBITS. The caller must assure this.
1..MAXBITS is interpreted as that code length. zero means that that
symbol does not occur in this code.
The codes are sorted by computing a count of codes for each length,
creating from that a table of starting indices for each length in the
sorted table, and then entering the symbols in order in the sorted
table. The sorted table is work[], with that space being provided by
the caller.
The length counts are used for other purposes as well, i.e. finding
the minimum and maximum length codes, determining if there are any
codes at all, checking for a valid set of lengths, and looking ahead
at length counts to determine sub-table sizes when building the
decoding tables.
*/
/* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */
for (len = 0; len <= MAXBITS; len++) {
count[len] = 0;
}
for (sym = 0; sym < codes; sym++) {
count[lens[lens_index + sym]]++;
}
/* bound code lengths, force root to be within code lengths */
root = bits;
for (max = MAXBITS; max >= 1; max--) {
if (count[max] !== 0) { break; }
}
if (root > max) {
root = max;
}
if (max === 0) { /* no symbols to code at all */
//table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */
//table.bits[opts.table_index] = 1; //here.bits = (var char)1;
//table.val[opts.table_index++] = 0; //here.val = (var short)0;
table[table_index++] = (1 << 24) | (64 << 16) | 0;
//table.op[opts.table_index] = 64;
//table.bits[opts.table_index] = 1;
//table.val[opts.table_index++] = 0;
table[table_index++] = (1 << 24) | (64 << 16) | 0;
opts.bits = 1;
return 0; /* no symbols, but wait for decoding to report error */
}
for (min = 1; min < max; min++) {
if (count[min] !== 0) { break; }
}
if (root < min) {
root = min;
}
/* check for an over-subscribed or incomplete set of lengths */
left = 1;
for (len = 1; len <= MAXBITS; len++) {
left <<= 1;
left -= count[len];
if (left < 0) {
return -1;
} /* over-subscribed */
}
if (left > 0 && (type === CODES || max !== 1)) {
return -1; /* incomplete set */
}
/* generate offsets into symbol table for each length for sorting */
offs[1] = 0;
for (len = 1; len < MAXBITS; len++) {
offs[len + 1] = offs[len] + count[len];
}
/* sort symbols by length, by symbol order within each length */
for (sym = 0; sym < codes; sym++) {
if (lens[lens_index + sym] !== 0) {
work[offs[lens[lens_index + sym]]++] = sym;
}
}
/*
Create and fill in decoding tables. In this loop, the table being
filled is at next and has curr index bits. The code being used is huff
with length len. That code is converted to an index by dropping drop
bits off of the bottom. For codes where len is less than drop + curr,
those top drop + curr - len bits are incremented through all values to
fill the table with replicated entries.
root is the number of index bits for the root table. When len exceeds
root, sub-tables are created pointed to by the root entry with an index
of the low root bits of huff. This is saved in low to check for when a
new sub-table should be started. drop is zero when the root table is
being filled, and drop is root when sub-tables are being filled.
When a new sub-table is needed, it is necessary to look ahead in the
code lengths to determine what size sub-table is needed. The length
counts are used for this, and so count[] is decremented as codes are
entered in the tables.
used keeps track of how many table entries have been allocated from the
provided *table space. It is checked for LENS and DIST tables against
the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in
the initial root table size constants. See the comments in inftrees.h
for more information.
sym increments through all symbols, and the loop terminates when
all codes of length max, i.e. all codes, have been processed. This
routine permits incomplete codes, so another loop after this one fills
in the rest of the decoding tables with invalid code markers.
*/
/* set up for code type */
// poor man optimization - use if-else instead of switch,
// to avoid deopts in old v8
if (type === CODES) {
base = extra = work; /* dummy value--not used */
end = 19;
} else if (type === LENS) {
base = lbase;
base_index -= 257;
extra = lext;
extra_index -= 257;
end = 256;
} else { /* DISTS */
base = dbase;
extra = dext;
end = -1;
}
/* initialize opts for loop */
huff = 0; /* starting code */
sym = 0; /* starting code symbol */
len = min; /* starting code length */
next = table_index; /* current table to fill in */
curr = root; /* current table index bits */
drop = 0; /* current bits to drop from code for index */
low = -1; /* trigger new sub-table when len > root */
used = 1 << root; /* use root table entries */
mask = used - 1; /* mask for comparing low */
/* check available table space */
if ((type === LENS && used > ENOUGH_LENS) ||
(type === DISTS && used > ENOUGH_DISTS)) {
return 1;
}
/* process all codes and make table entries */
for (;;) {
/* create table entry */
here_bits = len - drop;
if (work[sym] < end) {
here_op = 0;
here_val = work[sym];
}
else if (work[sym] > end) {
here_op = extra[extra_index + work[sym]];
here_val = base[base_index + work[sym]];
}
else {
here_op = 32 + 64; /* end of block */
here_val = 0;
}
/* replicate for those indices with low len bits equal to huff */
incr = 1 << (len - drop);
fill = 1 << curr;
min = fill; /* save offset to next table */
do {
fill -= incr;
table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0;
} while (fill !== 0);
/* backwards increment the len-bit code huff */
incr = 1 << (len - 1);
while (huff & incr) {
incr >>= 1;
}
if (incr !== 0) {
huff &= incr - 1;
huff += incr;
} else {
huff = 0;
}
/* go to next symbol, update count, len */
sym++;
if (--count[len] === 0) {
if (len === max) { break; }
len = lens[lens_index + work[sym]];
}
/* create new sub-table if needed */
if (len > root && (huff & mask) !== low) {
/* if first time, transition to sub-tables */
if (drop === 0) {
drop = root;
}
/* increment past last table */
next += min; /* here min is 1 << curr */
/* determine length of next table */
curr = len - drop;
left = 1 << curr;
while (curr + drop < max) {
left -= count[curr + drop];
if (left <= 0) { break; }
curr++;
left <<= 1;
}
/* check for enough space */
used += 1 << curr;
if ((type === LENS && used > ENOUGH_LENS) ||
(type === DISTS && used > ENOUGH_DISTS)) {
return 1;
}
/* point entry in root table to sub-table */
low = huff & mask;
/*table.op[low] = curr;
table.bits[low] = root;
table.val[low] = next - opts.table_index;*/
table[low] = (root << 24) | (curr << 16) | (next - table_index) |0;
}
}
/* fill in remaining table entry if code is incomplete (guaranteed to have
at most one remaining entry, since if the code is incomplete, the
maximum code length that was allowed to get this far is one bit) */
if (huff !== 0) {
//table.op[next + huff] = 64; /* invalid code marker */
//table.bits[next + huff] = len - drop;
//table.val[next + huff] = 0;
table[next + huff] = ((len - drop) << 24) | (64 << 16) |0;
}
/* set return parameters */
//opts.table_index += used;
opts.bits = root;
return 0;
};
/***/ }),
/***/ 1890:
/***/ ((module) => {
"use strict";
// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
module.exports = {
2: 'need dictionary', /* Z_NEED_DICT 2 */
1: 'stream end', /* Z_STREAM_END 1 */
0: '', /* Z_OK 0 */
'-1': 'file error', /* Z_ERRNO (-1) */
'-2': 'stream error', /* Z_STREAM_ERROR (-2) */
'-3': 'data error', /* Z_DATA_ERROR (-3) */
'-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */
'-5': 'buffer error', /* Z_BUF_ERROR (-5) */
'-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */
};
/***/ }),
/***/ 8754:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
/* eslint-disable space-unary-ops */
var utils = __nccwpck_require__(5483);
/* Public constants ==========================================================*/
/* ===========================================================================*/
//var Z_FILTERED = 1;
//var Z_HUFFMAN_ONLY = 2;
//var Z_RLE = 3;
var Z_FIXED = 4;
//var Z_DEFAULT_STRATEGY = 0;
/* Possible values of the data_type field (though see inflate()) */
var Z_BINARY = 0;
var Z_TEXT = 1;
//var Z_ASCII = 1; // = Z_TEXT
var Z_UNKNOWN = 2;
/*============================================================================*/
function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }
// From zutil.h
var STORED_BLOCK = 0;
var STATIC_TREES = 1;
var DYN_TREES = 2;
/* The three kinds of block type */
var MIN_MATCH = 3;
var MAX_MATCH = 258;
/* The minimum and maximum match lengths */
// From deflate.h
/* ===========================================================================
* Internal compression state.
*/
var LENGTH_CODES = 29;
/* number of length codes, not counting the special END_BLOCK code */
var LITERALS = 256;
/* number of literal bytes 0..255 */
var L_CODES = LITERALS + 1 + LENGTH_CODES;
/* number of Literal or Length codes, including the END_BLOCK code */
var D_CODES = 30;
/* number of distance codes */
var BL_CODES = 19;
/* number of codes used to transfer the bit lengths */
var HEAP_SIZE = 2 * L_CODES + 1;
/* maximum heap size */
var MAX_BITS = 15;
/* All codes must not exceed MAX_BITS bits */
var Buf_size = 16;
/* size of bit buffer in bi_buf */
/* ===========================================================================
* Constants
*/
var MAX_BL_BITS = 7;
/* Bit length codes must not exceed MAX_BL_BITS bits */
var END_BLOCK = 256;
/* end of block literal code */
var REP_3_6 = 16;
/* repeat previous bit length 3-6 times (2 bits of repeat count) */
var REPZ_3_10 = 17;
/* repeat a zero length 3-10 times (3 bits of repeat count) */
var REPZ_11_138 = 18;
/* repeat a zero length 11-138 times (7 bits of repeat count) */
/* eslint-disable comma-spacing,array-bracket-spacing */
var extra_lbits = /* extra bits for each length code */
[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];
var extra_dbits = /* extra bits for each distance code */
[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];
var extra_blbits = /* extra bits for each bit length code */
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];
var bl_order =
[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];
/* eslint-enable comma-spacing,array-bracket-spacing */
/* The lengths of the bit length codes are sent in order of decreasing
* probability, to avoid transmitting the lengths for unused bit length codes.
*/
/* ===========================================================================
* Local data. These are initialized only once.
*/
// We pre-fill arrays with 0 to avoid uninitialized gaps
var DIST_CODE_LEN = 512; /* see definition of array dist_code below */
// !!!! Use flat array instead of structure, Freq = i*2, Len = i*2+1
var static_ltree = new Array((L_CODES + 2) * 2);
zero(static_ltree);
/* The static literal tree. Since the bit lengths are imposed, there is no
* need for the L_CODES extra codes used during heap construction. However
* The codes 286 and 287 are needed to build a canonical tree (see _tr_init
* below).
*/
var static_dtree = new Array(D_CODES * 2);
zero(static_dtree);
/* The static distance tree. (Actually a trivial tree since all codes use
* 5 bits.)
*/
var _dist_code = new Array(DIST_CODE_LEN);
zero(_dist_code);
/* Distance codes. The first 256 values correspond to the distances
* 3 .. 258, the last 256 values correspond to the top 8 bits of
* the 15 bit distances.
*/
var _length_code = new Array(MAX_MATCH - MIN_MATCH + 1);
zero(_length_code);
/* length code for each normalized match length (0 == MIN_MATCH) */
var base_length = new Array(LENGTH_CODES);
zero(base_length);
/* First normalized length for each code (0 = MIN_MATCH) */
var base_dist = new Array(D_CODES);
zero(base_dist);
/* First normalized distance for each code (0 = distance of 1) */
function StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {
this.static_tree = static_tree; /* static tree or NULL */
this.extra_bits = extra_bits; /* extra bits for each code or NULL */
this.extra_base = extra_base; /* base index for extra_bits */
this.elems = elems; /* max number of elements in the tree */
this.max_length = max_length; /* max bit length for the codes */
// show if `static_tree` has data or dummy - needed for monomorphic objects
this.has_stree = static_tree && static_tree.length;
}
var static_l_desc;
var static_d_desc;
var static_bl_desc;
function TreeDesc(dyn_tree, stat_desc) {
this.dyn_tree = dyn_tree; /* the dynamic tree */
this.max_code = 0; /* largest code with non zero frequency */
this.stat_desc = stat_desc; /* the corresponding static tree */
}
function d_code(dist) {
return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];
}
/* ===========================================================================
* Output a short LSB first on the stream.
* IN assertion: there is enough room in pendingBuf.
*/
function put_short(s, w) {
// put_byte(s, (uch)((w) & 0xff));
// put_byte(s, (uch)((ush)(w) >> 8));
s.pending_buf[s.pending++] = (w) & 0xff;
s.pending_buf[s.pending++] = (w >>> 8) & 0xff;
}
/* ===========================================================================
* Send a value on a given number of bits.
* IN assertion: length <= 16 and value fits in length bits.
*/
function send_bits(s, value, length) {
if (s.bi_valid > (Buf_size - length)) {
s.bi_buf |= (value << s.bi_valid) & 0xffff;
put_short(s, s.bi_buf);
s.bi_buf = value >> (Buf_size - s.bi_valid);
s.bi_valid += length - Buf_size;
} else {
s.bi_buf |= (value << s.bi_valid) & 0xffff;
s.bi_valid += length;
}
}
function send_code(s, c, tree) {
send_bits(s, tree[c * 2]/*.Code*/, tree[c * 2 + 1]/*.Len*/);
}
/* ===========================================================================
* Reverse the first len bits of a code, using straightforward code (a faster
* method would use a table)
* IN assertion: 1 <= len <= 15
*/
function bi_reverse(code, len) {
var res = 0;
do {
res |= code & 1;
code >>>= 1;
res <<= 1;
} while (--len > 0);
return res >>> 1;
}
/* ===========================================================================
* Flush the bit buffer, keeping at most 7 bits in it.
*/
function bi_flush(s) {
if (s.bi_valid === 16) {
put_short(s, s.bi_buf);
s.bi_buf = 0;
s.bi_valid = 0;
} else if (s.bi_valid >= 8) {
s.pending_buf[s.pending++] = s.bi_buf & 0xff;
s.bi_buf >>= 8;
s.bi_valid -= 8;
}
}
/* ===========================================================================
* Compute the optimal bit lengths for a tree and update the total bit length
* for the current block.
* IN assertion: the fields freq and dad are set, heap[heap_max] and
* above are the tree nodes sorted by increasing frequency.
* OUT assertions: the field len is set to the optimal bit length, the
* array bl_count contains the frequencies for each bit length.
* The length opt_len is updated; static_len is also updated if stree is
* not null.
*/
function gen_bitlen(s, desc)
// deflate_state *s;
// tree_desc *desc; /* the tree descriptor */
{
var tree = desc.dyn_tree;
var max_code = desc.max_code;
var stree = desc.stat_desc.static_tree;
var has_stree = desc.stat_desc.has_stree;
var extra = desc.stat_desc.extra_bits;
var base = desc.stat_desc.extra_base;
var max_length = desc.stat_desc.max_length;
var h; /* heap index */
var n, m; /* iterate over the tree elements */
var bits; /* bit length */
var xbits; /* extra bits */
var f; /* frequency */
var overflow = 0; /* number of elements with bit length too large */
for (bits = 0; bits <= MAX_BITS; bits++) {
s.bl_count[bits] = 0;
}
/* In a first pass, compute the optimal bit lengths (which may
* overflow in the case of the bit length tree).
*/
tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */
for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {
n = s.heap[h];
bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;
if (bits > max_length) {
bits = max_length;
overflow++;
}
tree[n * 2 + 1]/*.Len*/ = bits;
/* We overwrite tree[n].Dad which is no longer needed */
if (n > max_code) { continue; } /* not a leaf node */
s.bl_count[bits]++;
xbits = 0;
if (n >= base) {
xbits = extra[n - base];
}
f = tree[n * 2]/*.Freq*/;
s.opt_len += f * (bits + xbits);
if (has_stree) {
s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);
}
}
if (overflow === 0) { return; }
// Trace((stderr,"\nbit length overflow\n"));
/* This happens for example on obj2 and pic of the Calgary corpus */
/* Find the first bit length which could increase: */
do {
bits = max_length - 1;
while (s.bl_count[bits] === 0) { bits--; }
s.bl_count[bits]--; /* move one leaf down the tree */
s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */
s.bl_count[max_length]--;
/* The brother of the overflow item also moves one step up,
* but this does not affect bl_count[max_length]
*/
overflow -= 2;
} while (overflow > 0);
/* Now recompute all bit lengths, scanning in increasing frequency.
* h is still equal to HEAP_SIZE. (It is simpler to reconstruct all
* lengths instead of fixing only the wrong ones. This idea is taken
* from 'ar' written by Haruhiko Okumura.)
*/
for (bits = max_length; bits !== 0; bits--) {
n = s.bl_count[bits];
while (n !== 0) {
m = s.heap[--h];
if (m > max_code) { continue; }
if (tree[m * 2 + 1]/*.Len*/ !== bits) {
// Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits));
s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;
tree[m * 2 + 1]/*.Len*/ = bits;
}
n--;
}
}
}
/* ===========================================================================
* Generate the codes for a given tree and bit counts (which need not be
* optimal).
* IN assertion: the array bl_count contains the bit length statistics for
* the given tree and the field len is set for all tree elements.
* OUT assertion: the field code is set for all tree elements of non
* zero code length.
*/
function gen_codes(tree, max_code, bl_count)
// ct_data *tree; /* the tree to decorate */
// int max_code; /* largest code with non zero frequency */
// ushf *bl_count; /* number of codes at each bit length */
{
var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */
var code = 0; /* running code value */
var bits; /* bit index */
var n; /* code index */
/* The distribution counts are first used to generate the code values
* without bit reversal.
*/
for (bits = 1; bits <= MAX_BITS; bits++) {
next_code[bits] = code = (code + bl_count[bits - 1]) << 1;
}
/* Check that the bit counts in bl_count are consistent. The last code
* must be all ones.
*/
//Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,
// "inconsistent bit counts");
//Tracev((stderr,"\ngen_codes: max_code %d ", max_code));
for (n = 0; n <= max_code; n++) {
var len = tree[n * 2 + 1]/*.Len*/;
if (len === 0) { continue; }
/* Now reverse the bits */
tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);
//Tracecv(tree != static_ltree, (stderr,"\nn %3d %c l %2d c %4x (%x) ",
// n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));
}
}
/* ===========================================================================
* Initialize the various 'constant' tables.
*/
function tr_static_init() {
var n; /* iterates over tree elements */
var bits; /* bit counter */
var length; /* length value */
var code; /* code value */
var dist; /* distance index */
var bl_count = new Array(MAX_BITS + 1);
/* number of codes at each bit length for an optimal tree */
// do check in _tr_init()
//if (static_init_done) return;
/* For some embedded targets, global variables are not initialized: */
/*#ifdef NO_INIT_GLOBAL_POINTERS
static_l_desc.static_tree = static_ltree;
static_l_desc.extra_bits = extra_lbits;
static_d_desc.static_tree = static_dtree;
static_d_desc.extra_bits = extra_dbits;
static_bl_desc.extra_bits = extra_blbits;
#endif*/
/* Initialize the mapping length (0..255) -> length code (0..28) */
length = 0;
for (code = 0; code < LENGTH_CODES - 1; code++) {
base_length[code] = length;
for (n = 0; n < (1 << extra_lbits[code]); n++) {
_length_code[length++] = code;
}
}
//Assert (length == 256, "tr_static_init: length != 256");
/* Note that the length 255 (match length 258) can be represented
* in two different ways: code 284 + 5 bits or code 285, so we
* overwrite length_code[255] to use the best encoding:
*/
_length_code[length - 1] = code;
/* Initialize the mapping dist (0..32K) -> dist code (0..29) */
dist = 0;
for (code = 0; code < 16; code++) {
base_dist[code] = dist;
for (n = 0; n < (1 << extra_dbits[code]); n++) {
_dist_code[dist++] = code;
}
}
//Assert (dist == 256, "tr_static_init: dist != 256");
dist >>= 7; /* from now on, all distances are divided by 128 */
for (; code < D_CODES; code++) {
base_dist[code] = dist << 7;
for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {
_dist_code[256 + dist++] = code;
}
}
//Assert (dist == 256, "tr_static_init: 256+dist != 512");
/* Construct the codes of the static literal tree */
for (bits = 0; bits <= MAX_BITS; bits++) {
bl_count[bits] = 0;
}
n = 0;
while (n <= 143) {
static_ltree[n * 2 + 1]/*.Len*/ = 8;
n++;
bl_count[8]++;
}
while (n <= 255) {
static_ltree[n * 2 + 1]/*.Len*/ = 9;
n++;
bl_count[9]++;
}
while (n <= 279) {
static_ltree[n * 2 + 1]/*.Len*/ = 7;
n++;
bl_count[7]++;
}
while (n <= 287) {
static_ltree[n * 2 + 1]/*.Len*/ = 8;
n++;
bl_count[8]++;
}
/* Codes 286 and 287 do not exist, but we must include them in the
* tree construction to get a canonical Huffman tree (longest code
* all ones)
*/
gen_codes(static_ltree, L_CODES + 1, bl_count);
/* The static distance tree is trivial: */
for (n = 0; n < D_CODES; n++) {
static_dtree[n * 2 + 1]/*.Len*/ = 5;
static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);
}
// Now data ready and we can init static trees
static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);
static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);
static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);
//static_init_done = true;
}
/* ===========================================================================
* Initialize a new block.
*/
function init_block(s) {
var n; /* iterates over tree elements */
/* Initialize the trees. */
for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }
for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }
for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }
s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;
s.opt_len = s.static_len = 0;
s.last_lit = s.matches = 0;
}
/* ===========================================================================
* Flush the bit buffer and align the output on a byte boundary
*/
function bi_windup(s)
{
if (s.bi_valid > 8) {
put_short(s, s.bi_buf);
} else if (s.bi_valid > 0) {
//put_byte(s, (Byte)s->bi_buf);
s.pending_buf[s.pending++] = s.bi_buf;
}
s.bi_buf = 0;
s.bi_valid = 0;
}
/* ===========================================================================
* Copy a stored block, storing first the length and its
* one's complement if requested.
*/
function copy_block(s, buf, len, header)
//DeflateState *s;
//charf *buf; /* the input data */
//unsigned len; /* its length */
//int header; /* true if block header must be written */
{
bi_windup(s); /* align on byte boundary */
if (header) {
put_short(s, len);
put_short(s, ~len);
}
// while (len--) {
// put_byte(s, *buf++);
// }
utils.arraySet(s.pending_buf, s.window, buf, len, s.pending);
s.pending += len;
}
/* ===========================================================================
* Compares to subtrees, using the tree depth as tie breaker when
* the subtrees have equal frequency. This minimizes the worst case length.
*/
function smaller(tree, n, m, depth) {
var _n2 = n * 2;
var _m2 = m * 2;
return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||
(tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));
}
/* ===========================================================================
* Restore the heap property by moving down the tree starting at node k,
* exchanging a node with the smallest of its two sons if necessary, stopping
* when the heap property is re-established (each father smaller than its
* two sons).
*/
function pqdownheap(s, tree, k)
// deflate_state *s;
// ct_data *tree; /* the tree to restore */
// int k; /* node to move down */
{
var v = s.heap[k];
var j = k << 1; /* left son of k */
while (j <= s.heap_len) {
/* Set j to the smallest of the two sons: */
if (j < s.heap_len &&
smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {
j++;
}
/* Exit if v is smaller than both sons */
if (smaller(tree, v, s.heap[j], s.depth)) { break; }
/* Exchange v with the smallest son */
s.heap[k] = s.heap[j];
k = j;
/* And continue down the tree, setting j to the left son of k */
j <<= 1;
}
s.heap[k] = v;
}
// inlined manually
// var SMALLEST = 1;
/* ===========================================================================
* Send the block data compressed using the given Huffman trees
*/
function compress_block(s, ltree, dtree)
// deflate_state *s;
// const ct_data *ltree; /* literal tree */
// const ct_data *dtree; /* distance tree */
{
var dist; /* distance of matched string */
var lc; /* match length or unmatched char (if dist == 0) */
var lx = 0; /* running index in l_buf */
var code; /* the code to send */
var extra; /* number of extra bits to send */
if (s.last_lit !== 0) {
do {
dist = (s.pending_buf[s.d_buf + lx * 2] << 8) | (s.pending_buf[s.d_buf + lx * 2 + 1]);
lc = s.pending_buf[s.l_buf + lx];
lx++;
if (dist === 0) {
send_code(s, lc, ltree); /* send a literal byte */
//Tracecv(isgraph(lc), (stderr," '%c' ", lc));
} else {
/* Here, lc is the match length - MIN_MATCH */
code = _length_code[lc];
send_code(s, code + LITERALS + 1, ltree); /* send the length code */
extra = extra_lbits[code];
if (extra !== 0) {
lc -= base_length[code];
send_bits(s, lc, extra); /* send the extra length bits */
}
dist--; /* dist is now the match distance - 1 */
code = d_code(dist);
//Assert (code < D_CODES, "bad d_code");
send_code(s, code, dtree); /* send the distance code */
extra = extra_dbits[code];
if (extra !== 0) {
dist -= base_dist[code];
send_bits(s, dist, extra); /* send the extra distance bits */
}
} /* literal or match pair ? */
/* Check that the overlay between pending_buf and d_buf+l_buf is ok: */
//Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx,
// "pendingBuf overflow");
} while (lx < s.last_lit);
}
send_code(s, END_BLOCK, ltree);
}
/* ===========================================================================
* Construct one Huffman tree and assigns the code bit strings and lengths.
* Update the total bit length for the current block.
* IN assertion: the field freq is set for all tree elements.
* OUT assertions: the fields len and code are set to the optimal bit length
* and corresponding code. The length opt_len is updated; static_len is
* also updated if stree is not null. The field max_code is set.
*/
function build_tree(s, desc)
// deflate_state *s;
// tree_desc *desc; /* the tree descriptor */
{
var tree = desc.dyn_tree;
var stree = desc.stat_desc.static_tree;
var has_stree = desc.stat_desc.has_stree;
var elems = desc.stat_desc.elems;
var n, m; /* iterate over heap elements */
var max_code = -1; /* largest code with non zero frequency */
var node; /* new node being created */
/* Construct the initial heap, with least frequent element in
* heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].
* heap[0] is not used.
*/
s.heap_len = 0;
s.heap_max = HEAP_SIZE;
for (n = 0; n < elems; n++) {
if (tree[n * 2]/*.Freq*/ !== 0) {
s.heap[++s.heap_len] = max_code = n;
s.depth[n] = 0;
} else {
tree[n * 2 + 1]/*.Len*/ = 0;
}
}
/* The pkzip format requires that at least one distance code exists,
* and that at least one bit should be sent even if there is only one
* possible code. So to avoid special checks later on we force at least
* two codes of non zero frequency.
*/
while (s.heap_len < 2) {
node = s.heap[++s.heap_len] = (max_code < 2 ? ++max_code : 0);
tree[node * 2]/*.Freq*/ = 1;
s.depth[node] = 0;
s.opt_len--;
if (has_stree) {
s.static_len -= stree[node * 2 + 1]/*.Len*/;
}
/* node is 0 or 1 so it does not have extra bits */
}
desc.max_code = max_code;
/* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,
* establish sub-heaps of increasing lengths:
*/
for (n = (s.heap_len >> 1/*int /2*/); n >= 1; n--) { pqdownheap(s, tree, n); }
/* Construct the Huffman tree by repeatedly combining the least two
* frequent nodes.
*/
node = elems; /* next internal node of the tree */
do {
//pqremove(s, tree, n); /* n = node of least frequency */
/*** pqremove ***/
n = s.heap[1/*SMALLEST*/];
s.heap[1/*SMALLEST*/] = s.heap[s.heap_len--];
pqdownheap(s, tree, 1/*SMALLEST*/);
/***/
m = s.heap[1/*SMALLEST*/]; /* m = node of next least frequency */
s.heap[--s.heap_max] = n; /* keep the nodes sorted by frequency */
s.heap[--s.heap_max] = m;
/* Create a new node father of n and m */
tree[node * 2]/*.Freq*/ = tree[n * 2]/*.Freq*/ + tree[m * 2]/*.Freq*/;
s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1;
tree[n * 2 + 1]/*.Dad*/ = tree[m * 2 + 1]/*.Dad*/ = node;
/* and insert the new node in the heap */
s.heap[1/*SMALLEST*/] = node++;
pqdownheap(s, tree, 1/*SMALLEST*/);
} while (s.heap_len >= 2);
s.heap[--s.heap_max] = s.heap[1/*SMALLEST*/];
/* At this point, the fields freq and dad are set. We can now
* generate the bit lengths.
*/
gen_bitlen(s, desc);
/* The field len is now set, we can generate the bit codes */
gen_codes(tree, max_code, s.bl_count);
}
/* ===========================================================================
* Scan a literal or distance tree to determine the frequencies of the codes
* in the bit length tree.
*/
function scan_tree(s, tree, max_code)
// deflate_state *s;
// ct_data *tree; /* the tree to be scanned */
// int max_code; /* and its largest code of non zero frequency */
{
var n; /* iterates over all tree elements */
var prevlen = -1; /* last emitted length */
var curlen; /* length of current code */
var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */
var count = 0; /* repeat count of the current code */
var max_count = 7; /* max repeat count */
var min_count = 4; /* min repeat count */
if (nextlen === 0) {
max_count = 138;
min_count = 3;
}
tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */
for (n = 0; n <= max_code; n++) {
curlen = nextlen;
nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;
if (++count < max_count && curlen === nextlen) {
continue;
} else if (count < min_count) {
s.bl_tree[curlen * 2]/*.Freq*/ += count;
} else if (curlen !== 0) {
if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }
s.bl_tree[REP_3_6 * 2]/*.Freq*/++;
} else if (count <= 10) {
s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;
} else {
s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;
}
count = 0;
prevlen = curlen;
if (nextlen === 0) {
max_count = 138;
min_count = 3;
} else if (curlen === nextlen) {
max_count = 6;
min_count = 3;
} else {
max_count = 7;
min_count = 4;
}
}
}
/* ===========================================================================
* Send a literal or distance tree in compressed form, using the codes in
* bl_tree.
*/
function send_tree(s, tree, max_code)
// deflate_state *s;
// ct_data *tree; /* the tree to be scanned */
// int max_code; /* and its largest code of non zero frequency */
{
var n; /* iterates over all tree elements */
var prevlen = -1; /* last emitted length */
var curlen; /* length of current code */
var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */
var count = 0; /* repeat count of the current code */
var max_count = 7; /* max repeat count */
var min_count = 4; /* min repeat count */
/* tree[max_code+1].Len = -1; */ /* guard already set */
if (nextlen === 0) {
max_count = 138;
min_count = 3;
}
for (n = 0; n <= max_code; n++) {
curlen = nextlen;
nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;
if (++count < max_count && curlen === nextlen) {
continue;
} else if (count < min_count) {
do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);
} else if (curlen !== 0) {
if (curlen !== prevlen) {
send_code(s, curlen, s.bl_tree);
count--;
}
//Assert(count >= 3 && count <= 6, " 3_6?");
send_code(s, REP_3_6, s.bl_tree);
send_bits(s, count - 3, 2);
} else if (count <= 10) {
send_code(s, REPZ_3_10, s.bl_tree);
send_bits(s, count - 3, 3);
} else {
send_code(s, REPZ_11_138, s.bl_tree);
send_bits(s, count - 11, 7);
}
count = 0;
prevlen = curlen;
if (nextlen === 0) {
max_count = 138;
min_count = 3;
} else if (curlen === nextlen) {
max_count = 6;
min_count = 3;
} else {
max_count = 7;
min_count = 4;
}
}
}
/* ===========================================================================
* Construct the Huffman tree for the bit lengths and return the index in
* bl_order of the last bit length code to send.
*/
function build_bl_tree(s) {
var max_blindex; /* index of last bit length code of non zero freq */
/* Determine the bit length frequencies for literal and distance trees */
scan_tree(s, s.dyn_ltree, s.l_desc.max_code);
scan_tree(s, s.dyn_dtree, s.d_desc.max_code);
/* Build the bit length tree: */
build_tree(s, s.bl_desc);
/* opt_len now includes the length of the tree representations, except
* the lengths of the bit lengths codes and the 5+5+4 bits for the counts.
*/
/* Determine the number of bit length codes to send. The pkzip format
* requires that at least 4 bit length codes be sent. (appnote.txt says
* 3 but the actual value used is 4.)
*/
for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {
if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {
break;
}
}
/* Update opt_len to include the bit length tree and counts */
s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;
//Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld",
// s->opt_len, s->static_len));
return max_blindex;
}
/* ===========================================================================
* Send the header for a block using dynamic Huffman trees: the counts, the
* lengths of the bit length codes, the literal tree and the distance tree.
* IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.
*/
function send_all_trees(s, lcodes, dcodes, blcodes)
// deflate_state *s;
// int lcodes, dcodes, blcodes; /* number of codes for each tree */
{
var rank; /* index in bl_order */
//Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes");
//Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,
// "too many codes");
//Tracev((stderr, "\nbl counts: "));
send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */
send_bits(s, dcodes - 1, 5);
send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */
for (rank = 0; rank < blcodes; rank++) {
//Tracev((stderr, "\nbl code %2d ", bl_order[rank]));
send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);
}
//Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent));
send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */
//Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent));
send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */
//Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent));
}
/* ===========================================================================
* Check if the data type is TEXT or BINARY, using the following algorithm:
* - TEXT if the two conditions below are satisfied:
* a) There are no non-portable control characters belonging to the
* "black list" (0..6, 14..25, 28..31).
* b) There is at least one printable character belonging to the
* "white list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255).
* - BINARY otherwise.
* - The following partially-portable control characters form a
* "gray list" that is ignored in this detection algorithm:
* (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}).
* IN assertion: the fields Freq of dyn_ltree are set.
*/
function detect_data_type(s) {
/* black_mask is the bit mask of black-listed bytes
* set bits 0..6, 14..25, and 28..31
* 0xf3ffc07f = binary 11110011111111111100000001111111
*/
var black_mask = 0xf3ffc07f;
var n;
/* Check for non-textual ("black-listed") bytes. */
for (n = 0; n <= 31; n++, black_mask >>>= 1) {
if ((black_mask & 1) && (s.dyn_ltree[n * 2]/*.Freq*/ !== 0)) {
return Z_BINARY;
}
}
/* Check for textual ("white-listed") bytes. */
if (s.dyn_ltree[9 * 2]/*.Freq*/ !== 0 || s.dyn_ltree[10 * 2]/*.Freq*/ !== 0 ||
s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) {
return Z_TEXT;
}
for (n = 32; n < LITERALS; n++) {
if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) {
return Z_TEXT;
}
}
/* There are no "black-listed" or "white-listed" bytes:
* this stream either is empty or has tolerated ("gray-listed") bytes only.
*/
return Z_BINARY;
}
var static_init_done = false;
/* ===========================================================================
* Initialize the tree data structures for a new zlib stream.
*/
function _tr_init(s)
{
if (!static_init_done) {
tr_static_init();
static_init_done = true;
}
s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc);
s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc);
s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc);
s.bi_buf = 0;
s.bi_valid = 0;
/* Initialize the first block of the first file: */
init_block(s);
}
/* ===========================================================================
* Send a stored block
*/
function _tr_stored_block(s, buf, stored_len, last)
//DeflateState *s;
//charf *buf; /* input block */
//ulg stored_len; /* length of input block */
//int last; /* one if this is the last block for a file */
{
send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */
copy_block(s, buf, stored_len, true); /* with header */
}
/* ===========================================================================
* Send one empty static block to give enough lookahead for inflate.
* This takes 10 bits, of which 7 may remain in the bit buffer.
*/
function _tr_align(s) {
send_bits(s, STATIC_TREES << 1, 3);
send_code(s, END_BLOCK, static_ltree);
bi_flush(s);
}
/* ===========================================================================
* Determine the best encoding for the current block: dynamic trees, static
* trees or store, and output the encoded block to the zip file.
*/
function _tr_flush_block(s, buf, stored_len, last)
//DeflateState *s;
//charf *buf; /* input block, or NULL if too old */
//ulg stored_len; /* length of input block */
//int last; /* one if this is the last block for a file */
{
var opt_lenb, static_lenb; /* opt_len and static_len in bytes */
var max_blindex = 0; /* index of last bit length code of non zero freq */
/* Build the Huffman trees unless a stored block is forced */
if (s.level > 0) {
/* Check if the file is binary or text */
if (s.strm.data_type === Z_UNKNOWN) {
s.strm.data_type = detect_data_type(s);
}
/* Construct the literal and distance trees */
build_tree(s, s.l_desc);
// Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len,
// s->static_len));
build_tree(s, s.d_desc);
// Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len,
// s->static_len));
/* At this point, opt_len and static_len are the total bit lengths of
* the compressed block data, excluding the tree representations.
*/
/* Build the bit length tree for the above two trees, and get the index
* in bl_order of the last bit length code to send.
*/
max_blindex = build_bl_tree(s);
/* Determine the best encoding. Compute the block lengths in bytes. */
opt_lenb = (s.opt_len + 3 + 7) >>> 3;
static_lenb = (s.static_len + 3 + 7) >>> 3;
// Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ",
// opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,
// s->last_lit));
if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }
} else {
// Assert(buf != (char*)0, "lost buf");
opt_lenb = static_lenb = stored_len + 5; /* force a stored block */
}
if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {
/* 4: two words for the lengths */
/* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.
* Otherwise we can't have processed more than WSIZE input bytes since
* the last block flush, because compression would have been
* successful. If LIT_BUFSIZE <= WSIZE, it is never too late to
* transform a block into a stored block.
*/
_tr_stored_block(s, buf, stored_len, last);
} else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {
send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);
compress_block(s, static_ltree, static_dtree);
} else {
send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);
send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);
compress_block(s, s.dyn_ltree, s.dyn_dtree);
}
// Assert (s->compressed_len == s->bits_sent, "bad compressed size");
/* The above check is made mod 2^32, for files larger than 512 MB
* and uLong implemented on 32 bits.
*/
init_block(s);
if (last) {
bi_windup(s);
}
// Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3,
// s->compressed_len-7*last));
}
/* ===========================================================================
* Save the match info and tally the frequency counts. Return true if
* the current block must be flushed.
*/
function _tr_tally(s, dist, lc)
// deflate_state *s;
// unsigned dist; /* distance of matched string */
// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */
{
//var out_length, in_length, dcode;
s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;
s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;
s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;
s.last_lit++;
if (dist === 0) {
/* lc is the unmatched char */
s.dyn_ltree[lc * 2]/*.Freq*/++;
} else {
s.matches++;
/* Here, lc is the match length - MIN_MATCH */
dist--; /* dist = match distance - 1 */
//Assert((ush)dist < (ush)MAX_DIST(s) &&
// (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&
// (ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match");
s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;
s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;
}
// (!) This block is disabled in zlib defaults,
// don't enable it for binary compatibility
//#ifdef TRUNCATE_BLOCK
// /* Try to guess if it is profitable to stop the current block here */
// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {
// /* Compute an upper bound for the compressed length */
// out_length = s.last_lit*8;
// in_length = s.strstart - s.block_start;
//
// for (dcode = 0; dcode < D_CODES; dcode++) {
// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);
// }
// out_length >>>= 3;
// //Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ",
// // s->last_lit, in_length, out_length,
// // 100L - out_length*100L/in_length));
// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {
// return true;
// }
// }
//#endif
return (s.last_lit === s.lit_bufsize - 1);
/* We avoid equality with lit_bufsize because of wraparound at 64K
* on 16 bit machines and because stored blocks are restricted to
* 64K-1 bytes.
*/
}
exports._tr_init = _tr_init;
exports._tr_stored_block = _tr_stored_block;
exports._tr_flush_block = _tr_flush_block;
exports._tr_tally = _tr_tally;
exports._tr_align = _tr_align;
/***/ }),
/***/ 6442:
/***/ ((module) => {
"use strict";
// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
function ZStream() {
/* next input byte */
this.input = null; // JS specific, because we have no pointers
this.next_in = 0;
/* number of bytes available at input */
this.avail_in = 0;
/* total number of input bytes read so far */
this.total_in = 0;
/* next output byte should be put there */
this.output = null; // JS specific, because we have no pointers
this.next_out = 0;
/* remaining free space at output */
this.avail_out = 0;
/* total number of bytes output so far */
this.total_out = 0;
/* last error message, NULL if no error */
this.msg = ''/*Z_NULL*/;
/* not visible by applications */
this.state = null;
/* best guess about the data type: binary or text */
this.data_type = 2/*Z_UNKNOWN*/;
/* adler32 value of the uncompressed data */
this.adler = 0;
}
module.exports = ZStream;
/***/ }),
/***/ 5807:
/***/ ((module) => {
module.exports = function parseBMFontAscii(data) {
if (!data)
throw new Error('no data provided')
data = data.toString().trim()
var output = {
pages: [],
chars: [],
kernings: []
}
var lines = data.split(/\r\n?|\n/g)
if (lines.length === 0)
throw new Error('no data in BMFont file')
for (var i = 0; i < lines.length; i++) {
var lineData = splitLine(lines[i], i)
if (!lineData) //skip empty lines
continue
if (lineData.key === 'page') {
if (typeof lineData.data.id !== 'number')
throw new Error('malformed file at line ' + i + ' -- needs page id=N')
if (typeof lineData.data.file !== 'string')
throw new Error('malformed file at line ' + i + ' -- needs page file="path"')
output.pages[lineData.data.id] = lineData.data.file
} else if (lineData.key === 'chars' || lineData.key === 'kernings') {
//... do nothing for these two ...
} else if (lineData.key === 'char') {
output.chars.push(lineData.data)
} else if (lineData.key === 'kerning') {
output.kernings.push(lineData.data)
} else {
output[lineData.key] = lineData.data
}
}
return output
}
function splitLine(line, idx) {
line = line.replace(/\t+/g, ' ').trim()
if (!line)
return null
var space = line.indexOf(' ')
if (space === -1)
throw new Error("no named row at line " + idx)
var key = line.substring(0, space)
line = line.substring(space + 1)
//clear "letter" field as it is non-standard and
//requires additional complexity to parse " / = symbols
line = line.replace(/letter=[\'\"]\S+[\'\"]/gi, '')
line = line.split("=")
line = line.map(function(str) {
return str.trim().match((/(".*?"|[^"\s]+)+(?=\s*|\s*$)/g))
})
var data = []
for (var i = 0; i < line.length; i++) {
var dt = line[i]
if (i === 0) {
data.push({
key: dt[0],
data: ""
})
} else if (i === line.length - 1) {
data[data.length - 1].data = parseData(dt[0])
} else {
data[data.length - 1].data = parseData(dt[0])
data.push({
key: dt[1],
data: ""
})
}
}
var out = {
key: key,
data: {}
}
data.forEach(function(v) {
out.data[v.key] = v.data;
})
return out
}
function parseData(data) {
if (!data || data.length === 0)
return ""
if (data.indexOf('"') === 0 || data.indexOf("'") === 0)
return data.substring(1, data.length - 1)
if (data.indexOf(',') !== -1)
return parseIntList(data)
return parseInt(data, 10)
}
function parseIntList(data) {
return data.split(',').map(function(val) {
return parseInt(val, 10)
})
}
/***/ }),
/***/ 4563:
/***/ ((module) => {
var HEADER = [66, 77, 70]
module.exports = function readBMFontBinary(buf) {
if (buf.length < 6)
throw new Error('invalid buffer length for BMFont')
var header = HEADER.every(function(byte, i) {
return buf.readUInt8(i) === byte
})
if (!header)
throw new Error('BMFont missing BMF byte header')
var i = 3
var vers = buf.readUInt8(i++)
if (vers > 3)
throw new Error('Only supports BMFont Binary v3 (BMFont App v1.10)')
var target = { kernings: [], chars: [] }
for (var b=0; b<5; b++)
i += readBlock(target, buf, i)
return target
}
function readBlock(target, buf, i) {
if (i > buf.length-1)
return 0
var blockID = buf.readUInt8(i++)
var blockSize = buf.readInt32LE(i)
i += 4
switch(blockID) {
case 1:
target.info = readInfo(buf, i)
break
case 2:
target.common = readCommon(buf, i)
break
case 3:
target.pages = readPages(buf, i, blockSize)
break
case 4:
target.chars = readChars(buf, i, blockSize)
break
case 5:
target.kernings = readKernings(buf, i, blockSize)
break
}
return 5 + blockSize
}
function readInfo(buf, i) {
var info = {}
info.size = buf.readInt16LE(i)
var bitField = buf.readUInt8(i+2)
info.smooth = (bitField >> 7) & 1
info.unicode = (bitField >> 6) & 1
info.italic = (bitField >> 5) & 1
info.bold = (bitField >> 4) & 1
//fixedHeight is only mentioned in binary spec
if ((bitField >> 3) & 1)
info.fixedHeight = 1
info.charset = buf.readUInt8(i+3) || ''
info.stretchH = buf.readUInt16LE(i+4)
info.aa = buf.readUInt8(i+6)
info.padding = [
buf.readInt8(i+7),
buf.readInt8(i+8),
buf.readInt8(i+9),
buf.readInt8(i+10)
]
info.spacing = [
buf.readInt8(i+11),
buf.readInt8(i+12)
]
info.outline = buf.readUInt8(i+13)
info.face = readStringNT(buf, i+14)
return info
}
function readCommon(buf, i) {
var common = {}
common.lineHeight = buf.readUInt16LE(i)
common.base = buf.readUInt16LE(i+2)
common.scaleW = buf.readUInt16LE(i+4)
common.scaleH = buf.readUInt16LE(i+6)
common.pages = buf.readUInt16LE(i+8)
var bitField = buf.readUInt8(i+10)
common.packed = 0
common.alphaChnl = buf.readUInt8(i+11)
common.redChnl = buf.readUInt8(i+12)
common.greenChnl = buf.readUInt8(i+13)
common.blueChnl = buf.readUInt8(i+14)
return common
}
function readPages(buf, i, size) {
var pages = []
var text = readNameNT(buf, i)
var len = text.length+1
var count = size / len
for (var c=0; c<count; c++) {
pages[c] = buf.slice(i, i+text.length).toString('utf8')
i += len
}
return pages
}
function readChars(buf, i, blockSize) {
var chars = []
var count = blockSize / 20
for (var c=0; c<count; c++) {
var char = {}
var off = c*20
char.id = buf.readUInt32LE(i + 0 + off)
char.x = buf.readUInt16LE(i + 4 + off)
char.y = buf.readUInt16LE(i + 6 + off)
char.width = buf.readUInt16LE(i + 8 + off)
char.height = buf.readUInt16LE(i + 10 + off)
char.xoffset = buf.readInt16LE(i + 12 + off)
char.yoffset = buf.readInt16LE(i + 14 + off)
char.xadvance = buf.readInt16LE(i + 16 + off)
char.page = buf.readUInt8(i + 18 + off)
char.chnl = buf.readUInt8(i + 19 + off)
chars[c] = char
}
return chars
}
function readKernings(buf, i, blockSize) {
var kernings = []
var count = blockSize / 10
for (var c=0; c<count; c++) {
var kern = {}
var off = c*10
kern.first = buf.readUInt32LE(i + 0 + off)
kern.second = buf.readUInt32LE(i + 4 + off)
kern.amount = buf.readInt16LE(i + 8 + off)
kernings[c] = kern
}
return kernings
}
function readNameNT(buf, offset) {
var pos=offset
for (; pos<buf.length; pos++) {
if (buf[pos] === 0x00)
break
}
return buf.slice(offset, pos)
}
function readStringNT(buf, offset) {
return readNameNT(buf, offset).toString('utf8')
}
/***/ }),
/***/ 1199:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
var xml2js = __nccwpck_require__(6189)
var parseAttributes = __nccwpck_require__(820)
module.exports = function parseBMFontXML(data) {
data = data.toString().trim()
var output = {
pages: [],
chars: [],
kernings: []
}
xml2js.parseString(data, function(err, result) {
if (err)
throw err
if (!result.font)
throw "XML bitmap font doesn't have <font> root"
result = result.font
output.common = parseAttributes(result.common[0].$)
output.info = parseAttributes(result.info[0].$)
for (var i = 0; i < result.pages.length; i++) {
var p = result.pages[i].page[0].$
if (typeof p.id === "undefined")
throw new Error("malformed file -- needs page id=N")
if (typeof p.file !== "string")
throw new Error("malformed file -- needs page file=\"path\"")
output.pages[parseInt(p.id, 10)] = p.file
}
if (result.chars) {
var chrArray = result.chars[0]['char'] || []
for (var i = 0; i < chrArray.length; i++) {
output.chars.push(parseAttributes(chrArray[i].$))
}
}
if (result.kernings) {
var kernArray = result.kernings[0]['kerning'] || []
for (var i = 0; i < kernArray.length; i++) {
output.kernings.push(parseAttributes(kernArray[i].$))
}
}
})
return output
}
/***/ }),
/***/ 820:
/***/ ((module) => {
//Some versions of GlyphDesigner have a typo
//that causes some bugs with parsing.
//Need to confirm with recent version of the software
//to see whether this is still an issue or not.
var GLYPH_DESIGNER_ERROR = 'chasrset'
module.exports = function parseAttributes(obj) {
if (GLYPH_DESIGNER_ERROR in obj) {
obj['charset'] = obj[GLYPH_DESIGNER_ERROR]
delete obj[GLYPH_DESIGNER_ERROR]
}
for (var k in obj) {
if (k === 'face' || k === 'charset')
continue
else if (k === 'padding' || k === 'spacing')
obj[k] = parseIntList(obj[k])
else
obj[k] = parseInt(obj[k], 10)
}
return obj
}
function parseIntList(data) {
return data.split(',').map(function(val) {
return parseInt(val, 10)
})
}
/***/ }),
/***/ 8734:
/***/ ((__unused_webpack_module, exports) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.Deferred = void 0;
class Deferred {
constructor() {
this.resolve = () => null;
this.reject = () => null;
this.promise = new Promise((resolve, reject) => {
this.reject = reject;
this.resolve = resolve;
});
}
}
exports.Deferred = Deferred;
/***/ }),
/***/ 7770:
/***/ ((__unused_webpack_module, exports) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.EndOfStreamError = exports.defaultMessages = void 0;
exports.defaultMessages = 'End-Of-Stream';
/**
* Thrown on read operation of the end of file or stream has been reached
*/
class EndOfStreamError extends Error {
constructor() {
super(exports.defaultMessages);
}
}
exports.EndOfStreamError = EndOfStreamError;
/***/ }),
/***/ 5696:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.StreamReader = exports.EndOfStreamError = void 0;
const EndOfFileStream_1 = __nccwpck_require__(7770);
const Deferred_1 = __nccwpck_require__(8734);
var EndOfFileStream_2 = __nccwpck_require__(7770);
Object.defineProperty(exports, "EndOfStreamError", ({ enumerable: true, get: function () { return EndOfFileStream_2.EndOfStreamError; } }));
const maxStreamReadSize = 1 * 1024 * 1024; // Maximum request length on read-stream operation
class StreamReader {
constructor(s) {
this.s = s;
/**
* Deferred used for postponed read request (as not data is yet available to read)
*/
this.deferred = null;
this.endOfStream = false;
/**
* Store peeked data
* @type {Array}
*/
this.peekQueue = [];
if (!s.read || !s.once) {
throw new Error('Expected an instance of stream.Readable');
}
this.s.once('end', () => this.reject(new EndOfFileStream_1.EndOfStreamError()));
this.s.once('error', err => this.reject(err));
this.s.once('close', () => this.reject(new Error('Stream closed')));
}
/**
* Read ahead (peek) from stream. Subsequent read or peeks will return the same data
* @param uint8Array - Uint8Array (or Buffer) to store data read from stream in
* @param offset - Offset target
* @param length - Number of bytes to read
* @returns Number of bytes peeked
*/
async peek(uint8Array, offset, length) {
const bytesRead = await this.read(uint8Array, offset, length);
this.peekQueue.push(uint8Array.subarray(offset, offset + bytesRead)); // Put read data back to peek buffer
return bytesRead;
}
/**
* Read chunk from stream
* @param buffer - Target Uint8Array (or Buffer) to store data read from stream in
* @param offset - Offset target
* @param length - Number of bytes to read
* @returns Number of bytes read
*/
async read(buffer, offset, length) {
if (length === 0) {
return 0;
}
if (this.peekQueue.length === 0 && this.endOfStream) {
throw new EndOfFileStream_1.EndOfStreamError();
}
let remaining = length;
let bytesRead = 0;
// consume peeked data first
while (this.peekQueue.length > 0 && remaining > 0) {
const peekData = this.peekQueue.pop(); // Front of queue
if (!peekData)
throw new Error('peekData should be defined');
const lenCopy = Math.min(peekData.length, remaining);
buffer.set(peekData.subarray(0, lenCopy), offset + bytesRead);
bytesRead += lenCopy;
remaining -= lenCopy;
if (lenCopy < peekData.length) {
// remainder back to queue
this.peekQueue.push(peekData.subarray(lenCopy));
}
}
// continue reading from stream if required
while (remaining > 0 && !this.endOfStream) {
const reqLen = Math.min(remaining, maxStreamReadSize);
const chunkLen = await this.readFromStream(buffer, offset + bytesRead, reqLen);
bytesRead += chunkLen;
if (chunkLen < reqLen)
break;
remaining -= chunkLen;
}
return bytesRead;
}
/**
* Read chunk from stream
* @param buffer Target Uint8Array (or Buffer) to store data read from stream in
* @param offset Offset target
* @param length Number of bytes to read
* @returns Number of bytes read
*/
async readFromStream(buffer, offset, length) {
const readBuffer = this.s.read(length);
if (readBuffer) {
buffer.set(readBuffer, offset);
return readBuffer.length;
}
else {
const request = {
buffer,
offset,
length,
deferred: new Deferred_1.Deferred()
};
this.deferred = request.deferred;
this.s.once('readable', () => {
this.readDeferred(request);
});
return request.deferred.promise;
}
}
/**
* Process deferred read request
* @param request Deferred read request
*/
readDeferred(request) {
const readBuffer = this.s.read(request.length);
if (readBuffer) {
request.buffer.set(readBuffer, request.offset);
request.deferred.resolve(readBuffer.length);
this.deferred = null;
}
else {
this.s.once('readable', () => {
this.readDeferred(request);
});
}
}
reject(err) {
this.endOfStream = true;
if (this.deferred) {
this.deferred.reject(err);
this.deferred = null;
}
}
}
exports.StreamReader = StreamReader;
/***/ }),
/***/ 3752:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.StreamReader = exports.EndOfStreamError = void 0;
var EndOfFileStream_1 = __nccwpck_require__(7770);
Object.defineProperty(exports, "EndOfStreamError", ({ enumerable: true, get: function () { return EndOfFileStream_1.EndOfStreamError; } }));
var StreamReader_1 = __nccwpck_require__(5696);
Object.defineProperty(exports, "StreamReader", ({ enumerable: true, get: function () { return StreamReader_1.StreamReader; } }));
/***/ }),
/***/ 6130:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
"use strict";
var _typeof=typeof Symbol==='function'&&typeof Symbol.iterator==='symbol'?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==='function'&&obj.constructor===Symbol&&obj!==Symbol.prototype?'symbol':typeof obj};var http=__nccwpck_require__(3685);var https=__nccwpck_require__(5687);var url=__nccwpck_require__(7310);var qs=__nccwpck_require__(3477);var zlib=__nccwpck_require__(9796);var util=__nccwpck_require__(3837);var phin=function phin(opts,cb){if(typeof opts!=='string'){if(!opts.hasOwnProperty('url')){throw new Error('Missing url option from options for request method.')}}var addr=(typeof opts==='undefined'?'undefined':_typeof(opts))==='object'?url.parse(opts.url):url.parse(opts);var options={'hostname':addr.hostname,'port':addr.port||(addr.protocol.toLowerCase()==='http:'?80:443),'path':addr.path,'method':'GET','headers':{},'auth':addr.auth||null,'parse':'none','stream':false};if((typeof opts==='undefined'?'undefined':_typeof(opts))==='object'){options=Object.assign(options,opts)}options.port=Number(options.port);if(options.hasOwnProperty('timeout'))delete options.timeout;if(options.compressed===true){options.headers['accept-encoding']='gzip, deflate'}if(opts.hasOwnProperty('form')){if(_typeof(opts.form)!=='object'){throw new Error('phin \'form\' option must be of type Object if present.')}var formDataString=qs.stringify(opts.form);options.headers['Content-Type']='application/x-www-form-urlencoded';options.headers['Content-Length']=Buffer.byteLength(formDataString);opts.data=formDataString}var req=void 0;var resHandler=function resHandler(res){var stream=res;if(options.compressed===true){if(res.headers['content-encoding']==='gzip'){stream=res.pipe(zlib.createGunzip())}else if(res.headers['content-encoding']==='deflate'){stream=res.pipe(zlib.createInflate())}}if(options.stream===true){res.stream=stream;if(cb)cb(null,res)}else{res.body=new Buffer([]);stream.on('data',function(chunk){res.body=Buffer.concat([res.body,chunk])});stream.on('end',function(){if(cb){if(options.parse==='json'){try{res.body=JSON.parse(res.body.toString())}catch(err){cb('Invalid JSON received.',res);return}}cb(null,res)}})}};switch(addr.protocol.toLowerCase()){case'http:':req=http.request(options,resHandler);break;case'https:':req=https.request(options,resHandler);break;default:if(cb)cb(new Error('Invalid / unknown URL protocol. Expected HTTP or HTTPS.'),null);return;}if(typeof opts.timeout==='number'){req.setTimeout(opts.timeout,function(){req.abort();if(cb)cb(new Error('Timeout has been reached.'),null);cb=null})}req.on('error',function(err){if(cb)cb(err,null)});if(opts.hasOwnProperty('data')){var postData=opts.data;if(!(opts.data instanceof Buffer)&&_typeof(opts.data)==='object'){var contentType=options.headers['content-type']||options.headers['Content-Type'];if(contentType==='application/x-www-form-urlencoded'){postData=qs.stringify(opts.data)}else{try{postData=JSON.stringify(opts.data)}catch(err){if(cb)cb(new Error('Couldn\'t stringify object. (Likely due to a circular reference.)'),null)}}}req.write(postData)}req.end()};phin.promisified=function(opts,http){return new Promise(function(resolve,reject){phin(opts,function(err,res){if(err){reject(err)}else{resolve(res)}},http)})};if(util.promisify){phin[util.promisify.custom]=phin.promisified}module.exports=phin;
/***/ }),
/***/ 6097:
/***/ ((module) => {
"use strict";
module.exports = pixelmatch;
function pixelmatch(img1, img2, output, width, height, options) {
if (!options) options = {};
var threshold = options.threshold === undefined ? 0.1 : options.threshold;
// maximum acceptable square distance between two colors;
// 35215 is the maximum possible value for the YIQ difference metric
var maxDelta = 35215 * threshold * threshold,
diff = 0;
// compare each pixel of one image against the other one
for (var y = 0; y < height; y++) {
for (var x = 0; x < width; x++) {
var pos = (y * width + x) * 4;
// squared YUV distance between colors at this pixel position
var delta = colorDelta(img1, img2, pos, pos);
// the color difference is above the threshold
if (delta > maxDelta) {
// check it's a real rendering difference or just anti-aliasing
if (!options.includeAA && (antialiased(img1, x, y, width, height, img2) ||
antialiased(img2, x, y, width, height, img1))) {
// one of the pixels is anti-aliasing; draw as yellow and do not count as difference
if (output) drawPixel(output, pos, 255, 255, 0);
} else {
// found substantial difference not caused by anti-aliasing; draw it as red
if (output) drawPixel(output, pos, 255, 0, 0);
diff++;
}
} else if (output) {
// pixels are similar; draw background as grayscale image blended with white
var val = blend(grayPixel(img1, pos), 0.1);
drawPixel(output, pos, val, val, val);
}
}
}
// return the number of different pixels
return diff;
}
// check if a pixel is likely a part of anti-aliasing;
// based on "Anti-aliased Pixel and Intensity Slope Detector" paper by V. Vysniauskas, 2009
function antialiased(img, x1, y1, width, height, img2) {
var x0 = Math.max(x1 - 1, 0),
y0 = Math.max(y1 - 1, 0),
x2 = Math.min(x1 + 1, width - 1),
y2 = Math.min(y1 + 1, height - 1),
pos = (y1 * width + x1) * 4,
zeroes = 0,
positives = 0,
negatives = 0,
min = 0,
max = 0,
minX, minY, maxX, maxY;
// go through 8 adjacent pixels
for (var x = x0; x <= x2; x++) {
for (var y = y0; y <= y2; y++) {
if (x === x1 && y === y1) continue;
// brightness delta between the center pixel and adjacent one
var delta = colorDelta(img, img, pos, (y * width + x) * 4, true);
// count the number of equal, darker and brighter adjacent pixels
if (delta === 0) zeroes++;
else if (delta < 0) negatives++;
else if (delta > 0) positives++;
// if found more than 2 equal siblings, it's definitely not anti-aliasing
if (zeroes > 2) return false;
if (!img2) continue;
// remember the darkest pixel
if (delta < min) {
min = delta;
minX = x;
minY = y;
}
// remember the brightest pixel
if (delta > max) {
max = delta;
maxX = x;
maxY = y;
}
}
}
if (!img2) return true;
// if there are no both darker and brighter pixels among siblings, it's not anti-aliasing
if (negatives === 0 || positives === 0) return false;
// if either the darkest or the brightest pixel has more than 2 equal siblings in both images
// (definitely not anti-aliased), this pixel is anti-aliased
return (!antialiased(img, minX, minY, width, height) && !antialiased(img2, minX, minY, width, height)) ||
(!antialiased(img, maxX, maxY, width, height) && !antialiased(img2, maxX, maxY, width, height));
}
// calculate color difference according to the paper "Measuring perceived color difference
// using YIQ NTSC transmission color space in mobile applications" by Y. Kotsarenko and F. Ramos
function colorDelta(img1, img2, k, m, yOnly) {
var a1 = img1[k + 3] / 255,
a2 = img2[m + 3] / 255,
r1 = blend(img1[k + 0], a1),
g1 = blend(img1[k + 1], a1),
b1 = blend(img1[k + 2], a1),
r2 = blend(img2[m + 0], a2),
g2 = blend(img2[m + 1], a2),
b2 = blend(img2[m + 2], a2),
y = rgb2y(r1, g1, b1) - rgb2y(r2, g2, b2);
if (yOnly) return y; // brightness difference only
var i = rgb2i(r1, g1, b1) - rgb2i(r2, g2, b2),
q = rgb2q(r1, g1, b1) - rgb2q(r2, g2, b2);
return 0.5053 * y * y + 0.299 * i * i + 0.1957 * q * q;
}
function rgb2y(r, g, b) { return r * 0.29889531 + g * 0.58662247 + b * 0.11448223; }
function rgb2i(r, g, b) { return r * 0.59597799 - g * 0.27417610 - b * 0.32180189; }
function rgb2q(r, g, b) { return r * 0.21147017 - g * 0.52261711 + b * 0.31114694; }
// blend semi-transparent color with white
function blend(c, a) {
return 255 + (c - 255) * a;
}
function drawPixel(output, pos, r, g, b) {
output[pos + 0] = r;
output[pos + 1] = g;
output[pos + 2] = b;
output[pos + 3] = 255;
}
function grayPixel(img, i) {
var a = img[i + 3] / 255,
r = blend(img[i + 0], a),
g = blend(img[i + 1], a),
b = blend(img[i + 2], a);
return rgb2y(r, g, b);
}
/***/ }),
/***/ 2021:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
let interlaceUtils = __nccwpck_require__(3365);
let pixelBppMapper = [
// 0 - dummy entry
function () {},
// 1 - L
// 0: 0, 1: 0, 2: 0, 3: 0xff
function (pxData, data, pxPos, rawPos) {
if (rawPos === data.length) {
throw new Error("Ran out of data");
}
let pixel = data[rawPos];
pxData[pxPos] = pixel;
pxData[pxPos + 1] = pixel;
pxData[pxPos + 2] = pixel;
pxData[pxPos + 3] = 0xff;
},
// 2 - LA
// 0: 0, 1: 0, 2: 0, 3: 1
function (pxData, data, pxPos, rawPos) {
if (rawPos + 1 >= data.length) {
throw new Error("Ran out of data");
}
let pixel = data[rawPos];
pxData[pxPos] = pixel;
pxData[pxPos + 1] = pixel;
pxData[pxPos + 2] = pixel;
pxData[pxPos + 3] = data[rawPos + 1];
},
// 3 - RGB
// 0: 0, 1: 1, 2: 2, 3: 0xff
function (pxData, data, pxPos, rawPos) {
if (rawPos + 2 >= data.length) {
throw new Error("Ran out of data");
}
pxData[pxPos] = data[rawPos];
pxData[pxPos + 1] = data[rawPos + 1];
pxData[pxPos + 2] = data[rawPos + 2];
pxData[pxPos + 3] = 0xff;
},
// 4 - RGBA
// 0: 0, 1: 1, 2: 2, 3: 3
function (pxData, data, pxPos, rawPos) {
if (rawPos + 3 >= data.length) {
throw new Error("Ran out of data");
}
pxData[pxPos] = data[rawPos];
pxData[pxPos + 1] = data[rawPos + 1];
pxData[pxPos + 2] = data[rawPos + 2];
pxData[pxPos + 3] = data[rawPos + 3];
},
];
let pixelBppCustomMapper = [
// 0 - dummy entry
function () {},
// 1 - L
// 0: 0, 1: 0, 2: 0, 3: 0xff
function (pxData, pixelData, pxPos, maxBit) {
let pixel = pixelData[0];
pxData[pxPos] = pixel;
pxData[pxPos + 1] = pixel;
pxData[pxPos + 2] = pixel;
pxData[pxPos + 3] = maxBit;
},
// 2 - LA
// 0: 0, 1: 0, 2: 0, 3: 1
function (pxData, pixelData, pxPos) {
let pixel = pixelData[0];
pxData[pxPos] = pixel;
pxData[pxPos + 1] = pixel;
pxData[pxPos + 2] = pixel;
pxData[pxPos + 3] = pixelData[1];
},
// 3 - RGB
// 0: 0, 1: 1, 2: 2, 3: 0xff
function (pxData, pixelData, pxPos, maxBit) {
pxData[pxPos] = pixelData[0];
pxData[pxPos + 1] = pixelData[1];
pxData[pxPos + 2] = pixelData[2];
pxData[pxPos + 3] = maxBit;
},
// 4 - RGBA
// 0: 0, 1: 1, 2: 2, 3: 3
function (pxData, pixelData, pxPos) {
pxData[pxPos] = pixelData[0];
pxData[pxPos + 1] = pixelData[1];
pxData[pxPos + 2] = pixelData[2];
pxData[pxPos + 3] = pixelData[3];
},
];
function bitRetriever(data, depth) {
let leftOver = [];
let i = 0;
function split() {
if (i === data.length) {
throw new Error("Ran out of data");
}
let byte = data[i];
i++;
let byte8, byte7, byte6, byte5, byte4, byte3, byte2, byte1;
switch (depth) {
default:
throw new Error("unrecognised depth");
case 16:
byte2 = data[i];
i++;
leftOver.push((byte << 8) + byte2);
break;
case 4:
byte2 = byte & 0x0f;
byte1 = byte >> 4;
leftOver.push(byte1, byte2);
break;
case 2:
byte4 = byte & 3;
byte3 = (byte >> 2) & 3;
byte2 = (byte >> 4) & 3;
byte1 = (byte >> 6) & 3;
leftOver.push(byte1, byte2, byte3, byte4);
break;
case 1:
byte8 = byte & 1;
byte7 = (byte >> 1) & 1;
byte6 = (byte >> 2) & 1;
byte5 = (byte >> 3) & 1;
byte4 = (byte >> 4) & 1;
byte3 = (byte >> 5) & 1;
byte2 = (byte >> 6) & 1;
byte1 = (byte >> 7) & 1;
leftOver.push(byte1, byte2, byte3, byte4, byte5, byte6, byte7, byte8);
break;
}
}
return {
get: function (count) {
while (leftOver.length < count) {
split();
}
let returner = leftOver.slice(0, count);
leftOver = leftOver.slice(count);
return returner;
},
resetAfterLine: function () {
leftOver.length = 0;
},
end: function () {
if (i !== data.length) {
throw new Error("extra data found");
}
},
};
}
function mapImage8Bit(image, pxData, getPxPos, bpp, data, rawPos) {
// eslint-disable-line max-params
let imageWidth = image.width;
let imageHeight = image.height;
let imagePass = image.index;
for (let y = 0; y < imageHeight; y++) {
for (let x = 0; x < imageWidth; x++) {
let pxPos = getPxPos(x, y, imagePass);
pixelBppMapper[bpp](pxData, data, pxPos, rawPos);
rawPos += bpp; //eslint-disable-line no-param-reassign
}
}
return rawPos;
}
function mapImageCustomBit(image, pxData, getPxPos, bpp, bits, maxBit) {
// eslint-disable-line max-params
let imageWidth = image.width;
let imageHeight = image.height;
let imagePass = image.index;
for (let y = 0; y < imageHeight; y++) {
for (let x = 0; x < imageWidth; x++) {
let pixelData = bits.get(bpp);
let pxPos = getPxPos(x, y, imagePass);
pixelBppCustomMapper[bpp](pxData, pixelData, pxPos, maxBit);
}
bits.resetAfterLine();
}
}
exports.dataToBitMap = function (data, bitmapInfo) {
let width = bitmapInfo.width;
let height = bitmapInfo.height;
let depth = bitmapInfo.depth;
let bpp = bitmapInfo.bpp;
let interlace = bitmapInfo.interlace;
let bits;
if (depth !== 8) {
bits = bitRetriever(data, depth);
}
let pxData;
if (depth <= 8) {
pxData = Buffer.alloc(width * height * 4);
} else {
pxData = new Uint16Array(width * height * 4);
}
let maxBit = Math.pow(2, depth) - 1;
let rawPos = 0;
let images;
let getPxPos;
if (interlace) {
images = interlaceUtils.getImagePasses(width, height);
getPxPos = interlaceUtils.getInterlaceIterator(width, height);
} else {
let nonInterlacedPxPos = 0;
getPxPos = function () {
let returner = nonInterlacedPxPos;
nonInterlacedPxPos += 4;
return returner;
};
images = [{ width: width, height: height }];
}
for (let imageIndex = 0; imageIndex < images.length; imageIndex++) {
if (depth === 8) {
rawPos = mapImage8Bit(
images[imageIndex],
pxData,
getPxPos,
bpp,
data,
rawPos
);
} else {
mapImageCustomBit(
images[imageIndex],
pxData,
getPxPos,
bpp,
bits,
maxBit
);
}
}
if (depth === 8) {
if (rawPos !== data.length) {
throw new Error("extra data found");
}
} else {
bits.end();
}
return pxData;
};
/***/ }),
/***/ 6659:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
"use strict";
let constants = __nccwpck_require__(3316);
module.exports = function (dataIn, width, height, options) {
let outHasAlpha =
[constants.COLORTYPE_COLOR_ALPHA, constants.COLORTYPE_ALPHA].indexOf(
options.colorType
) !== -1;
if (options.colorType === options.inputColorType) {
let bigEndian = (function () {
let buffer = new ArrayBuffer(2);
new DataView(buffer).setInt16(0, 256, true /* littleEndian */);
// Int16Array uses the platform's endianness.
return new Int16Array(buffer)[0] !== 256;
})();
// If no need to convert to grayscale and alpha is present/absent in both, take a fast route
if (options.bitDepth === 8 || (options.bitDepth === 16 && bigEndian)) {
return dataIn;
}
}
// map to a UInt16 array if data is 16bit, fix endianness below
let data = options.bitDepth !== 16 ? dataIn : new Uint16Array(dataIn.buffer);
let maxValue = 255;
let inBpp = constants.COLORTYPE_TO_BPP_MAP[options.inputColorType];
if (inBpp === 4 && !options.inputHasAlpha) {
inBpp = 3;
}
let outBpp = constants.COLORTYPE_TO_BPP_MAP[options.colorType];
if (options.bitDepth === 16) {
maxValue = 65535;
outBpp *= 2;
}
let outData = Buffer.alloc(width * height * outBpp);
let inIndex = 0;
let outIndex = 0;
let bgColor = options.bgColor || {};
if (bgColor.red === undefined) {
bgColor.red = maxValue;
}
if (bgColor.green === undefined) {
bgColor.green = maxValue;
}
if (bgColor.blue === undefined) {
bgColor.blue = maxValue;
}
function getRGBA() {
let red;
let green;
let blue;
let alpha = maxValue;
switch (options.inputColorType) {
case constants.COLORTYPE_COLOR_ALPHA:
alpha = data[inIndex + 3];
red = data[inIndex];
green = data[inIndex + 1];
blue = data[inIndex + 2];
break;
case constants.COLORTYPE_COLOR:
red = data[inIndex];
green = data[inIndex + 1];
blue = data[inIndex + 2];
break;
case constants.COLORTYPE_ALPHA:
alpha = data[inIndex + 1];
red = data[inIndex];
green = red;
blue = red;
break;
case constants.COLORTYPE_GRAYSCALE:
red = data[inIndex];
green = red;
blue = red;
break;
default:
throw new Error(
"input color type:" +
options.inputColorType +
" is not supported at present"
);
}
if (options.inputHasAlpha) {
if (!outHasAlpha) {
alpha /= maxValue;
red = Math.min(
Math.max(Math.round((1 - alpha) * bgColor.red + alpha * red), 0),
maxValue
);
green = Math.min(
Math.max(Math.round((1 - alpha) * bgColor.green + alpha * green), 0),
maxValue
);
blue = Math.min(
Math.max(Math.round((1 - alpha) * bgColor.blue + alpha * blue), 0),
maxValue
);
}
}
return { red: red, green: green, blue: blue, alpha: alpha };
}
for (let y = 0; y < height; y++) {
for (let x = 0; x < width; x++) {
let rgba = getRGBA(data, inIndex);
switch (options.colorType) {
case constants.COLORTYPE_COLOR_ALPHA:
case constants.COLORTYPE_COLOR:
if (options.bitDepth === 8) {
outData[outIndex] = rgba.red;
outData[outIndex + 1] = rgba.green;
outData[outIndex + 2] = rgba.blue;
if (outHasAlpha) {
outData[outIndex + 3] = rgba.alpha;
}
} else {
outData.writeUInt16BE(rgba.red, outIndex);
outData.writeUInt16BE(rgba.green, outIndex + 2);
outData.writeUInt16BE(rgba.blue, outIndex + 4);
if (outHasAlpha) {
outData.writeUInt16BE(rgba.alpha, outIndex + 6);
}
}
break;
case constants.COLORTYPE_ALPHA:
case constants.COLORTYPE_GRAYSCALE: {
// Convert to grayscale and alpha
let grayscale = (rgba.red + rgba.green + rgba.blue) / 3;
if (options.bitDepth === 8) {
outData[outIndex] = grayscale;
if (outHasAlpha) {
outData[outIndex + 1] = rgba.alpha;
}
} else {
outData.writeUInt16BE(grayscale, outIndex);
if (outHasAlpha) {
outData.writeUInt16BE(rgba.alpha, outIndex + 2);
}
}
break;
}
default:
throw new Error("unrecognised color Type " + options.colorType);
}
inIndex += inBpp;
outIndex += outBpp;
}
}
return outData;
};
/***/ }),
/***/ 4036:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
"use strict";
let util = __nccwpck_require__(3837);
let Stream = __nccwpck_require__(2781);
let ChunkStream = (module.exports = function () {
Stream.call(this);
this._buffers = [];
this._buffered = 0;
this._reads = [];
this._paused = false;
this._encoding = "utf8";
this.writable = true;
});
util.inherits(ChunkStream, Stream);
ChunkStream.prototype.read = function (length, callback) {
this._reads.push({
length: Math.abs(length), // if length < 0 then at most this length
allowLess: length < 0,
func: callback,
});
process.nextTick(
function () {
this._process();
// its paused and there is not enought data then ask for more
if (this._paused && this._reads && this._reads.length > 0) {
this._paused = false;
this.emit("drain");
}
}.bind(this)
);
};
ChunkStream.prototype.write = function (data, encoding) {
if (!this.writable) {
this.emit("error", new Error("Stream not writable"));
return false;
}
let dataBuffer;
if (Buffer.isBuffer(data)) {
dataBuffer = data;
} else {
dataBuffer = Buffer.from(data, encoding || this._encoding);
}
this._buffers.push(dataBuffer);
this._buffered += dataBuffer.length;
this._process();
// ok if there are no more read requests
if (this._reads && this._reads.length === 0) {
this._paused = true;
}
return this.writable && !this._paused;
};
ChunkStream.prototype.end = function (data, encoding) {
if (data) {
this.write(data, encoding);
}
this.writable = false;
// already destroyed
if (!this._buffers) {
return;
}
// enqueue or handle end
if (this._buffers.length === 0) {
this._end();
} else {
this._buffers.push(null);
this._process();
}
};
ChunkStream.prototype.destroySoon = ChunkStream.prototype.end;
ChunkStream.prototype._end = function () {
if (this._reads.length > 0) {
this.emit("error", new Error("Unexpected end of input"));
}
this.destroy();
};
ChunkStream.prototype.destroy = function () {
if (!this._buffers) {
return;
}
this.writable = false;
this._reads = null;
this._buffers = null;
this.emit("close");
};
ChunkStream.prototype._processReadAllowingLess = function (read) {
// ok there is any data so that we can satisfy this request
this._reads.shift(); // == read
// first we need to peek into first buffer
let smallerBuf = this._buffers[0];
// ok there is more data than we need
if (smallerBuf.length > read.length) {
this._buffered -= read.length;
this._buffers[0] = smallerBuf.slice(read.length);
read.func.call(this, smallerBuf.slice(0, read.length));
} else {
// ok this is less than maximum length so use it all
this._buffered -= smallerBuf.length;
this._buffers.shift(); // == smallerBuf
read.func.call(this, smallerBuf);
}
};
ChunkStream.prototype._processRead = function (read) {
this._reads.shift(); // == read
let pos = 0;
let count = 0;
let data = Buffer.alloc(read.length);
// create buffer for all data
while (pos < read.length) {
let buf = this._buffers[count++];
let len = Math.min(buf.length, read.length - pos);
buf.copy(data, pos, 0, len);
pos += len;
// last buffer wasn't used all so just slice it and leave
if (len !== buf.length) {
this._buffers[--count] = buf.slice(len);
}
}
// remove all used buffers
if (count > 0) {
this._buffers.splice(0, count);
}
this._buffered -= read.length;
read.func.call(this, data);
};
ChunkStream.prototype._process = function () {
try {
// as long as there is any data and read requests
while (this._buffered > 0 && this._reads && this._reads.length > 0) {
let read = this._reads[0];
// read any data (but no more than length)
if (read.allowLess) {
this._processReadAllowingLess(read);
} else if (this._buffered >= read.length) {
// ok we can meet some expectations
this._processRead(read);
} else {
// not enought data to satisfy first request in queue
// so we need to wait for more
break;
}
}
if (this._buffers && !this.writable) {
this._end();
}
} catch (ex) {
this.emit("error", ex);
}
};
/***/ }),
/***/ 3316:
/***/ ((module) => {
"use strict";
module.exports = {
PNG_SIGNATURE: [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a],
TYPE_IHDR: 0x49484452,
TYPE_IEND: 0x49454e44,
TYPE_IDAT: 0x49444154,
TYPE_PLTE: 0x504c5445,
TYPE_tRNS: 0x74524e53, // eslint-disable-line camelcase
TYPE_gAMA: 0x67414d41, // eslint-disable-line camelcase
// color-type bits
COLORTYPE_GRAYSCALE: 0,
COLORTYPE_PALETTE: 1,
COLORTYPE_COLOR: 2,
COLORTYPE_ALPHA: 4, // e.g. grayscale and alpha
// color-type combinations
COLORTYPE_PALETTE_COLOR: 3,
COLORTYPE_COLOR_ALPHA: 6,
COLORTYPE_TO_BPP_MAP: {
0: 1,
2: 3,
3: 1,
4: 2,
6: 4,
},
GAMMA_DIVISION: 100000,
};
/***/ }),
/***/ 5987:
/***/ ((module) => {
"use strict";
let crcTable = [];
(function () {
for (let i = 0; i < 256; i++) {
let currentCrc = i;
for (let j = 0; j < 8; j++) {
if (currentCrc & 1) {
currentCrc = 0xedb88320 ^ (currentCrc >>> 1);
} else {
currentCrc = currentCrc >>> 1;
}
}
crcTable[i] = currentCrc;
}
})();
let CrcCalculator = (module.exports = function () {
this._crc = -1;
});
CrcCalculator.prototype.write = function (data) {
for (let i = 0; i < data.length; i++) {
this._crc = crcTable[(this._crc ^ data[i]) & 0xff] ^ (this._crc >>> 8);
}
return true;
};
CrcCalculator.prototype.crc32 = function () {
return this._crc ^ -1;
};
CrcCalculator.crc32 = function (buf) {
let crc = -1;
for (let i = 0; i < buf.length; i++) {
crc = crcTable[(crc ^ buf[i]) & 0xff] ^ (crc >>> 8);
}
return crc ^ -1;
};
/***/ }),
/***/ 7581:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
"use strict";
let paethPredictor = __nccwpck_require__(5252);
function filterNone(pxData, pxPos, byteWidth, rawData, rawPos) {
for (let x = 0; x < byteWidth; x++) {
rawData[rawPos + x] = pxData[pxPos + x];
}
}
function filterSumNone(pxData, pxPos, byteWidth) {
let sum = 0;
let length = pxPos + byteWidth;
for (let i = pxPos; i < length; i++) {
sum += Math.abs(pxData[i]);
}
return sum;
}
function filterSub(pxData, pxPos, byteWidth, rawData, rawPos, bpp) {
for (let x = 0; x < byteWidth; x++) {
let left = x >= bpp ? pxData[pxPos + x - bpp] : 0;
let val = pxData[pxPos + x] - left;
rawData[rawPos + x] = val;
}
}
function filterSumSub(pxData, pxPos, byteWidth, bpp) {
let sum = 0;
for (let x = 0; x < byteWidth; x++) {
let left = x >= bpp ? pxData[pxPos + x - bpp] : 0;
let val = pxData[pxPos + x] - left;
sum += Math.abs(val);
}
return sum;
}
function filterUp(pxData, pxPos, byteWidth, rawData, rawPos) {
for (let x = 0; x < byteWidth; x++) {
let up = pxPos > 0 ? pxData[pxPos + x - byteWidth] : 0;
let val = pxData[pxPos + x] - up;
rawData[rawPos + x] = val;
}
}
function filterSumUp(pxData, pxPos, byteWidth) {
let sum = 0;
let length = pxPos + byteWidth;
for (let x = pxPos; x < length; x++) {
let up = pxPos > 0 ? pxData[x - byteWidth] : 0;
let val = pxData[x] - up;
sum += Math.abs(val);
}
return sum;
}
function filterAvg(pxData, pxPos, byteWidth, rawData, rawPos, bpp) {
for (let x = 0; x < byteWidth; x++) {
let left = x >= bpp ? pxData[pxPos + x - bpp] : 0;
let up = pxPos > 0 ? pxData[pxPos + x - byteWidth] : 0;
let val = pxData[pxPos + x] - ((left + up) >> 1);
rawData[rawPos + x] = val;
}
}
function filterSumAvg(pxData, pxPos, byteWidth, bpp) {
let sum = 0;
for (let x = 0; x < byteWidth; x++) {
let left = x >= bpp ? pxData[pxPos + x - bpp] : 0;
let up = pxPos > 0 ? pxData[pxPos + x - byteWidth] : 0;
let val = pxData[pxPos + x] - ((left + up) >> 1);
sum += Math.abs(val);
}
return sum;
}
function filterPaeth(pxData, pxPos, byteWidth, rawData, rawPos, bpp) {
for (let x = 0; x < byteWidth; x++) {
let left = x >= bpp ? pxData[pxPos + x - bpp] : 0;
let up = pxPos > 0 ? pxData[pxPos + x - byteWidth] : 0;
let upleft =
pxPos > 0 && x >= bpp ? pxData[pxPos + x - (byteWidth + bpp)] : 0;
let val = pxData[pxPos + x] - paethPredictor(left, up, upleft);
rawData[rawPos + x] = val;
}
}
function filterSumPaeth(pxData, pxPos, byteWidth, bpp) {
let sum = 0;
for (let x = 0; x < byteWidth; x++) {
let left = x >= bpp ? pxData[pxPos + x - bpp] : 0;
let up = pxPos > 0 ? pxData[pxPos + x - byteWidth] : 0;
let upleft =
pxPos > 0 && x >= bpp ? pxData[pxPos + x - (byteWidth + bpp)] : 0;
let val = pxData[pxPos + x] - paethPredictor(left, up, upleft);
sum += Math.abs(val);
}
return sum;
}
let filters = {
0: filterNone,
1: filterSub,
2: filterUp,
3: filterAvg,
4: filterPaeth,
};
let filterSums = {
0: filterSumNone,
1: filterSumSub,
2: filterSumUp,
3: filterSumAvg,
4: filterSumPaeth,
};
module.exports = function (pxData, width, height, options, bpp) {
let filterTypes;
if (!("filterType" in options) || options.filterType === -1) {
filterTypes = [0, 1, 2, 3, 4];
} else if (typeof options.filterType === "number") {
filterTypes = [options.filterType];
} else {
throw new Error("unrecognised filter types");
}
if (options.bitDepth === 16) {
bpp *= 2;
}
let byteWidth = width * bpp;
let rawPos = 0;
let pxPos = 0;
let rawData = Buffer.alloc((byteWidth + 1) * height);
let sel = filterTypes[0];
for (let y = 0; y < height; y++) {
if (filterTypes.length > 1) {
// find best filter for this line (with lowest sum of values)
let min = Infinity;
for (let i = 0; i < filterTypes.length; i++) {
let sum = filterSums[filterTypes[i]](pxData, pxPos, byteWidth, bpp);
if (sum < min) {
sel = filterTypes[i];
min = sum;
}
}
}
rawData[rawPos] = sel;
rawPos++;
filters[sel](pxData, pxPos, byteWidth, rawData, rawPos, bpp);
rawPos += byteWidth;
pxPos += byteWidth;
}
return rawData;
};
/***/ }),
/***/ 528:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
"use strict";
let util = __nccwpck_require__(3837);
let ChunkStream = __nccwpck_require__(4036);
let Filter = __nccwpck_require__(6601);
let FilterAsync = (module.exports = function (bitmapInfo) {
ChunkStream.call(this);
let buffers = [];
let that = this;
this._filter = new Filter(bitmapInfo, {
read: this.read.bind(this),
write: function (buffer) {
buffers.push(buffer);
},
complete: function () {
that.emit("complete", Buffer.concat(buffers));
},
});
this._filter.start();
});
util.inherits(FilterAsync, ChunkStream);
/***/ }),
/***/ 8505:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
let SyncReader = __nccwpck_require__(3652);
let Filter = __nccwpck_require__(6601);
exports.process = function (inBuffer, bitmapInfo) {
let outBuffers = [];
let reader = new SyncReader(inBuffer);
let filter = new Filter(bitmapInfo, {
read: reader.read.bind(reader),
write: function (bufferPart) {
outBuffers.push(bufferPart);
},
complete: function () {},
});
filter.start();
reader.process();
return Buffer.concat(outBuffers);
};
/***/ }),
/***/ 6601:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
"use strict";
let interlaceUtils = __nccwpck_require__(3365);
let paethPredictor = __nccwpck_require__(5252);
function getByteWidth(width, bpp, depth) {
let byteWidth = width * bpp;
if (depth !== 8) {
byteWidth = Math.ceil(byteWidth / (8 / depth));
}
return byteWidth;
}
let Filter = (module.exports = function (bitmapInfo, dependencies) {
let width = bitmapInfo.width;
let height = bitmapInfo.height;
let interlace = bitmapInfo.interlace;
let bpp = bitmapInfo.bpp;
let depth = bitmapInfo.depth;
this.read = dependencies.read;
this.write = dependencies.write;
this.complete = dependencies.complete;
this._imageIndex = 0;
this._images = [];
if (interlace) {
let passes = interlaceUtils.getImagePasses(width, height);
for (let i = 0; i < passes.length; i++) {
this._images.push({
byteWidth: getByteWidth(passes[i].width, bpp, depth),
height: passes[i].height,
lineIndex: 0,
});
}
} else {
this._images.push({
byteWidth: getByteWidth(width, bpp, depth),
height: height,
lineIndex: 0,
});
}
// when filtering the line we look at the pixel to the left
// the spec also says it is done on a byte level regardless of the number of pixels
// so if the depth is byte compatible (8 or 16) we subtract the bpp in order to compare back
// a pixel rather than just a different byte part. However if we are sub byte, we ignore.
if (depth === 8) {
this._xComparison = bpp;
} else if (depth === 16) {
this._xComparison = bpp * 2;
} else {
this._xComparison = 1;
}
});
Filter.prototype.start = function () {
this.read(
this._images[this._imageIndex].byteWidth + 1,
this._reverseFilterLine.bind(this)
);
};
Filter.prototype._unFilterType1 = function (
rawData,
unfilteredLine,
byteWidth
) {
let xComparison = this._xComparison;
let xBiggerThan = xComparison - 1;
for (let x = 0; x < byteWidth; x++) {
let rawByte = rawData[1 + x];
let f1Left = x > xBiggerThan ? unfilteredLine[x - xComparison] : 0;
unfilteredLine[x] = rawByte + f1Left;
}
};
Filter.prototype._unFilterType2 = function (
rawData,
unfilteredLine,
byteWidth
) {
let lastLine = this._lastLine;
for (let x = 0; x < byteWidth; x++) {
let rawByte = rawData[1 + x];
let f2Up = lastLine ? lastLine[x] : 0;
unfilteredLine[x] = rawByte + f2Up;
}
};
Filter.prototype._unFilterType3 = function (
rawData,
unfilteredLine,
byteWidth
) {
let xComparison = this._xComparison;
let xBiggerThan = xComparison - 1;
let lastLine = this._lastLine;
for (let x = 0; x < byteWidth; x++) {
let rawByte = rawData[1 + x];
let f3Up = lastLine ? lastLine[x] : 0;
let f3Left = x > xBiggerThan ? unfilteredLine[x - xComparison] : 0;
let f3Add = Math.floor((f3Left + f3Up) / 2);
unfilteredLine[x] = rawByte + f3Add;
}
};
Filter.prototype._unFilterType4 = function (
rawData,
unfilteredLine,
byteWidth
) {
let xComparison = this._xComparison;
let xBiggerThan = xComparison - 1;
let lastLine = this._lastLine;
for (let x = 0; x < byteWidth; x++) {
let rawByte = rawData[1 + x];
let f4Up = lastLine ? lastLine[x] : 0;
let f4Left = x > xBiggerThan ? unfilteredLine[x - xComparison] : 0;
let f4UpLeft = x > xBiggerThan && lastLine ? lastLine[x - xComparison] : 0;
let f4Add = paethPredictor(f4Left, f4Up, f4UpLeft);
unfilteredLine[x] = rawByte + f4Add;
}
};
Filter.prototype._reverseFilterLine = function (rawData) {
let filter = rawData[0];
let unfilteredLine;
let currentImage = this._images[this._imageIndex];
let byteWidth = currentImage.byteWidth;
if (filter === 0) {
unfilteredLine = rawData.slice(1, byteWidth + 1);
} else {
unfilteredLine = Buffer.alloc(byteWidth);
switch (filter) {
case 1:
this._unFilterType1(rawData, unfilteredLine, byteWidth);
break;
case 2:
this._unFilterType2(rawData, unfilteredLine, byteWidth);
break;
case 3:
this._unFilterType3(rawData, unfilteredLine, byteWidth);
break;
case 4:
this._unFilterType4(rawData, unfilteredLine, byteWidth);
break;
default:
throw new Error("Unrecognised filter type - " + filter);
}
}
this.write(unfilteredLine);
currentImage.lineIndex++;
if (currentImage.lineIndex >= currentImage.height) {
this._lastLine = null;
this._imageIndex++;
currentImage = this._images[this._imageIndex];
} else {
this._lastLine = unfilteredLine;
}
if (currentImage) {
// read, using the byte width that may be from the new current image
this.read(currentImage.byteWidth + 1, this._reverseFilterLine.bind(this));
} else {
this._lastLine = null;
this.complete();
}
};
/***/ }),
/***/ 3928:
/***/ ((module) => {
"use strict";
function dePalette(indata, outdata, width, height, palette) {
let pxPos = 0;
// use values from palette
for (let y = 0; y < height; y++) {
for (let x = 0; x < width; x++) {
let color = palette[indata[pxPos]];
if (!color) {
throw new Error("index " + indata[pxPos] + " not in palette");
}
for (let i = 0; i < 4; i++) {
outdata[pxPos + i] = color[i];
}
pxPos += 4;
}
}
}
function replaceTransparentColor(indata, outdata, width, height, transColor) {
let pxPos = 0;
for (let y = 0; y < height; y++) {
for (let x = 0; x < width; x++) {
let makeTrans = false;
if (transColor.length === 1) {
if (transColor[0] === indata[pxPos]) {
makeTrans = true;
}
} else if (
transColor[0] === indata[pxPos] &&
transColor[1] === indata[pxPos + 1] &&
transColor[2] === indata[pxPos + 2]
) {
makeTrans = true;
}
if (makeTrans) {
for (let i = 0; i < 4; i++) {
outdata[pxPos + i] = 0;
}
}
pxPos += 4;
}
}
}
function scaleDepth(indata, outdata, width, height, depth) {
let maxOutSample = 255;
let maxInSample = Math.pow(2, depth) - 1;
let pxPos = 0;
for (let y = 0; y < height; y++) {
for (let x = 0; x < width; x++) {
for (let i = 0; i < 4; i++) {
outdata[pxPos + i] = Math.floor(
(indata[pxPos + i] * maxOutSample) / maxInSample + 0.5
);
}
pxPos += 4;
}
}
}
module.exports = function (indata, imageData, skipRescale = false) {
let depth = imageData.depth;
let width = imageData.width;
let height = imageData.height;
let colorType = imageData.colorType;
let transColor = imageData.transColor;
let palette = imageData.palette;
let outdata = indata; // only different for 16 bits
if (colorType === 3) {
// paletted
dePalette(indata, outdata, width, height, palette);
} else {
if (transColor) {
replaceTransparentColor(indata, outdata, width, height, transColor);
}
// if it needs scaling
if (depth !== 8 && !skipRescale) {
// if we need to change the buffer size
if (depth === 16) {
outdata = Buffer.alloc(width * height * 4);
}
scaleDepth(indata, outdata, width, height, depth);
}
}
return outdata;
};
/***/ }),
/***/ 3365:
/***/ ((__unused_webpack_module, exports) => {
"use strict";
// Adam 7
// 0 1 2 3 4 5 6 7
// 0 x 6 4 6 x 6 4 6
// 1 7 7 7 7 7 7 7 7
// 2 5 6 5 6 5 6 5 6
// 3 7 7 7 7 7 7 7 7
// 4 3 6 4 6 3 6 4 6
// 5 7 7 7 7 7 7 7 7
// 6 5 6 5 6 5 6 5 6
// 7 7 7 7 7 7 7 7 7
let imagePasses = [
{
// pass 1 - 1px
x: [0],
y: [0],
},
{
// pass 2 - 1px
x: [4],
y: [0],
},
{
// pass 3 - 2px
x: [0, 4],
y: [4],
},
{
// pass 4 - 4px
x: [2, 6],
y: [0, 4],
},
{
// pass 5 - 8px
x: [0, 2, 4, 6],
y: [2, 6],
},
{
// pass 6 - 16px
x: [1, 3, 5, 7],
y: [0, 2, 4, 6],
},
{
// pass 7 - 32px
x: [0, 1, 2, 3, 4, 5, 6, 7],
y: [1, 3, 5, 7],
},
];
exports.getImagePasses = function (width, height) {
let images = [];
let xLeftOver = width % 8;
let yLeftOver = height % 8;
let xRepeats = (width - xLeftOver) / 8;
let yRepeats = (height - yLeftOver) / 8;
for (let i = 0; i < imagePasses.length; i++) {
let pass = imagePasses[i];
let passWidth = xRepeats * pass.x.length;
let passHeight = yRepeats * pass.y.length;
for (let j = 0; j < pass.x.length; j++) {
if (pass.x[j] < xLeftOver) {
passWidth++;
} else {
break;
}
}
for (let j = 0; j < pass.y.length; j++) {
if (pass.y[j] < yLeftOver) {
passHeight++;
} else {
break;
}
}
if (passWidth > 0 && passHeight > 0) {
images.push({ width: passWidth, height: passHeight, index: i });
}
}
return images;
};
exports.getInterlaceIterator = function (width) {
return function (x, y, pass) {
let outerXLeftOver = x % imagePasses[pass].x.length;
let outerX =
((x - outerXLeftOver) / imagePasses[pass].x.length) * 8 +
imagePasses[pass].x[outerXLeftOver];
let outerYLeftOver = y % imagePasses[pass].y.length;
let outerY =
((y - outerYLeftOver) / imagePasses[pass].y.length) * 8 +
imagePasses[pass].y[outerYLeftOver];
return outerX * 4 + outerY * width * 4;
};
};
/***/ }),
/***/ 2584:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
"use strict";
let util = __nccwpck_require__(3837);
let Stream = __nccwpck_require__(2781);
let constants = __nccwpck_require__(3316);
let Packer = __nccwpck_require__(1710);
let PackerAsync = (module.exports = function (opt) {
Stream.call(this);
let options = opt || {};
this._packer = new Packer(options);
this._deflate = this._packer.createDeflate();
this.readable = true;
});
util.inherits(PackerAsync, Stream);
PackerAsync.prototype.pack = function (data, width, height, gamma) {
// Signature
this.emit("data", Buffer.from(constants.PNG_SIGNATURE));
this.emit("data", this._packer.packIHDR(width, height));
if (gamma) {
this.emit("data", this._packer.packGAMA(gamma));
}
let filteredData = this._packer.filterData(data, width, height);
// compress it
this._deflate.on("error", this.emit.bind(this, "error"));
this._deflate.on(
"data",
function (compressedData) {
this.emit("data", this._packer.packIDAT(compressedData));
}.bind(this)
);
this._deflate.on(
"end",
function () {
this.emit("data", this._packer.packIEND());
this.emit("end");
}.bind(this)
);
this._deflate.end(filteredData);
};
/***/ }),
/***/ 7100:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
"use strict";
let hasSyncZlib = true;
let zlib = __nccwpck_require__(9796);
if (!zlib.deflateSync) {
hasSyncZlib = false;
}
let constants = __nccwpck_require__(3316);
let Packer = __nccwpck_require__(1710);
module.exports = function (metaData, opt) {
if (!hasSyncZlib) {
throw new Error(
"To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0"
);
}
let options = opt || {};
let packer = new Packer(options);
let chunks = [];
// Signature
chunks.push(Buffer.from(constants.PNG_SIGNATURE));
// Header
chunks.push(packer.packIHDR(metaData.width, metaData.height));
if (metaData.gamma) {
chunks.push(packer.packGAMA(metaData.gamma));
}
let filteredData = packer.filterData(
metaData.data,
metaData.width,
metaData.height
);
// compress it
let compressedData = zlib.deflateSync(
filteredData,
packer.getDeflateOptions()
);
filteredData = null;
if (!compressedData || !compressedData.length) {
throw new Error("bad png - invalid compressed data response");
}
chunks.push(packer.packIDAT(compressedData));
// End
chunks.push(packer.packIEND());
return Buffer.concat(chunks);
};
/***/ }),
/***/ 1710:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
"use strict";
let constants = __nccwpck_require__(3316);
let CrcStream = __nccwpck_require__(5987);
let bitPacker = __nccwpck_require__(6659);
let filter = __nccwpck_require__(7581);
let zlib = __nccwpck_require__(9796);
let Packer = (module.exports = function (options) {
this._options = options;
options.deflateChunkSize = options.deflateChunkSize || 32 * 1024;
options.deflateLevel =
options.deflateLevel != null ? options.deflateLevel : 9;
options.deflateStrategy =
options.deflateStrategy != null ? options.deflateStrategy : 3;
options.inputHasAlpha =
options.inputHasAlpha != null ? options.inputHasAlpha : true;
options.deflateFactory = options.deflateFactory || zlib.createDeflate;
options.bitDepth = options.bitDepth || 8;
// This is outputColorType
options.colorType =
typeof options.colorType === "number"
? options.colorType
: constants.COLORTYPE_COLOR_ALPHA;
options.inputColorType =
typeof options.inputColorType === "number"
? options.inputColorType
: constants.COLORTYPE_COLOR_ALPHA;
if (
[
constants.COLORTYPE_GRAYSCALE,
constants.COLORTYPE_COLOR,
constants.COLORTYPE_COLOR_ALPHA,
constants.COLORTYPE_ALPHA,
].indexOf(options.colorType) === -1
) {
throw new Error(
"option color type:" + options.colorType + " is not supported at present"
);
}
if (
[
constants.COLORTYPE_GRAYSCALE,
constants.COLORTYPE_COLOR,
constants.COLORTYPE_COLOR_ALPHA,
constants.COLORTYPE_ALPHA,
].indexOf(options.inputColorType) === -1
) {
throw new Error(
"option input color type:" +
options.inputColorType +
" is not supported at present"
);
}
if (options.bitDepth !== 8 && options.bitDepth !== 16) {
throw new Error(
"option bit depth:" + options.bitDepth + " is not supported at present"
);
}
});
Packer.prototype.getDeflateOptions = function () {
return {
chunkSize: this._options.deflateChunkSize,
level: this._options.deflateLevel,
strategy: this._options.deflateStrategy,
};
};
Packer.prototype.createDeflate = function () {
return this._options.deflateFactory(this.getDeflateOptions());
};
Packer.prototype.filterData = function (data, width, height) {
// convert to correct format for filtering (e.g. right bpp and bit depth)
let packedData = bitPacker(data, width, height, this._options);
// filter pixel data
let bpp = constants.COLORTYPE_TO_BPP_MAP[this._options.colorType];
let filteredData = filter(packedData, width, height, this._options, bpp);
return filteredData;
};
Packer.prototype._packChunk = function (type, data) {
let len = data ? data.length : 0;
let buf = Buffer.alloc(len + 12);
buf.writeUInt32BE(len, 0);
buf.writeUInt32BE(type, 4);
if (data) {
data.copy(buf, 8);
}
buf.writeInt32BE(
CrcStream.crc32(buf.slice(4, buf.length - 4)),
buf.length - 4
);
return buf;
};
Packer.prototype.packGAMA = function (gamma) {
let buf = Buffer.alloc(4);
buf.writeUInt32BE(Math.floor(gamma * constants.GAMMA_DIVISION), 0);
return this._packChunk(constants.TYPE_gAMA, buf);
};
Packer.prototype.packIHDR = function (width, height) {
let buf = Buffer.alloc(13);
buf.writeUInt32BE(width, 0);
buf.writeUInt32BE(height, 4);
buf[8] = this._options.bitDepth; // Bit depth
buf[9] = this._options.colorType; // colorType
buf[10] = 0; // compression
buf[11] = 0; // filter
buf[12] = 0; // interlace
return this._packChunk(constants.TYPE_IHDR, buf);
};
Packer.prototype.packIDAT = function (data) {
return this._packChunk(constants.TYPE_IDAT, data);
};
Packer.prototype.packIEND = function () {
return this._packChunk(constants.TYPE_IEND, null);
};
/***/ }),
/***/ 5252:
/***/ ((module) => {
"use strict";
module.exports = function paethPredictor(left, above, upLeft) {
let paeth = left + above - upLeft;
let pLeft = Math.abs(paeth - left);
let pAbove = Math.abs(paeth - above);
let pUpLeft = Math.abs(paeth - upLeft);
if (pLeft <= pAbove && pLeft <= pUpLeft) {
return left;
}
if (pAbove <= pUpLeft) {
return above;
}
return upLeft;
};
/***/ }),
/***/ 699:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
"use strict";
let util = __nccwpck_require__(3837);
let zlib = __nccwpck_require__(9796);
let ChunkStream = __nccwpck_require__(4036);
let FilterAsync = __nccwpck_require__(528);
let Parser = __nccwpck_require__(2225);
let bitmapper = __nccwpck_require__(2021);
let formatNormaliser = __nccwpck_require__(3928);
let ParserAsync = (module.exports = function (options) {
ChunkStream.call(this);
this._parser = new Parser(options, {
read: this.read.bind(this),
error: this._handleError.bind(this),
metadata: this._handleMetaData.bind(this),
gamma: this.emit.bind(this, "gamma"),
palette: this._handlePalette.bind(this),
transColor: this._handleTransColor.bind(this),
finished: this._finished.bind(this),
inflateData: this._inflateData.bind(this),
simpleTransparency: this._simpleTransparency.bind(this),
headersFinished: this._headersFinished.bind(this),
});
this._options = options;
this.writable = true;
this._parser.start();
});
util.inherits(ParserAsync, ChunkStream);
ParserAsync.prototype._handleError = function (err) {
this.emit("error", err);
this.writable = false;
this.destroy();
if (this._inflate && this._inflate.destroy) {
this._inflate.destroy();
}
if (this._filter) {
this._filter.destroy();
// For backward compatibility with Node 7 and below.
// Suppress errors due to _inflate calling write() even after
// it's destroy()'ed.
this._filter.on("error", function () {});
}
this.errord = true;
};
ParserAsync.prototype._inflateData = function (data) {
if (!this._inflate) {
if (this._bitmapInfo.interlace) {
this._inflate = zlib.createInflate();
this._inflate.on("error", this.emit.bind(this, "error"));
this._filter.on("complete", this._complete.bind(this));
this._inflate.pipe(this._filter);
} else {
let rowSize =
((this._bitmapInfo.width *
this._bitmapInfo.bpp *
this._bitmapInfo.depth +
7) >>
3) +
1;
let imageSize = rowSize * this._bitmapInfo.height;
let chunkSize = Math.max(imageSize, zlib.Z_MIN_CHUNK);
this._inflate = zlib.createInflate({ chunkSize: chunkSize });
let leftToInflate = imageSize;
let emitError = this.emit.bind(this, "error");
this._inflate.on("error", function (err) {
if (!leftToInflate) {
return;
}
emitError(err);
});
this._filter.on("complete", this._complete.bind(this));
let filterWrite = this._filter.write.bind(this._filter);
this._inflate.on("data", function (chunk) {
if (!leftToInflate) {
return;
}
if (chunk.length > leftToInflate) {
chunk = chunk.slice(0, leftToInflate);
}
leftToInflate -= chunk.length;
filterWrite(chunk);
});
this._inflate.on("end", this._filter.end.bind(this._filter));
}
}
this._inflate.write(data);
};
ParserAsync.prototype._handleMetaData = function (metaData) {
this._metaData = metaData;
this._bitmapInfo = Object.create(metaData);
this._filter = new FilterAsync(this._bitmapInfo);
};
ParserAsync.prototype._handleTransColor = function (transColor) {
this._bitmapInfo.transColor = transColor;
};
ParserAsync.prototype._handlePalette = function (palette) {
this._bitmapInfo.palette = palette;
};
ParserAsync.prototype._simpleTransparency = function () {
this._metaData.alpha = true;
};
ParserAsync.prototype._headersFinished = function () {
// Up until this point, we don't know if we have a tRNS chunk (alpha)
// so we can't emit metadata any earlier
this.emit("metadata", this._metaData);
};
ParserAsync.prototype._finished = function () {
if (this.errord) {
return;
}
if (!this._inflate) {
this.emit("error", "No Inflate block");
} else {
// no more data to inflate
this._inflate.end();
}
};
ParserAsync.prototype._complete = function (filteredData) {
if (this.errord) {
return;
}
let normalisedBitmapData;
try {
let bitmapData = bitmapper.dataToBitMap(filteredData, this._bitmapInfo);
normalisedBitmapData = formatNormaliser(
bitmapData,
this._bitmapInfo,
this._options.skipRescale
);
bitmapData = null;
} catch (ex) {
this._handleError(ex);
return;
}
this.emit("parsed", normalisedBitmapData);
};
/***/ }),
/***/ 29:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
"use strict";
let hasSyncZlib = true;
let zlib = __nccwpck_require__(9796);
let inflateSync = __nccwpck_require__(5331);
if (!zlib.deflateSync) {
hasSyncZlib = false;
}
let SyncReader = __nccwpck_require__(3652);
let FilterSync = __nccwpck_require__(8505);
let Parser = __nccwpck_require__(2225);
let bitmapper = __nccwpck_require__(2021);
let formatNormaliser = __nccwpck_require__(3928);
module.exports = function (buffer, options) {
if (!hasSyncZlib) {
throw new Error(
"To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0"
);
}
let err;
function handleError(_err_) {
err = _err_;
}
let metaData;
function handleMetaData(_metaData_) {
metaData = _metaData_;
}
function handleTransColor(transColor) {
metaData.transColor = transColor;
}
function handlePalette(palette) {
metaData.palette = palette;
}
function handleSimpleTransparency() {
metaData.alpha = true;
}
let gamma;
function handleGamma(_gamma_) {
gamma = _gamma_;
}
let inflateDataList = [];
function handleInflateData(inflatedData) {
inflateDataList.push(inflatedData);
}
let reader = new SyncReader(buffer);
let parser = new Parser(options, {
read: reader.read.bind(reader),
error: handleError,
metadata: handleMetaData,
gamma: handleGamma,
palette: handlePalette,
transColor: handleTransColor,
inflateData: handleInflateData,
simpleTransparency: handleSimpleTransparency,
});
parser.start();
reader.process();
if (err) {
throw err;
}
//join together the inflate datas
let inflateData = Buffer.concat(inflateDataList);
inflateDataList.length = 0;
let inflatedData;
if (metaData.interlace) {
inflatedData = zlib.inflateSync(inflateData);
} else {
let rowSize =
((metaData.width * metaData.bpp * metaData.depth + 7) >> 3) + 1;
let imageSize = rowSize * metaData.height;
inflatedData = inflateSync(inflateData, {
chunkSize: imageSize,
maxLength: imageSize,
});
}
inflateData = null;
if (!inflatedData || !inflatedData.length) {
throw new Error("bad png - invalid inflate data response");
}
let unfilteredData = FilterSync.process(inflatedData, metaData);
inflateData = null;
let bitmapData = bitmapper.dataToBitMap(unfilteredData, metaData);
unfilteredData = null;
let normalisedBitmapData = formatNormaliser(
bitmapData,
metaData,
options.skipRescale
);
metaData.data = normalisedBitmapData;
metaData.gamma = gamma || 0;
return metaData;
};
/***/ }),
/***/ 2225:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
"use strict";
let constants = __nccwpck_require__(3316);
let CrcCalculator = __nccwpck_require__(5987);
let Parser = (module.exports = function (options, dependencies) {
this._options = options;
options.checkCRC = options.checkCRC !== false;
this._hasIHDR = false;
this._hasIEND = false;
this._emittedHeadersFinished = false;
// input flags/metadata
this._palette = [];
this._colorType = 0;
this._chunks = {};
this._chunks[constants.TYPE_IHDR] = this._handleIHDR.bind(this);
this._chunks[constants.TYPE_IEND] = this._handleIEND.bind(this);
this._chunks[constants.TYPE_IDAT] = this._handleIDAT.bind(this);
this._chunks[constants.TYPE_PLTE] = this._handlePLTE.bind(this);
this._chunks[constants.TYPE_tRNS] = this._handleTRNS.bind(this);
this._chunks[constants.TYPE_gAMA] = this._handleGAMA.bind(this);
this.read = dependencies.read;
this.error = dependencies.error;
this.metadata = dependencies.metadata;
this.gamma = dependencies.gamma;
this.transColor = dependencies.transColor;
this.palette = dependencies.palette;
this.parsed = dependencies.parsed;
this.inflateData = dependencies.inflateData;
this.finished = dependencies.finished;
this.simpleTransparency = dependencies.simpleTransparency;
this.headersFinished = dependencies.headersFinished || function () {};
});
Parser.prototype.start = function () {
this.read(constants.PNG_SIGNATURE.length, this._parseSignature.bind(this));
};
Parser.prototype._parseSignature = function (data) {
let signature = constants.PNG_SIGNATURE;
for (let i = 0; i < signature.length; i++) {
if (data[i] !== signature[i]) {
this.error(new Error("Invalid file signature"));
return;
}
}
this.read(8, this._parseChunkBegin.bind(this));
};
Parser.prototype._parseChunkBegin = function (data) {
// chunk content length
let length = data.readUInt32BE(0);
// chunk type
let type = data.readUInt32BE(4);
let name = "";
for (let i = 4; i < 8; i++) {
name += String.fromCharCode(data[i]);
}
//console.log('chunk ', name, length);
// chunk flags
let ancillary = Boolean(data[4] & 0x20); // or critical
// priv = Boolean(data[5] & 0x20), // or public
// safeToCopy = Boolean(data[7] & 0x20); // or unsafe
if (!this._hasIHDR && type !== constants.TYPE_IHDR) {
this.error(new Error("Expected IHDR on beggining"));
return;
}
this._crc = new CrcCalculator();
this._crc.write(Buffer.from(name));
if (this._chunks[type]) {
return this._chunks[type](length);
}
if (!ancillary) {
this.error(new Error("Unsupported critical chunk type " + name));
return;
}
this.read(length + 4, this._skipChunk.bind(this));
};
Parser.prototype._skipChunk = function (/*data*/) {
this.read(8, this._parseChunkBegin.bind(this));
};
Parser.prototype._handleChunkEnd = function () {
this.read(4, this._parseChunkEnd.bind(this));
};
Parser.prototype._parseChunkEnd = function (data) {
let fileCrc = data.readInt32BE(0);
let calcCrc = this._crc.crc32();
// check CRC
if (this._options.checkCRC && calcCrc !== fileCrc) {
this.error(new Error("Crc error - " + fileCrc + " - " + calcCrc));
return;
}
if (!this._hasIEND) {
this.read(8, this._parseChunkBegin.bind(this));
}
};
Parser.prototype._handleIHDR = function (length) {
this.read(length, this._parseIHDR.bind(this));
};
Parser.prototype._parseIHDR = function (data) {
this._crc.write(data);
let width = data.readUInt32BE(0);
let height = data.readUInt32BE(4);
let depth = data[8];
let colorType = data[9]; // bits: 1 palette, 2 color, 4 alpha
let compr = data[10];
let filter = data[11];
let interlace = data[12];
// console.log(' width', width, 'height', height,
// 'depth', depth, 'colorType', colorType,
// 'compr', compr, 'filter', filter, 'interlace', interlace
// );
if (
depth !== 8 &&
depth !== 4 &&
depth !== 2 &&
depth !== 1 &&
depth !== 16
) {
this.error(new Error("Unsupported bit depth " + depth));
return;
}
if (!(colorType in constants.COLORTYPE_TO_BPP_MAP)) {
this.error(new Error("Unsupported color type"));
return;
}
if (compr !== 0) {
this.error(new Error("Unsupported compression method"));
return;
}
if (filter !== 0) {
this.error(new Error("Unsupported filter method"));
return;
}
if (interlace !== 0 && interlace !== 1) {
this.error(new Error("Unsupported interlace method"));
return;
}
this._colorType = colorType;
let bpp = constants.COLORTYPE_TO_BPP_MAP[this._colorType];
this._hasIHDR = true;
this.metadata({
width: width,
height: height,
depth: depth,
interlace: Boolean(interlace),
palette: Boolean(colorType & constants.COLORTYPE_PALETTE),
color: Boolean(colorType & constants.COLORTYPE_COLOR),
alpha: Boolean(colorType & constants.COLORTYPE_ALPHA),
bpp: bpp,
colorType: colorType,
});
this._handleChunkEnd();
};
Parser.prototype._handlePLTE = function (length) {
this.read(length, this._parsePLTE.bind(this));
};
Parser.prototype._parsePLTE = function (data) {
this._crc.write(data);
let entries = Math.floor(data.length / 3);
// console.log('Palette:', entries);
for (let i = 0; i < entries; i++) {
this._palette.push([data[i * 3], data[i * 3 + 1], data[i * 3 + 2], 0xff]);
}
this.palette(this._palette);
this._handleChunkEnd();
};
Parser.prototype._handleTRNS = function (length) {
this.simpleTransparency();
this.read(length, this._parseTRNS.bind(this));
};
Parser.prototype._parseTRNS = function (data) {
this._crc.write(data);
// palette
if (this._colorType === constants.COLORTYPE_PALETTE_COLOR) {
if (this._palette.length === 0) {
this.error(new Error("Transparency chunk must be after palette"));
return;
}
if (data.length > this._palette.length) {
this.error(new Error("More transparent colors than palette size"));
return;
}
for (let i = 0; i < data.length; i++) {
this._palette[i][3] = data[i];
}
this.palette(this._palette);
}
// for colorType 0 (grayscale) and 2 (rgb)
// there might be one gray/color defined as transparent
if (this._colorType === constants.COLORTYPE_GRAYSCALE) {
// grey, 2 bytes
this.transColor([data.readUInt16BE(0)]);
}
if (this._colorType === constants.COLORTYPE_COLOR) {
this.transColor([
data.readUInt16BE(0),
data.readUInt16BE(2),
data.readUInt16BE(4),
]);
}
this._handleChunkEnd();
};
Parser.prototype._handleGAMA = function (length) {
this.read(length, this._parseGAMA.bind(this));
};
Parser.prototype._parseGAMA = function (data) {
this._crc.write(data);
this.gamma(data.readUInt32BE(0) / constants.GAMMA_DIVISION);
this._handleChunkEnd();
};
Parser.prototype._handleIDAT = function (length) {
if (!this._emittedHeadersFinished) {
this._emittedHeadersFinished = true;
this.headersFinished();
}
this.read(-length, this._parseIDAT.bind(this, length));
};
Parser.prototype._parseIDAT = function (length, data) {
this._crc.write(data);
if (
this._colorType === constants.COLORTYPE_PALETTE_COLOR &&
this._palette.length === 0
) {
throw new Error("Expected palette not found");
}
this.inflateData(data);
let leftOverLength = length - data.length;
if (leftOverLength > 0) {
this._handleIDAT(leftOverLength);
} else {
this._handleChunkEnd();
}
};
Parser.prototype._handleIEND = function (length) {
this.read(length, this._parseIEND.bind(this));
};
Parser.prototype._parseIEND = function (data) {
this._crc.write(data);
this._hasIEND = true;
this._handleChunkEnd();
if (this.finished) {
this.finished();
}
};
/***/ }),
/***/ 1436:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
let parse = __nccwpck_require__(29);
let pack = __nccwpck_require__(7100);
exports.read = function (buffer, options) {
return parse(buffer, options || {});
};
exports.write = function (png, options) {
return pack(png, options);
};
/***/ }),
/***/ 6413:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
let util = __nccwpck_require__(3837);
let Stream = __nccwpck_require__(2781);
let Parser = __nccwpck_require__(699);
let Packer = __nccwpck_require__(2584);
let PNGSync = __nccwpck_require__(1436);
let PNG = (exports.PNG = function (options) {
Stream.call(this);
options = options || {}; // eslint-disable-line no-param-reassign
// coerce pixel dimensions to integers (also coerces undefined -> 0):
this.width = options.width | 0;
this.height = options.height | 0;
this.data =
this.width > 0 && this.height > 0
? Buffer.alloc(4 * this.width * this.height)
: null;
if (options.fill && this.data) {
this.data.fill(0);
}
this.gamma = 0;
this.readable = this.writable = true;
this._parser = new Parser(options);
this._parser.on("error", this.emit.bind(this, "error"));
this._parser.on("close", this._handleClose.bind(this));
this._parser.on("metadata", this._metadata.bind(this));
this._parser.on("gamma", this._gamma.bind(this));
this._parser.on(
"parsed",
function (data) {
this.data = data;
this.emit("parsed", data);
}.bind(this)
);
this._packer = new Packer(options);
this._packer.on("data", this.emit.bind(this, "data"));
this._packer.on("end", this.emit.bind(this, "end"));
this._parser.on("close", this._handleClose.bind(this));
this._packer.on("error", this.emit.bind(this, "error"));
});
util.inherits(PNG, Stream);
PNG.sync = PNGSync;
PNG.prototype.pack = function () {
if (!this.data || !this.data.length) {
this.emit("error", "No data provided");
return this;
}
process.nextTick(
function () {
this._packer.pack(this.data, this.width, this.height, this.gamma);
}.bind(this)
);
return this;
};
PNG.prototype.parse = function (data, callback) {
if (callback) {
let onParsed, onError;
onParsed = function (parsedData) {
this.removeListener("error", onError);
this.data = parsedData;
callback(null, this);
}.bind(this);
onError = function (err) {
this.removeListener("parsed", onParsed);
callback(err, null);
}.bind(this);
this.once("parsed", onParsed);
this.once("error", onError);
}
this.end(data);
return this;
};
PNG.prototype.write = function (data) {
this._parser.write(data);
return true;
};
PNG.prototype.end = function (data) {
this._parser.end(data);
};
PNG.prototype._metadata = function (metadata) {
this.width = metadata.width;
this.height = metadata.height;
this.emit("metadata", metadata);
};
PNG.prototype._gamma = function (gamma) {
this.gamma = gamma;
};
PNG.prototype._handleClose = function () {
if (!this._parser.writable && !this._packer.readable) {
this.emit("close");
}
};
PNG.bitblt = function (src, dst, srcX, srcY, width, height, deltaX, deltaY) {
// eslint-disable-line max-params
// coerce pixel dimensions to integers (also coerces undefined -> 0):
/* eslint-disable no-param-reassign */
srcX |= 0;
srcY |= 0;
width |= 0;
height |= 0;
deltaX |= 0;
deltaY |= 0;
/* eslint-enable no-param-reassign */
if (
srcX > src.width ||
srcY > src.height ||
srcX + width > src.width ||
srcY + height > src.height
) {
throw new Error("bitblt reading outside image");
}
if (
deltaX > dst.width ||
deltaY > dst.height ||
deltaX + width > dst.width ||
deltaY + height > dst.height
) {
throw new Error("bitblt writing outside image");
}
for (let y = 0; y < height; y++) {
src.data.copy(
dst.data,
((deltaY + y) * dst.width + deltaX) << 2,
((srcY + y) * src.width + srcX) << 2,
((srcY + y) * src.width + srcX + width) << 2
);
}
};
PNG.prototype.bitblt = function (
dst,
srcX,
srcY,
width,
height,
deltaX,
deltaY
) {
// eslint-disable-line max-params
PNG.bitblt(this, dst, srcX, srcY, width, height, deltaX, deltaY);
return this;
};
PNG.adjustGamma = function (src) {
if (src.gamma) {
for (let y = 0; y < src.height; y++) {
for (let x = 0; x < src.width; x++) {
let idx = (src.width * y + x) << 2;
for (let i = 0; i < 3; i++) {
let sample = src.data[idx + i] / 255;
sample = Math.pow(sample, 1 / 2.2 / src.gamma);
src.data[idx + i] = Math.round(sample * 255);
}
}
}
src.gamma = 0;
}
};
PNG.prototype.adjustGamma = function () {
PNG.adjustGamma(this);
};
/***/ }),
/***/ 5331:
/***/ ((module, exports, __nccwpck_require__) => {
"use strict";
let assert = (__nccwpck_require__(9491).ok);
let zlib = __nccwpck_require__(9796);
let util = __nccwpck_require__(3837);
let kMaxLength = (__nccwpck_require__(4300).kMaxLength);
function Inflate(opts) {
if (!(this instanceof Inflate)) {
return new Inflate(opts);
}
if (opts && opts.chunkSize < zlib.Z_MIN_CHUNK) {
opts.chunkSize = zlib.Z_MIN_CHUNK;
}
zlib.Inflate.call(this, opts);
// Node 8 --> 9 compatibility check
this._offset = this._offset === undefined ? this._outOffset : this._offset;
this._buffer = this._buffer || this._outBuffer;
if (opts && opts.maxLength != null) {
this._maxLength = opts.maxLength;
}
}
function createInflate(opts) {
return new Inflate(opts);
}
function _close(engine, callback) {
if (callback) {
process.nextTick(callback);
}
// Caller may invoke .close after a zlib error (which will null _handle).
if (!engine._handle) {
return;
}
engine._handle.close();
engine._handle = null;
}
Inflate.prototype._processChunk = function (chunk, flushFlag, asyncCb) {
if (typeof asyncCb === "function") {
return zlib.Inflate._processChunk.call(this, chunk, flushFlag, asyncCb);
}
let self = this;
let availInBefore = chunk && chunk.length;
let availOutBefore = this._chunkSize - this._offset;
let leftToInflate = this._maxLength;
let inOff = 0;
let buffers = [];
let nread = 0;
let error;
this.on("error", function (err) {
error = err;
});
function handleChunk(availInAfter, availOutAfter) {
if (self._hadError) {
return;
}
let have = availOutBefore - availOutAfter;
assert(have >= 0, "have should not go down");
if (have > 0) {
let out = self._buffer.slice(self._offset, self._offset + have);
self._offset += have;
if (out.length > leftToInflate) {
out = out.slice(0, leftToInflate);
}
buffers.push(out);
nread += out.length;
leftToInflate -= out.length;
if (leftToInflate === 0) {
return false;
}
}
if (availOutAfter === 0 || self._offset >= self._chunkSize) {
availOutBefore = self._chunkSize;
self._offset = 0;
self._buffer = Buffer.allocUnsafe(self._chunkSize);
}
if (availOutAfter === 0) {
inOff += availInBefore - availInAfter;
availInBefore = availInAfter;
return true;
}
return false;
}
assert(this._handle, "zlib binding closed");
let res;
do {
res = this._handle.writeSync(
flushFlag,
chunk, // in
inOff, // in_off
availInBefore, // in_len
this._buffer, // out
this._offset, //out_off
availOutBefore
); // out_len
// Node 8 --> 9 compatibility check
res = res || this._writeState;
} while (!this._hadError && handleChunk(res[0], res[1]));
if (this._hadError) {
throw error;
}
if (nread >= kMaxLength) {
_close(this);
throw new RangeError(
"Cannot create final Buffer. It would be larger than 0x" +
kMaxLength.toString(16) +
" bytes"
);
}
let buf = Buffer.concat(buffers, nread);
_close(this);
return buf;
};
util.inherits(Inflate, zlib.Inflate);
function zlibBufferSync(engine, buffer) {
if (typeof buffer === "string") {
buffer = Buffer.from(buffer);
}
if (!(buffer instanceof Buffer)) {
throw new TypeError("Not a string or buffer");
}
let flushFlag = engine._finishFlushFlag;
if (flushFlag == null) {
flushFlag = zlib.Z_FINISH;
}
return engine._processChunk(buffer, flushFlag);
}
function inflateSync(buffer, opts) {
return zlibBufferSync(new Inflate(opts), buffer);
}
module.exports = exports = inflateSync;
exports.Inflate = Inflate;
exports.createInflate = createInflate;
exports.inflateSync = inflateSync;
/***/ }),
/***/ 3652:
/***/ ((module) => {
"use strict";
let SyncReader = (module.exports = function (buffer) {
this._buffer = buffer;
this._reads = [];
});
SyncReader.prototype.read = function (length, callback) {
this._reads.push({
length: Math.abs(length), // if length < 0 then at most this length
allowLess: length < 0,
func: callback,
});
};
SyncReader.prototype.process = function () {
// as long as there is any data and read requests
while (this._reads.length > 0 && this._buffer.length) {
let read = this._reads[0];
if (
this._buffer.length &&
(this._buffer.length >= read.length || read.allowLess)
) {
// ok there is any data so that we can satisfy this request
this._reads.shift(); // == read
let buf = this._buffer;
this._buffer = buf.slice(read.length);
read.func.call(this, buf.slice(0, read.length));
} else {
break;
}
}
if (this._reads.length > 0) {
throw new Error("There are some read requests waitng on finished stream");
}
if (this._buffer.length > 0) {
throw new Error("unrecognised content at end of stream");
}
};
/***/ }),
/***/ 6718:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
var QRCode = __nccwpck_require__(571),
QRErrorCorrectLevel = __nccwpck_require__(4383),
black = "\033[40m \033[0m",
white = "\033[47m \033[0m",
toCell = function (isBlack) {
return isBlack ? black : white;
},
repeat = function (color) {
return {
times: function (count) {
return new Array(count).join(color);
}
};
},
fill = function(length, value) {
var arr = new Array(length);
for (var i = 0; i < length; i++) {
arr[i] = value;
}
return arr;
};
module.exports = {
error: QRErrorCorrectLevel.L,
generate: function (input, opts, cb) {
if (typeof opts === 'function') {
cb = opts;
opts = {};
}
var qrcode = new QRCode(-1, this.error);
qrcode.addData(input);
qrcode.make();
var output = '';
if (opts && opts.small) {
var BLACK = true, WHITE = false;
var moduleCount = qrcode.getModuleCount();
var moduleData = qrcode.modules.slice();
var oddRow = moduleCount % 2 === 1;
if (oddRow) {
moduleData.push(fill(moduleCount, WHITE));
}
var platte= {
WHITE_ALL: '\u2588',
WHITE_BLACK: '\u2580',
BLACK_WHITE: '\u2584',
BLACK_ALL: ' ',
};
var borderTop = repeat(platte.BLACK_WHITE).times(moduleCount + 3);
var borderBottom = repeat(platte.WHITE_BLACK).times(moduleCount + 3);
output += borderTop + '\n';
for (var row = 0; row < moduleCount; row += 2) {
output += platte.WHITE_ALL;
for (var col = 0; col < moduleCount; col++) {
if (moduleData[row][col] === WHITE && moduleData[row + 1][col] === WHITE) {
output += platte.WHITE_ALL;
} else if (moduleData[row][col] === WHITE && moduleData[row + 1][col] === BLACK) {
output += platte.WHITE_BLACK;
} else if (moduleData[row][col] === BLACK && moduleData[row + 1][col] === WHITE) {
output += platte.BLACK_WHITE;
} else {
output += platte.BLACK_ALL;
}
}
output += platte.WHITE_ALL + '\n';
}
if (!oddRow) {
output += borderBottom;
}
} else {
var border = repeat(white).times(qrcode.getModuleCount() + 3);
output += border + '\n';
qrcode.modules.forEach(function (row) {
output += white;
output += row.map(toCell).join('');
output += white + '\n';
});
output += border;
}
if (cb) cb(output);
else console.log(output);
},
setErrorLevel: function (error) {
this.error = QRErrorCorrectLevel[error] || this.error;
}
};
/***/ }),
/***/ 5436:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
var QRMode = __nccwpck_require__(9301);
function QR8bitByte(data) {
this.mode = QRMode.MODE_8BIT_BYTE;
this.data = data;
}
QR8bitByte.prototype = {
getLength : function() {
return this.data.length;
},
write : function(buffer) {
for (var i = 0; i < this.data.length; i++) {
// not JIS ...
buffer.put(this.data.charCodeAt(i), 8);
}
}
};
module.exports = QR8bitByte;
/***/ }),
/***/ 4471:
/***/ ((module) => {
function QRBitBuffer() {
this.buffer = [];
this.length = 0;
}
QRBitBuffer.prototype = {
get : function(index) {
var bufIndex = Math.floor(index / 8);
return ( (this.buffer[bufIndex] >>> (7 - index % 8) ) & 1) == 1;
},
put : function(num, length) {
for (var i = 0; i < length; i++) {
this.putBit( ( (num >>> (length - i - 1) ) & 1) == 1);
}
},
getLengthInBits : function() {
return this.length;
},
putBit : function(bit) {
var bufIndex = Math.floor(this.length / 8);
if (this.buffer.length <= bufIndex) {
this.buffer.push(0);
}
if (bit) {
this.buffer[bufIndex] |= (0x80 >>> (this.length % 8) );
}
this.length++;
}
};
module.exports = QRBitBuffer;
/***/ }),
/***/ 4383:
/***/ ((module) => {
module.exports = {
L : 1,
M : 0,
Q : 3,
H : 2
};
/***/ }),
/***/ 6887:
/***/ ((module) => {
module.exports = {
PATTERN000 : 0,
PATTERN001 : 1,
PATTERN010 : 2,
PATTERN011 : 3,
PATTERN100 : 4,
PATTERN101 : 5,
PATTERN110 : 6,
PATTERN111 : 7
};
/***/ }),
/***/ 8997:
/***/ ((module) => {
var QRMath = {
glog : function(n) {
if (n < 1) {
throw new Error("glog(" + n + ")");
}
return QRMath.LOG_TABLE[n];
},
gexp : function(n) {
while (n < 0) {
n += 255;
}
while (n >= 256) {
n -= 255;
}
return QRMath.EXP_TABLE[n];
},
EXP_TABLE : new Array(256),
LOG_TABLE : new Array(256)
};
for (var i = 0; i < 8; i++) {
QRMath.EXP_TABLE[i] = 1 << i;
}
for (var i = 8; i < 256; i++) {
QRMath.EXP_TABLE[i] = QRMath.EXP_TABLE[i - 4]
^ QRMath.EXP_TABLE[i - 5]
^ QRMath.EXP_TABLE[i - 6]
^ QRMath.EXP_TABLE[i - 8];
}
for (var i = 0; i < 255; i++) {
QRMath.LOG_TABLE[QRMath.EXP_TABLE[i] ] = i;
}
module.exports = QRMath;
/***/ }),
/***/ 9301:
/***/ ((module) => {
module.exports = {
MODE_NUMBER : 1 << 0,
MODE_ALPHA_NUM : 1 << 1,
MODE_8BIT_BYTE : 1 << 2,
MODE_KANJI : 1 << 3
};
/***/ }),
/***/ 3021:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
var QRMath = __nccwpck_require__(8997);
function QRPolynomial(num, shift) {
if (num.length === undefined) {
throw new Error(num.length + "/" + shift);
}
var offset = 0;
while (offset < num.length && num[offset] === 0) {
offset++;
}
this.num = new Array(num.length - offset + shift);
for (var i = 0; i < num.length - offset; i++) {
this.num[i] = num[i + offset];
}
}
QRPolynomial.prototype = {
get : function(index) {
return this.num[index];
},
getLength : function() {
return this.num.length;
},
multiply : function(e) {
var num = new Array(this.getLength() + e.getLength() - 1);
for (var i = 0; i < this.getLength(); i++) {
for (var j = 0; j < e.getLength(); j++) {
num[i + j] ^= QRMath.gexp(QRMath.glog(this.get(i) ) + QRMath.glog(e.get(j) ) );
}
}
return new QRPolynomial(num, 0);
},
mod : function(e) {
if (this.getLength() - e.getLength() < 0) {
return this;
}
var ratio = QRMath.glog(this.get(0) ) - QRMath.glog(e.get(0) );
var num = new Array(this.getLength() );
for (var i = 0; i < this.getLength(); i++) {
num[i] = this.get(i);
}
for (var x = 0; x < e.getLength(); x++) {
num[x] ^= QRMath.gexp(QRMath.glog(e.get(x) ) + ratio);
}
// recursive call
return new QRPolynomial(num, 0).mod(e);
}
};
module.exports = QRPolynomial;
/***/ }),
/***/ 649:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
var QRErrorCorrectLevel = __nccwpck_require__(4383);
function QRRSBlock(totalCount, dataCount) {
this.totalCount = totalCount;
this.dataCount = dataCount;
}
QRRSBlock.RS_BLOCK_TABLE = [
// L
// M
// Q
// H
// 1
[1, 26, 19],
[1, 26, 16],
[1, 26, 13],
[1, 26, 9],
// 2
[1, 44, 34],
[1, 44, 28],
[1, 44, 22],
[1, 44, 16],
// 3
[1, 70, 55],
[1, 70, 44],
[2, 35, 17],
[2, 35, 13],
// 4
[1, 100, 80],
[2, 50, 32],
[2, 50, 24],
[4, 25, 9],
// 5
[1, 134, 108],
[2, 67, 43],
[2, 33, 15, 2, 34, 16],
[2, 33, 11, 2, 34, 12],
// 6
[2, 86, 68],
[4, 43, 27],
[4, 43, 19],
[4, 43, 15],
// 7
[2, 98, 78],
[4, 49, 31],
[2, 32, 14, 4, 33, 15],
[4, 39, 13, 1, 40, 14],
// 8
[2, 121, 97],
[2, 60, 38, 2, 61, 39],
[4, 40, 18, 2, 41, 19],
[4, 40, 14, 2, 41, 15],
// 9
[2, 146, 116],
[3, 58, 36, 2, 59, 37],
[4, 36, 16, 4, 37, 17],
[4, 36, 12, 4, 37, 13],
// 10
[2, 86, 68, 2, 87, 69],
[4, 69, 43, 1, 70, 44],
[6, 43, 19, 2, 44, 20],
[6, 43, 15, 2, 44, 16],
// 11
[4, 101, 81],
[1, 80, 50, 4, 81, 51],
[4, 50, 22, 4, 51, 23],
[3, 36, 12, 8, 37, 13],
// 12
[2, 116, 92, 2, 117, 93],
[6, 58, 36, 2, 59, 37],
[4, 46, 20, 6, 47, 21],
[7, 42, 14, 4, 43, 15],
// 13
[4, 133, 107],
[8, 59, 37, 1, 60, 38],
[8, 44, 20, 4, 45, 21],
[12, 33, 11, 4, 34, 12],
// 14
[3, 145, 115, 1, 146, 116],
[4, 64, 40, 5, 65, 41],
[11, 36, 16, 5, 37, 17],
[11, 36, 12, 5, 37, 13],
// 15
[5, 109, 87, 1, 110, 88],
[5, 65, 41, 5, 66, 42],
[5, 54, 24, 7, 55, 25],
[11, 36, 12],
// 16
[5, 122, 98, 1, 123, 99],
[7, 73, 45, 3, 74, 46],
[15, 43, 19, 2, 44, 20],
[3, 45, 15, 13, 46, 16],
// 17
[1, 135, 107, 5, 136, 108],
[10, 74, 46, 1, 75, 47],
[1, 50, 22, 15, 51, 23],
[2, 42, 14, 17, 43, 15],
// 18
[5, 150, 120, 1, 151, 121],
[9, 69, 43, 4, 70, 44],
[17, 50, 22, 1, 51, 23],
[2, 42, 14, 19, 43, 15],
// 19
[3, 141, 113, 4, 142, 114],
[3, 70, 44, 11, 71, 45],
[17, 47, 21, 4, 48, 22],
[9, 39, 13, 16, 40, 14],
// 20
[3, 135, 107, 5, 136, 108],
[3, 67, 41, 13, 68, 42],
[15, 54, 24, 5, 55, 25],
[15, 43, 15, 10, 44, 16],
// 21
[4, 144, 116, 4, 145, 117],
[17, 68, 42],
[17, 50, 22, 6, 51, 23],
[19, 46, 16, 6, 47, 17],
// 22
[2, 139, 111, 7, 140, 112],
[17, 74, 46],
[7, 54, 24, 16, 55, 25],
[34, 37, 13],
// 23
[4, 151, 121, 5, 152, 122],
[4, 75, 47, 14, 76, 48],
[11, 54, 24, 14, 55, 25],
[16, 45, 15, 14, 46, 16],
// 24
[6, 147, 117, 4, 148, 118],
[6, 73, 45, 14, 74, 46],
[11, 54, 24, 16, 55, 25],
[30, 46, 16, 2, 47, 17],
// 25
[8, 132, 106, 4, 133, 107],
[8, 75, 47, 13, 76, 48],
[7, 54, 24, 22, 55, 25],
[22, 45, 15, 13, 46, 16],
// 26
[10, 142, 114, 2, 143, 115],
[19, 74, 46, 4, 75, 47],
[28, 50, 22, 6, 51, 23],
[33, 46, 16, 4, 47, 17],
// 27
[8, 152, 122, 4, 153, 123],
[22, 73, 45, 3, 74, 46],
[8, 53, 23, 26, 54, 24],
[12, 45, 15, 28, 46, 16],
// 28
[3, 147, 117, 10, 148, 118],
[3, 73, 45, 23, 74, 46],
[4, 54, 24, 31, 55, 25],
[11, 45, 15, 31, 46, 16],
// 29
[7, 146, 116, 7, 147, 117],
[21, 73, 45, 7, 74, 46],
[1, 53, 23, 37, 54, 24],
[19, 45, 15, 26, 46, 16],
// 30
[5, 145, 115, 10, 146, 116],
[19, 75, 47, 10, 76, 48],
[15, 54, 24, 25, 55, 25],
[23, 45, 15, 25, 46, 16],
// 31
[13, 145, 115, 3, 146, 116],
[2, 74, 46, 29, 75, 47],
[42, 54, 24, 1, 55, 25],
[23, 45, 15, 28, 46, 16],
// 32
[17, 145, 115],
[10, 74, 46, 23, 75, 47],
[10, 54, 24, 35, 55, 25],
[19, 45, 15, 35, 46, 16],
// 33
[17, 145, 115, 1, 146, 116],
[14, 74, 46, 21, 75, 47],
[29, 54, 24, 19, 55, 25],
[11, 45, 15, 46, 46, 16],
// 34
[13, 145, 115, 6, 146, 116],
[14, 74, 46, 23, 75, 47],
[44, 54, 24, 7, 55, 25],
[59, 46, 16, 1, 47, 17],
// 35
[12, 151, 121, 7, 152, 122],
[12, 75, 47, 26, 76, 48],
[39, 54, 24, 14, 55, 25],
[22, 45, 15, 41, 46, 16],
// 36
[6, 151, 121, 14, 152, 122],
[6, 75, 47, 34, 76, 48],
[46, 54, 24, 10, 55, 25],
[2, 45, 15, 64, 46, 16],
// 37
[17, 152, 122, 4, 153, 123],
[29, 74, 46, 14, 75, 47],
[49, 54, 24, 10, 55, 25],
[24, 45, 15, 46, 46, 16],
// 38
[4, 152, 122, 18, 153, 123],
[13, 74, 46, 32, 75, 47],
[48, 54, 24, 14, 55, 25],
[42, 45, 15, 32, 46, 16],
// 39
[20, 147, 117, 4, 148, 118],
[40, 75, 47, 7, 76, 48],
[43, 54, 24, 22, 55, 25],
[10, 45, 15, 67, 46, 16],
// 40
[19, 148, 118, 6, 149, 119],
[18, 75, 47, 31, 76, 48],
[34, 54, 24, 34, 55, 25],
[20, 45, 15, 61, 46, 16]
];
QRRSBlock.getRSBlocks = function(typeNumber, errorCorrectLevel) {
var rsBlock = QRRSBlock.getRsBlockTable(typeNumber, errorCorrectLevel);
if (rsBlock === undefined) {
throw new Error("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" + errorCorrectLevel);
}
var length = rsBlock.length / 3;
var list = [];
for (var i = 0; i < length; i++) {
var count = rsBlock[i * 3 + 0];
var totalCount = rsBlock[i * 3 + 1];
var dataCount = rsBlock[i * 3 + 2];
for (var j = 0; j < count; j++) {
list.push(new QRRSBlock(totalCount, dataCount) );
}
}
return list;
};
QRRSBlock.getRsBlockTable = function(typeNumber, errorCorrectLevel) {
switch(errorCorrectLevel) {
case QRErrorCorrectLevel.L :
return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 0];
case QRErrorCorrectLevel.M :
return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 1];
case QRErrorCorrectLevel.Q :
return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 2];
case QRErrorCorrectLevel.H :
return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 3];
default :
return undefined;
}
};
module.exports = QRRSBlock;
/***/ }),
/***/ 2832:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
var QRMode = __nccwpck_require__(9301);
var QRPolynomial = __nccwpck_require__(3021);
var QRMath = __nccwpck_require__(8997);
var QRMaskPattern = __nccwpck_require__(6887);
var QRUtil = {
PATTERN_POSITION_TABLE : [
[],
[6, 18],
[6, 22],
[6, 26],
[6, 30],
[6, 34],
[6, 22, 38],
[6, 24, 42],
[6, 26, 46],
[6, 28, 50],
[6, 30, 54],
[6, 32, 58],
[6, 34, 62],
[6, 26, 46, 66],
[6, 26, 48, 70],
[6, 26, 50, 74],
[6, 30, 54, 78],
[6, 30, 56, 82],
[6, 30, 58, 86],
[6, 34, 62, 90],
[6, 28, 50, 72, 94],
[6, 26, 50, 74, 98],
[6, 30, 54, 78, 102],
[6, 28, 54, 80, 106],
[6, 32, 58, 84, 110],
[6, 30, 58, 86, 114],
[6, 34, 62, 90, 118],
[6, 26, 50, 74, 98, 122],
[6, 30, 54, 78, 102, 126],
[6, 26, 52, 78, 104, 130],
[6, 30, 56, 82, 108, 134],
[6, 34, 60, 86, 112, 138],
[6, 30, 58, 86, 114, 142],
[6, 34, 62, 90, 118, 146],
[6, 30, 54, 78, 102, 126, 150],
[6, 24, 50, 76, 102, 128, 154],
[6, 28, 54, 80, 106, 132, 158],
[6, 32, 58, 84, 110, 136, 162],
[6, 26, 54, 82, 110, 138, 166],
[6, 30, 58, 86, 114, 142, 170]
],
G15 : (1 << 10) | (1 << 8) | (1 << 5) | (1 << 4) | (1 << 2) | (1 << 1) | (1 << 0),
G18 : (1 << 12) | (1 << 11) | (1 << 10) | (1 << 9) | (1 << 8) | (1 << 5) | (1 << 2) | (1 << 0),
G15_MASK : (1 << 14) | (1 << 12) | (1 << 10) | (1 << 4) | (1 << 1),
getBCHTypeInfo : function(data) {
var d = data << 10;
while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15) >= 0) {
d ^= (QRUtil.G15 << (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15) ) );
}
return ( (data << 10) | d) ^ QRUtil.G15_MASK;
},
getBCHTypeNumber : function(data) {
var d = data << 12;
while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18) >= 0) {
d ^= (QRUtil.G18 << (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18) ) );
}
return (data << 12) | d;
},
getBCHDigit : function(data) {
var digit = 0;
while (data !== 0) {
digit++;
data >>>= 1;
}
return digit;
},
getPatternPosition : function(typeNumber) {
return QRUtil.PATTERN_POSITION_TABLE[typeNumber - 1];
},
getMask : function(maskPattern, i, j) {
switch (maskPattern) {
case QRMaskPattern.PATTERN000 : return (i + j) % 2 === 0;
case QRMaskPattern.PATTERN001 : return i % 2 === 0;
case QRMaskPattern.PATTERN010 : return j % 3 === 0;
case QRMaskPattern.PATTERN011 : return (i + j) % 3 === 0;
case QRMaskPattern.PATTERN100 : return (Math.floor(i / 2) + Math.floor(j / 3) ) % 2 === 0;
case QRMaskPattern.PATTERN101 : return (i * j) % 2 + (i * j) % 3 === 0;
case QRMaskPattern.PATTERN110 : return ( (i * j) % 2 + (i * j) % 3) % 2 === 0;
case QRMaskPattern.PATTERN111 : return ( (i * j) % 3 + (i + j) % 2) % 2 === 0;
default :
throw new Error("bad maskPattern:" + maskPattern);
}
},
getErrorCorrectPolynomial : function(errorCorrectLength) {
var a = new QRPolynomial([1], 0);
for (var i = 0; i < errorCorrectLength; i++) {
a = a.multiply(new QRPolynomial([1, QRMath.gexp(i)], 0) );
}
return a;
},
getLengthInBits : function(mode, type) {
if (1 <= type && type < 10) {
// 1 - 9
switch(mode) {
case QRMode.MODE_NUMBER : return 10;
case QRMode.MODE_ALPHA_NUM : return 9;
case QRMode.MODE_8BIT_BYTE : return 8;
case QRMode.MODE_KANJI : return 8;
default :
throw new Error("mode:" + mode);
}
} else if (type < 27) {
// 10 - 26
switch(mode) {
case QRMode.MODE_NUMBER : return 12;
case QRMode.MODE_ALPHA_NUM : return 11;
case QRMode.MODE_8BIT_BYTE : return 16;
case QRMode.MODE_KANJI : return 10;
default :
throw new Error("mode:" + mode);
}
} else if (type < 41) {
// 27 - 40
switch(mode) {
case QRMode.MODE_NUMBER : return 14;
case QRMode.MODE_ALPHA_NUM : return 13;
case QRMode.MODE_8BIT_BYTE : return 16;
case QRMode.MODE_KANJI : return 12;
default :
throw new Error("mode:" + mode);
}
} else {
throw new Error("type:" + type);
}
},
getLostPoint : function(qrCode) {
var moduleCount = qrCode.getModuleCount();
var lostPoint = 0;
var row = 0;
var col = 0;
// LEVEL1
for (row = 0; row < moduleCount; row++) {
for (col = 0; col < moduleCount; col++) {
var sameCount = 0;
var dark = qrCode.isDark(row, col);
for (var r = -1; r <= 1; r++) {
if (row + r < 0 || moduleCount <= row + r) {
continue;
}
for (var c = -1; c <= 1; c++) {
if (col + c < 0 || moduleCount <= col + c) {
continue;
}
if (r === 0 && c === 0) {
continue;
}
if (dark === qrCode.isDark(row + r, col + c) ) {
sameCount++;
}
}
}
if (sameCount > 5) {
lostPoint += (3 + sameCount - 5);
}
}
}
// LEVEL2
for (row = 0; row < moduleCount - 1; row++) {
for (col = 0; col < moduleCount - 1; col++) {
var count = 0;
if (qrCode.isDark(row, col ) ) count++;
if (qrCode.isDark(row + 1, col ) ) count++;
if (qrCode.isDark(row, col + 1) ) count++;
if (qrCode.isDark(row + 1, col + 1) ) count++;
if (count === 0 || count === 4) {
lostPoint += 3;
}
}
}
// LEVEL3
for (row = 0; row < moduleCount; row++) {
for (col = 0; col < moduleCount - 6; col++) {
if (qrCode.isDark(row, col) &&
!qrCode.isDark(row, col + 1) &&
qrCode.isDark(row, col + 2) &&
qrCode.isDark(row, col + 3) &&
qrCode.isDark(row, col + 4) &&
!qrCode.isDark(row, col + 5) &&
qrCode.isDark(row, col + 6) ) {
lostPoint += 40;
}
}
}
for (col = 0; col < moduleCount; col++) {
for (row = 0; row < moduleCount - 6; row++) {
if (qrCode.isDark(row, col) &&
!qrCode.isDark(row + 1, col) &&
qrCode.isDark(row + 2, col) &&
qrCode.isDark(row + 3, col) &&
qrCode.isDark(row + 4, col) &&
!qrCode.isDark(row + 5, col) &&
qrCode.isDark(row + 6, col) ) {
lostPoint += 40;
}
}
}
// LEVEL4
var darkCount = 0;
for (col = 0; col < moduleCount; col++) {
for (row = 0; row < moduleCount; row++) {
if (qrCode.isDark(row, col) ) {
darkCount++;
}
}
}
var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5;
lostPoint += ratio * 10;
return lostPoint;
}
};
module.exports = QRUtil;
/***/ }),
/***/ 571:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
//---------------------------------------------------------------------
// QRCode for JavaScript
//
// Copyright (c) 2009 Kazuhiko Arase
//
// URL: http://www.d-project.com/
//
// Licensed under the MIT license:
// http://www.opensource.org/licenses/mit-license.php
//
// The word "QR Code" is registered trademark of
// DENSO WAVE INCORPORATED
// http://www.denso-wave.com/qrcode/faqpatent-e.html
//
//---------------------------------------------------------------------
// Modified to work in node for this project (and some refactoring)
//---------------------------------------------------------------------
var QR8bitByte = __nccwpck_require__(5436);
var QRUtil = __nccwpck_require__(2832);
var QRPolynomial = __nccwpck_require__(3021);
var QRRSBlock = __nccwpck_require__(649);
var QRBitBuffer = __nccwpck_require__(4471);
function QRCode(typeNumber, errorCorrectLevel) {
this.typeNumber = typeNumber;
this.errorCorrectLevel = errorCorrectLevel;
this.modules = null;
this.moduleCount = 0;
this.dataCache = null;
this.dataList = [];
}
QRCode.prototype = {
addData : function(data) {
var newData = new QR8bitByte(data);
this.dataList.push(newData);
this.dataCache = null;
},
isDark : function(row, col) {
if (row < 0 || this.moduleCount <= row || col < 0 || this.moduleCount <= col) {
throw new Error(row + "," + col);
}
return this.modules[row][col];
},
getModuleCount : function() {
return this.moduleCount;
},
make : function() {
// Calculate automatically typeNumber if provided is < 1
if (this.typeNumber < 1 ){
var typeNumber = 1;
for (typeNumber = 1; typeNumber < 40; typeNumber++) {
var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, this.errorCorrectLevel);
var buffer = new QRBitBuffer();
var totalDataCount = 0;
for (var i = 0; i < rsBlocks.length; i++) {
totalDataCount += rsBlocks[i].dataCount;
}
for (var x = 0; x < this.dataList.length; x++) {
var data = this.dataList[x];
buffer.put(data.mode, 4);
buffer.put(data.getLength(), QRUtil.getLengthInBits(data.mode, typeNumber) );
data.write(buffer);
}
if (buffer.getLengthInBits() <= totalDataCount * 8)
break;
}
this.typeNumber = typeNumber;
}
this.makeImpl(false, this.getBestMaskPattern() );
},
makeImpl : function(test, maskPattern) {
this.moduleCount = this.typeNumber * 4 + 17;
this.modules = new Array(this.moduleCount);
for (var row = 0; row < this.moduleCount; row++) {
this.modules[row] = new Array(this.moduleCount);
for (var col = 0; col < this.moduleCount; col++) {
this.modules[row][col] = null;//(col + row) % 3;
}
}
this.setupPositionProbePattern(0, 0);
this.setupPositionProbePattern(this.moduleCount - 7, 0);
this.setupPositionProbePattern(0, this.moduleCount - 7);
this.setupPositionAdjustPattern();
this.setupTimingPattern();
this.setupTypeInfo(test, maskPattern);
if (this.typeNumber >= 7) {
this.setupTypeNumber(test);
}
if (this.dataCache === null) {
this.dataCache = QRCode.createData(this.typeNumber, this.errorCorrectLevel, this.dataList);
}
this.mapData(this.dataCache, maskPattern);
},
setupPositionProbePattern : function(row, col) {
for (var r = -1; r <= 7; r++) {
if (row + r <= -1 || this.moduleCount <= row + r) continue;
for (var c = -1; c <= 7; c++) {
if (col + c <= -1 || this.moduleCount <= col + c) continue;
if ( (0 <= r && r <= 6 && (c === 0 || c === 6) ) ||
(0 <= c && c <= 6 && (r === 0 || r === 6) ) ||
(2 <= r && r <= 4 && 2 <= c && c <= 4) ) {
this.modules[row + r][col + c] = true;
} else {
this.modules[row + r][col + c] = false;
}
}
}
},
getBestMaskPattern : function() {
var minLostPoint = 0;
var pattern = 0;
for (var i = 0; i < 8; i++) {
this.makeImpl(true, i);
var lostPoint = QRUtil.getLostPoint(this);
if (i === 0 || minLostPoint > lostPoint) {
minLostPoint = lostPoint;
pattern = i;
}
}
return pattern;
},
createMovieClip : function(target_mc, instance_name, depth) {
var qr_mc = target_mc.createEmptyMovieClip(instance_name, depth);
var cs = 1;
this.make();
for (var row = 0; row < this.modules.length; row++) {
var y = row * cs;
for (var col = 0; col < this.modules[row].length; col++) {
var x = col * cs;
var dark = this.modules[row][col];
if (dark) {
qr_mc.beginFill(0, 100);
qr_mc.moveTo(x, y);
qr_mc.lineTo(x + cs, y);
qr_mc.lineTo(x + cs, y + cs);
qr_mc.lineTo(x, y + cs);
qr_mc.endFill();
}
}
}
return qr_mc;
},
setupTimingPattern : function() {
for (var r = 8; r < this.moduleCount - 8; r++) {
if (this.modules[r][6] !== null) {
continue;
}
this.modules[r][6] = (r % 2 === 0);
}
for (var c = 8; c < this.moduleCount - 8; c++) {
if (this.modules[6][c] !== null) {
continue;
}
this.modules[6][c] = (c % 2 === 0);
}
},
setupPositionAdjustPattern : function() {
var pos = QRUtil.getPatternPosition(this.typeNumber);
for (var i = 0; i < pos.length; i++) {
for (var j = 0; j < pos.length; j++) {
var row = pos[i];
var col = pos[j];
if (this.modules[row][col] !== null) {
continue;
}
for (var r = -2; r <= 2; r++) {
for (var c = -2; c <= 2; c++) {
if (Math.abs(r) === 2 ||
Math.abs(c) === 2 ||
(r === 0 && c === 0) ) {
this.modules[row + r][col + c] = true;
} else {
this.modules[row + r][col + c] = false;
}
}
}
}
}
},
setupTypeNumber : function(test) {
var bits = QRUtil.getBCHTypeNumber(this.typeNumber);
var mod;
for (var i = 0; i < 18; i++) {
mod = (!test && ( (bits >> i) & 1) === 1);
this.modules[Math.floor(i / 3)][i % 3 + this.moduleCount - 8 - 3] = mod;
}
for (var x = 0; x < 18; x++) {
mod = (!test && ( (bits >> x) & 1) === 1);
this.modules[x % 3 + this.moduleCount - 8 - 3][Math.floor(x / 3)] = mod;
}
},
setupTypeInfo : function(test, maskPattern) {
var data = (this.errorCorrectLevel << 3) | maskPattern;
var bits = QRUtil.getBCHTypeInfo(data);
var mod;
// vertical
for (var v = 0; v < 15; v++) {
mod = (!test && ( (bits >> v) & 1) === 1);
if (v < 6) {
this.modules[v][8] = mod;
} else if (v < 8) {
this.modules[v + 1][8] = mod;
} else {
this.modules[this.moduleCount - 15 + v][8] = mod;
}
}
// horizontal
for (var h = 0; h < 15; h++) {
mod = (!test && ( (bits >> h) & 1) === 1);
if (h < 8) {
this.modules[8][this.moduleCount - h - 1] = mod;
} else if (h < 9) {
this.modules[8][15 - h - 1 + 1] = mod;
} else {
this.modules[8][15 - h - 1] = mod;
}
}
// fixed module
this.modules[this.moduleCount - 8][8] = (!test);
},
mapData : function(data, maskPattern) {
var inc = -1;
var row = this.moduleCount - 1;
var bitIndex = 7;
var byteIndex = 0;
for (var col = this.moduleCount - 1; col > 0; col -= 2) {
if (col === 6) col--;
while (true) {
for (var c = 0; c < 2; c++) {
if (this.modules[row][col - c] === null) {
var dark = false;
if (byteIndex < data.length) {
dark = ( ( (data[byteIndex] >>> bitIndex) & 1) === 1);
}
var mask = QRUtil.getMask(maskPattern, row, col - c);
if (mask) {
dark = !dark;
}
this.modules[row][col - c] = dark;
bitIndex--;
if (bitIndex === -1) {
byteIndex++;
bitIndex = 7;
}
}
}
row += inc;
if (row < 0 || this.moduleCount <= row) {
row -= inc;
inc = -inc;
break;
}
}
}
}
};
QRCode.PAD0 = 0xEC;
QRCode.PAD1 = 0x11;
QRCode.createData = function(typeNumber, errorCorrectLevel, dataList) {
var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, errorCorrectLevel);
var buffer = new QRBitBuffer();
for (var i = 0; i < dataList.length; i++) {
var data = dataList[i];
buffer.put(data.mode, 4);
buffer.put(data.getLength(), QRUtil.getLengthInBits(data.mode, typeNumber) );
data.write(buffer);
}
// calc num max data.
var totalDataCount = 0;
for (var x = 0; x < rsBlocks.length; x++) {
totalDataCount += rsBlocks[x].dataCount;
}
if (buffer.getLengthInBits() > totalDataCount * 8) {
throw new Error("code length overflow. (" +
buffer.getLengthInBits() +
">" +
totalDataCount * 8 +
")");
}
// end code
if (buffer.getLengthInBits() + 4 <= totalDataCount * 8) {
buffer.put(0, 4);
}
// padding
while (buffer.getLengthInBits() % 8 !== 0) {
buffer.putBit(false);
}
// padding
while (true) {
if (buffer.getLengthInBits() >= totalDataCount * 8) {
break;
}
buffer.put(QRCode.PAD0, 8);
if (buffer.getLengthInBits() >= totalDataCount * 8) {
break;
}
buffer.put(QRCode.PAD1, 8);
}
return QRCode.createBytes(buffer, rsBlocks);
};
QRCode.createBytes = function(buffer, rsBlocks) {
var offset = 0;
var maxDcCount = 0;
var maxEcCount = 0;
var dcdata = new Array(rsBlocks.length);
var ecdata = new Array(rsBlocks.length);
for (var r = 0; r < rsBlocks.length; r++) {
var dcCount = rsBlocks[r].dataCount;
var ecCount = rsBlocks[r].totalCount - dcCount;
maxDcCount = Math.max(maxDcCount, dcCount);
maxEcCount = Math.max(maxEcCount, ecCount);
dcdata[r] = new Array(dcCount);
for (var i = 0; i < dcdata[r].length; i++) {
dcdata[r][i] = 0xff & buffer.buffer[i + offset];
}
offset += dcCount;
var rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount);
var rawPoly = new QRPolynomial(dcdata[r], rsPoly.getLength() - 1);
var modPoly = rawPoly.mod(rsPoly);
ecdata[r] = new Array(rsPoly.getLength() - 1);
for (var x = 0; x < ecdata[r].length; x++) {
var modIndex = x + modPoly.getLength() - ecdata[r].length;
ecdata[r][x] = (modIndex >= 0)? modPoly.get(modIndex) : 0;
}
}
var totalCodeCount = 0;
for (var y = 0; y < rsBlocks.length; y++) {
totalCodeCount += rsBlocks[y].totalCount;
}
var data = new Array(totalCodeCount);
var index = 0;
for (var z = 0; z < maxDcCount; z++) {
for (var s = 0; s < rsBlocks.length; s++) {
if (z < dcdata[s].length) {
data[index++] = dcdata[s][z];
}
}
}
for (var xx = 0; xx < maxEcCount; xx++) {
for (var t = 0; t < rsBlocks.length; t++) {
if (xx < ecdata[t].length) {
data[index++] = ecdata[t][xx];
}
}
}
return data;
};
module.exports = QRCode;
/***/ }),
/***/ 2043:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
;(function (sax) { // wrapper for non-node envs
sax.parser = function (strict, opt) { return new SAXParser(strict, opt) }
sax.SAXParser = SAXParser
sax.SAXStream = SAXStream
sax.createStream = createStream
// When we pass the MAX_BUFFER_LENGTH position, start checking for buffer overruns.
// When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer lengths)),
// since that's the earliest that a buffer overrun could occur. This way, checks are
// as rare as required, but as often as necessary to ensure never crossing this bound.
// Furthermore, buffers are only tested at most once per write(), so passing a very
// large string into write() might have undesirable effects, but this is manageable by
// the caller, so it is assumed to be safe. Thus, a call to write() may, in the extreme
// edge case, result in creating at most one complete copy of the string passed in.
// Set to Infinity to have unlimited buffers.
sax.MAX_BUFFER_LENGTH = 64 * 1024
var buffers = [
'comment', 'sgmlDecl', 'textNode', 'tagName', 'doctype',
'procInstName', 'procInstBody', 'entity', 'attribName',
'attribValue', 'cdata', 'script'
]
sax.EVENTS = [
'text',
'processinginstruction',
'sgmldeclaration',
'doctype',
'comment',
'opentagstart',
'attribute',
'opentag',
'closetag',
'opencdata',
'cdata',
'closecdata',
'error',
'end',
'ready',
'script',
'opennamespace',
'closenamespace'
]
function SAXParser (strict, opt) {
if (!(this instanceof SAXParser)) {
return new SAXParser(strict, opt)
}
var parser = this
clearBuffers(parser)
parser.q = parser.c = ''
parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH
parser.opt = opt || {}
parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags
parser.looseCase = parser.opt.lowercase ? 'toLowerCase' : 'toUpperCase'
parser.tags = []
parser.closed = parser.closedRoot = parser.sawRoot = false
parser.tag = parser.error = null
parser.strict = !!strict
parser.noscript = !!(strict || parser.opt.noscript)
parser.state = S.BEGIN
parser.strictEntities = parser.opt.strictEntities
parser.ENTITIES = parser.strictEntities ? Object.create(sax.XML_ENTITIES) : Object.create(sax.ENTITIES)
parser.attribList = []
// namespaces form a prototype chain.
// it always points at the current tag,
// which protos to its parent tag.
if (parser.opt.xmlns) {
parser.ns = Object.create(rootNS)
}
// mostly just for error reporting
parser.trackPosition = parser.opt.position !== false
if (parser.trackPosition) {
parser.position = parser.line = parser.column = 0
}
emit(parser, 'onready')
}
if (!Object.create) {
Object.create = function (o) {
function F () {}
F.prototype = o
var newf = new F()
return newf
}
}
if (!Object.keys) {
Object.keys = function (o) {
var a = []
for (var i in o) if (o.hasOwnProperty(i)) a.push(i)
return a
}
}
function checkBufferLength (parser) {
var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10)
var maxActual = 0
for (var i = 0, l = buffers.length; i < l; i++) {
var len = parser[buffers[i]].length
if (len > maxAllowed) {
// Text/cdata nodes can get big, and since they're buffered,
// we can get here under normal conditions.
// Avoid issues by emitting the text node now,
// so at least it won't get any bigger.
switch (buffers[i]) {
case 'textNode':
closeText(parser)
break
case 'cdata':
emitNode(parser, 'oncdata', parser.cdata)
parser.cdata = ''
break
case 'script':
emitNode(parser, 'onscript', parser.script)
parser.script = ''
break
default:
error(parser, 'Max buffer length exceeded: ' + buffers[i])
}
}
maxActual = Math.max(maxActual, len)
}
// schedule the next check for the earliest possible buffer overrun.
var m = sax.MAX_BUFFER_LENGTH - maxActual
parser.bufferCheckPosition = m + parser.position
}
function clearBuffers (parser) {
for (var i = 0, l = buffers.length; i < l; i++) {
parser[buffers[i]] = ''
}
}
function flushBuffers (parser) {
closeText(parser)
if (parser.cdata !== '') {
emitNode(parser, 'oncdata', parser.cdata)
parser.cdata = ''
}
if (parser.script !== '') {
emitNode(parser, 'onscript', parser.script)
parser.script = ''
}
}
SAXParser.prototype = {
end: function () { end(this) },
write: write,
resume: function () { this.error = null; return this },
close: function () { return this.write(null) },
flush: function () { flushBuffers(this) }
}
var Stream
try {
Stream = (__nccwpck_require__(2781).Stream)
} catch (ex) {
Stream = function () {}
}
var streamWraps = sax.EVENTS.filter(function (ev) {
return ev !== 'error' && ev !== 'end'
})
function createStream (strict, opt) {
return new SAXStream(strict, opt)
}
function SAXStream (strict, opt) {
if (!(this instanceof SAXStream)) {
return new SAXStream(strict, opt)
}
Stream.apply(this)
this._parser = new SAXParser(strict, opt)
this.writable = true
this.readable = true
var me = this
this._parser.onend = function () {
me.emit('end')
}
this._parser.onerror = function (er) {
me.emit('error', er)
// if didn't throw, then means error was handled.
// go ahead and clear error, so we can write again.
me._parser.error = null
}
this._decoder = null
streamWraps.forEach(function (ev) {
Object.defineProperty(me, 'on' + ev, {
get: function () {
return me._parser['on' + ev]
},
set: function (h) {
if (!h) {
me.removeAllListeners(ev)
me._parser['on' + ev] = h
return h
}
me.on(ev, h)
},
enumerable: true,
configurable: false
})
})
}
SAXStream.prototype = Object.create(Stream.prototype, {
constructor: {
value: SAXStream
}
})
SAXStream.prototype.write = function (data) {
if (typeof Buffer === 'function' &&
typeof Buffer.isBuffer === 'function' &&
Buffer.isBuffer(data)) {
if (!this._decoder) {
var SD = (__nccwpck_require__(1576).StringDecoder)
this._decoder = new SD('utf8')
}
data = this._decoder.write(data)
}
this._parser.write(data.toString())
this.emit('data', data)
return true
}
SAXStream.prototype.end = function (chunk) {
if (chunk && chunk.length) {
this.write(chunk)
}
this._parser.end()
return true
}
SAXStream.prototype.on = function (ev, handler) {
var me = this
if (!me._parser['on' + ev] && streamWraps.indexOf(ev) !== -1) {
me._parser['on' + ev] = function () {
var args = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments)
args.splice(0, 0, ev)
me.emit.apply(me, args)
}
}
return Stream.prototype.on.call(me, ev, handler)
}
// this really needs to be replaced with character classes.
// XML allows all manner of ridiculous numbers and digits.
var CDATA = '[CDATA['
var DOCTYPE = 'DOCTYPE'
var XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace'
var XMLNS_NAMESPACE = 'http://www.w3.org/2000/xmlns/'
var rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE }
// http://www.w3.org/TR/REC-xml/#NT-NameStartChar
// This implementation works on strings, a single character at a time
// as such, it cannot ever support astral-plane characters (10000-EFFFF)
// without a significant breaking change to either this parser, or the
// JavaScript language. Implementation of an emoji-capable xml parser
// is left as an exercise for the reader.
var nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/
var nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/
var entityStart = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/
var entityBody = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/
function isWhitespace (c) {
return c === ' ' || c === '\n' || c === '\r' || c === '\t'
}
function isQuote (c) {
return c === '"' || c === '\''
}
function isAttribEnd (c) {
return c === '>' || isWhitespace(c)
}
function isMatch (regex, c) {
return regex.test(c)
}
function notMatch (regex, c) {
return !isMatch(regex, c)
}
var S = 0
sax.STATE = {
BEGIN: S++, // leading byte order mark or whitespace
BEGIN_WHITESPACE: S++, // leading whitespace
TEXT: S++, // general stuff
TEXT_ENTITY: S++, // &amp and such.
OPEN_WAKA: S++, // <
SGML_DECL: S++, // <!BLARG
SGML_DECL_QUOTED: S++, // <!BLARG foo "bar
DOCTYPE: S++, // <!DOCTYPE
DOCTYPE_QUOTED: S++, // <!DOCTYPE "//blah
DOCTYPE_DTD: S++, // <!DOCTYPE "//blah" [ ...
DOCTYPE_DTD_QUOTED: S++, // <!DOCTYPE "//blah" [ "foo
COMMENT_STARTING: S++, // <!-
COMMENT: S++, // <!--
COMMENT_ENDING: S++, // <!-- blah -
COMMENT_ENDED: S++, // <!-- blah --
CDATA: S++, // <![CDATA[ something
CDATA_ENDING: S++, // ]
CDATA_ENDING_2: S++, // ]]
PROC_INST: S++, // <?hi
PROC_INST_BODY: S++, // <?hi there
PROC_INST_ENDING: S++, // <?hi "there" ?
OPEN_TAG: S++, // <strong
OPEN_TAG_SLASH: S++, // <strong /
ATTRIB: S++, // <a
ATTRIB_NAME: S++, // <a foo
ATTRIB_NAME_SAW_WHITE: S++, // <a foo _
ATTRIB_VALUE: S++, // <a foo=
ATTRIB_VALUE_QUOTED: S++, // <a foo="bar
ATTRIB_VALUE_CLOSED: S++, // <a foo="bar"
ATTRIB_VALUE_UNQUOTED: S++, // <a foo=bar
ATTRIB_VALUE_ENTITY_Q: S++, // <foo bar="&quot;"
ATTRIB_VALUE_ENTITY_U: S++, // <foo bar=&quot
CLOSE_TAG: S++, // </a
CLOSE_TAG_SAW_WHITE: S++, // </a >
SCRIPT: S++, // <script> ...
SCRIPT_ENDING: S++ // <script> ... <
}
sax.XML_ENTITIES = {
'amp': '&',
'gt': '>',
'lt': '<',
'quot': '"',
'apos': "'"
}
sax.ENTITIES = {
'amp': '&',
'gt': '>',
'lt': '<',
'quot': '"',
'apos': "'",
'AElig': 198,
'Aacute': 193,
'Acirc': 194,
'Agrave': 192,
'Aring': 197,
'Atilde': 195,
'Auml': 196,
'Ccedil': 199,
'ETH': 208,
'Eacute': 201,
'Ecirc': 202,
'Egrave': 200,
'Euml': 203,
'Iacute': 205,
'Icirc': 206,
'Igrave': 204,
'Iuml': 207,
'Ntilde': 209,
'Oacute': 211,
'Ocirc': 212,
'Ograve': 210,
'Oslash': 216,
'Otilde': 213,
'Ouml': 214,
'THORN': 222,
'Uacute': 218,
'Ucirc': 219,
'Ugrave': 217,
'Uuml': 220,
'Yacute': 221,
'aacute': 225,
'acirc': 226,
'aelig': 230,
'agrave': 224,
'aring': 229,
'atilde': 227,
'auml': 228,
'ccedil': 231,
'eacute': 233,
'ecirc': 234,
'egrave': 232,
'eth': 240,
'euml': 235,
'iacute': 237,
'icirc': 238,
'igrave': 236,
'iuml': 239,
'ntilde': 241,
'oacute': 243,
'ocirc': 244,
'ograve': 242,
'oslash': 248,
'otilde': 245,
'ouml': 246,
'szlig': 223,
'thorn': 254,
'uacute': 250,
'ucirc': 251,
'ugrave': 249,
'uuml': 252,
'yacute': 253,
'yuml': 255,
'copy': 169,
'reg': 174,
'nbsp': 160,
'iexcl': 161,
'cent': 162,
'pound': 163,
'curren': 164,
'yen': 165,
'brvbar': 166,
'sect': 167,
'uml': 168,
'ordf': 170,
'laquo': 171,
'not': 172,
'shy': 173,
'macr': 175,
'deg': 176,
'plusmn': 177,
'sup1': 185,
'sup2': 178,
'sup3': 179,
'acute': 180,
'micro': 181,
'para': 182,
'middot': 183,
'cedil': 184,
'ordm': 186,
'raquo': 187,
'frac14': 188,
'frac12': 189,
'frac34': 190,
'iquest': 191,
'times': 215,
'divide': 247,
'OElig': 338,
'oelig': 339,
'Scaron': 352,
'scaron': 353,
'Yuml': 376,
'fnof': 402,
'circ': 710,
'tilde': 732,
'Alpha': 913,
'Beta': 914,
'Gamma': 915,
'Delta': 916,
'Epsilon': 917,
'Zeta': 918,
'Eta': 919,
'Theta': 920,
'Iota': 921,
'Kappa': 922,
'Lambda': 923,
'Mu': 924,
'Nu': 925,
'Xi': 926,
'Omicron': 927,
'Pi': 928,
'Rho': 929,
'Sigma': 931,
'Tau': 932,
'Upsilon': 933,
'Phi': 934,
'Chi': 935,
'Psi': 936,
'Omega': 937,
'alpha': 945,
'beta': 946,
'gamma': 947,
'delta': 948,
'epsilon': 949,
'zeta': 950,
'eta': 951,
'theta': 952,
'iota': 953,
'kappa': 954,
'lambda': 955,
'mu': 956,
'nu': 957,
'xi': 958,
'omicron': 959,
'pi': 960,
'rho': 961,
'sigmaf': 962,
'sigma': 963,
'tau': 964,
'upsilon': 965,
'phi': 966,
'chi': 967,
'psi': 968,
'omega': 969,
'thetasym': 977,
'upsih': 978,
'piv': 982,
'ensp': 8194,
'emsp': 8195,
'thinsp': 8201,
'zwnj': 8204,
'zwj': 8205,
'lrm': 8206,
'rlm': 8207,
'ndash': 8211,
'mdash': 8212,
'lsquo': 8216,
'rsquo': 8217,
'sbquo': 8218,
'ldquo': 8220,
'rdquo': 8221,
'bdquo': 8222,
'dagger': 8224,
'Dagger': 8225,
'bull': 8226,
'hellip': 8230,
'permil': 8240,
'prime': 8242,
'Prime': 8243,
'lsaquo': 8249,
'rsaquo': 8250,
'oline': 8254,
'frasl': 8260,
'euro': 8364,
'image': 8465,
'weierp': 8472,
'real': 8476,
'trade': 8482,
'alefsym': 8501,
'larr': 8592,
'uarr': 8593,
'rarr': 8594,
'darr': 8595,
'harr': 8596,
'crarr': 8629,
'lArr': 8656,
'uArr': 8657,
'rArr': 8658,
'dArr': 8659,
'hArr': 8660,
'forall': 8704,
'part': 8706,
'exist': 8707,
'empty': 8709,
'nabla': 8711,
'isin': 8712,
'notin': 8713,
'ni': 8715,
'prod': 8719,
'sum': 8721,
'minus': 8722,
'lowast': 8727,
'radic': 8730,
'prop': 8733,
'infin': 8734,
'ang': 8736,
'and': 8743,
'or': 8744,
'cap': 8745,
'cup': 8746,
'int': 8747,
'there4': 8756,
'sim': 8764,
'cong': 8773,
'asymp': 8776,
'ne': 8800,
'equiv': 8801,
'le': 8804,
'ge': 8805,
'sub': 8834,
'sup': 8835,
'nsub': 8836,
'sube': 8838,
'supe': 8839,
'oplus': 8853,
'otimes': 8855,
'perp': 8869,
'sdot': 8901,
'lceil': 8968,
'rceil': 8969,
'lfloor': 8970,
'rfloor': 8971,
'lang': 9001,
'rang': 9002,
'loz': 9674,
'spades': 9824,
'clubs': 9827,
'hearts': 9829,
'diams': 9830
}
Object.keys(sax.ENTITIES).forEach(function (key) {
var e = sax.ENTITIES[key]
var s = typeof e === 'number' ? String.fromCharCode(e) : e
sax.ENTITIES[key] = s
})
for (var s in sax.STATE) {
sax.STATE[sax.STATE[s]] = s
}
// shorthand
S = sax.STATE
function emit (parser, event, data) {
parser[event] && parser[event](data)
}
function emitNode (parser, nodeType, data) {
if (parser.textNode) closeText(parser)
emit(parser, nodeType, data)
}
function closeText (parser) {
parser.textNode = textopts(parser.opt, parser.textNode)
if (parser.textNode) emit(parser, 'ontext', parser.textNode)
parser.textNode = ''
}
function textopts (opt, text) {
if (opt.trim) text = text.trim()
if (opt.normalize) text = text.replace(/\s+/g, ' ')
return text
}
function error (parser, er) {
closeText(parser)
if (parser.trackPosition) {
er += '\nLine: ' + parser.line +
'\nColumn: ' + parser.column +
'\nChar: ' + parser.c
}
er = new Error(er)
parser.error = er
emit(parser, 'onerror', er)
return parser
}
function end (parser) {
if (parser.sawRoot && !parser.closedRoot) strictFail(parser, 'Unclosed root tag')
if ((parser.state !== S.BEGIN) &&
(parser.state !== S.BEGIN_WHITESPACE) &&
(parser.state !== S.TEXT)) {
error(parser, 'Unexpected end')
}
closeText(parser)
parser.c = ''
parser.closed = true
emit(parser, 'onend')
SAXParser.call(parser, parser.strict, parser.opt)
return parser
}
function strictFail (parser, message) {
if (typeof parser !== 'object' || !(parser instanceof SAXParser)) {
throw new Error('bad call to strictFail')
}
if (parser.strict) {
error(parser, message)
}
}
function newTag (parser) {
if (!parser.strict) parser.tagName = parser.tagName[parser.looseCase]()
var parent = parser.tags[parser.tags.length - 1] || parser
var tag = parser.tag = { name: parser.tagName, attributes: {} }
// will be overridden if tag contails an xmlns="foo" or xmlns:foo="bar"
if (parser.opt.xmlns) {
tag.ns = parent.ns
}
parser.attribList.length = 0
emitNode(parser, 'onopentagstart', tag)
}
function qname (name, attribute) {
var i = name.indexOf(':')
var qualName = i < 0 ? [ '', name ] : name.split(':')
var prefix = qualName[0]
var local = qualName[1]
// <x "xmlns"="http://foo">
if (attribute && name === 'xmlns') {
prefix = 'xmlns'
local = ''
}
return { prefix: prefix, local: local }
}
function attrib (parser) {
if (!parser.strict) {
parser.attribName = parser.attribName[parser.looseCase]()
}
if (parser.attribList.indexOf(parser.attribName) !== -1 ||
parser.tag.attributes.hasOwnProperty(parser.attribName)) {
parser.attribName = parser.attribValue = ''
return
}
if (parser.opt.xmlns) {
var qn = qname(parser.attribName, true)
var prefix = qn.prefix
var local = qn.local
if (prefix === 'xmlns') {
// namespace binding attribute. push the binding into scope
if (local === 'xml' && parser.attribValue !== XML_NAMESPACE) {
strictFail(parser,
'xml: prefix must be bound to ' + XML_NAMESPACE + '\n' +
'Actual: ' + parser.attribValue)
} else if (local === 'xmlns' && parser.attribValue !== XMLNS_NAMESPACE) {
strictFail(parser,
'xmlns: prefix must be bound to ' + XMLNS_NAMESPACE + '\n' +
'Actual: ' + parser.attribValue)
} else {
var tag = parser.tag
var parent = parser.tags[parser.tags.length - 1] || parser
if (tag.ns === parent.ns) {
tag.ns = Object.create(parent.ns)
}
tag.ns[local] = parser.attribValue
}
}
// defer onattribute events until all attributes have been seen
// so any new bindings can take effect. preserve attribute order
// so deferred events can be emitted in document order
parser.attribList.push([parser.attribName, parser.attribValue])
} else {
// in non-xmlns mode, we can emit the event right away
parser.tag.attributes[parser.attribName] = parser.attribValue
emitNode(parser, 'onattribute', {
name: parser.attribName,
value: parser.attribValue
})
}
parser.attribName = parser.attribValue = ''
}
function openTag (parser, selfClosing) {
if (parser.opt.xmlns) {
// emit namespace binding events
var tag = parser.tag
// add namespace info to tag
var qn = qname(parser.tagName)
tag.prefix = qn.prefix
tag.local = qn.local
tag.uri = tag.ns[qn.prefix] || ''
if (tag.prefix && !tag.uri) {
strictFail(parser, 'Unbound namespace prefix: ' +
JSON.stringify(parser.tagName))
tag.uri = qn.prefix
}
var parent = parser.tags[parser.tags.length - 1] || parser
if (tag.ns && parent.ns !== tag.ns) {
Object.keys(tag.ns).forEach(function (p) {
emitNode(parser, 'onopennamespace', {
prefix: p,
uri: tag.ns[p]
})
})
}
// handle deferred onattribute events
// Note: do not apply default ns to attributes:
// http://www.w3.org/TR/REC-xml-names/#defaulting
for (var i = 0, l = parser.attribList.length; i < l; i++) {
var nv = parser.attribList[i]
var name = nv[0]
var value = nv[1]
var qualName = qname(name, true)
var prefix = qualName.prefix
var local = qualName.local
var uri = prefix === '' ? '' : (tag.ns[prefix] || '')
var a = {
name: name,
value: value,
prefix: prefix,
local: local,
uri: uri
}
// if there's any attributes with an undefined namespace,
// then fail on them now.
if (prefix && prefix !== 'xmlns' && !uri) {
strictFail(parser, 'Unbound namespace prefix: ' +
JSON.stringify(prefix))
a.uri = prefix
}
parser.tag.attributes[name] = a
emitNode(parser, 'onattribute', a)
}
parser.attribList.length = 0
}
parser.tag.isSelfClosing = !!selfClosing
// process the tag
parser.sawRoot = true
parser.tags.push(parser.tag)
emitNode(parser, 'onopentag', parser.tag)
if (!selfClosing) {
// special case for <script> in non-strict mode.
if (!parser.noscript && parser.tagName.toLowerCase() === 'script') {
parser.state = S.SCRIPT
} else {
parser.state = S.TEXT
}
parser.tag = null
parser.tagName = ''
}
parser.attribName = parser.attribValue = ''
parser.attribList.length = 0
}
function closeTag (parser) {
if (!parser.tagName) {
strictFail(parser, 'Weird empty close tag.')
parser.textNode += '</>'
parser.state = S.TEXT
return
}
if (parser.script) {
if (parser.tagName !== 'script') {
parser.script += '</' + parser.tagName + '>'
parser.tagName = ''
parser.state = S.SCRIPT
return
}
emitNode(parser, 'onscript', parser.script)
parser.script = ''
}
// first make sure that the closing tag actually exists.
// <a><b></c></b></a> will close everything, otherwise.
var t = parser.tags.length
var tagName = parser.tagName
if (!parser.strict) {
tagName = tagName[parser.looseCase]()
}
var closeTo = tagName
while (t--) {
var close = parser.tags[t]
if (close.name !== closeTo) {
// fail the first time in strict mode
strictFail(parser, 'Unexpected close tag')
} else {
break
}
}
// didn't find it. we already failed for strict, so just abort.
if (t < 0) {
strictFail(parser, 'Unmatched closing tag: ' + parser.tagName)
parser.textNode += '</' + parser.tagName + '>'
parser.state = S.TEXT
return
}
parser.tagName = tagName
var s = parser.tags.length
while (s-- > t) {
var tag = parser.tag = parser.tags.pop()
parser.tagName = parser.tag.name
emitNode(parser, 'onclosetag', parser.tagName)
var x = {}
for (var i in tag.ns) {
x[i] = tag.ns[i]
}
var parent = parser.tags[parser.tags.length - 1] || parser
if (parser.opt.xmlns && tag.ns !== parent.ns) {
// remove namespace bindings introduced by tag
Object.keys(tag.ns).forEach(function (p) {
var n = tag.ns[p]
emitNode(parser, 'onclosenamespace', { prefix: p, uri: n })
})
}
}
if (t === 0) parser.closedRoot = true
parser.tagName = parser.attribValue = parser.attribName = ''
parser.attribList.length = 0
parser.state = S.TEXT
}
function parseEntity (parser) {
var entity = parser.entity
var entityLC = entity.toLowerCase()
var num
var numStr = ''
if (parser.ENTITIES[entity]) {
return parser.ENTITIES[entity]
}
if (parser.ENTITIES[entityLC]) {
return parser.ENTITIES[entityLC]
}
entity = entityLC
if (entity.charAt(0) === '#') {
if (entity.charAt(1) === 'x') {
entity = entity.slice(2)
num = parseInt(entity, 16)
numStr = num.toString(16)
} else {
entity = entity.slice(1)
num = parseInt(entity, 10)
numStr = num.toString(10)
}
}
entity = entity.replace(/^0+/, '')
if (isNaN(num) || numStr.toLowerCase() !== entity) {
strictFail(parser, 'Invalid character entity')
return '&' + parser.entity + ';'
}
return String.fromCodePoint(num)
}
function beginWhiteSpace (parser, c) {
if (c === '<') {
parser.state = S.OPEN_WAKA
parser.startTagPosition = parser.position
} else if (!isWhitespace(c)) {
// have to process this as a text node.
// weird, but happens.
strictFail(parser, 'Non-whitespace before first tag.')
parser.textNode = c
parser.state = S.TEXT
}
}
function charAt (chunk, i) {
var result = ''
if (i < chunk.length) {
result = chunk.charAt(i)
}
return result
}
function write (chunk) {
var parser = this
if (this.error) {
throw this.error
}
if (parser.closed) {
return error(parser,
'Cannot write after close. Assign an onready handler.')
}
if (chunk === null) {
return end(parser)
}
if (typeof chunk === 'object') {
chunk = chunk.toString()
}
var i = 0
var c = ''
while (true) {
c = charAt(chunk, i++)
parser.c = c
if (!c) {
break
}
if (parser.trackPosition) {
parser.position++
if (c === '\n') {
parser.line++
parser.column = 0
} else {
parser.column++
}
}
switch (parser.state) {
case S.BEGIN:
parser.state = S.BEGIN_WHITESPACE
if (c === '\uFEFF') {
continue
}
beginWhiteSpace(parser, c)
continue
case S.BEGIN_WHITESPACE:
beginWhiteSpace(parser, c)
continue
case S.TEXT:
if (parser.sawRoot && !parser.closedRoot) {
var starti = i - 1
while (c && c !== '<' && c !== '&') {
c = charAt(chunk, i++)
if (c && parser.trackPosition) {
parser.position++
if (c === '\n') {
parser.line++
parser.column = 0
} else {
parser.column++
}
}
}
parser.textNode += chunk.substring(starti, i - 1)
}
if (c === '<' && !(parser.sawRoot && parser.closedRoot && !parser.strict)) {
parser.state = S.OPEN_WAKA
parser.startTagPosition = parser.position
} else {
if (!isWhitespace(c) && (!parser.sawRoot || parser.closedRoot)) {
strictFail(parser, 'Text data outside of root node.')
}
if (c === '&') {
parser.state = S.TEXT_ENTITY
} else {
parser.textNode += c
}
}
continue
case S.SCRIPT:
// only non-strict
if (c === '<') {
parser.state = S.SCRIPT_ENDING
} else {
parser.script += c
}
continue
case S.SCRIPT_ENDING:
if (c === '/') {
parser.state = S.CLOSE_TAG
} else {
parser.script += '<' + c
parser.state = S.SCRIPT
}
continue
case S.OPEN_WAKA:
// either a /, ?, !, or text is coming next.
if (c === '!') {
parser.state = S.SGML_DECL
parser.sgmlDecl = ''
} else if (isWhitespace(c)) {
// wait for it...
} else if (isMatch(nameStart, c)) {
parser.state = S.OPEN_TAG
parser.tagName = c
} else if (c === '/') {
parser.state = S.CLOSE_TAG
parser.tagName = ''
} else if (c === '?') {
parser.state = S.PROC_INST
parser.procInstName = parser.procInstBody = ''
} else {
strictFail(parser, 'Unencoded <')
// if there was some whitespace, then add that in.
if (parser.startTagPosition + 1 < parser.position) {
var pad = parser.position - parser.startTagPosition
c = new Array(pad).join(' ') + c
}
parser.textNode += '<' + c
parser.state = S.TEXT
}
continue
case S.SGML_DECL:
if ((parser.sgmlDecl + c).toUpperCase() === CDATA) {
emitNode(parser, 'onopencdata')
parser.state = S.CDATA
parser.sgmlDecl = ''
parser.cdata = ''
} else if (parser.sgmlDecl + c === '--') {
parser.state = S.COMMENT
parser.comment = ''
parser.sgmlDecl = ''
} else if ((parser.sgmlDecl + c).toUpperCase() === DOCTYPE) {
parser.state = S.DOCTYPE
if (parser.doctype || parser.sawRoot) {
strictFail(parser,
'Inappropriately located doctype declaration')
}
parser.doctype = ''
parser.sgmlDecl = ''
} else if (c === '>') {
emitNode(parser, 'onsgmldeclaration', parser.sgmlDecl)
parser.sgmlDecl = ''
parser.state = S.TEXT
} else if (isQuote(c)) {
parser.state = S.SGML_DECL_QUOTED
parser.sgmlDecl += c
} else {
parser.sgmlDecl += c
}
continue
case S.SGML_DECL_QUOTED:
if (c === parser.q) {
parser.state = S.SGML_DECL
parser.q = ''
}
parser.sgmlDecl += c
continue
case S.DOCTYPE:
if (c === '>') {
parser.state = S.TEXT
emitNode(parser, 'ondoctype', parser.doctype)
parser.doctype = true // just remember that we saw it.
} else {
parser.doctype += c
if (c === '[') {
parser.state = S.DOCTYPE_DTD
} else if (isQuote(c)) {
parser.state = S.DOCTYPE_QUOTED
parser.q = c
}
}
continue
case S.DOCTYPE_QUOTED:
parser.doctype += c
if (c === parser.q) {
parser.q = ''
parser.state = S.DOCTYPE
}
continue
case S.DOCTYPE_DTD:
parser.doctype += c
if (c === ']') {
parser.state = S.DOCTYPE
} else if (isQuote(c)) {
parser.state = S.DOCTYPE_DTD_QUOTED
parser.q = c
}
continue
case S.DOCTYPE_DTD_QUOTED:
parser.doctype += c
if (c === parser.q) {
parser.state = S.DOCTYPE_DTD
parser.q = ''
}
continue
case S.COMMENT:
if (c === '-') {
parser.state = S.COMMENT_ENDING
} else {
parser.comment += c
}
continue
case S.COMMENT_ENDING:
if (c === '-') {
parser.state = S.COMMENT_ENDED
parser.comment = textopts(parser.opt, parser.comment)
if (parser.comment) {
emitNode(parser, 'oncomment', parser.comment)
}
parser.comment = ''
} else {
parser.comment += '-' + c
parser.state = S.COMMENT
}
continue
case S.COMMENT_ENDED:
if (c !== '>') {
strictFail(parser, 'Malformed comment')
// allow <!-- blah -- bloo --> in non-strict mode,
// which is a comment of " blah -- bloo "
parser.comment += '--' + c
parser.state = S.COMMENT
} else {
parser.state = S.TEXT
}
continue
case S.CDATA:
if (c === ']') {
parser.state = S.CDATA_ENDING
} else {
parser.cdata += c
}
continue
case S.CDATA_ENDING:
if (c === ']') {
parser.state = S.CDATA_ENDING_2
} else {
parser.cdata += ']' + c
parser.state = S.CDATA
}
continue
case S.CDATA_ENDING_2:
if (c === '>') {
if (parser.cdata) {
emitNode(parser, 'oncdata', parser.cdata)
}
emitNode(parser, 'onclosecdata')
parser.cdata = ''
parser.state = S.TEXT
} else if (c === ']') {
parser.cdata += ']'
} else {
parser.cdata += ']]' + c
parser.state = S.CDATA
}
continue
case S.PROC_INST:
if (c === '?') {
parser.state = S.PROC_INST_ENDING
} else if (isWhitespace(c)) {
parser.state = S.PROC_INST_BODY
} else {
parser.procInstName += c
}
continue
case S.PROC_INST_BODY:
if (!parser.procInstBody && isWhitespace(c)) {
continue
} else if (c === '?') {
parser.state = S.PROC_INST_ENDING
} else {
parser.procInstBody += c
}
continue
case S.PROC_INST_ENDING:
if (c === '>') {
emitNode(parser, 'onprocessinginstruction', {
name: parser.procInstName,
body: parser.procInstBody
})
parser.procInstName = parser.procInstBody = ''
parser.state = S.TEXT
} else {
parser.procInstBody += '?' + c
parser.state = S.PROC_INST_BODY
}
continue
case S.OPEN_TAG:
if (isMatch(nameBody, c)) {
parser.tagName += c
} else {
newTag(parser)
if (c === '>') {
openTag(parser)
} else if (c === '/') {
parser.state = S.OPEN_TAG_SLASH
} else {
if (!isWhitespace(c)) {
strictFail(parser, 'Invalid character in tag name')
}
parser.state = S.ATTRIB
}
}
continue
case S.OPEN_TAG_SLASH:
if (c === '>') {
openTag(parser, true)
closeTag(parser)
} else {
strictFail(parser, 'Forward-slash in opening tag not followed by >')
parser.state = S.ATTRIB
}
continue
case S.ATTRIB:
// haven't read the attribute name yet.
if (isWhitespace(c)) {
continue
} else if (c === '>') {
openTag(parser)
} else if (c === '/') {
parser.state = S.OPEN_TAG_SLASH
} else if (isMatch(nameStart, c)) {
parser.attribName = c
parser.attribValue = ''
parser.state = S.ATTRIB_NAME
} else {
strictFail(parser, 'Invalid attribute name')
}
continue
case S.ATTRIB_NAME:
if (c === '=') {
parser.state = S.ATTRIB_VALUE
} else if (c === '>') {
strictFail(parser, 'Attribute without value')
parser.attribValue = parser.attribName
attrib(parser)
openTag(parser)
} else if (isWhitespace(c)) {
parser.state = S.ATTRIB_NAME_SAW_WHITE
} else if (isMatch(nameBody, c)) {
parser.attribName += c
} else {
strictFail(parser, 'Invalid attribute name')
}
continue
case S.ATTRIB_NAME_SAW_WHITE:
if (c === '=') {
parser.state = S.ATTRIB_VALUE
} else if (isWhitespace(c)) {
continue
} else {
strictFail(parser, 'Attribute without value')
parser.tag.attributes[parser.attribName] = ''
parser.attribValue = ''
emitNode(parser, 'onattribute', {
name: parser.attribName,
value: ''
})
parser.attribName = ''
if (c === '>') {
openTag(parser)
} else if (isMatch(nameStart, c)) {
parser.attribName = c
parser.state = S.ATTRIB_NAME
} else {
strictFail(parser, 'Invalid attribute name')
parser.state = S.ATTRIB
}
}
continue
case S.ATTRIB_VALUE:
if (isWhitespace(c)) {
continue
} else if (isQuote(c)) {
parser.q = c
parser.state = S.ATTRIB_VALUE_QUOTED
} else {
strictFail(parser, 'Unquoted attribute value')
parser.state = S.ATTRIB_VALUE_UNQUOTED
parser.attribValue = c
}
continue
case S.ATTRIB_VALUE_QUOTED:
if (c !== parser.q) {
if (c === '&') {
parser.state = S.ATTRIB_VALUE_ENTITY_Q
} else {
parser.attribValue += c
}
continue
}
attrib(parser)
parser.q = ''
parser.state = S.ATTRIB_VALUE_CLOSED
continue
case S.ATTRIB_VALUE_CLOSED:
if (isWhitespace(c)) {
parser.state = S.ATTRIB
} else if (c === '>') {
openTag(parser)
} else if (c === '/') {
parser.state = S.OPEN_TAG_SLASH
} else if (isMatch(nameStart, c)) {
strictFail(parser, 'No whitespace between attributes')
parser.attribName = c
parser.attribValue = ''
parser.state = S.ATTRIB_NAME
} else {
strictFail(parser, 'Invalid attribute name')
}
continue
case S.ATTRIB_VALUE_UNQUOTED:
if (!isAttribEnd(c)) {
if (c === '&') {
parser.state = S.ATTRIB_VALUE_ENTITY_U
} else {
parser.attribValue += c
}
continue
}
attrib(parser)
if (c === '>') {
openTag(parser)
} else {
parser.state = S.ATTRIB
}
continue
case S.CLOSE_TAG:
if (!parser.tagName) {
if (isWhitespace(c)) {
continue
} else if (notMatch(nameStart, c)) {
if (parser.script) {
parser.script += '</' + c
parser.state = S.SCRIPT
} else {
strictFail(parser, 'Invalid tagname in closing tag.')
}
} else {
parser.tagName = c
}
} else if (c === '>') {
closeTag(parser)
} else if (isMatch(nameBody, c)) {
parser.tagName += c
} else if (parser.script) {
parser.script += '</' + parser.tagName
parser.tagName = ''
parser.state = S.SCRIPT
} else {
if (!isWhitespace(c)) {
strictFail(parser, 'Invalid tagname in closing tag')
}
parser.state = S.CLOSE_TAG_SAW_WHITE
}
continue
case S.CLOSE_TAG_SAW_WHITE:
if (isWhitespace(c)) {
continue
}
if (c === '>') {
closeTag(parser)
} else {
strictFail(parser, 'Invalid characters in closing tag')
}
continue
case S.TEXT_ENTITY:
case S.ATTRIB_VALUE_ENTITY_Q:
case S.ATTRIB_VALUE_ENTITY_U:
var returnState
var buffer
switch (parser.state) {
case S.TEXT_ENTITY:
returnState = S.TEXT
buffer = 'textNode'
break
case S.ATTRIB_VALUE_ENTITY_Q:
returnState = S.ATTRIB_VALUE_QUOTED
buffer = 'attribValue'
break
case S.ATTRIB_VALUE_ENTITY_U:
returnState = S.ATTRIB_VALUE_UNQUOTED
buffer = 'attribValue'
break
}
if (c === ';') {
parser[buffer] += parseEntity(parser)
parser.entity = ''
parser.state = returnState
} else if (isMatch(parser.entity.length ? entityBody : entityStart, c)) {
parser.entity += c
} else {
strictFail(parser, 'Invalid character in entity name')
parser[buffer] += '&' + parser.entity + c
parser.entity = ''
parser.state = returnState
}
continue
default:
throw new Error(parser, 'Unknown state: ' + parser.state)
}
} // while
if (parser.position >= parser.bufferCheckPosition) {
checkBufferLength(parser)
}
return parser
}
/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */
/* istanbul ignore next */
if (!String.fromCodePoint) {
(function () {
var stringFromCharCode = String.fromCharCode
var floor = Math.floor
var fromCodePoint = function () {
var MAX_SIZE = 0x4000
var codeUnits = []
var highSurrogate
var lowSurrogate
var index = -1
var length = arguments.length
if (!length) {
return ''
}
var result = ''
while (++index < length) {
var codePoint = Number(arguments[index])
if (
!isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`
codePoint < 0 || // not a valid Unicode code point
codePoint > 0x10FFFF || // not a valid Unicode code point
floor(codePoint) !== codePoint // not an integer
) {
throw RangeError('Invalid code point: ' + codePoint)
}
if (codePoint <= 0xFFFF) { // BMP code point
codeUnits.push(codePoint)
} else { // Astral code point; split in surrogate halves
// http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
codePoint -= 0x10000
highSurrogate = (codePoint >> 10) + 0xD800
lowSurrogate = (codePoint % 0x400) + 0xDC00
codeUnits.push(highSurrogate, lowSurrogate)
}
if (index + 1 === length || codeUnits.length > MAX_SIZE) {
result += stringFromCharCode.apply(null, codeUnits)
codeUnits.length = 0
}
}
return result
}
/* istanbul ignore next */
if (Object.defineProperty) {
Object.defineProperty(String, 'fromCodePoint', {
value: fromCodePoint,
configurable: true,
writable: true
})
} else {
String.fromCodePoint = fromCodePoint
}
}())
}
})( false ? 0 : exports)
/***/ }),
/***/ 5051:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.AbstractTokenizer = void 0;
const peek_readable_1 = __nccwpck_require__(3752);
/**
* Core tokenizer
*/
class AbstractTokenizer {
constructor(fileInfo) {
/**
* Tokenizer-stream position
*/
this.position = 0;
this.numBuffer = new Uint8Array(8);
this.fileInfo = fileInfo ? fileInfo : {};
}
/**
* Read a token from the tokenizer-stream
* @param token - The token to read
* @param position - If provided, the desired position in the tokenizer-stream
* @returns Promise with token data
*/
async readToken(token, position = this.position) {
const uint8Array = Buffer.alloc(token.len);
const len = await this.readBuffer(uint8Array, { position });
if (len < token.len)
throw new peek_readable_1.EndOfStreamError();
return token.get(uint8Array, 0);
}
/**
* Peek a token from the tokenizer-stream.
* @param token - Token to peek from the tokenizer-stream.
* @param position - Offset where to begin reading within the file. If position is null, data will be read from the current file position.
* @returns Promise with token data
*/
async peekToken(token, position = this.position) {
const uint8Array = Buffer.alloc(token.len);
const len = await this.peekBuffer(uint8Array, { position });
if (len < token.len)
throw new peek_readable_1.EndOfStreamError();
return token.get(uint8Array, 0);
}
/**
* Read a numeric token from the stream
* @param token - Numeric token
* @returns Promise with number
*/
async readNumber(token) {
const len = await this.readBuffer(this.numBuffer, { length: token.len });
if (len < token.len)
throw new peek_readable_1.EndOfStreamError();
return token.get(this.numBuffer, 0);
}
/**
* Read a numeric token from the stream
* @param token - Numeric token
* @returns Promise with number
*/
async peekNumber(token) {
const len = await this.peekBuffer(this.numBuffer, { length: token.len });
if (len < token.len)
throw new peek_readable_1.EndOfStreamError();
return token.get(this.numBuffer, 0);
}
/**
* Ignore number of bytes, advances the pointer in under tokenizer-stream.
* @param length - Number of bytes to ignore
* @return resolves the number of bytes ignored, equals length if this available, otherwise the number of bytes available
*/
async ignore(length) {
if (this.fileInfo.size !== undefined) {
const bytesLeft = this.fileInfo.size - this.position;
if (length > bytesLeft) {
this.position += bytesLeft;
return bytesLeft;
}
}
this.position += length;
return length;
}
async close() {
// empty
}
normalizeOptions(uint8Array, options) {
if (options && options.position !== undefined && options.position < this.position) {
throw new Error('`options.position` must be equal or greater than `tokenizer.position`');
}
if (options) {
return {
mayBeLess: options.mayBeLess === true,
offset: options.offset ? options.offset : 0,
length: options.length ? options.length : (uint8Array.length - (options.offset ? options.offset : 0)),
position: options.position ? options.position : this.position
};
}
return {
mayBeLess: false,
offset: 0,
length: uint8Array.length,
position: this.position
};
}
}
exports.AbstractTokenizer = AbstractTokenizer;
/***/ }),
/***/ 8054:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.BufferTokenizer = void 0;
const peek_readable_1 = __nccwpck_require__(3752);
const AbstractTokenizer_1 = __nccwpck_require__(5051);
class BufferTokenizer extends AbstractTokenizer_1.AbstractTokenizer {
/**
* Construct BufferTokenizer
* @param uint8Array - Uint8Array to tokenize
* @param fileInfo - Pass additional file information to the tokenizer
*/
constructor(uint8Array, fileInfo) {
super(fileInfo);
this.uint8Array = uint8Array;
this.fileInfo.size = this.fileInfo.size ? this.fileInfo.size : uint8Array.length;
}
/**
* Read buffer from tokenizer
* @param uint8Array - Uint8Array to tokenize
* @param options - Read behaviour options
* @returns {Promise<number>}
*/
async readBuffer(uint8Array, options) {
if (options && options.position) {
if (options.position < this.position) {
throw new Error('`options.position` must be equal or greater than `tokenizer.position`');
}
this.position = options.position;
}
const bytesRead = await this.peekBuffer(uint8Array, options);
this.position += bytesRead;
return bytesRead;
}
/**
* Peek (read ahead) buffer from tokenizer
* @param uint8Array
* @param options - Read behaviour options
* @returns {Promise<number>}
*/
async peekBuffer(uint8Array, options) {
const normOptions = this.normalizeOptions(uint8Array, options);
const bytes2read = Math.min(this.uint8Array.length - normOptions.position, normOptions.length);
if ((!normOptions.mayBeLess) && bytes2read < normOptions.length) {
throw new peek_readable_1.EndOfStreamError();
}
else {
uint8Array.set(this.uint8Array.subarray(normOptions.position, normOptions.position + bytes2read), normOptions.offset);
return bytes2read;
}
}
async close() {
// empty
}
}
exports.BufferTokenizer = BufferTokenizer;
/***/ }),
/***/ 561:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.fromFile = exports.FileTokenizer = void 0;
const AbstractTokenizer_1 = __nccwpck_require__(5051);
const peek_readable_1 = __nccwpck_require__(3752);
const fs = __nccwpck_require__(3915);
class FileTokenizer extends AbstractTokenizer_1.AbstractTokenizer {
constructor(fd, fileInfo) {
super(fileInfo);
this.fd = fd;
}
/**
* Read buffer from file
* @param uint8Array - Uint8Array to write result to
* @param options - Read behaviour options
* @returns Promise number of bytes read
*/
async readBuffer(uint8Array, options) {
const normOptions = this.normalizeOptions(uint8Array, options);
this.position = normOptions.position;
const res = await fs.read(this.fd, uint8Array, normOptions.offset, normOptions.length, normOptions.position);
this.position += res.bytesRead;
if (res.bytesRead < normOptions.length && (!options || !options.mayBeLess)) {
throw new peek_readable_1.EndOfStreamError();
}
return res.bytesRead;
}
/**
* Peek buffer from file
* @param uint8Array - Uint8Array (or Buffer) to write data to
* @param options - Read behaviour options
* @returns Promise number of bytes read
*/
async peekBuffer(uint8Array, options) {
const normOptions = this.normalizeOptions(uint8Array, options);
const res = await fs.read(this.fd, uint8Array, normOptions.offset, normOptions.length, normOptions.position);
if ((!normOptions.mayBeLess) && res.bytesRead < normOptions.length) {
throw new peek_readable_1.EndOfStreamError();
}
return res.bytesRead;
}
async close() {
return fs.close(this.fd);
}
}
exports.FileTokenizer = FileTokenizer;
async function fromFile(sourceFilePath) {
const stat = await fs.stat(sourceFilePath);
if (!stat.isFile) {
throw new Error(`File not a file: ${sourceFilePath}`);
}
const fd = await fs.open(sourceFilePath, 'r');
return new FileTokenizer(fd, { path: sourceFilePath, size: stat.size });
}
exports.fromFile = fromFile;
/***/ }),
/***/ 3915:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
/**
* Module convert fs functions to promise based functions
*/
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.readFile = exports.writeFileSync = exports.writeFile = exports.read = exports.open = exports.close = exports.stat = exports.createReadStream = exports.pathExists = void 0;
const fs = __nccwpck_require__(7147);
exports.pathExists = fs.existsSync;
exports.createReadStream = fs.createReadStream;
async function stat(path) {
return new Promise((resolve, reject) => {
fs.stat(path, (err, stats) => {
if (err)
reject(err);
else
resolve(stats);
});
});
}
exports.stat = stat;
async function close(fd) {
return new Promise((resolve, reject) => {
fs.close(fd, err => {
if (err)
reject(err);
else
resolve();
});
});
}
exports.close = close;
async function open(path, mode) {
return new Promise((resolve, reject) => {
fs.open(path, mode, (err, fd) => {
if (err)
reject(err);
else
resolve(fd);
});
});
}
exports.open = open;
async function read(fd, buffer, offset, length, position) {
return new Promise((resolve, reject) => {
fs.read(fd, buffer, offset, length, position, (err, bytesRead, _buffer) => {
if (err)
reject(err);
else
resolve({ bytesRead, buffer: _buffer });
});
});
}
exports.read = read;
async function writeFile(path, data) {
return new Promise((resolve, reject) => {
fs.writeFile(path, data, err => {
if (err)
reject(err);
else
resolve();
});
});
}
exports.writeFile = writeFile;
function writeFileSync(path, data) {
fs.writeFileSync(path, data);
}
exports.writeFileSync = writeFileSync;
async function readFile(path) {
return new Promise((resolve, reject) => {
fs.readFile(path, (err, buffer) => {
if (err)
reject(err);
else
resolve(buffer);
});
});
}
exports.readFile = readFile;
/***/ }),
/***/ 8888:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.ReadStreamTokenizer = void 0;
const AbstractTokenizer_1 = __nccwpck_require__(5051);
const peek_readable_1 = __nccwpck_require__(3752);
const maxBufferSize = 256000;
class ReadStreamTokenizer extends AbstractTokenizer_1.AbstractTokenizer {
constructor(stream, fileInfo) {
super(fileInfo);
this.streamReader = new peek_readable_1.StreamReader(stream);
}
/**
* Get file information, an HTTP-client may implement this doing a HEAD request
* @return Promise with file information
*/
async getFileInfo() {
return this.fileInfo;
}
/**
* Read buffer from tokenizer
* @param uint8Array - Target Uint8Array to fill with data read from the tokenizer-stream
* @param options - Read behaviour options
* @returns Promise with number of bytes read
*/
async readBuffer(uint8Array, options) {
const normOptions = this.normalizeOptions(uint8Array, options);
const skipBytes = normOptions.position - this.position;
if (skipBytes > 0) {
await this.ignore(skipBytes);
return this.readBuffer(uint8Array, options);
}
else if (skipBytes < 0) {
throw new Error('`options.position` must be equal or greater than `tokenizer.position`');
}
if (normOptions.length === 0) {
return 0;
}
const bytesRead = await this.streamReader.read(uint8Array, normOptions.offset, normOptions.length);
this.position += bytesRead;
if ((!options || !options.mayBeLess) && bytesRead < normOptions.length) {
throw new peek_readable_1.EndOfStreamError();
}
return bytesRead;
}
/**
* Peek (read ahead) buffer from tokenizer
* @param uint8Array - Uint8Array (or Buffer) to write data to
* @param options - Read behaviour options
* @returns Promise with number of bytes peeked
*/
async peekBuffer(uint8Array, options) {
const normOptions = this.normalizeOptions(uint8Array, options);
let bytesRead = 0;
if (normOptions.position) {
const skipBytes = normOptions.position - this.position;
if (skipBytes > 0) {
const skipBuffer = new Uint8Array(normOptions.length + skipBytes);
bytesRead = await this.peekBuffer(skipBuffer, { mayBeLess: normOptions.mayBeLess });
uint8Array.set(skipBuffer.subarray(skipBytes), normOptions.offset);
return bytesRead - skipBytes;
}
else if (skipBytes < 0) {
throw new Error('Cannot peek from a negative offset in a stream');
}
}
if (normOptions.length > 0) {
try {
bytesRead = await this.streamReader.peek(uint8Array, normOptions.offset, normOptions.length);
}
catch (err) {
if (options && options.mayBeLess && err instanceof peek_readable_1.EndOfStreamError) {
return 0;
}
throw err;
}
if ((!normOptions.mayBeLess) && bytesRead < normOptions.length) {
throw new peek_readable_1.EndOfStreamError();
}
}
return bytesRead;
}
async ignore(length) {
// debug(`ignore ${this.position}...${this.position + length - 1}`);
const bufSize = Math.min(maxBufferSize, length);
const buf = new Uint8Array(bufSize);
let totBytesRead = 0;
while (totBytesRead < length) {
const remaining = length - totBytesRead;
const bytesRead = await this.readBuffer(buf, { length: Math.min(bufSize, remaining) });
if (bytesRead < 0) {
return bytesRead;
}
totBytesRead += bytesRead;
}
return totBytesRead;
}
}
exports.ReadStreamTokenizer = ReadStreamTokenizer;
/***/ }),
/***/ 3026:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.fromBuffer = exports.fromStream = exports.EndOfStreamError = void 0;
const ReadStreamTokenizer_1 = __nccwpck_require__(8888);
const BufferTokenizer_1 = __nccwpck_require__(8054);
var peek_readable_1 = __nccwpck_require__(3752);
Object.defineProperty(exports, "EndOfStreamError", ({ enumerable: true, get: function () { return peek_readable_1.EndOfStreamError; } }));
/**
* Construct ReadStreamTokenizer from given Stream.
* Will set fileSize, if provided given Stream has set the .path property/
* @param stream - Read from Node.js Stream.Readable
* @param fileInfo - Pass the file information, like size and MIME-type of the corresponding stream.
* @returns ReadStreamTokenizer
*/
function fromStream(stream, fileInfo) {
fileInfo = fileInfo ? fileInfo : {};
return new ReadStreamTokenizer_1.ReadStreamTokenizer(stream, fileInfo);
}
exports.fromStream = fromStream;
/**
* Construct ReadStreamTokenizer from given Buffer.
* @param uint8Array - Uint8Array to tokenize
* @param fileInfo - Pass additional file information to the tokenizer
* @returns BufferTokenizer
*/
function fromBuffer(uint8Array, fileInfo) {
return new BufferTokenizer_1.BufferTokenizer(uint8Array, fileInfo);
}
exports.fromBuffer = fromBuffer;
/***/ }),
/***/ 8569:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.fromStream = exports.fromBuffer = exports.EndOfStreamError = exports.fromFile = void 0;
const fs = __nccwpck_require__(3915);
const core = __nccwpck_require__(3026);
var FileTokenizer_1 = __nccwpck_require__(561);
Object.defineProperty(exports, "fromFile", ({ enumerable: true, get: function () { return FileTokenizer_1.fromFile; } }));
var core_1 = __nccwpck_require__(3026);
Object.defineProperty(exports, "EndOfStreamError", ({ enumerable: true, get: function () { return core_1.EndOfStreamError; } }));
Object.defineProperty(exports, "fromBuffer", ({ enumerable: true, get: function () { return core_1.fromBuffer; } }));
/**
* Construct ReadStreamTokenizer from given Stream.
* Will set fileSize, if provided given Stream has set the .path property.
* @param stream - Node.js Stream.Readable
* @param fileInfo - Pass additional file information to the tokenizer
* @returns Tokenizer
*/
async function fromStream(stream, fileInfo) {
fileInfo = fileInfo ? fileInfo : {};
if (stream.path) {
const stat = await fs.stat(stream.path);
fileInfo.path = stream.path;
fileInfo.size = stat.size;
}
return core.fromStream(stream, fileInfo);
}
exports.fromStream = fromStream;
/***/ }),
/***/ 3567:
/***/ ((__unused_webpack_module, exports) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.clone = clone;
exports.addLast = addLast;
exports.addFirst = addFirst;
exports.removeLast = removeLast;
exports.removeFirst = removeFirst;
exports.insert = insert;
exports.removeAt = removeAt;
exports.replaceAt = replaceAt;
exports.getIn = getIn;
exports.set = set;
exports.setIn = setIn;
exports.update = update;
exports.updateIn = updateIn;
exports.merge = merge;
exports.mergeDeep = mergeDeep;
exports.mergeIn = mergeIn;
exports.omit = omit;
exports.addDefaults = addDefaults;
exports["default"] = void 0;
/* eslint-disable @typescript-eslint/ban-types */
/*!
* Timm
*
* Immutability helpers with fast reads and acceptable writes.
*
* @copyright Guillermo Grau Panea 2016
* @license MIT
*/
const INVALID_ARGS = 'INVALID_ARGS';
const IS_DEV = process.env.NODE_ENV !== 'production';
// ===============================================
// ### Helpers
// ===============================================
function throwStr(msg) {
throw new Error(msg);
}
function getKeysAndSymbols(obj) {
const keys = Object.keys(obj);
if (Object.getOwnPropertySymbols) {
// @ts-ignore
return keys.concat(Object.getOwnPropertySymbols(obj));
}
return keys;
}
const hasOwnProperty = {}.hasOwnProperty;
function clone(obj0) {
// As array
if (Array.isArray(obj0)) return obj0.slice(); // As object
const obj = obj0;
const keys = getKeysAndSymbols(obj);
const out = {};
for (let i = 0; i < keys.length; i++) {
const key = keys[i];
out[key] = obj[key];
} // @ts-ignore (see type tests)
return out;
} // Custom guard
function isObject(o) {
return o != null && typeof o === 'object';
} // _deepFreeze = (obj) ->
// Object.freeze obj
// for key in Object.getOwnPropertyNames obj
// val = obj[key]
// if isObject(val) and not Object.isFrozen val
// _deepFreeze val
// obj
// ===============================================
// -- ### Arrays
// ===============================================
// -- #### addLast()
// -- Returns a new array with an appended item or items.
// --
// -- Usage: `addLast(array, val)`
// --
// -- ```js
// -- arr = ['a', 'b']
// -- arr2 = addLast(arr, 'c')
// -- // ['a', 'b', 'c']
// -- arr2 === arr
// -- // false
// -- arr3 = addLast(arr, ['c', 'd'])
// -- // ['a', 'b', 'c', 'd']
// -- ```
// `array.concat(val)` also handles the scalar case,
// but is apparently very slow
function addLast(array, val) {
if (Array.isArray(val)) return array.concat(val);
return array.concat([val]);
} // -- #### addFirst()
// -- Returns a new array with a prepended item or items.
// --
// -- Usage: `addFirst(array, val)`
// --
// -- ```js
// -- arr = ['a', 'b']
// -- arr2 = addFirst(arr, 'c')
// -- // ['c', 'a', 'b']
// -- arr2 === arr
// -- // false
// -- arr3 = addFirst(arr, ['c', 'd'])
// -- // ['c', 'd', 'a', 'b']
// -- ```
function addFirst(array, val) {
if (Array.isArray(val)) return val.concat(array);
return [val].concat(array);
} // -- #### removeLast()
// -- Returns a new array removing the last item.
// --
// -- Usage: `removeLast(array)`
// --
// -- ```js
// -- arr = ['a', 'b']
// -- arr2 = removeLast(arr)
// -- // ['a']
// -- arr2 === arr
// -- // false
// --
// -- // The same array is returned if there are no changes:
// -- arr3 = []
// -- removeLast(arr3) === arr3
// -- // true
// -- ```
function removeLast(array) {
if (!array.length) return array;
return array.slice(0, array.length - 1);
} // -- #### removeFirst()
// -- Returns a new array removing the first item.
// --
// -- Usage: `removeFirst(array)`
// --
// -- ```js
// -- arr = ['a', 'b']
// -- arr2 = removeFirst(arr)
// -- // ['b']
// -- arr2 === arr
// -- // false
// --
// -- // The same array is returned if there are no changes:
// -- arr3 = []
// -- removeFirst(arr3) === arr3
// -- // true
// -- ```
function removeFirst(array) {
if (!array.length) return array;
return array.slice(1);
} // -- #### insert()
// -- Returns a new array obtained by inserting an item or items
// -- at a specified index.
// --
// -- Usage: `insert(array, idx, val)`
// --
// -- ```js
// -- arr = ['a', 'b', 'c']
// -- arr2 = insert(arr, 1, 'd')
// -- // ['a', 'd', 'b', 'c']
// -- arr2 === arr
// -- // false
// -- insert(arr, 1, ['d', 'e'])
// -- // ['a', 'd', 'e', 'b', 'c']
// -- ```
function insert(array, idx, val) {
return array.slice(0, idx).concat(Array.isArray(val) ? val : [val]).concat(array.slice(idx));
} // -- #### removeAt()
// -- Returns a new array obtained by removing an item at
// -- a specified index.
// --
// -- Usage: `removeAt(array, idx)`
// --
// -- ```js
// -- arr = ['a', 'b', 'c']
// -- arr2 = removeAt(arr, 1)
// -- // ['a', 'c']
// -- arr2 === arr
// -- // false
// --
// -- // The same array is returned if there are no changes:
// -- removeAt(arr, 4) === arr
// -- // true
// -- ```
function removeAt(array, idx) {
if (idx >= array.length || idx < 0) return array;
return array.slice(0, idx).concat(array.slice(idx + 1));
} // -- #### replaceAt()
// -- Returns a new array obtained by replacing an item at
// -- a specified index. If the provided item is the same as
// -- (*referentially equal to*) the previous item at that position,
// -- the original array is returned.
// --
// -- Usage: `replaceAt(array, idx, newItem)`
// --
// -- ```js
// -- arr = ['a', 'b', 'c']
// -- arr2 = replaceAt(arr, 1, 'd')
// -- // ['a', 'd', 'c']
// -- arr2 === arr
// -- // false
// --
// -- // The same object is returned if there are no changes:
// -- replaceAt(arr, 1, 'b') === arr
// -- // true
// -- ```
function replaceAt(array, idx, newItem) {
if (array[idx] === newItem) return array;
const len = array.length;
const result = Array(len);
for (let i = 0; i < len; i++) {
result[i] = array[i];
}
result[idx] = newItem;
return result;
} // ===============================================
// -- ### Collections (objects and arrays)
// ===============================================
// -- #### getIn()
// -- Returns a value from an object at a given path. Works with
// -- nested arrays and objects. If the path does not exist, it returns
// -- `undefined`.
// --
// -- Usage: `getIn(obj, path)`
// --
// -- ```js
// -- obj = { a: 1, b: 2, d: { d1: 3, d2: 4 }, e: ['a', 'b', 'c'] }
// -- getIn(obj, ['d', 'd1'])
// -- // 3
// -- getIn(obj, ['e', 1])
// -- // 'b'
// -- ```
function getIn(obj, path) {
if (!Array.isArray(path)) {
throwStr(IS_DEV ? 'A path array should be provided when calling getIn()' : INVALID_ARGS);
}
if (obj == null) return undefined;
let ptr = obj;
for (let i = 0; i < path.length; i++) {
const key = path[i];
ptr = ptr != null ? ptr[key] : undefined;
if (ptr === undefined) return ptr;
}
return ptr;
} // -- #### set()
// -- Returns a new object with a modified attribute.
// -- If the provided value is the same as (*referentially equal to*)
// -- the previous value, the original object is returned.
// --
// -- Usage: `set(obj, key, val)`
// --
// -- ```js
// -- obj = { a: 1, b: 2, c: 3 }
// -- obj2 = set(obj, 'b', 5)
// -- // { a: 1, b: 5, c: 3 }
// -- obj2 === obj
// -- // false
// --
// -- // The same object is returned if there are no changes:
// -- set(obj, 'b', 2) === obj
// -- // true
// -- ```
// When called with an undefined/null `obj`, `set()` returns either
// a single-element array, or a single-key object
// Implementation
function set(obj0, key, val) {
let obj = obj0;
if (obj == null) obj = typeof key === 'number' ? [] : {};
if (obj[key] === val) return obj;
const obj2 = clone(obj);
obj2[key] = val;
return obj2;
} // -- #### setIn()
// -- Returns a new object with a modified **nested** attribute.
// --
// -- Notes:
// --
// -- * If the provided value is the same as (*referentially equal to*)
// -- the previous value, the original object is returned.
// -- * If the path does not exist, it will be created before setting
// -- the new value.
// --
// -- Usage: `setIn(obj, path, val)`
// --
// -- ```js
// -- obj = { a: 1, b: 2, d: { d1: 3, d2: 4 }, e: { e1: 'foo', e2: 'bar' } }
// -- obj2 = setIn(obj, ['d', 'd1'], 4)
// -- // { a: 1, b: 2, d: { d1: 4, d2: 4 }, e: { e1: 'foo', e2: 'bar' } }
// -- obj2 === obj
// -- // false
// -- obj2.d === obj.d
// -- // false
// -- obj2.e === obj.e
// -- // true
// --
// -- // The same object is returned if there are no changes:
// -- obj3 = setIn(obj, ['d', 'd1'], 3)
// -- // { a: 1, b: 2, d: { d1: 3, d2: 4 }, e: { e1: 'foo', e2: 'bar' } }
// -- obj3 === obj
// -- // true
// -- obj3.d === obj.d
// -- // true
// -- obj3.e === obj.e
// -- // true
// --
// -- // ... unknown paths create intermediate keys. Numeric segments are treated as array indices:
// -- setIn({ a: 3 }, ['unknown', 0, 'path'], 4)
// -- // { a: 3, unknown: [{ path: 4 }] }
// -- ```
function setIn(obj, path, val) {
if (!path.length) return val;
return doSetIn(obj, path, val, 0);
}
function doSetIn(obj, path, val, idx) {
let newValue;
const key = path[idx];
if (idx === path.length - 1) {
newValue = val;
} else {
const nestedObj = isObject(obj) && isObject(obj[key]) ? obj[key] : typeof path[idx + 1] === 'number' ? [] : {};
newValue = doSetIn(nestedObj, path, val, idx + 1);
}
return set(obj, key, newValue);
} // -- #### update()
// -- Returns a new object with a modified attribute,
// -- calculated via a user-provided callback based on the current value.
// -- If the calculated value is the same as (*referentially equal to*)
// -- the previous value, the original object is returned.
// --
// -- Usage: `update(obj, key, fnUpdate)`
// --
// -- ```js
// -- obj = { a: 1, b: 2, c: 3 }
// -- obj2 = update(obj, 'b', (val) => val + 1)
// -- // { a: 1, b: 3, c: 3 }
// -- obj2 === obj
// -- // false
// --
// -- // The same object is returned if there are no changes:
// -- update(obj, 'b', (val) => val) === obj
// -- // true
// -- ```
function update(obj, key, fnUpdate) {
const prevVal = obj == null ? undefined : obj[key];
const nextVal = fnUpdate(prevVal);
return set(obj, key, nextVal);
} // -- #### updateIn()
// -- Returns a new object with a modified **nested** attribute,
// -- calculated via a user-provided callback based on the current value.
// -- If the calculated value is the same as (*referentially equal to*)
// -- the previous value, the original object is returned.
// --
// -- Usage: `updateIn<T: ArrayOrObject>(obj: T, path: Array<Key>,
// -- fnUpdate: (prevValue: any) => any): T`
// --
// -- ```js
// -- obj = { a: 1, d: { d1: 3, d2: 4 } }
// -- obj2 = updateIn(obj, ['d', 'd1'], (val) => val + 1)
// -- // { a: 1, d: { d1: 4, d2: 4 } }
// -- obj2 === obj
// -- // false
// --
// -- // The same object is returned if there are no changes:
// -- obj3 = updateIn(obj, ['d', 'd1'], (val) => val)
// -- // { a: 1, d: { d1: 3, d2: 4 } }
// -- obj3 === obj
// -- // true
// -- ```
function updateIn(obj, path, fnUpdate) {
const prevVal = getIn(obj, path);
const nextVal = fnUpdate(prevVal);
return setIn(obj, path, nextVal);
} // -- #### merge()
// -- Returns a new object built as follows: the overlapping keys from the
// -- second one overwrite the corresponding entries from the first one.
// -- Similar to `Object.assign()`, but immutable.
// --
// -- Usage:
// --
// -- * `merge(obj1, obj2)`
// -- * `merge(obj1, ...objects)`
// --
// -- The unmodified `obj1` is returned if `obj2` does not *provide something
// -- new to* `obj1`, i.e. if either of the following
// -- conditions are true:
// --
// -- * `obj2` is `null` or `undefined`
// -- * `obj2` is an object, but it is empty
// -- * All attributes of `obj2` are `undefined`
// -- * All attributes of `obj2` are referentially equal to the
// -- corresponding attributes of `obj1`
// --
// -- Note that `undefined` attributes in `obj2` do not modify the
// -- corresponding attributes in `obj1`.
// --
// -- ```js
// -- obj1 = { a: 1, b: 2, c: 3 }
// -- obj2 = { c: 4, d: 5 }
// -- obj3 = merge(obj1, obj2)
// -- // { a: 1, b: 2, c: 4, d: 5 }
// -- obj3 === obj1
// -- // false
// --
// -- // The same object is returned if there are no changes:
// -- merge(obj1, { c: 3 }) === obj1
// -- // true
// -- ```
// Signatures:
// - 1 arg
// Implementation
function merge(a, b, c, d, e, f, ...rest) {
return rest.length ? doMerge.call(null, false, false, a, b, c, d, e, f, ...rest) : doMerge(false, false, a, b, c, d, e, f);
} // -- #### mergeDeep()
// -- Returns a new object built as follows: the overlapping keys from the
// -- second one overwrite the corresponding entries from the first one.
// -- If both the first and second entries are objects they are merged recursively.
// -- Similar to `Object.assign()`, but immutable, and deeply merging.
// --
// -- Usage:
// --
// -- * `mergeDeep(obj1, obj2)`
// -- * `mergeDeep(obj1, ...objects)`
// --
// -- The unmodified `obj1` is returned if `obj2` does not *provide something
// -- new to* `obj1`, i.e. if either of the following
// -- conditions are true:
// --
// -- * `obj2` is `null` or `undefined`
// -- * `obj2` is an object, but it is empty
// -- * All attributes of `obj2` are `undefined`
// -- * All attributes of `obj2` are referentially equal to the
// -- corresponding attributes of `obj1`
// --
// -- Note that `undefined` attributes in `obj2` do not modify the
// -- corresponding attributes in `obj1`.
// --
// -- ```js
// -- obj1 = { a: 1, b: 2, c: { a: 1 } }
// -- obj2 = { b: 3, c: { b: 2 } }
// -- obj3 = mergeDeep(obj1, obj2)
// -- // { a: 1, b: 3, c: { a: 1, b: 2 } }
// -- obj3 === obj1
// -- // false
// --
// -- // The same object is returned if there are no changes:
// -- mergeDeep(obj1, { c: { a: 1 } }) === obj1
// -- // true
// -- ```
function mergeDeep(a, b, c, d, e, f, ...rest) {
return rest.length ? doMerge.call(null, false, true, a, b, c, d, e, f, ...rest) : doMerge(false, true, a, b, c, d, e, f);
} // -- #### mergeIn()
// -- Similar to `merge()`, but merging the value at a given nested path.
// --
// -- Usage examples:
// --
// -- * `mergeIn(obj1, path, obj2)`
// -- * `mergeIn(obj1, path, ...objects)`
// --
// -- ```js
// -- obj1 = { a: 1, d: { b: { d1: 3, d2: 4 } } }
// -- obj2 = { d3: 5 }
// -- obj3 = mergeIn(obj1, ['d', 'b'], obj2)
// -- // { a: 1, d: { b: { d1: 3, d2: 4, d3: 5 } } }
// -- obj3 === obj1
// -- // false
// --
// -- // The same object is returned if there are no changes:
// -- mergeIn(obj1, ['d', 'b'], { d2: 4 }) === obj1
// -- // true
// -- ```
function mergeIn(a, path, b, c, d, e, f, ...rest) {
let prevVal = getIn(a, path);
if (prevVal == null) prevVal = {};
let nextVal;
if (rest.length) {
nextVal = doMerge.call(null, false, false, prevVal, b, c, d, e, f, ...rest);
} else {
nextVal = doMerge(false, false, prevVal, b, c, d, e, f);
}
return setIn(a, path, nextVal);
} // -- #### omit()
// -- Returns an object excluding one or several attributes.
// --
// -- Usage: `omit(obj, attrs)`
//
// -- ```js
// -- obj = { a: 1, b: 2, c: 3, d: 4 }
// -- omit(obj, 'a')
// -- // { b: 2, c: 3, d: 4 }
// -- omit(obj, ['b', 'c'])
// -- // { a: 1, d: 4 }
// --
// -- // The same object is returned if there are no changes:
// -- omit(obj, 'z') === obj1
// -- // true
// -- ```
function omit(obj, attrs) {
const omitList = Array.isArray(attrs) ? attrs : [attrs];
let fDoSomething = false;
for (let i = 0; i < omitList.length; i++) {
if (hasOwnProperty.call(obj, omitList[i])) {
fDoSomething = true;
break;
}
}
if (!fDoSomething) return obj;
const out = {};
const keys = getKeysAndSymbols(obj);
for (let i = 0; i < keys.length; i++) {
const key = keys[i];
if (omitList.indexOf(key) >= 0) continue;
out[key] = obj[key];
}
return out;
} // -- #### addDefaults()
// -- Returns a new object built as follows: `undefined` keys in the first one
// -- are filled in with the corresponding values from the second one
// -- (even if they are `null`).
// --
// -- Usage:
// --
// -- * `addDefaults(obj, defaults)`
// -- * `addDefaults(obj, ...defaultObjects)`
// --
// -- ```js
// -- obj1 = { a: 1, b: 2, c: 3 }
// -- obj2 = { c: 4, d: 5, e: null }
// -- obj3 = addDefaults(obj1, obj2)
// -- // { a: 1, b: 2, c: 3, d: 5, e: null }
// -- obj3 === obj1
// -- // false
// --
// -- // The same object is returned if there are no changes:
// -- addDefaults(obj1, { c: 4 }) === obj1
// -- // true
// -- ```
// Signatures:
// - 2 args
// Implementation and catch-all
function addDefaults(a, b, c, d, e, f, ...rest) {
return rest.length ? doMerge.call(null, true, false, a, b, c, d, e, f, ...rest) : doMerge(true, false, a, b, c, d, e, f);
}
function doMerge(fAddDefaults, fDeep, first, ...rest) {
let out = first;
if (!(out != null)) {
throwStr(IS_DEV ? 'At least one object should be provided to merge()' : INVALID_ARGS);
}
let fChanged = false;
for (let idx = 0; idx < rest.length; idx++) {
const obj = rest[idx];
if (obj == null) continue;
const keys = getKeysAndSymbols(obj);
if (!keys.length) continue;
for (let j = 0; j <= keys.length; j++) {
const key = keys[j];
if (fAddDefaults && out[key] !== undefined) continue;
let nextVal = obj[key];
if (fDeep && isObject(out[key]) && isObject(nextVal)) {
nextVal = doMerge(fAddDefaults, fDeep, out[key], nextVal);
}
if (nextVal === undefined || nextVal === out[key]) continue;
if (!fChanged) {
fChanged = true;
out = clone(out);
}
out[key] = nextVal;
}
}
return out;
} // ===============================================
// ### Public API
// ===============================================
const timm = {
clone,
addLast,
addFirst,
removeLast,
removeFirst,
insert,
removeAt,
replaceAt,
getIn,
set,
setIn,
update,
updateIn,
merge,
mergeDeep,
mergeIn,
omit,
addDefaults
};
var _default = timm;
exports["default"] = _default;
/***/ }),
/***/ 4261:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.AnsiStringType = exports.StringType = exports.BufferType = exports.Uint8ArrayType = exports.IgnoreType = exports.Float80_LE = exports.Float80_BE = exports.Float64_LE = exports.Float64_BE = exports.Float32_LE = exports.Float32_BE = exports.Float16_LE = exports.Float16_BE = exports.INT64_BE = exports.UINT64_BE = exports.INT64_LE = exports.UINT64_LE = exports.INT32_LE = exports.INT32_BE = exports.INT24_BE = exports.INT24_LE = exports.INT16_LE = exports.INT16_BE = exports.INT8 = exports.UINT32_BE = exports.UINT32_LE = exports.UINT24_BE = exports.UINT24_LE = exports.UINT16_BE = exports.UINT16_LE = exports.UINT8 = void 0;
const ieee754 = __nccwpck_require__(3092);
// Primitive types
function dv(array) {
return new DataView(array.buffer, array.byteOffset);
}
/**
* 8-bit unsigned integer
*/
exports.UINT8 = {
len: 1,
get(array, offset) {
return dv(array).getUint8(offset);
},
put(array, offset, value) {
dv(array).setUint8(offset, value);
return offset + 1;
}
};
/**
* 16-bit unsigned integer, Little Endian byte order
*/
exports.UINT16_LE = {
len: 2,
get(array, offset) {
return dv(array).getUint16(offset, true);
},
put(array, offset, value) {
dv(array).setUint16(offset, value, true);
return offset + 2;
}
};
/**
* 16-bit unsigned integer, Big Endian byte order
*/
exports.UINT16_BE = {
len: 2,
get(array, offset) {
return dv(array).getUint16(offset);
},
put(array, offset, value) {
dv(array).setUint16(offset, value);
return offset + 2;
}
};
/**
* 24-bit unsigned integer, Little Endian byte order
*/
exports.UINT24_LE = {
len: 3,
get(array, offset) {
const dataView = dv(array);
return dataView.getUint8(offset) + (dataView.getUint16(offset + 1, true) << 8);
},
put(array, offset, value) {
const dataView = dv(array);
dataView.setUint8(offset, value & 0xff);
dataView.setUint16(offset + 1, value >> 8, true);
return offset + 3;
}
};
/**
* 24-bit unsigned integer, Big Endian byte order
*/
exports.UINT24_BE = {
len: 3,
get(array, offset) {
const dataView = dv(array);
return (dataView.getUint16(offset) << 8) + dataView.getUint8(offset + 2);
},
put(array, offset, value) {
const dataView = dv(array);
dataView.setUint16(offset, value >> 8);
dataView.setUint8(offset + 2, value & 0xff);
return offset + 3;
}
};
/**
* 32-bit unsigned integer, Little Endian byte order
*/
exports.UINT32_LE = {
len: 4,
get(array, offset) {
return dv(array).getUint32(offset, true);
},
put(array, offset, value) {
dv(array).setUint32(offset, value, true);
return offset + 4;
}
};
/**
* 32-bit unsigned integer, Big Endian byte order
*/
exports.UINT32_BE = {
len: 4,
get(array, offset) {
return dv(array).getUint32(offset);
},
put(array, offset, value) {
dv(array).setUint32(offset, value);
return offset + 4;
}
};
/**
* 8-bit signed integer
*/
exports.INT8 = {
len: 1,
get(array, offset) {
return dv(array).getInt8(offset);
},
put(array, offset, value) {
dv(array).setInt8(offset, value);
return offset + 1;
}
};
/**
* 16-bit signed integer, Big Endian byte order
*/
exports.INT16_BE = {
len: 2,
get(array, offset) {
return dv(array).getInt16(offset);
},
put(array, offset, value) {
dv(array).setInt16(offset, value);
return offset + 2;
}
};
/**
* 16-bit signed integer, Little Endian byte order
*/
exports.INT16_LE = {
len: 2,
get(array, offset) {
return dv(array).getInt16(offset, true);
},
put(array, offset, value) {
dv(array).setInt16(offset, value, true);
return offset + 2;
}
};
/**
* 24-bit signed integer, Little Endian byte order
*/
exports.INT24_LE = {
len: 3,
get(array, offset) {
const unsigned = exports.UINT24_LE.get(array, offset);
return unsigned > 0x7fffff ? unsigned - 0x1000000 : unsigned;
},
put(array, offset, value) {
const dataView = dv(array);
dataView.setUint8(offset, value & 0xff);
dataView.setUint16(offset + 1, value >> 8, true);
return offset + 3;
}
};
/**
* 24-bit signed integer, Big Endian byte order
*/
exports.INT24_BE = {
len: 3,
get(array, offset) {
const unsigned = exports.UINT24_BE.get(array, offset);
return unsigned > 0x7fffff ? unsigned - 0x1000000 : unsigned;
},
put(array, offset, value) {
const dataView = dv(array);
dataView.setUint16(offset, value >> 8);
dataView.setUint8(offset + 2, value & 0xff);
return offset + 3;
}
};
/**
* 32-bit signed integer, Big Endian byte order
*/
exports.INT32_BE = {
len: 4,
get(array, offset) {
return dv(array).getInt32(offset);
},
put(array, offset, value) {
dv(array).setInt32(offset, value);
return offset + 4;
}
};
/**
* 32-bit signed integer, Big Endian byte order
*/
exports.INT32_LE = {
len: 4,
get(array, offset) {
return dv(array).getInt32(offset, true);
},
put(array, offset, value) {
dv(array).setInt32(offset, value, true);
return offset + 4;
}
};
/**
* 64-bit unsigned integer, Little Endian byte order
*/
exports.UINT64_LE = {
len: 8,
get(array, offset) {
return dv(array).getBigUint64(offset, true);
},
put(array, offset, value) {
dv(array).setBigUint64(offset, value, true);
return offset + 8;
}
};
/**
* 64-bit signed integer, Little Endian byte order
*/
exports.INT64_LE = {
len: 8,
get(array, offset) {
return dv(array).getBigInt64(offset, true);
},
put(array, offset, value) {
dv(array).setBigInt64(offset, value, true);
return offset + 8;
}
};
/**
* 64-bit unsigned integer, Big Endian byte order
*/
exports.UINT64_BE = {
len: 8,
get(array, offset) {
return dv(array).getBigUint64(offset);
},
put(array, offset, value) {
dv(array).setBigUint64(offset, value);
return offset + 8;
}
};
/**
* 64-bit signed integer, Big Endian byte order
*/
exports.INT64_BE = {
len: 8,
get(array, offset) {
return dv(array).getBigInt64(offset);
},
put(array, offset, value) {
dv(array).setBigInt64(offset, value);
return offset + 8;
}
};
/**
* IEEE 754 16-bit (half precision) float, big endian
*/
exports.Float16_BE = {
len: 2,
get(dataView, offset) {
return ieee754.read(dataView, offset, false, 10, this.len);
},
put(dataView, offset, value) {
ieee754.write(dataView, value, offset, false, 10, this.len);
return offset + this.len;
}
};
/**
* IEEE 754 16-bit (half precision) float, little endian
*/
exports.Float16_LE = {
len: 2,
get(array, offset) {
return ieee754.read(array, offset, true, 10, this.len);
},
put(array, offset, value) {
ieee754.write(array, value, offset, true, 10, this.len);
return offset + this.len;
}
};
/**
* IEEE 754 32-bit (single precision) float, big endian
*/
exports.Float32_BE = {
len: 4,
get(array, offset) {
return dv(array).getFloat32(offset);
},
put(array, offset, value) {
dv(array).setFloat32(offset, value);
return offset + 4;
}
};
/**
* IEEE 754 32-bit (single precision) float, little endian
*/
exports.Float32_LE = {
len: 4,
get(array, offset) {
return dv(array).getFloat32(offset, true);
},
put(array, offset, value) {
dv(array).setFloat32(offset, value, true);
return offset + 4;
}
};
/**
* IEEE 754 64-bit (double precision) float, big endian
*/
exports.Float64_BE = {
len: 8,
get(array, offset) {
return dv(array).getFloat64(offset);
},
put(array, offset, value) {
dv(array).setFloat64(offset, value);
return offset + 8;
}
};
/**
* IEEE 754 64-bit (double precision) float, little endian
*/
exports.Float64_LE = {
len: 8,
get(array, offset) {
return dv(array).getFloat64(offset, true);
},
put(array, offset, value) {
dv(array).setFloat64(offset, value, true);
return offset + 8;
}
};
/**
* IEEE 754 80-bit (extended precision) float, big endian
*/
exports.Float80_BE = {
len: 10,
get(array, offset) {
return ieee754.read(array, offset, false, 63, this.len);
},
put(array, offset, value) {
ieee754.write(array, value, offset, false, 63, this.len);
return offset + this.len;
}
};
/**
* IEEE 754 80-bit (extended precision) float, little endian
*/
exports.Float80_LE = {
len: 10,
get(array, offset) {
return ieee754.read(array, offset, true, 63, this.len);
},
put(array, offset, value) {
ieee754.write(array, value, offset, true, 63, this.len);
return offset + this.len;
}
};
/**
* Ignore a given number of bytes
*/
class IgnoreType {
/**
* @param len number of bytes to ignore
*/
constructor(len) {
this.len = len;
}
// ToDo: don't read, but skip data
get(array, off) {
}
}
exports.IgnoreType = IgnoreType;
class Uint8ArrayType {
constructor(len) {
this.len = len;
}
get(array, offset) {
return array.subarray(offset, offset + this.len);
}
}
exports.Uint8ArrayType = Uint8ArrayType;
class BufferType {
constructor(len) {
this.len = len;
}
get(uint8Array, off) {
return Buffer.from(uint8Array.subarray(off, off + this.len));
}
}
exports.BufferType = BufferType;
/**
* Consume a fixed number of bytes from the stream and return a string with a specified encoding.
*/
class StringType {
constructor(len, encoding) {
this.len = len;
this.encoding = encoding;
}
get(uint8Array, offset) {
return Buffer.from(uint8Array).toString(this.encoding, offset, offset + this.len);
}
}
exports.StringType = StringType;
/**
* ANSI Latin 1 String
* Using windows-1252 / ISO 8859-1 decoding
*/
class AnsiStringType {
constructor(len) {
this.len = len;
}
static decode(buffer, offset, until) {
let str = '';
for (let i = offset; i < until; ++i) {
str += AnsiStringType.codePointToString(AnsiStringType.singleByteDecoder(buffer[i]));
}
return str;
}
static inRange(a, min, max) {
return min <= a && a <= max;
}
static codePointToString(cp) {
if (cp <= 0xFFFF) {
return String.fromCharCode(cp);
}
else {
cp -= 0x10000;
return String.fromCharCode((cp >> 10) + 0xD800, (cp & 0x3FF) + 0xDC00);
}
}
static singleByteDecoder(bite) {
if (AnsiStringType.inRange(bite, 0x00, 0x7F)) {
return bite;
}
const codePoint = AnsiStringType.windows1252[bite - 0x80];
if (codePoint === null) {
throw Error('invaliding encoding');
}
return codePoint;
}
get(buffer, offset = 0) {
return AnsiStringType.decode(buffer, offset, offset + this.len);
}
}
exports.AnsiStringType = AnsiStringType;
AnsiStringType.windows1252 = [8364, 129, 8218, 402, 8222, 8230, 8224, 8225, 710, 8240, 352,
8249, 338, 141, 381, 143, 144, 8216, 8217, 8220, 8221, 8226, 8211, 8212, 732,
8482, 353, 8250, 339, 157, 382, 376, 160, 161, 162, 163, 164, 165, 166, 167, 168,
169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184,
185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200,
201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216,
217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232,
233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247,
248, 249, 250, 251, 252, 253, 254, 255];
/***/ }),
/***/ 4256:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
"use strict";
var punycode = __nccwpck_require__(5477);
var mappingTable = __nccwpck_require__(2020);
var PROCESSING_OPTIONS = {
TRANSITIONAL: 0,
NONTRANSITIONAL: 1
};
function normalize(str) { // fix bug in v8
return str.split('\u0000').map(function (s) { return s.normalize('NFC'); }).join('\u0000');
}
function findStatus(val) {
var start = 0;
var end = mappingTable.length - 1;
while (start <= end) {
var mid = Math.floor((start + end) / 2);
var target = mappingTable[mid];
if (target[0][0] <= val && target[0][1] >= val) {
return target;
} else if (target[0][0] > val) {
end = mid - 1;
} else {
start = mid + 1;
}
}
return null;
}
var regexAstralSymbols = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
function countSymbols(string) {
return string
// replace every surrogate pair with a BMP symbol
.replace(regexAstralSymbols, '_')
// then get the length
.length;
}
function mapChars(domain_name, useSTD3, processing_option) {
var hasError = false;
var processed = "";
var len = countSymbols(domain_name);
for (var i = 0; i < len; ++i) {
var codePoint = domain_name.codePointAt(i);
var status = findStatus(codePoint);
switch (status[1]) {
case "disallowed":
hasError = true;
processed += String.fromCodePoint(codePoint);
break;
case "ignored":
break;
case "mapped":
processed += String.fromCodePoint.apply(String, status[2]);
break;
case "deviation":
if (processing_option === PROCESSING_OPTIONS.TRANSITIONAL) {
processed += String.fromCodePoint.apply(String, status[2]);
} else {
processed += String.fromCodePoint(codePoint);
}
break;
case "valid":
processed += String.fromCodePoint(codePoint);
break;
case "disallowed_STD3_mapped":
if (useSTD3) {
hasError = true;
processed += String.fromCodePoint(codePoint);
} else {
processed += String.fromCodePoint.apply(String, status[2]);
}
break;
case "disallowed_STD3_valid":
if (useSTD3) {
hasError = true;
}
processed += String.fromCodePoint(codePoint);
break;
}
}
return {
string: processed,
error: hasError
};
}
var combiningMarksRegex = /[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08E4-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u18A9\u1920-\u192B\u1930-\u193B\u19B0-\u19C0\u19C8\u19C9\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFC-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C4\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2D]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC7F-\uDC82\uDCB0-\uDCBA\uDD00-\uDD02\uDD27-\uDD34\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDE2C-\uDE37\uDEDF-\uDEEA\uDF01-\uDF03\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDE30-\uDE40\uDEAB-\uDEB7]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF51-\uDF7E\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD83A[\uDCD0-\uDCD6]|\uDB40[\uDD00-\uDDEF]/;
function validateLabel(label, processing_option) {
if (label.substr(0, 4) === "xn--") {
label = punycode.toUnicode(label);
processing_option = PROCESSING_OPTIONS.NONTRANSITIONAL;
}
var error = false;
if (normalize(label) !== label ||
(label[3] === "-" && label[4] === "-") ||
label[0] === "-" || label[label.length - 1] === "-" ||
label.indexOf(".") !== -1 ||
label.search(combiningMarksRegex) === 0) {
error = true;
}
var len = countSymbols(label);
for (var i = 0; i < len; ++i) {
var status = findStatus(label.codePointAt(i));
if ((processing === PROCESSING_OPTIONS.TRANSITIONAL && status[1] !== "valid") ||
(processing === PROCESSING_OPTIONS.NONTRANSITIONAL &&
status[1] !== "valid" && status[1] !== "deviation")) {
error = true;
break;
}
}
return {
label: label,
error: error
};
}
function processing(domain_name, useSTD3, processing_option) {
var result = mapChars(domain_name, useSTD3, processing_option);
result.string = normalize(result.string);
var labels = result.string.split(".");
for (var i = 0; i < labels.length; ++i) {
try {
var validation = validateLabel(labels[i]);
labels[i] = validation.label;
result.error = result.error || validation.error;
} catch(e) {
result.error = true;
}
}
return {
string: labels.join("."),
error: result.error
};
}
module.exports.toASCII = function(domain_name, useSTD3, processing_option, verifyDnsLength) {
var result = processing(domain_name, useSTD3, processing_option);
var labels = result.string.split(".");
labels = labels.map(function(l) {
try {
return punycode.toASCII(l);
} catch(e) {
result.error = true;
return l;
}
});
if (verifyDnsLength) {
var total = labels.slice(0, labels.length - 1).join(".").length;
if (total.length > 253 || total.length === 0) {
result.error = true;
}
for (var i=0; i < labels.length; ++i) {
if (labels.length > 63 || labels.length === 0) {
result.error = true;
break;
}
}
}
if (result.error) return null;
return labels.join(".");
};
module.exports.toUnicode = function(domain_name, useSTD3) {
var result = processing(domain_name, useSTD3, PROCESSING_OPTIONS.NONTRANSITIONAL);
return {
domain: result.string,
error: result.error
};
};
module.exports.PROCESSING_OPTIONS = PROCESSING_OPTIONS;
/***/ }),
/***/ 4294:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
module.exports = __nccwpck_require__(4219);
/***/ }),
/***/ 4219:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
var net = __nccwpck_require__(1808);
var tls = __nccwpck_require__(4404);
var http = __nccwpck_require__(3685);
var https = __nccwpck_require__(5687);
var events = __nccwpck_require__(2361);
var assert = __nccwpck_require__(9491);
var util = __nccwpck_require__(3837);
exports.httpOverHttp = httpOverHttp;
exports.httpsOverHttp = httpsOverHttp;
exports.httpOverHttps = httpOverHttps;
exports.httpsOverHttps = httpsOverHttps;
function httpOverHttp(options) {
var agent = new TunnelingAgent(options);
agent.request = http.request;
return agent;
}
function httpsOverHttp(options) {
var agent = new TunnelingAgent(options);
agent.request = http.request;
agent.createSocket = createSecureSocket;
agent.defaultPort = 443;
return agent;
}
function httpOverHttps(options) {
var agent = new TunnelingAgent(options);
agent.request = https.request;
return agent;
}
function httpsOverHttps(options) {
var agent = new TunnelingAgent(options);
agent.request = https.request;
agent.createSocket = createSecureSocket;
agent.defaultPort = 443;
return agent;
}
function TunnelingAgent(options) {
var self = this;
self.options = options || {};
self.proxyOptions = self.options.proxy || {};
self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
self.requests = [];
self.sockets = [];
self.on('free', function onFree(socket, host, port, localAddress) {
var options = toOptions(host, port, localAddress);
for (var i = 0, len = self.requests.length; i < len; ++i) {
var pending = self.requests[i];
if (pending.host === options.host && pending.port === options.port) {
// Detect the request to connect same origin server,
// reuse the connection.
self.requests.splice(i, 1);
pending.request.onSocket(socket);
return;
}
}
socket.destroy();
self.removeSocket(socket);
});
}
util.inherits(TunnelingAgent, events.EventEmitter);
TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
var self = this;
var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
if (self.sockets.length >= this.maxSockets) {
// We are over limit so we'll add it to the queue.
self.requests.push(options);
return;
}
// If we are under maxSockets create a new one.
self.createSocket(options, function(socket) {
socket.on('free', onFree);
socket.on('close', onCloseOrRemove);
socket.on('agentRemove', onCloseOrRemove);
req.onSocket(socket);
function onFree() {
self.emit('free', socket, options);
}
function onCloseOrRemove(err) {
self.removeSocket(socket);
socket.removeListener('free', onFree);
socket.removeListener('close', onCloseOrRemove);
socket.removeListener('agentRemove', onCloseOrRemove);
}
});
};
TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
var self = this;
var placeholder = {};
self.sockets.push(placeholder);
var connectOptions = mergeOptions({}, self.proxyOptions, {
method: 'CONNECT',
path: options.host + ':' + options.port,
agent: false,
headers: {
host: options.host + ':' + options.port
}
});
if (options.localAddress) {
connectOptions.localAddress = options.localAddress;
}
if (connectOptions.proxyAuth) {
connectOptions.headers = connectOptions.headers || {};
connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
new Buffer(connectOptions.proxyAuth).toString('base64');
}
debug('making CONNECT request');
var connectReq = self.request(connectOptions);
connectReq.useChunkedEncodingByDefault = false; // for v0.6
connectReq.once('response', onResponse); // for v0.6
connectReq.once('upgrade', onUpgrade); // for v0.6
connectReq.once('connect', onConnect); // for v0.7 or later
connectReq.once('error', onError);
connectReq.end();
function onResponse(res) {
// Very hacky. This is necessary to avoid http-parser leaks.
res.upgrade = true;
}
function onUpgrade(res, socket, head) {
// Hacky.
process.nextTick(function() {
onConnect(res, socket, head);
});
}
function onConnect(res, socket, head) {
connectReq.removeAllListeners();
socket.removeAllListeners();
if (res.statusCode !== 200) {
debug('tunneling socket could not be established, statusCode=%d',
res.statusCode);
socket.destroy();
var error = new Error('tunneling socket could not be established, ' +
'statusCode=' + res.statusCode);
error.code = 'ECONNRESET';
options.request.emit('error', error);
self.removeSocket(placeholder);
return;
}
if (head.length > 0) {
debug('got illegal response body from proxy');
socket.destroy();
var error = new Error('got illegal response body from proxy');
error.code = 'ECONNRESET';
options.request.emit('error', error);
self.removeSocket(placeholder);
return;
}
debug('tunneling connection has established');
self.sockets[self.sockets.indexOf(placeholder)] = socket;
return cb(socket);
}
function onError(cause) {
connectReq.removeAllListeners();
debug('tunneling socket could not be established, cause=%s\n',
cause.message, cause.stack);
var error = new Error('tunneling socket could not be established, ' +
'cause=' + cause.message);
error.code = 'ECONNRESET';
options.request.emit('error', error);
self.removeSocket(placeholder);
}
};
TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
var pos = this.sockets.indexOf(socket)
if (pos === -1) {
return;
}
this.sockets.splice(pos, 1);
var pending = this.requests.shift();
if (pending) {
// If we have pending requests and a socket gets closed a new one
// needs to be created to take over in the pool for the one that closed.
this.createSocket(pending, function(socket) {
pending.request.onSocket(socket);
});
}
};
function createSecureSocket(options, cb) {
var self = this;
TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
var hostHeader = options.request.getHeader('host');
var tlsOptions = mergeOptions({}, self.options, {
socket: socket,
servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
});
// 0 is dummy port for v0.6
var secureSocket = tls.connect(0, tlsOptions);
self.sockets[self.sockets.indexOf(socket)] = secureSocket;
cb(secureSocket);
});
}
function toOptions(host, port, localAddress) {
if (typeof host === 'string') { // since v0.10
return {
host: host,
port: port,
localAddress: localAddress
};
}
return host; // for v0.11 or later
}
function mergeOptions(target) {
for (var i = 1, len = arguments.length; i < len; ++i) {
var overrides = arguments[i];
if (typeof overrides === 'object') {
var keys = Object.keys(overrides);
for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
var k = keys[j];
if (overrides[k] !== undefined) {
target[k] = overrides[k];
}
}
}
}
return target;
}
var debug;
if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
debug = function() {
var args = Array.prototype.slice.call(arguments);
if (typeof args[0] === 'string') {
args[0] = 'TUNNEL: ' + args[0];
} else {
args.unshift('TUNNEL:');
}
console.error.apply(console, args);
}
} else {
debug = function() {};
}
exports.debug = debug; // for test
/***/ }),
/***/ 2783:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
;(function(){
var UTIF = {};
// Make available for import by `require()`
if (true) {module.exports = UTIF;}
else {}
var pako = ( true) ? __nccwpck_require__(1726) : 0;
function log() { if (typeof process=="undefined" || process.env.NODE_ENV=="development") console.log.apply(console, arguments); }
(function(UTIF, pako){
// Following lines add a JPEG decoder to UTIF.JpegDecoder
(function(){"use strict";var W=function a1(){function W(p){this.message="JPEG error: "+p}W.prototype=new Error;W.prototype.name="JpegError";W.constructor=W;return W}(),ak=function ag(){var p=new Uint8Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),t=4017,ac=799,ah=3406,ao=2276,ar=1567,ai=3784,s=5793,ad=2896;function ak(Q){if(Q==null)Q={};if(Q.w==null)Q.w=-1;this.V=Q.n;this.N=Q.w}function a5(Q,h){var f=0,G=[],n,E,a=16,F;while(a>0&&!Q[a-1]){a--}G.push({children:[],index:0});var C=G[0];for(n=0;n<a;n++)
{for(E=0;E<Q[n];E++){C=G.pop();C.children[C.index]=h[f];while(C.index>0){C=G.pop()}C.index++;G.push(C);while(G.length<=n){G.push(F={children:[],index:0});C.children[C.index]=F.children;C=F}f++}if(n+1<a){G.push(F={children:[],index:0});C.children[C.index]=F.children;C=F}}return G[0].children}function a2(Q,h,f){return 64*((Q.P+1)*h+f)}function a7(Q,h,f,G,n,E,a,C,F,d){if(d==null)d=!1;var T=f.m,U=f.Z,z=h,J=0,V=0,r=0,D=0,a8,q=0,X,O,_,N,e,K,x=0,k,g,R,c;function Y(){if(V>0){V--;return J>>V&1}J=Q[h++];if(J===255){var I=Q[h++];if(I){if(I===220&&d){h+=2;var l=Z(Q,h);h+=2;if(l>0&&l!==f.s){throw new DNLMarkerError("Found DNL marker (0xFFDC) while parsing scan data",l)}}else if(I===217){if(d){var M=q*8;
if(M>0&&M<f.s/10){throw new DNLMarkerError("Found EOI marker (0xFFD9) while parsing scan data, "+"possibly caused by incorrect `scanLines` parameter",M)}}throw new EOIMarkerError("Found EOI marker (0xFFD9) while parsing scan data")}throw new W("unexpected marker")}}V=7;return J>>>7}function u(I){var l=I;while(!0){l=l[Y()];switch(typeof l){case"number":return l;case"object":continue}throw new W("invalid huffman sequence")}}function m(I){var e=0;while(I>0){e=e<<1|Y();I--}return e}function j(I){if(I===1){return Y()===1?1:-1}var e=m(I);if(e>=1<<I-1){return e}return e+(-1<<I)+1}function v(X,I){var l=u(X.J),M=l===0?0:j(l),N=1;
X.D[I]=X.Q+=M;while(N<64){var S=u(X.i),i=S&15,A=S>>4;if(i===0){if(A<15){break}N+=16;continue}N+=A;var o=p[N];X.D[I+o]=j(i);N++}}function $(X,I){var l=u(X.J),M=l===0?0:j(l)<<F;X.D[I]=X.Q+=M}function b(X,I){X.D[I]|=Y()<<F}function P(X,I){if(r>0){r--;return}var N=E,l=a;while(N<=l){var M=u(X.i),S=M&15,i=M>>4;if(S===0){if(i<15){r=m(i)+(1<<i)-1;break}N+=16;continue}N+=i;var A=p[N];X.D[I+A]=j(S)*(1<<F);N++}}function a4(X,I){var N=E,l=a,M=0,S,i;while(N<=l){var A=I+p[N],o=X.D[A]<0?-1:1;switch(D){case 0:i=u(X.i);S=i&15;M=i>>4;if(S===0){if(M<15){r=m(M)+(1<<M);D=4}else{M=16;D=1}}else{if(S!==1){throw new W("invalid ACn encoding")}a8=j(S);D=M?2:3}continue;case 1:case 2:if(X.D[A]){X.D[A]+=o*(Y()<<F)}else{M--;if(M===0){D=D===2?3:0}}break;case 3:if(X.D[A]){X.D[A]+=o*(Y()<<F)}else{X.D[A]=a8<<F;
D=0}break;case 4:if(X.D[A]){X.D[A]+=o*(Y()<<F)}break}N++}if(D===4){r--;if(r===0){D=0}}}function H(X,I,x,l,M){var S=x/T|0,i=x%T;q=S*X.A+l;var A=i*X.h+M,o=a2(X,q,A);I(X,o)}function w(X,I,x){q=x/X.P|0;var l=x%X.P,M=a2(X,q,l);I(X,M)}var y=G.length;if(U){if(E===0){K=C===0?$:b}else{K=C===0?P:a4}}else{K=v}if(y===1){g=G[0].P*G[0].c}else{g=T*f.R}while(x<=g){var L=n?Math.min(g-x,n):g;if(L>0){for(O=0;O<y;O++){G[O].Q=0}r=0;if(y===1){X=G[0];for(e=0;e<L;e++){w(X,K,x);x++}}else{for(e=0;e<L;
e++){for(O=0;O<y;O++){X=G[O];R=X.h;c=X.A;for(_=0;_<c;_++){for(N=0;N<R;N++){H(X,K,x,_,N)}}}x++}}}V=0;k=an(Q,h);if(!k){break}if(k.u){var a6=L>0?"unexpected":"excessive";h=k.offset}if(k.M>=65488&&k.M<=65495){h+=2}else{break}}return h-z}function al(Q,h,f){var G=Q.$,n=Q.D,E,a,C,F,d,T,U,z,J,V,Y,u,m,j,v,$,b;if(!G){throw new W("missing required Quantization Table.")}for(var r=0;r<64;r+=8){J=n[h+r];V=n[h+r+1];Y=n[h+r+2];u=n[h+r+3];m=n[h+r+4];j=n[h+r+5];v=n[h+r+6];$=n[h+r+7];J*=G[r];if((V|Y|u|m|j|v|$)===0){b=s*J+512>>10;f[r]=b;f[r+1]=b;f[r+2]=b;f[r+3]=b;f[r+4]=b;f[r+5]=b;f[r+6]=b;f[r+7]=b;continue}V*=G[r+1];Y*=G[r+2];u*=G[r+3];m*=G[r+4];j*=G[r+5];v*=G[r+6];$*=G[r+7];E=s*J+128>>8;a=s*m+128>>8;C=Y;F=v;d=ad*(V-$)+128>>8;z=ad*(V+$)+128>>8;
T=u<<4;U=j<<4;E=E+a+1>>1;a=E-a;b=C*ai+F*ar+128>>8;C=C*ar-F*ai+128>>8;F=b;d=d+U+1>>1;U=d-U;z=z+T+1>>1;T=z-T;E=E+F+1>>1;F=E-F;a=a+C+1>>1;C=a-C;b=d*ao+z*ah+2048>>12;d=d*ah-z*ao+2048>>12;z=b;b=T*ac+U*t+2048>>12;T=T*t-U*ac+2048>>12;U=b;f[r]=E+z;f[r+7]=E-z;f[r+1]=a+U;f[r+6]=a-U;f[r+2]=C+T;f[r+5]=C-T;f[r+3]=F+d;f[r+4]=F-d}for(var P=0;P<8;++P){J=f[P];V=f[P+8];Y=f[P+16];u=f[P+24];m=f[P+32];j=f[P+40];v=f[P+48];$=f[P+56];if((V|Y|u|m|j|v|$)===0){b=s*J+8192>>14;if(b<-2040){b=0}else if(b>=2024){b=255}else{b=b+2056>>4}n[h+P]=b;n[h+P+8]=b;n[h+P+16]=b;n[h+P+24]=b;n[h+P+32]=b;n[h+P+40]=b;n[h+P+48]=b;n[h+P+56]=b;continue}E=s*J+2048>>12;a=s*m+2048>>12;C=Y;F=v;d=ad*(V-$)+2048>>12;z=ad*(V+$)+2048>>12;T=u;U=j;E=(E+a+1>>1)+4112;a=E-a;b=C*ai+F*ar+2048>>12;C=C*ar-F*ai+2048>>12;F=b;d=d+U+1>>1;U=d-U;z=z+T+1>>1;T=z-T;E=E+F+1>>1;F=E-F;a=a+C+1>>1;C=a-C;b=d*ao+z*ah+2048>>12;d=d*ah-z*ao+2048>>12;z=b;
b=T*ac+U*t+2048>>12;T=T*t-U*ac+2048>>12;U=b;J=E+z;$=E-z;V=a+U;v=a-U;Y=C+T;j=C-T;u=F+d;m=F-d;if(J<16){J=0}else if(J>=4080){J=255}else{J>>=4}if(V<16){V=0}else if(V>=4080){V=255}else{V>>=4}if(Y<16){Y=0}else if(Y>=4080){Y=255}else{Y>>=4}if(u<16){u=0}else if(u>=4080){u=255}else{u>>=4}if(m<16){m=0}else if(m>=4080){m=255}else{m>>=4}if(j<16){j=0}else if(j>=4080){j=255}else{j>>=4}if(v<16){v=0}else if(v>=4080){v=255}else{v>>=4}if($<16){$=0}else if($>=4080){$=255}else{$>>=4}n[h+P]=J;
n[h+P+8]=V;n[h+P+16]=Y;n[h+P+24]=u;n[h+P+32]=m;n[h+P+40]=j;n[h+P+48]=v;n[h+P+56]=$}}function a0(Q,h){var f=h.P,G=h.c,n=new Int16Array(64);for(var E=0;E<G;E++){for(var a=0;a<f;a++){var C=a2(h,E,a);al(h,C,n)}}return h.D}function an(Q,h,f){if(f==null)f=h;var G=Q.length-1,n=f<h?f:h;if(h>=G){return null}var E=Z(Q,h);if(E>=65472&&E<=65534){return{u:null,M:E,offset:h}}var a=Z(Q,n);while(!(a>=65472&&a<=65534)){if(++n>=G){return null}a=Z(Q,n)}return{u:E.toString(16),M:a,offset:n}}ak.prototype={parse(Q,h){if(h==null)h={};
var f=h.F,E=0,a=null,C=null,F,d,T=0;function G(){var o=Z(Q,E);E+=2;var B=E+o-2,V=an(Q,B,E);if(V&&V.u){B=V.offset}var ab=Q.subarray(E,B);E+=ab.length;return ab}function n(F){var o=Math.ceil(F.o/8/F.X),B=Math.ceil(F.s/8/F.B);for(var Y=0;Y<F.W.length;Y++){R=F.W[Y];var ab=Math.ceil(Math.ceil(F.o/8)*R.h/F.X),af=Math.ceil(Math.ceil(F.s/8)*R.A/F.B),ap=o*R.h,aq=B*R.A,ae=64*aq*(ap+1);R.D=new Int16Array(ae);R.P=ab;R.c=af}F.m=o;F.R=B}var U=[],z=[],J=[],V=Z(Q,E);E+=2;if(V!==65496){throw new W("SOI not found")}V=Z(Q,E);
E+=2;markerLoop:while(V!==65497){var Y,u,m;switch(V){case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:var j=G();if(V===65504){if(j[0]===74&&j[1]===70&&j[2]===73&&j[3]===70&&j[4]===0){a={version:{d:j[5],T:j[6]},K:j[7],j:j[8]<<8|j[9],H:j[10]<<8|j[11],S:j[12],I:j[13],C:j.subarray(14,14+3*j[12]*j[13])}}}if(V===65518){if(j[0]===65&&j[1]===100&&j[2]===111&&j[3]===98&&j[4]===101){C={version:j[5]<<8|j[6],k:j[7]<<8|j[8],q:j[9]<<8|j[10],a:j[11]}}}break;
case 65499:var v=Z(Q,E),b;E+=2;var $=v+E-2;while(E<$){var r=Q[E++],P=new Uint16Array(64);if(r>>4===0){for(u=0;u<64;u++){b=p[u];P[b]=Q[E++]}}else if(r>>4===1){for(u=0;u<64;u++){b=p[u];P[b]=Z(Q,E);E+=2}}else{throw new W("DQT - invalid table spec")}U[r&15]=P}break;case 65472:case 65473:case 65474:if(F){throw new W("Only single frame JPEGs supported")}E+=2;F={};F.G=V===65473;F.Z=V===65474;F.precision=Q[E++];var D=Z(Q,E),a4,q=0,H=0;E+=2;F.s=f||D;F.o=Z(Q,E);E+=2;F.W=[];F._={};var a8=Q[E++];for(Y=0;Y<a8;Y++){a4=Q[E];var w=Q[E+1]>>4,y=Q[E+1]&15;if(q<w){q=w}if(H<y){H=y}var X=Q[E+2];m=F.W.push({h:w,A:y,L:X,$:null});F._[a4]=m-1;E+=3}F.X=q;F.B=H;n(F);break;case 65476:var O=Z(Q,E);E+=2;
for(Y=2;Y<O;){var _=Q[E++],N=new Uint8Array(16),e=0;for(u=0;u<16;u++,E++){e+=N[u]=Q[E]}var K=new Uint8Array(e);for(u=0;u<e;u++,E++){K[u]=Q[E]}Y+=17+e;(_>>4===0?J:z)[_&15]=a5(N,K)}break;case 65501:E+=2;d=Z(Q,E);E+=2;break;case 65498:var x=++T===1&&!f,R;E+=2;var k=Q[E++],g=[];for(Y=0;Y<k;Y++){var c=Q[E++],L=F._[c];R=F.W[L];R.index=c;var a6=Q[E++];R.J=J[a6>>4];R.i=z[a6&15];g.push(R)}var I=Q[E++],l=Q[E++],M=Q[E++];try{var S=a7(Q,E,F,g,d,I,l,M>>4,M&15,x);E+=S}catch(ex){if(ex instanceof DNLMarkerError){return this.parse(Q,{F:ex.s})}else if(ex instanceof EOIMarkerError){break markerLoop}throw ex}break;case 65500:E+=4;break;case 65535:if(Q[E]!==255){E--}break;default:var i=an(Q,E-2,E-3);if(i&&i.u){E=i.offset;break}if(E>=Q.length-1){break markerLoop}throw new W("JpegImage.parse - unknown marker: "+V.toString(16))}V=Z(Q,E);E+=2}this.width=F.o;this.height=F.s;this.g=a;this.b=C;this.W=[];for(Y=0;Y<F.W.length;Y++){R=F.W[Y];
var A=U[R.L];if(A){R.$=A}this.W.push({index:R.index,e:a0(F,R),l:R.h/F.X,t:R.A/F.B,P:R.P,c:R.c})}this.p=this.W.length;return undefined},Y(Q,h,f){if(f==null)f=!1;var G=this.width/Q,n=this.height/h,E,a,C,F,d,T,U,z,J,V,Y=0,u,m=this.W.length,j=Q*h*m,v=new Uint8ClampedArray(j),$=new Uint32Array(Q),b=4294967288,r;for(U=0;U<m;U++){E=this.W[U];a=E.l*G;C=E.t*n;Y=U;u=E.e;F=E.P+1<<3;if(a!==r){for(d=0;d<Q;d++){z=0|d*a;$[d]=(z&b)<<3|z&7}r=a}for(T=0;T<h;T++){z=0|T*C;V=F*(z&b)|(z&7)<<3;for(d=0;d<Q;d++){v[Y]=u[V+$[d]];Y+=m}}}var P=this.V;if(!f&&m===4&&!P){P=new Int32Array([-256,255,-256,255,-256,255,-256,255])}if(P){for(U=0;U<j;){for(z=0,J=0;z<m;z++,U++,J+=2){v[U]=(v[U]*P[J]>>8)+P[J+1]}}}return v},get f(){if(this.b){return!!this.b.a}if(this.p===3){if(this.N===0){return!1}else if(this.W[0].index===82&&this.W[1].index===71&&this.W[2].index===66){return!1}return!0}if(this.N===1){return!0}return!1},z:function aj(Q){var h,f,G;
for(var n=0,E=Q.length;n<E;n+=3){h=Q[n];f=Q[n+1];G=Q[n+2];Q[n]=h-179.456+1.402*G;Q[n+1]=h+135.459-.344*f-.714*G;Q[n+2]=h-226.816+1.772*f}return Q},O:function aa(Q){var h,f,G,n,E=0;for(var a=0,C=Q.length;a<C;a+=4){h=Q[a];f=Q[a+1];G=Q[a+2];n=Q[a+3];Q[E++]=-122.67195406894+f*(-660635669420364e-19*f+.000437130475926232*G-54080610064599e-18*h+.00048449797120281*n-.154362151871126)+G*(-.000957964378445773*G+.000817076911346625*h-.00477271405408747*n+1.53380253221734)+h*(.000961250184130688*h-.00266257332283933*n+.48357088451265)+n*(-.000336197177618394*n+.484791561490776);
Q[E++]=107.268039397724+f*(219927104525741e-19*f-.000640992018297945*G+.000659397001245577*h+.000426105652938837*n-.176491792462875)+G*(-.000778269941513683*G+.00130872261408275*h+.000770482631801132*n-.151051492775562)+h*(.00126935368114843*h-.00265090189010898*n+.25802910206845)+n*(-.000318913117588328*n-.213742400323665);Q[E++]=-20.810012546947+f*(-.000570115196973677*f-263409051004589e-19*G+.0020741088115012*h-.00288260236853442*n+.814272968359295)+G*(-153496057440975e-19*G-.000132689043961446*h+.000560833691242812*n-.195152027534049)+h*(.00174418132927582*h-.00255243321439347*n+.116935020465145)+n*(-.000343531996510555*n+.24165260232407)}return Q.subarray(0,E)},r:function a3(Q){var h,f,G;
for(var n=0,E=Q.length;n<E;n+=4){h=Q[n];f=Q[n+1];G=Q[n+2];Q[n]=434.456-h-1.402*G;Q[n+1]=119.541-h+.344*f+.714*G;Q[n+2]=481.816-h-1.772*f}return Q},U:function as(Q){var h,f,G,n,E=0;for(var a=0,C=Q.length;a<C;a+=4){h=Q[a];f=Q[a+1];G=Q[a+2];n=Q[a+3];Q[E++]=255+h*(-6747147073602441e-20*h+.0008379262121013727*f+.0002894718188643294*G+.003264231057537806*n-1.1185611867203937)+f*(26374107616089404e-21*f-8626949158638572e-20*G-.0002748769067499491*n-.02155688794978967)+G*(-3878099212869363e-20*G-.0003267808279485286*n+.0686742238595345)-n*(.0003361971776183937*n+.7430659151342254);
Q[E++]=255+h*(.00013596372813588848*h+.000924537132573585*f+.00010567359618683593*G+.0004791864687436512*n-.3109689587515875)+f*(-.00023545346108370344*f+.0002702845253534714*G+.0020200308977307156*n-.7488052167015494)+G*(6834815998235662e-20*G+.00015168452363460973*n-.09751927774728933)-n*(.0003189131175883281*n+.7364883807733168);Q[E++]=255+h*(13598650411385308e-21*h+.00012423956175490851*f+.0004751985097583589*G-36729317476630424e-22*n-.05562186980264034)+f*(.00016141380598724676*f+.0009692239130725186*G+.0007782692450036253*n-.44015232367526463)+G*(5.068882914068769e-7*G+.0017778369011375071*n-.7591454649749609)-n*(.0003435319965105553*n+.7063770186160144)}return Q.subarray(0,E)},getData:function(Q){var h=Q.width,f=Q.height,G=Q.forceRGB,n=Q.isSourcePDF;
if(this.p>4){throw new W("Unsupported color mode")}var E=this.Y(h,f,n);if(this.p===1&&G){var a=E.length,C=new Uint8ClampedArray(a*3),F=0;for(var d=0;d<a;d++){var T=E[d];C[F++]=T;C[F++]=T;C[F++]=T}return C}else if(this.p===3&&this.f){return this.z(E)}else if(this.p===4){if(this.f){if(G){return this.O(E)}return this.r(E)}else if(G){return this.U(E)}}return E}};return ak}();function a9(p,t){return p[t]<<24>>24}function Z(p,t){return p[t]<<8|p[t+1]}function am(p,t){return(p[t]<<24|p[t+1]<<16|p[t+2]<<8|p[t+3])>>>0}UTIF.JpegDecoder=ak}());
//UTIF.JpegDecoder = PDFJS.JpegImage;
UTIF.encodeImage = function(rgba, w, h, metadata)
{
var idf = { "t256":[w], "t257":[h], "t258":[8,8,8,8], "t259":[1], "t262":[2], "t273":[1000], // strips offset
"t277":[4], "t278":[h], /* rows per strip */ "t279":[w*h*4], // strip byte counts
"t282":[[72,1]], "t283":[[72,1]], "t284":[1], "t286":[[0,1]], "t287":[[0,1]], "t296":[1], "t305": ["Photopea (UTIF.js)"], "t338":[1]
};
if (metadata) for (var i in metadata) idf[i] = metadata[i];
var prfx = new Uint8Array(UTIF.encode([idf]));
var img = new Uint8Array(rgba);
var data = new Uint8Array(1000+w*h*4);
for(var i=0; i<prfx.length; i++) data[i] = prfx[i];
for(var i=0; i<img .length; i++) data[1000+i] = img[i];
return data.buffer;
}
UTIF.encode = function(ifds)
{
var LE = false;
var data = new Uint8Array(20000), offset = 4, bin = LE ? UTIF._binLE : UTIF._binBE;
data[0]=data[1]=LE?73:77; bin.writeUshort(data,2,42);
var ifdo = 8;
bin.writeUint(data, offset, ifdo); offset+=4;
for(var i=0; i<ifds.length; i++)
{
var noffs = UTIF._writeIFD(bin, UTIF._types.basic, data, ifdo, ifds[i]);
ifdo = noffs[1];
if(i<ifds.length-1) {
if((ifdo&3)!=0) ifdo+=(4-(ifdo&3)); // make each IFD start at multiple of 4
bin.writeUint(data, noffs[0], ifdo);
}
}
return data.slice(0, ifdo).buffer;
}
UTIF.decode = function(buff, prm)
{
if(prm==null) prm = {parseMN:true, debug:false}; // read MakerNote, debug
var data = new Uint8Array(buff), offset = 0;
var id = UTIF._binBE.readASCII(data, offset, 2); offset+=2;
var bin = id=="II" ? UTIF._binLE : UTIF._binBE;
var num = bin.readUshort(data, offset); offset+=2;
var ifdo = bin.readUint(data, offset); offset+=4;
var ifds = [];
while(true) {
var cnt = bin.readUshort(data,ifdo), typ = bin.readUshort(data,ifdo+4); if(cnt!=0) if(typ<1 || 13<typ) { log("error in TIFF"); break };
UTIF._readIFD(bin, data, ifdo, ifds, 0, prm);
ifdo = bin.readUint(data, ifdo+2+cnt*12);
if(ifdo==0) break;
}
return ifds;
}
UTIF.decodeImage = function(buff, img, ifds)
{
if(img.data) return;
var data = new Uint8Array(buff);
var id = UTIF._binBE.readASCII(data, 0, 2);
if(img["t256"]==null) return; // No width => probably not an image
img.isLE = id=="II";
img.width = img["t256"][0]; //delete img["t256"];
img.height = img["t257"][0]; //delete img["t257"];
var cmpr = img["t259"] ? img["t259"][0] : 1; //delete img["t259"];
var fo = img["t266"] ? img["t266"][0] : 1; //delete img["t266"];
if(img["t284"] && img["t284"][0]==2) log("PlanarConfiguration 2 should not be used!");
if(cmpr==7 && img["t258"] && img["t258"].length>3) img["t258"]=img["t258"].slice(0,3);
var spp = img["t277"]?img["t277"][0]:1;
var bps = img["t258"]?img["t258"][0]:1;
var bipp = bps*spp; // bits per pixel
/*
var bipp; // bits per pixel
if(img["t258"]) bipp = Math.min(32,img["t258"][0])*img["t258"].length;
else bipp = (img["t277"]?img["t277"][0]:1);
*/
// Some .NEF files have t258==14, even though they use 16 bits per pixel
if(cmpr==1 && img["t279"]!=null && img["t278"] && img["t262"][0]==32803) {
bipp = Math.round((img["t279"][0]*8)/(img.width*img["t278"][0]));
}
if(img["t50885"] && img["t50885"][0]==4) bipp = img["t258"][0]*3; // RAW_CANON_40D_SRAW_V103.CR2
var bipl = Math.ceil(img.width*bipp/8)*8;
var soff = img["t273"]; if(soff==null || img["t322"]) soff = img["t324"];
var bcnt = img["t279"]; if(cmpr==1 && soff.length==1) bcnt = [img.height*(bipl>>>3)]; if(bcnt==null || img["t322"]) bcnt = img["t325"];
//bcnt[0] = Math.min(bcnt[0], data.length); // Hasselblad, "RAW_HASSELBLAD_H3D39II.3FR"
var bytes = new Uint8Array(img.height*(bipl>>>3)), bilen = 0;
if(img["t322"]!=null) // tiled
{
var tw = img["t322"][0], th = img["t323"][0];
var tx = Math.floor((img.width + tw - 1) / tw);
var ty = Math.floor((img.height + th - 1) / th);
var tbuff = new Uint8Array(Math.ceil(tw*th*bipp/8)|0);
console.log("====", tx,ty);
for(var y=0; y<ty; y++)
for(var x=0; x<tx; x++)
{
var i = y*tx+x; tbuff.fill(0);
UTIF.decode._decompress(img,ifds, data, soff[i], bcnt[i], cmpr, tbuff, 0, fo,tw,th);
// Might be required for 7 too. Need to check
if (cmpr==6) bytes = tbuff;
else UTIF._copyTile(tbuff, Math.ceil(tw*bipp/8)|0, th, bytes, Math.ceil(img.width*bipp/8)|0, img.height, Math.ceil(x*tw*bipp/8)|0, y*th);
}
bilen = bytes.length*8;
}
else // stripped
{
if(soff==null) return;
var rps = img["t278"] ? img["t278"][0] : img.height; rps = Math.min(rps, img.height);
//console.log("====", img.width, rps);
for(var i=0; i<soff.length; i++)
{
UTIF.decode._decompress(img,ifds, data, soff[i], bcnt[i], cmpr, bytes, Math.ceil(bilen/8)|0, fo,img.width,rps);
bilen += bipl * rps;
}
bilen = Math.min(bilen, bytes.length*8);
}
img.data = new Uint8Array(bytes.buffer, 0, Math.ceil(bilen/8)|0);
}
UTIF.decode._decompress = function(img,ifds, data, off, len, cmpr, tgt, toff, fo, w, h) // fill order
{
if(img["t271"] && img["t271"][0]=="Panasonic" && img["t45"] && img["t45"][0]==6) cmpr = 34316;
//console.log("compression", cmpr);
//var time = Date.now();
if(false) {}
else if(cmpr==1/* || (len==tgt.length && cmpr!=32767)*/) for(var j=0; j<len; j++) tgt[toff+j] = data[off+j];
else if(cmpr==2) UTIF.decode._decodeG2 (data, off, len, tgt, toff, w, fo);
else if(cmpr==3) UTIF.decode._decodeG3 (data, off, len, tgt, toff, w, fo, img["t292"]?((img["t292"][0]&1)==1):false);
else if(cmpr==4) UTIF.decode._decodeG4 (data, off, len, tgt, toff, w, fo);
else if(cmpr==5) UTIF.decode._decodeLZW(data, off, len, tgt, toff,8);
else if(cmpr==6) UTIF.decode._decodeOldJPEG(img, data, off, len, tgt, toff);
else if(cmpr==7 || cmpr==34892) UTIF.decode._decodeNewJPEG(img, data, off, len, tgt, toff);
else if(cmpr==8 || cmpr==32946) { var src = new Uint8Array(data.buffer,off+2,len-6); var bin = pako["inflateRaw"](src); if(toff+bin.length<=tgt.length) tgt.set(bin,toff); }
else if(cmpr==9) UTIF.decode._decodeVC5(data,off,len,tgt,toff,img["t33422"]);
else if(cmpr==32767) UTIF.decode._decodeARW(img, data, off, len, tgt, toff);
else if(cmpr==32773) UTIF.decode._decodePackBits(data, off, len, tgt, toff);
else if(cmpr==32809) UTIF.decode._decodeThunder (data, off, len, tgt, toff);
else if(cmpr==34316) UTIF.decode._decodePanasonic(img,data,off, len, tgt, toff);
else if(cmpr==34713) //for(var j=0; j<len; j++) tgt[toff+j] = data[off+j];
UTIF.decode._decodeNikon (img,ifds, data, off, len, tgt, toff);
else if(cmpr==34676) UTIF.decode._decodeLogLuv32(img,data, off, len, tgt, toff);
else log("Unknown compression", cmpr);
//console.log(Date.now()-time);
var bps = (img["t258"]?Math.min(32,img["t258"][0]):1);
var noc = (img["t277"]?img["t277"][0]:1), bpp=(bps*noc)>>>3, bpl = Math.ceil(bps*noc*w/8);
// convert to Little Endian /*
if(bps==16 && !img.isLE && img["t33422"]==null) // not DNG
for(var y=0; y<h; y++) {
//console.log("fixing endianity");
var roff = toff+y*bpl;
for(var x=1; x<bpl; x+=2) { var t=tgt[roff+x]; tgt[roff+x]=tgt[roff+x-1]; tgt[roff+x-1]=t; }
} //*/
if(img["t317"] && img["t317"][0]==2)
{
for(var y=0; y<h; y++)
{
var ntoff = toff+y*bpl;
if(bps==16) for(var j=bpp; j<bpl; j+=2) {
var nv = ((tgt[ntoff+j+1]<<8)|tgt[ntoff+j]) + ((tgt[ntoff+j-bpp+1]<<8)|tgt[ntoff+j-bpp]);
tgt[ntoff+j] = nv&255; tgt[ntoff+j+1] = (nv>>>8)&255;
}
else if(noc==3) for(var j= 3; j<bpl; j+=3)
{
tgt[ntoff+j ] = (tgt[ntoff+j ] + tgt[ntoff+j-3])&255;
tgt[ntoff+j+1] = (tgt[ntoff+j+1] + tgt[ntoff+j-2])&255;
tgt[ntoff+j+2] = (tgt[ntoff+j+2] + tgt[ntoff+j-1])&255;
}
else for(var j=bpp; j<bpl; j++) tgt[ntoff+j] = (tgt[ntoff+j] + tgt[ntoff+j-bpp])&255;
}
}
}
UTIF.decode._decodePanasonic = function(img, data, off, len, tgt, toff) {
var img_buffer = data.buffer;
var rawWidth = img["t2"][0];
var rawHeight = img["t3"][0];
var bitsPerSample = img["t10"][0];
var RW2_Format = img["t45"][0];
var bidx = 0;
var imageIndex = 0;
var vpos = 0;
var byte = 0;
var arr_a, arr_b;
var bytes = (RW2_Format == 6 ? new Uint32Array(18) : new Uint8Array(16));
var i, j, sh, pred=[0,0], nonz=[0,0], isOdd, idx = 0, pixel_base;
var row, col, crow;
var buffer = new Uint8Array(0x4000);
var result = new Uint16Array(tgt.buffer);
function getDataRaw(bits){
if (vpos == 0) {
var arr_a = new Uint8Array(img_buffer, off+imageIndex + 0x1ff8, 0x4000-0x1ff8);
var arr_b = new Uint8Array(img_buffer, off+imageIndex, 0x1ff8);
buffer.set(arr_a);
buffer.set(arr_b, arr_a.length);
imageIndex += 0x4000;
}
if(RW2_Format == 5) {
for (i = 0; i < 16; i++){
bytes[i] = buffer[vpos++];
vpos &= 0x3FFF;
}
} else {
vpos = (vpos - bits) & 0x1ffff;
byte = vpos >> 3 ^ 0x3ff0;
return (buffer[byte] | buffer[byte + 1] << 8) >> (vpos & 7) & ~((-1) << bits);
}
}
// Raw Format 6
function getBufferDataRW6(i) {
return buffer[vpos + 15 - i];
}
function readPageRW6() {
bytes[0] = (getBufferDataRW6(0) << 6) | (getBufferDataRW6(1) >> 2); // 14 bit
bytes[1] = (((getBufferDataRW6(1) & 0x3) << 12) | (getBufferDataRW6(2) << 4) | (getBufferDataRW6(3) >> 4)) & 0x3fff;
bytes[2] = (getBufferDataRW6(3) >> 2) & 0x3;
bytes[3] = ((getBufferDataRW6(3) & 0x3) << 8) | getBufferDataRW6(4);
bytes[4] = (getBufferDataRW6(5) << 2) | (getBufferDataRW6(6) >> 6);
bytes[5] = ((getBufferDataRW6(6) & 0x3f) << 4) | (getBufferDataRW6(7) >> 4);
bytes[6] = (getBufferDataRW6(7) >> 2) & 0x3;
bytes[7] = ((getBufferDataRW6(7) & 0x3) << 8) | getBufferDataRW6(8);
bytes[8] = ((getBufferDataRW6(9) << 2) & 0x3fc) | (getBufferDataRW6(10) >> 6);
bytes[9] = ((getBufferDataRW6(10) << 4) | (getBufferDataRW6(11) >> 4)) & 0x3ff;
bytes[10] = (getBufferDataRW6(11) >> 2) & 0x3;
bytes[11] = ((getBufferDataRW6(11) & 0x3) << 8) | getBufferDataRW6(12);
bytes[12] = (((getBufferDataRW6(13) << 2) & 0x3fc) | getBufferDataRW6(14) >> 6) & 0x3ff;
bytes[13] = ((getBufferDataRW6(14) << 4) | (getBufferDataRW6(15) >> 4)) & 0x3ff;
vpos += 16;
byte = 0;
}
function readPageRw6_bps12() {
bytes[0] = (getBufferDataRW6(0) << 4) | (getBufferDataRW6(1) >> 4);
bytes[1] = (((getBufferDataRW6(1) & 0xf) << 8) | (getBufferDataRW6(2))) & 0xfff;
bytes[2] = (getBufferDataRW6(3) >> 6) & 0x3;
bytes[3] = ((getBufferDataRW6(3) & 0x3f) << 2) | (getBufferDataRW6(4) >> 6);
bytes[4] = ((getBufferDataRW6(4) & 0x3f) << 2) | (getBufferDataRW6(5) >> 6);
bytes[5] = ((getBufferDataRW6(5) & 0x3f) << 2) | (getBufferDataRW6(6) >> 6);
bytes[6] = (getBufferDataRW6(6) >> 4) & 0x3;
bytes[7] = ((getBufferDataRW6(6) & 0xf) << 4) | (getBufferDataRW6(7) >> 4);
bytes[8] = ((getBufferDataRW6(7) & 0xf) << 4) | (getBufferDataRW6(8) >> 4);
bytes[9] = ((getBufferDataRW6(8) & 0xf) << 4) | (getBufferDataRW6(9) >> 4);
bytes[10] = (getBufferDataRW6(9) >> 2) & 0x3;
bytes[11] = ((getBufferDataRW6(9) & 0x3) << 6) | (getBufferDataRW6(10) >> 2);
bytes[12] = ((getBufferDataRW6(10) & 0x3) << 6) | (getBufferDataRW6(11) >> 2);
bytes[13] = ((getBufferDataRW6(11) & 0x3) << 6) | (getBufferDataRW6(12) >> 2);
bytes[14] = getBufferDataRW6(12) & 0x3;
bytes[15] = getBufferDataRW6(13);
bytes[16] = getBufferDataRW6(14);
bytes[17] = getBufferDataRW6(15);
vpos += 16;
byte = 0;
}
// Main loop
function resetPredNonzeros(){
pred[0]=0; pred[1]=0;
nonz[0]=0; nonz[1]=0;
}
if (RW2_Format == 7) {
throw RW2_Format;
// Skatch of version 7
/*
var pixels_per_block = bitsPerSample == 14 ? 9 : 10;
rowbytes = 0|(rawWidth / pixels_per_block * 16);
for (row = 0; row < rawHeight - 15; row += 16) {
var rowstoread = Math.min(16, rawHeight - row);
var readlen = rowbytes*rowstoread;
buffer = new Uint8Array(image.slice(bidx, bidx+readlen));
vpos = 0;
bidx += readlen;
i = 0;
for (crow = 0; crow < rowstoread; crow++) {
idx = (row + crow) * rawWidth;
for (col = 0; col <= rawWidth - pixels_per_block; col += pixels_per_block) {
for(j=0; j < pixels_per_block; j++) bytes[j] = buffer[i++];
if (bitsPerSample == 12) {
result[idx ] = ((bytes[1] & 0xF) << 8) + bytes[0];
result[idx + 1] = 16 * bytes[2] + (bytes[1] >> 4);
result[idx + 2] = ((bytes[4] & 0xF) << 8) + bytes[3];
result[idx + 3] = 16 * bytes[5] + (bytes[4] >> 4);
result[idx + 4] = ((bytes[7] & 0xF) << 8) + bytes[6];
result[idx + 5] = 16 * bytes[8] + (bytes[7] >> 4);
result[idx + 6] = ((bytes[10] & 0xF) << 8) + bytes[9];
result[idx + 7] = 16 * bytes[11] + (bytes[10] >> 4);
result[idx + 8] = ((bytes[13] & 0xF) << 8) + bytes[12];
result[idx + 9] = 16 * bytes[14] + (bytes[13] >> 4);
} else if (bitsPerSample == 14) {
result[idx] = bytes[0] + ((bytes[1] & 0x3F) << 8);
result[idx + 1] = (bytes[1] >> 6) + 4 * (bytes[2]) + ((bytes[3] & 0xF) << 10);
result[idx + 2] = (bytes[3] >> 4) + 16 * (bytes[4]) + ((bytes[5] & 3) << 12);
result[idx + 3] = ((bytes[5] & 0xFC) >> 2) + (bytes[6] << 6);
result[idx + 4] = bytes[7] + ((bytes[8] & 0x3F) << 8);
result[idx + 5] = (bytes[8] >> 6) + 4 * bytes[9] + ((bytes[10] & 0xF) << 10);
result[idx + 6] = (bytes[10] >> 4) + 16 * bytes[11] + ((bytes[12] & 3) << 12);
result[idx + 7] = ((bytes[12] & 0xFC) >> 2) + (bytes[13] << 6);
result[idx + 8] = bytes[14] + ((bytes[15] & 0x3F) << 8);
}
}
}
}
*/
}
else if(RW2_Format == 6) {
var is12bit = bitsPerSample == 12,
readPageRw6Fn = is12bit ? readPageRw6_bps12 : readPageRW6,
pixelsPerBlock = is12bit ? 14 : 11,
pixelbase0 = is12bit ? 0x80 : 0x200,
pixelbase_compare = is12bit ? 0x800 : 0x2000,
spix_compare = is12bit ? 0x3fff : 0xffff,
pixel_mask = is12bit ? 0xfff : 0x3fff,
blocksperrow = rawWidth / pixelsPerBlock,
rowbytes = blocksperrow * 16,
bufferSize = is12bit ? 18 : 14;
for (row = 0; row < rawHeight - 15; row += 16) {
var rowstoread = Math.min(16, rawHeight - row);
var readlen = rowbytes*rowstoread;
buffer = new Uint8Array(img_buffer, off+bidx, readlen);//new Uint8Array(image.slice(bidx, bidx+readlen));
vpos = 0;
bidx += readlen;
for (crow = 0, col = 0; crow < rowstoread; crow++, col = 0) {
idx = (row + crow) * rawWidth;
for (var rblock = 0; rblock < blocksperrow; rblock++) {
readPageRw6Fn();
resetPredNonzeros();
sh=0; pixel_base=0;
for (i = 0; i < pixelsPerBlock; i++){
isOdd = i & 1;
if (i % 3 == 2) {
var base = byte < bufferSize ? bytes[byte++] : 0;
if (base == 3) base = 4;
pixel_base = pixelbase0 << base;
sh = 1 << base;
}
var epixel = byte < bufferSize ? bytes[byte++] : 0;
if (pred[isOdd]) {
epixel *= sh;
if (pixel_base < pixelbase_compare && nonz[isOdd] > pixel_base)
epixel += nonz[isOdd] - pixel_base;
nonz[isOdd] = epixel;
} else {
pred[isOdd] = epixel;
if (epixel)
nonz[isOdd] = epixel;
else
epixel = nonz[isOdd];
}
result[idx + col++] = (epixel - 0xf) <= spix_compare ? (epixel - 0xf) & spix_compare : ((epixel + 0x7ffffff1) >> 0x1f) & pixel_mask;
}
}
}
}
}
else if (RW2_Format == 5) {
var blockSize = bitsPerSample == 12 ? 10 : 9;
for (row = 0; row < rawHeight; row++) {
for (col = 0; col < rawWidth; col+=blockSize) {
getDataRaw(0);
// Tuhle podminku pouziva i RW2_Format 7
if (bitsPerSample == 12) {
result[idx++] = ((bytes[1] & 0xF) << 8) + bytes[0];
result[idx++] = 16 * bytes[2] + (bytes[1] >> 4);
result[idx++] = ((bytes[4] & 0xF) << 8) + bytes[3];
result[idx++] = 16 * bytes[5] + (bytes[4] >> 4);
result[idx++] = ((bytes[7] & 0xF) << 8) + bytes[6];
result[idx++] = 16 * bytes[8] + (bytes[7] >> 4);
result[idx++] = ((bytes[10] & 0xF) << 8) + bytes[9];
result[idx++] = 16 * bytes[11] + (bytes[10] >> 4);
result[idx++] = ((bytes[13] & 0xF) << 8) + bytes[12];
result[idx++] = 16 * bytes[14] + (bytes[13] >> 4);
} else if (bitsPerSample == 14) {
result[idx++] = bytes[0] + ((bytes[1] & 0x3F) << 8);
result[idx++] = (bytes[1] >> 6) + 4 * (bytes[2]) + ((bytes[3] & 0xF) << 10);
result[idx++] = (bytes[3] >> 4) + 16 * (bytes[4]) + ((bytes[5] & 3) << 12);
result[idx++] = ((bytes[5] & 0xFC) >> 2) + (bytes[6] << 6);
result[idx++] = bytes[7] + ((bytes[8] & 0x3F) << 8);
result[idx++] = (bytes[8] >> 6) + 4 * bytes[9] + ((bytes[10] & 0xF) << 10);
result[idx++] = (bytes[10] >> 4) + 16 * bytes[11] + ((bytes[12] & 3) << 12);
result[idx++] = ((bytes[12] & 0xFC) >> 2) + (bytes[13] << 6);
result[idx++] = bytes[14] + ((bytes[15] & 0x3F) << 8);
}
}
}
//console.log(result[1000000 - 1])
} else if(RW2_Format == 4) {
for (row = 0; row < rawHeight; row++){
for(col = 0; col < rawWidth; col++){
i = col % 14;
isOdd = i & 1;
if (i==0) resetPredNonzeros();
if (i%3 == 2)
sh = 4 >> (3 - getDataRaw(2));
if (nonz[isOdd]) {
j = getDataRaw(8);
if(j != 0){
pred[isOdd] -= 0x80 << sh;
if (pred[isOdd] < 0 || sh == 4)
pred[isOdd] &= ~((-1) << sh);
pred[isOdd] += j << sh;
}
} else {
nonz[isOdd] = getDataRaw(8);
if(nonz[isOdd] || i > 11)
pred[isOdd] = nonz[isOdd] << 4 | getDataRaw(4);
}
result[idx++] = pred[col & 1];
}
}
}
else throw RW2_Format;
}
UTIF.decode._decodeVC5 = function(){var x=[1,0,1,0,2,2,1,1,3,7,1,2,5,25,1,3,6,48,1,4,6,54,1,5,7,111,1,8,7,99,1,6,7,105,12,0,7,107,1,7,8,209,20,0,8,212,1,9,8,220,1,10,9,393,1,11,9,394,32,0,9,416,1,12,9,427,1,13,10,887,1,18,10,784,1,14,10,790,1,15,10,835,60,0,10,852,1,16,10,885,1,17,11,1571,1,19,11,1668,1,20,11,1669,100,0,11,1707,1,21,11,1772,1,22,12,3547,1,29,12,3164,1,24,12,3166,1,25,12,3140,1,23,12,3413,1,26,12,3537,1,27,12,3539,1,28,13,7093,1,35,13,6283,1,30,13,6331,1,31,13,6335,180,0,13,6824,1,32,13,7072,1,33,13,7077,320,0,13,7076,1,34,14,12565,1,36,14,12661,1,37,14,12669,1,38,14,13651,1,39,14,14184,1,40,15,28295,1,46,15,28371,1,47,15,25320,1,42,15,25336,1,43,15,25128,1,41,15,27300,1,44,15,28293,1,45,16,50259,1,48,16,50643,1,49,16,50675,1,50,16,56740,1,53,16,56584,1,51,16,56588,1,52,17,113483,1,61,17,113482,1,60,17,101285,1,55,17,101349,1,56,17,109205,1,57,17,109207,1,58,17,100516,1,54,17,113171,1,59,18,202568,1,62,18,202696,1,63,18,218408,1,64,18,218412,1,65,18,226340,1,66,18,226356,1,67,18,226358,1,68,19,402068,1,69,19,405138,1,70,19,405394,1,71,19,436818,1,72,19,436826,1,73,19,452714,1,75,19,452718,1,76,19,452682,1,74,20,804138,1,77,20,810279,1,78,20,810790,1,79,20,873638,1,80,20,873654,1,81,20,905366,1,82,20,905430,1,83,20,905438,1,84,21,1608278,1,85,21,1620557,1,86,21,1621582,1,87,21,1621583,1,88,21,1747310,1,89,21,1810734,1,90,21,1810735,1,91,21,1810863,1,92,21,1810879,1,93,22,3621725,1,99,22,3621757,1,100,22,3241112,1,94,22,3494556,1,95,22,3494557,1,96,22,3494622,1,97,22,3494623,1,98,23,6482227,1,102,23,6433117,1,101,23,6989117,1,103,23,6989119,1,105,23,6989118,1,104,23,7243449,1,106,23,7243512,1,107,24,13978233,1,111,24,12964453,1,109,24,12866232,1,108,24,14486897,1,113,24,13978232,1,110,24,14486896,1,112,24,14487026,1,114,24,14487027,1,115,25,25732598,1,225,25,25732597,1,189,25,25732596,1,188,25,25732595,1,203,25,25732594,1,202,25,25732593,1,197,25,25732592,1,207,25,25732591,1,169,25,25732590,1,223,25,25732589,1,159,25,25732522,1,235,25,25732579,1,152,25,25732575,1,192,25,25732489,1,179,25,25732573,1,201,25,25732472,1,172,25,25732576,1,149,25,25732488,1,178,25,25732566,1,120,25,25732571,1,219,25,25732577,1,150,25,25732487,1,127,25,25732506,1,211,25,25732548,1,125,25,25732588,1,158,25,25732486,1,247,25,25732467,1,238,25,25732508,1,163,25,25732552,1,228,25,25732603,1,183,25,25732513,1,217,25,25732587,1,168,25,25732520,1,122,25,25732484,1,128,25,25732562,1,249,25,25732505,1,187,25,25732504,1,186,25,25732483,1,136,25,25928905,1,181,25,25732560,1,255,25,25732500,1,230,25,25732482,1,135,25,25732555,1,233,25,25732568,1,222,25,25732583,1,145,25,25732481,1,134,25,25732586,1,167,25,25732521,1,248,25,25732518,1,209,25,25732480,1,243,25,25732512,1,216,25,25732509,1,164,25,25732547,1,140,25,25732479,1,157,25,25732544,1,239,25,25732574,1,191,25,25732564,1,251,25,25732478,1,156,25,25732546,1,139,25,25732498,1,242,25,25732557,1,133,25,25732477,1,162,25,25732515,1,213,25,25732584,1,165,25,25732514,1,212,25,25732476,1,227,25,25732494,1,198,25,25732531,1,236,25,25732530,1,234,25,25732529,1,117,25,25732528,1,215,25,25732527,1,124,25,25732526,1,123,25,25732525,1,254,25,25732524,1,253,25,25732523,1,148,25,25732570,1,218,25,25732580,1,146,25,25732581,1,147,25,25732569,1,224,25,25732533,1,143,25,25732540,1,184,25,25732541,1,185,25,25732585,1,166,25,25732556,1,132,25,25732485,1,129,25,25732563,1,250,25,25732578,1,151,25,25732501,1,119,25,25732502,1,193,25,25732536,1,176,25,25732496,1,245,25,25732553,1,229,25,25732516,1,206,25,25732582,1,144,25,25732517,1,208,25,25732558,1,137,25,25732543,1,241,25,25732466,1,237,25,25732507,1,190,25,25732542,1,240,25,25732551,1,131,25,25732554,1,232,25,25732565,1,252,25,25732475,1,171,25,25732493,1,205,25,25732492,1,204,25,25732491,1,118,25,25732490,1,214,25,25928904,1,180,25,25732549,1,126,25,25732602,1,182,25,25732539,1,175,25,25732545,1,141,25,25732559,1,138,25,25732537,1,177,25,25732534,1,153,25,25732503,1,194,25,25732606,1,160,25,25732567,1,121,25,25732538,1,174,25,25732497,1,246,25,25732550,1,130,25,25732572,1,200,25,25732474,1,170,25,25732511,1,221,25,25732601,1,196,25,25732532,1,142,25,25732519,1,210,25,25732495,1,199,25,25732605,1,155,25,25732535,1,154,25,25732499,1,244,25,25732510,1,220,25,25732600,1,195,25,25732607,1,161,25,25732604,1,231,25,25732473,1,173,25,25732599,1,226,26,51465122,1,116,26,51465123,0,1],o,C,k,P=[3,3,3,3,2,2,2,1,1,1],V=24576,ar=16384,H=8192,az=ar|H;
function d(t){var E=t[1],h=t[0][E>>>3]>>>7-(E&7)&1;t[1]++;return h}function ag(t,E){if(o==null){o={};
for(var h=0;h<x.length;h+=4)o[x[h+1]]=x.slice(h,h+4)}var L=d(t),g=o[L];while(g==null){L=L<<1|d(t);g=o[L]}var n=g[3];
if(n!=0)n=d(t)==0?n:-n;E[0]=g[2];E[1]=n}function m(t,E){for(var h=0;h<E;h++){if((t&1)==1)t++;t=t>>>1}return t}function A(t,E){return t>>E}function O(t,E,h,L,g,n){E[h]=A(A(11*t[g]-4*t[g+n]+t[g+n+n]+4,3)+t[L],1);
E[h+n]=A(A(5*t[g]+4*t[g+n]-t[g+n+n]+4,3)-t[L],1)}function J(t,E,h,L,g,n){var W=t[g-n]-t[g+n],j=t[g],$=t[L];
E[h]=A(A(W+4,3)+j+$,1);E[h+n]=A(A(-W+4,3)+j-$,1)}function y(t,E,h,L,g,n){E[h]=A(A(5*t[g]+4*t[g-n]-t[g-n-n]+4,3)+t[L],1);
E[h+n]=A(A(11*t[g]-4*t[g-n]+t[g-n-n]+4,3)-t[L],1)}function q(t){t=t<0?0:t>4095?4095:t;t=k[t]>>>2;return t}function av(t,E,h,L,g,n){L=new Uint16Array(L.buffer);
var W=Date.now(),j=UTIF._binBE,$=E+h,r,u,X,I,ax,a3,R,ai,aa,ap,ah,ae,aD,al,i,aE,T,B;E+=4;var a5=n[0]==1;
while(E<$){var S=j.readShort(t,E),s=j.readUshort(t,E+2);E+=4;if(S==12)r=s;else if(S==20)u=s;else if(S==21)X=s;
else if(S==48)I=s;else if(S==53)ax=s;else if(S==35)a3=s;else if(S==62)R=s;else if(S==101)ai=s;else if(S==109)aa=s;
else if(S==84)ap=s;else if(S==106)ah=s;else if(S==107)ae=s;else if(S==108)aD=s;else if(S==102)al=s;else if(S==104)i=s;
else if(S==105)aE=s;else{var F=S<0?-S:S,D=F&65280,_=0;if(F&az){if(F&H){_=s&65535;_+=(F&255)<<16}else{_=s&65535}}if((F&V)==V){if(T==null){T=[];
for(var M=0;M<4;M++)T[M]=new Int16Array((u>>>1)*(X>>>1));B=new Int16Array((u>>>1)*(X>>>1));C=new Int16Array(1024);
for(var M=0;M<1024;M++){var aG=M-512,p=Math.abs(aG),r=Math.floor(768*p*p*p/(255*255*255))+p;C[M]=Math.sign(aG)*r}k=new Uint16Array(4096);
var aA=(1<<16)-1;for(var M=0;M<4096;M++){var at=M,a1=aA*(Math.pow(113,at/4095)-1)/112;k[M]=Math.min(a1,aA)}}var w=T[R],v=m(u,1+P[I]),N=m(X,1+P[I]);
if(I==0){for(var b=0;b<N;b++)for(var G=0;G<v;G++){var c=E+(b*v+G)*2;w[b*(u>>>1)+G]=t[c]<<8|t[c+1]}}else{var a7=[t,E*8],a4=[],ay=0,aw=v*N,f=[0,0],Q=0,s=0;
while(ay<aw){ag(a7,f);Q=f[0];s=f[1];while(Q>0){a4[ay++]=s;Q--}}var l=(I-1)%3,aF=l!=1?v:0,a2=l!=0?N:0;
for(var b=0;b<N;b++){var af=(b+a2)*(u>>>1)+aF,au=b*v;for(var G=0;G<v;G++)w[af+G]=C[a4[au+G]+512]*ax}if(l==2){var i=u>>>1,an=v*2,a9=N*2;
for(var b=0;b<N;b++){for(var G=0;G<an;G++){var M=b*2*i+G,a=b*i+G,e=N*i+a;if(b==0)O(w,B,M,e,a,i);else if(b==N-1)y(w,B,M,e,a,i);
else J(w,B,M,e,a,i)}}var Z=w;w=B;B=Z;for(var b=0;b<a9;b++){for(var G=0;G<v;G++){var M=b*i+2*G,a=b*i+G,e=v+a;
if(G==0)O(w,B,M,e,a,1);else if(G==v-1)y(w,B,M,e,a,1);else J(w,B,M,e,a,1)}}var Z=w;w=B;B=Z;var aC=[],aB=2-~~((I-1)/3);
for(var K=0;K<3;K++)aC[K]=aa>>14-K*2&3;var a6=aC[aB];if(a6!=0)for(var b=0;b<a9;b++)for(var G=0;G<an;
G++){var M=b*i+G;w[M]=w[M]<<a6}}}if(I==9&&R==3){var a8=T[0],ab=T[1],aq=T[2],as=T[3];for(var b=0;b<X;
b+=2)for(var G=0;G<u;G+=2){var U=b*u+G,c=(b>>>1)*(u>>>1)+(G>>>1),z=a8[c],ao=ab[c]-2048,ak=aq[c]-2048,ad=as[c]-2048,aj=(ao<<1)+z,a0=(ak<<1)+z,aH=z+ad,am=z-ad;
if(a5){L[U]=q(aH);L[U+1]=q(a0);L[U+u]=q(aj);L[U+u+1]=q(am)}else{L[U]=q(aj);L[U+1]=q(aH);L[U+u]=q(am);
L[U+u+1]=q(a0)}}}E+=_*4}else if(F==16388){E+=_*4}else if(D==8192||D==8448||D==9216){}else throw F.toString(16)}}console.log(Date.now()-W)}return av}()
UTIF.decode._decodeLogLuv32 = function(img, data, off, len, tgt, toff) {
var w = img.width, qw=w*4;
var io = 0, out = new Uint8Array(qw);
while(io<len) {
var oo=0;
while(oo<qw) {
var c = data[off+io]; io++;
if(c<128) { for(var j=0; j<c; j++) out[oo+j] = data[off+io+j]; oo+=c; io+=c; }
else { c=c-126; for(var j=0; j<c; j++) out[oo+j] = data[off+io ]; oo+=c; io++ ; }
}
for(var x=0; x<w; x++) {
tgt[toff+0] = out[x];
tgt[toff+1] = out[x+w];
tgt[toff+2] = out[x+w*2];
tgt[toff+4] = out[x+w*3];
toff+=6;
}
}
}
UTIF.decode._ljpeg_diff = function(data, prm, huff) {
var getbithuff = UTIF.decode._getbithuff;
var len, diff;
len = getbithuff(data, prm, huff[0], huff);
diff = getbithuff(data, prm, len, 0);
if ((diff & (1 << (len-1))) == 0) diff -= (1 << len) - 1;
return diff;
}
UTIF.decode._decodeARW = function(img, inp, off, src_length, tgt, toff) {
var raw_width = img["t256"][0], height=img["t257"][0], tiff_bps=img["t258"][0];
var bin=(img.isLE ? UTIF._binLE : UTIF._binBE);
//console.log(raw_width, height, tiff_bps, raw_width*height, src_length);
var arw2 = (raw_width*height == src_length) || (raw_width*height*1.5 == src_length);
//arw2 = true;
//console.log("ARW2: ", arw2, raw_width*height, src_length, tgt.length);
if(!arw2) { //"sony_arw_load_raw"; // not arw2
height+=8;
var prm = [off,0,0,0];
var huff = new Uint16Array(32770);
var tab = [ 0xf11,0xf10,0xe0f,0xd0e,0xc0d,0xb0c,0xa0b,0x90a,0x809,
0x708,0x607,0x506,0x405,0x304,0x303,0x300,0x202,0x201 ];
var i, c, n, col, row, sum=0;
var ljpeg_diff = UTIF.decode._ljpeg_diff;
huff[0] = 15;
for (n=i=0; i < 18; i++) {
var lim = 32768 >>> (tab[i] >>> 8);
for(var c=0; c<lim; c++) huff[++n] = tab[i];
}
for (col = raw_width; col--; )
for (row=0; row < height+1; row+=2) {
if (row == height) row = 1;
sum += ljpeg_diff(inp, prm, huff);
if (row < height) {
var clr = (sum)&4095;
UTIF.decode._putsF(tgt, (row*raw_width+col)*tiff_bps, clr<<(16-tiff_bps));
}
}
return;
}
if(raw_width*height*1.5==src_length) {
//console.log("weird compression");
for(var i=0; i<src_length; i+=3) { var b0=inp[off+i+0], b1=inp[off+i+1], b2=inp[off+i+2];
tgt[toff+i]=(b1<<4)|(b0>>>4); tgt[toff+i+1]=(b0<<4)|(b2>>>4); tgt[toff+i+2]=(b2<<4)|(b1>>>4); }
return;
}
var pix = new Uint16Array(16);
var row, col, val, max, min, imax, imin, sh, bit, i, dp;
var data = new Uint8Array(raw_width+1);
for (row=0; row < height; row++) {
//fread (data, 1, raw_width, ifp);
for(var j=0; j<raw_width; j++) data[j]=inp[off++];
for (dp=0, col=0; col < raw_width-30; dp+=16) {
max = 0x7ff & (val = bin.readUint(data,dp));
min = 0x7ff & (val >>> 11);
imax = 0x0f & (val >>> 22);
imin = 0x0f & (val >>> 26);
for (sh=0; sh < 4 && 0x80 << sh <= max-min; sh++);
for (bit=30, i=0; i < 16; i++)
if (i == imax) pix[i] = max;
else if (i == imin) pix[i] = min;
else {
pix[i] = ((bin.readUshort(data, dp+(bit >> 3)) >>> (bit & 7) & 0x7f) << sh) + min;
if (pix[i] > 0x7ff) pix[i] = 0x7ff;
bit += 7;
}
for (i=0; i < 16; i++, col+=2) {
//RAW(row,col) = curve[pix[i] << 1] >> 2;
var clr = pix[i]<<1; //clr = 0xffff;
UTIF.decode._putsF(tgt, (row*raw_width+col)*tiff_bps, clr<<(16-tiff_bps));
}
col -= col & 1 ? 1:31;
}
}
}
UTIF.decode._decodeNikon = function(img,imgs, data, off, src_length, tgt, toff)
{
var nikon_tree = [
[ 0, 0,1,5,1,1,1,1,1,1,2,0,0,0,0,0,0, /* 12-bit lossy */
5,4,3,6,2,7,1,0,8,9,11,10,12 ],
[ 0, 0,1,5,1,1,1,1,1,1,2,0,0,0,0,0,0, /* 12-bit lossy after split */
0x39,0x5a,0x38,0x27,0x16,5,4,3,2,1,0,11,12,12 ],
[ 0, 0,1,4,2,3,1,2,0,0,0,0,0,0,0,0,0, /* 12-bit lossless */
5,4,6,3,7,2,8,1,9,0,10,11,12 ],
[ 0, 0,1,4,3,1,1,1,1,1,2,0,0,0,0,0,0, /* 14-bit lossy */
5,6,4,7,8,3,9,2,1,0,10,11,12,13,14 ],
[ 0, 0,1,5,1,1,1,1,1,1,1,2,0,0,0,0,0, /* 14-bit lossy after split */
8,0x5c,0x4b,0x3a,0x29,7,6,5,4,3,2,1,0,13,14 ],
[ 0, 0,1,4,2,2,3,1,2,0,0,0,0,0,0,0,0, /* 14-bit lossless */
7,6,8,5,9,4,10,3,11,12,2,0,1,13,14 ] ];
var raw_width = img["t256"][0], height=img["t257"][0], tiff_bps=img["t258"][0];
var tree = 0, split = 0;
var make_decoder = UTIF.decode._make_decoder;
var getbithuff = UTIF.decode._getbithuff;
var mn = imgs[0].exifIFD.makerNote, md = mn["t150"]?mn["t150"]:mn["t140"], mdo=0; //console.log(mn,md);
//console.log(md[0].toString(16), md[1].toString(16), tiff_bps);
var ver0 = md[mdo++], ver1 = md[mdo++];
if (ver0 == 0x49 || ver1 == 0x58) mdo+=2110;
if (ver0 == 0x46) tree = 2;
if (tiff_bps == 14) tree += 3;
var vpred = [[0,0],[0,0]], bin=(img.isLE ? UTIF._binLE : UTIF._binBE);
for(var i=0; i<2; i++) for(var j=0; j<2; j++) { vpred[i][j] = bin.readShort(md,mdo); mdo+=2; } // not sure here ... [i][j] or [j][i]
//console.log(vpred);
var max = 1 << tiff_bps & 0x7fff, step=0;
var csize = bin.readShort(md,mdo); mdo+=2;
if (csize > 1) step = Math.floor(max / (csize-1));
if (ver0 == 0x44 && ver1 == 0x20 && step > 0) split = bin.readShort(md,562);
var i;
var row, col;
var len, shl, diff;
var min_v = 0;
var hpred = [0,0];
var huff = make_decoder(nikon_tree[tree]);
//var g_input_offset=0, bitbuf=0, vbits=0, reset=0;
var prm = [off,0,0,0];
//console.log(split); split = 170;
for (min_v=row=0; row < height; row++) {
if (split && row == split) {
//free (huff);
huff = make_decoder (nikon_tree[tree+1]);
//max_v += (min_v = 16) << 1;
}
for (col=0; col < raw_width; col++) {
i = getbithuff(data,prm,huff[0],huff);
len = i & 15;
shl = i >>> 4;
diff = (((getbithuff(data,prm,len-shl,0) << 1) + 1) << shl) >>> 1;
if ((diff & (1 << (len-1))) == 0)
diff -= (1 << len) - (shl==0?1:0);
if (col < 2) hpred[col] = vpred[row & 1][col] += diff;
else hpred[col & 1] += diff;
var clr = Math.min(Math.max(hpred[col & 1],0),(1<<tiff_bps)-1);
var bti = (row*raw_width+col)*tiff_bps;
UTIF.decode._putsF(tgt, bti, clr<<(16-tiff_bps));
}
}
}
// put 16 bits
UTIF.decode._putsF= function(dt, pos, val) { val = val<<(8-(pos&7)); var o=(pos>>>3); dt[o]|=val>>>16; dt[o+1]|=val>>>8; dt[o+2]|=val; }
UTIF.decode._getbithuff = function(data,prm,nbits, huff) {
var zero_after_ff = 0;
var get_byte = UTIF.decode._get_byte;
var c;
var off=prm[0], bitbuf=prm[1], vbits=prm[2], reset=prm[3];
//if (nbits > 25) return 0;
//if (nbits < 0) return bitbuf = vbits = reset = 0;
if (nbits == 0 || vbits < 0) return 0;
while (!reset && vbits < nbits && (c = data[off++]) != -1 &&
!(reset = zero_after_ff && c == 0xff && data[off++])) {
//console.log("byte read into c");
bitbuf = (bitbuf << 8) + c;
vbits += 8;
}
c = (bitbuf << (32-vbits)) >>> (32-nbits);
if (huff) {
vbits -= huff[c+1] >>> 8; //console.log(c, huff[c]>>8);
c = huff[c+1]&255;
} else
vbits -= nbits;
if (vbits < 0) throw "e";
prm[0]=off; prm[1]=bitbuf; prm[2]=vbits; prm[3]=reset;
return c;
}
UTIF.decode._make_decoder = function(source) {
var max, len, h, i, j;
var huff = [];
for (max=16; max!=0 && !source[max]; max--);
var si=17;
huff[0] = max;
for (h=len=1; len <= max; len++)
for (i=0; i < source[len]; i++, ++si)
for (j=0; j < 1 << (max-len); j++)
if (h <= 1 << max)
huff[h++] = (len << 8) | source[si];
return huff;
}
UTIF.decode._decodeNewJPEG = function(img, data, off, len, tgt, toff)
{
len = Math.min(len, data.length-off);
var tables = img["t347"], tlen = tables ? tables.length : 0, buff = new Uint8Array(tlen + len);
if (tables) {
var SOI = 216, EOI = 217, boff = 0;
for (var i=0; i<(tlen-1); i++)
{
// Skip EOI marker from JPEGTables
if (tables[i]==255 && tables[i+1]==EOI) break;
buff[boff++] = tables[i];
}
// Skip SOI marker from data
var byte1 = data[off], byte2 = data[off + 1];
if (byte1!=255 || byte2!=SOI)
{
buff[boff++] = byte1;
buff[boff++] = byte2;
}
for (var i=2; i<len; i++) buff[boff++] = data[off+i];
}
else for (var i=0; i<len; i++) buff[i] = data[off+i];
if(img["t262"][0]==32803 || (img["t259"][0]==7 && img["t262"][0]==34892)) // lossless JPEG (used in DNG files)
{
var bps = img["t258"][0];//, dcdr = new LosslessJpegDecoder();
//var time = Date.now();
var out = UTIF.LosslessJpegDecode(buff), olen=out.length; //console.log(olen);
//var out = ULLJPG(buff), olen=out.length; //console.log(olen);
//console.log(Date.now()-time);
if(false) {}
else if(bps==16) {
if(img.isLE) for(var i=0; i<olen; i++ ) { tgt[toff+(i<<1)] = (out[i]&255); tgt[toff+(i<<1)+1] = (out[i]>>>8); }
else for(var i=0; i<olen; i++ ) { tgt[toff+(i<<1)] = (out[i]>>>8); tgt[toff+(i<<1)+1] = (out[i]&255); }
}
else if(bps==14 || bps==12 || bps==10) { // 4 * 14 == 56 == 7 * 8
var rst = 16-bps;
for(var i=0; i<olen; i++) UTIF.decode._putsF(tgt, i*bps, out[i]<<rst);
}
else if(bps==8) {
for(var i=0; i<olen; i++) tgt[toff+i]=out[i];
}
else throw new Error("unsupported bit depth "+bps);
}
else
{
var parser = new UTIF.JpegDecoder(); parser.parse(buff);
var decoded = parser.getData({"width":parser.width,"height":parser.height,"forceRGB":true,"isSourcePDF":false});
for (var i=0; i<decoded.length; i++) tgt[toff + i] = decoded[i];
}
// PhotometricInterpretation is 6 (YCbCr) for JPEG, but after decoding we populate data in
// RGB format, so updating the tag value
if(img["t262"][0] == 6) img["t262"][0] = 2;
}
UTIF.decode._decodeOldJPEGInit = function(img, data, off, len)
{
var SOI = 216, EOI = 217, DQT = 219, DHT = 196, DRI = 221, SOF0 = 192, SOS = 218;
var joff = 0, soff = 0, tables, sosMarker, isTiled = false, i, j, k;
var jpgIchgFmt = img["t513"], jifoff = jpgIchgFmt ? jpgIchgFmt[0] : 0;
var jpgIchgFmtLen = img["t514"], jiflen = jpgIchgFmtLen ? jpgIchgFmtLen[0] : 0;
var soffTag = img["t324"] || img["t273"] || jpgIchgFmt;
var ycbcrss = img["t530"], ssx = 0, ssy = 0;
var spp = img["t277"]?img["t277"][0]:1;
var jpgresint = img["t515"];
if(soffTag)
{
soff = soffTag[0];
isTiled = (soffTag.length > 1);
}
if(!isTiled)
{
if(data[off]==255 && data[off+1]==SOI) return { jpegOffset: off };
if(jpgIchgFmt!=null)
{
if(data[off+jifoff]==255 && data[off+jifoff+1]==SOI) joff = off+jifoff;
else log("JPEGInterchangeFormat does not point to SOI");
if(jpgIchgFmtLen==null) log("JPEGInterchangeFormatLength field is missing");
else if(jifoff >= soff || (jifoff+jiflen) <= soff) log("JPEGInterchangeFormatLength field value is invalid");
if(joff != null) return { jpegOffset: joff };
}
}
if(ycbcrss!=null) { ssx = ycbcrss[0]; ssy = ycbcrss[1]; }
if(jpgIchgFmt!=null)
if(jpgIchgFmtLen!=null)
if(jiflen >= 2 && (jifoff+jiflen) <= soff)
{
if(data[off+jifoff+jiflen-2]==255 && data[off+jifoff+jiflen-1]==SOI) tables = new Uint8Array(jiflen-2);
else tables = new Uint8Array(jiflen);
for(i=0; i<tables.length; i++) tables[i] = data[off+jifoff+i];
log("Incorrect JPEG interchange format: using JPEGInterchangeFormat offset to derive tables");
}
else log("JPEGInterchangeFormat+JPEGInterchangeFormatLength > offset to first strip or tile");
if(tables == null)
{
var ooff = 0, out = [];
out[ooff++] = 255; out[ooff++] = SOI;
var qtables = img["t519"];
if(qtables==null) throw new Error("JPEGQTables tag is missing");
for(i=0; i<qtables.length; i++)
{
out[ooff++] = 255; out[ooff++] = DQT; out[ooff++] = 0; out[ooff++] = 67; out[ooff++] = i;
for(j=0; j<64; j++) out[ooff++] = data[off+qtables[i]+j];
}
for(k=0; k<2; k++)
{
var htables = img[(k == 0) ? "t520" : "t521"];
if(htables==null) throw new Error(((k == 0) ? "JPEGDCTables" : "JPEGACTables") + " tag is missing");
for(i=0; i<htables.length; i++)
{
out[ooff++] = 255; out[ooff++] = DHT;
//out[ooff++] = 0; out[ooff++] = 67; out[ooff++] = i;
var nc = 19;
for(j=0; j<16; j++) nc += data[off+htables[i]+j];
out[ooff++] = (nc >>> 8); out[ooff++] = nc & 255;
out[ooff++] = (i | (k << 4));
for(j=0; j<16; j++) out[ooff++] = data[off+htables[i]+j];
for(j=0; j<nc; j++) out[ooff++] = data[off+htables[i]+16+j];
}
}
out[ooff++] = 255; out[ooff++] = SOF0;
out[ooff++] = 0; out[ooff++] = 8 + 3*spp; out[ooff++] = 8;
out[ooff++] = (img.height >>> 8) & 255; out[ooff++] = img.height & 255;
out[ooff++] = (img.width >>> 8) & 255; out[ooff++] = img.width & 255;
out[ooff++] = spp;
if(spp==1) { out[ooff++] = 1; out[ooff++] = 17; out[ooff++] = 0; }
else for(i=0; i<3; i++)
{
out[ooff++] = i + 1;
out[ooff++] = (i != 0) ? 17 : (((ssx & 15) << 4) | (ssy & 15));
out[ooff++] = i;
}
if(jpgresint!=null && jpgresint[0]!=0)
{
out[ooff++] = 255; out[ooff++] = DRI; out[ooff++] = 0; out[ooff++] = 4;
out[ooff++] = (jpgresint[0] >>> 8) & 255;
out[ooff++] = jpgresint[0] & 255;
}
tables = new Uint8Array(out);
}
var sofpos = -1;
i = 0;
while(i < (tables.length - 1)) {
if(tables[i]==255 && tables[i+1]==SOF0) { sofpos = i; break; }
i++;
}
if(sofpos == -1)
{
var tmptab = new Uint8Array(tables.length + 10 + 3*spp);
tmptab.set(tables);
var tmpoff = tables.length;
sofpos = tables.length;
tables = tmptab;
tables[tmpoff++] = 255; tables[tmpoff++] = SOF0;
tables[tmpoff++] = 0; tables[tmpoff++] = 8 + 3*spp; tables[tmpoff++] = 8;
tables[tmpoff++] = (img.height >>> 8) & 255; tables[tmpoff++] = img.height & 255;
tables[tmpoff++] = (img.width >>> 8) & 255; tables[tmpoff++] = img.width & 255;
tables[tmpoff++] = spp;
if(spp==1) { tables[tmpoff++] = 1; tables[tmpoff++] = 17; tables[tmpoff++] = 0; }
else for(i=0; i<3; i++)
{
tables[tmpoff++] = i + 1;
tables[tmpoff++] = (i != 0) ? 17 : (((ssx & 15) << 4) | (ssy & 15));
tables[tmpoff++] = i;
}
}
if(data[soff]==255 && data[soff+1]==SOS)
{
var soslen = (data[soff+2]<<8) | data[soff+3];
sosMarker = new Uint8Array(soslen+2);
sosMarker[0] = data[soff]; sosMarker[1] = data[soff+1]; sosMarker[2] = data[soff+2]; sosMarker[3] = data[soff+3];
for(i=0; i<(soslen-2); i++) sosMarker[i+4] = data[soff+i+4];
}
else
{
sosMarker = new Uint8Array(2 + 6 + 2*spp);
var sosoff = 0;
sosMarker[sosoff++] = 255; sosMarker[sosoff++] = SOS;
sosMarker[sosoff++] = 0; sosMarker[sosoff++] = 6 + 2*spp; sosMarker[sosoff++] = spp;
if(spp==1) { sosMarker[sosoff++] = 1; sosMarker[sosoff++] = 0; }
else for(i=0; i<3; i++)
{
sosMarker[sosoff++] = i+1; sosMarker[sosoff++] = (i << 4) | i;
}
sosMarker[sosoff++] = 0; sosMarker[sosoff++] = 63; sosMarker[sosoff++] = 0;
}
return { jpegOffset: off, tables: tables, sosMarker: sosMarker, sofPosition: sofpos };
}
UTIF.decode._decodeOldJPEG = function(img, data, off, len, tgt, toff)
{
var i, dlen, tlen, buff, buffoff;
var jpegData = UTIF.decode._decodeOldJPEGInit(img, data, off, len);
if(jpegData.jpegOffset!=null)
{
dlen = off+len-jpegData.jpegOffset;
buff = new Uint8Array(dlen);
for(i=0; i<dlen; i++) buff[i] = data[jpegData.jpegOffset+i];
}
else
{
tlen = jpegData.tables.length;
buff = new Uint8Array(tlen + jpegData.sosMarker.length + len + 2);
buff.set(jpegData.tables);
buffoff = tlen;
buff[jpegData.sofPosition+5] = (img.height >>> 8) & 255; buff[jpegData.sofPosition+6] = img.height & 255;
buff[jpegData.sofPosition+7] = (img.width >>> 8) & 255; buff[jpegData.sofPosition+8] = img.width & 255;
if(data[off]!=255 || data[off+1]!=SOS)
{
buff.set(jpegData.sosMarker, buffoff);
buffoff += sosMarker.length;
}
for(i=0; i<len; i++) buff[buffoff++] = data[off+i];
buff[buffoff++] = 255; buff[buffoff++] = EOI;
}
var parser = new UTIF.JpegDecoder(); parser.parse(buff);
var decoded = parser.getData({"width":parser.width,"height":parser.height,"forceRGB":true,"isSourcePDF":false});
for (var i=0; i<decoded.length; i++) tgt[toff + i] = decoded[i];
// PhotometricInterpretation is 6 (YCbCr) for JPEG, but after decoding we populate data in
// RGB format, so updating the tag value
if(img["t262"] && img["t262"][0] == 6) img["t262"][0] = 2;
}
UTIF.decode._decodePackBits = function(data, off, len, tgt, toff)
{
var sa = new Int8Array(data.buffer), ta = new Int8Array(tgt.buffer), lim = off+len;
while(off<lim)
{
var n = sa[off]; off++;
if(n>=0 && n<128) for(var i=0; i< n+1; i++) { ta[toff]=sa[off]; toff++; off++; }
if(n>=-127 && n<0) { for(var i=0; i<-n+1; i++) { ta[toff]=sa[off]; toff++; } off++; }
}
return toff;
}
UTIF.decode._decodeThunder = function(data, off, len, tgt, toff)
{
var d2 = [ 0, 1, 0, -1 ], d3 = [ 0, 1, 2, 3, 0, -3, -2, -1 ];
var lim = off+len, qoff = toff*2, px = 0;
while(off<lim)
{
var b = data[off], msk = (b>>>6), n = (b&63); off++;
if(msk==3) { px=(n&15); tgt[qoff>>>1] |= (px<<(4*(1-qoff&1))); qoff++; }
if(msk==0) for(var i=0; i<n; i++) { tgt[qoff>>>1] |= (px<<(4*(1-qoff&1))); qoff++; }
if(msk==2) for(var i=0; i<2; i++) { var d=(n>>>(3*(1-i)))&7; if(d!=4) { px+=d3[d]; tgt[qoff>>>1] |= (px<<(4*(1-qoff&1))); qoff++; } }
if(msk==1) for(var i=0; i<3; i++) { var d=(n>>>(2*(2-i)))&3; if(d!=2) { px+=d2[d]; tgt[qoff>>>1] |= (px<<(4*(1-qoff&1))); qoff++; } }
}
}
UTIF.decode._dmap = { "1":0,"011":1,"000011":2,"0000011":3, "010":-1,"000010":-2,"0000010":-3 };
UTIF.decode._lens = ( function()
{
var addKeys = function(lens, arr, i0, inc) { for(var i=0; i<arr.length; i++) lens[arr[i]] = i0 + i*inc; }
var termW = "00110101,000111,0111,1000,1011,1100,1110,1111,10011,10100,00111,01000,001000,000011,110100,110101," // 15
+ "101010,101011,0100111,0001100,0001000,0010111,0000011,0000100,0101000,0101011,0010011,0100100,0011000,00000010,00000011,00011010," // 31
+ "00011011,00010010,00010011,00010100,00010101,00010110,00010111,00101000,00101001,00101010,00101011,00101100,00101101,00000100,00000101,00001010," // 47
+ "00001011,01010010,01010011,01010100,01010101,00100100,00100101,01011000,01011001,01011010,01011011,01001010,01001011,00110010,00110011,00110100";
var termB = "0000110111,010,11,10,011,0011,0010,00011,000101,000100,0000100,0000101,0000111,00000100,00000111,000011000," // 15
+ "0000010111,0000011000,0000001000,00001100111,00001101000,00001101100,00000110111,00000101000,00000010111,00000011000,000011001010,000011001011,000011001100,000011001101,000001101000,000001101001," // 31
+ "000001101010,000001101011,000011010010,000011010011,000011010100,000011010101,000011010110,000011010111,000001101100,000001101101,000011011010,000011011011,000001010100,000001010101,000001010110,000001010111," // 47
+ "000001100100,000001100101,000001010010,000001010011,000000100100,000000110111,000000111000,000000100111,000000101000,000001011000,000001011001,000000101011,000000101100,000001011010,000001100110,000001100111";
var makeW = "11011,10010,010111,0110111,00110110,00110111,01100100,01100101,01101000,01100111,011001100,011001101,011010010,011010011,011010100,011010101,011010110,"
+ "011010111,011011000,011011001,011011010,011011011,010011000,010011001,010011010,011000,010011011";
var makeB = "0000001111,000011001000,000011001001,000001011011,000000110011,000000110100,000000110101,0000001101100,0000001101101,0000001001010,0000001001011,0000001001100,"
+ "0000001001101,0000001110010,0000001110011,0000001110100,0000001110101,0000001110110,0000001110111,0000001010010,0000001010011,0000001010100,0000001010101,0000001011010,"
+ "0000001011011,0000001100100,0000001100101";
var makeA = "00000001000,00000001100,00000001101,000000010010,000000010011,000000010100,000000010101,000000010110,000000010111,000000011100,000000011101,000000011110,000000011111";
termW = termW.split(","); termB = termB.split(","); makeW = makeW.split(","); makeB = makeB.split(","); makeA = makeA.split(",");
var lensW = {}, lensB = {};
addKeys(lensW, termW, 0, 1); addKeys(lensW, makeW, 64,64); addKeys(lensW, makeA, 1792,64);
addKeys(lensB, termB, 0, 1); addKeys(lensB, makeB, 64,64); addKeys(lensB, makeA, 1792,64);
return [lensW, lensB];
} )();
UTIF.decode._decodeG4 = function(data, off, slen, tgt, toff, w, fo)
{
var U = UTIF.decode, boff=off<<3, len=0, wrd=""; // previous starts with 1
var line=[], pline=[]; for(var i=0; i<w; i++) pline.push(0); pline=U._makeDiff(pline);
var a0=0, a1=0, a2=0, b1=0, b2=0, clr=0;
var y=0, mode="", toRead=0;
var bipl = Math.ceil(w/8)*8;
while((boff>>>3)<off+slen)
{
b1 = U._findDiff(pline, a0+(a0==0?0:1), 1-clr), b2 = U._findDiff(pline, b1, clr); // could be precomputed
var bit =0;
if(fo==1) bit = (data[boff>>>3]>>>(7-(boff&7)))&1;
if(fo==2) bit = (data[boff>>>3]>>>( (boff&7)))&1;
boff++; wrd+=bit;
if(mode=="H")
{
if(U._lens[clr][wrd]!=null)
{
var dl=U._lens[clr][wrd]; wrd=""; len+=dl;
if(dl<64) { U._addNtimes(line,len,clr); a0+=len; clr=1-clr; len=0; toRead--; if(toRead==0) mode=""; }
}
}
else
{
if(wrd=="0001") { wrd=""; U._addNtimes(line,b2-a0,clr); a0=b2; }
if(wrd=="001" ) { wrd=""; mode="H"; toRead=2; }
if(U._dmap[wrd]!=null) { a1 = b1+U._dmap[wrd]; U._addNtimes(line, a1-a0, clr); a0=a1; wrd=""; clr=1-clr; }
}
if(line.length==w && mode=="")
{
U._writeBits(line, tgt, toff*8+y*bipl);
clr=0; y++; a0=0;
pline=U._makeDiff(line); line=[];
}
//if(wrd.length>150) { log(wrd); break; throw "e"; }
}
}
UTIF.decode._findDiff = function(line, x, clr) { for(var i=0; i<line.length; i+=2) if(line[i]>=x && line[i+1]==clr) return line[i]; }
UTIF.decode._makeDiff = function(line)
{
var out = []; if(line[0]==1) out.push(0,1);
for(var i=1; i<line.length; i++) if(line[i-1]!=line[i]) out.push(i, line[i]);
out.push(line.length,0,line.length,1); return out;
}
UTIF.decode._decodeG2 = function(data, off, slen, tgt, toff, w, fo)
{
var U = UTIF.decode, boff=off<<3, len=0, wrd="";
var line=[];
var clr = 0;
var y=0;
var bipl = Math.ceil(w/8)*8;
while((boff>>>3)<off+slen) {
var bit =0;
if(fo==1) bit = (data[boff>>>3]>>>(7-(boff&7)))&1;
if(fo==2) bit = (data[boff>>>3]>>>( (boff&7)))&1;
boff++; wrd+=bit;
len = U._lens[clr][wrd];
if(len!=null) {
U._addNtimes(line,len,clr); wrd="";
if(len<64) clr = 1-clr;
if(line.length==w) { U._writeBits(line, tgt, toff*8+y*bipl); line=[]; y++; clr=0; if((boff&7)!=0) boff+=8-(boff&7); if(len>=64) boff+=8; }
}
}
}
UTIF.decode._decodeG3 = function(data, off, slen, tgt, toff, w, fo, twoDim)
{
var U = UTIF.decode, boff=off<<3, len=0, wrd="";
var line=[], pline=[]; for(var i=0; i<w; i++) line.push(0);
var a0=0, a1=0, a2=0, b1=0, b2=0, clr=0;
var y=-1, mode="", toRead=0, is1D=true;
var bipl = Math.ceil(w/8)*8;
while((boff>>>3)<off+slen)
{
b1 = U._findDiff(pline, a0+(a0==0?0:1), 1-clr), b2 = U._findDiff(pline, b1, clr); // could be precomputed
var bit =0;
if(fo==1) bit = (data[boff>>>3]>>>(7-(boff&7)))&1;
if(fo==2) bit = (data[boff>>>3]>>>( (boff&7)))&1;
boff++; wrd+=bit;
if(is1D)
{
if(U._lens[clr][wrd]!=null)
{
var dl=U._lens[clr][wrd]; wrd=""; len+=dl;
if(dl<64) { U._addNtimes(line,len,clr); clr=1-clr; len=0; }
}
}
else
{
if(mode=="H")
{
if(U._lens[clr][wrd]!=null)
{
var dl=U._lens[clr][wrd]; wrd=""; len+=dl;
if(dl<64) { U._addNtimes(line,len,clr); a0+=len; clr=1-clr; len=0; toRead--; if(toRead==0) mode=""; }
}
}
else
{
if(wrd=="0001") { wrd=""; U._addNtimes(line,b2-a0,clr); a0=b2; }
if(wrd=="001" ) { wrd=""; mode="H"; toRead=2; }
if(U._dmap[wrd]!=null) { a1 = b1+U._dmap[wrd]; U._addNtimes(line, a1-a0, clr); a0=a1; wrd=""; clr=1-clr; }
}
}
if(wrd.endsWith("000000000001")) // needed for some files
{
if(y>=0) U._writeBits(line, tgt, toff*8+y*bipl);
if(twoDim) {
if(fo==1) is1D = ((data[boff>>>3]>>>(7-(boff&7)))&1)==1;
if(fo==2) is1D = ((data[boff>>>3]>>>( (boff&7)))&1)==1;
boff++;
}
//log("EOL",y, "next 1D:", is1D);
wrd=""; clr=0; y++; a0=0;
pline=U._makeDiff(line); line=[];
}
}
if(line.length==w) U._writeBits(line, tgt, toff*8+y*bipl);
}
UTIF.decode._addNtimes = function(arr, n, val) { for(var i=0; i<n; i++) arr.push(val); }
UTIF.decode._writeBits = function(bits, tgt, boff)
{
for(var i=0; i<bits.length; i++) tgt[(boff+i)>>>3] |= (bits[i]<<(7-((boff+i)&7)));
}
UTIF.decode._decodeLZW=UTIF.decode._decodeLZW=function(){var e,U,Z,u,K=0,V=0,g=0,N=0,O=function(){var S=e>>>3,A=U[S]<<16|U[S+1]<<8|U[S+2],j=A>>>24-(e&7)-V&(1<<V)-1;
e+=V;return j},h=new Uint32Array(4096*4),w=0,m=function(S){if(S==w)return;w=S;g=1<<S;N=g+1;for(var A=0;
A<N+1;A++){h[4*A]=h[4*A+3]=A;h[4*A+1]=65535;h[4*A+2]=1}},i=function(S){V=S+1;K=N+1},D=function(S){var A=S<<2,j=h[A+2],a=u+j-1;
while(A!=65535){Z[a--]=h[A];A=h[A+1]}u+=j},L=function(S,A){var j=K<<2,a=S<<2;h[j]=h[(A<<2)+3];h[j+1]=a;
h[j+2]=h[a+2]+1;h[j+3]=h[a+3];K++;if(K+1==1<<V&&V!=12)V++},T=function(S,A,j,a,n,q){e=A<<3;U=S;Z=a;u=n;
var B=A+j<<3,_=0,t=0;m(q);i(q);while(e<B&&(_=O())!=N){if(_==g){i(q);_=O();if(_==N)break;D(_)}else{if(_<K){D(_);
L(t,_)}else{L(t,t);D(K-1)}}t=_}return u};return T}();
UTIF.tags = {};
//UTIF.ttypes = { 256:3,257:3,258:3, 259:3, 262:3, 273:4, 274:3, 277:3,278:4,279:4, 282:5, 283:5, 284:3, 286:5,287:5, 296:3, 305:2, 306:2, 338:3, 513:4, 514:4, 34665:4 };
// start at tag 250
UTIF._types = function() {
var main = new Array(250); main.fill(0);
main = main.concat([0,0,0,0,4,3,3,3,3,3,0,0,3,0,0,0,3,0,0,2,2,2,2,4,3,0,0,3,4,4,3,3,5,5,3,2,5,5,0,0,0,0,4,4,0,0,3,3,0,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,0,2,2,3,5,5,3,0,3,3,4,4,4,3,4,0,0,0,0,0,0,0,0,0,3,3,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);
var rest = {33432: 2, 33434: 5, 33437: 5, 34665: 4, 34850: 3, 34853: 4, 34855: 3, 34864: 3, 34866: 4, 36864: 7, 36867: 2, 36868: 2, 37121: 7, 37377: 10, 37378: 5, 37380: 10, 37381: 5, 37383: 3, 37384: 3, 37385: 3, 37386: 5, 37510: 7, 37520: 2, 37521: 2, 37522: 2, 40960: 7, 40961: 3, 40962: 4, 40963: 4, 40965: 4, 41486: 5, 41487: 5, 41488: 3, 41985: 3, 41986: 3, 41987: 3, 41988: 5, 41989: 3, 41990: 3, 41993: 3, 41994: 3, 41995: 7, 41996: 3, 42032: 2, 42033: 2, 42034: 5, 42036: 2, 42037: 2, 59932: 7};
return {
basic: {
main: main,
rest: rest
},
gps: {
main: [1,2,5,2,5,1,5,5,0,9],
rest: {18:2,29:2}
}
}
}();
UTIF._readIFD = function(bin, data, offset, ifds, depth, prm)
{
var cnt = bin.readUshort(data, offset); offset+=2;
var ifd = {};
if(prm.debug) log(" ".repeat(depth),ifds.length-1,">>>----------------");
for(var i=0; i<cnt; i++)
{
var tag = bin.readUshort(data, offset); offset+=2;
var type = bin.readUshort(data, offset); offset+=2;
var num = bin.readUint (data, offset); offset+=4;
var voff = bin.readUint (data, offset); offset+=4;
var arr = [];
//ifd["t"+tag+"-"+UTIF.tags[tag]] = arr;
if(type== 1 || type==7) { var no=(num<5 ? offset-4 : voff); if(no+num>data.buffer.byteLength) num=data.buffer.byteLength-no; arr = new Uint8Array(data.buffer, no, num); }
if(type== 2) { var o0 = (num<5 ? offset-4 : voff), c=data[o0], len=Math.max(0, Math.min(num-1,data.length-o0));
if(c<128 || len==0) arr.push( bin.readASCII(data, o0, len) );
else arr = new Uint8Array(data.buffer, o0, len); }
if(type== 3) { for(var j=0; j<num; j++) arr.push(bin.readUshort(data, (num<3 ? offset-4 : voff)+2*j)); }
if(type== 4
|| type==13) { for(var j=0; j<num; j++) arr.push(bin.readUint (data, (num<2 ? offset-4 : voff)+4*j)); }
if(type== 5 || type==10) {
var ri = type==5 ? bin.readUint : bin.readInt;
for(var j=0; j<num; j++) arr.push([ri(data, voff+j*8), ri(data,voff+j*8+4)]); }
if(type== 8) { for(var j=0; j<num; j++) arr.push(bin.readShort (data, (num<3 ? offset-4 : voff)+2*j)); }
if(type== 9) { for(var j=0; j<num; j++) arr.push(bin.readInt (data, (num<2 ? offset-4 : voff)+4*j)); }
if(type==11) { for(var j=0; j<num; j++) arr.push(bin.readFloat (data, voff+j*4)); }
if(type==12) { for(var j=0; j<num; j++) arr.push(bin.readDouble(data, voff+j*8)); }
if(num!=0 && arr.length==0) { log(tag, "unknown TIFF tag type: ", type, "num:",num); if(i==0)return; continue; }
if(prm.debug) log(" ".repeat(depth), tag, type, UTIF.tags[tag], arr);
ifd["t"+tag] = arr;
if(tag==330 && ifd["t272"] && ifd["t272"][0]=="DSLR-A100") { }
else if(tag==330 || tag==34665 || tag==34853 || (tag==50740 && bin.readUshort(data,bin.readUint(arr,0))<300 ) ||tag==61440) {
var oarr = tag==50740 ? [bin.readUint(arr,0)] : arr;
var subfd = [];
for(var j=0; j<oarr.length; j++) UTIF._readIFD(bin, data, oarr[j], subfd, depth+1, prm);
if(tag== 330) ifd.subIFD = subfd;
if(tag==34665) ifd.exifIFD = subfd[0];
if(tag==34853) ifd.gpsiIFD = subfd[0]; //console.log("gps", subfd[0]); }
if(tag==50740) ifd.dngPrvt = subfd[0];
if(tag==61440) ifd.fujiIFD = subfd[0];
}
if(tag==37500 && prm.parseMN) {
var mn = arr;
//console.log(bin.readASCII(mn,0,mn.length), mn);
if(bin.readASCII(mn,0,5)=="Nikon") ifd.makerNote = UTIF["decode"](mn.slice(10).buffer)[0];
else if(bin.readASCII(mn,0,5)=="OLYMP" || bin.readASCII(mn,0,9)=="OM SYSTEM") { // ???
var inds = [8208,8224,8240,8256,8272];
var subsub = []; UTIF._readIFD(bin, mn, mn[1]==77 ? 16 : (mn[5]==85 ? 12 : 8), subsub, depth+1, prm);
var obj = ifd.makerNote = subsub.pop();
for(var j=0; j<inds.length; j++) {
var k="t"+inds[j]; if(obj[k]==null) continue;
UTIF._readIFD(bin, mn, obj[k][0], subsub, depth+1, prm);
obj[k] = subsub.pop();
}
if(obj["t12288"]) {
UTIF._readIFD(bin, obj["t12288"], 0, subsub, depth+1, prm);
obj["t12288"]=subsub.pop();
}
}
else if(bin.readUshort(data,voff)<300 && bin.readUshort(data,voff+4)<=12){
var subsub=[]; UTIF._readIFD(bin, data, voff, subsub, depth+1, prm);
ifd.makerNote = subsub[0];
}
}
}
ifds.push(ifd);
if(prm.debug) log(" ".repeat(depth),"<<<---------------");
return offset;
}
UTIF._writeIFD = function(bin, types, data, offset, ifd)
{
var keys = Object.keys(ifd), knum=keys.length; if(ifd["exifIFD"]) knum--; if(ifd["gpsiIFD"]) knum--;
bin.writeUshort(data, offset, knum); offset+=2;
var eoff = offset + knum*12 + 4;
for(var ki=0; ki<keys.length; ki++)
{
var key = keys[ki]; if(key=="t34665" || key=="t34853") continue;
if(key=="exifIFD") key="t34665"; if(key=="gpsiIFD") key="t34853";
var tag = parseInt(key.slice(1)), type = types.main[tag]; if(type==null) type=types.rest[tag];
if(type==null || type==0) throw new Error("unknown type of tag: "+tag);
//console.log(offset+":", tag, type, eoff);
var val = ifd[key];
if(tag==34665) {
var outp = UTIF._writeIFD(bin, types, data, eoff, ifd["exifIFD"]);
val = [eoff]; eoff = outp[1];
}
if(tag==34853) {
var outp = UTIF._writeIFD(bin, UTIF._types.gps, data, eoff, ifd["gpsiIFD"]);
val = [eoff]; eoff = outp[1];
}
if(type==2) val=val[0]+"\u0000"; var num = val.length;
bin.writeUshort(data, offset, tag ); offset+=2;
bin.writeUshort(data, offset, type); offset+=2;
bin.writeUint (data, offset, num ); offset+=4;
var dlen = [-1, 1, 1, 2, 4, 8, 0, 1, 0, 4, 8, 0, 8][type] * num; //if(dlen<1) throw "e";
var toff = offset;
if(dlen>4) { bin.writeUint(data, offset, eoff); toff=eoff; }
if (type== 1 || type==7) { for(var i=0; i<num; i++) data[toff+i] = val[i]; }
else if(type== 2) { bin.writeASCII(data, toff, val); }
else if(type== 3) { for(var i=0; i<num; i++) bin.writeUshort(data, toff+2*i, val[i]); }
else if(type== 4) { for(var i=0; i<num; i++) bin.writeUint (data, toff+4*i, val[i]); }
else if(type== 5 || type==10) {
var wr = type==5?bin.writeUint:bin.writeInt;
for(var i=0; i<num; i++) {
var v=val[i],nu=v[0],de=v[1]; if(nu==null) throw "e"; wr(data, toff+8*i, nu); wr(data, toff+8*i+4, de); } }
else if(type== 9) { for(var i=0; i<num; i++) bin.writeInt (data, toff+4*i, val[i]); }
else if(type==12) { for(var i=0; i<num; i++) bin.writeDouble(data, toff+8*i, val[i]); }
else throw type;
if(dlen>4) { dlen += (dlen&1); eoff += dlen; }
offset += 4;
}
return [offset, eoff];
}
UTIF.toRGBA8 = function(out, scl)
{
function gamma(x) { return x < 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1.0 / 2.4) - 0.055; }
var w = out.width, h = out.height, area = w*h, qarea = area*4, data = out.data;
var img = new Uint8Array(area*4);
//console.log(out);
// 0: WhiteIsZero, 1: BlackIsZero, 2: RGB, 3: Palette color, 4: Transparency mask, 5: CMYK
var intp = (out["t262"] ? out["t262"][0]: 2), bps = (out["t258"]?Math.min(32,out["t258"][0]):1);
if(out["t262"]==null && bps==1) intp=0;
var smpls = out["t277"]?out["t277"][0] : (out["t258"]?out["t258"].length : [1,1,3,1,1,4,3][intp]);
var sfmt = out["t339"]?out["t339"][0] : null; if(intp==1 && bps==32 && sfmt!=3) throw "e"; // sample format
var bpl = Math.ceil(smpls*bps*w/8);
//log("interpretation: ", intp, "smpls", smpls, "bps", bps, "sample format",sfmt, out);
if(false) {}
else if(intp==0)
{
scl = 1/256; // "Photopeatest.tif"
for(var y=0; y<h; y++) {
var off = y*bpl, io = y*w;
if(bps== 1) for(var i=0; i<w; i++) { var qi=(io+i)<<2, px=((data[off+(i>>3)])>>(7- (i&7)))& 1; img[qi]=img[qi+1]=img[qi+2]=( 1-px)*255; img[qi+3]=255; }
if(bps== 4) for(var i=0; i<w; i++) { var qi=(io+i)<<2, px=((data[off+(i>>1)])>>(4-4*(i&1)))&15; img[qi]=img[qi+1]=img[qi+2]=(15-px)* 17; img[qi+3]=255; }
if(bps== 8) for(var i=0; i<w; i++) { var qi=(io+i)<<2, px=data[off+i]; img[qi]=img[qi+1]=img[qi+2]=255-px; img[qi+3]=255; }
if(bps==16) for(var i=0; i<w; i++) { var qi=(io+i)<<2, o=off+(2*i), px=(data[o+1]<<8)|data[o]; img[qi]=img[qi+1]=img[qi+2]= Math.min(255,255-(~~(px*scl))); img[qi+3]=255; } // ladoga.tif
}
}
else if(intp==1)
{
if(scl==null) scl=1/256;
var f32 = ((data.length&3)==0) ? new Float32Array(data.buffer) : null;
for(var y=0; y<h; y++) {
var off = y*bpl, io = y*w;
if(bps== 1) for(var i=0; i<w; i++) { var qi=(io+i)<<2, px=((data[off+(i>>3)])>>(7- (i&7)))&1; img[qi]=img[qi+1]=img[qi+2]=(px)*255; img[qi+3]=255; }
if(bps== 2) for(var i=0; i<w; i++) { var qi=(io+i)<<2, px=((data[off+(i>>2)])>>(6-2*(i&3)))&3; img[qi]=img[qi+1]=img[qi+2]=(px)* 85; img[qi+3]=255; }
if(bps== 8) for(var i=0; i<w; i++) { var qi=(io+i)<<2, px=data[off+i*smpls]; img[qi]=img[qi+1]=img[qi+2]= px; img[qi+3]=255; }
if(bps==16) for(var i=0; i<w; i++) { var qi=(io+i)<<2, o=off+(2*i), px=(data[o+1]<<8)|data[o]; img[qi]=img[qi+1]=img[qi+2]= Math.min(255,~~(px*scl)); img[qi+3]=255; } // ladoga.tif
if(bps==32) for(var i=0; i<w; i++) { var qi=(io+i)<<2, o=(off>>>2)+i, px=f32[o]; img[qi]=img[qi+1]=img[qi+2]= ~~(0.5+255*px); img[qi+3]=255; }
}
}
else if(intp==2)
{
if(bps== 8)
{
if(smpls==1) for(var i=0; i<area; i++) { img[4*i]=img[4*i+1]=img[4*i+2]=data[i]; img[4*i+3]=255; }
if(smpls==3) for(var i=0; i<area; i++) { var qi=i<<2, ti=i*3 ; img[qi]=data[ti]; img[qi+1]=data[ti+1]; img[qi+2]=data[ti+2]; img[qi+3]=255; }
if(smpls>=4) for(var i=0; i<area; i++) { var qi=i<<2, ti=i*smpls; img[qi]=data[ti]; img[qi+1]=data[ti+1]; img[qi+2]=data[ti+2]; img[qi+3]=data[ti+3]; }
}
else if(bps==16){ // 3x 16-bit channel
if(smpls==4) for(var i=0; i<area; i++) { var qi=i<<2, ti=i*8+1; img[qi]=data[ti]; img[qi+1]=data[ti+2]; img[qi+2]=data[ti+4]; img[qi+3]=data[ti+6]; }
if(smpls==3) for(var i=0; i<area; i++) { var qi=i<<2, ti=i*6+1; img[qi]=data[ti]; img[qi+1]=data[ti+2]; img[qi+2]=data[ti+4]; img[qi+3]=255; }
}
else if(bps==32){
var ndt = new Float32Array(data.buffer); // t339 is [3,3,3]
// check the endianity
var min = 0; for(var i=0; i<ndt.length; i++) min = Math.min(min,ndt[i]);
if(min<0) for(var i=0; i<data.length; i+=4) { var t=data[i]; data[i]=data[i+3]; data[i+3]=t; t=data[i+1]; data[i+1]=data[i+2]; data[i+2]=t; }
// gamma correction
var pmap = []; for(var i=0; i<65536; i++) pmap.push(gamma(i/65535));
for(var i=0; i<ndt.length; i++) { var cv = Math.max(0, Math.min(1, ndt[i])); ndt[i] = pmap[~~(0.5+cv*65535)]; }
if(smpls==3) for(var i=0; i<area; i++) { var qi=i<<2, ti=i*3;
img[qi]=~~(0.5+ndt[ti]*255); img[qi+1]=~~(0.5+ndt[ti+1]*255); img[qi+2]=~~(0.5+ndt[ti+2]*255); img[qi+3]=255; }
else if(smpls==4) for(var i=0; i<area; i++) { var qi=i<<2, ti=i*4;
img[qi]=~~(0.5+ndt[ti]*255); img[qi+1]=~~(0.5+ndt[ti+1]*255); img[qi+2]=~~(0.5+ndt[ti+2]*255); img[qi+3]=~~(0.5+ndt[ti+3]*255); }
else throw smpls;
}
else throw bps;
}
else if(intp==3)
{
var map = out["t320"];
var cn = 1<<bps;
var nexta = bps==8 && smpls>1 && out["t338"] && out["t338"][0]!=0;
for(var y=0; y<h; y++)
for(var x=0; x<w; x++) {
var i = y*w+x;
var qi=i<<2, mi=0;
var dof = y*bpl;
if(false) {}
else if(bps==1) mi=(data[dof+(x>>>3)]>>>(7- (x&7)))& 1;
else if(bps==2) mi=(data[dof+(x>>>2)]>>>(6-2*(x&3)))& 3;
else if(bps==4) mi=(data[dof+(x>>>1)]>>>(4-4*(x&1)))&15;
else if(bps==8) mi= data[dof+x*smpls];
else throw bps;
img[qi]=(map[mi]>>8); img[qi+1]=(map[cn+mi]>>8); img[qi+2]=(map[cn+cn+mi]>>8); img[qi+3]=nexta ? data[dof+x*smpls+1] : 255;
}
}
else if(intp==5)
{
var gotAlpha = smpls>4 ? 1 : 0;
for(var i=0; i<area; i++) {
var qi=i<<2, si=i*smpls;
if(window.UDOC) {
var C=data[si], M=data[si+1], Y=data[si+2], K=data[si+3];
var c = UDOC.C.cmykToRgb([C*(1/255), M*(1/255), Y*(1/255), K*(1/255)]);
img[qi] = ~~(0.5+255*c[0]); img[qi+1] = ~~(0.5+255*c[1]); img[qi+2] = ~~(0.5+255*c[2]);
}
else {
var C=255-data[si], M=255-data[si+1], Y=255-data[si+2], K=(255-data[si+3])*(1/255);
img[qi]=~~(C*K+0.5); img[qi+1]=~~(M*K+0.5); img[qi+2]=~~(Y*K+0.5);
}
img[qi+3]=255*(1-gotAlpha)+data[si+4]*gotAlpha;
}
}
else if(intp==6 && out["t278"]) { // only for DSC_1538.TIF
var rps = out["t278"][0];
for(var y=0; y<h; y+=rps) {
var i=(y*w), len = rps*w;
for(var j=0; j<len; j++) {
var qi = 4*(i+j), si = 3*i+4*(j>>>1);
var Y = data[si+(j&1)], Cb=data[si+2]-128, Cr=data[si+3]-128;
var r = Y + ( (Cr >> 2) + (Cr >> 3) + (Cr >> 5) ) ;
var g = Y - ( (Cb >> 2) + (Cb >> 4) + (Cb >> 5)) - ( (Cr >> 1) + (Cr >> 3) + (Cr >> 4) + (Cr >> 5)) ;
var b = Y + ( Cb + (Cb >> 1) + (Cb >> 2) + (Cb >> 6)) ;
img[qi ]=Math.max(0,Math.min(255,r));
img[qi+1]=Math.max(0,Math.min(255,g));
img[qi+2]=Math.max(0,Math.min(255,b));
img[qi+3]=255;
}
}
}
else if(intp==32845) {
for(var y=0; y<h; y++)
for(var x=0; x<w; x++) {
var si = (y*w+x)*6, qi=(y*w+x)*4;
var L = (data[si+1]<<8) | data[si];
var L = Math.pow(2, (L + 0.5) / 256 - 64);
var u = (data[si+3] + 0.5) / 410;
var v = (data[si+5] + 0.5) / 410;
// Luv to xyY
var sX = (9 * u) / (6 * u - 16 * v + 12);
var sY = (4 * v) / (6 * u - 16 * v + 12);
var bY = L;
// xyY to XYZ
var X = (sX*bY)/sY, Y = bY, Z = (1-sX-sY)*bY/sY;
var r = 2.690*X -1.276*Y -0.414*Z
var g = -1.022*X +1.978*Y +0.044*Z
var b = 0.061*X -0.224*Y +1.163*Z
img[qi ] = gamma(Math.min(r,1))*255;
img[qi+1] = gamma(Math.min(g,1))*255;
img[qi+2] = gamma(Math.min(b,1))*255;
img[qi+3] = 255;
}
}
else log("Unknown Photometric interpretation: "+intp);
return img;
}
UTIF.replaceIMG = function(imgs)
{
if(imgs==null) imgs = document.getElementsByTagName("img");
var sufs = ["tif","tiff","dng","cr2","nef"]
for (var i=0; i<imgs.length; i++)
{
var img=imgs[i], src=img.getAttribute("src"); if(src==null) continue;
var suff=src.split(".").pop().toLowerCase();
if(sufs.indexOf(suff)==-1) continue;
var xhr = new XMLHttpRequest(); UTIF._xhrs.push(xhr); UTIF._imgs.push(img);
xhr.open("GET", src); xhr.responseType = "arraybuffer";
xhr.onload = UTIF._imgLoaded; xhr.send();
}
}
UTIF._xhrs = []; UTIF._imgs = [];
UTIF._imgLoaded = function(e) {
var ind = UTIF._xhrs.indexOf(e.target), img = UTIF._imgs[ind];
UTIF._xhrs.splice(ind,1); UTIF._imgs.splice(ind,1);
img.setAttribute("src",UTIF.bufferToURI(e.target.response));
}
UTIF.bufferToURI = function(buff) {
var ifds = UTIF.decode(buff); //console.log(ifds);
var vsns = ifds, ma=0, page=vsns[0]; if(ifds[0].subIFD) vsns = vsns.concat(ifds[0].subIFD);
for(var i=0; i<vsns.length; i++) {
var img = vsns[i];
if(img["t258"]==null || img["t258"].length<3) continue;
var ar = img["t256"]*img["t257"];
if(ar>ma) { ma=ar; page=img; }
}
UTIF.decodeImage(buff, page, ifds);
var rgba = UTIF.toRGBA8(page), w=page.width, h=page.height;
var cnv = document.createElement("canvas"); cnv.width=w; cnv.height=h;
var ctx = cnv.getContext("2d");
var imgd = new ImageData(new Uint8ClampedArray(rgba.buffer),w,h);
ctx.putImageData(imgd,0,0);
return cnv.toDataURL();
}
UTIF._binBE =
{
nextZero : function(data, o) { while(data[o]!=0) o++; return o; },
readUshort : function(buff, p) { return (buff[p]<< 8) | buff[p+1]; },
readShort : function(buff, p) { var a=UTIF._binBE.ui8; a[0]=buff[p+1]; a[1]=buff[p+0]; return UTIF._binBE. i16[0]; },
readInt : function(buff, p) { var a=UTIF._binBE.ui8; a[0]=buff[p+3]; a[1]=buff[p+2]; a[2]=buff[p+1]; a[3]=buff[p+0]; return UTIF._binBE. i32[0]; },
readUint : function(buff, p) { var a=UTIF._binBE.ui8; a[0]=buff[p+3]; a[1]=buff[p+2]; a[2]=buff[p+1]; a[3]=buff[p+0]; return UTIF._binBE.ui32[0]; },
readASCII : function(buff, p, l) { var s = ""; for(var i=0; i<l; i++) s += String.fromCharCode(buff[p+i]); return s; },
readFloat : function(buff, p) { var a=UTIF._binBE.ui8; for(var i=0;i<4;i++) a[i]=buff[p+3-i]; return UTIF._binBE.fl32[0]; },
readDouble : function(buff, p) { var a=UTIF._binBE.ui8; for(var i=0;i<8;i++) a[i]=buff[p+7-i]; return UTIF._binBE.fl64[0]; },
writeUshort: function(buff, p, n) { buff[p] = (n>> 8)&255; buff[p+1] = n&255; },
writeInt : function(buff, p, n) { var a=UTIF._binBE.ui8; UTIF._binBE.i32[0]=n; buff[p+3]=a[0]; buff[p+2]=a[1]; buff[p+1]=a[2]; buff[p+0]=a[3]; },
writeUint : function(buff, p, n) { buff[p] = (n>>24)&255; buff[p+1] = (n>>16)&255; buff[p+2] = (n>>8)&255; buff[p+3] = (n>>0)&255; },
writeASCII : function(buff, p, s) { for(var i = 0; i < s.length; i++) buff[p+i] = s.charCodeAt(i); },
writeDouble: function(buff, p, n)
{
UTIF._binBE.fl64[0] = n;
for (var i = 0; i < 8; i++) buff[p + i] = UTIF._binBE.ui8[7 - i];
}
}
UTIF._binBE.ui8 = new Uint8Array (8);
UTIF._binBE.i16 = new Int16Array (UTIF._binBE.ui8.buffer);
UTIF._binBE.i32 = new Int32Array (UTIF._binBE.ui8.buffer);
UTIF._binBE.ui32 = new Uint32Array (UTIF._binBE.ui8.buffer);
UTIF._binBE.fl32 = new Float32Array(UTIF._binBE.ui8.buffer);
UTIF._binBE.fl64 = new Float64Array(UTIF._binBE.ui8.buffer);
UTIF._binLE =
{
nextZero : UTIF._binBE.nextZero,
readUshort : function(buff, p) { return (buff[p+1]<< 8) | buff[p]; },
readShort : function(buff, p) { var a=UTIF._binBE.ui8; a[0]=buff[p+0]; a[1]=buff[p+1]; return UTIF._binBE. i16[0]; },
readInt : function(buff, p) { var a=UTIF._binBE.ui8; a[0]=buff[p+0]; a[1]=buff[p+1]; a[2]=buff[p+2]; a[3]=buff[p+3]; return UTIF._binBE. i32[0]; },
readUint : function(buff, p) { var a=UTIF._binBE.ui8; a[0]=buff[p+0]; a[1]=buff[p+1]; a[2]=buff[p+2]; a[3]=buff[p+3]; return UTIF._binBE.ui32[0]; },
readASCII : UTIF._binBE.readASCII,
readFloat : function(buff, p) { var a=UTIF._binBE.ui8; for(var i=0;i<4;i++) a[i]=buff[p+ i]; return UTIF._binBE.fl32[0]; },
readDouble : function(buff, p) { var a=UTIF._binBE.ui8; for(var i=0;i<8;i++) a[i]=buff[p+ i]; return UTIF._binBE.fl64[0]; },
writeUshort: function(buff, p, n) { buff[p] = (n)&255; buff[p+1] = (n>>8)&255; },
writeInt : function(buff, p, n) { var a=UTIF._binBE.ui8; UTIF._binBE.i32[0]=n; buff[p+0]=a[0]; buff[p+1]=a[1]; buff[p+2]=a[2]; buff[p+3]=a[3]; },
writeUint : function(buff, p, n) { buff[p] = (n>>>0)&255; buff[p+1] = (n>>>8)&255; buff[p+2] = (n>>>16)&255; buff[p+3] = (n>>>24)&255; },
writeASCII : UTIF._binBE.writeASCII
}
UTIF._copyTile = function(tb, tw, th, b, w, h, xoff, yoff)
{
//log("copyTile", tw, th, w, h, xoff, yoff);
var xlim = Math.min(tw, w-xoff);
var ylim = Math.min(th, h-yoff);
for(var y=0; y<ylim; y++)
{
var tof = (yoff+y)*w+xoff;
var sof = y*tw;
for(var x=0; x<xlim; x++) b[tof+x] = tb[sof+x];
}
}
UTIF.LosslessJpegDecode =function(){var b,O;function l(){return b[O++]}function m(){return b[O++]<<8|b[O++]}function a0(h){var V=l(),I=[0,0,0,255],f=[],G=8;
for(var w=0;w<16;w++)f[w]=l();for(var w=0;w<16;w++){for(var x=0;x<f[w];x++){var T=z(I,0,w+1,1);I[T+3]=l()}}var E=new Uint8Array(1<<G);
h[V]=[new Uint8Array(I),E];for(var w=0;w<1<<G;w++){var s=G,_=w,Y=0,F=0;while(I[Y+3]==255&&s!=0){F=_>>--s&1;
Y=I[Y+F]}E[w]=Y}}function z(h,V,I,f){if(h[V+3]!=255)return 0;if(I==0)return V;for(var w=0;w<2;w++){if(h[V+w]==0){h[V+w]=h.length;
h.push(0,0,f,255)}var x=z(h,h[V+w],I-1,f+1);if(x!=0)return x}return 0}function i(h){var V=h.b,I=h.f;
while(V<25&&h.a<h.d){var f=h.data[h.a++];if(f==255&&!h.c)h.a++;I=I<<8|f;V+=8}if(V<0)throw"e";h.b=V;h.f=I}function H(h,V){if(V.b<h)i(V);
return V.f>>(V.b-=h)&65535>>16-h}function g(h,V){var I=h[0],f=0,w=255,x=0;if(V.b<16)i(V);var T=V.f>>V.b-8&255;
f=h[1][T];w=I[f+3];V.b-=I[f+2];while(w==255){x=V.f>>--V.b&1;f=I[f+x];w=I[f+3]}return w}function P(h,V){if(h<32768>>16-V)h+=-(1<<V)+1;
return h}function a2(h,V){var I=g(h,V);if(I==0)return 0;if(I==16)return-32768;var f=H(I,V);return P(f,I)}function X(h,V,I,f,w,x){var T=0;
for(var G=0;G<x;G++){var s=G*V;for(var _=0;_<V;_+=w){T++;for(var Y=0;Y<w;Y++)h[s+_+Y]=a2(f[Y],I)}if(I.e!=0&&T%I.e==0&&G!=0){var F=I.a,t=I.data;
while(t[F]!=255||!(208<=t[F+1]&&t[F+1]<=215))F--;I.a=F+2;I.f=0;I.b=0}}}function o(h,V){return P(H(h,V),h)}function a1(h,V,I,f,w){var x=b.length-O;
for(var T=0;T<x;T+=4){var G=b[O+T];b[O+T]=b[O+T+3];b[O+T+3]=G;var G=b[O+T+1];b[O+T+1]=b[O+T+2];b[O+T+2]=G}for(var E=0;
E<w;E++){var s=32768,_=32768;for(var Y=0;Y<V;Y+=2){var F=g(f,I),t=g(f,I);if(F!=0)s+=o(F,I);if(t!=0)_+=o(t,I);
h[E*V+Y]=s&65535;h[E*V+Y+1]=_&65535}}}function C(h){b=h;O=0;if(m()!=65496)throw"e";var V=[],I=0,f=0,w=0,x=[],T=[],G=[],E=0,s=0,_=0;
while(!0){var Y=m();if(Y==65535){O--;continue}var F=m();if(Y==65475){f=l();s=m();_=m();E=l();for(var t=0;
t<E;t++){var a=l(),J=l(),r=l();if(r!=0)throw"e";V[a]=[t,J>>4,J&15]}}else if(Y==65476){var a3=O+F-2;while(O<a3)a0(T)}else if(Y==65498){O++;
for(var t=0;t<E;t++){var a5=l(),v=V[a5];G[v[0]]=T[l()>>>4];x[v[0]]=v.slice(1)}I=l();O+=2;break}else if(Y==65501){w=m()}else{O+=F-2}}var a4=f>8?Uint16Array:Uint8Array,$=new a4(s*_*E),M={b:0,f:0,c:I==8,a:O,data:b,d:b.length,e:w};
if(M.c)a1($,_*E,M,G[0],s);else{var c=[],p=0,D=0;for(var t=0;t<E;t++){var N=x[t],S=N[0],K=N[1];if(S>p)p=S;
if(K>D)D=K;c.push(S*K)}if(p!=1||D!=1){if(E!=3||c[1]!=1||c[2]!=1)throw"e";if(p!=2||D!=1&&D!=2)throw"e";
var u=[],Z=0;for(var t=0;t<E;t++){for(var R=0;R<c[t];R++)u.push(G[t]);Z+=c[t]}var B=_/p,e=s/D,d=B*e;
X($,B*Z,M,u,Z,e);j($,I,B,e,Z-2,Z,Z,f);var A=new Uint16Array(d*c[0]);if(p==2&&D==2){for(var t=0;t<d;t++){A[4*t]=$[6*t];
A[4*t+1]=$[6*t+1];A[4*t+2]=$[6*t+2];A[4*t+3]=$[6*t+3]}j(A,I,B*4,e,0,1,1,f);for(var t=0;t<d;t++){$[6*t]=A[4*t];
$[6*t+1]=A[4*t+1];$[6*t+2]=A[4*t+2];$[6*t+3]=A[4*t+3]}}if(p==2&&D==1){for(var t=0;t<d;t++){A[2*t]=$[4*t];
A[2*t+1]=$[4*t+1]}j(A,I,B*2,e,0,1,1,f);for(var t=0;t<d;t++){$[4*t]=A[2*t];$[4*t+1]=A[2*t+1]}}var n=$.slice(0);
for(var K=0;K<s;K++){if(D==2)for(var S=0;S<_;S++){var q=(K*_+S)*E,k=((K>>>1)*B+(S>>>1))*Z,y=(K&1)*2+(S&1);
$[q]=n[k+y];$[q+1]=n[k+4];$[q+2]=n[k+5]}else for(var S=0;S<_;S++){var q=(K*_+S)*E,k=(K*B+(S>>>1))*Z,y=S&1;
$[q]=n[k+y];$[q+1]=n[k+2];$[q+2]=n[k+3]}}}else{X($,_*E,M,G,E,s);if(w==0)j($,I,_,s,0,E,E,f);else{var U=Math.floor(w/_);
for(var K=0;K<s;K+=U){var L=$.slice(K*_*E,(K+U)*_*E);j(L,I,_,U,0,E,E,f);$.set(L,K*_*E)}}}}return $}function j(h,V,I,f,w,x,G,E){var s=I*G;
for(var _=w;_<x;_++)h[_]+=1<<E-1;for(var Y=G;Y<s;Y+=G)for(var _=w;_<x;_++)h[Y+_]+=h[Y+_-G];for(var F=1;
F<f;F++){var t=F*s;for(var _=w;_<x;_++)h[t+_]+=h[t+_-s];for(var Y=G;Y<s;Y+=G){for(var _=w;_<x;_++){var a=t+Y+_,J=a-s,r=h[a-G],Q=0;
if(V==0)Q=0;else if(V==1)Q=r;else if(V==2)Q=h[J];else if(V==3)Q=h[J-G];else if(V==4)Q=r+(h[J]-h[J-G]);
else if(V==5)Q=r+(h[J]-h[J-G]>>>1);else if(V==6)Q=h[J]+(r-h[J-G]>>>1);else if(V==7)Q=r+h[J]>>>1;else throw V;
h[a]+=Q}}}}return C}();
(function(){var G=0,F=1,i=2,b=3,J=4,N=5,E=6,s=7,c=8,T=9,a3=10,f=11,q=12,M=13,m=14,x=15,L=16,$=17,p=18;
function a5(t){var Z=UTIF._binBE.readUshort,u={b:Z(t,0),i:t[2],C:t[3],u:t[4],q:Z(t,5),k:Z(t,7),e:Z(t,9),l:Z(t,11),s:t[13],d:Z(t,14)};
if(u.b!=18771||u.i>1||u.q<6||u.q%6||u.e<768||u.e%24||u.l!=768||u.k<u.l||u.k%u.l||u.k-u.e>=u.l||u.s>16||u.s!=u.k/u.l||u.s!=Math.ceil(u.e/u.l)||u.d!=u.q/6||u.u!=12&&u.u!=14&&u.u!=16||u.C!=16&&u.C!=0){throw"Invalid data"}if(u.i==0){throw"Not implemented. We need this file!"}u.h=u.C==16;
u.m=(u.h?u.l*2/3:u.l>>>1)|0;u.A=u.m+2;u.f=64;u.g=(1<<u.u)-1;u.n=4*u.u;return u}function a7(t,Z){var u=new Array(Z.s),e=4*Z.s,Q=16+e;
if(e&12)Q+=16-(e&12);for(var V=0,O=16;V<Z.s;O+=4){var o=UTIF._binBE.readUint(t,O);u[V]=t.slice(Q,Q+o);u[V].j=0;u[V].a=0;
Q+=o;V++}if(Q!=t.length)throw"Invalid data";return u}function a6(t,Z){for(var u=-Z[4],e=0;u<=Z[4];e++,u++){t[e]=u<=-Z[3]?-4:u<=-Z[2]?-3:u<=-Z[1]?-2:u<-Z[0]?-1:u<=Z[0]?0:u<Z[1]?1:u<Z[2]?2:u<Z[3]?3:4}}function a1(t,Z,u){var e=[Z,3*Z+18,5*Z+67,7*Z+276,u];
t.o=Z;t.w=(e[4]+2*Z)/(2*Z+1)+1|0;t.v=Math.ceil(Math.log2(t.w));t.t=9;a6(t.c,e)}function a2(t){var Z={c:new Int8Array(2<<t.u)};
a1(Z,0,t.g);return Z}function D(t){var Z=[[],[],[]],u=Math.max(2,t.w+32>>>6);for(var e=0;e<3;e++){for(var Q=0;
Q<41;Q++){Z[e][Q]=[u,1]}}return Z}function a4(t){for(var Z=-1,u=0;!u;Z++){u=t[t.j]>>>7-t.a&1;t.a++;t.a&=7;
if(!t.a)t.j++}return Z}function K(t,Z){var u=0,e=8-t.a,Q=t.j,V=t.a;if(Z){if(Z>=e){do{u<<=e;Z-=e;u|=t[t.j]&(1<<e)-1;
t.j++;e=8}while(Z>=8)}if(Z){u<<=Z;e-=Z;u|=t[t.j]>>>e&(1<<Z)-1}t.a=8-e}return u}function a0(t,Z){var u=0;
if(Z<t){while(u<=14&&Z<<++u<t);}return u}function r(t,Z,u,e,Q,V,O,o){if(o==null)o=0;var X=V+1,k=X%2,j=0,I=0,a=0,l,R,w=e[Q],S=e[Q-1],H=e[Q-2][X],g=S[X-1],Y=S[X],P=S[X+1],A=w[X-1],v=w[X+1],y=Math.abs,d,C,n,h;
if(k){d=y(P-Y);C=y(H-Y);n=y(g-Y)}if(k){h=d>n&&C<d?H+g:d<n&&C<n?H+P:P+g;h=h+2*Y>>>2;if(o){w[X]=h;return}l=Z.t*Z.c[t.g+Y-H]+Z.c[t.g+g-Y]}else{h=Y>g&&Y>P||Y<g&&Y<P?v+A+2*Y>>>2:A+v>>>1;
l=Z.t*Z.c[t.g+Y-g]+Z.c[t.g+g-A]}R=y(l);var W=a4(u);if(W<t.n-Z.v-1){var z=a0(O[R][0],O[R][1]);a=K(u,z)+(W<<z)}else{a=K(u,Z.v)+1}a=a&1?-1-(a>>>1):a>>>1;
O[R][0]+=y(a);if(O[R][1]==t.f){O[R][0]>>>=1;O[R][1]>>>=1}O[R][1]++;h=l<0?h-a:h+a;if(t.i){if(h<0)h+=Z.w;
else if(h>t.g)h-=Z.w}w[X]=h>=0?Math.min(h,t.g):0}function U(t,Z,u){var e=t[0].length;for(var Q=Z;Q<=u;
Q++){t[Q][0]=t[Q-1][1];t[Q][e-1]=t[Q-1][e-2]}}function B(t){U(t,s,q);U(t,i,J);U(t,x,$)}function _(t,Z,u,e,Q,V,O,o,X,k,j,I,a){var l=0,R=1,w=Q<M&&Q>J;
while(R<t.m){if(l<t.m){r(t,Z,u,e,Q,l,O[X],t.h&&(w&&k||!w&&(j||(l&I)==a)));r(t,Z,u,e,V,l,O[X],t.h&&(!w&&k||w&&(j||(l&I)==a)));
l+=2}if(l>8){r(t,Z,u,e,Q,R,o[X]);r(t,Z,u,e,V,R,o[X]);R+=2}}B(e)}function a8(t,Z,u,e,Q,V){_(t,Z,u,e,i,s,Q,V,0,0,1,0,8);
_(t,Z,u,e,c,x,Q,V,1,0,1,0,8);_(t,Z,u,e,b,T,Q,V,2,1,0,3,0);_(t,Z,u,e,a3,L,Q,V,0,0,0,3,2);_(t,Z,u,e,J,f,Q,V,1,0,0,3,2);
_(t,Z,u,e,q,$,Q,V,2,1,0,3,0)}function a9(t,Z,u,e,Q,V){var O=V.length,o=t.l;if(Q+1==t.s)o=t.e-Q*t.l;var X=6*t.e*e+Q*t.l;
for(var k=0;k<6;k++){for(var j=0;j<o;j++){var I=V[k%O][j%O],a;if(I==0){a=i+(k>>>1)}else if(I==2){a=x+(k>>>1)}else{a=s+k}var l=t.h?(j*2/3&2147483646|j%3&1)+(j%3>>>1):j>>>1;
Z[X+j]=u[a][l+1]}X+=t.e}}UTIF._decompressRAF=function(t,Z){var u=a5(t),e=a7(t,u),Q=a2(u),V=new Int16Array(u.e*u.q);
if(Z==null){Z=u.h?[[1,1,0,1,1,2],[1,1,2,1,1,0],[2,0,1,0,2,1],[1,1,2,1,1,0],[1,1,0,1,1,2],[0,2,1,2,0,1]]:[[0,1],[3,2]]}var O=[[G,b],[F,J],[N,f],[E,q],[M,L],[m,$]],o=[];
for(var X=0;X<p;X++){o[X]=new Uint16Array(u.A)}for(var k=0;k<u.s;k++){var j=D(Q),I=D(Q);for(var X=0;
X<p;X++){for(var a=0;a<u.A;a++){o[X][a]=0}}for(var l=0;l<u.d;l++){a8(u,Q,e[k],o,j,I);for(var X=0;X<6;
X++){for(var a=0;a<u.A;a++){o[O[X][0]][a]=o[O[X][1]][a]}}a9(u,V,o,l,k,Z);for(var X=i;X<p;X++){if([N,E,M,m].indexOf(X)==-1){for(var a=0;
a<u.A;a++){o[X][a]=0}}}B(o)}}return V}}())
})(UTIF, pako);
})();
/***/ }),
/***/ 5840:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
Object.defineProperty(exports, "v1", ({
enumerable: true,
get: function () {
return _v.default;
}
}));
Object.defineProperty(exports, "v3", ({
enumerable: true,
get: function () {
return _v2.default;
}
}));
Object.defineProperty(exports, "v4", ({
enumerable: true,
get: function () {
return _v3.default;
}
}));
Object.defineProperty(exports, "v5", ({
enumerable: true,
get: function () {
return _v4.default;
}
}));
Object.defineProperty(exports, "NIL", ({
enumerable: true,
get: function () {
return _nil.default;
}
}));
Object.defineProperty(exports, "version", ({
enumerable: true,
get: function () {
return _version.default;
}
}));
Object.defineProperty(exports, "validate", ({
enumerable: true,
get: function () {
return _validate.default;
}
}));
Object.defineProperty(exports, "stringify", ({
enumerable: true,
get: function () {
return _stringify.default;
}
}));
Object.defineProperty(exports, "parse", ({
enumerable: true,
get: function () {
return _parse.default;
}
}));
var _v = _interopRequireDefault(__nccwpck_require__(8628));
var _v2 = _interopRequireDefault(__nccwpck_require__(6409));
var _v3 = _interopRequireDefault(__nccwpck_require__(5122));
var _v4 = _interopRequireDefault(__nccwpck_require__(9120));
var _nil = _interopRequireDefault(__nccwpck_require__(5332));
var _version = _interopRequireDefault(__nccwpck_require__(1595));
var _validate = _interopRequireDefault(__nccwpck_require__(6900));
var _stringify = _interopRequireDefault(__nccwpck_require__(8950));
var _parse = _interopRequireDefault(__nccwpck_require__(2746));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/***/ }),
/***/ 4569:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function md5(bytes) {
if (Array.isArray(bytes)) {
bytes = Buffer.from(bytes);
} else if (typeof bytes === 'string') {
bytes = Buffer.from(bytes, 'utf8');
}
return _crypto.default.createHash('md5').update(bytes).digest();
}
var _default = md5;
exports["default"] = _default;
/***/ }),
/***/ 5332:
/***/ ((__unused_webpack_module, exports) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _default = '00000000-0000-0000-0000-000000000000';
exports["default"] = _default;
/***/ }),
/***/ 2746:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _validate = _interopRequireDefault(__nccwpck_require__(6900));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function parse(uuid) {
if (!(0, _validate.default)(uuid)) {
throw TypeError('Invalid UUID');
}
let v;
const arr = new Uint8Array(16); // Parse ########-....-....-....-............
arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
arr[1] = v >>> 16 & 0xff;
arr[2] = v >>> 8 & 0xff;
arr[3] = v & 0xff; // Parse ........-####-....-....-............
arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
arr[5] = v & 0xff; // Parse ........-....-####-....-............
arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
arr[7] = v & 0xff; // Parse ........-....-....-####-............
arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
arr[9] = v & 0xff; // Parse ........-....-....-....-############
// (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes)
arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;
arr[11] = v / 0x100000000 & 0xff;
arr[12] = v >>> 24 & 0xff;
arr[13] = v >>> 16 & 0xff;
arr[14] = v >>> 8 & 0xff;
arr[15] = v & 0xff;
return arr;
}
var _default = parse;
exports["default"] = _default;
/***/ }),
/***/ 814:
/***/ ((__unused_webpack_module, exports) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
exports["default"] = _default;
/***/ }),
/***/ 807:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = rng;
var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate
let poolPtr = rnds8Pool.length;
function rng() {
if (poolPtr > rnds8Pool.length - 16) {
_crypto.default.randomFillSync(rnds8Pool);
poolPtr = 0;
}
return rnds8Pool.slice(poolPtr, poolPtr += 16);
}
/***/ }),
/***/ 5274:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _crypto = _interopRequireDefault(__nccwpck_require__(6113));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function sha1(bytes) {
if (Array.isArray(bytes)) {
bytes = Buffer.from(bytes);
} else if (typeof bytes === 'string') {
bytes = Buffer.from(bytes, 'utf8');
}
return _crypto.default.createHash('sha1').update(bytes).digest();
}
var _default = sha1;
exports["default"] = _default;
/***/ }),
/***/ 8950:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _validate = _interopRequireDefault(__nccwpck_require__(6900));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Convert array of 16 byte values to UUID string format of the form:
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
*/
const byteToHex = [];
for (let i = 0; i < 256; ++i) {
byteToHex.push((i + 0x100).toString(16).substr(1));
}
function stringify(arr, offset = 0) {
// Note: Be careful editing this code! It's been tuned for performance
// and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
const uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one
// of the following:
// - One or more input array values don't map to a hex octet (leading to
// "undefined" in the uuid)
// - Invalid input values for the RFC `version` or `variant` fields
if (!(0, _validate.default)(uuid)) {
throw TypeError('Stringified UUID is invalid');
}
return uuid;
}
var _default = stringify;
exports["default"] = _default;
/***/ }),
/***/ 8628:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _rng = _interopRequireDefault(__nccwpck_require__(807));
var _stringify = _interopRequireDefault(__nccwpck_require__(8950));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// **`v1()` - Generate time-based UUID**
//
// Inspired by https://github.com/LiosK/UUID.js
// and http://docs.python.org/library/uuid.html
let _nodeId;
let _clockseq; // Previous uuid creation time
let _lastMSecs = 0;
let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details
function v1(options, buf, offset) {
let i = buf && offset || 0;
const b = buf || new Array(16);
options = options || {};
let node = options.node || _nodeId;
let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not
// specified. We do this lazily to minimize issues related to insufficient
// system entropy. See #189
if (node == null || clockseq == null) {
const seedBytes = options.random || (options.rng || _rng.default)();
if (node == null) {
// Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
}
if (clockseq == null) {
// Per 4.2.2, randomize (14 bit) clockseq
clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
}
} // UUID timestamps are 100 nano-second units since the Gregorian epoch,
// (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
// time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
// (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock
// cycle to simulate higher resolution clock
let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)
const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression
if (dt < 0 && options.clockseq === undefined) {
clockseq = clockseq + 1 & 0x3fff;
} // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
// time interval
if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
nsecs = 0;
} // Per 4.2.1.2 Throw error if too many uuids are requested
if (nsecs >= 10000) {
throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
}
_lastMSecs = msecs;
_lastNSecs = nsecs;
_clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
msecs += 12219292800000; // `time_low`
const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
b[i++] = tl >>> 24 & 0xff;
b[i++] = tl >>> 16 & 0xff;
b[i++] = tl >>> 8 & 0xff;
b[i++] = tl & 0xff; // `time_mid`
const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;
b[i++] = tmh >>> 8 & 0xff;
b[i++] = tmh & 0xff; // `time_high_and_version`
b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`
b[i++] = clockseq & 0xff; // `node`
for (let n = 0; n < 6; ++n) {
b[i + n] = node[n];
}
return buf || (0, _stringify.default)(b);
}
var _default = v1;
exports["default"] = _default;
/***/ }),
/***/ 6409:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _v = _interopRequireDefault(__nccwpck_require__(5998));
var _md = _interopRequireDefault(__nccwpck_require__(4569));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const v3 = (0, _v.default)('v3', 0x30, _md.default);
var _default = v3;
exports["default"] = _default;
/***/ }),
/***/ 5998:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = _default;
exports.URL = exports.DNS = void 0;
var _stringify = _interopRequireDefault(__nccwpck_require__(8950));
var _parse = _interopRequireDefault(__nccwpck_require__(2746));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function stringToBytes(str) {
str = unescape(encodeURIComponent(str)); // UTF8 escape
const bytes = [];
for (let i = 0; i < str.length; ++i) {
bytes.push(str.charCodeAt(i));
}
return bytes;
}
const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
exports.DNS = DNS;
const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
exports.URL = URL;
function _default(name, version, hashfunc) {
function generateUUID(value, namespace, buf, offset) {
if (typeof value === 'string') {
value = stringToBytes(value);
}
if (typeof namespace === 'string') {
namespace = (0, _parse.default)(namespace);
}
if (namespace.length !== 16) {
throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
} // Compute hash of namespace and value, Per 4.3
// Future: Use spread syntax when supported on all platforms, e.g. `bytes =
// hashfunc([...namespace, ... value])`
let bytes = new Uint8Array(16 + value.length);
bytes.set(namespace);
bytes.set(value, namespace.length);
bytes = hashfunc(bytes);
bytes[6] = bytes[6] & 0x0f | version;
bytes[8] = bytes[8] & 0x3f | 0x80;
if (buf) {
offset = offset || 0;
for (let i = 0; i < 16; ++i) {
buf[offset + i] = bytes[i];
}
return buf;
}
return (0, _stringify.default)(bytes);
} // Function#name is not settable on some platforms (#270)
try {
generateUUID.name = name; // eslint-disable-next-line no-empty
} catch (err) {} // For CommonJS default export support
generateUUID.DNS = DNS;
generateUUID.URL = URL;
return generateUUID;
}
/***/ }),
/***/ 5122:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _rng = _interopRequireDefault(__nccwpck_require__(807));
var _stringify = _interopRequireDefault(__nccwpck_require__(8950));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function v4(options, buf, offset) {
options = options || {};
const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
rnds[6] = rnds[6] & 0x0f | 0x40;
rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
if (buf) {
offset = offset || 0;
for (let i = 0; i < 16; ++i) {
buf[offset + i] = rnds[i];
}
return buf;
}
return (0, _stringify.default)(rnds);
}
var _default = v4;
exports["default"] = _default;
/***/ }),
/***/ 9120:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _v = _interopRequireDefault(__nccwpck_require__(5998));
var _sha = _interopRequireDefault(__nccwpck_require__(5274));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const v5 = (0, _v.default)('v5', 0x50, _sha.default);
var _default = v5;
exports["default"] = _default;
/***/ }),
/***/ 6900:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _regex = _interopRequireDefault(__nccwpck_require__(814));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function validate(uuid) {
return typeof uuid === 'string' && _regex.default.test(uuid);
}
var _default = validate;
exports["default"] = _default;
/***/ }),
/***/ 1595:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports["default"] = void 0;
var _validate = _interopRequireDefault(__nccwpck_require__(6900));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function version(uuid) {
if (!(0, _validate.default)(uuid)) {
throw TypeError('Invalid UUID');
}
return parseInt(uuid.substr(14, 1), 16);
}
var _default = version;
exports["default"] = _default;
/***/ }),
/***/ 4886:
/***/ ((module) => {
"use strict";
var conversions = {};
module.exports = conversions;
function sign(x) {
return x < 0 ? -1 : 1;
}
function evenRound(x) {
// Round x to the nearest integer, choosing the even integer if it lies halfway between two.
if ((x % 1) === 0.5 && (x & 1) === 0) { // [even number].5; round down (i.e. floor)
return Math.floor(x);
} else {
return Math.round(x);
}
}
function createNumberConversion(bitLength, typeOpts) {
if (!typeOpts.unsigned) {
--bitLength;
}
const lowerBound = typeOpts.unsigned ? 0 : -Math.pow(2, bitLength);
const upperBound = Math.pow(2, bitLength) - 1;
const moduloVal = typeOpts.moduloBitLength ? Math.pow(2, typeOpts.moduloBitLength) : Math.pow(2, bitLength);
const moduloBound = typeOpts.moduloBitLength ? Math.pow(2, typeOpts.moduloBitLength - 1) : Math.pow(2, bitLength - 1);
return function(V, opts) {
if (!opts) opts = {};
let x = +V;
if (opts.enforceRange) {
if (!Number.isFinite(x)) {
throw new TypeError("Argument is not a finite number");
}
x = sign(x) * Math.floor(Math.abs(x));
if (x < lowerBound || x > upperBound) {
throw new TypeError("Argument is not in byte range");
}
return x;
}
if (!isNaN(x) && opts.clamp) {
x = evenRound(x);
if (x < lowerBound) x = lowerBound;
if (x > upperBound) x = upperBound;
return x;
}
if (!Number.isFinite(x) || x === 0) {
return 0;
}
x = sign(x) * Math.floor(Math.abs(x));
x = x % moduloVal;
if (!typeOpts.unsigned && x >= moduloBound) {
return x - moduloVal;
} else if (typeOpts.unsigned) {
if (x < 0) {
x += moduloVal;
} else if (x === -0) { // don't return negative zero
return 0;
}
}
return x;
}
}
conversions["void"] = function () {
return undefined;
};
conversions["boolean"] = function (val) {
return !!val;
};
conversions["byte"] = createNumberConversion(8, { unsigned: false });
conversions["octet"] = createNumberConversion(8, { unsigned: true });
conversions["short"] = createNumberConversion(16, { unsigned: false });
conversions["unsigned short"] = createNumberConversion(16, { unsigned: true });
conversions["long"] = createNumberConversion(32, { unsigned: false });
conversions["unsigned long"] = createNumberConversion(32, { unsigned: true });
conversions["long long"] = createNumberConversion(32, { unsigned: false, moduloBitLength: 64 });
conversions["unsigned long long"] = createNumberConversion(32, { unsigned: true, moduloBitLength: 64 });
conversions["double"] = function (V) {
const x = +V;
if (!Number.isFinite(x)) {
throw new TypeError("Argument is not a finite floating-point value");
}
return x;
};
conversions["unrestricted double"] = function (V) {
const x = +V;
if (isNaN(x)) {
throw new TypeError("Argument is NaN");
}
return x;
};
// not quite valid, but good enough for JS
conversions["float"] = conversions["double"];
conversions["unrestricted float"] = conversions["unrestricted double"];
conversions["DOMString"] = function (V, opts) {
if (!opts) opts = {};
if (opts.treatNullAsEmptyString && V === null) {
return "";
}
return String(V);
};
conversions["ByteString"] = function (V, opts) {
const x = String(V);
let c = undefined;
for (let i = 0; (c = x.codePointAt(i)) !== undefined; ++i) {
if (c > 255) {
throw new TypeError("Argument is not a valid bytestring");
}
}
return x;
};
conversions["USVString"] = function (V) {
const S = String(V);
const n = S.length;
const U = [];
for (let i = 0; i < n; ++i) {
const c = S.charCodeAt(i);
if (c < 0xD800 || c > 0xDFFF) {
U.push(String.fromCodePoint(c));
} else if (0xDC00 <= c && c <= 0xDFFF) {
U.push(String.fromCodePoint(0xFFFD));
} else {
if (i === n - 1) {
U.push(String.fromCodePoint(0xFFFD));
} else {
const d = S.charCodeAt(i + 1);
if (0xDC00 <= d && d <= 0xDFFF) {
const a = c & 0x3FF;
const b = d & 0x3FF;
U.push(String.fromCodePoint((2 << 15) + (2 << 9) * a + b));
++i;
} else {
U.push(String.fromCodePoint(0xFFFD));
}
}
}
}
return U.join('');
};
conversions["Date"] = function (V, opts) {
if (!(V instanceof Date)) {
throw new TypeError("Argument is not a Date object");
}
if (isNaN(V)) {
return undefined;
}
return V;
};
conversions["RegExp"] = function (V, opts) {
if (!(V instanceof RegExp)) {
V = new RegExp(V);
}
return V;
};
/***/ }),
/***/ 7537:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
const usm = __nccwpck_require__(2158);
exports.implementation = class URLImpl {
constructor(constructorArgs) {
const url = constructorArgs[0];
const base = constructorArgs[1];
let parsedBase = null;
if (base !== undefined) {
parsedBase = usm.basicURLParse(base);
if (parsedBase === "failure") {
throw new TypeError("Invalid base URL");
}
}
const parsedURL = usm.basicURLParse(url, { baseURL: parsedBase });
if (parsedURL === "failure") {
throw new TypeError("Invalid URL");
}
this._url = parsedURL;
// TODO: query stuff
}
get href() {
return usm.serializeURL(this._url);
}
set href(v) {
const parsedURL = usm.basicURLParse(v);
if (parsedURL === "failure") {
throw new TypeError("Invalid URL");
}
this._url = parsedURL;
}
get origin() {
return usm.serializeURLOrigin(this._url);
}
get protocol() {
return this._url.scheme + ":";
}
set protocol(v) {
usm.basicURLParse(v + ":", { url: this._url, stateOverride: "scheme start" });
}
get username() {
return this._url.username;
}
set username(v) {
if (usm.cannotHaveAUsernamePasswordPort(this._url)) {
return;
}
usm.setTheUsername(this._url, v);
}
get password() {
return this._url.password;
}
set password(v) {
if (usm.cannotHaveAUsernamePasswordPort(this._url)) {
return;
}
usm.setThePassword(this._url, v);
}
get host() {
const url = this._url;
if (url.host === null) {
return "";
}
if (url.port === null) {
return usm.serializeHost(url.host);
}
return usm.serializeHost(url.host) + ":" + usm.serializeInteger(url.port);
}
set host(v) {
if (this._url.cannotBeABaseURL) {
return;
}
usm.basicURLParse(v, { url: this._url, stateOverride: "host" });
}
get hostname() {
if (this._url.host === null) {
return "";
}
return usm.serializeHost(this._url.host);
}
set hostname(v) {
if (this._url.cannotBeABaseURL) {
return;
}
usm.basicURLParse(v, { url: this._url, stateOverride: "hostname" });
}
get port() {
if (this._url.port === null) {
return "";
}
return usm.serializeInteger(this._url.port);
}
set port(v) {
if (usm.cannotHaveAUsernamePasswordPort(this._url)) {
return;
}
if (v === "") {
this._url.port = null;
} else {
usm.basicURLParse(v, { url: this._url, stateOverride: "port" });
}
}
get pathname() {
if (this._url.cannotBeABaseURL) {
return this._url.path[0];
}
if (this._url.path.length === 0) {
return "";
}
return "/" + this._url.path.join("/");
}
set pathname(v) {
if (this._url.cannotBeABaseURL) {
return;
}
this._url.path = [];
usm.basicURLParse(v, { url: this._url, stateOverride: "path start" });
}
get search() {
if (this._url.query === null || this._url.query === "") {
return "";
}
return "?" + this._url.query;
}
set search(v) {
// TODO: query stuff
const url = this._url;
if (v === "") {
url.query = null;
return;
}
const input = v[0] === "?" ? v.substring(1) : v;
url.query = "";
usm.basicURLParse(input, { url, stateOverride: "query" });
}
get hash() {
if (this._url.fragment === null || this._url.fragment === "") {
return "";
}
return "#" + this._url.fragment;
}
set hash(v) {
if (v === "") {
this._url.fragment = null;
return;
}
const input = v[0] === "#" ? v.substring(1) : v;
this._url.fragment = "";
usm.basicURLParse(input, { url: this._url, stateOverride: "fragment" });
}
toJSON() {
return this.href;
}
};
/***/ }),
/***/ 3394:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
"use strict";
const conversions = __nccwpck_require__(4886);
const utils = __nccwpck_require__(3185);
const Impl = __nccwpck_require__(7537);
const impl = utils.implSymbol;
function URL(url) {
if (!this || this[impl] || !(this instanceof URL)) {
throw new TypeError("Failed to construct 'URL': Please use the 'new' operator, this DOM object constructor cannot be called as a function.");
}
if (arguments.length < 1) {
throw new TypeError("Failed to construct 'URL': 1 argument required, but only " + arguments.length + " present.");
}
const args = [];
for (let i = 0; i < arguments.length && i < 2; ++i) {
args[i] = arguments[i];
}
args[0] = conversions["USVString"](args[0]);
if (args[1] !== undefined) {
args[1] = conversions["USVString"](args[1]);
}
module.exports.setup(this, args);
}
URL.prototype.toJSON = function toJSON() {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
const args = [];
for (let i = 0; i < arguments.length && i < 0; ++i) {
args[i] = arguments[i];
}
return this[impl].toJSON.apply(this[impl], args);
};
Object.defineProperty(URL.prototype, "href", {
get() {
return this[impl].href;
},
set(V) {
V = conversions["USVString"](V);
this[impl].href = V;
},
enumerable: true,
configurable: true
});
URL.prototype.toString = function () {
if (!this || !module.exports.is(this)) {
throw new TypeError("Illegal invocation");
}
return this.href;
};
Object.defineProperty(URL.prototype, "origin", {
get() {
return this[impl].origin;
},
enumerable: true,
configurable: true
});
Object.defineProperty(URL.prototype, "protocol", {
get() {
return this[impl].protocol;
},
set(V) {
V = conversions["USVString"](V);
this[impl].protocol = V;
},
enumerable: true,
configurable: true
});
Object.defineProperty(URL.prototype, "username", {
get() {
return this[impl].username;
},
set(V) {
V = conversions["USVString"](V);
this[impl].username = V;
},
enumerable: true,
configurable: true
});
Object.defineProperty(URL.prototype, "password", {
get() {
return this[impl].password;
},
set(V) {
V = conversions["USVString"](V);
this[impl].password = V;
},
enumerable: true,
configurable: true
});
Object.defineProperty(URL.prototype, "host", {
get() {
return this[impl].host;
},
set(V) {
V = conversions["USVString"](V);
this[impl].host = V;
},
enumerable: true,
configurable: true
});
Object.defineProperty(URL.prototype, "hostname", {
get() {
return this[impl].hostname;
},
set(V) {
V = conversions["USVString"](V);
this[impl].hostname = V;
},
enumerable: true,
configurable: true
});
Object.defineProperty(URL.prototype, "port", {
get() {
return this[impl].port;
},
set(V) {
V = conversions["USVString"](V);
this[impl].port = V;
},
enumerable: true,
configurable: true
});
Object.defineProperty(URL.prototype, "pathname", {
get() {
return this[impl].pathname;
},
set(V) {
V = conversions["USVString"](V);
this[impl].pathname = V;
},
enumerable: true,
configurable: true
});
Object.defineProperty(URL.prototype, "search", {
get() {
return this[impl].search;
},
set(V) {
V = conversions["USVString"](V);
this[impl].search = V;
},
enumerable: true,
configurable: true
});
Object.defineProperty(URL.prototype, "hash", {
get() {
return this[impl].hash;
},
set(V) {
V = conversions["USVString"](V);
this[impl].hash = V;
},
enumerable: true,
configurable: true
});
module.exports = {
is(obj) {
return !!obj && obj[impl] instanceof Impl.implementation;
},
create(constructorArgs, privateData) {
let obj = Object.create(URL.prototype);
this.setup(obj, constructorArgs, privateData);
return obj;
},
setup(obj, constructorArgs, privateData) {
if (!privateData) privateData = {};
privateData.wrapper = obj;
obj[impl] = new Impl.implementation(constructorArgs, privateData);
obj[impl][utils.wrapperSymbol] = obj;
},
interface: URL,
expose: {
Window: { URL: URL },
Worker: { URL: URL }
}
};
/***/ }),
/***/ 8665:
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
"use strict";
exports.URL = __nccwpck_require__(3394)["interface"];
exports.serializeURL = __nccwpck_require__(2158).serializeURL;
exports.serializeURLOrigin = __nccwpck_require__(2158).serializeURLOrigin;
exports.basicURLParse = __nccwpck_require__(2158).basicURLParse;
exports.setTheUsername = __nccwpck_require__(2158).setTheUsername;
exports.setThePassword = __nccwpck_require__(2158).setThePassword;
exports.serializeHost = __nccwpck_require__(2158).serializeHost;
exports.serializeInteger = __nccwpck_require__(2158).serializeInteger;
exports.parseURL = __nccwpck_require__(2158).parseURL;
/***/ }),
/***/ 2158:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
"use strict";
const punycode = __nccwpck_require__(5477);
const tr46 = __nccwpck_require__(4256);
const specialSchemes = {
ftp: 21,
file: null,
gopher: 70,
http: 80,
https: 443,
ws: 80,
wss: 443
};
const failure = Symbol("failure");
function countSymbols(str) {
return punycode.ucs2.decode(str).length;
}
function at(input, idx) {
const c = input[idx];
return isNaN(c) ? undefined : String.fromCodePoint(c);
}
function isASCIIDigit(c) {
return c >= 0x30 && c <= 0x39;
}
function isASCIIAlpha(c) {
return (c >= 0x41 && c <= 0x5A) || (c >= 0x61 && c <= 0x7A);
}
function isASCIIAlphanumeric(c) {
return isASCIIAlpha(c) || isASCIIDigit(c);
}
function isASCIIHex(c) {
return isASCIIDigit(c) || (c >= 0x41 && c <= 0x46) || (c >= 0x61 && c <= 0x66);
}
function isSingleDot(buffer) {
return buffer === "." || buffer.toLowerCase() === "%2e";
}
function isDoubleDot(buffer) {
buffer = buffer.toLowerCase();
return buffer === ".." || buffer === "%2e." || buffer === ".%2e" || buffer === "%2e%2e";
}
function isWindowsDriveLetterCodePoints(cp1, cp2) {
return isASCIIAlpha(cp1) && (cp2 === 58 || cp2 === 124);
}
function isWindowsDriveLetterString(string) {
return string.length === 2 && isASCIIAlpha(string.codePointAt(0)) && (string[1] === ":" || string[1] === "|");
}
function isNormalizedWindowsDriveLetterString(string) {
return string.length === 2 && isASCIIAlpha(string.codePointAt(0)) && string[1] === ":";
}
function containsForbiddenHostCodePoint(string) {
return string.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|%|\/|:|\?|@|\[|\\|\]/) !== -1;
}
function containsForbiddenHostCodePointExcludingPercent(string) {
return string.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|\/|:|\?|@|\[|\\|\]/) !== -1;
}
function isSpecialScheme(scheme) {
return specialSchemes[scheme] !== undefined;
}
function isSpecial(url) {
return isSpecialScheme(url.scheme);
}
function defaultPort(scheme) {
return specialSchemes[scheme];
}
function percentEncode(c) {
let hex = c.toString(16).toUpperCase();
if (hex.length === 1) {
hex = "0" + hex;
}
return "%" + hex;
}
function utf8PercentEncode(c) {
const buf = new Buffer(c);
let str = "";
for (let i = 0; i < buf.length; ++i) {
str += percentEncode(buf[i]);
}
return str;
}
function utf8PercentDecode(str) {
const input = new Buffer(str);
const output = [];
for (let i = 0; i < input.length; ++i) {
if (input[i] !== 37) {
output.push(input[i]);
} else if (input[i] === 37 && isASCIIHex(input[i + 1]) && isASCIIHex(input[i + 2])) {
output.push(parseInt(input.slice(i + 1, i + 3).toString(), 16));
i += 2;
} else {
output.push(input[i]);
}
}
return new Buffer(output).toString();
}
function isC0ControlPercentEncode(c) {
return c <= 0x1F || c > 0x7E;
}
const extraPathPercentEncodeSet = new Set([32, 34, 35, 60, 62, 63, 96, 123, 125]);
function isPathPercentEncode(c) {
return isC0ControlPercentEncode(c) || extraPathPercentEncodeSet.has(c);
}
const extraUserinfoPercentEncodeSet =
new Set([47, 58, 59, 61, 64, 91, 92, 93, 94, 124]);
function isUserinfoPercentEncode(c) {
return isPathPercentEncode(c) || extraUserinfoPercentEncodeSet.has(c);
}
function percentEncodeChar(c, encodeSetPredicate) {
const cStr = String.fromCodePoint(c);
if (encodeSetPredicate(c)) {
return utf8PercentEncode(cStr);
}
return cStr;
}
function parseIPv4Number(input) {
let R = 10;
if (input.length >= 2 && input.charAt(0) === "0" && input.charAt(1).toLowerCase() === "x") {
input = input.substring(2);
R = 16;
} else if (input.length >= 2 && input.charAt(0) === "0") {
input = input.substring(1);
R = 8;
}
if (input === "") {
return 0;
}
const regex = R === 10 ? /[^0-9]/ : (R === 16 ? /[^0-9A-Fa-f]/ : /[^0-7]/);
if (regex.test(input)) {
return failure;
}
return parseInt(input, R);
}
function parseIPv4(input) {
const parts = input.split(".");
if (parts[parts.length - 1] === "") {
if (parts.length > 1) {
parts.pop();
}
}
if (parts.length > 4) {
return input;
}
const numbers = [];
for (const part of parts) {
if (part === "") {
return input;
}
const n = parseIPv4Number(part);
if (n === failure) {
return input;
}
numbers.push(n);
}
for (let i = 0; i < numbers.length - 1; ++i) {
if (numbers[i] > 255) {
return failure;
}
}
if (numbers[numbers.length - 1] >= Math.pow(256, 5 - numbers.length)) {
return failure;
}
let ipv4 = numbers.pop();
let counter = 0;
for (const n of numbers) {
ipv4 += n * Math.pow(256, 3 - counter);
++counter;
}
return ipv4;
}
function serializeIPv4(address) {
let output = "";
let n = address;
for (let i = 1; i <= 4; ++i) {
output = String(n % 256) + output;
if (i !== 4) {
output = "." + output;
}
n = Math.floor(n / 256);
}
return output;
}
function parseIPv6(input) {
const address = [0, 0, 0, 0, 0, 0, 0, 0];
let pieceIndex = 0;
let compress = null;
let pointer = 0;
input = punycode.ucs2.decode(input);
if (input[pointer] === 58) {
if (input[pointer + 1] !== 58) {
return failure;
}
pointer += 2;
++pieceIndex;
compress = pieceIndex;
}
while (pointer < input.length) {
if (pieceIndex === 8) {
return failure;
}
if (input[pointer] === 58) {
if (compress !== null) {
return failure;
}
++pointer;
++pieceIndex;
compress = pieceIndex;
continue;
}
let value = 0;
let length = 0;
while (length < 4 && isASCIIHex(input[pointer])) {
value = value * 0x10 + parseInt(at(input, pointer), 16);
++pointer;
++length;
}
if (input[pointer] === 46) {
if (length === 0) {
return failure;
}
pointer -= length;
if (pieceIndex > 6) {
return failure;
}
let numbersSeen = 0;
while (input[pointer] !== undefined) {
let ipv4Piece = null;
if (numbersSeen > 0) {
if (input[pointer] === 46 && numbersSeen < 4) {
++pointer;
} else {
return failure;
}
}
if (!isASCIIDigit(input[pointer])) {
return failure;
}
while (isASCIIDigit(input[pointer])) {
const number = parseInt(at(input, pointer));
if (ipv4Piece === null) {
ipv4Piece = number;
} else if (ipv4Piece === 0) {
return failure;
} else {
ipv4Piece = ipv4Piece * 10 + number;
}
if (ipv4Piece > 255) {
return failure;
}
++pointer;
}
address[pieceIndex] = address[pieceIndex] * 0x100 + ipv4Piece;
++numbersSeen;
if (numbersSeen === 2 || numbersSeen === 4) {
++pieceIndex;
}
}
if (numbersSeen !== 4) {
return failure;
}
break;
} else if (input[pointer] === 58) {
++pointer;
if (input[pointer] === undefined) {
return failure;
}
} else if (input[pointer] !== undefined) {
return failure;
}
address[pieceIndex] = value;
++pieceIndex;
}
if (compress !== null) {
let swaps = pieceIndex - compress;
pieceIndex = 7;
while (pieceIndex !== 0 && swaps > 0) {
const temp = address[compress + swaps - 1];
address[compress + swaps - 1] = address[pieceIndex];
address[pieceIndex] = temp;
--pieceIndex;
--swaps;
}
} else if (compress === null && pieceIndex !== 8) {
return failure;
}
return address;
}
function serializeIPv6(address) {
let output = "";
const seqResult = findLongestZeroSequence(address);
const compress = seqResult.idx;
let ignore0 = false;
for (let pieceIndex = 0; pieceIndex <= 7; ++pieceIndex) {
if (ignore0 && address[pieceIndex] === 0) {
continue;
} else if (ignore0) {
ignore0 = false;
}
if (compress === pieceIndex) {
const separator = pieceIndex === 0 ? "::" : ":";
output += separator;
ignore0 = true;
continue;
}
output += address[pieceIndex].toString(16);
if (pieceIndex !== 7) {
output += ":";
}
}
return output;
}
function parseHost(input, isSpecialArg) {
if (input[0] === "[") {
if (input[input.length - 1] !== "]") {
return failure;
}
return parseIPv6(input.substring(1, input.length - 1));
}
if (!isSpecialArg) {
return parseOpaqueHost(input);
}
const domain = utf8PercentDecode(input);
const asciiDomain = tr46.toASCII(domain, false, tr46.PROCESSING_OPTIONS.NONTRANSITIONAL, false);
if (asciiDomain === null) {
return failure;
}
if (containsForbiddenHostCodePoint(asciiDomain)) {
return failure;
}
const ipv4Host = parseIPv4(asciiDomain);
if (typeof ipv4Host === "number" || ipv4Host === failure) {
return ipv4Host;
}
return asciiDomain;
}
function parseOpaqueHost(input) {
if (containsForbiddenHostCodePointExcludingPercent(input)) {
return failure;
}
let output = "";
const decoded = punycode.ucs2.decode(input);
for (let i = 0; i < decoded.length; ++i) {
output += percentEncodeChar(decoded[i], isC0ControlPercentEncode);
}
return output;
}
function findLongestZeroSequence(arr) {
let maxIdx = null;
let maxLen = 1; // only find elements > 1
let currStart = null;
let currLen = 0;
for (let i = 0; i < arr.length; ++i) {
if (arr[i] !== 0) {
if (currLen > maxLen) {
maxIdx = currStart;
maxLen = currLen;
}
currStart = null;
currLen = 0;
} else {
if (currStart === null) {
currStart = i;
}
++currLen;
}
}
// if trailing zeros
if (currLen > maxLen) {
maxIdx = currStart;
maxLen = currLen;
}
return {
idx: maxIdx,
len: maxLen
};
}
function serializeHost(host) {
if (typeof host === "number") {
return serializeIPv4(host);
}
// IPv6 serializer
if (host instanceof Array) {
return "[" + serializeIPv6(host) + "]";
}
return host;
}
function trimControlChars(url) {
return url.replace(/^[\u0000-\u001F\u0020]+|[\u0000-\u001F\u0020]+$/g, "");
}
function trimTabAndNewline(url) {
return url.replace(/\u0009|\u000A|\u000D/g, "");
}
function shortenPath(url) {
const path = url.path;
if (path.length === 0) {
return;
}
if (url.scheme === "file" && path.length === 1 && isNormalizedWindowsDriveLetter(path[0])) {
return;
}
path.pop();
}
function includesCredentials(url) {
return url.username !== "" || url.password !== "";
}
function cannotHaveAUsernamePasswordPort(url) {
return url.host === null || url.host === "" || url.cannotBeABaseURL || url.scheme === "file";
}
function isNormalizedWindowsDriveLetter(string) {
return /^[A-Za-z]:$/.test(string);
}
function URLStateMachine(input, base, encodingOverride, url, stateOverride) {
this.pointer = 0;
this.input = input;
this.base = base || null;
this.encodingOverride = encodingOverride || "utf-8";
this.stateOverride = stateOverride;
this.url = url;
this.failure = false;
this.parseError = false;
if (!this.url) {
this.url = {
scheme: "",
username: "",
password: "",
host: null,
port: null,
path: [],
query: null,
fragment: null,
cannotBeABaseURL: false
};
const res = trimControlChars(this.input);
if (res !== this.input) {
this.parseError = true;
}
this.input = res;
}
const res = trimTabAndNewline(this.input);
if (res !== this.input) {
this.parseError = true;
}
this.input = res;
this.state = stateOverride || "scheme start";
this.buffer = "";
this.atFlag = false;
this.arrFlag = false;
this.passwordTokenSeenFlag = false;
this.input = punycode.ucs2.decode(this.input);
for (; this.pointer <= this.input.length; ++this.pointer) {
const c = this.input[this.pointer];
const cStr = isNaN(c) ? undefined : String.fromCodePoint(c);
// exec state machine
const ret = this["parse " + this.state](c, cStr);
if (!ret) {
break; // terminate algorithm
} else if (ret === failure) {
this.failure = true;
break;
}
}
}
URLStateMachine.prototype["parse scheme start"] = function parseSchemeStart(c, cStr) {
if (isASCIIAlpha(c)) {
this.buffer += cStr.toLowerCase();
this.state = "scheme";
} else if (!this.stateOverride) {
this.state = "no scheme";
--this.pointer;
} else {
this.parseError = true;
return failure;
}
return true;
};
URLStateMachine.prototype["parse scheme"] = function parseScheme(c, cStr) {
if (isASCIIAlphanumeric(c) || c === 43 || c === 45 || c === 46) {
this.buffer += cStr.toLowerCase();
} else if (c === 58) {
if (this.stateOverride) {
if (isSpecial(this.url) && !isSpecialScheme(this.buffer)) {
return false;
}
if (!isSpecial(this.url) && isSpecialScheme(this.buffer)) {
return false;
}
if ((includesCredentials(this.url) || this.url.port !== null) && this.buffer === "file") {
return false;
}
if (this.url.scheme === "file" && (this.url.host === "" || this.url.host === null)) {
return false;
}
}
this.url.scheme = this.buffer;
this.buffer = "";
if (this.stateOverride) {
return false;
}
if (this.url.scheme === "file") {
if (this.input[this.pointer + 1] !== 47 || this.input[this.pointer + 2] !== 47) {
this.parseError = true;
}
this.state = "file";
} else if (isSpecial(this.url) && this.base !== null && this.base.scheme === this.url.scheme) {
this.state = "special relative or authority";
} else if (isSpecial(this.url)) {
this.state = "special authority slashes";
} else if (this.input[this.pointer + 1] === 47) {
this.state = "path or authority";
++this.pointer;
} else {
this.url.cannotBeABaseURL = true;
this.url.path.push("");
this.state = "cannot-be-a-base-URL path";
}
} else if (!this.stateOverride) {
this.buffer = "";
this.state = "no scheme";
this.pointer = -1;
} else {
this.parseError = true;
return failure;
}
return true;
};
URLStateMachine.prototype["parse no scheme"] = function parseNoScheme(c) {
if (this.base === null || (this.base.cannotBeABaseURL && c !== 35)) {
return failure;
} else if (this.base.cannotBeABaseURL && c === 35) {
this.url.scheme = this.base.scheme;
this.url.path = this.base.path.slice();
this.url.query = this.base.query;
this.url.fragment = "";
this.url.cannotBeABaseURL = true;
this.state = "fragment";
} else if (this.base.scheme === "file") {
this.state = "file";
--this.pointer;
} else {
this.state = "relative";
--this.pointer;
}
return true;
};
URLStateMachine.prototype["parse special relative or authority"] = function parseSpecialRelativeOrAuthority(c) {
if (c === 47 && this.input[this.pointer + 1] === 47) {
this.state = "special authority ignore slashes";
++this.pointer;
} else {
this.parseError = true;
this.state = "relative";
--this.pointer;
}
return true;
};
URLStateMachine.prototype["parse path or authority"] = function parsePathOrAuthority(c) {
if (c === 47) {
this.state = "authority";
} else {
this.state = "path";
--this.pointer;
}
return true;
};
URLStateMachine.prototype["parse relative"] = function parseRelative(c) {
this.url.scheme = this.base.scheme;
if (isNaN(c)) {
this.url.username = this.base.username;
this.url.password = this.base.password;
this.url.host = this.base.host;
this.url.port = this.base.port;
this.url.path = this.base.path.slice();
this.url.query = this.base.query;
} else if (c === 47) {
this.state = "relative slash";
} else if (c === 63) {
this.url.username = this.base.username;
this.url.password = this.base.password;
this.url.host = this.base.host;
this.url.port = this.base.port;
this.url.path = this.base.path.slice();
this.url.query = "";
this.state = "query";
} else if (c === 35) {
this.url.username = this.base.username;
this.url.password = this.base.password;
this.url.host = this.base.host;
this.url.port = this.base.port;
this.url.path = this.base.path.slice();
this.url.query = this.base.query;
this.url.fragment = "";
this.state = "fragment";
} else if (isSpecial(this.url) && c === 92) {
this.parseError = true;
this.state = "relative slash";
} else {
this.url.username = this.base.username;
this.url.password = this.base.password;
this.url.host = this.base.host;
this.url.port = this.base.port;
this.url.path = this.base.path.slice(0, this.base.path.length - 1);
this.state = "path";
--this.pointer;
}
return true;
};
URLStateMachine.prototype["parse relative slash"] = function parseRelativeSlash(c) {
if (isSpecial(this.url) && (c === 47 || c === 92)) {
if (c === 92) {
this.parseError = true;
}
this.state = "special authority ignore slashes";
} else if (c === 47) {
this.state = "authority";
} else {
this.url.username = this.base.username;
this.url.password = this.base.password;
this.url.host = this.base.host;
this.url.port = this.base.port;
this.state = "path";
--this.pointer;
}
return true;
};
URLStateMachine.prototype["parse special authority slashes"] = function parseSpecialAuthoritySlashes(c) {
if (c === 47 && this.input[this.pointer + 1] === 47) {
this.state = "special authority ignore slashes";
++this.pointer;
} else {
this.parseError = true;
this.state = "special authority ignore slashes";
--this.pointer;
}
return true;
};
URLStateMachine.prototype["parse special authority ignore slashes"] = function parseSpecialAuthorityIgnoreSlashes(c) {
if (c !== 47 && c !== 92) {
this.state = "authority";
--this.pointer;
} else {
this.parseError = true;
}
return true;
};
URLStateMachine.prototype["parse authority"] = function parseAuthority(c, cStr) {
if (c === 64) {
this.parseError = true;
if (this.atFlag) {
this.buffer = "%40" + this.buffer;
}
this.atFlag = true;
// careful, this is based on buffer and has its own pointer (this.pointer != pointer) and inner chars
const len = countSymbols(this.buffer);
for (let pointer = 0; pointer < len; ++pointer) {
const codePoint = this.buffer.codePointAt(pointer);
if (codePoint === 58 && !this.passwordTokenSeenFlag) {
this.passwordTokenSeenFlag = true;
continue;
}
const encodedCodePoints = percentEncodeChar(codePoint, isUserinfoPercentEncode);
if (this.passwordTokenSeenFlag) {
this.url.password += encodedCodePoints;
} else {
this.url.username += encodedCodePoints;
}
}
this.buffer = "";
} else if (isNaN(c) || c === 47 || c === 63 || c === 35 ||
(isSpecial(this.url) && c === 92)) {
if (this.atFlag && this.buffer === "") {
this.parseError = true;
return failure;
}
this.pointer -= countSymbols(this.buffer) + 1;
this.buffer = "";
this.state = "host";
} else {
this.buffer += cStr;
}
return true;
};
URLStateMachine.prototype["parse hostname"] =
URLStateMachine.prototype["parse host"] = function parseHostName(c, cStr) {
if (this.stateOverride && this.url.scheme === "file") {
--this.pointer;
this.state = "file host";
} else if (c === 58 && !this.arrFlag) {
if (this.buffer === "") {
this.parseError = true;
return failure;
}
const host = parseHost(this.buffer, isSpecial(this.url));
if (host === failure) {
return failure;
}
this.url.host = host;
this.buffer = "";
this.state = "port";
if (this.stateOverride === "hostname") {
return false;
}
} else if (isNaN(c) || c === 47 || c === 63 || c === 35 ||
(isSpecial(this.url) && c === 92)) {
--this.pointer;
if (isSpecial(this.url) && this.buffer === "") {
this.parseError = true;
return failure;
} else if (this.stateOverride && this.buffer === "" &&
(includesCredentials(this.url) || this.url.port !== null)) {
this.parseError = true;
return false;
}
const host = parseHost(this.buffer, isSpecial(this.url));
if (host === failure) {
return failure;
}
this.url.host = host;
this.buffer = "";
this.state = "path start";
if (this.stateOverride) {
return false;
}
} else {
if (c === 91) {
this.arrFlag = true;
} else if (c === 93) {
this.arrFlag = false;
}
this.buffer += cStr;
}
return true;
};
URLStateMachine.prototype["parse port"] = function parsePort(c, cStr) {
if (isASCIIDigit(c)) {
this.buffer += cStr;
} else if (isNaN(c) || c === 47 || c === 63 || c === 35 ||
(isSpecial(this.url) && c === 92) ||
this.stateOverride) {
if (this.buffer !== "") {
const port = parseInt(this.buffer);
if (port > Math.pow(2, 16) - 1) {
this.parseError = true;
return failure;
}
this.url.port = port === defaultPort(this.url.scheme) ? null : port;
this.buffer = "";
}
if (this.stateOverride) {
return false;
}
this.state = "path start";
--this.pointer;
} else {
this.parseError = true;
return failure;
}
return true;
};
const fileOtherwiseCodePoints = new Set([47, 92, 63, 35]);
URLStateMachine.prototype["parse file"] = function parseFile(c) {
this.url.scheme = "file";
if (c === 47 || c === 92) {
if (c === 92) {
this.parseError = true;
}
this.state = "file slash";
} else if (this.base !== null && this.base.scheme === "file") {
if (isNaN(c)) {
this.url.host = this.base.host;
this.url.path = this.base.path.slice();
this.url.query = this.base.query;
} else if (c === 63) {
this.url.host = this.base.host;
this.url.path = this.base.path.slice();
this.url.query = "";
this.state = "query";
} else if (c === 35) {
this.url.host = this.base.host;
this.url.path = this.base.path.slice();
this.url.query = this.base.query;
this.url.fragment = "";
this.state = "fragment";
} else {
if (this.input.length - this.pointer - 1 === 0 || // remaining consists of 0 code points
!isWindowsDriveLetterCodePoints(c, this.input[this.pointer + 1]) ||
(this.input.length - this.pointer - 1 >= 2 && // remaining has at least 2 code points
!fileOtherwiseCodePoints.has(this.input[this.pointer + 2]))) {
this.url.host = this.base.host;
this.url.path = this.base.path.slice();
shortenPath(this.url);
} else {
this.parseError = true;
}
this.state = "path";
--this.pointer;
}
} else {
this.state = "path";
--this.pointer;
}
return true;
};
URLStateMachine.prototype["parse file slash"] = function parseFileSlash(c) {
if (c === 47 || c === 92) {
if (c === 92) {
this.parseError = true;
}
this.state = "file host";
} else {
if (this.base !== null && this.base.scheme === "file") {
if (isNormalizedWindowsDriveLetterString(this.base.path[0])) {
this.url.path.push(this.base.path[0]);
} else {
this.url.host = this.base.host;
}
}
this.state = "path";
--this.pointer;
}
return true;
};
URLStateMachine.prototype["parse file host"] = function parseFileHost(c, cStr) {
if (isNaN(c) || c === 47 || c === 92 || c === 63 || c === 35) {
--this.pointer;
if (!this.stateOverride && isWindowsDriveLetterString(this.buffer)) {
this.parseError = true;
this.state = "path";
} else if (this.buffer === "") {
this.url.host = "";
if (this.stateOverride) {
return false;
}
this.state = "path start";
} else {
let host = parseHost(this.buffer, isSpecial(this.url));
if (host === failure) {
return failure;
}
if (host === "localhost") {
host = "";
}
this.url.host = host;
if (this.stateOverride) {
return false;
}
this.buffer = "";
this.state = "path start";
}
} else {
this.buffer += cStr;
}
return true;
};
URLStateMachine.prototype["parse path start"] = function parsePathStart(c) {
if (isSpecial(this.url)) {
if (c === 92) {
this.parseError = true;
}
this.state = "path";
if (c !== 47 && c !== 92) {
--this.pointer;
}
} else if (!this.stateOverride && c === 63) {
this.url.query = "";
this.state = "query";
} else if (!this.stateOverride && c === 35) {
this.url.fragment = "";
this.state = "fragment";
} else if (c !== undefined) {
this.state = "path";
if (c !== 47) {
--this.pointer;
}
}
return true;
};
URLStateMachine.prototype["parse path"] = function parsePath(c) {
if (isNaN(c) || c === 47 || (isSpecial(this.url) && c === 92) ||
(!this.stateOverride && (c === 63 || c === 35))) {
if (isSpecial(this.url) && c === 92) {
this.parseError = true;
}
if (isDoubleDot(this.buffer)) {
shortenPath(this.url);
if (c !== 47 && !(isSpecial(this.url) && c === 92)) {
this.url.path.push("");
}
} else if (isSingleDot(this.buffer) && c !== 47 &&
!(isSpecial(this.url) && c === 92)) {
this.url.path.push("");
} else if (!isSingleDot(this.buffer)) {
if (this.url.scheme === "file" && this.url.path.length === 0 && isWindowsDriveLetterString(this.buffer)) {
if (this.url.host !== "" && this.url.host !== null) {
this.parseError = true;
this.url.host = "";
}
this.buffer = this.buffer[0] + ":";
}
this.url.path.push(this.buffer);
}
this.buffer = "";
if (this.url.scheme === "file" && (c === undefined || c === 63 || c === 35)) {
while (this.url.path.length > 1 && this.url.path[0] === "") {
this.parseError = true;
this.url.path.shift();
}
}
if (c === 63) {
this.url.query = "";
this.state = "query";
}
if (c === 35) {
this.url.fragment = "";
this.state = "fragment";
}
} else {
// TODO: If c is not a URL code point and not "%", parse error.
if (c === 37 &&
(!isASCIIHex(this.input[this.pointer + 1]) ||
!isASCIIHex(this.input[this.pointer + 2]))) {
this.parseError = true;
}
this.buffer += percentEncodeChar(c, isPathPercentEncode);
}
return true;
};
URLStateMachine.prototype["parse cannot-be-a-base-URL path"] = function parseCannotBeABaseURLPath(c) {
if (c === 63) {
this.url.query = "";
this.state = "query";
} else if (c === 35) {
this.url.fragment = "";
this.state = "fragment";
} else {
// TODO: Add: not a URL code point
if (!isNaN(c) && c !== 37) {
this.parseError = true;
}
if (c === 37 &&
(!isASCIIHex(this.input[this.pointer + 1]) ||
!isASCIIHex(this.input[this.pointer + 2]))) {
this.parseError = true;
}
if (!isNaN(c)) {
this.url.path[0] = this.url.path[0] + percentEncodeChar(c, isC0ControlPercentEncode);
}
}
return true;
};
URLStateMachine.prototype["parse query"] = function parseQuery(c, cStr) {
if (isNaN(c) || (!this.stateOverride && c === 35)) {
if (!isSpecial(this.url) || this.url.scheme === "ws" || this.url.scheme === "wss") {
this.encodingOverride = "utf-8";
}
const buffer = new Buffer(this.buffer); // TODO: Use encoding override instead
for (let i = 0; i < buffer.length; ++i) {
if (buffer[i] < 0x21 || buffer[i] > 0x7E || buffer[i] === 0x22 || buffer[i] === 0x23 ||
buffer[i] === 0x3C || buffer[i] === 0x3E) {
this.url.query += percentEncode(buffer[i]);
} else {
this.url.query += String.fromCodePoint(buffer[i]);
}
}
this.buffer = "";
if (c === 35) {
this.url.fragment = "";
this.state = "fragment";
}
} else {
// TODO: If c is not a URL code point and not "%", parse error.
if (c === 37 &&
(!isASCIIHex(this.input[this.pointer + 1]) ||
!isASCIIHex(this.input[this.pointer + 2]))) {
this.parseError = true;
}
this.buffer += cStr;
}
return true;
};
URLStateMachine.prototype["parse fragment"] = function parseFragment(c) {
if (isNaN(c)) { // do nothing
} else if (c === 0x0) {
this.parseError = true;
} else {
// TODO: If c is not a URL code point and not "%", parse error.
if (c === 37 &&
(!isASCIIHex(this.input[this.pointer + 1]) ||
!isASCIIHex(this.input[this.pointer + 2]))) {
this.parseError = true;
}
this.url.fragment += percentEncodeChar(c, isC0ControlPercentEncode);
}
return true;
};
function serializeURL(url, excludeFragment) {
let output = url.scheme + ":";
if (url.host !== null) {
output += "//";
if (url.username !== "" || url.password !== "") {
output += url.username;
if (url.password !== "") {
output += ":" + url.password;
}
output += "@";
}
output += serializeHost(url.host);
if (url.port !== null) {
output += ":" + url.port;
}
} else if (url.host === null && url.scheme === "file") {
output += "//";
}
if (url.cannotBeABaseURL) {
output += url.path[0];
} else {
for (const string of url.path) {
output += "/" + string;
}
}
if (url.query !== null) {
output += "?" + url.query;
}
if (!excludeFragment && url.fragment !== null) {
output += "#" + url.fragment;
}
return output;
}
function serializeOrigin(tuple) {
let result = tuple.scheme + "://";
result += serializeHost(tuple.host);
if (tuple.port !== null) {
result += ":" + tuple.port;
}
return result;
}
module.exports.serializeURL = serializeURL;
module.exports.serializeURLOrigin = function (url) {
// https://url.spec.whatwg.org/#concept-url-origin
switch (url.scheme) {
case "blob":
try {
return module.exports.serializeURLOrigin(module.exports.parseURL(url.path[0]));
} catch (e) {
// serializing an opaque origin returns "null"
return "null";
}
case "ftp":
case "gopher":
case "http":
case "https":
case "ws":
case "wss":
return serializeOrigin({
scheme: url.scheme,
host: url.host,
port: url.port
});
case "file":
// spec says "exercise to the reader", chrome says "file://"
return "file://";
default:
// serializing an opaque origin returns "null"
return "null";
}
};
module.exports.basicURLParse = function (input, options) {
if (options === undefined) {
options = {};
}
const usm = new URLStateMachine(input, options.baseURL, options.encodingOverride, options.url, options.stateOverride);
if (usm.failure) {
return "failure";
}
return usm.url;
};
module.exports.setTheUsername = function (url, username) {
url.username = "";
const decoded = punycode.ucs2.decode(username);
for (let i = 0; i < decoded.length; ++i) {
url.username += percentEncodeChar(decoded[i], isUserinfoPercentEncode);
}
};
module.exports.setThePassword = function (url, password) {
url.password = "";
const decoded = punycode.ucs2.decode(password);
for (let i = 0; i < decoded.length; ++i) {
url.password += percentEncodeChar(decoded[i], isUserinfoPercentEncode);
}
};
module.exports.serializeHost = serializeHost;
module.exports.cannotHaveAUsernamePasswordPort = cannotHaveAUsernamePasswordPort;
module.exports.serializeInteger = function (integer) {
return String(integer);
};
module.exports.parseURL = function (input, options) {
if (options === undefined) {
options = {};
}
// We don't handle blobs, so this just delegates:
return module.exports.basicURLParse(input, { baseURL: options.baseURL, encodingOverride: options.encodingOverride });
};
/***/ }),
/***/ 3185:
/***/ ((module) => {
"use strict";
module.exports.mixin = function mixin(target, source) {
const keys = Object.getOwnPropertyNames(source);
for (let i = 0; i < keys.length; ++i) {
Object.defineProperty(target, keys[i], Object.getOwnPropertyDescriptor(source, keys[i]));
}
};
module.exports.wrapperSymbol = Symbol("wrapper");
module.exports.implSymbol = Symbol("impl");
module.exports.wrapperForImpl = function (impl) {
return impl[module.exports.wrapperSymbol];
};
module.exports.implForWrapper = function (wrapper) {
return wrapper[module.exports.implSymbol];
};
/***/ }),
/***/ 2624:
/***/ (function(__unused_webpack_module, exports) {
// Generated by CoffeeScript 1.12.7
(function() {
"use strict";
exports.stripBOM = function(str) {
if (str[0] === '\uFEFF') {
return str.substring(1);
} else {
return str;
}
};
}).call(this);
/***/ }),
/***/ 3337:
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
// Generated by CoffeeScript 1.12.7
(function() {
"use strict";
var builder, defaults, escapeCDATA, requiresCDATA, wrapCDATA,
hasProp = {}.hasOwnProperty;
builder = __nccwpck_require__(2958);
defaults = (__nccwpck_require__(7251).defaults);
requiresCDATA = function(entry) {
return typeof entry === "string" && (entry.indexOf('&') >= 0 || entry.indexOf('>') >= 0 || entry.indexOf('<') >= 0);
};
wrapCDATA = function(entry) {
return "<![CDATA[" + (escapeCDATA(entry)) + "]]>";
};
escapeCDATA = function(entry) {
return entry.replace(']]>', ']]]]><![CDATA[>');
};
exports.Builder = (function() {
function Builder(opts) {
var key, ref, value;
this.options = {};
ref = defaults["0.2"];
for (key in ref) {
if (!hasProp.call(ref, key)) continue;
value = ref[key];
this.options[key] = value;
}
for (key in opts) {
if (!hasProp.call(opts, key)) continue;
value = opts[key];
this.options[key] = value;
}
}
Builder.prototype.buildObject = function(rootObj) {
var attrkey, charkey, render, rootElement, rootName;
attrkey = this.options.attrkey;
charkey = this.options.charkey;
if ((Object.keys(rootObj).length === 1) && (this.options.rootName === defaults['0.2'].rootName)) {
rootName = Object.keys(rootObj)[0];
rootObj = rootObj[rootName];
} else {
rootName = this.options.rootName;
}
render = (function(_this) {
return function(element, obj) {
var attr, child, entry, index, key, value;
if (typeof obj !== 'object') {
if (_this.options.cdata && requiresCDATA(obj)) {
element.raw(wrapCDATA(obj));
} else {
element.txt(obj);
}
} else if (Array.isArray(obj)) {
for (index in obj) {
if (!hasProp.call(obj, index)) continue;
child = obj[index];
for (key in child) {
entry = child[key];
element = render(element.ele(key), entry).up();
}
}
} else {
for (key in obj) {
if (!hasProp.call(obj, key)) continue;
child = obj[key];
if (key === attrkey) {
if (typeof child === "object") {
for (attr in child) {
value = child[attr];
element = element.att(attr, value);
}
}
} else if (key === charkey) {
if (_this.options.cdata && requiresCDATA(child)) {
element = element.raw(wrapCDATA(child));
} else {
element = element.txt(child);
}
} else if (Array.isArray(child)) {
for (index in child) {
if (!hasProp.call(child, index)) continue;
entry = child[index];
if (typeof entry === 'string') {
if (_this.options.cdata && requiresCDATA(entry)) {
element = element.ele(key).raw(wrapCDATA(entry)).up();
} else {
element = element.ele(key, entry).up();
}
} else {
element = render(element.ele(key), entry).up();
}
}
} else if (typeof child === "object") {
element = render(element.ele(key), child).up();
} else {
if (typeof child === 'string' && _this.options.cdata && requiresCDATA(child)) {
element = element.ele(key).raw(wrapCDATA(child)).up();
} else {
if (child == null) {
child = '';
}
element = element.ele(key, child.toString()).up();
}
}
}
}
return element;
};
})(this);
rootElement = builder.create(rootName, this.options.xmldec, this.options.doctype, {
headless: this.options.headless,
allowSurrogateChars: this.options.allowSurrogateChars
});
return render(rootElement, rootObj).end(this.options.renderOpts);
};
return Builder;
})();
}).call(this);
/***/ }),
/***/ 7251:
/***/ (function(__unused_webpack_module, exports) {
// Generated by CoffeeScript 1.12.7
(function() {
exports.defaults = {
"0.1": {
explicitCharkey: false,
trim: true,
normalize: true,
normalizeTags: false,
attrkey: "@",
charkey: "#",
explicitArray: false,
ignoreAttrs: false,
mergeAttrs: false,
explicitRoot: false,
validator: null,
xmlns: false,
explicitChildren: false,
childkey: '@@',
charsAsChildren: false,
includeWhiteChars: false,
async: false,
strict: true,
attrNameProcessors: null,
attrValueProcessors: null,
tagNameProcessors: null,
valueProcessors: null,
emptyTag: ''
},
"0.2": {
explicitCharkey: false,
trim: false,
normalize: false,
normalizeTags: false,
attrkey: "$",
charkey: "_",
explicitArray: true,
ignoreAttrs: false,
mergeAttrs: false,
explicitRoot: true,
validator: null,
xmlns: false,
explicitChildren: false,
preserveChildrenOrder: false,
childkey: '$$',
charsAsChildren: false,
includeWhiteChars: false,
async: false,
strict: true,
attrNameProcessors: null,
attrValueProcessors: null,
tagNameProcessors: null,
valueProcessors: null,
rootName: 'root',
xmldec: {
'version': '1.0',
'encoding': 'UTF-8',
'standalone': true
},
doctype: null,
renderOpts: {
'pretty': true,
'indent': ' ',
'newline': '\n'
},
headless: false,
chunkSize: 10000,
emptyTag: '',
cdata: false
}
};
}).call(this);
/***/ }),
/***/ 3314:
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
// Generated by CoffeeScript 1.12.7
(function() {
"use strict";
var bom, defaults, events, isEmpty, processItem, processors, sax, setImmediate,
bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
sax = __nccwpck_require__(2043);
events = __nccwpck_require__(2361);
bom = __nccwpck_require__(2624);
processors = __nccwpck_require__(9236);
setImmediate = (__nccwpck_require__(9512).setImmediate);
defaults = (__nccwpck_require__(7251).defaults);
isEmpty = function(thing) {
return typeof thing === "object" && (thing != null) && Object.keys(thing).length === 0;
};
processItem = function(processors, item, key) {
var i, len, process;
for (i = 0, len = processors.length; i < len; i++) {
process = processors[i];
item = process(item, key);
}
return item;
};
exports.Parser = (function(superClass) {
extend(Parser, superClass);
function Parser(opts) {
this.parseStringPromise = bind(this.parseStringPromise, this);
this.parseString = bind(this.parseString, this);
this.reset = bind(this.reset, this);
this.assignOrPush = bind(this.assignOrPush, this);
this.processAsync = bind(this.processAsync, this);
var key, ref, value;
if (!(this instanceof exports.Parser)) {
return new exports.Parser(opts);
}
this.options = {};
ref = defaults["0.2"];
for (key in ref) {
if (!hasProp.call(ref, key)) continue;
value = ref[key];
this.options[key] = value;
}
for (key in opts) {
if (!hasProp.call(opts, key)) continue;
value = opts[key];
this.options[key] = value;
}
if (this.options.xmlns) {
this.options.xmlnskey = this.options.attrkey + "ns";
}
if (this.options.normalizeTags) {
if (!this.options.tagNameProcessors) {
this.options.tagNameProcessors = [];
}
this.options.tagNameProcessors.unshift(processors.normalize);
}
this.reset();
}
Parser.prototype.processAsync = function() {
var chunk, err;
try {
if (this.remaining.length <= this.options.chunkSize) {
chunk = this.remaining;
this.remaining = '';
this.saxParser = this.saxParser.write(chunk);
return this.saxParser.close();
} else {
chunk = this.remaining.substr(0, this.options.chunkSize);
this.remaining = this.remaining.substr(this.options.chunkSize, this.remaining.length);
this.saxParser = this.saxParser.write(chunk);
return setImmediate(this.processAsync);
}
} catch (error1) {
err = error1;
if (!this.saxParser.errThrown) {
this.saxParser.errThrown = true;
return this.emit(err);
}
}
};
Parser.prototype.assignOrPush = function(obj, key, newValue) {
if (!(key in obj)) {
if (!this.options.explicitArray) {
return obj[key] = newValue;
} else {
return obj[key] = [newValue];
}
} else {
if (!(obj[key] instanceof Array)) {
obj[key] = [obj[key]];
}
return obj[key].push(newValue);
}
};
Parser.prototype.reset = function() {
var attrkey, charkey, ontext, stack;
this.removeAllListeners();
this.saxParser = sax.parser(this.options.strict, {
trim: false,
normalize: false,
xmlns: this.options.xmlns
});
this.saxParser.errThrown = false;
this.saxParser.onerror = (function(_this) {
return function(error) {
_this.saxParser.resume();
if (!_this.saxParser.errThrown) {
_this.saxParser.errThrown = true;
return _this.emit("error", error);
}
};
})(this);
this.saxParser.onend = (function(_this) {
return function() {
if (!_this.saxParser.ended) {
_this.saxParser.ended = true;
return _this.emit("end", _this.resultObject);
}
};
})(this);
this.saxParser.ended = false;
this.EXPLICIT_CHARKEY = this.options.explicitCharkey;
this.resultObject = null;
stack = [];
attrkey = this.options.attrkey;
charkey = this.options.charkey;
this.saxParser.onopentag = (function(_this) {
return function(node) {
var key, newValue, obj, processedKey, ref;
obj = {};
obj[charkey] = "";
if (!_this.options.ignoreAttrs) {
ref = node.attributes;
for (key in ref) {
if (!hasProp.call(ref, key)) continue;
if (!(attrkey in obj) && !_this.options.mergeAttrs) {
obj[attrkey] = {};
}
newValue = _this.options.attrValueProcessors ? processItem(_this.options.attrValueProcessors, node.attributes[key], key) : node.attributes[key];
processedKey = _this.options.attrNameProcessors ? processItem(_this.options.attrNameProcessors, key) : key;
if (_this.options.mergeAttrs) {
_this.assignOrPush(obj, processedKey, newValue);
} else {
obj[attrkey][processedKey] = newValue;
}
}
}
obj["#name"] = _this.options.tagNameProcessors ? processItem(_this.options.tagNameProcessors, node.name) : node.name;
if (_this.options.xmlns) {
obj[_this.options.xmlnskey] = {
uri: node.uri,
local: node.local
};
}
return stack.push(obj);
};
})(this);
this.saxParser.onclosetag = (function(_this) {
return function() {
var cdata, emptyStr, key, node, nodeName, obj, objClone, old, s, xpath;
obj = stack.pop();
nodeName = obj["#name"];
if (!_this.options.explicitChildren || !_this.options.preserveChildrenOrder) {
delete obj["#name"];
}
if (obj.cdata === true) {
cdata = obj.cdata;
delete obj.cdata;
}
s = stack[stack.length - 1];
if (obj[charkey].match(/^\s*$/) && !cdata) {
emptyStr = obj[charkey];
delete obj[charkey];
} else {
if (_this.options.trim) {
obj[charkey] = obj[charkey].trim();
}
if (_this.options.normalize) {
obj[charkey] = obj[charkey].replace(/\s{2,}/g, " ").trim();
}
obj[charkey] = _this.options.valueProcessors ? processItem(_this.options.valueProcessors, obj[charkey], nodeName) : obj[charkey];
if (Object.keys(obj).length === 1 && charkey in obj && !_this.EXPLICIT_CHARKEY) {
obj = obj[charkey];
}
}
if (isEmpty(obj)) {
obj = _this.options.emptyTag !== '' ? _this.options.emptyTag : emptyStr;
}
if (_this.options.validator != null) {
xpath = "/" + ((function() {
var i, len, results;
results = [];
for (i = 0, len = stack.length; i < len; i++) {
node = stack[i];
results.push(node["#name"]);
}
return results;
})()).concat(nodeName).join("/");
(function() {
var err;
try {
return obj = _this.options.validator(xpath, s && s[nodeName], obj);
} catch (error1) {
err = error1;
return _this.emit("error", err);
}
})();
}
if (_this.options.explicitChildren && !_this.options.mergeAttrs && typeof obj === 'object') {
if (!_this.options.preserveChildrenOrder) {
node = {};
if (_this.options.attrkey in obj) {
node[_this.options.attrkey] = obj[_this.options.attrkey];
delete obj[_this.options.attrkey];
}
if (!_this.options.charsAsChildren && _this.options.charkey in obj) {
node[_this.options.charkey] = obj[_this.options.charkey];
delete obj[_this.options.charkey];
}
if (Object.getOwnPropertyNames(obj).length > 0) {
node[_this.options.childkey] = obj;
}
obj = node;
} else if (s) {
s[_this.options.childkey] = s[_this.options.childkey] || [];
objClone = {};
for (key in obj) {
if (!hasProp.call(obj, key)) continue;
objClone[key] = obj[key];
}
s[_this.options.childkey].push(objClone);
delete obj["#name"];
if (Object.keys(obj).length === 1 && charkey in obj && !_this.EXPLICIT_CHARKEY) {
obj = obj[charkey];
}
}
}
if (stack.length > 0) {
return _this.assignOrPush(s, nodeName, obj);
} else {
if (_this.options.explicitRoot) {
old = obj;
obj = {};
obj[nodeName] = old;
}
_this.resultObject = obj;
_this.saxParser.ended = true;
return _this.emit("end", _this.resultObject);
}
};
})(this);
ontext = (function(_this) {
return function(text) {
var charChild, s;
s = stack[stack.length - 1];
if (s) {
s[charkey] += text;
if (_this.options.explicitChildren && _this.options.preserveChildrenOrder && _this.options.charsAsChildren && (_this.options.includeWhiteChars || text.replace(/\\n/g, '').trim() !== '')) {
s[_this.options.childkey] = s[_this.options.childkey] || [];
charChild = {
'#name': '__text__'
};
charChild[charkey] = text;
if (_this.options.normalize) {
charChild[charkey] = charChild[charkey].replace(/\s{2,}/g, " ").trim();
}
s[_this.options.childkey].push(charChild);
}
return s;
}
};
})(this);
this.saxParser.ontext = ontext;
return this.saxParser.oncdata = (function(_this) {
return function(text) {
var s;
s = ontext(text);
if (s) {
return s.cdata = true;
}
};
})(this);
};
Parser.prototype.parseString = function(str, cb) {
var err;
if ((cb != null) && typeof cb === "function") {
this.on("end", function(result) {
this.reset();
return cb(null, result);
});
this.on("error", function(err) {
this.reset();
return cb(err);
});
}
try {
str = str.toString();
if (str.trim() === '') {
this.emit("end", null);
return true;
}
str = bom.stripBOM(str);
if (this.options.async) {
this.remaining = str;
setImmediate(this.processAsync);
return this.saxParser;
}
return this.saxParser.write(str).close();
} catch (error1) {
err = error1;
if (!(this.saxParser.errThrown || this.saxParser.ended)) {
this.emit('error', err);
return this.saxParser.errThrown = true;
} else if (this.saxParser.ended) {
throw err;
}
}
};
Parser.prototype.parseStringPromise = function(str) {
return new Promise((function(_this) {
return function(resolve, reject) {
return _this.parseString(str, function(err, value) {
if (err) {
return reject(err);
} else {
return resolve(value);
}
});
};
})(this));
};
return Parser;
})(events);
exports.parseString = function(str, a, b) {
var cb, options, parser;
if (b != null) {
if (typeof b === 'function') {
cb = b;
}
if (typeof a === 'object') {
options = a;
}
} else {
if (typeof a === 'function') {
cb = a;
}
options = {};
}
parser = new exports.Parser(options);
return parser.parseString(str, cb);
};
exports.parseStringPromise = function(str, a) {
var options, parser;
if (typeof a === 'object') {
options = a;
}
parser = new exports.Parser(options);
return parser.parseStringPromise(str);
};
}).call(this);
/***/ }),
/***/ 9236:
/***/ (function(__unused_webpack_module, exports) {
// Generated by CoffeeScript 1.12.7
(function() {
"use strict";
var prefixMatch;
prefixMatch = new RegExp(/(?!xmlns)^.*:/);
exports.normalize = function(str) {
return str.toLowerCase();
};
exports.firstCharLowerCase = function(str) {
return str.charAt(0).toLowerCase() + str.slice(1);
};
exports.stripPrefix = function(str) {
return str.replace(prefixMatch, '');
};
exports.parseNumbers = function(str) {
if (!isNaN(str)) {
str = str % 1 === 0 ? parseInt(str, 10) : parseFloat(str);
}
return str;
};
exports.parseBooleans = function(str) {
if (/^(?:true|false)$/i.test(str)) {
str = str.toLowerCase() === 'true';
}
return str;
};
}).call(this);
/***/ }),
/***/ 6189:
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
// Generated by CoffeeScript 1.12.7
(function() {
"use strict";
var builder, defaults, parser, processors,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
defaults = __nccwpck_require__(7251);
builder = __nccwpck_require__(3337);
parser = __nccwpck_require__(3314);
processors = __nccwpck_require__(9236);
exports.defaults = defaults.defaults;
exports.processors = processors;
exports.ValidationError = (function(superClass) {
extend(ValidationError, superClass);
function ValidationError(message) {
this.message = message;
}
return ValidationError;
})(Error);
exports.Builder = builder.Builder;
exports.Parser = parser.Parser;
exports.parseString = parser.parseString;
exports.parseStringPromise = parser.parseStringPromise;
}).call(this);
/***/ }),
/***/ 2839:
/***/ (function(module) {
// Generated by CoffeeScript 1.12.7
(function() {
module.exports = {
Disconnected: 1,
Preceding: 2,
Following: 4,
Contains: 8,
ContainedBy: 16,
ImplementationSpecific: 32
};
}).call(this);
/***/ }),
/***/ 9267:
/***/ (function(module) {
// Generated by CoffeeScript 1.12.7
(function() {
module.exports = {
Element: 1,
Attribute: 2,
Text: 3,
CData: 4,
EntityReference: 5,
EntityDeclaration: 6,
ProcessingInstruction: 7,
Comment: 8,
Document: 9,
DocType: 10,
DocumentFragment: 11,
NotationDeclaration: 12,
Declaration: 201,
Raw: 202,
AttributeDeclaration: 203,
ElementDeclaration: 204,
Dummy: 205
};
}).call(this);
/***/ }),
/***/ 8229:
/***/ (function(module) {
// Generated by CoffeeScript 1.12.7
(function() {
var assign, getValue, isArray, isEmpty, isFunction, isObject, isPlainObject,
slice = [].slice,
hasProp = {}.hasOwnProperty;
assign = function() {
var i, key, len, source, sources, target;
target = arguments[0], sources = 2 <= arguments.length ? slice.call(arguments, 1) : [];
if (isFunction(Object.assign)) {
Object.assign.apply(null, arguments);
} else {
for (i = 0, len = sources.length; i < len; i++) {
source = sources[i];
if (source != null) {
for (key in source) {
if (!hasProp.call(source, key)) continue;
target[key] = source[key];
}
}
}
}
return target;
};
isFunction = function(val) {
return !!val && Object.prototype.toString.call(val) === '[object Function]';
};
isObject = function(val) {
var ref;
return !!val && ((ref = typeof val) === 'function' || ref === 'object');
};
isArray = function(val) {
if (isFunction(Array.isArray)) {
return Array.isArray(val);
} else {
return Object.prototype.toString.call(val) === '[object Array]';
}
};
isEmpty = function(val) {
var key;
if (isArray(val)) {
return !val.length;
} else {
for (key in val) {
if (!hasProp.call(val, key)) continue;
return false;
}
return true;
}
};
isPlainObject = function(val) {
var ctor, proto;
return isObject(val) && (proto = Object.getPrototypeOf(val)) && (ctor = proto.constructor) && (typeof ctor === 'function') && (ctor instanceof ctor) && (Function.prototype.toString.call(ctor) === Function.prototype.toString.call(Object));
};
getValue = function(obj) {
if (isFunction(obj.valueOf)) {
return obj.valueOf();
} else {
return obj;
}
};
module.exports.assign = assign;
module.exports.isFunction = isFunction;
module.exports.isObject = isObject;
module.exports.isArray = isArray;
module.exports.isEmpty = isEmpty;
module.exports.isPlainObject = isPlainObject;
module.exports.getValue = getValue;
}).call(this);
/***/ }),
/***/ 9766:
/***/ (function(module) {
// Generated by CoffeeScript 1.12.7
(function() {
module.exports = {
None: 0,
OpenTag: 1,
InsideTag: 2,
CloseTag: 3
};
}).call(this);
/***/ }),
/***/ 8376:
/***/ (function(module, __unused_webpack_exports, __nccwpck_require__) {
// Generated by CoffeeScript 1.12.7
(function() {
var NodeType, XMLAttribute, XMLNode;
NodeType = __nccwpck_require__(9267);
XMLNode = __nccwpck_require__(7608);
module.exports = XMLAttribute = (function() {
function XMLAttribute(parent, name, value) {
this.parent = parent;
if (this.parent) {
this.options = this.parent.options;
this.stringify = this.parent.stringify;
}
if (name == null) {
throw new Error("Missing attribute name. " + this.debugInfo(name));
}
this.name = this.stringify.name(name);
this.value = this.stringify.attValue(value);
this.type = NodeType.Attribute;
this.isId = false;
this.schemaTypeInfo = null;
}
Object.defineProperty(XMLAttribute.prototype, 'nodeType', {
get: function() {
return this.type;
}
});
Object.defineProperty(XMLAttribute.prototype, 'ownerElement', {
get: function() {
return this.parent;
}
});
Object.defineProperty(XMLAttribute.prototype, 'textContent', {
get: function() {
return this.value;
},
set: function(value) {
return this.value = value || '';
}
});
Object.defineProperty(XMLAttribute.prototype, 'namespaceURI', {
get: function() {
return '';
}
});
Object.defineProperty(XMLAttribute.prototype, 'prefix', {
get: function() {
return '';
}
});
Object.defineProperty(XMLAttribute.prototype, 'localName', {
get: function() {
return this.name;
}
});
Object.defineProperty(XMLAttribute.prototype, 'specified', {
get: function() {
return true;
}
});
XMLAttribute.prototype.clone = function() {
return Object.create(this);
};
XMLAttribute.prototype.toString = function(options) {
return this.options.writer.attribute(this, this.options.writer.filterOptions(options));
};
XMLAttribute.prototype.debugInfo = function(name) {
name = name || this.name;
if (name == null) {
return "parent: <" + this.parent.name + ">";
} else {
return "attribute: {" + name + "}, parent: <" + this.parent.name + ">";
}
};
XMLAttribute.prototype.isEqualNode = function(node) {
if (node.namespaceURI !== this.namespaceURI) {
return false;
}
if (node.prefix !== this.prefix) {
return false;
}
if (node.localName !== this.localName) {
return false;
}
if (node.value !== this.value) {
return false;
}
return true;
};
return XMLAttribute;
})();
}).call(this);
/***/ }),
/***/ 333:
/***/ (function(module, __unused_webpack_exports, __nccwpck_require__) {
// Generated by CoffeeScript 1.12.7
(function() {
var NodeType, XMLCData, XMLCharacterData,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
NodeType = __nccwpck_require__(9267);
XMLCharacterData = __nccwpck_require__(7709);
module.exports = XMLCData = (function(superClass) {
extend(XMLCData, superClass);
function XMLCData(parent, text) {
XMLCData.__super__.constructor.call(this, parent);
if (text == null) {
throw new Error("Missing CDATA text. " + this.debugInfo());
}
this.name = "#cdata-section";
this.type = NodeType.CData;
this.value = this.stringify.cdata(text);
}
XMLCData.prototype.clone = function() {
return Object.create(this);
};
XMLCData.prototype.toString = function(options) {
return this.options.writer.cdata(this, this.options.writer.filterOptions(options));
};
return XMLCData;
})(XMLCharacterData);
}).call(this);
/***/ }),
/***/ 7709:
/***/ (function(module, __unused_webpack_exports, __nccwpck_require__) {
// Generated by CoffeeScript 1.12.7
(function() {
var XMLCharacterData, XMLNode,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
XMLNode = __nccwpck_require__(7608);
module.exports = XMLCharacterData = (function(superClass) {
extend(XMLCharacterData, superClass);
function XMLCharacterData(parent) {
XMLCharacterData.__super__.constructor.call(this, parent);
this.value = '';
}
Object.defineProperty(XMLCharacterData.prototype, 'data', {
get: function() {
return this.value;
},
set: function(value) {
return this.value = value || '';
}
});
Object.defineProperty(XMLCharacterData.prototype, 'length', {
get: function() {
return this.value.length;
}
});
Object.defineProperty(XMLCharacterData.prototype, 'textContent', {
get: function() {
return this.value;
},
set: function(value) {
return this.value = value || '';
}
});
XMLCharacterData.prototype.clone = function() {
return Object.create(this);
};
XMLCharacterData.prototype.substringData = function(offset, count) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLCharacterData.prototype.appendData = function(arg) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLCharacterData.prototype.insertData = function(offset, arg) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLCharacterData.prototype.deleteData = function(offset, count) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLCharacterData.prototype.replaceData = function(offset, count, arg) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLCharacterData.prototype.isEqualNode = function(node) {
if (!XMLCharacterData.__super__.isEqualNode.apply(this, arguments).isEqualNode(node)) {
return false;
}
if (node.data !== this.data) {
return false;
}
return true;
};
return XMLCharacterData;
})(XMLNode);
}).call(this);
/***/ }),
/***/ 4407:
/***/ (function(module, __unused_webpack_exports, __nccwpck_require__) {
// Generated by CoffeeScript 1.12.7
(function() {
var NodeType, XMLCharacterData, XMLComment,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
NodeType = __nccwpck_require__(9267);
XMLCharacterData = __nccwpck_require__(7709);
module.exports = XMLComment = (function(superClass) {
extend(XMLComment, superClass);
function XMLComment(parent, text) {
XMLComment.__super__.constructor.call(this, parent);
if (text == null) {
throw new Error("Missing comment text. " + this.debugInfo());
}
this.name = "#comment";
this.type = NodeType.Comment;
this.value = this.stringify.comment(text);
}
XMLComment.prototype.clone = function() {
return Object.create(this);
};
XMLComment.prototype.toString = function(options) {
return this.options.writer.comment(this, this.options.writer.filterOptions(options));
};
return XMLComment;
})(XMLCharacterData);
}).call(this);
/***/ }),
/***/ 7465:
/***/ (function(module, __unused_webpack_exports, __nccwpck_require__) {
// Generated by CoffeeScript 1.12.7
(function() {
var XMLDOMConfiguration, XMLDOMErrorHandler, XMLDOMStringList;
XMLDOMErrorHandler = __nccwpck_require__(6744);
XMLDOMStringList = __nccwpck_require__(7028);
module.exports = XMLDOMConfiguration = (function() {
function XMLDOMConfiguration() {
var clonedSelf;
this.defaultParams = {
"canonical-form": false,
"cdata-sections": false,
"comments": false,
"datatype-normalization": false,
"element-content-whitespace": true,
"entities": true,
"error-handler": new XMLDOMErrorHandler(),
"infoset": true,
"validate-if-schema": false,
"namespaces": true,
"namespace-declarations": true,
"normalize-characters": false,
"schema-location": '',
"schema-type": '',
"split-cdata-sections": true,
"validate": false,
"well-formed": true
};
this.params = clonedSelf = Object.create(this.defaultParams);
}
Object.defineProperty(XMLDOMConfiguration.prototype, 'parameterNames', {
get: function() {
return new XMLDOMStringList(Object.keys(this.defaultParams));
}
});
XMLDOMConfiguration.prototype.getParameter = function(name) {
if (this.params.hasOwnProperty(name)) {
return this.params[name];
} else {
return null;
}
};
XMLDOMConfiguration.prototype.canSetParameter = function(name, value) {
return true;
};
XMLDOMConfiguration.prototype.setParameter = function(name, value) {
if (value != null) {
return this.params[name] = value;
} else {
return delete this.params[name];
}
};
return XMLDOMConfiguration;
})();
}).call(this);
/***/ }),
/***/ 6744:
/***/ (function(module) {
// Generated by CoffeeScript 1.12.7
(function() {
var XMLDOMErrorHandler;
module.exports = XMLDOMErrorHandler = (function() {
function XMLDOMErrorHandler() {}
XMLDOMErrorHandler.prototype.handleError = function(error) {
throw new Error(error);
};
return XMLDOMErrorHandler;
})();
}).call(this);
/***/ }),
/***/ 8310:
/***/ (function(module) {
// Generated by CoffeeScript 1.12.7
(function() {
var XMLDOMImplementation;
module.exports = XMLDOMImplementation = (function() {
function XMLDOMImplementation() {}
XMLDOMImplementation.prototype.hasFeature = function(feature, version) {
return true;
};
XMLDOMImplementation.prototype.createDocumentType = function(qualifiedName, publicId, systemId) {
throw new Error("This DOM method is not implemented.");
};
XMLDOMImplementation.prototype.createDocument = function(namespaceURI, qualifiedName, doctype) {
throw new Error("This DOM method is not implemented.");
};
XMLDOMImplementation.prototype.createHTMLDocument = function(title) {
throw new Error("This DOM method is not implemented.");
};
XMLDOMImplementation.prototype.getFeature = function(feature, version) {
throw new Error("This DOM method is not implemented.");
};
return XMLDOMImplementation;
})();
}).call(this);
/***/ }),
/***/ 7028:
/***/ (function(module) {
// Generated by CoffeeScript 1.12.7
(function() {
var XMLDOMStringList;
module.exports = XMLDOMStringList = (function() {
function XMLDOMStringList(arr) {
this.arr = arr || [];
}
Object.defineProperty(XMLDOMStringList.prototype, 'length', {
get: function() {
return this.arr.length;
}
});
XMLDOMStringList.prototype.item = function(index) {
return this.arr[index] || null;
};
XMLDOMStringList.prototype.contains = function(str) {
return this.arr.indexOf(str) !== -1;
};
return XMLDOMStringList;
})();
}).call(this);
/***/ }),
/***/ 1015:
/***/ (function(module, __unused_webpack_exports, __nccwpck_require__) {
// Generated by CoffeeScript 1.12.7
(function() {
var NodeType, XMLDTDAttList, XMLNode,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
XMLNode = __nccwpck_require__(7608);
NodeType = __nccwpck_require__(9267);
module.exports = XMLDTDAttList = (function(superClass) {
extend(XMLDTDAttList, superClass);
function XMLDTDAttList(parent, elementName, attributeName, attributeType, defaultValueType, defaultValue) {
XMLDTDAttList.__super__.constructor.call(this, parent);
if (elementName == null) {
throw new Error("Missing DTD element name. " + this.debugInfo());
}
if (attributeName == null) {
throw new Error("Missing DTD attribute name. " + this.debugInfo(elementName));
}
if (!attributeType) {
throw new Error("Missing DTD attribute type. " + this.debugInfo(elementName));
}
if (!defaultValueType) {
throw new Error("Missing DTD attribute default. " + this.debugInfo(elementName));
}
if (defaultValueType.indexOf('#') !== 0) {
defaultValueType = '#' + defaultValueType;
}
if (!defaultValueType.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/)) {
throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. " + this.debugInfo(elementName));
}
if (defaultValue && !defaultValueType.match(/^(#FIXED|#DEFAULT)$/)) {
throw new Error("Default value only applies to #FIXED or #DEFAULT. " + this.debugInfo(elementName));
}
this.elementName = this.stringify.name(elementName);
this.type = NodeType.AttributeDeclaration;
this.attributeName = this.stringify.name(attributeName);
this.attributeType = this.stringify.dtdAttType(attributeType);
if (defaultValue) {
this.defaultValue = this.stringify.dtdAttDefault(defaultValue);
}
this.defaultValueType = defaultValueType;
}
XMLDTDAttList.prototype.toString = function(options) {
return this.options.writer.dtdAttList(this, this.options.writer.filterOptions(options));
};
return XMLDTDAttList;
})(XMLNode);
}).call(this);
/***/ }),
/***/ 2421:
/***/ (function(module, __unused_webpack_exports, __nccwpck_require__) {
// Generated by CoffeeScript 1.12.7
(function() {
var NodeType, XMLDTDElement, XMLNode,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
XMLNode = __nccwpck_require__(7608);
NodeType = __nccwpck_require__(9267);
module.exports = XMLDTDElement = (function(superClass) {
extend(XMLDTDElement, superClass);
function XMLDTDElement(parent, name, value) {
XMLDTDElement.__super__.constructor.call(this, parent);
if (name == null) {
throw new Error("Missing DTD element name. " + this.debugInfo());
}
if (!value) {
value = '(#PCDATA)';
}
if (Array.isArray(value)) {
value = '(' + value.join(',') + ')';
}
this.name = this.stringify.name(name);
this.type = NodeType.ElementDeclaration;
this.value = this.stringify.dtdElementValue(value);
}
XMLDTDElement.prototype.toString = function(options) {
return this.options.writer.dtdElement(this, this.options.writer.filterOptions(options));
};
return XMLDTDElement;
})(XMLNode);
}).call(this);
/***/ }),
/***/ 53:
/***/ (function(module, __unused_webpack_exports, __nccwpck_require__) {
// Generated by CoffeeScript 1.12.7
(function() {
var NodeType, XMLDTDEntity, XMLNode, isObject,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
isObject = (__nccwpck_require__(8229).isObject);
XMLNode = __nccwpck_require__(7608);
NodeType = __nccwpck_require__(9267);
module.exports = XMLDTDEntity = (function(superClass) {
extend(XMLDTDEntity, superClass);
function XMLDTDEntity(parent, pe, name, value) {
XMLDTDEntity.__super__.constructor.call(this, parent);
if (name == null) {
throw new Error("Missing DTD entity name. " + this.debugInfo(name));
}
if (value == null) {
throw new Error("Missing DTD entity value. " + this.debugInfo(name));
}
this.pe = !!pe;
this.name = this.stringify.name(name);
this.type = NodeType.EntityDeclaration;
if (!isObject(value)) {
this.value = this.stringify.dtdEntityValue(value);
this.internal = true;
} else {
if (!value.pubID && !value.sysID) {
throw new Error("Public and/or system identifiers are required for an external entity. " + this.debugInfo(name));
}
if (value.pubID && !value.sysID) {
throw new Error("System identifier is required for a public external entity. " + this.debugInfo(name));
}
this.internal = false;
if (value.pubID != null) {
this.pubID = this.stringify.dtdPubID(value.pubID);
}
if (value.sysID != null) {
this.sysID = this.stringify.dtdSysID(value.sysID);
}
if (value.nData != null) {
this.nData = this.stringify.dtdNData(value.nData);
}
if (this.pe && this.nData) {
throw new Error("Notation declaration is not allowed in a parameter entity. " + this.debugInfo(name));
}
}
}
Object.defineProperty(XMLDTDEntity.prototype, 'publicId', {
get: function() {
return this.pubID;
}
});
Object.defineProperty(XMLDTDEntity.prototype, 'systemId', {
get: function() {
return this.sysID;
}
});
Object.defineProperty(XMLDTDEntity.prototype, 'notationName', {
get: function() {
return this.nData || null;
}
});
Object.defineProperty(XMLDTDEntity.prototype, 'inputEncoding', {
get: function() {
return null;
}
});
Object.defineProperty(XMLDTDEntity.prototype, 'xmlEncoding', {
get: function() {
return null;
}
});
Object.defineProperty(XMLDTDEntity.prototype, 'xmlVersion', {
get: function() {
return null;
}
});
XMLDTDEntity.prototype.toString = function(options) {
return this.options.writer.dtdEntity(this, this.options.writer.filterOptions(options));
};
return XMLDTDEntity;
})(XMLNode);
}).call(this);
/***/ }),
/***/ 2837:
/***/ (function(module, __unused_webpack_exports, __nccwpck_require__) {
// Generated by CoffeeScript 1.12.7
(function() {
var NodeType, XMLDTDNotation, XMLNode,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
XMLNode = __nccwpck_require__(7608);
NodeType = __nccwpck_require__(9267);
module.exports = XMLDTDNotation = (function(superClass) {
extend(XMLDTDNotation, superClass);
function XMLDTDNotation(parent, name, value) {
XMLDTDNotation.__super__.constructor.call(this, parent);
if (name == null) {
throw new Error("Missing DTD notation name. " + this.debugInfo(name));
}
if (!value.pubID && !value.sysID) {
throw new Error("Public or system identifiers are required for an external entity. " + this.debugInfo(name));
}
this.name = this.stringify.name(name);
this.type = NodeType.NotationDeclaration;
if (value.pubID != null) {
this.pubID = this.stringify.dtdPubID(value.pubID);
}
if (value.sysID != null) {
this.sysID = this.stringify.dtdSysID(value.sysID);
}
}
Object.defineProperty(XMLDTDNotation.prototype, 'publicId', {
get: function() {
return this.pubID;
}
});
Object.defineProperty(XMLDTDNotation.prototype, 'systemId', {
get: function() {
return this.sysID;
}
});
XMLDTDNotation.prototype.toString = function(options) {
return this.options.writer.dtdNotation(this, this.options.writer.filterOptions(options));
};
return XMLDTDNotation;
})(XMLNode);
}).call(this);
/***/ }),
/***/ 6364:
/***/ (function(module, __unused_webpack_exports, __nccwpck_require__) {
// Generated by CoffeeScript 1.12.7
(function() {
var NodeType, XMLDeclaration, XMLNode, isObject,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
isObject = (__nccwpck_require__(8229).isObject);
XMLNode = __nccwpck_require__(7608);
NodeType = __nccwpck_require__(9267);
module.exports = XMLDeclaration = (function(superClass) {
extend(XMLDeclaration, superClass);
function XMLDeclaration(parent, version, encoding, standalone) {
var ref;
XMLDeclaration.__super__.constructor.call(this, parent);
if (isObject(version)) {
ref = version, version = ref.version, encoding = ref.encoding, standalone = ref.standalone;
}
if (!version) {
version = '1.0';
}
this.type = NodeType.Declaration;
this.version = this.stringify.xmlVersion(version);
if (encoding != null) {
this.encoding = this.stringify.xmlEncoding(encoding);
}
if (standalone != null) {
this.standalone = this.stringify.xmlStandalone(standalone);
}
}
XMLDeclaration.prototype.toString = function(options) {
return this.options.writer.declaration(this, this.options.writer.filterOptions(options));
};
return XMLDeclaration;
})(XMLNode);
}).call(this);
/***/ }),
/***/ 1801:
/***/ (function(module, __unused_webpack_exports, __nccwpck_require__) {
// Generated by CoffeeScript 1.12.7
(function() {
var NodeType, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDocType, XMLNamedNodeMap, XMLNode, isObject,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
isObject = (__nccwpck_require__(8229).isObject);
XMLNode = __nccwpck_require__(7608);
NodeType = __nccwpck_require__(9267);
XMLDTDAttList = __nccwpck_require__(1015);
XMLDTDEntity = __nccwpck_require__(53);
XMLDTDElement = __nccwpck_require__(2421);
XMLDTDNotation = __nccwpck_require__(2837);
XMLNamedNodeMap = __nccwpck_require__(4361);
module.exports = XMLDocType = (function(superClass) {
extend(XMLDocType, superClass);
function XMLDocType(parent, pubID, sysID) {
var child, i, len, ref, ref1, ref2;
XMLDocType.__super__.constructor.call(this, parent);
this.type = NodeType.DocType;
if (parent.children) {
ref = parent.children;
for (i = 0, len = ref.length; i < len; i++) {
child = ref[i];
if (child.type === NodeType.Element) {
this.name = child.name;
break;
}
}
}
this.documentObject = parent;
if (isObject(pubID)) {
ref1 = pubID, pubID = ref1.pubID, sysID = ref1.sysID;
}
if (sysID == null) {
ref2 = [pubID, sysID], sysID = ref2[0], pubID = ref2[1];
}
if (pubID != null) {
this.pubID = this.stringify.dtdPubID(pubID);
}
if (sysID != null) {
this.sysID = this.stringify.dtdSysID(sysID);
}
}
Object.defineProperty(XMLDocType.prototype, 'entities', {
get: function() {
var child, i, len, nodes, ref;
nodes = {};
ref = this.children;
for (i = 0, len = ref.length; i < len; i++) {
child = ref[i];
if ((child.type === NodeType.EntityDeclaration) && !child.pe) {
nodes[child.name] = child;
}
}
return new XMLNamedNodeMap(nodes);
}
});
Object.defineProperty(XMLDocType.prototype, 'notations', {
get: function() {
var child, i, len, nodes, ref;
nodes = {};
ref = this.children;
for (i = 0, len = ref.length; i < len; i++) {
child = ref[i];
if (child.type === NodeType.NotationDeclaration) {
nodes[child.name] = child;
}
}
return new XMLNamedNodeMap(nodes);
}
});
Object.defineProperty(XMLDocType.prototype, 'publicId', {
get: function() {
return this.pubID;
}
});
Object.defineProperty(XMLDocType.prototype, 'systemId', {
get: function() {
return this.sysID;
}
});
Object.defineProperty(XMLDocType.prototype, 'internalSubset', {
get: function() {
throw new Error("This DOM method is not implemented." + this.debugInfo());
}
});
XMLDocType.prototype.element = function(name, value) {
var child;
child = new XMLDTDElement(this, name, value);
this.children.push(child);
return this;
};
XMLDocType.prototype.attList = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) {
var child;
child = new XMLDTDAttList(this, elementName, attributeName, attributeType, defaultValueType, defaultValue);
this.children.push(child);
return this;
};
XMLDocType.prototype.entity = function(name, value) {
var child;
child = new XMLDTDEntity(this, false, name, value);
this.children.push(child);
return this;
};
XMLDocType.prototype.pEntity = function(name, value) {
var child;
child = new XMLDTDEntity(this, true, name, value);
this.children.push(child);
return this;
};
XMLDocType.prototype.notation = function(name, value) {
var child;
child = new XMLDTDNotation(this, name, value);
this.children.push(child);
return this;
};
XMLDocType.prototype.toString = function(options) {
return this.options.writer.docType(this, this.options.writer.filterOptions(options));
};
XMLDocType.prototype.ele = function(name, value) {
return this.element(name, value);
};
XMLDocType.prototype.att = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) {
return this.attList(elementName, attributeName, attributeType, defaultValueType, defaultValue);
};
XMLDocType.prototype.ent = function(name, value) {
return this.entity(name, value);
};
XMLDocType.prototype.pent = function(name, value) {
return this.pEntity(name, value);
};
XMLDocType.prototype.not = function(name, value) {
return this.notation(name, value);
};
XMLDocType.prototype.up = function() {
return this.root() || this.documentObject;
};
XMLDocType.prototype.isEqualNode = function(node) {
if (!XMLDocType.__super__.isEqualNode.apply(this, arguments).isEqualNode(node)) {
return false;
}
if (node.name !== this.name) {
return false;
}
if (node.publicId !== this.publicId) {
return false;
}
if (node.systemId !== this.systemId) {
return false;
}
return true;
};
return XMLDocType;
})(XMLNode);
}).call(this);
/***/ }),
/***/ 3730:
/***/ (function(module, __unused_webpack_exports, __nccwpck_require__) {
// Generated by CoffeeScript 1.12.7
(function() {
var NodeType, XMLDOMConfiguration, XMLDOMImplementation, XMLDocument, XMLNode, XMLStringWriter, XMLStringifier, isPlainObject,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
isPlainObject = (__nccwpck_require__(8229).isPlainObject);
XMLDOMImplementation = __nccwpck_require__(8310);
XMLDOMConfiguration = __nccwpck_require__(7465);
XMLNode = __nccwpck_require__(7608);
NodeType = __nccwpck_require__(9267);
XMLStringifier = __nccwpck_require__(8594);
XMLStringWriter = __nccwpck_require__(5913);
module.exports = XMLDocument = (function(superClass) {
extend(XMLDocument, superClass);
function XMLDocument(options) {
XMLDocument.__super__.constructor.call(this, null);
this.name = "#document";
this.type = NodeType.Document;
this.documentURI = null;
this.domConfig = new XMLDOMConfiguration();
options || (options = {});
if (!options.writer) {
options.writer = new XMLStringWriter();
}
this.options = options;
this.stringify = new XMLStringifier(options);
}
Object.defineProperty(XMLDocument.prototype, 'implementation', {
value: new XMLDOMImplementation()
});
Object.defineProperty(XMLDocument.prototype, 'doctype', {
get: function() {
var child, i, len, ref;
ref = this.children;
for (i = 0, len = ref.length; i < len; i++) {
child = ref[i];
if (child.type === NodeType.DocType) {
return child;
}
}
return null;
}
});
Object.defineProperty(XMLDocument.prototype, 'documentElement', {
get: function() {
return this.rootObject || null;
}
});
Object.defineProperty(XMLDocument.prototype, 'inputEncoding', {
get: function() {
return null;
}
});
Object.defineProperty(XMLDocument.prototype, 'strictErrorChecking', {
get: function() {
return false;
}
});
Object.defineProperty(XMLDocument.prototype, 'xmlEncoding', {
get: function() {
if (this.children.length !== 0 && this.children[0].type === NodeType.Declaration) {
return this.children[0].encoding;
} else {
return null;
}
}
});
Object.defineProperty(XMLDocument.prototype, 'xmlStandalone', {
get: function() {
if (this.children.length !== 0 && this.children[0].type === NodeType.Declaration) {
return this.children[0].standalone === 'yes';
} else {
return false;
}
}
});
Object.defineProperty(XMLDocument.prototype, 'xmlVersion', {
get: function() {
if (this.children.length !== 0 && this.children[0].type === NodeType.Declaration) {
return this.children[0].version;
} else {
return "1.0";
}
}
});
Object.defineProperty(XMLDocument.prototype, 'URL', {
get: function() {
return this.documentURI;
}
});
Object.defineProperty(XMLDocument.prototype, 'origin', {
get: function() {
return null;
}
});
Object.defineProperty(XMLDocument.prototype, 'compatMode', {
get: function() {
return null;
}
});
Object.defineProperty(XMLDocument.prototype, 'characterSet', {
get: function() {
return null;
}
});
Object.defineProperty(XMLDocument.prototype, 'contentType', {
get: function() {
return null;
}
});
XMLDocument.prototype.end = function(writer) {
var writerOptions;
writerOptions = {};
if (!writer) {
writer = this.options.writer;
} else if (isPlainObject(writer)) {
writerOptions = writer;
writer = this.options.writer;
}
return writer.document(this, writer.filterOptions(writerOptions));
};
XMLDocument.prototype.toString = function(options) {
return this.options.writer.document(this, this.options.writer.filterOptions(options));
};
XMLDocument.prototype.createElement = function(tagName) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLDocument.prototype.createDocumentFragment = function() {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLDocument.prototype.createTextNode = function(data) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLDocument.prototype.createComment = function(data) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLDocument.prototype.createCDATASection = function(data) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLDocument.prototype.createProcessingInstruction = function(target, data) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLDocument.prototype.createAttribute = function(name) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLDocument.prototype.createEntityReference = function(name) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLDocument.prototype.getElementsByTagName = function(tagname) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLDocument.prototype.importNode = function(importedNode, deep) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLDocument.prototype.createElementNS = function(namespaceURI, qualifiedName) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLDocument.prototype.createAttributeNS = function(namespaceURI, qualifiedName) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLDocument.prototype.getElementsByTagNameNS = function(namespaceURI, localName) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLDocument.prototype.getElementById = function(elementId) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLDocument.prototype.adoptNode = function(source) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLDocument.prototype.normalizeDocument = function() {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLDocument.prototype.renameNode = function(node, namespaceURI, qualifiedName) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLDocument.prototype.getElementsByClassName = function(classNames) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLDocument.prototype.createEvent = function(eventInterface) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLDocument.prototype.createRange = function() {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLDocument.prototype.createNodeIterator = function(root, whatToShow, filter) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLDocument.prototype.createTreeWalker = function(root, whatToShow, filter) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
return XMLDocument;
})(XMLNode);
}).call(this);
/***/ }),
/***/ 7356:
/***/ (function(module, __unused_webpack_exports, __nccwpck_require__) {
// Generated by CoffeeScript 1.12.7
(function() {
var NodeType, WriterState, XMLAttribute, XMLCData, XMLComment, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDeclaration, XMLDocType, XMLDocument, XMLDocumentCB, XMLElement, XMLProcessingInstruction, XMLRaw, XMLStringWriter, XMLStringifier, XMLText, getValue, isFunction, isObject, isPlainObject, ref,
hasProp = {}.hasOwnProperty;
ref = __nccwpck_require__(8229), isObject = ref.isObject, isFunction = ref.isFunction, isPlainObject = ref.isPlainObject, getValue = ref.getValue;
NodeType = __nccwpck_require__(9267);
XMLDocument = __nccwpck_require__(3730);
XMLElement = __nccwpck_require__(9437);
XMLCData = __nccwpck_require__(333);
XMLComment = __nccwpck_require__(4407);
XMLRaw = __nccwpck_require__(6329);
XMLText = __nccwpck_require__(1318);
XMLProcessingInstruction = __nccwpck_require__(6939);
XMLDeclaration = __nccwpck_require__(6364);
XMLDocType = __nccwpck_require__(1801);
XMLDTDAttList = __nccwpck_require__(1015);
XMLDTDEntity = __nccwpck_require__(53);
XMLDTDElement = __nccwpck_require__(2421);
XMLDTDNotation = __nccwpck_require__(2837);
XMLAttribute = __nccwpck_require__(8376);
XMLStringifier = __nccwpck_require__(8594);
XMLStringWriter = __nccwpck_require__(5913);
WriterState = __nccwpck_require__(9766);
module.exports = XMLDocumentCB = (function() {
function XMLDocumentCB(options, onData, onEnd) {
var writerOptions;
this.name = "?xml";
this.type = NodeType.Document;
options || (options = {});
writerOptions = {};
if (!options.writer) {
options.writer = new XMLStringWriter();
} else if (isPlainObject(options.writer)) {
writerOptions = options.writer;
options.writer = new XMLStringWriter();
}
this.options = options;
this.writer = options.writer;
this.writerOptions = this.writer.filterOptions(writerOptions);
this.stringify = new XMLStringifier(options);
this.onDataCallback = onData || function() {};
this.onEndCallback = onEnd || function() {};
this.currentNode = null;
this.currentLevel = -1;
this.openTags = {};
this.documentStarted = false;
this.documentCompleted = false;
this.root = null;
}
XMLDocumentCB.prototype.createChildNode = function(node) {
var att, attName, attributes, child, i, len, ref1, ref2;
switch (node.type) {
case NodeType.CData:
this.cdata(node.value);
break;
case NodeType.Comment:
this.comment(node.value);
break;
case NodeType.Element:
attributes = {};
ref1 = node.attribs;
for (attName in ref1) {
if (!hasProp.call(ref1, attName)) continue;
att = ref1[attName];
attributes[attName] = att.value;
}
this.node(node.name, attributes);
break;
case NodeType.Dummy:
this.dummy();
break;
case NodeType.Raw:
this.raw(node.value);
break;
case NodeType.Text:
this.text(node.value);
break;
case NodeType.ProcessingInstruction:
this.instruction(node.target, node.value);
break;
default:
throw new Error("This XML node type is not supported in a JS object: " + node.constructor.name);
}
ref2 = node.children;
for (i = 0, len = ref2.length; i < len; i++) {
child = ref2[i];
this.createChildNode(child);
if (child.type === NodeType.Element) {
this.up();
}
}
return this;
};
XMLDocumentCB.prototype.dummy = function() {
return this;
};
XMLDocumentCB.prototype.node = function(name, attributes, text) {
var ref1;
if (name == null) {
throw new Error("Missing node name.");
}
if (this.root && this.currentLevel === -1) {
throw new Error("Document can only have one root node. " + this.debugInfo(name));
}
this.openCurrent();
name = getValue(name);
if (attributes == null) {
attributes = {};
}
attributes = getValue(attributes);
if (!isObject(attributes)) {
ref1 = [attributes, text], text = ref1[0], attributes = ref1[1];
}
this.currentNode = new XMLElement(this, name, attributes);
this.currentNode.children = false;
this.currentLevel++;
this.openTags[this.currentLevel] = this.currentNode;
if (text != null) {
this.text(text);
}
return this;
};
XMLDocumentCB.prototype.element = function(name, attributes, text) {
var child, i, len, oldValidationFlag, ref1, root;
if (this.currentNode && this.currentNode.type === NodeType.DocType) {
this.dtdElement.apply(this, arguments);
} else {
if (Array.isArray(name) || isObject(name) || isFunction(name)) {
oldValidationFlag = this.options.noValidation;
this.options.noValidation = true;
root = new XMLDocument(this.options).element('TEMP_ROOT');
root.element(name);
this.options.noValidation = oldValidationFlag;
ref1 = root.children;
for (i = 0, len = ref1.length; i < len; i++) {
child = ref1[i];
this.createChildNode(child);
if (child.type === NodeType.Element) {
this.up();
}
}
} else {
this.node(name, attributes, text);
}
}
return this;
};
XMLDocumentCB.prototype.attribute = function(name, value) {
var attName, attValue;
if (!this.currentNode || this.currentNode.children) {
throw new Error("att() can only be used immediately after an ele() call in callback mode. " + this.debugInfo(name));
}
if (name != null) {
name = getValue(name);
}
if (isObject(name)) {
for (attName in name) {
if (!hasProp.call(name, attName)) continue;
attValue = name[attName];
this.attribute(attName, attValue);
}
} else {
if (isFunction(value)) {
value = value.apply();
}
if (this.options.keepNullAttributes && (value == null)) {
this.currentNode.attribs[name] = new XMLAttribute(this, name, "");
} else if (value != null) {
this.currentNode.attribs[name] = new XMLAttribute(this, name, value);
}
}
return this;
};
XMLDocumentCB.prototype.text = function(value) {
var node;
this.openCurrent();
node = new XMLText(this, value);
this.onData(this.writer.text(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
return this;
};
XMLDocumentCB.prototype.cdata = function(value) {
var node;
this.openCurrent();
node = new XMLCData(this, value);
this.onData(this.writer.cdata(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
return this;
};
XMLDocumentCB.prototype.comment = function(value) {
var node;
this.openCurrent();
node = new XMLComment(this, value);
this.onData(this.writer.comment(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
return this;
};
XMLDocumentCB.prototype.raw = function(value) {
var node;
this.openCurrent();
node = new XMLRaw(this, value);
this.onData(this.writer.raw(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
return this;
};
XMLDocumentCB.prototype.instruction = function(target, value) {
var i, insTarget, insValue, len, node;
this.openCurrent();
if (target != null) {
target = getValue(target);
}
if (value != null) {
value = getValue(value);
}
if (Array.isArray(target)) {
for (i = 0, len = target.length; i < len; i++) {
insTarget = target[i];
this.instruction(insTarget);
}
} else if (isObject(target)) {
for (insTarget in target) {
if (!hasProp.call(target, insTarget)) continue;
insValue = target[insTarget];
this.instruction(insTarget, insValue);
}
} else {
if (isFunction(value)) {
value = value.apply();
}
node = new XMLProcessingInstruction(this, target, value);
this.onData(this.writer.processingInstruction(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
}
return this;
};
XMLDocumentCB.prototype.declaration = function(version, encoding, standalone) {
var node;
this.openCurrent();
if (this.documentStarted) {
throw new Error("declaration() must be the first node.");
}
node = new XMLDeclaration(this, version, encoding, standalone);
this.onData(this.writer.declaration(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
return this;
};
XMLDocumentCB.prototype.doctype = function(root, pubID, sysID) {
this.openCurrent();
if (root == null) {
throw new Error("Missing root node name.");
}
if (this.root) {
throw new Error("dtd() must come before the root node.");
}
this.currentNode = new XMLDocType(this, pubID, sysID);
this.currentNode.rootNodeName = root;
this.currentNode.children = false;
this.currentLevel++;
this.openTags[this.currentLevel] = this.currentNode;
return this;
};
XMLDocumentCB.prototype.dtdElement = function(name, value) {
var node;
this.openCurrent();
node = new XMLDTDElement(this, name, value);
this.onData(this.writer.dtdElement(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
return this;
};
XMLDocumentCB.prototype.attList = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) {
var node;
this.openCurrent();
node = new XMLDTDAttList(this, elementName, attributeName, attributeType, defaultValueType, defaultValue);
this.onData(this.writer.dtdAttList(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
return this;
};
XMLDocumentCB.prototype.entity = function(name, value) {
var node;
this.openCurrent();
node = new XMLDTDEntity(this, false, name, value);
this.onData(this.writer.dtdEntity(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
return this;
};
XMLDocumentCB.prototype.pEntity = function(name, value) {
var node;
this.openCurrent();
node = new XMLDTDEntity(this, true, name, value);
this.onData(this.writer.dtdEntity(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
return this;
};
XMLDocumentCB.prototype.notation = function(name, value) {
var node;
this.openCurrent();
node = new XMLDTDNotation(this, name, value);
this.onData(this.writer.dtdNotation(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
return this;
};
XMLDocumentCB.prototype.up = function() {
if (this.currentLevel < 0) {
throw new Error("The document node has no parent.");
}
if (this.currentNode) {
if (this.currentNode.children) {
this.closeNode(this.currentNode);
} else {
this.openNode(this.currentNode);
}
this.currentNode = null;
} else {
this.closeNode(this.openTags[this.currentLevel]);
}
delete this.openTags[this.currentLevel];
this.currentLevel--;
return this;
};
XMLDocumentCB.prototype.end = function() {
while (this.currentLevel >= 0) {
this.up();
}
return this.onEnd();
};
XMLDocumentCB.prototype.openCurrent = function() {
if (this.currentNode) {
this.currentNode.children = true;
return this.openNode(this.currentNode);
}
};
XMLDocumentCB.prototype.openNode = function(node) {
var att, chunk, name, ref1;
if (!node.isOpen) {
if (!this.root && this.currentLevel === 0 && node.type === NodeType.Element) {
this.root = node;
}
chunk = '';
if (node.type === NodeType.Element) {
this.writerOptions.state = WriterState.OpenTag;
chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + '<' + node.name;
ref1 = node.attribs;
for (name in ref1) {
if (!hasProp.call(ref1, name)) continue;
att = ref1[name];
chunk += this.writer.attribute(att, this.writerOptions, this.currentLevel);
}
chunk += (node.children ? '>' : '/>') + this.writer.endline(node, this.writerOptions, this.currentLevel);
this.writerOptions.state = WriterState.InsideTag;
} else {
this.writerOptions.state = WriterState.OpenTag;
chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + '<!DOCTYPE ' + node.rootNodeName;
if (node.pubID && node.sysID) {
chunk += ' PUBLIC "' + node.pubID + '" "' + node.sysID + '"';
} else if (node.sysID) {
chunk += ' SYSTEM "' + node.sysID + '"';
}
if (node.children) {
chunk += ' [';
this.writerOptions.state = WriterState.InsideTag;
} else {
this.writerOptions.state = WriterState.CloseTag;
chunk += '>';
}
chunk += this.writer.endline(node, this.writerOptions, this.currentLevel);
}
this.onData(chunk, this.currentLevel);
return node.isOpen = true;
}
};
XMLDocumentCB.prototype.closeNode = function(node) {
var chunk;
if (!node.isClosed) {
chunk = '';
this.writerOptions.state = WriterState.CloseTag;
if (node.type === NodeType.Element) {
chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + '</' + node.name + '>' + this.writer.endline(node, this.writerOptions, this.currentLevel);
} else {
chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + ']>' + this.writer.endline(node, this.writerOptions, this.currentLevel);
}
this.writerOptions.state = WriterState.None;
this.onData(chunk, this.currentLevel);
return node.isClosed = true;
}
};
XMLDocumentCB.prototype.onData = function(chunk, level) {
this.documentStarted = true;
return this.onDataCallback(chunk, level + 1);
};
XMLDocumentCB.prototype.onEnd = function() {
this.documentCompleted = true;
return this.onEndCallback();
};
XMLDocumentCB.prototype.debugInfo = function(name) {
if (name == null) {
return "";
} else {
return "node: <" + name + ">";
}
};
XMLDocumentCB.prototype.ele = function() {
return this.element.apply(this, arguments);
};
XMLDocumentCB.prototype.nod = function(name, attributes, text) {
return this.node(name, attributes, text);
};
XMLDocumentCB.prototype.txt = function(value) {
return this.text(value);
};
XMLDocumentCB.prototype.dat = function(value) {
return this.cdata(value);
};
XMLDocumentCB.prototype.com = function(value) {
return this.comment(value);
};
XMLDocumentCB.prototype.ins = function(target, value) {
return this.instruction(target, value);
};
XMLDocumentCB.prototype.dec = function(version, encoding, standalone) {
return this.declaration(version, encoding, standalone);
};
XMLDocumentCB.prototype.dtd = function(root, pubID, sysID) {
return this.doctype(root, pubID, sysID);
};
XMLDocumentCB.prototype.e = function(name, attributes, text) {
return this.element(name, attributes, text);
};
XMLDocumentCB.prototype.n = function(name, attributes, text) {
return this.node(name, attributes, text);
};
XMLDocumentCB.prototype.t = function(value) {
return this.text(value);
};
XMLDocumentCB.prototype.d = function(value) {
return this.cdata(value);
};
XMLDocumentCB.prototype.c = function(value) {
return this.comment(value);
};
XMLDocumentCB.prototype.r = function(value) {
return this.raw(value);
};
XMLDocumentCB.prototype.i = function(target, value) {
return this.instruction(target, value);
};
XMLDocumentCB.prototype.att = function() {
if (this.currentNode && this.currentNode.type === NodeType.DocType) {
return this.attList.apply(this, arguments);
} else {
return this.attribute.apply(this, arguments);
}
};
XMLDocumentCB.prototype.a = function() {
if (this.currentNode && this.currentNode.type === NodeType.DocType) {
return this.attList.apply(this, arguments);
} else {
return this.attribute.apply(this, arguments);
}
};
XMLDocumentCB.prototype.ent = function(name, value) {
return this.entity(name, value);
};
XMLDocumentCB.prototype.pent = function(name, value) {
return this.pEntity(name, value);
};
XMLDocumentCB.prototype.not = function(name, value) {
return this.notation(name, value);
};
return XMLDocumentCB;
})();
}).call(this);
/***/ }),
/***/ 3590:
/***/ (function(module, __unused_webpack_exports, __nccwpck_require__) {
// Generated by CoffeeScript 1.12.7
(function() {
var NodeType, XMLDummy, XMLNode,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
XMLNode = __nccwpck_require__(7608);
NodeType = __nccwpck_require__(9267);
module.exports = XMLDummy = (function(superClass) {
extend(XMLDummy, superClass);
function XMLDummy(parent) {
XMLDummy.__super__.constructor.call(this, parent);
this.type = NodeType.Dummy;
}
XMLDummy.prototype.clone = function() {
return Object.create(this);
};
XMLDummy.prototype.toString = function(options) {
return '';
};
return XMLDummy;
})(XMLNode);
}).call(this);
/***/ }),
/***/ 9437:
/***/ (function(module, __unused_webpack_exports, __nccwpck_require__) {
// Generated by CoffeeScript 1.12.7
(function() {
var NodeType, XMLAttribute, XMLElement, XMLNamedNodeMap, XMLNode, getValue, isFunction, isObject, ref,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
ref = __nccwpck_require__(8229), isObject = ref.isObject, isFunction = ref.isFunction, getValue = ref.getValue;
XMLNode = __nccwpck_require__(7608);
NodeType = __nccwpck_require__(9267);
XMLAttribute = __nccwpck_require__(8376);
XMLNamedNodeMap = __nccwpck_require__(4361);
module.exports = XMLElement = (function(superClass) {
extend(XMLElement, superClass);
function XMLElement(parent, name, attributes) {
var child, j, len, ref1;
XMLElement.__super__.constructor.call(this, parent);
if (name == null) {
throw new Error("Missing element name. " + this.debugInfo());
}
this.name = this.stringify.name(name);
this.type = NodeType.Element;
this.attribs = {};
this.schemaTypeInfo = null;
if (attributes != null) {
this.attribute(attributes);
}
if (parent.type === NodeType.Document) {
this.isRoot = true;
this.documentObject = parent;
parent.rootObject = this;
if (parent.children) {
ref1 = parent.children;
for (j = 0, len = ref1.length; j < len; j++) {
child = ref1[j];
if (child.type === NodeType.DocType) {
child.name = this.name;
break;
}
}
}
}
}
Object.defineProperty(XMLElement.prototype, 'tagName', {
get: function() {
return this.name;
}
});
Object.defineProperty(XMLElement.prototype, 'namespaceURI', {
get: function() {
return '';
}
});
Object.defineProperty(XMLElement.prototype, 'prefix', {
get: function() {
return '';
}
});
Object.defineProperty(XMLElement.prototype, 'localName', {
get: function() {
return this.name;
}
});
Object.defineProperty(XMLElement.prototype, 'id', {
get: function() {
throw new Error("This DOM method is not implemented." + this.debugInfo());
}
});
Object.defineProperty(XMLElement.prototype, 'className', {
get: function() {
throw new Error("This DOM method is not implemented." + this.debugInfo());
}
});
Object.defineProperty(XMLElement.prototype, 'classList', {
get: function() {
throw new Error("This DOM method is not implemented." + this.debugInfo());
}
});
Object.defineProperty(XMLElement.prototype, 'attributes', {
get: function() {
if (!this.attributeMap || !this.attributeMap.nodes) {
this.attributeMap = new XMLNamedNodeMap(this.attribs);
}
return this.attributeMap;
}
});
XMLElement.prototype.clone = function() {
var att, attName, clonedSelf, ref1;
clonedSelf = Object.create(this);
if (clonedSelf.isRoot) {
clonedSelf.documentObject = null;
}
clonedSelf.attribs = {};
ref1 = this.attribs;
for (attName in ref1) {
if (!hasProp.call(ref1, attName)) continue;
att = ref1[attName];
clonedSelf.attribs[attName] = att.clone();
}
clonedSelf.children = [];
this.children.forEach(function(child) {
var clonedChild;
clonedChild = child.clone();
clonedChild.parent = clonedSelf;
return clonedSelf.children.push(clonedChild);
});
return clonedSelf;
};
XMLElement.prototype.attribute = function(name, value) {
var attName, attValue;
if (name != null) {
name = getValue(name);
}
if (isObject(name)) {
for (attName in name) {
if (!hasProp.call(name, attName)) continue;
attValue = name[attName];
this.attribute(attName, attValue);
}
} else {
if (isFunction(value)) {
value = value.apply();
}
if (this.options.keepNullAttributes && (value == null)) {
this.attribs[name] = new XMLAttribute(this, name, "");
} else if (value != null) {
this.attribs[name] = new XMLAttribute(this, name, value);
}
}
return this;
};
XMLElement.prototype.removeAttribute = function(name) {
var attName, j, len;
if (name == null) {
throw new Error("Missing attribute name. " + this.debugInfo());
}
name = getValue(name);
if (Array.isArray(name)) {
for (j = 0, len = name.length; j < len; j++) {
attName = name[j];
delete this.attribs[attName];
}
} else {
delete this.attribs[name];
}
return this;
};
XMLElement.prototype.toString = function(options) {
return this.options.writer.element(this, this.options.writer.filterOptions(options));
};
XMLElement.prototype.att = function(name, value) {
return this.attribute(name, value);
};
XMLElement.prototype.a = function(name, value) {
return this.attribute(name, value);
};
XMLElement.prototype.getAttribute = function(name) {
if (this.attribs.hasOwnProperty(name)) {
return this.attribs[name].value;
} else {
return null;
}
};
XMLElement.prototype.setAttribute = function(name, value) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLElement.prototype.getAttributeNode = function(name) {
if (this.attribs.hasOwnProperty(name)) {
return this.attribs[name];
} else {
return null;
}
};
XMLElement.prototype.setAttributeNode = function(newAttr) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLElement.prototype.removeAttributeNode = function(oldAttr) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLElement.prototype.getElementsByTagName = function(name) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLElement.prototype.getAttributeNS = function(namespaceURI, localName) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLElement.prototype.setAttributeNS = function(namespaceURI, qualifiedName, value) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLElement.prototype.removeAttributeNS = function(namespaceURI, localName) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLElement.prototype.getAttributeNodeNS = function(namespaceURI, localName) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLElement.prototype.setAttributeNodeNS = function(newAttr) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLElement.prototype.getElementsByTagNameNS = function(namespaceURI, localName) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLElement.prototype.hasAttribute = function(name) {
return this.attribs.hasOwnProperty(name);
};
XMLElement.prototype.hasAttributeNS = function(namespaceURI, localName) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLElement.prototype.setIdAttribute = function(name, isId) {
if (this.attribs.hasOwnProperty(name)) {
return this.attribs[name].isId;
} else {
return isId;
}
};
XMLElement.prototype.setIdAttributeNS = function(namespaceURI, localName, isId) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLElement.prototype.setIdAttributeNode = function(idAttr, isId) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLElement.prototype.getElementsByTagName = function(tagname) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLElement.prototype.getElementsByTagNameNS = function(namespaceURI, localName) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLElement.prototype.getElementsByClassName = function(classNames) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLElement.prototype.isEqualNode = function(node) {
var i, j, ref1;
if (!XMLElement.__super__.isEqualNode.apply(this, arguments).isEqualNode(node)) {
return false;
}
if (node.namespaceURI !== this.namespaceURI) {
return false;
}
if (node.prefix !== this.prefix) {
return false;
}
if (node.localName !== this.localName) {
return false;
}
if (node.attribs.length !== this.attribs.length) {
return false;
}
for (i = j = 0, ref1 = this.attribs.length - 1; 0 <= ref1 ? j <= ref1 : j >= ref1; i = 0 <= ref1 ? ++j : --j) {
if (!this.attribs[i].isEqualNode(node.attribs[i])) {
return false;
}
}
return true;
};
return XMLElement;
})(XMLNode);
}).call(this);
/***/ }),
/***/ 4361:
/***/ (function(module) {
// Generated by CoffeeScript 1.12.7
(function() {
var XMLNamedNodeMap;
module.exports = XMLNamedNodeMap = (function() {
function XMLNamedNodeMap(nodes) {
this.nodes = nodes;
}
Object.defineProperty(XMLNamedNodeMap.prototype, 'length', {
get: function() {
return Object.keys(this.nodes).length || 0;
}
});
XMLNamedNodeMap.prototype.clone = function() {
return this.nodes = null;
};
XMLNamedNodeMap.prototype.getNamedItem = function(name) {
return this.nodes[name];
};
XMLNamedNodeMap.prototype.setNamedItem = function(node) {
var oldNode;
oldNode = this.nodes[node.nodeName];
this.nodes[node.nodeName] = node;
return oldNode || null;
};
XMLNamedNodeMap.prototype.removeNamedItem = function(name) {
var oldNode;
oldNode = this.nodes[name];
delete this.nodes[name];
return oldNode || null;
};
XMLNamedNodeMap.prototype.item = function(index) {
return this.nodes[Object.keys(this.nodes)[index]] || null;
};
XMLNamedNodeMap.prototype.getNamedItemNS = function(namespaceURI, localName) {
throw new Error("This DOM method is not implemented.");
};
XMLNamedNodeMap.prototype.setNamedItemNS = function(node) {
throw new Error("This DOM method is not implemented.");
};
XMLNamedNodeMap.prototype.removeNamedItemNS = function(namespaceURI, localName) {
throw new Error("This DOM method is not implemented.");
};
return XMLNamedNodeMap;
})();
}).call(this);
/***/ }),
/***/ 7608:
/***/ (function(module, __unused_webpack_exports, __nccwpck_require__) {
// Generated by CoffeeScript 1.12.7
(function() {
var DocumentPosition, NodeType, XMLCData, XMLComment, XMLDeclaration, XMLDocType, XMLDummy, XMLElement, XMLNamedNodeMap, XMLNode, XMLNodeList, XMLProcessingInstruction, XMLRaw, XMLText, getValue, isEmpty, isFunction, isObject, ref1,
hasProp = {}.hasOwnProperty;
ref1 = __nccwpck_require__(8229), isObject = ref1.isObject, isFunction = ref1.isFunction, isEmpty = ref1.isEmpty, getValue = ref1.getValue;
XMLElement = null;
XMLCData = null;
XMLComment = null;
XMLDeclaration = null;
XMLDocType = null;
XMLRaw = null;
XMLText = null;
XMLProcessingInstruction = null;
XMLDummy = null;
NodeType = null;
XMLNodeList = null;
XMLNamedNodeMap = null;
DocumentPosition = null;
module.exports = XMLNode = (function() {
function XMLNode(parent1) {
this.parent = parent1;
if (this.parent) {
this.options = this.parent.options;
this.stringify = this.parent.stringify;
}
this.value = null;
this.children = [];
this.baseURI = null;
if (!XMLElement) {
XMLElement = __nccwpck_require__(9437);
XMLCData = __nccwpck_require__(333);
XMLComment = __nccwpck_require__(4407);
XMLDeclaration = __nccwpck_require__(6364);
XMLDocType = __nccwpck_require__(1801);
XMLRaw = __nccwpck_require__(6329);
XMLText = __nccwpck_require__(1318);
XMLProcessingInstruction = __nccwpck_require__(6939);
XMLDummy = __nccwpck_require__(3590);
NodeType = __nccwpck_require__(9267);
XMLNodeList = __nccwpck_require__(6768);
XMLNamedNodeMap = __nccwpck_require__(4361);
DocumentPosition = __nccwpck_require__(2839);
}
}
Object.defineProperty(XMLNode.prototype, 'nodeName', {
get: function() {
return this.name;
}
});
Object.defineProperty(XMLNode.prototype, 'nodeType', {
get: function() {
return this.type;
}
});
Object.defineProperty(XMLNode.prototype, 'nodeValue', {
get: function() {
return this.value;
}
});
Object.defineProperty(XMLNode.prototype, 'parentNode', {
get: function() {
return this.parent;
}
});
Object.defineProperty(XMLNode.prototype, 'childNodes', {
get: function() {
if (!this.childNodeList || !this.childNodeList.nodes) {
this.childNodeList = new XMLNodeList(this.children);
}
return this.childNodeList;
}
});
Object.defineProperty(XMLNode.prototype, 'firstChild', {
get: function() {
return this.children[0] || null;
}
});
Object.defineProperty(XMLNode.prototype, 'lastChild', {
get: function() {
return this.children[this.children.length - 1] || null;
}
});
Object.defineProperty(XMLNode.prototype, 'previousSibling', {
get: function() {
var i;
i = this.parent.children.indexOf(this);
return this.parent.children[i - 1] || null;
}
});
Object.defineProperty(XMLNode.prototype, 'nextSibling', {
get: function() {
var i;
i = this.parent.children.indexOf(this);
return this.parent.children[i + 1] || null;
}
});
Object.defineProperty(XMLNode.prototype, 'ownerDocument', {
get: function() {
return this.document() || null;
}
});
Object.defineProperty(XMLNode.prototype, 'textContent', {
get: function() {
var child, j, len, ref2, str;
if (this.nodeType === NodeType.Element || this.nodeType === NodeType.DocumentFragment) {
str = '';
ref2 = this.children;
for (j = 0, len = ref2.length; j < len; j++) {
child = ref2[j];
if (child.textContent) {
str += child.textContent;
}
}
return str;
} else {
return null;
}
},
set: function(value) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
}
});
XMLNode.prototype.setParent = function(parent) {
var child, j, len, ref2, results;
this.parent = parent;
if (parent) {
this.options = parent.options;
this.stringify = parent.stringify;
}
ref2 = this.children;
results = [];
for (j = 0, len = ref2.length; j < len; j++) {
child = ref2[j];
results.push(child.setParent(this));
}
return results;
};
XMLNode.prototype.element = function(name, attributes, text) {
var childNode, item, j, k, key, lastChild, len, len1, ref2, ref3, val;
lastChild = null;
if (attributes === null && (text == null)) {
ref2 = [{}, null], attributes = ref2[0], text = ref2[1];
}
if (attributes == null) {
attributes = {};
}
attributes = getValue(attributes);
if (!isObject(attributes)) {
ref3 = [attributes, text], text = ref3[0], attributes = ref3[1];
}
if (name != null) {
name = getValue(name);
}
if (Array.isArray(name)) {
for (j = 0, len = name.length; j < len; j++) {
item = name[j];
lastChild = this.element(item);
}
} else if (isFunction(name)) {
lastChild = this.element(name.apply());
} else if (isObject(name)) {
for (key in name) {
if (!hasProp.call(name, key)) continue;
val = name[key];
if (isFunction(val)) {
val = val.apply();
}
if (!this.options.ignoreDecorators && this.stringify.convertAttKey && key.indexOf(this.stringify.convertAttKey) === 0) {
lastChild = this.attribute(key.substr(this.stringify.convertAttKey.length), val);
} else if (!this.options.separateArrayItems && Array.isArray(val) && isEmpty(val)) {
lastChild = this.dummy();
} else if (isObject(val) && isEmpty(val)) {
lastChild = this.element(key);
} else if (!this.options.keepNullNodes && (val == null)) {
lastChild = this.dummy();
} else if (!this.options.separateArrayItems && Array.isArray(val)) {
for (k = 0, len1 = val.length; k < len1; k++) {
item = val[k];
childNode = {};
childNode[key] = item;
lastChild = this.element(childNode);
}
} else if (isObject(val)) {
if (!this.options.ignoreDecorators && this.stringify.convertTextKey && key.indexOf(this.stringify.convertTextKey) === 0) {
lastChild = this.element(val);
} else {
lastChild = this.element(key);
lastChild.element(val);
}
} else {
lastChild = this.element(key, val);
}
}
} else if (!this.options.keepNullNodes && text === null) {
lastChild = this.dummy();
} else {
if (!this.options.ignoreDecorators && this.stringify.convertTextKey && name.indexOf(this.stringify.convertTextKey) === 0) {
lastChild = this.text(text);
} else if (!this.options.ignoreDecorators && this.stringify.convertCDataKey && name.indexOf(this.stringify.convertCDataKey) === 0) {
lastChild = this.cdata(text);
} else if (!this.options.ignoreDecorators && this.stringify.convertCommentKey && name.indexOf(this.stringify.convertCommentKey) === 0) {
lastChild = this.comment(text);
} else if (!this.options.ignoreDecorators && this.stringify.convertRawKey && name.indexOf(this.stringify.convertRawKey) === 0) {
lastChild = this.raw(text);
} else if (!this.options.ignoreDecorators && this.stringify.convertPIKey && name.indexOf(this.stringify.convertPIKey) === 0) {
lastChild = this.instruction(name.substr(this.stringify.convertPIKey.length), text);
} else {
lastChild = this.node(name, attributes, text);
}
}
if (lastChild == null) {
throw new Error("Could not create any elements with: " + name + ". " + this.debugInfo());
}
return lastChild;
};
XMLNode.prototype.insertBefore = function(name, attributes, text) {
var child, i, newChild, refChild, removed;
if (name != null ? name.type : void 0) {
newChild = name;
refChild = attributes;
newChild.setParent(this);
if (refChild) {
i = children.indexOf(refChild);
removed = children.splice(i);
children.push(newChild);
Array.prototype.push.apply(children, removed);
} else {
children.push(newChild);
}
return newChild;
} else {
if (this.isRoot) {
throw new Error("Cannot insert elements at root level. " + this.debugInfo(name));
}
i = this.parent.children.indexOf(this);
removed = this.parent.children.splice(i);
child = this.parent.element(name, attributes, text);
Array.prototype.push.apply(this.parent.children, removed);
return child;
}
};
XMLNode.prototype.insertAfter = function(name, attributes, text) {
var child, i, removed;
if (this.isRoot) {
throw new Error("Cannot insert elements at root level. " + this.debugInfo(name));
}
i = this.parent.children.indexOf(this);
removed = this.parent.children.splice(i + 1);
child = this.parent.element(name, attributes, text);
Array.prototype.push.apply(this.parent.children, removed);
return child;
};
XMLNode.prototype.remove = function() {
var i, ref2;
if (this.isRoot) {
throw new Error("Cannot remove the root element. " + this.debugInfo());
}
i = this.parent.children.indexOf(this);
[].splice.apply(this.parent.children, [i, i - i + 1].concat(ref2 = [])), ref2;
return this.parent;
};
XMLNode.prototype.node = function(name, attributes, text) {
var child, ref2;
if (name != null) {
name = getValue(name);
}
attributes || (attributes = {});
attributes = getValue(attributes);
if (!isObject(attributes)) {
ref2 = [attributes, text], text = ref2[0], attributes = ref2[1];
}
child = new XMLElement(this, name, attributes);
if (text != null) {
child.text(text);
}
this.children.push(child);
return child;
};
XMLNode.prototype.text = function(value) {
var child;
if (isObject(value)) {
this.element(value);
}
child = new XMLText(this, value);
this.children.push(child);
return this;
};
XMLNode.prototype.cdata = function(value) {
var child;
child = new XMLCData(this, value);
this.children.push(child);
return this;
};
XMLNode.prototype.comment = function(value) {
var child;
child = new XMLComment(this, value);
this.children.push(child);
return this;
};
XMLNode.prototype.commentBefore = function(value) {
var child, i, removed;
i = this.parent.children.indexOf(this);
removed = this.parent.children.splice(i);
child = this.parent.comment(value);
Array.prototype.push.apply(this.parent.children, removed);
return this;
};
XMLNode.prototype.commentAfter = function(value) {
var child, i, removed;
i = this.parent.children.indexOf(this);
removed = this.parent.children.splice(i + 1);
child = this.parent.comment(value);
Array.prototype.push.apply(this.parent.children, removed);
return this;
};
XMLNode.prototype.raw = function(value) {
var child;
child = new XMLRaw(this, value);
this.children.push(child);
return this;
};
XMLNode.prototype.dummy = function() {
var child;
child = new XMLDummy(this);
return child;
};
XMLNode.prototype.instruction = function(target, value) {
var insTarget, insValue, instruction, j, len;
if (target != null) {
target = getValue(target);
}
if (value != null) {
value = getValue(value);
}
if (Array.isArray(target)) {
for (j = 0, len = target.length; j < len; j++) {
insTarget = target[j];
this.instruction(insTarget);
}
} else if (isObject(target)) {
for (insTarget in target) {
if (!hasProp.call(target, insTarget)) continue;
insValue = target[insTarget];
this.instruction(insTarget, insValue);
}
} else {
if (isFunction(value)) {
value = value.apply();
}
instruction = new XMLProcessingInstruction(this, target, value);
this.children.push(instruction);
}
return this;
};
XMLNode.prototype.instructionBefore = function(target, value) {
var child, i, removed;
i = this.parent.children.indexOf(this);
removed = this.parent.children.splice(i);
child = this.parent.instruction(target, value);
Array.prototype.push.apply(this.parent.children, removed);
return this;
};
XMLNode.prototype.instructionAfter = function(target, value) {
var child, i, removed;
i = this.parent.children.indexOf(this);
removed = this.parent.children.splice(i + 1);
child = this.parent.instruction(target, value);
Array.prototype.push.apply(this.parent.children, removed);
return this;
};
XMLNode.prototype.declaration = function(version, encoding, standalone) {
var doc, xmldec;
doc = this.document();
xmldec = new XMLDeclaration(doc, version, encoding, standalone);
if (doc.children.length === 0) {
doc.children.unshift(xmldec);
} else if (doc.children[0].type === NodeType.Declaration) {
doc.children[0] = xmldec;
} else {
doc.children.unshift(xmldec);
}
return doc.root() || doc;
};
XMLNode.prototype.dtd = function(pubID, sysID) {
var child, doc, doctype, i, j, k, len, len1, ref2, ref3;
doc = this.document();
doctype = new XMLDocType(doc, pubID, sysID);
ref2 = doc.children;
for (i = j = 0, len = ref2.length; j < len; i = ++j) {
child = ref2[i];
if (child.type === NodeType.DocType) {
doc.children[i] = doctype;
return doctype;
}
}
ref3 = doc.children;
for (i = k = 0, len1 = ref3.length; k < len1; i = ++k) {
child = ref3[i];
if (child.isRoot) {
doc.children.splice(i, 0, doctype);
return doctype;
}
}
doc.children.push(doctype);
return doctype;
};
XMLNode.prototype.up = function() {
if (this.isRoot) {
throw new Error("The root node has no parent. Use doc() if you need to get the document object.");
}
return this.parent;
};
XMLNode.prototype.root = function() {
var node;
node = this;
while (node) {
if (node.type === NodeType.Document) {
return node.rootObject;
} else if (node.isRoot) {
return node;
} else {
node = node.parent;
}
}
};
XMLNode.prototype.document = function() {
var node;
node = this;
while (node) {
if (node.type === NodeType.Document) {
return node;
} else {
node = node.parent;
}
}
};
XMLNode.prototype.end = function(options) {
return this.document().end(options);
};
XMLNode.prototype.prev = function() {
var i;
i = this.parent.children.indexOf(this);
if (i < 1) {
throw new Error("Already at the first node. " + this.debugInfo());
}
return this.parent.children[i - 1];
};
XMLNode.prototype.next = function() {
var i;
i = this.parent.children.indexOf(this);
if (i === -1 || i === this.parent.children.length - 1) {
throw new Error("Already at the last node. " + this.debugInfo());
}
return this.parent.children[i + 1];
};
XMLNode.prototype.importDocument = function(doc) {
var clonedRoot;
clonedRoot = doc.root().clone();
clonedRoot.parent = this;
clonedRoot.isRoot = false;
this.children.push(clonedRoot);
return this;
};
XMLNode.prototype.debugInfo = function(name) {
var ref2, ref3;
name = name || this.name;
if ((name == null) && !((ref2 = this.parent) != null ? ref2.name : void 0)) {
return "";
} else if (name == null) {
return "parent: <" + this.parent.name + ">";
} else if (!((ref3 = this.parent) != null ? ref3.name : void 0)) {
return "node: <" + name + ">";
} else {
return "node: <" + name + ">, parent: <" + this.parent.name + ">";
}
};
XMLNode.prototype.ele = function(name, attributes, text) {
return this.element(name, attributes, text);
};
XMLNode.prototype.nod = function(name, attributes, text) {
return this.node(name, attributes, text);
};
XMLNode.prototype.txt = function(value) {
return this.text(value);
};
XMLNode.prototype.dat = function(value) {
return this.cdata(value);
};
XMLNode.prototype.com = function(value) {
return this.comment(value);
};
XMLNode.prototype.ins = function(target, value) {
return this.instruction(target, value);
};
XMLNode.prototype.doc = function() {
return this.document();
};
XMLNode.prototype.dec = function(version, encoding, standalone) {
return this.declaration(version, encoding, standalone);
};
XMLNode.prototype.e = function(name, attributes, text) {
return this.element(name, attributes, text);
};
XMLNode.prototype.n = function(name, attributes, text) {
return this.node(name, attributes, text);
};
XMLNode.prototype.t = function(value) {
return this.text(value);
};
XMLNode.prototype.d = function(value) {
return this.cdata(value);
};
XMLNode.prototype.c = function(value) {
return this.comment(value);
};
XMLNode.prototype.r = function(value) {
return this.raw(value);
};
XMLNode.prototype.i = function(target, value) {
return this.instruction(target, value);
};
XMLNode.prototype.u = function() {
return this.up();
};
XMLNode.prototype.importXMLBuilder = function(doc) {
return this.importDocument(doc);
};
XMLNode.prototype.replaceChild = function(newChild, oldChild) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLNode.prototype.removeChild = function(oldChild) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLNode.prototype.appendChild = function(newChild) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLNode.prototype.hasChildNodes = function() {
return this.children.length !== 0;
};
XMLNode.prototype.cloneNode = function(deep) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLNode.prototype.normalize = function() {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLNode.prototype.isSupported = function(feature, version) {
return true;
};
XMLNode.prototype.hasAttributes = function() {
return this.attribs.length !== 0;
};
XMLNode.prototype.compareDocumentPosition = function(other) {
var ref, res;
ref = this;
if (ref === other) {
return 0;
} else if (this.document() !== other.document()) {
res = DocumentPosition.Disconnected | DocumentPosition.ImplementationSpecific;
if (Math.random() < 0.5) {
res |= DocumentPosition.Preceding;
} else {
res |= DocumentPosition.Following;
}
return res;
} else if (ref.isAncestor(other)) {
return DocumentPosition.Contains | DocumentPosition.Preceding;
} else if (ref.isDescendant(other)) {
return DocumentPosition.Contains | DocumentPosition.Following;
} else if (ref.isPreceding(other)) {
return DocumentPosition.Preceding;
} else {
return DocumentPosition.Following;
}
};
XMLNode.prototype.isSameNode = function(other) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLNode.prototype.lookupPrefix = function(namespaceURI) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLNode.prototype.isDefaultNamespace = function(namespaceURI) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLNode.prototype.lookupNamespaceURI = function(prefix) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLNode.prototype.isEqualNode = function(node) {
var i, j, ref2;
if (node.nodeType !== this.nodeType) {
return false;
}
if (node.children.length !== this.children.length) {
return false;
}
for (i = j = 0, ref2 = this.children.length - 1; 0 <= ref2 ? j <= ref2 : j >= ref2; i = 0 <= ref2 ? ++j : --j) {
if (!this.children[i].isEqualNode(node.children[i])) {
return false;
}
}
return true;
};
XMLNode.prototype.getFeature = function(feature, version) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLNode.prototype.setUserData = function(key, data, handler) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLNode.prototype.getUserData = function(key) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLNode.prototype.contains = function(other) {
if (!other) {
return false;
}
return other === this || this.isDescendant(other);
};
XMLNode.prototype.isDescendant = function(node) {
var child, isDescendantChild, j, len, ref2;
ref2 = this.children;
for (j = 0, len = ref2.length; j < len; j++) {
child = ref2[j];
if (node === child) {
return true;
}
isDescendantChild = child.isDescendant(node);
if (isDescendantChild) {
return true;
}
}
return false;
};
XMLNode.prototype.isAncestor = function(node) {
return node.isDescendant(this);
};
XMLNode.prototype.isPreceding = function(node) {
var nodePos, thisPos;
nodePos = this.treePosition(node);
thisPos = this.treePosition(this);
if (nodePos === -1 || thisPos === -1) {
return false;
} else {
return nodePos < thisPos;
}
};
XMLNode.prototype.isFollowing = function(node) {
var nodePos, thisPos;
nodePos = this.treePosition(node);
thisPos = this.treePosition(this);
if (nodePos === -1 || thisPos === -1) {
return false;
} else {
return nodePos > thisPos;
}
};
XMLNode.prototype.treePosition = function(node) {
var found, pos;
pos = 0;
found = false;
this.foreachTreeNode(this.document(), function(childNode) {
pos++;
if (!found && childNode === node) {
return found = true;
}
});
if (found) {
return pos;
} else {
return -1;
}
};
XMLNode.prototype.foreachTreeNode = function(node, func) {
var child, j, len, ref2, res;
node || (node = this.document());
ref2 = node.children;
for (j = 0, len = ref2.length; j < len; j++) {
child = ref2[j];
if (res = func(child)) {
return res;
} else {
res = this.foreachTreeNode(child, func);
if (res) {
return res;
}
}
}
};
return XMLNode;
})();
}).call(this);
/***/ }),
/***/ 6768:
/***/ (function(module) {
// Generated by CoffeeScript 1.12.7
(function() {
var XMLNodeList;
module.exports = XMLNodeList = (function() {
function XMLNodeList(nodes) {
this.nodes = nodes;
}
Object.defineProperty(XMLNodeList.prototype, 'length', {
get: function() {
return this.nodes.length || 0;
}
});
XMLNodeList.prototype.clone = function() {
return this.nodes = null;
};
XMLNodeList.prototype.item = function(index) {
return this.nodes[index] || null;
};
return XMLNodeList;
})();
}).call(this);
/***/ }),
/***/ 6939:
/***/ (function(module, __unused_webpack_exports, __nccwpck_require__) {
// Generated by CoffeeScript 1.12.7
(function() {
var NodeType, XMLCharacterData, XMLProcessingInstruction,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
NodeType = __nccwpck_require__(9267);
XMLCharacterData = __nccwpck_require__(7709);
module.exports = XMLProcessingInstruction = (function(superClass) {
extend(XMLProcessingInstruction, superClass);
function XMLProcessingInstruction(parent, target, value) {
XMLProcessingInstruction.__super__.constructor.call(this, parent);
if (target == null) {
throw new Error("Missing instruction target. " + this.debugInfo());
}
this.type = NodeType.ProcessingInstruction;
this.target = this.stringify.insTarget(target);
this.name = this.target;
if (value) {
this.value = this.stringify.insValue(value);
}
}
XMLProcessingInstruction.prototype.clone = function() {
return Object.create(this);
};
XMLProcessingInstruction.prototype.toString = function(options) {
return this.options.writer.processingInstruction(this, this.options.writer.filterOptions(options));
};
XMLProcessingInstruction.prototype.isEqualNode = function(node) {
if (!XMLProcessingInstruction.__super__.isEqualNode.apply(this, arguments).isEqualNode(node)) {
return false;
}
if (node.target !== this.target) {
return false;
}
return true;
};
return XMLProcessingInstruction;
})(XMLCharacterData);
}).call(this);
/***/ }),
/***/ 6329:
/***/ (function(module, __unused_webpack_exports, __nccwpck_require__) {
// Generated by CoffeeScript 1.12.7
(function() {
var NodeType, XMLNode, XMLRaw,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
NodeType = __nccwpck_require__(9267);
XMLNode = __nccwpck_require__(7608);
module.exports = XMLRaw = (function(superClass) {
extend(XMLRaw, superClass);
function XMLRaw(parent, text) {
XMLRaw.__super__.constructor.call(this, parent);
if (text == null) {
throw new Error("Missing raw text. " + this.debugInfo());
}
this.type = NodeType.Raw;
this.value = this.stringify.raw(text);
}
XMLRaw.prototype.clone = function() {
return Object.create(this);
};
XMLRaw.prototype.toString = function(options) {
return this.options.writer.raw(this, this.options.writer.filterOptions(options));
};
return XMLRaw;
})(XMLNode);
}).call(this);
/***/ }),
/***/ 8601:
/***/ (function(module, __unused_webpack_exports, __nccwpck_require__) {
// Generated by CoffeeScript 1.12.7
(function() {
var NodeType, WriterState, XMLStreamWriter, XMLWriterBase,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
NodeType = __nccwpck_require__(9267);
XMLWriterBase = __nccwpck_require__(6752);
WriterState = __nccwpck_require__(9766);
module.exports = XMLStreamWriter = (function(superClass) {
extend(XMLStreamWriter, superClass);
function XMLStreamWriter(stream, options) {
this.stream = stream;
XMLStreamWriter.__super__.constructor.call(this, options);
}
XMLStreamWriter.prototype.endline = function(node, options, level) {
if (node.isLastRootNode && options.state === WriterState.CloseTag) {
return '';
} else {
return XMLStreamWriter.__super__.endline.call(this, node, options, level);
}
};
XMLStreamWriter.prototype.document = function(doc, options) {
var child, i, j, k, len, len1, ref, ref1, results;
ref = doc.children;
for (i = j = 0, len = ref.length; j < len; i = ++j) {
child = ref[i];
child.isLastRootNode = i === doc.children.length - 1;
}
options = this.filterOptions(options);
ref1 = doc.children;
results = [];
for (k = 0, len1 = ref1.length; k < len1; k++) {
child = ref1[k];
results.push(this.writeChildNode(child, options, 0));
}
return results;
};
XMLStreamWriter.prototype.attribute = function(att, options, level) {
return this.stream.write(XMLStreamWriter.__super__.attribute.call(this, att, options, level));
};
XMLStreamWriter.prototype.cdata = function(node, options, level) {
return this.stream.write(XMLStreamWriter.__super__.cdata.call(this, node, options, level));
};
XMLStreamWriter.prototype.comment = function(node, options, level) {
return this.stream.write(XMLStreamWriter.__super__.comment.call(this, node, options, level));
};
XMLStreamWriter.prototype.declaration = function(node, options, level) {
return this.stream.write(XMLStreamWriter.__super__.declaration.call(this, node, options, level));
};
XMLStreamWriter.prototype.docType = function(node, options, level) {
var child, j, len, ref;
level || (level = 0);
this.openNode(node, options, level);
options.state = WriterState.OpenTag;
this.stream.write(this.indent(node, options, level));
this.stream.write('<!DOCTYPE ' + node.root().name);
if (node.pubID && node.sysID) {
this.stream.write(' PUBLIC "' + node.pubID + '" "' + node.sysID + '"');
} else if (node.sysID) {
this.stream.write(' SYSTEM "' + node.sysID + '"');
}
if (node.children.length > 0) {
this.stream.write(' [');
this.stream.write(this.endline(node, options, level));
options.state = WriterState.InsideTag;
ref = node.children;
for (j = 0, len = ref.length; j < len; j++) {
child = ref[j];
this.writeChildNode(child, options, level + 1);
}
options.state = WriterState.CloseTag;
this.stream.write(']');
}
options.state = WriterState.CloseTag;
this.stream.write(options.spaceBeforeSlash + '>');
this.stream.write(this.endline(node, options, level));
options.state = WriterState.None;
return this.closeNode(node, options, level);
};
XMLStreamWriter.prototype.element = function(node, options, level) {
var att, child, childNodeCount, firstChildNode, j, len, name, prettySuppressed, ref, ref1;
level || (level = 0);
this.openNode(node, options, level);
options.state = WriterState.OpenTag;
this.stream.write(this.indent(node, options, level) + '<' + node.name);
ref = node.attribs;
for (name in ref) {
if (!hasProp.call(ref, name)) continue;
att = ref[name];
this.attribute(att, options, level);
}
childNodeCount = node.children.length;
firstChildNode = childNodeCount === 0 ? null : node.children[0];
if (childNodeCount === 0 || node.children.every(function(e) {
return (e.type === NodeType.Text || e.type === NodeType.Raw) && e.value === '';
})) {
if (options.allowEmpty) {
this.stream.write('>');
options.state = WriterState.CloseTag;
this.stream.write('</' + node.name + '>');
} else {
options.state = WriterState.CloseTag;
this.stream.write(options.spaceBeforeSlash + '/>');
}
} else if (options.pretty && childNodeCount === 1 && (firstChildNode.type === NodeType.Text || firstChildNode.type === NodeType.Raw) && (firstChildNode.value != null)) {
this.stream.write('>');
options.state = WriterState.InsideTag;
options.suppressPrettyCount++;
prettySuppressed = true;
this.writeChildNode(firstChildNode, options, level + 1);
options.suppressPrettyCount--;
prettySuppressed = false;
options.state = WriterState.CloseTag;
this.stream.write('</' + node.name + '>');
} else {
this.stream.write('>' + this.endline(node, options, level));
options.state = WriterState.InsideTag;
ref1 = node.children;
for (j = 0, len = ref1.length; j < len; j++) {
child = ref1[j];
this.writeChildNode(child, options, level + 1);
}
options.state = WriterState.CloseTag;
this.stream.write(this.indent(node, options, level) + '</' + node.name + '>');
}
this.stream.write(this.endline(node, options, level));
options.state = WriterState.None;
return this.closeNode(node, options, level);
};
XMLStreamWriter.prototype.processingInstruction = function(node, options, level) {
return this.stream.write(XMLStreamWriter.__super__.processingInstruction.call(this, node, options, level));
};
XMLStreamWriter.prototype.raw = function(node, options, level) {
return this.stream.write(XMLStreamWriter.__super__.raw.call(this, node, options, level));
};
XMLStreamWriter.prototype.text = function(node, options, level) {
return this.stream.write(XMLStreamWriter.__super__.text.call(this, node, options, level));
};
XMLStreamWriter.prototype.dtdAttList = function(node, options, level) {
return this.stream.write(XMLStreamWriter.__super__.dtdAttList.call(this, node, options, level));
};
XMLStreamWriter.prototype.dtdElement = function(node, options, level) {
return this.stream.write(XMLStreamWriter.__super__.dtdElement.call(this, node, options, level));
};
XMLStreamWriter.prototype.dtdEntity = function(node, options, level) {
return this.stream.write(XMLStreamWriter.__super__.dtdEntity.call(this, node, options, level));
};
XMLStreamWriter.prototype.dtdNotation = function(node, options, level) {
return this.stream.write(XMLStreamWriter.__super__.dtdNotation.call(this, node, options, level));
};
return XMLStreamWriter;
})(XMLWriterBase);
}).call(this);
/***/ }),
/***/ 5913:
/***/ (function(module, __unused_webpack_exports, __nccwpck_require__) {
// Generated by CoffeeScript 1.12.7
(function() {
var XMLStringWriter, XMLWriterBase,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
XMLWriterBase = __nccwpck_require__(6752);
module.exports = XMLStringWriter = (function(superClass) {
extend(XMLStringWriter, superClass);
function XMLStringWriter(options) {
XMLStringWriter.__super__.constructor.call(this, options);
}
XMLStringWriter.prototype.document = function(doc, options) {
var child, i, len, r, ref;
options = this.filterOptions(options);
r = '';
ref = doc.children;
for (i = 0, len = ref.length; i < len; i++) {
child = ref[i];
r += this.writeChildNode(child, options, 0);
}
if (options.pretty && r.slice(-options.newline.length) === options.newline) {
r = r.slice(0, -options.newline.length);
}
return r;
};
return XMLStringWriter;
})(XMLWriterBase);
}).call(this);
/***/ }),
/***/ 8594:
/***/ (function(module) {
// Generated by CoffeeScript 1.12.7
(function() {
var XMLStringifier,
bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
hasProp = {}.hasOwnProperty;
module.exports = XMLStringifier = (function() {
function XMLStringifier(options) {
this.assertLegalName = bind(this.assertLegalName, this);
this.assertLegalChar = bind(this.assertLegalChar, this);
var key, ref, value;
options || (options = {});
this.options = options;
if (!this.options.version) {
this.options.version = '1.0';
}
ref = options.stringify || {};
for (key in ref) {
if (!hasProp.call(ref, key)) continue;
value = ref[key];
this[key] = value;
}
}
XMLStringifier.prototype.name = function(val) {
if (this.options.noValidation) {
return val;
}
return this.assertLegalName('' + val || '');
};
XMLStringifier.prototype.text = function(val) {
if (this.options.noValidation) {
return val;
}
return this.assertLegalChar(this.textEscape('' + val || ''));
};
XMLStringifier.prototype.cdata = function(val) {
if (this.options.noValidation) {
return val;
}
val = '' + val || '';
val = val.replace(']]>', ']]]]><![CDATA[>');
return this.assertLegalChar(val);
};
XMLStringifier.prototype.comment = function(val) {
if (this.options.noValidation) {
return val;
}
val = '' + val || '';
if (val.match(/--/)) {
throw new Error("Comment text cannot contain double-hypen: " + val);
}
return this.assertLegalChar(val);
};
XMLStringifier.prototype.raw = function(val) {
if (this.options.noValidation) {
return val;
}
return '' + val || '';
};
XMLStringifier.prototype.attValue = function(val) {
if (this.options.noValidation) {
return val;
}
return this.assertLegalChar(this.attEscape(val = '' + val || ''));
};
XMLStringifier.prototype.insTarget = function(val) {
if (this.options.noValidation) {
return val;
}
return this.assertLegalChar('' + val || '');
};
XMLStringifier.prototype.insValue = function(val) {
if (this.options.noValidation) {
return val;
}
val = '' + val || '';
if (val.match(/\?>/)) {
throw new Error("Invalid processing instruction value: " + val);
}
return this.assertLegalChar(val);
};
XMLStringifier.prototype.xmlVersion = function(val) {
if (this.options.noValidation) {
return val;
}
val = '' + val || '';
if (!val.match(/1\.[0-9]+/)) {
throw new Error("Invalid version number: " + val);
}
return val;
};
XMLStringifier.prototype.xmlEncoding = function(val) {
if (this.options.noValidation) {
return val;
}
val = '' + val || '';
if (!val.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/)) {
throw new Error("Invalid encoding: " + val);
}
return this.assertLegalChar(val);
};
XMLStringifier.prototype.xmlStandalone = function(val) {
if (this.options.noValidation) {
return val;
}
if (val) {
return "yes";
} else {
return "no";
}
};
XMLStringifier.prototype.dtdPubID = function(val) {
if (this.options.noValidation) {
return val;
}
return this.assertLegalChar('' + val || '');
};
XMLStringifier.prototype.dtdSysID = function(val) {
if (this.options.noValidation) {
return val;
}
return this.assertLegalChar('' + val || '');
};
XMLStringifier.prototype.dtdElementValue = function(val) {
if (this.options.noValidation) {
return val;
}
return this.assertLegalChar('' + val || '');
};
XMLStringifier.prototype.dtdAttType = function(val) {
if (this.options.noValidation) {
return val;
}
return this.assertLegalChar('' + val || '');
};
XMLStringifier.prototype.dtdAttDefault = function(val) {
if (this.options.noValidation) {
return val;
}
return this.assertLegalChar('' + val || '');
};
XMLStringifier.prototype.dtdEntityValue = function(val) {
if (this.options.noValidation) {
return val;
}
return this.assertLegalChar('' + val || '');
};
XMLStringifier.prototype.dtdNData = function(val) {
if (this.options.noValidation) {
return val;
}
return this.assertLegalChar('' + val || '');
};
XMLStringifier.prototype.convertAttKey = '@';
XMLStringifier.prototype.convertPIKey = '?';
XMLStringifier.prototype.convertTextKey = '#text';
XMLStringifier.prototype.convertCDataKey = '#cdata';
XMLStringifier.prototype.convertCommentKey = '#comment';
XMLStringifier.prototype.convertRawKey = '#raw';
XMLStringifier.prototype.assertLegalChar = function(str) {
var regex, res;
if (this.options.noValidation) {
return str;
}
regex = '';
if (this.options.version === '1.0') {
regex = /[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
if (res = str.match(regex)) {
throw new Error("Invalid character in string: " + str + " at index " + res.index);
}
} else if (this.options.version === '1.1') {
regex = /[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
if (res = str.match(regex)) {
throw new Error("Invalid character in string: " + str + " at index " + res.index);
}
}
return str;
};
XMLStringifier.prototype.assertLegalName = function(str) {
var regex;
if (this.options.noValidation) {
return str;
}
this.assertLegalChar(str);
regex = /^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/;
if (!str.match(regex)) {
throw new Error("Invalid character in name");
}
return str;
};
XMLStringifier.prototype.textEscape = function(str) {
var ampregex;
if (this.options.noValidation) {
return str;
}
ampregex = this.options.noDoubleEncoding ? /(?!&\S+;)&/g : /&/g;
return str.replace(ampregex, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\r/g, '&#xD;');
};
XMLStringifier.prototype.attEscape = function(str) {
var ampregex;
if (this.options.noValidation) {
return str;
}
ampregex = this.options.noDoubleEncoding ? /(?!&\S+;)&/g : /&/g;
return str.replace(ampregex, '&amp;').replace(/</g, '&lt;').replace(/"/g, '&quot;').replace(/\t/g, '&#x9;').replace(/\n/g, '&#xA;').replace(/\r/g, '&#xD;');
};
return XMLStringifier;
})();
}).call(this);
/***/ }),
/***/ 1318:
/***/ (function(module, __unused_webpack_exports, __nccwpck_require__) {
// Generated by CoffeeScript 1.12.7
(function() {
var NodeType, XMLCharacterData, XMLText,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
NodeType = __nccwpck_require__(9267);
XMLCharacterData = __nccwpck_require__(7709);
module.exports = XMLText = (function(superClass) {
extend(XMLText, superClass);
function XMLText(parent, text) {
XMLText.__super__.constructor.call(this, parent);
if (text == null) {
throw new Error("Missing element text. " + this.debugInfo());
}
this.name = "#text";
this.type = NodeType.Text;
this.value = this.stringify.text(text);
}
Object.defineProperty(XMLText.prototype, 'isElementContentWhitespace', {
get: function() {
throw new Error("This DOM method is not implemented." + this.debugInfo());
}
});
Object.defineProperty(XMLText.prototype, 'wholeText', {
get: function() {
var next, prev, str;
str = '';
prev = this.previousSibling;
while (prev) {
str = prev.data + str;
prev = prev.previousSibling;
}
str += this.data;
next = this.nextSibling;
while (next) {
str = str + next.data;
next = next.nextSibling;
}
return str;
}
});
XMLText.prototype.clone = function() {
return Object.create(this);
};
XMLText.prototype.toString = function(options) {
return this.options.writer.text(this, this.options.writer.filterOptions(options));
};
XMLText.prototype.splitText = function(offset) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLText.prototype.replaceWholeText = function(content) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
return XMLText;
})(XMLCharacterData);
}).call(this);
/***/ }),
/***/ 6752:
/***/ (function(module, __unused_webpack_exports, __nccwpck_require__) {
// Generated by CoffeeScript 1.12.7
(function() {
var NodeType, WriterState, XMLCData, XMLComment, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDeclaration, XMLDocType, XMLDummy, XMLElement, XMLProcessingInstruction, XMLRaw, XMLText, XMLWriterBase, assign,
hasProp = {}.hasOwnProperty;
assign = (__nccwpck_require__(8229).assign);
NodeType = __nccwpck_require__(9267);
XMLDeclaration = __nccwpck_require__(6364);
XMLDocType = __nccwpck_require__(1801);
XMLCData = __nccwpck_require__(333);
XMLComment = __nccwpck_require__(4407);
XMLElement = __nccwpck_require__(9437);
XMLRaw = __nccwpck_require__(6329);
XMLText = __nccwpck_require__(1318);
XMLProcessingInstruction = __nccwpck_require__(6939);
XMLDummy = __nccwpck_require__(3590);
XMLDTDAttList = __nccwpck_require__(1015);
XMLDTDElement = __nccwpck_require__(2421);
XMLDTDEntity = __nccwpck_require__(53);
XMLDTDNotation = __nccwpck_require__(2837);
WriterState = __nccwpck_require__(9766);
module.exports = XMLWriterBase = (function() {
function XMLWriterBase(options) {
var key, ref, value;
options || (options = {});
this.options = options;
ref = options.writer || {};
for (key in ref) {
if (!hasProp.call(ref, key)) continue;
value = ref[key];
this["_" + key] = this[key];
this[key] = value;
}
}
XMLWriterBase.prototype.filterOptions = function(options) {
var filteredOptions, ref, ref1, ref2, ref3, ref4, ref5, ref6;
options || (options = {});
options = assign({}, this.options, options);
filteredOptions = {
writer: this
};
filteredOptions.pretty = options.pretty || false;
filteredOptions.allowEmpty = options.allowEmpty || false;
filteredOptions.indent = (ref = options.indent) != null ? ref : ' ';
filteredOptions.newline = (ref1 = options.newline) != null ? ref1 : '\n';
filteredOptions.offset = (ref2 = options.offset) != null ? ref2 : 0;
filteredOptions.dontPrettyTextNodes = (ref3 = (ref4 = options.dontPrettyTextNodes) != null ? ref4 : options.dontprettytextnodes) != null ? ref3 : 0;
filteredOptions.spaceBeforeSlash = (ref5 = (ref6 = options.spaceBeforeSlash) != null ? ref6 : options.spacebeforeslash) != null ? ref5 : '';
if (filteredOptions.spaceBeforeSlash === true) {
filteredOptions.spaceBeforeSlash = ' ';
}
filteredOptions.suppressPrettyCount = 0;
filteredOptions.user = {};
filteredOptions.state = WriterState.None;
return filteredOptions;
};
XMLWriterBase.prototype.indent = function(node, options, level) {
var indentLevel;
if (!options.pretty || options.suppressPrettyCount) {
return '';
} else if (options.pretty) {
indentLevel = (level || 0) + options.offset + 1;
if (indentLevel > 0) {
return new Array(indentLevel).join(options.indent);
}
}
return '';
};
XMLWriterBase.prototype.endline = function(node, options, level) {
if (!options.pretty || options.suppressPrettyCount) {
return '';
} else {
return options.newline;
}
};
XMLWriterBase.prototype.attribute = function(att, options, level) {
var r;
this.openAttribute(att, options, level);
r = ' ' + att.name + '="' + att.value + '"';
this.closeAttribute(att, options, level);
return r;
};
XMLWriterBase.prototype.cdata = function(node, options, level) {
var r;
this.openNode(node, options, level);
options.state = WriterState.OpenTag;
r = this.indent(node, options, level) + '<![CDATA[';
options.state = WriterState.InsideTag;
r += node.value;
options.state = WriterState.CloseTag;
r += ']]>' + this.endline(node, options, level);
options.state = WriterState.None;
this.closeNode(node, options, level);
return r;
};
XMLWriterBase.prototype.comment = function(node, options, level) {
var r;
this.openNode(node, options, level);
options.state = WriterState.OpenTag;
r = this.indent(node, options, level) + '<!-- ';
options.state = WriterState.InsideTag;
r += node.value;
options.state = WriterState.CloseTag;
r += ' -->' + this.endline(node, options, level);
options.state = WriterState.None;
this.closeNode(node, options, level);
return r;
};
XMLWriterBase.prototype.declaration = function(node, options, level) {
var r;
this.openNode(node, options, level);
options.state = WriterState.OpenTag;
r = this.indent(node, options, level) + '<?xml';
options.state = WriterState.InsideTag;
r += ' version="' + node.version + '"';
if (node.encoding != null) {
r += ' encoding="' + node.encoding + '"';
}
if (node.standalone != null) {
r += ' standalone="' + node.standalone + '"';
}
options.state = WriterState.CloseTag;
r += options.spaceBeforeSlash + '?>';
r += this.endline(node, options, level);
options.state = WriterState.None;
this.closeNode(node, options, level);
return r;
};
XMLWriterBase.prototype.docType = function(node, options, level) {
var child, i, len, r, ref;
level || (level = 0);
this.openNode(node, options, level);
options.state = WriterState.OpenTag;
r = this.indent(node, options, level);
r += '<!DOCTYPE ' + node.root().name;
if (node.pubID && node.sysID) {
r += ' PUBLIC "' + node.pubID + '" "' + node.sysID + '"';
} else if (node.sysID) {
r += ' SYSTEM "' + node.sysID + '"';
}
if (node.children.length > 0) {
r += ' [';
r += this.endline(node, options, level);
options.state = WriterState.InsideTag;
ref = node.children;
for (i = 0, len = ref.length; i < len; i++) {
child = ref[i];
r += this.writeChildNode(child, options, level + 1);
}
options.state = WriterState.CloseTag;
r += ']';
}
options.state = WriterState.CloseTag;
r += options.spaceBeforeSlash + '>';
r += this.endline(node, options, level);
options.state = WriterState.None;
this.closeNode(node, options, level);
return r;
};
XMLWriterBase.prototype.element = function(node, options, level) {
var att, child, childNodeCount, firstChildNode, i, j, len, len1, name, prettySuppressed, r, ref, ref1, ref2;
level || (level = 0);
prettySuppressed = false;
r = '';
this.openNode(node, options, level);
options.state = WriterState.OpenTag;
r += this.indent(node, options, level) + '<' + node.name;
ref = node.attribs;
for (name in ref) {
if (!hasProp.call(ref, name)) continue;
att = ref[name];
r += this.attribute(att, options, level);
}
childNodeCount = node.children.length;
firstChildNode = childNodeCount === 0 ? null : node.children[0];
if (childNodeCount === 0 || node.children.every(function(e) {
return (e.type === NodeType.Text || e.type === NodeType.Raw) && e.value === '';
})) {
if (options.allowEmpty) {
r += '>';
options.state = WriterState.CloseTag;
r += '</' + node.name + '>' + this.endline(node, options, level);
} else {
options.state = WriterState.CloseTag;
r += options.spaceBeforeSlash + '/>' + this.endline(node, options, level);
}
} else if (options.pretty && childNodeCount === 1 && (firstChildNode.type === NodeType.Text || firstChildNode.type === NodeType.Raw) && (firstChildNode.value != null)) {
r += '>';
options.state = WriterState.InsideTag;
options.suppressPrettyCount++;
prettySuppressed = true;
r += this.writeChildNode(firstChildNode, options, level + 1);
options.suppressPrettyCount--;
prettySuppressed = false;
options.state = WriterState.CloseTag;
r += '</' + node.name + '>' + this.endline(node, options, level);
} else {
if (options.dontPrettyTextNodes) {
ref1 = node.children;
for (i = 0, len = ref1.length; i < len; i++) {
child = ref1[i];
if ((child.type === NodeType.Text || child.type === NodeType.Raw) && (child.value != null)) {
options.suppressPrettyCount++;
prettySuppressed = true;
break;
}
}
}
r += '>' + this.endline(node, options, level);
options.state = WriterState.InsideTag;
ref2 = node.children;
for (j = 0, len1 = ref2.length; j < len1; j++) {
child = ref2[j];
r += this.writeChildNode(child, options, level + 1);
}
options.state = WriterState.CloseTag;
r += this.indent(node, options, level) + '</' + node.name + '>';
if (prettySuppressed) {
options.suppressPrettyCount--;
}
r += this.endline(node, options, level);
options.state = WriterState.None;
}
this.closeNode(node, options, level);
return r;
};
XMLWriterBase.prototype.writeChildNode = function(node, options, level) {
switch (node.type) {
case NodeType.CData:
return this.cdata(node, options, level);
case NodeType.Comment:
return this.comment(node, options, level);
case NodeType.Element:
return this.element(node, options, level);
case NodeType.Raw:
return this.raw(node, options, level);
case NodeType.Text:
return this.text(node, options, level);
case NodeType.ProcessingInstruction:
return this.processingInstruction(node, options, level);
case NodeType.Dummy:
return '';
case NodeType.Declaration:
return this.declaration(node, options, level);
case NodeType.DocType:
return this.docType(node, options, level);
case NodeType.AttributeDeclaration:
return this.dtdAttList(node, options, level);
case NodeType.ElementDeclaration:
return this.dtdElement(node, options, level);
case NodeType.EntityDeclaration:
return this.dtdEntity(node, options, level);
case NodeType.NotationDeclaration:
return this.dtdNotation(node, options, level);
default:
throw new Error("Unknown XML node type: " + node.constructor.name);
}
};
XMLWriterBase.prototype.processingInstruction = function(node, options, level) {
var r;
this.openNode(node, options, level);
options.state = WriterState.OpenTag;
r = this.indent(node, options, level) + '<?';
options.state = WriterState.InsideTag;
r += node.target;
if (node.value) {
r += ' ' + node.value;
}
options.state = WriterState.CloseTag;
r += options.spaceBeforeSlash + '?>';
r += this.endline(node, options, level);
options.state = WriterState.None;
this.closeNode(node, options, level);
return r;
};
XMLWriterBase.prototype.raw = function(node, options, level) {
var r;
this.openNode(node, options, level);
options.state = WriterState.OpenTag;
r = this.indent(node, options, level);
options.state = WriterState.InsideTag;
r += node.value;
options.state = WriterState.CloseTag;
r += this.endline(node, options, level);
options.state = WriterState.None;
this.closeNode(node, options, level);
return r;
};
XMLWriterBase.prototype.text = function(node, options, level) {
var r;
this.openNode(node, options, level);
options.state = WriterState.OpenTag;
r = this.indent(node, options, level);
options.state = WriterState.InsideTag;
r += node.value;
options.state = WriterState.CloseTag;
r += this.endline(node, options, level);
options.state = WriterState.None;
this.closeNode(node, options, level);
return r;
};
XMLWriterBase.prototype.dtdAttList = function(node, options, level) {
var r;
this.openNode(node, options, level);
options.state = WriterState.OpenTag;
r = this.indent(node, options, level) + '<!ATTLIST';
options.state = WriterState.InsideTag;
r += ' ' + node.elementName + ' ' + node.attributeName + ' ' + node.attributeType;
if (node.defaultValueType !== '#DEFAULT') {
r += ' ' + node.defaultValueType;
}
if (node.defaultValue) {
r += ' "' + node.defaultValue + '"';
}
options.state = WriterState.CloseTag;
r += options.spaceBeforeSlash + '>' + this.endline(node, options, level);
options.state = WriterState.None;
this.closeNode(node, options, level);
return r;
};
XMLWriterBase.prototype.dtdElement = function(node, options, level) {
var r;
this.openNode(node, options, level);
options.state = WriterState.OpenTag;
r = this.indent(node, options, level) + '<!ELEMENT';
options.state = WriterState.InsideTag;
r += ' ' + node.name + ' ' + node.value;
options.state = WriterState.CloseTag;
r += options.spaceBeforeSlash + '>' + this.endline(node, options, level);
options.state = WriterState.None;
this.closeNode(node, options, level);
return r;
};
XMLWriterBase.prototype.dtdEntity = function(node, options, level) {
var r;
this.openNode(node, options, level);
options.state = WriterState.OpenTag;
r = this.indent(node, options, level) + '<!ENTITY';
options.state = WriterState.InsideTag;
if (node.pe) {
r += ' %';
}
r += ' ' + node.name;
if (node.value) {
r += ' "' + node.value + '"';
} else {
if (node.pubID && node.sysID) {
r += ' PUBLIC "' + node.pubID + '" "' + node.sysID + '"';
} else if (node.sysID) {
r += ' SYSTEM "' + node.sysID + '"';
}
if (node.nData) {
r += ' NDATA ' + node.nData;
}
}
options.state = WriterState.CloseTag;
r += options.spaceBeforeSlash + '>' + this.endline(node, options, level);
options.state = WriterState.None;
this.closeNode(node, options, level);
return r;
};
XMLWriterBase.prototype.dtdNotation = function(node, options, level) {
var r;
this.openNode(node, options, level);
options.state = WriterState.OpenTag;
r = this.indent(node, options, level) + '<!NOTATION';
options.state = WriterState.InsideTag;
r += ' ' + node.name;
if (node.pubID && node.sysID) {
r += ' PUBLIC "' + node.pubID + '" "' + node.sysID + '"';
} else if (node.pubID) {
r += ' PUBLIC "' + node.pubID + '"';
} else if (node.sysID) {
r += ' SYSTEM "' + node.sysID + '"';
}
options.state = WriterState.CloseTag;
r += options.spaceBeforeSlash + '>' + this.endline(node, options, level);
options.state = WriterState.None;
this.closeNode(node, options, level);
return r;
};
XMLWriterBase.prototype.openNode = function(node, options, level) {};
XMLWriterBase.prototype.closeNode = function(node, options, level) {};
XMLWriterBase.prototype.openAttribute = function(att, options, level) {};
XMLWriterBase.prototype.closeAttribute = function(att, options, level) {};
return XMLWriterBase;
})();
}).call(this);
/***/ }),
/***/ 2958:
/***/ (function(module, __unused_webpack_exports, __nccwpck_require__) {
// Generated by CoffeeScript 1.12.7
(function() {
var NodeType, WriterState, XMLDOMImplementation, XMLDocument, XMLDocumentCB, XMLStreamWriter, XMLStringWriter, assign, isFunction, ref;
ref = __nccwpck_require__(8229), assign = ref.assign, isFunction = ref.isFunction;
XMLDOMImplementation = __nccwpck_require__(8310);
XMLDocument = __nccwpck_require__(3730);
XMLDocumentCB = __nccwpck_require__(7356);
XMLStringWriter = __nccwpck_require__(5913);
XMLStreamWriter = __nccwpck_require__(8601);
NodeType = __nccwpck_require__(9267);
WriterState = __nccwpck_require__(9766);
module.exports.create = function(name, xmldec, doctype, options) {
var doc, root;
if (name == null) {
throw new Error("Root element needs a name.");
}
options = assign({}, xmldec, doctype, options);
doc = new XMLDocument(options);
root = doc.element(name);
if (!options.headless) {
doc.declaration(options);
if ((options.pubID != null) || (options.sysID != null)) {
doc.dtd(options);
}
}
return root;
};
module.exports.begin = function(options, onData, onEnd) {
var ref1;
if (isFunction(options)) {
ref1 = [options, onData], onData = ref1[0], onEnd = ref1[1];
options = {};
}
if (onData) {
return new XMLDocumentCB(options, onData, onEnd);
} else {
return new XMLDocument(options);
}
};
module.exports.stringWriter = function(options) {
return new XMLStringWriter(options);
};
module.exports.streamWriter = function(stream, options) {
return new XMLStreamWriter(stream, options);
};
module.exports.implementation = new XMLDOMImplementation();
module.exports.nodeType = NodeType;
module.exports.writerState = WriterState;
}).call(this);
/***/ }),
/***/ 2877:
/***/ ((module) => {
module.exports = eval("require")("encoding");
/***/ }),
/***/ 9491:
/***/ ((module) => {
"use strict";
module.exports = require("assert");
/***/ }),
/***/ 4300:
/***/ ((module) => {
"use strict";
module.exports = require("buffer");
/***/ }),
/***/ 2081:
/***/ ((module) => {
"use strict";
module.exports = require("child_process");
/***/ }),
/***/ 6113:
/***/ ((module) => {
"use strict";
module.exports = require("crypto");
/***/ }),
/***/ 2361:
/***/ ((module) => {
"use strict";
module.exports = require("events");
/***/ }),
/***/ 7147:
/***/ ((module) => {
"use strict";
module.exports = require("fs");
/***/ }),
/***/ 3685:
/***/ ((module) => {
"use strict";
module.exports = require("http");
/***/ }),
/***/ 5687:
/***/ ((module) => {
"use strict";
module.exports = require("https");
/***/ }),
/***/ 1808:
/***/ ((module) => {
"use strict";
module.exports = require("net");
/***/ }),
/***/ 2037:
/***/ ((module) => {
"use strict";
module.exports = require("os");
/***/ }),
/***/ 1017:
/***/ ((module) => {
"use strict";
module.exports = require("path");
/***/ }),
/***/ 5477:
/***/ ((module) => {
"use strict";
module.exports = require("punycode");
/***/ }),
/***/ 3477:
/***/ ((module) => {
"use strict";
module.exports = require("querystring");
/***/ }),
/***/ 2781:
/***/ ((module) => {
"use strict";
module.exports = require("stream");
/***/ }),
/***/ 1576:
/***/ ((module) => {
"use strict";
module.exports = require("string_decoder");
/***/ }),
/***/ 9512:
/***/ ((module) => {
"use strict";
module.exports = require("timers");
/***/ }),
/***/ 4404:
/***/ ((module) => {
"use strict";
module.exports = require("tls");
/***/ }),
/***/ 7310:
/***/ ((module) => {
"use strict";
module.exports = require("url");
/***/ }),
/***/ 3837:
/***/ ((module) => {
"use strict";
module.exports = require("util");
/***/ }),
/***/ 9796:
/***/ ((module) => {
"use strict";
module.exports = require("zlib");
/***/ }),
/***/ 7476:
/***/ (function(module) {
// This file is autogenerated. It's used to publish CJS to npm.
(function (global, factory) {
true ? module.exports = factory() :
0;
})(this, (function () { 'use strict';
function _typeof(obj) {
"@babel/helpers - typeof";
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
return typeof obj;
} : function (obj) {
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
}, _typeof(obj);
}
// https://github.com/bgrins/TinyColor
// Brian Grinstead, MIT License
var trimLeft = /^\s+/;
var trimRight = /\s+$/;
function tinycolor(color, opts) {
color = color ? color : "";
opts = opts || {};
// If input is already a tinycolor, return itself
if (color instanceof tinycolor) {
return color;
}
// If we are called as a function, call using new instead
if (!(this instanceof tinycolor)) {
return new tinycolor(color, opts);
}
var rgb = inputToRGB(color);
this._originalInput = color, this._r = rgb.r, this._g = rgb.g, this._b = rgb.b, this._a = rgb.a, this._roundA = Math.round(100 * this._a) / 100, this._format = opts.format || rgb.format;
this._gradientType = opts.gradientType;
// Don't let the range of [0,255] come back in [0,1].
// Potentially lose a little bit of precision here, but will fix issues where
// .5 gets interpreted as half of the total, instead of half of 1
// If it was supposed to be 128, this was already taken care of by `inputToRgb`
if (this._r < 1) this._r = Math.round(this._r);
if (this._g < 1) this._g = Math.round(this._g);
if (this._b < 1) this._b = Math.round(this._b);
this._ok = rgb.ok;
}
tinycolor.prototype = {
isDark: function isDark() {
return this.getBrightness() < 128;
},
isLight: function isLight() {
return !this.isDark();
},
isValid: function isValid() {
return this._ok;
},
getOriginalInput: function getOriginalInput() {
return this._originalInput;
},
getFormat: function getFormat() {
return this._format;
},
getAlpha: function getAlpha() {
return this._a;
},
getBrightness: function getBrightness() {
//http://www.w3.org/TR/AERT#color-contrast
var rgb = this.toRgb();
return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;
},
getLuminance: function getLuminance() {
//http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
var rgb = this.toRgb();
var RsRGB, GsRGB, BsRGB, R, G, B;
RsRGB = rgb.r / 255;
GsRGB = rgb.g / 255;
BsRGB = rgb.b / 255;
if (RsRGB <= 0.03928) R = RsRGB / 12.92;else R = Math.pow((RsRGB + 0.055) / 1.055, 2.4);
if (GsRGB <= 0.03928) G = GsRGB / 12.92;else G = Math.pow((GsRGB + 0.055) / 1.055, 2.4);
if (BsRGB <= 0.03928) B = BsRGB / 12.92;else B = Math.pow((BsRGB + 0.055) / 1.055, 2.4);
return 0.2126 * R + 0.7152 * G + 0.0722 * B;
},
setAlpha: function setAlpha(value) {
this._a = boundAlpha(value);
this._roundA = Math.round(100 * this._a) / 100;
return this;
},
toHsv: function toHsv() {
var hsv = rgbToHsv(this._r, this._g, this._b);
return {
h: hsv.h * 360,
s: hsv.s,
v: hsv.v,
a: this._a
};
},
toHsvString: function toHsvString() {
var hsv = rgbToHsv(this._r, this._g, this._b);
var h = Math.round(hsv.h * 360),
s = Math.round(hsv.s * 100),
v = Math.round(hsv.v * 100);
return this._a == 1 ? "hsv(" + h + ", " + s + "%, " + v + "%)" : "hsva(" + h + ", " + s + "%, " + v + "%, " + this._roundA + ")";
},
toHsl: function toHsl() {
var hsl = rgbToHsl(this._r, this._g, this._b);
return {
h: hsl.h * 360,
s: hsl.s,
l: hsl.l,
a: this._a
};
},
toHslString: function toHslString() {
var hsl = rgbToHsl(this._r, this._g, this._b);
var h = Math.round(hsl.h * 360),
s = Math.round(hsl.s * 100),
l = Math.round(hsl.l * 100);
return this._a == 1 ? "hsl(" + h + ", " + s + "%, " + l + "%)" : "hsla(" + h + ", " + s + "%, " + l + "%, " + this._roundA + ")";
},
toHex: function toHex(allow3Char) {
return rgbToHex(this._r, this._g, this._b, allow3Char);
},
toHexString: function toHexString(allow3Char) {
return "#" + this.toHex(allow3Char);
},
toHex8: function toHex8(allow4Char) {
return rgbaToHex(this._r, this._g, this._b, this._a, allow4Char);
},
toHex8String: function toHex8String(allow4Char) {
return "#" + this.toHex8(allow4Char);
},
toRgb: function toRgb() {
return {
r: Math.round(this._r),
g: Math.round(this._g),
b: Math.round(this._b),
a: this._a
};
},
toRgbString: function toRgbString() {
return this._a == 1 ? "rgb(" + Math.round(this._r) + ", " + Math.round(this._g) + ", " + Math.round(this._b) + ")" : "rgba(" + Math.round(this._r) + ", " + Math.round(this._g) + ", " + Math.round(this._b) + ", " + this._roundA + ")";
},
toPercentageRgb: function toPercentageRgb() {
return {
r: Math.round(bound01(this._r, 255) * 100) + "%",
g: Math.round(bound01(this._g, 255) * 100) + "%",
b: Math.round(bound01(this._b, 255) * 100) + "%",
a: this._a
};
},
toPercentageRgbString: function toPercentageRgbString() {
return this._a == 1 ? "rgb(" + Math.round(bound01(this._r, 255) * 100) + "%, " + Math.round(bound01(this._g, 255) * 100) + "%, " + Math.round(bound01(this._b, 255) * 100) + "%)" : "rgba(" + Math.round(bound01(this._r, 255) * 100) + "%, " + Math.round(bound01(this._g, 255) * 100) + "%, " + Math.round(bound01(this._b, 255) * 100) + "%, " + this._roundA + ")";
},
toName: function toName() {
if (this._a === 0) {
return "transparent";
}
if (this._a < 1) {
return false;
}
return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false;
},
toFilter: function toFilter(secondColor) {
var hex8String = "#" + rgbaToArgbHex(this._r, this._g, this._b, this._a);
var secondHex8String = hex8String;
var gradientType = this._gradientType ? "GradientType = 1, " : "";
if (secondColor) {
var s = tinycolor(secondColor);
secondHex8String = "#" + rgbaToArgbHex(s._r, s._g, s._b, s._a);
}
return "progid:DXImageTransform.Microsoft.gradient(" + gradientType + "startColorstr=" + hex8String + ",endColorstr=" + secondHex8String + ")";
},
toString: function toString(format) {
var formatSet = !!format;
format = format || this._format;
var formattedString = false;
var hasAlpha = this._a < 1 && this._a >= 0;
var needsAlphaFormat = !formatSet && hasAlpha && (format === "hex" || format === "hex6" || format === "hex3" || format === "hex4" || format === "hex8" || format === "name");
if (needsAlphaFormat) {
// Special case for "transparent", all other non-alpha formats
// will return rgba when there is transparency.
if (format === "name" && this._a === 0) {
return this.toName();
}
return this.toRgbString();
}
if (format === "rgb") {
formattedString = this.toRgbString();
}
if (format === "prgb") {
formattedString = this.toPercentageRgbString();
}
if (format === "hex" || format === "hex6") {
formattedString = this.toHexString();
}
if (format === "hex3") {
formattedString = this.toHexString(true);
}
if (format === "hex4") {
formattedString = this.toHex8String(true);
}
if (format === "hex8") {
formattedString = this.toHex8String();
}
if (format === "name") {
formattedString = this.toName();
}
if (format === "hsl") {
formattedString = this.toHslString();
}
if (format === "hsv") {
formattedString = this.toHsvString();
}
return formattedString || this.toHexString();
},
clone: function clone() {
return tinycolor(this.toString());
},
_applyModification: function _applyModification(fn, args) {
var color = fn.apply(null, [this].concat([].slice.call(args)));
this._r = color._r;
this._g = color._g;
this._b = color._b;
this.setAlpha(color._a);
return this;
},
lighten: function lighten() {
return this._applyModification(_lighten, arguments);
},
brighten: function brighten() {
return this._applyModification(_brighten, arguments);
},
darken: function darken() {
return this._applyModification(_darken, arguments);
},
desaturate: function desaturate() {
return this._applyModification(_desaturate, arguments);
},
saturate: function saturate() {
return this._applyModification(_saturate, arguments);
},
greyscale: function greyscale() {
return this._applyModification(_greyscale, arguments);
},
spin: function spin() {
return this._applyModification(_spin, arguments);
},
_applyCombination: function _applyCombination(fn, args) {
return fn.apply(null, [this].concat([].slice.call(args)));
},
analogous: function analogous() {
return this._applyCombination(_analogous, arguments);
},
complement: function complement() {
return this._applyCombination(_complement, arguments);
},
monochromatic: function monochromatic() {
return this._applyCombination(_monochromatic, arguments);
},
splitcomplement: function splitcomplement() {
return this._applyCombination(_splitcomplement, arguments);
},
// Disabled until https://github.com/bgrins/TinyColor/issues/254
// polyad: function (number) {
// return this._applyCombination(polyad, [number]);
// },
triad: function triad() {
return this._applyCombination(polyad, [3]);
},
tetrad: function tetrad() {
return this._applyCombination(polyad, [4]);
}
};
// If input is an object, force 1 into "1.0" to handle ratios properly
// String input requires "1.0" as input, so 1 will be treated as 1
tinycolor.fromRatio = function (color, opts) {
if (_typeof(color) == "object") {
var newColor = {};
for (var i in color) {
if (color.hasOwnProperty(i)) {
if (i === "a") {
newColor[i] = color[i];
} else {
newColor[i] = convertToPercentage(color[i]);
}
}
}
color = newColor;
}
return tinycolor(color, opts);
};
// Given a string or object, convert that input to RGB
// Possible string inputs:
//
// "red"
// "#f00" or "f00"
// "#ff0000" or "ff0000"
// "#ff000000" or "ff000000"
// "rgb 255 0 0" or "rgb (255, 0, 0)"
// "rgb 1.0 0 0" or "rgb (1, 0, 0)"
// "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1"
// "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1"
// "hsl(0, 100%, 50%)" or "hsl 0 100% 50%"
// "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1"
// "hsv(0, 100%, 100%)" or "hsv 0 100% 100%"
//
function inputToRGB(color) {
var rgb = {
r: 0,
g: 0,
b: 0
};
var a = 1;
var s = null;
var v = null;
var l = null;
var ok = false;
var format = false;
if (typeof color == "string") {
color = stringInputToObject(color);
}
if (_typeof(color) == "object") {
if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {
rgb = rgbToRgb(color.r, color.g, color.b);
ok = true;
format = String(color.r).substr(-1) === "%" ? "prgb" : "rgb";
} else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {
s = convertToPercentage(color.s);
v = convertToPercentage(color.v);
rgb = hsvToRgb(color.h, s, v);
ok = true;
format = "hsv";
} else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {
s = convertToPercentage(color.s);
l = convertToPercentage(color.l);
rgb = hslToRgb(color.h, s, l);
ok = true;
format = "hsl";
}
if (color.hasOwnProperty("a")) {
a = color.a;
}
}
a = boundAlpha(a);
return {
ok: ok,
format: color.format || format,
r: Math.min(255, Math.max(rgb.r, 0)),
g: Math.min(255, Math.max(rgb.g, 0)),
b: Math.min(255, Math.max(rgb.b, 0)),
a: a
};
}
// Conversion Functions
// --------------------
// `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:
// <http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript>
// `rgbToRgb`
// Handle bounds / percentage checking to conform to CSS color spec
// <http://www.w3.org/TR/css3-color/>
// *Assumes:* r, g, b in [0, 255] or [0, 1]
// *Returns:* { r, g, b } in [0, 255]
function rgbToRgb(r, g, b) {
return {
r: bound01(r, 255) * 255,
g: bound01(g, 255) * 255,
b: bound01(b, 255) * 255
};
}
// `rgbToHsl`
// Converts an RGB color value to HSL.
// *Assumes:* r, g, and b are contained in [0, 255] or [0, 1]
// *Returns:* { h, s, l } in [0,1]
function rgbToHsl(r, g, b) {
r = bound01(r, 255);
g = bound01(g, 255);
b = bound01(b, 255);
var max = Math.max(r, g, b),
min = Math.min(r, g, b);
var h,
s,
l = (max + min) / 2;
if (max == min) {
h = s = 0; // achromatic
} else {
var d = max - min;
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
switch (max) {
case r:
h = (g - b) / d + (g < b ? 6 : 0);
break;
case g:
h = (b - r) / d + 2;
break;
case b:
h = (r - g) / d + 4;
break;
}
h /= 6;
}
return {
h: h,
s: s,
l: l
};
}
// `hslToRgb`
// Converts an HSL color value to RGB.
// *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]
// *Returns:* { r, g, b } in the set [0, 255]
function hslToRgb(h, s, l) {
var r, g, b;
h = bound01(h, 360);
s = bound01(s, 100);
l = bound01(l, 100);
function hue2rgb(p, q, t) {
if (t < 0) t += 1;
if (t > 1) t -= 1;
if (t < 1 / 6) return p + (q - p) * 6 * t;
if (t < 1 / 2) return q;
if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
return p;
}
if (s === 0) {
r = g = b = l; // achromatic
} else {
var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
var p = 2 * l - q;
r = hue2rgb(p, q, h + 1 / 3);
g = hue2rgb(p, q, h);
b = hue2rgb(p, q, h - 1 / 3);
}
return {
r: r * 255,
g: g * 255,
b: b * 255
};
}
// `rgbToHsv`
// Converts an RGB color value to HSV
// *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]
// *Returns:* { h, s, v } in [0,1]
function rgbToHsv(r, g, b) {
r = bound01(r, 255);
g = bound01(g, 255);
b = bound01(b, 255);
var max = Math.max(r, g, b),
min = Math.min(r, g, b);
var h,
s,
v = max;
var d = max - min;
s = max === 0 ? 0 : d / max;
if (max == min) {
h = 0; // achromatic
} else {
switch (max) {
case r:
h = (g - b) / d + (g < b ? 6 : 0);
break;
case g:
h = (b - r) / d + 2;
break;
case b:
h = (r - g) / d + 4;
break;
}
h /= 6;
}
return {
h: h,
s: s,
v: v
};
}
// `hsvToRgb`
// Converts an HSV color value to RGB.
// *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]
// *Returns:* { r, g, b } in the set [0, 255]
function hsvToRgb(h, s, v) {
h = bound01(h, 360) * 6;
s = bound01(s, 100);
v = bound01(v, 100);
var i = Math.floor(h),
f = h - i,
p = v * (1 - s),
q = v * (1 - f * s),
t = v * (1 - (1 - f) * s),
mod = i % 6,
r = [v, q, p, p, t, v][mod],
g = [t, v, v, q, p, p][mod],
b = [p, p, t, v, v, q][mod];
return {
r: r * 255,
g: g * 255,
b: b * 255
};
}
// `rgbToHex`
// Converts an RGB color to hex
// Assumes r, g, and b are contained in the set [0, 255]
// Returns a 3 or 6 character hex
function rgbToHex(r, g, b, allow3Char) {
var hex = [pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16))];
// Return a 3 character hex if possible
if (allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) {
return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
}
return hex.join("");
}
// `rgbaToHex`
// Converts an RGBA color plus alpha transparency to hex
// Assumes r, g, b are contained in the set [0, 255] and
// a in [0, 1]. Returns a 4 or 8 character rgba hex
function rgbaToHex(r, g, b, a, allow4Char) {
var hex = [pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16)), pad2(convertDecimalToHex(a))];
// Return a 4 character hex if possible
if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {
return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);
}
return hex.join("");
}
// `rgbaToArgbHex`
// Converts an RGBA color to an ARGB Hex8 string
// Rarely used, but required for "toFilter()"
function rgbaToArgbHex(r, g, b, a) {
var hex = [pad2(convertDecimalToHex(a)), pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16))];
return hex.join("");
}
// `equals`
// Can be called with any tinycolor input
tinycolor.equals = function (color1, color2) {
if (!color1 || !color2) return false;
return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString();
};
tinycolor.random = function () {
return tinycolor.fromRatio({
r: Math.random(),
g: Math.random(),
b: Math.random()
});
};
// Modification Functions
// ----------------------
// Thanks to less.js for some of the basics here
// <https://github.com/cloudhead/less.js/blob/master/lib/less/functions.js>
function _desaturate(color, amount) {
amount = amount === 0 ? 0 : amount || 10;
var hsl = tinycolor(color).toHsl();
hsl.s -= amount / 100;
hsl.s = clamp01(hsl.s);
return tinycolor(hsl);
}
function _saturate(color, amount) {
amount = amount === 0 ? 0 : amount || 10;
var hsl = tinycolor(color).toHsl();
hsl.s += amount / 100;
hsl.s = clamp01(hsl.s);
return tinycolor(hsl);
}
function _greyscale(color) {
return tinycolor(color).desaturate(100);
}
function _lighten(color, amount) {
amount = amount === 0 ? 0 : amount || 10;
var hsl = tinycolor(color).toHsl();
hsl.l += amount / 100;
hsl.l = clamp01(hsl.l);
return tinycolor(hsl);
}
function _brighten(color, amount) {
amount = amount === 0 ? 0 : amount || 10;
var rgb = tinycolor(color).toRgb();
rgb.r = Math.max(0, Math.min(255, rgb.r - Math.round(255 * -(amount / 100))));
rgb.g = Math.max(0, Math.min(255, rgb.g - Math.round(255 * -(amount / 100))));
rgb.b = Math.max(0, Math.min(255, rgb.b - Math.round(255 * -(amount / 100))));
return tinycolor(rgb);
}
function _darken(color, amount) {
amount = amount === 0 ? 0 : amount || 10;
var hsl = tinycolor(color).toHsl();
hsl.l -= amount / 100;
hsl.l = clamp01(hsl.l);
return tinycolor(hsl);
}
// Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.
// Values outside of this range will be wrapped into this range.
function _spin(color, amount) {
var hsl = tinycolor(color).toHsl();
var hue = (hsl.h + amount) % 360;
hsl.h = hue < 0 ? 360 + hue : hue;
return tinycolor(hsl);
}
// Combination Functions
// ---------------------
// Thanks to jQuery xColor for some of the ideas behind these
// <https://github.com/infusion/jQuery-xcolor/blob/master/jquery.xcolor.js>
function _complement(color) {
var hsl = tinycolor(color).toHsl();
hsl.h = (hsl.h + 180) % 360;
return tinycolor(hsl);
}
function polyad(color, number) {
if (isNaN(number) || number <= 0) {
throw new Error("Argument to polyad must be a positive number");
}
var hsl = tinycolor(color).toHsl();
var result = [tinycolor(color)];
var step = 360 / number;
for (var i = 1; i < number; i++) {
result.push(tinycolor({
h: (hsl.h + i * step) % 360,
s: hsl.s,
l: hsl.l
}));
}
return result;
}
function _splitcomplement(color) {
var hsl = tinycolor(color).toHsl();
var h = hsl.h;
return [tinycolor(color), tinycolor({
h: (h + 72) % 360,
s: hsl.s,
l: hsl.l
}), tinycolor({
h: (h + 216) % 360,
s: hsl.s,
l: hsl.l
})];
}
function _analogous(color, results, slices) {
results = results || 6;
slices = slices || 30;
var hsl = tinycolor(color).toHsl();
var part = 360 / slices;
var ret = [tinycolor(color)];
for (hsl.h = (hsl.h - (part * results >> 1) + 720) % 360; --results;) {
hsl.h = (hsl.h + part) % 360;
ret.push(tinycolor(hsl));
}
return ret;
}
function _monochromatic(color, results) {
results = results || 6;
var hsv = tinycolor(color).toHsv();
var h = hsv.h,
s = hsv.s,
v = hsv.v;
var ret = [];
var modification = 1 / results;
while (results--) {
ret.push(tinycolor({
h: h,
s: s,
v: v
}));
v = (v + modification) % 1;
}
return ret;
}
// Utility Functions
// ---------------------
tinycolor.mix = function (color1, color2, amount) {
amount = amount === 0 ? 0 : amount || 50;
var rgb1 = tinycolor(color1).toRgb();
var rgb2 = tinycolor(color2).toRgb();
var p = amount / 100;
var rgba = {
r: (rgb2.r - rgb1.r) * p + rgb1.r,
g: (rgb2.g - rgb1.g) * p + rgb1.g,
b: (rgb2.b - rgb1.b) * p + rgb1.b,
a: (rgb2.a - rgb1.a) * p + rgb1.a
};
return tinycolor(rgba);
};
// Readability Functions
// ---------------------
// <http://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef (WCAG Version 2)
// `contrast`
// Analyze the 2 colors and returns the color contrast defined by (WCAG Version 2)
tinycolor.readability = function (color1, color2) {
var c1 = tinycolor(color1);
var c2 = tinycolor(color2);
return (Math.max(c1.getLuminance(), c2.getLuminance()) + 0.05) / (Math.min(c1.getLuminance(), c2.getLuminance()) + 0.05);
};
// `isReadable`
// Ensure that foreground and background color combinations meet WCAG2 guidelines.
// The third argument is an optional Object.
// the 'level' property states 'AA' or 'AAA' - if missing or invalid, it defaults to 'AA';
// the 'size' property states 'large' or 'small' - if missing or invalid, it defaults to 'small'.
// If the entire object is absent, isReadable defaults to {level:"AA",size:"small"}.
// *Example*
// tinycolor.isReadable("#000", "#111") => false
// tinycolor.isReadable("#000", "#111",{level:"AA",size:"large"}) => false
tinycolor.isReadable = function (color1, color2, wcag2) {
var readability = tinycolor.readability(color1, color2);
var wcag2Parms, out;
out = false;
wcag2Parms = validateWCAG2Parms(wcag2);
switch (wcag2Parms.level + wcag2Parms.size) {
case "AAsmall":
case "AAAlarge":
out = readability >= 4.5;
break;
case "AAlarge":
out = readability >= 3;
break;
case "AAAsmall":
out = readability >= 7;
break;
}
return out;
};
// `mostReadable`
// Given a base color and a list of possible foreground or background
// colors for that base, returns the most readable color.
// Optionally returns Black or White if the most readable color is unreadable.
// *Example*
// tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:false}).toHexString(); // "#112255"
// tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:true}).toHexString(); // "#ffffff"
// tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"large"}).toHexString(); // "#faf3f3"
// tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"small"}).toHexString(); // "#ffffff"
tinycolor.mostReadable = function (baseColor, colorList, args) {
var bestColor = null;
var bestScore = 0;
var readability;
var includeFallbackColors, level, size;
args = args || {};
includeFallbackColors = args.includeFallbackColors;
level = args.level;
size = args.size;
for (var i = 0; i < colorList.length; i++) {
readability = tinycolor.readability(baseColor, colorList[i]);
if (readability > bestScore) {
bestScore = readability;
bestColor = tinycolor(colorList[i]);
}
}
if (tinycolor.isReadable(baseColor, bestColor, {
level: level,
size: size
}) || !includeFallbackColors) {
return bestColor;
} else {
args.includeFallbackColors = false;
return tinycolor.mostReadable(baseColor, ["#fff", "#000"], args);
}
};
// Big List of Colors
// ------------------
// <https://www.w3.org/TR/css-color-4/#named-colors>
var names = tinycolor.names = {
aliceblue: "f0f8ff",
antiquewhite: "faebd7",
aqua: "0ff",
aquamarine: "7fffd4",
azure: "f0ffff",
beige: "f5f5dc",
bisque: "ffe4c4",
black: "000",
blanchedalmond: "ffebcd",
blue: "00f",
blueviolet: "8a2be2",
brown: "a52a2a",
burlywood: "deb887",
burntsienna: "ea7e5d",
cadetblue: "5f9ea0",
chartreuse: "7fff00",
chocolate: "d2691e",
coral: "ff7f50",
cornflowerblue: "6495ed",
cornsilk: "fff8dc",
crimson: "dc143c",
cyan: "0ff",
darkblue: "00008b",
darkcyan: "008b8b",
darkgoldenrod: "b8860b",
darkgray: "a9a9a9",
darkgreen: "006400",
darkgrey: "a9a9a9",
darkkhaki: "bdb76b",
darkmagenta: "8b008b",
darkolivegreen: "556b2f",
darkorange: "ff8c00",
darkorchid: "9932cc",
darkred: "8b0000",
darksalmon: "e9967a",
darkseagreen: "8fbc8f",
darkslateblue: "483d8b",
darkslategray: "2f4f4f",
darkslategrey: "2f4f4f",
darkturquoise: "00ced1",
darkviolet: "9400d3",
deeppink: "ff1493",
deepskyblue: "00bfff",
dimgray: "696969",
dimgrey: "696969",
dodgerblue: "1e90ff",
firebrick: "b22222",
floralwhite: "fffaf0",
forestgreen: "228b22",
fuchsia: "f0f",
gainsboro: "dcdcdc",
ghostwhite: "f8f8ff",
gold: "ffd700",
goldenrod: "daa520",
gray: "808080",
green: "008000",
greenyellow: "adff2f",
grey: "808080",
honeydew: "f0fff0",
hotpink: "ff69b4",
indianred: "cd5c5c",
indigo: "4b0082",
ivory: "fffff0",
khaki: "f0e68c",
lavender: "e6e6fa",
lavenderblush: "fff0f5",
lawngreen: "7cfc00",
lemonchiffon: "fffacd",
lightblue: "add8e6",
lightcoral: "f08080",
lightcyan: "e0ffff",
lightgoldenrodyellow: "fafad2",
lightgray: "d3d3d3",
lightgreen: "90ee90",
lightgrey: "d3d3d3",
lightpink: "ffb6c1",
lightsalmon: "ffa07a",
lightseagreen: "20b2aa",
lightskyblue: "87cefa",
lightslategray: "789",
lightslategrey: "789",
lightsteelblue: "b0c4de",
lightyellow: "ffffe0",
lime: "0f0",
limegreen: "32cd32",
linen: "faf0e6",
magenta: "f0f",
maroon: "800000",
mediumaquamarine: "66cdaa",
mediumblue: "0000cd",
mediumorchid: "ba55d3",
mediumpurple: "9370db",
mediumseagreen: "3cb371",
mediumslateblue: "7b68ee",
mediumspringgreen: "00fa9a",
mediumturquoise: "48d1cc",
mediumvioletred: "c71585",
midnightblue: "191970",
mintcream: "f5fffa",
mistyrose: "ffe4e1",
moccasin: "ffe4b5",
navajowhite: "ffdead",
navy: "000080",
oldlace: "fdf5e6",
olive: "808000",
olivedrab: "6b8e23",
orange: "ffa500",
orangered: "ff4500",
orchid: "da70d6",
palegoldenrod: "eee8aa",
palegreen: "98fb98",
paleturquoise: "afeeee",
palevioletred: "db7093",
papayawhip: "ffefd5",
peachpuff: "ffdab9",
peru: "cd853f",
pink: "ffc0cb",
plum: "dda0dd",
powderblue: "b0e0e6",
purple: "800080",
rebeccapurple: "663399",
red: "f00",
rosybrown: "bc8f8f",
royalblue: "4169e1",
saddlebrown: "8b4513",
salmon: "fa8072",
sandybrown: "f4a460",
seagreen: "2e8b57",
seashell: "fff5ee",
sienna: "a0522d",
silver: "c0c0c0",
skyblue: "87ceeb",
slateblue: "6a5acd",
slategray: "708090",
slategrey: "708090",
snow: "fffafa",
springgreen: "00ff7f",
steelblue: "4682b4",
tan: "d2b48c",
teal: "008080",
thistle: "d8bfd8",
tomato: "ff6347",
turquoise: "40e0d0",
violet: "ee82ee",
wheat: "f5deb3",
white: "fff",
whitesmoke: "f5f5f5",
yellow: "ff0",
yellowgreen: "9acd32"
};
// Make it easy to access colors via `hexNames[hex]`
var hexNames = tinycolor.hexNames = flip(names);
// Utilities
// ---------
// `{ 'name1': 'val1' }` becomes `{ 'val1': 'name1' }`
function flip(o) {
var flipped = {};
for (var i in o) {
if (o.hasOwnProperty(i)) {
flipped[o[i]] = i;
}
}
return flipped;
}
// Return a valid alpha value [0,1] with all invalid values being set to 1
function boundAlpha(a) {
a = parseFloat(a);
if (isNaN(a) || a < 0 || a > 1) {
a = 1;
}
return a;
}
// Take input from [0, n] and return it as [0, 1]
function bound01(n, max) {
if (isOnePointZero(n)) n = "100%";
var processPercent = isPercentage(n);
n = Math.min(max, Math.max(0, parseFloat(n)));
// Automatically convert percentage into number
if (processPercent) {
n = parseInt(n * max, 10) / 100;
}
// Handle floating point rounding errors
if (Math.abs(n - max) < 0.000001) {
return 1;
}
// Convert into [0, 1] range if it isn't already
return n % max / parseFloat(max);
}
// Force a number between 0 and 1
function clamp01(val) {
return Math.min(1, Math.max(0, val));
}
// Parse a base-16 hex value into a base-10 integer
function parseIntFromHex(val) {
return parseInt(val, 16);
}
// Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1
// <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0>
function isOnePointZero(n) {
return typeof n == "string" && n.indexOf(".") != -1 && parseFloat(n) === 1;
}
// Check to see if string passed in is a percentage
function isPercentage(n) {
return typeof n === "string" && n.indexOf("%") != -1;
}
// Force a hex value to have 2 characters
function pad2(c) {
return c.length == 1 ? "0" + c : "" + c;
}
// Replace a decimal with it's percentage value
function convertToPercentage(n) {
if (n <= 1) {
n = n * 100 + "%";
}
return n;
}
// Converts a decimal to a hex value
function convertDecimalToHex(d) {
return Math.round(parseFloat(d) * 255).toString(16);
}
// Converts a hex value to a decimal
function convertHexToDecimal(h) {
return parseIntFromHex(h) / 255;
}
var matchers = function () {
// <http://www.w3.org/TR/css3-values/#integers>
var CSS_INTEGER = "[-\\+]?\\d+%?";
// <http://www.w3.org/TR/css3-values/#number-value>
var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?";
// Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.
var CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")";
// Actual matching.
// Parentheses and commas are optional, but not required.
// Whitespace can take the place of commas or opening paren
var PERMISSIVE_MATCH3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
var PERMISSIVE_MATCH4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
return {
CSS_UNIT: new RegExp(CSS_UNIT),
rgb: new RegExp("rgb" + PERMISSIVE_MATCH3),
rgba: new RegExp("rgba" + PERMISSIVE_MATCH4),
hsl: new RegExp("hsl" + PERMISSIVE_MATCH3),
hsla: new RegExp("hsla" + PERMISSIVE_MATCH4),
hsv: new RegExp("hsv" + PERMISSIVE_MATCH3),
hsva: new RegExp("hsva" + PERMISSIVE_MATCH4),
hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
};
}();
// `isValidCSSUnit`
// Take in a single string / number and check to see if it looks like a CSS unit
// (see `matchers` above for definition).
function isValidCSSUnit(color) {
return !!matchers.CSS_UNIT.exec(color);
}
// `stringInputToObject`
// Permissive string parsing. Take in a number of formats, and output an object
// based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`
function stringInputToObject(color) {
color = color.replace(trimLeft, "").replace(trimRight, "").toLowerCase();
var named = false;
if (names[color]) {
color = names[color];
named = true;
} else if (color == "transparent") {
return {
r: 0,
g: 0,
b: 0,
a: 0,
format: "name"
};
}
// Try to match string input using regular expressions.
// Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]
// Just return an object and let the conversion functions handle that.
// This way the result will be the same whether the tinycolor is initialized with string or object.
var match;
if (match = matchers.rgb.exec(color)) {
return {
r: match[1],
g: match[2],
b: match[3]
};
}
if (match = matchers.rgba.exec(color)) {
return {
r: match[1],
g: match[2],
b: match[3],
a: match[4]
};
}
if (match = matchers.hsl.exec(color)) {
return {
h: match[1],
s: match[2],
l: match[3]
};
}
if (match = matchers.hsla.exec(color)) {
return {
h: match[1],
s: match[2],
l: match[3],
a: match[4]
};
}
if (match = matchers.hsv.exec(color)) {
return {
h: match[1],
s: match[2],
v: match[3]
};
}
if (match = matchers.hsva.exec(color)) {
return {
h: match[1],
s: match[2],
v: match[3],
a: match[4]
};
}
if (match = matchers.hex8.exec(color)) {
return {
r: parseIntFromHex(match[1]),
g: parseIntFromHex(match[2]),
b: parseIntFromHex(match[3]),
a: convertHexToDecimal(match[4]),
format: named ? "name" : "hex8"
};
}
if (match = matchers.hex6.exec(color)) {
return {
r: parseIntFromHex(match[1]),
g: parseIntFromHex(match[2]),
b: parseIntFromHex(match[3]),
format: named ? "name" : "hex"
};
}
if (match = matchers.hex4.exec(color)) {
return {
r: parseIntFromHex(match[1] + "" + match[1]),
g: parseIntFromHex(match[2] + "" + match[2]),
b: parseIntFromHex(match[3] + "" + match[3]),
a: convertHexToDecimal(match[4] + "" + match[4]),
format: named ? "name" : "hex8"
};
}
if (match = matchers.hex3.exec(color)) {
return {
r: parseIntFromHex(match[1] + "" + match[1]),
g: parseIntFromHex(match[2] + "" + match[2]),
b: parseIntFromHex(match[3] + "" + match[3]),
format: named ? "name" : "hex"
};
}
return false;
}
function validateWCAG2Parms(parms) {
// return valid WCAG2 parms for isReadable.
// If input parms are invalid, return {"level":"AA", "size":"small"}
var level, size;
parms = parms || {
level: "AA",
size: "small"
};
level = (parms.level || "AA").toUpperCase();
size = (parms.size || "small").toLowerCase();
if (level !== "AA" && level !== "AAA") {
level = "AA";
}
if (size !== "small" && size !== "large") {
size = "small";
}
return {
level: level,
size: size
};
}
return tinycolor;
}));
/***/ }),
/***/ 8622:
/***/ ((module) => {
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __reExport = (target, module2, copyDefault, desc) => {
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
for (let key of __getOwnPropNames(module2))
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
}
return target;
};
var __toCommonJS = /* @__PURE__ */ ((cache) => {
return (module2, temp) => {
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
};
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
var __publicField = (obj, key, value) => {
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
return value;
};
// src/index.ts
var src_exports = {};
__export(src_exports, {
applyPalette: () => applyPalette,
applyPaletteSync: () => applyPaletteSync,
buildPalette: () => buildPalette,
buildPaletteSync: () => buildPaletteSync,
constants: () => constants_exports,
conversion: () => conversion_exports,
distance: () => distance_exports,
image: () => image_exports,
palette: () => palette_exports,
quality: () => quality_exports,
utils: () => utils_exports
});
// src/constants/index.ts
var constants_exports = {};
__export(constants_exports, {
bt709: () => bt709_exports
});
// src/constants/bt709.ts
var bt709_exports = {};
__export(bt709_exports, {
Y: () => Y,
x: () => x,
y: () => y
});
var Y = /* @__PURE__ */ ((Y2) => {
Y2[Y2["RED"] = 0.2126] = "RED";
Y2[Y2["GREEN"] = 0.7152] = "GREEN";
Y2[Y2["BLUE"] = 0.0722] = "BLUE";
Y2[Y2["WHITE"] = 1] = "WHITE";
return Y2;
})(Y || {});
var x = /* @__PURE__ */ ((x2) => {
x2[x2["RED"] = 0.64] = "RED";
x2[x2["GREEN"] = 0.3] = "GREEN";
x2[x2["BLUE"] = 0.15] = "BLUE";
x2[x2["WHITE"] = 0.3127] = "WHITE";
return x2;
})(x || {});
var y = /* @__PURE__ */ ((y2) => {
y2[y2["RED"] = 0.33] = "RED";
y2[y2["GREEN"] = 0.6] = "GREEN";
y2[y2["BLUE"] = 0.06] = "BLUE";
y2[y2["WHITE"] = 0.329] = "WHITE";
return y2;
})(y || {});
// src/conversion/index.ts
var conversion_exports = {};
__export(conversion_exports, {
lab2rgb: () => lab2rgb,
lab2xyz: () => lab2xyz,
rgb2hsl: () => rgb2hsl,
rgb2lab: () => rgb2lab,
rgb2xyz: () => rgb2xyz,
xyz2lab: () => xyz2lab,
xyz2rgb: () => xyz2rgb
});
// src/conversion/rgb2xyz.ts
function correctGamma(n) {
return n > 0.04045 ? ((n + 0.055) / 1.055) ** 2.4 : n / 12.92;
}
function rgb2xyz(r, g, b) {
r = correctGamma(r / 255);
g = correctGamma(g / 255);
b = correctGamma(b / 255);
return {
x: r * 0.4124 + g * 0.3576 + b * 0.1805,
y: r * 0.2126 + g * 0.7152 + b * 0.0722,
z: r * 0.0193 + g * 0.1192 + b * 0.9505
};
}
// src/utils/arithmetic.ts
var arithmetic_exports = {};
__export(arithmetic_exports, {
degrees2radians: () => degrees2radians,
inRange0to255: () => inRange0to255,
inRange0to255Rounded: () => inRange0to255Rounded,
intInRange: () => intInRange,
max3: () => max3,
min3: () => min3,
stableSort: () => stableSort
});
function degrees2radians(n) {
return n * (Math.PI / 180);
}
function max3(a, b, c) {
let m = a;
if (m < b)
m = b;
if (m < c)
m = c;
return m;
}
function min3(a, b, c) {
let m = a;
if (m > b)
m = b;
if (m > c)
m = c;
return m;
}
function intInRange(value, low, high) {
if (value > high)
value = high;
if (value < low)
value = low;
return value | 0;
}
function inRange0to255Rounded(n) {
n = Math.round(n);
if (n > 255)
n = 255;
else if (n < 0)
n = 0;
return n;
}
function inRange0to255(n) {
if (n > 255)
n = 255;
else if (n < 0)
n = 0;
return n;
}
function stableSort(arrayToSort, callback) {
const type = typeof arrayToSort[0];
let sorted;
if (type === "number" || type === "string") {
const ord = /* @__PURE__ */ Object.create(null);
for (let i = 0, l = arrayToSort.length; i < l; i++) {
const val = arrayToSort[i];
if (ord[val] || ord[val] === 0)
continue;
ord[val] = i;
}
sorted = arrayToSort.sort((a, b) => callback(a, b) || ord[a] - ord[b]);
} else {
const ord2 = arrayToSort.slice(0);
sorted = arrayToSort.sort((a, b) => callback(a, b) || ord2.indexOf(a) - ord2.indexOf(b));
}
return sorted;
}
// src/conversion/rgb2hsl.ts
function rgb2hsl(r, g, b) {
const min = min3(r, g, b);
const max = max3(r, g, b);
const delta = max - min;
const l = (min + max) / 510;
let s = 0;
if (l > 0 && l < 1)
s = delta / (l < 0.5 ? max + min : 510 - max - min);
let h = 0;
if (delta > 0) {
if (max === r) {
h = (g - b) / delta;
} else if (max === g) {
h = 2 + (b - r) / delta;
} else {
h = 4 + (r - g) / delta;
}
h *= 60;
if (h < 0)
h += 360;
}
return { h, s, l };
}
// src/conversion/xyz2lab.ts
var refX = 0.95047;
var refY = 1;
var refZ = 1.08883;
function pivot(n) {
return n > 8856e-6 ? n ** (1 / 3) : 7.787 * n + 16 / 116;
}
function xyz2lab(x2, y2, z) {
x2 = pivot(x2 / refX);
y2 = pivot(y2 / refY);
z = pivot(z / refZ);
if (116 * y2 - 16 < 0)
throw new Error("xxx");
return {
L: Math.max(0, 116 * y2 - 16),
a: 500 * (x2 - y2),
b: 200 * (y2 - z)
};
}
// src/conversion/rgb2lab.ts
function rgb2lab(r, g, b) {
const xyz = rgb2xyz(r, g, b);
return xyz2lab(xyz.x, xyz.y, xyz.z);
}
// src/conversion/lab2xyz.ts
var refX2 = 0.95047;
var refY2 = 1;
var refZ2 = 1.08883;
function pivot2(n) {
return n > 0.206893034 ? n ** 3 : (n - 16 / 116) / 7.787;
}
function lab2xyz(L, a, b) {
const y2 = (L + 16) / 116;
const x2 = a / 500 + y2;
const z = y2 - b / 200;
return {
x: refX2 * pivot2(x2),
y: refY2 * pivot2(y2),
z: refZ2 * pivot2(z)
};
}
// src/conversion/xyz2rgb.ts
function correctGamma2(n) {
return n > 31308e-7 ? 1.055 * n ** (1 / 2.4) - 0.055 : 12.92 * n;
}
function xyz2rgb(x2, y2, z) {
const r = correctGamma2(x2 * 3.2406 + y2 * -1.5372 + z * -0.4986);
const g = correctGamma2(x2 * -0.9689 + y2 * 1.8758 + z * 0.0415);
const b = correctGamma2(x2 * 0.0557 + y2 * -0.204 + z * 1.057);
return {
r: inRange0to255Rounded(r * 255),
g: inRange0to255Rounded(g * 255),
b: inRange0to255Rounded(b * 255)
};
}
// src/conversion/lab2rgb.ts
function lab2rgb(L, a, b) {
const xyz = lab2xyz(L, a, b);
return xyz2rgb(xyz.x, xyz.y, xyz.z);
}
// src/distance/index.ts
var distance_exports = {};
__export(distance_exports, {
AbstractDistanceCalculator: () => AbstractDistanceCalculator,
AbstractEuclidean: () => AbstractEuclidean,
AbstractManhattan: () => AbstractManhattan,
CIE94GraphicArts: () => CIE94GraphicArts,
CIE94Textiles: () => CIE94Textiles,
CIEDE2000: () => CIEDE2000,
CMetric: () => CMetric,
Euclidean: () => Euclidean,
EuclideanBT709: () => EuclideanBT709,
EuclideanBT709NoAlpha: () => EuclideanBT709NoAlpha,
Manhattan: () => Manhattan,
ManhattanBT709: () => ManhattanBT709,
ManhattanNommyde: () => ManhattanNommyde,
PNGQuant: () => PNGQuant
});
// src/distance/distanceCalculator.ts
var AbstractDistanceCalculator = class {
constructor() {
__publicField(this, "_maxDistance");
__publicField(this, "_whitePoint");
this._setDefaults();
this.setWhitePoint(255, 255, 255, 255);
}
setWhitePoint(r, g, b, a) {
this._whitePoint = {
r: r > 0 ? 255 / r : 0,
g: g > 0 ? 255 / g : 0,
b: b > 0 ? 255 / b : 0,
a: a > 0 ? 255 / a : 0
};
this._maxDistance = this.calculateRaw(r, g, b, a, 0, 0, 0, 0);
}
calculateNormalized(colorA, colorB) {
return this.calculateRaw(colorA.r, colorA.g, colorA.b, colorA.a, colorB.r, colorB.g, colorB.b, colorB.a) / this._maxDistance;
}
};
// src/distance/cie94.ts
var AbstractCIE94 = class extends AbstractDistanceCalculator {
calculateRaw(r1, g1, b1, a1, r2, g2, b2, a2) {
const lab1 = rgb2lab(inRange0to255(r1 * this._whitePoint.r), inRange0to255(g1 * this._whitePoint.g), inRange0to255(b1 * this._whitePoint.b));
const lab2 = rgb2lab(inRange0to255(r2 * this._whitePoint.r), inRange0to255(g2 * this._whitePoint.g), inRange0to255(b2 * this._whitePoint.b));
const dL = lab1.L - lab2.L;
const dA = lab1.a - lab2.a;
const dB = lab1.b - lab2.b;
const c1 = Math.sqrt(lab1.a * lab1.a + lab1.b * lab1.b);
const c2 = Math.sqrt(lab2.a * lab2.a + lab2.b * lab2.b);
const dC = c1 - c2;
let deltaH = dA * dA + dB * dB - dC * dC;
deltaH = deltaH < 0 ? 0 : Math.sqrt(deltaH);
const dAlpha = (a2 - a1) * this._whitePoint.a * this._kA;
return Math.sqrt((dL / this._Kl) ** 2 + (dC / (1 + this._K1 * c1)) ** 2 + (deltaH / (1 + this._K2 * c1)) ** 2 + dAlpha ** 2);
}
};
var CIE94Textiles = class extends AbstractCIE94 {
_setDefaults() {
this._Kl = 2;
this._K1 = 0.048;
this._K2 = 0.014;
this._kA = 0.25 * 50 / 255;
}
};
var CIE94GraphicArts = class extends AbstractCIE94 {
_setDefaults() {
this._Kl = 1;
this._K1 = 0.045;
this._K2 = 0.015;
this._kA = 0.25 * 100 / 255;
}
};
// src/distance/ciede2000.ts
var _CIEDE2000 = class extends AbstractDistanceCalculator {
_setDefaults() {
}
static _calculatehp(b, ap) {
const hp = Math.atan2(b, ap);
if (hp >= 0)
return hp;
return hp + _CIEDE2000._deg360InRad;
}
static _calculateRT(ahp, aCp) {
const aCp_to_7 = aCp ** 7;
const R_C = 2 * Math.sqrt(aCp_to_7 / (aCp_to_7 + _CIEDE2000._pow25to7));
const delta_theta = _CIEDE2000._deg30InRad * Math.exp(-(((ahp - _CIEDE2000._deg275InRad) / _CIEDE2000._deg25InRad) ** 2));
return -Math.sin(2 * delta_theta) * R_C;
}
static _calculateT(ahp) {
return 1 - 0.17 * Math.cos(ahp - _CIEDE2000._deg30InRad) + 0.24 * Math.cos(ahp * 2) + 0.32 * Math.cos(ahp * 3 + _CIEDE2000._deg6InRad) - 0.2 * Math.cos(ahp * 4 - _CIEDE2000._deg63InRad);
}
static _calculate_ahp(C1pC2p, h_bar, h1p, h2p) {
const hpSum = h1p + h2p;
if (C1pC2p === 0)
return hpSum;
if (h_bar <= _CIEDE2000._deg180InRad)
return hpSum / 2;
if (hpSum < _CIEDE2000._deg360InRad) {
return (hpSum + _CIEDE2000._deg360InRad) / 2;
}
return (hpSum - _CIEDE2000._deg360InRad) / 2;
}
static _calculate_dHp(C1pC2p, h_bar, h2p, h1p) {
let dhp;
if (C1pC2p === 0) {
dhp = 0;
} else if (h_bar <= _CIEDE2000._deg180InRad) {
dhp = h2p - h1p;
} else if (h2p <= h1p) {
dhp = h2p - h1p + _CIEDE2000._deg360InRad;
} else {
dhp = h2p - h1p - _CIEDE2000._deg360InRad;
}
return 2 * Math.sqrt(C1pC2p) * Math.sin(dhp / 2);
}
calculateRaw(r1, g1, b1, a1, r2, g2, b2, a2) {
const lab1 = rgb2lab(inRange0to255(r1 * this._whitePoint.r), inRange0to255(g1 * this._whitePoint.g), inRange0to255(b1 * this._whitePoint.b));
const lab2 = rgb2lab(inRange0to255(r2 * this._whitePoint.r), inRange0to255(g2 * this._whitePoint.g), inRange0to255(b2 * this._whitePoint.b));
const dA = (a2 - a1) * this._whitePoint.a * _CIEDE2000._kA;
const dE2 = this.calculateRawInLab(lab1, lab2);
return Math.sqrt(dE2 + dA * dA);
}
calculateRawInLab(Lab1, Lab2) {
const L1 = Lab1.L;
const a1 = Lab1.a;
const b1 = Lab1.b;
const L2 = Lab2.L;
const a2 = Lab2.a;
const b2 = Lab2.b;
const C1 = Math.sqrt(a1 * a1 + b1 * b1);
const C2 = Math.sqrt(a2 * a2 + b2 * b2);
const pow_a_C1_C2_to_7 = ((C1 + C2) / 2) ** 7;
const G = 0.5 * (1 - Math.sqrt(pow_a_C1_C2_to_7 / (pow_a_C1_C2_to_7 + _CIEDE2000._pow25to7)));
const a1p = (1 + G) * a1;
const a2p = (1 + G) * a2;
const C1p = Math.sqrt(a1p * a1p + b1 * b1);
const C2p = Math.sqrt(a2p * a2p + b2 * b2);
const C1pC2p = C1p * C2p;
const h1p = _CIEDE2000._calculatehp(b1, a1p);
const h2p = _CIEDE2000._calculatehp(b2, a2p);
const h_bar = Math.abs(h1p - h2p);
const dLp = L2 - L1;
const dCp = C2p - C1p;
const dHp = _CIEDE2000._calculate_dHp(C1pC2p, h_bar, h2p, h1p);
const ahp = _CIEDE2000._calculate_ahp(C1pC2p, h_bar, h1p, h2p);
const T = _CIEDE2000._calculateT(ahp);
const aCp = (C1p + C2p) / 2;
const aLp_minus_50_square = ((L1 + L2) / 2 - 50) ** 2;
const S_L = 1 + 0.015 * aLp_minus_50_square / Math.sqrt(20 + aLp_minus_50_square);
const S_C = 1 + 0.045 * aCp;
const S_H = 1 + 0.015 * T * aCp;
const R_T = _CIEDE2000._calculateRT(ahp, aCp);
const dLpSL = dLp / S_L;
const dCpSC = dCp / S_C;
const dHpSH = dHp / S_H;
return dLpSL ** 2 + dCpSC ** 2 + dHpSH ** 2 + R_T * dCpSC * dHpSH;
}
};
var CIEDE2000 = _CIEDE2000;
__publicField(CIEDE2000, "_kA", 0.25 * 100 / 255);
__publicField(CIEDE2000, "_pow25to7", 25 ** 7);
__publicField(CIEDE2000, "_deg360InRad", degrees2radians(360));
__publicField(CIEDE2000, "_deg180InRad", degrees2radians(180));
__publicField(CIEDE2000, "_deg30InRad", degrees2radians(30));
__publicField(CIEDE2000, "_deg6InRad", degrees2radians(6));
__publicField(CIEDE2000, "_deg63InRad", degrees2radians(63));
__publicField(CIEDE2000, "_deg275InRad", degrees2radians(275));
__publicField(CIEDE2000, "_deg25InRad", degrees2radians(25));
// src/distance/cmetric.ts
var CMetric = class extends AbstractDistanceCalculator {
calculateRaw(r1, g1, b1, a1, r2, g2, b2, a2) {
const rmean = (r1 + r2) / 2 * this._whitePoint.r;
const r = (r1 - r2) * this._whitePoint.r;
const g = (g1 - g2) * this._whitePoint.g;
const b = (b1 - b2) * this._whitePoint.b;
const dE = ((512 + rmean) * r * r >> 8) + 4 * g * g + ((767 - rmean) * b * b >> 8);
const dA = (a2 - a1) * this._whitePoint.a;
return Math.sqrt(dE + dA * dA);
}
_setDefaults() {
}
};
// src/distance/euclidean.ts
var AbstractEuclidean = class extends AbstractDistanceCalculator {
calculateRaw(r1, g1, b1, a1, r2, g2, b2, a2) {
const dR = r2 - r1;
const dG = g2 - g1;
const dB = b2 - b1;
const dA = a2 - a1;
return Math.sqrt(this._kR * dR * dR + this._kG * dG * dG + this._kB * dB * dB + this._kA * dA * dA);
}
};
var Euclidean = class extends AbstractEuclidean {
_setDefaults() {
this._kR = 1;
this._kG = 1;
this._kB = 1;
this._kA = 1;
}
};
var EuclideanBT709 = class extends AbstractEuclidean {
_setDefaults() {
this._kR = 0.2126 /* RED */;
this._kG = 0.7152 /* GREEN */;
this._kB = 0.0722 /* BLUE */;
this._kA = 1;
}
};
var EuclideanBT709NoAlpha = class extends AbstractEuclidean {
_setDefaults() {
this._kR = 0.2126 /* RED */;
this._kG = 0.7152 /* GREEN */;
this._kB = 0.0722 /* BLUE */;
this._kA = 0;
}
};
// src/distance/manhattan.ts
var AbstractManhattan = class extends AbstractDistanceCalculator {
calculateRaw(r1, g1, b1, a1, r2, g2, b2, a2) {
let dR = r2 - r1;
let dG = g2 - g1;
let dB = b2 - b1;
let dA = a2 - a1;
if (dR < 0)
dR = 0 - dR;
if (dG < 0)
dG = 0 - dG;
if (dB < 0)
dB = 0 - dB;
if (dA < 0)
dA = 0 - dA;
return this._kR * dR + this._kG * dG + this._kB * dB + this._kA * dA;
}
};
var Manhattan = class extends AbstractManhattan {
_setDefaults() {
this._kR = 1;
this._kG = 1;
this._kB = 1;
this._kA = 1;
}
};
var ManhattanNommyde = class extends AbstractManhattan {
_setDefaults() {
this._kR = 0.4984;
this._kG = 0.8625;
this._kB = 0.2979;
this._kA = 1;
}
};
var ManhattanBT709 = class extends AbstractManhattan {
_setDefaults() {
this._kR = 0.2126 /* RED */;
this._kG = 0.7152 /* GREEN */;
this._kB = 0.0722 /* BLUE */;
this._kA = 1;
}
};
// src/distance/pngQuant.ts
var PNGQuant = class extends AbstractDistanceCalculator {
calculateRaw(r1, g1, b1, a1, r2, g2, b2, a2) {
const alphas = (a2 - a1) * this._whitePoint.a;
return this._colordifferenceCh(r1 * this._whitePoint.r, r2 * this._whitePoint.r, alphas) + this._colordifferenceCh(g1 * this._whitePoint.g, g2 * this._whitePoint.g, alphas) + this._colordifferenceCh(b1 * this._whitePoint.b, b2 * this._whitePoint.b, alphas);
}
_colordifferenceCh(x2, y2, alphas) {
const black = x2 - y2;
const white = black + alphas;
return black * black + white * white;
}
_setDefaults() {
}
};
// src/palette/index.ts
var palette_exports = {};
__export(palette_exports, {
AbstractPaletteQuantizer: () => AbstractPaletteQuantizer,
ColorHistogram: () => ColorHistogram,
NeuQuant: () => NeuQuant,
NeuQuantFloat: () => NeuQuantFloat,
RGBQuant: () => RGBQuant,
WuColorCube: () => WuColorCube,
WuQuant: () => WuQuant
});
// src/palette/paletteQuantizer.ts
var AbstractPaletteQuantizer = class {
quantizeSync() {
for (const value of this.quantize()) {
if (value.palette) {
return value.palette;
}
}
throw new Error("unreachable");
}
};
// src/utils/point.ts
var Point = class {
constructor() {
__publicField(this, "r");
__publicField(this, "g");
__publicField(this, "b");
__publicField(this, "a");
__publicField(this, "uint32");
__publicField(this, "rgba");
this.uint32 = -1 >>> 0;
this.r = this.g = this.b = this.a = 0;
this.rgba = new Array(4);
this.rgba[0] = 0;
this.rgba[1] = 0;
this.rgba[2] = 0;
this.rgba[3] = 0;
}
static createByQuadruplet(quadruplet) {
const point = new Point();
point.r = quadruplet[0] | 0;
point.g = quadruplet[1] | 0;
point.b = quadruplet[2] | 0;
point.a = quadruplet[3] | 0;
point._loadUINT32();
point._loadQuadruplet();
return point;
}
static createByRGBA(red, green, blue, alpha) {
const point = new Point();
point.r = red | 0;
point.g = green | 0;
point.b = blue | 0;
point.a = alpha | 0;
point._loadUINT32();
point._loadQuadruplet();
return point;
}
static createByUint32(uint32) {
const point = new Point();
point.uint32 = uint32 >>> 0;
point._loadRGBA();
point._loadQuadruplet();
return point;
}
from(point) {
this.r = point.r;
this.g = point.g;
this.b = point.b;
this.a = point.a;
this.uint32 = point.uint32;
this.rgba[0] = point.r;
this.rgba[1] = point.g;
this.rgba[2] = point.b;
this.rgba[3] = point.a;
}
getLuminosity(useAlphaChannel) {
let r = this.r;
let g = this.g;
let b = this.b;
if (useAlphaChannel) {
r = Math.min(255, 255 - this.a + this.a * r / 255);
g = Math.min(255, 255 - this.a + this.a * g / 255);
b = Math.min(255, 255 - this.a + this.a * b / 255);
}
return r * 0.2126 /* RED */ + g * 0.7152 /* GREEN */ + b * 0.0722 /* BLUE */;
}
_loadUINT32() {
this.uint32 = (this.a << 24 | this.b << 16 | this.g << 8 | this.r) >>> 0;
}
_loadRGBA() {
this.r = this.uint32 & 255;
this.g = this.uint32 >>> 8 & 255;
this.b = this.uint32 >>> 16 & 255;
this.a = this.uint32 >>> 24 & 255;
}
_loadQuadruplet() {
this.rgba[0] = this.r;
this.rgba[1] = this.g;
this.rgba[2] = this.b;
this.rgba[3] = this.a;
}
};
// src/utils/pointContainer.ts
var PointContainer = class {
constructor() {
__publicField(this, "_pointArray");
__publicField(this, "_width");
__publicField(this, "_height");
this._width = 0;
this._height = 0;
this._pointArray = [];
}
getWidth() {
return this._width;
}
getHeight() {
return this._height;
}
setWidth(width) {
this._width = width;
}
setHeight(height) {
this._height = height;
}
getPointArray() {
return this._pointArray;
}
clone() {
const clone = new PointContainer();
clone._width = this._width;
clone._height = this._height;
for (let i = 0, l = this._pointArray.length; i < l; i++) {
clone._pointArray[i] = Point.createByUint32(this._pointArray[i].uint32 | 0);
}
return clone;
}
toUint32Array() {
const l = this._pointArray.length;
const uint32Array = new Uint32Array(l);
for (let i = 0; i < l; i++) {
uint32Array[i] = this._pointArray[i].uint32;
}
return uint32Array;
}
toUint8Array() {
return new Uint8Array(this.toUint32Array().buffer);
}
static fromHTMLImageElement(img) {
const width = img.naturalWidth;
const height = img.naturalHeight;
const canvas = document.createElement("canvas");
canvas.width = width;
canvas.height = height;
const ctx = canvas.getContext("2d");
ctx.drawImage(img, 0, 0, width, height, 0, 0, width, height);
return PointContainer.fromHTMLCanvasElement(canvas);
}
static fromHTMLCanvasElement(canvas) {
const width = canvas.width;
const height = canvas.height;
const ctx = canvas.getContext("2d");
const imgData = ctx.getImageData(0, 0, width, height);
return PointContainer.fromImageData(imgData);
}
static fromImageData(imageData) {
const width = imageData.width;
const height = imageData.height;
return PointContainer.fromUint8Array(imageData.data, width, height);
}
static fromUint8Array(uint8Array, width, height) {
switch (Object.prototype.toString.call(uint8Array)) {
case "[object Uint8ClampedArray]":
case "[object Uint8Array]":
break;
default:
uint8Array = new Uint8Array(uint8Array);
}
const uint32Array = new Uint32Array(uint8Array.buffer);
return PointContainer.fromUint32Array(uint32Array, width, height);
}
static fromUint32Array(uint32Array, width, height) {
const container = new PointContainer();
container._width = width;
container._height = height;
for (let i = 0, l = uint32Array.length; i < l; i++) {
container._pointArray[i] = Point.createByUint32(uint32Array[i] | 0);
}
return container;
}
static fromBuffer(buffer, width, height) {
const uint32Array = new Uint32Array(buffer.buffer, buffer.byteOffset, buffer.byteLength / Uint32Array.BYTES_PER_ELEMENT);
return PointContainer.fromUint32Array(uint32Array, width, height);
}
};
// src/utils/palette.ts
var hueGroups = 10;
function hueGroup(hue, segmentsNumber) {
const maxHue = 360;
const seg = maxHue / segmentsNumber;
const half = seg / 2;
for (let i = 1, mid = seg - half; i < segmentsNumber; i++, mid += seg) {
if (hue >= mid && hue < mid + seg)
return i;
}
return 0;
}
var Palette = class {
constructor() {
__publicField(this, "_pointContainer");
__publicField(this, "_pointArray", []);
__publicField(this, "_i32idx", {});
this._pointContainer = new PointContainer();
this._pointContainer.setHeight(1);
this._pointArray = this._pointContainer.getPointArray();
}
add(color) {
this._pointArray.push(color);
this._pointContainer.setWidth(this._pointArray.length);
}
has(color) {
for (let i = this._pointArray.length - 1; i >= 0; i--) {
if (color.uint32 === this._pointArray[i].uint32)
return true;
}
return false;
}
getNearestColor(colorDistanceCalculator, color) {
return this._pointArray[this._getNearestIndex(colorDistanceCalculator, color) | 0];
}
getPointContainer() {
return this._pointContainer;
}
_nearestPointFromCache(key) {
return typeof this._i32idx[key] === "number" ? this._i32idx[key] : -1;
}
_getNearestIndex(colorDistanceCalculator, point) {
let idx = this._nearestPointFromCache("" + point.uint32);
if (idx >= 0)
return idx;
let minimalDistance = Number.MAX_VALUE;
idx = 0;
for (let i = 0, l = this._pointArray.length; i < l; i++) {
const p = this._pointArray[i];
const distance = colorDistanceCalculator.calculateRaw(point.r, point.g, point.b, point.a, p.r, p.g, p.b, p.a);
if (distance < minimalDistance) {
minimalDistance = distance;
idx = i;
}
}
this._i32idx[point.uint32] = idx;
return idx;
}
sort() {
this._i32idx = {};
this._pointArray.sort((a, b) => {
const hslA = rgb2hsl(a.r, a.g, a.b);
const hslB = rgb2hsl(b.r, b.g, b.b);
const hueA = a.r === a.g && a.g === a.b ? 0 : 1 + hueGroup(hslA.h, hueGroups);
const hueB = b.r === b.g && b.g === b.b ? 0 : 1 + hueGroup(hslB.h, hueGroups);
const hueDiff = hueB - hueA;
if (hueDiff)
return -hueDiff;
const lA = a.getLuminosity(true);
const lB = b.getLuminosity(true);
if (lB - lA !== 0)
return lB - lA;
const satDiff = (hslB.s * 100 | 0) - (hslA.s * 100 | 0);
if (satDiff)
return -satDiff;
return 0;
});
}
};
// src/utils/index.ts
var utils_exports = {};
__export(utils_exports, {
HueStatistics: () => HueStatistics,
Palette: () => Palette,
Point: () => Point,
PointContainer: () => PointContainer,
ProgressTracker: () => ProgressTracker,
arithmetic: () => arithmetic_exports
});
// src/utils/hueStatistics.ts
var HueGroup = class {
constructor() {
__publicField(this, "num", 0);
__publicField(this, "cols", []);
}
};
var HueStatistics = class {
constructor(numGroups, minCols) {
__publicField(this, "_numGroups");
__publicField(this, "_minCols");
__publicField(this, "_stats");
__publicField(this, "_groupsFull");
this._numGroups = numGroups;
this._minCols = minCols;
this._stats = [];
for (let i = 0; i <= numGroups; i++) {
this._stats[i] = new HueGroup();
}
this._groupsFull = 0;
}
check(i32) {
if (this._groupsFull === this._numGroups + 1) {
this.check = () => {
};
}
const r = i32 & 255;
const g = i32 >>> 8 & 255;
const b = i32 >>> 16 & 255;
const hg = r === g && g === b ? 0 : 1 + hueGroup(rgb2hsl(r, g, b).h, this._numGroups);
const gr = this._stats[hg];
const min = this._minCols;
gr.num++;
if (gr.num > min) {
return;
}
if (gr.num === min) {
this._groupsFull++;
}
if (gr.num <= min) {
this._stats[hg].cols.push(i32);
}
}
injectIntoDictionary(histG) {
for (let i = 0; i <= this._numGroups; i++) {
if (this._stats[i].num <= this._minCols) {
this._stats[i].cols.forEach((col) => {
if (!histG[col]) {
histG[col] = 1;
} else {
histG[col]++;
}
});
}
}
}
injectIntoArray(histG) {
for (let i = 0; i <= this._numGroups; i++) {
if (this._stats[i].num <= this._minCols) {
this._stats[i].cols.forEach((col) => {
if (histG.indexOf(col) === -1) {
histG.push(col);
}
});
}
}
}
};
// src/utils/progressTracker.ts
var _ProgressTracker = class {
constructor(valueRange, progressRange) {
__publicField(this, "progress");
__publicField(this, "_step");
__publicField(this, "_range");
__publicField(this, "_last");
__publicField(this, "_progressRange");
this._range = valueRange;
this._progressRange = progressRange;
this._step = Math.max(1, this._range / (_ProgressTracker.steps + 1) | 0);
this._last = -this._step;
this.progress = 0;
}
shouldNotify(current) {
if (current - this._last >= this._step) {
this._last = current;
this.progress = Math.min(this._progressRange * this._last / this._range, this._progressRange);
return true;
}
return false;
}
};
var ProgressTracker = _ProgressTracker;
__publicField(ProgressTracker, "steps", 100);
// src/palette/neuquant/neuquant.ts
var networkBiasShift = 3;
var Neuron = class {
constructor(defaultValue) {
__publicField(this, "r");
__publicField(this, "g");
__publicField(this, "b");
__publicField(this, "a");
this.r = this.g = this.b = this.a = defaultValue;
}
toPoint() {
return Point.createByRGBA(this.r >> networkBiasShift, this.g >> networkBiasShift, this.b >> networkBiasShift, this.a >> networkBiasShift);
}
subtract(r, g, b, a) {
this.r -= r | 0;
this.g -= g | 0;
this.b -= b | 0;
this.a -= a | 0;
}
};
var _NeuQuant = class extends AbstractPaletteQuantizer {
constructor(colorDistanceCalculator, colors = 256) {
super();
__publicField(this, "_pointArray");
__publicField(this, "_networkSize");
__publicField(this, "_network");
__publicField(this, "_sampleFactor");
__publicField(this, "_radPower");
__publicField(this, "_freq");
__publicField(this, "_bias");
__publicField(this, "_distance");
this._distance = colorDistanceCalculator;
this._pointArray = [];
this._sampleFactor = 1;
this._networkSize = colors;
this._distance.setWhitePoint(255 << networkBiasShift, 255 << networkBiasShift, 255 << networkBiasShift, 255 << networkBiasShift);
}
sample(pointContainer) {
this._pointArray = this._pointArray.concat(pointContainer.getPointArray());
}
*quantize() {
this._init();
yield* this._learn();
yield {
palette: this._buildPalette(),
progress: 100
};
}
_init() {
this._freq = [];
this._bias = [];
this._radPower = [];
this._network = [];
for (let i = 0; i < this._networkSize; i++) {
this._network[i] = new Neuron((i << networkBiasShift + 8) / this._networkSize | 0);
this._freq[i] = _NeuQuant._initialBias / this._networkSize | 0;
this._bias[i] = 0;
}
}
*_learn() {
let sampleFactor = this._sampleFactor;
const pointsNumber = this._pointArray.length;
if (pointsNumber < _NeuQuant._minpicturebytes)
sampleFactor = 1;
const alphadec = 30 + (sampleFactor - 1) / 3 | 0;
const pointsToSample = pointsNumber / sampleFactor | 0;
let delta = pointsToSample / _NeuQuant._nCycles | 0;
let alpha = _NeuQuant._initAlpha;
let radius = (this._networkSize >> 3) * _NeuQuant._radiusBias;
let rad = radius >> _NeuQuant._radiusBiasShift;
if (rad <= 1)
rad = 0;
for (let i = 0; i < rad; i++) {
this._radPower[i] = alpha * ((rad * rad - i * i) * _NeuQuant._radBias / (rad * rad)) >>> 0;
}
let step;
if (pointsNumber < _NeuQuant._minpicturebytes) {
step = 1;
} else if (pointsNumber % _NeuQuant._prime1 !== 0) {
step = _NeuQuant._prime1;
} else if (pointsNumber % _NeuQuant._prime2 !== 0) {
step = _NeuQuant._prime2;
} else if (pointsNumber % _NeuQuant._prime3 !== 0) {
step = _NeuQuant._prime3;
} else {
step = _NeuQuant._prime4;
}
const tracker = new ProgressTracker(pointsToSample, 99);
for (let i = 0, pointIndex = 0; i < pointsToSample; ) {
if (tracker.shouldNotify(i)) {
yield {
progress: tracker.progress
};
}
const point = this._pointArray[pointIndex];
const b = point.b << networkBiasShift;
const g = point.g << networkBiasShift;
const r = point.r << networkBiasShift;
const a = point.a << networkBiasShift;
const neuronIndex = this._contest(b, g, r, a);
this._alterSingle(alpha, neuronIndex, b, g, r, a);
if (rad !== 0)
this._alterNeighbour(rad, neuronIndex, b, g, r, a);
pointIndex += step;
if (pointIndex >= pointsNumber)
pointIndex -= pointsNumber;
i++;
if (delta === 0)
delta = 1;
if (i % delta === 0) {
alpha -= alpha / alphadec | 0;
radius -= radius / _NeuQuant._radiusDecrease | 0;
rad = radius >> _NeuQuant._radiusBiasShift;
if (rad <= 1)
rad = 0;
for (let j = 0; j < rad; j++) {
this._radPower[j] = alpha * ((rad * rad - j * j) * _NeuQuant._radBias / (rad * rad)) >>> 0;
}
}
}
}
_buildPalette() {
const palette = new Palette();
this._network.forEach((neuron) => {
palette.add(neuron.toPoint());
});
palette.sort();
return palette;
}
_alterNeighbour(rad, i, b, g, r, al) {
let lo = i - rad;
if (lo < -1)
lo = -1;
let hi = i + rad;
if (hi > this._networkSize)
hi = this._networkSize;
let j = i + 1;
let k = i - 1;
let m = 1;
while (j < hi || k > lo) {
const a = this._radPower[m++] / _NeuQuant._alphaRadBias;
if (j < hi) {
const p = this._network[j++];
p.subtract(a * (p.r - r), a * (p.g - g), a * (p.b - b), a * (p.a - al));
}
if (k > lo) {
const p = this._network[k--];
p.subtract(a * (p.r - r), a * (p.g - g), a * (p.b - b), a * (p.a - al));
}
}
}
_alterSingle(alpha, i, b, g, r, a) {
alpha /= _NeuQuant._initAlpha;
const n = this._network[i];
n.subtract(alpha * (n.r - r), alpha * (n.g - g), alpha * (n.b - b), alpha * (n.a - a));
}
_contest(b, g, r, a) {
const multiplier = 255 * 4 << networkBiasShift;
let bestd = ~(1 << 31);
let bestbiasd = bestd;
let bestpos = -1;
let bestbiaspos = bestpos;
for (let i = 0; i < this._networkSize; i++) {
const n = this._network[i];
const dist = this._distance.calculateNormalized(n, { r, g, b, a }) * multiplier | 0;
if (dist < bestd) {
bestd = dist;
bestpos = i;
}
const biasdist = dist - (this._bias[i] >> _NeuQuant._initialBiasShift - networkBiasShift);
if (biasdist < bestbiasd) {
bestbiasd = biasdist;
bestbiaspos = i;
}
const betafreq = this._freq[i] >> _NeuQuant._betaShift;
this._freq[i] -= betafreq;
this._bias[i] += betafreq << _NeuQuant._gammaShift;
}
this._freq[bestpos] += _NeuQuant._beta;
this._bias[bestpos] -= _NeuQuant._betaGamma;
return bestbiaspos;
}
};
var NeuQuant = _NeuQuant;
__publicField(NeuQuant, "_prime1", 499);
__publicField(NeuQuant, "_prime2", 491);
__publicField(NeuQuant, "_prime3", 487);
__publicField(NeuQuant, "_prime4", 503);
__publicField(NeuQuant, "_minpicturebytes", _NeuQuant._prime4);
__publicField(NeuQuant, "_nCycles", 100);
__publicField(NeuQuant, "_initialBiasShift", 16);
__publicField(NeuQuant, "_initialBias", 1 << _NeuQuant._initialBiasShift);
__publicField(NeuQuant, "_gammaShift", 10);
__publicField(NeuQuant, "_betaShift", 10);
__publicField(NeuQuant, "_beta", _NeuQuant._initialBias >> _NeuQuant._betaShift);
__publicField(NeuQuant, "_betaGamma", _NeuQuant._initialBias << _NeuQuant._gammaShift - _NeuQuant._betaShift);
__publicField(NeuQuant, "_radiusBiasShift", 6);
__publicField(NeuQuant, "_radiusBias", 1 << _NeuQuant._radiusBiasShift);
__publicField(NeuQuant, "_radiusDecrease", 30);
__publicField(NeuQuant, "_alphaBiasShift", 10);
__publicField(NeuQuant, "_initAlpha", 1 << _NeuQuant._alphaBiasShift);
__publicField(NeuQuant, "_radBiasShift", 8);
__publicField(NeuQuant, "_radBias", 1 << _NeuQuant._radBiasShift);
__publicField(NeuQuant, "_alphaRadBiasShift", _NeuQuant._alphaBiasShift + _NeuQuant._radBiasShift);
__publicField(NeuQuant, "_alphaRadBias", 1 << _NeuQuant._alphaRadBiasShift);
// src/palette/neuquant/neuquantFloat.ts
var networkBiasShift2 = 3;
var NeuronFloat = class {
constructor(defaultValue) {
__publicField(this, "r");
__publicField(this, "g");
__publicField(this, "b");
__publicField(this, "a");
this.r = this.g = this.b = this.a = defaultValue;
}
toPoint() {
return Point.createByRGBA(this.r >> networkBiasShift2, this.g >> networkBiasShift2, this.b >> networkBiasShift2, this.a >> networkBiasShift2);
}
subtract(r, g, b, a) {
this.r -= r;
this.g -= g;
this.b -= b;
this.a -= a;
}
};
var _NeuQuantFloat = class extends AbstractPaletteQuantizer {
constructor(colorDistanceCalculator, colors = 256) {
super();
__publicField(this, "_pointArray");
__publicField(this, "_networkSize");
__publicField(this, "_network");
__publicField(this, "_sampleFactor");
__publicField(this, "_radPower");
__publicField(this, "_freq");
__publicField(this, "_bias");
__publicField(this, "_distance");
this._distance = colorDistanceCalculator;
this._pointArray = [];
this._sampleFactor = 1;
this._networkSize = colors;
this._distance.setWhitePoint(255 << networkBiasShift2, 255 << networkBiasShift2, 255 << networkBiasShift2, 255 << networkBiasShift2);
}
sample(pointContainer) {
this._pointArray = this._pointArray.concat(pointContainer.getPointArray());
}
*quantize() {
this._init();
yield* this._learn();
yield {
palette: this._buildPalette(),
progress: 100
};
}
_init() {
this._freq = [];
this._bias = [];
this._radPower = [];
this._network = [];
for (let i = 0; i < this._networkSize; i++) {
this._network[i] = new NeuronFloat((i << networkBiasShift2 + 8) / this._networkSize);
this._freq[i] = _NeuQuantFloat._initialBias / this._networkSize;
this._bias[i] = 0;
}
}
*_learn() {
let sampleFactor = this._sampleFactor;
const pointsNumber = this._pointArray.length;
if (pointsNumber < _NeuQuantFloat._minpicturebytes)
sampleFactor = 1;
const alphadec = 30 + (sampleFactor - 1) / 3;
const pointsToSample = pointsNumber / sampleFactor;
let delta = pointsToSample / _NeuQuantFloat._nCycles | 0;
let alpha = _NeuQuantFloat._initAlpha;
let radius = (this._networkSize >> 3) * _NeuQuantFloat._radiusBias;
let rad = radius >> _NeuQuantFloat._radiusBiasShift;
if (rad <= 1)
rad = 0;
for (let i = 0; i < rad; i++) {
this._radPower[i] = alpha * ((rad * rad - i * i) * _NeuQuantFloat._radBias / (rad * rad));
}
let step;
if (pointsNumber < _NeuQuantFloat._minpicturebytes) {
step = 1;
} else if (pointsNumber % _NeuQuantFloat._prime1 !== 0) {
step = _NeuQuantFloat._prime1;
} else if (pointsNumber % _NeuQuantFloat._prime2 !== 0) {
step = _NeuQuantFloat._prime2;
} else if (pointsNumber % _NeuQuantFloat._prime3 !== 0) {
step = _NeuQuantFloat._prime3;
} else {
step = _NeuQuantFloat._prime4;
}
const tracker = new ProgressTracker(pointsToSample, 99);
for (let i = 0, pointIndex = 0; i < pointsToSample; ) {
if (tracker.shouldNotify(i)) {
yield {
progress: tracker.progress
};
}
const point = this._pointArray[pointIndex];
const b = point.b << networkBiasShift2;
const g = point.g << networkBiasShift2;
const r = point.r << networkBiasShift2;
const a = point.a << networkBiasShift2;
const neuronIndex = this._contest(b, g, r, a);
this._alterSingle(alpha, neuronIndex, b, g, r, a);
if (rad !== 0)
this._alterNeighbour(rad, neuronIndex, b, g, r, a);
pointIndex += step;
if (pointIndex >= pointsNumber)
pointIndex -= pointsNumber;
i++;
if (delta === 0)
delta = 1;
if (i % delta === 0) {
alpha -= alpha / alphadec;
radius -= radius / _NeuQuantFloat._radiusDecrease;
rad = radius >> _NeuQuantFloat._radiusBiasShift;
if (rad <= 1)
rad = 0;
for (let j = 0; j < rad; j++) {
this._radPower[j] = alpha * ((rad * rad - j * j) * _NeuQuantFloat._radBias / (rad * rad));
}
}
}
}
_buildPalette() {
const palette = new Palette();
this._network.forEach((neuron) => {
palette.add(neuron.toPoint());
});
palette.sort();
return palette;
}
_alterNeighbour(rad, i, b, g, r, al) {
let lo = i - rad;
if (lo < -1)
lo = -1;
let hi = i + rad;
if (hi > this._networkSize)
hi = this._networkSize;
let j = i + 1;
let k = i - 1;
let m = 1;
while (j < hi || k > lo) {
const a = this._radPower[m++] / _NeuQuantFloat._alphaRadBias;
if (j < hi) {
const p = this._network[j++];
p.subtract(a * (p.r - r), a * (p.g - g), a * (p.b - b), a * (p.a - al));
}
if (k > lo) {
const p = this._network[k--];
p.subtract(a * (p.r - r), a * (p.g - g), a * (p.b - b), a * (p.a - al));
}
}
}
_alterSingle(alpha, i, b, g, r, a) {
alpha /= _NeuQuantFloat._initAlpha;
const n = this._network[i];
n.subtract(alpha * (n.r - r), alpha * (n.g - g), alpha * (n.b - b), alpha * (n.a - a));
}
_contest(b, g, r, al) {
const multiplier = 255 * 4 << networkBiasShift2;
let bestd = ~(1 << 31);
let bestbiasd = bestd;
let bestpos = -1;
let bestbiaspos = bestpos;
for (let i = 0; i < this._networkSize; i++) {
const n = this._network[i];
const dist = this._distance.calculateNormalized(n, { r, g, b, a: al }) * multiplier;
if (dist < bestd) {
bestd = dist;
bestpos = i;
}
const biasdist = dist - (this._bias[i] >> _NeuQuantFloat._initialBiasShift - networkBiasShift2);
if (biasdist < bestbiasd) {
bestbiasd = biasdist;
bestbiaspos = i;
}
const betafreq = this._freq[i] >> _NeuQuantFloat._betaShift;
this._freq[i] -= betafreq;
this._bias[i] += betafreq << _NeuQuantFloat._gammaShift;
}
this._freq[bestpos] += _NeuQuantFloat._beta;
this._bias[bestpos] -= _NeuQuantFloat._betaGamma;
return bestbiaspos;
}
};
var NeuQuantFloat = _NeuQuantFloat;
__publicField(NeuQuantFloat, "_prime1", 499);
__publicField(NeuQuantFloat, "_prime2", 491);
__publicField(NeuQuantFloat, "_prime3", 487);
__publicField(NeuQuantFloat, "_prime4", 503);
__publicField(NeuQuantFloat, "_minpicturebytes", _NeuQuantFloat._prime4);
__publicField(NeuQuantFloat, "_nCycles", 100);
__publicField(NeuQuantFloat, "_initialBiasShift", 16);
__publicField(NeuQuantFloat, "_initialBias", 1 << _NeuQuantFloat._initialBiasShift);
__publicField(NeuQuantFloat, "_gammaShift", 10);
__publicField(NeuQuantFloat, "_betaShift", 10);
__publicField(NeuQuantFloat, "_beta", _NeuQuantFloat._initialBias >> _NeuQuantFloat._betaShift);
__publicField(NeuQuantFloat, "_betaGamma", _NeuQuantFloat._initialBias << _NeuQuantFloat._gammaShift - _NeuQuantFloat._betaShift);
__publicField(NeuQuantFloat, "_radiusBiasShift", 6);
__publicField(NeuQuantFloat, "_radiusBias", 1 << _NeuQuantFloat._radiusBiasShift);
__publicField(NeuQuantFloat, "_radiusDecrease", 30);
__publicField(NeuQuantFloat, "_alphaBiasShift", 10);
__publicField(NeuQuantFloat, "_initAlpha", 1 << _NeuQuantFloat._alphaBiasShift);
__publicField(NeuQuantFloat, "_radBiasShift", 8);
__publicField(NeuQuantFloat, "_radBias", 1 << _NeuQuantFloat._radBiasShift);
__publicField(NeuQuantFloat, "_alphaRadBiasShift", _NeuQuantFloat._alphaBiasShift + _NeuQuantFloat._radBiasShift);
__publicField(NeuQuantFloat, "_alphaRadBias", 1 << _NeuQuantFloat._alphaRadBiasShift);
// src/palette/rgbquant/colorHistogram.ts
var _ColorHistogram = class {
constructor(method, colors) {
__publicField(this, "_method");
__publicField(this, "_hueStats");
__publicField(this, "_histogram");
__publicField(this, "_initColors");
__publicField(this, "_minHueCols");
this._method = method;
this._minHueCols = colors << 2;
this._initColors = colors << 2;
this._hueStats = new HueStatistics(_ColorHistogram._hueGroups, this._minHueCols);
this._histogram = /* @__PURE__ */ Object.create(null);
}
sample(pointContainer) {
switch (this._method) {
case 1:
this._colorStats1D(pointContainer);
break;
case 2:
this._colorStats2D(pointContainer);
break;
}
}
getImportanceSortedColorsIDXI32() {
const sorted = stableSort(Object.keys(this._histogram), (a, b) => this._histogram[b] - this._histogram[a]);
if (sorted.length === 0) {
return [];
}
let idxi32;
switch (this._method) {
case 1:
const initialColorsLimit = Math.min(sorted.length, this._initColors);
const last = sorted[initialColorsLimit - 1];
const freq = this._histogram[last];
idxi32 = sorted.slice(0, initialColorsLimit);
let pos = initialColorsLimit;
const len = sorted.length;
while (pos < len && this._histogram[sorted[pos]] === freq) {
idxi32.push(sorted[pos++]);
}
this._hueStats.injectIntoArray(idxi32);
break;
case 2:
idxi32 = sorted;
break;
default:
throw new Error("Incorrect method");
}
return idxi32.map((v) => +v);
}
_colorStats1D(pointContainer) {
const histG = this._histogram;
const pointArray = pointContainer.getPointArray();
const len = pointArray.length;
for (let i = 0; i < len; i++) {
const col = pointArray[i].uint32;
this._hueStats.check(col);
if (col in histG) {
histG[col]++;
} else {
histG[col] = 1;
}
}
}
_colorStats2D(pointContainer) {
const width = pointContainer.getWidth();
const height = pointContainer.getHeight();
const pointArray = pointContainer.getPointArray();
const boxW = _ColorHistogram._boxSize[0];
const boxH = _ColorHistogram._boxSize[1];
const area = boxW * boxH;
const boxes = this._makeBoxes(width, height, boxW, boxH);
const histG = this._histogram;
boxes.forEach((box) => {
let effc = Math.round(box.w * box.h / area) * _ColorHistogram._boxPixels;
if (effc < 2)
effc = 2;
const histL = {};
this._iterateBox(box, width, (i) => {
const col = pointArray[i].uint32;
this._hueStats.check(col);
if (col in histG) {
histG[col]++;
} else if (col in histL) {
if (++histL[col] >= effc) {
histG[col] = histL[col];
}
} else {
histL[col] = 1;
}
});
});
this._hueStats.injectIntoDictionary(histG);
}
_iterateBox(bbox, wid, fn) {
const b = bbox;
const i0 = b.y * wid + b.x;
const i1 = (b.y + b.h - 1) * wid + (b.x + b.w - 1);
const incr = wid - b.w + 1;
let cnt = 0;
let i = i0;
do {
fn.call(this, i);
i += ++cnt % b.w === 0 ? incr : 1;
} while (i <= i1);
}
_makeBoxes(width, height, stepX, stepY) {
const wrem = width % stepX;
const hrem = height % stepY;
const xend = width - wrem;
const yend = height - hrem;
const boxesArray = [];
for (let y2 = 0; y2 < height; y2 += stepY) {
for (let x2 = 0; x2 < width; x2 += stepX) {
boxesArray.push({
x: x2,
y: y2,
w: x2 === xend ? wrem : stepX,
h: y2 === yend ? hrem : stepY
});
}
}
return boxesArray;
}
};
var ColorHistogram = _ColorHistogram;
__publicField(ColorHistogram, "_boxSize", [64, 64]);
__publicField(ColorHistogram, "_boxPixels", 2);
__publicField(ColorHistogram, "_hueGroups", 10);
// src/palette/rgbquant/rgbquant.ts
var RemovedColor = class {
constructor(index, color, distance) {
__publicField(this, "index");
__publicField(this, "color");
__publicField(this, "distance");
this.index = index;
this.color = color;
this.distance = distance;
}
};
var RGBQuant = class extends AbstractPaletteQuantizer {
constructor(colorDistanceCalculator, colors = 256, method = 2) {
super();
__publicField(this, "_colors");
__publicField(this, "_initialDistance");
__publicField(this, "_distanceIncrement");
__publicField(this, "_histogram");
__publicField(this, "_distance");
this._distance = colorDistanceCalculator;
this._colors = colors;
this._histogram = new ColorHistogram(method, colors);
this._initialDistance = 0.01;
this._distanceIncrement = 5e-3;
}
sample(image) {
this._histogram.sample(image);
}
*quantize() {
const idxi32 = this._histogram.getImportanceSortedColorsIDXI32();
if (idxi32.length === 0) {
throw new Error("No colors in image");
}
yield* this._buildPalette(idxi32);
}
*_buildPalette(idxi32) {
const palette = new Palette();
const colorArray = palette.getPointContainer().getPointArray();
const usageArray = new Array(idxi32.length);
for (let i = 0; i < idxi32.length; i++) {
colorArray.push(Point.createByUint32(idxi32[i]));
usageArray[i] = 1;
}
const len = colorArray.length;
const memDist = [];
let palLen = len;
let thold = this._initialDistance;
const tracker = new ProgressTracker(palLen - this._colors, 99);
while (palLen > this._colors) {
memDist.length = 0;
for (let i = 0; i < len; i++) {
if (tracker.shouldNotify(len - palLen)) {
yield {
progress: tracker.progress
};
}
if (usageArray[i] === 0)
continue;
const pxi = colorArray[i];
for (let j = i + 1; j < len; j++) {
if (usageArray[j] === 0)
continue;
const pxj = colorArray[j];
const dist = this._distance.calculateNormalized(pxi, pxj);
if (dist < thold) {
memDist.push(new RemovedColor(j, pxj, dist));
usageArray[j] = 0;
palLen--;
}
}
}
thold += palLen > this._colors * 3 ? this._initialDistance : this._distanceIncrement;
}
if (palLen < this._colors) {
stableSort(memDist, (a, b) => b.distance - a.distance);
let k = 0;
while (palLen < this._colors && k < memDist.length) {
const removedColor = memDist[k];
usageArray[removedColor.index] = 1;
palLen++;
k++;
}
}
let colors = colorArray.length;
for (let colorIndex = colors - 1; colorIndex >= 0; colorIndex--) {
if (usageArray[colorIndex] === 0) {
if (colorIndex !== colors - 1) {
colorArray[colorIndex] = colorArray[colors - 1];
}
--colors;
}
}
colorArray.length = colors;
palette.sort();
yield {
palette,
progress: 100
};
}
};
// src/palette/wu/wuQuant.ts
function createArray1D(dimension1) {
const a = [];
for (let k = 0; k < dimension1; k++) {
a[k] = 0;
}
return a;
}
function createArray4D(dimension1, dimension2, dimension3, dimension4) {
const a = new Array(dimension1);
for (let i = 0; i < dimension1; i++) {
a[i] = new Array(dimension2);
for (let j = 0; j < dimension2; j++) {
a[i][j] = new Array(dimension3);
for (let k = 0; k < dimension3; k++) {
a[i][j][k] = new Array(dimension4);
for (let l = 0; l < dimension4; l++) {
a[i][j][k][l] = 0;
}
}
}
}
return a;
}
function createArray3D(dimension1, dimension2, dimension3) {
const a = new Array(dimension1);
for (let i = 0; i < dimension1; i++) {
a[i] = new Array(dimension2);
for (let j = 0; j < dimension2; j++) {
a[i][j] = new Array(dimension3);
for (let k = 0; k < dimension3; k++) {
a[i][j][k] = 0;
}
}
}
return a;
}
function fillArray3D(a, dimension1, dimension2, dimension3, value) {
for (let i = 0; i < dimension1; i++) {
a[i] = [];
for (let j = 0; j < dimension2; j++) {
a[i][j] = [];
for (let k = 0; k < dimension3; k++) {
a[i][j][k] = value;
}
}
}
}
function fillArray1D(a, dimension1, value) {
for (let i = 0; i < dimension1; i++) {
a[i] = value;
}
}
var WuColorCube = class {
constructor() {
__publicField(this, "redMinimum");
__publicField(this, "redMaximum");
__publicField(this, "greenMinimum");
__publicField(this, "greenMaximum");
__publicField(this, "blueMinimum");
__publicField(this, "blueMaximum");
__publicField(this, "volume");
__publicField(this, "alphaMinimum");
__publicField(this, "alphaMaximum");
}
};
var _WuQuant = class extends AbstractPaletteQuantizer {
constructor(colorDistanceCalculator, colors = 256, significantBitsPerChannel = 5) {
super();
__publicField(this, "_reds");
__publicField(this, "_greens");
__publicField(this, "_blues");
__publicField(this, "_alphas");
__publicField(this, "_sums");
__publicField(this, "_weights");
__publicField(this, "_momentsRed");
__publicField(this, "_momentsGreen");
__publicField(this, "_momentsBlue");
__publicField(this, "_momentsAlpha");
__publicField(this, "_moments");
__publicField(this, "_table");
__publicField(this, "_pixels");
__publicField(this, "_cubes");
__publicField(this, "_colors");
__publicField(this, "_significantBitsPerChannel");
__publicField(this, "_maxSideIndex");
__publicField(this, "_alphaMaxSideIndex");
__publicField(this, "_sideSize");
__publicField(this, "_alphaSideSize");
__publicField(this, "_distance");
this._distance = colorDistanceCalculator;
this._setQuality(significantBitsPerChannel);
this._initialize(colors);
}
sample(image) {
const pointArray = image.getPointArray();
for (let i = 0, l = pointArray.length; i < l; i++) {
this._addColor(pointArray[i]);
}
this._pixels = this._pixels.concat(pointArray);
}
*quantize() {
yield* this._preparePalette();
const palette = new Palette();
for (let paletteIndex = 0; paletteIndex < this._colors; paletteIndex++) {
if (this._sums[paletteIndex] > 0) {
const sum = this._sums[paletteIndex];
const r = this._reds[paletteIndex] / sum;
const g = this._greens[paletteIndex] / sum;
const b = this._blues[paletteIndex] / sum;
const a = this._alphas[paletteIndex] / sum;
const color = Point.createByRGBA(r | 0, g | 0, b | 0, a | 0);
palette.add(color);
}
}
palette.sort();
yield {
palette,
progress: 100
};
}
*_preparePalette() {
yield* this._calculateMoments();
let next = 0;
const volumeVariance = createArray1D(this._colors);
for (let cubeIndex = 1; cubeIndex < this._colors; ++cubeIndex) {
if (this._cut(this._cubes[next], this._cubes[cubeIndex])) {
volumeVariance[next] = this._cubes[next].volume > 1 ? this._calculateVariance(this._cubes[next]) : 0;
volumeVariance[cubeIndex] = this._cubes[cubeIndex].volume > 1 ? this._calculateVariance(this._cubes[cubeIndex]) : 0;
} else {
volumeVariance[next] = 0;
cubeIndex--;
}
next = 0;
let temp = volumeVariance[0];
for (let index = 1; index <= cubeIndex; ++index) {
if (volumeVariance[index] > temp) {
temp = volumeVariance[index];
next = index;
}
}
if (temp <= 0) {
this._colors = cubeIndex + 1;
break;
}
}
const lookupRed = [];
const lookupGreen = [];
const lookupBlue = [];
const lookupAlpha = [];
for (let k = 0; k < this._colors; ++k) {
const weight = _WuQuant._volume(this._cubes[k], this._weights);
if (weight > 0) {
lookupRed[k] = _WuQuant._volume(this._cubes[k], this._momentsRed) / weight | 0;
lookupGreen[k] = _WuQuant._volume(this._cubes[k], this._momentsGreen) / weight | 0;
lookupBlue[k] = _WuQuant._volume(this._cubes[k], this._momentsBlue) / weight | 0;
lookupAlpha[k] = _WuQuant._volume(this._cubes[k], this._momentsAlpha) / weight | 0;
} else {
lookupRed[k] = 0;
lookupGreen[k] = 0;
lookupBlue[k] = 0;
lookupAlpha[k] = 0;
}
}
this._reds = createArray1D(this._colors + 1);
this._greens = createArray1D(this._colors + 1);
this._blues = createArray1D(this._colors + 1);
this._alphas = createArray1D(this._colors + 1);
this._sums = createArray1D(this._colors + 1);
for (let index = 0, l = this._pixels.length; index < l; index++) {
const color = this._pixels[index];
const match = -1;
let bestMatch = match;
let bestDistance = Number.MAX_VALUE;
for (let lookup = 0; lookup < this._colors; lookup++) {
const foundRed = lookupRed[lookup];
const foundGreen = lookupGreen[lookup];
const foundBlue = lookupBlue[lookup];
const foundAlpha = lookupAlpha[lookup];
const distance = this._distance.calculateRaw(foundRed, foundGreen, foundBlue, foundAlpha, color.r, color.g, color.b, color.a);
if (distance < bestDistance) {
bestDistance = distance;
bestMatch = lookup;
}
}
this._reds[bestMatch] += color.r;
this._greens[bestMatch] += color.g;
this._blues[bestMatch] += color.b;
this._alphas[bestMatch] += color.a;
this._sums[bestMatch]++;
}
}
_addColor(color) {
const bitsToRemove = 8 - this._significantBitsPerChannel;
const indexRed = (color.r >> bitsToRemove) + 1;
const indexGreen = (color.g >> bitsToRemove) + 1;
const indexBlue = (color.b >> bitsToRemove) + 1;
const indexAlpha = (color.a >> bitsToRemove) + 1;
this._weights[indexAlpha][indexRed][indexGreen][indexBlue]++;
this._momentsRed[indexAlpha][indexRed][indexGreen][indexBlue] += color.r;
this._momentsGreen[indexAlpha][indexRed][indexGreen][indexBlue] += color.g;
this._momentsBlue[indexAlpha][indexRed][indexGreen][indexBlue] += color.b;
this._momentsAlpha[indexAlpha][indexRed][indexGreen][indexBlue] += color.a;
this._moments[indexAlpha][indexRed][indexGreen][indexBlue] += this._table[color.r] + this._table[color.g] + this._table[color.b] + this._table[color.a];
}
*_calculateMoments() {
const area = [];
const areaRed = [];
const areaGreen = [];
const areaBlue = [];
const areaAlpha = [];
const area2 = [];
const xarea = createArray3D(this._sideSize, this._sideSize, this._sideSize);
const xareaRed = createArray3D(this._sideSize, this._sideSize, this._sideSize);
const xareaGreen = createArray3D(this._sideSize, this._sideSize, this._sideSize);
const xareaBlue = createArray3D(this._sideSize, this._sideSize, this._sideSize);
const xareaAlpha = createArray3D(this._sideSize, this._sideSize, this._sideSize);
const xarea2 = createArray3D(this._sideSize, this._sideSize, this._sideSize);
let trackerProgress = 0;
const tracker = new ProgressTracker(this._alphaMaxSideIndex * this._maxSideIndex, 99);
for (let alphaIndex = 1; alphaIndex <= this._alphaMaxSideIndex; ++alphaIndex) {
fillArray3D(xarea, this._sideSize, this._sideSize, this._sideSize, 0);
fillArray3D(xareaRed, this._sideSize, this._sideSize, this._sideSize, 0);
fillArray3D(xareaGreen, this._sideSize, this._sideSize, this._sideSize, 0);
fillArray3D(xareaBlue, this._sideSize, this._sideSize, this._sideSize, 0);
fillArray3D(xareaAlpha, this._sideSize, this._sideSize, this._sideSize, 0);
fillArray3D(xarea2, this._sideSize, this._sideSize, this._sideSize, 0);
for (let redIndex = 1; redIndex <= this._maxSideIndex; ++redIndex, ++trackerProgress) {
if (tracker.shouldNotify(trackerProgress)) {
yield {
progress: tracker.progress
};
}
fillArray1D(area, this._sideSize, 0);
fillArray1D(areaRed, this._sideSize, 0);
fillArray1D(areaGreen, this._sideSize, 0);
fillArray1D(areaBlue, this._sideSize, 0);
fillArray1D(areaAlpha, this._sideSize, 0);
fillArray1D(area2, this._sideSize, 0);
for (let greenIndex = 1; greenIndex <= this._maxSideIndex; ++greenIndex) {
let line = 0;
let lineRed = 0;
let lineGreen = 0;
let lineBlue = 0;
let lineAlpha = 0;
let line2 = 0;
for (let blueIndex = 1; blueIndex <= this._maxSideIndex; ++blueIndex) {
line += this._weights[alphaIndex][redIndex][greenIndex][blueIndex];
lineRed += this._momentsRed[alphaIndex][redIndex][greenIndex][blueIndex];
lineGreen += this._momentsGreen[alphaIndex][redIndex][greenIndex][blueIndex];
lineBlue += this._momentsBlue[alphaIndex][redIndex][greenIndex][blueIndex];
lineAlpha += this._momentsAlpha[alphaIndex][redIndex][greenIndex][blueIndex];
line2 += this._moments[alphaIndex][redIndex][greenIndex][blueIndex];
area[blueIndex] += line;
areaRed[blueIndex] += lineRed;
areaGreen[blueIndex] += lineGreen;
areaBlue[blueIndex] += lineBlue;
areaAlpha[blueIndex] += lineAlpha;
area2[blueIndex] += line2;
xarea[redIndex][greenIndex][blueIndex] = xarea[redIndex - 1][greenIndex][blueIndex] + area[blueIndex];
xareaRed[redIndex][greenIndex][blueIndex] = xareaRed[redIndex - 1][greenIndex][blueIndex] + areaRed[blueIndex];
xareaGreen[redIndex][greenIndex][blueIndex] = xareaGreen[redIndex - 1][greenIndex][blueIndex] + areaGreen[blueIndex];
xareaBlue[redIndex][greenIndex][blueIndex] = xareaBlue[redIndex - 1][greenIndex][blueIndex] + areaBlue[blueIndex];
xareaAlpha[redIndex][greenIndex][blueIndex] = xareaAlpha[redIndex - 1][greenIndex][blueIndex] + areaAlpha[blueIndex];
xarea2[redIndex][greenIndex][blueIndex] = xarea2[redIndex - 1][greenIndex][blueIndex] + area2[blueIndex];
this._weights[alphaIndex][redIndex][greenIndex][blueIndex] = this._weights[alphaIndex - 1][redIndex][greenIndex][blueIndex] + xarea[redIndex][greenIndex][blueIndex];
this._momentsRed[alphaIndex][redIndex][greenIndex][blueIndex] = this._momentsRed[alphaIndex - 1][redIndex][greenIndex][blueIndex] + xareaRed[redIndex][greenIndex][blueIndex];
this._momentsGreen[alphaIndex][redIndex][greenIndex][blueIndex] = this._momentsGreen[alphaIndex - 1][redIndex][greenIndex][blueIndex] + xareaGreen[redIndex][greenIndex][blueIndex];
this._momentsBlue[alphaIndex][redIndex][greenIndex][blueIndex] = this._momentsBlue[alphaIndex - 1][redIndex][greenIndex][blueIndex] + xareaBlue[redIndex][greenIndex][blueIndex];
this._momentsAlpha[alphaIndex][redIndex][greenIndex][blueIndex] = this._momentsAlpha[alphaIndex - 1][redIndex][greenIndex][blueIndex] + xareaAlpha[redIndex][greenIndex][blueIndex];
this._moments[alphaIndex][redIndex][greenIndex][blueIndex] = this._moments[alphaIndex - 1][redIndex][greenIndex][blueIndex] + xarea2[redIndex][greenIndex][blueIndex];
}
}
}
}
}
static _volumeFloat(cube, moment) {
return moment[cube.alphaMaximum][cube.redMaximum][cube.greenMaximum][cube.blueMaximum] - moment[cube.alphaMaximum][cube.redMaximum][cube.greenMinimum][cube.blueMaximum] - moment[cube.alphaMaximum][cube.redMinimum][cube.greenMaximum][cube.blueMaximum] + moment[cube.alphaMaximum][cube.redMinimum][cube.greenMinimum][cube.blueMaximum] - moment[cube.alphaMinimum][cube.redMaximum][cube.greenMaximum][cube.blueMaximum] + moment[cube.alphaMinimum][cube.redMaximum][cube.greenMinimum][cube.blueMaximum] + moment[cube.alphaMinimum][cube.redMinimum][cube.greenMaximum][cube.blueMaximum] - moment[cube.alphaMinimum][cube.redMinimum][cube.greenMinimum][cube.blueMaximum] - (moment[cube.alphaMaximum][cube.redMaximum][cube.greenMaximum][cube.blueMinimum] - moment[cube.alphaMinimum][cube.redMaximum][cube.greenMaximum][cube.blueMinimum] - moment[cube.alphaMaximum][cube.redMaximum][cube.greenMinimum][cube.blueMinimum] + moment[cube.alphaMinimum][cube.redMaximum][cube.greenMinimum][cube.blueMinimum] - moment[cube.alphaMaximum][cube.redMinimum][cube.greenMaximum][cube.blueMinimum] + moment[cube.alphaMinimum][cube.redMinimum][cube.greenMaximum][cube.blueMinimum] + moment[cube.alphaMaximum][cube.redMinimum][cube.greenMinimum][cube.blueMinimum] - moment[cube.alphaMinimum][cube.redMinimum][cube.greenMinimum][cube.blueMinimum]);
}
static _volume(cube, moment) {
return _WuQuant._volumeFloat(cube, moment) | 0;
}
static _top(cube, direction, position, moment) {
let result;
switch (direction) {
case _WuQuant._alpha:
result = moment[position][cube.redMaximum][cube.greenMaximum][cube.blueMaximum] - moment[position][cube.redMaximum][cube.greenMinimum][cube.blueMaximum] - moment[position][cube.redMinimum][cube.greenMaximum][cube.blueMaximum] + moment[position][cube.redMinimum][cube.greenMinimum][cube.blueMaximum] - (moment[position][cube.redMaximum][cube.greenMaximum][cube.blueMinimum] - moment[position][cube.redMaximum][cube.greenMinimum][cube.blueMinimum] - moment[position][cube.redMinimum][cube.greenMaximum][cube.blueMinimum] + moment[position][cube.redMinimum][cube.greenMinimum][cube.blueMinimum]);
break;
case _WuQuant._red:
result = moment[cube.alphaMaximum][position][cube.greenMaximum][cube.blueMaximum] - moment[cube.alphaMaximum][position][cube.greenMinimum][cube.blueMaximum] - moment[cube.alphaMinimum][position][cube.greenMaximum][cube.blueMaximum] + moment[cube.alphaMinimum][position][cube.greenMinimum][cube.blueMaximum] - (moment[cube.alphaMaximum][position][cube.greenMaximum][cube.blueMinimum] - moment[cube.alphaMaximum][position][cube.greenMinimum][cube.blueMinimum] - moment[cube.alphaMinimum][position][cube.greenMaximum][cube.blueMinimum] + moment[cube.alphaMinimum][position][cube.greenMinimum][cube.blueMinimum]);
break;
case _WuQuant._green:
result = moment[cube.alphaMaximum][cube.redMaximum][position][cube.blueMaximum] - moment[cube.alphaMaximum][cube.redMinimum][position][cube.blueMaximum] - moment[cube.alphaMinimum][cube.redMaximum][position][cube.blueMaximum] + moment[cube.alphaMinimum][cube.redMinimum][position][cube.blueMaximum] - (moment[cube.alphaMaximum][cube.redMaximum][position][cube.blueMinimum] - moment[cube.alphaMaximum][cube.redMinimum][position][cube.blueMinimum] - moment[cube.alphaMinimum][cube.redMaximum][position][cube.blueMinimum] + moment[cube.alphaMinimum][cube.redMinimum][position][cube.blueMinimum]);
break;
case _WuQuant._blue:
result = moment[cube.alphaMaximum][cube.redMaximum][cube.greenMaximum][position] - moment[cube.alphaMaximum][cube.redMaximum][cube.greenMinimum][position] - moment[cube.alphaMaximum][cube.redMinimum][cube.greenMaximum][position] + moment[cube.alphaMaximum][cube.redMinimum][cube.greenMinimum][position] - (moment[cube.alphaMinimum][cube.redMaximum][cube.greenMaximum][position] - moment[cube.alphaMinimum][cube.redMaximum][cube.greenMinimum][position] - moment[cube.alphaMinimum][cube.redMinimum][cube.greenMaximum][position] + moment[cube.alphaMinimum][cube.redMinimum][cube.greenMinimum][position]);
break;
default:
throw new Error("impossible");
}
return result | 0;
}
static _bottom(cube, direction, moment) {
switch (direction) {
case _WuQuant._alpha:
return -moment[cube.alphaMinimum][cube.redMaximum][cube.greenMaximum][cube.blueMaximum] + moment[cube.alphaMinimum][cube.redMaximum][cube.greenMinimum][cube.blueMaximum] + moment[cube.alphaMinimum][cube.redMinimum][cube.greenMaximum][cube.blueMaximum] - moment[cube.alphaMinimum][cube.redMinimum][cube.greenMinimum][cube.blueMaximum] - (-moment[cube.alphaMinimum][cube.redMaximum][cube.greenMaximum][cube.blueMinimum] + moment[cube.alphaMinimum][cube.redMaximum][cube.greenMinimum][cube.blueMinimum] + moment[cube.alphaMinimum][cube.redMinimum][cube.greenMaximum][cube.blueMinimum] - moment[cube.alphaMinimum][cube.redMinimum][cube.greenMinimum][cube.blueMinimum]);
case _WuQuant._red:
return -moment[cube.alphaMaximum][cube.redMinimum][cube.greenMaximum][cube.blueMaximum] + moment[cube.alphaMaximum][cube.redMinimum][cube.greenMinimum][cube.blueMaximum] + moment[cube.alphaMinimum][cube.redMinimum][cube.greenMaximum][cube.blueMaximum] - moment[cube.alphaMinimum][cube.redMinimum][cube.greenMinimum][cube.blueMaximum] - (-moment[cube.alphaMaximum][cube.redMinimum][cube.greenMaximum][cube.blueMinimum] + moment[cube.alphaMaximum][cube.redMinimum][cube.greenMinimum][cube.blueMinimum] + moment[cube.alphaMinimum][cube.redMinimum][cube.greenMaximum][cube.blueMinimum] - moment[cube.alphaMinimum][cube.redMinimum][cube.greenMinimum][cube.blueMinimum]);
case _WuQuant._green:
return -moment[cube.alphaMaximum][cube.redMaximum][cube.greenMinimum][cube.blueMaximum] + moment[cube.alphaMaximum][cube.redMinimum][cube.greenMinimum][cube.blueMaximum] + moment[cube.alphaMinimum][cube.redMaximum][cube.greenMinimum][cube.blueMaximum] - moment[cube.alphaMinimum][cube.redMinimum][cube.greenMinimum][cube.blueMaximum] - (-moment[cube.alphaMaximum][cube.redMaximum][cube.greenMinimum][cube.blueMinimum] + moment[cube.alphaMaximum][cube.redMinimum][cube.greenMinimum][cube.blueMinimum] + moment[cube.alphaMinimum][cube.redMaximum][cube.greenMinimum][cube.blueMinimum] - moment[cube.alphaMinimum][cube.redMinimum][cube.greenMinimum][cube.blueMinimum]);
case _WuQuant._blue:
return -moment[cube.alphaMaximum][cube.redMaximum][cube.greenMaximum][cube.blueMinimum] + moment[cube.alphaMaximum][cube.redMaximum][cube.greenMinimum][cube.blueMinimum] + moment[cube.alphaMaximum][cube.redMinimum][cube.greenMaximum][cube.blueMinimum] - moment[cube.alphaMaximum][cube.redMinimum][cube.greenMinimum][cube.blueMinimum] - (-moment[cube.alphaMinimum][cube.redMaximum][cube.greenMaximum][cube.blueMinimum] + moment[cube.alphaMinimum][cube.redMaximum][cube.greenMinimum][cube.blueMinimum] + moment[cube.alphaMinimum][cube.redMinimum][cube.greenMaximum][cube.blueMinimum] - moment[cube.alphaMinimum][cube.redMinimum][cube.greenMinimum][cube.blueMinimum]);
default:
return 0;
}
}
_calculateVariance(cube) {
const volumeRed = _WuQuant._volume(cube, this._momentsRed);
const volumeGreen = _WuQuant._volume(cube, this._momentsGreen);
const volumeBlue = _WuQuant._volume(cube, this._momentsBlue);
const volumeAlpha = _WuQuant._volume(cube, this._momentsAlpha);
const volumeMoment = _WuQuant._volumeFloat(cube, this._moments);
const volumeWeight = _WuQuant._volume(cube, this._weights);
const distance = volumeRed * volumeRed + volumeGreen * volumeGreen + volumeBlue * volumeBlue + volumeAlpha * volumeAlpha;
return volumeMoment - distance / volumeWeight;
}
_maximize(cube, direction, first, last, wholeRed, wholeGreen, wholeBlue, wholeAlpha, wholeWeight) {
const bottomRed = _WuQuant._bottom(cube, direction, this._momentsRed) | 0;
const bottomGreen = _WuQuant._bottom(cube, direction, this._momentsGreen) | 0;
const bottomBlue = _WuQuant._bottom(cube, direction, this._momentsBlue) | 0;
const bottomAlpha = _WuQuant._bottom(cube, direction, this._momentsAlpha) | 0;
const bottomWeight = _WuQuant._bottom(cube, direction, this._weights) | 0;
let result = 0;
let cutPosition = -1;
for (let position = first; position < last; ++position) {
let halfRed = bottomRed + _WuQuant._top(cube, direction, position, this._momentsRed);
let halfGreen = bottomGreen + _WuQuant._top(cube, direction, position, this._momentsGreen);
let halfBlue = bottomBlue + _WuQuant._top(cube, direction, position, this._momentsBlue);
let halfAlpha = bottomAlpha + _WuQuant._top(cube, direction, position, this._momentsAlpha);
let halfWeight = bottomWeight + _WuQuant._top(cube, direction, position, this._weights);
if (halfWeight !== 0) {
let halfDistance = halfRed * halfRed + halfGreen * halfGreen + halfBlue * halfBlue + halfAlpha * halfAlpha;
let temp = halfDistance / halfWeight;
halfRed = wholeRed - halfRed;
halfGreen = wholeGreen - halfGreen;
halfBlue = wholeBlue - halfBlue;
halfAlpha = wholeAlpha - halfAlpha;
halfWeight = wholeWeight - halfWeight;
if (halfWeight !== 0) {
halfDistance = halfRed * halfRed + halfGreen * halfGreen + halfBlue * halfBlue + halfAlpha * halfAlpha;
temp += halfDistance / halfWeight;
if (temp > result) {
result = temp;
cutPosition = position;
}
}
}
}
return { max: result, position: cutPosition };
}
_cut(first, second) {
let direction;
const wholeRed = _WuQuant._volume(first, this._momentsRed);
const wholeGreen = _WuQuant._volume(first, this._momentsGreen);
const wholeBlue = _WuQuant._volume(first, this._momentsBlue);
const wholeAlpha = _WuQuant._volume(first, this._momentsAlpha);
const wholeWeight = _WuQuant._volume(first, this._weights);
const red = this._maximize(first, _WuQuant._red, first.redMinimum + 1, first.redMaximum, wholeRed, wholeGreen, wholeBlue, wholeAlpha, wholeWeight);
const green = this._maximize(first, _WuQuant._green, first.greenMinimum + 1, first.greenMaximum, wholeRed, wholeGreen, wholeBlue, wholeAlpha, wholeWeight);
const blue = this._maximize(first, _WuQuant._blue, first.blueMinimum + 1, first.blueMaximum, wholeRed, wholeGreen, wholeBlue, wholeAlpha, wholeWeight);
const alpha = this._maximize(first, _WuQuant._alpha, first.alphaMinimum + 1, first.alphaMaximum, wholeRed, wholeGreen, wholeBlue, wholeAlpha, wholeWeight);
if (alpha.max >= red.max && alpha.max >= green.max && alpha.max >= blue.max) {
direction = _WuQuant._alpha;
if (alpha.position < 0)
return false;
} else if (red.max >= alpha.max && red.max >= green.max && red.max >= blue.max) {
direction = _WuQuant._red;
} else if (green.max >= alpha.max && green.max >= red.max && green.max >= blue.max) {
direction = _WuQuant._green;
} else {
direction = _WuQuant._blue;
}
second.redMaximum = first.redMaximum;
second.greenMaximum = first.greenMaximum;
second.blueMaximum = first.blueMaximum;
second.alphaMaximum = first.alphaMaximum;
switch (direction) {
case _WuQuant._red:
second.redMinimum = first.redMaximum = red.position;
second.greenMinimum = first.greenMinimum;
second.blueMinimum = first.blueMinimum;
second.alphaMinimum = first.alphaMinimum;
break;
case _WuQuant._green:
second.greenMinimum = first.greenMaximum = green.position;
second.redMinimum = first.redMinimum;
second.blueMinimum = first.blueMinimum;
second.alphaMinimum = first.alphaMinimum;
break;
case _WuQuant._blue:
second.blueMinimum = first.blueMaximum = blue.position;
second.redMinimum = first.redMinimum;
second.greenMinimum = first.greenMinimum;
second.alphaMinimum = first.alphaMinimum;
break;
case _WuQuant._alpha:
second.alphaMinimum = first.alphaMaximum = alpha.position;
second.blueMinimum = first.blueMinimum;
second.redMinimum = first.redMinimum;
second.greenMinimum = first.greenMinimum;
break;
}
first.volume = (first.redMaximum - first.redMinimum) * (first.greenMaximum - first.greenMinimum) * (first.blueMaximum - first.blueMinimum) * (first.alphaMaximum - first.alphaMinimum);
second.volume = (second.redMaximum - second.redMinimum) * (second.greenMaximum - second.greenMinimum) * (second.blueMaximum - second.blueMinimum) * (second.alphaMaximum - second.alphaMinimum);
return true;
}
_initialize(colors) {
this._colors = colors;
this._cubes = [];
for (let cubeIndex = 0; cubeIndex < colors; cubeIndex++) {
this._cubes[cubeIndex] = new WuColorCube();
}
this._cubes[0].redMinimum = 0;
this._cubes[0].greenMinimum = 0;
this._cubes[0].blueMinimum = 0;
this._cubes[0].alphaMinimum = 0;
this._cubes[0].redMaximum = this._maxSideIndex;
this._cubes[0].greenMaximum = this._maxSideIndex;
this._cubes[0].blueMaximum = this._maxSideIndex;
this._cubes[0].alphaMaximum = this._alphaMaxSideIndex;
this._weights = createArray4D(this._alphaSideSize, this._sideSize, this._sideSize, this._sideSize);
this._momentsRed = createArray4D(this._alphaSideSize, this._sideSize, this._sideSize, this._sideSize);
this._momentsGreen = createArray4D(this._alphaSideSize, this._sideSize, this._sideSize, this._sideSize);
this._momentsBlue = createArray4D(this._alphaSideSize, this._sideSize, this._sideSize, this._sideSize);
this._momentsAlpha = createArray4D(this._alphaSideSize, this._sideSize, this._sideSize, this._sideSize);
this._moments = createArray4D(this._alphaSideSize, this._sideSize, this._sideSize, this._sideSize);
this._table = [];
for (let tableIndex = 0; tableIndex < 256; ++tableIndex) {
this._table[tableIndex] = tableIndex * tableIndex;
}
this._pixels = [];
}
_setQuality(significantBitsPerChannel = 5) {
this._significantBitsPerChannel = significantBitsPerChannel;
this._maxSideIndex = 1 << this._significantBitsPerChannel;
this._alphaMaxSideIndex = this._maxSideIndex;
this._sideSize = this._maxSideIndex + 1;
this._alphaSideSize = this._alphaMaxSideIndex + 1;
}
};
var WuQuant = _WuQuant;
__publicField(WuQuant, "_alpha", 3);
__publicField(WuQuant, "_red", 2);
__publicField(WuQuant, "_green", 1);
__publicField(WuQuant, "_blue", 0);
// src/image/index.ts
var image_exports = {};
__export(image_exports, {
AbstractImageQuantizer: () => AbstractImageQuantizer,
ErrorDiffusionArray: () => ErrorDiffusionArray,
ErrorDiffusionArrayKernel: () => ErrorDiffusionArrayKernel,
ErrorDiffusionRiemersma: () => ErrorDiffusionRiemersma,
NearestColor: () => NearestColor
});
// src/image/imageQuantizer.ts
var AbstractImageQuantizer = class {
quantizeSync(pointContainer, palette) {
for (const value of this.quantize(pointContainer, palette)) {
if (value.pointContainer) {
return value.pointContainer;
}
}
throw new Error("unreachable");
}
};
// src/image/nearestColor.ts
var NearestColor = class extends AbstractImageQuantizer {
constructor(colorDistanceCalculator) {
super();
__publicField(this, "_distance");
this._distance = colorDistanceCalculator;
}
*quantize(pointContainer, palette) {
const pointArray = pointContainer.getPointArray();
const width = pointContainer.getWidth();
const height = pointContainer.getHeight();
const tracker = new ProgressTracker(height, 99);
for (let y2 = 0; y2 < height; y2++) {
if (tracker.shouldNotify(y2)) {
yield {
progress: tracker.progress
};
}
for (let x2 = 0, idx = y2 * width; x2 < width; x2++, idx++) {
const point = pointArray[idx];
point.from(palette.getNearestColor(this._distance, point));
}
}
yield {
pointContainer,
progress: 100
};
}
};
// src/image/array.ts
var ErrorDiffusionArrayKernel = /* @__PURE__ */ ((ErrorDiffusionArrayKernel2) => {
ErrorDiffusionArrayKernel2[ErrorDiffusionArrayKernel2["FloydSteinberg"] = 0] = "FloydSteinberg";
ErrorDiffusionArrayKernel2[ErrorDiffusionArrayKernel2["FalseFloydSteinberg"] = 1] = "FalseFloydSteinberg";
ErrorDiffusionArrayKernel2[ErrorDiffusionArrayKernel2["Stucki"] = 2] = "Stucki";
ErrorDiffusionArrayKernel2[ErrorDiffusionArrayKernel2["Atkinson"] = 3] = "Atkinson";
ErrorDiffusionArrayKernel2[ErrorDiffusionArrayKernel2["Jarvis"] = 4] = "Jarvis";
ErrorDiffusionArrayKernel2[ErrorDiffusionArrayKernel2["Burkes"] = 5] = "Burkes";
ErrorDiffusionArrayKernel2[ErrorDiffusionArrayKernel2["Sierra"] = 6] = "Sierra";
ErrorDiffusionArrayKernel2[ErrorDiffusionArrayKernel2["TwoSierra"] = 7] = "TwoSierra";
ErrorDiffusionArrayKernel2[ErrorDiffusionArrayKernel2["SierraLite"] = 8] = "SierraLite";
return ErrorDiffusionArrayKernel2;
})(ErrorDiffusionArrayKernel || {});
var ErrorDiffusionArray = class extends AbstractImageQuantizer {
constructor(colorDistanceCalculator, kernel, serpentine = true, minimumColorDistanceToDither = 0, calculateErrorLikeGIMP = false) {
super();
__publicField(this, "_minColorDistance");
__publicField(this, "_serpentine");
__publicField(this, "_kernel");
__publicField(this, "_calculateErrorLikeGIMP");
__publicField(this, "_distance");
this._setKernel(kernel);
this._distance = colorDistanceCalculator;
this._minColorDistance = minimumColorDistanceToDither;
this._serpentine = serpentine;
this._calculateErrorLikeGIMP = calculateErrorLikeGIMP;
}
*quantize(pointContainer, palette) {
const pointArray = pointContainer.getPointArray();
const originalPoint = new Point();
const width = pointContainer.getWidth();
const height = pointContainer.getHeight();
const errorLines = [];
let dir = 1;
let maxErrorLines = 1;
for (const kernel of this._kernel) {
const kernelErrorLines = kernel[2] + 1;
if (maxErrorLines < kernelErrorLines)
maxErrorLines = kernelErrorLines;
}
for (let i = 0; i < maxErrorLines; i++) {
this._fillErrorLine(errorLines[i] = [], width);
}
const tracker = new ProgressTracker(height, 99);
for (let y2 = 0; y2 < height; y2++) {
if (tracker.shouldNotify(y2)) {
yield {
progress: tracker.progress
};
}
if (this._serpentine)
dir *= -1;
const lni = y2 * width;
const xStart = dir === 1 ? 0 : width - 1;
const xEnd = dir === 1 ? width : -1;
this._fillErrorLine(errorLines[0], width);
errorLines.push(errorLines.shift());
const errorLine = errorLines[0];
for (let x2 = xStart, idx = lni + xStart; x2 !== xEnd; x2 += dir, idx += dir) {
const point = pointArray[idx];
const error = errorLine[x2];
originalPoint.from(point);
const correctedPoint = Point.createByRGBA(inRange0to255Rounded(point.r + error[0]), inRange0to255Rounded(point.g + error[1]), inRange0to255Rounded(point.b + error[2]), inRange0to255Rounded(point.a + error[3]));
const palettePoint = palette.getNearestColor(this._distance, correctedPoint);
point.from(palettePoint);
if (this._minColorDistance) {
const dist = this._distance.calculateNormalized(originalPoint, palettePoint);
if (dist < this._minColorDistance)
continue;
}
let er;
let eg;
let eb;
let ea;
if (this._calculateErrorLikeGIMP) {
er = correctedPoint.r - palettePoint.r;
eg = correctedPoint.g - palettePoint.g;
eb = correctedPoint.b - palettePoint.b;
ea = correctedPoint.a - palettePoint.a;
} else {
er = originalPoint.r - palettePoint.r;
eg = originalPoint.g - palettePoint.g;
eb = originalPoint.b - palettePoint.b;
ea = originalPoint.a - palettePoint.a;
}
const dStart = dir === 1 ? 0 : this._kernel.length - 1;
const dEnd = dir === 1 ? this._kernel.length : -1;
for (let i = dStart; i !== dEnd; i += dir) {
const x1 = this._kernel[i][1] * dir;
const y1 = this._kernel[i][2];
if (x1 + x2 >= 0 && x1 + x2 < width && y1 + y2 >= 0 && y1 + y2 < height) {
const d = this._kernel[i][0];
const e = errorLines[y1][x1 + x2];
e[0] += er * d;
e[1] += eg * d;
e[2] += eb * d;
e[3] += ea * d;
}
}
}
}
yield {
pointContainer,
progress: 100
};
}
_fillErrorLine(errorLine, width) {
if (errorLine.length > width) {
errorLine.length = width;
}
const l = errorLine.length;
for (let i = 0; i < l; i++) {
const error = errorLine[i];
error[0] = error[1] = error[2] = error[3] = 0;
}
for (let i = l; i < width; i++) {
errorLine[i] = [0, 0, 0, 0];
}
}
_setKernel(kernel) {
switch (kernel) {
case 0 /* FloydSteinberg */:
this._kernel = [
[7 / 16, 1, 0],
[3 / 16, -1, 1],
[5 / 16, 0, 1],
[1 / 16, 1, 1]
];
break;
case 1 /* FalseFloydSteinberg */:
this._kernel = [
[3 / 8, 1, 0],
[3 / 8, 0, 1],
[2 / 8, 1, 1]
];
break;
case 2 /* Stucki */:
this._kernel = [
[8 / 42, 1, 0],
[4 / 42, 2, 0],
[2 / 42, -2, 1],
[4 / 42, -1, 1],
[8 / 42, 0, 1],
[4 / 42, 1, 1],
[2 / 42, 2, 1],
[1 / 42, -2, 2],
[2 / 42, -1, 2],
[4 / 42, 0, 2],
[2 / 42, 1, 2],
[1 / 42, 2, 2]
];
break;
case 3 /* Atkinson */:
this._kernel = [
[1 / 8, 1, 0],
[1 / 8, 2, 0],
[1 / 8, -1, 1],
[1 / 8, 0, 1],
[1 / 8, 1, 1],
[1 / 8, 0, 2]
];
break;
case 4 /* Jarvis */:
this._kernel = [
[7 / 48, 1, 0],
[5 / 48, 2, 0],
[3 / 48, -2, 1],
[5 / 48, -1, 1],
[7 / 48, 0, 1],
[5 / 48, 1, 1],
[3 / 48, 2, 1],
[1 / 48, -2, 2],
[3 / 48, -1, 2],
[5 / 48, 0, 2],
[3 / 48, 1, 2],
[1 / 48, 2, 2]
];
break;
case 5 /* Burkes */:
this._kernel = [
[8 / 32, 1, 0],
[4 / 32, 2, 0],
[2 / 32, -2, 1],
[4 / 32, -1, 1],
[8 / 32, 0, 1],
[4 / 32, 1, 1],
[2 / 32, 2, 1]
];
break;
case 6 /* Sierra */:
this._kernel = [
[5 / 32, 1, 0],
[3 / 32, 2, 0],
[2 / 32, -2, 1],
[4 / 32, -1, 1],
[5 / 32, 0, 1],
[4 / 32, 1, 1],
[2 / 32, 2, 1],
[2 / 32, -1, 2],
[3 / 32, 0, 2],
[2 / 32, 1, 2]
];
break;
case 7 /* TwoSierra */:
this._kernel = [
[4 / 16, 1, 0],
[3 / 16, 2, 0],
[1 / 16, -2, 1],
[2 / 16, -1, 1],
[3 / 16, 0, 1],
[2 / 16, 1, 1],
[1 / 16, 2, 1]
];
break;
case 8 /* SierraLite */:
this._kernel = [
[2 / 4, 1, 0],
[1 / 4, -1, 1],
[1 / 4, 0, 1]
];
break;
default:
throw new Error(`ErrorDiffusionArray: unknown kernel = ${kernel}`);
}
}
};
// src/image/spaceFillingCurves/hilbertCurve.ts
function* hilbertCurve(width, height, callback) {
const maxBound = Math.max(width, height);
const level = Math.floor(Math.log(maxBound) / Math.log(2) + 1);
const tracker = new ProgressTracker(width * height, 99);
const data = {
width,
height,
level,
callback,
tracker,
index: 0,
x: 0,
y: 0
};
yield* walkHilbert(data, 1 /* UP */);
visit(data, 0 /* NONE */);
}
function* walkHilbert(data, direction) {
if (data.level < 1)
return;
if (data.tracker.shouldNotify(data.index)) {
yield { progress: data.tracker.progress };
}
data.level--;
switch (direction) {
case 2 /* LEFT */:
yield* walkHilbert(data, 1 /* UP */);
visit(data, 3 /* RIGHT */);
yield* walkHilbert(data, 2 /* LEFT */);
visit(data, 4 /* DOWN */);
yield* walkHilbert(data, 2 /* LEFT */);
visit(data, 2 /* LEFT */);
yield* walkHilbert(data, 4 /* DOWN */);
break;
case 3 /* RIGHT */:
yield* walkHilbert(data, 4 /* DOWN */);
visit(data, 2 /* LEFT */);
yield* walkHilbert(data, 3 /* RIGHT */);
visit(data, 1 /* UP */);
yield* walkHilbert(data, 3 /* RIGHT */);
visit(data, 3 /* RIGHT */);
yield* walkHilbert(data, 1 /* UP */);
break;
case 1 /* UP */:
yield* walkHilbert(data, 2 /* LEFT */);
visit(data, 4 /* DOWN */);
yield* walkHilbert(data, 1 /* UP */);
visit(data, 3 /* RIGHT */);
yield* walkHilbert(data, 1 /* UP */);
visit(data, 1 /* UP */);
yield* walkHilbert(data, 3 /* RIGHT */);
break;
case 4 /* DOWN */:
yield* walkHilbert(data, 3 /* RIGHT */);
visit(data, 1 /* UP */);
yield* walkHilbert(data, 4 /* DOWN */);
visit(data, 2 /* LEFT */);
yield* walkHilbert(data, 4 /* DOWN */);
visit(data, 4 /* DOWN */);
yield* walkHilbert(data, 2 /* LEFT */);
break;
default:
break;
}
data.level++;
}
function visit(data, direction) {
if (data.x >= 0 && data.x < data.width && data.y >= 0 && data.y < data.height) {
data.callback(data.x, data.y);
data.index++;
}
switch (direction) {
case 2 /* LEFT */:
data.x--;
break;
case 3 /* RIGHT */:
data.x++;
break;
case 1 /* UP */:
data.y--;
break;
case 4 /* DOWN */:
data.y++;
break;
}
}
// src/image/riemersma.ts
var ErrorDiffusionRiemersma = class extends AbstractImageQuantizer {
constructor(colorDistanceCalculator, errorQueueSize = 16, errorPropagation = 1) {
super();
__publicField(this, "_distance");
__publicField(this, "_weights");
__publicField(this, "_errorQueueSize");
this._distance = colorDistanceCalculator;
this._errorQueueSize = errorQueueSize;
this._weights = ErrorDiffusionRiemersma._createWeights(errorPropagation, errorQueueSize);
}
*quantize(pointContainer, palette) {
const pointArray = pointContainer.getPointArray();
const width = pointContainer.getWidth();
const height = pointContainer.getHeight();
const errorQueue = [];
let head = 0;
for (let i = 0; i < this._errorQueueSize; i++) {
errorQueue[i] = { r: 0, g: 0, b: 0, a: 0 };
}
yield* hilbertCurve(width, height, (x2, y2) => {
const p = pointArray[x2 + y2 * width];
let { r, g, b, a } = p;
for (let i = 0; i < this._errorQueueSize; i++) {
const weight = this._weights[i];
const e = errorQueue[(i + head) % this._errorQueueSize];
r += e.r * weight;
g += e.g * weight;
b += e.b * weight;
a += e.a * weight;
}
const correctedPoint = Point.createByRGBA(inRange0to255Rounded(r), inRange0to255Rounded(g), inRange0to255Rounded(b), inRange0to255Rounded(a));
const quantizedPoint = palette.getNearestColor(this._distance, correctedPoint);
head = (head + 1) % this._errorQueueSize;
const tail = (head + this._errorQueueSize - 1) % this._errorQueueSize;
errorQueue[tail].r = p.r - quantizedPoint.r;
errorQueue[tail].g = p.g - quantizedPoint.g;
errorQueue[tail].b = p.b - quantizedPoint.b;
errorQueue[tail].a = p.a - quantizedPoint.a;
p.from(quantizedPoint);
});
yield {
pointContainer,
progress: 100
};
}
static _createWeights(errorPropagation, errorQueueSize) {
const weights = [];
const multiplier = Math.exp(Math.log(errorQueueSize) / (errorQueueSize - 1));
for (let i = 0, next = 1; i < errorQueueSize; i++) {
weights[i] = (next + 0.5 | 0) / errorQueueSize * errorPropagation;
next *= multiplier;
}
return weights;
}
};
// src/quality/index.ts
var quality_exports = {};
__export(quality_exports, {
ssim: () => ssim
});
// src/quality/ssim.ts
var K1 = 0.01;
var K2 = 0.03;
function ssim(image1, image2) {
if (image1.getHeight() !== image2.getHeight() || image1.getWidth() !== image2.getWidth()) {
throw new Error("Images have different sizes!");
}
const bitsPerComponent = 8;
const L = (1 << bitsPerComponent) - 1;
const c1 = (K1 * L) ** 2;
const c2 = (K2 * L) ** 2;
let numWindows = 0;
let mssim = 0;
iterate(image1, image2, (lumaValues1, lumaValues2, averageLumaValue1, averageLumaValue2) => {
let sigxy = 0;
let sigsqx = 0;
let sigsqy = 0;
for (let i = 0; i < lumaValues1.length; i++) {
sigsqx += (lumaValues1[i] - averageLumaValue1) ** 2;
sigsqy += (lumaValues2[i] - averageLumaValue2) ** 2;
sigxy += (lumaValues1[i] - averageLumaValue1) * (lumaValues2[i] - averageLumaValue2);
}
const numPixelsInWin = lumaValues1.length - 1;
sigsqx /= numPixelsInWin;
sigsqy /= numPixelsInWin;
sigxy /= numPixelsInWin;
const numerator = (2 * averageLumaValue1 * averageLumaValue2 + c1) * (2 * sigxy + c2);
const denominator = (averageLumaValue1 ** 2 + averageLumaValue2 ** 2 + c1) * (sigsqx + sigsqy + c2);
const ssim2 = numerator / denominator;
mssim += ssim2;
numWindows++;
});
return mssim / numWindows;
}
function iterate(image1, image2, callback) {
const windowSize = 8;
const width = image1.getWidth();
const height = image1.getHeight();
for (let y2 = 0; y2 < height; y2 += windowSize) {
for (let x2 = 0; x2 < width; x2 += windowSize) {
const windowWidth = Math.min(windowSize, width - x2);
const windowHeight = Math.min(windowSize, height - y2);
const lumaValues1 = calculateLumaValuesForWindow(image1, x2, y2, windowWidth, windowHeight);
const lumaValues2 = calculateLumaValuesForWindow(image2, x2, y2, windowWidth, windowHeight);
const averageLuma1 = calculateAverageLuma(lumaValues1);
const averageLuma2 = calculateAverageLuma(lumaValues2);
callback(lumaValues1, lumaValues2, averageLuma1, averageLuma2);
}
}
}
function calculateLumaValuesForWindow(image, x2, y2, width, height) {
const pointArray = image.getPointArray();
const lumaValues = [];
let counter = 0;
for (let j = y2; j < y2 + height; j++) {
const offset = j * image.getWidth();
for (let i = x2; i < x2 + width; i++) {
const point = pointArray[offset + i];
lumaValues[counter] = point.r * 0.2126 /* RED */ + point.g * 0.7152 /* GREEN */ + point.b * 0.0722 /* BLUE */;
counter++;
}
}
return lumaValues;
}
function calculateAverageLuma(lumaValues) {
let sumLuma = 0;
for (const luma of lumaValues) {
sumLuma += luma;
}
return sumLuma / lumaValues.length;
}
// src/basicAPI.ts
var setImmediateImpl = typeof setImmediate === "function" ? setImmediate : typeof process !== "undefined" && typeof (process == null ? void 0 : process.nextTick) === "function" ? (callback) => process.nextTick(callback) : (callback) => setTimeout(callback, 0);
function buildPaletteSync(images, {
colorDistanceFormula,
paletteQuantization,
colors
} = {}) {
const distanceCalculator = colorDistanceFormulaToColorDistance(colorDistanceFormula);
const paletteQuantizer = paletteQuantizationToPaletteQuantizer(distanceCalculator, paletteQuantization, colors);
images.forEach((image) => paletteQuantizer.sample(image));
return paletteQuantizer.quantizeSync();
}
async function buildPalette(images, {
colorDistanceFormula,
paletteQuantization,
colors,
onProgress
} = {}) {
return new Promise((resolve, reject) => {
const distanceCalculator = colorDistanceFormulaToColorDistance(colorDistanceFormula);
const paletteQuantizer = paletteQuantizationToPaletteQuantizer(distanceCalculator, paletteQuantization, colors);
images.forEach((image) => paletteQuantizer.sample(image));
let palette;
const iterator = paletteQuantizer.quantize();
const next = () => {
try {
const result = iterator.next();
if (result.done) {
resolve(palette);
} else {
if (result.value.palette)
palette = result.value.palette;
if (onProgress)
onProgress(result.value.progress);
setImmediateImpl(next);
}
} catch (error) {
reject(error);
}
};
setImmediateImpl(next);
});
}
function applyPaletteSync(image, palette, { colorDistanceFormula, imageQuantization } = {}) {
const distanceCalculator = colorDistanceFormulaToColorDistance(colorDistanceFormula);
const imageQuantizer = imageQuantizationToImageQuantizer(distanceCalculator, imageQuantization);
return imageQuantizer.quantizeSync(image, palette);
}
async function applyPalette(image, palette, {
colorDistanceFormula,
imageQuantization,
onProgress
} = {}) {
return new Promise((resolve, reject) => {
const distanceCalculator = colorDistanceFormulaToColorDistance(colorDistanceFormula);
const imageQuantizer = imageQuantizationToImageQuantizer(distanceCalculator, imageQuantization);
let outPointContainer;
const iterator = imageQuantizer.quantize(image, palette);
const next = () => {
try {
const result = iterator.next();
if (result.done) {
resolve(outPointContainer);
} else {
if (result.value.pointContainer) {
outPointContainer = result.value.pointContainer;
}
if (onProgress)
onProgress(result.value.progress);
setImmediateImpl(next);
}
} catch (error) {
reject(error);
}
};
setImmediateImpl(next);
});
}
function colorDistanceFormulaToColorDistance(colorDistanceFormula = "euclidean-bt709") {
switch (colorDistanceFormula) {
case "cie94-graphic-arts":
return new CIE94GraphicArts();
case "cie94-textiles":
return new CIE94Textiles();
case "ciede2000":
return new CIEDE2000();
case "color-metric":
return new CMetric();
case "euclidean":
return new Euclidean();
case "euclidean-bt709":
return new EuclideanBT709();
case "euclidean-bt709-noalpha":
return new EuclideanBT709NoAlpha();
case "manhattan":
return new Manhattan();
case "manhattan-bt709":
return new ManhattanBT709();
case "manhattan-nommyde":
return new ManhattanNommyde();
case "pngquant":
return new PNGQuant();
default:
throw new Error(`Unknown colorDistanceFormula ${colorDistanceFormula}`);
}
}
function imageQuantizationToImageQuantizer(distanceCalculator, imageQuantization = "floyd-steinberg") {
switch (imageQuantization) {
case "nearest":
return new NearestColor(distanceCalculator);
case "riemersma":
return new ErrorDiffusionRiemersma(distanceCalculator);
case "floyd-steinberg":
return new ErrorDiffusionArray(distanceCalculator, 0 /* FloydSteinberg */);
case "false-floyd-steinberg":
return new ErrorDiffusionArray(distanceCalculator, 1 /* FalseFloydSteinberg */);
case "stucki":
return new ErrorDiffusionArray(distanceCalculator, 2 /* Stucki */);
case "atkinson":
return new ErrorDiffusionArray(distanceCalculator, 3 /* Atkinson */);
case "jarvis":
return new ErrorDiffusionArray(distanceCalculator, 4 /* Jarvis */);
case "burkes":
return new ErrorDiffusionArray(distanceCalculator, 5 /* Burkes */);
case "sierra":
return new ErrorDiffusionArray(distanceCalculator, 6 /* Sierra */);
case "two-sierra":
return new ErrorDiffusionArray(distanceCalculator, 7 /* TwoSierra */);
case "sierra-lite":
return new ErrorDiffusionArray(distanceCalculator, 8 /* SierraLite */);
default:
throw new Error(`Unknown imageQuantization ${imageQuantization}`);
}
}
function paletteQuantizationToPaletteQuantizer(distanceCalculator, paletteQuantization = "wuquant", colors = 256) {
switch (paletteQuantization) {
case "neuquant":
return new NeuQuant(distanceCalculator, colors);
case "rgbquant":
return new RGBQuant(distanceCalculator, colors);
case "wuquant":
return new WuQuant(distanceCalculator, colors);
case "neuquant-float":
return new NeuQuantFloat(distanceCalculator, colors);
default:
throw new Error(`Unknown paletteQuantization ${paletteQuantization}`);
}
}
module.exports = __toCommonJS(src_exports);
// Annotate the CommonJS export names for ESM import in node:
0 && (0);
/**
* @preserve
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* cie94.ts - part of Image Quantization Library
*/
/**
* @preserve
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* ciede2000.ts - part of Image Quantization Library
*/
/**
* @preserve
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* cmetric.ts - part of Image Quantization Library
*/
/**
* @preserve
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* common.ts - part of Image Quantization Library
*/
/**
* @preserve
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* constants.ts - part of Image Quantization Library
*/
/**
* @preserve
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* ditherErrorDiffusionArray.ts - part of Image Quantization Library
*/
/**
* @preserve
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* euclidean.ts - part of Image Quantization Library
*/
/**
* @preserve
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* helper.ts - part of Image Quantization Library
*/
/**
* @preserve
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* hueStatistics.ts - part of Image Quantization Library
*/
/**
* @preserve
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* iq.ts - Image Quantization Library
*/
/**
* @preserve
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* lab2rgb.ts - part of Image Quantization Library
*/
/**
* @preserve
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* lab2xyz.ts - part of Image Quantization Library
*/
/**
* @preserve
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* manhattanNeuQuant.ts - part of Image Quantization Library
*/
/**
* @preserve
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* nearestColor.ts - part of Image Quantization Library
*/
/**
* @preserve
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* palette.ts - part of Image Quantization Library
*/
/**
* @preserve
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* pngQuant.ts - part of Image Quantization Library
*/
/**
* @preserve
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* point.ts - part of Image Quantization Library
*/
/**
* @preserve
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* pointContainer.ts - part of Image Quantization Library
*/
/**
* @preserve
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* rgb2hsl.ts - part of Image Quantization Library
*/
/**
* @preserve
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* rgb2lab.ts - part of Image Quantization Library
*/
/**
* @preserve
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* rgb2xyz.ts - part of Image Quantization Library
*/
/**
* @preserve
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* ssim.ts - part of Image Quantization Library
*/
/**
* @preserve
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* wuQuant.ts - part of Image Quantization Library
*/
/**
* @preserve
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* xyz2lab.ts - part of Image Quantization Library
*/
/**
* @preserve
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* xyz2rgb.ts - part of Image Quantization Library
*/
/**
* @preserve
* MIT License
*
* Copyright 2015-2018 Igor Bezkrovnyi
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*
* riemersma.ts - part of Image Quantization Library
*/
/**
* @preserve TypeScript port:
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* colorHistogram.ts - part of Image Quantization Library
*/
/**
* @preserve TypeScript port:
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* neuquant.ts - part of Image Quantization Library
*/
/**
* @preserve TypeScript port:
* Copyright 2015-2018 Igor Bezkrovnyi
* All rights reserved. (MIT Licensed)
*
* rgbquant.ts - part of Image Quantization Library
*/
//# sourceMappingURL=image-q.cjs.map
/***/ }),
/***/ 5799:
/***/ ((module) => {
"use strict";
module.exports = JSON.parse('{"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomsvc+xml":["atomsvc"],"application/bdoc":["bdoc"],"application/ccxml+xml":["ccxml"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/font-tdpfr":["pfr"],"application/font-woff":[],"application/font-woff2":[],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/prs.cww":["cww"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["xfdf"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":[],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":[],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-iso9660-image":[],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":[],"application/x-msdownload":["com","bat"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["wmf","emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":[],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"application/xaml+xml":["xaml"],"application/xcap-diff+xml":["xdf"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":[],"audio/adpcm":["adp"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mp3":[],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/wav":["wav"],"audio/wave":[],"audio/webm":["weba"],"audio/x-aac":["aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":[],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":[],"audio/x-wav":[],"audio/xm":["xm"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/apng":["apng"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/g3fax":["g3"],"image/gif":["gif"],"image/ief":["ief"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jpm":["jpm"],"image/jpx":["jpx","jpf"],"image/ktx":["ktx"],"image/png":["png"],"image/prs.btif":["btif"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/tiff":["tiff","tif"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":[],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/webp":["webp"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":[],"image/x-pcx":["pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/rfc822":["eml","mime"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["mts"],"model/vnd.vtu":["vtu"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["x3db","x3dbz"],"model/x3d+vrml":["x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/hjson":["hjson"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/prs.lines.tag":["dsc"],"text/richtext":["rtx"],"text/rtf":[],"text/sgml":["sgml","sgm"],"text/slim":["slim","slm"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/vtt":["vtt"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":[],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"text/xml":[],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/jpeg":["jpgv"],"video/jpm":["jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/webm":["webm"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]}');
/***/ }),
/***/ 2020:
/***/ ((module) => {
"use strict";
module.exports = JSON.parse('[[[0,44],"disallowed_STD3_valid"],[[45,46],"valid"],[[47,47],"disallowed_STD3_valid"],[[48,57],"valid"],[[58,64],"disallowed_STD3_valid"],[[65,65],"mapped",[97]],[[66,66],"mapped",[98]],[[67,67],"mapped",[99]],[[68,68],"mapped",[100]],[[69,69],"mapped",[101]],[[70,70],"mapped",[102]],[[71,71],"mapped",[103]],[[72,72],"mapped",[104]],[[73,73],"mapped",[105]],[[74,74],"mapped",[106]],[[75,75],"mapped",[107]],[[76,76],"mapped",[108]],[[77,77],"mapped",[109]],[[78,78],"mapped",[110]],[[79,79],"mapped",[111]],[[80,80],"mapped",[112]],[[81,81],"mapped",[113]],[[82,82],"mapped",[114]],[[83,83],"mapped",[115]],[[84,84],"mapped",[116]],[[85,85],"mapped",[117]],[[86,86],"mapped",[118]],[[87,87],"mapped",[119]],[[88,88],"mapped",[120]],[[89,89],"mapped",[121]],[[90,90],"mapped",[122]],[[91,96],"disallowed_STD3_valid"],[[97,122],"valid"],[[123,127],"disallowed_STD3_valid"],[[128,159],"disallowed"],[[160,160],"disallowed_STD3_mapped",[32]],[[161,167],"valid",[],"NV8"],[[168,168],"disallowed_STD3_mapped",[32,776]],[[169,169],"valid",[],"NV8"],[[170,170],"mapped",[97]],[[171,172],"valid",[],"NV8"],[[173,173],"ignored"],[[174,174],"valid",[],"NV8"],[[175,175],"disallowed_STD3_mapped",[32,772]],[[176,177],"valid",[],"NV8"],[[178,178],"mapped",[50]],[[179,179],"mapped",[51]],[[180,180],"disallowed_STD3_mapped",[32,769]],[[181,181],"mapped",[956]],[[182,182],"valid",[],"NV8"],[[183,183],"valid"],[[184,184],"disallowed_STD3_mapped",[32,807]],[[185,185],"mapped",[49]],[[186,186],"mapped",[111]],[[187,187],"valid",[],"NV8"],[[188,188],"mapped",[49,8260,52]],[[189,189],"mapped",[49,8260,50]],[[190,190],"mapped",[51,8260,52]],[[191,191],"valid",[],"NV8"],[[192,192],"mapped",[224]],[[193,193],"mapped",[225]],[[194,194],"mapped",[226]],[[195,195],"mapped",[227]],[[196,196],"mapped",[228]],[[197,197],"mapped",[229]],[[198,198],"mapped",[230]],[[199,199],"mapped",[231]],[[200,200],"mapped",[232]],[[201,201],"mapped",[233]],[[202,202],"mapped",[234]],[[203,203],"mapped",[235]],[[204,204],"mapped",[236]],[[205,205],"mapped",[237]],[[206,206],"mapped",[238]],[[207,207],"mapped",[239]],[[208,208],"mapped",[240]],[[209,209],"mapped",[241]],[[210,210],"mapped",[242]],[[211,211],"mapped",[243]],[[212,212],"mapped",[244]],[[213,213],"mapped",[245]],[[214,214],"mapped",[246]],[[215,215],"valid",[],"NV8"],[[216,216],"mapped",[248]],[[217,217],"mapped",[249]],[[218,218],"mapped",[250]],[[219,219],"mapped",[251]],[[220,220],"mapped",[252]],[[221,221],"mapped",[253]],[[222,222],"mapped",[254]],[[223,223],"deviation",[115,115]],[[224,246],"valid"],[[247,247],"valid",[],"NV8"],[[248,255],"valid"],[[256,256],"mapped",[257]],[[257,257],"valid"],[[258,258],"mapped",[259]],[[259,259],"valid"],[[260,260],"mapped",[261]],[[261,261],"valid"],[[262,262],"mapped",[263]],[[263,263],"valid"],[[264,264],"mapped",[265]],[[265,265],"valid"],[[266,266],"mapped",[267]],[[267,267],"valid"],[[268,268],"mapped",[269]],[[269,269],"valid"],[[270,270],"mapped",[271]],[[271,271],"valid"],[[272,272],"mapped",[273]],[[273,273],"valid"],[[274,274],"mapped",[275]],[[275,275],"valid"],[[276,276],"mapped",[277]],[[277,277],"valid"],[[278,278],"mapped",[279]],[[279,279],"valid"],[[280,280],"mapped",[281]],[[281,281],"valid"],[[282,282],"mapped",[283]],[[283,283],"valid"],[[284,284],"mapped",[285]],[[285,285],"valid"],[[286,286],"mapped",[287]],[[287,287],"valid"],[[288,288],"mapped",[289]],[[289,289],"valid"],[[290,290],"mapped",[291]],[[291,291],"valid"],[[292,292],"mapped",[293]],[[293,293],"valid"],[[294,294],"mapped",[295]],[[295,295],"valid"],[[296,296],"mapped",[297]],[[297,297],"valid"],[[298,298],"mapped",[299]],[[299,299],"valid"],[[300,300],"mapped",[301]],[[301,301],"valid"],[[302,302],"mapped",[303]],[[303,303],"valid"],[[304,304],"mapped",[105,775]],[[305,305],"valid"],[[306,307],"mapped",[105,106]],[[308,308],"mapped",[309]],[[309,309],"valid"],[[310,310],"mapped",[311]],[[311,312],"valid"],[[313,313],"mapped",[314]],[[314,314],"valid"],[[315,315],"mapped",[316]],[[316,316],"valid"],[[317,317],"mapped",[318]],[[318,318],"valid"],[[319,320],"mapped",[108,183]],[[321,321],"mapped",[322]],[[322,322],"valid"],[[323,323],"mapped",[324]],[[324,324],"valid"],[[325,325],"mapped",[326]],[[326,326],"valid"],[[327,327],"mapped",[328]],[[328,328],"valid"],[[329,329],"mapped",[700,110]],[[330,330],"mapped",[331]],[[331,331],"valid"],[[332,332],"mapped",[333]],[[333,333],"valid"],[[334,334],"mapped",[335]],[[335,335],"valid"],[[336,336],"mapped",[337]],[[337,337],"valid"],[[338,338],"mapped",[339]],[[339,339],"valid"],[[340,340],"mapped",[341]],[[341,341],"valid"],[[342,342],"mapped",[343]],[[343,343],"valid"],[[344,344],"mapped",[345]],[[345,345],"valid"],[[346,346],"mapped",[347]],[[347,347],"valid"],[[348,348],"mapped",[349]],[[349,349],"valid"],[[350,350],"mapped",[351]],[[351,351],"valid"],[[352,352],"mapped",[353]],[[353,353],"valid"],[[354,354],"mapped",[355]],[[355,355],"valid"],[[356,356],"mapped",[357]],[[357,357],"valid"],[[358,358],"mapped",[359]],[[359,359],"valid"],[[360,360],"mapped",[361]],[[361,361],"valid"],[[362,362],"mapped",[363]],[[363,363],"valid"],[[364,364],"mapped",[365]],[[365,365],"valid"],[[366,366],"mapped",[367]],[[367,367],"valid"],[[368,368],"mapped",[369]],[[369,369],"valid"],[[370,370],"mapped",[371]],[[371,371],"valid"],[[372,372],"mapped",[373]],[[373,373],"valid"],[[374,374],"mapped",[375]],[[375,375],"valid"],[[376,376],"mapped",[255]],[[377,377],"mapped",[378]],[[378,378],"valid"],[[379,379],"mapped",[380]],[[380,380],"valid"],[[381,381],"mapped",[382]],[[382,382],"valid"],[[383,383],"mapped",[115]],[[384,384],"valid"],[[385,385],"mapped",[595]],[[386,386],"mapped",[387]],[[387,387],"valid"],[[388,388],"mapped",[389]],[[389,389],"valid"],[[390,390],"mapped",[596]],[[391,391],"mapped",[392]],[[392,392],"valid"],[[393,393],"mapped",[598]],[[394,394],"mapped",[599]],[[395,395],"mapped",[396]],[[396,397],"valid"],[[398,398],"mapped",[477]],[[399,399],"mapped",[601]],[[400,400],"mapped",[603]],[[401,401],"mapped",[402]],[[402,402],"valid"],[[403,403],"mapped",[608]],[[404,404],"mapped",[611]],[[405,405],"valid"],[[406,406],"mapped",[617]],[[407,407],"mapped",[616]],[[408,408],"mapped",[409]],[[409,411],"valid"],[[412,412],"mapped",[623]],[[413,413],"mapped",[626]],[[414,414],"valid"],[[415,415],"mapped",[629]],[[416,416],"mapped",[417]],[[417,417],"valid"],[[418,418],"mapped",[419]],[[419,419],"valid"],[[420,420],"mapped",[421]],[[421,421],"valid"],[[422,422],"mapped",[640]],[[423,423],"mapped",[424]],[[424,424],"valid"],[[425,425],"mapped",[643]],[[426,427],"valid"],[[428,428],"mapped",[429]],[[429,429],"valid"],[[430,430],"mapped",[648]],[[431,431],"mapped",[432]],[[432,432],"valid"],[[433,433],"mapped",[650]],[[434,434],"mapped",[651]],[[435,435],"mapped",[436]],[[436,436],"valid"],[[437,437],"mapped",[438]],[[438,438],"valid"],[[439,439],"mapped",[658]],[[440,440],"mapped",[441]],[[441,443],"valid"],[[444,444],"mapped",[445]],[[445,451],"valid"],[[452,454],"mapped",[100,382]],[[455,457],"mapped",[108,106]],[[458,460],"mapped",[110,106]],[[461,461],"mapped",[462]],[[462,462],"valid"],[[463,463],"mapped",[464]],[[464,464],"valid"],[[465,465],"mapped",[466]],[[466,466],"valid"],[[467,467],"mapped",[468]],[[468,468],"valid"],[[469,469],"mapped",[470]],[[470,470],"valid"],[[471,471],"mapped",[472]],[[472,472],"valid"],[[473,473],"mapped",[474]],[[474,474],"valid"],[[475,475],"mapped",[476]],[[476,477],"valid"],[[478,478],"mapped",[479]],[[479,479],"valid"],[[480,480],"mapped",[481]],[[481,481],"valid"],[[482,482],"mapped",[483]],[[483,483],"valid"],[[484,484],"mapped",[485]],[[485,485],"valid"],[[486,486],"mapped",[487]],[[487,487],"valid"],[[488,488],"mapped",[489]],[[489,489],"valid"],[[490,490],"mapped",[491]],[[491,491],"valid"],[[492,492],"mapped",[493]],[[493,493],"valid"],[[494,494],"mapped",[495]],[[495,496],"valid"],[[497,499],"mapped",[100,122]],[[500,500],"mapped",[501]],[[501,501],"valid"],[[502,502],"mapped",[405]],[[503,503],"mapped",[447]],[[504,504],"mapped",[505]],[[505,505],"valid"],[[506,506],"mapped",[507]],[[507,507],"valid"],[[508,508],"mapped",[509]],[[509,509],"valid"],[[510,510],"mapped",[511]],[[511,511],"valid"],[[512,512],"mapped",[513]],[[513,513],"valid"],[[514,514],"mapped",[515]],[[515,515],"valid"],[[516,516],"mapped",[517]],[[517,517],"valid"],[[518,518],"mapped",[519]],[[519,519],"valid"],[[520,520],"mapped",[521]],[[521,521],"valid"],[[522,522],"mapped",[523]],[[523,523],"valid"],[[524,524],"mapped",[525]],[[525,525],"valid"],[[526,526],"mapped",[527]],[[527,527],"valid"],[[528,528],"mapped",[529]],[[529,529],"valid"],[[530,530],"mapped",[531]],[[531,531],"valid"],[[532,532],"mapped",[533]],[[533,533],"valid"],[[534,534],"mapped",[535]],[[535,535],"valid"],[[536,536],"mapped",[537]],[[537,537],"valid"],[[538,538],"mapped",[539]],[[539,539],"valid"],[[540,540],"mapped",[541]],[[541,541],"valid"],[[542,542],"mapped",[543]],[[543,543],"valid"],[[544,544],"mapped",[414]],[[545,545],"valid"],[[546,546],"mapped",[547]],[[547,547],"valid"],[[548,548],"mapped",[549]],[[549,549],"valid"],[[550,550],"mapped",[551]],[[551,551],"valid"],[[552,552],"mapped",[553]],[[553,553],"valid"],[[554,554],"mapped",[555]],[[555,555],"valid"],[[556,556],"mapped",[557]],[[557,557],"valid"],[[558,558],"mapped",[559]],[[559,559],"valid"],[[560,560],"mapped",[561]],[[561,561],"valid"],[[562,562],"mapped",[563]],[[563,563],"valid"],[[564,566],"valid"],[[567,569],"valid"],[[570,570],"mapped",[11365]],[[571,571],"mapped",[572]],[[572,572],"valid"],[[573,573],"mapped",[410]],[[574,574],"mapped",[11366]],[[575,576],"valid"],[[577,577],"mapped",[578]],[[578,578],"valid"],[[579,579],"mapped",[384]],[[580,580],"mapped",[649]],[[581,581],"mapped",[652]],[[582,582],"mapped",[583]],[[583,583],"valid"],[[584,584],"mapped",[585]],[[585,585],"valid"],[[586,586],"mapped",[587]],[[587,587],"valid"],[[588,588],"mapped",[589]],[[589,589],"valid"],[[590,590],"mapped",[591]],[[591,591],"valid"],[[592,680],"valid"],[[681,685],"valid"],[[686,687],"valid"],[[688,688],"mapped",[104]],[[689,689],"mapped",[614]],[[690,690],"mapped",[106]],[[691,691],"mapped",[114]],[[692,692],"mapped",[633]],[[693,693],"mapped",[635]],[[694,694],"mapped",[641]],[[695,695],"mapped",[119]],[[696,696],"mapped",[121]],[[697,705],"valid"],[[706,709],"valid",[],"NV8"],[[710,721],"valid"],[[722,727],"valid",[],"NV8"],[[728,728],"disallowed_STD3_mapped",[32,774]],[[729,729],"disallowed_STD3_mapped",[32,775]],[[730,730],"disallowed_STD3_mapped",[32,778]],[[731,731],"disallowed_STD3_mapped",[32,808]],[[732,732],"disallowed_STD3_mapped",[32,771]],[[733,733],"disallowed_STD3_mapped",[32,779]],[[734,734],"valid",[],"NV8"],[[735,735],"valid",[],"NV8"],[[736,736],"mapped",[611]],[[737,737],"mapped",[108]],[[738,738],"mapped",[115]],[[739,739],"mapped",[120]],[[740,740],"mapped",[661]],[[741,745],"valid",[],"NV8"],[[746,747],"valid",[],"NV8"],[[748,748],"valid"],[[749,749],"valid",[],"NV8"],[[750,750],"valid"],[[751,767],"valid",[],"NV8"],[[768,831],"valid"],[[832,832],"mapped",[768]],[[833,833],"mapped",[769]],[[834,834],"valid"],[[835,835],"mapped",[787]],[[836,836],"mapped",[776,769]],[[837,837],"mapped",[953]],[[838,846],"valid"],[[847,847],"ignored"],[[848,855],"valid"],[[856,860],"valid"],[[861,863],"valid"],[[864,865],"valid"],[[866,866],"valid"],[[867,879],"valid"],[[880,880],"mapped",[881]],[[881,881],"valid"],[[882,882],"mapped",[883]],[[883,883],"valid"],[[884,884],"mapped",[697]],[[885,885],"valid"],[[886,886],"mapped",[887]],[[887,887],"valid"],[[888,889],"disallowed"],[[890,890],"disallowed_STD3_mapped",[32,953]],[[891,893],"valid"],[[894,894],"disallowed_STD3_mapped",[59]],[[895,895],"mapped",[1011]],[[896,899],"disallowed"],[[900,900],"disallowed_STD3_mapped",[32,769]],[[901,901],"disallowed_STD3_mapped",[32,776,769]],[[902,902],"mapped",[940]],[[903,903],"mapped",[183]],[[904,904],"mapped",[941]],[[905,905],"mapped",[942]],[[906,906],"mapped",[943]],[[907,907],"disallowed"],[[908,908],"mapped",[972]],[[909,909],"disallowed"],[[910,910],"mapped",[973]],[[911,911],"mapped",[974]],[[912,912],"valid"],[[913,913],"mapped",[945]],[[914,914],"mapped",[946]],[[915,915],"mapped",[947]],[[916,916],"mapped",[948]],[[917,917],"mapped",[949]],[[918,918],"mapped",[950]],[[919,919],"mapped",[951]],[[920,920],"mapped",[952]],[[921,921],"mapped",[953]],[[922,922],"mapped",[954]],[[923,923],"mapped",[955]],[[924,924],"mapped",[956]],[[925,925],"mapped",[957]],[[926,926],"mapped",[958]],[[927,927],"mapped",[959]],[[928,928],"mapped",[960]],[[929,929],"mapped",[961]],[[930,930],"disallowed"],[[931,931],"mapped",[963]],[[932,932],"mapped",[964]],[[933,933],"mapped",[965]],[[934,934],"mapped",[966]],[[935,935],"mapped",[967]],[[936,936],"mapped",[968]],[[937,937],"mapped",[969]],[[938,938],"mapped",[970]],[[939,939],"mapped",[971]],[[940,961],"valid"],[[962,962],"deviation",[963]],[[963,974],"valid"],[[975,975],"mapped",[983]],[[976,976],"mapped",[946]],[[977,977],"mapped",[952]],[[978,978],"mapped",[965]],[[979,979],"mapped",[973]],[[980,980],"mapped",[971]],[[981,981],"mapped",[966]],[[982,982],"mapped",[960]],[[983,983],"valid"],[[984,984],"mapped",[985]],[[985,985],"valid"],[[986,986],"mapped",[987]],[[987,987],"valid"],[[988,988],"mapped",[989]],[[989,989],"valid"],[[990,990],"mapped",[991]],[[991,991],"valid"],[[992,992],"mapped",[993]],[[993,993],"valid"],[[994,994],"mapped",[995]],[[995,995],"valid"],[[996,996],"mapped",[997]],[[997,997],"valid"],[[998,998],"mapped",[999]],[[999,999],"valid"],[[1000,1000],"mapped",[1001]],[[1001,1001],"valid"],[[1002,1002],"mapped",[1003]],[[1003,1003],"valid"],[[1004,1004],"mapped",[1005]],[[1005,1005],"valid"],[[1006,1006],"mapped",[1007]],[[1007,1007],"valid"],[[1008,1008],"mapped",[954]],[[1009,1009],"mapped",[961]],[[1010,1010],"mapped",[963]],[[1011,1011],"valid"],[[1012,1012],"mapped",[952]],[[1013,1013],"mapped",[949]],[[1014,1014],"valid",[],"NV8"],[[1015,1015],"mapped",[1016]],[[1016,1016],"valid"],[[1017,1017],"mapped",[963]],[[1018,1018],"mapped",[1019]],[[1019,1019],"valid"],[[1020,1020],"valid"],[[1021,1021],"mapped",[891]],[[1022,1022],"mapped",[892]],[[1023,1023],"mapped",[893]],[[1024,1024],"mapped",[1104]],[[1025,1025],"mapped",[1105]],[[1026,1026],"mapped",[1106]],[[1027,1027],"mapped",[1107]],[[1028,1028],"mapped",[1108]],[[1029,1029],"mapped",[1109]],[[1030,1030],"mapped",[1110]],[[1031,1031],"mapped",[1111]],[[1032,1032],"mapped",[1112]],[[1033,1033],"mapped",[1113]],[[1034,1034],"mapped",[1114]],[[1035,1035],"mapped",[1115]],[[1036,1036],"mapped",[1116]],[[1037,1037],"mapped",[1117]],[[1038,1038],"mapped",[1118]],[[1039,1039],"mapped",[1119]],[[1040,1040],"mapped",[1072]],[[1041,1041],"mapped",[1073]],[[1042,1042],"mapped",[1074]],[[1043,1043],"mapped",[1075]],[[1044,1044],"mapped",[1076]],[[1045,1045],"mapped",[1077]],[[1046,1046],"mapped",[1078]],[[1047,1047],"mapped",[1079]],[[1048,1048],"mapped",[1080]],[[1049,1049],"mapped",[1081]],[[1050,1050],"mapped",[1082]],[[1051,1051],"mapped",[1083]],[[1052,1052],"mapped",[1084]],[[1053,1053],"mapped",[1085]],[[1054,1054],"mapped",[1086]],[[1055,1055],"mapped",[1087]],[[1056,1056],"mapped",[1088]],[[1057,1057],"mapped",[1089]],[[1058,1058],"mapped",[1090]],[[1059,1059],"mapped",[1091]],[[1060,1060],"mapped",[1092]],[[1061,1061],"mapped",[1093]],[[1062,1062],"mapped",[1094]],[[1063,1063],"mapped",[1095]],[[1064,1064],"mapped",[1096]],[[1065,1065],"mapped",[1097]],[[1066,1066],"mapped",[1098]],[[1067,1067],"mapped",[1099]],[[1068,1068],"mapped",[1100]],[[1069,1069],"mapped",[1101]],[[1070,1070],"mapped",[1102]],[[1071,1071],"mapped",[1103]],[[1072,1103],"valid"],[[1104,1104],"valid"],[[1105,1116],"valid"],[[1117,1117],"valid"],[[1118,1119],"valid"],[[1120,1120],"mapped",[1121]],[[1121,1121],"valid"],[[1122,1122],"mapped",[1123]],[[1123,1123],"valid"],[[1124,1124],"mapped",[1125]],[[1125,1125],"valid"],[[1126,1126],"mapped",[1127]],[[1127,1127],"valid"],[[1128,1128],"mapped",[1129]],[[1129,1129],"valid"],[[1130,1130],"mapped",[1131]],[[1131,1131],"valid"],[[1132,1132],"mapped",[1133]],[[1133,1133],"valid"],[[1134,1134],"mapped",[1135]],[[1135,1135],"valid"],[[1136,1136],"mapped",[1137]],[[1137,1137],"valid"],[[1138,1138],"mapped",[1139]],[[1139,1139],"valid"],[[1140,1140],"mapped",[1141]],[[1141,1141],"valid"],[[1142,1142],"mapped",[1143]],[[1143,1143],"valid"],[[1144,1144],"mapped",[1145]],[[1145,1145],"valid"],[[1146,1146],"mapped",[1147]],[[1147,1147],"valid"],[[1148,1148],"mapped",[1149]],[[1149,1149],"valid"],[[1150,1150],"mapped",[1151]],[[1151,1151],"valid"],[[1152,1152],"mapped",[1153]],[[1153,1153],"valid"],[[1154,1154],"valid",[],"NV8"],[[1155,1158],"valid"],[[1159,1159],"valid"],[[1160,1161],"valid",[],"NV8"],[[1162,1162],"mapped",[1163]],[[1163,1163],"valid"],[[1164,1164],"mapped",[1165]],[[1165,1165],"valid"],[[1166,1166],"mapped",[1167]],[[1167,1167],"valid"],[[1168,1168],"mapped",[1169]],[[1169,1169],"valid"],[[1170,1170],"mapped",[1171]],[[1171,1171],"valid"],[[1172,1172],"mapped",[1173]],[[1173,1173],"valid"],[[1174,1174],"mapped",[1175]],[[1175,1175],"valid"],[[1176,1176],"mapped",[1177]],[[1177,1177],"valid"],[[1178,1178],"mapped",[1179]],[[1179,1179],"valid"],[[1180,1180],"mapped",[1181]],[[1181,1181],"valid"],[[1182,1182],"mapped",[1183]],[[1183,1183],"valid"],[[1184,1184],"mapped",[1185]],[[1185,1185],"valid"],[[1186,1186],"mapped",[1187]],[[1187,1187],"valid"],[[1188,1188],"mapped",[1189]],[[1189,1189],"valid"],[[1190,1190],"mapped",[1191]],[[1191,1191],"valid"],[[1192,1192],"mapped",[1193]],[[1193,1193],"valid"],[[1194,1194],"mapped",[1195]],[[1195,1195],"valid"],[[1196,1196],"mapped",[1197]],[[1197,1197],"valid"],[[1198,1198],"mapped",[1199]],[[1199,1199],"valid"],[[1200,1200],"mapped",[1201]],[[1201,1201],"valid"],[[1202,1202],"mapped",[1203]],[[1203,1203],"valid"],[[1204,1204],"mapped",[1205]],[[1205,1205],"valid"],[[1206,1206],"mapped",[1207]],[[1207,1207],"valid"],[[1208,1208],"mapped",[1209]],[[1209,1209],"valid"],[[1210,1210],"mapped",[1211]],[[1211,1211],"valid"],[[1212,1212],"mapped",[1213]],[[1213,1213],"valid"],[[1214,1214],"mapped",[1215]],[[1215,1215],"valid"],[[1216,1216],"disallowed"],[[1217,1217],"mapped",[1218]],[[1218,1218],"valid"],[[1219,1219],"mapped",[1220]],[[1220,1220],"valid"],[[1221,1221],"mapped",[1222]],[[1222,1222],"valid"],[[1223,1223],"mapped",[1224]],[[1224,1224],"valid"],[[1225,1225],"mapped",[1226]],[[1226,1226],"valid"],[[1227,1227],"mapped",[1228]],[[1228,1228],"valid"],[[1229,1229],"mapped",[1230]],[[1230,1230],"valid"],[[1231,1231],"valid"],[[1232,1232],"mapped",[1233]],[[1233,1233],"valid"],[[1234,1234],"mapped",[1235]],[[1235,1235],"valid"],[[1236,1236],"mapped",[1237]],[[1237,1237],"valid"],[[1238,1238],"mapped",[1239]],[[1239,1239],"valid"],[[1240,1240],"mapped",[1241]],[[1241,1241],"valid"],[[1242,1242],"mapped",[1243]],[[1243,1243],"valid"],[[1244,1244],"mapped",[1245]],[[1245,1245],"valid"],[[1246,1246],"mapped",[1247]],[[1247,1247],"valid"],[[1248,1248],"mapped",[1249]],[[1249,1249],"valid"],[[1250,1250],"mapped",[1251]],[[1251,1251],"valid"],[[1252,1252],"mapped",[1253]],[[1253,1253],"valid"],[[1254,1254],"mapped",[1255]],[[1255,1255],"valid"],[[1256,1256],"mapped",[1257]],[[1257,1257],"valid"],[[1258,1258],"mapped",[1259]],[[1259,1259],"valid"],[[1260,1260],"mapped",[1261]],[[1261,1261],"valid"],[[1262,1262],"mapped",[1263]],[[1263,1263],"valid"],[[1264,1264],"mapped",[1265]],[[1265,1265],"valid"],[[1266,1266],"mapped",[1267]],[[1267,1267],"valid"],[[1268,1268],"mapped",[1269]],[[1269,1269],"valid"],[[1270,1270],"mapped",[1271]],[[1271,1271],"valid"],[[1272,1272],"mapped",[1273]],[[1273,1273],"valid"],[[1274,1274],"mapped",[1275]],[[1275,1275],"valid"],[[1276,1276],"mapped",[1277]],[[1277,1277],"valid"],[[1278,1278],"mapped",[1279]],[[1279,1279],"valid"],[[1280,1280],"mapped",[1281]],[[1281,1281],"valid"],[[1282,1282],"mapped",[1283]],[[1283,1283],"valid"],[[1284,1284],"mapped",[1285]],[[1285,1285],"valid"],[[1286,1286],"mapped",[1287]],[[1287,1287],"valid"],[[1288,1288],"mapped",[1289]],[[1289,1289],"valid"],[[1290,1290],"mapped",[1291]],[[1291,1291],"valid"],[[1292,1292],"mapped",[1293]],[[1293,1293],"valid"],[[1294,1294],"mapped",[1295]],[[1295,1295],"valid"],[[1296,1296],"mapped",[1297]],[[1297,1297],"valid"],[[1298,1298],"mapped",[1299]],[[1299,1299],"valid"],[[1300,1300],"mapped",[1301]],[[1301,1301],"valid"],[[1302,1302],"mapped",[1303]],[[1303,1303],"valid"],[[1304,1304],"mapped",[1305]],[[1305,1305],"valid"],[[1306,1306],"mapped",[1307]],[[1307,1307],"valid"],[[1308,1308],"mapped",[1309]],[[1309,1309],"valid"],[[1310,1310],"mapped",[1311]],[[1311,1311],"valid"],[[1312,1312],"mapped",[1313]],[[1313,1313],"valid"],[[1314,1314],"mapped",[1315]],[[1315,1315],"valid"],[[1316,1316],"mapped",[1317]],[[1317,1317],"valid"],[[1318,1318],"mapped",[1319]],[[1319,1319],"valid"],[[1320,1320],"mapped",[1321]],[[1321,1321],"valid"],[[1322,1322],"mapped",[1323]],[[1323,1323],"valid"],[[1324,1324],"mapped",[1325]],[[1325,1325],"valid"],[[1326,1326],"mapped",[1327]],[[1327,1327],"valid"],[[1328,1328],"disallowed"],[[1329,1329],"mapped",[1377]],[[1330,1330],"mapped",[1378]],[[1331,1331],"mapped",[1379]],[[1332,1332],"mapped",[1380]],[[1333,1333],"mapped",[1381]],[[1334,1334],"mapped",[1382]],[[1335,1335],"mapped",[1383]],[[1336,1336],"mapped",[1384]],[[1337,1337],"mapped",[1385]],[[1338,1338],"mapped",[1386]],[[1339,1339],"mapped",[1387]],[[1340,1340],"mapped",[1388]],[[1341,1341],"mapped",[1389]],[[1342,1342],"mapped",[1390]],[[1343,1343],"mapped",[1391]],[[1344,1344],"mapped",[1392]],[[1345,1345],"mapped",[1393]],[[1346,1346],"mapped",[1394]],[[1347,1347],"mapped",[1395]],[[1348,1348],"mapped",[1396]],[[1349,1349],"mapped",[1397]],[[1350,1350],"mapped",[1398]],[[1351,1351],"mapped",[1399]],[[1352,1352],"mapped",[1400]],[[1353,1353],"mapped",[1401]],[[1354,1354],"mapped",[1402]],[[1355,1355],"mapped",[1403]],[[1356,1356],"mapped",[1404]],[[1357,1357],"mapped",[1405]],[[1358,1358],"mapped",[1406]],[[1359,1359],"mapped",[1407]],[[1360,1360],"mapped",[1408]],[[1361,1361],"mapped",[1409]],[[1362,1362],"mapped",[1410]],[[1363,1363],"mapped",[1411]],[[1364,1364],"mapped",[1412]],[[1365,1365],"mapped",[1413]],[[1366,1366],"mapped",[1414]],[[1367,1368],"disallowed"],[[1369,1369],"valid"],[[1370,1375],"valid",[],"NV8"],[[1376,1376],"disallowed"],[[1377,1414],"valid"],[[1415,1415],"mapped",[1381,1410]],[[1416,1416],"disallowed"],[[1417,1417],"valid",[],"NV8"],[[1418,1418],"valid",[],"NV8"],[[1419,1420],"disallowed"],[[1421,1422],"valid",[],"NV8"],[[1423,1423],"valid",[],"NV8"],[[1424,1424],"disallowed"],[[1425,1441],"valid"],[[1442,1442],"valid"],[[1443,1455],"valid"],[[1456,1465],"valid"],[[1466,1466],"valid"],[[1467,1469],"valid"],[[1470,1470],"valid",[],"NV8"],[[1471,1471],"valid"],[[1472,1472],"valid",[],"NV8"],[[1473,1474],"valid"],[[1475,1475],"valid",[],"NV8"],[[1476,1476],"valid"],[[1477,1477],"valid"],[[1478,1478],"valid",[],"NV8"],[[1479,1479],"valid"],[[1480,1487],"disallowed"],[[1488,1514],"valid"],[[1515,1519],"disallowed"],[[1520,1524],"valid"],[[1525,1535],"disallowed"],[[1536,1539],"disallowed"],[[1540,1540],"disallowed"],[[1541,1541],"disallowed"],[[1542,1546],"valid",[],"NV8"],[[1547,1547],"valid",[],"NV8"],[[1548,1548],"valid",[],"NV8"],[[1549,1551],"valid",[],"NV8"],[[1552,1557],"valid"],[[1558,1562],"valid"],[[1563,1563],"valid",[],"NV8"],[[1564,1564],"disallowed"],[[1565,1565],"disallowed"],[[1566,1566],"valid",[],"NV8"],[[1567,1567],"valid",[],"NV8"],[[1568,1568],"valid"],[[1569,1594],"valid"],[[1595,1599],"valid"],[[1600,1600],"valid",[],"NV8"],[[1601,1618],"valid"],[[1619,1621],"valid"],[[1622,1624],"valid"],[[1625,1630],"valid"],[[1631,1631],"valid"],[[1632,1641],"valid"],[[1642,1645],"valid",[],"NV8"],[[1646,1647],"valid"],[[1648,1652],"valid"],[[1653,1653],"mapped",[1575,1652]],[[1654,1654],"mapped",[1608,1652]],[[1655,1655],"mapped",[1735,1652]],[[1656,1656],"mapped",[1610,1652]],[[1657,1719],"valid"],[[1720,1721],"valid"],[[1722,1726],"valid"],[[1727,1727],"valid"],[[1728,1742],"valid"],[[1743,1743],"valid"],[[1744,1747],"valid"],[[1748,1748],"valid",[],"NV8"],[[1749,1756],"valid"],[[1757,1757],"disallowed"],[[1758,1758],"valid",[],"NV8"],[[1759,1768],"valid"],[[1769,1769],"valid",[],"NV8"],[[1770,1773],"valid"],[[1774,1775],"valid"],[[1776,1785],"valid"],[[1786,1790],"valid"],[[1791,1791],"valid"],[[1792,1805],"valid",[],"NV8"],[[1806,1806],"disallowed"],[[1807,1807],"disallowed"],[[1808,1836],"valid"],[[1837,1839],"valid"],[[1840,1866],"valid"],[[1867,1868],"disallowed"],[[1869,1871],"valid"],[[1872,1901],"valid"],[[1902,1919],"valid"],[[1920,1968],"valid"],[[1969,1969],"valid"],[[1970,1983],"disallowed"],[[1984,2037],"valid"],[[2038,2042],"valid",[],"NV8"],[[2043,2047],"disallowed"],[[2048,2093],"valid"],[[2094,2095],"disallowed"],[[2096,2110],"valid",[],"NV8"],[[2111,2111],"disallowed"],[[2112,2139],"valid"],[[2140,2141],"disallowed"],[[2142,2142],"valid",[],"NV8"],[[2143,2207],"disallowed"],[[2208,2208],"valid"],[[2209,2209],"valid"],[[2210,2220],"valid"],[[2221,2226],"valid"],[[2227,2228],"valid"],[[2229,2274],"disallowed"],[[2275,2275],"valid"],[[2276,2302],"valid"],[[2303,2303],"valid"],[[2304,2304],"valid"],[[2305,2307],"valid"],[[2308,2308],"valid"],[[2309,2361],"valid"],[[2362,2363],"valid"],[[2364,2381],"valid"],[[2382,2382],"valid"],[[2383,2383],"valid"],[[2384,2388],"valid"],[[2389,2389],"valid"],[[2390,2391],"valid"],[[2392,2392],"mapped",[2325,2364]],[[2393,2393],"mapped",[2326,2364]],[[2394,2394],"mapped",[2327,2364]],[[2395,2395],"mapped",[2332,2364]],[[2396,2396],"mapped",[2337,2364]],[[2397,2397],"mapped",[2338,2364]],[[2398,2398],"mapped",[2347,2364]],[[2399,2399],"mapped",[2351,2364]],[[2400,2403],"valid"],[[2404,2405],"valid",[],"NV8"],[[2406,2415],"valid"],[[2416,2416],"valid",[],"NV8"],[[2417,2418],"valid"],[[2419,2423],"valid"],[[2424,2424],"valid"],[[2425,2426],"valid"],[[2427,2428],"valid"],[[2429,2429],"valid"],[[2430,2431],"valid"],[[2432,2432],"valid"],[[2433,2435],"valid"],[[2436,2436],"disallowed"],[[2437,2444],"valid"],[[2445,2446],"disallowed"],[[2447,2448],"valid"],[[2449,2450],"disallowed"],[[2451,2472],"valid"],[[2473,2473],"disallowed"],[[2474,2480],"valid"],[[2481,2481],"disallowed"],[[2482,2482],"valid"],[[2483,2485],"disallowed"],[[2486,2489],"valid"],[[2490,2491],"disallowed"],[[2492,2492],"valid"],[[2493,2493],"valid"],[[2494,2500],"valid"],[[2501,2502],"disallowed"],[[2503,2504],"valid"],[[2505,2506],"disallowed"],[[2507,2509],"valid"],[[2510,2510],"valid"],[[2511,2518],"disallowed"],[[2519,2519],"valid"],[[2520,2523],"disallowed"],[[2524,2524],"mapped",[2465,2492]],[[2525,2525],"mapped",[2466,2492]],[[2526,2526],"disallowed"],[[2527,2527],"mapped",[2479,2492]],[[2528,2531],"valid"],[[2532,2533],"disallowed"],[[2534,2545],"valid"],[[2546,2554],"valid",[],"NV8"],[[2555,2555],"valid",[],"NV8"],[[2556,2560],"disallowed"],[[2561,2561],"valid"],[[2562,2562],"valid"],[[2563,2563],"valid"],[[2564,2564],"disallowed"],[[2565,2570],"valid"],[[2571,2574],"disallowed"],[[2575,2576],"valid"],[[2577,2578],"disallowed"],[[2579,2600],"valid"],[[2601,2601],"disallowed"],[[2602,2608],"valid"],[[2609,2609],"disallowed"],[[2610,2610],"valid"],[[2611,2611],"mapped",[2610,2620]],[[2612,2612],"disallowed"],[[2613,2613],"valid"],[[2614,2614],"mapped",[2616,2620]],[[2615,2615],"disallowed"],[[2616,2617],"valid"],[[2618,2619],"disallowed"],[[2620,2620],"valid"],[[2621,2621],"disallowed"],[[2622,2626],"valid"],[[2627,2630],"disallowed"],[[2631,2632],"valid"],[[2633,2634],"disallowed"],[[2635,2637],"valid"],[[2638,2640],"disallowed"],[[2641,2641],"valid"],[[2642,2648],"disallowed"],[[2649,2649],"mapped",[2582,2620]],[[2650,2650],"mapped",[2583,2620]],[[2651,2651],"mapped",[2588,2620]],[[2652,2652],"valid"],[[2653,2653],"disallowed"],[[2654,2654],"mapped",[2603,2620]],[[2655,2661],"disallowed"],[[2662,2676],"valid"],[[2677,2677],"valid"],[[2678,2688],"disallowed"],[[2689,2691],"valid"],[[2692,2692],"disallowed"],[[2693,2699],"valid"],[[2700,2700],"valid"],[[2701,2701],"valid"],[[2702,2702],"disallowed"],[[2703,2705],"valid"],[[2706,2706],"disallowed"],[[2707,2728],"valid"],[[2729,2729],"disallowed"],[[2730,2736],"valid"],[[2737,2737],"disallowed"],[[2738,2739],"valid"],[[2740,2740],"disallowed"],[[2741,2745],"valid"],[[2746,2747],"disallowed"],[[2748,2757],"valid"],[[2758,2758],"disallowed"],[[2759,2761],"valid"],[[2762,2762],"disallowed"],[[2763,2765],"valid"],[[2766,2767],"disallowed"],[[2768,2768],"valid"],[[2769,2783],"disallowed"],[[2784,2784],"valid"],[[2785,2787],"valid"],[[2788,2789],"disallowed"],[[2790,2799],"valid"],[[2800,2800],"valid",[],"NV8"],[[2801,2801],"valid",[],"NV8"],[[2802,2808],"disallowed"],[[2809,2809],"valid"],[[2810,2816],"disallowed"],[[2817,2819],"valid"],[[2820,2820],"disallowed"],[[2821,2828],"valid"],[[2829,2830],"disallowed"],[[2831,2832],"valid"],[[2833,2834],"disallowed"],[[2835,2856],"valid"],[[2857,2857],"disallowed"],[[2858,2864],"valid"],[[2865,2865],"disallowed"],[[2866,2867],"valid"],[[2868,2868],"disallowed"],[[2869,2869],"valid"],[[2870,2873],"valid"],[[2874,2875],"disallowed"],[[2876,2883],"valid"],[[2884,2884],"valid"],[[2885,2886],"disallowed"],[[2887,2888],"valid"],[[2889,2890],"disallowed"],[[2891,2893],"valid"],[[2894,2901],"disallowed"],[[2902,2903],"valid"],[[2904,2907],"disallowed"],[[2908,2908],"mapped",[2849,2876]],[[2909,2909],"mapped",[2850,2876]],[[2910,2910],"disallowed"],[[2911,2913],"valid"],[[2914,2915],"valid"],[[2916,2917],"disallowed"],[[2918,2927],"valid"],[[2928,2928],"valid",[],"NV8"],[[2929,2929],"valid"],[[2930,2935],"valid",[],"NV8"],[[2936,2945],"disallowed"],[[2946,2947],"valid"],[[2948,2948],"disallowed"],[[2949,2954],"valid"],[[2955,2957],"disallowed"],[[2958,2960],"valid"],[[2961,2961],"disallowed"],[[2962,2965],"valid"],[[2966,2968],"disallowed"],[[2969,2970],"valid"],[[2971,2971],"disallowed"],[[2972,2972],"valid"],[[2973,2973],"disallowed"],[[2974,2975],"valid"],[[2976,2978],"disallowed"],[[2979,2980],"valid"],[[2981,2983],"disallowed"],[[2984,2986],"valid"],[[2987,2989],"disallowed"],[[2990,2997],"valid"],[[2998,2998],"valid"],[[2999,3001],"valid"],[[3002,3005],"disallowed"],[[3006,3010],"valid"],[[3011,3013],"disallowed"],[[3014,3016],"valid"],[[3017,3017],"disallowed"],[[3018,3021],"valid"],[[3022,3023],"disallowed"],[[3024,3024],"valid"],[[3025,3030],"disallowed"],[[3031,3031],"valid"],[[3032,3045],"disallowed"],[[3046,3046],"valid"],[[3047,3055],"valid"],[[3056,3058],"valid",[],"NV8"],[[3059,3066],"valid",[],"NV8"],[[3067,3071],"disallowed"],[[3072,3072],"valid"],[[3073,3075],"valid"],[[3076,3076],"disallowed"],[[3077,3084],"valid"],[[3085,3085],"disallowed"],[[3086,3088],"valid"],[[3089,3089],"disallowed"],[[3090,3112],"valid"],[[3113,3113],"disallowed"],[[3114,3123],"valid"],[[3124,3124],"valid"],[[3125,3129],"valid"],[[3130,3132],"disallowed"],[[3133,3133],"valid"],[[3134,3140],"valid"],[[3141,3141],"disallowed"],[[3142,3144],"valid"],[[3145,3145],"disallowed"],[[3146,3149],"valid"],[[3150,3156],"disallowed"],[[3157,3158],"valid"],[[3159,3159],"disallowed"],[[3160,3161],"valid"],[[3162,3162],"valid"],[[3163,3167],"disallowed"],[[3168,3169],"valid"],[[3170,3171],"valid"],[[3172,3173],"disallowed"],[[3174,3183],"valid"],[[3184,3191],"disallowed"],[[3192,3199],"valid",[],"NV8"],[[3200,3200],"disallowed"],[[3201,3201],"valid"],[[3202,3203],"valid"],[[3204,3204],"disallowed"],[[3205,3212],"valid"],[[3213,3213],"disallowed"],[[3214,3216],"valid"],[[3217,3217],"disallowed"],[[3218,3240],"valid"],[[3241,3241],"disallowed"],[[3242,3251],"valid"],[[3252,3252],"disallowed"],[[3253,3257],"valid"],[[3258,3259],"disallowed"],[[3260,3261],"valid"],[[3262,3268],"valid"],[[3269,3269],"disallowed"],[[3270,3272],"valid"],[[3273,3273],"disallowed"],[[3274,3277],"valid"],[[3278,3284],"disallowed"],[[3285,3286],"valid"],[[3287,3293],"disallowed"],[[3294,3294],"valid"],[[3295,3295],"disallowed"],[[3296,3297],"valid"],[[3298,3299],"valid"],[[3300,3301],"disallowed"],[[3302,3311],"valid"],[[3312,3312],"disallowed"],[[3313,3314],"valid"],[[3315,3328],"disallowed"],[[3329,3329],"valid"],[[3330,3331],"valid"],[[3332,3332],"disallowed"],[[3333,3340],"valid"],[[3341,3341],"disallowed"],[[3342,3344],"valid"],[[3345,3345],"disallowed"],[[3346,3368],"valid"],[[3369,3369],"valid"],[[3370,3385],"valid"],[[3386,3386],"valid"],[[3387,3388],"disallowed"],[[3389,3389],"valid"],[[3390,3395],"valid"],[[3396,3396],"valid"],[[3397,3397],"disallowed"],[[3398,3400],"valid"],[[3401,3401],"disallowed"],[[3402,3405],"valid"],[[3406,3406],"valid"],[[3407,3414],"disallowed"],[[3415,3415],"valid"],[[3416,3422],"disallowed"],[[3423,3423],"valid"],[[3424,3425],"valid"],[[3426,3427],"valid"],[[3428,3429],"disallowed"],[[3430,3439],"valid"],[[3440,3445],"valid",[],"NV8"],[[3446,3448],"disallowed"],[[3449,3449],"valid",[],"NV8"],[[3450,3455],"valid"],[[3456,3457],"disallowed"],[[3458,3459],"valid"],[[3460,3460],"disallowed"],[[3461,3478],"valid"],[[3479,3481],"disallowed"],[[3482,3505],"valid"],[[3506,3506],"disallowed"],[[3507,3515],"valid"],[[3516,3516],"disallowed"],[[3517,3517],"valid"],[[3518,3519],"disallowed"],[[3520,3526],"valid"],[[3527,3529],"disallowed"],[[3530,3530],"valid"],[[3531,3534],"disallowed"],[[3535,3540],"valid"],[[3541,3541],"disallowed"],[[3542,3542],"valid"],[[3543,3543],"disallowed"],[[3544,3551],"valid"],[[3552,3557],"disallowed"],[[3558,3567],"valid"],[[3568,3569],"disallowed"],[[3570,3571],"valid"],[[3572,3572],"valid",[],"NV8"],[[3573,3584],"disallowed"],[[3585,3634],"valid"],[[3635,3635],"mapped",[3661,3634]],[[3636,3642],"valid"],[[3643,3646],"disallowed"],[[3647,3647],"valid",[],"NV8"],[[3648,3662],"valid"],[[3663,3663],"valid",[],"NV8"],[[3664,3673],"valid"],[[3674,3675],"valid",[],"NV8"],[[3676,3712],"disallowed"],[[3713,3714],"valid"],[[3715,3715],"disallowed"],[[3716,3716],"valid"],[[3717,3718],"disallowed"],[[3719,3720],"valid"],[[3721,3721],"disallowed"],[[3722,3722],"valid"],[[3723,3724],"disallowed"],[[3725,3725],"valid"],[[3726,3731],"disallowed"],[[3732,3735],"valid"],[[3736,3736],"disallowed"],[[3737,3743],"valid"],[[3744,3744],"disallowed"],[[3745,3747],"valid"],[[3748,3748],"disallowed"],[[3749,3749],"valid"],[[3750,3750],"disallowed"],[[3751,3751],"valid"],[[3752,3753],"disallowed"],[[3754,3755],"valid"],[[3756,3756],"disallowed"],[[3757,3762],"valid"],[[3763,3763],"mapped",[3789,3762]],[[3764,3769],"valid"],[[3770,3770],"disallowed"],[[3771,3773],"valid"],[[3774,3775],"disallowed"],[[3776,3780],"valid"],[[3781,3781],"disallowed"],[[3782,3782],"valid"],[[3783,3783],"disallowed"],[[3784,3789],"valid"],[[3790,3791],"disallowed"],[[3792,3801],"valid"],[[3802,3803],"disallowed"],[[3804,3804],"mapped",[3755,3737]],[[3805,3805],"mapped",[3755,3745]],[[3806,3807],"valid"],[[3808,3839],"disallowed"],[[3840,3840],"valid"],[[3841,3850],"valid",[],"NV8"],[[3851,3851],"valid"],[[3852,3852],"mapped",[3851]],[[3853,3863],"valid",[],"NV8"],[[3864,3865],"valid"],[[3866,3871],"valid",[],"NV8"],[[3872,3881],"valid"],[[3882,3892],"valid",[],"NV8"],[[3893,3893],"valid"],[[3894,3894],"valid",[],"NV8"],[[3895,3895],"valid"],[[3896,3896],"valid",[],"NV8"],[[3897,3897],"valid"],[[3898,3901],"valid",[],"NV8"],[[3902,3906],"valid"],[[3907,3907],"mapped",[3906,4023]],[[3908,3911],"valid"],[[3912,3912],"disallowed"],[[3913,3916],"valid"],[[3917,3917],"mapped",[3916,4023]],[[3918,3921],"valid"],[[3922,3922],"mapped",[3921,4023]],[[3923,3926],"valid"],[[3927,3927],"mapped",[3926,4023]],[[3928,3931],"valid"],[[3932,3932],"mapped",[3931,4023]],[[3933,3944],"valid"],[[3945,3945],"mapped",[3904,4021]],[[3946,3946],"valid"],[[3947,3948],"valid"],[[3949,3952],"disallowed"],[[3953,3954],"valid"],[[3955,3955],"mapped",[3953,3954]],[[3956,3956],"valid"],[[3957,3957],"mapped",[3953,3956]],[[3958,3958],"mapped",[4018,3968]],[[3959,3959],"mapped",[4018,3953,3968]],[[3960,3960],"mapped",[4019,3968]],[[3961,3961],"mapped",[4019,3953,3968]],[[3962,3968],"valid"],[[3969,3969],"mapped",[3953,3968]],[[3970,3972],"valid"],[[3973,3973],"valid",[],"NV8"],[[3974,3979],"valid"],[[3980,3983],"valid"],[[3984,3986],"valid"],[[3987,3987],"mapped",[3986,4023]],[[3988,3989],"valid"],[[3990,3990],"valid"],[[3991,3991],"valid"],[[3992,3992],"disallowed"],[[3993,3996],"valid"],[[3997,3997],"mapped",[3996,4023]],[[3998,4001],"valid"],[[4002,4002],"mapped",[4001,4023]],[[4003,4006],"valid"],[[4007,4007],"mapped",[4006,4023]],[[4008,4011],"valid"],[[4012,4012],"mapped",[4011,4023]],[[4013,4013],"valid"],[[4014,4016],"valid"],[[4017,4023],"valid"],[[4024,4024],"valid"],[[4025,4025],"mapped",[3984,4021]],[[4026,4028],"valid"],[[4029,4029],"disallowed"],[[4030,4037],"valid",[],"NV8"],[[4038,4038],"valid"],[[4039,4044],"valid",[],"NV8"],[[4045,4045],"disallowed"],[[4046,4046],"valid",[],"NV8"],[[4047,4047],"valid",[],"NV8"],[[4048,4049],"valid",[],"NV8"],[[4050,4052],"valid",[],"NV8"],[[4053,4056],"valid",[],"NV8"],[[4057,4058],"valid",[],"NV8"],[[4059,4095],"disallowed"],[[4096,4129],"valid"],[[4130,4130],"valid"],[[4131,4135],"valid"],[[4136,4136],"valid"],[[4137,4138],"valid"],[[4139,4139],"valid"],[[4140,4146],"valid"],[[4147,4149],"valid"],[[4150,4153],"valid"],[[4154,4159],"valid"],[[4160,4169],"valid"],[[4170,4175],"valid",[],"NV8"],[[4176,4185],"valid"],[[4186,4249],"valid"],[[4250,4253],"valid"],[[4254,4255],"valid",[],"NV8"],[[4256,4293],"disallowed"],[[4294,4294],"disallowed"],[[4295,4295],"mapped",[11559]],[[4296,4300],"disallowed"],[[4301,4301],"mapped",[11565]],[[4302,4303],"disallowed"],[[4304,4342],"valid"],[[4343,4344],"valid"],[[4345,4346],"valid"],[[4347,4347],"valid",[],"NV8"],[[4348,4348],"mapped",[4316]],[[4349,4351],"valid"],[[4352,4441],"valid",[],"NV8"],[[4442,4446],"valid",[],"NV8"],[[4447,4448],"disallowed"],[[4449,4514],"valid",[],"NV8"],[[4515,4519],"valid",[],"NV8"],[[4520,4601],"valid",[],"NV8"],[[4602,4607],"valid",[],"NV8"],[[4608,4614],"valid"],[[4615,4615],"valid"],[[4616,4678],"valid"],[[4679,4679],"valid"],[[4680,4680],"valid"],[[4681,4681],"disallowed"],[[4682,4685],"valid"],[[4686,4687],"disallowed"],[[4688,4694],"valid"],[[4695,4695],"disallowed"],[[4696,4696],"valid"],[[4697,4697],"disallowed"],[[4698,4701],"valid"],[[4702,4703],"disallowed"],[[4704,4742],"valid"],[[4743,4743],"valid"],[[4744,4744],"valid"],[[4745,4745],"disallowed"],[[4746,4749],"valid"],[[4750,4751],"disallowed"],[[4752,4782],"valid"],[[4783,4783],"valid"],[[4784,4784],"valid"],[[4785,4785],"disallowed"],[[4786,4789],"valid"],[[4790,4791],"disallowed"],[[4792,4798],"valid"],[[4799,4799],"disallowed"],[[4800,4800],"valid"],[[4801,4801],"disallowed"],[[4802,4805],"valid"],[[4806,4807],"disallowed"],[[4808,4814],"valid"],[[4815,4815],"valid"],[[4816,4822],"valid"],[[4823,4823],"disallowed"],[[4824,4846],"valid"],[[4847,4847],"valid"],[[4848,4878],"valid"],[[4879,4879],"valid"],[[4880,4880],"valid"],[[4881,4881],"disallowed"],[[4882,4885],"valid"],[[4886,4887],"disallowed"],[[4888,4894],"valid"],[[4895,4895],"valid"],[[4896,4934],"valid"],[[4935,4935],"valid"],[[4936,4954],"valid"],[[4955,4956],"disallowed"],[[4957,4958],"valid"],[[4959,4959],"valid"],[[4960,4960],"valid",[],"NV8"],[[4961,4988],"valid",[],"NV8"],[[4989,4991],"disallowed"],[[4992,5007],"valid"],[[5008,5017],"valid",[],"NV8"],[[5018,5023],"disallowed"],[[5024,5108],"valid"],[[5109,5109],"valid"],[[5110,5111],"disallowed"],[[5112,5112],"mapped",[5104]],[[5113,5113],"mapped",[5105]],[[5114,5114],"mapped",[5106]],[[5115,5115],"mapped",[5107]],[[5116,5116],"mapped",[5108]],[[5117,5117],"mapped",[5109]],[[5118,5119],"disallowed"],[[5120,5120],"valid",[],"NV8"],[[5121,5740],"valid"],[[5741,5742],"valid",[],"NV8"],[[5743,5750],"valid"],[[5751,5759],"valid"],[[5760,5760],"disallowed"],[[5761,5786],"valid"],[[5787,5788],"valid",[],"NV8"],[[5789,5791],"disallowed"],[[5792,5866],"valid"],[[5867,5872],"valid",[],"NV8"],[[5873,5880],"valid"],[[5881,5887],"disallowed"],[[5888,5900],"valid"],[[5901,5901],"disallowed"],[[5902,5908],"valid"],[[5909,5919],"disallowed"],[[5920,5940],"valid"],[[5941,5942],"valid",[],"NV8"],[[5943,5951],"disallowed"],[[5952,5971],"valid"],[[5972,5983],"disallowed"],[[5984,5996],"valid"],[[5997,5997],"disallowed"],[[5998,6000],"valid"],[[6001,6001],"disallowed"],[[6002,6003],"valid"],[[6004,6015],"disallowed"],[[6016,6067],"valid"],[[6068,6069],"disallowed"],[[6070,6099],"valid"],[[6100,6102],"valid",[],"NV8"],[[6103,6103],"valid"],[[6104,6107],"valid",[],"NV8"],[[6108,6108],"valid"],[[6109,6109],"valid"],[[6110,6111],"disallowed"],[[6112,6121],"valid"],[[6122,6127],"disallowed"],[[6128,6137],"valid",[],"NV8"],[[6138,6143],"disallowed"],[[6144,6149],"valid",[],"NV8"],[[6150,6150],"disallowed"],[[6151,6154],"valid",[],"NV8"],[[6155,6157],"ignored"],[[6158,6158],"disallowed"],[[6159,6159],"disallowed"],[[6160,6169],"valid"],[[6170,6175],"disallowed"],[[6176,6263],"valid"],[[6264,6271],"disallowed"],[[6272,6313],"valid"],[[6314,6314],"valid"],[[6315,6319],"disallowed"],[[6320,6389],"valid"],[[6390,6399],"disallowed"],[[6400,6428],"valid"],[[6429,6430],"valid"],[[6431,6431],"disallowed"],[[6432,6443],"valid"],[[6444,6447],"disallowed"],[[6448,6459],"valid"],[[6460,6463],"disallowed"],[[6464,6464],"valid",[],"NV8"],[[6465,6467],"disallowed"],[[6468,6469],"valid",[],"NV8"],[[6470,6509],"valid"],[[6510,6511],"disallowed"],[[6512,6516],"valid"],[[6517,6527],"disallowed"],[[6528,6569],"valid"],[[6570,6571],"valid"],[[6572,6575],"disallowed"],[[6576,6601],"valid"],[[6602,6607],"disallowed"],[[6608,6617],"valid"],[[6618,6618],"valid",[],"XV8"],[[6619,6621],"disallowed"],[[6622,6623],"valid",[],"NV8"],[[6624,6655],"valid",[],"NV8"],[[6656,6683],"valid"],[[6684,6685],"disallowed"],[[6686,6687],"valid",[],"NV8"],[[6688,6750],"valid"],[[6751,6751],"disallowed"],[[6752,6780],"valid"],[[6781,6782],"disallowed"],[[6783,6793],"valid"],[[6794,6799],"disallowed"],[[6800,6809],"valid"],[[6810,6815],"disallowed"],[[6816,6822],"valid",[],"NV8"],[[6823,6823],"valid"],[[6824,6829],"valid",[],"NV8"],[[6830,6831],"disallowed"],[[6832,6845],"valid"],[[6846,6846],"valid",[],"NV8"],[[6847,6911],"disallowed"],[[6912,6987],"valid"],[[6988,6991],"disallowed"],[[6992,7001],"valid"],[[7002,7018],"valid",[],"NV8"],[[7019,7027],"valid"],[[7028,7036],"valid",[],"NV8"],[[7037,7039],"disallowed"],[[7040,7082],"valid"],[[7083,7085],"valid"],[[7086,7097],"valid"],[[7098,7103],"valid"],[[7104,7155],"valid"],[[7156,7163],"disallowed"],[[7164,7167],"valid",[],"NV8"],[[7168,7223],"valid"],[[7224,7226],"disallowed"],[[7227,7231],"valid",[],"NV8"],[[7232,7241],"valid"],[[7242,7244],"disallowed"],[[7245,7293],"valid"],[[7294,7295],"valid",[],"NV8"],[[7296,7359],"disallowed"],[[7360,7367],"valid",[],"NV8"],[[7368,7375],"disallowed"],[[7376,7378],"valid"],[[7379,7379],"valid",[],"NV8"],[[7380,7410],"valid"],[[7411,7414],"valid"],[[7415,7415],"disallowed"],[[7416,7417],"valid"],[[7418,7423],"disallowed"],[[7424,7467],"valid"],[[7468,7468],"mapped",[97]],[[7469,7469],"mapped",[230]],[[7470,7470],"mapped",[98]],[[7471,7471],"valid"],[[7472,7472],"mapped",[100]],[[7473,7473],"mapped",[101]],[[7474,7474],"mapped",[477]],[[7475,7475],"mapped",[103]],[[7476,7476],"mapped",[104]],[[7477,7477],"mapped",[105]],[[7478,7478],"mapped",[106]],[[7479,7479],"mapped",[107]],[[7480,7480],"mapped",[108]],[[7481,7481],"mapped",[109]],[[7482,7482],"mapped",[110]],[[7483,7483],"valid"],[[7484,7484],"mapped",[111]],[[7485,7485],"mapped",[547]],[[7486,7486],"mapped",[112]],[[7487,7487],"mapped",[114]],[[7488,7488],"mapped",[116]],[[7489,7489],"mapped",[117]],[[7490,7490],"mapped",[119]],[[7491,7491],"mapped",[97]],[[7492,7492],"mapped",[592]],[[7493,7493],"mapped",[593]],[[7494,7494],"mapped",[7426]],[[7495,7495],"mapped",[98]],[[7496,7496],"mapped",[100]],[[7497,7497],"mapped",[101]],[[7498,7498],"mapped",[601]],[[7499,7499],"mapped",[603]],[[7500,7500],"mapped",[604]],[[7501,7501],"mapped",[103]],[[7502,7502],"valid"],[[7503,7503],"mapped",[107]],[[7504,7504],"mapped",[109]],[[7505,7505],"mapped",[331]],[[7506,7506],"mapped",[111]],[[7507,7507],"mapped",[596]],[[7508,7508],"mapped",[7446]],[[7509,7509],"mapped",[7447]],[[7510,7510],"mapped",[112]],[[7511,7511],"mapped",[116]],[[7512,7512],"mapped",[117]],[[7513,7513],"mapped",[7453]],[[7514,7514],"mapped",[623]],[[7515,7515],"mapped",[118]],[[7516,7516],"mapped",[7461]],[[7517,7517],"mapped",[946]],[[7518,7518],"mapped",[947]],[[7519,7519],"mapped",[948]],[[7520,7520],"mapped",[966]],[[7521,7521],"mapped",[967]],[[7522,7522],"mapped",[105]],[[7523,7523],"mapped",[114]],[[7524,7524],"mapped",[117]],[[7525,7525],"mapped",[118]],[[7526,7526],"mapped",[946]],[[7527,7527],"mapped",[947]],[[7528,7528],"mapped",[961]],[[7529,7529],"mapped",[966]],[[7530,7530],"mapped",[967]],[[7531,7531],"valid"],[[7532,7543],"valid"],[[7544,7544],"mapped",[1085]],[[7545,7578],"valid"],[[7579,7579],"mapped",[594]],[[7580,7580],"mapped",[99]],[[7581,7581],"mapped",[597]],[[7582,7582],"mapped",[240]],[[7583,7583],"mapped",[604]],[[7584,7584],"mapped",[102]],[[7585,7585],"mapped",[607]],[[7586,7586],"mapped",[609]],[[7587,7587],"mapped",[613]],[[7588,7588],"mapped",[616]],[[7589,7589],"mapped",[617]],[[7590,7590],"mapped",[618]],[[7591,7591],"mapped",[7547]],[[7592,7592],"mapped",[669]],[[7593,7593],"mapped",[621]],[[7594,7594],"mapped",[7557]],[[7595,7595],"mapped",[671]],[[7596,7596],"mapped",[625]],[[7597,7597],"mapped",[624]],[[7598,7598],"mapped",[626]],[[7599,7599],"mapped",[627]],[[7600,7600],"mapped",[628]],[[7601,7601],"mapped",[629]],[[7602,7602],"mapped",[632]],[[7603,7603],"mapped",[642]],[[7604,7604],"mapped",[643]],[[7605,7605],"mapped",[427]],[[7606,7606],"mapped",[649]],[[7607,7607],"mapped",[650]],[[7608,7608],"mapped",[7452]],[[7609,7609],"mapped",[651]],[[7610,7610],"mapped",[652]],[[7611,7611],"mapped",[122]],[[7612,7612],"mapped",[656]],[[7613,7613],"mapped",[657]],[[7614,7614],"mapped",[658]],[[7615,7615],"mapped",[952]],[[7616,7619],"valid"],[[7620,7626],"valid"],[[7627,7654],"valid"],[[7655,7669],"valid"],[[7670,7675],"disallowed"],[[7676,7676],"valid"],[[7677,7677],"valid"],[[7678,7679],"valid"],[[7680,7680],"mapped",[7681]],[[7681,7681],"valid"],[[7682,7682],"mapped",[7683]],[[7683,7683],"valid"],[[7684,7684],"mapped",[7685]],[[7685,7685],"valid"],[[7686,7686],"mapped",[7687]],[[7687,7687],"valid"],[[7688,7688],"mapped",[7689]],[[7689,7689],"valid"],[[7690,7690],"mapped",[7691]],[[7691,7691],"valid"],[[7692,7692],"mapped",[7693]],[[7693,7693],"valid"],[[7694,7694],"mapped",[7695]],[[7695,7695],"valid"],[[7696,7696],"mapped",[7697]],[[7697,7697],"valid"],[[7698,7698],"mapped",[7699]],[[7699,7699],"valid"],[[7700,7700],"mapped",[7701]],[[7701,7701],"valid"],[[7702,7702],"mapped",[7703]],[[7703,7703],"valid"],[[7704,7704],"mapped",[7705]],[[7705,7705],"valid"],[[7706,7706],"mapped",[7707]],[[7707,7707],"valid"],[[7708,7708],"mapped",[7709]],[[7709,7709],"valid"],[[7710,7710],"mapped",[7711]],[[7711,7711],"valid"],[[7712,7712],"mapped",[7713]],[[7713,7713],"valid"],[[7714,7714],"mapped",[7715]],[[7715,7715],"valid"],[[7716,7716],"mapped",[7717]],[[7717,7717],"valid"],[[7718,7718],"mapped",[7719]],[[7719,7719],"valid"],[[7720,7720],"mapped",[7721]],[[7721,7721],"valid"],[[7722,7722],"mapped",[7723]],[[7723,7723],"valid"],[[7724,7724],"mapped",[7725]],[[7725,7725],"valid"],[[7726,7726],"mapped",[7727]],[[7727,7727],"valid"],[[7728,7728],"mapped",[7729]],[[7729,7729],"valid"],[[7730,7730],"mapped",[7731]],[[7731,7731],"valid"],[[7732,7732],"mapped",[7733]],[[7733,7733],"valid"],[[7734,7734],"mapped",[7735]],[[7735,7735],"valid"],[[7736,7736],"mapped",[7737]],[[7737,7737],"valid"],[[7738,7738],"mapped",[7739]],[[7739,7739],"valid"],[[7740,7740],"mapped",[7741]],[[7741,7741],"valid"],[[7742,7742],"mapped",[7743]],[[7743,7743],"valid"],[[7744,7744],"mapped",[7745]],[[7745,7745],"valid"],[[7746,7746],"mapped",[7747]],[[7747,7747],"valid"],[[7748,7748],"mapped",[7749]],[[7749,7749],"valid"],[[7750,7750],"mapped",[7751]],[[7751,7751],"valid"],[[7752,7752],"mapped",[7753]],[[7753,7753],"valid"],[[7754,7754],"mapped",[7755]],[[7755,7755],"valid"],[[7756,7756],"mapped",[7757]],[[7757,7757],"valid"],[[7758,7758],"mapped",[7759]],[[7759,7759],"valid"],[[7760,7760],"mapped",[7761]],[[7761,7761],"valid"],[[7762,7762],"mapped",[7763]],[[7763,7763],"valid"],[[7764,7764],"mapped",[7765]],[[7765,7765],"valid"],[[7766,7766],"mapped",[7767]],[[7767,7767],"valid"],[[7768,7768],"mapped",[7769]],[[7769,7769],"valid"],[[7770,7770],"mapped",[7771]],[[7771,7771],"valid"],[[7772,7772],"mapped",[7773]],[[7773,7773],"valid"],[[7774,7774],"mapped",[7775]],[[7775,7775],"valid"],[[7776,7776],"mapped",[7777]],[[7777,7777],"valid"],[[7778,7778],"mapped",[7779]],[[7779,7779],"valid"],[[7780,7780],"mapped",[7781]],[[7781,7781],"valid"],[[7782,7782],"mapped",[7783]],[[7783,7783],"valid"],[[7784,7784],"mapped",[7785]],[[7785,7785],"valid"],[[7786,7786],"mapped",[7787]],[[7787,7787],"valid"],[[7788,7788],"mapped",[7789]],[[7789,7789],"valid"],[[7790,7790],"mapped",[7791]],[[7791,7791],"valid"],[[7792,7792],"mapped",[7793]],[[7793,7793],"valid"],[[7794,7794],"mapped",[7795]],[[7795,7795],"valid"],[[7796,7796],"mapped",[7797]],[[7797,7797],"valid"],[[7798,7798],"mapped",[7799]],[[7799,7799],"valid"],[[7800,7800],"mapped",[7801]],[[7801,7801],"valid"],[[7802,7802],"mapped",[7803]],[[7803,7803],"valid"],[[7804,7804],"mapped",[7805]],[[7805,7805],"valid"],[[7806,7806],"mapped",[7807]],[[7807,7807],"valid"],[[7808,7808],"mapped",[7809]],[[7809,7809],"valid"],[[7810,7810],"mapped",[7811]],[[7811,7811],"valid"],[[7812,7812],"mapped",[7813]],[[7813,7813],"valid"],[[7814,7814],"mapped",[7815]],[[7815,7815],"valid"],[[7816,7816],"mapped",[7817]],[[7817,7817],"valid"],[[7818,7818],"mapped",[7819]],[[7819,7819],"valid"],[[7820,7820],"mapped",[7821]],[[7821,7821],"valid"],[[7822,7822],"mapped",[7823]],[[7823,7823],"valid"],[[7824,7824],"mapped",[7825]],[[7825,7825],"valid"],[[7826,7826],"mapped",[7827]],[[7827,7827],"valid"],[[7828,7828],"mapped",[7829]],[[7829,7833],"valid"],[[7834,7834],"mapped",[97,702]],[[7835,7835],"mapped",[7777]],[[7836,7837],"valid"],[[7838,7838],"mapped",[115,115]],[[7839,7839],"valid"],[[7840,7840],"mapped",[7841]],[[7841,7841],"valid"],[[7842,7842],"mapped",[7843]],[[7843,7843],"valid"],[[7844,7844],"mapped",[7845]],[[7845,7845],"valid"],[[7846,7846],"mapped",[7847]],[[7847,7847],"valid"],[[7848,7848],"mapped",[7849]],[[7849,7849],"valid"],[[7850,7850],"mapped",[7851]],[[7851,7851],"valid"],[[7852,7852],"mapped",[7853]],[[7853,7853],"valid"],[[7854,7854],"mapped",[7855]],[[7855,7855],"valid"],[[7856,7856],"mapped",[7857]],[[7857,7857],"valid"],[[7858,7858],"mapped",[7859]],[[7859,7859],"valid"],[[7860,7860],"mapped",[7861]],[[7861,7861],"valid"],[[7862,7862],"mapped",[7863]],[[7863,7863],"valid"],[[7864,7864],"mapped",[7865]],[[7865,7865],"valid"],[[7866,7866],"mapped",[7867]],[[7867,7867],"valid"],[[7868,7868],"mapped",[7869]],[[7869,7869],"valid"],[[7870,7870],"mapped",[7871]],[[7871,7871],"valid"],[[7872,7872],"mapped",[7873]],[[7873,7873],"valid"],[[7874,7874],"mapped",[7875]],[[7875,7875],"valid"],[[7876,7876],"mapped",[7877]],[[7877,7877],"valid"],[[7878,7878],"mapped",[7879]],[[7879,7879],"valid"],[[7880,7880],"mapped",[7881]],[[7881,7881],"valid"],[[7882,7882],"mapped",[7883]],[[7883,7883],"valid"],[[7884,7884],"mapped",[7885]],[[7885,7885],"valid"],[[7886,7886],"mapped",[7887]],[[7887,7887],"valid"],[[7888,7888],"mapped",[7889]],[[7889,7889],"valid"],[[7890,7890],"mapped",[7891]],[[7891,7891],"valid"],[[7892,7892],"mapped",[7893]],[[7893,7893],"valid"],[[7894,7894],"mapped",[7895]],[[7895,7895],"valid"],[[7896,7896],"mapped",[7897]],[[7897,7897],"valid"],[[7898,7898],"mapped",[7899]],[[7899,7899],"valid"],[[7900,7900],"mapped",[7901]],[[7901,7901],"valid"],[[7902,7902],"mapped",[7903]],[[7903,7903],"valid"],[[7904,7904],"mapped",[7905]],[[7905,7905],"valid"],[[7906,7906],"mapped",[7907]],[[7907,7907],"valid"],[[7908,7908],"mapped",[7909]],[[7909,7909],"valid"],[[7910,7910],"mapped",[7911]],[[7911,7911],"valid"],[[7912,7912],"mapped",[7913]],[[7913,7913],"valid"],[[7914,7914],"mapped",[7915]],[[7915,7915],"valid"],[[7916,7916],"mapped",[7917]],[[7917,7917],"valid"],[[7918,7918],"mapped",[7919]],[[7919,7919],"valid"],[[7920,7920],"mapped",[7921]],[[7921,7921],"valid"],[[7922,7922],"mapped",[7923]],[[7923,7923],"valid"],[[7924,7924],"mapped",[7925]],[[7925,7925],"valid"],[[7926,7926],"mapped",[7927]],[[7927,7927],"valid"],[[7928,7928],"mapped",[7929]],[[7929,7929],"valid"],[[7930,7930],"mapped",[7931]],[[7931,7931],"valid"],[[7932,7932],"mapped",[7933]],[[7933,7933],"valid"],[[7934,7934],"mapped",[7935]],[[7935,7935],"valid"],[[7936,7943],"valid"],[[7944,7944],"mapped",[7936]],[[7945,7945],"mapped",[7937]],[[7946,7946],"mapped",[7938]],[[7947,7947],"mapped",[7939]],[[7948,7948],"mapped",[7940]],[[7949,7949],"mapped",[7941]],[[7950,7950],"mapped",[7942]],[[7951,7951],"mapped",[7943]],[[7952,7957],"valid"],[[7958,7959],"disallowed"],[[7960,7960],"mapped",[7952]],[[7961,7961],"mapped",[7953]],[[7962,7962],"mapped",[7954]],[[7963,7963],"mapped",[7955]],[[7964,7964],"mapped",[7956]],[[7965,7965],"mapped",[7957]],[[7966,7967],"disallowed"],[[7968,7975],"valid"],[[7976,7976],"mapped",[7968]],[[7977,7977],"mapped",[7969]],[[7978,7978],"mapped",[7970]],[[7979,7979],"mapped",[7971]],[[7980,7980],"mapped",[7972]],[[7981,7981],"mapped",[7973]],[[7982,7982],"mapped",[7974]],[[7983,7983],"mapped",[7975]],[[7984,7991],"valid"],[[7992,7992],"mapped",[7984]],[[7993,7993],"mapped",[7985]],[[7994,7994],"mapped",[7986]],[[7995,7995],"mapped",[7987]],[[7996,7996],"mapped",[7988]],[[7997,7997],"mapped",[7989]],[[7998,7998],"mapped",[7990]],[[7999,7999],"mapped",[7991]],[[8000,8005],"valid"],[[8006,8007],"disallowed"],[[8008,8008],"mapped",[8000]],[[8009,8009],"mapped",[8001]],[[8010,8010],"mapped",[8002]],[[8011,8011],"mapped",[8003]],[[8012,8012],"mapped",[8004]],[[8013,8013],"mapped",[8005]],[[8014,8015],"disallowed"],[[8016,8023],"valid"],[[8024,8024],"disallowed"],[[8025,8025],"mapped",[8017]],[[8026,8026],"disallowed"],[[8027,8027],"mapped",[8019]],[[8028,8028],"disallowed"],[[8029,8029],"mapped",[8021]],[[8030,8030],"disallowed"],[[8031,8031],"mapped",[8023]],[[8032,8039],"valid"],[[8040,8040],"mapped",[8032]],[[8041,8041],"mapped",[8033]],[[8042,8042],"mapped",[8034]],[[8043,8043],"mapped",[8035]],[[8044,8044],"mapped",[8036]],[[8045,8045],"mapped",[8037]],[[8046,8046],"mapped",[8038]],[[8047,8047],"mapped",[8039]],[[8048,8048],"valid"],[[8049,8049],"mapped",[940]],[[8050,8050],"valid"],[[8051,8051],"mapped",[941]],[[8052,8052],"valid"],[[8053,8053],"mapped",[942]],[[8054,8054],"valid"],[[8055,8055],"mapped",[943]],[[8056,8056],"valid"],[[8057,8057],"mapped",[972]],[[8058,8058],"valid"],[[8059,8059],"mapped",[973]],[[8060,8060],"valid"],[[8061,8061],"mapped",[974]],[[8062,8063],"disallowed"],[[8064,8064],"mapped",[7936,953]],[[8065,8065],"mapped",[7937,953]],[[8066,8066],"mapped",[7938,953]],[[8067,8067],"mapped",[7939,953]],[[8068,8068],"mapped",[7940,953]],[[8069,8069],"mapped",[7941,953]],[[8070,8070],"mapped",[7942,953]],[[8071,8071],"mapped",[7943,953]],[[8072,8072],"mapped",[7936,953]],[[8073,8073],"mapped",[7937,953]],[[8074,8074],"mapped",[7938,953]],[[8075,8075],"mapped",[7939,953]],[[8076,8076],"mapped",[7940,953]],[[8077,8077],"mapped",[7941,953]],[[8078,8078],"mapped",[7942,953]],[[8079,8079],"mapped",[7943,953]],[[8080,8080],"mapped",[7968,953]],[[8081,8081],"mapped",[7969,953]],[[8082,8082],"mapped",[7970,953]],[[8083,8083],"mapped",[7971,953]],[[8084,8084],"mapped",[7972,953]],[[8085,8085],"mapped",[7973,953]],[[8086,8086],"mapped",[7974,953]],[[8087,8087],"mapped",[7975,953]],[[8088,8088],"mapped",[7968,953]],[[8089,8089],"mapped",[7969,953]],[[8090,8090],"mapped",[7970,953]],[[8091,8091],"mapped",[7971,953]],[[8092,8092],"mapped",[7972,953]],[[8093,8093],"mapped",[7973,953]],[[8094,8094],"mapped",[7974,953]],[[8095,8095],"mapped",[7975,953]],[[8096,8096],"mapped",[8032,953]],[[8097,8097],"mapped",[8033,953]],[[8098,8098],"mapped",[8034,953]],[[8099,8099],"mapped",[8035,953]],[[8100,8100],"mapped",[8036,953]],[[8101,8101],"mapped",[8037,953]],[[8102,8102],"mapped",[8038,953]],[[8103,8103],"mapped",[8039,953]],[[8104,8104],"mapped",[8032,953]],[[8105,8105],"mapped",[8033,953]],[[8106,8106],"mapped",[8034,953]],[[8107,8107],"mapped",[8035,953]],[[8108,8108],"mapped",[8036,953]],[[8109,8109],"mapped",[8037,953]],[[8110,8110],"mapped",[8038,953]],[[8111,8111],"mapped",[8039,953]],[[8112,8113],"valid"],[[8114,8114],"mapped",[8048,953]],[[8115,8115],"mapped",[945,953]],[[8116,8116],"mapped",[940,953]],[[8117,8117],"disallowed"],[[8118,8118],"valid"],[[8119,8119],"mapped",[8118,953]],[[8120,8120],"mapped",[8112]],[[8121,8121],"mapped",[8113]],[[8122,8122],"mapped",[8048]],[[8123,8123],"mapped",[940]],[[8124,8124],"mapped",[945,953]],[[8125,8125],"disallowed_STD3_mapped",[32,787]],[[8126,8126],"mapped",[953]],[[8127,8127],"disallowed_STD3_mapped",[32,787]],[[8128,8128],"disallowed_STD3_mapped",[32,834]],[[8129,8129],"disallowed_STD3_mapped",[32,776,834]],[[8130,8130],"mapped",[8052,953]],[[8131,8131],"mapped",[951,953]],[[8132,8132],"mapped",[942,953]],[[8133,8133],"disallowed"],[[8134,8134],"valid"],[[8135,8135],"mapped",[8134,953]],[[8136,8136],"mapped",[8050]],[[8137,8137],"mapped",[941]],[[8138,8138],"mapped",[8052]],[[8139,8139],"mapped",[942]],[[8140,8140],"mapped",[951,953]],[[8141,8141],"disallowed_STD3_mapped",[32,787,768]],[[8142,8142],"disallowed_STD3_mapped",[32,787,769]],[[8143,8143],"disallowed_STD3_mapped",[32,787,834]],[[8144,8146],"valid"],[[8147,8147],"mapped",[912]],[[8148,8149],"disallowed"],[[8150,8151],"valid"],[[8152,8152],"mapped",[8144]],[[8153,8153],"mapped",[8145]],[[8154,8154],"mapped",[8054]],[[8155,8155],"mapped",[943]],[[8156,8156],"disallowed"],[[8157,8157],"disallowed_STD3_mapped",[32,788,768]],[[8158,8158],"disallowed_STD3_mapped",[32,788,769]],[[8159,8159],"disallowed_STD3_mapped",[32,788,834]],[[8160,8162],"valid"],[[8163,8163],"mapped",[944]],[[8164,8167],"valid"],[[8168,8168],"mapped",[8160]],[[8169,8169],"mapped",[8161]],[[8170,8170],"mapped",[8058]],[[8171,8171],"mapped",[973]],[[8172,8172],"mapped",[8165]],[[8173,8173],"disallowed_STD3_mapped",[32,776,768]],[[8174,8174],"disallowed_STD3_mapped",[32,776,769]],[[8175,8175],"disallowed_STD3_mapped",[96]],[[8176,8177],"disallowed"],[[8178,8178],"mapped",[8060,953]],[[8179,8179],"mapped",[969,953]],[[8180,8180],"mapped",[974,953]],[[8181,8181],"disallowed"],[[8182,8182],"valid"],[[8183,8183],"mapped",[8182,953]],[[8184,8184],"mapped",[8056]],[[8185,8185],"mapped",[972]],[[8186,8186],"mapped",[8060]],[[8187,8187],"mapped",[974]],[[8188,8188],"mapped",[969,953]],[[8189,8189],"disallowed_STD3_mapped",[32,769]],[[8190,8190],"disallowed_STD3_mapped",[32,788]],[[8191,8191],"disallowed"],[[8192,8202],"disallowed_STD3_mapped",[32]],[[8203,8203],"ignored"],[[8204,8205],"deviation",[]],[[8206,8207],"disallowed"],[[8208,8208],"valid",[],"NV8"],[[8209,8209],"mapped",[8208]],[[8210,8214],"valid",[],"NV8"],[[8215,8215],"disallowed_STD3_mapped",[32,819]],[[8216,8227],"valid",[],"NV8"],[[8228,8230],"disallowed"],[[8231,8231],"valid",[],"NV8"],[[8232,8238],"disallowed"],[[8239,8239],"disallowed_STD3_mapped",[32]],[[8240,8242],"valid",[],"NV8"],[[8243,8243],"mapped",[8242,8242]],[[8244,8244],"mapped",[8242,8242,8242]],[[8245,8245],"valid",[],"NV8"],[[8246,8246],"mapped",[8245,8245]],[[8247,8247],"mapped",[8245,8245,8245]],[[8248,8251],"valid",[],"NV8"],[[8252,8252],"disallowed_STD3_mapped",[33,33]],[[8253,8253],"valid",[],"NV8"],[[8254,8254],"disallowed_STD3_mapped",[32,773]],[[8255,8262],"valid",[],"NV8"],[[8263,8263],"disallowed_STD3_mapped",[63,63]],[[8264,8264],"disallowed_STD3_mapped",[63,33]],[[8265,8265],"disallowed_STD3_mapped",[33,63]],[[8266,8269],"valid",[],"NV8"],[[8270,8274],"valid",[],"NV8"],[[8275,8276],"valid",[],"NV8"],[[8277,8278],"valid",[],"NV8"],[[8279,8279],"mapped",[8242,8242,8242,8242]],[[8280,8286],"valid",[],"NV8"],[[8287,8287],"disallowed_STD3_mapped",[32]],[[8288,8288],"ignored"],[[8289,8291],"disallowed"],[[8292,8292],"ignored"],[[8293,8293],"disallowed"],[[8294,8297],"disallowed"],[[8298,8303],"disallowed"],[[8304,8304],"mapped",[48]],[[8305,8305],"mapped",[105]],[[8306,8307],"disallowed"],[[8308,8308],"mapped",[52]],[[8309,8309],"mapped",[53]],[[8310,8310],"mapped",[54]],[[8311,8311],"mapped",[55]],[[8312,8312],"mapped",[56]],[[8313,8313],"mapped",[57]],[[8314,8314],"disallowed_STD3_mapped",[43]],[[8315,8315],"mapped",[8722]],[[8316,8316],"disallowed_STD3_mapped",[61]],[[8317,8317],"disallowed_STD3_mapped",[40]],[[8318,8318],"disallowed_STD3_mapped",[41]],[[8319,8319],"mapped",[110]],[[8320,8320],"mapped",[48]],[[8321,8321],"mapped",[49]],[[8322,8322],"mapped",[50]],[[8323,8323],"mapped",[51]],[[8324,8324],"mapped",[52]],[[8325,8325],"mapped",[53]],[[8326,8326],"mapped",[54]],[[8327,8327],"mapped",[55]],[[8328,8328],"mapped",[56]],[[8329,8329],"mapped",[57]],[[8330,8330],"disallowed_STD3_mapped",[43]],[[8331,8331],"mapped",[8722]],[[8332,8332],"disallowed_STD3_mapped",[61]],[[8333,8333],"disallowed_STD3_mapped",[40]],[[8334,8334],"disallowed_STD3_mapped",[41]],[[8335,8335],"disallowed"],[[8336,8336],"mapped",[97]],[[8337,8337],"mapped",[101]],[[8338,8338],"mapped",[111]],[[8339,8339],"mapped",[120]],[[8340,8340],"mapped",[601]],[[8341,8341],"mapped",[104]],[[8342,8342],"mapped",[107]],[[8343,8343],"mapped",[108]],[[8344,8344],"mapped",[109]],[[8345,8345],"mapped",[110]],[[8346,8346],"mapped",[112]],[[8347,8347],"mapped",[115]],[[8348,8348],"mapped",[116]],[[8349,8351],"disallowed"],[[8352,8359],"valid",[],"NV8"],[[8360,8360],"mapped",[114,115]],[[8361,8362],"valid",[],"NV8"],[[8363,8363],"valid",[],"NV8"],[[8364,8364],"valid",[],"NV8"],[[8365,8367],"valid",[],"NV8"],[[8368,8369],"valid",[],"NV8"],[[8370,8373],"valid",[],"NV8"],[[8374,8376],"valid",[],"NV8"],[[8377,8377],"valid",[],"NV8"],[[8378,8378],"valid",[],"NV8"],[[8379,8381],"valid",[],"NV8"],[[8382,8382],"valid",[],"NV8"],[[8383,8399],"disallowed"],[[8400,8417],"valid",[],"NV8"],[[8418,8419],"valid",[],"NV8"],[[8420,8426],"valid",[],"NV8"],[[8427,8427],"valid",[],"NV8"],[[8428,8431],"valid",[],"NV8"],[[8432,8432],"valid",[],"NV8"],[[8433,8447],"disallowed"],[[8448,8448],"disallowed_STD3_mapped",[97,47,99]],[[8449,8449],"disallowed_STD3_mapped",[97,47,115]],[[8450,8450],"mapped",[99]],[[8451,8451],"mapped",[176,99]],[[8452,8452],"valid",[],"NV8"],[[8453,8453],"disallowed_STD3_mapped",[99,47,111]],[[8454,8454],"disallowed_STD3_mapped",[99,47,117]],[[8455,8455],"mapped",[603]],[[8456,8456],"valid",[],"NV8"],[[8457,8457],"mapped",[176,102]],[[8458,8458],"mapped",[103]],[[8459,8462],"mapped",[104]],[[8463,8463],"mapped",[295]],[[8464,8465],"mapped",[105]],[[8466,8467],"mapped",[108]],[[8468,8468],"valid",[],"NV8"],[[8469,8469],"mapped",[110]],[[8470,8470],"mapped",[110,111]],[[8471,8472],"valid",[],"NV8"],[[8473,8473],"mapped",[112]],[[8474,8474],"mapped",[113]],[[8475,8477],"mapped",[114]],[[8478,8479],"valid",[],"NV8"],[[8480,8480],"mapped",[115,109]],[[8481,8481],"mapped",[116,101,108]],[[8482,8482],"mapped",[116,109]],[[8483,8483],"valid",[],"NV8"],[[8484,8484],"mapped",[122]],[[8485,8485],"valid",[],"NV8"],[[8486,8486],"mapped",[969]],[[8487,8487],"valid",[],"NV8"],[[8488,8488],"mapped",[122]],[[8489,8489],"valid",[],"NV8"],[[8490,8490],"mapped",[107]],[[8491,8491],"mapped",[229]],[[8492,8492],"mapped",[98]],[[8493,8493],"mapped",[99]],[[8494,8494],"valid",[],"NV8"],[[8495,8496],"mapped",[101]],[[8497,8497],"mapped",[102]],[[8498,8498],"disallowed"],[[8499,8499],"mapped",[109]],[[8500,8500],"mapped",[111]],[[8501,8501],"mapped",[1488]],[[8502,8502],"mapped",[1489]],[[8503,8503],"mapped",[1490]],[[8504,8504],"mapped",[1491]],[[8505,8505],"mapped",[105]],[[8506,8506],"valid",[],"NV8"],[[8507,8507],"mapped",[102,97,120]],[[8508,8508],"mapped",[960]],[[8509,8510],"mapped",[947]],[[8511,8511],"mapped",[960]],[[8512,8512],"mapped",[8721]],[[8513,8516],"valid",[],"NV8"],[[8517,8518],"mapped",[100]],[[8519,8519],"mapped",[101]],[[8520,8520],"mapped",[105]],[[8521,8521],"mapped",[106]],[[8522,8523],"valid",[],"NV8"],[[8524,8524],"valid",[],"NV8"],[[8525,8525],"valid",[],"NV8"],[[8526,8526],"valid"],[[8527,8527],"valid",[],"NV8"],[[8528,8528],"mapped",[49,8260,55]],[[8529,8529],"mapped",[49,8260,57]],[[8530,8530],"mapped",[49,8260,49,48]],[[8531,8531],"mapped",[49,8260,51]],[[8532,8532],"mapped",[50,8260,51]],[[8533,8533],"mapped",[49,8260,53]],[[8534,8534],"mapped",[50,8260,53]],[[8535,8535],"mapped",[51,8260,53]],[[8536,8536],"mapped",[52,8260,53]],[[8537,8537],"mapped",[49,8260,54]],[[8538,8538],"mapped",[53,8260,54]],[[8539,8539],"mapped",[49,8260,56]],[[8540,8540],"mapped",[51,8260,56]],[[8541,8541],"mapped",[53,8260,56]],[[8542,8542],"mapped",[55,8260,56]],[[8543,8543],"mapped",[49,8260]],[[8544,8544],"mapped",[105]],[[8545,8545],"mapped",[105,105]],[[8546,8546],"mapped",[105,105,105]],[[8547,8547],"mapped",[105,118]],[[8548,8548],"mapped",[118]],[[8549,8549],"mapped",[118,105]],[[8550,8550],"mapped",[118,105,105]],[[8551,8551],"mapped",[118,105,105,105]],[[8552,8552],"mapped",[105,120]],[[8553,8553],"mapped",[120]],[[8554,8554],"mapped",[120,105]],[[8555,8555],"mapped",[120,105,105]],[[8556,8556],"mapped",[108]],[[8557,8557],"mapped",[99]],[[8558,8558],"mapped",[100]],[[8559,8559],"mapped",[109]],[[8560,8560],"mapped",[105]],[[8561,8561],"mapped",[105,105]],[[8562,8562],"mapped",[105,105,105]],[[8563,8563],"mapped",[105,118]],[[8564,8564],"mapped",[118]],[[8565,8565],"mapped",[118,105]],[[8566,8566],"mapped",[118,105,105]],[[8567,8567],"mapped",[118,105,105,105]],[[8568,8568],"mapped",[105,120]],[[8569,8569],"mapped",[120]],[[8570,8570],"mapped",[120,105]],[[8571,8571],"mapped",[120,105,105]],[[8572,8572],"mapped",[108]],[[8573,8573],"mapped",[99]],[[8574,8574],"mapped",[100]],[[8575,8575],"mapped",[109]],[[8576,8578],"valid",[],"NV8"],[[8579,8579],"disallowed"],[[8580,8580],"valid"],[[8581,8584],"valid",[],"NV8"],[[8585,8585],"mapped",[48,8260,51]],[[8586,8587],"valid",[],"NV8"],[[8588,8591],"disallowed"],[[8592,8682],"valid",[],"NV8"],[[8683,8691],"valid",[],"NV8"],[[8692,8703],"valid",[],"NV8"],[[8704,8747],"valid",[],"NV8"],[[8748,8748],"mapped",[8747,8747]],[[8749,8749],"mapped",[8747,8747,8747]],[[8750,8750],"valid",[],"NV8"],[[8751,8751],"mapped",[8750,8750]],[[8752,8752],"mapped",[8750,8750,8750]],[[8753,8799],"valid",[],"NV8"],[[8800,8800],"disallowed_STD3_valid"],[[8801,8813],"valid",[],"NV8"],[[8814,8815],"disallowed_STD3_valid"],[[8816,8945],"valid",[],"NV8"],[[8946,8959],"valid",[],"NV8"],[[8960,8960],"valid",[],"NV8"],[[8961,8961],"valid",[],"NV8"],[[8962,9000],"valid",[],"NV8"],[[9001,9001],"mapped",[12296]],[[9002,9002],"mapped",[12297]],[[9003,9082],"valid",[],"NV8"],[[9083,9083],"valid",[],"NV8"],[[9084,9084],"valid",[],"NV8"],[[9085,9114],"valid",[],"NV8"],[[9115,9166],"valid",[],"NV8"],[[9167,9168],"valid",[],"NV8"],[[9169,9179],"valid",[],"NV8"],[[9180,9191],"valid",[],"NV8"],[[9192,9192],"valid",[],"NV8"],[[9193,9203],"valid",[],"NV8"],[[9204,9210],"valid",[],"NV8"],[[9211,9215],"disallowed"],[[9216,9252],"valid",[],"NV8"],[[9253,9254],"valid",[],"NV8"],[[9255,9279],"disallowed"],[[9280,9290],"valid",[],"NV8"],[[9291,9311],"disallowed"],[[9312,9312],"mapped",[49]],[[9313,9313],"mapped",[50]],[[9314,9314],"mapped",[51]],[[9315,9315],"mapped",[52]],[[9316,9316],"mapped",[53]],[[9317,9317],"mapped",[54]],[[9318,9318],"mapped",[55]],[[9319,9319],"mapped",[56]],[[9320,9320],"mapped",[57]],[[9321,9321],"mapped",[49,48]],[[9322,9322],"mapped",[49,49]],[[9323,9323],"mapped",[49,50]],[[9324,9324],"mapped",[49,51]],[[9325,9325],"mapped",[49,52]],[[9326,9326],"mapped",[49,53]],[[9327,9327],"mapped",[49,54]],[[9328,9328],"mapped",[49,55]],[[9329,9329],"mapped",[49,56]],[[9330,9330],"mapped",[49,57]],[[9331,9331],"mapped",[50,48]],[[9332,9332],"disallowed_STD3_mapped",[40,49,41]],[[9333,9333],"disallowed_STD3_mapped",[40,50,41]],[[9334,9334],"disallowed_STD3_mapped",[40,51,41]],[[9335,9335],"disallowed_STD3_mapped",[40,52,41]],[[9336,9336],"disallowed_STD3_mapped",[40,53,41]],[[9337,9337],"disallowed_STD3_mapped",[40,54,41]],[[9338,9338],"disallowed_STD3_mapped",[40,55,41]],[[9339,9339],"disallowed_STD3_mapped",[40,56,41]],[[9340,9340],"disallowed_STD3_mapped",[40,57,41]],[[9341,9341],"disallowed_STD3_mapped",[40,49,48,41]],[[9342,9342],"disallowed_STD3_mapped",[40,49,49,41]],[[9343,9343],"disallowed_STD3_mapped",[40,49,50,41]],[[9344,9344],"disallowed_STD3_mapped",[40,49,51,41]],[[9345,9345],"disallowed_STD3_mapped",[40,49,52,41]],[[9346,9346],"disallowed_STD3_mapped",[40,49,53,41]],[[9347,9347],"disallowed_STD3_mapped",[40,49,54,41]],[[9348,9348],"disallowed_STD3_mapped",[40,49,55,41]],[[9349,9349],"disallowed_STD3_mapped",[40,49,56,41]],[[9350,9350],"disallowed_STD3_mapped",[40,49,57,41]],[[9351,9351],"disallowed_STD3_mapped",[40,50,48,41]],[[9352,9371],"disallowed"],[[9372,9372],"disallowed_STD3_mapped",[40,97,41]],[[9373,9373],"disallowed_STD3_mapped",[40,98,41]],[[9374,9374],"disallowed_STD3_mapped",[40,99,41]],[[9375,9375],"disallowed_STD3_mapped",[40,100,41]],[[9376,9376],"disallowed_STD3_mapped",[40,101,41]],[[9377,9377],"disallowed_STD3_mapped",[40,102,41]],[[9378,9378],"disallowed_STD3_mapped",[40,103,41]],[[9379,9379],"disallowed_STD3_mapped",[40,104,41]],[[9380,9380],"disallowed_STD3_mapped",[40,105,41]],[[9381,9381],"disallowed_STD3_mapped",[40,106,41]],[[9382,9382],"disallowed_STD3_mapped",[40,107,41]],[[9383,9383],"disallowed_STD3_mapped",[40,108,41]],[[9384,9384],"disallowed_STD3_mapped",[40,109,41]],[[9385,9385],"disallowed_STD3_mapped",[40,110,41]],[[9386,9386],"disallowed_STD3_mapped",[40,111,41]],[[9387,9387],"disallowed_STD3_mapped",[40,112,41]],[[9388,9388],"disallowed_STD3_mapped",[40,113,41]],[[9389,9389],"disallowed_STD3_mapped",[40,114,41]],[[9390,9390],"disallowed_STD3_mapped",[40,115,41]],[[9391,9391],"disallowed_STD3_mapped",[40,116,41]],[[9392,9392],"disallowed_STD3_mapped",[40,117,41]],[[9393,9393],"disallowed_STD3_mapped",[40,118,41]],[[9394,9394],"disallowed_STD3_mapped",[40,119,41]],[[9395,9395],"disallowed_STD3_mapped",[40,120,41]],[[9396,9396],"disallowed_STD3_mapped",[40,121,41]],[[9397,9397],"disallowed_STD3_mapped",[40,122,41]],[[9398,9398],"mapped",[97]],[[9399,9399],"mapped",[98]],[[9400,9400],"mapped",[99]],[[9401,9401],"mapped",[100]],[[9402,9402],"mapped",[101]],[[9403,9403],"mapped",[102]],[[9404,9404],"mapped",[103]],[[9405,9405],"mapped",[104]],[[9406,9406],"mapped",[105]],[[9407,9407],"mapped",[106]],[[9408,9408],"mapped",[107]],[[9409,9409],"mapped",[108]],[[9410,9410],"mapped",[109]],[[9411,9411],"mapped",[110]],[[9412,9412],"mapped",[111]],[[9413,9413],"mapped",[112]],[[9414,9414],"mapped",[113]],[[9415,9415],"mapped",[114]],[[9416,9416],"mapped",[115]],[[9417,9417],"mapped",[116]],[[9418,9418],"mapped",[117]],[[9419,9419],"mapped",[118]],[[9420,9420],"mapped",[119]],[[9421,9421],"mapped",[120]],[[9422,9422],"mapped",[121]],[[9423,9423],"mapped",[122]],[[9424,9424],"mapped",[97]],[[9425,9425],"mapped",[98]],[[9426,9426],"mapped",[99]],[[9427,9427],"mapped",[100]],[[9428,9428],"mapped",[101]],[[9429,9429],"mapped",[102]],[[9430,9430],"mapped",[103]],[[9431,9431],"mapped",[104]],[[9432,9432],"mapped",[105]],[[9433,9433],"mapped",[106]],[[9434,9434],"mapped",[107]],[[9435,9435],"mapped",[108]],[[9436,9436],"mapped",[109]],[[9437,9437],"mapped",[110]],[[9438,9438],"mapped",[111]],[[9439,9439],"mapped",[112]],[[9440,9440],"mapped",[113]],[[9441,9441],"mapped",[114]],[[9442,9442],"mapped",[115]],[[9443,9443],"mapped",[116]],[[9444,9444],"mapped",[117]],[[9445,9445],"mapped",[118]],[[9446,9446],"mapped",[119]],[[9447,9447],"mapped",[120]],[[9448,9448],"mapped",[121]],[[9449,9449],"mapped",[122]],[[9450,9450],"mapped",[48]],[[9451,9470],"valid",[],"NV8"],[[9471,9471],"valid",[],"NV8"],[[9472,9621],"valid",[],"NV8"],[[9622,9631],"valid",[],"NV8"],[[9632,9711],"valid",[],"NV8"],[[9712,9719],"valid",[],"NV8"],[[9720,9727],"valid",[],"NV8"],[[9728,9747],"valid",[],"NV8"],[[9748,9749],"valid",[],"NV8"],[[9750,9751],"valid",[],"NV8"],[[9752,9752],"valid",[],"NV8"],[[9753,9753],"valid",[],"NV8"],[[9754,9839],"valid",[],"NV8"],[[9840,9841],"valid",[],"NV8"],[[9842,9853],"valid",[],"NV8"],[[9854,9855],"valid",[],"NV8"],[[9856,9865],"valid",[],"NV8"],[[9866,9873],"valid",[],"NV8"],[[9874,9884],"valid",[],"NV8"],[[9885,9885],"valid",[],"NV8"],[[9886,9887],"valid",[],"NV8"],[[9888,9889],"valid",[],"NV8"],[[9890,9905],"valid",[],"NV8"],[[9906,9906],"valid",[],"NV8"],[[9907,9916],"valid",[],"NV8"],[[9917,9919],"valid",[],"NV8"],[[9920,9923],"valid",[],"NV8"],[[9924,9933],"valid",[],"NV8"],[[9934,9934],"valid",[],"NV8"],[[9935,9953],"valid",[],"NV8"],[[9954,9954],"valid",[],"NV8"],[[9955,9955],"valid",[],"NV8"],[[9956,9959],"valid",[],"NV8"],[[9960,9983],"valid",[],"NV8"],[[9984,9984],"valid",[],"NV8"],[[9985,9988],"valid",[],"NV8"],[[9989,9989],"valid",[],"NV8"],[[9990,9993],"valid",[],"NV8"],[[9994,9995],"valid",[],"NV8"],[[9996,10023],"valid",[],"NV8"],[[10024,10024],"valid",[],"NV8"],[[10025,10059],"valid",[],"NV8"],[[10060,10060],"valid",[],"NV8"],[[10061,10061],"valid",[],"NV8"],[[10062,10062],"valid",[],"NV8"],[[10063,10066],"valid",[],"NV8"],[[10067,10069],"valid",[],"NV8"],[[10070,10070],"valid",[],"NV8"],[[10071,10071],"valid",[],"NV8"],[[10072,10078],"valid",[],"NV8"],[[10079,10080],"valid",[],"NV8"],[[10081,10087],"valid",[],"NV8"],[[10088,10101],"valid",[],"NV8"],[[10102,10132],"valid",[],"NV8"],[[10133,10135],"valid",[],"NV8"],[[10136,10159],"valid",[],"NV8"],[[10160,10160],"valid",[],"NV8"],[[10161,10174],"valid",[],"NV8"],[[10175,10175],"valid",[],"NV8"],[[10176,10182],"valid",[],"NV8"],[[10183,10186],"valid",[],"NV8"],[[10187,10187],"valid",[],"NV8"],[[10188,10188],"valid",[],"NV8"],[[10189,10189],"valid",[],"NV8"],[[10190,10191],"valid",[],"NV8"],[[10192,10219],"valid",[],"NV8"],[[10220,10223],"valid",[],"NV8"],[[10224,10239],"valid",[],"NV8"],[[10240,10495],"valid",[],"NV8"],[[10496,10763],"valid",[],"NV8"],[[10764,10764],"mapped",[8747,8747,8747,8747]],[[10765,10867],"valid",[],"NV8"],[[10868,10868],"disallowed_STD3_mapped",[58,58,61]],[[10869,10869],"disallowed_STD3_mapped",[61,61]],[[10870,10870],"disallowed_STD3_mapped",[61,61,61]],[[10871,10971],"valid",[],"NV8"],[[10972,10972],"mapped",[10973,824]],[[10973,11007],"valid",[],"NV8"],[[11008,11021],"valid",[],"NV8"],[[11022,11027],"valid",[],"NV8"],[[11028,11034],"valid",[],"NV8"],[[11035,11039],"valid",[],"NV8"],[[11040,11043],"valid",[],"NV8"],[[11044,11084],"valid",[],"NV8"],[[11085,11087],"valid",[],"NV8"],[[11088,11092],"valid",[],"NV8"],[[11093,11097],"valid",[],"NV8"],[[11098,11123],"valid",[],"NV8"],[[11124,11125],"disallowed"],[[11126,11157],"valid",[],"NV8"],[[11158,11159],"disallowed"],[[11160,11193],"valid",[],"NV8"],[[11194,11196],"disallowed"],[[11197,11208],"valid",[],"NV8"],[[11209,11209],"disallowed"],[[11210,11217],"valid",[],"NV8"],[[11218,11243],"disallowed"],[[11244,11247],"valid",[],"NV8"],[[11248,11263],"disallowed"],[[11264,11264],"mapped",[11312]],[[11265,11265],"mapped",[11313]],[[11266,11266],"mapped",[11314]],[[11267,11267],"mapped",[11315]],[[11268,11268],"mapped",[11316]],[[11269,11269],"mapped",[11317]],[[11270,11270],"mapped",[11318]],[[11271,11271],"mapped",[11319]],[[11272,11272],"mapped",[11320]],[[11273,11273],"mapped",[11321]],[[11274,11274],"mapped",[11322]],[[11275,11275],"mapped",[11323]],[[11276,11276],"mapped",[11324]],[[11277,11277],"mapped",[11325]],[[11278,11278],"mapped",[11326]],[[11279,11279],"mapped",[11327]],[[11280,11280],"mapped",[11328]],[[11281,11281],"mapped",[11329]],[[11282,11282],"mapped",[11330]],[[11283,11283],"mapped",[11331]],[[11284,11284],"mapped",[11332]],[[11285,11285],"mapped",[11333]],[[11286,11286],"mapped",[11334]],[[11287,11287],"mapped",[11335]],[[11288,11288],"mapped",[11336]],[[11289,11289],"mapped",[11337]],[[11290,11290],"mapped",[11338]],[[11291,11291],"mapped",[11339]],[[11292,11292],"mapped",[11340]],[[11293,11293],"mapped",[11341]],[[11294,11294],"mapped",[11342]],[[11295,11295],"mapped",[11343]],[[11296,11296],"mapped",[11344]],[[11297,11297],"mapped",[11345]],[[11298,11298],"mapped",[11346]],[[11299,11299],"mapped",[11347]],[[11300,11300],"mapped",[11348]],[[11301,11301],"mapped",[11349]],[[11302,11302],"mapped",[11350]],[[11303,11303],"mapped",[11351]],[[11304,11304],"mapped",[11352]],[[11305,11305],"mapped",[11353]],[[11306,11306],"mapped",[11354]],[[11307,11307],"mapped",[11355]],[[11308,11308],"mapped",[11356]],[[11309,11309],"mapped",[11357]],[[11310,11310],"mapped",[11358]],[[11311,11311],"disallowed"],[[11312,11358],"valid"],[[11359,11359],"disallowed"],[[11360,11360],"mapped",[11361]],[[11361,11361],"valid"],[[11362,11362],"mapped",[619]],[[11363,11363],"mapped",[7549]],[[11364,11364],"mapped",[637]],[[11365,11366],"valid"],[[11367,11367],"mapped",[11368]],[[11368,11368],"valid"],[[11369,11369],"mapped",[11370]],[[11370,11370],"valid"],[[11371,11371],"mapped",[11372]],[[11372,11372],"valid"],[[11373,11373],"mapped",[593]],[[11374,11374],"mapped",[625]],[[11375,11375],"mapped",[592]],[[11376,11376],"mapped",[594]],[[11377,11377],"valid"],[[11378,11378],"mapped",[11379]],[[11379,11379],"valid"],[[11380,11380],"valid"],[[11381,11381],"mapped",[11382]],[[11382,11383],"valid"],[[11384,11387],"valid"],[[11388,11388],"mapped",[106]],[[11389,11389],"mapped",[118]],[[11390,11390],"mapped",[575]],[[11391,11391],"mapped",[576]],[[11392,11392],"mapped",[11393]],[[11393,11393],"valid"],[[11394,11394],"mapped",[11395]],[[11395,11395],"valid"],[[11396,11396],"mapped",[11397]],[[11397,11397],"valid"],[[11398,11398],"mapped",[11399]],[[11399,11399],"valid"],[[11400,11400],"mapped",[11401]],[[11401,11401],"valid"],[[11402,11402],"mapped",[11403]],[[11403,11403],"valid"],[[11404,11404],"mapped",[11405]],[[11405,11405],"valid"],[[11406,11406],"mapped",[11407]],[[11407,11407],"valid"],[[11408,11408],"mapped",[11409]],[[11409,11409],"valid"],[[11410,11410],"mapped",[11411]],[[11411,11411],"valid"],[[11412,11412],"mapped",[11413]],[[11413,11413],"valid"],[[11414,11414],"mapped",[11415]],[[11415,11415],"valid"],[[11416,11416],"mapped",[11417]],[[11417,11417],"valid"],[[11418,11418],"mapped",[11419]],[[11419,11419],"valid"],[[11420,11420],"mapped",[11421]],[[11421,11421],"valid"],[[11422,11422],"mapped",[11423]],[[11423,11423],"valid"],[[11424,11424],"mapped",[11425]],[[11425,11425],"valid"],[[11426,11426],"mapped",[11427]],[[11427,11427],"valid"],[[11428,11428],"mapped",[11429]],[[11429,11429],"valid"],[[11430,11430],"mapped",[11431]],[[11431,11431],"valid"],[[11432,11432],"mapped",[11433]],[[11433,11433],"valid"],[[11434,11434],"mapped",[11435]],[[11435,11435],"valid"],[[11436,11436],"mapped",[11437]],[[11437,11437],"valid"],[[11438,11438],"mapped",[11439]],[[11439,11439],"valid"],[[11440,11440],"mapped",[11441]],[[11441,11441],"valid"],[[11442,11442],"mapped",[11443]],[[11443,11443],"valid"],[[11444,11444],"mapped",[11445]],[[11445,11445],"valid"],[[11446,11446],"mapped",[11447]],[[11447,11447],"valid"],[[11448,11448],"mapped",[11449]],[[11449,11449],"valid"],[[11450,11450],"mapped",[11451]],[[11451,11451],"valid"],[[11452,11452],"mapped",[11453]],[[11453,11453],"valid"],[[11454,11454],"mapped",[11455]],[[11455,11455],"valid"],[[11456,11456],"mapped",[11457]],[[11457,11457],"valid"],[[11458,11458],"mapped",[11459]],[[11459,11459],"valid"],[[11460,11460],"mapped",[11461]],[[11461,11461],"valid"],[[11462,11462],"mapped",[11463]],[[11463,11463],"valid"],[[11464,11464],"mapped",[11465]],[[11465,11465],"valid"],[[11466,11466],"mapped",[11467]],[[11467,11467],"valid"],[[11468,11468],"mapped",[11469]],[[11469,11469],"valid"],[[11470,11470],"mapped",[11471]],[[11471,11471],"valid"],[[11472,11472],"mapped",[11473]],[[11473,11473],"valid"],[[11474,11474],"mapped",[11475]],[[11475,11475],"valid"],[[11476,11476],"mapped",[11477]],[[11477,11477],"valid"],[[11478,11478],"mapped",[11479]],[[11479,11479],"valid"],[[11480,11480],"mapped",[11481]],[[11481,11481],"valid"],[[11482,11482],"mapped",[11483]],[[11483,11483],"valid"],[[11484,11484],"mapped",[11485]],[[11485,11485],"valid"],[[11486,11486],"mapped",[11487]],[[11487,11487],"valid"],[[11488,11488],"mapped",[11489]],[[11489,11489],"valid"],[[11490,11490],"mapped",[11491]],[[11491,11492],"valid"],[[11493,11498],"valid",[],"NV8"],[[11499,11499],"mapped",[11500]],[[11500,11500],"valid"],[[11501,11501],"mapped",[11502]],[[11502,11505],"valid"],[[11506,11506],"mapped",[11507]],[[11507,11507],"valid"],[[11508,11512],"disallowed"],[[11513,11519],"valid",[],"NV8"],[[11520,11557],"valid"],[[11558,11558],"disallowed"],[[11559,11559],"valid"],[[11560,11564],"disallowed"],[[11565,11565],"valid"],[[11566,11567],"disallowed"],[[11568,11621],"valid"],[[11622,11623],"valid"],[[11624,11630],"disallowed"],[[11631,11631],"mapped",[11617]],[[11632,11632],"valid",[],"NV8"],[[11633,11646],"disallowed"],[[11647,11647],"valid"],[[11648,11670],"valid"],[[11671,11679],"disallowed"],[[11680,11686],"valid"],[[11687,11687],"disallowed"],[[11688,11694],"valid"],[[11695,11695],"disallowed"],[[11696,11702],"valid"],[[11703,11703],"disallowed"],[[11704,11710],"valid"],[[11711,11711],"disallowed"],[[11712,11718],"valid"],[[11719,11719],"disallowed"],[[11720,11726],"valid"],[[11727,11727],"disallowed"],[[11728,11734],"valid"],[[11735,11735],"disallowed"],[[11736,11742],"valid"],[[11743,11743],"disallowed"],[[11744,11775],"valid"],[[11776,11799],"valid",[],"NV8"],[[11800,11803],"valid",[],"NV8"],[[11804,11805],"valid",[],"NV8"],[[11806,11822],"valid",[],"NV8"],[[11823,11823],"valid"],[[11824,11824],"valid",[],"NV8"],[[11825,11825],"valid",[],"NV8"],[[11826,11835],"valid",[],"NV8"],[[11836,11842],"valid",[],"NV8"],[[11843,11903],"disallowed"],[[11904,11929],"valid",[],"NV8"],[[11930,11930],"disallowed"],[[11931,11934],"valid",[],"NV8"],[[11935,11935],"mapped",[27597]],[[11936,12018],"valid",[],"NV8"],[[12019,12019],"mapped",[40863]],[[12020,12031],"disallowed"],[[12032,12032],"mapped",[19968]],[[12033,12033],"mapped",[20008]],[[12034,12034],"mapped",[20022]],[[12035,12035],"mapped",[20031]],[[12036,12036],"mapped",[20057]],[[12037,12037],"mapped",[20101]],[[12038,12038],"mapped",[20108]],[[12039,12039],"mapped",[20128]],[[12040,12040],"mapped",[20154]],[[12041,12041],"mapped",[20799]],[[12042,12042],"mapped",[20837]],[[12043,12043],"mapped",[20843]],[[12044,12044],"mapped",[20866]],[[12045,12045],"mapped",[20886]],[[12046,12046],"mapped",[20907]],[[12047,12047],"mapped",[20960]],[[12048,12048],"mapped",[20981]],[[12049,12049],"mapped",[20992]],[[12050,12050],"mapped",[21147]],[[12051,12051],"mapped",[21241]],[[12052,12052],"mapped",[21269]],[[12053,12053],"mapped",[21274]],[[12054,12054],"mapped",[21304]],[[12055,12055],"mapped",[21313]],[[12056,12056],"mapped",[21340]],[[12057,12057],"mapped",[21353]],[[12058,12058],"mapped",[21378]],[[12059,12059],"mapped",[21430]],[[12060,12060],"mapped",[21448]],[[12061,12061],"mapped",[21475]],[[12062,12062],"mapped",[22231]],[[12063,12063],"mapped",[22303]],[[12064,12064],"mapped",[22763]],[[12065,12065],"mapped",[22786]],[[12066,12066],"mapped",[22794]],[[12067,12067],"mapped",[22805]],[[12068,12068],"mapped",[22823]],[[12069,12069],"mapped",[22899]],[[12070,12070],"mapped",[23376]],[[12071,12071],"mapped",[23424]],[[12072,12072],"mapped",[23544]],[[12073,12073],"mapped",[23567]],[[12074,12074],"mapped",[23586]],[[12075,12075],"mapped",[23608]],[[12076,12076],"mapped",[23662]],[[12077,12077],"mapped",[23665]],[[12078,12078],"mapped",[24027]],[[12079,12079],"mapped",[24037]],[[12080,12080],"mapped",[24049]],[[12081,12081],"mapped",[24062]],[[12082,12082],"mapped",[24178]],[[12083,12083],"mapped",[24186]],[[12084,12084],"mapped",[24191]],[[12085,12085],"mapped",[24308]],[[12086,12086],"mapped",[24318]],[[12087,12087],"mapped",[24331]],[[12088,12088],"mapped",[24339]],[[12089,12089],"mapped",[24400]],[[12090,12090],"mapped",[24417]],[[12091,12091],"mapped",[24435]],[[12092,12092],"mapped",[24515]],[[12093,12093],"mapped",[25096]],[[12094,12094],"mapped",[25142]],[[12095,12095],"mapped",[25163]],[[12096,12096],"mapped",[25903]],[[12097,12097],"mapped",[25908]],[[12098,12098],"mapped",[25991]],[[12099,12099],"mapped",[26007]],[[12100,12100],"mapped",[26020]],[[12101,12101],"mapped",[26041]],[[12102,12102],"mapped",[26080]],[[12103,12103],"mapped",[26085]],[[12104,12104],"mapped",[26352]],[[12105,12105],"mapped",[26376]],[[12106,12106],"mapped",[26408]],[[12107,12107],"mapped",[27424]],[[12108,12108],"mapped",[27490]],[[12109,12109],"mapped",[27513]],[[12110,12110],"mapped",[27571]],[[12111,12111],"mapped",[27595]],[[12112,12112],"mapped",[27604]],[[12113,12113],"mapped",[27611]],[[12114,12114],"mapped",[27663]],[[12115,12115],"mapped",[27668]],[[12116,12116],"mapped",[27700]],[[12117,12117],"mapped",[28779]],[[12118,12118],"mapped",[29226]],[[12119,12119],"mapped",[29238]],[[12120,12120],"mapped",[29243]],[[12121,12121],"mapped",[29247]],[[12122,12122],"mapped",[29255]],[[12123,12123],"mapped",[29273]],[[12124,12124],"mapped",[29275]],[[12125,12125],"mapped",[29356]],[[12126,12126],"mapped",[29572]],[[12127,12127],"mapped",[29577]],[[12128,12128],"mapped",[29916]],[[12129,12129],"mapped",[29926]],[[12130,12130],"mapped",[29976]],[[12131,12131],"mapped",[29983]],[[12132,12132],"mapped",[29992]],[[12133,12133],"mapped",[30000]],[[12134,12134],"mapped",[30091]],[[12135,12135],"mapped",[30098]],[[12136,12136],"mapped",[30326]],[[12137,12137],"mapped",[30333]],[[12138,12138],"mapped",[30382]],[[12139,12139],"mapped",[30399]],[[12140,12140],"mapped",[30446]],[[12141,12141],"mapped",[30683]],[[12142,12142],"mapped",[30690]],[[12143,12143],"mapped",[30707]],[[12144,12144],"mapped",[31034]],[[12145,12145],"mapped",[31160]],[[12146,12146],"mapped",[31166]],[[12147,12147],"mapped",[31348]],[[12148,12148],"mapped",[31435]],[[12149,12149],"mapped",[31481]],[[12150,12150],"mapped",[31859]],[[12151,12151],"mapped",[31992]],[[12152,12152],"mapped",[32566]],[[12153,12153],"mapped",[32593]],[[12154,12154],"mapped",[32650]],[[12155,12155],"mapped",[32701]],[[12156,12156],"mapped",[32769]],[[12157,12157],"mapped",[32780]],[[12158,12158],"mapped",[32786]],[[12159,12159],"mapped",[32819]],[[12160,12160],"mapped",[32895]],[[12161,12161],"mapped",[32905]],[[12162,12162],"mapped",[33251]],[[12163,12163],"mapped",[33258]],[[12164,12164],"mapped",[33267]],[[12165,12165],"mapped",[33276]],[[12166,12166],"mapped",[33292]],[[12167,12167],"mapped",[33307]],[[12168,12168],"mapped",[33311]],[[12169,12169],"mapped",[33390]],[[12170,12170],"mapped",[33394]],[[12171,12171],"mapped",[33400]],[[12172,12172],"mapped",[34381]],[[12173,12173],"mapped",[34411]],[[12174,12174],"mapped",[34880]],[[12175,12175],"mapped",[34892]],[[12176,12176],"mapped",[34915]],[[12177,12177],"mapped",[35198]],[[12178,12178],"mapped",[35211]],[[12179,12179],"mapped",[35282]],[[12180,12180],"mapped",[35328]],[[12181,12181],"mapped",[35895]],[[12182,12182],"mapped",[35910]],[[12183,12183],"mapped",[35925]],[[12184,12184],"mapped",[35960]],[[12185,12185],"mapped",[35997]],[[12186,12186],"mapped",[36196]],[[12187,12187],"mapped",[36208]],[[12188,12188],"mapped",[36275]],[[12189,12189],"mapped",[36523]],[[12190,12190],"mapped",[36554]],[[12191,12191],"mapped",[36763]],[[12192,12192],"mapped",[36784]],[[12193,12193],"mapped",[36789]],[[12194,12194],"mapped",[37009]],[[12195,12195],"mapped",[37193]],[[12196,12196],"mapped",[37318]],[[12197,12197],"mapped",[37324]],[[12198,12198],"mapped",[37329]],[[12199,12199],"mapped",[38263]],[[12200,12200],"mapped",[38272]],[[12201,12201],"mapped",[38428]],[[12202,12202],"mapped",[38582]],[[12203,12203],"mapped",[38585]],[[12204,12204],"mapped",[38632]],[[12205,12205],"mapped",[38737]],[[12206,12206],"mapped",[38750]],[[12207,12207],"mapped",[38754]],[[12208,12208],"mapped",[38761]],[[12209,12209],"mapped",[38859]],[[12210,12210],"mapped",[38893]],[[12211,12211],"mapped",[38899]],[[12212,12212],"mapped",[38913]],[[12213,12213],"mapped",[39080]],[[12214,12214],"mapped",[39131]],[[12215,12215],"mapped",[39135]],[[12216,12216],"mapped",[39318]],[[12217,12217],"mapped",[39321]],[[12218,12218],"mapped",[39340]],[[12219,12219],"mapped",[39592]],[[12220,12220],"mapped",[39640]],[[12221,12221],"mapped",[39647]],[[12222,12222],"mapped",[39717]],[[12223,12223],"mapped",[39727]],[[12224,12224],"mapped",[39730]],[[12225,12225],"mapped",[39740]],[[12226,12226],"mapped",[39770]],[[12227,12227],"mapped",[40165]],[[12228,12228],"mapped",[40565]],[[12229,12229],"mapped",[40575]],[[12230,12230],"mapped",[40613]],[[12231,12231],"mapped",[40635]],[[12232,12232],"mapped",[40643]],[[12233,12233],"mapped",[40653]],[[12234,12234],"mapped",[40657]],[[12235,12235],"mapped",[40697]],[[12236,12236],"mapped",[40701]],[[12237,12237],"mapped",[40718]],[[12238,12238],"mapped",[40723]],[[12239,12239],"mapped",[40736]],[[12240,12240],"mapped",[40763]],[[12241,12241],"mapped",[40778]],[[12242,12242],"mapped",[40786]],[[12243,12243],"mapped",[40845]],[[12244,12244],"mapped",[40860]],[[12245,12245],"mapped",[40864]],[[12246,12271],"disallowed"],[[12272,12283],"disallowed"],[[12284,12287],"disallowed"],[[12288,12288],"disallowed_STD3_mapped",[32]],[[12289,12289],"valid",[],"NV8"],[[12290,12290],"mapped",[46]],[[12291,12292],"valid",[],"NV8"],[[12293,12295],"valid"],[[12296,12329],"valid",[],"NV8"],[[12330,12333],"valid"],[[12334,12341],"valid",[],"NV8"],[[12342,12342],"mapped",[12306]],[[12343,12343],"valid",[],"NV8"],[[12344,12344],"mapped",[21313]],[[12345,12345],"mapped",[21316]],[[12346,12346],"mapped",[21317]],[[12347,12347],"valid",[],"NV8"],[[12348,12348],"valid"],[[12349,12349],"valid",[],"NV8"],[[12350,12350],"valid",[],"NV8"],[[12351,12351],"valid",[],"NV8"],[[12352,12352],"disallowed"],[[12353,12436],"valid"],[[12437,12438],"valid"],[[12439,12440],"disallowed"],[[12441,12442],"valid"],[[12443,12443],"disallowed_STD3_mapped",[32,12441]],[[12444,12444],"disallowed_STD3_mapped",[32,12442]],[[12445,12446],"valid"],[[12447,12447],"mapped",[12424,12426]],[[12448,12448],"valid",[],"NV8"],[[12449,12542],"valid"],[[12543,12543],"mapped",[12467,12488]],[[12544,12548],"disallowed"],[[12549,12588],"valid"],[[12589,12589],"valid"],[[12590,12592],"disallowed"],[[12593,12593],"mapped",[4352]],[[12594,12594],"mapped",[4353]],[[12595,12595],"mapped",[4522]],[[12596,12596],"mapped",[4354]],[[12597,12597],"mapped",[4524]],[[12598,12598],"mapped",[4525]],[[12599,12599],"mapped",[4355]],[[12600,12600],"mapped",[4356]],[[12601,12601],"mapped",[4357]],[[12602,12602],"mapped",[4528]],[[12603,12603],"mapped",[4529]],[[12604,12604],"mapped",[4530]],[[12605,12605],"mapped",[4531]],[[12606,12606],"mapped",[4532]],[[12607,12607],"mapped",[4533]],[[12608,12608],"mapped",[4378]],[[12609,12609],"mapped",[4358]],[[12610,12610],"mapped",[4359]],[[12611,12611],"mapped",[4360]],[[12612,12612],"mapped",[4385]],[[12613,12613],"mapped",[4361]],[[12614,12614],"mapped",[4362]],[[12615,12615],"mapped",[4363]],[[12616,12616],"mapped",[4364]],[[12617,12617],"mapped",[4365]],[[12618,12618],"mapped",[4366]],[[12619,12619],"mapped",[4367]],[[12620,12620],"mapped",[4368]],[[12621,12621],"mapped",[4369]],[[12622,12622],"mapped",[4370]],[[12623,12623],"mapped",[4449]],[[12624,12624],"mapped",[4450]],[[12625,12625],"mapped",[4451]],[[12626,12626],"mapped",[4452]],[[12627,12627],"mapped",[4453]],[[12628,12628],"mapped",[4454]],[[12629,12629],"mapped",[4455]],[[12630,12630],"mapped",[4456]],[[12631,12631],"mapped",[4457]],[[12632,12632],"mapped",[4458]],[[12633,12633],"mapped",[4459]],[[12634,12634],"mapped",[4460]],[[12635,12635],"mapped",[4461]],[[12636,12636],"mapped",[4462]],[[12637,12637],"mapped",[4463]],[[12638,12638],"mapped",[4464]],[[12639,12639],"mapped",[4465]],[[12640,12640],"mapped",[4466]],[[12641,12641],"mapped",[4467]],[[12642,12642],"mapped",[4468]],[[12643,12643],"mapped",[4469]],[[12644,12644],"disallowed"],[[12645,12645],"mapped",[4372]],[[12646,12646],"mapped",[4373]],[[12647,12647],"mapped",[4551]],[[12648,12648],"mapped",[4552]],[[12649,12649],"mapped",[4556]],[[12650,12650],"mapped",[4558]],[[12651,12651],"mapped",[4563]],[[12652,12652],"mapped",[4567]],[[12653,12653],"mapped",[4569]],[[12654,12654],"mapped",[4380]],[[12655,12655],"mapped",[4573]],[[12656,12656],"mapped",[4575]],[[12657,12657],"mapped",[4381]],[[12658,12658],"mapped",[4382]],[[12659,12659],"mapped",[4384]],[[12660,12660],"mapped",[4386]],[[12661,12661],"mapped",[4387]],[[12662,12662],"mapped",[4391]],[[12663,12663],"mapped",[4393]],[[12664,12664],"mapped",[4395]],[[12665,12665],"mapped",[4396]],[[12666,12666],"mapped",[4397]],[[12667,12667],"mapped",[4398]],[[12668,12668],"mapped",[4399]],[[12669,12669],"mapped",[4402]],[[12670,12670],"mapped",[4406]],[[12671,12671],"mapped",[4416]],[[12672,12672],"mapped",[4423]],[[12673,12673],"mapped",[4428]],[[12674,12674],"mapped",[4593]],[[12675,12675],"mapped",[4594]],[[12676,12676],"mapped",[4439]],[[12677,12677],"mapped",[4440]],[[12678,12678],"mapped",[4441]],[[12679,12679],"mapped",[4484]],[[12680,12680],"mapped",[4485]],[[12681,12681],"mapped",[4488]],[[12682,12682],"mapped",[4497]],[[12683,12683],"mapped",[4498]],[[12684,12684],"mapped",[4500]],[[12685,12685],"mapped",[4510]],[[12686,12686],"mapped",[4513]],[[12687,12687],"disallowed"],[[12688,12689],"valid",[],"NV8"],[[12690,12690],"mapped",[19968]],[[12691,12691],"mapped",[20108]],[[12692,12692],"mapped",[19977]],[[12693,12693],"mapped",[22235]],[[12694,12694],"mapped",[19978]],[[12695,12695],"mapped",[20013]],[[12696,12696],"mapped",[19979]],[[12697,12697],"mapped",[30002]],[[12698,12698],"mapped",[20057]],[[12699,12699],"mapped",[19993]],[[12700,12700],"mapped",[19969]],[[12701,12701],"mapped",[22825]],[[12702,12702],"mapped",[22320]],[[12703,12703],"mapped",[20154]],[[12704,12727],"valid"],[[12728,12730],"valid"],[[12731,12735],"disallowed"],[[12736,12751],"valid",[],"NV8"],[[12752,12771],"valid",[],"NV8"],[[12772,12783],"disallowed"],[[12784,12799],"valid"],[[12800,12800],"disallowed_STD3_mapped",[40,4352,41]],[[12801,12801],"disallowed_STD3_mapped",[40,4354,41]],[[12802,12802],"disallowed_STD3_mapped",[40,4355,41]],[[12803,12803],"disallowed_STD3_mapped",[40,4357,41]],[[12804,12804],"disallowed_STD3_mapped",[40,4358,41]],[[12805,12805],"disallowed_STD3_mapped",[40,4359,41]],[[12806,12806],"disallowed_STD3_mapped",[40,4361,41]],[[12807,12807],"disallowed_STD3_mapped",[40,4363,41]],[[12808,12808],"disallowed_STD3_mapped",[40,4364,41]],[[12809,12809],"disallowed_STD3_mapped",[40,4366,41]],[[12810,12810],"disallowed_STD3_mapped",[40,4367,41]],[[12811,12811],"disallowed_STD3_mapped",[40,4368,41]],[[12812,12812],"disallowed_STD3_mapped",[40,4369,41]],[[12813,12813],"disallowed_STD3_mapped",[40,4370,41]],[[12814,12814],"disallowed_STD3_mapped",[40,44032,41]],[[12815,12815],"disallowed_STD3_mapped",[40,45208,41]],[[12816,12816],"disallowed_STD3_mapped",[40,45796,41]],[[12817,12817],"disallowed_STD3_mapped",[40,46972,41]],[[12818,12818],"disallowed_STD3_mapped",[40,47560,41]],[[12819,12819],"disallowed_STD3_mapped",[40,48148,41]],[[12820,12820],"disallowed_STD3_mapped",[40,49324,41]],[[12821,12821],"disallowed_STD3_mapped",[40,50500,41]],[[12822,12822],"disallowed_STD3_mapped",[40,51088,41]],[[12823,12823],"disallowed_STD3_mapped",[40,52264,41]],[[12824,12824],"disallowed_STD3_mapped",[40,52852,41]],[[12825,12825],"disallowed_STD3_mapped",[40,53440,41]],[[12826,12826],"disallowed_STD3_mapped",[40,54028,41]],[[12827,12827],"disallowed_STD3_mapped",[40,54616,41]],[[12828,12828],"disallowed_STD3_mapped",[40,51452,41]],[[12829,12829],"disallowed_STD3_mapped",[40,50724,51204,41]],[[12830,12830],"disallowed_STD3_mapped",[40,50724,54980,41]],[[12831,12831],"disallowed"],[[12832,12832],"disallowed_STD3_mapped",[40,19968,41]],[[12833,12833],"disallowed_STD3_mapped",[40,20108,41]],[[12834,12834],"disallowed_STD3_mapped",[40,19977,41]],[[12835,12835],"disallowed_STD3_mapped",[40,22235,41]],[[12836,12836],"disallowed_STD3_mapped",[40,20116,41]],[[12837,12837],"disallowed_STD3_mapped",[40,20845,41]],[[12838,12838],"disallowed_STD3_mapped",[40,19971,41]],[[12839,12839],"disallowed_STD3_mapped",[40,20843,41]],[[12840,12840],"disallowed_STD3_mapped",[40,20061,41]],[[12841,12841],"disallowed_STD3_mapped",[40,21313,41]],[[12842,12842],"disallowed_STD3_mapped",[40,26376,41]],[[12843,12843],"disallowed_STD3_mapped",[40,28779,41]],[[12844,12844],"disallowed_STD3_mapped",[40,27700,41]],[[12845,12845],"disallowed_STD3_mapped",[40,26408,41]],[[12846,12846],"disallowed_STD3_mapped",[40,37329,41]],[[12847,12847],"disallowed_STD3_mapped",[40,22303,41]],[[12848,12848],"disallowed_STD3_mapped",[40,26085,41]],[[12849,12849],"disallowed_STD3_mapped",[40,26666,41]],[[12850,12850],"disallowed_STD3_mapped",[40,26377,41]],[[12851,12851],"disallowed_STD3_mapped",[40,31038,41]],[[12852,12852],"disallowed_STD3_mapped",[40,21517,41]],[[12853,12853],"disallowed_STD3_mapped",[40,29305,41]],[[12854,12854],"disallowed_STD3_mapped",[40,36001,41]],[[12855,12855],"disallowed_STD3_mapped",[40,31069,41]],[[12856,12856],"disallowed_STD3_mapped",[40,21172,41]],[[12857,12857],"disallowed_STD3_mapped",[40,20195,41]],[[12858,12858],"disallowed_STD3_mapped",[40,21628,41]],[[12859,12859],"disallowed_STD3_mapped",[40,23398,41]],[[12860,12860],"disallowed_STD3_mapped",[40,30435,41]],[[12861,12861],"disallowed_STD3_mapped",[40,20225,41]],[[12862,12862],"disallowed_STD3_mapped",[40,36039,41]],[[12863,12863],"disallowed_STD3_mapped",[40,21332,41]],[[12864,12864],"disallowed_STD3_mapped",[40,31085,41]],[[12865,12865],"disallowed_STD3_mapped",[40,20241,41]],[[12866,12866],"disallowed_STD3_mapped",[40,33258,41]],[[12867,12867],"disallowed_STD3_mapped",[40,33267,41]],[[12868,12868],"mapped",[21839]],[[12869,12869],"mapped",[24188]],[[12870,12870],"mapped",[25991]],[[12871,12871],"mapped",[31631]],[[12872,12879],"valid",[],"NV8"],[[12880,12880],"mapped",[112,116,101]],[[12881,12881],"mapped",[50,49]],[[12882,12882],"mapped",[50,50]],[[12883,12883],"mapped",[50,51]],[[12884,12884],"mapped",[50,52]],[[12885,12885],"mapped",[50,53]],[[12886,12886],"mapped",[50,54]],[[12887,12887],"mapped",[50,55]],[[12888,12888],"mapped",[50,56]],[[12889,12889],"mapped",[50,57]],[[12890,12890],"mapped",[51,48]],[[12891,12891],"mapped",[51,49]],[[12892,12892],"mapped",[51,50]],[[12893,12893],"mapped",[51,51]],[[12894,12894],"mapped",[51,52]],[[12895,12895],"mapped",[51,53]],[[12896,12896],"mapped",[4352]],[[12897,12897],"mapped",[4354]],[[12898,12898],"mapped",[4355]],[[12899,12899],"mapped",[4357]],[[12900,12900],"mapped",[4358]],[[12901,12901],"mapped",[4359]],[[12902,12902],"mapped",[4361]],[[12903,12903],"mapped",[4363]],[[12904,12904],"mapped",[4364]],[[12905,12905],"mapped",[4366]],[[12906,12906],"mapped",[4367]],[[12907,12907],"mapped",[4368]],[[12908,12908],"mapped",[4369]],[[12909,12909],"mapped",[4370]],[[12910,12910],"mapped",[44032]],[[12911,12911],"mapped",[45208]],[[12912,12912],"mapped",[45796]],[[12913,12913],"mapped",[46972]],[[12914,12914],"mapped",[47560]],[[12915,12915],"mapped",[48148]],[[12916,12916],"mapped",[49324]],[[12917,12917],"mapped",[50500]],[[12918,12918],"mapped",[51088]],[[12919,12919],"mapped",[52264]],[[12920,12920],"mapped",[52852]],[[12921,12921],"mapped",[53440]],[[12922,12922],"mapped",[54028]],[[12923,12923],"mapped",[54616]],[[12924,12924],"mapped",[52280,44256]],[[12925,12925],"mapped",[51452,51032]],[[12926,12926],"mapped",[50864]],[[12927,12927],"valid",[],"NV8"],[[12928,12928],"mapped",[19968]],[[12929,12929],"mapped",[20108]],[[12930,12930],"mapped",[19977]],[[12931,12931],"mapped",[22235]],[[12932,12932],"mapped",[20116]],[[12933,12933],"mapped",[20845]],[[12934,12934],"mapped",[19971]],[[12935,12935],"mapped",[20843]],[[12936,12936],"mapped",[20061]],[[12937,12937],"mapped",[21313]],[[12938,12938],"mapped",[26376]],[[12939,12939],"mapped",[28779]],[[12940,12940],"mapped",[27700]],[[12941,12941],"mapped",[26408]],[[12942,12942],"mapped",[37329]],[[12943,12943],"mapped",[22303]],[[12944,12944],"mapped",[26085]],[[12945,12945],"mapped",[26666]],[[12946,12946],"mapped",[26377]],[[12947,12947],"mapped",[31038]],[[12948,12948],"mapped",[21517]],[[12949,12949],"mapped",[29305]],[[12950,12950],"mapped",[36001]],[[12951,12951],"mapped",[31069]],[[12952,12952],"mapped",[21172]],[[12953,12953],"mapped",[31192]],[[12954,12954],"mapped",[30007]],[[12955,12955],"mapped",[22899]],[[12956,12956],"mapped",[36969]],[[12957,12957],"mapped",[20778]],[[12958,12958],"mapped",[21360]],[[12959,12959],"mapped",[27880]],[[12960,12960],"mapped",[38917]],[[12961,12961],"mapped",[20241]],[[12962,12962],"mapped",[20889]],[[12963,12963],"mapped",[27491]],[[12964,12964],"mapped",[19978]],[[12965,12965],"mapped",[20013]],[[12966,12966],"mapped",[19979]],[[12967,12967],"mapped",[24038]],[[12968,12968],"mapped",[21491]],[[12969,12969],"mapped",[21307]],[[12970,12970],"mapped",[23447]],[[12971,12971],"mapped",[23398]],[[12972,12972],"mapped",[30435]],[[12973,12973],"mapped",[20225]],[[12974,12974],"mapped",[36039]],[[12975,12975],"mapped",[21332]],[[12976,12976],"mapped",[22812]],[[12977,12977],"mapped",[51,54]],[[12978,12978],"mapped",[51,55]],[[12979,12979],"mapped",[51,56]],[[12980,12980],"mapped",[51,57]],[[12981,12981],"mapped",[52,48]],[[12982,12982],"mapped",[52,49]],[[12983,12983],"mapped",[52,50]],[[12984,12984],"mapped",[52,51]],[[12985,12985],"mapped",[52,52]],[[12986,12986],"mapped",[52,53]],[[12987,12987],"mapped",[52,54]],[[12988,12988],"mapped",[52,55]],[[12989,12989],"mapped",[52,56]],[[12990,12990],"mapped",[52,57]],[[12991,12991],"mapped",[53,48]],[[12992,12992],"mapped",[49,26376]],[[12993,12993],"mapped",[50,26376]],[[12994,12994],"mapped",[51,26376]],[[12995,12995],"mapped",[52,26376]],[[12996,12996],"mapped",[53,26376]],[[12997,12997],"mapped",[54,26376]],[[12998,12998],"mapped",[55,26376]],[[12999,12999],"mapped",[56,26376]],[[13000,13000],"mapped",[57,26376]],[[13001,13001],"mapped",[49,48,26376]],[[13002,13002],"mapped",[49,49,26376]],[[13003,13003],"mapped",[49,50,26376]],[[13004,13004],"mapped",[104,103]],[[13005,13005],"mapped",[101,114,103]],[[13006,13006],"mapped",[101,118]],[[13007,13007],"mapped",[108,116,100]],[[13008,13008],"mapped",[12450]],[[13009,13009],"mapped",[12452]],[[13010,13010],"mapped",[12454]],[[13011,13011],"mapped",[12456]],[[13012,13012],"mapped",[12458]],[[13013,13013],"mapped",[12459]],[[13014,13014],"mapped",[12461]],[[13015,13015],"mapped",[12463]],[[13016,13016],"mapped",[12465]],[[13017,13017],"mapped",[12467]],[[13018,13018],"mapped",[12469]],[[13019,13019],"mapped",[12471]],[[13020,13020],"mapped",[12473]],[[13021,13021],"mapped",[12475]],[[13022,13022],"mapped",[12477]],[[13023,13023],"mapped",[12479]],[[13024,13024],"mapped",[12481]],[[13025,13025],"mapped",[12484]],[[13026,13026],"mapped",[12486]],[[13027,13027],"mapped",[12488]],[[13028,13028],"mapped",[12490]],[[13029,13029],"mapped",[12491]],[[13030,13030],"mapped",[12492]],[[13031,13031],"mapped",[12493]],[[13032,13032],"mapped",[12494]],[[13033,13033],"mapped",[12495]],[[13034,13034],"mapped",[12498]],[[13035,13035],"mapped",[12501]],[[13036,13036],"mapped",[12504]],[[13037,13037],"mapped",[12507]],[[13038,13038],"mapped",[12510]],[[13039,13039],"mapped",[12511]],[[13040,13040],"mapped",[12512]],[[13041,13041],"mapped",[12513]],[[13042,13042],"mapped",[12514]],[[13043,13043],"mapped",[12516]],[[13044,13044],"mapped",[12518]],[[13045,13045],"mapped",[12520]],[[13046,13046],"mapped",[12521]],[[13047,13047],"mapped",[12522]],[[13048,13048],"mapped",[12523]],[[13049,13049],"mapped",[12524]],[[13050,13050],"mapped",[12525]],[[13051,13051],"mapped",[12527]],[[13052,13052],"mapped",[12528]],[[13053,13053],"mapped",[12529]],[[13054,13054],"mapped",[12530]],[[13055,13055],"disallowed"],[[13056,13056],"mapped",[12450,12497,12540,12488]],[[13057,13057],"mapped",[12450,12523,12501,12449]],[[13058,13058],"mapped",[12450,12531,12506,12450]],[[13059,13059],"mapped",[12450,12540,12523]],[[13060,13060],"mapped",[12452,12491,12531,12464]],[[13061,13061],"mapped",[12452,12531,12481]],[[13062,13062],"mapped",[12454,12457,12531]],[[13063,13063],"mapped",[12456,12473,12463,12540,12489]],[[13064,13064],"mapped",[12456,12540,12459,12540]],[[13065,13065],"mapped",[12458,12531,12473]],[[13066,13066],"mapped",[12458,12540,12512]],[[13067,13067],"mapped",[12459,12452,12522]],[[13068,13068],"mapped",[12459,12521,12483,12488]],[[13069,13069],"mapped",[12459,12525,12522,12540]],[[13070,13070],"mapped",[12460,12525,12531]],[[13071,13071],"mapped",[12460,12531,12510]],[[13072,13072],"mapped",[12462,12460]],[[13073,13073],"mapped",[12462,12491,12540]],[[13074,13074],"mapped",[12461,12517,12522,12540]],[[13075,13075],"mapped",[12462,12523,12480,12540]],[[13076,13076],"mapped",[12461,12525]],[[13077,13077],"mapped",[12461,12525,12464,12521,12512]],[[13078,13078],"mapped",[12461,12525,12513,12540,12488,12523]],[[13079,13079],"mapped",[12461,12525,12527,12483,12488]],[[13080,13080],"mapped",[12464,12521,12512]],[[13081,13081],"mapped",[12464,12521,12512,12488,12531]],[[13082,13082],"mapped",[12463,12523,12476,12452,12525]],[[13083,13083],"mapped",[12463,12525,12540,12493]],[[13084,13084],"mapped",[12465,12540,12473]],[[13085,13085],"mapped",[12467,12523,12490]],[[13086,13086],"mapped",[12467,12540,12509]],[[13087,13087],"mapped",[12469,12452,12463,12523]],[[13088,13088],"mapped",[12469,12531,12481,12540,12512]],[[13089,13089],"mapped",[12471,12522,12531,12464]],[[13090,13090],"mapped",[12475,12531,12481]],[[13091,13091],"mapped",[12475,12531,12488]],[[13092,13092],"mapped",[12480,12540,12473]],[[13093,13093],"mapped",[12487,12471]],[[13094,13094],"mapped",[12489,12523]],[[13095,13095],"mapped",[12488,12531]],[[13096,13096],"mapped",[12490,12494]],[[13097,13097],"mapped",[12494,12483,12488]],[[13098,13098],"mapped",[12495,12452,12484]],[[13099,13099],"mapped",[12497,12540,12475,12531,12488]],[[13100,13100],"mapped",[12497,12540,12484]],[[13101,13101],"mapped",[12496,12540,12524,12523]],[[13102,13102],"mapped",[12500,12450,12473,12488,12523]],[[13103,13103],"mapped",[12500,12463,12523]],[[13104,13104],"mapped",[12500,12467]],[[13105,13105],"mapped",[12499,12523]],[[13106,13106],"mapped",[12501,12449,12521,12483,12489]],[[13107,13107],"mapped",[12501,12451,12540,12488]],[[13108,13108],"mapped",[12502,12483,12471,12455,12523]],[[13109,13109],"mapped",[12501,12521,12531]],[[13110,13110],"mapped",[12504,12463,12479,12540,12523]],[[13111,13111],"mapped",[12506,12477]],[[13112,13112],"mapped",[12506,12491,12498]],[[13113,13113],"mapped",[12504,12523,12484]],[[13114,13114],"mapped",[12506,12531,12473]],[[13115,13115],"mapped",[12506,12540,12472]],[[13116,13116],"mapped",[12505,12540,12479]],[[13117,13117],"mapped",[12509,12452,12531,12488]],[[13118,13118],"mapped",[12508,12523,12488]],[[13119,13119],"mapped",[12507,12531]],[[13120,13120],"mapped",[12509,12531,12489]],[[13121,13121],"mapped",[12507,12540,12523]],[[13122,13122],"mapped",[12507,12540,12531]],[[13123,13123],"mapped",[12510,12452,12463,12525]],[[13124,13124],"mapped",[12510,12452,12523]],[[13125,13125],"mapped",[12510,12483,12495]],[[13126,13126],"mapped",[12510,12523,12463]],[[13127,13127],"mapped",[12510,12531,12471,12519,12531]],[[13128,13128],"mapped",[12511,12463,12525,12531]],[[13129,13129],"mapped",[12511,12522]],[[13130,13130],"mapped",[12511,12522,12496,12540,12523]],[[13131,13131],"mapped",[12513,12460]],[[13132,13132],"mapped",[12513,12460,12488,12531]],[[13133,13133],"mapped",[12513,12540,12488,12523]],[[13134,13134],"mapped",[12516,12540,12489]],[[13135,13135],"mapped",[12516,12540,12523]],[[13136,13136],"mapped",[12518,12450,12531]],[[13137,13137],"mapped",[12522,12483,12488,12523]],[[13138,13138],"mapped",[12522,12521]],[[13139,13139],"mapped",[12523,12500,12540]],[[13140,13140],"mapped",[12523,12540,12502,12523]],[[13141,13141],"mapped",[12524,12512]],[[13142,13142],"mapped",[12524,12531,12488,12466,12531]],[[13143,13143],"mapped",[12527,12483,12488]],[[13144,13144],"mapped",[48,28857]],[[13145,13145],"mapped",[49,28857]],[[13146,13146],"mapped",[50,28857]],[[13147,13147],"mapped",[51,28857]],[[13148,13148],"mapped",[52,28857]],[[13149,13149],"mapped",[53,28857]],[[13150,13150],"mapped",[54,28857]],[[13151,13151],"mapped",[55,28857]],[[13152,13152],"mapped",[56,28857]],[[13153,13153],"mapped",[57,28857]],[[13154,13154],"mapped",[49,48,28857]],[[13155,13155],"mapped",[49,49,28857]],[[13156,13156],"mapped",[49,50,28857]],[[13157,13157],"mapped",[49,51,28857]],[[13158,13158],"mapped",[49,52,28857]],[[13159,13159],"mapped",[49,53,28857]],[[13160,13160],"mapped",[49,54,28857]],[[13161,13161],"mapped",[49,55,28857]],[[13162,13162],"mapped",[49,56,28857]],[[13163,13163],"mapped",[49,57,28857]],[[13164,13164],"mapped",[50,48,28857]],[[13165,13165],"mapped",[50,49,28857]],[[13166,13166],"mapped",[50,50,28857]],[[13167,13167],"mapped",[50,51,28857]],[[13168,13168],"mapped",[50,52,28857]],[[13169,13169],"mapped",[104,112,97]],[[13170,13170],"mapped",[100,97]],[[13171,13171],"mapped",[97,117]],[[13172,13172],"mapped",[98,97,114]],[[13173,13173],"mapped",[111,118]],[[13174,13174],"mapped",[112,99]],[[13175,13175],"mapped",[100,109]],[[13176,13176],"mapped",[100,109,50]],[[13177,13177],"mapped",[100,109,51]],[[13178,13178],"mapped",[105,117]],[[13179,13179],"mapped",[24179,25104]],[[13180,13180],"mapped",[26157,21644]],[[13181,13181],"mapped",[22823,27491]],[[13182,13182],"mapped",[26126,27835]],[[13183,13183],"mapped",[26666,24335,20250,31038]],[[13184,13184],"mapped",[112,97]],[[13185,13185],"mapped",[110,97]],[[13186,13186],"mapped",[956,97]],[[13187,13187],"mapped",[109,97]],[[13188,13188],"mapped",[107,97]],[[13189,13189],"mapped",[107,98]],[[13190,13190],"mapped",[109,98]],[[13191,13191],"mapped",[103,98]],[[13192,13192],"mapped",[99,97,108]],[[13193,13193],"mapped",[107,99,97,108]],[[13194,13194],"mapped",[112,102]],[[13195,13195],"mapped",[110,102]],[[13196,13196],"mapped",[956,102]],[[13197,13197],"mapped",[956,103]],[[13198,13198],"mapped",[109,103]],[[13199,13199],"mapped",[107,103]],[[13200,13200],"mapped",[104,122]],[[13201,13201],"mapped",[107,104,122]],[[13202,13202],"mapped",[109,104,122]],[[13203,13203],"mapped",[103,104,122]],[[13204,13204],"mapped",[116,104,122]],[[13205,13205],"mapped",[956,108]],[[13206,13206],"mapped",[109,108]],[[13207,13207],"mapped",[100,108]],[[13208,13208],"mapped",[107,108]],[[13209,13209],"mapped",[102,109]],[[13210,13210],"mapped",[110,109]],[[13211,13211],"mapped",[956,109]],[[13212,13212],"mapped",[109,109]],[[13213,13213],"mapped",[99,109]],[[13214,13214],"mapped",[107,109]],[[13215,13215],"mapped",[109,109,50]],[[13216,13216],"mapped",[99,109,50]],[[13217,13217],"mapped",[109,50]],[[13218,13218],"mapped",[107,109,50]],[[13219,13219],"mapped",[109,109,51]],[[13220,13220],"mapped",[99,109,51]],[[13221,13221],"mapped",[109,51]],[[13222,13222],"mapped",[107,109,51]],[[13223,13223],"mapped",[109,8725,115]],[[13224,13224],"mapped",[109,8725,115,50]],[[13225,13225],"mapped",[112,97]],[[13226,13226],"mapped",[107,112,97]],[[13227,13227],"mapped",[109,112,97]],[[13228,13228],"mapped",[103,112,97]],[[13229,13229],"mapped",[114,97,100]],[[13230,13230],"mapped",[114,97,100,8725,115]],[[13231,13231],"mapped",[114,97,100,8725,115,50]],[[13232,13232],"mapped",[112,115]],[[13233,13233],"mapped",[110,115]],[[13234,13234],"mapped",[956,115]],[[13235,13235],"mapped",[109,115]],[[13236,13236],"mapped",[112,118]],[[13237,13237],"mapped",[110,118]],[[13238,13238],"mapped",[956,118]],[[13239,13239],"mapped",[109,118]],[[13240,13240],"mapped",[107,118]],[[13241,13241],"mapped",[109,118]],[[13242,13242],"mapped",[112,119]],[[13243,13243],"mapped",[110,119]],[[13244,13244],"mapped",[956,119]],[[13245,13245],"mapped",[109,119]],[[13246,13246],"mapped",[107,119]],[[13247,13247],"mapped",[109,119]],[[13248,13248],"mapped",[107,969]],[[13249,13249],"mapped",[109,969]],[[13250,13250],"disallowed"],[[13251,13251],"mapped",[98,113]],[[13252,13252],"mapped",[99,99]],[[13253,13253],"mapped",[99,100]],[[13254,13254],"mapped",[99,8725,107,103]],[[13255,13255],"disallowed"],[[13256,13256],"mapped",[100,98]],[[13257,13257],"mapped",[103,121]],[[13258,13258],"mapped",[104,97]],[[13259,13259],"mapped",[104,112]],[[13260,13260],"mapped",[105,110]],[[13261,13261],"mapped",[107,107]],[[13262,13262],"mapped",[107,109]],[[13263,13263],"mapped",[107,116]],[[13264,13264],"mapped",[108,109]],[[13265,13265],"mapped",[108,110]],[[13266,13266],"mapped",[108,111,103]],[[13267,13267],"mapped",[108,120]],[[13268,13268],"mapped",[109,98]],[[13269,13269],"mapped",[109,105,108]],[[13270,13270],"mapped",[109,111,108]],[[13271,13271],"mapped",[112,104]],[[13272,13272],"disallowed"],[[13273,13273],"mapped",[112,112,109]],[[13274,13274],"mapped",[112,114]],[[13275,13275],"mapped",[115,114]],[[13276,13276],"mapped",[115,118]],[[13277,13277],"mapped",[119,98]],[[13278,13278],"mapped",[118,8725,109]],[[13279,13279],"mapped",[97,8725,109]],[[13280,13280],"mapped",[49,26085]],[[13281,13281],"mapped",[50,26085]],[[13282,13282],"mapped",[51,26085]],[[13283,13283],"mapped",[52,26085]],[[13284,13284],"mapped",[53,26085]],[[13285,13285],"mapped",[54,26085]],[[13286,13286],"mapped",[55,26085]],[[13287,13287],"mapped",[56,26085]],[[13288,13288],"mapped",[57,26085]],[[13289,13289],"mapped",[49,48,26085]],[[13290,13290],"mapped",[49,49,26085]],[[13291,13291],"mapped",[49,50,26085]],[[13292,13292],"mapped",[49,51,26085]],[[13293,13293],"mapped",[49,52,26085]],[[13294,13294],"mapped",[49,53,26085]],[[13295,13295],"mapped",[49,54,26085]],[[13296,13296],"mapped",[49,55,26085]],[[13297,13297],"mapped",[49,56,26085]],[[13298,13298],"mapped",[49,57,26085]],[[13299,13299],"mapped",[50,48,26085]],[[13300,13300],"mapped",[50,49,26085]],[[13301,13301],"mapped",[50,50,26085]],[[13302,13302],"mapped",[50,51,26085]],[[13303,13303],"mapped",[50,52,26085]],[[13304,13304],"mapped",[50,53,26085]],[[13305,13305],"mapped",[50,54,26085]],[[13306,13306],"mapped",[50,55,26085]],[[13307,13307],"mapped",[50,56,26085]],[[13308,13308],"mapped",[50,57,26085]],[[13309,13309],"mapped",[51,48,26085]],[[13310,13310],"mapped",[51,49,26085]],[[13311,13311],"mapped",[103,97,108]],[[13312,19893],"valid"],[[19894,19903],"disallowed"],[[19904,19967],"valid",[],"NV8"],[[19968,40869],"valid"],[[40870,40891],"valid"],[[40892,40899],"valid"],[[40900,40907],"valid"],[[40908,40908],"valid"],[[40909,40917],"valid"],[[40918,40959],"disallowed"],[[40960,42124],"valid"],[[42125,42127],"disallowed"],[[42128,42145],"valid",[],"NV8"],[[42146,42147],"valid",[],"NV8"],[[42148,42163],"valid",[],"NV8"],[[42164,42164],"valid",[],"NV8"],[[42165,42176],"valid",[],"NV8"],[[42177,42177],"valid",[],"NV8"],[[42178,42180],"valid",[],"NV8"],[[42181,42181],"valid",[],"NV8"],[[42182,42182],"valid",[],"NV8"],[[42183,42191],"disallowed"],[[42192,42237],"valid"],[[42238,42239],"valid",[],"NV8"],[[42240,42508],"valid"],[[42509,42511],"valid",[],"NV8"],[[42512,42539],"valid"],[[42540,42559],"disallowed"],[[42560,42560],"mapped",[42561]],[[42561,42561],"valid"],[[42562,42562],"mapped",[42563]],[[42563,42563],"valid"],[[42564,42564],"mapped",[42565]],[[42565,42565],"valid"],[[42566,42566],"mapped",[42567]],[[42567,42567],"valid"],[[42568,42568],"mapped",[42569]],[[42569,42569],"valid"],[[42570,42570],"mapped",[42571]],[[42571,42571],"valid"],[[42572,42572],"mapped",[42573]],[[42573,42573],"valid"],[[42574,42574],"mapped",[42575]],[[42575,42575],"valid"],[[42576,42576],"mapped",[42577]],[[42577,42577],"valid"],[[42578,42578],"mapped",[42579]],[[42579,42579],"valid"],[[42580,42580],"mapped",[42581]],[[42581,42581],"valid"],[[42582,42582],"mapped",[42583]],[[42583,42583],"valid"],[[42584,42584],"mapped",[42585]],[[42585,42585],"valid"],[[42586,42586],"mapped",[42587]],[[42587,42587],"valid"],[[42588,42588],"mapped",[42589]],[[42589,42589],"valid"],[[42590,42590],"mapped",[42591]],[[42591,42591],"valid"],[[42592,42592],"mapped",[42593]],[[42593,42593],"valid"],[[42594,42594],"mapped",[42595]],[[42595,42595],"valid"],[[42596,42596],"mapped",[42597]],[[42597,42597],"valid"],[[42598,42598],"mapped",[42599]],[[42599,42599],"valid"],[[42600,42600],"mapped",[42601]],[[42601,42601],"valid"],[[42602,42602],"mapped",[42603]],[[42603,42603],"valid"],[[42604,42604],"mapped",[42605]],[[42605,42607],"valid"],[[42608,42611],"valid",[],"NV8"],[[42612,42619],"valid"],[[42620,42621],"valid"],[[42622,42622],"valid",[],"NV8"],[[42623,42623],"valid"],[[42624,42624],"mapped",[42625]],[[42625,42625],"valid"],[[42626,42626],"mapped",[42627]],[[42627,42627],"valid"],[[42628,42628],"mapped",[42629]],[[42629,42629],"valid"],[[42630,42630],"mapped",[42631]],[[42631,42631],"valid"],[[42632,42632],"mapped",[42633]],[[42633,42633],"valid"],[[42634,42634],"mapped",[42635]],[[42635,42635],"valid"],[[42636,42636],"mapped",[42637]],[[42637,42637],"valid"],[[42638,42638],"mapped",[42639]],[[42639,42639],"valid"],[[42640,42640],"mapped",[42641]],[[42641,42641],"valid"],[[42642,42642],"mapped",[42643]],[[42643,42643],"valid"],[[42644,42644],"mapped",[42645]],[[42645,42645],"valid"],[[42646,42646],"mapped",[42647]],[[42647,42647],"valid"],[[42648,42648],"mapped",[42649]],[[42649,42649],"valid"],[[42650,42650],"mapped",[42651]],[[42651,42651],"valid"],[[42652,42652],"mapped",[1098]],[[42653,42653],"mapped",[1100]],[[42654,42654],"valid"],[[42655,42655],"valid"],[[42656,42725],"valid"],[[42726,42735],"valid",[],"NV8"],[[42736,42737],"valid"],[[42738,42743],"valid",[],"NV8"],[[42744,42751],"disallowed"],[[42752,42774],"valid",[],"NV8"],[[42775,42778],"valid"],[[42779,42783],"valid"],[[42784,42785],"valid",[],"NV8"],[[42786,42786],"mapped",[42787]],[[42787,42787],"valid"],[[42788,42788],"mapped",[42789]],[[42789,42789],"valid"],[[42790,42790],"mapped",[42791]],[[42791,42791],"valid"],[[42792,42792],"mapped",[42793]],[[42793,42793],"valid"],[[42794,42794],"mapped",[42795]],[[42795,42795],"valid"],[[42796,42796],"mapped",[42797]],[[42797,42797],"valid"],[[42798,42798],"mapped",[42799]],[[42799,42801],"valid"],[[42802,42802],"mapped",[42803]],[[42803,42803],"valid"],[[42804,42804],"mapped",[42805]],[[42805,42805],"valid"],[[42806,42806],"mapped",[42807]],[[42807,42807],"valid"],[[42808,42808],"mapped",[42809]],[[42809,42809],"valid"],[[42810,42810],"mapped",[42811]],[[42811,42811],"valid"],[[42812,42812],"mapped",[42813]],[[42813,42813],"valid"],[[42814,42814],"mapped",[42815]],[[42815,42815],"valid"],[[42816,42816],"mapped",[42817]],[[42817,42817],"valid"],[[42818,42818],"mapped",[42819]],[[42819,42819],"valid"],[[42820,42820],"mapped",[42821]],[[42821,42821],"valid"],[[42822,42822],"mapped",[42823]],[[42823,42823],"valid"],[[42824,42824],"mapped",[42825]],[[42825,42825],"valid"],[[42826,42826],"mapped",[42827]],[[42827,42827],"valid"],[[42828,42828],"mapped",[42829]],[[42829,42829],"valid"],[[42830,42830],"mapped",[42831]],[[42831,42831],"valid"],[[42832,42832],"mapped",[42833]],[[42833,42833],"valid"],[[42834,42834],"mapped",[42835]],[[42835,42835],"valid"],[[42836,42836],"mapped",[42837]],[[42837,42837],"valid"],[[42838,42838],"mapped",[42839]],[[42839,42839],"valid"],[[42840,42840],"mapped",[42841]],[[42841,42841],"valid"],[[42842,42842],"mapped",[42843]],[[42843,42843],"valid"],[[42844,42844],"mapped",[42845]],[[42845,42845],"valid"],[[42846,42846],"mapped",[42847]],[[42847,42847],"valid"],[[42848,42848],"mapped",[42849]],[[42849,42849],"valid"],[[42850,42850],"mapped",[42851]],[[42851,42851],"valid"],[[42852,42852],"mapped",[42853]],[[42853,42853],"valid"],[[42854,42854],"mapped",[42855]],[[42855,42855],"valid"],[[42856,42856],"mapped",[42857]],[[42857,42857],"valid"],[[42858,42858],"mapped",[42859]],[[42859,42859],"valid"],[[42860,42860],"mapped",[42861]],[[42861,42861],"valid"],[[42862,42862],"mapped",[42863]],[[42863,42863],"valid"],[[42864,42864],"mapped",[42863]],[[42865,42872],"valid"],[[42873,42873],"mapped",[42874]],[[42874,42874],"valid"],[[42875,42875],"mapped",[42876]],[[42876,42876],"valid"],[[42877,42877],"mapped",[7545]],[[42878,42878],"mapped",[42879]],[[42879,42879],"valid"],[[42880,42880],"mapped",[42881]],[[42881,42881],"valid"],[[42882,42882],"mapped",[42883]],[[42883,42883],"valid"],[[42884,42884],"mapped",[42885]],[[42885,42885],"valid"],[[42886,42886],"mapped",[42887]],[[42887,42888],"valid"],[[42889,42890],"valid",[],"NV8"],[[42891,42891],"mapped",[42892]],[[42892,42892],"valid"],[[42893,42893],"mapped",[613]],[[42894,42894],"valid"],[[42895,42895],"valid"],[[42896,42896],"mapped",[42897]],[[42897,42897],"valid"],[[42898,42898],"mapped",[42899]],[[42899,42899],"valid"],[[42900,42901],"valid"],[[42902,42902],"mapped",[42903]],[[42903,42903],"valid"],[[42904,42904],"mapped",[42905]],[[42905,42905],"valid"],[[42906,42906],"mapped",[42907]],[[42907,42907],"valid"],[[42908,42908],"mapped",[42909]],[[42909,42909],"valid"],[[42910,42910],"mapped",[42911]],[[42911,42911],"valid"],[[42912,42912],"mapped",[42913]],[[42913,42913],"valid"],[[42914,42914],"mapped",[42915]],[[42915,42915],"valid"],[[42916,42916],"mapped",[42917]],[[42917,42917],"valid"],[[42918,42918],"mapped",[42919]],[[42919,42919],"valid"],[[42920,42920],"mapped",[42921]],[[42921,42921],"valid"],[[42922,42922],"mapped",[614]],[[42923,42923],"mapped",[604]],[[42924,42924],"mapped",[609]],[[42925,42925],"mapped",[620]],[[42926,42927],"disallowed"],[[42928,42928],"mapped",[670]],[[42929,42929],"mapped",[647]],[[42930,42930],"mapped",[669]],[[42931,42931],"mapped",[43859]],[[42932,42932],"mapped",[42933]],[[42933,42933],"valid"],[[42934,42934],"mapped",[42935]],[[42935,42935],"valid"],[[42936,42998],"disallowed"],[[42999,42999],"valid"],[[43000,43000],"mapped",[295]],[[43001,43001],"mapped",[339]],[[43002,43002],"valid"],[[43003,43007],"valid"],[[43008,43047],"valid"],[[43048,43051],"valid",[],"NV8"],[[43052,43055],"disallowed"],[[43056,43065],"valid",[],"NV8"],[[43066,43071],"disallowed"],[[43072,43123],"valid"],[[43124,43127],"valid",[],"NV8"],[[43128,43135],"disallowed"],[[43136,43204],"valid"],[[43205,43213],"disallowed"],[[43214,43215],"valid",[],"NV8"],[[43216,43225],"valid"],[[43226,43231],"disallowed"],[[43232,43255],"valid"],[[43256,43258],"valid",[],"NV8"],[[43259,43259],"valid"],[[43260,43260],"valid",[],"NV8"],[[43261,43261],"valid"],[[43262,43263],"disallowed"],[[43264,43309],"valid"],[[43310,43311],"valid",[],"NV8"],[[43312,43347],"valid"],[[43348,43358],"disallowed"],[[43359,43359],"valid",[],"NV8"],[[43360,43388],"valid",[],"NV8"],[[43389,43391],"disallowed"],[[43392,43456],"valid"],[[43457,43469],"valid",[],"NV8"],[[43470,43470],"disallowed"],[[43471,43481],"valid"],[[43482,43485],"disallowed"],[[43486,43487],"valid",[],"NV8"],[[43488,43518],"valid"],[[43519,43519],"disallowed"],[[43520,43574],"valid"],[[43575,43583],"disallowed"],[[43584,43597],"valid"],[[43598,43599],"disallowed"],[[43600,43609],"valid"],[[43610,43611],"disallowed"],[[43612,43615],"valid",[],"NV8"],[[43616,43638],"valid"],[[43639,43641],"valid",[],"NV8"],[[43642,43643],"valid"],[[43644,43647],"valid"],[[43648,43714],"valid"],[[43715,43738],"disallowed"],[[43739,43741],"valid"],[[43742,43743],"valid",[],"NV8"],[[43744,43759],"valid"],[[43760,43761],"valid",[],"NV8"],[[43762,43766],"valid"],[[43767,43776],"disallowed"],[[43777,43782],"valid"],[[43783,43784],"disallowed"],[[43785,43790],"valid"],[[43791,43792],"disallowed"],[[43793,43798],"valid"],[[43799,43807],"disallowed"],[[43808,43814],"valid"],[[43815,43815],"disallowed"],[[43816,43822],"valid"],[[43823,43823],"disallowed"],[[43824,43866],"valid"],[[43867,43867],"valid",[],"NV8"],[[43868,43868],"mapped",[42791]],[[43869,43869],"mapped",[43831]],[[43870,43870],"mapped",[619]],[[43871,43871],"mapped",[43858]],[[43872,43875],"valid"],[[43876,43877],"valid"],[[43878,43887],"disallowed"],[[43888,43888],"mapped",[5024]],[[43889,43889],"mapped",[5025]],[[43890,43890],"mapped",[5026]],[[43891,43891],"mapped",[5027]],[[43892,43892],"mapped",[5028]],[[43893,43893],"mapped",[5029]],[[43894,43894],"mapped",[5030]],[[43895,43895],"mapped",[5031]],[[43896,43896],"mapped",[5032]],[[43897,43897],"mapped",[5033]],[[43898,43898],"mapped",[5034]],[[43899,43899],"mapped",[5035]],[[43900,43900],"mapped",[5036]],[[43901,43901],"mapped",[5037]],[[43902,43902],"mapped",[5038]],[[43903,43903],"mapped",[5039]],[[43904,43904],"mapped",[5040]],[[43905,43905],"mapped",[5041]],[[43906,43906],"mapped",[5042]],[[43907,43907],"mapped",[5043]],[[43908,43908],"mapped",[5044]],[[43909,43909],"mapped",[5045]],[[43910,43910],"mapped",[5046]],[[43911,43911],"mapped",[5047]],[[43912,43912],"mapped",[5048]],[[43913,43913],"mapped",[5049]],[[43914,43914],"mapped",[5050]],[[43915,43915],"mapped",[5051]],[[43916,43916],"mapped",[5052]],[[43917,43917],"mapped",[5053]],[[43918,43918],"mapped",[5054]],[[43919,43919],"mapped",[5055]],[[43920,43920],"mapped",[5056]],[[43921,43921],"mapped",[5057]],[[43922,43922],"mapped",[5058]],[[43923,43923],"mapped",[5059]],[[43924,43924],"mapped",[5060]],[[43925,43925],"mapped",[5061]],[[43926,43926],"mapped",[5062]],[[43927,43927],"mapped",[5063]],[[43928,43928],"mapped",[5064]],[[43929,43929],"mapped",[5065]],[[43930,43930],"mapped",[5066]],[[43931,43931],"mapped",[5067]],[[43932,43932],"mapped",[5068]],[[43933,43933],"mapped",[5069]],[[43934,43934],"mapped",[5070]],[[43935,43935],"mapped",[5071]],[[43936,43936],"mapped",[5072]],[[43937,43937],"mapped",[5073]],[[43938,43938],"mapped",[5074]],[[43939,43939],"mapped",[5075]],[[43940,43940],"mapped",[5076]],[[43941,43941],"mapped",[5077]],[[43942,43942],"mapped",[5078]],[[43943,43943],"mapped",[5079]],[[43944,43944],"mapped",[5080]],[[43945,43945],"mapped",[5081]],[[43946,43946],"mapped",[5082]],[[43947,43947],"mapped",[5083]],[[43948,43948],"mapped",[5084]],[[43949,43949],"mapped",[5085]],[[43950,43950],"mapped",[5086]],[[43951,43951],"mapped",[5087]],[[43952,43952],"mapped",[5088]],[[43953,43953],"mapped",[5089]],[[43954,43954],"mapped",[5090]],[[43955,43955],"mapped",[5091]],[[43956,43956],"mapped",[5092]],[[43957,43957],"mapped",[5093]],[[43958,43958],"mapped",[5094]],[[43959,43959],"mapped",[5095]],[[43960,43960],"mapped",[5096]],[[43961,43961],"mapped",[5097]],[[43962,43962],"mapped",[5098]],[[43963,43963],"mapped",[5099]],[[43964,43964],"mapped",[5100]],[[43965,43965],"mapped",[5101]],[[43966,43966],"mapped",[5102]],[[43967,43967],"mapped",[5103]],[[43968,44010],"valid"],[[44011,44011],"valid",[],"NV8"],[[44012,44013],"valid"],[[44014,44015],"disallowed"],[[44016,44025],"valid"],[[44026,44031],"disallowed"],[[44032,55203],"valid"],[[55204,55215],"disallowed"],[[55216,55238],"valid",[],"NV8"],[[55239,55242],"disallowed"],[[55243,55291],"valid",[],"NV8"],[[55292,55295],"disallowed"],[[55296,57343],"disallowed"],[[57344,63743],"disallowed"],[[63744,63744],"mapped",[35912]],[[63745,63745],"mapped",[26356]],[[63746,63746],"mapped",[36554]],[[63747,63747],"mapped",[36040]],[[63748,63748],"mapped",[28369]],[[63749,63749],"mapped",[20018]],[[63750,63750],"mapped",[21477]],[[63751,63752],"mapped",[40860]],[[63753,63753],"mapped",[22865]],[[63754,63754],"mapped",[37329]],[[63755,63755],"mapped",[21895]],[[63756,63756],"mapped",[22856]],[[63757,63757],"mapped",[25078]],[[63758,63758],"mapped",[30313]],[[63759,63759],"mapped",[32645]],[[63760,63760],"mapped",[34367]],[[63761,63761],"mapped",[34746]],[[63762,63762],"mapped",[35064]],[[63763,63763],"mapped",[37007]],[[63764,63764],"mapped",[27138]],[[63765,63765],"mapped",[27931]],[[63766,63766],"mapped",[28889]],[[63767,63767],"mapped",[29662]],[[63768,63768],"mapped",[33853]],[[63769,63769],"mapped",[37226]],[[63770,63770],"mapped",[39409]],[[63771,63771],"mapped",[20098]],[[63772,63772],"mapped",[21365]],[[63773,63773],"mapped",[27396]],[[63774,63774],"mapped",[29211]],[[63775,63775],"mapped",[34349]],[[63776,63776],"mapped",[40478]],[[63777,63777],"mapped",[23888]],[[63778,63778],"mapped",[28651]],[[63779,63779],"mapped",[34253]],[[63780,63780],"mapped",[35172]],[[63781,63781],"mapped",[25289]],[[63782,63782],"mapped",[33240]],[[63783,63783],"mapped",[34847]],[[63784,63784],"mapped",[24266]],[[63785,63785],"mapped",[26391]],[[63786,63786],"mapped",[28010]],[[63787,63787],"mapped",[29436]],[[63788,63788],"mapped",[37070]],[[63789,63789],"mapped",[20358]],[[63790,63790],"mapped",[20919]],[[63791,63791],"mapped",[21214]],[[63792,63792],"mapped",[25796]],[[63793,63793],"mapped",[27347]],[[63794,63794],"mapped",[29200]],[[63795,63795],"mapped",[30439]],[[63796,63796],"mapped",[32769]],[[63797,63797],"mapped",[34310]],[[63798,63798],"mapped",[34396]],[[63799,63799],"mapped",[36335]],[[63800,63800],"mapped",[38706]],[[63801,63801],"mapped",[39791]],[[63802,63802],"mapped",[40442]],[[63803,63803],"mapped",[30860]],[[63804,63804],"mapped",[31103]],[[63805,63805],"mapped",[32160]],[[63806,63806],"mapped",[33737]],[[63807,63807],"mapped",[37636]],[[63808,63808],"mapped",[40575]],[[63809,63809],"mapped",[35542]],[[63810,63810],"mapped",[22751]],[[63811,63811],"mapped",[24324]],[[63812,63812],"mapped",[31840]],[[63813,63813],"mapped",[32894]],[[63814,63814],"mapped",[29282]],[[63815,63815],"mapped",[30922]],[[63816,63816],"mapped",[36034]],[[63817,63817],"mapped",[38647]],[[63818,63818],"mapped",[22744]],[[63819,63819],"mapped",[23650]],[[63820,63820],"mapped",[27155]],[[63821,63821],"mapped",[28122]],[[63822,63822],"mapped",[28431]],[[63823,63823],"mapped",[32047]],[[63824,63824],"mapped",[32311]],[[63825,63825],"mapped",[38475]],[[63826,63826],"mapped",[21202]],[[63827,63827],"mapped",[32907]],[[63828,63828],"mapped",[20956]],[[63829,63829],"mapped",[20940]],[[63830,63830],"mapped",[31260]],[[63831,63831],"mapped",[32190]],[[63832,63832],"mapped",[33777]],[[63833,63833],"mapped",[38517]],[[63834,63834],"mapped",[35712]],[[63835,63835],"mapped",[25295]],[[63836,63836],"mapped",[27138]],[[63837,63837],"mapped",[35582]],[[63838,63838],"mapped",[20025]],[[63839,63839],"mapped",[23527]],[[63840,63840],"mapped",[24594]],[[63841,63841],"mapped",[29575]],[[63842,63842],"mapped",[30064]],[[63843,63843],"mapped",[21271]],[[63844,63844],"mapped",[30971]],[[63845,63845],"mapped",[20415]],[[63846,63846],"mapped",[24489]],[[63847,63847],"mapped",[19981]],[[63848,63848],"mapped",[27852]],[[63849,63849],"mapped",[25976]],[[63850,63850],"mapped",[32034]],[[63851,63851],"mapped",[21443]],[[63852,63852],"mapped",[22622]],[[63853,63853],"mapped",[30465]],[[63854,63854],"mapped",[33865]],[[63855,63855],"mapped",[35498]],[[63856,63856],"mapped",[27578]],[[63857,63857],"mapped",[36784]],[[63858,63858],"mapped",[27784]],[[63859,63859],"mapped",[25342]],[[63860,63860],"mapped",[33509]],[[63861,63861],"mapped",[25504]],[[63862,63862],"mapped",[30053]],[[63863,63863],"mapped",[20142]],[[63864,63864],"mapped",[20841]],[[63865,63865],"mapped",[20937]],[[63866,63866],"mapped",[26753]],[[63867,63867],"mapped",[31975]],[[63868,63868],"mapped",[33391]],[[63869,63869],"mapped",[35538]],[[63870,63870],"mapped",[37327]],[[63871,63871],"mapped",[21237]],[[63872,63872],"mapped",[21570]],[[63873,63873],"mapped",[22899]],[[63874,63874],"mapped",[24300]],[[63875,63875],"mapped",[26053]],[[63876,63876],"mapped",[28670]],[[63877,63877],"mapped",[31018]],[[63878,63878],"mapped",[38317]],[[63879,63879],"mapped",[39530]],[[63880,63880],"mapped",[40599]],[[63881,63881],"mapped",[40654]],[[63882,63882],"mapped",[21147]],[[63883,63883],"mapped",[26310]],[[63884,63884],"mapped",[27511]],[[63885,63885],"mapped",[36706]],[[63886,63886],"mapped",[24180]],[[63887,63887],"mapped",[24976]],[[63888,63888],"mapped",[25088]],[[63889,63889],"mapped",[25754]],[[63890,63890],"mapped",[28451]],[[63891,63891],"mapped",[29001]],[[63892,63892],"mapped",[29833]],[[63893,63893],"mapped",[31178]],[[63894,63894],"mapped",[32244]],[[63895,63895],"mapped",[32879]],[[63896,63896],"mapped",[36646]],[[63897,63897],"mapped",[34030]],[[63898,63898],"mapped",[36899]],[[63899,63899],"mapped",[37706]],[[63900,63900],"mapped",[21015]],[[63901,63901],"mapped",[21155]],[[63902,63902],"mapped",[21693]],[[63903,63903],"mapped",[28872]],[[63904,63904],"mapped",[35010]],[[63905,63905],"mapped",[35498]],[[63906,63906],"mapped",[24265]],[[63907,63907],"mapped",[24565]],[[63908,63908],"mapped",[25467]],[[63909,63909],"mapped",[27566]],[[63910,63910],"mapped",[31806]],[[63911,63911],"mapped",[29557]],[[63912,63912],"mapped",[20196]],[[63913,63913],"mapped",[22265]],[[63914,63914],"mapped",[23527]],[[63915,63915],"mapped",[23994]],[[63916,63916],"mapped",[24604]],[[63917,63917],"mapped",[29618]],[[63918,63918],"mapped",[29801]],[[63919,63919],"mapped",[32666]],[[63920,63920],"mapped",[32838]],[[63921,63921],"mapped",[37428]],[[63922,63922],"mapped",[38646]],[[63923,63923],"mapped",[38728]],[[63924,63924],"mapped",[38936]],[[63925,63925],"mapped",[20363]],[[63926,63926],"mapped",[31150]],[[63927,63927],"mapped",[37300]],[[63928,63928],"mapped",[38584]],[[63929,63929],"mapped",[24801]],[[63930,63930],"mapped",[20102]],[[63931,63931],"mapped",[20698]],[[63932,63932],"mapped",[23534]],[[63933,63933],"mapped",[23615]],[[63934,63934],"mapped",[26009]],[[63935,63935],"mapped",[27138]],[[63936,63936],"mapped",[29134]],[[63937,63937],"mapped",[30274]],[[63938,63938],"mapped",[34044]],[[63939,63939],"mapped",[36988]],[[63940,63940],"mapped",[40845]],[[63941,63941],"mapped",[26248]],[[63942,63942],"mapped",[38446]],[[63943,63943],"mapped",[21129]],[[63944,63944],"mapped",[26491]],[[63945,63945],"mapped",[26611]],[[63946,63946],"mapped",[27969]],[[63947,63947],"mapped",[28316]],[[63948,63948],"mapped",[29705]],[[63949,63949],"mapped",[30041]],[[63950,63950],"mapped",[30827]],[[63951,63951],"mapped",[32016]],[[63952,63952],"mapped",[39006]],[[63953,63953],"mapped",[20845]],[[63954,63954],"mapped",[25134]],[[63955,63955],"mapped",[38520]],[[63956,63956],"mapped",[20523]],[[63957,63957],"mapped",[23833]],[[63958,63958],"mapped",[28138]],[[63959,63959],"mapped",[36650]],[[63960,63960],"mapped",[24459]],[[63961,63961],"mapped",[24900]],[[63962,63962],"mapped",[26647]],[[63963,63963],"mapped",[29575]],[[63964,63964],"mapped",[38534]],[[63965,63965],"mapped",[21033]],[[63966,63966],"mapped",[21519]],[[63967,63967],"mapped",[23653]],[[63968,63968],"mapped",[26131]],[[63969,63969],"mapped",[26446]],[[63970,63970],"mapped",[26792]],[[63971,63971],"mapped",[27877]],[[63972,63972],"mapped",[29702]],[[63973,63973],"mapped",[30178]],[[63974,63974],"mapped",[32633]],[[63975,63975],"mapped",[35023]],[[63976,63976],"mapped",[35041]],[[63977,63977],"mapped",[37324]],[[63978,63978],"mapped",[38626]],[[63979,63979],"mapped",[21311]],[[63980,63980],"mapped",[28346]],[[63981,63981],"mapped",[21533]],[[63982,63982],"mapped",[29136]],[[63983,63983],"mapped",[29848]],[[63984,63984],"mapped",[34298]],[[63985,63985],"mapped",[38563]],[[63986,63986],"mapped",[40023]],[[63987,63987],"mapped",[40607]],[[63988,63988],"mapped",[26519]],[[63989,63989],"mapped",[28107]],[[63990,63990],"mapped",[33256]],[[63991,63991],"mapped",[31435]],[[63992,63992],"mapped",[31520]],[[63993,63993],"mapped",[31890]],[[63994,63994],"mapped",[29376]],[[63995,63995],"mapped",[28825]],[[63996,63996],"mapped",[35672]],[[63997,63997],"mapped",[20160]],[[63998,63998],"mapped",[33590]],[[63999,63999],"mapped",[21050]],[[64000,64000],"mapped",[20999]],[[64001,64001],"mapped",[24230]],[[64002,64002],"mapped",[25299]],[[64003,64003],"mapped",[31958]],[[64004,64004],"mapped",[23429]],[[64005,64005],"mapped",[27934]],[[64006,64006],"mapped",[26292]],[[64007,64007],"mapped",[36667]],[[64008,64008],"mapped",[34892]],[[64009,64009],"mapped",[38477]],[[64010,64010],"mapped",[35211]],[[64011,64011],"mapped",[24275]],[[64012,64012],"mapped",[20800]],[[64013,64013],"mapped",[21952]],[[64014,64015],"valid"],[[64016,64016],"mapped",[22618]],[[64017,64017],"valid"],[[64018,64018],"mapped",[26228]],[[64019,64020],"valid"],[[64021,64021],"mapped",[20958]],[[64022,64022],"mapped",[29482]],[[64023,64023],"mapped",[30410]],[[64024,64024],"mapped",[31036]],[[64025,64025],"mapped",[31070]],[[64026,64026],"mapped",[31077]],[[64027,64027],"mapped",[31119]],[[64028,64028],"mapped",[38742]],[[64029,64029],"mapped",[31934]],[[64030,64030],"mapped",[32701]],[[64031,64031],"valid"],[[64032,64032],"mapped",[34322]],[[64033,64033],"valid"],[[64034,64034],"mapped",[35576]],[[64035,64036],"valid"],[[64037,64037],"mapped",[36920]],[[64038,64038],"mapped",[37117]],[[64039,64041],"valid"],[[64042,64042],"mapped",[39151]],[[64043,64043],"mapped",[39164]],[[64044,64044],"mapped",[39208]],[[64045,64045],"mapped",[40372]],[[64046,64046],"mapped",[37086]],[[64047,64047],"mapped",[38583]],[[64048,64048],"mapped",[20398]],[[64049,64049],"mapped",[20711]],[[64050,64050],"mapped",[20813]],[[64051,64051],"mapped",[21193]],[[64052,64052],"mapped",[21220]],[[64053,64053],"mapped",[21329]],[[64054,64054],"mapped",[21917]],[[64055,64055],"mapped",[22022]],[[64056,64056],"mapped",[22120]],[[64057,64057],"mapped",[22592]],[[64058,64058],"mapped",[22696]],[[64059,64059],"mapped",[23652]],[[64060,64060],"mapped",[23662]],[[64061,64061],"mapped",[24724]],[[64062,64062],"mapped",[24936]],[[64063,64063],"mapped",[24974]],[[64064,64064],"mapped",[25074]],[[64065,64065],"mapped",[25935]],[[64066,64066],"mapped",[26082]],[[64067,64067],"mapped",[26257]],[[64068,64068],"mapped",[26757]],[[64069,64069],"mapped",[28023]],[[64070,64070],"mapped",[28186]],[[64071,64071],"mapped",[28450]],[[64072,64072],"mapped",[29038]],[[64073,64073],"mapped",[29227]],[[64074,64074],"mapped",[29730]],[[64075,64075],"mapped",[30865]],[[64076,64076],"mapped",[31038]],[[64077,64077],"mapped",[31049]],[[64078,64078],"mapped",[31048]],[[64079,64079],"mapped",[31056]],[[64080,64080],"mapped",[31062]],[[64081,64081],"mapped",[31069]],[[64082,64082],"mapped",[31117]],[[64083,64083],"mapped",[31118]],[[64084,64084],"mapped",[31296]],[[64085,64085],"mapped",[31361]],[[64086,64086],"mapped",[31680]],[[64087,64087],"mapped",[32244]],[[64088,64088],"mapped",[32265]],[[64089,64089],"mapped",[32321]],[[64090,64090],"mapped",[32626]],[[64091,64091],"mapped",[32773]],[[64092,64092],"mapped",[33261]],[[64093,64094],"mapped",[33401]],[[64095,64095],"mapped",[33879]],[[64096,64096],"mapped",[35088]],[[64097,64097],"mapped",[35222]],[[64098,64098],"mapped",[35585]],[[64099,64099],"mapped",[35641]],[[64100,64100],"mapped",[36051]],[[64101,64101],"mapped",[36104]],[[64102,64102],"mapped",[36790]],[[64103,64103],"mapped",[36920]],[[64104,64104],"mapped",[38627]],[[64105,64105],"mapped",[38911]],[[64106,64106],"mapped",[38971]],[[64107,64107],"mapped",[24693]],[[64108,64108],"mapped",[148206]],[[64109,64109],"mapped",[33304]],[[64110,64111],"disallowed"],[[64112,64112],"mapped",[20006]],[[64113,64113],"mapped",[20917]],[[64114,64114],"mapped",[20840]],[[64115,64115],"mapped",[20352]],[[64116,64116],"mapped",[20805]],[[64117,64117],"mapped",[20864]],[[64118,64118],"mapped",[21191]],[[64119,64119],"mapped",[21242]],[[64120,64120],"mapped",[21917]],[[64121,64121],"mapped",[21845]],[[64122,64122],"mapped",[21913]],[[64123,64123],"mapped",[21986]],[[64124,64124],"mapped",[22618]],[[64125,64125],"mapped",[22707]],[[64126,64126],"mapped",[22852]],[[64127,64127],"mapped",[22868]],[[64128,64128],"mapped",[23138]],[[64129,64129],"mapped",[23336]],[[64130,64130],"mapped",[24274]],[[64131,64131],"mapped",[24281]],[[64132,64132],"mapped",[24425]],[[64133,64133],"mapped",[24493]],[[64134,64134],"mapped",[24792]],[[64135,64135],"mapped",[24910]],[[64136,64136],"mapped",[24840]],[[64137,64137],"mapped",[24974]],[[64138,64138],"mapped",[24928]],[[64139,64139],"mapped",[25074]],[[64140,64140],"mapped",[25140]],[[64141,64141],"mapped",[25540]],[[64142,64142],"mapped",[25628]],[[64143,64143],"mapped",[25682]],[[64144,64144],"mapped",[25942]],[[64145,64145],"mapped",[26228]],[[64146,64146],"mapped",[26391]],[[64147,64147],"mapped",[26395]],[[64148,64148],"mapped",[26454]],[[64149,64149],"mapped",[27513]],[[64150,64150],"mapped",[27578]],[[64151,64151],"mapped",[27969]],[[64152,64152],"mapped",[28379]],[[64153,64153],"mapped",[28363]],[[64154,64154],"mapped",[28450]],[[64155,64155],"mapped",[28702]],[[64156,64156],"mapped",[29038]],[[64157,64157],"mapped",[30631]],[[64158,64158],"mapped",[29237]],[[64159,64159],"mapped",[29359]],[[64160,64160],"mapped",[29482]],[[64161,64161],"mapped",[29809]],[[64162,64162],"mapped",[29958]],[[64163,64163],"mapped",[30011]],[[64164,64164],"mapped",[30237]],[[64165,64165],"mapped",[30239]],[[64166,64166],"mapped",[30410]],[[64167,64167],"mapped",[30427]],[[64168,64168],"mapped",[30452]],[[64169,64169],"mapped",[30538]],[[64170,64170],"mapped",[30528]],[[64171,64171],"mapped",[30924]],[[64172,64172],"mapped",[31409]],[[64173,64173],"mapped",[31680]],[[64174,64174],"mapped",[31867]],[[64175,64175],"mapped",[32091]],[[64176,64176],"mapped",[32244]],[[64177,64177],"mapped",[32574]],[[64178,64178],"mapped",[32773]],[[64179,64179],"mapped",[33618]],[[64180,64180],"mapped",[33775]],[[64181,64181],"mapped",[34681]],[[64182,64182],"mapped",[35137]],[[64183,64183],"mapped",[35206]],[[64184,64184],"mapped",[35222]],[[64185,64185],"mapped",[35519]],[[64186,64186],"mapped",[35576]],[[64187,64187],"mapped",[35531]],[[64188,64188],"mapped",[35585]],[[64189,64189],"mapped",[35582]],[[64190,64190],"mapped",[35565]],[[64191,64191],"mapped",[35641]],[[64192,64192],"mapped",[35722]],[[64193,64193],"mapped",[36104]],[[64194,64194],"mapped",[36664]],[[64195,64195],"mapped",[36978]],[[64196,64196],"mapped",[37273]],[[64197,64197],"mapped",[37494]],[[64198,64198],"mapped",[38524]],[[64199,64199],"mapped",[38627]],[[64200,64200],"mapped",[38742]],[[64201,64201],"mapped",[38875]],[[64202,64202],"mapped",[38911]],[[64203,64203],"mapped",[38923]],[[64204,64204],"mapped",[38971]],[[64205,64205],"mapped",[39698]],[[64206,64206],"mapped",[40860]],[[64207,64207],"mapped",[141386]],[[64208,64208],"mapped",[141380]],[[64209,64209],"mapped",[144341]],[[64210,64210],"mapped",[15261]],[[64211,64211],"mapped",[16408]],[[64212,64212],"mapped",[16441]],[[64213,64213],"mapped",[152137]],[[64214,64214],"mapped",[154832]],[[64215,64215],"mapped",[163539]],[[64216,64216],"mapped",[40771]],[[64217,64217],"mapped",[40846]],[[64218,64255],"disallowed"],[[64256,64256],"mapped",[102,102]],[[64257,64257],"mapped",[102,105]],[[64258,64258],"mapped",[102,108]],[[64259,64259],"mapped",[102,102,105]],[[64260,64260],"mapped",[102,102,108]],[[64261,64262],"mapped",[115,116]],[[64263,64274],"disallowed"],[[64275,64275],"mapped",[1396,1398]],[[64276,64276],"mapped",[1396,1381]],[[64277,64277],"mapped",[1396,1387]],[[64278,64278],"mapped",[1406,1398]],[[64279,64279],"mapped",[1396,1389]],[[64280,64284],"disallowed"],[[64285,64285],"mapped",[1497,1460]],[[64286,64286],"valid"],[[64287,64287],"mapped",[1522,1463]],[[64288,64288],"mapped",[1506]],[[64289,64289],"mapped",[1488]],[[64290,64290],"mapped",[1491]],[[64291,64291],"mapped",[1492]],[[64292,64292],"mapped",[1499]],[[64293,64293],"mapped",[1500]],[[64294,64294],"mapped",[1501]],[[64295,64295],"mapped",[1512]],[[64296,64296],"mapped",[1514]],[[64297,64297],"disallowed_STD3_mapped",[43]],[[64298,64298],"mapped",[1513,1473]],[[64299,64299],"mapped",[1513,1474]],[[64300,64300],"mapped",[1513,1468,1473]],[[64301,64301],"mapped",[1513,1468,1474]],[[64302,64302],"mapped",[1488,1463]],[[64303,64303],"mapped",[1488,1464]],[[64304,64304],"mapped",[1488,1468]],[[64305,64305],"mapped",[1489,1468]],[[64306,64306],"mapped",[1490,1468]],[[64307,64307],"mapped",[1491,1468]],[[64308,64308],"mapped",[1492,1468]],[[64309,64309],"mapped",[1493,1468]],[[64310,64310],"mapped",[1494,1468]],[[64311,64311],"disallowed"],[[64312,64312],"mapped",[1496,1468]],[[64313,64313],"mapped",[1497,1468]],[[64314,64314],"mapped",[1498,1468]],[[64315,64315],"mapped",[1499,1468]],[[64316,64316],"mapped",[1500,1468]],[[64317,64317],"disallowed"],[[64318,64318],"mapped",[1502,1468]],[[64319,64319],"disallowed"],[[64320,64320],"mapped",[1504,1468]],[[64321,64321],"mapped",[1505,1468]],[[64322,64322],"disallowed"],[[64323,64323],"mapped",[1507,1468]],[[64324,64324],"mapped",[1508,1468]],[[64325,64325],"disallowed"],[[64326,64326],"mapped",[1510,1468]],[[64327,64327],"mapped",[1511,1468]],[[64328,64328],"mapped",[1512,1468]],[[64329,64329],"mapped",[1513,1468]],[[64330,64330],"mapped",[1514,1468]],[[64331,64331],"mapped",[1493,1465]],[[64332,64332],"mapped",[1489,1471]],[[64333,64333],"mapped",[1499,1471]],[[64334,64334],"mapped",[1508,1471]],[[64335,64335],"mapped",[1488,1500]],[[64336,64337],"mapped",[1649]],[[64338,64341],"mapped",[1659]],[[64342,64345],"mapped",[1662]],[[64346,64349],"mapped",[1664]],[[64350,64353],"mapped",[1658]],[[64354,64357],"mapped",[1663]],[[64358,64361],"mapped",[1657]],[[64362,64365],"mapped",[1700]],[[64366,64369],"mapped",[1702]],[[64370,64373],"mapped",[1668]],[[64374,64377],"mapped",[1667]],[[64378,64381],"mapped",[1670]],[[64382,64385],"mapped",[1671]],[[64386,64387],"mapped",[1677]],[[64388,64389],"mapped",[1676]],[[64390,64391],"mapped",[1678]],[[64392,64393],"mapped",[1672]],[[64394,64395],"mapped",[1688]],[[64396,64397],"mapped",[1681]],[[64398,64401],"mapped",[1705]],[[64402,64405],"mapped",[1711]],[[64406,64409],"mapped",[1715]],[[64410,64413],"mapped",[1713]],[[64414,64415],"mapped",[1722]],[[64416,64419],"mapped",[1723]],[[64420,64421],"mapped",[1728]],[[64422,64425],"mapped",[1729]],[[64426,64429],"mapped",[1726]],[[64430,64431],"mapped",[1746]],[[64432,64433],"mapped",[1747]],[[64434,64449],"valid",[],"NV8"],[[64450,64466],"disallowed"],[[64467,64470],"mapped",[1709]],[[64471,64472],"mapped",[1735]],[[64473,64474],"mapped",[1734]],[[64475,64476],"mapped",[1736]],[[64477,64477],"mapped",[1735,1652]],[[64478,64479],"mapped",[1739]],[[64480,64481],"mapped",[1733]],[[64482,64483],"mapped",[1737]],[[64484,64487],"mapped",[1744]],[[64488,64489],"mapped",[1609]],[[64490,64491],"mapped",[1574,1575]],[[64492,64493],"mapped",[1574,1749]],[[64494,64495],"mapped",[1574,1608]],[[64496,64497],"mapped",[1574,1735]],[[64498,64499],"mapped",[1574,1734]],[[64500,64501],"mapped",[1574,1736]],[[64502,64504],"mapped",[1574,1744]],[[64505,64507],"mapped",[1574,1609]],[[64508,64511],"mapped",[1740]],[[64512,64512],"mapped",[1574,1580]],[[64513,64513],"mapped",[1574,1581]],[[64514,64514],"mapped",[1574,1605]],[[64515,64515],"mapped",[1574,1609]],[[64516,64516],"mapped",[1574,1610]],[[64517,64517],"mapped",[1576,1580]],[[64518,64518],"mapped",[1576,1581]],[[64519,64519],"mapped",[1576,1582]],[[64520,64520],"mapped",[1576,1605]],[[64521,64521],"mapped",[1576,1609]],[[64522,64522],"mapped",[1576,1610]],[[64523,64523],"mapped",[1578,1580]],[[64524,64524],"mapped",[1578,1581]],[[64525,64525],"mapped",[1578,1582]],[[64526,64526],"mapped",[1578,1605]],[[64527,64527],"mapped",[1578,1609]],[[64528,64528],"mapped",[1578,1610]],[[64529,64529],"mapped",[1579,1580]],[[64530,64530],"mapped",[1579,1605]],[[64531,64531],"mapped",[1579,1609]],[[64532,64532],"mapped",[1579,1610]],[[64533,64533],"mapped",[1580,1581]],[[64534,64534],"mapped",[1580,1605]],[[64535,64535],"mapped",[1581,1580]],[[64536,64536],"mapped",[1581,1605]],[[64537,64537],"mapped",[1582,1580]],[[64538,64538],"mapped",[1582,1581]],[[64539,64539],"mapped",[1582,1605]],[[64540,64540],"mapped",[1587,1580]],[[64541,64541],"mapped",[1587,1581]],[[64542,64542],"mapped",[1587,1582]],[[64543,64543],"mapped",[1587,1605]],[[64544,64544],"mapped",[1589,1581]],[[64545,64545],"mapped",[1589,1605]],[[64546,64546],"mapped",[1590,1580]],[[64547,64547],"mapped",[1590,1581]],[[64548,64548],"mapped",[1590,1582]],[[64549,64549],"mapped",[1590,1605]],[[64550,64550],"mapped",[1591,1581]],[[64551,64551],"mapped",[1591,1605]],[[64552,64552],"mapped",[1592,1605]],[[64553,64553],"mapped",[1593,1580]],[[64554,64554],"mapped",[1593,1605]],[[64555,64555],"mapped",[1594,1580]],[[64556,64556],"mapped",[1594,1605]],[[64557,64557],"mapped",[1601,1580]],[[64558,64558],"mapped",[1601,1581]],[[64559,64559],"mapped",[1601,1582]],[[64560,64560],"mapped",[1601,1605]],[[64561,64561],"mapped",[1601,1609]],[[64562,64562],"mapped",[1601,1610]],[[64563,64563],"mapped",[1602,1581]],[[64564,64564],"mapped",[1602,1605]],[[64565,64565],"mapped",[1602,1609]],[[64566,64566],"mapped",[1602,1610]],[[64567,64567],"mapped",[1603,1575]],[[64568,64568],"mapped",[1603,1580]],[[64569,64569],"mapped",[1603,1581]],[[64570,64570],"mapped",[1603,1582]],[[64571,64571],"mapped",[1603,1604]],[[64572,64572],"mapped",[1603,1605]],[[64573,64573],"mapped",[1603,1609]],[[64574,64574],"mapped",[1603,1610]],[[64575,64575],"mapped",[1604,1580]],[[64576,64576],"mapped",[1604,1581]],[[64577,64577],"mapped",[1604,1582]],[[64578,64578],"mapped",[1604,1605]],[[64579,64579],"mapped",[1604,1609]],[[64580,64580],"mapped",[1604,1610]],[[64581,64581],"mapped",[1605,1580]],[[64582,64582],"mapped",[1605,1581]],[[64583,64583],"mapped",[1605,1582]],[[64584,64584],"mapped",[1605,1605]],[[64585,64585],"mapped",[1605,1609]],[[64586,64586],"mapped",[1605,1610]],[[64587,64587],"mapped",[1606,1580]],[[64588,64588],"mapped",[1606,1581]],[[64589,64589],"mapped",[1606,1582]],[[64590,64590],"mapped",[1606,1605]],[[64591,64591],"mapped",[1606,1609]],[[64592,64592],"mapped",[1606,1610]],[[64593,64593],"mapped",[1607,1580]],[[64594,64594],"mapped",[1607,1605]],[[64595,64595],"mapped",[1607,1609]],[[64596,64596],"mapped",[1607,1610]],[[64597,64597],"mapped",[1610,1580]],[[64598,64598],"mapped",[1610,1581]],[[64599,64599],"mapped",[1610,1582]],[[64600,64600],"mapped",[1610,1605]],[[64601,64601],"mapped",[1610,1609]],[[64602,64602],"mapped",[1610,1610]],[[64603,64603],"mapped",[1584,1648]],[[64604,64604],"mapped",[1585,1648]],[[64605,64605],"mapped",[1609,1648]],[[64606,64606],"disallowed_STD3_mapped",[32,1612,1617]],[[64607,64607],"disallowed_STD3_mapped",[32,1613,1617]],[[64608,64608],"disallowed_STD3_mapped",[32,1614,1617]],[[64609,64609],"disallowed_STD3_mapped",[32,1615,1617]],[[64610,64610],"disallowed_STD3_mapped",[32,1616,1617]],[[64611,64611],"disallowed_STD3_mapped",[32,1617,1648]],[[64612,64612],"mapped",[1574,1585]],[[64613,64613],"mapped",[1574,1586]],[[64614,64614],"mapped",[1574,1605]],[[64615,64615],"mapped",[1574,1606]],[[64616,64616],"mapped",[1574,1609]],[[64617,64617],"mapped",[1574,1610]],[[64618,64618],"mapped",[1576,1585]],[[64619,64619],"mapped",[1576,1586]],[[64620,64620],"mapped",[1576,1605]],[[64621,64621],"mapped",[1576,1606]],[[64622,64622],"mapped",[1576,1609]],[[64623,64623],"mapped",[1576,1610]],[[64624,64624],"mapped",[1578,1585]],[[64625,64625],"mapped",[1578,1586]],[[64626,64626],"mapped",[1578,1605]],[[64627,64627],"mapped",[1578,1606]],[[64628,64628],"mapped",[1578,1609]],[[64629,64629],"mapped",[1578,1610]],[[64630,64630],"mapped",[1579,1585]],[[64631,64631],"mapped",[1579,1586]],[[64632,64632],"mapped",[1579,1605]],[[64633,64633],"mapped",[1579,1606]],[[64634,64634],"mapped",[1579,1609]],[[64635,64635],"mapped",[1579,1610]],[[64636,64636],"mapped",[1601,1609]],[[64637,64637],"mapped",[1601,1610]],[[64638,64638],"mapped",[1602,1609]],[[64639,64639],"mapped",[1602,1610]],[[64640,64640],"mapped",[1603,1575]],[[64641,64641],"mapped",[1603,1604]],[[64642,64642],"mapped",[1603,1605]],[[64643,64643],"mapped",[1603,1609]],[[64644,64644],"mapped",[1603,1610]],[[64645,64645],"mapped",[1604,1605]],[[64646,64646],"mapped",[1604,1609]],[[64647,64647],"mapped",[1604,1610]],[[64648,64648],"mapped",[1605,1575]],[[64649,64649],"mapped",[1605,1605]],[[64650,64650],"mapped",[1606,1585]],[[64651,64651],"mapped",[1606,1586]],[[64652,64652],"mapped",[1606,1605]],[[64653,64653],"mapped",[1606,1606]],[[64654,64654],"mapped",[1606,1609]],[[64655,64655],"mapped",[1606,1610]],[[64656,64656],"mapped",[1609,1648]],[[64657,64657],"mapped",[1610,1585]],[[64658,64658],"mapped",[1610,1586]],[[64659,64659],"mapped",[1610,1605]],[[64660,64660],"mapped",[1610,1606]],[[64661,64661],"mapped",[1610,1609]],[[64662,64662],"mapped",[1610,1610]],[[64663,64663],"mapped",[1574,1580]],[[64664,64664],"mapped",[1574,1581]],[[64665,64665],"mapped",[1574,1582]],[[64666,64666],"mapped",[1574,1605]],[[64667,64667],"mapped",[1574,1607]],[[64668,64668],"mapped",[1576,1580]],[[64669,64669],"mapped",[1576,1581]],[[64670,64670],"mapped",[1576,1582]],[[64671,64671],"mapped",[1576,1605]],[[64672,64672],"mapped",[1576,1607]],[[64673,64673],"mapped",[1578,1580]],[[64674,64674],"mapped",[1578,1581]],[[64675,64675],"mapped",[1578,1582]],[[64676,64676],"mapped",[1578,1605]],[[64677,64677],"mapped",[1578,1607]],[[64678,64678],"mapped",[1579,1605]],[[64679,64679],"mapped",[1580,1581]],[[64680,64680],"mapped",[1580,1605]],[[64681,64681],"mapped",[1581,1580]],[[64682,64682],"mapped",[1581,1605]],[[64683,64683],"mapped",[1582,1580]],[[64684,64684],"mapped",[1582,1605]],[[64685,64685],"mapped",[1587,1580]],[[64686,64686],"mapped",[1587,1581]],[[64687,64687],"mapped",[1587,1582]],[[64688,64688],"mapped",[1587,1605]],[[64689,64689],"mapped",[1589,1581]],[[64690,64690],"mapped",[1589,1582]],[[64691,64691],"mapped",[1589,1605]],[[64692,64692],"mapped",[1590,1580]],[[64693,64693],"mapped",[1590,1581]],[[64694,64694],"mapped",[1590,1582]],[[64695,64695],"mapped",[1590,1605]],[[64696,64696],"mapped",[1591,1581]],[[64697,64697],"mapped",[1592,1605]],[[64698,64698],"mapped",[1593,1580]],[[64699,64699],"mapped",[1593,1605]],[[64700,64700],"mapped",[1594,1580]],[[64701,64701],"mapped",[1594,1605]],[[64702,64702],"mapped",[1601,1580]],[[64703,64703],"mapped",[1601,1581]],[[64704,64704],"mapped",[1601,1582]],[[64705,64705],"mapped",[1601,1605]],[[64706,64706],"mapped",[1602,1581]],[[64707,64707],"mapped",[1602,1605]],[[64708,64708],"mapped",[1603,1580]],[[64709,64709],"mapped",[1603,1581]],[[64710,64710],"mapped",[1603,1582]],[[64711,64711],"mapped",[1603,1604]],[[64712,64712],"mapped",[1603,1605]],[[64713,64713],"mapped",[1604,1580]],[[64714,64714],"mapped",[1604,1581]],[[64715,64715],"mapped",[1604,1582]],[[64716,64716],"mapped",[1604,1605]],[[64717,64717],"mapped",[1604,1607]],[[64718,64718],"mapped",[1605,1580]],[[64719,64719],"mapped",[1605,1581]],[[64720,64720],"mapped",[1605,1582]],[[64721,64721],"mapped",[1605,1605]],[[64722,64722],"mapped",[1606,1580]],[[64723,64723],"mapped",[1606,1581]],[[64724,64724],"mapped",[1606,1582]],[[64725,64725],"mapped",[1606,1605]],[[64726,64726],"mapped",[1606,1607]],[[64727,64727],"mapped",[1607,1580]],[[64728,64728],"mapped",[1607,1605]],[[64729,64729],"mapped",[1607,1648]],[[64730,64730],"mapped",[1610,1580]],[[64731,64731],"mapped",[1610,1581]],[[64732,64732],"mapped",[1610,1582]],[[64733,64733],"mapped",[1610,1605]],[[64734,64734],"mapped",[1610,1607]],[[64735,64735],"mapped",[1574,1605]],[[64736,64736],"mapped",[1574,1607]],[[64737,64737],"mapped",[1576,1605]],[[64738,64738],"mapped",[1576,1607]],[[64739,64739],"mapped",[1578,1605]],[[64740,64740],"mapped",[1578,1607]],[[64741,64741],"mapped",[1579,1605]],[[64742,64742],"mapped",[1579,1607]],[[64743,64743],"mapped",[1587,1605]],[[64744,64744],"mapped",[1587,1607]],[[64745,64745],"mapped",[1588,1605]],[[64746,64746],"mapped",[1588,1607]],[[64747,64747],"mapped",[1603,1604]],[[64748,64748],"mapped",[1603,1605]],[[64749,64749],"mapped",[1604,1605]],[[64750,64750],"mapped",[1606,1605]],[[64751,64751],"mapped",[1606,1607]],[[64752,64752],"mapped",[1610,1605]],[[64753,64753],"mapped",[1610,1607]],[[64754,64754],"mapped",[1600,1614,1617]],[[64755,64755],"mapped",[1600,1615,1617]],[[64756,64756],"mapped",[1600,1616,1617]],[[64757,64757],"mapped",[1591,1609]],[[64758,64758],"mapped",[1591,1610]],[[64759,64759],"mapped",[1593,1609]],[[64760,64760],"mapped",[1593,1610]],[[64761,64761],"mapped",[1594,1609]],[[64762,64762],"mapped",[1594,1610]],[[64763,64763],"mapped",[1587,1609]],[[64764,64764],"mapped",[1587,1610]],[[64765,64765],"mapped",[1588,1609]],[[64766,64766],"mapped",[1588,1610]],[[64767,64767],"mapped",[1581,1609]],[[64768,64768],"mapped",[1581,1610]],[[64769,64769],"mapped",[1580,1609]],[[64770,64770],"mapped",[1580,1610]],[[64771,64771],"mapped",[1582,1609]],[[64772,64772],"mapped",[1582,1610]],[[64773,64773],"mapped",[1589,1609]],[[64774,64774],"mapped",[1589,1610]],[[64775,64775],"mapped",[1590,1609]],[[64776,64776],"mapped",[1590,1610]],[[64777,64777],"mapped",[1588,1580]],[[64778,64778],"mapped",[1588,1581]],[[64779,64779],"mapped",[1588,1582]],[[64780,64780],"mapped",[1588,1605]],[[64781,64781],"mapped",[1588,1585]],[[64782,64782],"mapped",[1587,1585]],[[64783,64783],"mapped",[1589,1585]],[[64784,64784],"mapped",[1590,1585]],[[64785,64785],"mapped",[1591,1609]],[[64786,64786],"mapped",[1591,1610]],[[64787,64787],"mapped",[1593,1609]],[[64788,64788],"mapped",[1593,1610]],[[64789,64789],"mapped",[1594,1609]],[[64790,64790],"mapped",[1594,1610]],[[64791,64791],"mapped",[1587,1609]],[[64792,64792],"mapped",[1587,1610]],[[64793,64793],"mapped",[1588,1609]],[[64794,64794],"mapped",[1588,1610]],[[64795,64795],"mapped",[1581,1609]],[[64796,64796],"mapped",[1581,1610]],[[64797,64797],"mapped",[1580,1609]],[[64798,64798],"mapped",[1580,1610]],[[64799,64799],"mapped",[1582,1609]],[[64800,64800],"mapped",[1582,1610]],[[64801,64801],"mapped",[1589,1609]],[[64802,64802],"mapped",[1589,1610]],[[64803,64803],"mapped",[1590,1609]],[[64804,64804],"mapped",[1590,1610]],[[64805,64805],"mapped",[1588,1580]],[[64806,64806],"mapped",[1588,1581]],[[64807,64807],"mapped",[1588,1582]],[[64808,64808],"mapped",[1588,1605]],[[64809,64809],"mapped",[1588,1585]],[[64810,64810],"mapped",[1587,1585]],[[64811,64811],"mapped",[1589,1585]],[[64812,64812],"mapped",[1590,1585]],[[64813,64813],"mapped",[1588,1580]],[[64814,64814],"mapped",[1588,1581]],[[64815,64815],"mapped",[1588,1582]],[[64816,64816],"mapped",[1588,1605]],[[64817,64817],"mapped",[1587,1607]],[[64818,64818],"mapped",[1588,1607]],[[64819,64819],"mapped",[1591,1605]],[[64820,64820],"mapped",[1587,1580]],[[64821,64821],"mapped",[1587,1581]],[[64822,64822],"mapped",[1587,1582]],[[64823,64823],"mapped",[1588,1580]],[[64824,64824],"mapped",[1588,1581]],[[64825,64825],"mapped",[1588,1582]],[[64826,64826],"mapped",[1591,1605]],[[64827,64827],"mapped",[1592,1605]],[[64828,64829],"mapped",[1575,1611]],[[64830,64831],"valid",[],"NV8"],[[64832,64847],"disallowed"],[[64848,64848],"mapped",[1578,1580,1605]],[[64849,64850],"mapped",[1578,1581,1580]],[[64851,64851],"mapped",[1578,1581,1605]],[[64852,64852],"mapped",[1578,1582,1605]],[[64853,64853],"mapped",[1578,1605,1580]],[[64854,64854],"mapped",[1578,1605,1581]],[[64855,64855],"mapped",[1578,1605,1582]],[[64856,64857],"mapped",[1580,1605,1581]],[[64858,64858],"mapped",[1581,1605,1610]],[[64859,64859],"mapped",[1581,1605,1609]],[[64860,64860],"mapped",[1587,1581,1580]],[[64861,64861],"mapped",[1587,1580,1581]],[[64862,64862],"mapped",[1587,1580,1609]],[[64863,64864],"mapped",[1587,1605,1581]],[[64865,64865],"mapped",[1587,1605,1580]],[[64866,64867],"mapped",[1587,1605,1605]],[[64868,64869],"mapped",[1589,1581,1581]],[[64870,64870],"mapped",[1589,1605,1605]],[[64871,64872],"mapped",[1588,1581,1605]],[[64873,64873],"mapped",[1588,1580,1610]],[[64874,64875],"mapped",[1588,1605,1582]],[[64876,64877],"mapped",[1588,1605,1605]],[[64878,64878],"mapped",[1590,1581,1609]],[[64879,64880],"mapped",[1590,1582,1605]],[[64881,64882],"mapped",[1591,1605,1581]],[[64883,64883],"mapped",[1591,1605,1605]],[[64884,64884],"mapped",[1591,1605,1610]],[[64885,64885],"mapped",[1593,1580,1605]],[[64886,64887],"mapped",[1593,1605,1605]],[[64888,64888],"mapped",[1593,1605,1609]],[[64889,64889],"mapped",[1594,1605,1605]],[[64890,64890],"mapped",[1594,1605,1610]],[[64891,64891],"mapped",[1594,1605,1609]],[[64892,64893],"mapped",[1601,1582,1605]],[[64894,64894],"mapped",[1602,1605,1581]],[[64895,64895],"mapped",[1602,1605,1605]],[[64896,64896],"mapped",[1604,1581,1605]],[[64897,64897],"mapped",[1604,1581,1610]],[[64898,64898],"mapped",[1604,1581,1609]],[[64899,64900],"mapped",[1604,1580,1580]],[[64901,64902],"mapped",[1604,1582,1605]],[[64903,64904],"mapped",[1604,1605,1581]],[[64905,64905],"mapped",[1605,1581,1580]],[[64906,64906],"mapped",[1605,1581,1605]],[[64907,64907],"mapped",[1605,1581,1610]],[[64908,64908],"mapped",[1605,1580,1581]],[[64909,64909],"mapped",[1605,1580,1605]],[[64910,64910],"mapped",[1605,1582,1580]],[[64911,64911],"mapped",[1605,1582,1605]],[[64912,64913],"disallowed"],[[64914,64914],"mapped",[1605,1580,1582]],[[64915,64915],"mapped",[1607,1605,1580]],[[64916,64916],"mapped",[1607,1605,1605]],[[64917,64917],"mapped",[1606,1581,1605]],[[64918,64918],"mapped",[1606,1581,1609]],[[64919,64920],"mapped",[1606,1580,1605]],[[64921,64921],"mapped",[1606,1580,1609]],[[64922,64922],"mapped",[1606,1605,1610]],[[64923,64923],"mapped",[1606,1605,1609]],[[64924,64925],"mapped",[1610,1605,1605]],[[64926,64926],"mapped",[1576,1582,1610]],[[64927,64927],"mapped",[1578,1580,1610]],[[64928,64928],"mapped",[1578,1580,1609]],[[64929,64929],"mapped",[1578,1582,1610]],[[64930,64930],"mapped",[1578,1582,1609]],[[64931,64931],"mapped",[1578,1605,1610]],[[64932,64932],"mapped",[1578,1605,1609]],[[64933,64933],"mapped",[1580,1605,1610]],[[64934,64934],"mapped",[1580,1581,1609]],[[64935,64935],"mapped",[1580,1605,1609]],[[64936,64936],"mapped",[1587,1582,1609]],[[64937,64937],"mapped",[1589,1581,1610]],[[64938,64938],"mapped",[1588,1581,1610]],[[64939,64939],"mapped",[1590,1581,1610]],[[64940,64940],"mapped",[1604,1580,1610]],[[64941,64941],"mapped",[1604,1605,1610]],[[64942,64942],"mapped",[1610,1581,1610]],[[64943,64943],"mapped",[1610,1580,1610]],[[64944,64944],"mapped",[1610,1605,1610]],[[64945,64945],"mapped",[1605,1605,1610]],[[64946,64946],"mapped",[1602,1605,1610]],[[64947,64947],"mapped",[1606,1581,1610]],[[64948,64948],"mapped",[1602,1605,1581]],[[64949,64949],"mapped",[1604,1581,1605]],[[64950,64950],"mapped",[1593,1605,1610]],[[64951,64951],"mapped",[1603,1605,1610]],[[64952,64952],"mapped",[1606,1580,1581]],[[64953,64953],"mapped",[1605,1582,1610]],[[64954,64954],"mapped",[1604,1580,1605]],[[64955,64955],"mapped",[1603,1605,1605]],[[64956,64956],"mapped",[1604,1580,1605]],[[64957,64957],"mapped",[1606,1580,1581]],[[64958,64958],"mapped",[1580,1581,1610]],[[64959,64959],"mapped",[1581,1580,1610]],[[64960,64960],"mapped",[1605,1580,1610]],[[64961,64961],"mapped",[1601,1605,1610]],[[64962,64962],"mapped",[1576,1581,1610]],[[64963,64963],"mapped",[1603,1605,1605]],[[64964,64964],"mapped",[1593,1580,1605]],[[64965,64965],"mapped",[1589,1605,1605]],[[64966,64966],"mapped",[1587,1582,1610]],[[64967,64967],"mapped",[1606,1580,1610]],[[64968,64975],"disallowed"],[[64976,65007],"disallowed"],[[65008,65008],"mapped",[1589,1604,1746]],[[65009,65009],"mapped",[1602,1604,1746]],[[65010,65010],"mapped",[1575,1604,1604,1607]],[[65011,65011],"mapped",[1575,1603,1576,1585]],[[65012,65012],"mapped",[1605,1581,1605,1583]],[[65013,65013],"mapped",[1589,1604,1593,1605]],[[65014,65014],"mapped",[1585,1587,1608,1604]],[[65015,65015],"mapped",[1593,1604,1610,1607]],[[65016,65016],"mapped",[1608,1587,1604,1605]],[[65017,65017],"mapped",[1589,1604,1609]],[[65018,65018],"disallowed_STD3_mapped",[1589,1604,1609,32,1575,1604,1604,1607,32,1593,1604,1610,1607,32,1608,1587,1604,1605]],[[65019,65019],"disallowed_STD3_mapped",[1580,1604,32,1580,1604,1575,1604,1607]],[[65020,65020],"mapped",[1585,1740,1575,1604]],[[65021,65021],"valid",[],"NV8"],[[65022,65023],"disallowed"],[[65024,65039],"ignored"],[[65040,65040],"disallowed_STD3_mapped",[44]],[[65041,65041],"mapped",[12289]],[[65042,65042],"disallowed"],[[65043,65043],"disallowed_STD3_mapped",[58]],[[65044,65044],"disallowed_STD3_mapped",[59]],[[65045,65045],"disallowed_STD3_mapped",[33]],[[65046,65046],"disallowed_STD3_mapped",[63]],[[65047,65047],"mapped",[12310]],[[65048,65048],"mapped",[12311]],[[65049,65049],"disallowed"],[[65050,65055],"disallowed"],[[65056,65059],"valid"],[[65060,65062],"valid"],[[65063,65069],"valid"],[[65070,65071],"valid"],[[65072,65072],"disallowed"],[[65073,65073],"mapped",[8212]],[[65074,65074],"mapped",[8211]],[[65075,65076],"disallowed_STD3_mapped",[95]],[[65077,65077],"disallowed_STD3_mapped",[40]],[[65078,65078],"disallowed_STD3_mapped",[41]],[[65079,65079],"disallowed_STD3_mapped",[123]],[[65080,65080],"disallowed_STD3_mapped",[125]],[[65081,65081],"mapped",[12308]],[[65082,65082],"mapped",[12309]],[[65083,65083],"mapped",[12304]],[[65084,65084],"mapped",[12305]],[[65085,65085],"mapped",[12298]],[[65086,65086],"mapped",[12299]],[[65087,65087],"mapped",[12296]],[[65088,65088],"mapped",[12297]],[[65089,65089],"mapped",[12300]],[[65090,65090],"mapped",[12301]],[[65091,65091],"mapped",[12302]],[[65092,65092],"mapped",[12303]],[[65093,65094],"valid",[],"NV8"],[[65095,65095],"disallowed_STD3_mapped",[91]],[[65096,65096],"disallowed_STD3_mapped",[93]],[[65097,65100],"disallowed_STD3_mapped",[32,773]],[[65101,65103],"disallowed_STD3_mapped",[95]],[[65104,65104],"disallowed_STD3_mapped",[44]],[[65105,65105],"mapped",[12289]],[[65106,65106],"disallowed"],[[65107,65107],"disallowed"],[[65108,65108],"disallowed_STD3_mapped",[59]],[[65109,65109],"disallowed_STD3_mapped",[58]],[[65110,65110],"disallowed_STD3_mapped",[63]],[[65111,65111],"disallowed_STD3_mapped",[33]],[[65112,65112],"mapped",[8212]],[[65113,65113],"disallowed_STD3_mapped",[40]],[[65114,65114],"disallowed_STD3_mapped",[41]],[[65115,65115],"disallowed_STD3_mapped",[123]],[[65116,65116],"disallowed_STD3_mapped",[125]],[[65117,65117],"mapped",[12308]],[[65118,65118],"mapped",[12309]],[[65119,65119],"disallowed_STD3_mapped",[35]],[[65120,65120],"disallowed_STD3_mapped",[38]],[[65121,65121],"disallowed_STD3_mapped",[42]],[[65122,65122],"disallowed_STD3_mapped",[43]],[[65123,65123],"mapped",[45]],[[65124,65124],"disallowed_STD3_mapped",[60]],[[65125,65125],"disallowed_STD3_mapped",[62]],[[65126,65126],"disallowed_STD3_mapped",[61]],[[65127,65127],"disallowed"],[[65128,65128],"disallowed_STD3_mapped",[92]],[[65129,65129],"disallowed_STD3_mapped",[36]],[[65130,65130],"disallowed_STD3_mapped",[37]],[[65131,65131],"disallowed_STD3_mapped",[64]],[[65132,65135],"disallowed"],[[65136,65136],"disallowed_STD3_mapped",[32,1611]],[[65137,65137],"mapped",[1600,1611]],[[65138,65138],"disallowed_STD3_mapped",[32,1612]],[[65139,65139],"valid"],[[65140,65140],"disallowed_STD3_mapped",[32,1613]],[[65141,65141],"disallowed"],[[65142,65142],"disallowed_STD3_mapped",[32,1614]],[[65143,65143],"mapped",[1600,1614]],[[65144,65144],"disallowed_STD3_mapped",[32,1615]],[[65145,65145],"mapped",[1600,1615]],[[65146,65146],"disallowed_STD3_mapped",[32,1616]],[[65147,65147],"mapped",[1600,1616]],[[65148,65148],"disallowed_STD3_mapped",[32,1617]],[[65149,65149],"mapped",[1600,1617]],[[65150,65150],"disallowed_STD3_mapped",[32,1618]],[[65151,65151],"mapped",[1600,1618]],[[65152,65152],"mapped",[1569]],[[65153,65154],"mapped",[1570]],[[65155,65156],"mapped",[1571]],[[65157,65158],"mapped",[1572]],[[65159,65160],"mapped",[1573]],[[65161,65164],"mapped",[1574]],[[65165,65166],"mapped",[1575]],[[65167,65170],"mapped",[1576]],[[65171,65172],"mapped",[1577]],[[65173,65176],"mapped",[1578]],[[65177,65180],"mapped",[1579]],[[65181,65184],"mapped",[1580]],[[65185,65188],"mapped",[1581]],[[65189,65192],"mapped",[1582]],[[65193,65194],"mapped",[1583]],[[65195,65196],"mapped",[1584]],[[65197,65198],"mapped",[1585]],[[65199,65200],"mapped",[1586]],[[65201,65204],"mapped",[1587]],[[65205,65208],"mapped",[1588]],[[65209,65212],"mapped",[1589]],[[65213,65216],"mapped",[1590]],[[65217,65220],"mapped",[1591]],[[65221,65224],"mapped",[1592]],[[65225,65228],"mapped",[1593]],[[65229,65232],"mapped",[1594]],[[65233,65236],"mapped",[1601]],[[65237,65240],"mapped",[1602]],[[65241,65244],"mapped",[1603]],[[65245,65248],"mapped",[1604]],[[65249,65252],"mapped",[1605]],[[65253,65256],"mapped",[1606]],[[65257,65260],"mapped",[1607]],[[65261,65262],"mapped",[1608]],[[65263,65264],"mapped",[1609]],[[65265,65268],"mapped",[1610]],[[65269,65270],"mapped",[1604,1570]],[[65271,65272],"mapped",[1604,1571]],[[65273,65274],"mapped",[1604,1573]],[[65275,65276],"mapped",[1604,1575]],[[65277,65278],"disallowed"],[[65279,65279],"ignored"],[[65280,65280],"disallowed"],[[65281,65281],"disallowed_STD3_mapped",[33]],[[65282,65282],"disallowed_STD3_mapped",[34]],[[65283,65283],"disallowed_STD3_mapped",[35]],[[65284,65284],"disallowed_STD3_mapped",[36]],[[65285,65285],"disallowed_STD3_mapped",[37]],[[65286,65286],"disallowed_STD3_mapped",[38]],[[65287,65287],"disallowed_STD3_mapped",[39]],[[65288,65288],"disallowed_STD3_mapped",[40]],[[65289,65289],"disallowed_STD3_mapped",[41]],[[65290,65290],"disallowed_STD3_mapped",[42]],[[65291,65291],"disallowed_STD3_mapped",[43]],[[65292,65292],"disallowed_STD3_mapped",[44]],[[65293,65293],"mapped",[45]],[[65294,65294],"mapped",[46]],[[65295,65295],"disallowed_STD3_mapped",[47]],[[65296,65296],"mapped",[48]],[[65297,65297],"mapped",[49]],[[65298,65298],"mapped",[50]],[[65299,65299],"mapped",[51]],[[65300,65300],"mapped",[52]],[[65301,65301],"mapped",[53]],[[65302,65302],"mapped",[54]],[[65303,65303],"mapped",[55]],[[65304,65304],"mapped",[56]],[[65305,65305],"mapped",[57]],[[65306,65306],"disallowed_STD3_mapped",[58]],[[65307,65307],"disallowed_STD3_mapped",[59]],[[65308,65308],"disallowed_STD3_mapped",[60]],[[65309,65309],"disallowed_STD3_mapped",[61]],[[65310,65310],"disallowed_STD3_mapped",[62]],[[65311,65311],"disallowed_STD3_mapped",[63]],[[65312,65312],"disallowed_STD3_mapped",[64]],[[65313,65313],"mapped",[97]],[[65314,65314],"mapped",[98]],[[65315,65315],"mapped",[99]],[[65316,65316],"mapped",[100]],[[65317,65317],"mapped",[101]],[[65318,65318],"mapped",[102]],[[65319,65319],"mapped",[103]],[[65320,65320],"mapped",[104]],[[65321,65321],"mapped",[105]],[[65322,65322],"mapped",[106]],[[65323,65323],"mapped",[107]],[[65324,65324],"mapped",[108]],[[65325,65325],"mapped",[109]],[[65326,65326],"mapped",[110]],[[65327,65327],"mapped",[111]],[[65328,65328],"mapped",[112]],[[65329,65329],"mapped",[113]],[[65330,65330],"mapped",[114]],[[65331,65331],"mapped",[115]],[[65332,65332],"mapped",[116]],[[65333,65333],"mapped",[117]],[[65334,65334],"mapped",[118]],[[65335,65335],"mapped",[119]],[[65336,65336],"mapped",[120]],[[65337,65337],"mapped",[121]],[[65338,65338],"mapped",[122]],[[65339,65339],"disallowed_STD3_mapped",[91]],[[65340,65340],"disallowed_STD3_mapped",[92]],[[65341,65341],"disallowed_STD3_mapped",[93]],[[65342,65342],"disallowed_STD3_mapped",[94]],[[65343,65343],"disallowed_STD3_mapped",[95]],[[65344,65344],"disallowed_STD3_mapped",[96]],[[65345,65345],"mapped",[97]],[[65346,65346],"mapped",[98]],[[65347,65347],"mapped",[99]],[[65348,65348],"mapped",[100]],[[65349,65349],"mapped",[101]],[[65350,65350],"mapped",[102]],[[65351,65351],"mapped",[103]],[[65352,65352],"mapped",[104]],[[65353,65353],"mapped",[105]],[[65354,65354],"mapped",[106]],[[65355,65355],"mapped",[107]],[[65356,65356],"mapped",[108]],[[65357,65357],"mapped",[109]],[[65358,65358],"mapped",[110]],[[65359,65359],"mapped",[111]],[[65360,65360],"mapped",[112]],[[65361,65361],"mapped",[113]],[[65362,65362],"mapped",[114]],[[65363,65363],"mapped",[115]],[[65364,65364],"mapped",[116]],[[65365,65365],"mapped",[117]],[[65366,65366],"mapped",[118]],[[65367,65367],"mapped",[119]],[[65368,65368],"mapped",[120]],[[65369,65369],"mapped",[121]],[[65370,65370],"mapped",[122]],[[65371,65371],"disallowed_STD3_mapped",[123]],[[65372,65372],"disallowed_STD3_mapped",[124]],[[65373,65373],"disallowed_STD3_mapped",[125]],[[65374,65374],"disallowed_STD3_mapped",[126]],[[65375,65375],"mapped",[10629]],[[65376,65376],"mapped",[10630]],[[65377,65377],"mapped",[46]],[[65378,65378],"mapped",[12300]],[[65379,65379],"mapped",[12301]],[[65380,65380],"mapped",[12289]],[[65381,65381],"mapped",[12539]],[[65382,65382],"mapped",[12530]],[[65383,65383],"mapped",[12449]],[[65384,65384],"mapped",[12451]],[[65385,65385],"mapped",[12453]],[[65386,65386],"mapped",[12455]],[[65387,65387],"mapped",[12457]],[[65388,65388],"mapped",[12515]],[[65389,65389],"mapped",[12517]],[[65390,65390],"mapped",[12519]],[[65391,65391],"mapped",[12483]],[[65392,65392],"mapped",[12540]],[[65393,65393],"mapped",[12450]],[[65394,65394],"mapped",[12452]],[[65395,65395],"mapped",[12454]],[[65396,65396],"mapped",[12456]],[[65397,65397],"mapped",[12458]],[[65398,65398],"mapped",[12459]],[[65399,65399],"mapped",[12461]],[[65400,65400],"mapped",[12463]],[[65401,65401],"mapped",[12465]],[[65402,65402],"mapped",[12467]],[[65403,65403],"mapped",[12469]],[[65404,65404],"mapped",[12471]],[[65405,65405],"mapped",[12473]],[[65406,65406],"mapped",[12475]],[[65407,65407],"mapped",[12477]],[[65408,65408],"mapped",[12479]],[[65409,65409],"mapped",[12481]],[[65410,65410],"mapped",[12484]],[[65411,65411],"mapped",[12486]],[[65412,65412],"mapped",[12488]],[[65413,65413],"mapped",[12490]],[[65414,65414],"mapped",[12491]],[[65415,65415],"mapped",[12492]],[[65416,65416],"mapped",[12493]],[[65417,65417],"mapped",[12494]],[[65418,65418],"mapped",[12495]],[[65419,65419],"mapped",[12498]],[[65420,65420],"mapped",[12501]],[[65421,65421],"mapped",[12504]],[[65422,65422],"mapped",[12507]],[[65423,65423],"mapped",[12510]],[[65424,65424],"mapped",[12511]],[[65425,65425],"mapped",[12512]],[[65426,65426],"mapped",[12513]],[[65427,65427],"mapped",[12514]],[[65428,65428],"mapped",[12516]],[[65429,65429],"mapped",[12518]],[[65430,65430],"mapped",[12520]],[[65431,65431],"mapped",[12521]],[[65432,65432],"mapped",[12522]],[[65433,65433],"mapped",[12523]],[[65434,65434],"mapped",[12524]],[[65435,65435],"mapped",[12525]],[[65436,65436],"mapped",[12527]],[[65437,65437],"mapped",[12531]],[[65438,65438],"mapped",[12441]],[[65439,65439],"mapped",[12442]],[[65440,65440],"disallowed"],[[65441,65441],"mapped",[4352]],[[65442,65442],"mapped",[4353]],[[65443,65443],"mapped",[4522]],[[65444,65444],"mapped",[4354]],[[65445,65445],"mapped",[4524]],[[65446,65446],"mapped",[4525]],[[65447,65447],"mapped",[4355]],[[65448,65448],"mapped",[4356]],[[65449,65449],"mapped",[4357]],[[65450,65450],"mapped",[4528]],[[65451,65451],"mapped",[4529]],[[65452,65452],"mapped",[4530]],[[65453,65453],"mapped",[4531]],[[65454,65454],"mapped",[4532]],[[65455,65455],"mapped",[4533]],[[65456,65456],"mapped",[4378]],[[65457,65457],"mapped",[4358]],[[65458,65458],"mapped",[4359]],[[65459,65459],"mapped",[4360]],[[65460,65460],"mapped",[4385]],[[65461,65461],"mapped",[4361]],[[65462,65462],"mapped",[4362]],[[65463,65463],"mapped",[4363]],[[65464,65464],"mapped",[4364]],[[65465,65465],"mapped",[4365]],[[65466,65466],"mapped",[4366]],[[65467,65467],"mapped",[4367]],[[65468,65468],"mapped",[4368]],[[65469,65469],"mapped",[4369]],[[65470,65470],"mapped",[4370]],[[65471,65473],"disallowed"],[[65474,65474],"mapped",[4449]],[[65475,65475],"mapped",[4450]],[[65476,65476],"mapped",[4451]],[[65477,65477],"mapped",[4452]],[[65478,65478],"mapped",[4453]],[[65479,65479],"mapped",[4454]],[[65480,65481],"disallowed"],[[65482,65482],"mapped",[4455]],[[65483,65483],"mapped",[4456]],[[65484,65484],"mapped",[4457]],[[65485,65485],"mapped",[4458]],[[65486,65486],"mapped",[4459]],[[65487,65487],"mapped",[4460]],[[65488,65489],"disallowed"],[[65490,65490],"mapped",[4461]],[[65491,65491],"mapped",[4462]],[[65492,65492],"mapped",[4463]],[[65493,65493],"mapped",[4464]],[[65494,65494],"mapped",[4465]],[[65495,65495],"mapped",[4466]],[[65496,65497],"disallowed"],[[65498,65498],"mapped",[4467]],[[65499,65499],"mapped",[4468]],[[65500,65500],"mapped",[4469]],[[65501,65503],"disallowed"],[[65504,65504],"mapped",[162]],[[65505,65505],"mapped",[163]],[[65506,65506],"mapped",[172]],[[65507,65507],"disallowed_STD3_mapped",[32,772]],[[65508,65508],"mapped",[166]],[[65509,65509],"mapped",[165]],[[65510,65510],"mapped",[8361]],[[65511,65511],"disallowed"],[[65512,65512],"mapped",[9474]],[[65513,65513],"mapped",[8592]],[[65514,65514],"mapped",[8593]],[[65515,65515],"mapped",[8594]],[[65516,65516],"mapped",[8595]],[[65517,65517],"mapped",[9632]],[[65518,65518],"mapped",[9675]],[[65519,65528],"disallowed"],[[65529,65531],"disallowed"],[[65532,65532],"disallowed"],[[65533,65533],"disallowed"],[[65534,65535],"disallowed"],[[65536,65547],"valid"],[[65548,65548],"disallowed"],[[65549,65574],"valid"],[[65575,65575],"disallowed"],[[65576,65594],"valid"],[[65595,65595],"disallowed"],[[65596,65597],"valid"],[[65598,65598],"disallowed"],[[65599,65613],"valid"],[[65614,65615],"disallowed"],[[65616,65629],"valid"],[[65630,65663],"disallowed"],[[65664,65786],"valid"],[[65787,65791],"disallowed"],[[65792,65794],"valid",[],"NV8"],[[65795,65798],"disallowed"],[[65799,65843],"valid",[],"NV8"],[[65844,65846],"disallowed"],[[65847,65855],"valid",[],"NV8"],[[65856,65930],"valid",[],"NV8"],[[65931,65932],"valid",[],"NV8"],[[65933,65935],"disallowed"],[[65936,65947],"valid",[],"NV8"],[[65948,65951],"disallowed"],[[65952,65952],"valid",[],"NV8"],[[65953,65999],"disallowed"],[[66000,66044],"valid",[],"NV8"],[[66045,66045],"valid"],[[66046,66175],"disallowed"],[[66176,66204],"valid"],[[66205,66207],"disallowed"],[[66208,66256],"valid"],[[66257,66271],"disallowed"],[[66272,66272],"valid"],[[66273,66299],"valid",[],"NV8"],[[66300,66303],"disallowed"],[[66304,66334],"valid"],[[66335,66335],"valid"],[[66336,66339],"valid",[],"NV8"],[[66340,66351],"disallowed"],[[66352,66368],"valid"],[[66369,66369],"valid",[],"NV8"],[[66370,66377],"valid"],[[66378,66378],"valid",[],"NV8"],[[66379,66383],"disallowed"],[[66384,66426],"valid"],[[66427,66431],"disallowed"],[[66432,66461],"valid"],[[66462,66462],"disallowed"],[[66463,66463],"valid",[],"NV8"],[[66464,66499],"valid"],[[66500,66503],"disallowed"],[[66504,66511],"valid"],[[66512,66517],"valid",[],"NV8"],[[66518,66559],"disallowed"],[[66560,66560],"mapped",[66600]],[[66561,66561],"mapped",[66601]],[[66562,66562],"mapped",[66602]],[[66563,66563],"mapped",[66603]],[[66564,66564],"mapped",[66604]],[[66565,66565],"mapped",[66605]],[[66566,66566],"mapped",[66606]],[[66567,66567],"mapped",[66607]],[[66568,66568],"mapped",[66608]],[[66569,66569],"mapped",[66609]],[[66570,66570],"mapped",[66610]],[[66571,66571],"mapped",[66611]],[[66572,66572],"mapped",[66612]],[[66573,66573],"mapped",[66613]],[[66574,66574],"mapped",[66614]],[[66575,66575],"mapped",[66615]],[[66576,66576],"mapped",[66616]],[[66577,66577],"mapped",[66617]],[[66578,66578],"mapped",[66618]],[[66579,66579],"mapped",[66619]],[[66580,66580],"mapped",[66620]],[[66581,66581],"mapped",[66621]],[[66582,66582],"mapped",[66622]],[[66583,66583],"mapped",[66623]],[[66584,66584],"mapped",[66624]],[[66585,66585],"mapped",[66625]],[[66586,66586],"mapped",[66626]],[[66587,66587],"mapped",[66627]],[[66588,66588],"mapped",[66628]],[[66589,66589],"mapped",[66629]],[[66590,66590],"mapped",[66630]],[[66591,66591],"mapped",[66631]],[[66592,66592],"mapped",[66632]],[[66593,66593],"mapped",[66633]],[[66594,66594],"mapped",[66634]],[[66595,66595],"mapped",[66635]],[[66596,66596],"mapped",[66636]],[[66597,66597],"mapped",[66637]],[[66598,66598],"mapped",[66638]],[[66599,66599],"mapped",[66639]],[[66600,66637],"valid"],[[66638,66717],"valid"],[[66718,66719],"disallowed"],[[66720,66729],"valid"],[[66730,66815],"disallowed"],[[66816,66855],"valid"],[[66856,66863],"disallowed"],[[66864,66915],"valid"],[[66916,66926],"disallowed"],[[66927,66927],"valid",[],"NV8"],[[66928,67071],"disallowed"],[[67072,67382],"valid"],[[67383,67391],"disallowed"],[[67392,67413],"valid"],[[67414,67423],"disallowed"],[[67424,67431],"valid"],[[67432,67583],"disallowed"],[[67584,67589],"valid"],[[67590,67591],"disallowed"],[[67592,67592],"valid"],[[67593,67593],"disallowed"],[[67594,67637],"valid"],[[67638,67638],"disallowed"],[[67639,67640],"valid"],[[67641,67643],"disallowed"],[[67644,67644],"valid"],[[67645,67646],"disallowed"],[[67647,67647],"valid"],[[67648,67669],"valid"],[[67670,67670],"disallowed"],[[67671,67679],"valid",[],"NV8"],[[67680,67702],"valid"],[[67703,67711],"valid",[],"NV8"],[[67712,67742],"valid"],[[67743,67750],"disallowed"],[[67751,67759],"valid",[],"NV8"],[[67760,67807],"disallowed"],[[67808,67826],"valid"],[[67827,67827],"disallowed"],[[67828,67829],"valid"],[[67830,67834],"disallowed"],[[67835,67839],"valid",[],"NV8"],[[67840,67861],"valid"],[[67862,67865],"valid",[],"NV8"],[[67866,67867],"valid",[],"NV8"],[[67868,67870],"disallowed"],[[67871,67871],"valid",[],"NV8"],[[67872,67897],"valid"],[[67898,67902],"disallowed"],[[67903,67903],"valid",[],"NV8"],[[67904,67967],"disallowed"],[[67968,68023],"valid"],[[68024,68027],"disallowed"],[[68028,68029],"valid",[],"NV8"],[[68030,68031],"valid"],[[68032,68047],"valid",[],"NV8"],[[68048,68049],"disallowed"],[[68050,68095],"valid",[],"NV8"],[[68096,68099],"valid"],[[68100,68100],"disallowed"],[[68101,68102],"valid"],[[68103,68107],"disallowed"],[[68108,68115],"valid"],[[68116,68116],"disallowed"],[[68117,68119],"valid"],[[68120,68120],"disallowed"],[[68121,68147],"valid"],[[68148,68151],"disallowed"],[[68152,68154],"valid"],[[68155,68158],"disallowed"],[[68159,68159],"valid"],[[68160,68167],"valid",[],"NV8"],[[68168,68175],"disallowed"],[[68176,68184],"valid",[],"NV8"],[[68185,68191],"disallowed"],[[68192,68220],"valid"],[[68221,68223],"valid",[],"NV8"],[[68224,68252],"valid"],[[68253,68255],"valid",[],"NV8"],[[68256,68287],"disallowed"],[[68288,68295],"valid"],[[68296,68296],"valid",[],"NV8"],[[68297,68326],"valid"],[[68327,68330],"disallowed"],[[68331,68342],"valid",[],"NV8"],[[68343,68351],"disallowed"],[[68352,68405],"valid"],[[68406,68408],"disallowed"],[[68409,68415],"valid",[],"NV8"],[[68416,68437],"valid"],[[68438,68439],"disallowed"],[[68440,68447],"valid",[],"NV8"],[[68448,68466],"valid"],[[68467,68471],"disallowed"],[[68472,68479],"valid",[],"NV8"],[[68480,68497],"valid"],[[68498,68504],"disallowed"],[[68505,68508],"valid",[],"NV8"],[[68509,68520],"disallowed"],[[68521,68527],"valid",[],"NV8"],[[68528,68607],"disallowed"],[[68608,68680],"valid"],[[68681,68735],"disallowed"],[[68736,68736],"mapped",[68800]],[[68737,68737],"mapped",[68801]],[[68738,68738],"mapped",[68802]],[[68739,68739],"mapped",[68803]],[[68740,68740],"mapped",[68804]],[[68741,68741],"mapped",[68805]],[[68742,68742],"mapped",[68806]],[[68743,68743],"mapped",[68807]],[[68744,68744],"mapped",[68808]],[[68745,68745],"mapped",[68809]],[[68746,68746],"mapped",[68810]],[[68747,68747],"mapped",[68811]],[[68748,68748],"mapped",[68812]],[[68749,68749],"mapped",[68813]],[[68750,68750],"mapped",[68814]],[[68751,68751],"mapped",[68815]],[[68752,68752],"mapped",[68816]],[[68753,68753],"mapped",[68817]],[[68754,68754],"mapped",[68818]],[[68755,68755],"mapped",[68819]],[[68756,68756],"mapped",[68820]],[[68757,68757],"mapped",[68821]],[[68758,68758],"mapped",[68822]],[[68759,68759],"mapped",[68823]],[[68760,68760],"mapped",[68824]],[[68761,68761],"mapped",[68825]],[[68762,68762],"mapped",[68826]],[[68763,68763],"mapped",[68827]],[[68764,68764],"mapped",[68828]],[[68765,68765],"mapped",[68829]],[[68766,68766],"mapped",[68830]],[[68767,68767],"mapped",[68831]],[[68768,68768],"mapped",[68832]],[[68769,68769],"mapped",[68833]],[[68770,68770],"mapped",[68834]],[[68771,68771],"mapped",[68835]],[[68772,68772],"mapped",[68836]],[[68773,68773],"mapped",[68837]],[[68774,68774],"mapped",[68838]],[[68775,68775],"mapped",[68839]],[[68776,68776],"mapped",[68840]],[[68777,68777],"mapped",[68841]],[[68778,68778],"mapped",[68842]],[[68779,68779],"mapped",[68843]],[[68780,68780],"mapped",[68844]],[[68781,68781],"mapped",[68845]],[[68782,68782],"mapped",[68846]],[[68783,68783],"mapped",[68847]],[[68784,68784],"mapped",[68848]],[[68785,68785],"mapped",[68849]],[[68786,68786],"mapped",[68850]],[[68787,68799],"disallowed"],[[68800,68850],"valid"],[[68851,68857],"disallowed"],[[68858,68863],"valid",[],"NV8"],[[68864,69215],"disallowed"],[[69216,69246],"valid",[],"NV8"],[[69247,69631],"disallowed"],[[69632,69702],"valid"],[[69703,69709],"valid",[],"NV8"],[[69710,69713],"disallowed"],[[69714,69733],"valid",[],"NV8"],[[69734,69743],"valid"],[[69744,69758],"disallowed"],[[69759,69759],"valid"],[[69760,69818],"valid"],[[69819,69820],"valid",[],"NV8"],[[69821,69821],"disallowed"],[[69822,69825],"valid",[],"NV8"],[[69826,69839],"disallowed"],[[69840,69864],"valid"],[[69865,69871],"disallowed"],[[69872,69881],"valid"],[[69882,69887],"disallowed"],[[69888,69940],"valid"],[[69941,69941],"disallowed"],[[69942,69951],"valid"],[[69952,69955],"valid",[],"NV8"],[[69956,69967],"disallowed"],[[69968,70003],"valid"],[[70004,70005],"valid",[],"NV8"],[[70006,70006],"valid"],[[70007,70015],"disallowed"],[[70016,70084],"valid"],[[70085,70088],"valid",[],"NV8"],[[70089,70089],"valid",[],"NV8"],[[70090,70092],"valid"],[[70093,70093],"valid",[],"NV8"],[[70094,70095],"disallowed"],[[70096,70105],"valid"],[[70106,70106],"valid"],[[70107,70107],"valid",[],"NV8"],[[70108,70108],"valid"],[[70109,70111],"valid",[],"NV8"],[[70112,70112],"disallowed"],[[70113,70132],"valid",[],"NV8"],[[70133,70143],"disallowed"],[[70144,70161],"valid"],[[70162,70162],"disallowed"],[[70163,70199],"valid"],[[70200,70205],"valid",[],"NV8"],[[70206,70271],"disallowed"],[[70272,70278],"valid"],[[70279,70279],"disallowed"],[[70280,70280],"valid"],[[70281,70281],"disallowed"],[[70282,70285],"valid"],[[70286,70286],"disallowed"],[[70287,70301],"valid"],[[70302,70302],"disallowed"],[[70303,70312],"valid"],[[70313,70313],"valid",[],"NV8"],[[70314,70319],"disallowed"],[[70320,70378],"valid"],[[70379,70383],"disallowed"],[[70384,70393],"valid"],[[70394,70399],"disallowed"],[[70400,70400],"valid"],[[70401,70403],"valid"],[[70404,70404],"disallowed"],[[70405,70412],"valid"],[[70413,70414],"disallowed"],[[70415,70416],"valid"],[[70417,70418],"disallowed"],[[70419,70440],"valid"],[[70441,70441],"disallowed"],[[70442,70448],"valid"],[[70449,70449],"disallowed"],[[70450,70451],"valid"],[[70452,70452],"disallowed"],[[70453,70457],"valid"],[[70458,70459],"disallowed"],[[70460,70468],"valid"],[[70469,70470],"disallowed"],[[70471,70472],"valid"],[[70473,70474],"disallowed"],[[70475,70477],"valid"],[[70478,70479],"disallowed"],[[70480,70480],"valid"],[[70481,70486],"disallowed"],[[70487,70487],"valid"],[[70488,70492],"disallowed"],[[70493,70499],"valid"],[[70500,70501],"disallowed"],[[70502,70508],"valid"],[[70509,70511],"disallowed"],[[70512,70516],"valid"],[[70517,70783],"disallowed"],[[70784,70853],"valid"],[[70854,70854],"valid",[],"NV8"],[[70855,70855],"valid"],[[70856,70863],"disallowed"],[[70864,70873],"valid"],[[70874,71039],"disallowed"],[[71040,71093],"valid"],[[71094,71095],"disallowed"],[[71096,71104],"valid"],[[71105,71113],"valid",[],"NV8"],[[71114,71127],"valid",[],"NV8"],[[71128,71133],"valid"],[[71134,71167],"disallowed"],[[71168,71232],"valid"],[[71233,71235],"valid",[],"NV8"],[[71236,71236],"valid"],[[71237,71247],"disallowed"],[[71248,71257],"valid"],[[71258,71295],"disallowed"],[[71296,71351],"valid"],[[71352,71359],"disallowed"],[[71360,71369],"valid"],[[71370,71423],"disallowed"],[[71424,71449],"valid"],[[71450,71452],"disallowed"],[[71453,71467],"valid"],[[71468,71471],"disallowed"],[[71472,71481],"valid"],[[71482,71487],"valid",[],"NV8"],[[71488,71839],"disallowed"],[[71840,71840],"mapped",[71872]],[[71841,71841],"mapped",[71873]],[[71842,71842],"mapped",[71874]],[[71843,71843],"mapped",[71875]],[[71844,71844],"mapped",[71876]],[[71845,71845],"mapped",[71877]],[[71846,71846],"mapped",[71878]],[[71847,71847],"mapped",[71879]],[[71848,71848],"mapped",[71880]],[[71849,71849],"mapped",[71881]],[[71850,71850],"mapped",[71882]],[[71851,71851],"mapped",[71883]],[[71852,71852],"mapped",[71884]],[[71853,71853],"mapped",[71885]],[[71854,71854],"mapped",[71886]],[[71855,71855],"mapped",[71887]],[[71856,71856],"mapped",[71888]],[[71857,71857],"mapped",[71889]],[[71858,71858],"mapped",[71890]],[[71859,71859],"mapped",[71891]],[[71860,71860],"mapped",[71892]],[[71861,71861],"mapped",[71893]],[[71862,71862],"mapped",[71894]],[[71863,71863],"mapped",[71895]],[[71864,71864],"mapped",[71896]],[[71865,71865],"mapped",[71897]],[[71866,71866],"mapped",[71898]],[[71867,71867],"mapped",[71899]],[[71868,71868],"mapped",[71900]],[[71869,71869],"mapped",[71901]],[[71870,71870],"mapped",[71902]],[[71871,71871],"mapped",[71903]],[[71872,71913],"valid"],[[71914,71922],"valid",[],"NV8"],[[71923,71934],"disallowed"],[[71935,71935],"valid"],[[71936,72383],"disallowed"],[[72384,72440],"valid"],[[72441,73727],"disallowed"],[[73728,74606],"valid"],[[74607,74648],"valid"],[[74649,74649],"valid"],[[74650,74751],"disallowed"],[[74752,74850],"valid",[],"NV8"],[[74851,74862],"valid",[],"NV8"],[[74863,74863],"disallowed"],[[74864,74867],"valid",[],"NV8"],[[74868,74868],"valid",[],"NV8"],[[74869,74879],"disallowed"],[[74880,75075],"valid"],[[75076,77823],"disallowed"],[[77824,78894],"valid"],[[78895,82943],"disallowed"],[[82944,83526],"valid"],[[83527,92159],"disallowed"],[[92160,92728],"valid"],[[92729,92735],"disallowed"],[[92736,92766],"valid"],[[92767,92767],"disallowed"],[[92768,92777],"valid"],[[92778,92781],"disallowed"],[[92782,92783],"valid",[],"NV8"],[[92784,92879],"disallowed"],[[92880,92909],"valid"],[[92910,92911],"disallowed"],[[92912,92916],"valid"],[[92917,92917],"valid",[],"NV8"],[[92918,92927],"disallowed"],[[92928,92982],"valid"],[[92983,92991],"valid",[],"NV8"],[[92992,92995],"valid"],[[92996,92997],"valid",[],"NV8"],[[92998,93007],"disallowed"],[[93008,93017],"valid"],[[93018,93018],"disallowed"],[[93019,93025],"valid",[],"NV8"],[[93026,93026],"disallowed"],[[93027,93047],"valid"],[[93048,93052],"disallowed"],[[93053,93071],"valid"],[[93072,93951],"disallowed"],[[93952,94020],"valid"],[[94021,94031],"disallowed"],[[94032,94078],"valid"],[[94079,94094],"disallowed"],[[94095,94111],"valid"],[[94112,110591],"disallowed"],[[110592,110593],"valid"],[[110594,113663],"disallowed"],[[113664,113770],"valid"],[[113771,113775],"disallowed"],[[113776,113788],"valid"],[[113789,113791],"disallowed"],[[113792,113800],"valid"],[[113801,113807],"disallowed"],[[113808,113817],"valid"],[[113818,113819],"disallowed"],[[113820,113820],"valid",[],"NV8"],[[113821,113822],"valid"],[[113823,113823],"valid",[],"NV8"],[[113824,113827],"ignored"],[[113828,118783],"disallowed"],[[118784,119029],"valid",[],"NV8"],[[119030,119039],"disallowed"],[[119040,119078],"valid",[],"NV8"],[[119079,119080],"disallowed"],[[119081,119081],"valid",[],"NV8"],[[119082,119133],"valid",[],"NV8"],[[119134,119134],"mapped",[119127,119141]],[[119135,119135],"mapped",[119128,119141]],[[119136,119136],"mapped",[119128,119141,119150]],[[119137,119137],"mapped",[119128,119141,119151]],[[119138,119138],"mapped",[119128,119141,119152]],[[119139,119139],"mapped",[119128,119141,119153]],[[119140,119140],"mapped",[119128,119141,119154]],[[119141,119154],"valid",[],"NV8"],[[119155,119162],"disallowed"],[[119163,119226],"valid",[],"NV8"],[[119227,119227],"mapped",[119225,119141]],[[119228,119228],"mapped",[119226,119141]],[[119229,119229],"mapped",[119225,119141,119150]],[[119230,119230],"mapped",[119226,119141,119150]],[[119231,119231],"mapped",[119225,119141,119151]],[[119232,119232],"mapped",[119226,119141,119151]],[[119233,119261],"valid",[],"NV8"],[[119262,119272],"valid",[],"NV8"],[[119273,119295],"disallowed"],[[119296,119365],"valid",[],"NV8"],[[119366,119551],"disallowed"],[[119552,119638],"valid",[],"NV8"],[[119639,119647],"disallowed"],[[119648,119665],"valid",[],"NV8"],[[119666,119807],"disallowed"],[[119808,119808],"mapped",[97]],[[119809,119809],"mapped",[98]],[[119810,119810],"mapped",[99]],[[119811,119811],"mapped",[100]],[[119812,119812],"mapped",[101]],[[119813,119813],"mapped",[102]],[[119814,119814],"mapped",[103]],[[119815,119815],"mapped",[104]],[[119816,119816],"mapped",[105]],[[119817,119817],"mapped",[106]],[[119818,119818],"mapped",[107]],[[119819,119819],"mapped",[108]],[[119820,119820],"mapped",[109]],[[119821,119821],"mapped",[110]],[[119822,119822],"mapped",[111]],[[119823,119823],"mapped",[112]],[[119824,119824],"mapped",[113]],[[119825,119825],"mapped",[114]],[[119826,119826],"mapped",[115]],[[119827,119827],"mapped",[116]],[[119828,119828],"mapped",[117]],[[119829,119829],"mapped",[118]],[[119830,119830],"mapped",[119]],[[119831,119831],"mapped",[120]],[[119832,119832],"mapped",[121]],[[119833,119833],"mapped",[122]],[[119834,119834],"mapped",[97]],[[119835,119835],"mapped",[98]],[[119836,119836],"mapped",[99]],[[119837,119837],"mapped",[100]],[[119838,119838],"mapped",[101]],[[119839,119839],"mapped",[102]],[[119840,119840],"mapped",[103]],[[119841,119841],"mapped",[104]],[[119842,119842],"mapped",[105]],[[119843,119843],"mapped",[106]],[[119844,119844],"mapped",[107]],[[119845,119845],"mapped",[108]],[[119846,119846],"mapped",[109]],[[119847,119847],"mapped",[110]],[[119848,119848],"mapped",[111]],[[119849,119849],"mapped",[112]],[[119850,119850],"mapped",[113]],[[119851,119851],"mapped",[114]],[[119852,119852],"mapped",[115]],[[119853,119853],"mapped",[116]],[[119854,119854],"mapped",[117]],[[119855,119855],"mapped",[118]],[[119856,119856],"mapped",[119]],[[119857,119857],"mapped",[120]],[[119858,119858],"mapped",[121]],[[119859,119859],"mapped",[122]],[[119860,119860],"mapped",[97]],[[119861,119861],"mapped",[98]],[[119862,119862],"mapped",[99]],[[119863,119863],"mapped",[100]],[[119864,119864],"mapped",[101]],[[119865,119865],"mapped",[102]],[[119866,119866],"mapped",[103]],[[119867,119867],"mapped",[104]],[[119868,119868],"mapped",[105]],[[119869,119869],"mapped",[106]],[[119870,119870],"mapped",[107]],[[119871,119871],"mapped",[108]],[[119872,119872],"mapped",[109]],[[119873,119873],"mapped",[110]],[[119874,119874],"mapped",[111]],[[119875,119875],"mapped",[112]],[[119876,119876],"mapped",[113]],[[119877,119877],"mapped",[114]],[[119878,119878],"mapped",[115]],[[119879,119879],"mapped",[116]],[[119880,119880],"mapped",[117]],[[119881,119881],"mapped",[118]],[[119882,119882],"mapped",[119]],[[119883,119883],"mapped",[120]],[[119884,119884],"mapped",[121]],[[119885,119885],"mapped",[122]],[[119886,119886],"mapped",[97]],[[119887,119887],"mapped",[98]],[[119888,119888],"mapped",[99]],[[119889,119889],"mapped",[100]],[[119890,119890],"mapped",[101]],[[119891,119891],"mapped",[102]],[[119892,119892],"mapped",[103]],[[119893,119893],"disallowed"],[[119894,119894],"mapped",[105]],[[119895,119895],"mapped",[106]],[[119896,119896],"mapped",[107]],[[119897,119897],"mapped",[108]],[[119898,119898],"mapped",[109]],[[119899,119899],"mapped",[110]],[[119900,119900],"mapped",[111]],[[119901,119901],"mapped",[112]],[[119902,119902],"mapped",[113]],[[119903,119903],"mapped",[114]],[[119904,119904],"mapped",[115]],[[119905,119905],"mapped",[116]],[[119906,119906],"mapped",[117]],[[119907,119907],"mapped",[118]],[[119908,119908],"mapped",[119]],[[119909,119909],"mapped",[120]],[[119910,119910],"mapped",[121]],[[119911,119911],"mapped",[122]],[[119912,119912],"mapped",[97]],[[119913,119913],"mapped",[98]],[[119914,119914],"mapped",[99]],[[119915,119915],"mapped",[100]],[[119916,119916],"mapped",[101]],[[119917,119917],"mapped",[102]],[[119918,119918],"mapped",[103]],[[119919,119919],"mapped",[104]],[[119920,119920],"mapped",[105]],[[119921,119921],"mapped",[106]],[[119922,119922],"mapped",[107]],[[119923,119923],"mapped",[108]],[[119924,119924],"mapped",[109]],[[119925,119925],"mapped",[110]],[[119926,119926],"mapped",[111]],[[119927,119927],"mapped",[112]],[[119928,119928],"mapped",[113]],[[119929,119929],"mapped",[114]],[[119930,119930],"mapped",[115]],[[119931,119931],"mapped",[116]],[[119932,119932],"mapped",[117]],[[119933,119933],"mapped",[118]],[[119934,119934],"mapped",[119]],[[119935,119935],"mapped",[120]],[[119936,119936],"mapped",[121]],[[119937,119937],"mapped",[122]],[[119938,119938],"mapped",[97]],[[119939,119939],"mapped",[98]],[[119940,119940],"mapped",[99]],[[119941,119941],"mapped",[100]],[[119942,119942],"mapped",[101]],[[119943,119943],"mapped",[102]],[[119944,119944],"mapped",[103]],[[119945,119945],"mapped",[104]],[[119946,119946],"mapped",[105]],[[119947,119947],"mapped",[106]],[[119948,119948],"mapped",[107]],[[119949,119949],"mapped",[108]],[[119950,119950],"mapped",[109]],[[119951,119951],"mapped",[110]],[[119952,119952],"mapped",[111]],[[119953,119953],"mapped",[112]],[[119954,119954],"mapped",[113]],[[119955,119955],"mapped",[114]],[[119956,119956],"mapped",[115]],[[119957,119957],"mapped",[116]],[[119958,119958],"mapped",[117]],[[119959,119959],"mapped",[118]],[[119960,119960],"mapped",[119]],[[119961,119961],"mapped",[120]],[[119962,119962],"mapped",[121]],[[119963,119963],"mapped",[122]],[[119964,119964],"mapped",[97]],[[119965,119965],"disallowed"],[[119966,119966],"mapped",[99]],[[119967,119967],"mapped",[100]],[[119968,119969],"disallowed"],[[119970,119970],"mapped",[103]],[[119971,119972],"disallowed"],[[119973,119973],"mapped",[106]],[[119974,119974],"mapped",[107]],[[119975,119976],"disallowed"],[[119977,119977],"mapped",[110]],[[119978,119978],"mapped",[111]],[[119979,119979],"mapped",[112]],[[119980,119980],"mapped",[113]],[[119981,119981],"disallowed"],[[119982,119982],"mapped",[115]],[[119983,119983],"mapped",[116]],[[119984,119984],"mapped",[117]],[[119985,119985],"mapped",[118]],[[119986,119986],"mapped",[119]],[[119987,119987],"mapped",[120]],[[119988,119988],"mapped",[121]],[[119989,119989],"mapped",[122]],[[119990,119990],"mapped",[97]],[[119991,119991],"mapped",[98]],[[119992,119992],"mapped",[99]],[[119993,119993],"mapped",[100]],[[119994,119994],"disallowed"],[[119995,119995],"mapped",[102]],[[119996,119996],"disallowed"],[[119997,119997],"mapped",[104]],[[119998,119998],"mapped",[105]],[[119999,119999],"mapped",[106]],[[120000,120000],"mapped",[107]],[[120001,120001],"mapped",[108]],[[120002,120002],"mapped",[109]],[[120003,120003],"mapped",[110]],[[120004,120004],"disallowed"],[[120005,120005],"mapped",[112]],[[120006,120006],"mapped",[113]],[[120007,120007],"mapped",[114]],[[120008,120008],"mapped",[115]],[[120009,120009],"mapped",[116]],[[120010,120010],"mapped",[117]],[[120011,120011],"mapped",[118]],[[120012,120012],"mapped",[119]],[[120013,120013],"mapped",[120]],[[120014,120014],"mapped",[121]],[[120015,120015],"mapped",[122]],[[120016,120016],"mapped",[97]],[[120017,120017],"mapped",[98]],[[120018,120018],"mapped",[99]],[[120019,120019],"mapped",[100]],[[120020,120020],"mapped",[101]],[[120021,120021],"mapped",[102]],[[120022,120022],"mapped",[103]],[[120023,120023],"mapped",[104]],[[120024,120024],"mapped",[105]],[[120025,120025],"mapped",[106]],[[120026,120026],"mapped",[107]],[[120027,120027],"mapped",[108]],[[120028,120028],"mapped",[109]],[[120029,120029],"mapped",[110]],[[120030,120030],"mapped",[111]],[[120031,120031],"mapped",[112]],[[120032,120032],"mapped",[113]],[[120033,120033],"mapped",[114]],[[120034,120034],"mapped",[115]],[[120035,120035],"mapped",[116]],[[120036,120036],"mapped",[117]],[[120037,120037],"mapped",[118]],[[120038,120038],"mapped",[119]],[[120039,120039],"mapped",[120]],[[120040,120040],"mapped",[121]],[[120041,120041],"mapped",[122]],[[120042,120042],"mapped",[97]],[[120043,120043],"mapped",[98]],[[120044,120044],"mapped",[99]],[[120045,120045],"mapped",[100]],[[120046,120046],"mapped",[101]],[[120047,120047],"mapped",[102]],[[120048,120048],"mapped",[103]],[[120049,120049],"mapped",[104]],[[120050,120050],"mapped",[105]],[[120051,120051],"mapped",[106]],[[120052,120052],"mapped",[107]],[[120053,120053],"mapped",[108]],[[120054,120054],"mapped",[109]],[[120055,120055],"mapped",[110]],[[120056,120056],"mapped",[111]],[[120057,120057],"mapped",[112]],[[120058,120058],"mapped",[113]],[[120059,120059],"mapped",[114]],[[120060,120060],"mapped",[115]],[[120061,120061],"mapped",[116]],[[120062,120062],"mapped",[117]],[[120063,120063],"mapped",[118]],[[120064,120064],"mapped",[119]],[[120065,120065],"mapped",[120]],[[120066,120066],"mapped",[121]],[[120067,120067],"mapped",[122]],[[120068,120068],"mapped",[97]],[[120069,120069],"mapped",[98]],[[120070,120070],"disallowed"],[[120071,120071],"mapped",[100]],[[120072,120072],"mapped",[101]],[[120073,120073],"mapped",[102]],[[120074,120074],"mapped",[103]],[[120075,120076],"disallowed"],[[120077,120077],"mapped",[106]],[[120078,120078],"mapped",[107]],[[120079,120079],"mapped",[108]],[[120080,120080],"mapped",[109]],[[120081,120081],"mapped",[110]],[[120082,120082],"mapped",[111]],[[120083,120083],"mapped",[112]],[[120084,120084],"mapped",[113]],[[120085,120085],"disallowed"],[[120086,120086],"mapped",[115]],[[120087,120087],"mapped",[116]],[[120088,120088],"mapped",[117]],[[120089,120089],"mapped",[118]],[[120090,120090],"mapped",[119]],[[120091,120091],"mapped",[120]],[[120092,120092],"mapped",[121]],[[120093,120093],"disallowed"],[[120094,120094],"mapped",[97]],[[120095,120095],"mapped",[98]],[[120096,120096],"mapped",[99]],[[120097,120097],"mapped",[100]],[[120098,120098],"mapped",[101]],[[120099,120099],"mapped",[102]],[[120100,120100],"mapped",[103]],[[120101,120101],"mapped",[104]],[[120102,120102],"mapped",[105]],[[120103,120103],"mapped",[106]],[[120104,120104],"mapped",[107]],[[120105,120105],"mapped",[108]],[[120106,120106],"mapped",[109]],[[120107,120107],"mapped",[110]],[[120108,120108],"mapped",[111]],[[120109,120109],"mapped",[112]],[[120110,120110],"mapped",[113]],[[120111,120111],"mapped",[114]],[[120112,120112],"mapped",[115]],[[120113,120113],"mapped",[116]],[[120114,120114],"mapped",[117]],[[120115,120115],"mapped",[118]],[[120116,120116],"mapped",[119]],[[120117,120117],"mapped",[120]],[[120118,120118],"mapped",[121]],[[120119,120119],"mapped",[122]],[[120120,120120],"mapped",[97]],[[120121,120121],"mapped",[98]],[[120122,120122],"disallowed"],[[120123,120123],"mapped",[100]],[[120124,120124],"mapped",[101]],[[120125,120125],"mapped",[102]],[[120126,120126],"mapped",[103]],[[120127,120127],"disallowed"],[[120128,120128],"mapped",[105]],[[120129,120129],"mapped",[106]],[[120130,120130],"mapped",[107]],[[120131,120131],"mapped",[108]],[[120132,120132],"mapped",[109]],[[120133,120133],"disallowed"],[[120134,120134],"mapped",[111]],[[120135,120137],"disallowed"],[[120138,120138],"mapped",[115]],[[120139,120139],"mapped",[116]],[[120140,120140],"mapped",[117]],[[120141,120141],"mapped",[118]],[[120142,120142],"mapped",[119]],[[120143,120143],"mapped",[120]],[[120144,120144],"mapped",[121]],[[120145,120145],"disallowed"],[[120146,120146],"mapped",[97]],[[120147,120147],"mapped",[98]],[[120148,120148],"mapped",[99]],[[120149,120149],"mapped",[100]],[[120150,120150],"mapped",[101]],[[120151,120151],"mapped",[102]],[[120152,120152],"mapped",[103]],[[120153,120153],"mapped",[104]],[[120154,120154],"mapped",[105]],[[120155,120155],"mapped",[106]],[[120156,120156],"mapped",[107]],[[120157,120157],"mapped",[108]],[[120158,120158],"mapped",[109]],[[120159,120159],"mapped",[110]],[[120160,120160],"mapped",[111]],[[120161,120161],"mapped",[112]],[[120162,120162],"mapped",[113]],[[120163,120163],"mapped",[114]],[[120164,120164],"mapped",[115]],[[120165,120165],"mapped",[116]],[[120166,120166],"mapped",[117]],[[120167,120167],"mapped",[118]],[[120168,120168],"mapped",[119]],[[120169,120169],"mapped",[120]],[[120170,120170],"mapped",[121]],[[120171,120171],"mapped",[122]],[[120172,120172],"mapped",[97]],[[120173,120173],"mapped",[98]],[[120174,120174],"mapped",[99]],[[120175,120175],"mapped",[100]],[[120176,120176],"mapped",[101]],[[120177,120177],"mapped",[102]],[[120178,120178],"mapped",[103]],[[120179,120179],"mapped",[104]],[[120180,120180],"mapped",[105]],[[120181,120181],"mapped",[106]],[[120182,120182],"mapped",[107]],[[120183,120183],"mapped",[108]],[[120184,120184],"mapped",[109]],[[120185,120185],"mapped",[110]],[[120186,120186],"mapped",[111]],[[120187,120187],"mapped",[112]],[[120188,120188],"mapped",[113]],[[120189,120189],"mapped",[114]],[[120190,120190],"mapped",[115]],[[120191,120191],"mapped",[116]],[[120192,120192],"mapped",[117]],[[120193,120193],"mapped",[118]],[[120194,120194],"mapped",[119]],[[120195,120195],"mapped",[120]],[[120196,120196],"mapped",[121]],[[120197,120197],"mapped",[122]],[[120198,120198],"mapped",[97]],[[120199,120199],"mapped",[98]],[[120200,120200],"mapped",[99]],[[120201,120201],"mapped",[100]],[[120202,120202],"mapped",[101]],[[120203,120203],"mapped",[102]],[[120204,120204],"mapped",[103]],[[120205,120205],"mapped",[104]],[[120206,120206],"mapped",[105]],[[120207,120207],"mapped",[106]],[[120208,120208],"mapped",[107]],[[120209,120209],"mapped",[108]],[[120210,120210],"mapped",[109]],[[120211,120211],"mapped",[110]],[[120212,120212],"mapped",[111]],[[120213,120213],"mapped",[112]],[[120214,120214],"mapped",[113]],[[120215,120215],"mapped",[114]],[[120216,120216],"mapped",[115]],[[120217,120217],"mapped",[116]],[[120218,120218],"mapped",[117]],[[120219,120219],"mapped",[118]],[[120220,120220],"mapped",[119]],[[120221,120221],"mapped",[120]],[[120222,120222],"mapped",[121]],[[120223,120223],"mapped",[122]],[[120224,120224],"mapped",[97]],[[120225,120225],"mapped",[98]],[[120226,120226],"mapped",[99]],[[120227,120227],"mapped",[100]],[[120228,120228],"mapped",[101]],[[120229,120229],"mapped",[102]],[[120230,120230],"mapped",[103]],[[120231,120231],"mapped",[104]],[[120232,120232],"mapped",[105]],[[120233,120233],"mapped",[106]],[[120234,120234],"mapped",[107]],[[120235,120235],"mapped",[108]],[[120236,120236],"mapped",[109]],[[120237,120237],"mapped",[110]],[[120238,120238],"mapped",[111]],[[120239,120239],"mapped",[112]],[[120240,120240],"mapped",[113]],[[120241,120241],"mapped",[114]],[[120242,120242],"mapped",[115]],[[120243,120243],"mapped",[116]],[[120244,120244],"mapped",[117]],[[120245,120245],"mapped",[118]],[[120246,120246],"mapped",[119]],[[120247,120247],"mapped",[120]],[[120248,120248],"mapped",[121]],[[120249,120249],"mapped",[122]],[[120250,120250],"mapped",[97]],[[120251,120251],"mapped",[98]],[[120252,120252],"mapped",[99]],[[120253,120253],"mapped",[100]],[[120254,120254],"mapped",[101]],[[120255,120255],"mapped",[102]],[[120256,120256],"mapped",[103]],[[120257,120257],"mapped",[104]],[[120258,120258],"mapped",[105]],[[120259,120259],"mapped",[106]],[[120260,120260],"mapped",[107]],[[120261,120261],"mapped",[108]],[[120262,120262],"mapped",[109]],[[120263,120263],"mapped",[110]],[[120264,120264],"mapped",[111]],[[120265,120265],"mapped",[112]],[[120266,120266],"mapped",[113]],[[120267,120267],"mapped",[114]],[[120268,120268],"mapped",[115]],[[120269,120269],"mapped",[116]],[[120270,120270],"mapped",[117]],[[120271,120271],"mapped",[118]],[[120272,120272],"mapped",[119]],[[120273,120273],"mapped",[120]],[[120274,120274],"mapped",[121]],[[120275,120275],"mapped",[122]],[[120276,120276],"mapped",[97]],[[120277,120277],"mapped",[98]],[[120278,120278],"mapped",[99]],[[120279,120279],"mapped",[100]],[[120280,120280],"mapped",[101]],[[120281,120281],"mapped",[102]],[[120282,120282],"mapped",[103]],[[120283,120283],"mapped",[104]],[[120284,120284],"mapped",[105]],[[120285,120285],"mapped",[106]],[[120286,120286],"mapped",[107]],[[120287,120287],"mapped",[108]],[[120288,120288],"mapped",[109]],[[120289,120289],"mapped",[110]],[[120290,120290],"mapped",[111]],[[120291,120291],"mapped",[112]],[[120292,120292],"mapped",[113]],[[120293,120293],"mapped",[114]],[[120294,120294],"mapped",[115]],[[120295,120295],"mapped",[116]],[[120296,120296],"mapped",[117]],[[120297,120297],"mapped",[118]],[[120298,120298],"mapped",[119]],[[120299,120299],"mapped",[120]],[[120300,120300],"mapped",[121]],[[120301,120301],"mapped",[122]],[[120302,120302],"mapped",[97]],[[120303,120303],"mapped",[98]],[[120304,120304],"mapped",[99]],[[120305,120305],"mapped",[100]],[[120306,120306],"mapped",[101]],[[120307,120307],"mapped",[102]],[[120308,120308],"mapped",[103]],[[120309,120309],"mapped",[104]],[[120310,120310],"mapped",[105]],[[120311,120311],"mapped",[106]],[[120312,120312],"mapped",[107]],[[120313,120313],"mapped",[108]],[[120314,120314],"mapped",[109]],[[120315,120315],"mapped",[110]],[[120316,120316],"mapped",[111]],[[120317,120317],"mapped",[112]],[[120318,120318],"mapped",[113]],[[120319,120319],"mapped",[114]],[[120320,120320],"mapped",[115]],[[120321,120321],"mapped",[116]],[[120322,120322],"mapped",[117]],[[120323,120323],"mapped",[118]],[[120324,120324],"mapped",[119]],[[120325,120325],"mapped",[120]],[[120326,120326],"mapped",[121]],[[120327,120327],"mapped",[122]],[[120328,120328],"mapped",[97]],[[120329,120329],"mapped",[98]],[[120330,120330],"mapped",[99]],[[120331,120331],"mapped",[100]],[[120332,120332],"mapped",[101]],[[120333,120333],"mapped",[102]],[[120334,120334],"mapped",[103]],[[120335,120335],"mapped",[104]],[[120336,120336],"mapped",[105]],[[120337,120337],"mapped",[106]],[[120338,120338],"mapped",[107]],[[120339,120339],"mapped",[108]],[[120340,120340],"mapped",[109]],[[120341,120341],"mapped",[110]],[[120342,120342],"mapped",[111]],[[120343,120343],"mapped",[112]],[[120344,120344],"mapped",[113]],[[120345,120345],"mapped",[114]],[[120346,120346],"mapped",[115]],[[120347,120347],"mapped",[116]],[[120348,120348],"mapped",[117]],[[120349,120349],"mapped",[118]],[[120350,120350],"mapped",[119]],[[120351,120351],"mapped",[120]],[[120352,120352],"mapped",[121]],[[120353,120353],"mapped",[122]],[[120354,120354],"mapped",[97]],[[120355,120355],"mapped",[98]],[[120356,120356],"mapped",[99]],[[120357,120357],"mapped",[100]],[[120358,120358],"mapped",[101]],[[120359,120359],"mapped",[102]],[[120360,120360],"mapped",[103]],[[120361,120361],"mapped",[104]],[[120362,120362],"mapped",[105]],[[120363,120363],"mapped",[106]],[[120364,120364],"mapped",[107]],[[120365,120365],"mapped",[108]],[[120366,120366],"mapped",[109]],[[120367,120367],"mapped",[110]],[[120368,120368],"mapped",[111]],[[120369,120369],"mapped",[112]],[[120370,120370],"mapped",[113]],[[120371,120371],"mapped",[114]],[[120372,120372],"mapped",[115]],[[120373,120373],"mapped",[116]],[[120374,120374],"mapped",[117]],[[120375,120375],"mapped",[118]],[[120376,120376],"mapped",[119]],[[120377,120377],"mapped",[120]],[[120378,120378],"mapped",[121]],[[120379,120379],"mapped",[122]],[[120380,120380],"mapped",[97]],[[120381,120381],"mapped",[98]],[[120382,120382],"mapped",[99]],[[120383,120383],"mapped",[100]],[[120384,120384],"mapped",[101]],[[120385,120385],"mapped",[102]],[[120386,120386],"mapped",[103]],[[120387,120387],"mapped",[104]],[[120388,120388],"mapped",[105]],[[120389,120389],"mapped",[106]],[[120390,120390],"mapped",[107]],[[120391,120391],"mapped",[108]],[[120392,120392],"mapped",[109]],[[120393,120393],"mapped",[110]],[[120394,120394],"mapped",[111]],[[120395,120395],"mapped",[112]],[[120396,120396],"mapped",[113]],[[120397,120397],"mapped",[114]],[[120398,120398],"mapped",[115]],[[120399,120399],"mapped",[116]],[[120400,120400],"mapped",[117]],[[120401,120401],"mapped",[118]],[[120402,120402],"mapped",[119]],[[120403,120403],"mapped",[120]],[[120404,120404],"mapped",[121]],[[120405,120405],"mapped",[122]],[[120406,120406],"mapped",[97]],[[120407,120407],"mapped",[98]],[[120408,120408],"mapped",[99]],[[120409,120409],"mapped",[100]],[[120410,120410],"mapped",[101]],[[120411,120411],"mapped",[102]],[[120412,120412],"mapped",[103]],[[120413,120413],"mapped",[104]],[[120414,120414],"mapped",[105]],[[120415,120415],"mapped",[106]],[[120416,120416],"mapped",[107]],[[120417,120417],"mapped",[108]],[[120418,120418],"mapped",[109]],[[120419,120419],"mapped",[110]],[[120420,120420],"mapped",[111]],[[120421,120421],"mapped",[112]],[[120422,120422],"mapped",[113]],[[120423,120423],"mapped",[114]],[[120424,120424],"mapped",[115]],[[120425,120425],"mapped",[116]],[[120426,120426],"mapped",[117]],[[120427,120427],"mapped",[118]],[[120428,120428],"mapped",[119]],[[120429,120429],"mapped",[120]],[[120430,120430],"mapped",[121]],[[120431,120431],"mapped",[122]],[[120432,120432],"mapped",[97]],[[120433,120433],"mapped",[98]],[[120434,120434],"mapped",[99]],[[120435,120435],"mapped",[100]],[[120436,120436],"mapped",[101]],[[120437,120437],"mapped",[102]],[[120438,120438],"mapped",[103]],[[120439,120439],"mapped",[104]],[[120440,120440],"mapped",[105]],[[120441,120441],"mapped",[106]],[[120442,120442],"mapped",[107]],[[120443,120443],"mapped",[108]],[[120444,120444],"mapped",[109]],[[120445,120445],"mapped",[110]],[[120446,120446],"mapped",[111]],[[120447,120447],"mapped",[112]],[[120448,120448],"mapped",[113]],[[120449,120449],"mapped",[114]],[[120450,120450],"mapped",[115]],[[120451,120451],"mapped",[116]],[[120452,120452],"mapped",[117]],[[120453,120453],"mapped",[118]],[[120454,120454],"mapped",[119]],[[120455,120455],"mapped",[120]],[[120456,120456],"mapped",[121]],[[120457,120457],"mapped",[122]],[[120458,120458],"mapped",[97]],[[120459,120459],"mapped",[98]],[[120460,120460],"mapped",[99]],[[120461,120461],"mapped",[100]],[[120462,120462],"mapped",[101]],[[120463,120463],"mapped",[102]],[[120464,120464],"mapped",[103]],[[120465,120465],"mapped",[104]],[[120466,120466],"mapped",[105]],[[120467,120467],"mapped",[106]],[[120468,120468],"mapped",[107]],[[120469,120469],"mapped",[108]],[[120470,120470],"mapped",[109]],[[120471,120471],"mapped",[110]],[[120472,120472],"mapped",[111]],[[120473,120473],"mapped",[112]],[[120474,120474],"mapped",[113]],[[120475,120475],"mapped",[114]],[[120476,120476],"mapped",[115]],[[120477,120477],"mapped",[116]],[[120478,120478],"mapped",[117]],[[120479,120479],"mapped",[118]],[[120480,120480],"mapped",[119]],[[120481,120481],"mapped",[120]],[[120482,120482],"mapped",[121]],[[120483,120483],"mapped",[122]],[[120484,120484],"mapped",[305]],[[120485,120485],"mapped",[567]],[[120486,120487],"disallowed"],[[120488,120488],"mapped",[945]],[[120489,120489],"mapped",[946]],[[120490,120490],"mapped",[947]],[[120491,120491],"mapped",[948]],[[120492,120492],"mapped",[949]],[[120493,120493],"mapped",[950]],[[120494,120494],"mapped",[951]],[[120495,120495],"mapped",[952]],[[120496,120496],"mapped",[953]],[[120497,120497],"mapped",[954]],[[120498,120498],"mapped",[955]],[[120499,120499],"mapped",[956]],[[120500,120500],"mapped",[957]],[[120501,120501],"mapped",[958]],[[120502,120502],"mapped",[959]],[[120503,120503],"mapped",[960]],[[120504,120504],"mapped",[961]],[[120505,120505],"mapped",[952]],[[120506,120506],"mapped",[963]],[[120507,120507],"mapped",[964]],[[120508,120508],"mapped",[965]],[[120509,120509],"mapped",[966]],[[120510,120510],"mapped",[967]],[[120511,120511],"mapped",[968]],[[120512,120512],"mapped",[969]],[[120513,120513],"mapped",[8711]],[[120514,120514],"mapped",[945]],[[120515,120515],"mapped",[946]],[[120516,120516],"mapped",[947]],[[120517,120517],"mapped",[948]],[[120518,120518],"mapped",[949]],[[120519,120519],"mapped",[950]],[[120520,120520],"mapped",[951]],[[120521,120521],"mapped",[952]],[[120522,120522],"mapped",[953]],[[120523,120523],"mapped",[954]],[[120524,120524],"mapped",[955]],[[120525,120525],"mapped",[956]],[[120526,120526],"mapped",[957]],[[120527,120527],"mapped",[958]],[[120528,120528],"mapped",[959]],[[120529,120529],"mapped",[960]],[[120530,120530],"mapped",[961]],[[120531,120532],"mapped",[963]],[[120533,120533],"mapped",[964]],[[120534,120534],"mapped",[965]],[[120535,120535],"mapped",[966]],[[120536,120536],"mapped",[967]],[[120537,120537],"mapped",[968]],[[120538,120538],"mapped",[969]],[[120539,120539],"mapped",[8706]],[[120540,120540],"mapped",[949]],[[120541,120541],"mapped",[952]],[[120542,120542],"mapped",[954]],[[120543,120543],"mapped",[966]],[[120544,120544],"mapped",[961]],[[120545,120545],"mapped",[960]],[[120546,120546],"mapped",[945]],[[120547,120547],"mapped",[946]],[[120548,120548],"mapped",[947]],[[120549,120549],"mapped",[948]],[[120550,120550],"mapped",[949]],[[120551,120551],"mapped",[950]],[[120552,120552],"mapped",[951]],[[120553,120553],"mapped",[952]],[[120554,120554],"mapped",[953]],[[120555,120555],"mapped",[954]],[[120556,120556],"mapped",[955]],[[120557,120557],"mapped",[956]],[[120558,120558],"mapped",[957]],[[120559,120559],"mapped",[958]],[[120560,120560],"mapped",[959]],[[120561,120561],"mapped",[960]],[[120562,120562],"mapped",[961]],[[120563,120563],"mapped",[952]],[[120564,120564],"mapped",[963]],[[120565,120565],"mapped",[964]],[[120566,120566],"mapped",[965]],[[120567,120567],"mapped",[966]],[[120568,120568],"mapped",[967]],[[120569,120569],"mapped",[968]],[[120570,120570],"mapped",[969]],[[120571,120571],"mapped",[8711]],[[120572,120572],"mapped",[945]],[[120573,120573],"mapped",[946]],[[120574,120574],"mapped",[947]],[[120575,120575],"mapped",[948]],[[120576,120576],"mapped",[949]],[[120577,120577],"mapped",[950]],[[120578,120578],"mapped",[951]],[[120579,120579],"mapped",[952]],[[120580,120580],"mapped",[953]],[[120581,120581],"mapped",[954]],[[120582,120582],"mapped",[955]],[[120583,120583],"mapped",[956]],[[120584,120584],"mapped",[957]],[[120585,120585],"mapped",[958]],[[120586,120586],"mapped",[959]],[[120587,120587],"mapped",[960]],[[120588,120588],"mapped",[961]],[[120589,120590],"mapped",[963]],[[120591,120591],"mapped",[964]],[[120592,120592],"mapped",[965]],[[120593,120593],"mapped",[966]],[[120594,120594],"mapped",[967]],[[120595,120595],"mapped",[968]],[[120596,120596],"mapped",[969]],[[120597,120597],"mapped",[8706]],[[120598,120598],"mapped",[949]],[[120599,120599],"mapped",[952]],[[120600,120600],"mapped",[954]],[[120601,120601],"mapped",[966]],[[120602,120602],"mapped",[961]],[[120603,120603],"mapped",[960]],[[120604,120604],"mapped",[945]],[[120605,120605],"mapped",[946]],[[120606,120606],"mapped",[947]],[[120607,120607],"mapped",[948]],[[120608,120608],"mapped",[949]],[[120609,120609],"mapped",[950]],[[120610,120610],"mapped",[951]],[[120611,120611],"mapped",[952]],[[120612,120612],"mapped",[953]],[[120613,120613],"mapped",[954]],[[120614,120614],"mapped",[955]],[[120615,120615],"mapped",[956]],[[120616,120616],"mapped",[957]],[[120617,120617],"mapped",[958]],[[120618,120618],"mapped",[959]],[[120619,120619],"mapped",[960]],[[120620,120620],"mapped",[961]],[[120621,120621],"mapped",[952]],[[120622,120622],"mapped",[963]],[[120623,120623],"mapped",[964]],[[120624,120624],"mapped",[965]],[[120625,120625],"mapped",[966]],[[120626,120626],"mapped",[967]],[[120627,120627],"mapped",[968]],[[120628,120628],"mapped",[969]],[[120629,120629],"mapped",[8711]],[[120630,120630],"mapped",[945]],[[120631,120631],"mapped",[946]],[[120632,120632],"mapped",[947]],[[120633,120633],"mapped",[948]],[[120634,120634],"mapped",[949]],[[120635,120635],"mapped",[950]],[[120636,120636],"mapped",[951]],[[120637,120637],"mapped",[952]],[[120638,120638],"mapped",[953]],[[120639,120639],"mapped",[954]],[[120640,120640],"mapped",[955]],[[120641,120641],"mapped",[956]],[[120642,120642],"mapped",[957]],[[120643,120643],"mapped",[958]],[[120644,120644],"mapped",[959]],[[120645,120645],"mapped",[960]],[[120646,120646],"mapped",[961]],[[120647,120648],"mapped",[963]],[[120649,120649],"mapped",[964]],[[120650,120650],"mapped",[965]],[[120651,120651],"mapped",[966]],[[120652,120652],"mapped",[967]],[[120653,120653],"mapped",[968]],[[120654,120654],"mapped",[969]],[[120655,120655],"mapped",[8706]],[[120656,120656],"mapped",[949]],[[120657,120657],"mapped",[952]],[[120658,120658],"mapped",[954]],[[120659,120659],"mapped",[966]],[[120660,120660],"mapped",[961]],[[120661,120661],"mapped",[960]],[[120662,120662],"mapped",[945]],[[120663,120663],"mapped",[946]],[[120664,120664],"mapped",[947]],[[120665,120665],"mapped",[948]],[[120666,120666],"mapped",[949]],[[120667,120667],"mapped",[950]],[[120668,120668],"mapped",[951]],[[120669,120669],"mapped",[952]],[[120670,120670],"mapped",[953]],[[120671,120671],"mapped",[954]],[[120672,120672],"mapped",[955]],[[120673,120673],"mapped",[956]],[[120674,120674],"mapped",[957]],[[120675,120675],"mapped",[958]],[[120676,120676],"mapped",[959]],[[120677,120677],"mapped",[960]],[[120678,120678],"mapped",[961]],[[120679,120679],"mapped",[952]],[[120680,120680],"mapped",[963]],[[120681,120681],"mapped",[964]],[[120682,120682],"mapped",[965]],[[120683,120683],"mapped",[966]],[[120684,120684],"mapped",[967]],[[120685,120685],"mapped",[968]],[[120686,120686],"mapped",[969]],[[120687,120687],"mapped",[8711]],[[120688,120688],"mapped",[945]],[[120689,120689],"mapped",[946]],[[120690,120690],"mapped",[947]],[[120691,120691],"mapped",[948]],[[120692,120692],"mapped",[949]],[[120693,120693],"mapped",[950]],[[120694,120694],"mapped",[951]],[[120695,120695],"mapped",[952]],[[120696,120696],"mapped",[953]],[[120697,120697],"mapped",[954]],[[120698,120698],"mapped",[955]],[[120699,120699],"mapped",[956]],[[120700,120700],"mapped",[957]],[[120701,120701],"mapped",[958]],[[120702,120702],"mapped",[959]],[[120703,120703],"mapped",[960]],[[120704,120704],"mapped",[961]],[[120705,120706],"mapped",[963]],[[120707,120707],"mapped",[964]],[[120708,120708],"mapped",[965]],[[120709,120709],"mapped",[966]],[[120710,120710],"mapped",[967]],[[120711,120711],"mapped",[968]],[[120712,120712],"mapped",[969]],[[120713,120713],"mapped",[8706]],[[120714,120714],"mapped",[949]],[[120715,120715],"mapped",[952]],[[120716,120716],"mapped",[954]],[[120717,120717],"mapped",[966]],[[120718,120718],"mapped",[961]],[[120719,120719],"mapped",[960]],[[120720,120720],"mapped",[945]],[[120721,120721],"mapped",[946]],[[120722,120722],"mapped",[947]],[[120723,120723],"mapped",[948]],[[120724,120724],"mapped",[949]],[[120725,120725],"mapped",[950]],[[120726,120726],"mapped",[951]],[[120727,120727],"mapped",[952]],[[120728,120728],"mapped",[953]],[[120729,120729],"mapped",[954]],[[120730,120730],"mapped",[955]],[[120731,120731],"mapped",[956]],[[120732,120732],"mapped",[957]],[[120733,120733],"mapped",[958]],[[120734,120734],"mapped",[959]],[[120735,120735],"mapped",[960]],[[120736,120736],"mapped",[961]],[[120737,120737],"mapped",[952]],[[120738,120738],"mapped",[963]],[[120739,120739],"mapped",[964]],[[120740,120740],"mapped",[965]],[[120741,120741],"mapped",[966]],[[120742,120742],"mapped",[967]],[[120743,120743],"mapped",[968]],[[120744,120744],"mapped",[969]],[[120745,120745],"mapped",[8711]],[[120746,120746],"mapped",[945]],[[120747,120747],"mapped",[946]],[[120748,120748],"mapped",[947]],[[120749,120749],"mapped",[948]],[[120750,120750],"mapped",[949]],[[120751,120751],"mapped",[950]],[[120752,120752],"mapped",[951]],[[120753,120753],"mapped",[952]],[[120754,120754],"mapped",[953]],[[120755,120755],"mapped",[954]],[[120756,120756],"mapped",[955]],[[120757,120757],"mapped",[956]],[[120758,120758],"mapped",[957]],[[120759,120759],"mapped",[958]],[[120760,120760],"mapped",[959]],[[120761,120761],"mapped",[960]],[[120762,120762],"mapped",[961]],[[120763,120764],"mapped",[963]],[[120765,120765],"mapped",[964]],[[120766,120766],"mapped",[965]],[[120767,120767],"mapped",[966]],[[120768,120768],"mapped",[967]],[[120769,120769],"mapped",[968]],[[120770,120770],"mapped",[969]],[[120771,120771],"mapped",[8706]],[[120772,120772],"mapped",[949]],[[120773,120773],"mapped",[952]],[[120774,120774],"mapped",[954]],[[120775,120775],"mapped",[966]],[[120776,120776],"mapped",[961]],[[120777,120777],"mapped",[960]],[[120778,120779],"mapped",[989]],[[120780,120781],"disallowed"],[[120782,120782],"mapped",[48]],[[120783,120783],"mapped",[49]],[[120784,120784],"mapped",[50]],[[120785,120785],"mapped",[51]],[[120786,120786],"mapped",[52]],[[120787,120787],"mapped",[53]],[[120788,120788],"mapped",[54]],[[120789,120789],"mapped",[55]],[[120790,120790],"mapped",[56]],[[120791,120791],"mapped",[57]],[[120792,120792],"mapped",[48]],[[120793,120793],"mapped",[49]],[[120794,120794],"mapped",[50]],[[120795,120795],"mapped",[51]],[[120796,120796],"mapped",[52]],[[120797,120797],"mapped",[53]],[[120798,120798],"mapped",[54]],[[120799,120799],"mapped",[55]],[[120800,120800],"mapped",[56]],[[120801,120801],"mapped",[57]],[[120802,120802],"mapped",[48]],[[120803,120803],"mapped",[49]],[[120804,120804],"mapped",[50]],[[120805,120805],"mapped",[51]],[[120806,120806],"mapped",[52]],[[120807,120807],"mapped",[53]],[[120808,120808],"mapped",[54]],[[120809,120809],"mapped",[55]],[[120810,120810],"mapped",[56]],[[120811,120811],"mapped",[57]],[[120812,120812],"mapped",[48]],[[120813,120813],"mapped",[49]],[[120814,120814],"mapped",[50]],[[120815,120815],"mapped",[51]],[[120816,120816],"mapped",[52]],[[120817,120817],"mapped",[53]],[[120818,120818],"mapped",[54]],[[120819,120819],"mapped",[55]],[[120820,120820],"mapped",[56]],[[120821,120821],"mapped",[57]],[[120822,120822],"mapped",[48]],[[120823,120823],"mapped",[49]],[[120824,120824],"mapped",[50]],[[120825,120825],"mapped",[51]],[[120826,120826],"mapped",[52]],[[120827,120827],"mapped",[53]],[[120828,120828],"mapped",[54]],[[120829,120829],"mapped",[55]],[[120830,120830],"mapped",[56]],[[120831,120831],"mapped",[57]],[[120832,121343],"valid",[],"NV8"],[[121344,121398],"valid"],[[121399,121402],"valid",[],"NV8"],[[121403,121452],"valid"],[[121453,121460],"valid",[],"NV8"],[[121461,121461],"valid"],[[121462,121475],"valid",[],"NV8"],[[121476,121476],"valid"],[[121477,121483],"valid",[],"NV8"],[[121484,121498],"disallowed"],[[121499,121503],"valid"],[[121504,121504],"disallowed"],[[121505,121519],"valid"],[[121520,124927],"disallowed"],[[124928,125124],"valid"],[[125125,125126],"disallowed"],[[125127,125135],"valid",[],"NV8"],[[125136,125142],"valid"],[[125143,126463],"disallowed"],[[126464,126464],"mapped",[1575]],[[126465,126465],"mapped",[1576]],[[126466,126466],"mapped",[1580]],[[126467,126467],"mapped",[1583]],[[126468,126468],"disallowed"],[[126469,126469],"mapped",[1608]],[[126470,126470],"mapped",[1586]],[[126471,126471],"mapped",[1581]],[[126472,126472],"mapped",[1591]],[[126473,126473],"mapped",[1610]],[[126474,126474],"mapped",[1603]],[[126475,126475],"mapped",[1604]],[[126476,126476],"mapped",[1605]],[[126477,126477],"mapped",[1606]],[[126478,126478],"mapped",[1587]],[[126479,126479],"mapped",[1593]],[[126480,126480],"mapped",[1601]],[[126481,126481],"mapped",[1589]],[[126482,126482],"mapped",[1602]],[[126483,126483],"mapped",[1585]],[[126484,126484],"mapped",[1588]],[[126485,126485],"mapped",[1578]],[[126486,126486],"mapped",[1579]],[[126487,126487],"mapped",[1582]],[[126488,126488],"mapped",[1584]],[[126489,126489],"mapped",[1590]],[[126490,126490],"mapped",[1592]],[[126491,126491],"mapped",[1594]],[[126492,126492],"mapped",[1646]],[[126493,126493],"mapped",[1722]],[[126494,126494],"mapped",[1697]],[[126495,126495],"mapped",[1647]],[[126496,126496],"disallowed"],[[126497,126497],"mapped",[1576]],[[126498,126498],"mapped",[1580]],[[126499,126499],"disallowed"],[[126500,126500],"mapped",[1607]],[[126501,126502],"disallowed"],[[126503,126503],"mapped",[1581]],[[126504,126504],"disallowed"],[[126505,126505],"mapped",[1610]],[[126506,126506],"mapped",[1603]],[[126507,126507],"mapped",[1604]],[[126508,126508],"mapped",[1605]],[[126509,126509],"mapped",[1606]],[[126510,126510],"mapped",[1587]],[[126511,126511],"mapped",[1593]],[[126512,126512],"mapped",[1601]],[[126513,126513],"mapped",[1589]],[[126514,126514],"mapped",[1602]],[[126515,126515],"disallowed"],[[126516,126516],"mapped",[1588]],[[126517,126517],"mapped",[1578]],[[126518,126518],"mapped",[1579]],[[126519,126519],"mapped",[1582]],[[126520,126520],"disallowed"],[[126521,126521],"mapped",[1590]],[[126522,126522],"disallowed"],[[126523,126523],"mapped",[1594]],[[126524,126529],"disallowed"],[[126530,126530],"mapped",[1580]],[[126531,126534],"disallowed"],[[126535,126535],"mapped",[1581]],[[126536,126536],"disallowed"],[[126537,126537],"mapped",[1610]],[[126538,126538],"disallowed"],[[126539,126539],"mapped",[1604]],[[126540,126540],"disallowed"],[[126541,126541],"mapped",[1606]],[[126542,126542],"mapped",[1587]],[[126543,126543],"mapped",[1593]],[[126544,126544],"disallowed"],[[126545,126545],"mapped",[1589]],[[126546,126546],"mapped",[1602]],[[126547,126547],"disallowed"],[[126548,126548],"mapped",[1588]],[[126549,126550],"disallowed"],[[126551,126551],"mapped",[1582]],[[126552,126552],"disallowed"],[[126553,126553],"mapped",[1590]],[[126554,126554],"disallowed"],[[126555,126555],"mapped",[1594]],[[126556,126556],"disallowed"],[[126557,126557],"mapped",[1722]],[[126558,126558],"disallowed"],[[126559,126559],"mapped",[1647]],[[126560,126560],"disallowed"],[[126561,126561],"mapped",[1576]],[[126562,126562],"mapped",[1580]],[[126563,126563],"disallowed"],[[126564,126564],"mapped",[1607]],[[126565,126566],"disallowed"],[[126567,126567],"mapped",[1581]],[[126568,126568],"mapped",[1591]],[[126569,126569],"mapped",[1610]],[[126570,126570],"mapped",[1603]],[[126571,126571],"disallowed"],[[126572,126572],"mapped",[1605]],[[126573,126573],"mapped",[1606]],[[126574,126574],"mapped",[1587]],[[126575,126575],"mapped",[1593]],[[126576,126576],"mapped",[1601]],[[126577,126577],"mapped",[1589]],[[126578,126578],"mapped",[1602]],[[126579,126579],"disallowed"],[[126580,126580],"mapped",[1588]],[[126581,126581],"mapped",[1578]],[[126582,126582],"mapped",[1579]],[[126583,126583],"mapped",[1582]],[[126584,126584],"disallowed"],[[126585,126585],"mapped",[1590]],[[126586,126586],"mapped",[1592]],[[126587,126587],"mapped",[1594]],[[126588,126588],"mapped",[1646]],[[126589,126589],"disallowed"],[[126590,126590],"mapped",[1697]],[[126591,126591],"disallowed"],[[126592,126592],"mapped",[1575]],[[126593,126593],"mapped",[1576]],[[126594,126594],"mapped",[1580]],[[126595,126595],"mapped",[1583]],[[126596,126596],"mapped",[1607]],[[126597,126597],"mapped",[1608]],[[126598,126598],"mapped",[1586]],[[126599,126599],"mapped",[1581]],[[126600,126600],"mapped",[1591]],[[126601,126601],"mapped",[1610]],[[126602,126602],"disallowed"],[[126603,126603],"mapped",[1604]],[[126604,126604],"mapped",[1605]],[[126605,126605],"mapped",[1606]],[[126606,126606],"mapped",[1587]],[[126607,126607],"mapped",[1593]],[[126608,126608],"mapped",[1601]],[[126609,126609],"mapped",[1589]],[[126610,126610],"mapped",[1602]],[[126611,126611],"mapped",[1585]],[[126612,126612],"mapped",[1588]],[[126613,126613],"mapped",[1578]],[[126614,126614],"mapped",[1579]],[[126615,126615],"mapped",[1582]],[[126616,126616],"mapped",[1584]],[[126617,126617],"mapped",[1590]],[[126618,126618],"mapped",[1592]],[[126619,126619],"mapped",[1594]],[[126620,126624],"disallowed"],[[126625,126625],"mapped",[1576]],[[126626,126626],"mapped",[1580]],[[126627,126627],"mapped",[1583]],[[126628,126628],"disallowed"],[[126629,126629],"mapped",[1608]],[[126630,126630],"mapped",[1586]],[[126631,126631],"mapped",[1581]],[[126632,126632],"mapped",[1591]],[[126633,126633],"mapped",[1610]],[[126634,126634],"disallowed"],[[126635,126635],"mapped",[1604]],[[126636,126636],"mapped",[1605]],[[126637,126637],"mapped",[1606]],[[126638,126638],"mapped",[1587]],[[126639,126639],"mapped",[1593]],[[126640,126640],"mapped",[1601]],[[126641,126641],"mapped",[1589]],[[126642,126642],"mapped",[1602]],[[126643,126643],"mapped",[1585]],[[126644,126644],"mapped",[1588]],[[126645,126645],"mapped",[1578]],[[126646,126646],"mapped",[1579]],[[126647,126647],"mapped",[1582]],[[126648,126648],"mapped",[1584]],[[126649,126649],"mapped",[1590]],[[126650,126650],"mapped",[1592]],[[126651,126651],"mapped",[1594]],[[126652,126703],"disallowed"],[[126704,126705],"valid",[],"NV8"],[[126706,126975],"disallowed"],[[126976,127019],"valid",[],"NV8"],[[127020,127023],"disallowed"],[[127024,127123],"valid",[],"NV8"],[[127124,127135],"disallowed"],[[127136,127150],"valid",[],"NV8"],[[127151,127152],"disallowed"],[[127153,127166],"valid",[],"NV8"],[[127167,127167],"valid",[],"NV8"],[[127168,127168],"disallowed"],[[127169,127183],"valid",[],"NV8"],[[127184,127184],"disallowed"],[[127185,127199],"valid",[],"NV8"],[[127200,127221],"valid",[],"NV8"],[[127222,127231],"disallowed"],[[127232,127232],"disallowed"],[[127233,127233],"disallowed_STD3_mapped",[48,44]],[[127234,127234],"disallowed_STD3_mapped",[49,44]],[[127235,127235],"disallowed_STD3_mapped",[50,44]],[[127236,127236],"disallowed_STD3_mapped",[51,44]],[[127237,127237],"disallowed_STD3_mapped",[52,44]],[[127238,127238],"disallowed_STD3_mapped",[53,44]],[[127239,127239],"disallowed_STD3_mapped",[54,44]],[[127240,127240],"disallowed_STD3_mapped",[55,44]],[[127241,127241],"disallowed_STD3_mapped",[56,44]],[[127242,127242],"disallowed_STD3_mapped",[57,44]],[[127243,127244],"valid",[],"NV8"],[[127245,127247],"disallowed"],[[127248,127248],"disallowed_STD3_mapped",[40,97,41]],[[127249,127249],"disallowed_STD3_mapped",[40,98,41]],[[127250,127250],"disallowed_STD3_mapped",[40,99,41]],[[127251,127251],"disallowed_STD3_mapped",[40,100,41]],[[127252,127252],"disallowed_STD3_mapped",[40,101,41]],[[127253,127253],"disallowed_STD3_mapped",[40,102,41]],[[127254,127254],"disallowed_STD3_mapped",[40,103,41]],[[127255,127255],"disallowed_STD3_mapped",[40,104,41]],[[127256,127256],"disallowed_STD3_mapped",[40,105,41]],[[127257,127257],"disallowed_STD3_mapped",[40,106,41]],[[127258,127258],"disallowed_STD3_mapped",[40,107,41]],[[127259,127259],"disallowed_STD3_mapped",[40,108,41]],[[127260,127260],"disallowed_STD3_mapped",[40,109,41]],[[127261,127261],"disallowed_STD3_mapped",[40,110,41]],[[127262,127262],"disallowed_STD3_mapped",[40,111,41]],[[127263,127263],"disallowed_STD3_mapped",[40,112,41]],[[127264,127264],"disallowed_STD3_mapped",[40,113,41]],[[127265,127265],"disallowed_STD3_mapped",[40,114,41]],[[127266,127266],"disallowed_STD3_mapped",[40,115,41]],[[127267,127267],"disallowed_STD3_mapped",[40,116,41]],[[127268,127268],"disallowed_STD3_mapped",[40,117,41]],[[127269,127269],"disallowed_STD3_mapped",[40,118,41]],[[127270,127270],"disallowed_STD3_mapped",[40,119,41]],[[127271,127271],"disallowed_STD3_mapped",[40,120,41]],[[127272,127272],"disallowed_STD3_mapped",[40,121,41]],[[127273,127273],"disallowed_STD3_mapped",[40,122,41]],[[127274,127274],"mapped",[12308,115,12309]],[[127275,127275],"mapped",[99]],[[127276,127276],"mapped",[114]],[[127277,127277],"mapped",[99,100]],[[127278,127278],"mapped",[119,122]],[[127279,127279],"disallowed"],[[127280,127280],"mapped",[97]],[[127281,127281],"mapped",[98]],[[127282,127282],"mapped",[99]],[[127283,127283],"mapped",[100]],[[127284,127284],"mapped",[101]],[[127285,127285],"mapped",[102]],[[127286,127286],"mapped",[103]],[[127287,127287],"mapped",[104]],[[127288,127288],"mapped",[105]],[[127289,127289],"mapped",[106]],[[127290,127290],"mapped",[107]],[[127291,127291],"mapped",[108]],[[127292,127292],"mapped",[109]],[[127293,127293],"mapped",[110]],[[127294,127294],"mapped",[111]],[[127295,127295],"mapped",[112]],[[127296,127296],"mapped",[113]],[[127297,127297],"mapped",[114]],[[127298,127298],"mapped",[115]],[[127299,127299],"mapped",[116]],[[127300,127300],"mapped",[117]],[[127301,127301],"mapped",[118]],[[127302,127302],"mapped",[119]],[[127303,127303],"mapped",[120]],[[127304,127304],"mapped",[121]],[[127305,127305],"mapped",[122]],[[127306,127306],"mapped",[104,118]],[[127307,127307],"mapped",[109,118]],[[127308,127308],"mapped",[115,100]],[[127309,127309],"mapped",[115,115]],[[127310,127310],"mapped",[112,112,118]],[[127311,127311],"mapped",[119,99]],[[127312,127318],"valid",[],"NV8"],[[127319,127319],"valid",[],"NV8"],[[127320,127326],"valid",[],"NV8"],[[127327,127327],"valid",[],"NV8"],[[127328,127337],"valid",[],"NV8"],[[127338,127338],"mapped",[109,99]],[[127339,127339],"mapped",[109,100]],[[127340,127343],"disallowed"],[[127344,127352],"valid",[],"NV8"],[[127353,127353],"valid",[],"NV8"],[[127354,127354],"valid",[],"NV8"],[[127355,127356],"valid",[],"NV8"],[[127357,127358],"valid",[],"NV8"],[[127359,127359],"valid",[],"NV8"],[[127360,127369],"valid",[],"NV8"],[[127370,127373],"valid",[],"NV8"],[[127374,127375],"valid",[],"NV8"],[[127376,127376],"mapped",[100,106]],[[127377,127386],"valid",[],"NV8"],[[127387,127461],"disallowed"],[[127462,127487],"valid",[],"NV8"],[[127488,127488],"mapped",[12411,12363]],[[127489,127489],"mapped",[12467,12467]],[[127490,127490],"mapped",[12469]],[[127491,127503],"disallowed"],[[127504,127504],"mapped",[25163]],[[127505,127505],"mapped",[23383]],[[127506,127506],"mapped",[21452]],[[127507,127507],"mapped",[12487]],[[127508,127508],"mapped",[20108]],[[127509,127509],"mapped",[22810]],[[127510,127510],"mapped",[35299]],[[127511,127511],"mapped",[22825]],[[127512,127512],"mapped",[20132]],[[127513,127513],"mapped",[26144]],[[127514,127514],"mapped",[28961]],[[127515,127515],"mapped",[26009]],[[127516,127516],"mapped",[21069]],[[127517,127517],"mapped",[24460]],[[127518,127518],"mapped",[20877]],[[127519,127519],"mapped",[26032]],[[127520,127520],"mapped",[21021]],[[127521,127521],"mapped",[32066]],[[127522,127522],"mapped",[29983]],[[127523,127523],"mapped",[36009]],[[127524,127524],"mapped",[22768]],[[127525,127525],"mapped",[21561]],[[127526,127526],"mapped",[28436]],[[127527,127527],"mapped",[25237]],[[127528,127528],"mapped",[25429]],[[127529,127529],"mapped",[19968]],[[127530,127530],"mapped",[19977]],[[127531,127531],"mapped",[36938]],[[127532,127532],"mapped",[24038]],[[127533,127533],"mapped",[20013]],[[127534,127534],"mapped",[21491]],[[127535,127535],"mapped",[25351]],[[127536,127536],"mapped",[36208]],[[127537,127537],"mapped",[25171]],[[127538,127538],"mapped",[31105]],[[127539,127539],"mapped",[31354]],[[127540,127540],"mapped",[21512]],[[127541,127541],"mapped",[28288]],[[127542,127542],"mapped",[26377]],[[127543,127543],"mapped",[26376]],[[127544,127544],"mapped",[30003]],[[127545,127545],"mapped",[21106]],[[127546,127546],"mapped",[21942]],[[127547,127551],"disallowed"],[[127552,127552],"mapped",[12308,26412,12309]],[[127553,127553],"mapped",[12308,19977,12309]],[[127554,127554],"mapped",[12308,20108,12309]],[[127555,127555],"mapped",[12308,23433,12309]],[[127556,127556],"mapped",[12308,28857,12309]],[[127557,127557],"mapped",[12308,25171,12309]],[[127558,127558],"mapped",[12308,30423,12309]],[[127559,127559],"mapped",[12308,21213,12309]],[[127560,127560],"mapped",[12308,25943,12309]],[[127561,127567],"disallowed"],[[127568,127568],"mapped",[24471]],[[127569,127569],"mapped",[21487]],[[127570,127743],"disallowed"],[[127744,127776],"valid",[],"NV8"],[[127777,127788],"valid",[],"NV8"],[[127789,127791],"valid",[],"NV8"],[[127792,127797],"valid",[],"NV8"],[[127798,127798],"valid",[],"NV8"],[[127799,127868],"valid",[],"NV8"],[[127869,127869],"valid",[],"NV8"],[[127870,127871],"valid",[],"NV8"],[[127872,127891],"valid",[],"NV8"],[[127892,127903],"valid",[],"NV8"],[[127904,127940],"valid",[],"NV8"],[[127941,127941],"valid",[],"NV8"],[[127942,127946],"valid",[],"NV8"],[[127947,127950],"valid",[],"NV8"],[[127951,127955],"valid",[],"NV8"],[[127956,127967],"valid",[],"NV8"],[[127968,127984],"valid",[],"NV8"],[[127985,127991],"valid",[],"NV8"],[[127992,127999],"valid",[],"NV8"],[[128000,128062],"valid",[],"NV8"],[[128063,128063],"valid",[],"NV8"],[[128064,128064],"valid",[],"NV8"],[[128065,128065],"valid",[],"NV8"],[[128066,128247],"valid",[],"NV8"],[[128248,128248],"valid",[],"NV8"],[[128249,128252],"valid",[],"NV8"],[[128253,128254],"valid",[],"NV8"],[[128255,128255],"valid",[],"NV8"],[[128256,128317],"valid",[],"NV8"],[[128318,128319],"valid",[],"NV8"],[[128320,128323],"valid",[],"NV8"],[[128324,128330],"valid",[],"NV8"],[[128331,128335],"valid",[],"NV8"],[[128336,128359],"valid",[],"NV8"],[[128360,128377],"valid",[],"NV8"],[[128378,128378],"disallowed"],[[128379,128419],"valid",[],"NV8"],[[128420,128420],"disallowed"],[[128421,128506],"valid",[],"NV8"],[[128507,128511],"valid",[],"NV8"],[[128512,128512],"valid",[],"NV8"],[[128513,128528],"valid",[],"NV8"],[[128529,128529],"valid",[],"NV8"],[[128530,128532],"valid",[],"NV8"],[[128533,128533],"valid",[],"NV8"],[[128534,128534],"valid",[],"NV8"],[[128535,128535],"valid",[],"NV8"],[[128536,128536],"valid",[],"NV8"],[[128537,128537],"valid",[],"NV8"],[[128538,128538],"valid",[],"NV8"],[[128539,128539],"valid",[],"NV8"],[[128540,128542],"valid",[],"NV8"],[[128543,128543],"valid",[],"NV8"],[[128544,128549],"valid",[],"NV8"],[[128550,128551],"valid",[],"NV8"],[[128552,128555],"valid",[],"NV8"],[[128556,128556],"valid",[],"NV8"],[[128557,128557],"valid",[],"NV8"],[[128558,128559],"valid",[],"NV8"],[[128560,128563],"valid",[],"NV8"],[[128564,128564],"valid",[],"NV8"],[[128565,128576],"valid",[],"NV8"],[[128577,128578],"valid",[],"NV8"],[[128579,128580],"valid",[],"NV8"],[[128581,128591],"valid",[],"NV8"],[[128592,128639],"valid",[],"NV8"],[[128640,128709],"valid",[],"NV8"],[[128710,128719],"valid",[],"NV8"],[[128720,128720],"valid",[],"NV8"],[[128721,128735],"disallowed"],[[128736,128748],"valid",[],"NV8"],[[128749,128751],"disallowed"],[[128752,128755],"valid",[],"NV8"],[[128756,128767],"disallowed"],[[128768,128883],"valid",[],"NV8"],[[128884,128895],"disallowed"],[[128896,128980],"valid",[],"NV8"],[[128981,129023],"disallowed"],[[129024,129035],"valid",[],"NV8"],[[129036,129039],"disallowed"],[[129040,129095],"valid",[],"NV8"],[[129096,129103],"disallowed"],[[129104,129113],"valid",[],"NV8"],[[129114,129119],"disallowed"],[[129120,129159],"valid",[],"NV8"],[[129160,129167],"disallowed"],[[129168,129197],"valid",[],"NV8"],[[129198,129295],"disallowed"],[[129296,129304],"valid",[],"NV8"],[[129305,129407],"disallowed"],[[129408,129412],"valid",[],"NV8"],[[129413,129471],"disallowed"],[[129472,129472],"valid",[],"NV8"],[[129473,131069],"disallowed"],[[131070,131071],"disallowed"],[[131072,173782],"valid"],[[173783,173823],"disallowed"],[[173824,177972],"valid"],[[177973,177983],"disallowed"],[[177984,178205],"valid"],[[178206,178207],"disallowed"],[[178208,183969],"valid"],[[183970,194559],"disallowed"],[[194560,194560],"mapped",[20029]],[[194561,194561],"mapped",[20024]],[[194562,194562],"mapped",[20033]],[[194563,194563],"mapped",[131362]],[[194564,194564],"mapped",[20320]],[[194565,194565],"mapped",[20398]],[[194566,194566],"mapped",[20411]],[[194567,194567],"mapped",[20482]],[[194568,194568],"mapped",[20602]],[[194569,194569],"mapped",[20633]],[[194570,194570],"mapped",[20711]],[[194571,194571],"mapped",[20687]],[[194572,194572],"mapped",[13470]],[[194573,194573],"mapped",[132666]],[[194574,194574],"mapped",[20813]],[[194575,194575],"mapped",[20820]],[[194576,194576],"mapped",[20836]],[[194577,194577],"mapped",[20855]],[[194578,194578],"mapped",[132380]],[[194579,194579],"mapped",[13497]],[[194580,194580],"mapped",[20839]],[[194581,194581],"mapped",[20877]],[[194582,194582],"mapped",[132427]],[[194583,194583],"mapped",[20887]],[[194584,194584],"mapped",[20900]],[[194585,194585],"mapped",[20172]],[[194586,194586],"mapped",[20908]],[[194587,194587],"mapped",[20917]],[[194588,194588],"mapped",[168415]],[[194589,194589],"mapped",[20981]],[[194590,194590],"mapped",[20995]],[[194591,194591],"mapped",[13535]],[[194592,194592],"mapped",[21051]],[[194593,194593],"mapped",[21062]],[[194594,194594],"mapped",[21106]],[[194595,194595],"mapped",[21111]],[[194596,194596],"mapped",[13589]],[[194597,194597],"mapped",[21191]],[[194598,194598],"mapped",[21193]],[[194599,194599],"mapped",[21220]],[[194600,194600],"mapped",[21242]],[[194601,194601],"mapped",[21253]],[[194602,194602],"mapped",[21254]],[[194603,194603],"mapped",[21271]],[[194604,194604],"mapped",[21321]],[[194605,194605],"mapped",[21329]],[[194606,194606],"mapped",[21338]],[[194607,194607],"mapped",[21363]],[[194608,194608],"mapped",[21373]],[[194609,194611],"mapped",[21375]],[[194612,194612],"mapped",[133676]],[[194613,194613],"mapped",[28784]],[[194614,194614],"mapped",[21450]],[[194615,194615],"mapped",[21471]],[[194616,194616],"mapped",[133987]],[[194617,194617],"mapped",[21483]],[[194618,194618],"mapped",[21489]],[[194619,194619],"mapped",[21510]],[[194620,194620],"mapped",[21662]],[[194621,194621],"mapped",[21560]],[[194622,194622],"mapped",[21576]],[[194623,194623],"mapped",[21608]],[[194624,194624],"mapped",[21666]],[[194625,194625],"mapped",[21750]],[[194626,194626],"mapped",[21776]],[[194627,194627],"mapped",[21843]],[[194628,194628],"mapped",[21859]],[[194629,194630],"mapped",[21892]],[[194631,194631],"mapped",[21913]],[[194632,194632],"mapped",[21931]],[[194633,194633],"mapped",[21939]],[[194634,194634],"mapped",[21954]],[[194635,194635],"mapped",[22294]],[[194636,194636],"mapped",[22022]],[[194637,194637],"mapped",[22295]],[[194638,194638],"mapped",[22097]],[[194639,194639],"mapped",[22132]],[[194640,194640],"mapped",[20999]],[[194641,194641],"mapped",[22766]],[[194642,194642],"mapped",[22478]],[[194643,194643],"mapped",[22516]],[[194644,194644],"mapped",[22541]],[[194645,194645],"mapped",[22411]],[[194646,194646],"mapped",[22578]],[[194647,194647],"mapped",[22577]],[[194648,194648],"mapped",[22700]],[[194649,194649],"mapped",[136420]],[[194650,194650],"mapped",[22770]],[[194651,194651],"mapped",[22775]],[[194652,194652],"mapped",[22790]],[[194653,194653],"mapped",[22810]],[[194654,194654],"mapped",[22818]],[[194655,194655],"mapped",[22882]],[[194656,194656],"mapped",[136872]],[[194657,194657],"mapped",[136938]],[[194658,194658],"mapped",[23020]],[[194659,194659],"mapped",[23067]],[[194660,194660],"mapped",[23079]],[[194661,194661],"mapped",[23000]],[[194662,194662],"mapped",[23142]],[[194663,194663],"mapped",[14062]],[[194664,194664],"disallowed"],[[194665,194665],"mapped",[23304]],[[194666,194667],"mapped",[23358]],[[194668,194668],"mapped",[137672]],[[194669,194669],"mapped",[23491]],[[194670,194670],"mapped",[23512]],[[194671,194671],"mapped",[23527]],[[194672,194672],"mapped",[23539]],[[194673,194673],"mapped",[138008]],[[194674,194674],"mapped",[23551]],[[194675,194675],"mapped",[23558]],[[194676,194676],"disallowed"],[[194677,194677],"mapped",[23586]],[[194678,194678],"mapped",[14209]],[[194679,194679],"mapped",[23648]],[[194680,194680],"mapped",[23662]],[[194681,194681],"mapped",[23744]],[[194682,194682],"mapped",[23693]],[[194683,194683],"mapped",[138724]],[[194684,194684],"mapped",[23875]],[[194685,194685],"mapped",[138726]],[[194686,194686],"mapped",[23918]],[[194687,194687],"mapped",[23915]],[[194688,194688],"mapped",[23932]],[[194689,194689],"mapped",[24033]],[[194690,194690],"mapped",[24034]],[[194691,194691],"mapped",[14383]],[[194692,194692],"mapped",[24061]],[[194693,194693],"mapped",[24104]],[[194694,194694],"mapped",[24125]],[[194695,194695],"mapped",[24169]],[[194696,194696],"mapped",[14434]],[[194697,194697],"mapped",[139651]],[[194698,194698],"mapped",[14460]],[[194699,194699],"mapped",[24240]],[[194700,194700],"mapped",[24243]],[[194701,194701],"mapped",[24246]],[[194702,194702],"mapped",[24266]],[[194703,194703],"mapped",[172946]],[[194704,194704],"mapped",[24318]],[[194705,194706],"mapped",[140081]],[[194707,194707],"mapped",[33281]],[[194708,194709],"mapped",[24354]],[[194710,194710],"mapped",[14535]],[[194711,194711],"mapped",[144056]],[[194712,194712],"mapped",[156122]],[[194713,194713],"mapped",[24418]],[[194714,194714],"mapped",[24427]],[[194715,194715],"mapped",[14563]],[[194716,194716],"mapped",[24474]],[[194717,194717],"mapped",[24525]],[[194718,194718],"mapped",[24535]],[[194719,194719],"mapped",[24569]],[[194720,194720],"mapped",[24705]],[[194721,194721],"mapped",[14650]],[[194722,194722],"mapped",[14620]],[[194723,194723],"mapped",[24724]],[[194724,194724],"mapped",[141012]],[[194725,194725],"mapped",[24775]],[[194726,194726],"mapped",[24904]],[[194727,194727],"mapped",[24908]],[[194728,194728],"mapped",[24910]],[[194729,194729],"mapped",[24908]],[[194730,194730],"mapped",[24954]],[[194731,194731],"mapped",[24974]],[[194732,194732],"mapped",[25010]],[[194733,194733],"mapped",[24996]],[[194734,194734],"mapped",[25007]],[[194735,194735],"mapped",[25054]],[[194736,194736],"mapped",[25074]],[[194737,194737],"mapped",[25078]],[[194738,194738],"mapped",[25104]],[[194739,194739],"mapped",[25115]],[[194740,194740],"mapped",[25181]],[[194741,194741],"mapped",[25265]],[[194742,194742],"mapped",[25300]],[[194743,194743],"mapped",[25424]],[[194744,194744],"mapped",[142092]],[[194745,194745],"mapped",[25405]],[[194746,194746],"mapped",[25340]],[[194747,194747],"mapped",[25448]],[[194748,194748],"mapped",[25475]],[[194749,194749],"mapped",[25572]],[[194750,194750],"mapped",[142321]],[[194751,194751],"mapped",[25634]],[[194752,194752],"mapped",[25541]],[[194753,194753],"mapped",[25513]],[[194754,194754],"mapped",[14894]],[[194755,194755],"mapped",[25705]],[[194756,194756],"mapped",[25726]],[[194757,194757],"mapped",[25757]],[[194758,194758],"mapped",[25719]],[[194759,194759],"mapped",[14956]],[[194760,194760],"mapped",[25935]],[[194761,194761],"mapped",[25964]],[[194762,194762],"mapped",[143370]],[[194763,194763],"mapped",[26083]],[[194764,194764],"mapped",[26360]],[[194765,194765],"mapped",[26185]],[[194766,194766],"mapped",[15129]],[[194767,194767],"mapped",[26257]],[[194768,194768],"mapped",[15112]],[[194769,194769],"mapped",[15076]],[[194770,194770],"mapped",[20882]],[[194771,194771],"mapped",[20885]],[[194772,194772],"mapped",[26368]],[[194773,194773],"mapped",[26268]],[[194774,194774],"mapped",[32941]],[[194775,194775],"mapped",[17369]],[[194776,194776],"mapped",[26391]],[[194777,194777],"mapped",[26395]],[[194778,194778],"mapped",[26401]],[[194779,194779],"mapped",[26462]],[[194780,194780],"mapped",[26451]],[[194781,194781],"mapped",[144323]],[[194782,194782],"mapped",[15177]],[[194783,194783],"mapped",[26618]],[[194784,194784],"mapped",[26501]],[[194785,194785],"mapped",[26706]],[[194786,194786],"mapped",[26757]],[[194787,194787],"mapped",[144493]],[[194788,194788],"mapped",[26766]],[[194789,194789],"mapped",[26655]],[[194790,194790],"mapped",[26900]],[[194791,194791],"mapped",[15261]],[[194792,194792],"mapped",[26946]],[[194793,194793],"mapped",[27043]],[[194794,194794],"mapped",[27114]],[[194795,194795],"mapped",[27304]],[[194796,194796],"mapped",[145059]],[[194797,194797],"mapped",[27355]],[[194798,194798],"mapped",[15384]],[[194799,194799],"mapped",[27425]],[[194800,194800],"mapped",[145575]],[[194801,194801],"mapped",[27476]],[[194802,194802],"mapped",[15438]],[[194803,194803],"mapped",[27506]],[[194804,194804],"mapped",[27551]],[[194805,194805],"mapped",[27578]],[[194806,194806],"mapped",[27579]],[[194807,194807],"mapped",[146061]],[[194808,194808],"mapped",[138507]],[[194809,194809],"mapped",[146170]],[[194810,194810],"mapped",[27726]],[[194811,194811],"mapped",[146620]],[[194812,194812],"mapped",[27839]],[[194813,194813],"mapped",[27853]],[[194814,194814],"mapped",[27751]],[[194815,194815],"mapped",[27926]],[[194816,194816],"mapped",[27966]],[[194817,194817],"mapped",[28023]],[[194818,194818],"mapped",[27969]],[[194819,194819],"mapped",[28009]],[[194820,194820],"mapped",[28024]],[[194821,194821],"mapped",[28037]],[[194822,194822],"mapped",[146718]],[[194823,194823],"mapped",[27956]],[[194824,194824],"mapped",[28207]],[[194825,194825],"mapped",[28270]],[[194826,194826],"mapped",[15667]],[[194827,194827],"mapped",[28363]],[[194828,194828],"mapped",[28359]],[[194829,194829],"mapped",[147153]],[[194830,194830],"mapped",[28153]],[[194831,194831],"mapped",[28526]],[[194832,194832],"mapped",[147294]],[[194833,194833],"mapped",[147342]],[[194834,194834],"mapped",[28614]],[[194835,194835],"mapped",[28729]],[[194836,194836],"mapped",[28702]],[[194837,194837],"mapped",[28699]],[[194838,194838],"mapped",[15766]],[[194839,194839],"mapped",[28746]],[[194840,194840],"mapped",[28797]],[[194841,194841],"mapped",[28791]],[[194842,194842],"mapped",[28845]],[[194843,194843],"mapped",[132389]],[[194844,194844],"mapped",[28997]],[[194845,194845],"mapped",[148067]],[[194846,194846],"mapped",[29084]],[[194847,194847],"disallowed"],[[194848,194848],"mapped",[29224]],[[194849,194849],"mapped",[29237]],[[194850,194850],"mapped",[29264]],[[194851,194851],"mapped",[149000]],[[194852,194852],"mapped",[29312]],[[194853,194853],"mapped",[29333]],[[194854,194854],"mapped",[149301]],[[194855,194855],"mapped",[149524]],[[194856,194856],"mapped",[29562]],[[194857,194857],"mapped",[29579]],[[194858,194858],"mapped",[16044]],[[194859,194859],"mapped",[29605]],[[194860,194861],"mapped",[16056]],[[194862,194862],"mapped",[29767]],[[194863,194863],"mapped",[29788]],[[194864,194864],"mapped",[29809]],[[194865,194865],"mapped",[29829]],[[194866,194866],"mapped",[29898]],[[194867,194867],"mapped",[16155]],[[194868,194868],"mapped",[29988]],[[194869,194869],"mapped",[150582]],[[194870,194870],"mapped",[30014]],[[194871,194871],"mapped",[150674]],[[194872,194872],"mapped",[30064]],[[194873,194873],"mapped",[139679]],[[194874,194874],"mapped",[30224]],[[194875,194875],"mapped",[151457]],[[194876,194876],"mapped",[151480]],[[194877,194877],"mapped",[151620]],[[194878,194878],"mapped",[16380]],[[194879,194879],"mapped",[16392]],[[194880,194880],"mapped",[30452]],[[194881,194881],"mapped",[151795]],[[194882,194882],"mapped",[151794]],[[194883,194883],"mapped",[151833]],[[194884,194884],"mapped",[151859]],[[194885,194885],"mapped",[30494]],[[194886,194887],"mapped",[30495]],[[194888,194888],"mapped",[30538]],[[194889,194889],"mapped",[16441]],[[194890,194890],"mapped",[30603]],[[194891,194891],"mapped",[16454]],[[194892,194892],"mapped",[16534]],[[194893,194893],"mapped",[152605]],[[194894,194894],"mapped",[30798]],[[194895,194895],"mapped",[30860]],[[194896,194896],"mapped",[30924]],[[194897,194897],"mapped",[16611]],[[194898,194898],"mapped",[153126]],[[194899,194899],"mapped",[31062]],[[194900,194900],"mapped",[153242]],[[194901,194901],"mapped",[153285]],[[194902,194902],"mapped",[31119]],[[194903,194903],"mapped",[31211]],[[194904,194904],"mapped",[16687]],[[194905,194905],"mapped",[31296]],[[194906,194906],"mapped",[31306]],[[194907,194907],"mapped",[31311]],[[194908,194908],"mapped",[153980]],[[194909,194910],"mapped",[154279]],[[194911,194911],"disallowed"],[[194912,194912],"mapped",[16898]],[[194913,194913],"mapped",[154539]],[[194914,194914],"mapped",[31686]],[[194915,194915],"mapped",[31689]],[[194916,194916],"mapped",[16935]],[[194917,194917],"mapped",[154752]],[[194918,194918],"mapped",[31954]],[[194919,194919],"mapped",[17056]],[[194920,194920],"mapped",[31976]],[[194921,194921],"mapped",[31971]],[[194922,194922],"mapped",[32000]],[[194923,194923],"mapped",[155526]],[[194924,194924],"mapped",[32099]],[[194925,194925],"mapped",[17153]],[[194926,194926],"mapped",[32199]],[[194927,194927],"mapped",[32258]],[[194928,194928],"mapped",[32325]],[[194929,194929],"mapped",[17204]],[[194930,194930],"mapped",[156200]],[[194931,194931],"mapped",[156231]],[[194932,194932],"mapped",[17241]],[[194933,194933],"mapped",[156377]],[[194934,194934],"mapped",[32634]],[[194935,194935],"mapped",[156478]],[[194936,194936],"mapped",[32661]],[[194937,194937],"mapped",[32762]],[[194938,194938],"mapped",[32773]],[[194939,194939],"mapped",[156890]],[[194940,194940],"mapped",[156963]],[[194941,194941],"mapped",[32864]],[[194942,194942],"mapped",[157096]],[[194943,194943],"mapped",[32880]],[[194944,194944],"mapped",[144223]],[[194945,194945],"mapped",[17365]],[[194946,194946],"mapped",[32946]],[[194947,194947],"mapped",[33027]],[[194948,194948],"mapped",[17419]],[[194949,194949],"mapped",[33086]],[[194950,194950],"mapped",[23221]],[[194951,194951],"mapped",[157607]],[[194952,194952],"mapped",[157621]],[[194953,194953],"mapped",[144275]],[[194954,194954],"mapped",[144284]],[[194955,194955],"mapped",[33281]],[[194956,194956],"mapped",[33284]],[[194957,194957],"mapped",[36766]],[[194958,194958],"mapped",[17515]],[[194959,194959],"mapped",[33425]],[[194960,194960],"mapped",[33419]],[[194961,194961],"mapped",[33437]],[[194962,194962],"mapped",[21171]],[[194963,194963],"mapped",[33457]],[[194964,194964],"mapped",[33459]],[[194965,194965],"mapped",[33469]],[[194966,194966],"mapped",[33510]],[[194967,194967],"mapped",[158524]],[[194968,194968],"mapped",[33509]],[[194969,194969],"mapped",[33565]],[[194970,194970],"mapped",[33635]],[[194971,194971],"mapped",[33709]],[[194972,194972],"mapped",[33571]],[[194973,194973],"mapped",[33725]],[[194974,194974],"mapped",[33767]],[[194975,194975],"mapped",[33879]],[[194976,194976],"mapped",[33619]],[[194977,194977],"mapped",[33738]],[[194978,194978],"mapped",[33740]],[[194979,194979],"mapped",[33756]],[[194980,194980],"mapped",[158774]],[[194981,194981],"mapped",[159083]],[[194982,194982],"mapped",[158933]],[[194983,194983],"mapped",[17707]],[[194984,194984],"mapped",[34033]],[[194985,194985],"mapped",[34035]],[[194986,194986],"mapped",[34070]],[[194987,194987],"mapped",[160714]],[[194988,194988],"mapped",[34148]],[[194989,194989],"mapped",[159532]],[[194990,194990],"mapped",[17757]],[[194991,194991],"mapped",[17761]],[[194992,194992],"mapped",[159665]],[[194993,194993],"mapped",[159954]],[[194994,194994],"mapped",[17771]],[[194995,194995],"mapped",[34384]],[[194996,194996],"mapped",[34396]],[[194997,194997],"mapped",[34407]],[[194998,194998],"mapped",[34409]],[[194999,194999],"mapped",[34473]],[[195000,195000],"mapped",[34440]],[[195001,195001],"mapped",[34574]],[[195002,195002],"mapped",[34530]],[[195003,195003],"mapped",[34681]],[[195004,195004],"mapped",[34600]],[[195005,195005],"mapped",[34667]],[[195006,195006],"mapped",[34694]],[[195007,195007],"disallowed"],[[195008,195008],"mapped",[34785]],[[195009,195009],"mapped",[34817]],[[195010,195010],"mapped",[17913]],[[195011,195011],"mapped",[34912]],[[195012,195012],"mapped",[34915]],[[195013,195013],"mapped",[161383]],[[195014,195014],"mapped",[35031]],[[195015,195015],"mapped",[35038]],[[195016,195016],"mapped",[17973]],[[195017,195017],"mapped",[35066]],[[195018,195018],"mapped",[13499]],[[195019,195019],"mapped",[161966]],[[195020,195020],"mapped",[162150]],[[195021,195021],"mapped",[18110]],[[195022,195022],"mapped",[18119]],[[195023,195023],"mapped",[35488]],[[195024,195024],"mapped",[35565]],[[195025,195025],"mapped",[35722]],[[195026,195026],"mapped",[35925]],[[195027,195027],"mapped",[162984]],[[195028,195028],"mapped",[36011]],[[195029,195029],"mapped",[36033]],[[195030,195030],"mapped",[36123]],[[195031,195031],"mapped",[36215]],[[195032,195032],"mapped",[163631]],[[195033,195033],"mapped",[133124]],[[195034,195034],"mapped",[36299]],[[195035,195035],"mapped",[36284]],[[195036,195036],"mapped",[36336]],[[195037,195037],"mapped",[133342]],[[195038,195038],"mapped",[36564]],[[195039,195039],"mapped",[36664]],[[195040,195040],"mapped",[165330]],[[195041,195041],"mapped",[165357]],[[195042,195042],"mapped",[37012]],[[195043,195043],"mapped",[37105]],[[195044,195044],"mapped",[37137]],[[195045,195045],"mapped",[165678]],[[195046,195046],"mapped",[37147]],[[195047,195047],"mapped",[37432]],[[195048,195048],"mapped",[37591]],[[195049,195049],"mapped",[37592]],[[195050,195050],"mapped",[37500]],[[195051,195051],"mapped",[37881]],[[195052,195052],"mapped",[37909]],[[195053,195053],"mapped",[166906]],[[195054,195054],"mapped",[38283]],[[195055,195055],"mapped",[18837]],[[195056,195056],"mapped",[38327]],[[195057,195057],"mapped",[167287]],[[195058,195058],"mapped",[18918]],[[195059,195059],"mapped",[38595]],[[195060,195060],"mapped",[23986]],[[195061,195061],"mapped",[38691]],[[195062,195062],"mapped",[168261]],[[195063,195063],"mapped",[168474]],[[195064,195064],"mapped",[19054]],[[195065,195065],"mapped",[19062]],[[195066,195066],"mapped",[38880]],[[195067,195067],"mapped",[168970]],[[195068,195068],"mapped",[19122]],[[195069,195069],"mapped",[169110]],[[195070,195071],"mapped",[38923]],[[195072,195072],"mapped",[38953]],[[195073,195073],"mapped",[169398]],[[195074,195074],"mapped",[39138]],[[195075,195075],"mapped",[19251]],[[195076,195076],"mapped",[39209]],[[195077,195077],"mapped",[39335]],[[195078,195078],"mapped",[39362]],[[195079,195079],"mapped",[39422]],[[195080,195080],"mapped",[19406]],[[195081,195081],"mapped",[170800]],[[195082,195082],"mapped",[39698]],[[195083,195083],"mapped",[40000]],[[195084,195084],"mapped",[40189]],[[195085,195085],"mapped",[19662]],[[195086,195086],"mapped",[19693]],[[195087,195087],"mapped",[40295]],[[195088,195088],"mapped",[172238]],[[195089,195089],"mapped",[19704]],[[195090,195090],"mapped",[172293]],[[195091,195091],"mapped",[172558]],[[195092,195092],"mapped",[172689]],[[195093,195093],"mapped",[40635]],[[195094,195094],"mapped",[19798]],[[195095,195095],"mapped",[40697]],[[195096,195096],"mapped",[40702]],[[195097,195097],"mapped",[40709]],[[195098,195098],"mapped",[40719]],[[195099,195099],"mapped",[40726]],[[195100,195100],"mapped",[40763]],[[195101,195101],"mapped",[173568]],[[195102,196605],"disallowed"],[[196606,196607],"disallowed"],[[196608,262141],"disallowed"],[[262142,262143],"disallowed"],[[262144,327677],"disallowed"],[[327678,327679],"disallowed"],[[327680,393213],"disallowed"],[[393214,393215],"disallowed"],[[393216,458749],"disallowed"],[[458750,458751],"disallowed"],[[458752,524285],"disallowed"],[[524286,524287],"disallowed"],[[524288,589821],"disallowed"],[[589822,589823],"disallowed"],[[589824,655357],"disallowed"],[[655358,655359],"disallowed"],[[655360,720893],"disallowed"],[[720894,720895],"disallowed"],[[720896,786429],"disallowed"],[[786430,786431],"disallowed"],[[786432,851965],"disallowed"],[[851966,851967],"disallowed"],[[851968,917501],"disallowed"],[[917502,917503],"disallowed"],[[917504,917504],"disallowed"],[[917505,917505],"disallowed"],[[917506,917535],"disallowed"],[[917536,917631],"disallowed"],[[917632,917759],"disallowed"],[[917760,917999],"ignored"],[[918000,983037],"disallowed"],[[983038,983039],"disallowed"],[[983040,1048573],"disallowed"],[[1048574,1048575],"disallowed"],[[1048576,1114109],"disallowed"],[[1114110,1114111],"disallowed"]]');
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __nccwpck_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ var threw = true;
/******/ try {
/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __nccwpck_require__);
/******/ threw = false;
/******/ } finally {
/******/ if(threw) delete __webpack_module_cache__[moduleId];
/******/ }
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/compat */
/******/
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";
/******/
/************************************************************************/
/******/
/******/ // startup
/******/ // Load entry module and return exports
/******/ // This entry module is referenced by other modules so it can't be inlined
/******/ var __webpack_exports__ = __nccwpck_require__(3109);
/******/ module.exports = __webpack_exports__;
/******/
/******/ })()
;
//# sourceMappingURL=index.js.map