: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
super(TEMPLATE_NS_ID, "choiceList", true);
this.commitOn = getStringOption(attributes.commitOn, ["select", "exit"]);
this.id = attributes.id || "";
this.open = getStringOption(attributes.open, ["userControl", "always", "multiSelect", "onEntry"]);
this.textEntry = getInteger({
data: attributes.textEntry,
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
[$toHTML](availableSpace) {
const style = toStyle(this, "border", "margin");
const ui = this[$getParent]();
const field = ui[$getParent]();
const fontSize = field.font?.size || 10;
fontSize: `calc(${fontSize}px * var(--scale-factor))`
if (field.items.children.length > 0) {
const items = field.items;
if (items.children.length === 2) {
displayedIndex = items.children[0].save;
saveIndex = 1 - displayedIndex;
const displayed = items.children[displayedIndex][$toHTML]().html;
const values = items.children[saveIndex][$toHTML]().html;
const value = field.value?.[$text]() || "";
for (let i = 0, ii = displayed.length; i < ii; i++) {
value: values[i] || displayed[i],
if (values[i] === value) {
option.attributes.selected = selected = true;
const selectAttributes = {
dataId: field[$data]?.[$uid] || field[$uid],
"aria-label": ariaLabel(field),
selectAttributes["aria-required"] = true;
selectAttributes.required = true;
if (this.open === "multiSelect") {
selectAttributes.multiple = true;
return HTMLResult.success({
attributes: selectAttributes
class Color extends XFAObject {
constructor(attributes) {
super(TEMPLATE_NS_ID, "color", true);
this.cSpace = getStringOption(attributes.cSpace, ["SRGB"]);
this.id = attributes.id || "";
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
this.value = attributes.value ? getColor(attributes.value) : "";
return this.value ? Util.makeHexColor(this.value.r, this.value.g, this.value.b) : null;
class Comb extends XFAObject {
constructor(attributes) {
super(TEMPLATE_NS_ID, "comb");
this.id = attributes.id || "";
this.numberOfCells = getInteger({
data: attributes.numberOfCells,
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
class Connect extends XFAObject {
constructor(attributes) {
super(TEMPLATE_NS_ID, "connect", true);
this.connection = attributes.connection || "";
this.id = attributes.id || "";
this.ref = attributes.ref || "";
this.usage = getStringOption(attributes.usage, ["exportAndImport", "exportOnly", "importOnly"]);
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
class ContentArea extends XFAObject {
constructor(attributes) {
super(TEMPLATE_NS_ID, "contentArea", true);
this.h = getMeasurement(attributes.h);
this.id = attributes.id || "";
this.name = attributes.name || "";
this.relevant = getRelevant(attributes.relevant);
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
this.w = getMeasurement(attributes.w);
this.x = getMeasurement(attributes.x, "0pt");
this.y = getMeasurement(attributes.y, "0pt");
[$toHTML](availableSpace) {
const left = measureToString(this.x);
const top = measureToString(this.y);
width: measureToString(this.w),
height: measureToString(this.h)
const classNames = ["xfaContentarea"];
classNames.push("xfaPrintOnly");
return HTMLResult.success({
class Corner extends XFAObject {
constructor(attributes) {
super(TEMPLATE_NS_ID, "corner", true);
this.id = attributes.id || "";
this.inverted = getInteger({
data: attributes.inverted,
this.join = getStringOption(attributes.join, ["square", "round"]);
this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]);
this.radius = getMeasurement(attributes.radius);
this.stroke = getStringOption(attributes.stroke, ["solid", "dashDot", "dashDotDot", "dashed", "dotted", "embossed", "etched", "lowered", "raised"]);
this.thickness = getMeasurement(attributes.thickness, "0.5pt");
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
const style = toStyle(this, "visibility");
style.radius = measureToString(this.join === "square" ? 0 : this.radius);
class DateElement extends ContentObject {
constructor(attributes) {
super(TEMPLATE_NS_ID, "date");
this.id = attributes.id || "";
this.name = attributes.name || "";
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
const date = this[$content].trim();
this[$content] = date ? new Date(date) : null;
[$toHTML](availableSpace) {
return valueToHtml(this[$content] ? this[$content].toString() : "");
class DateTime extends ContentObject {
constructor(attributes) {
super(TEMPLATE_NS_ID, "dateTime");
this.id = attributes.id || "";
this.name = attributes.name || "";
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
const date = this[$content].trim();
this[$content] = date ? new Date(date) : null;
[$toHTML](availableSpace) {
return valueToHtml(this[$content] ? this[$content].toString() : "");
class DateTimeEdit extends XFAObject {
constructor(attributes) {
super(TEMPLATE_NS_ID, "dateTimeEdit", true);
this.hScrollPolicy = getStringOption(attributes.hScrollPolicy, ["auto", "off", "on"]);
this.id = attributes.id || "";
this.picker = getStringOption(attributes.picker, ["host", "none"]);
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
[$toHTML](availableSpace) {
const style = toStyle(this, "border", "font", "margin");
const field = this[$getParent]()[$getParent]();
dataId: field[$data]?.[$uid] || field[$uid],
"aria-label": ariaLabel(field),
html.attributes["aria-required"] = true;
html.attributes.required = true;
return HTMLResult.success({
class Decimal extends ContentObject {
constructor(attributes) {
super(TEMPLATE_NS_ID, "decimal");
this.fracDigits = getInteger({
data: attributes.fracDigits,
this.id = attributes.id || "";
this.leadDigits = getInteger({
data: attributes.leadDigits,
this.name = attributes.name || "";
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
const number = parseFloat(this[$content].trim());
this[$content] = isNaN(number) ? null : number;
[$toHTML](availableSpace) {
return valueToHtml(this[$content] !== null ? this[$content].toString() : "");
class DefaultUi extends XFAObject {
constructor(attributes) {
super(TEMPLATE_NS_ID, "defaultUi", true);
this.id = attributes.id || "";
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
class Desc extends XFAObject {
constructor(attributes) {
super(TEMPLATE_NS_ID, "desc", true);
this.id = attributes.id || "";
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
this.boolean = new XFAObjectArray();
this.date = new XFAObjectArray();
this.dateTime = new XFAObjectArray();
this.decimal = new XFAObjectArray();
this.exData = new XFAObjectArray();
this.float = new XFAObjectArray();
this.image = new XFAObjectArray();
this.integer = new XFAObjectArray();
this.text = new XFAObjectArray();
this.time = new XFAObjectArray();
class DigestMethod extends OptionObject {
constructor(attributes) {
super(TEMPLATE_NS_ID, "digestMethod", ["", "SHA1", "SHA256", "SHA512", "RIPEMD160"]);
this.id = attributes.id || "";
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
class DigestMethods extends XFAObject {
constructor(attributes) {
super(TEMPLATE_NS_ID, "digestMethods", true);
this.id = attributes.id || "";
this.type = getStringOption(attributes.type, ["optional", "required"]);
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
this.digestMethod = new XFAObjectArray();
class Draw extends XFAObject {
constructor(attributes) {
super(TEMPLATE_NS_ID, "draw", true);
this.anchorType = getStringOption(attributes.anchorType, ["topLeft", "bottomCenter", "bottomLeft", "bottomRight", "middleCenter", "middleLeft", "middleRight", "topCenter", "topRight"]);
this.colSpan = getInteger({
data: attributes.colSpan,
validate: n => n >= 1 || n === -1
this.h = attributes.h ? getMeasurement(attributes.h) : "";
this.hAlign = getStringOption(attributes.hAlign, ["left", "center", "justify", "justifyAll", "radix", "right"]);
this.id = attributes.id || "";
this.locale = attributes.locale || "";
this.maxH = getMeasurement(attributes.maxH, "0pt");
this.maxW = getMeasurement(attributes.maxW, "0pt");
this.minH = getMeasurement(attributes.minH, "0pt");
this.minW = getMeasurement(attributes.minW, "0pt");
this.name = attributes.name || "";
this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]);
this.relevant = getRelevant(attributes.relevant);
this.rotate = getInteger({
validate: x => x % 90 === 0
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
this.w = attributes.w ? getMeasurement(attributes.w) : "";
this.x = getMeasurement(attributes.x, "0pt");
this.y = getMeasurement(attributes.y, "0pt");
this.setProperty = new XFAObjectArray();
[$toHTML](availableSpace) {
if (this.presence === "hidden" || this.presence === "inactive") {
} = layoutNode(this, availableSpace);
if (w && this.w === "") {
if (isBroken && this[$getSubformParent]()[$isThereMoreWidth]()) {
return HTMLResult.FAILURE;
if (h && this.h === "") {
setFirstUnsplittable(this);
if (!checkDimensions(this, availableSpace)) {
return HTMLResult.FAILURE;
unsetFirstUnsplittable(this);
const style = toStyle(this, "font", "hAlign", "dimensions", "position", "presence", "rotate", "anchorType", "border", "margin");
setMinMaxDimensions(this, style);
style.padding = style.margin;
const classNames = ["xfaDraw"];
classNames.push("xfaFont");
classNames.push("xfaPrintOnly");
attributes.xfaName = this.name;
applyAssist(this, attributes);
const bbox = computeBbox(this, html, availableSpace);
const value = this.value ? this.value[$toHTML](availableSpace).html : null;
return HTMLResult.success(createWrapper(this, html), bbox);
html.children.push(value);
setPara(this, style, value);
return HTMLResult.success(createWrapper(this, html), bbox);
class Edge extends XFAObject {
constructor(attributes) {
super(TEMPLATE_NS_ID, "edge", true);
this.cap = getStringOption(attributes.cap, ["square", "butt", "round"]);
this.id = attributes.id || "";
this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]);
this.stroke = getStringOption(attributes.stroke, ["solid", "dashDot", "dashDotDot", "dashed", "dotted", "embossed", "etched", "lowered", "raised"]);
this.thickness = getMeasurement(attributes.thickness, "0.5pt");
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
const style = toStyle(this, "visibility");
width: measureToString(this.thickness),
color: this.color ? this.color[$toStyle]() : "#000000",
if (this.presence !== "visible") {