@dpml/core
Version:
DPML Core: Parsing, validation, and transformation for DPML documents
1,397 lines (1,376 loc) • 279 kB
JavaScript
import { createRequire } from "node:module";
var __create = Object.create;
var __getProtoOf = Object.getPrototypeOf;
var __defProp = Object.defineProperty;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __toESM = (mod, isNodeMode, target) => {
target = mod != null ? __create(__getProtoOf(mod)) : {};
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
for (let key of __getOwnPropNames(mod))
if (!__hasOwnProp.call(to, key))
__defProp(to, key, {
get: () => mod[key],
enumerable: true
});
return to;
};
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
var __require = /* @__PURE__ */ createRequire(import.meta.url);
// ../../node_modules/.bun/xml2js@0.6.2/node_modules/xml2js/lib/defaults.js
var require_defaults = __commonJS((exports) => {
(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: `
`
},
headless: false,
chunkSize: 1e4,
emptyTag: "",
cdata: false
}
};
}).call(exports);
});
// ../../node_modules/.bun/xmlbuilder@11.0.1/node_modules/xmlbuilder/lib/Utility.js
var require_Utility = __commonJS((exports, module) => {
(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;
}
};
exports.assign = assign;
exports.isFunction = isFunction;
exports.isObject = isObject;
exports.isArray = isArray;
exports.isEmpty = isEmpty;
exports.isPlainObject = isPlainObject;
exports.getValue = getValue;
}).call(exports);
});
// ../../node_modules/.bun/xmlbuilder@11.0.1/node_modules/xmlbuilder/lib/XMLDOMImplementation.js
var require_XMLDOMImplementation = __commonJS((exports, module) => {
(function() {
var XMLDOMImplementation;
module.exports = XMLDOMImplementation = function() {
function XMLDOMImplementation2() {}
XMLDOMImplementation2.prototype.hasFeature = function(feature, version) {
return true;
};
XMLDOMImplementation2.prototype.createDocumentType = function(qualifiedName, publicId, systemId) {
throw new Error("This DOM method is not implemented.");
};
XMLDOMImplementation2.prototype.createDocument = function(namespaceURI, qualifiedName, doctype) {
throw new Error("This DOM method is not implemented.");
};
XMLDOMImplementation2.prototype.createHTMLDocument = function(title) {
throw new Error("This DOM method is not implemented.");
};
XMLDOMImplementation2.prototype.getFeature = function(feature, version) {
throw new Error("This DOM method is not implemented.");
};
return XMLDOMImplementation2;
}();
}).call(exports);
});
// ../../node_modules/.bun/xmlbuilder@11.0.1/node_modules/xmlbuilder/lib/XMLDOMErrorHandler.js
var require_XMLDOMErrorHandler = __commonJS((exports, module) => {
(function() {
var XMLDOMErrorHandler;
module.exports = XMLDOMErrorHandler = function() {
function XMLDOMErrorHandler2() {}
XMLDOMErrorHandler2.prototype.handleError = function(error) {
throw new Error(error);
};
return XMLDOMErrorHandler2;
}();
}).call(exports);
});
// ../../node_modules/.bun/xmlbuilder@11.0.1/node_modules/xmlbuilder/lib/XMLDOMStringList.js
var require_XMLDOMStringList = __commonJS((exports, module) => {
(function() {
var XMLDOMStringList;
module.exports = XMLDOMStringList = function() {
function XMLDOMStringList2(arr) {
this.arr = arr || [];
}
Object.defineProperty(XMLDOMStringList2.prototype, "length", {
get: function() {
return this.arr.length;
}
});
XMLDOMStringList2.prototype.item = function(index) {
return this.arr[index] || null;
};
XMLDOMStringList2.prototype.contains = function(str) {
return this.arr.indexOf(str) !== -1;
};
return XMLDOMStringList2;
}();
}).call(exports);
});
// ../../node_modules/.bun/xmlbuilder@11.0.1/node_modules/xmlbuilder/lib/XMLDOMConfiguration.js
var require_XMLDOMConfiguration = __commonJS((exports, module) => {
(function() {
var XMLDOMConfiguration, XMLDOMErrorHandler, XMLDOMStringList;
XMLDOMErrorHandler = require_XMLDOMErrorHandler();
XMLDOMStringList = require_XMLDOMStringList();
module.exports = XMLDOMConfiguration = function() {
function XMLDOMConfiguration2() {
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(XMLDOMConfiguration2.prototype, "parameterNames", {
get: function() {
return new XMLDOMStringList(Object.keys(this.defaultParams));
}
});
XMLDOMConfiguration2.prototype.getParameter = function(name) {
if (this.params.hasOwnProperty(name)) {
return this.params[name];
} else {
return null;
}
};
XMLDOMConfiguration2.prototype.canSetParameter = function(name, value) {
return true;
};
XMLDOMConfiguration2.prototype.setParameter = function(name, value) {
if (value != null) {
return this.params[name] = value;
} else {
return delete this.params[name];
}
};
return XMLDOMConfiguration2;
}();
}).call(exports);
});
// ../../node_modules/.bun/xmlbuilder@11.0.1/node_modules/xmlbuilder/lib/NodeType.js
var require_NodeType = __commonJS((exports, module) => {
(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(exports);
});
// ../../node_modules/.bun/xmlbuilder@11.0.1/node_modules/xmlbuilder/lib/XMLAttribute.js
var require_XMLAttribute = __commonJS((exports, module) => {
(function() {
var NodeType, XMLAttribute, XMLNode;
NodeType = require_NodeType();
XMLNode = require_XMLNode();
module.exports = XMLAttribute = function() {
function XMLAttribute2(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(XMLAttribute2.prototype, "nodeType", {
get: function() {
return this.type;
}
});
Object.defineProperty(XMLAttribute2.prototype, "ownerElement", {
get: function() {
return this.parent;
}
});
Object.defineProperty(XMLAttribute2.prototype, "textContent", {
get: function() {
return this.value;
},
set: function(value) {
return this.value = value || "";
}
});
Object.defineProperty(XMLAttribute2.prototype, "namespaceURI", {
get: function() {
return "";
}
});
Object.defineProperty(XMLAttribute2.prototype, "prefix", {
get: function() {
return "";
}
});
Object.defineProperty(XMLAttribute2.prototype, "localName", {
get: function() {
return this.name;
}
});
Object.defineProperty(XMLAttribute2.prototype, "specified", {
get: function() {
return true;
}
});
XMLAttribute2.prototype.clone = function() {
return Object.create(this);
};
XMLAttribute2.prototype.toString = function(options) {
return this.options.writer.attribute(this, this.options.writer.filterOptions(options));
};
XMLAttribute2.prototype.debugInfo = function(name) {
name = name || this.name;
if (name == null) {
return "parent: <" + this.parent.name + ">";
} else {
return "attribute: {" + name + "}, parent: <" + this.parent.name + ">";
}
};
XMLAttribute2.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 XMLAttribute2;
}();
}).call(exports);
});
// ../../node_modules/.bun/xmlbuilder@11.0.1/node_modules/xmlbuilder/lib/XMLNamedNodeMap.js
var require_XMLNamedNodeMap = __commonJS((exports, module) => {
(function() {
var XMLNamedNodeMap;
module.exports = XMLNamedNodeMap = function() {
function XMLNamedNodeMap2(nodes) {
this.nodes = nodes;
}
Object.defineProperty(XMLNamedNodeMap2.prototype, "length", {
get: function() {
return Object.keys(this.nodes).length || 0;
}
});
XMLNamedNodeMap2.prototype.clone = function() {
return this.nodes = null;
};
XMLNamedNodeMap2.prototype.getNamedItem = function(name) {
return this.nodes[name];
};
XMLNamedNodeMap2.prototype.setNamedItem = function(node) {
var oldNode;
oldNode = this.nodes[node.nodeName];
this.nodes[node.nodeName] = node;
return oldNode || null;
};
XMLNamedNodeMap2.prototype.removeNamedItem = function(name) {
var oldNode;
oldNode = this.nodes[name];
delete this.nodes[name];
return oldNode || null;
};
XMLNamedNodeMap2.prototype.item = function(index) {
return this.nodes[Object.keys(this.nodes)[index]] || null;
};
XMLNamedNodeMap2.prototype.getNamedItemNS = function(namespaceURI, localName) {
throw new Error("This DOM method is not implemented.");
};
XMLNamedNodeMap2.prototype.setNamedItemNS = function(node) {
throw new Error("This DOM method is not implemented.");
};
XMLNamedNodeMap2.prototype.removeNamedItemNS = function(namespaceURI, localName) {
throw new Error("This DOM method is not implemented.");
};
return XMLNamedNodeMap2;
}();
}).call(exports);
});
// ../../node_modules/.bun/xmlbuilder@11.0.1/node_modules/xmlbuilder/lib/XMLElement.js
var require_XMLElement = __commonJS((exports, module) => {
(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 = require_Utility(), isObject = ref.isObject, isFunction = ref.isFunction, getValue = ref.getValue;
XMLNode = require_XMLNode();
NodeType = require_NodeType();
XMLAttribute = require_XMLAttribute();
XMLNamedNodeMap = require_XMLNamedNodeMap();
module.exports = XMLElement = function(superClass) {
extend(XMLElement2, superClass);
function XMLElement2(parent, name, attributes) {
var child, j, len, ref1;
XMLElement2.__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(XMLElement2.prototype, "tagName", {
get: function() {
return this.name;
}
});
Object.defineProperty(XMLElement2.prototype, "namespaceURI", {
get: function() {
return "";
}
});
Object.defineProperty(XMLElement2.prototype, "prefix", {
get: function() {
return "";
}
});
Object.defineProperty(XMLElement2.prototype, "localName", {
get: function() {
return this.name;
}
});
Object.defineProperty(XMLElement2.prototype, "id", {
get: function() {
throw new Error("This DOM method is not implemented." + this.debugInfo());
}
});
Object.defineProperty(XMLElement2.prototype, "className", {
get: function() {
throw new Error("This DOM method is not implemented." + this.debugInfo());
}
});
Object.defineProperty(XMLElement2.prototype, "classList", {
get: function() {
throw new Error("This DOM method is not implemented." + this.debugInfo());
}
});
Object.defineProperty(XMLElement2.prototype, "attributes", {
get: function() {
if (!this.attributeMap || !this.attributeMap.nodes) {
this.attributeMap = new XMLNamedNodeMap(this.attribs);
}
return this.attributeMap;
}
});
XMLElement2.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;
};
XMLElement2.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;
};
XMLElement2.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;
};
XMLElement2.prototype.toString = function(options) {
return this.options.writer.element(this, this.options.writer.filterOptions(options));
};
XMLElement2.prototype.att = function(name, value) {
return this.attribute(name, value);
};
XMLElement2.prototype.a = function(name, value) {
return this.attribute(name, value);
};
XMLElement2.prototype.getAttribute = function(name) {
if (this.attribs.hasOwnProperty(name)) {
return this.attribs[name].value;
} else {
return null;
}
};
XMLElement2.prototype.setAttribute = function(name, value) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLElement2.prototype.getAttributeNode = function(name) {
if (this.attribs.hasOwnProperty(name)) {
return this.attribs[name];
} else {
return null;
}
};
XMLElement2.prototype.setAttributeNode = function(newAttr) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLElement2.prototype.removeAttributeNode = function(oldAttr) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLElement2.prototype.getElementsByTagName = function(name) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLElement2.prototype.getAttributeNS = function(namespaceURI, localName) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLElement2.prototype.setAttributeNS = function(namespaceURI, qualifiedName, value) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLElement2.prototype.removeAttributeNS = function(namespaceURI, localName) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLElement2.prototype.getAttributeNodeNS = function(namespaceURI, localName) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLElement2.prototype.setAttributeNodeNS = function(newAttr) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLElement2.prototype.getElementsByTagNameNS = function(namespaceURI, localName) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLElement2.prototype.hasAttribute = function(name) {
return this.attribs.hasOwnProperty(name);
};
XMLElement2.prototype.hasAttributeNS = function(namespaceURI, localName) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLElement2.prototype.setIdAttribute = function(name, isId) {
if (this.attribs.hasOwnProperty(name)) {
return this.attribs[name].isId;
} else {
return isId;
}
};
XMLElement2.prototype.setIdAttributeNS = function(namespaceURI, localName, isId) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLElement2.prototype.setIdAttributeNode = function(idAttr, isId) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLElement2.prototype.getElementsByTagName = function(tagname) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLElement2.prototype.getElementsByTagNameNS = function(namespaceURI, localName) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLElement2.prototype.getElementsByClassName = function(classNames) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLElement2.prototype.isEqualNode = function(node) {
var i, j, ref1;
if (!XMLElement2.__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 XMLElement2;
}(XMLNode);
}).call(exports);
});
// ../../node_modules/.bun/xmlbuilder@11.0.1/node_modules/xmlbuilder/lib/XMLCharacterData.js
var require_XMLCharacterData = __commonJS((exports, module) => {
(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 = require_XMLNode();
module.exports = XMLCharacterData = function(superClass) {
extend(XMLCharacterData2, superClass);
function XMLCharacterData2(parent) {
XMLCharacterData2.__super__.constructor.call(this, parent);
this.value = "";
}
Object.defineProperty(XMLCharacterData2.prototype, "data", {
get: function() {
return this.value;
},
set: function(value) {
return this.value = value || "";
}
});
Object.defineProperty(XMLCharacterData2.prototype, "length", {
get: function() {
return this.value.length;
}
});
Object.defineProperty(XMLCharacterData2.prototype, "textContent", {
get: function() {
return this.value;
},
set: function(value) {
return this.value = value || "";
}
});
XMLCharacterData2.prototype.clone = function() {
return Object.create(this);
};
XMLCharacterData2.prototype.substringData = function(offset, count) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLCharacterData2.prototype.appendData = function(arg) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLCharacterData2.prototype.insertData = function(offset, arg) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLCharacterData2.prototype.deleteData = function(offset, count) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLCharacterData2.prototype.replaceData = function(offset, count, arg) {
throw new Error("This DOM method is not implemented." + this.debugInfo());
};
XMLCharacterData2.prototype.isEqualNode = function(node) {
if (!XMLCharacterData2.__super__.isEqualNode.apply(this, arguments).isEqualNode(node)) {
return false;
}
if (node.data !== this.data) {
return false;
}
return true;
};
return XMLCharacterData2;
}(XMLNode);
}).call(exports);
});
// ../../node_modules/.bun/xmlbuilder@11.0.1/node_modules/xmlbuilder/lib/XMLCData.js
var require_XMLCData = __commonJS((exports, module) => {
(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 = require_NodeType();
XMLCharacterData = require_XMLCharacterData();
module.exports = XMLCData = function(superClass) {
extend(XMLCData2, superClass);
function XMLCData2(parent, text) {
XMLCData2.__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);
}
XMLCData2.prototype.clone = function() {
return Object.create(this);
};
XMLCData2.prototype.toString = function(options) {
return this.options.writer.cdata(this, this.options.writer.filterOptions(options));
};
return XMLCData2;
}(XMLCharacterData);
}).call(exports);
});
// ../../node_modules/.bun/xmlbuilder@11.0.1/node_modules/xmlbuilder/lib/XMLComment.js
var require_XMLComment = __commonJS((exports, module) => {
(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 = require_NodeType();
XMLCharacterData = require_XMLCharacterData();
module.exports = XMLComment = function(superClass) {
extend(XMLComment2, superClass);
function XMLComment2(parent, text) {
XMLComment2.__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);
}
XMLComment2.prototype.clone = function() {
return Object.create(this);
};
XMLComment2.prototype.toString = function(options) {
return this.options.writer.comment(this, this.options.writer.filterOptions(options));
};
return XMLComment2;
}(XMLCharacterData);
}).call(exports);
});
// ../../node_modules/.bun/xmlbuilder@11.0.1/node_modules/xmlbuilder/lib/XMLDeclaration.js
var require_XMLDeclaration = __commonJS((exports, module) => {
(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 = require_Utility().isObject;
XMLNode = require_XMLNode();
NodeType = require_NodeType();
module.exports = XMLDeclaration = function(superClass) {
extend(XMLDeclaration2, superClass);
function XMLDeclaration2(parent, version, encoding, standalone) {
var ref;
XMLDeclaration2.__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);
}
}
XMLDeclaration2.prototype.toString = function(options) {
return this.options.writer.declaration(this, this.options.writer.filterOptions(options));
};
return XMLDeclaration2;
}(XMLNode);
}).call(exports);
});
// ../../node_modules/.bun/xmlbuilder@11.0.1/node_modules/xmlbuilder/lib/XMLDTDAttList.js
var require_XMLDTDAttList = __commonJS((exports, module) => {
(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 = require_XMLNode();
NodeType = require_NodeType();
module.exports = XMLDTDAttList = function(superClass) {
extend(XMLDTDAttList2, superClass);
function XMLDTDAttList2(parent, elementName, attributeName, attributeType, defaultValueType, defaultValue) {
XMLDTDAttList2.__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;
}
XMLDTDAttList2.prototype.toString = function(options) {
return this.options.writer.dtdAttList(this, this.options.writer.filterOptions(options));
};
return XMLDTDAttList2;
}(XMLNode);
}).call(exports);
});
// ../../node_modules/.bun/xmlbuilder@11.0.1/node_modules/xmlbuilder/lib/XMLDTDEntity.js
var require_XMLDTDEntity = __commonJS((exports, module) => {
(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 = require_Utility().isObject;
XMLNode = require_XMLNode();
NodeType = require_NodeType();
module.exports = XMLDTDEntity = function(superClass) {
extend(XMLDTDEntity2, superClass);
function XMLDTDEntity2(parent, pe, name, value) {
XMLDTDEntity2.__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(XMLDTDEntity2.prototype, "publicId", {
get: function() {
return this.pubID;
}
});
Object.defineProperty(XMLDTDEntity2.prototype, "systemId", {
get: function() {
return this.sysID;
}
});
Object.defineProperty(XMLDTDEntity2.prototype, "notationName", {
get: function() {
return this.nData || null;
}
});
Object.defineProperty(XMLDTDEntity2.prototype, "inputEncoding", {
get: function() {
return null;
}
});
Object.defineProperty(XMLDTDEntity2.prototype, "xmlEncoding", {
get: function() {
return null;
}
});
Object.defineProperty(XMLDTDEntity2.prototype, "xmlVersion", {
get: function() {
return null;
}
});
XMLDTDEntity2.prototype.toString = function(options) {
return this.options.writer.dtdEntity(this, this.options.writer.filterOptions(options));
};
return XMLDTDEntity2;
}(XMLNode);
}).call(exports);
});
// ../../node_modules/.bun/xmlbuilder@11.0.1/node_modules/xmlbuilder/lib/XMLDTDElement.js
var require_XMLDTDElement = __commonJS((exports, module) => {
(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 = require_XMLNode();
NodeType = require_NodeType();
module.exports = XMLDTDElement = function(superClass) {
extend(XMLDTDElement2, superClass);
function XMLDTDElement2(parent, name, value) {
XMLDTDElement2.__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);
}
XMLDTDElement2.prototype.toString = function(options) {
return this.options.writer.dtdElement(this, this.options.writer.filterOptions(options));
};
return XMLDTDElement2;
}(XMLNode);
}).call(exports);
});
// ../../node_modules/.bun/xmlbuilder@11.0.1/node_modules/xmlbuilder/lib/XMLDTDNotation.js
var require_XMLDTDNotation = __commonJS((exports, module) => {
(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 = require_XMLNode();
NodeType = require_NodeType();
module.exports = XMLDTDNotation = function(superClass) {
extend(XMLDTDNotation2, superClass);
function XMLDTDNotation2(parent, name, value) {
XMLDTDNotation2.__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(XMLDTDNotation2.prototype, "publicId", {
get: function() {
return this.pubID;
}
});
Object.defineProperty(XMLDTDNotation2.prototype, "systemId", {
get: function() {
return this.sysID;
}
});
XMLDTDNotation2.prototype.toString = function(options) {
return this.options.writer.dtdNotation(this, this.options.writer.filterOptions(options));
};
return XMLDTDNotation2;
}(XMLNode);
}).call(exports);
});
// ../../node_modules/.bun/xmlbuilder@11.0.1/node_modules/xmlbuilder/lib/XMLDocType.js
var require_XMLDocType = __commonJS((exports, module) => {
(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 = require_Utility().isObject;
XMLNode = require_XMLNode();
NodeType = require_NodeType();
XMLDTDAttList = require_XMLDTDAttList();
XMLDTDEntity = require_XMLDTDEntity();
XMLDTDElement = require_XMLDTDElement();
XMLDTDNotation = require_XMLDTDNotation();
XMLNamedNodeMap = require_XMLNamedNodeMap();
module.exports = XMLDocType = function(superClass) {
extend(XMLDocType2, superClass);
function XMLDocType2(parent, pubID, sysID) {
var child, i, len, ref, ref1, ref2;
XMLDocType2.__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(XMLDocType2.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(XMLDocType2.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(XMLDocType2.prototype, "publicId", {
get: function() {
return this.pubID;
}
});
Object.defineProperty(XMLDocType2.prototype, "systemId", {
get: function() {
return this.sysID;
}
});
Object.defineProperty(XMLDocType2.prototype, "internalSubset", {
get: function() {
throw new Error("This DOM method is not implemented." + this.debugInfo());
}
});
XMLDocType2.prototype.element = function(name, value) {
var child;
child = new XMLDTDElement(this, name, value);
this.children.push(child);
return this;
};
XMLDocType2.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;
};
XMLDocType2.prototype.entity = function(name, value) {
var child;
child = new XMLDTDEntity(this, false, name, value);
this.children.push(child);
return this;
};
XMLDocType2.prototype.pEntity = function(name, value) {
var child;
child = new XMLDTDEntity(this, true, name, value);
this.children.push(child);
return this;
};
XMLDocType2.prototype.notation = function(name, value) {
var child;
child = new XMLDTDNotation(this, name, value);
this.children.push(child);
return this;
};
XMLDocType2.prototype.toString = function(options) {
return this.options.writer.docType(this, this.options.writer.filterOptions(options));
};
XMLDocType2.prototype.ele = function(name, value) {
return this.element(name, value);
};
XMLDocType2.prototype.att = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) {
return this.attList(elementName, attributeName, attributeType, defaultValueType, defaultValue);
};
XMLDocType2.prototype.ent = function(name, value) {
return this.entity(name, value);
};
XMLDocType2.prototype.pent = function(name, value) {
return this.pEntity(name, value);
};
XMLDocType2.prototype.not = function(name, value) {
return this.notation(name, value);
};
XMLDocType2.prototype.up = function() {
return this.root() || this.documentObject;
};
XMLDocType2.prototype.isEqualNode = function(node) {
if (!XMLDocType2.__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 XMLDocType2;
}(XMLNode);
}).call(exports);
});
// ../../node_modules/.bun/xmlbuilder@11.0.1/node_modules/xmlbuilder/lib/XMLRaw.js
var require_XMLRaw = __commonJS((exports, module) => {
(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 = require_NodeType();
XMLNode = require_XMLNode();
module.exports = XMLRaw = function(superClass) {
extend(XMLRaw2, superClass);
function XMLRaw2(parent, text) {
XMLRaw2.__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);
}
XMLRaw2.prototype.clone = function() {
return Object.create(this);
};
XMLRaw2.prototype.toString = function(options) {
return this.options.writer.raw(this, this.options.writer.filterOptions(options));
};
return XMLRaw2;
}(XMLNode);
}).call(exports);
});
// ../../node_modules/.bun/xmlbuilder@11.0.1/node_modules/xmlbuilder/lib/XMLText.js
var require_XMLText = __commonJS((exports, module) => {
(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 = p