ngx-pdfjs-viewer
Version:
This is a extended version of pdf viewer from https://www.npmjs.com/package/ng2-pdfjs-viewer
85 lines (70 loc) • 616 kB
JavaScript
/**
* @licstart The following is the entire license notice for the
* Javascript code in this page
*
* Copyright 2020 Mozilla Foundation
*
* 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.
*
* @licend The above is the entire license notice for the
* Javascript code in this page
*/
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define("pdfjs-dist/build/pdf.sandbox", [], factory);
else if(typeof exports === 'object')
exports["pdfjs-dist/build/pdf.sandbox"] = factory();
else
root["pdfjs-dist/build/pdf.sandbox"] = root.pdfjsSandbox = factory();
})(this, function() {
return /******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ([
/* 0 */
/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {
Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.QuickJSSandbox = QuickJSSandbox;
var _quickjsEval = _interopRequireDefault(__w_pdfjs_require__(1));
var _pdfSandboxExternal = __w_pdfjs_require__(2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const pdfjsVersion = '2.7.512';
const pdfjsBuild = '1de1ae0be';
const TESTING = false;
class SandboxSupport extends _pdfSandboxExternal.SandboxSupportBase {
exportValueToSandbox(val) {
return JSON.stringify(val);
}
importValueFromSandbox(val) {
return val;
}
createErrorForSandbox(errorMessage) {
return new Error(errorMessage);
}
}
class Sandbox {
constructor(win, module) {
this.support = new SandboxSupport(win, this);
module.externalCall = this.support.createSandboxExternals();
this._module = module;
this._alertOnError = 0;
}
create(data) {
if (TESTING) {
this._module.ccall("nukeSandbox", null, []);
}
const sandboxData = JSON.stringify(data);
const code = ['(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === \'object\' && typeof module === \'object\')\n\t\tmodule.exports = factory();\n\telse if(typeof define === \'function\' && define.amd)\n\t\tdefine("pdfjs-dist/build/pdf.scripting", [], factory);\n\telse if(typeof exports === \'object\')\n\t\texports["pdfjs-dist/build/pdf.scripting"] = factory();\n\telse\n\t\troot.pdfjsScripting = factory();\n})(this, function() {\nreturn /******/ (() => { // webpackBootstrap\n/******/ \t"use strict";\n/******/ \tvar __webpack_modules__ = ([\n/* 0 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nObject.defineProperty(exports, "initSandbox", ({\n enumerable: true,\n get: function () {\n return _initialization.initSandbox;\n }\n}));\n\nvar _initialization = __w_pdfjs_require__(1);\n\nconst pdfjsVersion = \'2.7.512\';\nconst pdfjsBuild = \'1de1ae0be\';\n\n/***/ }),\n/* 1 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.initSandbox = initSandbox;\n\nvar _constants = __w_pdfjs_require__(2);\n\nvar _field = __w_pdfjs_require__(3);\n\nvar _aform = __w_pdfjs_require__(8);\n\nvar _app = __w_pdfjs_require__(9);\n\nvar _color = __w_pdfjs_require__(4);\n\nvar _console = __w_pdfjs_require__(13);\n\nvar _doc = __w_pdfjs_require__(14);\n\nvar _proxy = __w_pdfjs_require__(16);\n\nvar _util = __w_pdfjs_require__(17);\n\nfunction initSandbox(params) {\n delete globalThis.pdfjsScripting;\n const externalCall = globalThis.callExternalFunction;\n delete globalThis.callExternalFunction;\n\n const globalEval = code => globalThis.eval(code);\n\n const send = data => externalCall("send", [data]);\n\n const proxyHandler = new _proxy.ProxyHandler();\n const {\n data\n } = params;\n const doc = new _doc.Doc({\n send,\n globalEval,\n ...data.docInfo\n });\n const _document = {\n obj: doc,\n wrapped: new Proxy(doc, proxyHandler)\n };\n const app = new _app.App({\n send,\n globalEval,\n externalCall,\n _document,\n calculationOrder: data.calculationOrder,\n proxyHandler,\n ...data.appInfo\n });\n const util = new _util.Util({\n externalCall\n });\n const aform = new _aform.AForm(doc, app, util);\n\n if (data.objects) {\n for (const [name, objs] of Object.entries(data.objects)) {\n const obj = objs[0];\n obj.send = send;\n obj.globalEval = globalEval;\n obj.doc = _document.wrapped;\n let field;\n\n if (obj.type === "radiobutton") {\n const otherButtons = objs.slice(1);\n field = new _field.RadioButtonField(otherButtons, obj);\n } else if (obj.type === "checkbox") {\n const otherButtons = objs.slice(1);\n field = new _field.CheckboxField(otherButtons, obj);\n } else {\n field = new _field.Field(obj);\n }\n\n const wrapped = new Proxy(field, proxyHandler);\n\n doc._addField(name, wrapped);\n\n const _object = {\n obj: field,\n wrapped\n };\n\n for (const object of objs) {\n app._objects[object.id] = _object;\n }\n }\n }\n\n globalThis.event = null;\n globalThis.global = Object.create(null);\n globalThis.app = new Proxy(app, proxyHandler);\n globalThis.color = new Proxy(new _color.Color(), proxyHandler);\n globalThis.console = new Proxy(new _console.Console({\n send\n }), proxyHandler);\n globalThis.util = new Proxy(util, proxyHandler);\n globalThis.border = _constants.Border;\n globalThis.cursor = _constants.Cursor;\n globalThis.display = _constants.Display;\n globalThis.font = _constants.Font;\n globalThis.highlight = _constants.Highlight;\n globalThis.position = _constants.Position;\n globalThis.scaleHow = _constants.ScaleHow;\n globalThis.scaleWhen = _constants.ScaleWhen;\n globalThis.style = _constants.Style;\n globalThis.trans = _constants.Trans;\n globalThis.zoomtype = _constants.ZoomType;\n\n for (const name of Object.getOwnPropertyNames(_aform.AForm.prototype)) {\n if (name !== "constructor" && !name.startsWith("_")) {\n globalThis[name] = aform[name].bind(aform);\n }\n }\n\n const properties = Object.create(null);\n\n for (const name of Object.getOwnPropertyNames(_doc.Doc.prototype)) {\n if (name === "constructor" || name.startsWith("_")) {\n continue;\n }\n\n const descriptor = Object.getOwnPropertyDescriptor(_doc.Doc.prototype, name);\n\n if (descriptor.get) {\n properties[name] = {\n get: descriptor.get.bind(doc),\n set: descriptor.set.bind(doc)\n };\n } else {\n properties[name] = {\n value: _doc.Doc.prototype[name].bind(doc)\n };\n }\n }\n\n Object.defineProperties(globalThis, properties);\n const functions = {\n dispatchEvent: app._dispatchEvent.bind(app),\n timeoutCb: app._evalCallback.bind(app)\n };\n return (name, args) => {\n try {\n functions[name](args);\n } catch (error) {\n const value = `${error.toString()}\\n${error.stack}`;\n send({\n command: "error",\n value\n });\n }\n };\n}\n\n/***/ }),\n/* 2 */\n/***/ ((__unused_webpack_module, exports) => {\n\n\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.ZoomType = exports.Trans = exports.Style = exports.ScaleWhen = exports.ScaleHow = exports.Position = exports.Highlight = exports.Font = exports.Display = exports.Cursor = exports.Border = void 0;\nconst Border = Object.freeze({\n s: "solid",\n d: "dashed",\n b: "beveled",\n i: "inset",\n u: "underline"\n});\nexports.Border = Border;\nconst Cursor = Object.freeze({\n visible: 0,\n hidden: 1,\n delay: 2\n});\nexports.Cursor = Cursor;\nconst Display = Object.freeze({\n visible: 0,\n hidden: 1,\n noPrint: 2,\n noView: 3\n});\nexports.Display = Display;\nconst Font = Object.freeze({\n Times: "Times-Roman",\n TimesB: "Times-Bold",\n TimesI: "Times-Italic",\n TimesBI: "Times-BoldItalic",\n Helv: "Helvetica",\n HelvB: "Helvetica-Bold",\n HelvI: "Helvetica-Oblique",\n HelvBI: "Helvetica-BoldOblique",\n Cour: "Courier",\n CourB: "Courier-Bold",\n CourI: "Courier-Oblique",\n CourBI: "Courier-BoldOblique",\n Symbol: "Symbol",\n ZapfD: "ZapfDingbats",\n KaGo: "HeiseiKakuGo-W5-UniJIS-UCS2-H",\n KaMi: "HeiseiMin-W3-UniJIS-UCS2-H"\n});\nexports.Font = Font;\nconst Highlight = Object.freeze({\n n: "none",\n i: "invert",\n p: "push",\n o: "outline"\n});\nexports.Highlight = Highlight;\nconst Position = Object.freeze({\n textOnly: 0,\n iconOnly: 1,\n iconTextV: 2,\n textIconV: 3,\n iconTextH: 4,\n textIconH: 5,\n overlay: 6\n});\nexports.Position = Position;\nconst ScaleHow = Object.freeze({\n proportional: 0,\n anamorphic: 1\n});\nexports.ScaleHow = ScaleHow;\nconst ScaleWhen = Object.freeze({\n always: 0,\n never: 1,\n tooBig: 2,\n tooSmall: 3\n});\nexports.ScaleWhen = ScaleWhen;\nconst Style = Object.freeze({\n ch: "check",\n cr: "cross",\n di: "diamond",\n ci: "circle",\n st: "star",\n sq: "square"\n});\nexports.Style = Style;\nconst Trans = Object.freeze({\n blindsH: "BlindsHorizontal",\n blindsV: "BlindsVertical",\n boxI: "BoxIn",\n boxO: "BoxOut",\n dissolve: "Dissolve",\n glitterD: "GlitterDown",\n glitterR: "GlitterRight",\n glitterRD: "GlitterRightDown",\n random: "Random",\n replace: "Replace",\n splitHI: "SplitHorizontalIn",\n splitHO: "SplitHorizontalOut",\n splitVI: "SplitVerticalIn",\n splitVO: "SplitVerticalOut",\n wipeD: "WipeDown",\n wipeL: "WipeLeft",\n wipeR: "WipeRight",\n wipeU: "WipeUp"\n});\nexports.Trans = Trans;\nconst ZoomType = Object.freeze({\n none: "NoVary",\n fitP: "FitPage",\n fitW: "FitWidth",\n fitH: "FitHeight",\n fitV: "FitVisibleWidth",\n pref: "Preferred",\n refW: "ReflowWidth"\n});\nexports.ZoomType = ZoomType;\n\n/***/ }),\n/* 3 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.RadioButtonField = exports.Field = exports.CheckboxField = void 0;\n\nvar _color = __w_pdfjs_require__(4);\n\nvar _common = __w_pdfjs_require__(7);\n\nvar _pdf_object = __w_pdfjs_require__(6);\n\nclass Field extends _pdf_object.PDFObject {\n constructor(data) {\n super(data);\n this.alignment = data.alignment || "left";\n this.borderStyle = data.borderStyle || "";\n this.buttonAlignX = data.buttonAlignX || 50;\n this.buttonAlignY = data.buttonAlignY || 50;\n this.buttonFitBounds = data.buttonFitBounds;\n this.buttonPosition = data.buttonPosition;\n this.buttonScaleHow = data.buttonScaleHow;\n this.ButtonScaleWhen = data.buttonScaleWhen;\n this.calcOrderIndex = data.calcOrderIndex;\n this.charLimit = data.charLimit;\n this.comb = data.comb;\n this.commitOnSelChange = data.commitOnSelChange;\n this.currentValueIndices = data.currentValueIndices;\n this.defaultStyle = data.defaultStyle;\n this.defaultValue = data.defaultValue;\n this.doNotScroll = data.doNotScroll;\n this.doNotSpellCheck = data.doNotSpellCheck;\n this.delay = data.delay;\n this.display = data.display;\n this.doc = data.doc;\n this.editable = data.editable;\n this.exportValues = data.exportValues;\n this.fileSelect = data.fileSelect;\n this.hidden = data.hidden;\n this.highlight = data.highlight;\n this.lineWidth = data.lineWidth;\n this.multiline = data.multiline;\n this.multipleSelection = !!data.multipleSelection;\n this.name = data.name;\n this.numItems = data.numItems;\n this.page = data.page;\n this.password = data.password;\n this.print = data.print;\n this.radiosInUnison = data.radiosInUnison;\n this.readonly = data.readonly;\n this.rect = data.rect;\n this.required = data.required;\n this.richText = data.richText;\n this.richValue = data.richValue;\n this.rotation = data.rotation;\n this.style = data.style;\n this.submitName = data.submitName;\n this.textFont = data.textFont;\n this.textSize = data.textSize;\n this.type = data.type;\n this.userName = data.userName;\n this._document = data.doc;\n this._value = data.value || "";\n this._valueAsString = data.valueAsString;\n this._actions = (0, _common.createActionsMap)(data.actions);\n this._fillColor = data.fillColor || ["T"];\n this._strokeColor = data.strokeColor || ["G", 0];\n this._textColor = data.textColor || ["G", 0];\n this._globalEval = data.globalEval;\n }\n\n get fillColor() {\n return this._fillColor;\n }\n\n set fillColor(color) {\n if (_color.Color._isValidColor(color)) {\n this._fillColor = color;\n }\n }\n\n get strokeColor() {\n return this._strokeColor;\n }\n\n set strokeColor(color) {\n if (_color.Color._isValidColor(color)) {\n this._strokeColor = color;\n }\n }\n\n get textColor() {\n return this._textColor;\n }\n\n set textColor(color) {\n if (_color.Color._isValidColor(color)) {\n this._textColor = color;\n }\n }\n\n get value() {\n return this._value;\n }\n\n set value(value) {\n if (!this.multipleSelection) {\n this._value = value;\n }\n }\n\n get valueAsString() {\n return this._valueAsString;\n }\n\n set valueAsString(val) {\n this._valueAsString = val ? val.toString() : "";\n }\n\n checkThisBox(nWidget, bCheckIt = true) {}\n\n isBoxChecked(nWidget) {\n return false;\n }\n\n isDefaultChecked(nWidget) {\n return false;\n }\n\n setAction(cTrigger, cScript) {\n if (typeof cTrigger !== "string" || typeof cScript !== "string") {\n return;\n }\n\n if (!(cTrigger in this._actions)) {\n this._actions[cTrigger] = [];\n }\n\n this._actions[cTrigger].push(cScript);\n }\n\n setFocus() {\n this._send({\n id: this._id,\n focus: true\n });\n }\n\n _isButton() {\n return false;\n }\n\n _runActions(event) {\n const eventName = event.name;\n\n if (!this._actions.has(eventName)) {\n return false;\n }\n\n const actions = this._actions.get(eventName);\n\n try {\n for (const action of actions) {\n this._globalEval(action);\n }\n } catch (error) {\n event.rc = false;\n throw error;\n }\n\n return true;\n }\n\n}\n\nexports.Field = Field;\n\nclass RadioButtonField extends Field {\n constructor(otherButtons, data) {\n super(data);\n this.exportValues = [this.exportValues];\n this._radioIds = [this._id];\n this._radioActions = [this._actions];\n\n for (const radioData of otherButtons) {\n this.exportValues.push(radioData.exportValues);\n\n this._radioIds.push(radioData.id);\n\n this._radioActions.push((0, _common.createActionsMap)(radioData.actions));\n\n if (this._value === radioData.exportValues) {\n this._id = radioData.id;\n }\n }\n }\n\n get value() {\n return this._value;\n }\n\n set value(value) {\n const i = this.exportValues.indexOf(value);\n\n if (0 <= i && i < this._radioIds.length) {\n this._id = this._radioIds[i];\n this._value = value;\n } else if (value === "Off" && this._radioIds.length === 2) {\n const nextI = (1 + this._radioIds.indexOf(this._id)) % 2;\n this._id = this._radioIds[nextI];\n this._value = this.exportValues[nextI];\n }\n }\n\n checkThisBox(nWidget, bCheckIt = true) {\n if (nWidget < 0 || nWidget >= this._radioIds.length || !bCheckIt) {\n return;\n }\n\n this._id = this._radioIds[nWidget];\n this._value = this.exportValues[nWidget];\n\n this._send({\n id: this._id,\n value: this._value\n });\n }\n\n isBoxChecked(nWidget) {\n return nWidget >= 0 && nWidget < this._radioIds.length && this._id === this._radioIds[nWidget];\n }\n\n isDefaultChecked(nWidget) {\n return nWidget >= 0 && nWidget < this.exportValues.length && this.defaultValue === this.exportValues[nWidget];\n }\n\n _getExportValue(state) {\n const i = this._radioIds.indexOf(this._id);\n\n return this.exportValues[i];\n }\n\n _runActions(event) {\n const i = this._radioIds.indexOf(this._id);\n\n this._actions = this._radioActions[i];\n return super._runActions(event);\n }\n\n _isButton() {\n return true;\n }\n\n}\n\nexports.RadioButtonField = RadioButtonField;\n\nclass CheckboxField extends RadioButtonField {\n get value() {\n return this._value;\n }\n\n set value(value) {\n if (value === "Off") {\n this._value = "Off";\n } else {\n super.value = value;\n }\n }\n\n _getExportValue(state) {\n return state ? super._getExportValue(state) : "Off";\n }\n\n isBoxChecked(nWidget) {\n if (this._value === "Off") {\n return false;\n }\n\n return super.isBoxChecked(nWidget);\n }\n\n isDefaultChecked(nWidget) {\n if (this.defaultValue === "Off") {\n return this._value === "Off";\n }\n\n return super.isDefaultChecked(nWidget);\n }\n\n checkThisBox(nWidget, bCheckIt = true) {\n if (nWidget < 0 || nWidget >= this._radioIds.length) {\n return;\n }\n\n this._id = this._radioIds[nWidget];\n this._value = bCheckIt ? this.exportValues[nWidget] : "Off";\n\n this._send({\n id: this._id,\n value: this._value\n });\n }\n\n}\n\nexports.CheckboxField = CheckboxField;\n\n/***/ }),\n/* 4 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.Color = void 0;\n\nvar _scripting_utils = __w_pdfjs_require__(5);\n\nvar _pdf_object = __w_pdfjs_require__(6);\n\nclass Color extends _pdf_object.PDFObject {\n constructor() {\n super({});\n this.transparent = ["T"];\n this.black = ["G", 0];\n this.white = ["G", 1];\n this.red = ["RGB", 1, 0, 0];\n this.green = ["RGB", 0, 1, 0];\n this.blue = ["RGB", 0, 0, 1];\n this.cyan = ["CMYK", 1, 0, 0, 0];\n this.magenta = ["CMYK", 0, 1, 0, 0];\n this.yellow = ["CMYK", 0, 0, 1, 0];\n this.dkGray = ["G", 0.25];\n this.gray = ["G", 0.5];\n this.ltGray = ["G", 0.75];\n }\n\n static _isValidSpace(cColorSpace) {\n return typeof cColorSpace === "string" && (cColorSpace === "T" || cColorSpace === "G" || cColorSpace === "RGB" || cColorSpace === "CMYK");\n }\n\n static _isValidColor(colorArray) {\n if (!Array.isArray(colorArray) || colorArray.length === 0) {\n return false;\n }\n\n const space = colorArray[0];\n\n if (!Color._isValidSpace(space)) {\n return false;\n }\n\n switch (space) {\n case "T":\n if (colorArray.length !== 1) {\n return false;\n }\n\n break;\n\n case "G":\n if (colorArray.length !== 2) {\n return false;\n }\n\n break;\n\n case "RGB":\n if (colorArray.length !== 4) {\n return false;\n }\n\n break;\n\n case "CMYK":\n if (colorArray.length !== 5) {\n return false;\n }\n\n break;\n\n default:\n return false;\n }\n\n return colorArray.slice(1).every(c => typeof c === "number" && c >= 0 && c <= 1);\n }\n\n static _getCorrectColor(colorArray) {\n return Color._isValidColor(colorArray) ? colorArray : ["G", 0];\n }\n\n convert(colorArray, cColorSpace) {\n if (!Color._isValidSpace(cColorSpace)) {\n return this.black;\n }\n\n if (cColorSpace === "T") {\n return ["T"];\n }\n\n colorArray = Color._getCorrectColor(colorArray);\n\n if (colorArray[0] === cColorSpace) {\n return colorArray;\n }\n\n if (colorArray[0] === "T") {\n return this.convert(this.black, cColorSpace);\n }\n\n return _scripting_utils.ColorConverters[`${colorArray[0]}_${cColorSpace}`](colorArray.slice(1));\n }\n\n equal(colorArray1, colorArray2) {\n colorArray1 = Color._getCorrectColor(colorArray1);\n colorArray2 = Color._getCorrectColor(colorArray2);\n\n if (colorArray1[0] === "T" || colorArray2[0] === "T") {\n return colorArray1[0] === "T" && colorArray2[0] === "T";\n }\n\n if (colorArray1[0] !== colorArray2[0]) {\n colorArray2 = this.convert(colorArray2, colorArray1[0]);\n }\n\n return colorArray1.slice(1).every((c, i) => c === colorArray2[i + 1]);\n }\n\n}\n\nexports.Color = Color;\n\n/***/ }),\n/* 5 */\n/***/ ((__unused_webpack_module, exports) => {\n\n\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.ColorConverters = void 0;\n\nfunction makeColorComp(n) {\n return Math.floor(Math.max(0, Math.min(1, n)) * 255).toString(16).padStart(2, "0");\n}\n\nclass ColorConverters {\n static CMYK_G([c, y, m, k]) {\n return ["G", 1 - Math.min(1, 0.3 * c + 0.59 * m + 0.11 * y + k)];\n }\n\n static G_CMYK([g]) {\n return ["CMYK", 0, 0, 0, 1 - g];\n }\n\n static G_RGB([g]) {\n return ["RGB", g, g, g];\n }\n\n static G_HTML([g]) {\n const G = makeColorComp(g);\n return `#${G}${G}${G}`;\n }\n\n static RGB_G([r, g, b]) {\n return ["G", 0.3 * r + 0.59 * g + 0.11 * b];\n }\n\n static RGB_HTML([r, g, b]) {\n const R = makeColorComp(r);\n const G = makeColorComp(g);\n const B = makeColorComp(b);\n return `#${R}${G}${B}`;\n }\n\n static T_HTML() {\n return "#00000000";\n }\n\n static CMYK_RGB([c, y, m, k]) {\n return ["RGB", 1 - Math.min(1, c + k), 1 - Math.min(1, m + k), 1 - Math.min(1, y + k)];\n }\n\n static CMYK_HTML(components) {\n return this.RGB_HTML(this.CMYK_RGB(components));\n }\n\n static RGB_CMYK([r, g, b]) {\n const c = 1 - r;\n const m = 1 - g;\n const y = 1 - b;\n const k = Math.min(c, m, y);\n return ["CMYK", c, m, y, k];\n }\n\n}\n\nexports.ColorConverters = ColorConverters;\n\n/***/ }),\n/* 6 */\n/***/ ((__unused_webpack_module, exports) => {\n\n\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.PDFObject = void 0;\n\nclass PDFObject {\n constructor(data) {\n this._expandos = Object.create(null);\n this._send = data.send || null;\n this._id = data.id || null;\n }\n\n}\n\nexports.PDFObject = PDFObject;\n\n/***/ }),\n/* 7 */\n/***/ ((__unused_webpack_module, exports) => {\n\n\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.createActionsMap = createActionsMap;\n\nfunction createActionsMap(actions) {\n const actionsMap = new Map();\n\n if (actions) {\n for (const [eventType, actionsForEvent] of Object.entries(actions)) {\n actionsMap.set(eventType, actionsForEvent);\n }\n }\n\n return actionsMap;\n}\n\n/***/ }),\n/* 8 */\n/***/ ((__unused_webpack_module, exports) => {\n\n\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.AForm = void 0;\n\nclass AForm {\n constructor(document, app, util) {\n this._document = document;\n this._app = app;\n this._util = util;\n this._dateFormats = ["m/d", "m/d/yy", "mm/dd/yy", "mm/yy", "d-mmm", "d-mmm-yy", "dd-mmm-yy", "yy-mm-dd", "mmm-yy", "mmmm-yy", "mmm d, yyyy", "mmmm d, yyyy", "m/d/yy h:MM tt", "m/d/yy HH:MM"];\n this._timeFormats = ["HH:MM", "h:MM tt", "HH:MM:ss", "h:MM:ss tt"];\n this._emailRegex = new RegExp("^[a-zA-Z0-9.!#$%&\'*+\\\\/=?^_`{|}~-]+" + "@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?" + "(?:\\\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$");\n }\n\n _parseDate(cFormat, cDate) {\n const ddate = Date.parse(cDate);\n\n if (isNaN(ddate)) {\n try {\n return this._util.scand(cFormat, cDate);\n } catch (error) {\n return null;\n }\n } else {\n return new Date(ddate);\n }\n }\n\n AFMergeChange(event = globalThis.event) {\n if (event.willCommit) {\n return event.value.toString();\n }\n\n return this._app._eventDispatcher.mergeChange(event);\n }\n\n AFParseDateEx(cString, cOrder) {\n return this._parseDate(cOrder, cString);\n }\n\n AFExtractNums(str) {\n if (typeof str === "number") {\n return [str];\n }\n\n if (!str || typeof str !== "string") {\n return null;\n }\n\n const first = str.charAt(0);\n\n if (first === "." || first === ",") {\n str = `0${str}`;\n }\n\n const numbers = str.match(/([0-9]+)/g);\n\n if (numbers.length === 0) {\n return null;\n }\n\n return numbers;\n }\n\n AFMakeNumber(str) {\n if (typeof str === "number") {\n return str;\n }\n\n if (typeof str !== "string") {\n return null;\n }\n\n str = str.trim().replace(",", ".");\n const number = parseFloat(str);\n\n if (isNaN(number) || !isFinite(number)) {\n return null;\n }\n\n return number;\n }\n\n AFMakeArrayFromList(string) {\n if (typeof string === "string") {\n return string.split(/, ?/g);\n }\n\n return string;\n }\n\n AFNumber_Format(nDec, sepStyle, negStyle, currStyle, strCurrency, bCurrencyPrepend) {\n const event = globalThis.event;\n\n if (!event.value) {\n return;\n }\n\n let value = this.AFMakeNumber(event.value);\n\n if (value === null) {\n event.value = "";\n return;\n }\n\n const sign = Math.sign(value);\n const buf = [];\n let hasParen = false;\n\n if (sign === -1 && bCurrencyPrepend && negStyle === 0) {\n buf.push("-");\n }\n\n if ((negStyle === 2 || negStyle === 3) && sign === -1) {\n buf.push("(");\n hasParen = true;\n }\n\n if (bCurrencyPrepend) {\n buf.push(strCurrency);\n }\n\n sepStyle = Math.min(Math.max(0, Math.floor(sepStyle)), 4);\n buf.push("%,");\n buf.push(sepStyle);\n buf.push(".");\n buf.push(nDec.toString());\n buf.push("f");\n\n if (!bCurrencyPrepend) {\n buf.push(strCurrency);\n }\n\n if (hasParen) {\n buf.push(")");\n }\n\n if (negStyle === 1 || negStyle === 3) {\n event.target.textColor = sign === 1 ? color.black : color.red;\n }\n\n if ((negStyle !== 0 || bCurrencyPrepend) && sign === -1) {\n value = -value;\n }\n\n const formatStr = buf.join("");\n event.value = this._util.printf(formatStr, value);\n }\n\n AFNumber_Keystroke(nDec, sepStyle, negStyle, currStyle, strCurrency, bCurrencyPrepend) {\n const event = globalThis.event;\n let value = this.AFMergeChange(event);\n\n if (!value) {\n return;\n }\n\n value = value.trim();\n let pattern;\n\n if (sepStyle > 1) {\n pattern = event.willCommit ? /^[+-]?([0-9]+(,[0-9]*)?|,[0-9]+)$/ : /^[+-]?[0-9]*,?[0-9]*$/;\n } else {\n pattern = event.willCommit ? /^[+-]?([0-9]+(\\.[0-9]*)?|\\.[0-9]+)$/ : /^[+-]?[0-9]*\\.?[0-9]*$/;\n }\n\n if (!pattern.test(value)) {\n if (event.willCommit) {\n if (event.target) {\n this._app.alert(`Invalid number in [ ${event.target.name} ]`);\n } else {\n this._app.alert(`Invalid number`);\n }\n }\n\n event.rc = false;\n }\n }\n\n AFPercent_Format(nDec, sepStyle, percentPrepend = false) {\n if (typeof nDec !== "number") {\n return;\n }\n\n if (typeof sepStyle !== "number") {\n return;\n }\n\n if (nDec < 0) {\n throw new Error("Invalid nDec value in AFPercent_Format");\n }\n\n const event = globalThis.event;\n\n if (nDec > 512) {\n event.value = "%";\n return;\n }\n\n nDec = Math.floor(nDec);\n sepStyle = Math.min(Math.max(0, Math.floor(sepStyle)), 4);\n let value = this.AFMakeNumber(event.value);\n\n if (value === null) {\n event.value = "%";\n return;\n }\n\n const formatStr = `%,${sepStyle}.${nDec}f`;\n value = this._util.printf(formatStr, value * 100);\n\n if (percentPrepend) {\n event.value = `%${value}`;\n } else {\n event.value = `${value}%`;\n }\n }\n\n AFPercent_Keystroke(nDec, sepStyle) {\n this.AFNumber_Keystroke(nDec, sepStyle, 0, 0, "", true);\n }\n\n AFDate_FormatEx(cFormat) {\n const event = globalThis.event;\n const value = event.value;\n\n if (!value) {\n return;\n }\n\n const date = this._parseDate(cFormat, value);\n\n if (date !== null) {\n event.value = this._util.printd(cFormat, date);\n }\n }\n\n AFDate_Format(pdf) {\n if (pdf >= 0 && pdf < this._dateFormats.length) {\n this.AFDate_FormatEx(this._dateFormats[pdf]);\n }\n }\n\n AFDate_KeystrokeEx(cFormat) {\n const event = globalThis.event;\n\n if (!event.willCommit) {\n return;\n }\n\n const value = event.value;\n\n if (!value) {\n return;\n }\n\n if (this._parseDate(cFormat, value) === null) {\n this._app.alert("Invalid date");\n\n event.rc = false;\n }\n }\n\n AFDate_Keystroke(pdf) {\n if (pdf >= 0 && pdf < this._dateFormats.length) {\n this.AFDate_KeystrokeEx(this._dateFormats[pdf]);\n }\n }\n\n AFRange_Validate(bGreaterThan, nGreaterThan, bLessThan, nLessThan) {\n const event = globalThis.event;\n\n if (!event.value) {\n return;\n }\n\n const value = this.AFMakeNumber(event.value);\n\n if (value === null) {\n return;\n }\n\n bGreaterThan = !!bGreaterThan;\n bLessThan = !!bLessThan;\n\n if (bGreaterThan) {\n nGreaterThan = this.AFMakeNumber(nGreaterThan);\n\n if (nGreaterThan === null) {\n return;\n }\n }\n\n if (bLessThan) {\n nLessThan = this.AFMakeNumber(nLessThan);\n\n if (nLessThan === null) {\n return;\n }\n }\n\n let err = "";\n\n if (bGreaterThan && bLessThan) {\n if (value < nGreaterThan || value > nLessThan) {\n err = `${event.value} is not between ${nGreaterThan} and ${nLessThan}`;\n }\n } else if (bGreaterThan) {\n if (value < nGreaterThan) {\n err = `${event.value} is not greater or equal than ${nGreaterThan}`;\n }\n } else if (value > nLessThan) {\n err = `${event.value} is not less or equal than ${nLessThan}`;\n }\n\n if (err) {\n this._app.alert(err);\n\n event.rc = false;\n }\n }\n\n AFSimple(cFunction, nValue1, nValue2) {\n const value1 = this.AFMakeNumber(nValue1);\n\n if (value1 === null) {\n throw new Error("Invalid nValue1 in AFSimple");\n }\n\n const value2 = this.AFMakeNumber(nValue2);\n\n if (value2 === null) {\n throw new Error("Invalid nValue2 in AFSimple");\n }\n\n switch (cFunction) {\n case "AVG":\n return (value1 + value2) / 2;\n\n case "SUM":\n return value1 + value2;\n\n case "PRD":\n return value1 * value2;\n\n case "MIN":\n return Math.min(value1, value2);\n\n case "MAX":\n return Math.max(value1, value2);\n }\n\n throw new Error("Invalid cFunction in AFSimple");\n }\n\n AFSimple_Calculate(cFunction, cFields) {\n const actions = {\n AVG: args => args.reduce((acc, value) => acc + value, 0) / args.length,\n SUM: args => args.reduce((acc, value) => acc + value, 0),\n PRD: args => args.reduce((acc, value) => acc * value, 1),\n MIN: args => args.reduce((acc, value) => Math.min(acc, value), Number.MAX_VALUE),\n MAX: args => args.reduce((acc, value) => Math.max(acc, value), Number.MIN_VALUE)\n };\n\n if (!(cFunction in actions)) {\n throw new TypeError("Invalid function in AFSimple_Calculate");\n }\n\n const event = globalThis.event;\n const values = [];\n\n for (const cField of cFields) {\n const field = this._document.getField(cField);\n\n const number = this.AFMakeNumber(field.value);\n\n if (number !== null) {\n values.push(number);\n }\n }\n\n if (values.length === 0) {\n event.value = cFunction === "PRD" ? 1 : 0;\n return;\n }\n\n const res = actions[cFunction](values);\n event.value = Math.round(1e6 * res) / 1e6;\n }\n\n AFSpecial_Format(psf) {\n const event = globalThis.event;\n\n if (!event.value) {\n return;\n }\n\n psf = this.AFMakeNumber(psf);\n\n if (psf === null) {\n throw new Error("Invalid psf in AFSpecial_Format");\n }\n\n let formatStr = "";\n\n switch (psf) {\n case 0:\n formatStr = "99999";\n break;\n\n case 1:\n formatStr = "99999-9999";\n break;\n\n case 2:\n if (this._util.printx("9999999999", event.value).length >= 10) {\n formatStr = "(999) 999-9999";\n } else {\n formatStr = "999-9999";\n }\n\n break;\n\n case 3:\n formatStr = "999-99-9999";\n break;\n\n default:\n throw new Error("Invalid psf in AFSpecial_Format");\n }\n\n event.value = this._util.printx(formatStr, event.value);\n }\n\n AFSpecial_KeystrokeEx(cMask) {\n if (!cMask) {\n return;\n }\n\n const event = globalThis.event;\n const value = this.AFMergeChange(event);\n const checkers = new Map([["9", char => char >= "0" && char <= "9"], ["A", char => "a" <= char && char <= "z" || "A" <= char && char <= "Z"], ["O", char => "a" <= char && char <= "z" || "A" <= char && char <= "Z" || "0" <= char && char <= "9"], ["X", char => true]]);\n\n function _checkValidity(_value, _cMask) {\n for (let i = 0, ii = value.length; i < ii; i++) {\n const mask = _cMask.charAt(i);\n\n const char = _value.charAt(i);\n\n const checker = checkers.get(mask);\n\n if (checker) {\n if (!checker(char)) {\n return false;\n }\n } else if (mask !== char) {\n return false;\n }\n }\n\n return true;\n }\n\n if (!value) {\n return;\n }\n\n if (value.length > cMask.length) {\n this._app.alert("Value is too long");\n\n event.rc = false;\n return;\n }\n\n if (event.willCommit) {\n if (value.length < cMask.length) {\n this._app.alert("Value is too short");\n\n event.rc = false;\n return;\n }\n\n if (!_checkValidity(value, cMask)) {\n this._app.alert("Value doesn\'t fit the specified format");\n\n event.rc = false;\n return;\n }\n\n return;\n }\n\n if (value.length < cMask.length) {\n cMask = cMask.substring(0, value.length);\n }\n\n if (!_checkValidity(value, cMask)) {\n event.rc = false;\n }\n }\n\n AFSpecial_Keystroke(psf) {\n const event = globalThis.event;\n\n if (!event.value) {\n return;\n }\n\n psf = this.AFMakeNumber(psf);\n\n if (psf === null) {\n throw new Error("Invalid psf in AFSpecial_Keystroke");\n }\n\n let formatStr;\n\n switch (psf) {\n case 0:\n formatStr = "99999";\n break;\n\n case 1:\n formatStr = "99999-9999";\n break;\n\n case 2:\n const finalLen = event.value.length + event.change.length + event.selStart - event.selEnd;\n\n if (finalLen >= 8) {\n formatStr = "(999) 999-9999";\n } else {\n formatStr = "999-9999";\n }\n\n break;\n\n case 3:\n formatStr = "999-99-9999";\n break;\n\n default:\n throw new Error("Invalid psf in AFSpecial_Keystroke");\n }\n\n this.AFSpecial_KeystrokeEx(formatStr);\n }\n\n AFTime_FormatEx(cFormat) {\n this.AFDate_FormatEx(cFormat);\n }\n\n AFTime_Format(pdf) {\n if (pdf >= 0 && pdf < this._timeFormats.length) {\n this.AFDate_FormatEx(this._timeFormats[pdf]);\n }\n }\n\n AFTime_KeystrokeEx(cFormat) {\n this.AFDate_KeystrokeEx(cFormat);\n }\n\n AFTime_Keystroke(pdf) {\n if (pdf >= 0 && pdf < this._timeFormats.length) {\n this.AFDate_KeystrokeEx(this._timeFormats[pdf]);\n }\n }\n\n eMailValidate(str) {\n return this._emailRegex.test(str);\n }\n\n}\n\nexports.AForm = AForm;\n\n/***/ }),\n/* 9 */\n/***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {\n\n\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.App = void 0;\n\nvar _color = __w_pdfjs_require__(4);\n\nvar _event = __w_pdfjs_require__(10);\n\nvar _fullscreen = __w_pdfjs_require__(11);\n\nvar _pdf_object = __w_pdfjs_require__(6);\n\nvar _thermometer = __w_pdfjs_require__(12);\n\nconst VIEWER_TYPE = "PDF.js";\nconst VIEWER_VARIATION = "Full";\nconst VIEWER_VERSION = "10.0";\nconst FORMS_VERSION = undefined;\n\nclass App extends _pdf_object.PDFObject {\n constructor(data) {\n super(data);\n this.calculate = true;\n this._constants = null;\n this._focusRect = true;\n this._fs = null;\n this._language = App._getLanguage(data.language);\n this._openInPlace = false;\n this._platform = App._getPlatform(data.platform);\n this._runtimeHighlight = false;\n this._runtimeHighlightColor = ["T"];\n this._thermometer = null;\n this._toolbar = false;\n this._document = data._document;\n this._proxyHandler = data.proxyHandler;\n this._objects = Object.create(null);\n this._eventDispatcher = new _event.EventDispatcher(this._document, data.calculationOrder, this._objects);\n this._timeoutIds = new WeakMap();\n\n if (typeof FinalizationRegistry !== "undefined") {\n this._timeoutIdsRegistry = new FinalizationRegistry(this._cleanTimeout.bind(this));\n } else {\n this._timeoutIdsRegistry = null;\n }\n\n this._timeoutCallbackIds = new Map();\n this._timeoutCallbackId = 0;\n this._globalEval = data.globalEval;\n this._externalCall = data.externalCall;\n }\n\n _dispatchEvent(pdfEvent) {\n this._eventDispatcher.dispatch(pdfEvent);\n }\n\n _registerTimeoutCallback(cExpr) {\n const id = this._timeoutCallbackId++;\n\n this._timeoutCallbackIds.set(id, cExpr);\n\n return id;\n }\n\n _unregisterTimeoutCallback(id) {\n this._timeoutCallbackIds.delete(id);\n }\n\n _evalCallback({\n callbackId,\n interval\n }) {\n const expr = this._timeoutCallbackIds.get(callbackId);\n\n if (!interval) {\n this._unregisterTimeoutCallback(callbackId);\n }\n\n if (expr) {\n this._globalEval(expr);\n }\n }\n\n _registerTimeout(callbackId, interval) {\n const timeout = Object.create(null);\n const id = {\n callbackId,\n interval\n };\n\n this._timeoutIds.set(timeout, id);\n\n if (this._timeoutIdsRegistry) {\n this._timeoutIdsRegistry.register(timeout, id);\n }\n\n return timeout;\n }\n\n _unregisterTimeout(timeout) {\n if (this._timeoutIdsRegistry) {\n this._timeoutIdsRegistry.unregister(timeout);\n }\n\n const data = this._timeoutIds.get(timeout);\n\n if (!data) {\n return;\n }\n\n this._timeoutIds.delete(timeout);\n\n this._cleanTimeout(data);\n }\n\n _cleanTimeout({\n callbackId,\n interval\n }) {\n this._unregisterTimeoutCallback(callbackId);\n\n if (interval) {\n this._externalCall("clearInterval", [callbackId]);\n } else {\n this._externalCall("clearTimeout", [callbackId]);\n }\n }\n\n static _getPlatform(platform) {\n if (typeof platform === "string") {\n platform = platform.toLowerCase();\n\n if (platform.includes("win")) {\n return "WIN";\n } else if (platform.includes("mac")) {\n return "MAC";\n }\n }\n\n return "UNIX";\n }\n\n static _getLanguage(language) {\n const [main, sub] = language.toLowerCase().split(/[-_]/);\n\n switch (main) {\n case "zh":\n if (sub === "cn" || sub === "sg") {\n return "CHS";\n }\n\n return "CHT";\n\n case "da":\n return "DAN";\n\n case "de":\n return "DEU";\n\n case "es":\n return "ESP";\n\n case "fr":\n return "FRA";\n\n case "it":\n return "ITA";\n\n case "ko":\n return "KOR";\n\n case "ja":\n return "JPN";\n\n case "nl":\n return "NLD";\n\n case "no":\n return "NOR";\n\n case "pt":\n if (sub === "br") {\n return "PTB";\n }\n\n return "ENU";\n\n case "fi":\n return "SUO";\n\n case "SV":\n return "SVE";\n\n default:\n return "ENU";\n }\n }\n\n get activeDocs() {\n return [this._document.wrapped];\n }\n\n set activeDocs(_) {\n throw new Error("app.activeDocs is read-only");\n }\n\n get constants() {\n if (!this._constants) {\n this._constants = Object.freeze({\n align: Object.freeze({\n left: 0,\n center: 1,\n right: 2,\n top: 3,\n bottom: 4\n })\n });\n }\n\n return this._constants;\n }\n\n set constants(_) {\n throw new Error("app.constants is read-only");\n }\n\n get focusRect() {\n return this._focusRect;\n }\n\n set focusRect(val) {\n this._focusRect = val;\n }\n\n get formsVersion() {\n return FORMS_VERSION;\n }\n\n set formsVersion(_) {\n throw new Error("app.formsVersion is read-only");\n }\n\n get fromPDFConverters() {\n return [];\n }\n\n set fromPDFConverters(_) {\n throw new Error("app.fromPDFConverters is read-only");\n }\n\n get fs() {\n if (this._fs === null) {\n this._fs = new Proxy(new _fullscreen.FullScreen({\n send: this._send\n }), this._proxyHandler);\n }\n\n return this._fs;\n }\n\n set fs(_) {\n throw new Error("app.fs is read-only");\n }\n\n get language() {\n return this._language;\n }\n\n set language(_) {\n throw new Error("app.language is read-only");\n }\n\n get media() {\n return undefined;\n }\n\n set media(_) {\n throw new Error("app.media is read-only");\n }\n\n get monitors() {\n return [];\n }\n\n set monitors(_) {\n throw new Error("app.monitors is read-only");\n }\n\n get numPlugins() {\n return 0;\n }\n\n set numPlugins(_) {\n throw new Error("app.numPlugins is read-only");\n }\n\n get openInPlace() {\n return this._openInPlace;\n }\n\n set openInPlace(val) {\n this._openInPlace = val;\n }\n\n get platform() {\n return this._platform;\n }\n\n set platform(_) {\n throw new Error("app.platform is read-only");\n }\n\n get plugins() {\n return [];\n }\n\n set plugins(_) {\n throw new Error("app.plugins is read-only");\n }\n\n get printColorProfiles() {\n return [];\n }\n\n set printColorProfiles(_) {\n throw new Error("app.printColorProfiles is read-only");\n }\n\n get printerNames() {\n return [];\n }\n\n set printerNames(_) {\n throw new Error("app.printerNames is read-only");\n }\n\n get runtimeHighlight() {\n return this._runtimeHighlight;\n }\n\n set runtimeHighlight(val) {\n this._runtimeHighlight = val;\n }\n\n get runtimeHighlightColor() {\n return this._runtimeHighlightColor;\n }\n\n set runtimeHighlightColor(val) {\n if (_color.Color._isValidColor(val)) {\n this._runtimeHighlightColor = val;\n }\n }\n\n get thermometer() {\n if (this._thermometer === null) {\n this._thermometer = new Proxy(new _thermometer.Thermometer({\n send: this._send\n }), this._proxyHandler);\n }\n\n return this._thermometer;\n }\n\n set thermometer(_) {\n throw new Error("app.thermometer is read-only");\n }\n\n get toolbar() {\n return this._toolbar;\n }\n\n set toolbar(val) {\n this._toolbar = val;\n }\n\n get toolbarHorizontal() {\n return this.toolbar;\n }\n\n set toolbarHorizontal(value) {\n this.toolbar = value;\n }\n\n get toolbarVertical() {\n return this.toolbar;\n }\n\n set toolbarVertical(value) {\n this.toolbar = value;\n }\n\n get viewerType() {\n return VIEWER_TYPE;\n }\n\n set viewerType(_) {\n throw new Error("app.viewerType is read-only");\n }\n\n get viewerVariation() {\n return VIEWER_VARIATION;\n }\n\n set viewerVariation(_) {\n throw new Error("app.viewerVariation is read-only");\n }\n\n get viewerVersion() {\n return VIEWER_VERSION;\n }\n\n set viewerVersion(_) {\n throw new Error("app.viewerVersion is read-only");\n }\n\n addMenuItem() {}\n\n addSubMenu() {}\n\n addToolButton() {}\n\n alert(cMsg, nIcon = 0, nType = 0, cTitle = "PDF.js", oDoc = null, oCheckbox = null) {\n this._externalCall("alert", [cMsg]);\n }\n\n beep() {}\n\n beginPriv() {}\n\n browseForDoc() {}\n\n clearInterval(oInterval) {\n this._unregisterTimeout(oInterval);\n }\n\n clearTimeOut(oTime) {\n this._unregisterTimeout(oTime);\n }\n\n endPriv() {}\n\n execDialog() {}\n\n execMenuItem() {}\n\n getNthPlugInName() {}\n\n getPath() {}\n\n goBack() {}\n\n goForward() {}\n\n hideMenuItem() {}\n\n hideToolbarButton() {}\n\n launchURL() {}\n\n listMenuItems() {}\n\n listToolbarButtons() {}\n\n loadPolicyFile() {}\n\n mailGetAddrs() {}\n\n mailMsg() {}\n\n newDoc() {}\n\n newCollection() {}\n\n newFDF() {}\n\n openDoc() {}\n\n openFDF() {}\n\n popUpMenu() {}\n\n popUpMenuEx() {}\n\n removeToolButton() {}\n\n response(cQuestion, cTitle = "", cDefault = "", bPassword = "", cLabel = "") {\n return this._externalCall("prompt", [cQuestion, cDefault || ""]);\n }\n\n setInterval(cExpr, nMilliseconds) {\n if (typeof cExpr !== "string") {\n throw new TypeError("First argument of app.setInterval must be a string");\n }\n\n if (typeof nMilliseconds !== "number") {\n throw new TypeError("Second argument of app.setInterval must be a number");\n }\n\n const callbackId = this._registerTimeoutCallback(cExpr);\n\n this._externalCall("setInterval", [callbackId, nMilliseconds]);\n\n return this._registerTimeout(callbackId, true);\n }\n\n setTimeOut(cExpr, nMilliseconds) {\n if (typeof cExpr !== "string") {\n throw new TypeError("First argument of app.setTimeOut must be a string");\n }\n\n if (typeof nMilliseconds !== "number") {\n throw new TypeError("Second argument of app.setTimeOut must be a number");\n }\n\n const callbackId = this._registerTimeoutCallback(cExpr);\n\n this._externalCall("setTimeout", [callbackId, nMilliseconds]);\n\n return this._registerTimeout(callbackId, false);\n }\n\n trustedFunction() {}\n\n trustPropagatorFunction() {}\n\n}\n\nexports.App = App;\n\n/***/ }),\n/* 10 */\n/***/ ((__unused_webpack_module, exports) => {\n\n\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.EventDispatcher = exports.Event = void 0;\n\nclass Event {\n constructor(data) {\n this.change = data.change || "";\n this.changeEx = data.changeEx || null;\n this.commitKey = data.commitKey || 0;\n this.fieldFull = data.fieldFull || false;\n this.keyDown = data.keyDown || false;\n this.modifier = data.modifier || false;\n this.name = data.name;\n this.rc = true;\n this.richChange = data.richChange || [];\n this.richChangeEx = data.richChangeEx || [];\n this.richValue = data.richValue || [];\n this.selEnd = data.selEnd || -1;\n this.selStart = data.selStart || -1;\n this.shift = data.shift || false;\n this.source = data.source || null;\n this.target = data.target || null;\n this.targetName = "";\n this.type = "Field";\n this.value = data.value || "";\n this.willCommit = data.willCommit || false;\n }\n\n}\n\nexports.Event = Event;\n\nclass EventDispatcher {\n constructor(document, calculationOrder, objects) {\n this._document = document;\n this._calculationOrder = calculationOrder;\n this._objects = objects;\n this._document.obj._eventDispatcher = this;\n }\n\n mergeChange(event) {\n let value = event.value;\n\n if (typeof value !== "string") {\n value = value.toString();\n }\n\n const prefix = event.selStart >= 0 ? value.substring(0, event.selStart) : "";\n const postfix = event.selEnd >= 0 && event.selEnd <= value.length ? value.substring(event.selEnd) : "";\n return `${prefix}${event.change}${postfix}`;\n }\n\n dispatch(baseEvent) {\n const id = baseEvent.id;\n\n if (!(id in this._objects)) {\n let event;\n\n if (id === "doc" || id === "page") {\n event = globalThis.event = new Event(baseEvent);\n event.source = event.target = this._document.wrapped;\n event.name = baseEvent.name;\n }\n\n if (id === "doc") {\n this._document.obj._dispatchDocEvent(event.name);\n } else if (id === "page") {\n this._document.obj._dispatchPageEvent(event.name, baseEvent.actions, baseEvent.pageNumber);\n }\n\n return;\n }\n\n const name = baseEvent.name.replace(" ", "");\n const source = this._objects[id];\n const event = globalThis.event = new Event(baseEvent);\n let savedChange;\n\n if (source.obj._isButton()) {\n source.obj._id = id;\n event.value = source.obj._getExportValue(event.value);\n\n if (name === "Action") {\n source.obj._value = event.value;\n }\n }\n\n if (name === "Keystroke") {\n savedChange = {\n value: event.value,\n change: event.change,\n selStart: event.selStart,\n selEnd: event.selEnd\n };\n } else if (name === "Blur" || name === "Focus") {\n Object.defineProperty(event, "value", {\n configurable: false,\n writable: false,\n enumerable: true,\n value: event.value\n });\n } else if (name === "Validate") {\n this.runValidation(source, event);\n return;\n }\n\n this.runActions(source, source, event, name);\n\n if (name === "Keystroke") {\n if (event.rc) {\n if (event.willCommit) {\n this.runValidation(source, event);\n } else if