: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
if (dataNode[$namespaceId] === NamespaceIds.datasets.id && dataNode[$nodeName] === "data") {
dataNode = dataNode[$getParent]();
generator = this.data[$getRealChildrenByNameIt](name, true, false);
match = generator.next().value;
generator = this.data[$getAttributeIt](name, true);
match = generator.next().value;
if (match?.[$isDataValue]()) {
_setProperties(formNode, dataNode) {
if (!formNode.hasOwnProperty("setProperty")) {
} of formNode.setProperty.children) {
const nodes = searchNode(this.root, dataNode, ref, false, false);
warn(`XFA - Invalid reference: ${ref}.`);
if (!node[$isDescendent](this.data)) {
warn(`XFA - Invalid node: must be a data node.`);
const targetNodes = searchNode(this.root, formNode, target, false, false);
warn(`XFA - Invalid target: ${target}.`);
const [targetNode] = targetNodes;
if (!targetNode[$isDescendent](formNode)) {
warn(`XFA - Invalid target: must be a property or subproperty.`);
const targetParent = targetNode[$getParent]();
if (targetNode instanceof SetProperty || targetParent instanceof SetProperty) {
warn(`XFA - Invalid target: cannot be a setProperty or one of its properties.`);
if (targetNode instanceof BindItems || targetParent instanceof BindItems) {
warn(`XFA - Invalid target: cannot be a bindItems or one of its properties.`);
const content = node[$text]();
const name = targetNode[$nodeName];
if (targetNode instanceof XFAAttribute) {
const attrs = Object.create(null);
const obj = Reflect.construct(Object.getPrototypeOf(targetParent).constructor, [attrs]);
targetParent[name] = obj[name];
if (!targetNode.hasOwnProperty($content)) {
warn(`XFA - Invalid node to use in setProperty`);
targetNode[$data] = node;
targetNode[$content] = content;
_bindItems(formNode, dataNode) {
if (!formNode.hasOwnProperty("items") || !formNode.hasOwnProperty("bindItems") || formNode.bindItems.isEmpty()) {
for (const item of formNode.items.children) {
formNode[$removeChild](item);
const labels = new Items({});
const values = new Items({});
formNode[$appendChild](labels);
formNode.items.push(labels);
formNode[$appendChild](values);
formNode.items.push(values);
} of formNode.bindItems.children) {
const nodes = searchNode(this.root, dataNode, ref, false, false);
warn(`XFA - Invalid reference: ${ref}.`);
for (const node of nodes) {
if (!node[$isDescendent](this.datasets)) {
warn(`XFA - Invalid ref (${ref}): must be a datasets child.`);
const labelNodes = searchNode(this.root, node, labelRef, true, false);
warn(`XFA - Invalid label: ${labelRef}.`);
const [labelNode] = labelNodes;
if (!labelNode[$isDescendent](this.datasets)) {
warn(`XFA - Invalid label: must be a datasets child.`);
const valueNodes = searchNode(this.root, node, valueRef, true, false);
warn(`XFA - Invalid value: ${valueRef}.`);
const [valueNode] = valueNodes;
if (!valueNode[$isDescendent](this.datasets)) {
warn(`XFA - Invalid value: must be a datasets child.`);
const label = createText(labelNode[$text]());
const value = createText(valueNode[$text]());
labels[$appendChild](label);
values[$appendChild](value);
_bindOccurrences(formNode, matches, picture) {
if (matches.length > 1) {
baseClone = formNode[$clone]();
baseClone[$removeChild](baseClone.occur);
this._bindValue(formNode, matches[0], picture);
this._setProperties(formNode, matches[0]);
this._bindItems(formNode, matches[0]);
if (matches.length === 1) {
const parent = formNode[$getParent]();
const name = formNode[$nodeName];
const pos = parent[$indexOf](formNode);
for (let i = 1, ii = matches.length; i < ii; i++) {
const match = matches[i];
const clone = baseClone[$clone]();
parent[name].push(clone);
parent[$insertAt](pos + i, clone);
this._bindValue(clone, match, picture);
this._setProperties(clone, match);
this._bindItems(clone, match);
_createOccurrences(formNode) {
if (!occur || occur.initial <= 1) {
const parent = formNode[$getParent]();
const name = formNode[$nodeName];
if (!(parent[name] instanceof XFAObjectArray)) {
currentNumber = parent[name].children.filter(e => e.name === formNode.name).length;
currentNumber = parent[name].children.length;
const pos = parent[$indexOf](formNode) + 1;
const ii = occur.initial - currentNumber;
const nodeClone = formNode[$clone]();
nodeClone[$removeChild](nodeClone.occur);
parent[name].push(nodeClone);
parent[$insertAt](pos, nodeClone);
for (let i = 1; i < ii; i++) {
const clone = nodeClone[$clone]();
parent[name].push(clone);
parent[$insertAt](pos + i, clone);
_getOccurInfo(formNode) {
const max = occur.max === -1 ? Infinity : occur.max;
_setAndBind(formNode, dataNode) {
this._setProperties(formNode, dataNode);
this._bindItems(formNode, dataNode);
this._bindElement(formNode, dataNode);
_bindElement(formNode, dataNode) {
this._createOccurrences(formNode);
for (const child of formNode[$getChildren]()) {
if (this._mergeMode === undefined && child[$nodeName] === "subform") {
this._mergeMode = child.mergeMode === "consumeData";
const dataChildren = dataNode[$getChildren]();
if (dataChildren.length > 0) {
this._bindOccurrences(child, [dataChildren[0]], null);
} else if (this.emptyMerge) {
const nsId = dataNode[$namespaceId] === bind_NS_DATASETS ? -1 : dataNode[$namespaceId];
const dataChild = child[$data] = new XmlObject(nsId, child.name || "root");
dataNode[$appendChild](dataChild);
this._bindElement(child, dataChild);
if (!child[$isBindable]()) {
switch (child.bind.match) {
this._setAndBind(child, dataNode);
warn(`XFA - ref is empty in node ${child[$nodeName]}.`);
this._setAndBind(child, dataNode);
if (child.bind.picture) {
picture = child.bind.picture[$content];
const [min, max] = this._getOccurInfo(child);
match = searchNode(this.root, dataNode, ref, true, false);
match = createDataNode(this.data, dataNode, ref);
if (this._isConsumeData()) {
this._setAndBind(child, match);
if (this._isConsumeData()) {
match = match.filter(node => !node[$consumed]);
if (match.length > max) {
match = match.slice(0, max);
} else if (match.length === 0) {
if (match && this._isConsumeData()) {
this._setAndBind(child, dataNode);
if (this._isConsumeData()) {
while (matches.length < max) {
const found = this._findDataByNameToConsume(child.name, child[$hasSettableValue](), dataNode, global);
match = matches.length > 0 ? matches : null;
match = dataNode[$getRealChildrenByNameIt](child.name, false, this.emptyMerge).next().value;
uselessNodes.push(child);
const nsId = dataNode[$namespaceId] === bind_NS_DATASETS ? -1 : dataNode[$namespaceId];
match = child[$data] = new XmlObject(nsId, child.name);
dataNode[$appendChild](match);
this._setAndBind(child, match);
this._bindOccurrences(child, match, picture);
this._setAndBind(child, dataNode);
uselessNodes.push(child);
uselessNodes.forEach(node => node[$getParent]()[$removeChild](node));
;// CONCATENATED MODULE: ./src/core/xfa/data.js
constructor(root, data) {
this.dataset = root.datasets || null;
const stack = [[-1, this.data[$getChildren]()]];
while (stack.length > 0) {
const last = stack.at(-1);
const [i, children] = last;
if (i + 1 === children.length) {
const child = children[++last[0]];
const storageEntry = storage.get(child[$uid]);
child[$setValue](storageEntry);
const attributes = child[$getAttributes]();
for (const value of attributes.values()) {
const entry = storage.get(value[$uid]);
const nodes = child[$getChildren]();
const buf = [`<xfa:datasets xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/">`];
for (const child of this.dataset[$getChildren]()) {
if (child[$nodeName] !== "data") {
this.data[$toString](buf);
buf.push("</xfa:datasets>");
;// CONCATENATED MODULE: ./src/core/xfa/config.js
const CONFIG_NS_ID = NamespaceIds.config.id;
class Acrobat extends XFAObject {
constructor(attributes) {
super(CONFIG_NS_ID, "acrobat", true);
this.validateApprovalSignatures = null;
this.submitUrl = new XFAObjectArray();
class Acrobat7 extends XFAObject {
constructor(attributes) {
super(CONFIG_NS_ID, "acrobat7", true);
this.dynamicRender = null;
class ADBE_JSConsole extends OptionObject {
constructor(attributes) {
super(CONFIG_NS_ID, "ADBE_JSConsole", ["delegate", "Enable", "Disable"]);
class ADBE_JSDebugger extends OptionObject {
constructor(attributes) {
super(CONFIG_NS_ID, "ADBE_JSDebugger", ["delegate", "Enable", "Disable"]);
class AddSilentPrint extends Option01 {
constructor(attributes) {
super(CONFIG_NS_ID, "addSilentPrint");
class AddViewerPreferences extends Option01 {
constructor(attributes) {
super(CONFIG_NS_ID, "addViewerPreferences");
class AdjustData extends Option10 {
constructor(attributes) {
super(CONFIG_NS_ID, "adjustData");
class AdobeExtensionLevel extends IntegerObject {
constructor(attributes) {
super(CONFIG_NS_ID, "adobeExtensionLevel", 0, n => n >= 1 && n <= 8);
class Agent extends XFAObject {
constructor(attributes) {
super(CONFIG_NS_ID, "agent", true);
this.name = attributes.name ? attributes.name.trim() : "";
this.common = new XFAObjectArray();
class AlwaysEmbed extends ContentObject {
constructor(attributes) {
super(CONFIG_NS_ID, "alwaysEmbed");
class Amd extends StringObject {
constructor(attributes) {
super(CONFIG_NS_ID, "amd");
class config_Area extends XFAObject {
constructor(attributes) {
super(CONFIG_NS_ID, "area");
this.level = getInteger({
validate: n => n >= 1 && n <= 3
this.name = getStringOption(attributes.name, ["", "barcode", "coreinit", "deviceDriver", "font", "general", "layout", "merge", "script", "signature", "sourceSet", "templateCache"]);
class Attributes extends OptionObject {
constructor(attributes) {
super(CONFIG_NS_ID, "attributes", ["preserve", "delegate", "ignore"]);
class AutoSave extends OptionObject {
constructor(attributes) {
super(CONFIG_NS_ID, "autoSave", ["disabled", "enabled"]);