: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
const DATASETS_NS_ID = NamespaceIds.datasets.id;
class datasets_Data extends XmlObject {
constructor(attributes) {
super(DATASETS_NS_ID, "data", attributes);
class Datasets extends XFAObject {
constructor(attributes) {
super(DATASETS_NS_ID, "datasets", true);
const name = child[$nodeName];
if (name === "data" && child[$namespaceId] === DATASETS_NS_ID || name === "Signature" && child[$namespaceId] === NamespaceIds.signature.id) {
this[$appendChild](child);
class DatasetsNamespace {
static [$buildXFAObject](name, attributes) {
if (DatasetsNamespace.hasOwnProperty(name)) {
return DatasetsNamespace[name](attributes);
static datasets(attributes) {
return new Datasets(attributes);
static data(attributes) {
return new datasets_Data(attributes);
;// CONCATENATED MODULE: ./src/core/xfa/locale_set.js
const LOCALE_SET_NS_ID = NamespaceIds.localeSet.id;
class CalendarSymbols extends XFAObject {
constructor(attributes) {
super(LOCALE_SET_NS_ID, "calendarSymbols", true);
this.dayNames = new XFAObjectArray(2);
this.meridiemNames = null;
this.monthNames = new XFAObjectArray(2);
class CurrencySymbol extends StringObject {
constructor(attributes) {
super(LOCALE_SET_NS_ID, "currencySymbol");
this.name = getStringOption(attributes.name, ["symbol", "isoname", "decimal"]);
class CurrencySymbols extends XFAObject {
constructor(attributes) {
super(LOCALE_SET_NS_ID, "currencySymbols", true);
this.currencySymbol = new XFAObjectArray(3);
class DatePattern extends StringObject {
constructor(attributes) {
super(LOCALE_SET_NS_ID, "datePattern");
this.name = getStringOption(attributes.name, ["full", "long", "med", "short"]);
class DatePatterns extends XFAObject {
constructor(attributes) {
super(LOCALE_SET_NS_ID, "datePatterns", true);
this.datePattern = new XFAObjectArray(4);
class DateTimeSymbols extends ContentObject {
constructor(attributes) {
super(LOCALE_SET_NS_ID, "dateTimeSymbols");
class Day extends StringObject {
constructor(attributes) {
super(LOCALE_SET_NS_ID, "day");
class DayNames extends XFAObject {
constructor(attributes) {
super(LOCALE_SET_NS_ID, "dayNames", true);
this.day = new XFAObjectArray(7);
class Era extends StringObject {
constructor(attributes) {
super(LOCALE_SET_NS_ID, "era");
class EraNames extends XFAObject {
constructor(attributes) {
super(LOCALE_SET_NS_ID, "eraNames", true);
this.era = new XFAObjectArray(2);
class locale_set_Locale extends XFAObject {
constructor(attributes) {
super(LOCALE_SET_NS_ID, "locale", true);
this.desc = attributes.desc || "";
this.calendarSymbols = null;
this.currencySymbols = null;
this.datePatterns = null;
this.dateTimeSymbols = null;
this.numberPatterns = null;
this.numberSymbols = null;
this.timePatterns = null;
class locale_set_LocaleSet extends XFAObject {
constructor(attributes) {
super(LOCALE_SET_NS_ID, "localeSet", true);
this.locale = new XFAObjectArray();
class Meridiem extends StringObject {
constructor(attributes) {
super(LOCALE_SET_NS_ID, "meridiem");
class MeridiemNames extends XFAObject {
constructor(attributes) {
super(LOCALE_SET_NS_ID, "meridiemNames", true);
this.meridiem = new XFAObjectArray(2);
class Month extends StringObject {
constructor(attributes) {
super(LOCALE_SET_NS_ID, "month");
class MonthNames extends XFAObject {
constructor(attributes) {
super(LOCALE_SET_NS_ID, "monthNames", true);
this.month = new XFAObjectArray(12);
class NumberPattern extends StringObject {
constructor(attributes) {
super(LOCALE_SET_NS_ID, "numberPattern");
this.name = getStringOption(attributes.name, ["full", "long", "med", "short"]);
class NumberPatterns extends XFAObject {
constructor(attributes) {
super(LOCALE_SET_NS_ID, "numberPatterns", true);
this.numberPattern = new XFAObjectArray(4);
class NumberSymbol extends StringObject {
constructor(attributes) {
super(LOCALE_SET_NS_ID, "numberSymbol");
this.name = getStringOption(attributes.name, ["decimal", "grouping", "percent", "minus", "zero"]);
class NumberSymbols extends XFAObject {
constructor(attributes) {
super(LOCALE_SET_NS_ID, "numberSymbols", true);
this.numberSymbol = new XFAObjectArray(5);
class TimePattern extends StringObject {
constructor(attributes) {
super(LOCALE_SET_NS_ID, "timePattern");
this.name = getStringOption(attributes.name, ["full", "long", "med", "short"]);
class TimePatterns extends XFAObject {
constructor(attributes) {
super(LOCALE_SET_NS_ID, "timePatterns", true);
this.timePattern = new XFAObjectArray(4);
class TypeFace extends XFAObject {
constructor(attributes) {
super(LOCALE_SET_NS_ID, "typeFace", true);
this.name = attributes.name | "";
class TypeFaces extends XFAObject {
constructor(attributes) {
super(LOCALE_SET_NS_ID, "typeFaces", true);
this.typeFace = new XFAObjectArray();
class LocaleSetNamespace {
static [$buildXFAObject](name, attributes) {
if (LocaleSetNamespace.hasOwnProperty(name)) {
return LocaleSetNamespace[name](attributes);
static calendarSymbols(attrs) {
return new CalendarSymbols(attrs);
static currencySymbol(attrs) {
return new CurrencySymbol(attrs);
static currencySymbols(attrs) {
return new CurrencySymbols(attrs);
static datePattern(attrs) {
return new DatePattern(attrs);
static datePatterns(attrs) {
return new DatePatterns(attrs);
static dateTimeSymbols(attrs) {
return new DateTimeSymbols(attrs);
return new DayNames(attrs);
return new EraNames(attrs);
return new locale_set_Locale(attrs);
static localeSet(attrs) {
return new locale_set_LocaleSet(attrs);
return new Meridiem(attrs);
static meridiemNames(attrs) {
return new MeridiemNames(attrs);
static monthNames(attrs) {
return new MonthNames(attrs);
static numberPattern(attrs) {
return new NumberPattern(attrs);
static numberPatterns(attrs) {
return new NumberPatterns(attrs);
static numberSymbol(attrs) {
return new NumberSymbol(attrs);
static numberSymbols(attrs) {
return new NumberSymbols(attrs);
static timePattern(attrs) {
return new TimePattern(attrs);
static timePatterns(attrs) {
return new TimePatterns(attrs);
return new TypeFace(attrs);
static typeFaces(attrs) {
return new TypeFaces(attrs);
;// CONCATENATED MODULE: ./src/core/xfa/signature.js
const SIGNATURE_NS_ID = NamespaceIds.signature.id;
class signature_Signature extends XFAObject {
constructor(attributes) {
super(SIGNATURE_NS_ID, "signature", true);
class SignatureNamespace {
static [$buildXFAObject](name, attributes) {
if (SignatureNamespace.hasOwnProperty(name)) {
return SignatureNamespace[name](attributes);
static signature(attributes) {
return new signature_Signature(attributes);
;// CONCATENATED MODULE: ./src/core/xfa/stylesheet.js
const STYLESHEET_NS_ID = NamespaceIds.stylesheet.id;
class Stylesheet extends XFAObject {
constructor(attributes) {
super(STYLESHEET_NS_ID, "stylesheet", true);
class StylesheetNamespace {
static [$buildXFAObject](name, attributes) {
if (StylesheetNamespace.hasOwnProperty(name)) {
return StylesheetNamespace[name](attributes);
static stylesheet(attributes) {
return new Stylesheet(attributes);
;// CONCATENATED MODULE: ./src/core/xfa/xdp.js
const XDP_NS_ID = NamespaceIds.xdp.id;
class xdp_Xdp extends XFAObject {
constructor(attributes) {
super(XDP_NS_ID, "xdp", true);
this.uuid = attributes.uuid || "";
this.timeStamp = attributes.timeStamp || "";
this.connectionSet = null;
this.stylesheet = new XFAObjectArray();
const ns = NamespaceIds[child[$nodeName]];
return ns && child[$namespaceId] === ns.id;
static [$buildXFAObject](name, attributes) {
if (XdpNamespace.hasOwnProperty(name)) {
return XdpNamespace[name](attributes);
return new xdp_Xdp(attributes);
;// CONCATENATED MODULE: ./src/core/xfa/xhtml.js
const XHTML_NS_ID = NamespaceIds.xhtml.id;
const $richText = Symbol();
const VALID_STYLES = new Set(["color", "font", "font-family", "font-size", "font-stretch", "font-style", "font-weight", "margin", "margin-bottom", "margin-left", "margin-right", "margin-top", "letter-spacing", "line-height", "orphans", "page-break-after", "page-break-before", "page-break-inside", "tab-interval", "tab-stop", "text-align", "text-decoration", "text-indent", "vertical-align", "widows", "kerning-mode", "xfa-font-horizontal-scale", "xfa-font-vertical-scale", "xfa-spacerun", "xfa-tab-stops"]);
const StyleMapping = new Map([["page-break-after", "breakAfter"], ["page-break-before", "breakBefore"], ["page-break-inside", "breakInside"], ["kerning-mode", value => value === "none" ? "none" : "normal"], ["xfa-font-horizontal-scale", value => `scaleX(${Math.max(0, Math.min(parseInt(value) / 100)).toFixed(2)})`], ["xfa-font-vertical-scale", value => `scaleY(${Math.max(0, Math.min(parseInt(value) / 100)).toFixed(2)})`], ["xfa-spacerun", ""], ["xfa-tab-stops", ""], ["font-size", (value, original) => {
value = original.fontSize = getMeasurement(value);
return measureToString(0.99 * value);
}], ["letter-spacing", value => measureToString(getMeasurement(value))], ["line-height", value => measureToString(getMeasurement(value))], ["margin", value => measureToString(getMeasurement(value))], ["margin-bottom", value => measureToString(getMeasurement(value))], ["margin-left", value => measureToString(getMeasurement(value))], ["margin-right", value => measureToString(getMeasurement(value))], ["margin-top", value => measureToString(getMeasurement(value))], ["text-indent", value => measureToString(getMeasurement(value))], ["font-family", value => value], ["vertical-align", value => measureToString(getMeasurement(value))]]);
const spacesRegExp = /\s+/g;
const crlfRegExp = /[\r\n]+/g;
const crlfForRichTextRegExp = /\r\n?/g;
function mapStyle(styleStr, node, richText) {
const style = Object.create(null);
const original = Object.create(null);
for (const [key, value] of styleStr.split(";").map(s => s.split(":", 2))) {
const mapping = StyleMapping.get(key);
newValue = typeof mapping === "string" ? mapping : mapping(value, original);
if (key.endsWith("scale")) {
style.transform = style.transform ? `${style[key]} ${newValue}` : newValue;
style[key.replaceAll(/-([a-zA-Z])/g, (_, x) => x.toUpperCase())] = newValue;
typeface: style.fontFamily,
weight: style.fontWeight || "normal",
posture: style.fontStyle || "normal",
size: original.fontSize || 0
}, node, node[$globalData].fontFinder, style);
if (richText && style.verticalAlign && style.verticalAlign !== "0px" && style.fontSize) {
const SUB_SUPER_SCRIPT_FACTOR = 0.583;
const VERTICAL_FACTOR = 0.333;
const fontSize = getMeasurement(style.fontSize);
style.fontSize = measureToString(fontSize * SUB_SUPER_SCRIPT_FACTOR);
style.verticalAlign = measureToString(Math.sign(getMeasurement(style.verticalAlign)) * fontSize * VERTICAL_FACTOR);
if (richText && style.fontSize) {
style.fontSize = `calc(${style.fontSize} * var(--scale-factor))`;
function checkStyle(node) {
return node.style.trim().split(/\s*;\s*/).filter(s => !!s).map(s => s.split(/\s*:\s*/, 2)).filter(([key, value]) => {
if (key === "font-family") {
node[$globalData].usedTypefaces.add(value);
return VALID_STYLES.has(key);
}).map(kv => kv.join(":")).join(";");
const NoWhites = new Set(["body", "html"]);
class XhtmlObject extends XmlObject {
constructor(attributes, name) {
super(XHTML_NS_ID, name);
this.style = attributes.style || "";
this.style = checkStyle(this);
return !NoWhites.has(this[$nodeName]);
[$onText](str, richText = false) {
str = str.replaceAll(crlfRegExp, "");
if (!this.style.includes("xfa-spacerun:yes")) {
str = str.replaceAll(spacesRegExp, " ");
[$pushGlyphs](measure, mustPop = true) {
const xfaFont = Object.create(null);
for (const [key, value] of this.style.split(";").map(s => s.split(":", 2))) {
xfaFont.typeface = stripQuotes(value);
xfaFont.size = getMeasurement(value);
xfaFont.letterSpacing = getMeasurement(value);
const values = value.split(/ \t/).map(x => getMeasurement(x));
margin.top = margin.bottom = margin.left = margin.right = values[0];