aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaindropsSys <raindrops@equestria.dev>2024-05-12 17:18:54 +0200
committerRaindropsSys <raindrops@equestria.dev>2024-05-12 17:18:54 +0200
commitfcdb5ca193406ef02dba8db4d7684d8c74089552 (patch)
tree223edcc76b54d18575d2c3bcd87ed321f8a896d6
parentd9337f848b94f33aa8641acced33c6c2e5efc26e (diff)
downloadatomic-fcdb5ca193406ef02dba8db4d7684d8c74089552.tar.gz
atomic-fcdb5ca193406ef02dba8db4d7684d8c74089552.tar.bz2
atomic-fcdb5ca193406ef02dba8db4d7684d8c74089552.zip
Updated 9 files and added 103 files (automated)
-rw-r--r--.gitignore10
-rwxr-xr-xconverter/convert_darwin_arm64.sh2
-rwxr-xr-xconverter/convert_darwin_x64.sh2
-rwxr-xr-xconverter/convert_linux_arm64.sh2
-rwxr-xr-xconverter/convert_linux_x64.sh2
-rw-r--r--generator/.idea/.gitignore5
-rw-r--r--generator/.idea/codeStyles/codeStyleConfig.xml5
-rw-r--r--generator/.idea/discord.xml12
-rw-r--r--generator/.idea/generator.iml8
-rw-r--r--generator/.idea/jsLibraryMappings.xml6
-rw-r--r--generator/.idea/modules.xml8
-rw-r--r--generator/.idea/php.xml13
-rw-r--r--generator/.idea/vcs.xml6
-rw-r--r--generator/Atomic-ARM.pkgproj2233
-rw-r--r--generator/Atomic-x64.pkgproj2233
-rw-r--r--generator/index.js89
-rw-r--r--generator/license-en.rtf253
-rw-r--r--generator/license-fr.rtf253
-rw-r--r--generator/node_modules/.package-lock.json55
-rw-r--r--generator/node_modules/@xmldom/xmldom/CHANGELOG.md459
-rw-r--r--generator/node_modules/@xmldom/xmldom/LICENSE8
-rw-r--r--generator/node_modules/@xmldom/xmldom/SECURITY.md50
-rw-r--r--generator/node_modules/@xmldom/xmldom/index.d.ts43
-rw-r--r--generator/node_modules/@xmldom/xmldom/lib/.eslintrc.yml2
-rw-r--r--generator/node_modules/@xmldom/xmldom/lib/conventions.js203
-rw-r--r--generator/node_modules/@xmldom/xmldom/lib/dom-parser.js322
-rw-r--r--generator/node_modules/@xmldom/xmldom/lib/dom.js1840
-rw-r--r--generator/node_modules/@xmldom/xmldom/lib/entities.js2166
-rw-r--r--generator/node_modules/@xmldom/xmldom/lib/index.js4
-rw-r--r--generator/node_modules/@xmldom/xmldom/lib/sax.js662
-rw-r--r--generator/node_modules/@xmldom/xmldom/package.json71
-rw-r--r--generator/node_modules/@xmldom/xmldom/readme.md356
-rw-r--r--generator/node_modules/base64-js/LICENSE21
-rw-r--r--generator/node_modules/base64-js/README.md34
-rw-r--r--generator/node_modules/base64-js/base64js.min.js1
-rw-r--r--generator/node_modules/base64-js/index.d.ts3
-rw-r--r--generator/node_modules/base64-js/index.js150
-rw-r--r--generator/node_modules/base64-js/package.json47
-rw-r--r--generator/node_modules/plist/.github/workflows/ci.yml24
-rw-r--r--generator/node_modules/plist/.jshintrc4
-rw-r--r--generator/node_modules/plist/History.md196
-rw-r--r--generator/node_modules/plist/LICENSE24
-rw-r--r--generator/node_modules/plist/Makefile75
-rw-r--r--generator/node_modules/plist/README.md146
-rw-r--r--generator/node_modules/plist/dist/plist-build.js5348
-rw-r--r--generator/node_modules/plist/dist/plist-parse.js7456
-rw-r--r--generator/node_modules/plist/dist/plist.js9888
-rw-r--r--generator/node_modules/plist/examples/browser/index.html14
-rw-r--r--generator/node_modules/plist/index.js13
-rw-r--r--generator/node_modules/plist/lib/build.js143
-rw-r--r--generator/node_modules/plist/lib/parse.js227
-rw-r--r--generator/node_modules/plist/package.json44
-rw-r--r--generator/node_modules/xmlbuilder/.nycrc6
-rw-r--r--generator/node_modules/xmlbuilder/.vscode/launch.json23
-rw-r--r--generator/node_modules/xmlbuilder/CHANGELOG.md593
-rw-r--r--generator/node_modules/xmlbuilder/LICENSE21
-rw-r--r--generator/node_modules/xmlbuilder/README.md103
-rw-r--r--generator/node_modules/xmlbuilder/lib/Derivation.js10
-rw-r--r--generator/node_modules/xmlbuilder/lib/DocumentPosition.js12
-rw-r--r--generator/node_modules/xmlbuilder/lib/NodeType.js25
-rw-r--r--generator/node_modules/xmlbuilder/lib/OperationType.js11
-rw-r--r--generator/node_modules/xmlbuilder/lib/Utility.js88
-rw-r--r--generator/node_modules/xmlbuilder/lib/WriterState.js10
-rw-r--r--generator/node_modules/xmlbuilder/lib/XMLAttribute.js130
-rw-r--r--generator/node_modules/xmlbuilder/lib/XMLCData.js41
-rw-r--r--generator/node_modules/xmlbuilder/lib/XMLCharacterData.js86
-rw-r--r--generator/node_modules/xmlbuilder/lib/XMLComment.js41
-rw-r--r--generator/node_modules/xmlbuilder/lib/XMLDOMConfiguration.js80
-rw-r--r--generator/node_modules/xmlbuilder/lib/XMLDOMErrorHandler.js20
-rw-r--r--generator/node_modules/xmlbuilder/lib/XMLDOMImplementation.js55
-rw-r--r--generator/node_modules/xmlbuilder/lib/XMLDOMStringList.js44
-rw-r--r--generator/node_modules/xmlbuilder/lib/XMLDTDAttList.js66
-rw-r--r--generator/node_modules/xmlbuilder/lib/XMLDTDElement.js44
-rw-r--r--generator/node_modules/xmlbuilder/lib/XMLDTDEntity.js115
-rw-r--r--generator/node_modules/xmlbuilder/lib/XMLDTDNotation.js66
-rw-r--r--generator/node_modules/xmlbuilder/lib/XMLDeclaration.js51
-rw-r--r--generator/node_modules/xmlbuilder/lib/XMLDocType.js235
-rw-r--r--generator/node_modules/xmlbuilder/lib/XMLDocument.js282
-rw-r--r--generator/node_modules/xmlbuilder/lib/XMLDocumentCB.js650
-rw-r--r--generator/node_modules/xmlbuilder/lib/XMLDocumentFragment.js21
-rw-r--r--generator/node_modules/xmlbuilder/lib/XMLDummy.js39
-rw-r--r--generator/node_modules/xmlbuilder/lib/XMLElement.js334
-rw-r--r--generator/node_modules/xmlbuilder/lib/XMLNamedNodeMap.js77
-rw-r--r--generator/node_modules/xmlbuilder/lib/XMLNode.js999
-rw-r--r--generator/node_modules/xmlbuilder/lib/XMLNodeFilter.js51
-rw-r--r--generator/node_modules/xmlbuilder/lib/XMLNodeList.js45
-rw-r--r--generator/node_modules/xmlbuilder/lib/XMLProcessingInstruction.js56
-rw-r--r--generator/node_modules/xmlbuilder/lib/XMLRaw.js40
-rw-r--r--generator/node_modules/xmlbuilder/lib/XMLStreamWriter.js209
-rw-r--r--generator/node_modules/xmlbuilder/lib/XMLStringWriter.js40
-rw-r--r--generator/node_modules/xmlbuilder/lib/XMLStringifier.js291
-rw-r--r--generator/node_modules/xmlbuilder/lib/XMLText.js82
-rw-r--r--generator/node_modules/xmlbuilder/lib/XMLTypeInfo.js23
-rw-r--r--generator/node_modules/xmlbuilder/lib/XMLUserDataHandler.js27
-rw-r--r--generator/node_modules/xmlbuilder/lib/XMLWriterBase.js485
-rw-r--r--generator/node_modules/xmlbuilder/lib/index.js120
-rw-r--r--generator/node_modules/xmlbuilder/package.json51
-rw-r--r--generator/node_modules/xmlbuilder/perf/basic/escaping.coffee244
-rw-r--r--generator/node_modules/xmlbuilder/perf/basic/object.coffee21
-rw-r--r--generator/node_modules/xmlbuilder/perf/index.coffee161
-rw-r--r--generator/node_modules/xmlbuilder/perf/perf.list11
-rw-r--r--generator/node_modules/xmlbuilder/typings/index.d.ts1771
-rw-r--r--generator/package-lock.json60
-rw-r--r--generator/package.json5
-rw-r--r--generator/post-en.rtf15
-rw-r--r--generator/post-fr.rtf15
-rw-r--r--generator/readme-en.rtf13
-rw-r--r--generator/readme-fr.rtf13
-rw-r--r--launcher/Cargo.lock2
-rw-r--r--launcher/Cargo.toml2
-rwxr-xr-xlauncher/build.sh1
-rw-r--r--launcher/src/constants.rs8
112 files changed, 43466 insertions, 15 deletions
diff --git a/.gitignore b/.gitignore
index 2f1cff0..1c99814 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,6 @@
-work
-launcher/target
-converter/launcher-*
-launcher/release
+/work
+/launcher/target
+/converter/launcher-*
+/launcher/release
+/generator/work
+/generator/build
diff --git a/converter/convert_darwin_arm64.sh b/converter/convert_darwin_arm64.sh
index 2938746..9ff5ef7 100755
--- a/converter/convert_darwin_arm64.sh
+++ b/converter/convert_darwin_arm64.sh
@@ -21,7 +21,7 @@ echo "$0: Executable found at $executable"
echo "$0: Copying launcher"
rm -f "$executable"
-cp "$me/launcher-darwin-arm64" "$executable"
+cp "$me/launcher-darwin-arm64" "$executable" || cp "$me/../Launcher/launcher-darwin-arm64" "$executable"
echo "$0: Removing built-in Electron"
rm -rf "$1/Contents/Frameworks"
diff --git a/converter/convert_darwin_x64.sh b/converter/convert_darwin_x64.sh
index 79ba101..17be753 100755
--- a/converter/convert_darwin_x64.sh
+++ b/converter/convert_darwin_x64.sh
@@ -21,7 +21,7 @@ echo "$0: Executable found at $executable"
echo "$0: Copying launcher"
rm -f "$executable"
-cp "$me/launcher-darwin-x64" "$executable"
+cp "$me/launcher-darwin-x64" "$executable" || cp "$me/../Launcher/launcher-darwin-x64" "$executable"
echo "$0: Removing built-in Electron"
rm -rf "$1/Contents/Frameworks"
diff --git a/converter/convert_linux_arm64.sh b/converter/convert_linux_arm64.sh
index a6476a5..3a336d6 100755
--- a/converter/convert_linux_arm64.sh
+++ b/converter/convert_linux_arm64.sh
@@ -30,7 +30,7 @@ echo "$0: Executable found at $executable"
echo "$0: Copying launcher"
rm -f "$executable"
-cp "$me/launcher-linux-arm64" "$executable"
+cp "$me/launcher-linux-arm64" "$executable" || cp "$me/../Launcher/launcher-linux-arm64" "$executable"
new=$(du -hs "$1" | awk '{print $1;}')
diff --git a/converter/convert_linux_x64.sh b/converter/convert_linux_x64.sh
index 462641c..9908ff1 100755
--- a/converter/convert_linux_x64.sh
+++ b/converter/convert_linux_x64.sh
@@ -30,7 +30,7 @@ echo "$0: Executable found at $executable"
echo "$0: Copying launcher"
rm -f "$executable"
-cp "$me/launcher-linux-x64" "$executable"
+cp "$me/launcher-darwin-x64" "$executable" || cp "$me/../Launcher/launcher-darwin-x64" "$executable"
new=$(du -hs "$1" | awk '{print $1;}')
diff --git a/generator/.idea/.gitignore b/generator/.idea/.gitignore
new file mode 100644
index 0000000..b58b603
--- /dev/null
+++ b/generator/.idea/.gitignore
@@ -0,0 +1,5 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Editor-based HTTP Client requests
+/httpRequests/
diff --git a/generator/.idea/codeStyles/codeStyleConfig.xml b/generator/.idea/codeStyles/codeStyleConfig.xml
new file mode 100644
index 0000000..a55e7a1
--- /dev/null
+++ b/generator/.idea/codeStyles/codeStyleConfig.xml
@@ -0,0 +1,5 @@
+<component name="ProjectCodeStyleConfiguration">
+ <state>
+ <option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
+ </state>
+</component> \ No newline at end of file
diff --git a/generator/.idea/discord.xml b/generator/.idea/discord.xml
new file mode 100644
index 0000000..3aef922
--- /dev/null
+++ b/generator/.idea/discord.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="DiscordProjectSettings">
+ <option name="show" value="PROJECT_FILES" />
+ <option name="description" value="" />
+ <option name="theme" value="material" />
+ <option name="button1Title" value="" />
+ <option name="button1Url" value="" />
+ <option name="button2Title" value="" />
+ <option name="button2Url" value="" />
+ </component>
+</project> \ No newline at end of file
diff --git a/generator/.idea/generator.iml b/generator/.idea/generator.iml
new file mode 100644
index 0000000..c956989
--- /dev/null
+++ b/generator/.idea/generator.iml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="WEB_MODULE" version="4">
+ <component name="NewModuleRootManager">
+ <content url="file://$MODULE_DIR$" />
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ </component>
+</module> \ No newline at end of file
diff --git a/generator/.idea/jsLibraryMappings.xml b/generator/.idea/jsLibraryMappings.xml
new file mode 100644
index 0000000..d23208f
--- /dev/null
+++ b/generator/.idea/jsLibraryMappings.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="JavaScriptLibraryMappings">
+ <includedPredefinedLibrary name="Node.js Core" />
+ </component>
+</project> \ No newline at end of file
diff --git a/generator/.idea/modules.xml b/generator/.idea/modules.xml
new file mode 100644
index 0000000..1a28752
--- /dev/null
+++ b/generator/.idea/modules.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="ProjectModuleManager">
+ <modules>
+ <module fileurl="file://$PROJECT_DIR$/.idea/generator.iml" filepath="$PROJECT_DIR$/.idea/generator.iml" />
+ </modules>
+ </component>
+</project> \ No newline at end of file
diff --git a/generator/.idea/php.xml b/generator/.idea/php.xml
new file mode 100644
index 0000000..88cd1bc
--- /dev/null
+++ b/generator/.idea/php.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="MessDetectorOptionsConfiguration">
+ <option name="transferred" value="true" />
+ </component>
+ <component name="PHPCSFixerOptionsConfiguration">
+ <option name="transferred" value="true" />
+ </component>
+ <component name="PHPCodeSnifferOptionsConfiguration">
+ <option name="highlightLevel" value="WARNING" />
+ <option name="transferred" value="true" />
+ </component>
+</project> \ No newline at end of file
diff --git a/generator/.idea/vcs.xml b/generator/.idea/vcs.xml
new file mode 100644
index 0000000..6c0b863
--- /dev/null
+++ b/generator/.idea/vcs.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="VcsDirectoryMappings">
+ <mapping directory="$PROJECT_DIR$/.." vcs="Git" />
+ </component>
+</project> \ No newline at end of file
diff --git a/generator/Atomic-ARM.pkgproj b/generator/Atomic-ARM.pkgproj
new file mode 100644
index 0000000..67d38c5
--- /dev/null
+++ b/generator/Atomic-ARM.pkgproj
@@ -0,0 +1,2233 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>PACKAGES</key>
+ <array>
+ <dict>
+ <key>MUST-CLOSE-APPLICATION-ITEMS</key>
+ <array/>
+ <key>MUST-CLOSE-APPLICATIONS</key>
+ <false/>
+ <key>PACKAGE_FILES</key>
+ <dict>
+ <key>DEFAULT_INSTALL_LOCATION</key>
+ <string>/</string>
+ <key>HIERARCHY</key>
+ <dict>
+ <key>CHILDREN</key>
+ <array>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>80</integer>
+ <key>PATH</key>
+ <string>Applications</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>509</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>80</integer>
+ <key>PATH</key>
+ <string>Application Support</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Automator</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Documentation</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Extensions</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Filesystems</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>work/root/arm/AtomicRuntime.framework</string>
+ <key>PATH_TYPE</key>
+ <integer>1</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>3</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ </array>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Frameworks</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Input Methods</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Internet Plug-Ins</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Keyboard Layouts</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>LaunchAgents</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>LaunchDaemons</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>PreferencePanes</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Preferences</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>80</integer>
+ <key>PATH</key>
+ <string>Printers</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>PrivilegedHelperTools</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>1005</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>QuickLook</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>QuickTime</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Screen Savers</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Scripts</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Services</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Widgets</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ </array>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Library</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Shared</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>1023</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ </array>
+ <key>GID</key>
+ <integer>80</integer>
+ <key>PATH</key>
+ <string>Users</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ </array>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>/</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <key>PAYLOAD_TYPE</key>
+ <integer>0</integer>
+ <key>PRESERVE_EXTENDED_ATTRIBUTES</key>
+ <false/>
+ <key>SHOW_INVISIBLE</key>
+ <false/>
+ <key>SPLIT_FORKS</key>
+ <true/>
+ <key>TREAT_MISSING_FILES_AS_WARNING</key>
+ <false/>
+ <key>VERSION</key>
+ <integer>5</integer>
+ </dict>
+ <key>PACKAGE_SCRIPTS</key>
+ <dict>
+ <key>POSTINSTALL_PATH</key>
+ <dict>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ </dict>
+ <key>PREINSTALL_PATH</key>
+ <dict>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ </dict>
+ <key>RESOURCES</key>
+ <array/>
+ </dict>
+ <key>PACKAGE_SETTINGS</key>
+ <dict>
+ <key>AUTHENTICATION</key>
+ <integer>1</integer>
+ <key>CONCLUSION_ACTION</key>
+ <integer>0</integer>
+ <key>FOLLOW_SYMBOLIC_LINKS</key>
+ <false/>
+ <key>IDENTIFIER</key>
+ <string>dev.equestria.atomic.Runtime</string>
+ <key>LOCATION</key>
+ <integer>0</integer>
+ <key>NAME</key>
+ <string>Atomic Runtime</string>
+ <key>OVERWRITE_PERMISSIONS</key>
+ <true/>
+ <key>PAYLOAD_SIZE</key>
+ <integer>-1</integer>
+ <key>REFERENCE_PATH</key>
+ <string></string>
+ <key>RELOCATABLE</key>
+ <false/>
+ <key>USE_HFS+_COMPRESSION</key>
+ <false/>
+ <key>VERSION</key>
+ <string>30.0.2</string>
+ </dict>
+ <key>TYPE</key>
+ <integer>0</integer>
+ <key>UUID</key>
+ <string>EB3E97AD-92B8-40C8-8752-15F53F31DD8F</string>
+ </dict>
+ <dict>
+ <key>MUST-CLOSE-APPLICATION-ITEMS</key>
+ <array/>
+ <key>MUST-CLOSE-APPLICATIONS</key>
+ <false/>
+ <key>PACKAGE_FILES</key>
+ <dict>
+ <key>DEFAULT_INSTALL_LOCATION</key>
+ <string>/</string>
+ <key>HIERARCHY</key>
+ <dict>
+ <key>CHILDREN</key>
+ <array>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>80</integer>
+ <key>PATH</key>
+ <string>Applications</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>509</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>80</integer>
+ <key>PATH</key>
+ <string>Application Support</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>work/root/sdk/Atomic</string>
+ <key>PATH_TYPE</key>
+ <integer>1</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>3</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Automator</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Documentation</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Extensions</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Filesystems</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Frameworks</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Input Methods</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Internet Plug-Ins</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Keyboard Layouts</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>LaunchAgents</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>LaunchDaemons</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>PreferencePanes</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Preferences</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>80</integer>
+ <key>PATH</key>
+ <string>Printers</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>PrivilegedHelperTools</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>1005</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>QuickLook</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>QuickTime</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Screen Savers</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Scripts</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Services</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Widgets</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ </array>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Library</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Shared</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>1023</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ </array>
+ <key>GID</key>
+ <integer>80</integer>
+ <key>PATH</key>
+ <string>Users</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ </array>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>/</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <key>PAYLOAD_TYPE</key>
+ <integer>0</integer>
+ <key>PRESERVE_EXTENDED_ATTRIBUTES</key>
+ <false/>
+ <key>SHOW_INVISIBLE</key>
+ <false/>
+ <key>SPLIT_FORKS</key>
+ <true/>
+ <key>TREAT_MISSING_FILES_AS_WARNING</key>
+ <false/>
+ <key>VERSION</key>
+ <integer>5</integer>
+ </dict>
+ <key>PACKAGE_SCRIPTS</key>
+ <dict>
+ <key>POSTINSTALL_PATH</key>
+ <dict>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ </dict>
+ <key>PREINSTALL_PATH</key>
+ <dict>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ </dict>
+ <key>RESOURCES</key>
+ <array/>
+ </dict>
+ <key>PACKAGE_SETTINGS</key>
+ <dict>
+ <key>AUTHENTICATION</key>
+ <integer>1</integer>
+ <key>CONCLUSION_ACTION</key>
+ <integer>0</integer>
+ <key>FOLLOW_SYMBOLIC_LINKS</key>
+ <false/>
+ <key>IDENTIFIER</key>
+ <string>dev.equestria.atomic.SDK</string>
+ <key>LOCATION</key>
+ <integer>0</integer>
+ <key>NAME</key>
+ <string>Atomic Software Development Kit</string>
+ <key>OVERWRITE_PERMISSIONS</key>
+ <true/>
+ <key>PAYLOAD_SIZE</key>
+ <integer>-1</integer>
+ <key>REFERENCE_PATH</key>
+ <string></string>
+ <key>RELOCATABLE</key>
+ <false/>
+ <key>USE_HFS+_COMPRESSION</key>
+ <false/>
+ <key>VERSION</key>
+ <string>1.0.1</string>
+ </dict>
+ <key>TYPE</key>
+ <integer>0</integer>
+ <key>UUID</key>
+ <string>2230EAB0-E446-4157-8EF0-86B7053CD238</string>
+ </dict>
+ <dict>
+ <key>MUST-CLOSE-APPLICATION-ITEMS</key>
+ <array/>
+ <key>MUST-CLOSE-APPLICATIONS</key>
+ <false/>
+ <key>PACKAGE_FILES</key>
+ <dict>
+ <key>DEFAULT_INSTALL_LOCATION</key>
+ <string>/</string>
+ <key>HIERARCHY</key>
+ <dict>
+ <key>CHILDREN</key>
+ <array>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>80</integer>
+ <key>PATH</key>
+ <string>Applications</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>509</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>80</integer>
+ <key>PATH</key>
+ <string>Application Support</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>80</integer>
+ <key>PATH</key>
+ <string>work/root/launcher/Atomic</string>
+ <key>PATH_TYPE</key>
+ <integer>1</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>3</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Automator</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Documentation</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Extensions</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Filesystems</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Frameworks</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Input Methods</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Internet Plug-Ins</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Keyboard Layouts</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>LaunchAgents</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>LaunchDaemons</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>PreferencePanes</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Preferences</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>80</integer>
+ <key>PATH</key>
+ <string>Printers</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>PrivilegedHelperTools</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>1005</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>QuickLook</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>QuickTime</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Screen Savers</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Scripts</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Services</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Widgets</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ </array>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Library</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Shared</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>1023</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ </array>
+ <key>GID</key>
+ <integer>80</integer>
+ <key>PATH</key>
+ <string>Users</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ </array>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>/</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <key>PAYLOAD_TYPE</key>
+ <integer>0</integer>
+ <key>PRESERVE_EXTENDED_ATTRIBUTES</key>
+ <false/>
+ <key>SHOW_INVISIBLE</key>
+ <false/>
+ <key>SPLIT_FORKS</key>
+ <true/>
+ <key>TREAT_MISSING_FILES_AS_WARNING</key>
+ <false/>
+ <key>VERSION</key>
+ <integer>5</integer>
+ </dict>
+ <key>PACKAGE_SCRIPTS</key>
+ <dict>
+ <key>POSTINSTALL_PATH</key>
+ <dict>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ </dict>
+ <key>PREINSTALL_PATH</key>
+ <dict>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ </dict>
+ <key>RESOURCES</key>
+ <array/>
+ </dict>
+ <key>PACKAGE_SETTINGS</key>
+ <dict>
+ <key>AUTHENTICATION</key>
+ <integer>1</integer>
+ <key>CONCLUSION_ACTION</key>
+ <integer>0</integer>
+ <key>FOLLOW_SYMBOLIC_LINKS</key>
+ <false/>
+ <key>IDENTIFIER</key>
+ <string>dev.equestria.atomic.Launcher</string>
+ <key>LOCATION</key>
+ <integer>0</integer>
+ <key>NAME</key>
+ <string>Atomic Standalone Launcher</string>
+ <key>OVERWRITE_PERMISSIONS</key>
+ <true/>
+ <key>PAYLOAD_SIZE</key>
+ <integer>-1</integer>
+ <key>REFERENCE_PATH</key>
+ <string></string>
+ <key>RELOCATABLE</key>
+ <false/>
+ <key>USE_HFS+_COMPRESSION</key>
+ <false/>
+ <key>VERSION</key>
+ <string>1.2.0</string>
+ </dict>
+ <key>TYPE</key>
+ <integer>0</integer>
+ <key>UUID</key>
+ <string>3C776BB3-766E-4B27-B3D1-41D6752EEBE4</string>
+ </dict>
+ </array>
+ <key>PROJECT</key>
+ <dict>
+ <key>PROJECT_COMMENTS</key>
+ <dict>
+ <key>NOTES</key>
+ <data>
+ </data>
+ </dict>
+ <key>PROJECT_PRESENTATION</key>
+ <dict>
+ <key>BACKGROUND</key>
+ <dict>
+ <key>APPAREANCES</key>
+ <dict>
+ <key>DARK_AQUA</key>
+ <dict/>
+ <key>LIGHT_AQUA</key>
+ <dict/>
+ </dict>
+ <key>SHARED_SETTINGS_FOR_ALL_APPAREANCES</key>
+ <true/>
+ </dict>
+ <key>INSTALLATION TYPE</key>
+ <dict>
+ <key>HIERARCHIES</key>
+ <dict>
+ <key>INSTALLER</key>
+ <dict>
+ <key>LIST</key>
+ <array>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>DESCRIPTION</key>
+ <array>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>English</string>
+ <key>VALUE</key>
+ <string>Files required to run Atomic applications on this system. Atomic will not function without these.</string>
+ </dict>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>French</string>
+ <key>VALUE</key>
+ <string>Fichiers requis pour exécuter des applications Atomic sur ce système. Atomic ne fonctionnera pas sans cela.</string>
+ </dict>
+ </array>
+ <key>OPTIONS</key>
+ <dict>
+ <key>HIDDEN</key>
+ <false/>
+ <key>STATE</key>
+ <integer>0</integer>
+ </dict>
+ <key>PACKAGE_UUID</key>
+ <string>EB3E97AD-92B8-40C8-8752-15F53F31DD8F</string>
+ <key>TITLE</key>
+ <array>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>English</string>
+ <key>VALUE</key>
+ <string>Atomic Runtime</string>
+ </dict>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>French</string>
+ <key>VALUE</key>
+ <string>Moteur Atomic</string>
+ </dict>
+ </array>
+ <key>TYPE</key>
+ <integer>0</integer>
+ <key>UUID</key>
+ <string>06169097-7351-44A4-9EFB-3EA608559A81</string>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>DESCRIPTION</key>
+ <array>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>English</string>
+ <key>VALUE</key>
+ <string>Files to develop, build and package Atomic applications, not required for Atomic to function.</string>
+ </dict>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>French</string>
+ <key>VALUE</key>
+ <string>Fichiers pour développer, compiler et empaqueter des applications Atomic, non requis pour le fonctionnement de Atomic.</string>
+ </dict>
+ </array>
+ <key>OPTIONS</key>
+ <dict>
+ <key>HIDDEN</key>
+ <false/>
+ <key>STATE</key>
+ <integer>2</integer>
+ </dict>
+ <key>PACKAGE_UUID</key>
+ <string>2230EAB0-E446-4157-8EF0-86B7053CD238</string>
+ <key>TITLE</key>
+ <array>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>English</string>
+ <key>VALUE</key>
+ <string>Atomic Software Development Kit (SDK)</string>
+ </dict>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>French</string>
+ <key>VALUE</key>
+ <string>Kit de développement (SDK) Atomic</string>
+ </dict>
+ </array>
+ <key>TYPE</key>
+ <integer>0</integer>
+ <key>UUID</key>
+ <string>191BBE52-4E6C-474A-AA2E-3AC6ED807261</string>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>DESCRIPTION</key>
+ <array>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>English</string>
+ <key>VALUE</key>
+ <string>Separate files for the Atomic launcher. Required to build Atomic applications alongside the Software Development Kit.</string>
+ </dict>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>French</string>
+ <key>VALUE</key>
+ <string>Fichiers séparés pour le lanceur Atomic. Requis pour construire des applications Atomic avec le Kit de développement logiciel</string>
+ </dict>
+ </array>
+ <key>OPTIONS</key>
+ <dict>
+ <key>HIDDEN</key>
+ <false/>
+ <key>STATE</key>
+ <integer>2</integer>
+ </dict>
+ <key>PACKAGE_UUID</key>
+ <string>3C776BB3-766E-4B27-B3D1-41D6752EEBE4</string>
+ <key>TITLE</key>
+ <array>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>English</string>
+ <key>VALUE</key>
+ <string>Atomic Standalone Launcher</string>
+ </dict>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>French</string>
+ <key>VALUE</key>
+ <string>Lanceur séparé Atomic</string>
+ </dict>
+ </array>
+ <key>TYPE</key>
+ <integer>0</integer>
+ <key>UUID</key>
+ <string>5B31330E-32F3-4C8A-BC9A-566E86E5FCEE</string>
+ </dict>
+ </array>
+ <key>REMOVED</key>
+ <dict/>
+ </dict>
+ </dict>
+ <key>MODE</key>
+ <integer>2</integer>
+ </dict>
+ <key>INSTALLATION_STEPS</key>
+ <array>
+ <dict>
+ <key>ICPRESENTATION_CHAPTER_VIEW_CONTROLLER_CLASS</key>
+ <string>ICPresentationViewIntroductionController</string>
+ <key>INSTALLER_PLUGIN</key>
+ <string>Introduction</string>
+ <key>LIST_TITLE_KEY</key>
+ <string>InstallerSectionTitle</string>
+ </dict>
+ <dict>
+ <key>ICPRESENTATION_CHAPTER_VIEW_CONTROLLER_CLASS</key>
+ <string>ICPresentationViewReadMeController</string>
+ <key>INSTALLER_PLUGIN</key>
+ <string>ReadMe</string>
+ <key>LIST_TITLE_KEY</key>
+ <string>InstallerSectionTitle</string>
+ </dict>
+ <dict>
+ <key>ICPRESENTATION_CHAPTER_VIEW_CONTROLLER_CLASS</key>
+ <string>ICPresentationViewLicenseController</string>
+ <key>INSTALLER_PLUGIN</key>
+ <string>License</string>
+ <key>LIST_TITLE_KEY</key>
+ <string>InstallerSectionTitle</string>
+ </dict>
+ <dict>
+ <key>ICPRESENTATION_CHAPTER_VIEW_CONTROLLER_CLASS</key>
+ <string>ICPresentationViewDestinationSelectController</string>
+ <key>INSTALLER_PLUGIN</key>
+ <string>TargetSelect</string>
+ <key>LIST_TITLE_KEY</key>
+ <string>InstallerSectionTitle</string>
+ </dict>
+ <dict>
+ <key>ICPRESENTATION_CHAPTER_VIEW_CONTROLLER_CLASS</key>
+ <string>ICPresentationViewInstallationTypeController</string>
+ <key>INSTALLER_PLUGIN</key>
+ <string>PackageSelection</string>
+ <key>LIST_TITLE_KEY</key>
+ <string>InstallerSectionTitle</string>
+ </dict>
+ <dict>
+ <key>ICPRESENTATION_CHAPTER_VIEW_CONTROLLER_CLASS</key>
+ <string>ICPresentationViewInstallationController</string>
+ <key>INSTALLER_PLUGIN</key>
+ <string>Install</string>
+ <key>LIST_TITLE_KEY</key>
+ <string>InstallerSectionTitle</string>
+ </dict>
+ <dict>
+ <key>ICPRESENTATION_CHAPTER_VIEW_CONTROLLER_CLASS</key>
+ <string>ICPresentationViewSummaryController</string>
+ <key>INSTALLER_PLUGIN</key>
+ <string>Summary</string>
+ <key>LIST_TITLE_KEY</key>
+ <string>InstallerSectionTitle</string>
+ </dict>
+ </array>
+ <key>INTRODUCTION</key>
+ <dict>
+ <key>LOCALIZATIONS</key>
+ <array>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>English</string>
+ <key>VALUE</key>
+ <dict>
+ <key>PATH</key>
+ <string>readme-en.rtf</string>
+ <key>PATH_TYPE</key>
+ <integer>1</integer>
+ </dict>
+ </dict>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>French</string>
+ <key>VALUE</key>
+ <dict>
+ <key>PATH</key>
+ <string>readme-fr.rtf</string>
+ <key>PATH_TYPE</key>
+ <integer>1</integer>
+ </dict>
+ </dict>
+ </array>
+ </dict>
+ <key>LICENSE</key>
+ <dict>
+ <key>LOCALIZATIONS</key>
+ <array>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>English</string>
+ <key>VALUE</key>
+ <dict>
+ <key>PATH</key>
+ <string>license-en.rtf</string>
+ <key>PATH_TYPE</key>
+ <integer>1</integer>
+ </dict>
+ </dict>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>French</string>
+ <key>VALUE</key>
+ <dict>
+ <key>PATH</key>
+ <string>license-fr.rtf</string>
+ <key>PATH_TYPE</key>
+ <integer>1</integer>
+ </dict>
+ </dict>
+ </array>
+ <key>MODE</key>
+ <integer>0</integer>
+ </dict>
+ <key>README</key>
+ <dict>
+ <key>LOCALIZATIONS</key>
+ <array/>
+ </dict>
+ <key>SUMMARY</key>
+ <dict>
+ <key>LOCALIZATIONS</key>
+ <array>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>English</string>
+ <key>VALUE</key>
+ <dict>
+ <key>PATH</key>
+ <string>post-en.rtf</string>
+ <key>PATH_TYPE</key>
+ <integer>1</integer>
+ </dict>
+ </dict>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>French</string>
+ <key>VALUE</key>
+ <dict>
+ <key>PATH</key>
+ <string>post-fr.rtf</string>
+ <key>PATH_TYPE</key>
+ <integer>1</integer>
+ </dict>
+ </dict>
+ </array>
+ </dict>
+ <key>TITLE</key>
+ <dict>
+ <key>LOCALIZATIONS</key>
+ <array>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>English</string>
+ <key>VALUE</key>
+ <string>Atomic Platform for Apple silicon</string>
+ </dict>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>French</string>
+ <key>VALUE</key>
+ <string>Plateforme Atomic pour puces Apple</string>
+ </dict>
+ </array>
+ </dict>
+ </dict>
+ <key>PROJECT_REQUIREMENTS</key>
+ <dict>
+ <key>LIST</key>
+ <array>
+ <dict>
+ <key>BEHAVIOR</key>
+ <integer>3</integer>
+ <key>DICTIONARY</key>
+ <dict>
+ <key>IC_REQUIREMENT_OS_DISK_TYPE</key>
+ <integer>1</integer>
+ <key>IC_REQUIREMENT_OS_DISTRIBUTION_TYPE</key>
+ <integer>1</integer>
+ <key>IC_REQUIREMENT_OS_MINIMUM_VERSION</key>
+ <integer>110000</integer>
+ </dict>
+ <key>IC_REQUIREMENT_CHECK_TYPE</key>
+ <integer>0</integer>
+ <key>IDENTIFIER</key>
+ <string>fr.whitebox.Packages.requirement.os</string>
+ <key>MESSAGE</key>
+ <array>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>English</string>
+ <key>SECONDARY_VALUE</key>
+ <string>Atomic for Apple silicon requires at least macOS 11 Big Sur.</string>
+ <key>VALUE</key>
+ <string>Invalid macOS version</string>
+ </dict>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>French</string>
+ <key>SECONDARY_VALUE</key>
+ <string>Atomic pour Apple silicon nécessite au moins macOS 11 Big Sur.</string>
+ <key>VALUE</key>
+ <string>Version de macOS invalide</string>
+ </dict>
+ </array>
+ <key>NAME</key>
+ <string>Operating System</string>
+ <key>STATE</key>
+ <true/>
+ </dict>
+ <dict>
+ <key>BEHAVIOR</key>
+ <integer>3</integer>
+ <key>DICTIONARY</key>
+ <dict>
+ <key>IC_REQUIREMENT_CPU_ARCHITECTURE_FAMILY</key>
+ <integer>3</integer>
+ <key>IC_REQUIREMENT_CPU_INTEL_ARCHITECTURE_TYPE</key>
+ <integer>0</integer>
+ <key>IC_REQUIREMENT_CPU_MINIMUM_CPU_CORES_COUNT</key>
+ <integer>1</integer>
+ <key>IC_REQUIREMENT_CPU_MINIMUM_FREQUENCY</key>
+ <integer>866666</integer>
+ <key>IC_REQUIREMENT_CPU_POWERPC_ARCHITECTURE_TYPE</key>
+ <integer>0</integer>
+ </dict>
+ <key>IC_REQUIREMENT_CHECK_TYPE</key>
+ <integer>0</integer>
+ <key>IDENTIFIER</key>
+ <string>fr.whitebox.Packages.requirement.cpu</string>
+ <key>MESSAGE</key>
+ <array>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>English</string>
+ <key>SECONDARY_VALUE</key>
+ <string>Atomic for Apple silicon requires an Apple M1 chip or later.</string>
+ <key>VALUE</key>
+ <string>Invalid processor</string>
+ </dict>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>French</string>
+ <key>SECONDARY_VALUE</key>
+ <string>Atomic pour Apple silicon nécessite une puce Apple M1 ou suivant.</string>
+ <key>VALUE</key>
+ <string>Processeur invalide</string>
+ </dict>
+ </array>
+ <key>NAME</key>
+ <string>Processor</string>
+ <key>STATE</key>
+ <true/>
+ </dict>
+ <dict>
+ <key>BEHAVIOR</key>
+ <integer>3</integer>
+ <key>DICTIONARY</key>
+ <dict>
+ <key>IC_REQUIREMENT_RAM_MINIMUM_SIZE_INDEX</key>
+ <integer>5</integer>
+ </dict>
+ <key>IC_REQUIREMENT_CHECK_TYPE</key>
+ <integer>0</integer>
+ <key>IDENTIFIER</key>
+ <string>fr.whitebox.Packages.requirement.ram</string>
+ <key>MESSAGE</key>
+ <array>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>English</string>
+ <key>SECONDARY_VALUE</key>
+ <string>Atomic requires at least 4 GB of system memory to function properly.</string>
+ <key>VALUE</key>
+ <string>Insufficient system memory</string>
+ </dict>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>French</string>
+ <key>SECONDARY_VALUE</key>
+ <string>Atomic nécessite au moins 4 Go de mémoire système pour fonctionner correctement.</string>
+ <key>VALUE</key>
+ <string>Mémoire système insuffisante</string>
+ </dict>
+ </array>
+ <key>NAME</key>
+ <string>Installed RAM</string>
+ <key>STATE</key>
+ <true/>
+ </dict>
+ <dict>
+ <key>BEHAVIOR</key>
+ <integer>3</integer>
+ <key>DICTIONARY</key>
+ <dict>
+ <key>IC_REQUIREMENT_DISKSPACE_MINIMUM_SIZE_UNIT</key>
+ <integer>1</integer>
+ <key>IC_REQUIREMENT_DISKSPACE_MINIMUM_SIZE_VALUE</key>
+ <integer>1</integer>
+ </dict>
+ <key>IC_REQUIREMENT_CHECK_TYPE</key>
+ <integer>1</integer>
+ <key>IDENTIFIER</key>
+ <string>fr.whitebox.Packages.requirement.diskspace</string>
+ <key>MESSAGE</key>
+ <array>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>English</string>
+ <key>VALUE</key>
+ <string>Atomic requires at least 1 GB of free disk space.</string>
+ </dict>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>French</string>
+ <key>VALUE</key>
+ <string>Atomic nécessite au moins 1 Go d'espace disque libre.</string>
+ </dict>
+ </array>
+ <key>NAME</key>
+ <string>Available Disk Space</string>
+ <key>STATE</key>
+ <true/>
+ </dict>
+ </array>
+ <key>RESOURCES</key>
+ <array/>
+ <key>ROOT_VOLUME_ONLY</key>
+ <true/>
+ </dict>
+ <key>PROJECT_SETTINGS</key>
+ <dict>
+ <key>BUILD_FORMAT</key>
+ <integer>0</integer>
+ <key>BUILD_PATH</key>
+ <dict>
+ <key>PATH</key>
+ <string>build/ARM</string>
+ <key>PATH_TYPE</key>
+ <integer>1</integer>
+ </dict>
+ <key>EXCLUDED_FILES</key>
+ <array>
+ <dict>
+ <key>PATTERNS_ARRAY</key>
+ <array>
+ <dict>
+ <key>REGULAR_EXPRESSION</key>
+ <false/>
+ <key>STRING</key>
+ <string>.DS_Store</string>
+ <key>TYPE</key>
+ <integer>0</integer>
+ </dict>
+ </array>
+ <key>PROTECTED</key>
+ <true/>
+ <key>PROXY_NAME</key>
+ <string>Remove .DS_Store files</string>
+ <key>PROXY_TOOLTIP</key>
+ <string>Remove ".DS_Store" files created by the Finder.</string>
+ <key>STATE</key>
+ <true/>
+ </dict>
+ <dict>
+ <key>PATTERNS_ARRAY</key>
+ <array>
+ <dict>
+ <key>REGULAR_EXPRESSION</key>
+ <false/>
+ <key>STRING</key>
+ <string>.pbdevelopment</string>
+ <key>TYPE</key>
+ <integer>0</integer>
+ </dict>
+ </array>
+ <key>PROTECTED</key>
+ <true/>
+ <key>PROXY_NAME</key>
+ <string>Remove .pbdevelopment files</string>
+ <key>PROXY_TOOLTIP</key>
+ <string>Remove ".pbdevelopment" files created by ProjectBuilder or Xcode.</string>
+ <key>STATE</key>
+ <true/>
+ </dict>
+ <dict>
+ <key>PATTERNS_ARRAY</key>
+ <array>
+ <dict>
+ <key>REGULAR_EXPRESSION</key>
+ <false/>
+ <key>STRING</key>
+ <string>CVS</string>
+ <key>TYPE</key>
+ <integer>1</integer>
+ </dict>
+ <dict>
+ <key>REGULAR_EXPRESSION</key>
+ <false/>
+ <key>STRING</key>
+ <string>.cvsignore</string>
+ <key>TYPE</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>REGULAR_EXPRESSION</key>
+ <false/>
+ <key>STRING</key>
+ <string>.cvspass</string>
+ <key>TYPE</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>REGULAR_EXPRESSION</key>
+ <false/>
+ <key>STRING</key>
+ <string>.svn</string>
+ <key>TYPE</key>
+ <integer>1</integer>
+ </dict>
+ <dict>
+ <key>REGULAR_EXPRESSION</key>
+ <false/>
+ <key>STRING</key>
+ <string>.git</string>
+ <key>TYPE</key>
+ <integer>1</integer>
+ </dict>
+ <dict>
+ <key>REGULAR_EXPRESSION</key>
+ <false/>
+ <key>STRING</key>
+ <string>.gitignore</string>
+ <key>TYPE</key>
+ <integer>0</integer>
+ </dict>
+ </array>
+ <key>PROTECTED</key>
+ <true/>
+ <key>PROXY_NAME</key>
+ <string>Remove SCM metadata</string>
+ <key>PROXY_TOOLTIP</key>
+ <string>Remove helper files and folders used by the CVS, SVN or Git Source Code Management systems.</string>
+ <key>STATE</key>
+ <true/>
+ </dict>
+ <dict>
+ <key>PATTERNS_ARRAY</key>
+ <array>
+ <dict>
+ <key>REGULAR_EXPRESSION</key>
+ <false/>
+ <key>STRING</key>
+ <string>classes.nib</string>
+ <key>TYPE</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>REGULAR_EXPRESSION</key>
+ <false/>
+ <key>STRING</key>
+ <string>designable.db</string>
+ <key>TYPE</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>REGULAR_EXPRESSION</key>
+ <false/>
+ <key>STRING</key>
+ <string>info.nib</string>
+ <key>TYPE</key>
+ <integer>0</integer>
+ </dict>
+ </array>
+ <key>PROTECTED</key>
+ <true/>
+ <key>PROXY_NAME</key>
+ <string>Optimize nib files</string>
+ <key>PROXY_TOOLTIP</key>
+ <string>Remove "classes.nib", "info.nib" and "designable.nib" files within .nib bundles.</string>
+ <key>STATE</key>
+ <true/>
+ </dict>
+ <dict>
+ <key>PATTERNS_ARRAY</key>
+ <array>
+ <dict>
+ <key>REGULAR_EXPRESSION</key>
+ <false/>
+ <key>STRING</key>
+ <string>Resources Disabled</string>
+ <key>TYPE</key>
+ <integer>1</integer>
+ </dict>
+ </array>
+ <key>PROTECTED</key>
+ <true/>
+ <key>PROXY_NAME</key>
+ <string>Remove Resources Disabled folders</string>
+ <key>PROXY_TOOLTIP</key>
+ <string>Remove "Resources Disabled" folders.</string>
+ <key>STATE</key>
+ <true/>
+ </dict>
+ <dict>
+ <key>SEPARATOR</key>
+ <true/>
+ </dict>
+ </array>
+ <key>NAME</key>
+ <string>Atomic</string>
+ <key>PAYLOAD_ONLY</key>
+ <false/>
+ <key>TREAT_MISSING_PRESENTATION_DOCUMENTS_AS_WARNING</key>
+ <false/>
+ </dict>
+ </dict>
+ <key>SHARED_GLOBAL_DATA</key>
+ <dict>
+ <key>IC_REQUIREMENT_JAVASCRIPT_SHARED_SOURCE_CODE</key>
+ <string></string>
+ </dict>
+ <key>TYPE</key>
+ <integer>0</integer>
+ <key>VERSION</key>
+ <integer>2</integer>
+</dict>
+</plist>
diff --git a/generator/Atomic-x64.pkgproj b/generator/Atomic-x64.pkgproj
new file mode 100644
index 0000000..5c47f21
--- /dev/null
+++ b/generator/Atomic-x64.pkgproj
@@ -0,0 +1,2233 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>PACKAGES</key>
+ <array>
+ <dict>
+ <key>MUST-CLOSE-APPLICATION-ITEMS</key>
+ <array/>
+ <key>MUST-CLOSE-APPLICATIONS</key>
+ <false/>
+ <key>PACKAGE_FILES</key>
+ <dict>
+ <key>DEFAULT_INSTALL_LOCATION</key>
+ <string>/</string>
+ <key>HIERARCHY</key>
+ <dict>
+ <key>CHILDREN</key>
+ <array>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>80</integer>
+ <key>PATH</key>
+ <string>Applications</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>509</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>80</integer>
+ <key>PATH</key>
+ <string>Application Support</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Automator</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Documentation</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Extensions</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Filesystems</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>work/root/x64/AtomicRuntime.framework</string>
+ <key>PATH_TYPE</key>
+ <integer>1</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>3</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ </array>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Frameworks</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Input Methods</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Internet Plug-Ins</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Keyboard Layouts</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>LaunchAgents</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>LaunchDaemons</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>PreferencePanes</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Preferences</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>80</integer>
+ <key>PATH</key>
+ <string>Printers</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>PrivilegedHelperTools</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>1005</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>QuickLook</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>QuickTime</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Screen Savers</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Scripts</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Services</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Widgets</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ </array>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Library</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Shared</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>1023</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ </array>
+ <key>GID</key>
+ <integer>80</integer>
+ <key>PATH</key>
+ <string>Users</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ </array>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>/</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <key>PAYLOAD_TYPE</key>
+ <integer>0</integer>
+ <key>PRESERVE_EXTENDED_ATTRIBUTES</key>
+ <false/>
+ <key>SHOW_INVISIBLE</key>
+ <false/>
+ <key>SPLIT_FORKS</key>
+ <true/>
+ <key>TREAT_MISSING_FILES_AS_WARNING</key>
+ <false/>
+ <key>VERSION</key>
+ <integer>5</integer>
+ </dict>
+ <key>PACKAGE_SCRIPTS</key>
+ <dict>
+ <key>POSTINSTALL_PATH</key>
+ <dict>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ </dict>
+ <key>PREINSTALL_PATH</key>
+ <dict>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ </dict>
+ <key>RESOURCES</key>
+ <array/>
+ </dict>
+ <key>PACKAGE_SETTINGS</key>
+ <dict>
+ <key>AUTHENTICATION</key>
+ <integer>1</integer>
+ <key>CONCLUSION_ACTION</key>
+ <integer>0</integer>
+ <key>FOLLOW_SYMBOLIC_LINKS</key>
+ <false/>
+ <key>IDENTIFIER</key>
+ <string>dev.equestria.atomic.Runtime</string>
+ <key>LOCATION</key>
+ <integer>0</integer>
+ <key>NAME</key>
+ <string>Atomic Runtime</string>
+ <key>OVERWRITE_PERMISSIONS</key>
+ <true/>
+ <key>PAYLOAD_SIZE</key>
+ <integer>-1</integer>
+ <key>REFERENCE_PATH</key>
+ <string></string>
+ <key>RELOCATABLE</key>
+ <false/>
+ <key>USE_HFS+_COMPRESSION</key>
+ <false/>
+ <key>VERSION</key>
+ <string>30.0.2</string>
+ </dict>
+ <key>TYPE</key>
+ <integer>0</integer>
+ <key>UUID</key>
+ <string>EB3E97AD-92B8-40C8-8752-15F53F31DD8F</string>
+ </dict>
+ <dict>
+ <key>MUST-CLOSE-APPLICATION-ITEMS</key>
+ <array/>
+ <key>MUST-CLOSE-APPLICATIONS</key>
+ <false/>
+ <key>PACKAGE_FILES</key>
+ <dict>
+ <key>DEFAULT_INSTALL_LOCATION</key>
+ <string>/</string>
+ <key>HIERARCHY</key>
+ <dict>
+ <key>CHILDREN</key>
+ <array>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>80</integer>
+ <key>PATH</key>
+ <string>Applications</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>509</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>80</integer>
+ <key>PATH</key>
+ <string>Application Support</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>work/root/sdk/Atomic</string>
+ <key>PATH_TYPE</key>
+ <integer>1</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>3</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Automator</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Documentation</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Extensions</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Filesystems</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Frameworks</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Input Methods</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Internet Plug-Ins</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Keyboard Layouts</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>LaunchAgents</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>LaunchDaemons</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>PreferencePanes</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Preferences</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>80</integer>
+ <key>PATH</key>
+ <string>Printers</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>PrivilegedHelperTools</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>1005</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>QuickLook</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>QuickTime</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Screen Savers</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Scripts</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Services</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Widgets</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ </array>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Library</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Shared</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>1023</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ </array>
+ <key>GID</key>
+ <integer>80</integer>
+ <key>PATH</key>
+ <string>Users</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ </array>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>/</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <key>PAYLOAD_TYPE</key>
+ <integer>0</integer>
+ <key>PRESERVE_EXTENDED_ATTRIBUTES</key>
+ <false/>
+ <key>SHOW_INVISIBLE</key>
+ <false/>
+ <key>SPLIT_FORKS</key>
+ <true/>
+ <key>TREAT_MISSING_FILES_AS_WARNING</key>
+ <false/>
+ <key>VERSION</key>
+ <integer>5</integer>
+ </dict>
+ <key>PACKAGE_SCRIPTS</key>
+ <dict>
+ <key>POSTINSTALL_PATH</key>
+ <dict>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ </dict>
+ <key>PREINSTALL_PATH</key>
+ <dict>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ </dict>
+ <key>RESOURCES</key>
+ <array/>
+ </dict>
+ <key>PACKAGE_SETTINGS</key>
+ <dict>
+ <key>AUTHENTICATION</key>
+ <integer>1</integer>
+ <key>CONCLUSION_ACTION</key>
+ <integer>0</integer>
+ <key>FOLLOW_SYMBOLIC_LINKS</key>
+ <false/>
+ <key>IDENTIFIER</key>
+ <string>dev.equestria.atomic.SDK</string>
+ <key>LOCATION</key>
+ <integer>0</integer>
+ <key>NAME</key>
+ <string>Atomic Software Development Kit</string>
+ <key>OVERWRITE_PERMISSIONS</key>
+ <true/>
+ <key>PAYLOAD_SIZE</key>
+ <integer>-1</integer>
+ <key>REFERENCE_PATH</key>
+ <string></string>
+ <key>RELOCATABLE</key>
+ <false/>
+ <key>USE_HFS+_COMPRESSION</key>
+ <false/>
+ <key>VERSION</key>
+ <string>1.0.1</string>
+ </dict>
+ <key>TYPE</key>
+ <integer>0</integer>
+ <key>UUID</key>
+ <string>2230EAB0-E446-4157-8EF0-86B7053CD238</string>
+ </dict>
+ <dict>
+ <key>MUST-CLOSE-APPLICATION-ITEMS</key>
+ <array/>
+ <key>MUST-CLOSE-APPLICATIONS</key>
+ <false/>
+ <key>PACKAGE_FILES</key>
+ <dict>
+ <key>DEFAULT_INSTALL_LOCATION</key>
+ <string>/</string>
+ <key>HIERARCHY</key>
+ <dict>
+ <key>CHILDREN</key>
+ <array>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>80</integer>
+ <key>PATH</key>
+ <string>Applications</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>509</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>80</integer>
+ <key>PATH</key>
+ <string>Application Support</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>80</integer>
+ <key>PATH</key>
+ <string>work/root/launcher/Atomic</string>
+ <key>PATH_TYPE</key>
+ <integer>1</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>3</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Automator</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Documentation</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Extensions</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Filesystems</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Frameworks</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Input Methods</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Internet Plug-Ins</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Keyboard Layouts</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>LaunchAgents</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>LaunchDaemons</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>PreferencePanes</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Preferences</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>80</integer>
+ <key>PATH</key>
+ <string>Printers</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>PrivilegedHelperTools</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>1005</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>QuickLook</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>QuickTime</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Screen Savers</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Scripts</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Services</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Widgets</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ </array>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Library</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>Shared</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>1023</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ </array>
+ <key>GID</key>
+ <integer>80</integer>
+ <key>PATH</key>
+ <string>Users</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ </array>
+ <key>GID</key>
+ <integer>0</integer>
+ <key>PATH</key>
+ <string>/</string>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ <key>PERMISSIONS</key>
+ <integer>493</integer>
+ <key>TYPE</key>
+ <integer>1</integer>
+ <key>UID</key>
+ <integer>0</integer>
+ </dict>
+ <key>PAYLOAD_TYPE</key>
+ <integer>0</integer>
+ <key>PRESERVE_EXTENDED_ATTRIBUTES</key>
+ <false/>
+ <key>SHOW_INVISIBLE</key>
+ <false/>
+ <key>SPLIT_FORKS</key>
+ <true/>
+ <key>TREAT_MISSING_FILES_AS_WARNING</key>
+ <false/>
+ <key>VERSION</key>
+ <integer>5</integer>
+ </dict>
+ <key>PACKAGE_SCRIPTS</key>
+ <dict>
+ <key>POSTINSTALL_PATH</key>
+ <dict>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ </dict>
+ <key>PREINSTALL_PATH</key>
+ <dict>
+ <key>PATH_TYPE</key>
+ <integer>0</integer>
+ </dict>
+ <key>RESOURCES</key>
+ <array/>
+ </dict>
+ <key>PACKAGE_SETTINGS</key>
+ <dict>
+ <key>AUTHENTICATION</key>
+ <integer>1</integer>
+ <key>CONCLUSION_ACTION</key>
+ <integer>0</integer>
+ <key>FOLLOW_SYMBOLIC_LINKS</key>
+ <false/>
+ <key>IDENTIFIER</key>
+ <string>dev.equestria.atomic.Launcher</string>
+ <key>LOCATION</key>
+ <integer>0</integer>
+ <key>NAME</key>
+ <string>Atomic Standalone Launcher</string>
+ <key>OVERWRITE_PERMISSIONS</key>
+ <true/>
+ <key>PAYLOAD_SIZE</key>
+ <integer>-1</integer>
+ <key>REFERENCE_PATH</key>
+ <string></string>
+ <key>RELOCATABLE</key>
+ <false/>
+ <key>USE_HFS+_COMPRESSION</key>
+ <false/>
+ <key>VERSION</key>
+ <string>1.2.0</string>
+ </dict>
+ <key>TYPE</key>
+ <integer>0</integer>
+ <key>UUID</key>
+ <string>3C776BB3-766E-4B27-B3D1-41D6752EEBE4</string>
+ </dict>
+ </array>
+ <key>PROJECT</key>
+ <dict>
+ <key>PROJECT_COMMENTS</key>
+ <dict>
+ <key>NOTES</key>
+ <data>
+ </data>
+ </dict>
+ <key>PROJECT_PRESENTATION</key>
+ <dict>
+ <key>BACKGROUND</key>
+ <dict>
+ <key>APPAREANCES</key>
+ <dict>
+ <key>DARK_AQUA</key>
+ <dict/>
+ <key>LIGHT_AQUA</key>
+ <dict/>
+ </dict>
+ <key>SHARED_SETTINGS_FOR_ALL_APPAREANCES</key>
+ <true/>
+ </dict>
+ <key>INSTALLATION TYPE</key>
+ <dict>
+ <key>HIERARCHIES</key>
+ <dict>
+ <key>INSTALLER</key>
+ <dict>
+ <key>LIST</key>
+ <array>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>DESCRIPTION</key>
+ <array>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>English</string>
+ <key>VALUE</key>
+ <string>Files required to run Atomic applications on this system. Atomic will not function without these.</string>
+ </dict>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>French</string>
+ <key>VALUE</key>
+ <string>Fichiers requis pour exécuter des applications Atomic sur ce système. Atomic ne fonctionnera pas sans cela.</string>
+ </dict>
+ </array>
+ <key>OPTIONS</key>
+ <dict>
+ <key>HIDDEN</key>
+ <false/>
+ <key>STATE</key>
+ <integer>0</integer>
+ </dict>
+ <key>PACKAGE_UUID</key>
+ <string>EB3E97AD-92B8-40C8-8752-15F53F31DD8F</string>
+ <key>TITLE</key>
+ <array>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>English</string>
+ <key>VALUE</key>
+ <string>Atomic Runtime</string>
+ </dict>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>French</string>
+ <key>VALUE</key>
+ <string>Moteur Atomic</string>
+ </dict>
+ </array>
+ <key>TYPE</key>
+ <integer>0</integer>
+ <key>UUID</key>
+ <string>06169097-7351-44A4-9EFB-3EA608559A81</string>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>DESCRIPTION</key>
+ <array>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>English</string>
+ <key>VALUE</key>
+ <string>Files to develop, build and package Atomic applications, not required for Atomic to function.</string>
+ </dict>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>French</string>
+ <key>VALUE</key>
+ <string>Fichiers pour développer, compiler et empaqueter des applications Atomic, non requis pour le fonctionnement de Atomic.</string>
+ </dict>
+ </array>
+ <key>OPTIONS</key>
+ <dict>
+ <key>HIDDEN</key>
+ <false/>
+ <key>STATE</key>
+ <integer>2</integer>
+ </dict>
+ <key>PACKAGE_UUID</key>
+ <string>2230EAB0-E446-4157-8EF0-86B7053CD238</string>
+ <key>TITLE</key>
+ <array>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>English</string>
+ <key>VALUE</key>
+ <string>Atomic Software Development Kit (SDK)</string>
+ </dict>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>French</string>
+ <key>VALUE</key>
+ <string>Kit de développement (SDK) Atomic</string>
+ </dict>
+ </array>
+ <key>TYPE</key>
+ <integer>0</integer>
+ <key>UUID</key>
+ <string>191BBE52-4E6C-474A-AA2E-3AC6ED807261</string>
+ </dict>
+ <dict>
+ <key>CHILDREN</key>
+ <array/>
+ <key>DESCRIPTION</key>
+ <array>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>English</string>
+ <key>VALUE</key>
+ <string>Separate files for the Atomic launcher. Required to build Atomic applications alongside the Software Development Kit.</string>
+ </dict>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>French</string>
+ <key>VALUE</key>
+ <string>Fichiers séparés pour le lanceur Atomic. Requis pour construire des applications Atomic avec le Kit de développement logiciel</string>
+ </dict>
+ </array>
+ <key>OPTIONS</key>
+ <dict>
+ <key>HIDDEN</key>
+ <false/>
+ <key>STATE</key>
+ <integer>2</integer>
+ </dict>
+ <key>PACKAGE_UUID</key>
+ <string>3C776BB3-766E-4B27-B3D1-41D6752EEBE4</string>
+ <key>TITLE</key>
+ <array>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>English</string>
+ <key>VALUE</key>
+ <string>Atomic Standalone Launcher</string>
+ </dict>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>French</string>
+ <key>VALUE</key>
+ <string>Lanceur séparé Atomic</string>
+ </dict>
+ </array>
+ <key>TYPE</key>
+ <integer>0</integer>
+ <key>UUID</key>
+ <string>5B31330E-32F3-4C8A-BC9A-566E86E5FCEE</string>
+ </dict>
+ </array>
+ <key>REMOVED</key>
+ <dict/>
+ </dict>
+ </dict>
+ <key>MODE</key>
+ <integer>2</integer>
+ </dict>
+ <key>INSTALLATION_STEPS</key>
+ <array>
+ <dict>
+ <key>ICPRESENTATION_CHAPTER_VIEW_CONTROLLER_CLASS</key>
+ <string>ICPresentationViewIntroductionController</string>
+ <key>INSTALLER_PLUGIN</key>
+ <string>Introduction</string>
+ <key>LIST_TITLE_KEY</key>
+ <string>InstallerSectionTitle</string>
+ </dict>
+ <dict>
+ <key>ICPRESENTATION_CHAPTER_VIEW_CONTROLLER_CLASS</key>
+ <string>ICPresentationViewReadMeController</string>
+ <key>INSTALLER_PLUGIN</key>
+ <string>ReadMe</string>
+ <key>LIST_TITLE_KEY</key>
+ <string>InstallerSectionTitle</string>
+ </dict>
+ <dict>
+ <key>ICPRESENTATION_CHAPTER_VIEW_CONTROLLER_CLASS</key>
+ <string>ICPresentationViewLicenseController</string>
+ <key>INSTALLER_PLUGIN</key>
+ <string>License</string>
+ <key>LIST_TITLE_KEY</key>
+ <string>InstallerSectionTitle</string>
+ </dict>
+ <dict>
+ <key>ICPRESENTATION_CHAPTER_VIEW_CONTROLLER_CLASS</key>
+ <string>ICPresentationViewDestinationSelectController</string>
+ <key>INSTALLER_PLUGIN</key>
+ <string>TargetSelect</string>
+ <key>LIST_TITLE_KEY</key>
+ <string>InstallerSectionTitle</string>
+ </dict>
+ <dict>
+ <key>ICPRESENTATION_CHAPTER_VIEW_CONTROLLER_CLASS</key>
+ <string>ICPresentationViewInstallationTypeController</string>
+ <key>INSTALLER_PLUGIN</key>
+ <string>PackageSelection</string>
+ <key>LIST_TITLE_KEY</key>
+ <string>InstallerSectionTitle</string>
+ </dict>
+ <dict>
+ <key>ICPRESENTATION_CHAPTER_VIEW_CONTROLLER_CLASS</key>
+ <string>ICPresentationViewInstallationController</string>
+ <key>INSTALLER_PLUGIN</key>
+ <string>Install</string>
+ <key>LIST_TITLE_KEY</key>
+ <string>InstallerSectionTitle</string>
+ </dict>
+ <dict>
+ <key>ICPRESENTATION_CHAPTER_VIEW_CONTROLLER_CLASS</key>
+ <string>ICPresentationViewSummaryController</string>
+ <key>INSTALLER_PLUGIN</key>
+ <string>Summary</string>
+ <key>LIST_TITLE_KEY</key>
+ <string>InstallerSectionTitle</string>
+ </dict>
+ </array>
+ <key>INTRODUCTION</key>
+ <dict>
+ <key>LOCALIZATIONS</key>
+ <array>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>English</string>
+ <key>VALUE</key>
+ <dict>
+ <key>PATH</key>
+ <string>readme-en.rtf</string>
+ <key>PATH_TYPE</key>
+ <integer>1</integer>
+ </dict>
+ </dict>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>French</string>
+ <key>VALUE</key>
+ <dict>
+ <key>PATH</key>
+ <string>readme-fr.rtf</string>
+ <key>PATH_TYPE</key>
+ <integer>1</integer>
+ </dict>
+ </dict>
+ </array>
+ </dict>
+ <key>LICENSE</key>
+ <dict>
+ <key>LOCALIZATIONS</key>
+ <array>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>English</string>
+ <key>VALUE</key>
+ <dict>
+ <key>PATH</key>
+ <string>license-en.rtf</string>
+ <key>PATH_TYPE</key>
+ <integer>1</integer>
+ </dict>
+ </dict>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>French</string>
+ <key>VALUE</key>
+ <dict>
+ <key>PATH</key>
+ <string>license-fr.rtf</string>
+ <key>PATH_TYPE</key>
+ <integer>1</integer>
+ </dict>
+ </dict>
+ </array>
+ <key>MODE</key>
+ <integer>0</integer>
+ </dict>
+ <key>README</key>
+ <dict>
+ <key>LOCALIZATIONS</key>
+ <array/>
+ </dict>
+ <key>SUMMARY</key>
+ <dict>
+ <key>LOCALIZATIONS</key>
+ <array>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>English</string>
+ <key>VALUE</key>
+ <dict>
+ <key>PATH</key>
+ <string>post-en.rtf</string>
+ <key>PATH_TYPE</key>
+ <integer>1</integer>
+ </dict>
+ </dict>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>French</string>
+ <key>VALUE</key>
+ <dict>
+ <key>PATH</key>
+ <string>post-fr.rtf</string>
+ <key>PATH_TYPE</key>
+ <integer>1</integer>
+ </dict>
+ </dict>
+ </array>
+ </dict>
+ <key>TITLE</key>
+ <dict>
+ <key>LOCALIZATIONS</key>
+ <array>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>English</string>
+ <key>VALUE</key>
+ <string>Atomic Platform for Intel</string>
+ </dict>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>French</string>
+ <key>VALUE</key>
+ <string>Plateforme Atomic pour Intel</string>
+ </dict>
+ </array>
+ </dict>
+ </dict>
+ <key>PROJECT_REQUIREMENTS</key>
+ <dict>
+ <key>LIST</key>
+ <array>
+ <dict>
+ <key>BEHAVIOR</key>
+ <integer>3</integer>
+ <key>DICTIONARY</key>
+ <dict>
+ <key>IC_REQUIREMENT_OS_DISK_TYPE</key>
+ <integer>1</integer>
+ <key>IC_REQUIREMENT_OS_DISTRIBUTION_TYPE</key>
+ <integer>1</integer>
+ <key>IC_REQUIREMENT_OS_MINIMUM_VERSION</key>
+ <integer>101000</integer>
+ </dict>
+ <key>IC_REQUIREMENT_CHECK_TYPE</key>
+ <integer>0</integer>
+ <key>IDENTIFIER</key>
+ <string>fr.whitebox.Packages.requirement.os</string>
+ <key>MESSAGE</key>
+ <array>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>English</string>
+ <key>SECONDARY_VALUE</key>
+ <string>Atomic for Intel requires at least macOS 10.10 Yosemite.</string>
+ <key>VALUE</key>
+ <string>Invalid macOS version</string>
+ </dict>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>French</string>
+ <key>SECONDARY_VALUE</key>
+ <string>Atomic pour Intel nécessite au moins macOS 10.10 Yosemite.</string>
+ <key>VALUE</key>
+ <string>Version de macOS invalide</string>
+ </dict>
+ </array>
+ <key>NAME</key>
+ <string>Operating System</string>
+ <key>STATE</key>
+ <true/>
+ </dict>
+ <dict>
+ <key>BEHAVIOR</key>
+ <integer>3</integer>
+ <key>DICTIONARY</key>
+ <dict>
+ <key>IC_REQUIREMENT_CPU_ARCHITECTURE_FAMILY</key>
+ <integer>2</integer>
+ <key>IC_REQUIREMENT_CPU_INTEL_ARCHITECTURE_TYPE</key>
+ <integer>2</integer>
+ <key>IC_REQUIREMENT_CPU_MINIMUM_CPU_CORES_COUNT</key>
+ <integer>1</integer>
+ <key>IC_REQUIREMENT_CPU_MINIMUM_FREQUENCY</key>
+ <integer>1000000</integer>
+ <key>IC_REQUIREMENT_CPU_POWERPC_ARCHITECTURE_TYPE</key>
+ <integer>0</integer>
+ </dict>
+ <key>IC_REQUIREMENT_CHECK_TYPE</key>
+ <integer>0</integer>
+ <key>IDENTIFIER</key>
+ <string>fr.whitebox.Packages.requirement.cpu</string>
+ <key>MESSAGE</key>
+ <array>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>English</string>
+ <key>SECONDARY_VALUE</key>
+ <string>Atomic for Intel requires a 64-bit Intel CPU with at least 1 GHz.</string>
+ <key>VALUE</key>
+ <string>Invalid processor</string>
+ </dict>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>French</string>
+ <key>SECONDARY_VALUE</key>
+ <string>Atomic pour Intel nécessite un processeur Intel 64 bits d'au moins 1 GHz.</string>
+ <key>VALUE</key>
+ <string>Processeur invalide</string>
+ </dict>
+ </array>
+ <key>NAME</key>
+ <string>Processor</string>
+ <key>STATE</key>
+ <true/>
+ </dict>
+ <dict>
+ <key>BEHAVIOR</key>
+ <integer>3</integer>
+ <key>DICTIONARY</key>
+ <dict>
+ <key>IC_REQUIREMENT_RAM_MINIMUM_SIZE_INDEX</key>
+ <integer>5</integer>
+ </dict>
+ <key>IC_REQUIREMENT_CHECK_TYPE</key>
+ <integer>0</integer>
+ <key>IDENTIFIER</key>
+ <string>fr.whitebox.Packages.requirement.ram</string>
+ <key>MESSAGE</key>
+ <array>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>English</string>
+ <key>SECONDARY_VALUE</key>
+ <string>Atomic requires at least 4 GB of system memory to function properly.</string>
+ <key>VALUE</key>
+ <string>Insufficient system memory</string>
+ </dict>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>French</string>
+ <key>SECONDARY_VALUE</key>
+ <string>Atomic nécessite au moins 4 Go de mémoire système pour fonctionner correctement.</string>
+ <key>VALUE</key>
+ <string>Mémoire système insuffisante</string>
+ </dict>
+ </array>
+ <key>NAME</key>
+ <string>Installed RAM</string>
+ <key>STATE</key>
+ <true/>
+ </dict>
+ <dict>
+ <key>BEHAVIOR</key>
+ <integer>3</integer>
+ <key>DICTIONARY</key>
+ <dict>
+ <key>IC_REQUIREMENT_DISKSPACE_MINIMUM_SIZE_UNIT</key>
+ <integer>1</integer>
+ <key>IC_REQUIREMENT_DISKSPACE_MINIMUM_SIZE_VALUE</key>
+ <integer>1</integer>
+ </dict>
+ <key>IC_REQUIREMENT_CHECK_TYPE</key>
+ <integer>1</integer>
+ <key>IDENTIFIER</key>
+ <string>fr.whitebox.Packages.requirement.diskspace</string>
+ <key>MESSAGE</key>
+ <array>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>English</string>
+ <key>VALUE</key>
+ <string>Atomic requires at least 1 GB of free disk space.</string>
+ </dict>
+ <dict>
+ <key>LANGUAGE</key>
+ <string>French</string>
+ <key>VALUE</key>
+ <string>Atomic nécessite au moins 1 Go d'espace disque libre.</string>
+ </dict>
+ </array>
+ <key>NAME</key>
+ <string>Available Disk Space</string>
+ <key>STATE</key>
+ <true/>
+ </dict>
+ </array>
+ <key>RESOURCES</key>
+ <array/>
+ <key>ROOT_VOLUME_ONLY</key>
+ <true/>
+ </dict>
+ <key>PROJECT_SETTINGS</key>
+ <dict>
+ <key>BUILD_FORMAT</key>
+ <integer>0</integer>
+ <key>BUILD_PATH</key>
+ <dict>
+ <key>PATH</key>
+ <string>build/x64</string>
+ <key>PATH_TYPE</key>
+ <integer>1</integer>
+ </dict>
+ <key>EXCLUDED_FILES</key>
+ <array>
+ <dict>
+ <key>PATTERNS_ARRAY</key>
+ <array>
+ <dict>
+ <key>REGULAR_EXPRESSION</key>
+ <false/>
+ <key>STRING</key>
+ <string>.DS_Store</string>
+ <key>TYPE</key>
+ <integer>0</integer>
+ </dict>
+ </array>
+ <key>PROTECTED</key>
+ <true/>
+ <key>PROXY_NAME</key>
+ <string>Remove .DS_Store files</string>
+ <key>PROXY_TOOLTIP</key>
+ <string>Remove ".DS_Store" files created by the Finder.</string>
+ <key>STATE</key>
+ <true/>
+ </dict>
+ <dict>
+ <key>PATTERNS_ARRAY</key>
+ <array>
+ <dict>
+ <key>REGULAR_EXPRESSION</key>
+ <false/>
+ <key>STRING</key>
+ <string>.pbdevelopment</string>
+ <key>TYPE</key>
+ <integer>0</integer>
+ </dict>
+ </array>
+ <key>PROTECTED</key>
+ <true/>
+ <key>PROXY_NAME</key>
+ <string>Remove .pbdevelopment files</string>
+ <key>PROXY_TOOLTIP</key>
+ <string>Remove ".pbdevelopment" files created by ProjectBuilder or Xcode.</string>
+ <key>STATE</key>
+ <true/>
+ </dict>
+ <dict>
+ <key>PATTERNS_ARRAY</key>
+ <array>
+ <dict>
+ <key>REGULAR_EXPRESSION</key>
+ <false/>
+ <key>STRING</key>
+ <string>CVS</string>
+ <key>TYPE</key>
+ <integer>1</integer>
+ </dict>
+ <dict>
+ <key>REGULAR_EXPRESSION</key>
+ <false/>
+ <key>STRING</key>
+ <string>.cvsignore</string>
+ <key>TYPE</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>REGULAR_EXPRESSION</key>
+ <false/>
+ <key>STRING</key>
+ <string>.cvspass</string>
+ <key>TYPE</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>REGULAR_EXPRESSION</key>
+ <false/>
+ <key>STRING</key>
+ <string>.svn</string>
+ <key>TYPE</key>
+ <integer>1</integer>
+ </dict>
+ <dict>
+ <key>REGULAR_EXPRESSION</key>
+ <false/>
+ <key>STRING</key>
+ <string>.git</string>
+ <key>TYPE</key>
+ <integer>1</integer>
+ </dict>
+ <dict>
+ <key>REGULAR_EXPRESSION</key>
+ <false/>
+ <key>STRING</key>
+ <string>.gitignore</string>
+ <key>TYPE</key>
+ <integer>0</integer>
+ </dict>
+ </array>
+ <key>PROTECTED</key>
+ <true/>
+ <key>PROXY_NAME</key>
+ <string>Remove SCM metadata</string>
+ <key>PROXY_TOOLTIP</key>
+ <string>Remove helper files and folders used by the CVS, SVN or Git Source Code Management systems.</string>
+ <key>STATE</key>
+ <true/>
+ </dict>
+ <dict>
+ <key>PATTERNS_ARRAY</key>
+ <array>
+ <dict>
+ <key>REGULAR_EXPRESSION</key>
+ <false/>
+ <key>STRING</key>
+ <string>classes.nib</string>
+ <key>TYPE</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>REGULAR_EXPRESSION</key>
+ <false/>
+ <key>STRING</key>
+ <string>designable.db</string>
+ <key>TYPE</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>REGULAR_EXPRESSION</key>
+ <false/>
+ <key>STRING</key>
+ <string>info.nib</string>
+ <key>TYPE</key>
+ <integer>0</integer>
+ </dict>
+ </array>
+ <key>PROTECTED</key>
+ <true/>
+ <key>PROXY_NAME</key>
+ <string>Optimize nib files</string>
+ <key>PROXY_TOOLTIP</key>
+ <string>Remove "classes.nib", "info.nib" and "designable.nib" files within .nib bundles.</string>
+ <key>STATE</key>
+ <true/>
+ </dict>
+ <dict>
+ <key>PATTERNS_ARRAY</key>
+ <array>
+ <dict>
+ <key>REGULAR_EXPRESSION</key>
+ <false/>
+ <key>STRING</key>
+ <string>Resources Disabled</string>
+ <key>TYPE</key>
+ <integer>1</integer>
+ </dict>
+ </array>
+ <key>PROTECTED</key>
+ <true/>
+ <key>PROXY_NAME</key>
+ <string>Remove Resources Disabled folders</string>
+ <key>PROXY_TOOLTIP</key>
+ <string>Remove "Resources Disabled" folders.</string>
+ <key>STATE</key>
+ <true/>
+ </dict>
+ <dict>
+ <key>SEPARATOR</key>
+ <true/>
+ </dict>
+ </array>
+ <key>NAME</key>
+ <string>Atomic</string>
+ <key>PAYLOAD_ONLY</key>
+ <false/>
+ <key>TREAT_MISSING_PRESENTATION_DOCUMENTS_AS_WARNING</key>
+ <false/>
+ </dict>
+ </dict>
+ <key>SHARED_GLOBAL_DATA</key>
+ <dict>
+ <key>IC_REQUIREMENT_JAVASCRIPT_SHARED_SOURCE_CODE</key>
+ <string></string>
+ </dict>
+ <key>TYPE</key>
+ <integer>0</integer>
+ <key>VERSION</key>
+ <integer>2</integer>
+</dict>
+</plist>
diff --git a/generator/index.js b/generator/index.js
new file mode 100644
index 0000000..0b92105
--- /dev/null
+++ b/generator/index.js
@@ -0,0 +1,89 @@
+const fs = require('fs');
+const cp = require('child_process');
+const plist = require('plist');
+
+if (fs.existsSync("./work")) fs.rmSync("./work", { recursive: true });
+fs.mkdirSync("./work");
+fs.writeFileSync("./work/package.json", "{}");
+
+console.log("# Downloading Electron for macOS ARM64");
+cp.execSync("npm install electron@latest --platform=darwin --arch=arm64", { cwd: "./work", stdio: "inherit" });
+fs.renameSync("./work/node_modules/electron/dist", "./work/electron-darwin-arm64");
+fs.rmSync("./work/node_modules", { recursive: true });
+
+console.log("# Downloading Electron for macOS x64");
+cp.execSync("npm install electron@latest --platform=darwin --arch=x64", { cwd: "./work", stdio: "inherit" });
+fs.renameSync("./work/node_modules/electron/dist", "./work/electron-darwin-x64");
+fs.rmSync("./work/node_modules", { recursive: true });
+
+let version = fs.readFileSync("./work/electron-darwin-arm64/version").toString().trim();
+console.log("# Electron version: " + version);
+
+console.log("# Preparing Electron");
+fs.mkdirSync("./work/root");
+fs.mkdirSync("./work/root/arm");
+fs.mkdirSync("./work/root/x64");
+
+fs.renameSync("./work/electron-darwin-x64/Electron.app", "./work/root/x64/AtomicRuntime.framework");
+fs.renameSync("./work/electron-darwin-arm64/Electron.app", "./work/root/arm/AtomicRuntime.framework");
+fs.renameSync("./work/root/x64/AtomicRuntime.framework/Contents/MacOS/Electron", "./work/root/x64/AtomicRuntime.framework/Contents/MacOS/Atomic");
+fs.renameSync("./work/root/arm/AtomicRuntime.framework/Contents/MacOS/Electron", "./work/root/arm/AtomicRuntime.framework/Contents/MacOS/Atomic");
+
+fs.rmSync("./work/root/arm/AtomicRuntime.framework/Contents/Info.plist");
+fs.rmSync("./work/root/arm/AtomicRuntime.framework/Contents/PkgInfo");
+fs.rmSync("./work/root/x64/AtomicRuntime.framework/Contents/Info.plist");
+fs.rmSync("./work/root/x64/AtomicRuntime.framework/Contents/PkgInfo");
+
+console.log("# Preparing SDK");
+fs.mkdirSync("./work/root/sdk");
+fs.mkdirSync("./work/root/sdk/Atomic");
+fs.mkdirSync("./work/root/sdk/Atomic/SDK");
+
+for (let file of fs.readdirSync("../converter/").filter(i => i.startsWith("convert_"))) {
+ fs.copyFileSync("../converter/" + file, "./work/root/sdk/Atomic/SDK/" + file);
+}
+
+console.log("# Preparing standalone launcher");
+fs.mkdirSync("./work/root/launcher");
+fs.mkdirSync("./work/root/launcher/Atomic");
+fs.mkdirSync("./work/root/launcher/Atomic/Launcher");
+
+for (let file of fs.readdirSync("../converter/").filter(i => i.startsWith("launcher-"))) {
+ fs.copyFileSync("../converter/" + file, "./work/root/launcher/Atomic/Launcher/" + file);
+}
+
+console.log("# Generating installer");
+
+let data = plist['parse'](fs.readFileSync("./Atomic-x64.pkgproj").toString());
+data["PACKAGES"].filter(i => i["PACKAGE_SETTINGS"]["NAME"] === "Atomic Runtime")[0]["PACKAGE_SETTINGS"]["VERSION"] = version;
+fs.writeFileSync("./Atomic-x64-work.pkgproj", plist['build'](data)
+ .replaceAll(" ", "\t")
+ .replace(/^\t(?=<dict>|<\/dict>)|^\t(?=\t(?=[<\t]))/gm, "")
+ .replaceAll("<string/>", "<string></string>")
+ .replaceAll("<data/>", "<data></data>")
+);
+
+data = plist['parse'](fs.readFileSync("./Atomic-ARM.pkgproj").toString());
+data["PACKAGES"].filter(i => i["PACKAGE_SETTINGS"]["NAME"] === "Atomic Runtime")[0]["PACKAGE_SETTINGS"]["VERSION"] = version;
+fs.writeFileSync("./Atomic-ARM-work.pkgproj", plist['build'](data)
+ .replaceAll(" ", "\t")
+ .replace(/^\t(?=<dict>|<\/dict>)|^\t(?=\t(?=[<\t]))/gm, "")
+ .replaceAll("<string/>", "<string></string>")
+ .replaceAll("<data/>", "<data></data>")
+);
+
+cp.execSync("packagesbuild ./Atomic-x64-work.pkgproj", { stdio: "inherit" });
+cp.execSync("packagesbuild ./Atomic-ARM-work.pkgproj", { stdio: "inherit" });
+
+console.log("# Cleaning up");
+fs.renameSync("./build/ARM/Atomic.pkg", "./build/Atomic-Mac-ARM64.pkg");
+fs.renameSync("./build/x64/Atomic.pkg", "./build/Atomic-Mac-x64.pkg");
+fs.rmdirSync("./build/ARM");
+fs.rmdirSync("./build/x64");
+fs.rmSync("./work", { recursive: true });
+fs.rmSync("./Atomic-ARM-work.pkgproj");
+fs.rmSync("./Atomic-x64-work.pkgproj");
+
+console.log("# Publishing to GitLab");
+cp.execSync(`curl -v --header "PRIVATE-TOKEN: $(cat ~/.deploy.txt)" --header "Content-Type: multipart/form-data" --upload-file Atomic-Mac-ARM64.pkg https://source.equestria.dev/api/v4/projects/186/packages/generic/atomic/${version}/Atomic-Mac-ARM64.pkg`, { cwd: "./build" });
+cp.execSync(`curl -v --header "PRIVATE-TOKEN: $(cat ~/.deploy.txt)" --header "Content-Type: multipart/form-data" --upload-file Atomic-Mac-x64.pkg https://source.equestria.dev/api/v4/projects/186/packages/generic/atomic/${version}/Atomic-Mac-x64.pkg`, { cwd: "./build" });
diff --git a/generator/license-en.rtf b/generator/license-en.rtf
new file mode 100644
index 0000000..7fbf381
--- /dev/null
+++ b/generator/license-en.rtf
@@ -0,0 +1,253 @@
+{\rtf1\ansi\ansicpg1252\cocoartf2761
+\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica-Bold;\f1\fswiss\fcharset0 Helvetica;\f2\froman\fcharset0 Times-Bold;
+\f3\froman\fcharset0 Times-Roman;}
+{\colortbl;\red255\green255\blue255;\red0\green0\blue0;\red0\green0\blue233;}
+{\*\expandedcolortbl;;\cssrgb\c0\c0\c0;\cssrgb\c0\c0\c93333;}
+{\*\listtable{\list\listtemplateid1\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid1\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid1}
+{\list\listtemplateid2\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid101\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid2}
+{\list\listtemplateid3\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid201\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid3}}
+{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}{\listoverride\listid2\listoverridecount0\ls2}{\listoverride\listid3\listoverridecount0\ls3}}
+\paperw11900\paperh16840\margl1440\margr1440\vieww12720\viewh7240\viewkind0
+\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
+
+\f0\b\fs24 \cf0 Atomic is released by Equestria.dev under the GNU Affero General Public License version 3
+\f1\b0 \
+\
+\pard\pardeftab720\sa280\qc\partightenfactor0
+
+\f2\b\fs28 \cf0 \expnd0\expndtw0\kerning0
+\outl0\strokewidth0 \strokec2 GNU AFFERO GENERAL PUBLIC LICENSE\
+\pard\pardeftab720\sa240\qc\partightenfactor0
+
+\f3\b0\fs24 \cf0 Version 3, 19 November 2007\
+\pard\pardeftab720\sa240\partightenfactor0
+\cf0 Copyright \'a9 2007 Free Software Foundation, Inc. <{\field{\*\fldinst{HYPERLINK "https://fsf.org/"}}{\fldrslt \cf3 \ul \ulc3 \strokec3 https://fsf.org/}}>\uc0\u8232 Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.\
+\pard\pardeftab720\sa319\partightenfactor0
+
+\f2\b \cf0 Preamble\
+\pard\pardeftab720\sa240\partightenfactor0
+
+\f3\b0 \cf0 The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed to ensure cooperation with the community in the case of network server software.\
+The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, our General Public Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users.\
+When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.\
+Developers that use our General Public Licenses protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License which gives you legal permission to copy, distribute and/or modify the software.\
+A secondary benefit of defending all users' freedom is that improvements made in alternate versions of the program, if they receive widespread use, become available for other developers to incorporate. Many developers of free software are heartened and encouraged by the resulting cooperation. However, in the case of software used on network servers, this result may fail to come about. The GNU General Public License permits making a modified version and letting the public access it on a server without ever releasing its source code to the public.\
+The GNU Affero General Public License is designed specifically to ensure that, in such cases, the modified source code becomes available to the community. It requires the operator of a network server to provide the source code of the modified version running there to the users of that server. Therefore, public use of a modified version, on a publicly accessible server, gives the public access to the source code of the modified version.\
+An older license, called the Affero General Public License and published by Affero, was designed to accomplish similar goals. This is a different license, not a version of the Affero GPL, but Affero has released a new version of the Affero GPL which permits relicensing under this license.\
+The precise terms and conditions for copying, distribution and modification follow.\
+\pard\pardeftab720\sa319\partightenfactor0
+
+\f2\b \cf0 TERMS AND CONDITIONS\
+0. Definitions.\
+\pard\pardeftab720\sa240\partightenfactor0
+
+\f3\b0 \cf0 "This License" refers to version 3 of the GNU Affero General Public License.\
+"Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.\
+"The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations.\
+To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work.\
+A "covered work" means either the unmodified Program or a work based on the Program.\
+To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.\
+To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.\
+An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.\
+\pard\pardeftab720\sa319\partightenfactor0
+
+\f2\b \cf0 1. Source Code.\
+\pard\pardeftab720\sa240\partightenfactor0
+
+\f3\b0 \cf0 The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work.\
+A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.\
+The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.\
+The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.\
+The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.\
+The Corresponding Source for a work in source code form is that same work.\
+\pard\pardeftab720\sa319\partightenfactor0
+
+\f2\b \cf0 2. Basic Permissions.\
+\pard\pardeftab720\sa240\partightenfactor0
+
+\f3\b0 \cf0 All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.\
+You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.\
+Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.\
+\pard\pardeftab720\sa319\partightenfactor0
+
+\f2\b \cf0 3. Protecting Users' Legal Rights From Anti-Circumvention Law.\
+\pard\pardeftab720\sa240\partightenfactor0
+
+\f3\b0 \cf0 No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.\
+When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.\
+\pard\pardeftab720\sa319\partightenfactor0
+
+\f2\b \cf0 4. Conveying Verbatim Copies.\
+\pard\pardeftab720\sa240\partightenfactor0
+
+\f3\b0 \cf0 You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.\
+You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.\
+\pard\pardeftab720\sa319\partightenfactor0
+
+\f2\b \cf0 5. Conveying Modified Source Versions.\
+\pard\pardeftab720\sa240\partightenfactor0
+
+\f3\b0 \cf0 You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:\
+\pard\tx220\tx720\pardeftab720\li720\fi-720\partightenfactor0
+\ls1\ilvl0\cf0 \kerning1\expnd0\expndtw0 \outl0\strokewidth0 {\listtext \uc0\u8226 }\expnd0\expndtw0\kerning0
+\outl0\strokewidth0 \strokec2 a) The work must carry prominent notices stating that you modified it, and giving a relevant date.\
+\ls1\ilvl0\kerning1\expnd0\expndtw0 \outl0\strokewidth0 {\listtext \uc0\u8226 }\expnd0\expndtw0\kerning0
+\outl0\strokewidth0 \strokec2 b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices".\
+\ls1\ilvl0\kerning1\expnd0\expndtw0 \outl0\strokewidth0 {\listtext \uc0\u8226 }\expnd0\expndtw0\kerning0
+\outl0\strokewidth0 \strokec2 c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.\
+\ls1\ilvl0\kerning1\expnd0\expndtw0 \outl0\strokewidth0 {\listtext \uc0\u8226 }\expnd0\expndtw0\kerning0
+\outl0\strokewidth0 \strokec2 d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.\
+\pard\pardeftab720\sa240\partightenfactor0
+\cf0 \strokec2 A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.\
+\pard\pardeftab720\sa319\partightenfactor0
+
+\f2\b \cf0 6. Conveying Non-Source Forms.\
+\pard\pardeftab720\sa240\partightenfactor0
+
+\f3\b0 \cf0 You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:\
+\pard\tx220\tx720\pardeftab720\li720\fi-720\partightenfactor0
+\ls2\ilvl0\cf0 \kerning1\expnd0\expndtw0 \outl0\strokewidth0 {\listtext \uc0\u8226 }\expnd0\expndtw0\kerning0
+\outl0\strokewidth0 \strokec2 a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.\
+\ls2\ilvl0\kerning1\expnd0\expndtw0 \outl0\strokewidth0 {\listtext \uc0\u8226 }\expnd0\expndtw0\kerning0
+\outl0\strokewidth0 \strokec2 b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.\
+\ls2\ilvl0\kerning1\expnd0\expndtw0 \outl0\strokewidth0 {\listtext \uc0\u8226 }\expnd0\expndtw0\kerning0
+\outl0\strokewidth0 \strokec2 c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.\
+\ls2\ilvl0\kerning1\expnd0\expndtw0 \outl0\strokewidth0 {\listtext \uc0\u8226 }\expnd0\expndtw0\kerning0
+\outl0\strokewidth0 \strokec2 d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.\
+\ls2\ilvl0\kerning1\expnd0\expndtw0 \outl0\strokewidth0 {\listtext \uc0\u8226 }\expnd0\expndtw0\kerning0
+\outl0\strokewidth0 \strokec2 e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.\
+\pard\pardeftab720\sa240\partightenfactor0
+\cf0 \strokec2 A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.\
+A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.\
+"Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.\
+If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).\
+The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.\
+Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.\
+\pard\pardeftab720\sa319\partightenfactor0
+
+\f2\b \cf0 7. Additional Terms.\
+\pard\pardeftab720\sa240\partightenfactor0
+
+\f3\b0 \cf0 "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.\
+When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.\
+Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:\
+\pard\tx220\tx720\pardeftab720\li720\fi-720\partightenfactor0
+\ls3\ilvl0\cf0 \kerning1\expnd0\expndtw0 \outl0\strokewidth0 {\listtext \uc0\u8226 }\expnd0\expndtw0\kerning0
+\outl0\strokewidth0 \strokec2 a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or\
+\ls3\ilvl0\kerning1\expnd0\expndtw0 \outl0\strokewidth0 {\listtext \uc0\u8226 }\expnd0\expndtw0\kerning0
+\outl0\strokewidth0 \strokec2 b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or\
+\ls3\ilvl0\kerning1\expnd0\expndtw0 \outl0\strokewidth0 {\listtext \uc0\u8226 }\expnd0\expndtw0\kerning0
+\outl0\strokewidth0 \strokec2 c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or\
+\ls3\ilvl0\kerning1\expnd0\expndtw0 \outl0\strokewidth0 {\listtext \uc0\u8226 }\expnd0\expndtw0\kerning0
+\outl0\strokewidth0 \strokec2 d) Limiting the use for publicity purposes of names of licensors or authors of the material; or\
+\ls3\ilvl0\kerning1\expnd0\expndtw0 \outl0\strokewidth0 {\listtext \uc0\u8226 }\expnd0\expndtw0\kerning0
+\outl0\strokewidth0 \strokec2 e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or\
+\ls3\ilvl0\kerning1\expnd0\expndtw0 \outl0\strokewidth0 {\listtext \uc0\u8226 }\expnd0\expndtw0\kerning0
+\outl0\strokewidth0 \strokec2 f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.\
+\pard\pardeftab720\sa240\partightenfactor0
+\cf0 \strokec2 All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.\
+If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.\
+Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.\
+\pard\pardeftab720\sa319\partightenfactor0
+
+\f2\b \cf0 8. Termination.\
+\pard\pardeftab720\sa240\partightenfactor0
+
+\f3\b0 \cf0 You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).\
+However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.\
+Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.\
+Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.\
+\pard\pardeftab720\sa319\partightenfactor0
+
+\f2\b \cf0 9. Acceptance Not Required for Having Copies.\
+\pard\pardeftab720\sa240\partightenfactor0
+
+\f3\b0 \cf0 You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.\
+\pard\pardeftab720\sa319\partightenfactor0
+
+\f2\b \cf0 10. Automatic Licensing of Downstream Recipients.\
+\pard\pardeftab720\sa240\partightenfactor0
+
+\f3\b0 \cf0 Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.\
+An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.\
+You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.\
+\pard\pardeftab720\sa319\partightenfactor0
+
+\f2\b \cf0 11. Patents.\
+\pard\pardeftab720\sa240\partightenfactor0
+
+\f3\b0 \cf0 A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version".\
+A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.\
+Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.\
+In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.\
+If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.\
+If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.\
+A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.\
+Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.\
+\pard\pardeftab720\sa319\partightenfactor0
+
+\f2\b \cf0 12. No Surrender of Others' Freedom.\
+\pard\pardeftab720\sa240\partightenfactor0
+
+\f3\b0 \cf0 If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.\
+\pard\pardeftab720\sa319\partightenfactor0
+
+\f2\b \cf0 13. Remote Network Interaction; Use with the GNU General Public License.\
+\pard\pardeftab720\sa240\partightenfactor0
+
+\f3\b0 \cf0 Notwithstanding any other provision of this License, if you modify the Program, your modified version must prominently offer all users interacting with it remotely through a computer network (if your version supports such interaction) an opportunity to receive the Corresponding Source of your version by providing access to the Corresponding Source from a network server at no charge, through some standard or customary means of facilitating copying of software. This Corresponding Source shall include the Corresponding Source for any work covered by version 3 of the GNU General Public License that is incorporated pursuant to the following paragraph.\
+Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the work with which it is combined will remain governed by version 3 of the GNU General Public License.\
+\pard\pardeftab720\sa319\partightenfactor0
+
+\f2\b \cf0 14. Revised Versions of this License.\
+\pard\pardeftab720\sa240\partightenfactor0
+
+\f3\b0 \cf0 The Free Software Foundation may publish revised and/or new versions of the GNU Affero General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.\
+Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU Affero General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU Affero General Public License, you may choose any version ever published by the Free Software Foundation.\
+If the Program specifies that a proxy can decide which future versions of the GNU Affero General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.\
+Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.\
+\pard\pardeftab720\sa319\partightenfactor0
+
+\f2\b \cf0 15. Disclaimer of Warranty.\
+\pard\pardeftab720\sa240\partightenfactor0
+
+\f3\b0 \cf0 THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\
+\pard\pardeftab720\sa319\partightenfactor0
+
+\f2\b \cf0 16. Limitation of Liability.\
+\pard\pardeftab720\sa240\partightenfactor0
+
+\f3\b0 \cf0 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\
+\pard\pardeftab720\sa319\partightenfactor0
+
+\f2\b \cf0 17. Interpretation of Sections 15 and 16.\
+\pard\pardeftab720\sa240\partightenfactor0
+
+\f3\b0 \cf0 If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
+\f0\b \kerning1\expnd0\expndtw0 \outl0\strokewidth0 \
+\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
+\cf0 \
+Atomic is powered by Electron, released under the MIT License
+\f1\b0 \
+\
+Copyright (c) Electron contributors\
+Copyright (c) 2013-2020 GitHub Inc.\
+\
+Permission is hereby granted, free of charge, to any person obtaining\
+a copy of this software and associated documentation files (the\
+"Software"), to deal in the Software without restriction, including\
+without limitation the rights to use, copy, modify, merge, publish,\
+distribute, sublicense, and/or sell copies of the Software, and to\
+permit persons to whom the Software is furnished to do so, subject to\
+the following conditions:\
+\
+The above copyright notice and this permission notice shall be\
+included in all copies or substantial portions of the Software.\
+\
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.} \ No newline at end of file
diff --git a/generator/license-fr.rtf b/generator/license-fr.rtf
new file mode 100644
index 0000000..f9a63ff
--- /dev/null
+++ b/generator/license-fr.rtf
@@ -0,0 +1,253 @@
+{\rtf1\ansi\ansicpg1252\cocoartf2761
+\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica-Bold;\f1\fswiss\fcharset0 Helvetica;\f2\froman\fcharset0 Times-Bold;
+\f3\froman\fcharset0 Times-Roman;}
+{\colortbl;\red255\green255\blue255;\red0\green0\blue0;\red0\green0\blue233;}
+{\*\expandedcolortbl;;\cssrgb\c0\c0\c0;\cssrgb\c0\c0\c93333;}
+{\*\listtable{\list\listtemplateid1\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid1\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid1}
+{\list\listtemplateid2\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid101\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid2}
+{\list\listtemplateid3\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid201\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid3}}
+{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}{\listoverride\listid2\listoverridecount0\ls2}{\listoverride\listid3\listoverridecount0\ls3}}
+\paperw11900\paperh16840\margl1440\margr1440\vieww12720\viewh7240\viewkind0
+\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
+
+\f0\b\fs24 \cf0 Atomic est publi\'e9 par Equestria.dev sous licence GNU Affero General Public License version 3
+\f1\b0 \
+\
+\pard\pardeftab720\sa280\qc\partightenfactor0
+
+\f2\b\fs28 \cf0 \expnd0\expndtw0\kerning0
+GNU AFFERO GENERAL PUBLIC LICENSE\
+\pard\pardeftab720\sa240\qc\partightenfactor0
+
+\f3\b0\fs24 \cf0 Version 3, 19 November 2007\
+\pard\pardeftab720\sa240\partightenfactor0
+\cf0 Copyright \'a9 2007 Free Software Foundation, Inc. <{\field{\*\fldinst{HYPERLINK "https://fsf.org/"}}{\fldrslt \cf3 \ul \ulc3 https://fsf.org/}}>\uc0\u8232 Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.\
+\pard\pardeftab720\sa319\partightenfactor0
+
+\f2\b \cf0 Preamble\
+\pard\pardeftab720\sa240\partightenfactor0
+
+\f3\b0 \cf0 The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed to ensure cooperation with the community in the case of network server software.\
+The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, our General Public Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users.\
+When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.\
+Developers that use our General Public Licenses protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License which gives you legal permission to copy, distribute and/or modify the software.\
+A secondary benefit of defending all users' freedom is that improvements made in alternate versions of the program, if they receive widespread use, become available for other developers to incorporate. Many developers of free software are heartened and encouraged by the resulting cooperation. However, in the case of software used on network servers, this result may fail to come about. The GNU General Public License permits making a modified version and letting the public access it on a server without ever releasing its source code to the public.\
+The GNU Affero General Public License is designed specifically to ensure that, in such cases, the modified source code becomes available to the community. It requires the operator of a network server to provide the source code of the modified version running there to the users of that server. Therefore, public use of a modified version, on a publicly accessible server, gives the public access to the source code of the modified version.\
+An older license, called the Affero General Public License and published by Affero, was designed to accomplish similar goals. This is a different license, not a version of the Affero GPL, but Affero has released a new version of the Affero GPL which permits relicensing under this license.\
+The precise terms and conditions for copying, distribution and modification follow.\
+\pard\pardeftab720\sa319\partightenfactor0
+
+\f2\b \cf0 TERMS AND CONDITIONS\
+0. Definitions.\
+\pard\pardeftab720\sa240\partightenfactor0
+
+\f3\b0 \cf0 "This License" refers to version 3 of the GNU Affero General Public License.\
+"Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.\
+"The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations.\
+To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work.\
+A "covered work" means either the unmodified Program or a work based on the Program.\
+To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.\
+To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.\
+An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.\
+\pard\pardeftab720\sa319\partightenfactor0
+
+\f2\b \cf0 1. Source Code.\
+\pard\pardeftab720\sa240\partightenfactor0
+
+\f3\b0 \cf0 The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work.\
+A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.\
+The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.\
+The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.\
+The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.\
+The Corresponding Source for a work in source code form is that same work.\
+\pard\pardeftab720\sa319\partightenfactor0
+
+\f2\b \cf0 2. Basic Permissions.\
+\pard\pardeftab720\sa240\partightenfactor0
+
+\f3\b0 \cf0 All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.\
+You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.\
+Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.\
+\pard\pardeftab720\sa319\partightenfactor0
+
+\f2\b \cf0 3. Protecting Users' Legal Rights From Anti-Circumvention Law.\
+\pard\pardeftab720\sa240\partightenfactor0
+
+\f3\b0 \cf0 No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.\
+When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.\
+\pard\pardeftab720\sa319\partightenfactor0
+
+\f2\b \cf0 4. Conveying Verbatim Copies.\
+\pard\pardeftab720\sa240\partightenfactor0
+
+\f3\b0 \cf0 You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.\
+You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.\
+\pard\pardeftab720\sa319\partightenfactor0
+
+\f2\b \cf0 5. Conveying Modified Source Versions.\
+\pard\pardeftab720\sa240\partightenfactor0
+
+\f3\b0 \cf0 You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:\
+\pard\tx220\tx720\pardeftab720\li720\fi-720\partightenfactor0
+\ls1\ilvl0\cf0 \kerning1\expnd0\expndtw0 {\listtext \uc0\u8226 }\expnd0\expndtw0\kerning0
+a) The work must carry prominent notices stating that you modified it, and giving a relevant date.\
+\ls1\ilvl0\kerning1\expnd0\expndtw0 {\listtext \uc0\u8226 }\expnd0\expndtw0\kerning0
+b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices".\
+\ls1\ilvl0\kerning1\expnd0\expndtw0 {\listtext \uc0\u8226 }\expnd0\expndtw0\kerning0
+c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.\
+\ls1\ilvl0\kerning1\expnd0\expndtw0 {\listtext \uc0\u8226 }\expnd0\expndtw0\kerning0
+d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.\
+\pard\pardeftab720\sa240\partightenfactor0
+\cf0 A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.\
+\pard\pardeftab720\sa319\partightenfactor0
+
+\f2\b \cf0 6. Conveying Non-Source Forms.\
+\pard\pardeftab720\sa240\partightenfactor0
+
+\f3\b0 \cf0 You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:\
+\pard\tx220\tx720\pardeftab720\li720\fi-720\partightenfactor0
+\ls2\ilvl0\cf0 \kerning1\expnd0\expndtw0 {\listtext \uc0\u8226 }\expnd0\expndtw0\kerning0
+a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.\
+\ls2\ilvl0\kerning1\expnd0\expndtw0 {\listtext \uc0\u8226 }\expnd0\expndtw0\kerning0
+b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.\
+\ls2\ilvl0\kerning1\expnd0\expndtw0 {\listtext \uc0\u8226 }\expnd0\expndtw0\kerning0
+c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.\
+\ls2\ilvl0\kerning1\expnd0\expndtw0 {\listtext \uc0\u8226 }\expnd0\expndtw0\kerning0
+d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.\
+\ls2\ilvl0\kerning1\expnd0\expndtw0 {\listtext \uc0\u8226 }\expnd0\expndtw0\kerning0
+e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.\
+\pard\pardeftab720\sa240\partightenfactor0
+\cf0 A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.\
+A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.\
+"Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.\
+If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).\
+The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.\
+Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.\
+\pard\pardeftab720\sa319\partightenfactor0
+
+\f2\b \cf0 7. Additional Terms.\
+\pard\pardeftab720\sa240\partightenfactor0
+
+\f3\b0 \cf0 "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.\
+When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.\
+Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:\
+\pard\tx220\tx720\pardeftab720\li720\fi-720\partightenfactor0
+\ls3\ilvl0\cf0 \kerning1\expnd0\expndtw0 {\listtext \uc0\u8226 }\expnd0\expndtw0\kerning0
+a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or\
+\ls3\ilvl0\kerning1\expnd0\expndtw0 {\listtext \uc0\u8226 }\expnd0\expndtw0\kerning0
+b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or\
+\ls3\ilvl0\kerning1\expnd0\expndtw0 {\listtext \uc0\u8226 }\expnd0\expndtw0\kerning0
+c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or\
+\ls3\ilvl0\kerning1\expnd0\expndtw0 {\listtext \uc0\u8226 }\expnd0\expndtw0\kerning0
+d) Limiting the use for publicity purposes of names of licensors or authors of the material; or\
+\ls3\ilvl0\kerning1\expnd0\expndtw0 {\listtext \uc0\u8226 }\expnd0\expndtw0\kerning0
+e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or\
+\ls3\ilvl0\kerning1\expnd0\expndtw0 {\listtext \uc0\u8226 }\expnd0\expndtw0\kerning0
+f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.\
+\pard\pardeftab720\sa240\partightenfactor0
+\cf0 All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.\
+If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.\
+Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.\
+\pard\pardeftab720\sa319\partightenfactor0
+
+\f2\b \cf0 8. Termination.\
+\pard\pardeftab720\sa240\partightenfactor0
+
+\f3\b0 \cf0 You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).\
+However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.\
+Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.\
+Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.\
+\pard\pardeftab720\sa319\partightenfactor0
+
+\f2\b \cf0 9. Acceptance Not Required for Having Copies.\
+\pard\pardeftab720\sa240\partightenfactor0
+
+\f3\b0 \cf0 You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.\
+\pard\pardeftab720\sa319\partightenfactor0
+
+\f2\b \cf0 10. Automatic Licensing of Downstream Recipients.\
+\pard\pardeftab720\sa240\partightenfactor0
+
+\f3\b0 \cf0 Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.\
+An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.\
+You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.\
+\pard\pardeftab720\sa319\partightenfactor0
+
+\f2\b \cf0 11. Patents.\
+\pard\pardeftab720\sa240\partightenfactor0
+
+\f3\b0 \cf0 A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version".\
+A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.\
+Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.\
+In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.\
+If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.\
+If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.\
+A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.\
+Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.\
+\pard\pardeftab720\sa319\partightenfactor0
+
+\f2\b \cf0 12. No Surrender of Others' Freedom.\
+\pard\pardeftab720\sa240\partightenfactor0
+
+\f3\b0 \cf0 If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.\
+\pard\pardeftab720\sa319\partightenfactor0
+
+\f2\b \cf0 13. Remote Network Interaction; Use with the GNU General Public License.\
+\pard\pardeftab720\sa240\partightenfactor0
+
+\f3\b0 \cf0 Notwithstanding any other provision of this License, if you modify the Program, your modified version must prominently offer all users interacting with it remotely through a computer network (if your version supports such interaction) an opportunity to receive the Corresponding Source of your version by providing access to the Corresponding Source from a network server at no charge, through some standard or customary means of facilitating copying of software. This Corresponding Source shall include the Corresponding Source for any work covered by version 3 of the GNU General Public License that is incorporated pursuant to the following paragraph.\
+Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the work with which it is combined will remain governed by version 3 of the GNU General Public License.\
+\pard\pardeftab720\sa319\partightenfactor0
+
+\f2\b \cf0 14. Revised Versions of this License.\
+\pard\pardeftab720\sa240\partightenfactor0
+
+\f3\b0 \cf0 The Free Software Foundation may publish revised and/or new versions of the GNU Affero General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.\
+Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU Affero General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU Affero General Public License, you may choose any version ever published by the Free Software Foundation.\
+If the Program specifies that a proxy can decide which future versions of the GNU Affero General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.\
+Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.\
+\pard\pardeftab720\sa319\partightenfactor0
+
+\f2\b \cf0 15. Disclaimer of Warranty.\
+\pard\pardeftab720\sa240\partightenfactor0
+
+\f3\b0 \cf0 THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\
+\pard\pardeftab720\sa319\partightenfactor0
+
+\f2\b \cf0 16. Limitation of Liability.\
+\pard\pardeftab720\sa240\partightenfactor0
+
+\f3\b0 \cf0 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\
+\pard\pardeftab720\sa319\partightenfactor0
+
+\f2\b \cf0 17. Interpretation of Sections 15 and 16.\
+\pard\pardeftab720\sa240\partightenfactor0
+
+\f3\b0 \cf0 If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
+\f0\b \kerning1\expnd0\expndtw0 \
+\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
+\cf0 \
+Atomic utilise Electron, publi\'e9 sous licence MIT
+\f1\b0 \
+\
+Copyright (c) Electron contributors\
+Copyright (c) 2013-2020 GitHub Inc.\
+\
+Permission is hereby granted, free of charge, to any person obtaining\
+a copy of this software and associated documentation files (the\
+"Software"), to deal in the Software without restriction, including\
+without limitation the rights to use, copy, modify, merge, publish,\
+distribute, sublicense, and/or sell copies of the Software, and to\
+permit persons to whom the Software is furnished to do so, subject to\
+the following conditions:\
+\
+The above copyright notice and this permission notice shall be\
+included in all copies or substantial portions of the Software.\
+\
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.} \ No newline at end of file
diff --git a/generator/node_modules/.package-lock.json b/generator/node_modules/.package-lock.json
new file mode 100644
index 0000000..5bf1d82
--- /dev/null
+++ b/generator/node_modules/.package-lock.json
@@ -0,0 +1,55 @@
+{
+ "name": "generator",
+ "lockfileVersion": 3,
+ "requires": true,
+ "packages": {
+ "node_modules/@xmldom/xmldom": {
+ "version": "0.8.10",
+ "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.10.tgz",
+ "integrity": "sha512-2WALfTl4xo2SkGCYRt6rDTFfk9R1czmBvUQy12gK2KuRKIpWEhcbbzy8EZXtz/jkRqHX8bFEc6FC1HjX4TUWYw==",
+ "engines": {
+ "node": ">=10.0.0"
+ }
+ },
+ "node_modules/base64-js": {
+ "version": "1.5.1",
+ "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
+ "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ]
+ },
+ "node_modules/plist": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/plist/-/plist-3.1.0.tgz",
+ "integrity": "sha512-uysumyrvkUX0rX/dEVqt8gC3sTBzd4zoWfLeS29nb53imdaXVvLINYXTI2GNqzaMuvacNx4uJQ8+b3zXR0pkgQ==",
+ "dependencies": {
+ "@xmldom/xmldom": "^0.8.8",
+ "base64-js": "^1.5.1",
+ "xmlbuilder": "^15.1.1"
+ },
+ "engines": {
+ "node": ">=10.4.0"
+ }
+ },
+ "node_modules/xmlbuilder": {
+ "version": "15.1.1",
+ "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-15.1.1.tgz",
+ "integrity": "sha512-yMqGBqtXyeN1e3TGYvgNgDVZ3j84W4cwkOXQswghol6APgZWaff9lnbvN7MHYJOiXsvGPXtjTYJEiC9J2wv9Eg==",
+ "engines": {
+ "node": ">=8.0"
+ }
+ }
+ }
+}
diff --git a/generator/node_modules/@xmldom/xmldom/CHANGELOG.md b/generator/node_modules/@xmldom/xmldom/CHANGELOG.md
new file mode 100644
index 0000000..c100896
--- /dev/null
+++ b/generator/node_modules/@xmldom/xmldom/CHANGELOG.md
@@ -0,0 +1,459 @@
+# Changelog
+
+All notable changes to this project will be documented in this file.
+
+This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+
+## [0.8.10](https://github.com/xmldom/xmldom/compare/0.8.9...0.8.10)
+
+### Fixed
+
+- dom: prevent iteration over deleted items [`#514`](https://github.com/xmldom/xmldom/pull/514)/ [`#499`](https://github.com/xmldom/xmldom/issues/499)
+
+Thank you, [@qtow](https://github.com/qtow), for your contributions
+
+
+## [0.8.9](https://github.com/xmldom/xmldom/compare/0.8.8...0.8.9)
+
+### Fixed
+
+- Set nodeName property in ProcessingInstruction [`#509`](https://github.com/xmldom/xmldom/pull/509) / [`#505`](https://github.com/xmldom/xmldom/issues/505)
+
+Thank you, [@cjbarth](https://github.com/cjbarth), for your contributions
+
+
+## [0.8.8](https://github.com/xmldom/xmldom/compare/0.8.7...0.8.8)
+
+### Fixed
+
+- extend list of HTML entities [`#489`](https://github.com/xmldom/xmldom/pull/489)
+
+Thank you, [@zorkow](https://github.com/zorkow), for your contributions
+
+## [0.8.7](https://github.com/xmldom/xmldom/compare/0.8.6...0.8.7)
+
+### Fixed
+
+- properly parse closing where the last attribute has no value [`#485`](https://github.com/xmldom/xmldom/pull/485) / [`#486`](https://github.com/xmldom/xmldom/issues/486)
+
+Thank you, [@bulandent](https://github.com/bulandent), for your contributions
+
+
+## [0.7.10](https://github.com/xmldom/xmldom/compare/0.7.9...0.7.10)
+
+### Fixed
+
+- properly parse closing where the last attribute has no value [`#485`](https://github.com/xmldom/xmldom/pull/485) / [`#486`](https://github.com/xmldom/xmldom/issues/486)
+
+Thank you, [@bulandent](https://github.com/bulandent), for your contributions
+
+
+## [0.8.6](https://github.com/xmldom/xmldom/compare/0.8.5...0.8.6)
+
+### Fixed
+
+- Properly check nodes before replacement [`#457`](https://github.com/xmldom/xmldom/pull/457) / [`#455`](https://github.com/xmldom/xmldom/issues/455) / [`#456`](https://github.com/xmldom/xmldom/issues/456)
+
+Thank you, [@edemaine](https://github.com/edemaine), [@pedro-l9](https://github.com/pedro-l9), for your contributions
+
+
+## [0.8.5](https://github.com/xmldom/xmldom/compare/0.8.4...0.8.5)
+
+### Fixed
+
+- fix: Restore ES5 compatibility [`#452`](https://github.com/xmldom/xmldom/pull/452) / [`#453`](https://github.com/xmldom/xmldom/issues/453)
+
+Thank you, [@fengxinming](https://github.com/fengxinming), for your contributions
+
+
+## [0.8.4](https://github.com/xmldom/xmldom/compare/0.8.3...0.8.4)
+
+### Fixed
+
+- Security: Prevent inserting DOM nodes when they are not well-formed [`CVE-2022-39353`](https://github.com/xmldom/xmldom/security/advisories/GHSA-crh6-fp67-6883)
+ In case such a DOM would be created, the part that is not well-formed will be transformed into text nodes, in which xml specific characters like `<` and `>` are encoded accordingly.
+ In the upcoming version 0.9.0 those text nodes will no longer be added and an error will be thrown instead.
+ This change can break your code, if you relied on this behavior, e.g. multiple root elements in the past. We consider it more important to align with the specs that we want to be aligned with, considering the potential security issues that might derive from people not being aware of the difference in behavior.
+ Related Spec: <https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity>
+
+Thank you, [@frumioj](https://github.com/frumioj), [@cjbarth](https://github.com/cjbarth), [@markgollnick](https://github.com/markgollnick) for your contributions
+
+
+## [0.8.3](https://github.com/xmldom/xmldom/compare/0.8.3...0.8.2)
+
+### Fixed
+- Avoid iterating over prototype properties [`#437`](https://github.com/xmldom/xmldom/pull/437) / [`#436`](https://github.com/xmldom/xmldom/issues/436)
+
+Thank you, [@Supraja9726](https://github.com/Supraja9726) for your contributions
+
+
+## [0.8.2](https://github.com/xmldom/xmldom/compare/0.8.1...0.8.2)
+
+### Fixed
+- fix(dom): Serialize `&gt;` as specified (#395) [`#58`](https://github.com/xmldom/xmldom/issues/58)
+
+### Other
+- docs: Add `nodeType` values to public interface description [`#396`](https://github.com/xmldom/xmldom/pull/396)
+- test: Add executable examples for node and typescript [`#317`](https://github.com/xmldom/xmldom/pull/317)
+- fix(dom): Serialize `&gt;` as specified [`#395`](https://github.com/xmldom/xmldom/pull/395)
+- chore: Add minimal `Object.assign` ponyfill [`#379`](https://github.com/xmldom/xmldom/pull/379)
+- docs: Refine release documentation [`#378`](https://github.com/xmldom/xmldom/pull/378)
+- chore: update various dev dependencies
+
+Thank you [@niklasl](https://github.com/niklasl), [@cburatto](https://github.com/cburatto), [@SheetJSDev](https://github.com/SheetJSDev), [@pyrsmk](https://github.com/pyrsmk) for your contributions
+
+## [0.8.1](https://github.com/xmldom/xmldom/compare/0.8.0...0.8.1)
+
+### Fixes
+- Only use own properties in entityMap [`#374`](https://github.com/xmldom/xmldom/pull/374)
+
+### Docs
+- Add security policy [`#365`](https://github.com/xmldom/xmldom/pull/365)
+- changelog: Correct contributor name and link [`#366`](https://github.com/xmldom/xmldom/pull/366)
+- Describe release/publish steps [`#358`](https://github.com/xmldom/xmldom/pull/358), [`#376`](https://github.com/xmldom/xmldom/pull/376)
+- Add snyk package health badge [`#360`](https://github.com/xmldom/xmldom/pull/360)
+
+
+## [0.8.0](https://github.com/xmldom/xmldom/compare/0.7.5...0.8.0)
+
+### Fixed
+- Normalize all line endings according to XML specs [1.0](https://w3.org/TR/xml/#sec-line-ends) and [1.1](https://www.w3.org/TR/xml11/#sec-line-ends) \
+ BREAKING CHANGE: Certain combination of line break characters are normalized to a single `\n` before parsing takes place and will no longer be preserved.
+ - [`#303`](https://github.com/xmldom/xmldom/issues/303) / [`#307`](https://github.com/xmldom/xmldom/pull/307)
+ - [`#49`](https://github.com/xmldom/xmldom/issues/49), [`#97`](https://github.com/xmldom/xmldom/issues/97), [`#324`](https://github.com/xmldom/xmldom/issues/324) / [`#314`](https://github.com/xmldom/xmldom/pull/314)
+- XMLSerializer: Preserve whitespace character references [`#284`](https://github.com/xmldom/xmldom/issues/284) / [`#310`](https://github.com/xmldom/xmldom/pull/310) \
+ BREAKING CHANGE: If you relied on the not spec compliant preservation of literal `\t`, `\n` or `\r` in **attribute values**.
+ To preserve those you will have to create XML that instead contains the correct numerical (or hexadecimal) equivalent (e.g. `&#x9;`, `&#xA;`, `&#xD;`).
+- Drop deprecated exports `DOMImplementation` and `XMLSerializer` from `lib/dom-parser.js` [#53](https://github.com/xmldom/xmldom/issues/53) / [`#309`](https://github.com/xmldom/xmldom/pull/309)
+ BREAKING CHANGE: Use the one provided by the main package export.
+- dom: Remove all links as part of `removeChild` [`#343`](https://github.com/xmldom/xmldom/issues/343) / [`#355`](https://github.com/xmldom/xmldom/pull/355)
+
+### Chore
+- ci: Restore latest tested node version to 16.x [`#325`](https://github.com/xmldom/xmldom/pull/325)
+- ci: Split test and lint steps into jobs [`#111`](https://github.com/xmldom/xmldom/issues/111) / [`#304`](https://github.com/xmldom/xmldom/pull/304)
+- Pinned and updated devDependencies
+
+Thank you [@marrus-sh](https://github.com/marrus-sh), [@victorandree](https://github.com/victorandree), [@mdierolf](https://github.com/mdierolf), [@tsabbay](https://github.com/tsabbay), [@fatihpense](https://github.com/fatihpense) for your contributions
+
+## 0.7.5
+
+[Commits](https://github.com/xmldom/xmldom/compare/0.7.4...0.7.5)
+
+### Fixes:
+
+- Preserve default namespace when serializing [`#319`](https://github.com/xmldom/xmldom/issues/319) / [`#321`](https://github.com/xmldom/xmldom/pull/321)
+ Thank you, [@lupestro](https://github.com/lupestro)
+
+## 0.7.4
+
+[Commits](https://github.com/xmldom/xmldom/compare/0.7.3...0.7.4)
+
+### Fixes:
+
+- Restore ability to parse `__prototype__` attributes [`#315`](https://github.com/xmldom/xmldom/pull/315)
+ Thank you, [@dsimpsonOMF](https://github.com/dsimpsonOMF)
+
+## 0.7.3
+
+[Commits](https://github.com/xmldom/xmldom/compare/0.7.2...0.7.3)
+
+### Fixes:
+
+- Add doctype when parsing from string [`#277`](https://github.com/xmldom/xmldom/issues/277) / [`#301`](https://github.com/xmldom/xmldom/pull/301)
+- Correct typo in error message [`#294`](https://github.com/xmldom/xmldom/pull/294)
+ Thank you, [@rrthomas](https://github.com/rrthomas)
+
+### Refactor:
+
+- Improve exports & require statements, new main package entry [`#233`](https://github.com/xmldom/xmldom/pull/233)
+
+### Docs:
+
+- Fix Stryker badge [`#298`](https://github.com/xmldom/xmldom/pull/298)
+- Fix link to help-wanted issues [`#299`](https://github.com/xmldom/xmldom/pull/299)
+
+### Chore:
+
+- Execute stryker:dry-run on branches [`#302`](https://github.com/xmldom/xmldom/pull/302)
+- Fix stryker config [`#300`](https://github.com/xmldom/xmldom/pull/300)
+- Split test and lint scripts [`#297`](https://github.com/xmldom/xmldom/pull/297)
+- Switch to stryker dashboard owned by org [`#292`](https://github.com/xmldom/xmldom/pull/292)
+
+## 0.7.2
+
+[Commits](https://github.com/xmldom/xmldom/compare/0.7.1...0.7.2)
+
+### Fixes:
+
+- Types: Add index.d.ts to packaged files [`#288`](https://github.com/xmldom/xmldom/pull/288)
+ Thank you, [@forty](https://github.com/forty)
+
+## 0.7.1
+
+[Commits](https://github.com/xmldom/xmldom/compare/0.7.0...0.7.1)
+
+### Fixes:
+
+- Types: Copy types from DefinitelyTyped [`#283`](https://github.com/xmldom/xmldom/pull/283)
+ Thank you, [@kachkaev](https://github.com/kachkaev)
+
+### Chore:
+- package.json: remove author, maintainers, etc. [`#279`](https://github.com/xmldom/xmldom/pull/279)
+
+## 0.7.0
+
+[Commits](https://github.com/xmldom/xmldom/compare/0.6.0...0.7.0)
+
+Due to [`#271`](https://github.com/xmldom/xmldom/issue/271) this version was published as
+- unscoped `xmldom` package to github (git tags [`0.7.0`](https://github.com/xmldom/xmldom/tree/0.7.0) and [`0.7.0+unscoped`](https://github.com/xmldom/xmldom/tree/0.7.0%2Bunscoped))
+- scoped `@xmldom/xmldom` package to npm (git tag `0.7.0+scoped`)
+For more details look at [`#278`](https://github.com/xmldom/xmldom/pull/278#issuecomment-902172483)
+
+### Fixes:
+
+- Security: Misinterpretation of malicious XML input [`CVE-2021-32796`](https://github.com/xmldom/xmldom/security/advisories/GHSA-5fg8-2547-mr8q)
+- Implement `Document.getElementsByClassName` as specified [`#213`](https://github.com/xmldom/xmldom/pull/213), thank you, [@ChALkeR](https://github.com/ChALkeR)
+- Inherit namespace prefix from parent when required [`#268`](https://github.com/xmldom/xmldom/pull/268)
+- Handle whitespace in closing tags [`#267`](https://github.com/xmldom/xmldom/pull/267)
+- Update `DOMImplementation` according to recent specs [`#210`](https://github.com/xmldom/xmldom/pull/210)
+ BREAKING CHANGE: Only if you "passed features to be marked as available as a constructor arguments" and expected it to "magically work".
+- No longer serializes any namespaces with an empty URI [`#244`](https://github.com/xmldom/xmldom/pull/244)
+ (related to [`#168`](https://github.com/xmldom/xmldom/pull/168) released in 0.6.0)
+ BREAKING CHANGE: Only if you rely on ["unsetting" a namespace prefix](https://github.com/xmldom/xmldom/pull/168#issuecomment-886984994) by setting it to an empty string
+- Set `localName` as part of `Document.createElement` [`#229`](https://github.com/xmldom/xmldom/pull/229), thank you, [@rrthomas](https://github.com/rrthomas)
+
+### CI
+
+- We are now additionally running tests against node v16
+- Stryker tests on the master branch now run against node v14
+
+### Docs
+
+- Describe relations with and between specs: [`#211`](https://github.com/xmldom/xmldom/pull/211), [`#247`](https://github.com/xmldom/xmldom/pull/247)
+
+## 0.6.0
+
+[Commits](https://github.com/xmldom/xmldom/compare/0.5.0...0.6.0)
+
+### Fixes
+
+- Stop serializing empty namespace values like `xmlns:ds=""` [`#168`](https://github.com/xmldom/xmldom/pull/168)
+ BREAKING CHANGE: If your code expected empty namespaces attributes to be serialized.
+ Thank you, [@pdecat](https://github.com/pdecat) and [@FranckDepoortere](https://github.com/FranckDepoortere)
+- Escape `<` to `&lt;` when serializing attribute values [`#198`](https://github.com/xmldom/xmldom/issues/198) / [`#199`](https://github.com/xmldom/xmldom/pull/199)
+
+## 0.5.0
+
+[Commits](https://github.com/xmldom/xmldom/compare/0.4.0...0.5.0)
+
+### Fixes
+- Avoid misinterpretation of malicious XML input - [`GHSA-h6q6-9hqw-rwfv`](https://github.com/xmldom/xmldom/security/advisories/GHSA-h6q6-9hqw-rwfv) (CVE-2021-21366)
+ - Improve error reporting; throw on duplicate attribute\
+ BREAKING CHANGE: It is currently not clear how to consistently deal with duplicate attributes, so it's also safer for our users to fail when detecting them.
+ It's possible to configure the `DOMParser.errorHandler` before parsing, to handle those errors differently.
+
+ To accomplish this and also be able to verify it in tests I needed to
+ - create a new `Error` type `ParseError` and export it
+ - Throw `ParseError` from `errorHandler.fatalError` and prevent those from being caught in `XMLReader`.
+ - export `DOMHandler` constructor as `__DOMHandler`
+ - Preserve quotes in DOCTYPE declaration
+ Since the only purpose of parsing the DOCTYPE is to be able to restore it when serializing, we decided that it would be best to leave the parsed `publicId` and `systemId` as is, including any quotes.
+ BREAKING CHANGE: If somebody relies on the actual unquoted values of those ids, they will need to take care of either single or double quotes and the right escaping.
+ (Without this change this would not have been possible because the SAX parser already dropped the information about the quotes that have been used in the source.)
+
+ https://www.w3.org/TR/2006/REC-xml11-20060816/#dtd
+ https://www.w3.org/TR/2006/REC-xml11-20060816/#IDAX1KS (External Entity Declaration)
+
+- Fix breaking preprocessors' directives when parsing attributes [`#171`](https://github.com/xmldom/xmldom/pull/171)
+- fix(dom): Escape `]]&gt;` when serializing CharData [`#181`](https://github.com/xmldom/xmldom/pull/181)
+- Switch to (only) MIT license (drop problematic LGPL license option) [`#178`](https://github.com/xmldom/xmldom/pull/178)
+- Export DOMException; remove custom assertions; etc. [`#174`](https://github.com/xmldom/xmldom/pull/174)
+
+### Docs
+- Update MDN links in `readme.md` [`#188`](https://github.com/xmldom/xmldom/pull/188)
+
+## 0.4.0
+
+[Commits](https://github.com/xmldom/xmldom/compare/0.3.0...0.4.0)
+
+### Fixes
+- **BREAKING** Restore `&nbsp;` behavior from v0.1.27 [`#67`](https://github.com/xmldom/xmldom/pull/67)
+- **BREAKING** Typecheck source param before parsing [`#113`](https://github.com/xmldom/xmldom/pull/113)
+- Include documents in package files list [`#156`](https://github.com/xmldom/xmldom/pull/156)
+- Preserve doctype with sysid [`#144`](https://github.com/xmldom/xmldom/pull/144)
+- Remove ES6 syntax from getElementsByClassName [`#91`](https://github.com/xmldom/xmldom/pull/91)
+- Revert "Add lowercase of åäö in entityMap" due to duplicate entries [`#84`](https://github.com/xmldom/xmldom/pull/84)
+- fix: Convert all line separators to LF [`#66`](https://github.com/xmldom/xmldom/pull/66)
+
+### Docs
+- Update CHANGELOG.md through version 0.3.0 [`#63`](https://github.com/xmldom/xmldom/pull/63)
+- Update badges [`#78`](https://github.com/xmldom/xmldom/pull/78)
+- Add .editorconfig file [`#104`](https://github.com/xmldom/xmldom/pull/104)
+- Add note about import [`#79`](https://github.com/xmldom/xmldom/pull/79)
+- Modernize & improve the example in readme.md [`#81`](https://github.com/xmldom/xmldom/pull/81)
+
+### CI
+- Add Stryker Mutator [`#70`](https://github.com/xmldom/xmldom/pull/70)
+- Add Stryker action to update dashboard [`#77`](https://github.com/xmldom/xmldom/pull/77)
+- Add Node GitHub action workflow [`#64`](https://github.com/xmldom/xmldom/pull/64)
+- add & enable eslint [`#106`](https://github.com/xmldom/xmldom/pull/106)
+- Use eslint-plugin-es5 to enforce ES5 syntax [`#107`](https://github.com/xmldom/xmldom/pull/107)
+- Recover `vows` tests, drop `proof` tests [`#59`](https://github.com/xmldom/xmldom/pull/59)
+- Add jest tessuite and first tests [`#114`](https://github.com/xmldom/xmldom/pull/114)
+- Add jest testsuite with `xmltest` cases [`#112`](https://github.com/xmldom/xmldom/pull/112)
+- Configure Renovate [`#108`](https://github.com/xmldom/xmldom/pull/108)
+- Test European HTML entities [`#86`](https://github.com/xmldom/xmldom/pull/86)
+- Updated devDependencies
+
+### Other
+- Remove files that are not of any use [`#131`](https://github.com/xmldom/xmldom/pull/131), [`#65`](https://github.com/xmldom/xmldom/pull/65), [`#33`](https://github.com/xmldom/xmldom/pull/33)
+
+## 0.3.0
+
+[Commits](https://github.com/xmldom/xmldom/compare/0.2.1...0.3.0)
+
+- **BREAKING** Node >=10.x is now required.
+- **BREAKING** Remove `component.json` (deprecated package manager https://github.com/componentjs/guide)
+- **BREAKING** Move existing sources into `lib` subdirectory.
+- **POSSIBLY BREAKING** Introduce `files` entry in `package.json` and remove use of `.npmignore`.
+- [Add `Document.getElementsByClassName`](https://github.com/xmldom/xmldom/issues/24).
+- [Add `Node` to the list of exports](https://github.com/xmldom/xmldom/pull/27)
+- [Add lowercase of åäö in `entityMap`](https://github.com/xmldom/xmldom/pull/23).
+- Move CHANGELOG to markdown file.
+- Move LICENSE to markdown file.
+
+## 0.2.1
+
+[Commits](https://github.com/xmldom/xmldom/compare/0.2.0...0.2.1)
+
+- Correct `homepage`, `repository` and `bugs` URLs in `package.json`.
+
+## 0.2.0
+
+[Commits](https://github.com/xmldom/xmldom/compare/v0.1.27...0.2.0)
+
+- Includes all **BREAKING** changes introduced in [`xmldom-alpha@v0.1.28`](#0128) by the original authors.
+- **POSSIBLY BREAKING** [remove the `Object.create` check from the `_extends` method of `dom.js` that added a `__proto__` property](https://github.com/xmldom/xmldom/commit/0be2ae910a8a22c9ec2cac042e04de4c04317d2a#diff-7d1c5d97786fdf9af5446a241d0b6d56L19-L22) ().
+- **POSSIBLY BREAKING** [remove code that added a `__proto__` property](https://github.com/xmldom/xmldom/commit/366159a76a181ce9a0d83f5dc48205686cfaf9cc)
+- formatting/corrections in `package.json`
+
+## 0.1.31
+
+[Commits](https://github.com/xmldom/xmldom/compare/v0.1.27...v0.1.31)
+
+The patch versions (`v0.1.29` - `v0.1.31`) that have been released on the [v0.1.x branch](https://github.com/xmldom/xmldom/tree/0.1.x), to reflect the changed maintainers, **are branched off from [`v0.1.27`](#0127) so they don't include the breaking changes introduced in [`xmldom-alpha@v0.1.28`](#0128)**:
+
+## Maintainer changes
+
+After the last commit to the original repository <https://github.com/jindw/xmldom> on the 9th of May 2017, the first commit to <https://github.com/xmldom/xmldom> is from the 19th of December 2019. [The fork has been announced in the original repository on the 2nd of March 2020.](https://github.com/jindw/xmldom/issues/259)
+
+The versions listed below have been published to one or both of the following packages:
+- <https://www.npmjs.com/package/xmldom-alpha>
+- <https://www.npmjs.com/package/xmldom>
+
+It is currently not planned to continue publishing the `xmldom-alpha` package.
+
+The new maintainers did not invest time to understand changes that led to the last `xmldom` version [`0.1.27`](#0127) published by the original maintainer, but consider it the basis for their work.
+A timeline of all the changes that happened from that version until `0.3.0` is available in <https://github.com/xmldom/xmldom/issues/62>. Any related questions should be asked there.
+
+## 0.1.28
+
+[Commits](https://github.com/xmldom/xmldom/compare/v0.1.27...xmldom-alpha@v0.1.28)
+
+Published by @jindw on the 9th of May 2017 as
+- `xmldom-alpha@0.1.28`
+
+- **BREAKING** includes [regression regarding `&nbsp;` (issue #57)](https://github.com/xmldom/xmldom/issues/57)
+- [Fix `license` field in `package.json`](https://github.com/jindw/xmldom/pull/178)
+- [Conditional converting of HTML entities](https://github.com/jindw/xmldom/pull/80)
+- Fix `dom.js` serialization issue for missing document element ([example that failed on `toString()` before this change](https://github.com/xmldom/xmldom/blob/a58dcf7a265522e80ce520fe3be0cddb1b976f6f/test/parse/unclosedcomment.js#L10-L11))
+- Add new module `entities.js`
+
+## 0.1.27
+
+Published by @jindw on the 28th of Nov 2016 as
+- `xmldom@0.1.27`
+- `xmldom-alpha@0.1.27`
+
+- Various bug fixes.
+
+## 0.1.26
+
+Published on the 18th of Nov 2016
+as `xmldom@0.1.26`
+
+- Details unknown
+
+## 0.1.25
+
+Published on the 18th of Nov 2016 as
+- `xmldom@0.1.25`
+
+- Details unknown
+
+## 0.1.24
+
+Published on the 27th of November 2016 as
+- `xmldom@0.1.24`
+- `xmldom-alpha@0.1.24`
+
+- Added node filter.
+
+## 0.1.23
+
+Published on the 5th of May 2016 as
+- `xmldom-alpha@0.1.23`
+
+- Add namespace support for nest node serialize.
+- Various other bug fixes.
+
+## 0.1.22
+
+- Merge XMLNS serialization.
+- Remove \r from source string.
+- Print namespaces for child elements.
+- Switch references to nodeType to use named constants.
+- Add nodelist toString support.
+
+## 0.1.21
+
+- Fix serialize bug.
+
+## 0.1.20
+
+- Optimize invalid XML support.
+- Add toString sorter for attributes output.
+- Add html self closed node button.
+- Add `*` NS support for getElementsByTagNameNS.
+- Convert attribute's value to string in setAttributeNS.
+- Add support for HTML entities for HTML docs only.
+- Fix TypeError when Document is created with DocumentType.
+
+## 0.1.19
+
+- Fix [infinite loop on unclosed comment (jindw/xmldom#68)](https://github.com/jindw/xmldom/issues/68)
+- Add error report for unclosed tag.
+- Various other fixes.
+
+## 0.1.18
+
+- Add default `ns` support.
+- parseFromString now renders entirely plain text documents as textNode.
+- Enable option to ignore white space on parsing.
+
+## 0.1.17
+
+**Details missing for this and potential earlier version**
+
+## 0.1.16
+
+- Correctly handle multibyte Unicode greater than two byts. #57. #56.
+- Initial unit testing and test coverage. #53. #46. #19.
+- Create Bower `component.json` #52.
+
+## 0.1.8
+
+- Add: some test case from node-o3-xml(excludes xpath support)
+- Fix: remove existed attribute before setting (bug introduced in v0.1.5)
+- Fix: index direct access for childNodes and any NodeList collection(not w3c standard)
+- Fix: remove last child bug
diff --git a/generator/node_modules/@xmldom/xmldom/LICENSE b/generator/node_modules/@xmldom/xmldom/LICENSE
new file mode 100644
index 0000000..b95f569
--- /dev/null
+++ b/generator/node_modules/@xmldom/xmldom/LICENSE
@@ -0,0 +1,8 @@
+Copyright 2019 - present Christopher J. Brody and other contributors, as listed in: https://github.com/xmldom/xmldom/graphs/contributors
+Copyright 2012 - 2017 @jindw <jindw@xidea.org> and other contributors, as listed in: https://github.com/jindw/xmldom/graphs/contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/generator/node_modules/@xmldom/xmldom/SECURITY.md b/generator/node_modules/@xmldom/xmldom/SECURITY.md
new file mode 100644
index 0000000..ececa1d
--- /dev/null
+++ b/generator/node_modules/@xmldom/xmldom/SECURITY.md
@@ -0,0 +1,50 @@
+# Security Policy
+
+The most up-to-date version of this document can be found at <https://github.com/xmldom/xmldom/security/policy>.
+
+## Supported Versions
+
+This repository contains the code for the libraries `xmldom` and `@xmldom/xmldom` on npm.
+
+As long as we didn't publish v1, we aim to maintain the last two minor versions with security fixes. If it is possible we provide security fixes as path versions.
+If you think there is a good reason to also patch an earlier version let us know in a github issue or the release discussion once the fix has been provided.
+The maintainers will consider it and if we agree and have/find the required resources, a patch for that version will be provided.
+
+Please notice that [we are no longer able to publish the (unscoped) `xmldom` package](https://github.com/xmldom/xmldom/issues/271),
+and that all existing versions of `xmldom` are affected by at least one security vulnerability and should be considered deprecated.
+You can still report issues regarding `xmldom` as described below.
+
+If you need help with migrating from `xmldom` to `@xmldom/xmldom`, file a github issue or PR in the affected repository and mention @karfau.
+
+## Reporting vulnerabilities
+
+Please email reports about any security related issues you find to `security@xmldom.org`, which will forward it to the list of maintainers.
+The maintainers will try to respond within 7 calendar days. (If nobody peplies after 7 days, please us send a reminder!)
+As part of you communication please make sure to always hit "Reply all", so all maintainers are kept in the loop.
+
+In addition, please include the following information along with your report:
+
+- Your name and affiliation (if any).
+- A description of the technical details of the vulnerabilities. It is very important to let us know how we can reproduce your findings.
+- An explanation who can exploit this vulnerability, and what they gain when doing so -- write an attack scenario. This will help us evaluate your report quickly, especially if the issue is complex.
+- Whether this vulnerability public or known to third parties. If it is, please provide details.
+
+If you believe that an existing (public) issue is security-related, please send an email to `security@xmldom.org`.
+The email should include the issue URL and a short description of why it should be handled according to this security policy.
+
+Once an issue is reported, the maintainers use the following disclosure process:
+
+- When a report is received, we confirm the issue, determine its severity and the affected versions.
+- If we know of specific third-party services or software based on xmldom that require mitigation before publication, those projects will be notified.
+- A [github security advisory](https://docs.github.com/en/code-security/security-advisories/about-github-security-advisories) is [created](https://docs.github.com/en/code-security/security-advisories/creating-a-security-advisory) (but not published) which details the problem and steps for mitigation.
+- If the reporter provides a github account and agrees to it, we (add that github account as a collaborator on the advisuory)[https://docs.github.com/en/code-security/security-advisories/adding-a-collaborator-to-a-security-advisory].
+- The vulnerability is fixed in a [private fork](https://docs.github.com/en/code-security/security-advisories/collaborating-in-a-temporary-private-fork-to-resolve-a-security-vulnerability) and potential workarounds are identified.
+- The maintainers audit the existing code to find any potential similar problems.
+- The release for the current minor version and the [security advisory are published](https://docs.github.com/en/code-security/security-advisories/publishing-a-security-advisory).
+- The release(s) for previous minor version(s) are published.
+
+We credit reporters for identifying security issues, if they confirm that they want to.
+
+## Known vulnerabilities
+
+See https://github.com/xmldom/xmldom/security/advisories?state=published
diff --git a/generator/node_modules/@xmldom/xmldom/index.d.ts b/generator/node_modules/@xmldom/xmldom/index.d.ts
new file mode 100644
index 0000000..9e9f81b
--- /dev/null
+++ b/generator/node_modules/@xmldom/xmldom/index.d.ts
@@ -0,0 +1,43 @@
+/// <reference lib="dom" />
+
+declare module "@xmldom/xmldom" {
+ var DOMParser: DOMParserStatic;
+ var XMLSerializer: XMLSerializerStatic;
+ var DOMImplementation: DOMImplementationStatic;
+
+ interface DOMImplementationStatic {
+ new(): DOMImplementation;
+ }
+
+ interface DOMParserStatic {
+ new (): DOMParser;
+ new (options: Options): DOMParser;
+ }
+
+ interface XMLSerializerStatic {
+ new (): XMLSerializer;
+ }
+
+ interface DOMParser {
+ parseFromString(xmlsource: string, mimeType?: string): Document;
+ }
+
+ interface XMLSerializer {
+ serializeToString(node: Node): string;
+ }
+
+ interface Options {
+ locator?: any;
+ errorHandler?: ErrorHandlerFunction | ErrorHandlerObject | undefined;
+ }
+
+ interface ErrorHandlerFunction {
+ (level: string, msg: any): any;
+ }
+
+ interface ErrorHandlerObject {
+ warning?: ((msg: any) => any) | undefined;
+ error?: ((msg: any) => any) | undefined;
+ fatalError?: ((msg: any) => any) | undefined;
+ }
+}
diff --git a/generator/node_modules/@xmldom/xmldom/lib/.eslintrc.yml b/generator/node_modules/@xmldom/xmldom/lib/.eslintrc.yml
new file mode 100644
index 0000000..3eb98ab
--- /dev/null
+++ b/generator/node_modules/@xmldom/xmldom/lib/.eslintrc.yml
@@ -0,0 +1,2 @@
+extends:
+ - 'plugin:es5/no-es2015'
diff --git a/generator/node_modules/@xmldom/xmldom/lib/conventions.js b/generator/node_modules/@xmldom/xmldom/lib/conventions.js
new file mode 100644
index 0000000..953f0ef
--- /dev/null
+++ b/generator/node_modules/@xmldom/xmldom/lib/conventions.js
@@ -0,0 +1,203 @@
+'use strict'
+
+/**
+ * Ponyfill for `Array.prototype.find` which is only available in ES6 runtimes.
+ *
+ * Works with anything that has a `length` property and index access properties, including NodeList.
+ *
+ * @template {unknown} T
+ * @param {Array<T> | ({length:number, [number]: T})} list
+ * @param {function (item: T, index: number, list:Array<T> | ({length:number, [number]: T})):boolean} predicate
+ * @param {Partial<Pick<ArrayConstructor['prototype'], 'find'>>?} ac `Array.prototype` by default,
+ * allows injecting a custom implementation in tests
+ * @returns {T | undefined}
+ *
+ * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find
+ * @see https://tc39.es/ecma262/multipage/indexed-collections.html#sec-array.prototype.find
+ */
+function find(list, predicate, ac) {
+ if (ac === undefined) {
+ ac = Array.prototype;
+ }
+ if (list && typeof ac.find === 'function') {
+ return ac.find.call(list, predicate);
+ }
+ for (var i = 0; i < list.length; i++) {
+ if (Object.prototype.hasOwnProperty.call(list, i)) {
+ var item = list[i];
+ if (predicate.call(undefined, item, i, list)) {
+ return item;
+ }
+ }
+ }
+}
+
+/**
+ * "Shallow freezes" an object to render it immutable.
+ * Uses `Object.freeze` if available,
+ * otherwise the immutability is only in the type.
+ *
+ * Is used to create "enum like" objects.
+ *
+ * @template T
+ * @param {T} object the object to freeze
+ * @param {Pick<ObjectConstructor, 'freeze'> = Object} oc `Object` by default,
+ * allows to inject custom object constructor for tests
+ * @returns {Readonly<T>}
+ *
+ * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze
+ */
+function freeze(object, oc) {
+ if (oc === undefined) {
+ oc = Object
+ }
+ return oc && typeof oc.freeze === 'function' ? oc.freeze(object) : object
+}
+
+/**
+ * Since we can not rely on `Object.assign` we provide a simplified version
+ * that is sufficient for our needs.
+ *
+ * @param {Object} target
+ * @param {Object | null | undefined} source
+ *
+ * @returns {Object} target
+ * @throws TypeError if target is not an object
+ *
+ * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign
+ * @see https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.assign
+ */
+function assign(target, source) {
+ if (target === null || typeof target !== 'object') {
+ throw new TypeError('target is not an object')
+ }
+ for (var key in source) {
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
+ target[key] = source[key]
+ }
+ }
+ return target
+}
+
+/**
+ * All mime types that are allowed as input to `DOMParser.parseFromString`
+ *
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString#Argument02 MDN
+ * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#domparsersupportedtype WHATWG HTML Spec
+ * @see DOMParser.prototype.parseFromString
+ */
+var MIME_TYPE = freeze({
+ /**
+ * `text/html`, the only mime type that triggers treating an XML document as HTML.
+ *
+ * @see DOMParser.SupportedType.isHTML
+ * @see https://www.iana.org/assignments/media-types/text/html IANA MimeType registration
+ * @see https://en.wikipedia.org/wiki/HTML Wikipedia
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString MDN
+ * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-domparser-parsefromstring WHATWG HTML Spec
+ */
+ HTML: 'text/html',
+
+ /**
+ * Helper method to check a mime type if it indicates an HTML document
+ *
+ * @param {string} [value]
+ * @returns {boolean}
+ *
+ * @see https://www.iana.org/assignments/media-types/text/html IANA MimeType registration
+ * @see https://en.wikipedia.org/wiki/HTML Wikipedia
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString MDN
+ * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-domparser-parsefromstring */
+ isHTML: function (value) {
+ return value === MIME_TYPE.HTML
+ },
+
+ /**
+ * `application/xml`, the standard mime type for XML documents.
+ *
+ * @see https://www.iana.org/assignments/media-types/application/xml IANA MimeType registration
+ * @see https://tools.ietf.org/html/rfc7303#section-9.1 RFC 7303
+ * @see https://en.wikipedia.org/wiki/XML_and_MIME Wikipedia
+ */
+ XML_APPLICATION: 'application/xml',
+
+ /**
+ * `text/html`, an alias for `application/xml`.
+ *
+ * @see https://tools.ietf.org/html/rfc7303#section-9.2 RFC 7303
+ * @see https://www.iana.org/assignments/media-types/text/xml IANA MimeType registration
+ * @see https://en.wikipedia.org/wiki/XML_and_MIME Wikipedia
+ */
+ XML_TEXT: 'text/xml',
+
+ /**
+ * `application/xhtml+xml`, indicates an XML document that has the default HTML namespace,
+ * but is parsed as an XML document.
+ *
+ * @see https://www.iana.org/assignments/media-types/application/xhtml+xml IANA MimeType registration
+ * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocument WHATWG DOM Spec
+ * @see https://en.wikipedia.org/wiki/XHTML Wikipedia
+ */
+ XML_XHTML_APPLICATION: 'application/xhtml+xml',
+
+ /**
+ * `image/svg+xml`,
+ *
+ * @see https://www.iana.org/assignments/media-types/image/svg+xml IANA MimeType registration
+ * @see https://www.w3.org/TR/SVG11/ W3C SVG 1.1
+ * @see https://en.wikipedia.org/wiki/Scalable_Vector_Graphics Wikipedia
+ */
+ XML_SVG_IMAGE: 'image/svg+xml',
+})
+
+/**
+ * Namespaces that are used in this code base.
+ *
+ * @see http://www.w3.org/TR/REC-xml-names
+ */
+var NAMESPACE = freeze({
+ /**
+ * The XHTML namespace.
+ *
+ * @see http://www.w3.org/1999/xhtml
+ */
+ HTML: 'http://www.w3.org/1999/xhtml',
+
+ /**
+ * Checks if `uri` equals `NAMESPACE.HTML`.
+ *
+ * @param {string} [uri]
+ *
+ * @see NAMESPACE.HTML
+ */
+ isHTML: function (uri) {
+ return uri === NAMESPACE.HTML
+ },
+
+ /**
+ * The SVG namespace.
+ *
+ * @see http://www.w3.org/2000/svg
+ */
+ SVG: 'http://www.w3.org/2000/svg',
+
+ /**
+ * The `xml:` namespace.
+ *
+ * @see http://www.w3.org/XML/1998/namespace
+ */
+ XML: 'http://www.w3.org/XML/1998/namespace',
+
+ /**
+ * The `xmlns:` namespace
+ *
+ * @see https://www.w3.org/2000/xmlns/
+ */
+ XMLNS: 'http://www.w3.org/2000/xmlns/',
+})
+
+exports.assign = assign;
+exports.find = find;
+exports.freeze = freeze;
+exports.MIME_TYPE = MIME_TYPE;
+exports.NAMESPACE = NAMESPACE;
diff --git a/generator/node_modules/@xmldom/xmldom/lib/dom-parser.js b/generator/node_modules/@xmldom/xmldom/lib/dom-parser.js
new file mode 100644
index 0000000..94769a2
--- /dev/null
+++ b/generator/node_modules/@xmldom/xmldom/lib/dom-parser.js
@@ -0,0 +1,322 @@
+var conventions = require("./conventions");
+var dom = require('./dom')
+var entities = require('./entities');
+var sax = require('./sax');
+
+var DOMImplementation = dom.DOMImplementation;
+
+var NAMESPACE = conventions.NAMESPACE;
+
+var ParseError = sax.ParseError;
+var XMLReader = sax.XMLReader;
+
+/**
+ * Normalizes line ending according to https://www.w3.org/TR/xml11/#sec-line-ends:
+ *
+ * > XML parsed entities are often stored in computer files which,
+ * > for editing convenience, are organized into lines.
+ * > These lines are typically separated by some combination
+ * > of the characters CARRIAGE RETURN (#xD) and LINE FEED (#xA).
+ * >
+ * > To simplify the tasks of applications, the XML processor must behave
+ * > as if it normalized all line breaks in external parsed entities (including the document entity)
+ * > on input, before parsing, by translating all of the following to a single #xA character:
+ * >
+ * > 1. the two-character sequence #xD #xA
+ * > 2. the two-character sequence #xD #x85
+ * > 3. the single character #x85
+ * > 4. the single character #x2028
+ * > 5. any #xD character that is not immediately followed by #xA or #x85.
+ *
+ * @param {string} input
+ * @returns {string}
+ */
+function normalizeLineEndings(input) {
+ return input
+ .replace(/\r[\n\u0085]/g, '\n')
+ .replace(/[\r\u0085\u2028]/g, '\n')
+}
+
+/**
+ * @typedef Locator
+ * @property {number} [columnNumber]
+ * @property {number} [lineNumber]
+ */
+
+/**
+ * @typedef DOMParserOptions
+ * @property {DOMHandler} [domBuilder]
+ * @property {Function} [errorHandler]
+ * @property {(string) => string} [normalizeLineEndings] used to replace line endings before parsing
+ * defaults to `normalizeLineEndings`
+ * @property {Locator} [locator]
+ * @property {Record<string, string>} [xmlns]
+ *
+ * @see normalizeLineEndings
+ */
+
+/**
+ * The DOMParser interface provides the ability to parse XML or HTML source code
+ * from a string into a DOM `Document`.
+ *
+ * _xmldom is different from the spec in that it allows an `options` parameter,
+ * to override the default behavior._
+ *
+ * @param {DOMParserOptions} [options]
+ * @constructor
+ *
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser
+ * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-parsing-and-serialization
+ */
+function DOMParser(options){
+ this.options = options ||{locator:{}};
+}
+
+DOMParser.prototype.parseFromString = function(source,mimeType){
+ var options = this.options;
+ var sax = new XMLReader();
+ var domBuilder = options.domBuilder || new DOMHandler();//contentHandler and LexicalHandler
+ var errorHandler = options.errorHandler;
+ var locator = options.locator;
+ var defaultNSMap = options.xmlns||{};
+ var isHTML = /\/x?html?$/.test(mimeType);//mimeType.toLowerCase().indexOf('html') > -1;
+ var entityMap = isHTML ? entities.HTML_ENTITIES : entities.XML_ENTITIES;
+ if(locator){
+ domBuilder.setDocumentLocator(locator)
+ }
+
+ sax.errorHandler = buildErrorHandler(errorHandler,domBuilder,locator);
+ sax.domBuilder = options.domBuilder || domBuilder;
+ if(isHTML){
+ defaultNSMap[''] = NAMESPACE.HTML;
+ }
+ defaultNSMap.xml = defaultNSMap.xml || NAMESPACE.XML;
+ var normalize = options.normalizeLineEndings || normalizeLineEndings;
+ if (source && typeof source === 'string') {
+ sax.parse(
+ normalize(source),
+ defaultNSMap,
+ entityMap
+ )
+ } else {
+ sax.errorHandler.error('invalid doc source')
+ }
+ return domBuilder.doc;
+}
+function buildErrorHandler(errorImpl,domBuilder,locator){
+ if(!errorImpl){
+ if(domBuilder instanceof DOMHandler){
+ return domBuilder;
+ }
+ errorImpl = domBuilder ;
+ }
+ var errorHandler = {}
+ var isCallback = errorImpl instanceof Function;
+ locator = locator||{}
+ function build(key){
+ var fn = errorImpl[key];
+ if(!fn && isCallback){
+ fn = errorImpl.length == 2?function(msg){errorImpl(key,msg)}:errorImpl;
+ }
+ errorHandler[key] = fn && function(msg){
+ fn('[xmldom '+key+']\t'+msg+_locator(locator));
+ }||function(){};
+ }
+ build('warning');
+ build('error');
+ build('fatalError');
+ return errorHandler;
+}
+
+//console.log('#\n\n\n\n\n\n\n####')
+/**
+ * +ContentHandler+ErrorHandler
+ * +LexicalHandler+EntityResolver2
+ * -DeclHandler-DTDHandler
+ *
+ * DefaultHandler:EntityResolver, DTDHandler, ContentHandler, ErrorHandler
+ * DefaultHandler2:DefaultHandler,LexicalHandler, DeclHandler, EntityResolver2
+ * @link http://www.saxproject.org/apidoc/org/xml/sax/helpers/DefaultHandler.html
+ */
+function DOMHandler() {
+ this.cdata = false;
+}
+function position(locator,node){
+ node.lineNumber = locator.lineNumber;
+ node.columnNumber = locator.columnNumber;
+}
+/**
+ * @see org.xml.sax.ContentHandler#startDocument
+ * @link http://www.saxproject.org/apidoc/org/xml/sax/ContentHandler.html
+ */
+DOMHandler.prototype = {
+ startDocument : function() {
+ this.doc = new DOMImplementation().createDocument(null, null, null);
+ if (this.locator) {
+ this.doc.documentURI = this.locator.systemId;
+ }
+ },
+ startElement:function(namespaceURI, localName, qName, attrs) {
+ var doc = this.doc;
+ var el = doc.createElementNS(namespaceURI, qName||localName);
+ var len = attrs.length;
+ appendElement(this, el);
+ this.currentElement = el;
+
+ this.locator && position(this.locator,el)
+ for (var i = 0 ; i < len; i++) {
+ var namespaceURI = attrs.getURI(i);
+ var value = attrs.getValue(i);
+ var qName = attrs.getQName(i);
+ var attr = doc.createAttributeNS(namespaceURI, qName);
+ this.locator &&position(attrs.getLocator(i),attr);
+ attr.value = attr.nodeValue = value;
+ el.setAttributeNode(attr)
+ }
+ },
+ endElement:function(namespaceURI, localName, qName) {
+ var current = this.currentElement
+ var tagName = current.tagName;
+ this.currentElement = current.parentNode;
+ },
+ startPrefixMapping:function(prefix, uri) {
+ },
+ endPrefixMapping:function(prefix) {
+ },
+ processingInstruction:function(target, data) {
+ var ins = this.doc.createProcessingInstruction(target, data);
+ this.locator && position(this.locator,ins)
+ appendElement(this, ins);
+ },
+ ignorableWhitespace:function(ch, start, length) {
+ },
+ characters:function(chars, start, length) {
+ chars = _toString.apply(this,arguments)
+ //console.log(chars)
+ if(chars){
+ if (this.cdata) {
+ var charNode = this.doc.createCDATASection(chars);
+ } else {
+ var charNode = this.doc.createTextNode(chars);
+ }
+ if(this.currentElement){
+ this.currentElement.appendChild(charNode);
+ }else if(/^\s*$/.test(chars)){
+ this.doc.appendChild(charNode);
+ //process xml
+ }
+ this.locator && position(this.locator,charNode)
+ }
+ },
+ skippedEntity:function(name) {
+ },
+ endDocument:function() {
+ this.doc.normalize();
+ },
+ setDocumentLocator:function (locator) {
+ if(this.locator = locator){// && !('lineNumber' in locator)){
+ locator.lineNumber = 0;
+ }
+ },
+ //LexicalHandler
+ comment:function(chars, start, length) {
+ chars = _toString.apply(this,arguments)
+ var comm = this.doc.createComment(chars);
+ this.locator && position(this.locator,comm)
+ appendElement(this, comm);
+ },
+
+ startCDATA:function() {
+ //used in characters() methods
+ this.cdata = true;
+ },
+ endCDATA:function() {
+ this.cdata = false;
+ },
+
+ startDTD:function(name, publicId, systemId) {
+ var impl = this.doc.implementation;
+ if (impl && impl.createDocumentType) {
+ var dt = impl.createDocumentType(name, publicId, systemId);
+ this.locator && position(this.locator,dt)
+ appendElement(this, dt);
+ this.doc.doctype = dt;
+ }
+ },
+ /**
+ * @see org.xml.sax.ErrorHandler
+ * @link http://www.saxproject.org/apidoc/org/xml/sax/ErrorHandler.html
+ */
+ warning:function(error) {
+ console.warn('[xmldom warning]\t'+error,_locator(this.locator));
+ },
+ error:function(error) {
+ console.error('[xmldom error]\t'+error,_locator(this.locator));
+ },
+ fatalError:function(error) {
+ throw new ParseError(error, this.locator);
+ }
+}
+function _locator(l){
+ if(l){
+ return '\n@'+(l.systemId ||'')+'#[line:'+l.lineNumber+',col:'+l.columnNumber+']'
+ }
+}
+function _toString(chars,start,length){
+ if(typeof chars == 'string'){
+ return chars.substr(start,length)
+ }else{//java sax connect width xmldom on rhino(what about: "? && !(chars instanceof String)")
+ if(chars.length >= start+length || start){
+ return new java.lang.String(chars,start,length)+'';
+ }
+ return chars;
+ }
+}
+
+/*
+ * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/LexicalHandler.html
+ * used method of org.xml.sax.ext.LexicalHandler:
+ * #comment(chars, start, length)
+ * #startCDATA()
+ * #endCDATA()
+ * #startDTD(name, publicId, systemId)
+ *
+ *
+ * IGNORED method of org.xml.sax.ext.LexicalHandler:
+ * #endDTD()
+ * #startEntity(name)
+ * #endEntity(name)
+ *
+ *
+ * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/DeclHandler.html
+ * IGNORED method of org.xml.sax.ext.DeclHandler
+ * #attributeDecl(eName, aName, type, mode, value)
+ * #elementDecl(name, model)
+ * #externalEntityDecl(name, publicId, systemId)
+ * #internalEntityDecl(name, value)
+ * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/EntityResolver2.html
+ * IGNORED method of org.xml.sax.EntityResolver2
+ * #resolveEntity(String name,String publicId,String baseURI,String systemId)
+ * #resolveEntity(publicId, systemId)
+ * #getExternalSubset(name, baseURI)
+ * @link http://www.saxproject.org/apidoc/org/xml/sax/DTDHandler.html
+ * IGNORED method of org.xml.sax.DTDHandler
+ * #notationDecl(name, publicId, systemId) {};
+ * #unparsedEntityDecl(name, publicId, systemId, notationName) {};
+ */
+"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(key){
+ DOMHandler.prototype[key] = function(){return null}
+})
+
+/* Private static helpers treated below as private instance methods, so don't need to add these to the public API; we might use a Relator to also get rid of non-standard public properties */
+function appendElement (hander,node) {
+ if (!hander.currentElement) {
+ hander.doc.appendChild(node);
+ } else {
+ hander.currentElement.appendChild(node);
+ }
+}//appendChild and setAttributeNS are preformance key
+
+exports.__DOMHandler = DOMHandler;
+exports.normalizeLineEndings = normalizeLineEndings;
+exports.DOMParser = DOMParser;
diff --git a/generator/node_modules/@xmldom/xmldom/lib/dom.js b/generator/node_modules/@xmldom/xmldom/lib/dom.js
new file mode 100644
index 0000000..aaa745f
--- /dev/null
+++ b/generator/node_modules/@xmldom/xmldom/lib/dom.js
@@ -0,0 +1,1840 @@
+var conventions = require("./conventions");
+
+var find = conventions.find;
+var NAMESPACE = conventions.NAMESPACE;
+
+/**
+ * A prerequisite for `[].filter`, to drop elements that are empty
+ * @param {string} input
+ * @returns {boolean}
+ */
+function notEmptyString (input) {
+ return input !== ''
+}
+/**
+ * @see https://infra.spec.whatwg.org/#split-on-ascii-whitespace
+ * @see https://infra.spec.whatwg.org/#ascii-whitespace
+ *
+ * @param {string} input
+ * @returns {string[]} (can be empty)
+ */
+function splitOnASCIIWhitespace(input) {
+ // U+0009 TAB, U+000A LF, U+000C FF, U+000D CR, U+0020 SPACE
+ return input ? input.split(/[\t\n\f\r ]+/).filter(notEmptyString) : []
+}
+
+/**
+ * Adds element as a key to current if it is not already present.
+ *
+ * @param {Record<string, boolean | undefined>} current
+ * @param {string} element
+ * @returns {Record<string, boolean | undefined>}
+ */
+function orderedSetReducer (current, element) {
+ if (!current.hasOwnProperty(element)) {
+ current[element] = true;
+ }
+ return current;
+}
+
+/**
+ * @see https://infra.spec.whatwg.org/#ordered-set
+ * @param {string} input
+ * @returns {string[]}
+ */
+function toOrderedSet(input) {
+ if (!input) return [];
+ var list = splitOnASCIIWhitespace(input);
+ return Object.keys(list.reduce(orderedSetReducer, {}))
+}
+
+/**
+ * Uses `list.indexOf` to implement something like `Array.prototype.includes`,
+ * which we can not rely on being available.
+ *
+ * @param {any[]} list
+ * @returns {function(any): boolean}
+ */
+function arrayIncludes (list) {
+ return function(element) {
+ return list && list.indexOf(element) !== -1;
+ }
+}
+
+function copy(src,dest){
+ for(var p in src){
+ if (Object.prototype.hasOwnProperty.call(src, p)) {
+ dest[p] = src[p];
+ }
+ }
+}
+
+/**
+^\w+\.prototype\.([_\w]+)\s*=\s*((?:.*\{\s*?[\r\n][\s\S]*?^})|\S.*?(?=[;\r\n]));?
+^\w+\.prototype\.([_\w]+)\s*=\s*(\S.*?(?=[;\r\n]));?
+ */
+function _extends(Class,Super){
+ var pt = Class.prototype;
+ if(!(pt instanceof Super)){
+ function t(){};
+ t.prototype = Super.prototype;
+ t = new t();
+ copy(pt,t);
+ Class.prototype = pt = t;
+ }
+ if(pt.constructor != Class){
+ if(typeof Class != 'function'){
+ console.error("unknown Class:"+Class)
+ }
+ pt.constructor = Class
+ }
+}
+
+// Node Types
+var NodeType = {}
+var ELEMENT_NODE = NodeType.ELEMENT_NODE = 1;
+var ATTRIBUTE_NODE = NodeType.ATTRIBUTE_NODE = 2;
+var TEXT_NODE = NodeType.TEXT_NODE = 3;
+var CDATA_SECTION_NODE = NodeType.CDATA_SECTION_NODE = 4;
+var ENTITY_REFERENCE_NODE = NodeType.ENTITY_REFERENCE_NODE = 5;
+var ENTITY_NODE = NodeType.ENTITY_NODE = 6;
+var PROCESSING_INSTRUCTION_NODE = NodeType.PROCESSING_INSTRUCTION_NODE = 7;
+var COMMENT_NODE = NodeType.COMMENT_NODE = 8;
+var DOCUMENT_NODE = NodeType.DOCUMENT_NODE = 9;
+var DOCUMENT_TYPE_NODE = NodeType.DOCUMENT_TYPE_NODE = 10;
+var DOCUMENT_FRAGMENT_NODE = NodeType.DOCUMENT_FRAGMENT_NODE = 11;
+var NOTATION_NODE = NodeType.NOTATION_NODE = 12;
+
+// ExceptionCode
+var ExceptionCode = {}
+var ExceptionMessage = {};
+var INDEX_SIZE_ERR = ExceptionCode.INDEX_SIZE_ERR = ((ExceptionMessage[1]="Index size error"),1);
+var DOMSTRING_SIZE_ERR = ExceptionCode.DOMSTRING_SIZE_ERR = ((ExceptionMessage[2]="DOMString size error"),2);
+var HIERARCHY_REQUEST_ERR = ExceptionCode.HIERARCHY_REQUEST_ERR = ((ExceptionMessage[3]="Hierarchy request error"),3);
+var WRONG_DOCUMENT_ERR = ExceptionCode.WRONG_DOCUMENT_ERR = ((ExceptionMessage[4]="Wrong document"),4);
+var INVALID_CHARACTER_ERR = ExceptionCode.INVALID_CHARACTER_ERR = ((ExceptionMessage[5]="Invalid character"),5);
+var NO_DATA_ALLOWED_ERR = ExceptionCode.NO_DATA_ALLOWED_ERR = ((ExceptionMessage[6]="No data allowed"),6);
+var NO_MODIFICATION_ALLOWED_ERR = ExceptionCode.NO_MODIFICATION_ALLOWED_ERR = ((ExceptionMessage[7]="No modification allowed"),7);
+var NOT_FOUND_ERR = ExceptionCode.NOT_FOUND_ERR = ((ExceptionMessage[8]="Not found"),8);
+var NOT_SUPPORTED_ERR = ExceptionCode.NOT_SUPPORTED_ERR = ((ExceptionMessage[9]="Not supported"),9);
+var INUSE_ATTRIBUTE_ERR = ExceptionCode.INUSE_ATTRIBUTE_ERR = ((ExceptionMessage[10]="Attribute in use"),10);
+//level2
+var INVALID_STATE_ERR = ExceptionCode.INVALID_STATE_ERR = ((ExceptionMessage[11]="Invalid state"),11);
+var SYNTAX_ERR = ExceptionCode.SYNTAX_ERR = ((ExceptionMessage[12]="Syntax error"),12);
+var INVALID_MODIFICATION_ERR = ExceptionCode.INVALID_MODIFICATION_ERR = ((ExceptionMessage[13]="Invalid modification"),13);
+var NAMESPACE_ERR = ExceptionCode.NAMESPACE_ERR = ((ExceptionMessage[14]="Invalid namespace"),14);
+var INVALID_ACCESS_ERR = ExceptionCode.INVALID_ACCESS_ERR = ((ExceptionMessage[15]="Invalid access"),15);
+
+/**
+ * DOM Level 2
+ * Object DOMException
+ * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html
+ * @see http://www.w3.org/TR/REC-DOM-Level-1/ecma-script-language-binding.html
+ */
+function DOMException(code, message) {
+ if(message instanceof Error){
+ var error = message;
+ }else{
+ error = this;
+ Error.call(this, ExceptionMessage[code]);
+ this.message = ExceptionMessage[code];
+ if(Error.captureStackTrace) Error.captureStackTrace(this, DOMException);
+ }
+ error.code = code;
+ if(message) this.message = this.message + ": " + message;
+ return error;
+};
+DOMException.prototype = Error.prototype;
+copy(ExceptionCode,DOMException)
+
+/**
+ * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-536297177
+ * The NodeList interface provides the abstraction of an ordered collection of nodes, without defining or constraining how this collection is implemented. NodeList objects in the DOM are live.
+ * The items in the NodeList are accessible via an integral index, starting from 0.
+ */
+function NodeList() {
+};
+NodeList.prototype = {
+ /**
+ * The number of nodes in the list. The range of valid child node indices is 0 to length-1 inclusive.
+ * @standard level1
+ */
+ length:0,
+ /**
+ * Returns the indexth item in the collection. If index is greater than or equal to the number of nodes in the list, this returns null.
+ * @standard level1
+ * @param index unsigned long
+ * Index into the collection.
+ * @return Node
+ * The node at the indexth position in the NodeList, or null if that is not a valid index.
+ */
+ item: function(index) {
+ return index >= 0 && index < this.length ? this[index] : null;
+ },
+ toString:function(isHTML,nodeFilter){
+ for(var buf = [], i = 0;i<this.length;i++){
+ serializeToString(this[i],buf,isHTML,nodeFilter);
+ }
+ return buf.join('');
+ },
+ /**
+ * @private
+ * @param {function (Node):boolean} predicate
+ * @returns {Node[]}
+ */
+ filter: function (predicate) {
+ return Array.prototype.filter.call(this, predicate);
+ },
+ /**
+ * @private
+ * @param {Node} item
+ * @returns {number}
+ */
+ indexOf: function (item) {
+ return Array.prototype.indexOf.call(this, item);
+ },
+};
+
+function LiveNodeList(node,refresh){
+ this._node = node;
+ this._refresh = refresh
+ _updateLiveList(this);
+}
+function _updateLiveList(list){
+ var inc = list._node._inc || list._node.ownerDocument._inc;
+ if (list._inc !== inc) {
+ var ls = list._refresh(list._node);
+ __set__(list,'length',ls.length);
+ if (!list.$$length || ls.length < list.$$length) {
+ for (var i = ls.length; i in list; i++) {
+ if (Object.prototype.hasOwnProperty.call(list, i)) {
+ delete list[i];
+ }
+ }
+ }
+ copy(ls,list);
+ list._inc = inc;
+ }
+}
+LiveNodeList.prototype.item = function(i){
+ _updateLiveList(this);
+ return this[i] || null;
+}
+
+_extends(LiveNodeList,NodeList);
+
+/**
+ * Objects implementing the NamedNodeMap interface are used
+ * to represent collections of nodes that can be accessed by name.
+ * Note that NamedNodeMap does not inherit from NodeList;
+ * NamedNodeMaps are not maintained in any particular order.
+ * Objects contained in an object implementing NamedNodeMap may also be accessed by an ordinal index,
+ * but this is simply to allow convenient enumeration of the contents of a NamedNodeMap,
+ * and does not imply that the DOM specifies an order to these Nodes.
+ * NamedNodeMap objects in the DOM are live.
+ * used for attributes or DocumentType entities
+ */
+function NamedNodeMap() {
+};
+
+function _findNodeIndex(list,node){
+ var i = list.length;
+ while(i--){
+ if(list[i] === node){return i}
+ }
+}
+
+function _addNamedNode(el,list,newAttr,oldAttr){
+ if(oldAttr){
+ list[_findNodeIndex(list,oldAttr)] = newAttr;
+ }else{
+ list[list.length++] = newAttr;
+ }
+ if(el){
+ newAttr.ownerElement = el;
+ var doc = el.ownerDocument;
+ if(doc){
+ oldAttr && _onRemoveAttribute(doc,el,oldAttr);
+ _onAddAttribute(doc,el,newAttr);
+ }
+ }
+}
+function _removeNamedNode(el,list,attr){
+ //console.log('remove attr:'+attr)
+ var i = _findNodeIndex(list,attr);
+ if(i>=0){
+ var lastIndex = list.length-1
+ while(i<lastIndex){
+ list[i] = list[++i]
+ }
+ list.length = lastIndex;
+ if(el){
+ var doc = el.ownerDocument;
+ if(doc){
+ _onRemoveAttribute(doc,el,attr);
+ attr.ownerElement = null;
+ }
+ }
+ }else{
+ throw new DOMException(NOT_FOUND_ERR,new Error(el.tagName+'@'+attr))
+ }
+}
+NamedNodeMap.prototype = {
+ length:0,
+ item:NodeList.prototype.item,
+ getNamedItem: function(key) {
+// if(key.indexOf(':')>0 || key == 'xmlns'){
+// return null;
+// }
+ //console.log()
+ var i = this.length;
+ while(i--){
+ var attr = this[i];
+ //console.log(attr.nodeName,key)
+ if(attr.nodeName == key){
+ return attr;
+ }
+ }
+ },
+ setNamedItem: function(attr) {
+ var el = attr.ownerElement;
+ if(el && el!=this._ownerElement){
+ throw new DOMException(INUSE_ATTRIBUTE_ERR);
+ }
+ var oldAttr = this.getNamedItem(attr.nodeName);
+ _addNamedNode(this._ownerElement,this,attr,oldAttr);
+ return oldAttr;
+ },
+ /* returns Node */
+ setNamedItemNS: function(attr) {// raises: WRONG_DOCUMENT_ERR,NO_MODIFICATION_ALLOWED_ERR,INUSE_ATTRIBUTE_ERR
+ var el = attr.ownerElement, oldAttr;
+ if(el && el!=this._ownerElement){
+ throw new DOMException(INUSE_ATTRIBUTE_ERR);
+ }
+ oldAttr = this.getNamedItemNS(attr.namespaceURI,attr.localName);
+ _addNamedNode(this._ownerElement,this,attr,oldAttr);
+ return oldAttr;
+ },
+
+ /* returns Node */
+ removeNamedItem: function(key) {
+ var attr = this.getNamedItem(key);
+ _removeNamedNode(this._ownerElement,this,attr);
+ return attr;
+
+
+ },// raises: NOT_FOUND_ERR,NO_MODIFICATION_ALLOWED_ERR
+
+ //for level2
+ removeNamedItemNS:function(namespaceURI,localName){
+ var attr = this.getNamedItemNS(namespaceURI,localName);
+ _removeNamedNode(this._ownerElement,this,attr);
+ return attr;
+ },
+ getNamedItemNS: function(namespaceURI, localName) {
+ var i = this.length;
+ while(i--){
+ var node = this[i];
+ if(node.localName == localName && node.namespaceURI == namespaceURI){
+ return node;
+ }
+ }
+ return null;
+ }
+};
+
+/**
+ * The DOMImplementation interface represents an object providing methods
+ * which are not dependent on any particular document.
+ * Such an object is returned by the `Document.implementation` property.
+ *
+ * __The individual methods describe the differences compared to the specs.__
+ *
+ * @constructor
+ *
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation MDN
+ * @see https://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-102161490 DOM Level 1 Core (Initial)
+ * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-102161490 DOM Level 2 Core
+ * @see https://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-102161490 DOM Level 3 Core
+ * @see https://dom.spec.whatwg.org/#domimplementation DOM Living Standard
+ */
+function DOMImplementation() {
+}
+
+DOMImplementation.prototype = {
+ /**
+ * The DOMImplementation.hasFeature() method returns a Boolean flag indicating if a given feature is supported.
+ * The different implementations fairly diverged in what kind of features were reported.
+ * The latest version of the spec settled to force this method to always return true, where the functionality was accurate and in use.
+ *
+ * @deprecated It is deprecated and modern browsers return true in all cases.
+ *
+ * @param {string} feature
+ * @param {string} [version]
+ * @returns {boolean} always true
+ *
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/hasFeature MDN
+ * @see https://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-5CED94D7 DOM Level 1 Core
+ * @see https://dom.spec.whatwg.org/#dom-domimplementation-hasfeature DOM Living Standard
+ */
+ hasFeature: function(feature, version) {
+ return true;
+ },
+ /**
+ * Creates an XML Document object of the specified type with its document element.
+ *
+ * __It behaves slightly different from the description in the living standard__:
+ * - There is no interface/class `XMLDocument`, it returns a `Document` instance.
+ * - `contentType`, `encoding`, `mode`, `origin`, `url` fields are currently not declared.
+ * - this implementation is not validating names or qualified names
+ * (when parsing XML strings, the SAX parser takes care of that)
+ *
+ * @param {string|null} namespaceURI
+ * @param {string} qualifiedName
+ * @param {DocumentType=null} doctype
+ * @returns {Document}
+ *
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createDocument MDN
+ * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#Level-2-Core-DOM-createDocument DOM Level 2 Core (initial)
+ * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocument DOM Level 2 Core
+ *
+ * @see https://dom.spec.whatwg.org/#validate-and-extract DOM: Validate and extract
+ * @see https://www.w3.org/TR/xml/#NT-NameStartChar XML Spec: Names
+ * @see https://www.w3.org/TR/xml-names/#ns-qualnames XML Namespaces: Qualified names
+ */
+ createDocument: function(namespaceURI, qualifiedName, doctype){
+ var doc = new Document();
+ doc.implementation = this;
+ doc.childNodes = new NodeList();
+ doc.doctype = doctype || null;
+ if (doctype){
+ doc.appendChild(doctype);
+ }
+ if (qualifiedName){
+ var root = doc.createElementNS(namespaceURI, qualifiedName);
+ doc.appendChild(root);
+ }
+ return doc;
+ },
+ /**
+ * Returns a doctype, with the given `qualifiedName`, `publicId`, and `systemId`.
+ *
+ * __This behavior is slightly different from the in the specs__:
+ * - this implementation is not validating names or qualified names
+ * (when parsing XML strings, the SAX parser takes care of that)
+ *
+ * @param {string} qualifiedName
+ * @param {string} [publicId]
+ * @param {string} [systemId]
+ * @returns {DocumentType} which can either be used with `DOMImplementation.createDocument` upon document creation
+ * or can be put into the document via methods like `Node.insertBefore()` or `Node.replaceChild()`
+ *
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createDocumentType MDN
+ * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#Level-2-Core-DOM-createDocType DOM Level 2 Core
+ * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocumenttype DOM Living Standard
+ *
+ * @see https://dom.spec.whatwg.org/#validate-and-extract DOM: Validate and extract
+ * @see https://www.w3.org/TR/xml/#NT-NameStartChar XML Spec: Names
+ * @see https://www.w3.org/TR/xml-names/#ns-qualnames XML Namespaces: Qualified names
+ */
+ createDocumentType: function(qualifiedName, publicId, systemId){
+ var node = new DocumentType();
+ node.name = qualifiedName;
+ node.nodeName = qualifiedName;
+ node.publicId = publicId || '';
+ node.systemId = systemId || '';
+
+ return node;
+ }
+};
+
+
+/**
+ * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-1950641247
+ */
+
+function Node() {
+};
+
+Node.prototype = {
+ firstChild : null,
+ lastChild : null,
+ previousSibling : null,
+ nextSibling : null,
+ attributes : null,
+ parentNode : null,
+ childNodes : null,
+ ownerDocument : null,
+ nodeValue : null,
+ namespaceURI : null,
+ prefix : null,
+ localName : null,
+ // Modified in DOM Level 2:
+ insertBefore:function(newChild, refChild){//raises
+ return _insertBefore(this,newChild,refChild);
+ },
+ replaceChild:function(newChild, oldChild){//raises
+ _insertBefore(this, newChild,oldChild, assertPreReplacementValidityInDocument);
+ if(oldChild){
+ this.removeChild(oldChild);
+ }
+ },
+ removeChild:function(oldChild){
+ return _removeChild(this,oldChild);
+ },
+ appendChild:function(newChild){
+ return this.insertBefore(newChild,null);
+ },
+ hasChildNodes:function(){
+ return this.firstChild != null;
+ },
+ cloneNode:function(deep){
+ return cloneNode(this.ownerDocument||this,this,deep);
+ },
+ // Modified in DOM Level 2:
+ normalize:function(){
+ var child = this.firstChild;
+ while(child){
+ var next = child.nextSibling;
+ if(next && next.nodeType == TEXT_NODE && child.nodeType == TEXT_NODE){
+ this.removeChild(next);
+ child.appendData(next.data);
+ }else{
+ child.normalize();
+ child = next;
+ }
+ }
+ },
+ // Introduced in DOM Level 2:
+ isSupported:function(feature, version){
+ return this.ownerDocument.implementation.hasFeature(feature,version);
+ },
+ // Introduced in DOM Level 2:
+ hasAttributes:function(){
+ return this.attributes.length>0;
+ },
+ /**
+ * Look up the prefix associated to the given namespace URI, starting from this node.
+ * **The default namespace declarations are ignored by this method.**
+ * See Namespace Prefix Lookup for details on the algorithm used by this method.
+ *
+ * _Note: The implementation seems to be incomplete when compared to the algorithm described in the specs._
+ *
+ * @param {string | null} namespaceURI
+ * @returns {string | null}
+ * @see https://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-lookupNamespacePrefix
+ * @see https://www.w3.org/TR/DOM-Level-3-Core/namespaces-algorithms.html#lookupNamespacePrefixAlgo
+ * @see https://dom.spec.whatwg.org/#dom-node-lookupprefix
+ * @see https://github.com/xmldom/xmldom/issues/322
+ */
+ lookupPrefix:function(namespaceURI){
+ var el = this;
+ while(el){
+ var map = el._nsMap;
+ //console.dir(map)
+ if(map){
+ for(var n in map){
+ if (Object.prototype.hasOwnProperty.call(map, n) && map[n] === namespaceURI) {
+ return n;
+ }
+ }
+ }
+ el = el.nodeType == ATTRIBUTE_NODE?el.ownerDocument : el.parentNode;
+ }
+ return null;
+ },
+ // Introduced in DOM Level 3:
+ lookupNamespaceURI:function(prefix){
+ var el = this;
+ while(el){
+ var map = el._nsMap;
+ //console.dir(map)
+ if(map){
+ if(Object.prototype.hasOwnProperty.call(map, prefix)){
+ return map[prefix] ;
+ }
+ }
+ el = el.nodeType == ATTRIBUTE_NODE?el.ownerDocument : el.parentNode;
+ }
+ return null;
+ },
+ // Introduced in DOM Level 3:
+ isDefaultNamespace:function(namespaceURI){
+ var prefix = this.lookupPrefix(namespaceURI);
+ return prefix == null;
+ }
+};
+
+
+function _xmlEncoder(c){
+ return c == '<' && '&lt;' ||
+ c == '>' && '&gt;' ||
+ c == '&' && '&amp;' ||
+ c == '"' && '&quot;' ||
+ '&#'+c.charCodeAt()+';'
+}
+
+
+copy(NodeType,Node);
+copy(NodeType,Node.prototype);
+
+/**
+ * @param callback return true for continue,false for break
+ * @return boolean true: break visit;
+ */
+function _visitNode(node,callback){
+ if(callback(node)){
+ return true;
+ }
+ if(node = node.firstChild){
+ do{
+ if(_visitNode(node,callback)){return true}
+ }while(node=node.nextSibling)
+ }
+}
+
+
+
+function Document(){
+ this.ownerDocument = this;
+}
+
+function _onAddAttribute(doc,el,newAttr){
+ doc && doc._inc++;
+ var ns = newAttr.namespaceURI ;
+ if(ns === NAMESPACE.XMLNS){
+ //update namespace
+ el._nsMap[newAttr.prefix?newAttr.localName:''] = newAttr.value
+ }
+}
+
+function _onRemoveAttribute(doc,el,newAttr,remove){
+ doc && doc._inc++;
+ var ns = newAttr.namespaceURI ;
+ if(ns === NAMESPACE.XMLNS){
+ //update namespace
+ delete el._nsMap[newAttr.prefix?newAttr.localName:'']
+ }
+}
+
+/**
+ * Updates `el.childNodes`, updating the indexed items and it's `length`.
+ * Passing `newChild` means it will be appended.
+ * Otherwise it's assumed that an item has been removed,
+ * and `el.firstNode` and it's `.nextSibling` are used
+ * to walk the current list of child nodes.
+ *
+ * @param {Document} doc
+ * @param {Node} el
+ * @param {Node} [newChild]
+ * @private
+ */
+function _onUpdateChild (doc, el, newChild) {
+ if(doc && doc._inc){
+ doc._inc++;
+ //update childNodes
+ var cs = el.childNodes;
+ if (newChild) {
+ cs[cs.length++] = newChild;
+ } else {
+ var child = el.firstChild;
+ var i = 0;
+ while (child) {
+ cs[i++] = child;
+ child = child.nextSibling;
+ }
+ cs.length = i;
+ delete cs[cs.length];
+ }
+ }
+}
+
+/**
+ * Removes the connections between `parentNode` and `child`
+ * and any existing `child.previousSibling` or `child.nextSibling`.
+ *
+ * @see https://github.com/xmldom/xmldom/issues/135
+ * @see https://github.com/xmldom/xmldom/issues/145
+ *
+ * @param {Node} parentNode
+ * @param {Node} child
+ * @returns {Node} the child that was removed.
+ * @private
+ */
+function _removeChild (parentNode, child) {
+ var previous = child.previousSibling;
+ var next = child.nextSibling;
+ if (previous) {
+ previous.nextSibling = next;
+ } else {
+ parentNode.firstChild = next;
+ }
+ if (next) {
+ next.previousSibling = previous;
+ } else {
+ parentNode.lastChild = previous;
+ }
+ child.parentNode = null;
+ child.previousSibling = null;
+ child.nextSibling = null;
+ _onUpdateChild(parentNode.ownerDocument, parentNode);
+ return child;
+}
+
+/**
+ * Returns `true` if `node` can be a parent for insertion.
+ * @param {Node} node
+ * @returns {boolean}
+ */
+function hasValidParentNodeType(node) {
+ return (
+ node &&
+ (node.nodeType === Node.DOCUMENT_NODE || node.nodeType === Node.DOCUMENT_FRAGMENT_NODE || node.nodeType === Node.ELEMENT_NODE)
+ );
+}
+
+/**
+ * Returns `true` if `node` can be inserted according to it's `nodeType`.
+ * @param {Node} node
+ * @returns {boolean}
+ */
+function hasInsertableNodeType(node) {
+ return (
+ node &&
+ (isElementNode(node) ||
+ isTextNode(node) ||
+ isDocTypeNode(node) ||
+ node.nodeType === Node.DOCUMENT_FRAGMENT_NODE ||
+ node.nodeType === Node.COMMENT_NODE ||
+ node.nodeType === Node.PROCESSING_INSTRUCTION_NODE)
+ );
+}
+
+/**
+ * Returns true if `node` is a DOCTYPE node
+ * @param {Node} node
+ * @returns {boolean}
+ */
+function isDocTypeNode(node) {
+ return node && node.nodeType === Node.DOCUMENT_TYPE_NODE;
+}
+
+/**
+ * Returns true if the node is an element
+ * @param {Node} node
+ * @returns {boolean}
+ */
+function isElementNode(node) {
+ return node && node.nodeType === Node.ELEMENT_NODE;
+}
+/**
+ * Returns true if `node` is a text node
+ * @param {Node} node
+ * @returns {boolean}
+ */
+function isTextNode(node) {
+ return node && node.nodeType === Node.TEXT_NODE;
+}
+
+/**
+ * Check if en element node can be inserted before `child`, or at the end if child is falsy,
+ * according to the presence and position of a doctype node on the same level.
+ *
+ * @param {Document} doc The document node
+ * @param {Node} child the node that would become the nextSibling if the element would be inserted
+ * @returns {boolean} `true` if an element can be inserted before child
+ * @private
+ * https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity
+ */
+function isElementInsertionPossible(doc, child) {
+ var parentChildNodes = doc.childNodes || [];
+ if (find(parentChildNodes, isElementNode) || isDocTypeNode(child)) {
+ return false;
+ }
+ var docTypeNode = find(parentChildNodes, isDocTypeNode);
+ return !(child && docTypeNode && parentChildNodes.indexOf(docTypeNode) > parentChildNodes.indexOf(child));
+}
+
+/**
+ * Check if en element node can be inserted before `child`, or at the end if child is falsy,
+ * according to the presence and position of a doctype node on the same level.
+ *
+ * @param {Node} doc The document node
+ * @param {Node} child the node that would become the nextSibling if the element would be inserted
+ * @returns {boolean} `true` if an element can be inserted before child
+ * @private
+ * https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity
+ */
+function isElementReplacementPossible(doc, child) {
+ var parentChildNodes = doc.childNodes || [];
+
+ function hasElementChildThatIsNotChild(node) {
+ return isElementNode(node) && node !== child;
+ }
+
+ if (find(parentChildNodes, hasElementChildThatIsNotChild)) {
+ return false;
+ }
+ var docTypeNode = find(parentChildNodes, isDocTypeNode);
+ return !(child && docTypeNode && parentChildNodes.indexOf(docTypeNode) > parentChildNodes.indexOf(child));
+}
+
+/**
+ * @private
+ * Steps 1-5 of the checks before inserting and before replacing a child are the same.
+ *
+ * @param {Node} parent the parent node to insert `node` into
+ * @param {Node} node the node to insert
+ * @param {Node=} child the node that should become the `nextSibling` of `node`
+ * @returns {Node}
+ * @throws DOMException for several node combinations that would create a DOM that is not well-formed.
+ * @throws DOMException if `child` is provided but is not a child of `parent`.
+ * @see https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity
+ * @see https://dom.spec.whatwg.org/#concept-node-replace
+ */
+function assertPreInsertionValidity1to5(parent, node, child) {
+ // 1. If `parent` is not a Document, DocumentFragment, or Element node, then throw a "HierarchyRequestError" DOMException.
+ if (!hasValidParentNodeType(parent)) {
+ throw new DOMException(HIERARCHY_REQUEST_ERR, 'Unexpected parent node type ' + parent.nodeType);
+ }
+ // 2. If `node` is a host-including inclusive ancestor of `parent`, then throw a "HierarchyRequestError" DOMException.
+ // not implemented!
+ // 3. If `child` is non-null and its parent is not `parent`, then throw a "NotFoundError" DOMException.
+ if (child && child.parentNode !== parent) {
+ throw new DOMException(NOT_FOUND_ERR, 'child not in parent');
+ }
+ if (
+ // 4. If `node` is not a DocumentFragment, DocumentType, Element, or CharacterData node, then throw a "HierarchyRequestError" DOMException.
+ !hasInsertableNodeType(node) ||
+ // 5. If either `node` is a Text node and `parent` is a document,
+ // the sax parser currently adds top level text nodes, this will be fixed in 0.9.0
+ // || (node.nodeType === Node.TEXT_NODE && parent.nodeType === Node.DOCUMENT_NODE)
+ // or `node` is a doctype and `parent` is not a document, then throw a "HierarchyRequestError" DOMException.
+ (isDocTypeNode(node) && parent.nodeType !== Node.DOCUMENT_NODE)
+ ) {
+ throw new DOMException(
+ HIERARCHY_REQUEST_ERR,
+ 'Unexpected node type ' + node.nodeType + ' for parent node type ' + parent.nodeType
+ );
+ }
+}
+
+/**
+ * @private
+ * Step 6 of the checks before inserting and before replacing a child are different.
+ *
+ * @param {Document} parent the parent node to insert `node` into
+ * @param {Node} node the node to insert
+ * @param {Node | undefined} child the node that should become the `nextSibling` of `node`
+ * @returns {Node}
+ * @throws DOMException for several node combinations that would create a DOM that is not well-formed.
+ * @throws DOMException if `child` is provided but is not a child of `parent`.
+ * @see https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity
+ * @see https://dom.spec.whatwg.org/#concept-node-replace
+ */
+function assertPreInsertionValidityInDocument(parent, node, child) {
+ var parentChildNodes = parent.childNodes || [];
+ var nodeChildNodes = node.childNodes || [];
+
+ // DocumentFragment
+ if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
+ var nodeChildElements = nodeChildNodes.filter(isElementNode);
+ // If node has more than one element child or has a Text node child.
+ if (nodeChildElements.length > 1 || find(nodeChildNodes, isTextNode)) {
+ throw new DOMException(HIERARCHY_REQUEST_ERR, 'More than one element or text in fragment');
+ }
+ // Otherwise, if `node` has one element child and either `parent` has an element child,
+ // `child` is a doctype, or `child` is non-null and a doctype is following `child`.
+ if (nodeChildElements.length === 1 && !isElementInsertionPossible(parent, child)) {
+ throw new DOMException(HIERARCHY_REQUEST_ERR, 'Element in fragment can not be inserted before doctype');
+ }
+ }
+ // Element
+ if (isElementNode(node)) {
+ // `parent` has an element child, `child` is a doctype,
+ // or `child` is non-null and a doctype is following `child`.
+ if (!isElementInsertionPossible(parent, child)) {
+ throw new DOMException(HIERARCHY_REQUEST_ERR, 'Only one element can be added and only after doctype');
+ }
+ }
+ // DocumentType
+ if (isDocTypeNode(node)) {
+ // `parent` has a doctype child,
+ if (find(parentChildNodes, isDocTypeNode)) {
+ throw new DOMException(HIERARCHY_REQUEST_ERR, 'Only one doctype is allowed');
+ }
+ var parentElementChild = find(parentChildNodes, isElementNode);
+ // `child` is non-null and an element is preceding `child`,
+ if (child && parentChildNodes.indexOf(parentElementChild) < parentChildNodes.indexOf(child)) {
+ throw new DOMException(HIERARCHY_REQUEST_ERR, 'Doctype can only be inserted before an element');
+ }
+ // or `child` is null and `parent` has an element child.
+ if (!child && parentElementChild) {
+ throw new DOMException(HIERARCHY_REQUEST_ERR, 'Doctype can not be appended since element is present');
+ }
+ }
+}
+
+/**
+ * @private
+ * Step 6 of the checks before inserting and before replacing a child are different.
+ *
+ * @param {Document} parent the parent node to insert `node` into
+ * @param {Node} node the node to insert
+ * @param {Node | undefined} child the node that should become the `nextSibling` of `node`
+ * @returns {Node}
+ * @throws DOMException for several node combinations that would create a DOM that is not well-formed.
+ * @throws DOMException if `child` is provided but is not a child of `parent`.
+ * @see https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity
+ * @see https://dom.spec.whatwg.org/#concept-node-replace
+ */
+function assertPreReplacementValidityInDocument(parent, node, child) {
+ var parentChildNodes = parent.childNodes || [];
+ var nodeChildNodes = node.childNodes || [];
+
+ // DocumentFragment
+ if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
+ var nodeChildElements = nodeChildNodes.filter(isElementNode);
+ // If `node` has more than one element child or has a Text node child.
+ if (nodeChildElements.length > 1 || find(nodeChildNodes, isTextNode)) {
+ throw new DOMException(HIERARCHY_REQUEST_ERR, 'More than one element or text in fragment');
+ }
+ // Otherwise, if `node` has one element child and either `parent` has an element child that is not `child` or a doctype is following `child`.
+ if (nodeChildElements.length === 1 && !isElementReplacementPossible(parent, child)) {
+ throw new DOMException(HIERARCHY_REQUEST_ERR, 'Element in fragment can not be inserted before doctype');
+ }
+ }
+ // Element
+ if (isElementNode(node)) {
+ // `parent` has an element child that is not `child` or a doctype is following `child`.
+ if (!isElementReplacementPossible(parent, child)) {
+ throw new DOMException(HIERARCHY_REQUEST_ERR, 'Only one element can be added and only after doctype');
+ }
+ }
+ // DocumentType
+ if (isDocTypeNode(node)) {
+ function hasDoctypeChildThatIsNotChild(node) {
+ return isDocTypeNode(node) && node !== child;
+ }
+
+ // `parent` has a doctype child that is not `child`,
+ if (find(parentChildNodes, hasDoctypeChildThatIsNotChild)) {
+ throw new DOMException(HIERARCHY_REQUEST_ERR, 'Only one doctype is allowed');
+ }
+ var parentElementChild = find(parentChildNodes, isElementNode);
+ // or an element is preceding `child`.
+ if (child && parentChildNodes.indexOf(parentElementChild) < parentChildNodes.indexOf(child)) {
+ throw new DOMException(HIERARCHY_REQUEST_ERR, 'Doctype can only be inserted before an element');
+ }
+ }
+}
+
+/**
+ * @private
+ * @param {Node} parent the parent node to insert `node` into
+ * @param {Node} node the node to insert
+ * @param {Node=} child the node that should become the `nextSibling` of `node`
+ * @returns {Node}
+ * @throws DOMException for several node combinations that would create a DOM that is not well-formed.
+ * @throws DOMException if `child` is provided but is not a child of `parent`.
+ * @see https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity
+ */
+function _insertBefore(parent, node, child, _inDocumentAssertion) {
+ // To ensure pre-insertion validity of a node into a parent before a child, run these steps:
+ assertPreInsertionValidity1to5(parent, node, child);
+
+ // If parent is a document, and any of the statements below, switched on the interface node implements,
+ // are true, then throw a "HierarchyRequestError" DOMException.
+ if (parent.nodeType === Node.DOCUMENT_NODE) {
+ (_inDocumentAssertion || assertPreInsertionValidityInDocument)(parent, node, child);
+ }
+
+ var cp = node.parentNode;
+ if(cp){
+ cp.removeChild(node);//remove and update
+ }
+ if(node.nodeType === DOCUMENT_FRAGMENT_NODE){
+ var newFirst = node.firstChild;
+ if (newFirst == null) {
+ return node;
+ }
+ var newLast = node.lastChild;
+ }else{
+ newFirst = newLast = node;
+ }
+ var pre = child ? child.previousSibling : parent.lastChild;
+
+ newFirst.previousSibling = pre;
+ newLast.nextSibling = child;
+
+
+ if(pre){
+ pre.nextSibling = newFirst;
+ }else{
+ parent.firstChild = newFirst;
+ }
+ if(child == null){
+ parent.lastChild = newLast;
+ }else{
+ child.previousSibling = newLast;
+ }
+ do{
+ newFirst.parentNode = parent;
+ }while(newFirst !== newLast && (newFirst= newFirst.nextSibling))
+ _onUpdateChild(parent.ownerDocument||parent, parent);
+ //console.log(parent.lastChild.nextSibling == null)
+ if (node.nodeType == DOCUMENT_FRAGMENT_NODE) {
+ node.firstChild = node.lastChild = null;
+ }
+ return node;
+}
+
+/**
+ * Appends `newChild` to `parentNode`.
+ * If `newChild` is already connected to a `parentNode` it is first removed from it.
+ *
+ * @see https://github.com/xmldom/xmldom/issues/135
+ * @see https://github.com/xmldom/xmldom/issues/145
+ * @param {Node} parentNode
+ * @param {Node} newChild
+ * @returns {Node}
+ * @private
+ */
+function _appendSingleChild (parentNode, newChild) {
+ if (newChild.parentNode) {
+ newChild.parentNode.removeChild(newChild);
+ }
+ newChild.parentNode = parentNode;
+ newChild.previousSibling = parentNode.lastChild;
+ newChild.nextSibling = null;
+ if (newChild.previousSibling) {
+ newChild.previousSibling.nextSibling = newChild;
+ } else {
+ parentNode.firstChild = newChild;
+ }
+ parentNode.lastChild = newChild;
+ _onUpdateChild(parentNode.ownerDocument, parentNode, newChild);
+ return newChild;
+}
+
+Document.prototype = {
+ //implementation : null,
+ nodeName : '#document',
+ nodeType : DOCUMENT_NODE,
+ /**
+ * The DocumentType node of the document.
+ *
+ * @readonly
+ * @type DocumentType
+ */
+ doctype : null,
+ documentElement : null,
+ _inc : 1,
+
+ insertBefore : function(newChild, refChild){//raises
+ if(newChild.nodeType == DOCUMENT_FRAGMENT_NODE){
+ var child = newChild.firstChild;
+ while(child){
+ var next = child.nextSibling;
+ this.insertBefore(child,refChild);
+ child = next;
+ }
+ return newChild;
+ }
+ _insertBefore(this, newChild, refChild);
+ newChild.ownerDocument = this;
+ if (this.documentElement === null && newChild.nodeType === ELEMENT_NODE) {
+ this.documentElement = newChild;
+ }
+
+ return newChild;
+ },
+ removeChild : function(oldChild){
+ if(this.documentElement == oldChild){
+ this.documentElement = null;
+ }
+ return _removeChild(this,oldChild);
+ },
+ replaceChild: function (newChild, oldChild) {
+ //raises
+ _insertBefore(this, newChild, oldChild, assertPreReplacementValidityInDocument);
+ newChild.ownerDocument = this;
+ if (oldChild) {
+ this.removeChild(oldChild);
+ }
+ if (isElementNode(newChild)) {
+ this.documentElement = newChild;
+ }
+ },
+ // Introduced in DOM Level 2:
+ importNode : function(importedNode,deep){
+ return importNode(this,importedNode,deep);
+ },
+ // Introduced in DOM Level 2:
+ getElementById : function(id){
+ var rtv = null;
+ _visitNode(this.documentElement,function(node){
+ if(node.nodeType == ELEMENT_NODE){
+ if(node.getAttribute('id') == id){
+ rtv = node;
+ return true;
+ }
+ }
+ })
+ return rtv;
+ },
+
+ /**
+ * The `getElementsByClassName` method of `Document` interface returns an array-like object
+ * of all child elements which have **all** of the given class name(s).
+ *
+ * Returns an empty list if `classeNames` is an empty string or only contains HTML white space characters.
+ *
+ *
+ * Warning: This is a live LiveNodeList.
+ * Changes in the DOM will reflect in the array as the changes occur.
+ * If an element selected by this array no longer qualifies for the selector,
+ * it will automatically be removed. Be aware of this for iteration purposes.
+ *
+ * @param {string} classNames is a string representing the class name(s) to match; multiple class names are separated by (ASCII-)whitespace
+ *
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementsByClassName
+ * @see https://dom.spec.whatwg.org/#concept-getelementsbyclassname
+ */
+ getElementsByClassName: function(classNames) {
+ var classNamesSet = toOrderedSet(classNames)
+ return new LiveNodeList(this, function(base) {
+ var ls = [];
+ if (classNamesSet.length > 0) {
+ _visitNode(base.documentElement, function(node) {
+ if(node !== base && node.nodeType === ELEMENT_NODE) {
+ var nodeClassNames = node.getAttribute('class')
+ // can be null if the attribute does not exist
+ if (nodeClassNames) {
+ // before splitting and iterating just compare them for the most common case
+ var matches = classNames === nodeClassNames;
+ if (!matches) {
+ var nodeClassNamesSet = toOrderedSet(nodeClassNames)
+ matches = classNamesSet.every(arrayIncludes(nodeClassNamesSet))
+ }
+ if(matches) {
+ ls.push(node);
+ }
+ }
+ }
+ });
+ }
+ return ls;
+ });
+ },
+
+ //document factory method:
+ createElement : function(tagName){
+ var node = new Element();
+ node.ownerDocument = this;
+ node.nodeName = tagName;
+ node.tagName = tagName;
+ node.localName = tagName;
+ node.childNodes = new NodeList();
+ var attrs = node.attributes = new NamedNodeMap();
+ attrs._ownerElement = node;
+ return node;
+ },
+ createDocumentFragment : function(){
+ var node = new DocumentFragment();
+ node.ownerDocument = this;
+ node.childNodes = new NodeList();
+ return node;
+ },
+ createTextNode : function(data){
+ var node = new Text();
+ node.ownerDocument = this;
+ node.appendData(data)
+ return node;
+ },
+ createComment : function(data){
+ var node = new Comment();
+ node.ownerDocument = this;
+ node.appendData(data)
+ return node;
+ },
+ createCDATASection : function(data){
+ var node = new CDATASection();
+ node.ownerDocument = this;
+ node.appendData(data)
+ return node;
+ },
+ createProcessingInstruction : function(target,data){
+ var node = new ProcessingInstruction();
+ node.ownerDocument = this;
+ node.tagName = node.nodeName = node.target = target;
+ node.nodeValue = node.data = data;
+ return node;
+ },
+ createAttribute : function(name){
+ var node = new Attr();
+ node.ownerDocument = this;
+ node.name = name;
+ node.nodeName = name;
+ node.localName = name;
+ node.specified = true;
+ return node;
+ },
+ createEntityReference : function(name){
+ var node = new EntityReference();
+ node.ownerDocument = this;
+ node.nodeName = name;
+ return node;
+ },
+ // Introduced in DOM Level 2:
+ createElementNS : function(namespaceURI,qualifiedName){
+ var node = new Element();
+ var pl = qualifiedName.split(':');
+ var attrs = node.attributes = new NamedNodeMap();
+ node.childNodes = new NodeList();
+ node.ownerDocument = this;
+ node.nodeName = qualifiedName;
+ node.tagName = qualifiedName;
+ node.namespaceURI = namespaceURI;
+ if(pl.length == 2){
+ node.prefix = pl[0];
+ node.localName = pl[1];
+ }else{
+ //el.prefix = null;
+ node.localName = qualifiedName;
+ }
+ attrs._ownerElement = node;
+ return node;
+ },
+ // Introduced in DOM Level 2:
+ createAttributeNS : function(namespaceURI,qualifiedName){
+ var node = new Attr();
+ var pl = qualifiedName.split(':');
+ node.ownerDocument = this;
+ node.nodeName = qualifiedName;
+ node.name = qualifiedName;
+ node.namespaceURI = namespaceURI;
+ node.specified = true;
+ if(pl.length == 2){
+ node.prefix = pl[0];
+ node.localName = pl[1];
+ }else{
+ //el.prefix = null;
+ node.localName = qualifiedName;
+ }
+ return node;
+ }
+};
+_extends(Document,Node);
+
+
+function Element() {
+ this._nsMap = {};
+};
+Element.prototype = {
+ nodeType : ELEMENT_NODE,
+ hasAttribute : function(name){
+ return this.getAttributeNode(name)!=null;
+ },
+ getAttribute : function(name){
+ var attr = this.getAttributeNode(name);
+ return attr && attr.value || '';
+ },
+ getAttributeNode : function(name){
+ return this.attributes.getNamedItem(name);
+ },
+ setAttribute : function(name, value){
+ var attr = this.ownerDocument.createAttribute(name);
+ attr.value = attr.nodeValue = "" + value;
+ this.setAttributeNode(attr)
+ },
+ removeAttribute : function(name){
+ var attr = this.getAttributeNode(name)
+ attr && this.removeAttributeNode(attr);
+ },
+
+ //four real opeartion method
+ appendChild:function(newChild){
+ if(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){
+ return this.insertBefore(newChild,null);
+ }else{
+ return _appendSingleChild(this,newChild);
+ }
+ },
+ setAttributeNode : function(newAttr){
+ return this.attributes.setNamedItem(newAttr);
+ },
+ setAttributeNodeNS : function(newAttr){
+ return this.attributes.setNamedItemNS(newAttr);
+ },
+ removeAttributeNode : function(oldAttr){
+ //console.log(this == oldAttr.ownerElement)
+ return this.attributes.removeNamedItem(oldAttr.nodeName);
+ },
+ //get real attribute name,and remove it by removeAttributeNode
+ removeAttributeNS : function(namespaceURI, localName){
+ var old = this.getAttributeNodeNS(namespaceURI, localName);
+ old && this.removeAttributeNode(old);
+ },
+
+ hasAttributeNS : function(namespaceURI, localName){
+ return this.getAttributeNodeNS(namespaceURI, localName)!=null;
+ },
+ getAttributeNS : function(namespaceURI, localName){
+ var attr = this.getAttributeNodeNS(namespaceURI, localName);
+ return attr && attr.value || '';
+ },
+ setAttributeNS : function(namespaceURI, qualifiedName, value){
+ var attr = this.ownerDocument.createAttributeNS(namespaceURI, qualifiedName);
+ attr.value = attr.nodeValue = "" + value;
+ this.setAttributeNode(attr)
+ },
+ getAttributeNodeNS : function(namespaceURI, localName){
+ return this.attributes.getNamedItemNS(namespaceURI, localName);
+ },
+
+ getElementsByTagName : function(tagName){
+ return new LiveNodeList(this,function(base){
+ var ls = [];
+ _visitNode(base,function(node){
+ if(node !== base && node.nodeType == ELEMENT_NODE && (tagName === '*' || node.tagName == tagName)){
+ ls.push(node);
+ }
+ });
+ return ls;
+ });
+ },
+ getElementsByTagNameNS : function(namespaceURI, localName){
+ return new LiveNodeList(this,function(base){
+ var ls = [];
+ _visitNode(base,function(node){
+ if(node !== base && node.nodeType === ELEMENT_NODE && (namespaceURI === '*' || node.namespaceURI === namespaceURI) && (localName === '*' || node.localName == localName)){
+ ls.push(node);
+ }
+ });
+ return ls;
+
+ });
+ }
+};
+Document.prototype.getElementsByTagName = Element.prototype.getElementsByTagName;
+Document.prototype.getElementsByTagNameNS = Element.prototype.getElementsByTagNameNS;
+
+
+_extends(Element,Node);
+function Attr() {
+};
+Attr.prototype.nodeType = ATTRIBUTE_NODE;
+_extends(Attr,Node);
+
+
+function CharacterData() {
+};
+CharacterData.prototype = {
+ data : '',
+ substringData : function(offset, count) {
+ return this.data.substring(offset, offset+count);
+ },
+ appendData: function(text) {
+ text = this.data+text;
+ this.nodeValue = this.data = text;
+ this.length = text.length;
+ },
+ insertData: function(offset,text) {
+ this.replaceData(offset,0,text);
+
+ },
+ appendChild:function(newChild){
+ throw new Error(ExceptionMessage[HIERARCHY_REQUEST_ERR])
+ },
+ deleteData: function(offset, count) {
+ this.replaceData(offset,count,"");
+ },
+ replaceData: function(offset, count, text) {
+ var start = this.data.substring(0,offset);
+ var end = this.data.substring(offset+count);
+ text = start + text + end;
+ this.nodeValue = this.data = text;
+ this.length = text.length;
+ }
+}
+_extends(CharacterData,Node);
+function Text() {
+};
+Text.prototype = {
+ nodeName : "#text",
+ nodeType : TEXT_NODE,
+ splitText : function(offset) {
+ var text = this.data;
+ var newText = text.substring(offset);
+ text = text.substring(0, offset);
+ this.data = this.nodeValue = text;
+ this.length = text.length;
+ var newNode = this.ownerDocument.createTextNode(newText);
+ if(this.parentNode){
+ this.parentNode.insertBefore(newNode, this.nextSibling);
+ }
+ return newNode;
+ }
+}
+_extends(Text,CharacterData);
+function Comment() {
+};
+Comment.prototype = {
+ nodeName : "#comment",
+ nodeType : COMMENT_NODE
+}
+_extends(Comment,CharacterData);
+
+function CDATASection() {
+};
+CDATASection.prototype = {
+ nodeName : "#cdata-section",
+ nodeType : CDATA_SECTION_NODE
+}
+_extends(CDATASection,CharacterData);
+
+
+function DocumentType() {
+};
+DocumentType.prototype.nodeType = DOCUMENT_TYPE_NODE;
+_extends(DocumentType,Node);
+
+function Notation() {
+};
+Notation.prototype.nodeType = NOTATION_NODE;
+_extends(Notation,Node);
+
+function Entity() {
+};
+Entity.prototype.nodeType = ENTITY_NODE;
+_extends(Entity,Node);
+
+function EntityReference() {
+};
+EntityReference.prototype.nodeType = ENTITY_REFERENCE_NODE;
+_extends(EntityReference,Node);
+
+function DocumentFragment() {
+};
+DocumentFragment.prototype.nodeName = "#document-fragment";
+DocumentFragment.prototype.nodeType = DOCUMENT_FRAGMENT_NODE;
+_extends(DocumentFragment,Node);
+
+
+function ProcessingInstruction() {
+}
+ProcessingInstruction.prototype.nodeType = PROCESSING_INSTRUCTION_NODE;
+_extends(ProcessingInstruction,Node);
+function XMLSerializer(){}
+XMLSerializer.prototype.serializeToString = function(node,isHtml,nodeFilter){
+ return nodeSerializeToString.call(node,isHtml,nodeFilter);
+}
+Node.prototype.toString = nodeSerializeToString;
+function nodeSerializeToString(isHtml,nodeFilter){
+ var buf = [];
+ var refNode = this.nodeType == 9 && this.documentElement || this;
+ var prefix = refNode.prefix;
+ var uri = refNode.namespaceURI;
+
+ if(uri && prefix == null){
+ //console.log(prefix)
+ var prefix = refNode.lookupPrefix(uri);
+ if(prefix == null){
+ //isHTML = true;
+ var visibleNamespaces=[
+ {namespace:uri,prefix:null}
+ //{namespace:uri,prefix:''}
+ ]
+ }
+ }
+ serializeToString(this,buf,isHtml,nodeFilter,visibleNamespaces);
+ //console.log('###',this.nodeType,uri,prefix,buf.join(''))
+ return buf.join('');
+}
+
+function needNamespaceDefine(node, isHTML, visibleNamespaces) {
+ var prefix = node.prefix || '';
+ var uri = node.namespaceURI;
+ // According to [Namespaces in XML 1.0](https://www.w3.org/TR/REC-xml-names/#ns-using) ,
+ // and more specifically https://www.w3.org/TR/REC-xml-names/#nsc-NoPrefixUndecl :
+ // > In a namespace declaration for a prefix [...], the attribute value MUST NOT be empty.
+ // in a similar manner [Namespaces in XML 1.1](https://www.w3.org/TR/xml-names11/#ns-using)
+ // and more specifically https://www.w3.org/TR/xml-names11/#nsc-NSDeclared :
+ // > [...] Furthermore, the attribute value [...] must not be an empty string.
+ // so serializing empty namespace value like xmlns:ds="" would produce an invalid XML document.
+ if (!uri) {
+ return false;
+ }
+ if (prefix === "xml" && uri === NAMESPACE.XML || uri === NAMESPACE.XMLNS) {
+ return false;
+ }
+
+ var i = visibleNamespaces.length
+ while (i--) {
+ var ns = visibleNamespaces[i];
+ // get namespace prefix
+ if (ns.prefix === prefix) {
+ return ns.namespace !== uri;
+ }
+ }
+ return true;
+}
+/**
+ * Well-formed constraint: No < in Attribute Values
+ * > The replacement text of any entity referred to directly or indirectly
+ * > in an attribute value must not contain a <.
+ * @see https://www.w3.org/TR/xml11/#CleanAttrVals
+ * @see https://www.w3.org/TR/xml11/#NT-AttValue
+ *
+ * Literal whitespace other than space that appear in attribute values
+ * are serialized as their entity references, so they will be preserved.
+ * (In contrast to whitespace literals in the input which are normalized to spaces)
+ * @see https://www.w3.org/TR/xml11/#AVNormalize
+ * @see https://w3c.github.io/DOM-Parsing/#serializing-an-element-s-attributes
+ */
+function addSerializedAttribute(buf, qualifiedName, value) {
+ buf.push(' ', qualifiedName, '="', value.replace(/[<>&"\t\n\r]/g, _xmlEncoder), '"')
+}
+
+function serializeToString(node,buf,isHTML,nodeFilter,visibleNamespaces){
+ if (!visibleNamespaces) {
+ visibleNamespaces = [];
+ }
+
+ if(nodeFilter){
+ node = nodeFilter(node);
+ if(node){
+ if(typeof node == 'string'){
+ buf.push(node);
+ return;
+ }
+ }else{
+ return;
+ }
+ //buf.sort.apply(attrs, attributeSorter);
+ }
+
+ switch(node.nodeType){
+ case ELEMENT_NODE:
+ var attrs = node.attributes;
+ var len = attrs.length;
+ var child = node.firstChild;
+ var nodeName = node.tagName;
+
+ isHTML = NAMESPACE.isHTML(node.namespaceURI) || isHTML
+
+ var prefixedNodeName = nodeName
+ if (!isHTML && !node.prefix && node.namespaceURI) {
+ var defaultNS
+ // lookup current default ns from `xmlns` attribute
+ for (var ai = 0; ai < attrs.length; ai++) {
+ if (attrs.item(ai).name === 'xmlns') {
+ defaultNS = attrs.item(ai).value
+ break
+ }
+ }
+ if (!defaultNS) {
+ // lookup current default ns in visibleNamespaces
+ for (var nsi = visibleNamespaces.length - 1; nsi >= 0; nsi--) {
+ var namespace = visibleNamespaces[nsi]
+ if (namespace.prefix === '' && namespace.namespace === node.namespaceURI) {
+ defaultNS = namespace.namespace
+ break
+ }
+ }
+ }
+ if (defaultNS !== node.namespaceURI) {
+ for (var nsi = visibleNamespaces.length - 1; nsi >= 0; nsi--) {
+ var namespace = visibleNamespaces[nsi]
+ if (namespace.namespace === node.namespaceURI) {
+ if (namespace.prefix) {
+ prefixedNodeName = namespace.prefix + ':' + nodeName
+ }
+ break
+ }
+ }
+ }
+ }
+
+ buf.push('<', prefixedNodeName);
+
+ for(var i=0;i<len;i++){
+ // add namespaces for attributes
+ var attr = attrs.item(i);
+ if (attr.prefix == 'xmlns') {
+ visibleNamespaces.push({ prefix: attr.localName, namespace: attr.value });
+ }else if(attr.nodeName == 'xmlns'){
+ visibleNamespaces.push({ prefix: '', namespace: attr.value });
+ }
+ }
+
+ for(var i=0;i<len;i++){
+ var attr = attrs.item(i);
+ if (needNamespaceDefine(attr,isHTML, visibleNamespaces)) {
+ var prefix = attr.prefix||'';
+ var uri = attr.namespaceURI;
+ addSerializedAttribute(buf, prefix ? 'xmlns:' + prefix : "xmlns", uri);
+ visibleNamespaces.push({ prefix: prefix, namespace:uri });
+ }
+ serializeToString(attr,buf,isHTML,nodeFilter,visibleNamespaces);
+ }
+
+ // add namespace for current node
+ if (nodeName === prefixedNodeName && needNamespaceDefine(node, isHTML, visibleNamespaces)) {
+ var prefix = node.prefix||'';
+ var uri = node.namespaceURI;
+ addSerializedAttribute(buf, prefix ? 'xmlns:' + prefix : "xmlns", uri);
+ visibleNamespaces.push({ prefix: prefix, namespace:uri });
+ }
+
+ if(child || isHTML && !/^(?:meta|link|img|br|hr|input)$/i.test(nodeName)){
+ buf.push('>');
+ //if is cdata child node
+ if(isHTML && /^script$/i.test(nodeName)){
+ while(child){
+ if(child.data){
+ buf.push(child.data);
+ }else{
+ serializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());
+ }
+ child = child.nextSibling;
+ }
+ }else
+ {
+ while(child){
+ serializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());
+ child = child.nextSibling;
+ }
+ }
+ buf.push('</',prefixedNodeName,'>');
+ }else{
+ buf.push('/>');
+ }
+ // remove added visible namespaces
+ //visibleNamespaces.length = startVisibleNamespaces;
+ return;
+ case DOCUMENT_NODE:
+ case DOCUMENT_FRAGMENT_NODE:
+ var child = node.firstChild;
+ while(child){
+ serializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());
+ child = child.nextSibling;
+ }
+ return;
+ case ATTRIBUTE_NODE:
+ return addSerializedAttribute(buf, node.name, node.value);
+ case TEXT_NODE:
+ /**
+ * The ampersand character (&) and the left angle bracket (<) must not appear in their literal form,
+ * except when used as markup delimiters, or within a comment, a processing instruction, or a CDATA section.
+ * If they are needed elsewhere, they must be escaped using either numeric character references or the strings
+ * `&amp;` and `&lt;` respectively.
+ * The right angle bracket (>) may be represented using the string " &gt; ", and must, for compatibility,
+ * be escaped using either `&gt;` or a character reference when it appears in the string `]]>` in content,
+ * when that string is not marking the end of a CDATA section.
+ *
+ * In the content of elements, character data is any string of characters
+ * which does not contain the start-delimiter of any markup
+ * and does not include the CDATA-section-close delimiter, `]]>`.
+ *
+ * @see https://www.w3.org/TR/xml/#NT-CharData
+ * @see https://w3c.github.io/DOM-Parsing/#xml-serializing-a-text-node
+ */
+ return buf.push(node.data
+ .replace(/[<&>]/g,_xmlEncoder)
+ );
+ case CDATA_SECTION_NODE:
+ return buf.push( '<![CDATA[',node.data,']]>');
+ case COMMENT_NODE:
+ return buf.push( "<!--",node.data,"-->");
+ case DOCUMENT_TYPE_NODE:
+ var pubid = node.publicId;
+ var sysid = node.systemId;
+ buf.push('<!DOCTYPE ',node.name);
+ if(pubid){
+ buf.push(' PUBLIC ', pubid);
+ if (sysid && sysid!='.') {
+ buf.push(' ', sysid);
+ }
+ buf.push('>');
+ }else if(sysid && sysid!='.'){
+ buf.push(' SYSTEM ', sysid, '>');
+ }else{
+ var sub = node.internalSubset;
+ if(sub){
+ buf.push(" [",sub,"]");
+ }
+ buf.push(">");
+ }
+ return;
+ case PROCESSING_INSTRUCTION_NODE:
+ return buf.push( "<?",node.target," ",node.data,"?>");
+ case ENTITY_REFERENCE_NODE:
+ return buf.push( '&',node.nodeName,';');
+ //case ENTITY_NODE:
+ //case NOTATION_NODE:
+ default:
+ buf.push('??',node.nodeName);
+ }
+}
+function importNode(doc,node,deep){
+ var node2;
+ switch (node.nodeType) {
+ case ELEMENT_NODE:
+ node2 = node.cloneNode(false);
+ node2.ownerDocument = doc;
+ //var attrs = node2.attributes;
+ //var len = attrs.length;
+ //for(var i=0;i<len;i++){
+ //node2.setAttributeNodeNS(importNode(doc,attrs.item(i),deep));
+ //}
+ case DOCUMENT_FRAGMENT_NODE:
+ break;
+ case ATTRIBUTE_NODE:
+ deep = true;
+ break;
+ //case ENTITY_REFERENCE_NODE:
+ //case PROCESSING_INSTRUCTION_NODE:
+ ////case TEXT_NODE:
+ //case CDATA_SECTION_NODE:
+ //case COMMENT_NODE:
+ // deep = false;
+ // break;
+ //case DOCUMENT_NODE:
+ //case DOCUMENT_TYPE_NODE:
+ //cannot be imported.
+ //case ENTITY_NODE:
+ //case NOTATION_NODE:
+ //can not hit in level3
+ //default:throw e;
+ }
+ if(!node2){
+ node2 = node.cloneNode(false);//false
+ }
+ node2.ownerDocument = doc;
+ node2.parentNode = null;
+ if(deep){
+ var child = node.firstChild;
+ while(child){
+ node2.appendChild(importNode(doc,child,deep));
+ child = child.nextSibling;
+ }
+ }
+ return node2;
+}
+//
+//var _relationMap = {firstChild:1,lastChild:1,previousSibling:1,nextSibling:1,
+// attributes:1,childNodes:1,parentNode:1,documentElement:1,doctype,};
+function cloneNode(doc,node,deep){
+ var node2 = new node.constructor();
+ for (var n in node) {
+ if (Object.prototype.hasOwnProperty.call(node, n)) {
+ var v = node[n];
+ if (typeof v != "object") {
+ if (v != node2[n]) {
+ node2[n] = v;
+ }
+ }
+ }
+ }
+ if(node.childNodes){
+ node2.childNodes = new NodeList();
+ }
+ node2.ownerDocument = doc;
+ switch (node2.nodeType) {
+ case ELEMENT_NODE:
+ var attrs = node.attributes;
+ var attrs2 = node2.attributes = new NamedNodeMap();
+ var len = attrs.length
+ attrs2._ownerElement = node2;
+ for(var i=0;i<len;i++){
+ node2.setAttributeNode(cloneNode(doc,attrs.item(i),true));
+ }
+ break;;
+ case ATTRIBUTE_NODE:
+ deep = true;
+ }
+ if(deep){
+ var child = node.firstChild;
+ while(child){
+ node2.appendChild(cloneNode(doc,child,deep));
+ child = child.nextSibling;
+ }
+ }
+ return node2;
+}
+
+function __set__(object,key,value){
+ object[key] = value
+}
+//do dynamic
+try{
+ if(Object.defineProperty){
+ Object.defineProperty(LiveNodeList.prototype,'length',{
+ get:function(){
+ _updateLiveList(this);
+ return this.$$length;
+ }
+ });
+
+ Object.defineProperty(Node.prototype,'textContent',{
+ get:function(){
+ return getTextContent(this);
+ },
+
+ set:function(data){
+ switch(this.nodeType){
+ case ELEMENT_NODE:
+ case DOCUMENT_FRAGMENT_NODE:
+ while(this.firstChild){
+ this.removeChild(this.firstChild);
+ }
+ if(data || String(data)){
+ this.appendChild(this.ownerDocument.createTextNode(data));
+ }
+ break;
+
+ default:
+ this.data = data;
+ this.value = data;
+ this.nodeValue = data;
+ }
+ }
+ })
+
+ function getTextContent(node){
+ switch(node.nodeType){
+ case ELEMENT_NODE:
+ case DOCUMENT_FRAGMENT_NODE:
+ var buf = [];
+ node = node.firstChild;
+ while(node){
+ if(node.nodeType!==7 && node.nodeType !==8){
+ buf.push(getTextContent(node));
+ }
+ node = node.nextSibling;
+ }
+ return buf.join('');
+ default:
+ return node.nodeValue;
+ }
+ }
+
+ __set__ = function(object,key,value){
+ //console.log(value)
+ object['$$'+key] = value
+ }
+ }
+}catch(e){//ie8
+}
+
+//if(typeof require == 'function'){
+ exports.DocumentType = DocumentType;
+ exports.DOMException = DOMException;
+ exports.DOMImplementation = DOMImplementation;
+ exports.Element = Element;
+ exports.Node = Node;
+ exports.NodeList = NodeList;
+ exports.XMLSerializer = XMLSerializer;
+//}
diff --git a/generator/node_modules/@xmldom/xmldom/lib/entities.js b/generator/node_modules/@xmldom/xmldom/lib/entities.js
new file mode 100644
index 0000000..6da8724
--- /dev/null
+++ b/generator/node_modules/@xmldom/xmldom/lib/entities.js
@@ -0,0 +1,2166 @@
+'use strict';
+
+var freeze = require('./conventions').freeze;
+
+/**
+ * The entities that are predefined in every XML document.
+ *
+ * @see https://www.w3.org/TR/2006/REC-xml11-20060816/#sec-predefined-ent W3C XML 1.1
+ * @see https://www.w3.org/TR/2008/REC-xml-20081126/#sec-predefined-ent W3C XML 1.0
+ * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Predefined_entities_in_XML Wikipedia
+ */
+exports.XML_ENTITIES = freeze({
+ amp: '&',
+ apos: "'",
+ gt: '>',
+ lt: '<',
+ quot: '"',
+});
+
+/**
+ * A map of all entities that are detected in an HTML document.
+ * They contain all entries from `XML_ENTITIES`.
+ *
+ * @see XML_ENTITIES
+ * @see DOMParser.parseFromString
+ * @see DOMImplementation.prototype.createHTMLDocument
+ * @see https://html.spec.whatwg.org/#named-character-references WHATWG HTML(5) Spec
+ * @see https://html.spec.whatwg.org/entities.json JSON
+ * @see https://www.w3.org/TR/xml-entity-names/ W3C XML Entity Names
+ * @see https://www.w3.org/TR/html4/sgml/entities.html W3C HTML4/SGML
+ * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Character_entity_references_in_HTML Wikipedia (HTML)
+ * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Entities_representing_special_characters_in_XHTML Wikpedia (XHTML)
+ */
+exports.HTML_ENTITIES = freeze({
+ Aacute: '\u00C1',
+ aacute: '\u00E1',
+ Abreve: '\u0102',
+ abreve: '\u0103',
+ ac: '\u223E',
+ acd: '\u223F',
+ acE: '\u223E\u0333',
+ Acirc: '\u00C2',
+ acirc: '\u00E2',
+ acute: '\u00B4',
+ Acy: '\u0410',
+ acy: '\u0430',
+ AElig: '\u00C6',
+ aelig: '\u00E6',
+ af: '\u2061',
+ Afr: '\uD835\uDD04',
+ afr: '\uD835\uDD1E',
+ Agrave: '\u00C0',
+ agrave: '\u00E0',
+ alefsym: '\u2135',
+ aleph: '\u2135',
+ Alpha: '\u0391',
+ alpha: '\u03B1',
+ Amacr: '\u0100',
+ amacr: '\u0101',
+ amalg: '\u2A3F',
+ AMP: '\u0026',
+ amp: '\u0026',
+ And: '\u2A53',
+ and: '\u2227',
+ andand: '\u2A55',
+ andd: '\u2A5C',
+ andslope: '\u2A58',
+ andv: '\u2A5A',
+ ang: '\u2220',
+ ange: '\u29A4',
+ angle: '\u2220',
+ angmsd: '\u2221',
+ angmsdaa: '\u29A8',
+ angmsdab: '\u29A9',
+ angmsdac: '\u29AA',
+ angmsdad: '\u29AB',
+ angmsdae: '\u29AC',
+ angmsdaf: '\u29AD',
+ angmsdag: '\u29AE',
+ angmsdah: '\u29AF',
+ angrt: '\u221F',
+ angrtvb: '\u22BE',
+ angrtvbd: '\u299D',
+ angsph: '\u2222',
+ angst: '\u00C5',
+ angzarr: '\u237C',
+ Aogon: '\u0104',
+ aogon: '\u0105',
+ Aopf: '\uD835\uDD38',
+ aopf: '\uD835\uDD52',
+ ap: '\u2248',
+ apacir: '\u2A6F',
+ apE: '\u2A70',
+ ape: '\u224A',
+ apid: '\u224B',
+ apos: '\u0027',
+ ApplyFunction: '\u2061',
+ approx: '\u2248',
+ approxeq: '\u224A',
+ Aring: '\u00C5',
+ aring: '\u00E5',
+ Ascr: '\uD835\uDC9C',
+ ascr: '\uD835\uDCB6',
+ Assign: '\u2254',
+ ast: '\u002A',
+ asymp: '\u2248',
+ asympeq: '\u224D',
+ Atilde: '\u00C3',
+ atilde: '\u00E3',
+ Auml: '\u00C4',
+ auml: '\u00E4',
+ awconint: '\u2233',
+ awint: '\u2A11',
+ backcong: '\u224C',
+ backepsilon: '\u03F6',
+ backprime: '\u2035',
+ backsim: '\u223D',
+ backsimeq: '\u22CD',
+ Backslash: '\u2216',
+ Barv: '\u2AE7',
+ barvee: '\u22BD',
+ Barwed: '\u2306',
+ barwed: '\u2305',
+ barwedge: '\u2305',
+ bbrk: '\u23B5',
+ bbrktbrk: '\u23B6',
+ bcong: '\u224C',
+ Bcy: '\u0411',
+ bcy: '\u0431',
+ bdquo: '\u201E',
+ becaus: '\u2235',
+ Because: '\u2235',
+ because: '\u2235',
+ bemptyv: '\u29B0',
+ bepsi: '\u03F6',
+ bernou: '\u212C',
+ Bernoullis: '\u212C',
+ Beta: '\u0392',
+ beta: '\u03B2',
+ beth: '\u2136',
+ between: '\u226C',
+ Bfr: '\uD835\uDD05',
+ bfr: '\uD835\uDD1F',
+ bigcap: '\u22C2',
+ bigcirc: '\u25EF',
+ bigcup: '\u22C3',
+ bigodot: '\u2A00',
+ bigoplus: '\u2A01',
+ bigotimes: '\u2A02',
+ bigsqcup: '\u2A06',
+ bigstar: '\u2605',
+ bigtriangledown: '\u25BD',
+ bigtriangleup: '\u25B3',
+ biguplus: '\u2A04',
+ bigvee: '\u22C1',
+ bigwedge: '\u22C0',
+ bkarow: '\u290D',
+ blacklozenge: '\u29EB',
+ blacksquare: '\u25AA',
+ blacktriangle: '\u25B4',
+ blacktriangledown: '\u25BE',
+ blacktriangleleft: '\u25C2',
+ blacktriangleright: '\u25B8',
+ blank: '\u2423',
+ blk12: '\u2592',
+ blk14: '\u2591',
+ blk34: '\u2593',
+ block: '\u2588',
+ bne: '\u003D\u20E5',
+ bnequiv: '\u2261\u20E5',
+ bNot: '\u2AED',
+ bnot: '\u2310',
+ Bopf: '\uD835\uDD39',
+ bopf: '\uD835\uDD53',
+ bot: '\u22A5',
+ bottom: '\u22A5',
+ bowtie: '\u22C8',
+ boxbox: '\u29C9',
+ boxDL: '\u2557',
+ boxDl: '\u2556',
+ boxdL: '\u2555',
+ boxdl: '\u2510',
+ boxDR: '\u2554',
+ boxDr: '\u2553',
+ boxdR: '\u2552',
+ boxdr: '\u250C',
+ boxH: '\u2550',
+ boxh: '\u2500',
+ boxHD: '\u2566',
+ boxHd: '\u2564',
+ boxhD: '\u2565',
+ boxhd: '\u252C',
+ boxHU: '\u2569',
+ boxHu: '\u2567',
+ boxhU: '\u2568',
+ boxhu: '\u2534',
+ boxminus: '\u229F',
+ boxplus: '\u229E',
+ boxtimes: '\u22A0',
+ boxUL: '\u255D',
+ boxUl: '\u255C',
+ boxuL: '\u255B',
+ boxul: '\u2518',
+ boxUR: '\u255A',
+ boxUr: '\u2559',
+ boxuR: '\u2558',
+ boxur: '\u2514',
+ boxV: '\u2551',
+ boxv: '\u2502',
+ boxVH: '\u256C',
+ boxVh: '\u256B',
+ boxvH: '\u256A',
+ boxvh: '\u253C',
+ boxVL: '\u2563',
+ boxVl: '\u2562',
+ boxvL: '\u2561',
+ boxvl: '\u2524',
+ boxVR: '\u2560',
+ boxVr: '\u255F',
+ boxvR: '\u255E',
+ boxvr: '\u251C',
+ bprime: '\u2035',
+ Breve: '\u02D8',
+ breve: '\u02D8',
+ brvbar: '\u00A6',
+ Bscr: '\u212C',
+ bscr: '\uD835\uDCB7',
+ bsemi: '\u204F',
+ bsim: '\u223D',
+ bsime: '\u22CD',
+ bsol: '\u005C',
+ bsolb: '\u29C5',
+ bsolhsub: '\u27C8',
+ bull: '\u2022',
+ bullet: '\u2022',
+ bump: '\u224E',
+ bumpE: '\u2AAE',
+ bumpe: '\u224F',
+ Bumpeq: '\u224E',
+ bumpeq: '\u224F',
+ Cacute: '\u0106',
+ cacute: '\u0107',
+ Cap: '\u22D2',
+ cap: '\u2229',
+ capand: '\u2A44',
+ capbrcup: '\u2A49',
+ capcap: '\u2A4B',
+ capcup: '\u2A47',
+ capdot: '\u2A40',
+ CapitalDifferentialD: '\u2145',
+ caps: '\u2229\uFE00',
+ caret: '\u2041',
+ caron: '\u02C7',
+ Cayleys: '\u212D',
+ ccaps: '\u2A4D',
+ Ccaron: '\u010C',
+ ccaron: '\u010D',
+ Ccedil: '\u00C7',
+ ccedil: '\u00E7',
+ Ccirc: '\u0108',
+ ccirc: '\u0109',
+ Cconint: '\u2230',
+ ccups: '\u2A4C',
+ ccupssm: '\u2A50',
+ Cdot: '\u010A',
+ cdot: '\u010B',
+ cedil: '\u00B8',
+ Cedilla: '\u00B8',
+ cemptyv: '\u29B2',
+ cent: '\u00A2',
+ CenterDot: '\u00B7',
+ centerdot: '\u00B7',
+ Cfr: '\u212D',
+ cfr: '\uD835\uDD20',
+ CHcy: '\u0427',
+ chcy: '\u0447',
+ check: '\u2713',
+ checkmark: '\u2713',
+ Chi: '\u03A7',
+ chi: '\u03C7',
+ cir: '\u25CB',
+ circ: '\u02C6',
+ circeq: '\u2257',
+ circlearrowleft: '\u21BA',
+ circlearrowright: '\u21BB',
+ circledast: '\u229B',
+ circledcirc: '\u229A',
+ circleddash: '\u229D',
+ CircleDot: '\u2299',
+ circledR: '\u00AE',
+ circledS: '\u24C8',
+ CircleMinus: '\u2296',
+ CirclePlus: '\u2295',
+ CircleTimes: '\u2297',
+ cirE: '\u29C3',
+ cire: '\u2257',
+ cirfnint: '\u2A10',
+ cirmid: '\u2AEF',
+ cirscir: '\u29C2',
+ ClockwiseContourIntegral: '\u2232',
+ CloseCurlyDoubleQuote: '\u201D',
+ CloseCurlyQuote: '\u2019',
+ clubs: '\u2663',
+ clubsuit: '\u2663',
+ Colon: '\u2237',
+ colon: '\u003A',
+ Colone: '\u2A74',
+ colone: '\u2254',
+ coloneq: '\u2254',
+ comma: '\u002C',
+ commat: '\u0040',
+ comp: '\u2201',
+ compfn: '\u2218',
+ complement: '\u2201',
+ complexes: '\u2102',
+ cong: '\u2245',
+ congdot: '\u2A6D',
+ Congruent: '\u2261',
+ Conint: '\u222F',
+ conint: '\u222E',
+ ContourIntegral: '\u222E',
+ Copf: '\u2102',
+ copf: '\uD835\uDD54',
+ coprod: '\u2210',
+ Coproduct: '\u2210',
+ COPY: '\u00A9',
+ copy: '\u00A9',
+ copysr: '\u2117',
+ CounterClockwiseContourIntegral: '\u2233',
+ crarr: '\u21B5',
+ Cross: '\u2A2F',
+ cross: '\u2717',
+ Cscr: '\uD835\uDC9E',
+ cscr: '\uD835\uDCB8',
+ csub: '\u2ACF',
+ csube: '\u2AD1',
+ csup: '\u2AD0',
+ csupe: '\u2AD2',
+ ctdot: '\u22EF',
+ cudarrl: '\u2938',
+ cudarrr: '\u2935',
+ cuepr: '\u22DE',
+ cuesc: '\u22DF',
+ cularr: '\u21B6',
+ cularrp: '\u293D',
+ Cup: '\u22D3',
+ cup: '\u222A',
+ cupbrcap: '\u2A48',
+ CupCap: '\u224D',
+ cupcap: '\u2A46',
+ cupcup: '\u2A4A',
+ cupdot: '\u228D',
+ cupor: '\u2A45',
+ cups: '\u222A\uFE00',
+ curarr: '\u21B7',
+ curarrm: '\u293C',
+ curlyeqprec: '\u22DE',
+ curlyeqsucc: '\u22DF',
+ curlyvee: '\u22CE',
+ curlywedge: '\u22CF',
+ curren: '\u00A4',
+ curvearrowleft: '\u21B6',
+ curvearrowright: '\u21B7',
+ cuvee: '\u22CE',
+ cuwed: '\u22CF',
+ cwconint: '\u2232',
+ cwint: '\u2231',
+ cylcty: '\u232D',
+ Dagger: '\u2021',
+ dagger: '\u2020',
+ daleth: '\u2138',
+ Darr: '\u21A1',
+ dArr: '\u21D3',
+ darr: '\u2193',
+ dash: '\u2010',
+ Dashv: '\u2AE4',
+ dashv: '\u22A3',
+ dbkarow: '\u290F',
+ dblac: '\u02DD',
+ Dcaron: '\u010E',
+ dcaron: '\u010F',
+ Dcy: '\u0414',
+ dcy: '\u0434',
+ DD: '\u2145',
+ dd: '\u2146',
+ ddagger: '\u2021',
+ ddarr: '\u21CA',
+ DDotrahd: '\u2911',
+ ddotseq: '\u2A77',
+ deg: '\u00B0',
+ Del: '\u2207',
+ Delta: '\u0394',
+ delta: '\u03B4',
+ demptyv: '\u29B1',
+ dfisht: '\u297F',
+ Dfr: '\uD835\uDD07',
+ dfr: '\uD835\uDD21',
+ dHar: '\u2965',
+ dharl: '\u21C3',
+ dharr: '\u21C2',
+ DiacriticalAcute: '\u00B4',
+ DiacriticalDot: '\u02D9',
+ DiacriticalDoubleAcute: '\u02DD',
+ DiacriticalGrave: '\u0060',
+ DiacriticalTilde: '\u02DC',
+ diam: '\u22C4',
+ Diamond: '\u22C4',
+ diamond: '\u22C4',
+ diamondsuit: '\u2666',
+ diams: '\u2666',
+ die: '\u00A8',
+ DifferentialD: '\u2146',
+ digamma: '\u03DD',
+ disin: '\u22F2',
+ div: '\u00F7',
+ divide: '\u00F7',
+ divideontimes: '\u22C7',
+ divonx: '\u22C7',
+ DJcy: '\u0402',
+ djcy: '\u0452',
+ dlcorn: '\u231E',
+ dlcrop: '\u230D',
+ dollar: '\u0024',
+ Dopf: '\uD835\uDD3B',
+ dopf: '\uD835\uDD55',
+ Dot: '\u00A8',
+ dot: '\u02D9',
+ DotDot: '\u20DC',
+ doteq: '\u2250',
+ doteqdot: '\u2251',
+ DotEqual: '\u2250',
+ dotminus: '\u2238',
+ dotplus: '\u2214',
+ dotsquare: '\u22A1',
+ doublebarwedge: '\u2306',
+ DoubleContourIntegral: '\u222F',
+ DoubleDot: '\u00A8',
+ DoubleDownArrow: '\u21D3',
+ DoubleLeftArrow: '\u21D0',
+ DoubleLeftRightArrow: '\u21D4',
+ DoubleLeftTee: '\u2AE4',
+ DoubleLongLeftArrow: '\u27F8',
+ DoubleLongLeftRightArrow: '\u27FA',
+ DoubleLongRightArrow: '\u27F9',
+ DoubleRightArrow: '\u21D2',
+ DoubleRightTee: '\u22A8',
+ DoubleUpArrow: '\u21D1',
+ DoubleUpDownArrow: '\u21D5',
+ DoubleVerticalBar: '\u2225',
+ DownArrow: '\u2193',
+ Downarrow: '\u21D3',
+ downarrow: '\u2193',
+ DownArrowBar: '\u2913',
+ DownArrowUpArrow: '\u21F5',
+ DownBreve: '\u0311',
+ downdownarrows: '\u21CA',
+ downharpoonleft: '\u21C3',
+ downharpoonright: '\u21C2',
+ DownLeftRightVector: '\u2950',
+ DownLeftTeeVector: '\u295E',
+ DownLeftVector: '\u21BD',
+ DownLeftVectorBar: '\u2956',
+ DownRightTeeVector: '\u295F',
+ DownRightVector: '\u21C1',
+ DownRightVectorBar: '\u2957',
+ DownTee: '\u22A4',
+ DownTeeArrow: '\u21A7',
+ drbkarow: '\u2910',
+ drcorn: '\u231F',
+ drcrop: '\u230C',
+ Dscr: '\uD835\uDC9F',
+ dscr: '\uD835\uDCB9',
+ DScy: '\u0405',
+ dscy: '\u0455',
+ dsol: '\u29F6',
+ Dstrok: '\u0110',
+ dstrok: '\u0111',
+ dtdot: '\u22F1',
+ dtri: '\u25BF',
+ dtrif: '\u25BE',
+ duarr: '\u21F5',
+ duhar: '\u296F',
+ dwangle: '\u29A6',
+ DZcy: '\u040F',
+ dzcy: '\u045F',
+ dzigrarr: '\u27FF',
+ Eacute: '\u00C9',
+ eacute: '\u00E9',
+ easter: '\u2A6E',
+ Ecaron: '\u011A',
+ ecaron: '\u011B',
+ ecir: '\u2256',
+ Ecirc: '\u00CA',
+ ecirc: '\u00EA',
+ ecolon: '\u2255',
+ Ecy: '\u042D',
+ ecy: '\u044D',
+ eDDot: '\u2A77',
+ Edot: '\u0116',
+ eDot: '\u2251',
+ edot: '\u0117',
+ ee: '\u2147',
+ efDot: '\u2252',
+ Efr: '\uD835\uDD08',
+ efr: '\uD835\uDD22',
+ eg: '\u2A9A',
+ Egrave: '\u00C8',
+ egrave: '\u00E8',
+ egs: '\u2A96',
+ egsdot: '\u2A98',
+ el: '\u2A99',
+ Element: '\u2208',
+ elinters: '\u23E7',
+ ell: '\u2113',
+ els: '\u2A95',
+ elsdot: '\u2A97',
+ Emacr: '\u0112',
+ emacr: '\u0113',
+ empty: '\u2205',
+ emptyset: '\u2205',
+ EmptySmallSquare: '\u25FB',
+ emptyv: '\u2205',
+ EmptyVerySmallSquare: '\u25AB',
+ emsp: '\u2003',
+ emsp13: '\u2004',
+ emsp14: '\u2005',
+ ENG: '\u014A',
+ eng: '\u014B',
+ ensp: '\u2002',
+ Eogon: '\u0118',
+ eogon: '\u0119',
+ Eopf: '\uD835\uDD3C',
+ eopf: '\uD835\uDD56',
+ epar: '\u22D5',
+ eparsl: '\u29E3',
+ eplus: '\u2A71',
+ epsi: '\u03B5',
+ Epsilon: '\u0395',
+ epsilon: '\u03B5',
+ epsiv: '\u03F5',
+ eqcirc: '\u2256',
+ eqcolon: '\u2255',
+ eqsim: '\u2242',
+ eqslantgtr: '\u2A96',
+ eqslantless: '\u2A95',
+ Equal: '\u2A75',
+ equals: '\u003D',
+ EqualTilde: '\u2242',
+ equest: '\u225F',
+ Equilibrium: '\u21CC',
+ equiv: '\u2261',
+ equivDD: '\u2A78',
+ eqvparsl: '\u29E5',
+ erarr: '\u2971',
+ erDot: '\u2253',
+ Escr: '\u2130',
+ escr: '\u212F',
+ esdot: '\u2250',
+ Esim: '\u2A73',
+ esim: '\u2242',
+ Eta: '\u0397',
+ eta: '\u03B7',
+ ETH: '\u00D0',
+ eth: '\u00F0',
+ Euml: '\u00CB',
+ euml: '\u00EB',
+ euro: '\u20AC',
+ excl: '\u0021',
+ exist: '\u2203',
+ Exists: '\u2203',
+ expectation: '\u2130',
+ ExponentialE: '\u2147',
+ exponentiale: '\u2147',
+ fallingdotseq: '\u2252',
+ Fcy: '\u0424',
+ fcy: '\u0444',
+ female: '\u2640',
+ ffilig: '\uFB03',
+ fflig: '\uFB00',
+ ffllig: '\uFB04',
+ Ffr: '\uD835\uDD09',
+ ffr: '\uD835\uDD23',
+ filig: '\uFB01',
+ FilledSmallSquare: '\u25FC',
+ FilledVerySmallSquare: '\u25AA',
+ fjlig: '\u0066\u006A',
+ flat: '\u266D',
+ fllig: '\uFB02',
+ fltns: '\u25B1',
+ fnof: '\u0192',
+ Fopf: '\uD835\uDD3D',
+ fopf: '\uD835\uDD57',
+ ForAll: '\u2200',
+ forall: '\u2200',
+ fork: '\u22D4',
+ forkv: '\u2AD9',
+ Fouriertrf: '\u2131',
+ fpartint: '\u2A0D',
+ frac12: '\u00BD',
+ frac13: '\u2153',
+ frac14: '\u00BC',
+ frac15: '\u2155',
+ frac16: '\u2159',
+ frac18: '\u215B',
+ frac23: '\u2154',
+ frac25: '\u2156',
+ frac34: '\u00BE',
+ frac35: '\u2157',
+ frac38: '\u215C',
+ frac45: '\u2158',
+ frac56: '\u215A',
+ frac58: '\u215D',
+ frac78: '\u215E',
+ frasl: '\u2044',
+ frown: '\u2322',
+ Fscr: '\u2131',
+ fscr: '\uD835\uDCBB',
+ gacute: '\u01F5',
+ Gamma: '\u0393',
+ gamma: '\u03B3',
+ Gammad: '\u03DC',
+ gammad: '\u03DD',
+ gap: '\u2A86',
+ Gbreve: '\u011E',
+ gbreve: '\u011F',
+ Gcedil: '\u0122',
+ Gcirc: '\u011C',
+ gcirc: '\u011D',
+ Gcy: '\u0413',
+ gcy: '\u0433',
+ Gdot: '\u0120',
+ gdot: '\u0121',
+ gE: '\u2267',
+ ge: '\u2265',
+ gEl: '\u2A8C',
+ gel: '\u22DB',
+ geq: '\u2265',
+ geqq: '\u2267',
+ geqslant: '\u2A7E',
+ ges: '\u2A7E',
+ gescc: '\u2AA9',
+ gesdot: '\u2A80',
+ gesdoto: '\u2A82',
+ gesdotol: '\u2A84',
+ gesl: '\u22DB\uFE00',
+ gesles: '\u2A94',
+ Gfr: '\uD835\uDD0A',
+ gfr: '\uD835\uDD24',
+ Gg: '\u22D9',
+ gg: '\u226B',
+ ggg: '\u22D9',
+ gimel: '\u2137',
+ GJcy: '\u0403',
+ gjcy: '\u0453',
+ gl: '\u2277',
+ gla: '\u2AA5',
+ glE: '\u2A92',
+ glj: '\u2AA4',
+ gnap: '\u2A8A',
+ gnapprox: '\u2A8A',
+ gnE: '\u2269',
+ gne: '\u2A88',
+ gneq: '\u2A88',
+ gneqq: '\u2269',
+ gnsim: '\u22E7',
+ Gopf: '\uD835\uDD3E',
+ gopf: '\uD835\uDD58',
+ grave: '\u0060',
+ GreaterEqual: '\u2265',
+ GreaterEqualLess: '\u22DB',
+ GreaterFullEqual: '\u2267',
+ GreaterGreater: '\u2AA2',
+ GreaterLess: '\u2277',
+ GreaterSlantEqual: '\u2A7E',
+ GreaterTilde: '\u2273',
+ Gscr: '\uD835\uDCA2',
+ gscr: '\u210A',
+ gsim: '\u2273',
+ gsime: '\u2A8E',
+ gsiml: '\u2A90',
+ Gt: '\u226B',
+ GT: '\u003E',
+ gt: '\u003E',
+ gtcc: '\u2AA7',
+ gtcir: '\u2A7A',
+ gtdot: '\u22D7',
+ gtlPar: '\u2995',
+ gtquest: '\u2A7C',
+ gtrapprox: '\u2A86',
+ gtrarr: '\u2978',
+ gtrdot: '\u22D7',
+ gtreqless: '\u22DB',
+ gtreqqless: '\u2A8C',
+ gtrless: '\u2277',
+ gtrsim: '\u2273',
+ gvertneqq: '\u2269\uFE00',
+ gvnE: '\u2269\uFE00',
+ Hacek: '\u02C7',
+ hairsp: '\u200A',
+ half: '\u00BD',
+ hamilt: '\u210B',
+ HARDcy: '\u042A',
+ hardcy: '\u044A',
+ hArr: '\u21D4',
+ harr: '\u2194',
+ harrcir: '\u2948',
+ harrw: '\u21AD',
+ Hat: '\u005E',
+ hbar: '\u210F',
+ Hcirc: '\u0124',
+ hcirc: '\u0125',
+ hearts: '\u2665',
+ heartsuit: '\u2665',
+ hellip: '\u2026',
+ hercon: '\u22B9',
+ Hfr: '\u210C',
+ hfr: '\uD835\uDD25',
+ HilbertSpace: '\u210B',
+ hksearow: '\u2925',
+ hkswarow: '\u2926',
+ hoarr: '\u21FF',
+ homtht: '\u223B',
+ hookleftarrow: '\u21A9',
+ hookrightarrow: '\u21AA',
+ Hopf: '\u210D',
+ hopf: '\uD835\uDD59',
+ horbar: '\u2015',
+ HorizontalLine: '\u2500',
+ Hscr: '\u210B',
+ hscr: '\uD835\uDCBD',
+ hslash: '\u210F',
+ Hstrok: '\u0126',
+ hstrok: '\u0127',
+ HumpDownHump: '\u224E',
+ HumpEqual: '\u224F',
+ hybull: '\u2043',
+ hyphen: '\u2010',
+ Iacute: '\u00CD',
+ iacute: '\u00ED',
+ ic: '\u2063',
+ Icirc: '\u00CE',
+ icirc: '\u00EE',
+ Icy: '\u0418',
+ icy: '\u0438',
+ Idot: '\u0130',
+ IEcy: '\u0415',
+ iecy: '\u0435',
+ iexcl: '\u00A1',
+ iff: '\u21D4',
+ Ifr: '\u2111',
+ ifr: '\uD835\uDD26',
+ Igrave: '\u00CC',
+ igrave: '\u00EC',
+ ii: '\u2148',
+ iiiint: '\u2A0C',
+ iiint: '\u222D',
+ iinfin: '\u29DC',
+ iiota: '\u2129',
+ IJlig: '\u0132',
+ ijlig: '\u0133',
+ Im: '\u2111',
+ Imacr: '\u012A',
+ imacr: '\u012B',
+ image: '\u2111',
+ ImaginaryI: '\u2148',
+ imagline: '\u2110',
+ imagpart: '\u2111',
+ imath: '\u0131',
+ imof: '\u22B7',
+ imped: '\u01B5',
+ Implies: '\u21D2',
+ in: '\u2208',
+ incare: '\u2105',
+ infin: '\u221E',
+ infintie: '\u29DD',
+ inodot: '\u0131',
+ Int: '\u222C',
+ int: '\u222B',
+ intcal: '\u22BA',
+ integers: '\u2124',
+ Integral: '\u222B',
+ intercal: '\u22BA',
+ Intersection: '\u22C2',
+ intlarhk: '\u2A17',
+ intprod: '\u2A3C',
+ InvisibleComma: '\u2063',
+ InvisibleTimes: '\u2062',
+ IOcy: '\u0401',
+ iocy: '\u0451',
+ Iogon: '\u012E',
+ iogon: '\u012F',
+ Iopf: '\uD835\uDD40',
+ iopf: '\uD835\uDD5A',
+ Iota: '\u0399',
+ iota: '\u03B9',
+ iprod: '\u2A3C',
+ iquest: '\u00BF',
+ Iscr: '\u2110',
+ iscr: '\uD835\uDCBE',
+ isin: '\u2208',
+ isindot: '\u22F5',
+ isinE: '\u22F9',
+ isins: '\u22F4',
+ isinsv: '\u22F3',
+ isinv: '\u2208',
+ it: '\u2062',
+ Itilde: '\u0128',
+ itilde: '\u0129',
+ Iukcy: '\u0406',
+ iukcy: '\u0456',
+ Iuml: '\u00CF',
+ iuml: '\u00EF',
+ Jcirc: '\u0134',
+ jcirc: '\u0135',
+ Jcy: '\u0419',
+ jcy: '\u0439',
+ Jfr: '\uD835\uDD0D',
+ jfr: '\uD835\uDD27',
+ jmath: '\u0237',
+ Jopf: '\uD835\uDD41',
+ jopf: '\uD835\uDD5B',
+ Jscr: '\uD835\uDCA5',
+ jscr: '\uD835\uDCBF',
+ Jsercy: '\u0408',
+ jsercy: '\u0458',
+ Jukcy: '\u0404',
+ jukcy: '\u0454',
+ Kappa: '\u039A',
+ kappa: '\u03BA',
+ kappav: '\u03F0',
+ Kcedil: '\u0136',
+ kcedil: '\u0137',
+ Kcy: '\u041A',
+ kcy: '\u043A',
+ Kfr: '\uD835\uDD0E',
+ kfr: '\uD835\uDD28',
+ kgreen: '\u0138',
+ KHcy: '\u0425',
+ khcy: '\u0445',
+ KJcy: '\u040C',
+ kjcy: '\u045C',
+ Kopf: '\uD835\uDD42',
+ kopf: '\uD835\uDD5C',
+ Kscr: '\uD835\uDCA6',
+ kscr: '\uD835\uDCC0',
+ lAarr: '\u21DA',
+ Lacute: '\u0139',
+ lacute: '\u013A',
+ laemptyv: '\u29B4',
+ lagran: '\u2112',
+ Lambda: '\u039B',
+ lambda: '\u03BB',
+ Lang: '\u27EA',
+ lang: '\u27E8',
+ langd: '\u2991',
+ langle: '\u27E8',
+ lap: '\u2A85',
+ Laplacetrf: '\u2112',
+ laquo: '\u00AB',
+ Larr: '\u219E',
+ lArr: '\u21D0',
+ larr: '\u2190',
+ larrb: '\u21E4',
+ larrbfs: '\u291F',
+ larrfs: '\u291D',
+ larrhk: '\u21A9',
+ larrlp: '\u21AB',
+ larrpl: '\u2939',
+ larrsim: '\u2973',
+ larrtl: '\u21A2',
+ lat: '\u2AAB',
+ lAtail: '\u291B',
+ latail: '\u2919',
+ late: '\u2AAD',
+ lates: '\u2AAD\uFE00',
+ lBarr: '\u290E',
+ lbarr: '\u290C',
+ lbbrk: '\u2772',
+ lbrace: '\u007B',
+ lbrack: '\u005B',
+ lbrke: '\u298B',
+ lbrksld: '\u298F',
+ lbrkslu: '\u298D',
+ Lcaron: '\u013D',
+ lcaron: '\u013E',
+ Lcedil: '\u013B',
+ lcedil: '\u013C',
+ lceil: '\u2308',
+ lcub: '\u007B',
+ Lcy: '\u041B',
+ lcy: '\u043B',
+ ldca: '\u2936',
+ ldquo: '\u201C',
+ ldquor: '\u201E',
+ ldrdhar: '\u2967',
+ ldrushar: '\u294B',
+ ldsh: '\u21B2',
+ lE: '\u2266',
+ le: '\u2264',
+ LeftAngleBracket: '\u27E8',
+ LeftArrow: '\u2190',
+ Leftarrow: '\u21D0',
+ leftarrow: '\u2190',
+ LeftArrowBar: '\u21E4',
+ LeftArrowRightArrow: '\u21C6',
+ leftarrowtail: '\u21A2',
+ LeftCeiling: '\u2308',
+ LeftDoubleBracket: '\u27E6',
+ LeftDownTeeVector: '\u2961',
+ LeftDownVector: '\u21C3',
+ LeftDownVectorBar: '\u2959',
+ LeftFloor: '\u230A',
+ leftharpoondown: '\u21BD',
+ leftharpoonup: '\u21BC',
+ leftleftarrows: '\u21C7',
+ LeftRightArrow: '\u2194',
+ Leftrightarrow: '\u21D4',
+ leftrightarrow: '\u2194',
+ leftrightarrows: '\u21C6',
+ leftrightharpoons: '\u21CB',
+ leftrightsquigarrow: '\u21AD',
+ LeftRightVector: '\u294E',
+ LeftTee: '\u22A3',
+ LeftTeeArrow: '\u21A4',
+ LeftTeeVector: '\u295A',
+ leftthreetimes: '\u22CB',
+ LeftTriangle: '\u22B2',
+ LeftTriangleBar: '\u29CF',
+ LeftTriangleEqual: '\u22B4',
+ LeftUpDownVector: '\u2951',
+ LeftUpTeeVector: '\u2960',
+ LeftUpVector: '\u21BF',
+ LeftUpVectorBar: '\u2958',
+ LeftVector: '\u21BC',
+ LeftVectorBar: '\u2952',
+ lEg: '\u2A8B',
+ leg: '\u22DA',
+ leq: '\u2264',
+ leqq: '\u2266',
+ leqslant: '\u2A7D',
+ les: '\u2A7D',
+ lescc: '\u2AA8',
+ lesdot: '\u2A7F',
+ lesdoto: '\u2A81',
+ lesdotor: '\u2A83',
+ lesg: '\u22DA\uFE00',
+ lesges: '\u2A93',
+ lessapprox: '\u2A85',
+ lessdot: '\u22D6',
+ lesseqgtr: '\u22DA',
+ lesseqqgtr: '\u2A8B',
+ LessEqualGreater: '\u22DA',
+ LessFullEqual: '\u2266',
+ LessGreater: '\u2276',
+ lessgtr: '\u2276',
+ LessLess: '\u2AA1',
+ lesssim: '\u2272',
+ LessSlantEqual: '\u2A7D',
+ LessTilde: '\u2272',
+ lfisht: '\u297C',
+ lfloor: '\u230A',
+ Lfr: '\uD835\uDD0F',
+ lfr: '\uD835\uDD29',
+ lg: '\u2276',
+ lgE: '\u2A91',
+ lHar: '\u2962',
+ lhard: '\u21BD',
+ lharu: '\u21BC',
+ lharul: '\u296A',
+ lhblk: '\u2584',
+ LJcy: '\u0409',
+ ljcy: '\u0459',
+ Ll: '\u22D8',
+ ll: '\u226A',
+ llarr: '\u21C7',
+ llcorner: '\u231E',
+ Lleftarrow: '\u21DA',
+ llhard: '\u296B',
+ lltri: '\u25FA',
+ Lmidot: '\u013F',
+ lmidot: '\u0140',
+ lmoust: '\u23B0',
+ lmoustache: '\u23B0',
+ lnap: '\u2A89',
+ lnapprox: '\u2A89',
+ lnE: '\u2268',
+ lne: '\u2A87',
+ lneq: '\u2A87',
+ lneqq: '\u2268',
+ lnsim: '\u22E6',
+ loang: '\u27EC',
+ loarr: '\u21FD',
+ lobrk: '\u27E6',
+ LongLeftArrow: '\u27F5',
+ Longleftarrow: '\u27F8',
+ longleftarrow: '\u27F5',
+ LongLeftRightArrow: '\u27F7',
+ Longleftrightarrow: '\u27FA',
+ longleftrightarrow: '\u27F7',
+ longmapsto: '\u27FC',
+ LongRightArrow: '\u27F6',
+ Longrightarrow: '\u27F9',
+ longrightarrow: '\u27F6',
+ looparrowleft: '\u21AB',
+ looparrowright: '\u21AC',
+ lopar: '\u2985',
+ Lopf: '\uD835\uDD43',
+ lopf: '\uD835\uDD5D',
+ loplus: '\u2A2D',
+ lotimes: '\u2A34',
+ lowast: '\u2217',
+ lowbar: '\u005F',
+ LowerLeftArrow: '\u2199',
+ LowerRightArrow: '\u2198',
+ loz: '\u25CA',
+ lozenge: '\u25CA',
+ lozf: '\u29EB',
+ lpar: '\u0028',
+ lparlt: '\u2993',
+ lrarr: '\u21C6',
+ lrcorner: '\u231F',
+ lrhar: '\u21CB',
+ lrhard: '\u296D',
+ lrm: '\u200E',
+ lrtri: '\u22BF',
+ lsaquo: '\u2039',
+ Lscr: '\u2112',
+ lscr: '\uD835\uDCC1',
+ Lsh: '\u21B0',
+ lsh: '\u21B0',
+ lsim: '\u2272',
+ lsime: '\u2A8D',
+ lsimg: '\u2A8F',
+ lsqb: '\u005B',
+ lsquo: '\u2018',
+ lsquor: '\u201A',
+ Lstrok: '\u0141',
+ lstrok: '\u0142',
+ Lt: '\u226A',
+ LT: '\u003C',
+ lt: '\u003C',
+ ltcc: '\u2AA6',
+ ltcir: '\u2A79',
+ ltdot: '\u22D6',
+ lthree: '\u22CB',
+ ltimes: '\u22C9',
+ ltlarr: '\u2976',
+ ltquest: '\u2A7B',
+ ltri: '\u25C3',
+ ltrie: '\u22B4',
+ ltrif: '\u25C2',
+ ltrPar: '\u2996',
+ lurdshar: '\u294A',
+ luruhar: '\u2966',
+ lvertneqq: '\u2268\uFE00',
+ lvnE: '\u2268\uFE00',
+ macr: '\u00AF',
+ male: '\u2642',
+ malt: '\u2720',
+ maltese: '\u2720',
+ Map: '\u2905',
+ map: '\u21A6',
+ mapsto: '\u21A6',
+ mapstodown: '\u21A7',
+ mapstoleft: '\u21A4',
+ mapstoup: '\u21A5',
+ marker: '\u25AE',
+ mcomma: '\u2A29',
+ Mcy: '\u041C',
+ mcy: '\u043C',
+ mdash: '\u2014',
+ mDDot: '\u223A',
+ measuredangle: '\u2221',
+ MediumSpace: '\u205F',
+ Mellintrf: '\u2133',
+ Mfr: '\uD835\uDD10',
+ mfr: '\uD835\uDD2A',
+ mho: '\u2127',
+ micro: '\u00B5',
+ mid: '\u2223',
+ midast: '\u002A',
+ midcir: '\u2AF0',
+ middot: '\u00B7',
+ minus: '\u2212',
+ minusb: '\u229F',
+ minusd: '\u2238',
+ minusdu: '\u2A2A',
+ MinusPlus: '\u2213',
+ mlcp: '\u2ADB',
+ mldr: '\u2026',
+ mnplus: '\u2213',
+ models: '\u22A7',
+ Mopf: '\uD835\uDD44',
+ mopf: '\uD835\uDD5E',
+ mp: '\u2213',
+ Mscr: '\u2133',
+ mscr: '\uD835\uDCC2',
+ mstpos: '\u223E',
+ Mu: '\u039C',
+ mu: '\u03BC',
+ multimap: '\u22B8',
+ mumap: '\u22B8',
+ nabla: '\u2207',
+ Nacute: '\u0143',
+ nacute: '\u0144',
+ nang: '\u2220\u20D2',
+ nap: '\u2249',
+ napE: '\u2A70\u0338',
+ napid: '\u224B\u0338',
+ napos: '\u0149',
+ napprox: '\u2249',
+ natur: '\u266E',
+ natural: '\u266E',
+ naturals: '\u2115',
+ nbsp: '\u00A0',
+ nbump: '\u224E\u0338',
+ nbumpe: '\u224F\u0338',
+ ncap: '\u2A43',
+ Ncaron: '\u0147',
+ ncaron: '\u0148',
+ Ncedil: '\u0145',
+ ncedil: '\u0146',
+ ncong: '\u2247',
+ ncongdot: '\u2A6D\u0338',
+ ncup: '\u2A42',
+ Ncy: '\u041D',
+ ncy: '\u043D',
+ ndash: '\u2013',
+ ne: '\u2260',
+ nearhk: '\u2924',
+ neArr: '\u21D7',
+ nearr: '\u2197',
+ nearrow: '\u2197',
+ nedot: '\u2250\u0338',
+ NegativeMediumSpace: '\u200B',
+ NegativeThickSpace: '\u200B',
+ NegativeThinSpace: '\u200B',
+ NegativeVeryThinSpace: '\u200B',
+ nequiv: '\u2262',
+ nesear: '\u2928',
+ nesim: '\u2242\u0338',
+ NestedGreaterGreater: '\u226B',
+ NestedLessLess: '\u226A',
+ NewLine: '\u000A',
+ nexist: '\u2204',
+ nexists: '\u2204',
+ Nfr: '\uD835\uDD11',
+ nfr: '\uD835\uDD2B',
+ ngE: '\u2267\u0338',
+ nge: '\u2271',
+ ngeq: '\u2271',
+ ngeqq: '\u2267\u0338',
+ ngeqslant: '\u2A7E\u0338',
+ nges: '\u2A7E\u0338',
+ nGg: '\u22D9\u0338',
+ ngsim: '\u2275',
+ nGt: '\u226B\u20D2',
+ ngt: '\u226F',
+ ngtr: '\u226F',
+ nGtv: '\u226B\u0338',
+ nhArr: '\u21CE',
+ nharr: '\u21AE',
+ nhpar: '\u2AF2',
+ ni: '\u220B',
+ nis: '\u22FC',
+ nisd: '\u22FA',
+ niv: '\u220B',
+ NJcy: '\u040A',
+ njcy: '\u045A',
+ nlArr: '\u21CD',
+ nlarr: '\u219A',
+ nldr: '\u2025',
+ nlE: '\u2266\u0338',
+ nle: '\u2270',
+ nLeftarrow: '\u21CD',
+ nleftarrow: '\u219A',
+ nLeftrightarrow: '\u21CE',
+ nleftrightarrow: '\u21AE',
+ nleq: '\u2270',
+ nleqq: '\u2266\u0338',
+ nleqslant: '\u2A7D\u0338',
+ nles: '\u2A7D\u0338',
+ nless: '\u226E',
+ nLl: '\u22D8\u0338',
+ nlsim: '\u2274',
+ nLt: '\u226A\u20D2',
+ nlt: '\u226E',
+ nltri: '\u22EA',
+ nltrie: '\u22EC',
+ nLtv: '\u226A\u0338',
+ nmid: '\u2224',
+ NoBreak: '\u2060',
+ NonBreakingSpace: '\u00A0',
+ Nopf: '\u2115',
+ nopf: '\uD835\uDD5F',
+ Not: '\u2AEC',
+ not: '\u00AC',
+ NotCongruent: '\u2262',
+ NotCupCap: '\u226D',
+ NotDoubleVerticalBar: '\u2226',
+ NotElement: '\u2209',
+ NotEqual: '\u2260',
+ NotEqualTilde: '\u2242\u0338',
+ NotExists: '\u2204',
+ NotGreater: '\u226F',
+ NotGreaterEqual: '\u2271',
+ NotGreaterFullEqual: '\u2267\u0338',
+ NotGreaterGreater: '\u226B\u0338',
+ NotGreaterLess: '\u2279',
+ NotGreaterSlantEqual: '\u2A7E\u0338',
+ NotGreaterTilde: '\u2275',
+ NotHumpDownHump: '\u224E\u0338',
+ NotHumpEqual: '\u224F\u0338',
+ notin: '\u2209',
+ notindot: '\u22F5\u0338',
+ notinE: '\u22F9\u0338',
+ notinva: '\u2209',
+ notinvb: '\u22F7',
+ notinvc: '\u22F6',
+ NotLeftTriangle: '\u22EA',
+ NotLeftTriangleBar: '\u29CF\u0338',
+ NotLeftTriangleEqual: '\u22EC',
+ NotLess: '\u226E',
+ NotLessEqual: '\u2270',
+ NotLessGreater: '\u2278',
+ NotLessLess: '\u226A\u0338',
+ NotLessSlantEqual: '\u2A7D\u0338',
+ NotLessTilde: '\u2274',
+ NotNestedGreaterGreater: '\u2AA2\u0338',
+ NotNestedLessLess: '\u2AA1\u0338',
+ notni: '\u220C',
+ notniva: '\u220C',
+ notnivb: '\u22FE',
+ notnivc: '\u22FD',
+ NotPrecedes: '\u2280',
+ NotPrecedesEqual: '\u2AAF\u0338',
+ NotPrecedesSlantEqual: '\u22E0',
+ NotReverseElement: '\u220C',
+ NotRightTriangle: '\u22EB',
+ NotRightTriangleBar: '\u29D0\u0338',
+ NotRightTriangleEqual: '\u22ED',
+ NotSquareSubset: '\u228F\u0338',
+ NotSquareSubsetEqual: '\u22E2',
+ NotSquareSuperset: '\u2290\u0338',
+ NotSquareSupersetEqual: '\u22E3',
+ NotSubset: '\u2282\u20D2',
+ NotSubsetEqual: '\u2288',
+ NotSucceeds: '\u2281',
+ NotSucceedsEqual: '\u2AB0\u0338',
+ NotSucceedsSlantEqual: '\u22E1',
+ NotSucceedsTilde: '\u227F\u0338',
+ NotSuperset: '\u2283\u20D2',
+ NotSupersetEqual: '\u2289',
+ NotTilde: '\u2241',
+ NotTildeEqual: '\u2244',
+ NotTildeFullEqual: '\u2247',
+ NotTildeTilde: '\u2249',
+ NotVerticalBar: '\u2224',
+ npar: '\u2226',
+ nparallel: '\u2226',
+ nparsl: '\u2AFD\u20E5',
+ npart: '\u2202\u0338',
+ npolint: '\u2A14',
+ npr: '\u2280',
+ nprcue: '\u22E0',
+ npre: '\u2AAF\u0338',
+ nprec: '\u2280',
+ npreceq: '\u2AAF\u0338',
+ nrArr: '\u21CF',
+ nrarr: '\u219B',
+ nrarrc: '\u2933\u0338',
+ nrarrw: '\u219D\u0338',
+ nRightarrow: '\u21CF',
+ nrightarrow: '\u219B',
+ nrtri: '\u22EB',
+ nrtrie: '\u22ED',
+ nsc: '\u2281',
+ nsccue: '\u22E1',
+ nsce: '\u2AB0\u0338',
+ Nscr: '\uD835\uDCA9',
+ nscr: '\uD835\uDCC3',
+ nshortmid: '\u2224',
+ nshortparallel: '\u2226',
+ nsim: '\u2241',
+ nsime: '\u2244',
+ nsimeq: '\u2244',
+ nsmid: '\u2224',
+ nspar: '\u2226',
+ nsqsube: '\u22E2',
+ nsqsupe: '\u22E3',
+ nsub: '\u2284',
+ nsubE: '\u2AC5\u0338',
+ nsube: '\u2288',
+ nsubset: '\u2282\u20D2',
+ nsubseteq: '\u2288',
+ nsubseteqq: '\u2AC5\u0338',
+ nsucc: '\u2281',
+ nsucceq: '\u2AB0\u0338',
+ nsup: '\u2285',
+ nsupE: '\u2AC6\u0338',
+ nsupe: '\u2289',
+ nsupset: '\u2283\u20D2',
+ nsupseteq: '\u2289',
+ nsupseteqq: '\u2AC6\u0338',
+ ntgl: '\u2279',
+ Ntilde: '\u00D1',
+ ntilde: '\u00F1',
+ ntlg: '\u2278',
+ ntriangleleft: '\u22EA',
+ ntrianglelefteq: '\u22EC',
+ ntriangleright: '\u22EB',
+ ntrianglerighteq: '\u22ED',
+ Nu: '\u039D',
+ nu: '\u03BD',
+ num: '\u0023',
+ numero: '\u2116',
+ numsp: '\u2007',
+ nvap: '\u224D\u20D2',
+ nVDash: '\u22AF',
+ nVdash: '\u22AE',
+ nvDash: '\u22AD',
+ nvdash: '\u22AC',
+ nvge: '\u2265\u20D2',
+ nvgt: '\u003E\u20D2',
+ nvHarr: '\u2904',
+ nvinfin: '\u29DE',
+ nvlArr: '\u2902',
+ nvle: '\u2264\u20D2',
+ nvlt: '\u003C\u20D2',
+ nvltrie: '\u22B4\u20D2',
+ nvrArr: '\u2903',
+ nvrtrie: '\u22B5\u20D2',
+ nvsim: '\u223C\u20D2',
+ nwarhk: '\u2923',
+ nwArr: '\u21D6',
+ nwarr: '\u2196',
+ nwarrow: '\u2196',
+ nwnear: '\u2927',
+ Oacute: '\u00D3',
+ oacute: '\u00F3',
+ oast: '\u229B',
+ ocir: '\u229A',
+ Ocirc: '\u00D4',
+ ocirc: '\u00F4',
+ Ocy: '\u041E',
+ ocy: '\u043E',
+ odash: '\u229D',
+ Odblac: '\u0150',
+ odblac: '\u0151',
+ odiv: '\u2A38',
+ odot: '\u2299',
+ odsold: '\u29BC',
+ OElig: '\u0152',
+ oelig: '\u0153',
+ ofcir: '\u29BF',
+ Ofr: '\uD835\uDD12',
+ ofr: '\uD835\uDD2C',
+ ogon: '\u02DB',
+ Ograve: '\u00D2',
+ ograve: '\u00F2',
+ ogt: '\u29C1',
+ ohbar: '\u29B5',
+ ohm: '\u03A9',
+ oint: '\u222E',
+ olarr: '\u21BA',
+ olcir: '\u29BE',
+ olcross: '\u29BB',
+ oline: '\u203E',
+ olt: '\u29C0',
+ Omacr: '\u014C',
+ omacr: '\u014D',
+ Omega: '\u03A9',
+ omega: '\u03C9',
+ Omicron: '\u039F',
+ omicron: '\u03BF',
+ omid: '\u29B6',
+ ominus: '\u2296',
+ Oopf: '\uD835\uDD46',
+ oopf: '\uD835\uDD60',
+ opar: '\u29B7',
+ OpenCurlyDoubleQuote: '\u201C',
+ OpenCurlyQuote: '\u2018',
+ operp: '\u29B9',
+ oplus: '\u2295',
+ Or: '\u2A54',
+ or: '\u2228',
+ orarr: '\u21BB',
+ ord: '\u2A5D',
+ order: '\u2134',
+ orderof: '\u2134',
+ ordf: '\u00AA',
+ ordm: '\u00BA',
+ origof: '\u22B6',
+ oror: '\u2A56',
+ orslope: '\u2A57',
+ orv: '\u2A5B',
+ oS: '\u24C8',
+ Oscr: '\uD835\uDCAA',
+ oscr: '\u2134',
+ Oslash: '\u00D8',
+ oslash: '\u00F8',
+ osol: '\u2298',
+ Otilde: '\u00D5',
+ otilde: '\u00F5',
+ Otimes: '\u2A37',
+ otimes: '\u2297',
+ otimesas: '\u2A36',
+ Ouml: '\u00D6',
+ ouml: '\u00F6',
+ ovbar: '\u233D',
+ OverBar: '\u203E',
+ OverBrace: '\u23DE',
+ OverBracket: '\u23B4',
+ OverParenthesis: '\u23DC',
+ par: '\u2225',
+ para: '\u00B6',
+ parallel: '\u2225',
+ parsim: '\u2AF3',
+ parsl: '\u2AFD',
+ part: '\u2202',
+ PartialD: '\u2202',
+ Pcy: '\u041F',
+ pcy: '\u043F',
+ percnt: '\u0025',
+ period: '\u002E',
+ permil: '\u2030',
+ perp: '\u22A5',
+ pertenk: '\u2031',
+ Pfr: '\uD835\uDD13',
+ pfr: '\uD835\uDD2D',
+ Phi: '\u03A6',
+ phi: '\u03C6',
+ phiv: '\u03D5',
+ phmmat: '\u2133',
+ phone: '\u260E',
+ Pi: '\u03A0',
+ pi: '\u03C0',
+ pitchfork: '\u22D4',
+ piv: '\u03D6',
+ planck: '\u210F',
+ planckh: '\u210E',
+ plankv: '\u210F',
+ plus: '\u002B',
+ plusacir: '\u2A23',
+ plusb: '\u229E',
+ pluscir: '\u2A22',
+ plusdo: '\u2214',
+ plusdu: '\u2A25',
+ pluse: '\u2A72',
+ PlusMinus: '\u00B1',
+ plusmn: '\u00B1',
+ plussim: '\u2A26',
+ plustwo: '\u2A27',
+ pm: '\u00B1',
+ Poincareplane: '\u210C',
+ pointint: '\u2A15',
+ Popf: '\u2119',
+ popf: '\uD835\uDD61',
+ pound: '\u00A3',
+ Pr: '\u2ABB',
+ pr: '\u227A',
+ prap: '\u2AB7',
+ prcue: '\u227C',
+ prE: '\u2AB3',
+ pre: '\u2AAF',
+ prec: '\u227A',
+ precapprox: '\u2AB7',
+ preccurlyeq: '\u227C',
+ Precedes: '\u227A',
+ PrecedesEqual: '\u2AAF',
+ PrecedesSlantEqual: '\u227C',
+ PrecedesTilde: '\u227E',
+ preceq: '\u2AAF',
+ precnapprox: '\u2AB9',
+ precneqq: '\u2AB5',
+ precnsim: '\u22E8',
+ precsim: '\u227E',
+ Prime: '\u2033',
+ prime: '\u2032',
+ primes: '\u2119',
+ prnap: '\u2AB9',
+ prnE: '\u2AB5',
+ prnsim: '\u22E8',
+ prod: '\u220F',
+ Product: '\u220F',
+ profalar: '\u232E',
+ profline: '\u2312',
+ profsurf: '\u2313',
+ prop: '\u221D',
+ Proportion: '\u2237',
+ Proportional: '\u221D',
+ propto: '\u221D',
+ prsim: '\u227E',
+ prurel: '\u22B0',
+ Pscr: '\uD835\uDCAB',
+ pscr: '\uD835\uDCC5',
+ Psi: '\u03A8',
+ psi: '\u03C8',
+ puncsp: '\u2008',
+ Qfr: '\uD835\uDD14',
+ qfr: '\uD835\uDD2E',
+ qint: '\u2A0C',
+ Qopf: '\u211A',
+ qopf: '\uD835\uDD62',
+ qprime: '\u2057',
+ Qscr: '\uD835\uDCAC',
+ qscr: '\uD835\uDCC6',
+ quaternions: '\u210D',
+ quatint: '\u2A16',
+ quest: '\u003F',
+ questeq: '\u225F',
+ QUOT: '\u0022',
+ quot: '\u0022',
+ rAarr: '\u21DB',
+ race: '\u223D\u0331',
+ Racute: '\u0154',
+ racute: '\u0155',
+ radic: '\u221A',
+ raemptyv: '\u29B3',
+ Rang: '\u27EB',
+ rang: '\u27E9',
+ rangd: '\u2992',
+ range: '\u29A5',
+ rangle: '\u27E9',
+ raquo: '\u00BB',
+ Rarr: '\u21A0',
+ rArr: '\u21D2',
+ rarr: '\u2192',
+ rarrap: '\u2975',
+ rarrb: '\u21E5',
+ rarrbfs: '\u2920',
+ rarrc: '\u2933',
+ rarrfs: '\u291E',
+ rarrhk: '\u21AA',
+ rarrlp: '\u21AC',
+ rarrpl: '\u2945',
+ rarrsim: '\u2974',
+ Rarrtl: '\u2916',
+ rarrtl: '\u21A3',
+ rarrw: '\u219D',
+ rAtail: '\u291C',
+ ratail: '\u291A',
+ ratio: '\u2236',
+ rationals: '\u211A',
+ RBarr: '\u2910',
+ rBarr: '\u290F',
+ rbarr: '\u290D',
+ rbbrk: '\u2773',
+ rbrace: '\u007D',
+ rbrack: '\u005D',
+ rbrke: '\u298C',
+ rbrksld: '\u298E',
+ rbrkslu: '\u2990',
+ Rcaron: '\u0158',
+ rcaron: '\u0159',
+ Rcedil: '\u0156',
+ rcedil: '\u0157',
+ rceil: '\u2309',
+ rcub: '\u007D',
+ Rcy: '\u0420',
+ rcy: '\u0440',
+ rdca: '\u2937',
+ rdldhar: '\u2969',
+ rdquo: '\u201D',
+ rdquor: '\u201D',
+ rdsh: '\u21B3',
+ Re: '\u211C',
+ real: '\u211C',
+ realine: '\u211B',
+ realpart: '\u211C',
+ reals: '\u211D',
+ rect: '\u25AD',
+ REG: '\u00AE',
+ reg: '\u00AE',
+ ReverseElement: '\u220B',
+ ReverseEquilibrium: '\u21CB',
+ ReverseUpEquilibrium: '\u296F',
+ rfisht: '\u297D',
+ rfloor: '\u230B',
+ Rfr: '\u211C',
+ rfr: '\uD835\uDD2F',
+ rHar: '\u2964',
+ rhard: '\u21C1',
+ rharu: '\u21C0',
+ rharul: '\u296C',
+ Rho: '\u03A1',
+ rho: '\u03C1',
+ rhov: '\u03F1',
+ RightAngleBracket: '\u27E9',
+ RightArrow: '\u2192',
+ Rightarrow: '\u21D2',
+ rightarrow: '\u2192',
+ RightArrowBar: '\u21E5',
+ RightArrowLeftArrow: '\u21C4',
+ rightarrowtail: '\u21A3',
+ RightCeiling: '\u2309',
+ RightDoubleBracket: '\u27E7',
+ RightDownTeeVector: '\u295D',
+ RightDownVector: '\u21C2',
+ RightDownVectorBar: '\u2955',
+ RightFloor: '\u230B',
+ rightharpoondown: '\u21C1',
+ rightharpoonup: '\u21C0',
+ rightleftarrows: '\u21C4',
+ rightleftharpoons: '\u21CC',
+ rightrightarrows: '\u21C9',
+ rightsquigarrow: '\u219D',
+ RightTee: '\u22A2',
+ RightTeeArrow: '\u21A6',
+ RightTeeVector: '\u295B',
+ rightthreetimes: '\u22CC',
+ RightTriangle: '\u22B3',
+ RightTriangleBar: '\u29D0',
+ RightTriangleEqual: '\u22B5',
+ RightUpDownVector: '\u294F',
+ RightUpTeeVector: '\u295C',
+ RightUpVector: '\u21BE',
+ RightUpVectorBar: '\u2954',
+ RightVector: '\u21C0',
+ RightVectorBar: '\u2953',
+ ring: '\u02DA',
+ risingdotseq: '\u2253',
+ rlarr: '\u21C4',
+ rlhar: '\u21CC',
+ rlm: '\u200F',
+ rmoust: '\u23B1',
+ rmoustache: '\u23B1',
+ rnmid: '\u2AEE',
+ roang: '\u27ED',
+ roarr: '\u21FE',
+ robrk: '\u27E7',
+ ropar: '\u2986',
+ Ropf: '\u211D',
+ ropf: '\uD835\uDD63',
+ roplus: '\u2A2E',
+ rotimes: '\u2A35',
+ RoundImplies: '\u2970',
+ rpar: '\u0029',
+ rpargt: '\u2994',
+ rppolint: '\u2A12',
+ rrarr: '\u21C9',
+ Rrightarrow: '\u21DB',
+ rsaquo: '\u203A',
+ Rscr: '\u211B',
+ rscr: '\uD835\uDCC7',
+ Rsh: '\u21B1',
+ rsh: '\u21B1',
+ rsqb: '\u005D',
+ rsquo: '\u2019',
+ rsquor: '\u2019',
+ rthree: '\u22CC',
+ rtimes: '\u22CA',
+ rtri: '\u25B9',
+ rtrie: '\u22B5',
+ rtrif: '\u25B8',
+ rtriltri: '\u29CE',
+ RuleDelayed: '\u29F4',
+ ruluhar: '\u2968',
+ rx: '\u211E',
+ Sacute: '\u015A',
+ sacute: '\u015B',
+ sbquo: '\u201A',
+ Sc: '\u2ABC',
+ sc: '\u227B',
+ scap: '\u2AB8',
+ Scaron: '\u0160',
+ scaron: '\u0161',
+ sccue: '\u227D',
+ scE: '\u2AB4',
+ sce: '\u2AB0',
+ Scedil: '\u015E',
+ scedil: '\u015F',
+ Scirc: '\u015C',
+ scirc: '\u015D',
+ scnap: '\u2ABA',
+ scnE: '\u2AB6',
+ scnsim: '\u22E9',
+ scpolint: '\u2A13',
+ scsim: '\u227F',
+ Scy: '\u0421',
+ scy: '\u0441',
+ sdot: '\u22C5',
+ sdotb: '\u22A1',
+ sdote: '\u2A66',
+ searhk: '\u2925',
+ seArr: '\u21D8',
+ searr: '\u2198',
+ searrow: '\u2198',
+ sect: '\u00A7',
+ semi: '\u003B',
+ seswar: '\u2929',
+ setminus: '\u2216',
+ setmn: '\u2216',
+ sext: '\u2736',
+ Sfr: '\uD835\uDD16',
+ sfr: '\uD835\uDD30',
+ sfrown: '\u2322',
+ sharp: '\u266F',
+ SHCHcy: '\u0429',
+ shchcy: '\u0449',
+ SHcy: '\u0428',
+ shcy: '\u0448',
+ ShortDownArrow: '\u2193',
+ ShortLeftArrow: '\u2190',
+ shortmid: '\u2223',
+ shortparallel: '\u2225',
+ ShortRightArrow: '\u2192',
+ ShortUpArrow: '\u2191',
+ shy: '\u00AD',
+ Sigma: '\u03A3',
+ sigma: '\u03C3',
+ sigmaf: '\u03C2',
+ sigmav: '\u03C2',
+ sim: '\u223C',
+ simdot: '\u2A6A',
+ sime: '\u2243',
+ simeq: '\u2243',
+ simg: '\u2A9E',
+ simgE: '\u2AA0',
+ siml: '\u2A9D',
+ simlE: '\u2A9F',
+ simne: '\u2246',
+ simplus: '\u2A24',
+ simrarr: '\u2972',
+ slarr: '\u2190',
+ SmallCircle: '\u2218',
+ smallsetminus: '\u2216',
+ smashp: '\u2A33',
+ smeparsl: '\u29E4',
+ smid: '\u2223',
+ smile: '\u2323',
+ smt: '\u2AAA',
+ smte: '\u2AAC',
+ smtes: '\u2AAC\uFE00',
+ SOFTcy: '\u042C',
+ softcy: '\u044C',
+ sol: '\u002F',
+ solb: '\u29C4',
+ solbar: '\u233F',
+ Sopf: '\uD835\uDD4A',
+ sopf: '\uD835\uDD64',
+ spades: '\u2660',
+ spadesuit: '\u2660',
+ spar: '\u2225',
+ sqcap: '\u2293',
+ sqcaps: '\u2293\uFE00',
+ sqcup: '\u2294',
+ sqcups: '\u2294\uFE00',
+ Sqrt: '\u221A',
+ sqsub: '\u228F',
+ sqsube: '\u2291',
+ sqsubset: '\u228F',
+ sqsubseteq: '\u2291',
+ sqsup: '\u2290',
+ sqsupe: '\u2292',
+ sqsupset: '\u2290',
+ sqsupseteq: '\u2292',
+ squ: '\u25A1',
+ Square: '\u25A1',
+ square: '\u25A1',
+ SquareIntersection: '\u2293',
+ SquareSubset: '\u228F',
+ SquareSubsetEqual: '\u2291',
+ SquareSuperset: '\u2290',
+ SquareSupersetEqual: '\u2292',
+ SquareUnion: '\u2294',
+ squarf: '\u25AA',
+ squf: '\u25AA',
+ srarr: '\u2192',
+ Sscr: '\uD835\uDCAE',
+ sscr: '\uD835\uDCC8',
+ ssetmn: '\u2216',
+ ssmile: '\u2323',
+ sstarf: '\u22C6',
+ Star: '\u22C6',
+ star: '\u2606',
+ starf: '\u2605',
+ straightepsilon: '\u03F5',
+ straightphi: '\u03D5',
+ strns: '\u00AF',
+ Sub: '\u22D0',
+ sub: '\u2282',
+ subdot: '\u2ABD',
+ subE: '\u2AC5',
+ sube: '\u2286',
+ subedot: '\u2AC3',
+ submult: '\u2AC1',
+ subnE: '\u2ACB',
+ subne: '\u228A',
+ subplus: '\u2ABF',
+ subrarr: '\u2979',
+ Subset: '\u22D0',
+ subset: '\u2282',
+ subseteq: '\u2286',
+ subseteqq: '\u2AC5',
+ SubsetEqual: '\u2286',
+ subsetneq: '\u228A',
+ subsetneqq: '\u2ACB',
+ subsim: '\u2AC7',
+ subsub: '\u2AD5',
+ subsup: '\u2AD3',
+ succ: '\u227B',
+ succapprox: '\u2AB8',
+ succcurlyeq: '\u227D',
+ Succeeds: '\u227B',
+ SucceedsEqual: '\u2AB0',
+ SucceedsSlantEqual: '\u227D',
+ SucceedsTilde: '\u227F',
+ succeq: '\u2AB0',
+ succnapprox: '\u2ABA',
+ succneqq: '\u2AB6',
+ succnsim: '\u22E9',
+ succsim: '\u227F',
+ SuchThat: '\u220B',
+ Sum: '\u2211',
+ sum: '\u2211',
+ sung: '\u266A',
+ Sup: '\u22D1',
+ sup: '\u2283',
+ sup1: '\u00B9',
+ sup2: '\u00B2',
+ sup3: '\u00B3',
+ supdot: '\u2ABE',
+ supdsub: '\u2AD8',
+ supE: '\u2AC6',
+ supe: '\u2287',
+ supedot: '\u2AC4',
+ Superset: '\u2283',
+ SupersetEqual: '\u2287',
+ suphsol: '\u27C9',
+ suphsub: '\u2AD7',
+ suplarr: '\u297B',
+ supmult: '\u2AC2',
+ supnE: '\u2ACC',
+ supne: '\u228B',
+ supplus: '\u2AC0',
+ Supset: '\u22D1',
+ supset: '\u2283',
+ supseteq: '\u2287',
+ supseteqq: '\u2AC6',
+ supsetneq: '\u228B',
+ supsetneqq: '\u2ACC',
+ supsim: '\u2AC8',
+ supsub: '\u2AD4',
+ supsup: '\u2AD6',
+ swarhk: '\u2926',
+ swArr: '\u21D9',
+ swarr: '\u2199',
+ swarrow: '\u2199',
+ swnwar: '\u292A',
+ szlig: '\u00DF',
+ Tab: '\u0009',
+ target: '\u2316',
+ Tau: '\u03A4',
+ tau: '\u03C4',
+ tbrk: '\u23B4',
+ Tcaron: '\u0164',
+ tcaron: '\u0165',
+ Tcedil: '\u0162',
+ tcedil: '\u0163',
+ Tcy: '\u0422',
+ tcy: '\u0442',
+ tdot: '\u20DB',
+ telrec: '\u2315',
+ Tfr: '\uD835\uDD17',
+ tfr: '\uD835\uDD31',
+ there4: '\u2234',
+ Therefore: '\u2234',
+ therefore: '\u2234',
+ Theta: '\u0398',
+ theta: '\u03B8',
+ thetasym: '\u03D1',
+ thetav: '\u03D1',
+ thickapprox: '\u2248',
+ thicksim: '\u223C',
+ ThickSpace: '\u205F\u200A',
+ thinsp: '\u2009',
+ ThinSpace: '\u2009',
+ thkap: '\u2248',
+ thksim: '\u223C',
+ THORN: '\u00DE',
+ thorn: '\u00FE',
+ Tilde: '\u223C',
+ tilde: '\u02DC',
+ TildeEqual: '\u2243',
+ TildeFullEqual: '\u2245',
+ TildeTilde: '\u2248',
+ times: '\u00D7',
+ timesb: '\u22A0',
+ timesbar: '\u2A31',
+ timesd: '\u2A30',
+ tint: '\u222D',
+ toea: '\u2928',
+ top: '\u22A4',
+ topbot: '\u2336',
+ topcir: '\u2AF1',
+ Topf: '\uD835\uDD4B',
+ topf: '\uD835\uDD65',
+ topfork: '\u2ADA',
+ tosa: '\u2929',
+ tprime: '\u2034',
+ TRADE: '\u2122',
+ trade: '\u2122',
+ triangle: '\u25B5',
+ triangledown: '\u25BF',
+ triangleleft: '\u25C3',
+ trianglelefteq: '\u22B4',
+ triangleq: '\u225C',
+ triangleright: '\u25B9',
+ trianglerighteq: '\u22B5',
+ tridot: '\u25EC',
+ trie: '\u225C',
+ triminus: '\u2A3A',
+ TripleDot: '\u20DB',
+ triplus: '\u2A39',
+ trisb: '\u29CD',
+ tritime: '\u2A3B',
+ trpezium: '\u23E2',
+ Tscr: '\uD835\uDCAF',
+ tscr: '\uD835\uDCC9',
+ TScy: '\u0426',
+ tscy: '\u0446',
+ TSHcy: '\u040B',
+ tshcy: '\u045B',
+ Tstrok: '\u0166',
+ tstrok: '\u0167',
+ twixt: '\u226C',
+ twoheadleftarrow: '\u219E',
+ twoheadrightarrow: '\u21A0',
+ Uacute: '\u00DA',
+ uacute: '\u00FA',
+ Uarr: '\u219F',
+ uArr: '\u21D1',
+ uarr: '\u2191',
+ Uarrocir: '\u2949',
+ Ubrcy: '\u040E',
+ ubrcy: '\u045E',
+ Ubreve: '\u016C',
+ ubreve: '\u016D',
+ Ucirc: '\u00DB',
+ ucirc: '\u00FB',
+ Ucy: '\u0423',
+ ucy: '\u0443',
+ udarr: '\u21C5',
+ Udblac: '\u0170',
+ udblac: '\u0171',
+ udhar: '\u296E',
+ ufisht: '\u297E',
+ Ufr: '\uD835\uDD18',
+ ufr: '\uD835\uDD32',
+ Ugrave: '\u00D9',
+ ugrave: '\u00F9',
+ uHar: '\u2963',
+ uharl: '\u21BF',
+ uharr: '\u21BE',
+ uhblk: '\u2580',
+ ulcorn: '\u231C',
+ ulcorner: '\u231C',
+ ulcrop: '\u230F',
+ ultri: '\u25F8',
+ Umacr: '\u016A',
+ umacr: '\u016B',
+ uml: '\u00A8',
+ UnderBar: '\u005F',
+ UnderBrace: '\u23DF',
+ UnderBracket: '\u23B5',
+ UnderParenthesis: '\u23DD',
+ Union: '\u22C3',
+ UnionPlus: '\u228E',
+ Uogon: '\u0172',
+ uogon: '\u0173',
+ Uopf: '\uD835\uDD4C',
+ uopf: '\uD835\uDD66',
+ UpArrow: '\u2191',
+ Uparrow: '\u21D1',
+ uparrow: '\u2191',
+ UpArrowBar: '\u2912',
+ UpArrowDownArrow: '\u21C5',
+ UpDownArrow: '\u2195',
+ Updownarrow: '\u21D5',
+ updownarrow: '\u2195',
+ UpEquilibrium: '\u296E',
+ upharpoonleft: '\u21BF',
+ upharpoonright: '\u21BE',
+ uplus: '\u228E',
+ UpperLeftArrow: '\u2196',
+ UpperRightArrow: '\u2197',
+ Upsi: '\u03D2',
+ upsi: '\u03C5',
+ upsih: '\u03D2',
+ Upsilon: '\u03A5',
+ upsilon: '\u03C5',
+ UpTee: '\u22A5',
+ UpTeeArrow: '\u21A5',
+ upuparrows: '\u21C8',
+ urcorn: '\u231D',
+ urcorner: '\u231D',
+ urcrop: '\u230E',
+ Uring: '\u016E',
+ uring: '\u016F',
+ urtri: '\u25F9',
+ Uscr: '\uD835\uDCB0',
+ uscr: '\uD835\uDCCA',
+ utdot: '\u22F0',
+ Utilde: '\u0168',
+ utilde: '\u0169',
+ utri: '\u25B5',
+ utrif: '\u25B4',
+ uuarr: '\u21C8',
+ Uuml: '\u00DC',
+ uuml: '\u00FC',
+ uwangle: '\u29A7',
+ vangrt: '\u299C',
+ varepsilon: '\u03F5',
+ varkappa: '\u03F0',
+ varnothing: '\u2205',
+ varphi: '\u03D5',
+ varpi: '\u03D6',
+ varpropto: '\u221D',
+ vArr: '\u21D5',
+ varr: '\u2195',
+ varrho: '\u03F1',
+ varsigma: '\u03C2',
+ varsubsetneq: '\u228A\uFE00',
+ varsubsetneqq: '\u2ACB\uFE00',
+ varsupsetneq: '\u228B\uFE00',
+ varsupsetneqq: '\u2ACC\uFE00',
+ vartheta: '\u03D1',
+ vartriangleleft: '\u22B2',
+ vartriangleright: '\u22B3',
+ Vbar: '\u2AEB',
+ vBar: '\u2AE8',
+ vBarv: '\u2AE9',
+ Vcy: '\u0412',
+ vcy: '\u0432',
+ VDash: '\u22AB',
+ Vdash: '\u22A9',
+ vDash: '\u22A8',
+ vdash: '\u22A2',
+ Vdashl: '\u2AE6',
+ Vee: '\u22C1',
+ vee: '\u2228',
+ veebar: '\u22BB',
+ veeeq: '\u225A',
+ vellip: '\u22EE',
+ Verbar: '\u2016',
+ verbar: '\u007C',
+ Vert: '\u2016',
+ vert: '\u007C',
+ VerticalBar: '\u2223',
+ VerticalLine: '\u007C',
+ VerticalSeparator: '\u2758',
+ VerticalTilde: '\u2240',
+ VeryThinSpace: '\u200A',
+ Vfr: '\uD835\uDD19',
+ vfr: '\uD835\uDD33',
+ vltri: '\u22B2',
+ vnsub: '\u2282\u20D2',
+ vnsup: '\u2283\u20D2',
+ Vopf: '\uD835\uDD4D',
+ vopf: '\uD835\uDD67',
+ vprop: '\u221D',
+ vrtri: '\u22B3',
+ Vscr: '\uD835\uDCB1',
+ vscr: '\uD835\uDCCB',
+ vsubnE: '\u2ACB\uFE00',
+ vsubne: '\u228A\uFE00',
+ vsupnE: '\u2ACC\uFE00',
+ vsupne: '\u228B\uFE00',
+ Vvdash: '\u22AA',
+ vzigzag: '\u299A',
+ Wcirc: '\u0174',
+ wcirc: '\u0175',
+ wedbar: '\u2A5F',
+ Wedge: '\u22C0',
+ wedge: '\u2227',
+ wedgeq: '\u2259',
+ weierp: '\u2118',
+ Wfr: '\uD835\uDD1A',
+ wfr: '\uD835\uDD34',
+ Wopf: '\uD835\uDD4E',
+ wopf: '\uD835\uDD68',
+ wp: '\u2118',
+ wr: '\u2240',
+ wreath: '\u2240',
+ Wscr: '\uD835\uDCB2',
+ wscr: '\uD835\uDCCC',
+ xcap: '\u22C2',
+ xcirc: '\u25EF',
+ xcup: '\u22C3',
+ xdtri: '\u25BD',
+ Xfr: '\uD835\uDD1B',
+ xfr: '\uD835\uDD35',
+ xhArr: '\u27FA',
+ xharr: '\u27F7',
+ Xi: '\u039E',
+ xi: '\u03BE',
+ xlArr: '\u27F8',
+ xlarr: '\u27F5',
+ xmap: '\u27FC',
+ xnis: '\u22FB',
+ xodot: '\u2A00',
+ Xopf: '\uD835\uDD4F',
+ xopf: '\uD835\uDD69',
+ xoplus: '\u2A01',
+ xotime: '\u2A02',
+ xrArr: '\u27F9',
+ xrarr: '\u27F6',
+ Xscr: '\uD835\uDCB3',
+ xscr: '\uD835\uDCCD',
+ xsqcup: '\u2A06',
+ xuplus: '\u2A04',
+ xutri: '\u25B3',
+ xvee: '\u22C1',
+ xwedge: '\u22C0',
+ Yacute: '\u00DD',
+ yacute: '\u00FD',
+ YAcy: '\u042F',
+ yacy: '\u044F',
+ Ycirc: '\u0176',
+ ycirc: '\u0177',
+ Ycy: '\u042B',
+ ycy: '\u044B',
+ yen: '\u00A5',
+ Yfr: '\uD835\uDD1C',
+ yfr: '\uD835\uDD36',
+ YIcy: '\u0407',
+ yicy: '\u0457',
+ Yopf: '\uD835\uDD50',
+ yopf: '\uD835\uDD6A',
+ Yscr: '\uD835\uDCB4',
+ yscr: '\uD835\uDCCE',
+ YUcy: '\u042E',
+ yucy: '\u044E',
+ Yuml: '\u0178',
+ yuml: '\u00FF',
+ Zacute: '\u0179',
+ zacute: '\u017A',
+ Zcaron: '\u017D',
+ zcaron: '\u017E',
+ Zcy: '\u0417',
+ zcy: '\u0437',
+ Zdot: '\u017B',
+ zdot: '\u017C',
+ zeetrf: '\u2128',
+ ZeroWidthSpace: '\u200B',
+ Zeta: '\u0396',
+ zeta: '\u03B6',
+ Zfr: '\u2128',
+ zfr: '\uD835\uDD37',
+ ZHcy: '\u0416',
+ zhcy: '\u0436',
+ zigrarr: '\u21DD',
+ Zopf: '\u2124',
+ zopf: '\uD835\uDD6B',
+ Zscr: '\uD835\uDCB5',
+ zscr: '\uD835\uDCCF',
+ zwj: '\u200D',
+ zwnj: '\u200C',
+});
+
+/**
+ * @deprecated use `HTML_ENTITIES` instead
+ * @see HTML_ENTITIES
+ */
+exports.entityMap = exports.HTML_ENTITIES;
diff --git a/generator/node_modules/@xmldom/xmldom/lib/index.js b/generator/node_modules/@xmldom/xmldom/lib/index.js
new file mode 100644
index 0000000..df827f6
--- /dev/null
+++ b/generator/node_modules/@xmldom/xmldom/lib/index.js
@@ -0,0 +1,4 @@
+var dom = require('./dom')
+exports.DOMImplementation = dom.DOMImplementation
+exports.XMLSerializer = dom.XMLSerializer
+exports.DOMParser = require('./dom-parser').DOMParser
diff --git a/generator/node_modules/@xmldom/xmldom/lib/sax.js b/generator/node_modules/@xmldom/xmldom/lib/sax.js
new file mode 100644
index 0000000..2ec3ea1
--- /dev/null
+++ b/generator/node_modules/@xmldom/xmldom/lib/sax.js
@@ -0,0 +1,662 @@
+var NAMESPACE = require("./conventions").NAMESPACE;
+
+//[4] NameStartChar ::= ":" | [A-Z] | "_" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]
+//[4a] NameChar ::= NameStartChar | "-" | "." | [0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040]
+//[5] Name ::= NameStartChar (NameChar)*
+var nameStartChar = /[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]///\u10000-\uEFFFF
+var nameChar = new RegExp("[\\-\\.0-9"+nameStartChar.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]");
+var tagNamePattern = new RegExp('^'+nameStartChar.source+nameChar.source+'*(?:\:'+nameStartChar.source+nameChar.source+'*)?$');
+//var tagNamePattern = /^[a-zA-Z_][\w\-\.]*(?:\:[a-zA-Z_][\w\-\.]*)?$/
+//var handlers = 'resolveEntity,getExternalSubset,characters,endDocument,endElement,endPrefixMapping,ignorableWhitespace,processingInstruction,setDocumentLocator,skippedEntity,startDocument,startElement,startPrefixMapping,notationDecl,unparsedEntityDecl,error,fatalError,warning,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,comment,endCDATA,endDTD,endEntity,startCDATA,startDTD,startEntity'.split(',')
+
+//S_TAG, S_ATTR, S_EQ, S_ATTR_NOQUOT_VALUE
+//S_ATTR_SPACE, S_ATTR_END, S_TAG_SPACE, S_TAG_CLOSE
+var S_TAG = 0;//tag name offerring
+var S_ATTR = 1;//attr name offerring
+var S_ATTR_SPACE=2;//attr name end and space offer
+var S_EQ = 3;//=space?
+var S_ATTR_NOQUOT_VALUE = 4;//attr value(no quot value only)
+var S_ATTR_END = 5;//attr value end and no space(quot end)
+var S_TAG_SPACE = 6;//(attr value end || tag end ) && (space offer)
+var S_TAG_CLOSE = 7;//closed el<el />
+
+/**
+ * Creates an error that will not be caught by XMLReader aka the SAX parser.
+ *
+ * @param {string} message
+ * @param {any?} locator Optional, can provide details about the location in the source
+ * @constructor
+ */
+function ParseError(message, locator) {
+ this.message = message
+ this.locator = locator
+ if(Error.captureStackTrace) Error.captureStackTrace(this, ParseError);
+}
+ParseError.prototype = new Error();
+ParseError.prototype.name = ParseError.name
+
+function XMLReader(){
+
+}
+
+XMLReader.prototype = {
+ parse:function(source,defaultNSMap,entityMap){
+ var domBuilder = this.domBuilder;
+ domBuilder.startDocument();
+ _copy(defaultNSMap ,defaultNSMap = {})
+ parse(source,defaultNSMap,entityMap,
+ domBuilder,this.errorHandler);
+ domBuilder.endDocument();
+ }
+}
+function parse(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){
+ function fixedFromCharCode(code) {
+ // String.prototype.fromCharCode does not supports
+ // > 2 bytes unicode chars directly
+ if (code > 0xffff) {
+ code -= 0x10000;
+ var surrogate1 = 0xd800 + (code >> 10)
+ , surrogate2 = 0xdc00 + (code & 0x3ff);
+
+ return String.fromCharCode(surrogate1, surrogate2);
+ } else {
+ return String.fromCharCode(code);
+ }
+ }
+ function entityReplacer(a){
+ var k = a.slice(1,-1);
+ if (Object.hasOwnProperty.call(entityMap, k)) {
+ return entityMap[k];
+ }else if(k.charAt(0) === '#'){
+ return fixedFromCharCode(parseInt(k.substr(1).replace('x','0x')))
+ }else{
+ errorHandler.error('entity not found:'+a);
+ return a;
+ }
+ }
+ function appendText(end){//has some bugs
+ if(end>start){
+ var xt = source.substring(start,end).replace(/&#?\w+;/g,entityReplacer);
+ locator&&position(start);
+ domBuilder.characters(xt,0,end-start);
+ start = end
+ }
+ }
+ function position(p,m){
+ while(p>=lineEnd && (m = linePattern.exec(source))){
+ lineStart = m.index;
+ lineEnd = lineStart + m[0].length;
+ locator.lineNumber++;
+ //console.log('line++:',locator,startPos,endPos)
+ }
+ locator.columnNumber = p-lineStart+1;
+ }
+ var lineStart = 0;
+ var lineEnd = 0;
+ var linePattern = /.*(?:\r\n?|\n)|.*$/g
+ var locator = domBuilder.locator;
+
+ var parseStack = [{currentNSMap:defaultNSMapCopy}]
+ var closeMap = {};
+ var start = 0;
+ while(true){
+ try{
+ var tagStart = source.indexOf('<',start);
+ if(tagStart<0){
+ if(!source.substr(start).match(/^\s*$/)){
+ var doc = domBuilder.doc;
+ var text = doc.createTextNode(source.substr(start));
+ doc.appendChild(text);
+ domBuilder.currentElement = text;
+ }
+ return;
+ }
+ if(tagStart>start){
+ appendText(tagStart);
+ }
+ switch(source.charAt(tagStart+1)){
+ case '/':
+ var end = source.indexOf('>',tagStart+3);
+ var tagName = source.substring(tagStart + 2, end).replace(/[ \t\n\r]+$/g, '');
+ var config = parseStack.pop();
+ if(end<0){
+
+ tagName = source.substring(tagStart+2).replace(/[\s<].*/,'');
+ errorHandler.error("end tag name: "+tagName+' is not complete:'+config.tagName);
+ end = tagStart+1+tagName.length;
+ }else if(tagName.match(/\s</)){
+ tagName = tagName.replace(/[\s<].*/,'');
+ errorHandler.error("end tag name: "+tagName+' maybe not complete');
+ end = tagStart+1+tagName.length;
+ }
+ var localNSMap = config.localNSMap;
+ var endMatch = config.tagName == tagName;
+ var endIgnoreCaseMach = endMatch || config.tagName&&config.tagName.toLowerCase() == tagName.toLowerCase()
+ if(endIgnoreCaseMach){
+ domBuilder.endElement(config.uri,config.localName,tagName);
+ if(localNSMap){
+ for (var prefix in localNSMap) {
+ if (Object.prototype.hasOwnProperty.call(localNSMap, prefix)) {
+ domBuilder.endPrefixMapping(prefix);
+ }
+ }
+ }
+ if(!endMatch){
+ errorHandler.fatalError("end tag name: "+tagName+' is not match the current start tagName:'+config.tagName ); // No known test case
+ }
+ }else{
+ parseStack.push(config)
+ }
+
+ end++;
+ break;
+ // end elment
+ case '?':// <?...?>
+ locator&&position(tagStart);
+ end = parseInstruction(source,tagStart,domBuilder);
+ break;
+ case '!':// <!doctype,<![CDATA,<!--
+ locator&&position(tagStart);
+ end = parseDCC(source,tagStart,domBuilder,errorHandler);
+ break;
+ default:
+ locator&&position(tagStart);
+ var el = new ElementAttributes();
+ var currentNSMap = parseStack[parseStack.length-1].currentNSMap;
+ //elStartEnd
+ var end = parseElementStartPart(source,tagStart,el,currentNSMap,entityReplacer,errorHandler);
+ var len = el.length;
+
+
+ if(!el.closed && fixSelfClosed(source,end,el.tagName,closeMap)){
+ el.closed = true;
+ if(!entityMap.nbsp){
+ errorHandler.warning('unclosed xml attribute');
+ }
+ }
+ if(locator && len){
+ var locator2 = copyLocator(locator,{});
+ //try{//attribute position fixed
+ for(var i = 0;i<len;i++){
+ var a = el[i];
+ position(a.offset);
+ a.locator = copyLocator(locator,{});
+ }
+ domBuilder.locator = locator2
+ if(appendElement(el,domBuilder,currentNSMap)){
+ parseStack.push(el)
+ }
+ domBuilder.locator = locator;
+ }else{
+ if(appendElement(el,domBuilder,currentNSMap)){
+ parseStack.push(el)
+ }
+ }
+
+ if (NAMESPACE.isHTML(el.uri) && !el.closed) {
+ end = parseHtmlSpecialContent(source,end,el.tagName,entityReplacer,domBuilder)
+ } else {
+ end++;
+ }
+ }
+ }catch(e){
+ if (e instanceof ParseError) {
+ throw e;
+ }
+ errorHandler.error('element parse error: '+e)
+ end = -1;
+ }
+ if(end>start){
+ start = end;
+ }else{
+ //TODO: 这里有可能sax回退,有位置错误风险
+ appendText(Math.max(tagStart,start)+1);
+ }
+ }
+}
+function copyLocator(f,t){
+ t.lineNumber = f.lineNumber;
+ t.columnNumber = f.columnNumber;
+ return t;
+}
+
+/**
+ * @see #appendElement(source,elStartEnd,el,selfClosed,entityReplacer,domBuilder,parseStack);
+ * @return end of the elementStartPart(end of elementEndPart for selfClosed el)
+ */
+function parseElementStartPart(source,start,el,currentNSMap,entityReplacer,errorHandler){
+
+ /**
+ * @param {string} qname
+ * @param {string} value
+ * @param {number} startIndex
+ */
+ function addAttribute(qname, value, startIndex) {
+ if (el.attributeNames.hasOwnProperty(qname)) {
+ errorHandler.fatalError('Attribute ' + qname + ' redefined')
+ }
+ el.addValue(
+ qname,
+ // @see https://www.w3.org/TR/xml/#AVNormalize
+ // since the xmldom sax parser does not "interpret" DTD the following is not implemented:
+ // - recursive replacement of (DTD) entity references
+ // - trimming and collapsing multiple spaces into a single one for attributes that are not of type CDATA
+ value.replace(/[\t\n\r]/g, ' ').replace(/&#?\w+;/g, entityReplacer),
+ startIndex
+ )
+ }
+ var attrName;
+ var value;
+ var p = ++start;
+ var s = S_TAG;//status
+ while(true){
+ var c = source.charAt(p);
+ switch(c){
+ case '=':
+ if(s === S_ATTR){//attrName
+ attrName = source.slice(start,p);
+ s = S_EQ;
+ }else if(s === S_ATTR_SPACE){
+ s = S_EQ;
+ }else{
+ //fatalError: equal must after attrName or space after attrName
+ throw new Error('attribute equal must after attrName'); // No known test case
+ }
+ break;
+ case '\'':
+ case '"':
+ if(s === S_EQ || s === S_ATTR //|| s == S_ATTR_SPACE
+ ){//equal
+ if(s === S_ATTR){
+ errorHandler.warning('attribute value must after "="')
+ attrName = source.slice(start,p)
+ }
+ start = p+1;
+ p = source.indexOf(c,start)
+ if(p>0){
+ value = source.slice(start, p);
+ addAttribute(attrName, value, start-1);
+ s = S_ATTR_END;
+ }else{
+ //fatalError: no end quot match
+ throw new Error('attribute value no end \''+c+'\' match');
+ }
+ }else if(s == S_ATTR_NOQUOT_VALUE){
+ value = source.slice(start, p);
+ addAttribute(attrName, value, start);
+ errorHandler.warning('attribute "'+attrName+'" missed start quot('+c+')!!');
+ start = p+1;
+ s = S_ATTR_END
+ }else{
+ //fatalError: no equal before
+ throw new Error('attribute value must after "="'); // No known test case
+ }
+ break;
+ case '/':
+ switch(s){
+ case S_TAG:
+ el.setTagName(source.slice(start,p));
+ case S_ATTR_END:
+ case S_TAG_SPACE:
+ case S_TAG_CLOSE:
+ s =S_TAG_CLOSE;
+ el.closed = true;
+ case S_ATTR_NOQUOT_VALUE:
+ case S_ATTR:
+ break;
+ case S_ATTR_SPACE:
+ el.closed = true;
+ break;
+ //case S_EQ:
+ default:
+ throw new Error("attribute invalid close char('/')") // No known test case
+ }
+ break;
+ case ''://end document
+ errorHandler.error('unexpected end of input');
+ if(s == S_TAG){
+ el.setTagName(source.slice(start,p));
+ }
+ return p;
+ case '>':
+ switch(s){
+ case S_TAG:
+ el.setTagName(source.slice(start,p));
+ case S_ATTR_END:
+ case S_TAG_SPACE:
+ case S_TAG_CLOSE:
+ break;//normal
+ case S_ATTR_NOQUOT_VALUE://Compatible state
+ case S_ATTR:
+ value = source.slice(start,p);
+ if(value.slice(-1) === '/'){
+ el.closed = true;
+ value = value.slice(0,-1)
+ }
+ case S_ATTR_SPACE:
+ if(s === S_ATTR_SPACE){
+ value = attrName;
+ }
+ if(s == S_ATTR_NOQUOT_VALUE){
+ errorHandler.warning('attribute "'+value+'" missed quot(")!');
+ addAttribute(attrName, value, start)
+ }else{
+ if(!NAMESPACE.isHTML(currentNSMap['']) || !value.match(/^(?:disabled|checked|selected)$/i)){
+ errorHandler.warning('attribute "'+value+'" missed value!! "'+value+'" instead!!')
+ }
+ addAttribute(value, value, start)
+ }
+ break;
+ case S_EQ:
+ throw new Error('attribute value missed!!');
+ }
+// console.log(tagName,tagNamePattern,tagNamePattern.test(tagName))
+ return p;
+ /*xml space '\x20' | #x9 | #xD | #xA; */
+ case '\u0080':
+ c = ' ';
+ default:
+ if(c<= ' '){//space
+ switch(s){
+ case S_TAG:
+ el.setTagName(source.slice(start,p));//tagName
+ s = S_TAG_SPACE;
+ break;
+ case S_ATTR:
+ attrName = source.slice(start,p)
+ s = S_ATTR_SPACE;
+ break;
+ case S_ATTR_NOQUOT_VALUE:
+ var value = source.slice(start, p);
+ errorHandler.warning('attribute "'+value+'" missed quot(")!!');
+ addAttribute(attrName, value, start)
+ case S_ATTR_END:
+ s = S_TAG_SPACE;
+ break;
+ //case S_TAG_SPACE:
+ //case S_EQ:
+ //case S_ATTR_SPACE:
+ // void();break;
+ //case S_TAG_CLOSE:
+ //ignore warning
+ }
+ }else{//not space
+//S_TAG, S_ATTR, S_EQ, S_ATTR_NOQUOT_VALUE
+//S_ATTR_SPACE, S_ATTR_END, S_TAG_SPACE, S_TAG_CLOSE
+ switch(s){
+ //case S_TAG:void();break;
+ //case S_ATTR:void();break;
+ //case S_ATTR_NOQUOT_VALUE:void();break;
+ case S_ATTR_SPACE:
+ var tagName = el.tagName;
+ if (!NAMESPACE.isHTML(currentNSMap['']) || !attrName.match(/^(?:disabled|checked|selected)$/i)) {
+ errorHandler.warning('attribute "'+attrName+'" missed value!! "'+attrName+'" instead2!!')
+ }
+ addAttribute(attrName, attrName, start);
+ start = p;
+ s = S_ATTR;
+ break;
+ case S_ATTR_END:
+ errorHandler.warning('attribute space is required"'+attrName+'"!!')
+ case S_TAG_SPACE:
+ s = S_ATTR;
+ start = p;
+ break;
+ case S_EQ:
+ s = S_ATTR_NOQUOT_VALUE;
+ start = p;
+ break;
+ case S_TAG_CLOSE:
+ throw new Error("elements closed character '/' and '>' must be connected to");
+ }
+ }
+ }//end outer switch
+ //console.log('p++',p)
+ p++;
+ }
+}
+/**
+ * @return true if has new namespace define
+ */
+function appendElement(el,domBuilder,currentNSMap){
+ var tagName = el.tagName;
+ var localNSMap = null;
+ //var currentNSMap = parseStack[parseStack.length-1].currentNSMap;
+ var i = el.length;
+ while(i--){
+ var a = el[i];
+ var qName = a.qName;
+ var value = a.value;
+ var nsp = qName.indexOf(':');
+ if(nsp>0){
+ var prefix = a.prefix = qName.slice(0,nsp);
+ var localName = qName.slice(nsp+1);
+ var nsPrefix = prefix === 'xmlns' && localName
+ }else{
+ localName = qName;
+ prefix = null
+ nsPrefix = qName === 'xmlns' && ''
+ }
+ //can not set prefix,because prefix !== ''
+ a.localName = localName ;
+ //prefix == null for no ns prefix attribute
+ if(nsPrefix !== false){//hack!!
+ if(localNSMap == null){
+ localNSMap = {}
+ //console.log(currentNSMap,0)
+ _copy(currentNSMap,currentNSMap={})
+ //console.log(currentNSMap,1)
+ }
+ currentNSMap[nsPrefix] = localNSMap[nsPrefix] = value;
+ a.uri = NAMESPACE.XMLNS
+ domBuilder.startPrefixMapping(nsPrefix, value)
+ }
+ }
+ var i = el.length;
+ while(i--){
+ a = el[i];
+ var prefix = a.prefix;
+ if(prefix){//no prefix attribute has no namespace
+ if(prefix === 'xml'){
+ a.uri = NAMESPACE.XML;
+ }if(prefix !== 'xmlns'){
+ a.uri = currentNSMap[prefix || '']
+
+ //{console.log('###'+a.qName,domBuilder.locator.systemId+'',currentNSMap,a.uri)}
+ }
+ }
+ }
+ var nsp = tagName.indexOf(':');
+ if(nsp>0){
+ prefix = el.prefix = tagName.slice(0,nsp);
+ localName = el.localName = tagName.slice(nsp+1);
+ }else{
+ prefix = null;//important!!
+ localName = el.localName = tagName;
+ }
+ //no prefix element has default namespace
+ var ns = el.uri = currentNSMap[prefix || ''];
+ domBuilder.startElement(ns,localName,tagName,el);
+ //endPrefixMapping and startPrefixMapping have not any help for dom builder
+ //localNSMap = null
+ if(el.closed){
+ domBuilder.endElement(ns,localName,tagName);
+ if(localNSMap){
+ for (prefix in localNSMap) {
+ if (Object.prototype.hasOwnProperty.call(localNSMap, prefix)) {
+ domBuilder.endPrefixMapping(prefix);
+ }
+ }
+ }
+ }else{
+ el.currentNSMap = currentNSMap;
+ el.localNSMap = localNSMap;
+ //parseStack.push(el);
+ return true;
+ }
+}
+function parseHtmlSpecialContent(source,elStartEnd,tagName,entityReplacer,domBuilder){
+ if(/^(?:script|textarea)$/i.test(tagName)){
+ var elEndStart = source.indexOf('</'+tagName+'>',elStartEnd);
+ var text = source.substring(elStartEnd+1,elEndStart);
+ if(/[&<]/.test(text)){
+ if(/^script$/i.test(tagName)){
+ //if(!/\]\]>/.test(text)){
+ //lexHandler.startCDATA();
+ domBuilder.characters(text,0,text.length);
+ //lexHandler.endCDATA();
+ return elEndStart;
+ //}
+ }//}else{//text area
+ text = text.replace(/&#?\w+;/g,entityReplacer);
+ domBuilder.characters(text,0,text.length);
+ return elEndStart;
+ //}
+
+ }
+ }
+ return elStartEnd+1;
+}
+function fixSelfClosed(source,elStartEnd,tagName,closeMap){
+ //if(tagName in closeMap){
+ var pos = closeMap[tagName];
+ if(pos == null){
+ //console.log(tagName)
+ pos = source.lastIndexOf('</'+tagName+'>')
+ if(pos<elStartEnd){//忘记闭合
+ pos = source.lastIndexOf('</'+tagName)
+ }
+ closeMap[tagName] =pos
+ }
+ return pos<elStartEnd;
+ //}
+}
+
+function _copy (source, target) {
+ for (var n in source) {
+ if (Object.prototype.hasOwnProperty.call(source, n)) {
+ target[n] = source[n];
+ }
+ }
+}
+
+function parseDCC(source,start,domBuilder,errorHandler){//sure start with '<!'
+ var next= source.charAt(start+2)
+ switch(next){
+ case '-':
+ if(source.charAt(start + 3) === '-'){
+ var end = source.indexOf('-->',start+4);
+ //append comment source.substring(4,end)//<!--
+ if(end>start){
+ domBuilder.comment(source,start+4,end-start-4);
+ return end+3;
+ }else{
+ errorHandler.error("Unclosed comment");
+ return -1;
+ }
+ }else{
+ //error
+ return -1;
+ }
+ default:
+ if(source.substr(start+3,6) == 'CDATA['){
+ var end = source.indexOf(']]>',start+9);
+ domBuilder.startCDATA();
+ domBuilder.characters(source,start+9,end-start-9);
+ domBuilder.endCDATA()
+ return end+3;
+ }
+ //<!DOCTYPE
+ //startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId)
+ var matchs = split(source,start);
+ var len = matchs.length;
+ if(len>1 && /!doctype/i.test(matchs[0][0])){
+ var name = matchs[1][0];
+ var pubid = false;
+ var sysid = false;
+ if(len>3){
+ if(/^public$/i.test(matchs[2][0])){
+ pubid = matchs[3][0];
+ sysid = len>4 && matchs[4][0];
+ }else if(/^system$/i.test(matchs[2][0])){
+ sysid = matchs[3][0];
+ }
+ }
+ var lastMatch = matchs[len-1]
+ domBuilder.startDTD(name, pubid, sysid);
+ domBuilder.endDTD();
+
+ return lastMatch.index+lastMatch[0].length
+ }
+ }
+ return -1;
+}
+
+
+
+function parseInstruction(source,start,domBuilder){
+ var end = source.indexOf('?>',start);
+ if(end){
+ var match = source.substring(start,end).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);
+ if(match){
+ var len = match[0].length;
+ domBuilder.processingInstruction(match[1], match[2]) ;
+ return end+2;
+ }else{//error
+ return -1;
+ }
+ }
+ return -1;
+}
+
+function ElementAttributes(){
+ this.attributeNames = {}
+}
+ElementAttributes.prototype = {
+ setTagName:function(tagName){
+ if(!tagNamePattern.test(tagName)){
+ throw new Error('invalid tagName:'+tagName)
+ }
+ this.tagName = tagName
+ },
+ addValue:function(qName, value, offset) {
+ if(!tagNamePattern.test(qName)){
+ throw new Error('invalid attribute:'+qName)
+ }
+ this.attributeNames[qName] = this.length;
+ this[this.length++] = {qName:qName,value:value,offset:offset}
+ },
+ length:0,
+ getLocalName:function(i){return this[i].localName},
+ getLocator:function(i){return this[i].locator},
+ getQName:function(i){return this[i].qName},
+ getURI:function(i){return this[i].uri},
+ getValue:function(i){return this[i].value}
+// ,getIndex:function(uri, localName)){
+// if(localName){
+//
+// }else{
+// var qName = uri
+// }
+// },
+// getValue:function(){return this.getValue(this.getIndex.apply(this,arguments))},
+// getType:function(uri,localName){}
+// getType:function(i){},
+}
+
+
+
+function split(source,start){
+ var match;
+ var buf = [];
+ var reg = /'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;
+ reg.lastIndex = start;
+ reg.exec(source);//skip <
+ while(match = reg.exec(source)){
+ buf.push(match);
+ if(match[1])return buf;
+ }
+}
+
+exports.XMLReader = XMLReader;
+exports.ParseError = ParseError;
diff --git a/generator/node_modules/@xmldom/xmldom/package.json b/generator/node_modules/@xmldom/xmldom/package.json
new file mode 100644
index 0000000..9a79115
--- /dev/null
+++ b/generator/node_modules/@xmldom/xmldom/package.json
@@ -0,0 +1,71 @@
+{
+ "name": "@xmldom/xmldom",
+ "version": "0.8.10",
+ "description": "A pure JavaScript W3C standard-based (XML DOM Level 2 Core) DOMParser and XMLSerializer module.",
+ "keywords": [
+ "w3c",
+ "dom",
+ "xml",
+ "parser",
+ "javascript",
+ "DOMParser",
+ "XMLSerializer",
+ "ponyfill"
+ ],
+ "homepage": "https://github.com/xmldom/xmldom",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/xmldom/xmldom.git"
+ },
+ "main": "lib/index.js",
+ "types": "index.d.ts",
+ "files": [
+ "CHANGELOG.md",
+ "LICENSE",
+ "readme.md",
+ "SECURITY.md",
+ "index.d.ts",
+ "lib"
+ ],
+ "scripts": {
+ "lint": "eslint lib test",
+ "format": "prettier --write test",
+ "changelog": "auto-changelog --unreleased-only",
+ "start": "nodemon --watch package.json --watch lib --watch test --exec 'npm --silent run test && npm --silent run lint'",
+ "stryker": "stryker run",
+ "stryker:dry-run": "stryker run -m '' --reporters progress",
+ "test": "jest",
+ "testrelease": "npm test && eslint lib",
+ "version": "./changelog-has-version.sh",
+ "release": "np --no-yarn --test-script testrelease --branch release-0.8.x patch"
+ },
+ "engines": {
+ "node": ">=10.0.0"
+ },
+ "dependencies": {},
+ "devDependencies": {
+ "@stryker-mutator/core": "5.6.1",
+ "auto-changelog": "2.4.0",
+ "eslint": "8.25.0",
+ "eslint-config-prettier": "8.5.0",
+ "eslint-plugin-es5": "1.5.0",
+ "eslint-plugin-prettier": "4.2.1",
+ "get-stream": "6.0.1",
+ "jest": "27.5.1",
+ "nodemon": "2.0.20",
+ "np": "7.6.2",
+ "prettier": "2.7.1",
+ "xmltest": "1.5.0",
+ "yauzl": "2.10.0"
+ },
+ "bugs": {
+ "url": "https://github.com/xmldom/xmldom/issues"
+ },
+ "license": "MIT",
+ "auto-changelog": {
+ "prepend": true,
+ "remote": "upstream",
+ "tagPrefix": "",
+ "template": "./auto-changelog.hbs"
+ }
+}
diff --git a/generator/node_modules/@xmldom/xmldom/readme.md b/generator/node_modules/@xmldom/xmldom/readme.md
new file mode 100644
index 0000000..4700aa8
--- /dev/null
+++ b/generator/node_modules/@xmldom/xmldom/readme.md
@@ -0,0 +1,356 @@
+# @xmldom/xmldom
+
+***Since version 0.7.0 this package is published to npm as [`@xmldom/xmldom`](https://www.npmjs.com/package/@xmldom/xmldom) and no longer as [`xmldom`](https://www.npmjs.com/package/xmldom), because [we are no longer able to publish `xmldom`](https://github.com/xmldom/xmldom/issues/271).***
+*For better readability in the docs we will continue to talk about this library as "xmldom".*
+
+[![license(MIT)](https://img.shields.io/npm/l/@xmldom/xmldom?color=blue&style=flat-square)](https://github.com/xmldom/xmldom/blob/master/LICENSE)
+[![npm](https://img.shields.io/npm/v/@xmldom/xmldom?style=flat-square)](https://www.npmjs.com/package/@xmldom/xmldom)
+[![snyk.io package health](https://snyk.io/advisor/npm-package/@xmldom/xmldom/badge.svg)](https://snyk.io/advisor/npm-package/@xmldom/xmldom)
+[![bug issues](https://img.shields.io/github/issues/xmldom/xmldom/bug?color=red&style=flat-square)](https://github.com/xmldom/xmldom/issues?q=is%3Aissue+is%3Aopen+label%3Abug)
+[![help-wanted issues](https://img.shields.io/github/issues/xmldom/xmldom/help-wanted?color=darkgreen&style=flat-square)](https://github.com/xmldom/xmldom/issues?q=is%3Aissue+is%3Aopen+label%3Ahelp-wanted)
+[![Mutation report](https://img.shields.io/endpoint?style=flat-square&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fxmldom%2Fxmldom%2Fmaster)](https://dashboard.stryker-mutator.io/reports/github.com/xmldom/xmldom/master)
+
+
+xmldom is a javascript [ponyfill](https://ponyfill.com/) to provide the following APIs [that are present in modern browsers](https://caniuse.com/xml-serializer) to other runtimes:
+- convert an XML string into a DOM tree
+ ```
+ new DOMParser().parseFromString(xml, mimeType) => Document
+ ```
+- create, access and modify a DOM tree
+ ```
+ new DOMImplementation().createDocument(...) => Document
+ ```
+- serialize a DOM tree back into an XML string
+ ```
+ new XMLSerializer().serializeToString(node) => string
+ ```
+
+The target runtimes `xmldom` supports are currently Node >= v10 (ES5) and Rhino ([not tested as part of CI](https://github.com/xmldom/xmldom/discussions/214)).
+
+When deciding how to fix bugs or implement features, `xmldom` tries to stay as close as possible to the various [related specifications/standards](#specs).
+As indicated by the version starting with `0.`, this implementation is not feature complete and some implemented features differ from what the specifications describe.
+**Issues and PRs for such differences are always welcome, even when they only provide a failing test case.**
+
+This project was forked from it's [original source](https://github.com/jindw/xmldom) in 2019, more details about that transition can be found in the [CHANGELOG](CHANGELOG.md#maintainer-changes).
+
+## Usage
+
+### Install:
+
+> npm install @xmldom/xmldom
+
+### Example:
+
+[In NodeJS](examples/nodejs/src/index.js)
+```javascript
+const { DOMParser, XMLSerializer } = require('@xmldom/xmldom')
+
+const source = `<xml xmlns="a">
+ <child>test</child>
+ <child/>
+</xml>`
+
+const doc = new DOMParser().parseFromString(source, 'text/xml')
+
+const serialized = new XMLSerializer().serializeToString(doc)
+```
+
+Note: in Typescript ~and ES6~(see #316) you can use the `import` approach, as follows:
+
+```typescript
+import { DOMParser } from '@xmldom/xmldom'
+```
+
+## API Reference
+
+ * [DOMParser](https://developer.mozilla.org/en-US/docs/Web/API/DOMParser):
+
+ ```javascript
+ parseFromString(xmlsource,mimeType)
+ ```
+ * **options extension** _by xmldom_ (not DOM standard!!)
+
+ ```javascript
+ //added the options argument
+ new DOMParser(options)
+
+ //errorHandler is supported
+ new DOMParser({
+ /**
+ * locator is always need for error position info
+ */
+ locator:{},
+ /**
+ * you can override the errorHandler for xml parser
+ * @link http://www.saxproject.org/apidoc/org/xml/sax/ErrorHandler.html
+ */
+ errorHandler:{warning:function(w){console.warn(w)},error:callback,fatalError:callback}
+ //only callback model
+ //errorHandler:function(level,msg){console.log(level,msg)}
+ })
+
+ ```
+
+ * [XMLSerializer](https://developer.mozilla.org/en-US/docs/Web/API/XMLSerializer)
+
+ ```javascript
+ serializeToString(node)
+ ```
+### DOM level2 method and attribute:
+
+* [Node](http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-1950641247)
+
+ readonly class properties (aka `NodeType`),
+ these can be accessed from any `Node` instance `node`:
+ `if (node.nodeType === node.ELEMENT_NODE) {...`
+
+ 1. `ELEMENT_NODE` (`1`)
+ 2. `ATTRIBUTE_NODE` (`2`)
+ 3. `TEXT_NODE` (`3`)
+ 4. `CDATA_SECTION_NODE` (`4`)
+ 5. `ENTITY_REFERENCE_NODE` (`5`)
+ 6. `ENTITY_NODE` (`6`)
+ 7. `PROCESSING_INSTRUCTION_NODE` (`7`)
+ 8. `COMMENT_NODE` (`8`)
+ 9. `DOCUMENT_NODE` (`9`)
+ 10. `DOCUMENT_TYPE_NODE` (`10`)
+ 11. `DOCUMENT_FRAGMENT_NODE` (`11`)
+ 12. `NOTATION_NODE` (`12`)
+
+ attribute:
+ - `nodeValue` | `prefix`
+
+ readonly attribute:
+ - `nodeName` | `nodeType` | `parentNode` | `childNodes` | `firstChild` | `lastChild` | `previousSibling` | `nextSibling` | `attributes` | `ownerDocument` | `namespaceURI` | `localName`
+
+ method:
+ * `insertBefore(newChild, refChild)`
+ * `replaceChild(newChild, oldChild)`
+ * `removeChild(oldChild)`
+ * `appendChild(newChild)`
+ * `hasChildNodes()`
+ * `cloneNode(deep)`
+ * `normalize()`
+ * `isSupported(feature, version)`
+ * `hasAttributes()`
+* [DOMException](http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html)
+
+ extends the Error type thrown as part of DOM API.
+
+ readonly class properties:
+ - `INDEX_SIZE_ERR` (`1`)
+ - `DOMSTRING_SIZE_ERR` (`2`)
+ - `HIERARCHY_REQUEST_ERR` (`3`)
+ - `WRONG_DOCUMENT_ERR` (`4`)
+ - `INVALID_CHARACTER_ERR` (`5`)
+ - `NO_DATA_ALLOWED_ERR` (`6`)
+ - `NO_MODIFICATION_ALLOWED_ERR` (`7`)
+ - `NOT_FOUND_ERR` (`8`)
+ - `NOT_SUPPORTED_ERR` (`9`)
+ - `INUSE_ATTRIBUTE_ERR` (`10`)
+ - `INVALID_STATE_ERR` (`11`)
+ - `SYNTAX_ERR` (`12`)
+ - `INVALID_MODIFICATION_ERR` (`13`)
+ - `NAMESPACE_ERR` (`14`)
+ - `INVALID_ACCESS_ERR` (`15`)
+
+ attributes:
+ - `code` with a value matching one of the above constants.
+
+* [DOMImplementation](http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-102161490)
+
+ method:
+ - `hasFeature(feature, version)`
+ - `createDocumentType(qualifiedName, publicId, systemId)`
+ - `createDocument(namespaceURI, qualifiedName, doctype)`
+
+* [Document](http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#i-Document) : Node
+
+ readonly attribute:
+ - `doctype` | `implementation` | `documentElement`
+
+ method:
+ - `createElement(tagName)`
+ - `createDocumentFragment()`
+ - `createTextNode(data)`
+ - `createComment(data)`
+ - `createCDATASection(data)`
+ - `createProcessingInstruction(target, data)`
+ - `createAttribute(name)`
+ - `createEntityReference(name)`
+ - `getElementsByTagName(tagname)`
+ - `importNode(importedNode, deep)`
+ - `createElementNS(namespaceURI, qualifiedName)`
+ - `createAttributeNS(namespaceURI, qualifiedName)`
+ - `getElementsByTagNameNS(namespaceURI, localName)`
+ - `getElementById(elementId)`
+
+* [DocumentFragment](http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-B63ED1A3) : Node
+* [Element](http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-745549614) : Node
+
+ readonly attribute:
+ - `tagName`
+
+ method:
+ - `getAttribute(name)`
+ - `setAttribute(name, value)`
+ - `removeAttribute(name)`
+ - `getAttributeNode(name)`
+ - `setAttributeNode(newAttr)`
+ - `removeAttributeNode(oldAttr)`
+ - `getElementsByTagName(name)`
+ - `getAttributeNS(namespaceURI, localName)`
+ - `setAttributeNS(namespaceURI, qualifiedName, value)`
+ - `removeAttributeNS(namespaceURI, localName)`
+ - `getAttributeNodeNS(namespaceURI, localName)`
+ - `setAttributeNodeNS(newAttr)`
+ - `getElementsByTagNameNS(namespaceURI, localName)`
+ - `hasAttribute(name)`
+ - `hasAttributeNS(namespaceURI, localName)`
+
+* [Attr](http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-637646024) : Node
+
+ attribute:
+ - `value`
+
+ readonly attribute:
+ - `name` | `specified` | `ownerElement`
+
+* [NodeList](http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-536297177)
+
+ readonly attribute:
+ - `length`
+
+ method:
+ - `item(index)`
+
+* [NamedNodeMap](http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-1780488922)
+
+ readonly attribute:
+ - `length`
+
+ method:
+ - `getNamedItem(name)`
+ - `setNamedItem(arg)`
+ - `removeNamedItem(name)`
+ - `item(index)`
+ - `getNamedItemNS(namespaceURI, localName)`
+ - `setNamedItemNS(arg)`
+ - `removeNamedItemNS(namespaceURI, localName)`
+
+* [CharacterData](http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-FF21A306) : Node
+
+ method:
+ - `substringData(offset, count)`
+ - `appendData(arg)`
+ - `insertData(offset, arg)`
+ - `deleteData(offset, count)`
+ - `replaceData(offset, count, arg)`
+
+* [Text](http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-1312295772) : CharacterData
+
+ method:
+ - `splitText(offset)`
+
+* [CDATASection](http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-667469212)
+* [Comment](http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-1728279322) : CharacterData
+
+* [DocumentType](http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-412266927)
+
+ readonly attribute:
+ - `name` | `entities` | `notations` | `publicId` | `systemId` | `internalSubset`
+
+* Notation : Node
+
+ readonly attribute:
+ - `publicId` | `systemId`
+
+* Entity : Node
+
+ readonly attribute:
+ - `publicId` | `systemId` | `notationName`
+
+* EntityReference : Node
+* ProcessingInstruction : Node
+
+ attribute:
+ - `data`
+ readonly attribute:
+ - `target`
+
+### DOM level 3 support:
+
+* [Node](http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-textContent)
+
+ attribute:
+ - `textContent`
+
+ method:
+ - `isDefaultNamespace(namespaceURI)`
+ - `lookupNamespaceURI(prefix)`
+
+### DOM extension by xmldom
+
+* [Node] Source position extension;
+
+ attribute:
+ - `lineNumber` //number starting from `1`
+ - `columnNumber` //number starting from `1`
+
+## Specs
+
+The implementation is based on several specifications:
+
+<!-- Should open in new tab and the links in the SVG should be clickable there! -->
+<a href="https://raw.githubusercontent.com/xmldom/xmldom/master/docs/specs.svg" target="_blank" rel="noopener noreferrer nofollow" >![Overview of related specifications and their relations](docs/specs.svg)</a>
+
+### DOM Parsing and Serialization
+
+From the [W3C DOM Parsing and Serialization (WD 2016)](https://www.w3.org/TR/2016/WD-DOM-Parsing-20160517/) `xmldom` provides an implementation for the interfaces:
+- `DOMParser`
+- `XMLSerializer`
+
+Note that there are some known deviations between this implementation and the W3 specifications.
+
+Note: [The latest version of this spec](https://w3c.github.io/DOM-Parsing/) has the status "Editors Draft", since it is under active development. One major change is that [the definition of the `DOMParser` interface has been moved to the HTML spec](https://w3c.github.io/DOM-Parsing/#the-domparser-interface)
+
+
+### DOM
+
+The original author claims that xmldom implements [DOM Level 2] in a "fully compatible" way and some parts of [DOM Level 3], but there are not enough tests to prove this. Both Specifications are now superseded by the [DOM Level 4 aka Living standard] wich has a much broader scope than xmldom.
+
+xmldom implements the following interfaces (most constructors are currently not exposed):
+- `Attr`
+- `CDATASection`
+- `CharacterData`
+- `Comment`
+- `Document`
+- `DocumentFragment`
+- `DocumentType`
+- `DOMException` (constructor exposed)
+- `DOMImplementation` (constructor exposed)
+- `Element`
+- `Entity`
+- `EntityReference`
+- `LiveNodeList`
+- `NamedNodeMap`
+- `Node` (constructor exposed)
+- `NodeList`
+- `Notation`
+- `ProcessingInstruction`
+- `Text`
+
+more details are available in the (incomplete) [API Reference](#api-reference) section.
+
+### HTML
+
+xmldom does not have any goal of supporting the full spec, but it has some capability to parse, report and serialize things differently when "detecting HTML" (by checking the default namespace).
+There is an upcoming change to better align the implementation with the latest specs, related to <https://github.com/xmldom/xmldom/issues/203>.
+
+### SAX, XML, XMLNS
+
+xmldom has an own SAX parser implementation to do the actual parsing, which implements some interfaces in alignment with the Java interfaces SAX defines:
+- `XMLReader`
+- `DOMHandler`
+
+There is an idea/proposal to make it possible to replace it with something else in <https://github.com/xmldom/xmldom/issues/55>
diff --git a/generator/node_modules/base64-js/LICENSE b/generator/node_modules/base64-js/LICENSE
new file mode 100644
index 0000000..6d52b8a
--- /dev/null
+++ b/generator/node_modules/base64-js/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Jameson Little
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/generator/node_modules/base64-js/README.md b/generator/node_modules/base64-js/README.md
new file mode 100644
index 0000000..b42a48f
--- /dev/null
+++ b/generator/node_modules/base64-js/README.md
@@ -0,0 +1,34 @@
+base64-js
+=========
+
+`base64-js` does basic base64 encoding/decoding in pure JS.
+
+[![build status](https://secure.travis-ci.org/beatgammit/base64-js.png)](http://travis-ci.org/beatgammit/base64-js)
+
+Many browsers already have base64 encoding/decoding functionality, but it is for text data, not all-purpose binary data.
+
+Sometimes encoding/decoding binary data in the browser is useful, and that is what this module does.
+
+## install
+
+With [npm](https://npmjs.org) do:
+
+`npm install base64-js` and `var base64js = require('base64-js')`
+
+For use in web browsers do:
+
+`<script src="base64js.min.js"></script>`
+
+[Get supported base64-js with the Tidelift Subscription](https://tidelift.com/subscription/pkg/npm-base64-js?utm_source=npm-base64-js&utm_medium=referral&utm_campaign=readme)
+
+## methods
+
+`base64js` has three exposed functions, `byteLength`, `toByteArray` and `fromByteArray`, which both take a single argument.
+
+* `byteLength` - Takes a base64 string and returns length of byte array
+* `toByteArray` - Takes a base64 string and returns a byte array
+* `fromByteArray` - Takes a byte array and returns a base64 string
+
+## license
+
+MIT
diff --git a/generator/node_modules/base64-js/base64js.min.js b/generator/node_modules/base64-js/base64js.min.js
new file mode 100644
index 0000000..908ac83
--- /dev/null
+++ b/generator/node_modules/base64-js/base64js.min.js
@@ -0,0 +1 @@
+(function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"==typeof window?"undefined"==typeof global?"undefined"==typeof self?this:self:global:window,b.base64js=a()}})(function(){return function(){function b(d,e,g){function a(j,i){if(!e[j]){if(!d[j]){var f="function"==typeof require&&require;if(!i&&f)return f(j,!0);if(h)return h(j,!0);var c=new Error("Cannot find module '"+j+"'");throw c.code="MODULE_NOT_FOUND",c}var k=e[j]={exports:{}};d[j][0].call(k.exports,function(b){var c=d[j][1][b];return a(c||b)},k,k.exports,b,d,e,g)}return e[j].exports}for(var h="function"==typeof require&&require,c=0;c<g.length;c++)a(g[c]);return a}return b}()({"/":[function(a,b,c){'use strict';function d(a){var b=a.length;if(0<b%4)throw new Error("Invalid string. Length must be a multiple of 4");var c=a.indexOf("=");-1===c&&(c=b);var d=c===b?0:4-c%4;return[c,d]}function e(a,b,c){return 3*(b+c)/4-c}function f(a){var b,c,f=d(a),g=f[0],h=f[1],j=new m(e(a,g,h)),k=0,n=0<h?g-4:g;for(c=0;c<n;c+=4)b=l[a.charCodeAt(c)]<<18|l[a.charCodeAt(c+1)]<<12|l[a.charCodeAt(c+2)]<<6|l[a.charCodeAt(c+3)],j[k++]=255&b>>16,j[k++]=255&b>>8,j[k++]=255&b;return 2===h&&(b=l[a.charCodeAt(c)]<<2|l[a.charCodeAt(c+1)]>>4,j[k++]=255&b),1===h&&(b=l[a.charCodeAt(c)]<<10|l[a.charCodeAt(c+1)]<<4|l[a.charCodeAt(c+2)]>>2,j[k++]=255&b>>8,j[k++]=255&b),j}function g(a){return k[63&a>>18]+k[63&a>>12]+k[63&a>>6]+k[63&a]}function h(a,b,c){for(var d,e=[],f=b;f<c;f+=3)d=(16711680&a[f]<<16)+(65280&a[f+1]<<8)+(255&a[f+2]),e.push(g(d));return e.join("")}function j(a){for(var b,c=a.length,d=c%3,e=[],f=16383,g=0,j=c-d;g<j;g+=f)e.push(h(a,g,g+f>j?j:g+f));return 1===d?(b=a[c-1],e.push(k[b>>2]+k[63&b<<4]+"==")):2===d&&(b=(a[c-2]<<8)+a[c-1],e.push(k[b>>10]+k[63&b>>4]+k[63&b<<2]+"=")),e.join("")}c.byteLength=function(a){var b=d(a),c=b[0],e=b[1];return 3*(c+e)/4-e},c.toByteArray=f,c.fromByteArray=j;for(var k=[],l=[],m="undefined"==typeof Uint8Array?Array:Uint8Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,p=n.length;o<p;++o)k[o]=n[o],l[n.charCodeAt(o)]=o;l[45]=62,l[95]=63},{}]},{},[])("/")}); \ No newline at end of file
diff --git a/generator/node_modules/base64-js/index.d.ts b/generator/node_modules/base64-js/index.d.ts
new file mode 100644
index 0000000..7d9fa1d
--- /dev/null
+++ b/generator/node_modules/base64-js/index.d.ts
@@ -0,0 +1,3 @@
+export function byteLength(b64: string): number;
+export function toByteArray(b64: string): Uint8Array;
+export function fromByteArray(uint8: Uint8Array): string;
diff --git a/generator/node_modules/base64-js/index.js b/generator/node_modules/base64-js/index.js
new file mode 100644
index 0000000..0599f3e
--- /dev/null
+++ b/generator/node_modules/base64-js/index.js
@@ -0,0 +1,150 @@
+'use strict'
+
+exports.byteLength = byteLength
+exports.toByteArray = toByteArray
+exports.fromByteArray = fromByteArray
+
+var lookup = []
+var revLookup = []
+var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
+
+var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
+for (var i = 0, len = code.length; i < len; ++i) {
+ lookup[i] = code[i]
+ revLookup[code.charCodeAt(i)] = i
+}
+
+// Support decoding URL-safe base64 strings, as Node.js does.
+// See: https://en.wikipedia.org/wiki/Base64#URL_applications
+revLookup['-'.charCodeAt(0)] = 62
+revLookup['_'.charCodeAt(0)] = 63
+
+function getLens (b64) {
+ var len = b64.length
+
+ if (len % 4 > 0) {
+ throw new Error('Invalid string. Length must be a multiple of 4')
+ }
+
+ // Trim off extra bytes after placeholder bytes are found
+ // See: https://github.com/beatgammit/base64-js/issues/42
+ var validLen = b64.indexOf('=')
+ if (validLen === -1) validLen = len
+
+ var placeHoldersLen = validLen === len
+ ? 0
+ : 4 - (validLen % 4)
+
+ return [validLen, placeHoldersLen]
+}
+
+// base64 is 4/3 + up to two characters of the original data
+function byteLength (b64) {
+ var lens = getLens(b64)
+ var validLen = lens[0]
+ var placeHoldersLen = lens[1]
+ return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
+}
+
+function _byteLength (b64, validLen, placeHoldersLen) {
+ return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
+}
+
+function toByteArray (b64) {
+ var tmp
+ var lens = getLens(b64)
+ var validLen = lens[0]
+ var placeHoldersLen = lens[1]
+
+ var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
+
+ var curByte = 0
+
+ // if there are placeholders, only get up to the last complete 4 chars
+ var len = placeHoldersLen > 0
+ ? validLen - 4
+ : validLen
+
+ var i
+ for (i = 0; i < len; i += 4) {
+ tmp =
+ (revLookup[b64.charCodeAt(i)] << 18) |
+ (revLookup[b64.charCodeAt(i + 1)] << 12) |
+ (revLookup[b64.charCodeAt(i + 2)] << 6) |
+ revLookup[b64.charCodeAt(i + 3)]
+ arr[curByte++] = (tmp >> 16) & 0xFF
+ arr[curByte++] = (tmp >> 8) & 0xFF
+ arr[curByte++] = tmp & 0xFF
+ }
+
+ if (placeHoldersLen === 2) {
+ tmp =
+ (revLookup[b64.charCodeAt(i)] << 2) |
+ (revLookup[b64.charCodeAt(i + 1)] >> 4)
+ arr[curByte++] = tmp & 0xFF
+ }
+
+ if (placeHoldersLen === 1) {
+ tmp =
+ (revLookup[b64.charCodeAt(i)] << 10) |
+ (revLookup[b64.charCodeAt(i + 1)] << 4) |
+ (revLookup[b64.charCodeAt(i + 2)] >> 2)
+ arr[curByte++] = (tmp >> 8) & 0xFF
+ arr[curByte++] = tmp & 0xFF
+ }
+
+ return arr
+}
+
+function tripletToBase64 (num) {
+ return lookup[num >> 18 & 0x3F] +
+ lookup[num >> 12 & 0x3F] +
+ lookup[num >> 6 & 0x3F] +
+ lookup[num & 0x3F]
+}
+
+function encodeChunk (uint8, start, end) {
+ var tmp
+ var output = []
+ for (var i = start; i < end; i += 3) {
+ tmp =
+ ((uint8[i] << 16) & 0xFF0000) +
+ ((uint8[i + 1] << 8) & 0xFF00) +
+ (uint8[i + 2] & 0xFF)
+ output.push(tripletToBase64(tmp))
+ }
+ return output.join('')
+}
+
+function fromByteArray (uint8) {
+ var tmp
+ var len = uint8.length
+ var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
+ var parts = []
+ var maxChunkLength = 16383 // must be multiple of 3
+
+ // go through the array every three bytes, we'll deal with trailing stuff later
+ for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
+ parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
+ }
+
+ // pad the end with zeros, but make sure to not forget the extra bytes
+ if (extraBytes === 1) {
+ tmp = uint8[len - 1]
+ parts.push(
+ lookup[tmp >> 2] +
+ lookup[(tmp << 4) & 0x3F] +
+ '=='
+ )
+ } else if (extraBytes === 2) {
+ tmp = (uint8[len - 2] << 8) + uint8[len - 1]
+ parts.push(
+ lookup[tmp >> 10] +
+ lookup[(tmp >> 4) & 0x3F] +
+ lookup[(tmp << 2) & 0x3F] +
+ '='
+ )
+ }
+
+ return parts.join('')
+}
diff --git a/generator/node_modules/base64-js/package.json b/generator/node_modules/base64-js/package.json
new file mode 100644
index 0000000..c3972e3
--- /dev/null
+++ b/generator/node_modules/base64-js/package.json
@@ -0,0 +1,47 @@
+{
+ "name": "base64-js",
+ "description": "Base64 encoding/decoding in pure JS",
+ "version": "1.5.1",
+ "author": "T. Jameson Little <t.jameson.little@gmail.com>",
+ "typings": "index.d.ts",
+ "bugs": {
+ "url": "https://github.com/beatgammit/base64-js/issues"
+ },
+ "devDependencies": {
+ "babel-minify": "^0.5.1",
+ "benchmark": "^2.1.4",
+ "browserify": "^16.3.0",
+ "standard": "*",
+ "tape": "4.x"
+ },
+ "homepage": "https://github.com/beatgammit/base64-js",
+ "keywords": [
+ "base64"
+ ],
+ "license": "MIT",
+ "main": "index.js",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/beatgammit/base64-js.git"
+ },
+ "scripts": {
+ "build": "browserify -s base64js -r ./ | minify > base64js.min.js",
+ "lint": "standard",
+ "test": "npm run lint && npm run unit",
+ "unit": "tape test/*.js"
+ },
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ]
+}
diff --git a/generator/node_modules/plist/.github/workflows/ci.yml b/generator/node_modules/plist/.github/workflows/ci.yml
new file mode 100644
index 0000000..f85c725
--- /dev/null
+++ b/generator/node_modules/plist/.github/workflows/ci.yml
@@ -0,0 +1,24 @@
+name: ci
+
+on:
+ push:
+ pull_request:
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+
+ strategy:
+ matrix:
+ node-version: [ '14', '16', '18' ]
+
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Use Node.js ${{ matrix.node-version }}
+ uses: actions/setup-node@v1
+ with:
+ node-version: ${{ matrix.node-version }}
+
+ - run: npm install
+ - run: npm test
diff --git a/generator/node_modules/plist/.jshintrc b/generator/node_modules/plist/.jshintrc
new file mode 100644
index 0000000..3f42622
--- /dev/null
+++ b/generator/node_modules/plist/.jshintrc
@@ -0,0 +1,4 @@
+{
+ "laxbreak": true,
+ "laxcomma": true
+}
diff --git a/generator/node_modules/plist/History.md b/generator/node_modules/plist/History.md
new file mode 100644
index 0000000..fbec7c9
--- /dev/null
+++ b/generator/node_modules/plist/History.md
@@ -0,0 +1,196 @@
+3.1.0 / 2023-07-06
+==================
+* replace inlined xmldom with @xmldom/xmldom
+
+
+3.0.5 / 2022-03-23
+==================
+* [[`96e2303d05`]](https://github.com/TooTallNate/plist.js/commit/96e2303d059e6be0c9e0c4773226d14b4758de52) Prototype Pollution using .parse() #114 (mario-canva)
+* update browserify from 16 to 17
+
+
+3.0.4 / 2021-08-27
+==================
+* inline xmldom@0.6.0 to eliminate security warning false positive (Mike Reinstein)
+
+
+3.0.3 / 2021-08-04
+==================
+* update xmldom to 0.6.0 to patch critical vulnerability (Mike Reinstein)
+* remove flaky saucelabs teseting badge (Mike Reinstein)
+
+
+3.0.2 / 2021-03-25
+==================
+* update xmldom to 0.5.0 to patch critical vulnerability (Mike Reinstein)
+* update saucelab credentials to point at mreinstein's saucelabs account (Mike Reinstein)
+* remove a bunch of test versions from the matrix because they weren't working in zuul + sauce (Mike Reinstein)
+
+
+3.0.1 / 2018-03-21
+==================
+* avoid using Buffer constructor nodejs/node#19079
+
+
+3.0.0 / 2018-03-18
+==================
+* [[`cb0d8f1bc6`]](https://github.com/TooTallNate/plist.js/commit/cb0d8f1bc60dee423f8fc2cfcac427452dfaddb0) update Makefile, rebuild dist/ (Mike Reinstein)
+* [[`9dfeffe73f`]](https://github.com/TooTallNate/plist.js/commit/9dfeffe73fdb447ac5a87ee364a1472975f12adf) remove unsupported browser versions from travis (Mike Reinstein)
+* [[`c962bfe1ea`]](https://github.com/TooTallNate/plist.js/commit/c962bfe1ea04dd87966250253d33738bceecab61) update module deps, remove support for node < 6 (Mike Reinstein)
+
+
+2.1.0 / 2017-05-04
+==================
+
+* [[`e4f06669bb`]](https://github.com/TooTallNate/plist.js/commit/e4f06669bb51d2e65654df7c39aab52bc3bf4e8a) - update license (extend copyright term) (Mike Reinstein)
+* [[`edc6e41035`]](https://github.com/TooTallNate/plist.js/commit/edc6e4103546b1d7518a577e7c202c305a8abec0) - update module deps (Mike Reinstein)
+* [[`85d11c48ef`](https://github.com/TooTallNate/plist.js/commit/85d11c48eff02312cbdd67f46fd8e74b0d372ca1)] - Harden test-cases and implementation to align with other implementations (Björn Brauer)
+* [[`7619537eaa`]](https://github.com/TooTallNate/plist.js/commit/7619537eaa9e3e5a80829e759c004d2e017a07d2) review feedback: early returns and constants for nodeTypes (Björn Brauer)
+
+
+2.0.1 / 2016-08-16
+==================
+
+* [[`de136c8388`](https://github.com/TooTallNate/plist/commit/de136c8388)] - bad npm release… (Nathan Rajlich)
+
+
+2.0.0 / 2016-08-16
+==================
+
+* [[`90deef5d43`](https://github.com/TooTallNate/plist/commit/90deef5d43)] - remove deprecated functions (Nathan Rajlich)
+* [[`d475cd8ce9`](https://github.com/TooTallNate/plist/commit/d475cd8ce9)] - Added travis ci support for node 6 (Amila Welihinda)
+* [[`04c8ee7646`](https://github.com/TooTallNate/plist/commit/04c8ee7646)] - update dependencies (Mitchell Hentges)
+* [[`97c02b3f05`](https://github.com/TooTallNate/plist/commit/97c02b3f05)] - **travis**: add `sudo: false` and test more node versions (Nathan Rajlich)
+* [[`54c821ec29`](https://github.com/TooTallNate/plist/commit/54c821ec29)] - #71 - fixed and added test (Andrew Goldis)
+* [[`4afb7c5079`](https://github.com/TooTallNate/plist/commit/4afb7c5079)] - fix `Cannot read property 'nodeValue' of undefined exception` that is thrown when a `<key></key>` construct appears in plist (Chris Kinsman)
+* [[`f360d7d685`](https://github.com/TooTallNate/plist/commit/f360d7d685)] - #66 - fixed empty keys and added tests (Andrew Goldis)
+* [[`421c7f26e9`](https://github.com/TooTallNate/plist/commit/421c7f26e9)] - #66 - fixed empty key (Andrew Goldis)
+* [[`a88aa4dca7`](https://github.com/TooTallNate/plist/commit/a88aa4dca7)] - add verbose examples (mrzmyr)
+
+
+1.2.0 / 2015-11-10
+==================
+
+ * package: update "browserify" to v12.0.1
+ * package: update "zuul" to v3.7.2
+ * package: update "xmlbuilder" to v4.0.0
+ * package: update "util-deprecate" to v1.0.2
+ * package: update "mocha" to v2.3.3
+ * package: update "base64-js" to v0.0.8
+ * build: omit undefined values
+ * travis: add node 4.0 and 4.1 to test matrix
+
+
+1.1.0 / 2014-08-27
+==================
+
+ * package: update "browserify" to v5.10.1
+ * package: update "zuul" to v1.10.2
+ * README: add "Sauce Test Status" build badge
+ * travis: use new "plistjs" sauce credentials
+ * travis: set up zuul saucelabs automated testing
+
+
+1.0.1 / 2014-06-25
+==================
+
+ * add .zuul.yml file for browser testing
+ * remove Testling stuff
+ * build: fix global variable `val` leak
+ * package: use --check-leaks when running mocha tests
+ * README: update examples to use preferred API
+ * package: add "browser" keyword
+
+
+1.0.0 / 2014-05-20
+==================
+
+ * package: remove "android-browser"
+ * test: add <dict> build() test
+ * test: re-add the empty string build() test
+ * test: remove "fixtures" and legacy "tests" dir
+ * test: add some more build() tests
+ * test: add a parse() CDATA test
+ * test: starting on build() tests
+ * test: more parse() tests
+ * package: attempt to fix "android-browser" testling
+ * parse: better <data> with newline handling
+ * README: add Testling badge
+ * test: add <data> node tests
+ * test: add a <date> parse() test
+ * travis: don't test node v0.6 or v0.8
+ * test: some more parse() tests
+ * test: add simple <string> parsing test
+ * build: add support for an optional "opts" object
+ * package: test mobile devices
+ * test: use multiline to inline the XML
+ * package: beautify
+ * package: fix "mocha" harness
+ * package: more testling browsers
+ * build: add the "version=1.0" attribute
+ * beginnings of "mocha" tests
+ * build: more JSDocs
+ * tests: add test that ensures that empty string conversion works
+ * build: update "xmlbuilder" to v2.2.1
+ * parse: ignore comment and cdata nodes
+ * tests: make the "Newlines" test actually contain a newline
+ * parse: lint
+ * test travis
+ * README: add Travis CI badge
+ * add .travis.yml file
+ * build: updated DTD to reflect name change
+ * parse: return falsey values in an Array plist
+ * build: fix encoding a typed array in the browser
+ * build: add support for Typed Arrays and ArrayBuffers
+ * build: more lint
+ * build: slight cleanup and optimizations
+ * build: use .txt() for the "date" value
+ * parse: always return a Buffer for <data> nodes
+ * build: don't interpret Strings as base64
+ * dist: commit prebuilt plist*.js files
+ * parse: fix typo in deprecate message
+ * parse: fix parse() return value
+ * parse: add jsdoc comments for the deprecated APIs
+ * parse: add `parse()` function
+ * node, parse: use `util-deprecate` module
+ * re-implemented parseFile to be asynchronous
+ * node: fix jsdoc comment
+ * Makefile: fix "node" require stubbing
+ * examples: add "browser" example
+ * package: tweak "main"
+ * package: remove "engines" field
+ * Makefile: fix --exclude command for browserify
+ * package: update "description"
+ * lib: more styling
+ * Makefile: add -build.js and -parse.js dist files
+ * lib: separate out the parse and build logic into their own files
+ * Makefile: add makefile with browserify build rules
+ * package: add "browserify" as a dev dependency
+ * plist: tabs to spaces (again)
+ * add a .jshintrc file
+ * LICENSE: update
+ * node-webkit support
+ * Ignore tests/ in .npmignore file
+ * Remove duplicate devDependencies key
+ * Remove trailing whitespace
+ * adding recent contributors. Bumping npm package number (patch release)
+ * Fixed node.js string handling
+ * bumping version number
+ * Fixed global variable plist leak
+ * patch release 0.4.1
+ * removed temporary debug output file
+ * flipping the cases for writing data and string elements in build(). removed the 125 length check. Added validation of base64 encoding for data fields when parsing. added unit tests.
+ * fixed syntax errors in README examples (issue #20)
+ * added Sync versions of calls. added deprecation warnings for old method calls. updated documentation. If the resulting object from parseStringSync is an array with 1 element, return just the element. If a plist string or file doesnt have a <plist> tag as the document root element, fail noisily (issue #15)
+ * incrementing package version
+ * added cross platform base64 encode/decode for data elements (issue #17.) Comments and hygiene.
+ * refactored the code to use a DOM parser instead of SAX. closes issues #5 and #16
+ * rolling up package version
+ * updated base64 detection regexp. updated README. hygiene.
+ * refactored the build function. Fixes issue #14
+ * refactored tests. Modified tests from issue #9. thanks @sylvinus
+ * upgrade xmlbuilder package version. this is why .end() was needed in last commit; breaking change to xmlbuilder lib. :/
+ * bug fix in build function, forgot to call .end() Refactored tests to use nodeunit
+ * Implemented support for real, identity tests
+ * Refactored base64 detection - still sloppy, fixed date building. Passing tests OK.
+ * Implemented basic plist builder that turns an existing JS object into plist XML. date, real and data types still need to be implemented.
diff --git a/generator/node_modules/plist/LICENSE b/generator/node_modules/plist/LICENSE
new file mode 100644
index 0000000..92e3423
--- /dev/null
+++ b/generator/node_modules/plist/LICENSE
@@ -0,0 +1,24 @@
+(The MIT License)
+
+Copyright (c) 2010-2017 Nathan Rajlich <nathan@tootallnate.net>
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
diff --git a/generator/node_modules/plist/Makefile b/generator/node_modules/plist/Makefile
new file mode 100644
index 0000000..7a918b5
--- /dev/null
+++ b/generator/node_modules/plist/Makefile
@@ -0,0 +1,75 @@
+
+# get Makefile directory name: http://stackoverflow.com/a/5982798/376773
+THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
+THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd)
+
+# BIN directory
+BIN := $(THIS_DIR)/node_modules/.bin
+
+# applications
+NODE ?= node
+NPM ?= $(NODE) $(shell which npm)
+BROWSERIFY ?= $(NODE) $(BIN)/browserify
+MOCHA ?= $(NODE) $(BIN)/mocha
+ZUUL ?= $(NODE) $(BIN)/zuul
+
+REPORTER ?= spec
+
+all: dist/plist.js dist/plist-build.js dist/plist-parse.js
+
+install: node_modules
+
+clean:
+ @rm -rf node_modules dist
+
+dist:
+ @mkdir -p $@
+
+dist/plist-build.js: node_modules lib/build.js dist
+ @$(BROWSERIFY) \
+ --standalone plist \
+ lib/build.js > $@
+
+dist/plist-parse.js: node_modules lib/parse.js dist
+ @$(BROWSERIFY) \
+ --standalone plist \
+ lib/parse.js > $@
+
+dist/plist.js: node_modules lib/*.js dist
+ @$(BROWSERIFY) \
+ --standalone plist \
+ index.js > $@
+
+node_modules: package.json
+ @NODE_ENV= $(NPM) install
+ @touch node_modules
+
+test:
+ @if [ "x$(BROWSER_NAME)" = "x" ]; then \
+ $(MAKE) test-node; \
+ else \
+ $(MAKE) test-zuul; \
+ fi
+
+test-node:
+ @$(MOCHA) \
+ --reporter $(REPORTER) \
+ test/*.js
+
+test-zuul:
+ @if [ "x$(BROWSER_PLATFORM)" = "x" ]; then \
+ $(ZUUL) \
+ --ui mocha-bdd \
+ --browser-name $(BROWSER_NAME) \
+ --browser-version $(BROWSER_VERSION) \
+ test/*.js; \
+ else \
+ $(ZUUL) \
+ --ui mocha-bdd \
+ --browser-name $(BROWSER_NAME) \
+ --browser-version $(BROWSER_VERSION) \
+ --browser-platform "$(BROWSER_PLATFORM)" \
+ test/*.js; \
+ fi
+
+.PHONY: all install clean test test-node test-zuul
diff --git a/generator/node_modules/plist/README.md b/generator/node_modules/plist/README.md
new file mode 100644
index 0000000..bb6fcf9
--- /dev/null
+++ b/generator/node_modules/plist/README.md
@@ -0,0 +1,146 @@
+plist.js
+========
+### Apple's Property list parser/builder for Node.js and browsers
+
+[![ci](https://github.com/TooTallNate/plist.js/actions/workflows/ci.yml/badge.svg)](https://github.com/TooTallNate/plist.js/actions/workflows/ci.yml)
+
+Provides facilities for reading and writing Plist (property list) files.
+These are often used in programming OS X and iOS applications, as well
+as the iTunes configuration XML file.
+
+Plist files represent stored programming "object"s. They are very similar
+to JSON. A valid Plist file is representable as a native JavaScript Object
+and vice-versa.
+
+
+## Usage
+
+### Node.js
+
+Install using `npm`:
+
+``` bash
+$ npm install --save plist
+```
+
+Then `require()` the _plist_ module in your file:
+
+``` js
+var plist = require('plist');
+
+// now use the `parse()` and `build()` functions
+var val = plist.parse('<plist><string>Hello World!</string></plist>');
+console.log(val); // "Hello World!"
+```
+
+
+### Browser
+
+Include the `dist/plist.js` in a `<script>` tag in your HTML file:
+
+``` html
+<script src="plist.js"></script>
+<script>
+ // now use the `parse()` and `build()` functions
+ var val = plist.parse('<plist><string>Hello World!</string></plist>');
+ console.log(val); // "Hello World!"
+</script>
+```
+
+
+## API
+
+### Parsing
+
+Parsing a plist from filename:
+
+``` javascript
+var fs = require('fs');
+var plist = require('plist');
+
+var obj = plist.parse(fs.readFileSync('myPlist.plist', 'utf8'));
+console.log(JSON.stringify(obj));
+```
+
+Parsing a plist from string payload:
+
+``` javascript
+var plist = require('plist');
+
+var xml =
+ '<?xml version="1.0" encoding="UTF-8"?>' +
+ '<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">' +
+ '<plist version="1.0">' +
+ '<key>metadata</key>' +
+ '<dict>' +
+ '<key>bundle-identifier</key>' +
+ '<string>com.company.app</string>' +
+ '<key>bundle-version</key>' +
+ '<string>0.1.1</string>' +
+ '<key>kind</key>' +
+ '<string>software</string>' +
+ '<key>title</key>' +
+ '<string>AppName</string>' +
+ '</dict>' +
+ '</plist>';
+
+console.log(plist.parse(xml));
+
+// [
+// "metadata",
+// {
+// "bundle-identifier": "com.company.app",
+// "bundle-version": "0.1.1",
+// "kind": "software",
+// "title": "AppName"
+// }
+// ]
+```
+
+### Building
+
+Given an existing JavaScript Object, you can turn it into an XML document
+that complies with the plist DTD:
+
+``` javascript
+var plist = require('plist');
+
+var json = [
+ "metadata",
+ {
+ "bundle-identifier": "com.company.app",
+ "bundle-version": "0.1.1",
+ "kind": "software",
+ "title": "AppName"
+ }
+];
+
+console.log(plist.build(json));
+
+// <?xml version="1.0" encoding="UTF-8"?>
+// <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+// <plist version="1.0">
+// <key>metadata</key>
+// <dict>
+// <key>bundle-identifier</key>
+// <string>com.company.app</string>
+// <key>bundle-version</key>
+// <string>0.1.1</string>
+// <key>kind</key>
+// <string>software</string>
+// <key>title</key>
+// <string>AppName</string>
+// </dict>
+// </plist>
+```
+
+## Cross Platform Testing Credits
+
+Much thanks to Sauce Labs for providing free resources that enable cross-browser testing on this project!
+
+[![Testing Powered By SauceLabs](https://opensource.saucelabs.com/images/opensauce/powered-by-saucelabs-badge-red.png?sanitize=true "Testing Powered By SauceLabs")](https://saucelabs.com)
+
+
+## License
+
+[(The MIT License)](LICENSE)
diff --git a/generator/node_modules/plist/dist/plist-build.js b/generator/node_modules/plist/dist/plist-build.js
new file mode 100644
index 0000000..0eeef51
--- /dev/null
+++ b/generator/node_modules/plist/dist/plist-build.js
@@ -0,0 +1,5348 @@
+(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.plist = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
+(function (Buffer){(function (){
+/**
+ * Module dependencies.
+ */
+
+var base64 = require('base64-js');
+var xmlbuilder = require('xmlbuilder');
+
+/**
+ * Module exports.
+ */
+
+exports.build = build;
+
+/**
+ * Accepts a `Date` instance and returns an ISO date string.
+ *
+ * @param {Date} d - Date instance to serialize
+ * @returns {String} ISO date string representation of `d`
+ * @api private
+ */
+
+function ISODateString(d){
+ function pad(n){
+ return n < 10 ? '0' + n : n;
+ }
+ return d.getUTCFullYear()+'-'
+ + pad(d.getUTCMonth()+1)+'-'
+ + pad(d.getUTCDate())+'T'
+ + pad(d.getUTCHours())+':'
+ + pad(d.getUTCMinutes())+':'
+ + pad(d.getUTCSeconds())+'Z';
+}
+
+/**
+ * Returns the internal "type" of `obj` via the
+ * `Object.prototype.toString()` trick.
+ *
+ * @param {Mixed} obj - any value
+ * @returns {String} the internal "type" name
+ * @api private
+ */
+
+var toString = Object.prototype.toString;
+function type (obj) {
+ var m = toString.call(obj).match(/\[object (.*)\]/);
+ return m ? m[1] : m;
+}
+
+/**
+ * Generate an XML plist string from the input object `obj`.
+ *
+ * @param {Object} obj - the object to convert
+ * @param {Object} [opts] - optional options object
+ * @returns {String} converted plist XML string
+ * @api public
+ */
+
+function build (obj, opts) {
+ var XMLHDR = {
+ version: '1.0',
+ encoding: 'UTF-8'
+ };
+
+ var XMLDTD = {
+ pubid: '-//Apple//DTD PLIST 1.0//EN',
+ sysid: 'http://www.apple.com/DTDs/PropertyList-1.0.dtd'
+ };
+
+ var doc = xmlbuilder.create('plist');
+
+ doc.dec(XMLHDR.version, XMLHDR.encoding, XMLHDR.standalone);
+ doc.dtd(XMLDTD.pubid, XMLDTD.sysid);
+ doc.att('version', '1.0');
+
+ walk_obj(obj, doc);
+
+ if (!opts) opts = {};
+ // default `pretty` to `true`
+ opts.pretty = opts.pretty !== false;
+ return doc.end(opts);
+}
+
+/**
+ * depth first, recursive traversal of a javascript object. when complete,
+ * next_child contains a reference to the build XML object.
+ *
+ * @api private
+ */
+
+function walk_obj(next, next_child) {
+ var tag_type, i, prop;
+ var name = type(next);
+
+ if ('Undefined' == name) {
+ return;
+ } else if (Array.isArray(next)) {
+ next_child = next_child.ele('array');
+ for (i = 0; i < next.length; i++) {
+ walk_obj(next[i], next_child);
+ }
+
+ } else if (Buffer.isBuffer(next)) {
+ next_child.ele('data').raw(next.toString('base64'));
+
+ } else if ('Object' == name) {
+ next_child = next_child.ele('dict');
+ for (prop in next) {
+ if (next.hasOwnProperty(prop)) {
+ next_child.ele('key').txt(prop);
+ walk_obj(next[prop], next_child);
+ }
+ }
+
+ } else if ('Number' == name) {
+ // detect if this is an integer or real
+ // TODO: add an ability to force one way or another via a "cast"
+ tag_type = (next % 1 === 0) ? 'integer' : 'real';
+ next_child.ele(tag_type).txt(next.toString());
+
+ } else if ('BigInt' == name) {
+ next_child.ele('integer').txt(next);
+
+ } else if ('Date' == name) {
+ next_child.ele('date').txt(ISODateString(new Date(next)));
+
+ } else if ('Boolean' == name) {
+ next_child.ele(next ? 'true' : 'false');
+
+ } else if ('String' == name) {
+ next_child.ele('string').txt(next);
+
+ } else if ('ArrayBuffer' == name) {
+ next_child.ele('data').raw(base64.fromByteArray(next));
+
+ } else if (next && next.buffer && 'ArrayBuffer' == type(next.buffer)) {
+ // a typed array
+ next_child.ele('data').raw(base64.fromByteArray(new Uint8Array(next.buffer), next_child));
+
+ } else if ('Null' === name) {
+ next_child.ele('null').txt('');
+
+ }
+}
+
+}).call(this)}).call(this,{"isBuffer":require("../node_modules/is-buffer/index.js")})
+},{"../node_modules/is-buffer/index.js":3,"base64-js":2,"xmlbuilder":36}],2:[function(require,module,exports){
+'use strict'
+
+exports.byteLength = byteLength
+exports.toByteArray = toByteArray
+exports.fromByteArray = fromByteArray
+
+var lookup = []
+var revLookup = []
+var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
+
+var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
+for (var i = 0, len = code.length; i < len; ++i) {
+ lookup[i] = code[i]
+ revLookup[code.charCodeAt(i)] = i
+}
+
+// Support decoding URL-safe base64 strings, as Node.js does.
+// See: https://en.wikipedia.org/wiki/Base64#URL_applications
+revLookup['-'.charCodeAt(0)] = 62
+revLookup['_'.charCodeAt(0)] = 63
+
+function getLens (b64) {
+ var len = b64.length
+
+ if (len % 4 > 0) {
+ throw new Error('Invalid string. Length must be a multiple of 4')
+ }
+
+ // Trim off extra bytes after placeholder bytes are found
+ // See: https://github.com/beatgammit/base64-js/issues/42
+ var validLen = b64.indexOf('=')
+ if (validLen === -1) validLen = len
+
+ var placeHoldersLen = validLen === len
+ ? 0
+ : 4 - (validLen % 4)
+
+ return [validLen, placeHoldersLen]
+}
+
+// base64 is 4/3 + up to two characters of the original data
+function byteLength (b64) {
+ var lens = getLens(b64)
+ var validLen = lens[0]
+ var placeHoldersLen = lens[1]
+ return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
+}
+
+function _byteLength (b64, validLen, placeHoldersLen) {
+ return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
+}
+
+function toByteArray (b64) {
+ var tmp
+ var lens = getLens(b64)
+ var validLen = lens[0]
+ var placeHoldersLen = lens[1]
+
+ var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
+
+ var curByte = 0
+
+ // if there are placeholders, only get up to the last complete 4 chars
+ var len = placeHoldersLen > 0
+ ? validLen - 4
+ : validLen
+
+ var i
+ for (i = 0; i < len; i += 4) {
+ tmp =
+ (revLookup[b64.charCodeAt(i)] << 18) |
+ (revLookup[b64.charCodeAt(i + 1)] << 12) |
+ (revLookup[b64.charCodeAt(i + 2)] << 6) |
+ revLookup[b64.charCodeAt(i + 3)]
+ arr[curByte++] = (tmp >> 16) & 0xFF
+ arr[curByte++] = (tmp >> 8) & 0xFF
+ arr[curByte++] = tmp & 0xFF
+ }
+
+ if (placeHoldersLen === 2) {
+ tmp =
+ (revLookup[b64.charCodeAt(i)] << 2) |
+ (revLookup[b64.charCodeAt(i + 1)] >> 4)
+ arr[curByte++] = tmp & 0xFF
+ }
+
+ if (placeHoldersLen === 1) {
+ tmp =
+ (revLookup[b64.charCodeAt(i)] << 10) |
+ (revLookup[b64.charCodeAt(i + 1)] << 4) |
+ (revLookup[b64.charCodeAt(i + 2)] >> 2)
+ arr[curByte++] = (tmp >> 8) & 0xFF
+ arr[curByte++] = tmp & 0xFF
+ }
+
+ return arr
+}
+
+function tripletToBase64 (num) {
+ return lookup[num >> 18 & 0x3F] +
+ lookup[num >> 12 & 0x3F] +
+ lookup[num >> 6 & 0x3F] +
+ lookup[num & 0x3F]
+}
+
+function encodeChunk (uint8, start, end) {
+ var tmp
+ var output = []
+ for (var i = start; i < end; i += 3) {
+ tmp =
+ ((uint8[i] << 16) & 0xFF0000) +
+ ((uint8[i + 1] << 8) & 0xFF00) +
+ (uint8[i + 2] & 0xFF)
+ output.push(tripletToBase64(tmp))
+ }
+ return output.join('')
+}
+
+function fromByteArray (uint8) {
+ var tmp
+ var len = uint8.length
+ var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
+ var parts = []
+ var maxChunkLength = 16383 // must be multiple of 3
+
+ // go through the array every three bytes, we'll deal with trailing stuff later
+ for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
+ parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
+ }
+
+ // pad the end with zeros, but make sure to not forget the extra bytes
+ if (extraBytes === 1) {
+ tmp = uint8[len - 1]
+ parts.push(
+ lookup[tmp >> 2] +
+ lookup[(tmp << 4) & 0x3F] +
+ '=='
+ )
+ } else if (extraBytes === 2) {
+ tmp = (uint8[len - 2] << 8) + uint8[len - 1]
+ parts.push(
+ lookup[tmp >> 10] +
+ lookup[(tmp >> 4) & 0x3F] +
+ lookup[(tmp << 2) & 0x3F] +
+ '='
+ )
+ }
+
+ return parts.join('')
+}
+
+},{}],3:[function(require,module,exports){
+/*!
+ * Determine if an object is a Buffer
+ *
+ * @author Feross Aboukhadijeh <https://feross.org>
+ * @license MIT
+ */
+
+// The _isBuffer check is for Safari 5-7 support, because it's missing
+// Object.prototype.constructor. Remove this eventually
+module.exports = function (obj) {
+ return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)
+}
+
+function isBuffer (obj) {
+ return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
+}
+
+// For Node v0.10 support. Remove this eventually.
+function isSlowBuffer (obj) {
+ return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))
+}
+
+},{}],4:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ module.exports = {
+ Disconnected: 1,
+ Preceding: 2,
+ Following: 4,
+ Contains: 8,
+ ContainedBy: 16,
+ ImplementationSpecific: 32
+ };
+
+}).call(this);
+
+},{}],5:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(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,
+ // Numeric codes up to 200 are reserved to W3C for possible future use.
+ // Following are types internal to this library:
+ Declaration: 201,
+ Raw: 202,
+ AttributeDeclaration: 203,
+ ElementDeclaration: 204,
+ Dummy: 205
+ };
+
+}).call(this);
+
+},{}],6:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ // Copies all enumerable own properties from `sources` to `target`
+ var assign, getValue, isArray, isEmpty, isFunction, isObject, isPlainObject,
+ hasProp = {}.hasOwnProperty;
+
+ assign = function(target, ...sources) {
+ var i, key, len, source;
+ 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;
+ };
+
+ // Determines if `val` is a Function object
+ isFunction = function(val) {
+ return !!val && Object.prototype.toString.call(val) === '[object Function]';
+ };
+
+ // Determines if `val` is an Object
+ isObject = function(val) {
+ var ref;
+ return !!val && ((ref = typeof val) === 'function' || ref === 'object');
+ };
+
+ // Determines if `val` is an Array
+ isArray = function(val) {
+ if (isFunction(Array.isArray)) {
+ return Array.isArray(val);
+ } else {
+ return Object.prototype.toString.call(val) === '[object Array]';
+ }
+ };
+
+ // Determines if `val` is an empty Array or an Object with no own properties
+ 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;
+ }
+ };
+
+ // Determines if `val` is a plain Object
+ 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));
+ };
+
+ // Gets the primitive value of an object
+ getValue = function(obj) {
+ if (isFunction(obj.valueOf)) {
+ return obj.valueOf();
+ } else {
+ return obj;
+ }
+ };
+
+ module.exports.assign = assign;
+
+ module.exports.isFunction = isFunction;
+
+ module.exports.isObject = isObject;
+
+ module.exports.isArray = isArray;
+
+ module.exports.isEmpty = isEmpty;
+
+ module.exports.isPlainObject = isPlainObject;
+
+ module.exports.getValue = getValue;
+
+}).call(this);
+
+},{}],7:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ module.exports = {
+ None: 0,
+ OpenTag: 1,
+ InsideTag: 2,
+ CloseTag: 3
+ };
+
+}).call(this);
+
+},{}],8:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, XMLAttribute, XMLNode;
+
+ NodeType = require('./NodeType');
+
+ XMLNode = require('./XMLNode');
+
+ // Represents an attribute
+ module.exports = XMLAttribute = (function() {
+ class XMLAttribute {
+ // Initializes a new instance of `XMLAttribute`
+
+ // `parent` the parent node
+ // `name` attribute target
+ // `value` attribute value
+ constructor(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;
+ // DOM level 3
+ this.isId = false;
+ this.schemaTypeInfo = null;
+ }
+
+ // Creates and returns a deep clone of `this`
+ clone() {
+ return Object.create(this);
+ }
+
+ // Converts the XML fragment to string
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation for pretty print
+ // `options.offset` how many indentations to add to every line for pretty print
+ // `options.newline` newline sequence for pretty print
+ toString(options) {
+ return this.options.writer.attribute(this, this.options.writer.filterOptions(options));
+ }
+
+
+ // Returns debug string for this node
+ debugInfo(name) {
+ name = name || this.name;
+ if (name == null) {
+ return "parent: <" + this.parent.name + ">";
+ } else {
+ return "attribute: {" + name + "}, parent: <" + this.parent.name + ">";
+ }
+ }
+
+ isEqualNode(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;
+ }
+
+ };
+
+ // DOM level 1
+ Object.defineProperty(XMLAttribute.prototype, 'nodeType', {
+ get: function() {
+ return this.type;
+ }
+ });
+
+ Object.defineProperty(XMLAttribute.prototype, 'ownerElement', {
+ get: function() {
+ return this.parent;
+ }
+ });
+
+ // DOM level 3
+ Object.defineProperty(XMLAttribute.prototype, 'textContent', {
+ get: function() {
+ return this.value;
+ },
+ set: function(value) {
+ return this.value = value || '';
+ }
+ });
+
+ // DOM level 4
+ Object.defineProperty(XMLAttribute.prototype, 'namespaceURI', {
+ get: function() {
+ return '';
+ }
+ });
+
+ Object.defineProperty(XMLAttribute.prototype, 'prefix', {
+ get: function() {
+ return '';
+ }
+ });
+
+ Object.defineProperty(XMLAttribute.prototype, 'localName', {
+ get: function() {
+ return this.name;
+ }
+ });
+
+ Object.defineProperty(XMLAttribute.prototype, 'specified', {
+ get: function() {
+ return true;
+ }
+ });
+
+ return XMLAttribute;
+
+ }).call(this);
+
+}).call(this);
+
+},{"./NodeType":5,"./XMLNode":27}],9:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, XMLCData, XMLCharacterData;
+
+ NodeType = require('./NodeType');
+
+ XMLCharacterData = require('./XMLCharacterData');
+
+ // Represents a CDATA node
+ module.exports = XMLCData = class XMLCData extends XMLCharacterData {
+ // Initializes a new instance of `XMLCData`
+
+ // `text` CDATA text
+ constructor(parent, text) {
+ super(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);
+ }
+
+ // Creates and returns a deep clone of `this`
+ clone() {
+ return Object.create(this);
+ }
+
+ // Converts the XML fragment to string
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation for pretty print
+ // `options.offset` how many indentations to add to every line for pretty print
+ // `options.newline` newline sequence for pretty print
+ toString(options) {
+ return this.options.writer.cdata(this, this.options.writer.filterOptions(options));
+ }
+
+ };
+
+}).call(this);
+
+},{"./NodeType":5,"./XMLCharacterData":10}],10:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var XMLCharacterData, XMLNode;
+
+ XMLNode = require('./XMLNode');
+
+ // Represents a character data node
+ module.exports = XMLCharacterData = (function() {
+ class XMLCharacterData extends XMLNode {
+ // Initializes a new instance of `XMLCharacterData`
+
+ constructor(parent) {
+ super(parent);
+ this.value = '';
+ }
+
+
+ // Creates and returns a deep clone of `this`
+ clone() {
+ return Object.create(this);
+ }
+
+ // DOM level 1 functions to be implemented later
+ substringData(offset, count) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ appendData(arg) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ insertData(offset, arg) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ deleteData(offset, count) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ replaceData(offset, count, arg) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ isEqualNode(node) {
+ if (!super.isEqualNode(node)) {
+ return false;
+ }
+ if (node.data !== this.data) {
+ return false;
+ }
+ return true;
+ }
+
+ };
+
+ // DOM level 1
+ Object.defineProperty(XMLCharacterData.prototype, 'data', {
+ get: function() {
+ return this.value;
+ },
+ set: function(value) {
+ return this.value = value || '';
+ }
+ });
+
+ Object.defineProperty(XMLCharacterData.prototype, 'length', {
+ get: function() {
+ return this.value.length;
+ }
+ });
+
+ // DOM level 3
+ Object.defineProperty(XMLCharacterData.prototype, 'textContent', {
+ get: function() {
+ return this.value;
+ },
+ set: function(value) {
+ return this.value = value || '';
+ }
+ });
+
+ return XMLCharacterData;
+
+ }).call(this);
+
+}).call(this);
+
+},{"./XMLNode":27}],11:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, XMLCharacterData, XMLComment;
+
+ NodeType = require('./NodeType');
+
+ XMLCharacterData = require('./XMLCharacterData');
+
+ // Represents a comment node
+ module.exports = XMLComment = class XMLComment extends XMLCharacterData {
+ // Initializes a new instance of `XMLComment`
+
+ // `text` comment text
+ constructor(parent, text) {
+ super(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);
+ }
+
+ // Creates and returns a deep clone of `this`
+ clone() {
+ return Object.create(this);
+ }
+
+ // Converts the XML fragment to string
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation for pretty print
+ // `options.offset` how many indentations to add to every line for pretty print
+ // `options.newline` newline sequence for pretty print
+ toString(options) {
+ return this.options.writer.comment(this, this.options.writer.filterOptions(options));
+ }
+
+ };
+
+}).call(this);
+
+},{"./NodeType":5,"./XMLCharacterData":10}],12:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var XMLDOMConfiguration, XMLDOMErrorHandler, XMLDOMStringList;
+
+ XMLDOMErrorHandler = require('./XMLDOMErrorHandler');
+
+ XMLDOMStringList = require('./XMLDOMStringList');
+
+ // Implements the DOMConfiguration interface
+ module.exports = XMLDOMConfiguration = (function() {
+ class XMLDOMConfiguration {
+ constructor() {
+ 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);
+ }
+
+ // Gets the value of a parameter.
+
+ // `name` name of the parameter
+ getParameter(name) {
+ if (this.params.hasOwnProperty(name)) {
+ return this.params[name];
+ } else {
+ return null;
+ }
+ }
+
+ // Checks if setting a parameter to a specific value is supported.
+
+ // `name` name of the parameter
+ // `value` parameter value
+ canSetParameter(name, value) {
+ return true;
+ }
+
+ // Sets the value of a parameter.
+
+ // `name` name of the parameter
+ // `value` new value or null if the user wishes to unset the parameter
+ setParameter(name, value) {
+ if (value != null) {
+ return this.params[name] = value;
+ } else {
+ return delete this.params[name];
+ }
+ }
+
+ };
+
+ // Returns the list of parameter names
+ Object.defineProperty(XMLDOMConfiguration.prototype, 'parameterNames', {
+ get: function() {
+ return new XMLDOMStringList(Object.keys(this.defaultParams));
+ }
+ });
+
+ return XMLDOMConfiguration;
+
+ }).call(this);
+
+}).call(this);
+
+},{"./XMLDOMErrorHandler":13,"./XMLDOMStringList":15}],13:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ // Represents the error handler for DOM operations
+ var XMLDOMErrorHandler;
+
+ module.exports = XMLDOMErrorHandler = class XMLDOMErrorHandler {
+ // Initializes a new instance of `XMLDOMErrorHandler`
+
+ constructor() {}
+
+ // Called on the error handler when an error occurs.
+
+ // `error` the error message as a string
+ handleError(error) {
+ throw new Error(error);
+ }
+
+ };
+
+}).call(this);
+
+},{}],14:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ // Implements the DOMImplementation interface
+ var XMLDOMImplementation;
+
+ module.exports = XMLDOMImplementation = class XMLDOMImplementation {
+ // Tests if the DOM implementation implements a specific feature.
+
+ // `feature` package name of the feature to test. In Level 1, the
+ // legal values are "HTML" and "XML" (case-insensitive).
+ // `version` version number of the package name to test.
+ // In Level 1, this is the string "1.0". If the version is
+ // not specified, supporting any version of the feature will
+ // cause the method to return true.
+ hasFeature(feature, version) {
+ return true;
+ }
+
+ // Creates a new document type declaration.
+
+ // `qualifiedName` qualified name of the document type to be created
+ // `publicId` public identifier of the external subset
+ // `systemId` system identifier of the external subset
+ createDocumentType(qualifiedName, publicId, systemId) {
+ throw new Error("This DOM method is not implemented.");
+ }
+
+ // Creates a new document.
+
+ // `namespaceURI` namespace URI of the document element to create
+ // `qualifiedName` the qualified name of the document to be created
+ // `doctype` the type of document to be created or null
+ createDocument(namespaceURI, qualifiedName, doctype) {
+ throw new Error("This DOM method is not implemented.");
+ }
+
+ // Creates a new HTML document.
+
+ // `title` document title
+ createHTMLDocument(title) {
+ throw new Error("This DOM method is not implemented.");
+ }
+
+ // Returns a specialized object which implements the specialized APIs
+ // of the specified feature and version.
+
+ // `feature` name of the feature requested.
+ // `version` version number of the feature to test
+ getFeature(feature, version) {
+ throw new Error("This DOM method is not implemented.");
+ }
+
+ };
+
+}).call(this);
+
+},{}],15:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ // Represents a list of string entries
+ var XMLDOMStringList;
+
+ module.exports = XMLDOMStringList = (function() {
+ class XMLDOMStringList {
+ // Initializes a new instance of `XMLDOMStringList`
+ // This is just a wrapper around an ordinary
+ // JS array.
+
+ // `arr` the array of string values
+ constructor(arr) {
+ this.arr = arr || [];
+ }
+
+ // Returns the indexth item in the collection.
+
+ // `index` index into the collection
+ item(index) {
+ return this.arr[index] || null;
+ }
+
+ // Test if a string is part of this DOMStringList.
+
+ // `str` the string to look for
+ contains(str) {
+ return this.arr.indexOf(str) !== -1;
+ }
+
+ };
+
+ // Returns the number of strings in the list.
+ Object.defineProperty(XMLDOMStringList.prototype, 'length', {
+ get: function() {
+ return this.arr.length;
+ }
+ });
+
+ return XMLDOMStringList;
+
+ }).call(this);
+
+}).call(this);
+
+},{}],16:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, XMLDTDAttList, XMLNode;
+
+ XMLNode = require('./XMLNode');
+
+ NodeType = require('./NodeType');
+
+ // Represents an attribute list
+ module.exports = XMLDTDAttList = class XMLDTDAttList extends XMLNode {
+ // Initializes a new instance of `XMLDTDAttList`
+
+ // `parent` the parent `XMLDocType` element
+ // `elementName` the name of the element containing this attribute
+ // `attributeName` attribute name
+ // `attributeType` type of the attribute
+ // `defaultValueType` default value type (either #REQUIRED, #IMPLIED,
+ // #FIXED or #DEFAULT)
+ // `defaultValue` default value of the attribute
+ // (only used for #FIXED or #DEFAULT)
+ constructor(parent, elementName, attributeName, attributeType, defaultValueType, defaultValue) {
+ super(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;
+ }
+
+ // Converts the XML fragment to string
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation for pretty print
+ // `options.offset` how many indentations to add to every line for pretty print
+ // `options.newline` newline sequence for pretty print
+ toString(options) {
+ return this.options.writer.dtdAttList(this, this.options.writer.filterOptions(options));
+ }
+
+ };
+
+}).call(this);
+
+},{"./NodeType":5,"./XMLNode":27}],17:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, XMLDTDElement, XMLNode;
+
+ XMLNode = require('./XMLNode');
+
+ NodeType = require('./NodeType');
+
+ // Represents an attribute
+ module.exports = XMLDTDElement = class XMLDTDElement extends XMLNode {
+ // Initializes a new instance of `XMLDTDElement`
+
+ // `parent` the parent `XMLDocType` element
+ // `name` element name
+ // `value` element content (defaults to #PCDATA)
+ constructor(parent, name, value) {
+ super(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);
+ }
+
+ // Converts the XML fragment to string
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation for pretty print
+ // `options.offset` how many indentations to add to every line for pretty print
+ // `options.newline` newline sequence for pretty print
+ toString(options) {
+ return this.options.writer.dtdElement(this, this.options.writer.filterOptions(options));
+ }
+
+ };
+
+}).call(this);
+
+},{"./NodeType":5,"./XMLNode":27}],18:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, XMLDTDEntity, XMLNode, isObject;
+
+ ({isObject} = require('./Utility'));
+
+ XMLNode = require('./XMLNode');
+
+ NodeType = require('./NodeType');
+
+ // Represents an entity declaration in the DTD
+ module.exports = XMLDTDEntity = (function() {
+ class XMLDTDEntity extends XMLNode {
+ // Initializes a new instance of `XMLDTDEntity`
+
+ // `parent` the parent `XMLDocType` element
+ // `pe` whether this is a parameter entity or a general entity
+ // defaults to `false` (general entity)
+ // `name` the name of the entity
+ // `value` internal entity value or an object with external entity details
+ // `value.pubID` public identifier
+ // `value.sysID` system identifier
+ // `value.nData` notation declaration
+ constructor(parent, pe, name, value) {
+ super(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));
+ }
+ }
+ }
+
+ // Converts the XML fragment to string
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation for pretty print
+ // `options.offset` how many indentations to add to every line for pretty print
+ // `options.newline` newline sequence for pretty print
+ toString(options) {
+ return this.options.writer.dtdEntity(this, this.options.writer.filterOptions(options));
+ }
+
+ };
+
+ // DOM level 1
+ Object.defineProperty(XMLDTDEntity.prototype, 'publicId', {
+ get: function() {
+ return this.pubID;
+ }
+ });
+
+ Object.defineProperty(XMLDTDEntity.prototype, 'systemId', {
+ get: function() {
+ return this.sysID;
+ }
+ });
+
+ Object.defineProperty(XMLDTDEntity.prototype, 'notationName', {
+ get: function() {
+ return this.nData || null;
+ }
+ });
+
+ // DOM level 3
+ Object.defineProperty(XMLDTDEntity.prototype, 'inputEncoding', {
+ get: function() {
+ return null;
+ }
+ });
+
+ Object.defineProperty(XMLDTDEntity.prototype, 'xmlEncoding', {
+ get: function() {
+ return null;
+ }
+ });
+
+ Object.defineProperty(XMLDTDEntity.prototype, 'xmlVersion', {
+ get: function() {
+ return null;
+ }
+ });
+
+ return XMLDTDEntity;
+
+ }).call(this);
+
+}).call(this);
+
+},{"./NodeType":5,"./Utility":6,"./XMLNode":27}],19:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, XMLDTDNotation, XMLNode;
+
+ XMLNode = require('./XMLNode');
+
+ NodeType = require('./NodeType');
+
+ // Represents a NOTATION entry in the DTD
+ module.exports = XMLDTDNotation = (function() {
+ class XMLDTDNotation extends XMLNode {
+ // Initializes a new instance of `XMLDTDNotation`
+
+ // `parent` the parent `XMLDocType` element
+ // `name` the name of the notation
+ // `value` an object with external entity details
+ // `value.pubID` public identifier
+ // `value.sysID` system identifier
+ constructor(parent, name, value) {
+ super(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);
+ }
+ }
+
+ // Converts the XML fragment to string
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation for pretty print
+ // `options.offset` how many indentations to add to every line for pretty print
+ // `options.newline` newline sequence for pretty print
+ toString(options) {
+ return this.options.writer.dtdNotation(this, this.options.writer.filterOptions(options));
+ }
+
+ };
+
+ // DOM level 1
+ Object.defineProperty(XMLDTDNotation.prototype, 'publicId', {
+ get: function() {
+ return this.pubID;
+ }
+ });
+
+ Object.defineProperty(XMLDTDNotation.prototype, 'systemId', {
+ get: function() {
+ return this.sysID;
+ }
+ });
+
+ return XMLDTDNotation;
+
+ }).call(this);
+
+}).call(this);
+
+},{"./NodeType":5,"./XMLNode":27}],20:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, XMLDeclaration, XMLNode, isObject;
+
+ ({isObject} = require('./Utility'));
+
+ XMLNode = require('./XMLNode');
+
+ NodeType = require('./NodeType');
+
+ // Represents the XML declaration
+ module.exports = XMLDeclaration = class XMLDeclaration extends XMLNode {
+ // Initializes a new instance of `XMLDeclaration`
+
+ // `parent` the document object
+
+ // `version` A version number string, e.g. 1.0
+ // `encoding` Encoding declaration, e.g. UTF-8
+ // `standalone` standalone document declaration: true or false
+ constructor(parent, version, encoding, standalone) {
+ super(parent);
+ // arguments may also be passed as an object
+ if (isObject(version)) {
+ ({version, encoding, standalone} = version);
+ }
+ 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);
+ }
+ }
+
+ // Converts to string
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation for pretty print
+ // `options.offset` how many indentations to add to every line for pretty print
+ // `options.newline` newline sequence for pretty print
+ toString(options) {
+ return this.options.writer.declaration(this, this.options.writer.filterOptions(options));
+ }
+
+ };
+
+}).call(this);
+
+},{"./NodeType":5,"./Utility":6,"./XMLNode":27}],21:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDocType, XMLNamedNodeMap, XMLNode, isObject;
+
+ ({isObject} = require('./Utility'));
+
+ XMLNode = require('./XMLNode');
+
+ NodeType = require('./NodeType');
+
+ XMLDTDAttList = require('./XMLDTDAttList');
+
+ XMLDTDEntity = require('./XMLDTDEntity');
+
+ XMLDTDElement = require('./XMLDTDElement');
+
+ XMLDTDNotation = require('./XMLDTDNotation');
+
+ XMLNamedNodeMap = require('./XMLNamedNodeMap');
+
+ // Represents doctype declaration
+ module.exports = XMLDocType = (function() {
+ class XMLDocType extends XMLNode {
+ // Initializes a new instance of `XMLDocType`
+
+ // `parent` the document object
+
+ // `pubID` public identifier of the external subset
+ // `sysID` system identifier of the external subset
+ constructor(parent, pubID, sysID) {
+ var child, i, len, ref;
+ super(parent);
+ this.type = NodeType.DocType;
+ // set DTD name to the name of the root node
+ 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;
+ // arguments may also be passed as an object
+ if (isObject(pubID)) {
+ ({pubID, sysID} = pubID);
+ }
+ if (sysID == null) {
+ [sysID, pubID] = [pubID, sysID];
+ }
+ if (pubID != null) {
+ this.pubID = this.stringify.dtdPubID(pubID);
+ }
+ if (sysID != null) {
+ this.sysID = this.stringify.dtdSysID(sysID);
+ }
+ }
+
+ // Creates an element type declaration
+
+ // `name` element name
+ // `value` element content (defaults to #PCDATA)
+ element(name, value) {
+ var child;
+ child = new XMLDTDElement(this, name, value);
+ this.children.push(child);
+ return this;
+ }
+
+ // Creates an attribute declaration
+
+ // `elementName` the name of the element containing this attribute
+ // `attributeName` attribute name
+ // `attributeType` type of the attribute (defaults to CDATA)
+ // `defaultValueType` default value type (either #REQUIRED, #IMPLIED, #FIXED or
+ // #DEFAULT) (defaults to #IMPLIED)
+ // `defaultValue` default value of the attribute
+ // (only used for #FIXED or #DEFAULT)
+ attList(elementName, attributeName, attributeType, defaultValueType, defaultValue) {
+ var child;
+ child = new XMLDTDAttList(this, elementName, attributeName, attributeType, defaultValueType, defaultValue);
+ this.children.push(child);
+ return this;
+ }
+
+ // Creates a general entity declaration
+
+ // `name` the name of the entity
+ // `value` internal entity value or an object with external entity details
+ // `value.pubID` public identifier
+ // `value.sysID` system identifier
+ // `value.nData` notation declaration
+ entity(name, value) {
+ var child;
+ child = new XMLDTDEntity(this, false, name, value);
+ this.children.push(child);
+ return this;
+ }
+
+ // Creates a parameter entity declaration
+
+ // `name` the name of the entity
+ // `value` internal entity value or an object with external entity details
+ // `value.pubID` public identifier
+ // `value.sysID` system identifier
+ pEntity(name, value) {
+ var child;
+ child = new XMLDTDEntity(this, true, name, value);
+ this.children.push(child);
+ return this;
+ }
+
+ // Creates a NOTATION declaration
+
+ // `name` the name of the notation
+ // `value` an object with external entity details
+ // `value.pubID` public identifier
+ // `value.sysID` system identifier
+ notation(name, value) {
+ var child;
+ child = new XMLDTDNotation(this, name, value);
+ this.children.push(child);
+ return this;
+ }
+
+ // Converts to string
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation for pretty print
+ // `options.offset` how many indentations to add to every line for pretty print
+ // `options.newline` newline sequence for pretty print
+ toString(options) {
+ return this.options.writer.docType(this, this.options.writer.filterOptions(options));
+ }
+
+ // Aliases
+ ele(name, value) {
+ return this.element(name, value);
+ }
+
+ att(elementName, attributeName, attributeType, defaultValueType, defaultValue) {
+ return this.attList(elementName, attributeName, attributeType, defaultValueType, defaultValue);
+ }
+
+ ent(name, value) {
+ return this.entity(name, value);
+ }
+
+ pent(name, value) {
+ return this.pEntity(name, value);
+ }
+
+ not(name, value) {
+ return this.notation(name, value);
+ }
+
+ up() {
+ return this.root() || this.documentObject;
+ }
+
+ isEqualNode(node) {
+ if (!super.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;
+ }
+
+ };
+
+ // DOM level 1
+ Object.defineProperty(XMLDocType.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(XMLDocType.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);
+ }
+ });
+
+ // DOM level 2
+ Object.defineProperty(XMLDocType.prototype, 'publicId', {
+ get: function() {
+ return this.pubID;
+ }
+ });
+
+ Object.defineProperty(XMLDocType.prototype, 'systemId', {
+ get: function() {
+ return this.sysID;
+ }
+ });
+
+ Object.defineProperty(XMLDocType.prototype, 'internalSubset', {
+ get: function() {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+ });
+
+ return XMLDocType;
+
+ }).call(this);
+
+}).call(this);
+
+},{"./NodeType":5,"./Utility":6,"./XMLDTDAttList":16,"./XMLDTDElement":17,"./XMLDTDEntity":18,"./XMLDTDNotation":19,"./XMLNamedNodeMap":26,"./XMLNode":27}],22:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, XMLDOMConfiguration, XMLDOMImplementation, XMLDocument, XMLNode, XMLStringWriter, XMLStringifier, isPlainObject;
+
+ ({isPlainObject} = require('./Utility'));
+
+ XMLDOMImplementation = require('./XMLDOMImplementation');
+
+ XMLDOMConfiguration = require('./XMLDOMConfiguration');
+
+ XMLNode = require('./XMLNode');
+
+ NodeType = require('./NodeType');
+
+ XMLStringifier = require('./XMLStringifier');
+
+ XMLStringWriter = require('./XMLStringWriter');
+
+ // Represents an XML builder
+ module.exports = XMLDocument = (function() {
+ class XMLDocument extends XMLNode {
+ // Initializes a new instance of `XMLDocument`
+
+ // `options.keepNullNodes` whether nodes with null values will be kept
+ // or ignored: true or false
+ // `options.keepNullAttributes` whether attributes with null values will be
+ // kept or ignored: true or false
+ // `options.ignoreDecorators` whether decorator strings will be ignored when
+ // converting JS objects: true or false
+ // `options.separateArrayItems` whether array items are created as separate
+ // nodes when passed as an object value: true or false
+ // `options.noDoubleEncoding` whether existing html entities are encoded:
+ // true or false
+ // `options.stringify` a set of functions to use for converting values to
+ // strings
+ // `options.writer` the default XML writer to use for converting nodes to
+ // string. If the default writer is not set, the built-in XMLStringWriter
+ // will be used instead.
+ constructor(options) {
+ super(null);
+ this.name = "#document";
+ this.type = NodeType.Document;
+ this.documentURI = null;
+ this.domConfig = new XMLDOMConfiguration();
+ options || (options = {});
+ if (!options.writer) {
+ options.writer = new XMLStringWriter();
+ }
+ this.options = options;
+ this.stringify = new XMLStringifier(options);
+ }
+
+ // Ends the document and passes it to the given XML writer
+
+ // `writer` is either an XML writer or a plain object to pass to the
+ // constructor of the default XML writer. The default writer is assigned when
+ // creating the XML document. Following flags are recognized by the
+ // built-in XMLStringWriter:
+ // `writer.pretty` pretty prints the result
+ // `writer.indent` indentation for pretty print
+ // `writer.offset` how many indentations to add to every line for pretty print
+ // `writer.newline` newline sequence for pretty print
+ end(writer) {
+ var writerOptions;
+ writerOptions = {};
+ if (!writer) {
+ writer = this.options.writer;
+ } else if (isPlainObject(writer)) {
+ writerOptions = writer;
+ writer = this.options.writer;
+ }
+ return writer.document(this, writer.filterOptions(writerOptions));
+ }
+
+ // Converts the XML document to string
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation for pretty print
+ // `options.offset` how many indentations to add to every line for pretty print
+ // `options.newline` newline sequence for pretty print
+ toString(options) {
+ return this.options.writer.document(this, this.options.writer.filterOptions(options));
+ }
+
+ // DOM level 1 functions to be implemented later
+ createElement(tagName) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ createDocumentFragment() {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ createTextNode(data) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ createComment(data) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ createCDATASection(data) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ createProcessingInstruction(target, data) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ createAttribute(name) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ createEntityReference(name) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ getElementsByTagName(tagname) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ // DOM level 2 functions to be implemented later
+ importNode(importedNode, deep) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ createElementNS(namespaceURI, qualifiedName) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ createAttributeNS(namespaceURI, qualifiedName) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ getElementsByTagNameNS(namespaceURI, localName) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ getElementById(elementId) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ // DOM level 3 functions to be implemented later
+ adoptNode(source) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ normalizeDocument() {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ renameNode(node, namespaceURI, qualifiedName) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ // DOM level 4 functions to be implemented later
+ getElementsByClassName(classNames) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ createEvent(eventInterface) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ createRange() {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ createNodeIterator(root, whatToShow, filter) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ createTreeWalker(root, whatToShow, filter) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ };
+
+ // DOM level 1
+ Object.defineProperty(XMLDocument.prototype, 'implementation', {
+ value: new XMLDOMImplementation()
+ });
+
+ Object.defineProperty(XMLDocument.prototype, 'doctype', {
+ get: function() {
+ var child, i, len, ref;
+ ref = this.children;
+ for (i = 0, len = ref.length; i < len; i++) {
+ child = ref[i];
+ if (child.type === NodeType.DocType) {
+ return child;
+ }
+ }
+ return null;
+ }
+ });
+
+ Object.defineProperty(XMLDocument.prototype, 'documentElement', {
+ get: function() {
+ return this.rootObject || null;
+ }
+ });
+
+ // DOM level 3
+ Object.defineProperty(XMLDocument.prototype, 'inputEncoding', {
+ get: function() {
+ return null;
+ }
+ });
+
+ Object.defineProperty(XMLDocument.prototype, 'strictErrorChecking', {
+ get: function() {
+ return false;
+ }
+ });
+
+ Object.defineProperty(XMLDocument.prototype, 'xmlEncoding', {
+ get: function() {
+ if (this.children.length !== 0 && this.children[0].type === NodeType.Declaration) {
+ return this.children[0].encoding;
+ } else {
+ return null;
+ }
+ }
+ });
+
+ Object.defineProperty(XMLDocument.prototype, 'xmlStandalone', {
+ get: function() {
+ if (this.children.length !== 0 && this.children[0].type === NodeType.Declaration) {
+ return this.children[0].standalone === 'yes';
+ } else {
+ return false;
+ }
+ }
+ });
+
+ Object.defineProperty(XMLDocument.prototype, 'xmlVersion', {
+ get: function() {
+ if (this.children.length !== 0 && this.children[0].type === NodeType.Declaration) {
+ return this.children[0].version;
+ } else {
+ return "1.0";
+ }
+ }
+ });
+
+ // DOM level 4
+ Object.defineProperty(XMLDocument.prototype, 'URL', {
+ get: function() {
+ return this.documentURI;
+ }
+ });
+
+ Object.defineProperty(XMLDocument.prototype, 'origin', {
+ get: function() {
+ return null;
+ }
+ });
+
+ Object.defineProperty(XMLDocument.prototype, 'compatMode', {
+ get: function() {
+ return null;
+ }
+ });
+
+ Object.defineProperty(XMLDocument.prototype, 'characterSet', {
+ get: function() {
+ return null;
+ }
+ });
+
+ Object.defineProperty(XMLDocument.prototype, 'contentType', {
+ get: function() {
+ return null;
+ }
+ });
+
+ return XMLDocument;
+
+ }).call(this);
+
+}).call(this);
+
+},{"./NodeType":5,"./Utility":6,"./XMLDOMConfiguration":12,"./XMLDOMImplementation":14,"./XMLNode":27,"./XMLStringWriter":32,"./XMLStringifier":33}],23:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, WriterState, XMLAttribute, XMLCData, XMLComment, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDeclaration, XMLDocType, XMLDocument, XMLDocumentCB, XMLElement, XMLProcessingInstruction, XMLRaw, XMLStringWriter, XMLStringifier, XMLText, getValue, isFunction, isObject, isPlainObject,
+ hasProp = {}.hasOwnProperty;
+
+ ({isObject, isFunction, isPlainObject, getValue} = require('./Utility'));
+
+ NodeType = require('./NodeType');
+
+ XMLDocument = require('./XMLDocument');
+
+ XMLElement = require('./XMLElement');
+
+ XMLCData = require('./XMLCData');
+
+ XMLComment = require('./XMLComment');
+
+ XMLRaw = require('./XMLRaw');
+
+ XMLText = require('./XMLText');
+
+ XMLProcessingInstruction = require('./XMLProcessingInstruction');
+
+ XMLDeclaration = require('./XMLDeclaration');
+
+ XMLDocType = require('./XMLDocType');
+
+ XMLDTDAttList = require('./XMLDTDAttList');
+
+ XMLDTDEntity = require('./XMLDTDEntity');
+
+ XMLDTDElement = require('./XMLDTDElement');
+
+ XMLDTDNotation = require('./XMLDTDNotation');
+
+ XMLAttribute = require('./XMLAttribute');
+
+ XMLStringifier = require('./XMLStringifier');
+
+ XMLStringWriter = require('./XMLStringWriter');
+
+ WriterState = require('./WriterState');
+
+ // Represents an XML builder
+ module.exports = XMLDocumentCB = class XMLDocumentCB {
+ // Initializes a new instance of `XMLDocumentCB`
+
+ // `options.keepNullNodes` whether nodes with null values will be kept
+ // or ignored: true or false
+ // `options.keepNullAttributes` whether attributes with null values will be
+ // kept or ignored: true or false
+ // `options.ignoreDecorators` whether decorator strings will be ignored when
+ // converting JS objects: true or false
+ // `options.separateArrayItems` whether array items are created as separate
+ // nodes when passed as an object value: true or false
+ // `options.noDoubleEncoding` whether existing html entities are encoded:
+ // true or false
+ // `options.stringify` a set of functions to use for converting values to
+ // strings
+ // `options.writer` the default XML writer to use for converting nodes to
+ // string. If the default writer is not set, the built-in XMLStringWriter
+ // will be used instead.
+
+ // `onData` the function to be called when a new chunk of XML is output. The
+ // string containing the XML chunk is passed to `onData` as its first
+ // argument, and the current indentation level as its second argument.
+ // `onEnd` the function to be called when the XML document is completed with
+ // `end`. `onEnd` does not receive any arguments.
+ constructor(options, onData, onEnd) {
+ var writerOptions;
+ this.name = "?xml";
+ this.type = NodeType.Document;
+ options || (options = {});
+ writerOptions = {};
+ if (!options.writer) {
+ options.writer = new XMLStringWriter();
+ } else if (isPlainObject(options.writer)) {
+ writerOptions = options.writer;
+ options.writer = new XMLStringWriter();
+ }
+ this.options = options;
+ this.writer = options.writer;
+ this.writerOptions = this.writer.filterOptions(writerOptions);
+ this.stringify = new XMLStringifier(options);
+ this.onDataCallback = onData || function() {};
+ this.onEndCallback = onEnd || function() {};
+ this.currentNode = null;
+ this.currentLevel = -1;
+ this.openTags = {};
+ this.documentStarted = false;
+ this.documentCompleted = false;
+ this.root = null;
+ }
+
+ // Creates a child element node from the given XMLNode
+
+ // `node` the child node
+ createChildNode(node) {
+ var att, attName, attributes, child, i, len, ref, ref1;
+ switch (node.type) {
+ case NodeType.CData:
+ this.cdata(node.value);
+ break;
+ case NodeType.Comment:
+ this.comment(node.value);
+ break;
+ case NodeType.Element:
+ attributes = {};
+ ref = node.attribs;
+ for (attName in ref) {
+ if (!hasProp.call(ref, attName)) continue;
+ att = ref[attName];
+ attributes[attName] = att.value;
+ }
+ this.node(node.name, attributes);
+ break;
+ case NodeType.Dummy:
+ this.dummy();
+ break;
+ case NodeType.Raw:
+ this.raw(node.value);
+ break;
+ case NodeType.Text:
+ this.text(node.value);
+ break;
+ case NodeType.ProcessingInstruction:
+ this.instruction(node.target, node.value);
+ break;
+ default:
+ throw new Error("This XML node type is not supported in a JS object: " + node.constructor.name);
+ }
+ ref1 = node.children;
+ // write child nodes recursively
+ for (i = 0, len = ref1.length; i < len; i++) {
+ child = ref1[i];
+ this.createChildNode(child);
+ if (child.type === NodeType.Element) {
+ this.up();
+ }
+ }
+ return this;
+ }
+
+ // Creates a dummy node
+
+ dummy() {
+ // no-op, just return this
+ return this;
+ }
+
+ // Creates a node
+
+ // `name` name of the node
+ // `attributes` an object containing name/value pairs of attributes
+ // `text` element text
+ node(name, attributes, text) {
+ if (name == null) {
+ throw new Error("Missing node name.");
+ }
+ if (this.root && this.currentLevel === -1) {
+ throw new Error("Document can only have one root node. " + this.debugInfo(name));
+ }
+ this.openCurrent();
+ name = getValue(name);
+ if (attributes == null) {
+ attributes = {};
+ }
+ attributes = getValue(attributes);
+ // swap argument order: text <-> attributes
+ if (!isObject(attributes)) {
+ [text, attributes] = [attributes, text];
+ }
+ this.currentNode = new XMLElement(this, name, attributes);
+ this.currentNode.children = false;
+ this.currentLevel++;
+ this.openTags[this.currentLevel] = this.currentNode;
+ if (text != null) {
+ this.text(text);
+ }
+ return this;
+ }
+
+ // Creates a child element node or an element type declaration when called
+ // inside the DTD
+
+ // `name` name of the node
+ // `attributes` an object containing name/value pairs of attributes
+ // `text` element text
+ element(name, attributes, text) {
+ var child, i, len, oldValidationFlag, ref, root;
+ if (this.currentNode && this.currentNode.type === NodeType.DocType) {
+ this.dtdElement(...arguments);
+ } else {
+ if (Array.isArray(name) || isObject(name) || isFunction(name)) {
+ oldValidationFlag = this.options.noValidation;
+ this.options.noValidation = true;
+ root = new XMLDocument(this.options).element('TEMP_ROOT');
+ root.element(name);
+ this.options.noValidation = oldValidationFlag;
+ ref = root.children;
+ for (i = 0, len = ref.length; i < len; i++) {
+ child = ref[i];
+ this.createChildNode(child);
+ if (child.type === NodeType.Element) {
+ this.up();
+ }
+ }
+ } else {
+ this.node(name, attributes, text);
+ }
+ }
+ return this;
+ }
+
+ // Adds or modifies an attribute
+
+ // `name` attribute name
+ // `value` attribute value
+ attribute(name, value) {
+ var attName, attValue;
+ if (!this.currentNode || this.currentNode.children) {
+ throw new Error("att() can only be used immediately after an ele() call in callback mode. " + this.debugInfo(name));
+ }
+ if (name != null) {
+ name = getValue(name);
+ }
+ if (isObject(name)) { // expand if object
+ 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.currentNode.attribs[name] = new XMLAttribute(this, name, "");
+ } else if (value != null) {
+ this.currentNode.attribs[name] = new XMLAttribute(this, name, value);
+ }
+ }
+ return this;
+ }
+
+ // Creates a text node
+
+ // `value` element text
+ text(value) {
+ var node;
+ this.openCurrent();
+ node = new XMLText(this, value);
+ this.onData(this.writer.text(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
+ return this;
+ }
+
+ // Creates a CDATA node
+
+ // `value` element text without CDATA delimiters
+ cdata(value) {
+ var node;
+ this.openCurrent();
+ node = new XMLCData(this, value);
+ this.onData(this.writer.cdata(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
+ return this;
+ }
+
+ // Creates a comment node
+
+ // `value` comment text
+ comment(value) {
+ var node;
+ this.openCurrent();
+ node = new XMLComment(this, value);
+ this.onData(this.writer.comment(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
+ return this;
+ }
+
+ // Adds unescaped raw text
+
+ // `value` text
+ raw(value) {
+ var node;
+ this.openCurrent();
+ node = new XMLRaw(this, value);
+ this.onData(this.writer.raw(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
+ return this;
+ }
+
+ // Adds a processing instruction
+
+ // `target` instruction target
+ // `value` instruction value
+ instruction(target, value) {
+ var i, insTarget, insValue, len, node;
+ this.openCurrent();
+ if (target != null) {
+ target = getValue(target);
+ }
+ if (value != null) {
+ value = getValue(value);
+ }
+ if (Array.isArray(target)) { // expand if array
+ for (i = 0, len = target.length; i < len; i++) {
+ insTarget = target[i];
+ this.instruction(insTarget);
+ }
+ } else if (isObject(target)) { // expand if object
+ for (insTarget in target) {
+ if (!hasProp.call(target, insTarget)) continue;
+ insValue = target[insTarget];
+ this.instruction(insTarget, insValue);
+ }
+ } else {
+ if (isFunction(value)) {
+ value = value.apply();
+ }
+ node = new XMLProcessingInstruction(this, target, value);
+ this.onData(this.writer.processingInstruction(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
+ }
+ return this;
+ }
+
+ // Creates the xml declaration
+
+ // `version` A version number string, e.g. 1.0
+ // `encoding` Encoding declaration, e.g. UTF-8
+ // `standalone` standalone document declaration: true or false
+ declaration(version, encoding, standalone) {
+ var node;
+ this.openCurrent();
+ if (this.documentStarted) {
+ throw new Error("declaration() must be the first node.");
+ }
+ node = new XMLDeclaration(this, version, encoding, standalone);
+ this.onData(this.writer.declaration(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
+ return this;
+ }
+
+ // Creates the document type declaration
+
+ // `root` the name of the root node
+ // `pubID` the public identifier of the external subset
+ // `sysID` the system identifier of the external subset
+ doctype(root, pubID, sysID) {
+ this.openCurrent();
+ if (root == null) {
+ throw new Error("Missing root node name.");
+ }
+ if (this.root) {
+ throw new Error("dtd() must come before the root node.");
+ }
+ this.currentNode = new XMLDocType(this, pubID, sysID);
+ this.currentNode.rootNodeName = root;
+ this.currentNode.children = false;
+ this.currentLevel++;
+ this.openTags[this.currentLevel] = this.currentNode;
+ return this;
+ }
+
+ // Creates an element type declaration
+
+ // `name` element name
+ // `value` element content (defaults to #PCDATA)
+ dtdElement(name, value) {
+ var node;
+ this.openCurrent();
+ node = new XMLDTDElement(this, name, value);
+ this.onData(this.writer.dtdElement(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
+ return this;
+ }
+
+ // Creates an attribute declaration
+
+ // `elementName` the name of the element containing this attribute
+ // `attributeName` attribute name
+ // `attributeType` type of the attribute (defaults to CDATA)
+ // `defaultValueType` default value type (either #REQUIRED, #IMPLIED, #FIXED or
+ // #DEFAULT) (defaults to #IMPLIED)
+ // `defaultValue` default value of the attribute
+ // (only used for #FIXED or #DEFAULT)
+ attList(elementName, attributeName, attributeType, defaultValueType, defaultValue) {
+ var node;
+ this.openCurrent();
+ node = new XMLDTDAttList(this, elementName, attributeName, attributeType, defaultValueType, defaultValue);
+ this.onData(this.writer.dtdAttList(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
+ return this;
+ }
+
+ // Creates a general entity declaration
+
+ // `name` the name of the entity
+ // `value` internal entity value or an object with external entity details
+ // `value.pubID` public identifier
+ // `value.sysID` system identifier
+ // `value.nData` notation declaration
+ entity(name, value) {
+ var node;
+ this.openCurrent();
+ node = new XMLDTDEntity(this, false, name, value);
+ this.onData(this.writer.dtdEntity(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
+ return this;
+ }
+
+ // Creates a parameter entity declaration
+
+ // `name` the name of the entity
+ // `value` internal entity value or an object with external entity details
+ // `value.pubID` public identifier
+ // `value.sysID` system identifier
+ pEntity(name, value) {
+ var node;
+ this.openCurrent();
+ node = new XMLDTDEntity(this, true, name, value);
+ this.onData(this.writer.dtdEntity(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
+ return this;
+ }
+
+ // Creates a NOTATION declaration
+
+ // `name` the name of the notation
+ // `value` an object with external entity details
+ // `value.pubID` public identifier
+ // `value.sysID` system identifier
+ notation(name, value) {
+ var node;
+ this.openCurrent();
+ node = new XMLDTDNotation(this, name, value);
+ this.onData(this.writer.dtdNotation(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
+ return this;
+ }
+
+ // Gets the parent node
+ up() {
+ if (this.currentLevel < 0) {
+ throw new Error("The document node has no parent.");
+ }
+ if (this.currentNode) {
+ if (this.currentNode.children) {
+ this.closeNode(this.currentNode);
+ } else {
+ this.openNode(this.currentNode);
+ }
+ this.currentNode = null;
+ } else {
+ this.closeNode(this.openTags[this.currentLevel]);
+ }
+ delete this.openTags[this.currentLevel];
+ this.currentLevel--;
+ return this;
+ }
+
+ // Ends the document
+ end() {
+ while (this.currentLevel >= 0) {
+ this.up();
+ }
+ return this.onEnd();
+ }
+
+ // Opens the current parent node
+ openCurrent() {
+ if (this.currentNode) {
+ this.currentNode.children = true;
+ return this.openNode(this.currentNode);
+ }
+ }
+
+ // Writes the opening tag of the current node or the entire node if it has
+ // no child nodes
+ openNode(node) {
+ var att, chunk, name, ref;
+ if (!node.isOpen) {
+ if (!this.root && this.currentLevel === 0 && node.type === NodeType.Element) {
+ this.root = node;
+ }
+ chunk = '';
+ if (node.type === NodeType.Element) {
+ this.writerOptions.state = WriterState.OpenTag;
+ chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + '<' + node.name;
+ ref = node.attribs;
+ for (name in ref) {
+ if (!hasProp.call(ref, name)) continue;
+ att = ref[name];
+ chunk += this.writer.attribute(att, this.writerOptions, this.currentLevel);
+ }
+ chunk += (node.children ? '>' : '/>') + this.writer.endline(node, this.writerOptions, this.currentLevel);
+ this.writerOptions.state = WriterState.InsideTag; // if node.type is NodeType.DocType
+ } else {
+ this.writerOptions.state = WriterState.OpenTag;
+ chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + '<!DOCTYPE ' + node.rootNodeName;
+
+ // external identifier
+ if (node.pubID && node.sysID) {
+ chunk += ' PUBLIC "' + node.pubID + '" "' + node.sysID + '"';
+ } else if (node.sysID) {
+ chunk += ' SYSTEM "' + node.sysID + '"';
+ }
+
+ // internal subset
+ if (node.children) {
+ chunk += ' [';
+ this.writerOptions.state = WriterState.InsideTag;
+ } else {
+ this.writerOptions.state = WriterState.CloseTag;
+ chunk += '>';
+ }
+ chunk += this.writer.endline(node, this.writerOptions, this.currentLevel);
+ }
+ this.onData(chunk, this.currentLevel);
+ return node.isOpen = true;
+ }
+ }
+
+ // Writes the closing tag of the current node
+ closeNode(node) {
+ var chunk;
+ if (!node.isClosed) {
+ chunk = '';
+ this.writerOptions.state = WriterState.CloseTag;
+ if (node.type === NodeType.Element) {
+ chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + '</' + node.name + '>' + this.writer.endline(node, this.writerOptions, this.currentLevel); // if node.type is NodeType.DocType
+ } else {
+ chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + ']>' + this.writer.endline(node, this.writerOptions, this.currentLevel);
+ }
+ this.writerOptions.state = WriterState.None;
+ this.onData(chunk, this.currentLevel);
+ return node.isClosed = true;
+ }
+ }
+
+ // Called when a new chunk of XML is output
+
+ // `chunk` a string containing the XML chunk
+ // `level` current indentation level
+ onData(chunk, level) {
+ this.documentStarted = true;
+ return this.onDataCallback(chunk, level + 1);
+ }
+
+ // Called when the XML document is completed
+ onEnd() {
+ this.documentCompleted = true;
+ return this.onEndCallback();
+ }
+
+ // Returns debug string
+ debugInfo(name) {
+ if (name == null) {
+ return "";
+ } else {
+ return "node: <" + name + ">";
+ }
+ }
+
+ // Node aliases
+ ele() {
+ return this.element(...arguments);
+ }
+
+ nod(name, attributes, text) {
+ return this.node(name, attributes, text);
+ }
+
+ txt(value) {
+ return this.text(value);
+ }
+
+ dat(value) {
+ return this.cdata(value);
+ }
+
+ com(value) {
+ return this.comment(value);
+ }
+
+ ins(target, value) {
+ return this.instruction(target, value);
+ }
+
+ dec(version, encoding, standalone) {
+ return this.declaration(version, encoding, standalone);
+ }
+
+ dtd(root, pubID, sysID) {
+ return this.doctype(root, pubID, sysID);
+ }
+
+ e(name, attributes, text) {
+ return this.element(name, attributes, text);
+ }
+
+ n(name, attributes, text) {
+ return this.node(name, attributes, text);
+ }
+
+ t(value) {
+ return this.text(value);
+ }
+
+ d(value) {
+ return this.cdata(value);
+ }
+
+ c(value) {
+ return this.comment(value);
+ }
+
+ r(value) {
+ return this.raw(value);
+ }
+
+ i(target, value) {
+ return this.instruction(target, value);
+ }
+
+ // Attribute aliases
+ att() {
+ if (this.currentNode && this.currentNode.type === NodeType.DocType) {
+ return this.attList(...arguments);
+ } else {
+ return this.attribute(...arguments);
+ }
+ }
+
+ a() {
+ if (this.currentNode && this.currentNode.type === NodeType.DocType) {
+ return this.attList(...arguments);
+ } else {
+ return this.attribute(...arguments);
+ }
+ }
+
+ // DTD aliases
+ // att() and ele() are defined above
+ ent(name, value) {
+ return this.entity(name, value);
+ }
+
+ pent(name, value) {
+ return this.pEntity(name, value);
+ }
+
+ not(name, value) {
+ return this.notation(name, value);
+ }
+
+ };
+
+}).call(this);
+
+},{"./NodeType":5,"./Utility":6,"./WriterState":7,"./XMLAttribute":8,"./XMLCData":9,"./XMLComment":11,"./XMLDTDAttList":16,"./XMLDTDElement":17,"./XMLDTDEntity":18,"./XMLDTDNotation":19,"./XMLDeclaration":20,"./XMLDocType":21,"./XMLDocument":22,"./XMLElement":25,"./XMLProcessingInstruction":29,"./XMLRaw":30,"./XMLStringWriter":32,"./XMLStringifier":33,"./XMLText":34}],24:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, XMLDummy, XMLNode;
+
+ XMLNode = require('./XMLNode');
+
+ NodeType = require('./NodeType');
+
+ // Represents a raw node
+ module.exports = XMLDummy = class XMLDummy extends XMLNode {
+ // Initializes a new instance of `XMLDummy`
+
+ // `XMLDummy` is a special node representing a node with
+ // a null value. Dummy nodes are created while recursively
+ // building the XML tree. Simply skipping null values doesn't
+ // work because that would break the recursive chain.
+ constructor(parent) {
+ super(parent);
+ this.type = NodeType.Dummy;
+ }
+
+ // Creates and returns a deep clone of `this`
+ clone() {
+ return Object.create(this);
+ }
+
+ // Converts the XML fragment to string
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation for pretty print
+ // `options.offset` how many indentations to add to every line for pretty print
+ // `options.newline` newline sequence for pretty print
+ toString(options) {
+ return '';
+ }
+
+ };
+
+}).call(this);
+
+},{"./NodeType":5,"./XMLNode":27}],25:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, XMLAttribute, XMLElement, XMLNamedNodeMap, XMLNode, getValue, isFunction, isObject,
+ hasProp = {}.hasOwnProperty;
+
+ ({isObject, isFunction, getValue} = require('./Utility'));
+
+ XMLNode = require('./XMLNode');
+
+ NodeType = require('./NodeType');
+
+ XMLAttribute = require('./XMLAttribute');
+
+ XMLNamedNodeMap = require('./XMLNamedNodeMap');
+
+ // Represents an element of the XML document
+ module.exports = XMLElement = (function() {
+ class XMLElement extends XMLNode {
+ // Initializes a new instance of `XMLElement`
+
+ // `parent` the parent node
+ // `name` element name
+ // `attributes` an object containing name/value pairs of attributes
+ constructor(parent, name, attributes) {
+ var child, j, len, ref;
+ super(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);
+ }
+ // set properties if this is the root node
+ if (parent.type === NodeType.Document) {
+ this.isRoot = true;
+ this.documentObject = parent;
+ parent.rootObject = this;
+ // set dtd name
+ if (parent.children) {
+ ref = parent.children;
+ for (j = 0, len = ref.length; j < len; j++) {
+ child = ref[j];
+ if (child.type === NodeType.DocType) {
+ child.name = this.name;
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ // Creates and returns a deep clone of `this`
+
+ clone() {
+ var att, attName, clonedSelf, ref;
+ clonedSelf = Object.create(this);
+ // remove document element
+ if (clonedSelf.isRoot) {
+ clonedSelf.documentObject = null;
+ }
+ // clone attributes
+ clonedSelf.attribs = {};
+ ref = this.attribs;
+ for (attName in ref) {
+ if (!hasProp.call(ref, attName)) continue;
+ att = ref[attName];
+ clonedSelf.attribs[attName] = att.clone();
+ }
+ // clone child nodes
+ clonedSelf.children = [];
+ this.children.forEach(function(child) {
+ var clonedChild;
+ clonedChild = child.clone();
+ clonedChild.parent = clonedSelf;
+ return clonedSelf.children.push(clonedChild);
+ });
+ return clonedSelf;
+ }
+
+ // Adds or modifies an attribute
+
+ // `name` attribute name
+ // `value` attribute value
+ attribute(name, value) {
+ var attName, attValue;
+ if (name != null) {
+ name = getValue(name);
+ }
+ if (isObject(name)) { // expand if object
+ 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;
+ }
+
+ // Removes an attribute
+
+ // `name` attribute name
+ removeAttribute(name) {
+ var attName, j, len;
+ // Also defined in DOM level 1
+ // removeAttribute(name) removes an attribute by name.
+ if (name == null) {
+ throw new Error("Missing attribute name. " + this.debugInfo());
+ }
+ name = getValue(name);
+ if (Array.isArray(name)) { // expand if array
+ for (j = 0, len = name.length; j < len; j++) {
+ attName = name[j];
+ delete this.attribs[attName];
+ }
+ } else {
+ delete this.attribs[name];
+ }
+ return this;
+ }
+
+ // Converts the XML fragment to string
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation for pretty print
+ // `options.offset` how many indentations to add to every line for pretty print
+ // `options.newline` newline sequence for pretty print
+ // `options.allowEmpty` do not self close empty element tags
+ toString(options) {
+ return this.options.writer.element(this, this.options.writer.filterOptions(options));
+ }
+
+ // Aliases
+ att(name, value) {
+ return this.attribute(name, value);
+ }
+
+ a(name, value) {
+ return this.attribute(name, value);
+ }
+
+ // DOM Level 1
+ getAttribute(name) {
+ if (this.attribs.hasOwnProperty(name)) {
+ return this.attribs[name].value;
+ } else {
+ return null;
+ }
+ }
+
+ setAttribute(name, value) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ getAttributeNode(name) {
+ if (this.attribs.hasOwnProperty(name)) {
+ return this.attribs[name];
+ } else {
+ return null;
+ }
+ }
+
+ setAttributeNode(newAttr) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ removeAttributeNode(oldAttr) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ getElementsByTagName(name) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ // DOM Level 2
+ getAttributeNS(namespaceURI, localName) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ setAttributeNS(namespaceURI, qualifiedName, value) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ removeAttributeNS(namespaceURI, localName) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ getAttributeNodeNS(namespaceURI, localName) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ setAttributeNodeNS(newAttr) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ getElementsByTagNameNS(namespaceURI, localName) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ hasAttribute(name) {
+ return this.attribs.hasOwnProperty(name);
+ }
+
+ hasAttributeNS(namespaceURI, localName) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ // DOM Level 3
+ setIdAttribute(name, isId) {
+ if (this.attribs.hasOwnProperty(name)) {
+ return this.attribs[name].isId;
+ } else {
+ return isId;
+ }
+ }
+
+ setIdAttributeNS(namespaceURI, localName, isId) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ setIdAttributeNode(idAttr, isId) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ // DOM Level 4
+ getElementsByTagName(tagname) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ getElementsByTagNameNS(namespaceURI, localName) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ getElementsByClassName(classNames) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ isEqualNode(node) {
+ var i, j, ref;
+ if (!super.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, ref = this.attribs.length - 1; (0 <= ref ? j <= ref : j >= ref); i = 0 <= ref ? ++j : --j) {
+ if (!this.attribs[i].isEqualNode(node.attribs[i])) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ };
+
+ // DOM level 1
+ Object.defineProperty(XMLElement.prototype, 'tagName', {
+ get: function() {
+ return this.name;
+ }
+ });
+
+ // DOM level 4
+ Object.defineProperty(XMLElement.prototype, 'namespaceURI', {
+ get: function() {
+ return '';
+ }
+ });
+
+ Object.defineProperty(XMLElement.prototype, 'prefix', {
+ get: function() {
+ return '';
+ }
+ });
+
+ Object.defineProperty(XMLElement.prototype, 'localName', {
+ get: function() {
+ return this.name;
+ }
+ });
+
+ Object.defineProperty(XMLElement.prototype, 'id', {
+ get: function() {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+ });
+
+ Object.defineProperty(XMLElement.prototype, 'className', {
+ get: function() {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+ });
+
+ Object.defineProperty(XMLElement.prototype, 'classList', {
+ get: function() {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+ });
+
+ Object.defineProperty(XMLElement.prototype, 'attributes', {
+ get: function() {
+ if (!this.attributeMap || !this.attributeMap.nodes) {
+ this.attributeMap = new XMLNamedNodeMap(this.attribs);
+ }
+ return this.attributeMap;
+ }
+ });
+
+ return XMLElement;
+
+ }).call(this);
+
+}).call(this);
+
+},{"./NodeType":5,"./Utility":6,"./XMLAttribute":8,"./XMLNamedNodeMap":26,"./XMLNode":27}],26:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ // Represents a map of nodes accessed by a string key
+ var XMLNamedNodeMap;
+
+ module.exports = XMLNamedNodeMap = (function() {
+ class XMLNamedNodeMap {
+ // Initializes a new instance of `XMLNamedNodeMap`
+ // This is just a wrapper around an ordinary
+ // JS object.
+
+ // `nodes` the object containing nodes.
+ constructor(nodes) {
+ this.nodes = nodes;
+ }
+
+ // Creates and returns a deep clone of `this`
+
+ clone() {
+ // this class should not be cloned since it wraps
+ // around a given object. The calling function should check
+ // whether the wrapped object is null and supply a new object
+ // (from the clone).
+ return this.nodes = null;
+ }
+
+ // DOM Level 1
+ getNamedItem(name) {
+ return this.nodes[name];
+ }
+
+ setNamedItem(node) {
+ var oldNode;
+ oldNode = this.nodes[node.nodeName];
+ this.nodes[node.nodeName] = node;
+ return oldNode || null;
+ }
+
+ removeNamedItem(name) {
+ var oldNode;
+ oldNode = this.nodes[name];
+ delete this.nodes[name];
+ return oldNode || null;
+ }
+
+ item(index) {
+ return this.nodes[Object.keys(this.nodes)[index]] || null;
+ }
+
+ // DOM level 2 functions to be implemented later
+ getNamedItemNS(namespaceURI, localName) {
+ throw new Error("This DOM method is not implemented.");
+ }
+
+ setNamedItemNS(node) {
+ throw new Error("This DOM method is not implemented.");
+ }
+
+ removeNamedItemNS(namespaceURI, localName) {
+ throw new Error("This DOM method is not implemented.");
+ }
+
+ };
+
+
+ // DOM level 1
+ Object.defineProperty(XMLNamedNodeMap.prototype, 'length', {
+ get: function() {
+ return Object.keys(this.nodes).length || 0;
+ }
+ });
+
+ return XMLNamedNodeMap;
+
+ }).call(this);
+
+}).call(this);
+
+},{}],27:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var DocumentPosition, NodeType, XMLCData, XMLComment, XMLDeclaration, XMLDocType, XMLDummy, XMLElement, XMLNamedNodeMap, XMLNode, XMLNodeList, XMLProcessingInstruction, XMLRaw, XMLText, getValue, isEmpty, isFunction, isObject,
+ hasProp = {}.hasOwnProperty,
+ splice = [].splice;
+
+ ({isObject, isFunction, isEmpty, getValue} = require('./Utility'));
+
+ XMLElement = null;
+
+ XMLCData = null;
+
+ XMLComment = null;
+
+ XMLDeclaration = null;
+
+ XMLDocType = null;
+
+ XMLRaw = null;
+
+ XMLText = null;
+
+ XMLProcessingInstruction = null;
+
+ XMLDummy = null;
+
+ NodeType = null;
+
+ XMLNodeList = null;
+
+ XMLNamedNodeMap = null;
+
+ DocumentPosition = null;
+
+ // Represents a generic XMl element
+ module.exports = XMLNode = (function() {
+ class XMLNode {
+ // Initializes a new instance of `XMLNode`
+
+ // `parent` the parent node
+ constructor(parent1) {
+ this.parent = parent1;
+ if (this.parent) {
+ this.options = this.parent.options;
+ this.stringify = this.parent.stringify;
+ }
+ this.value = null;
+ this.children = [];
+ this.baseURI = null;
+ // first execution, load dependencies that are otherwise
+ // circular (so we can't load them at the top)
+ if (!XMLElement) {
+ XMLElement = require('./XMLElement');
+ XMLCData = require('./XMLCData');
+ XMLComment = require('./XMLComment');
+ XMLDeclaration = require('./XMLDeclaration');
+ XMLDocType = require('./XMLDocType');
+ XMLRaw = require('./XMLRaw');
+ XMLText = require('./XMLText');
+ XMLProcessingInstruction = require('./XMLProcessingInstruction');
+ XMLDummy = require('./XMLDummy');
+ NodeType = require('./NodeType');
+ XMLNodeList = require('./XMLNodeList');
+ XMLNamedNodeMap = require('./XMLNamedNodeMap');
+ DocumentPosition = require('./DocumentPosition');
+ }
+ }
+
+
+ // Sets the parent node of this node and its children recursively
+
+ // `parent` the parent node
+ setParent(parent) {
+ var child, j, len, ref1, results;
+ this.parent = parent;
+ if (parent) {
+ this.options = parent.options;
+ this.stringify = parent.stringify;
+ }
+ ref1 = this.children;
+ results = [];
+ for (j = 0, len = ref1.length; j < len; j++) {
+ child = ref1[j];
+ results.push(child.setParent(this));
+ }
+ return results;
+ }
+
+ // Creates a child element node
+
+ // `name` node name or an object describing the XML tree
+ // `attributes` an object containing name/value pairs of attributes
+ // `text` element text
+ element(name, attributes, text) {
+ var childNode, item, j, k, key, lastChild, len, len1, val;
+ lastChild = null;
+ if (attributes === null && (text == null)) {
+ [attributes, text] = [{}, null];
+ }
+ if (attributes == null) {
+ attributes = {};
+ }
+ attributes = getValue(attributes);
+ // swap argument order: text <-> attributes
+ if (!isObject(attributes)) {
+ [text, attributes] = [attributes, text];
+ }
+ if (name != null) {
+ name = getValue(name);
+ }
+ // expand if array
+ if (Array.isArray(name)) {
+ for (j = 0, len = name.length; j < len; j++) {
+ item = name[j];
+ lastChild = this.element(item);
+ }
+ // evaluate if function
+ } else if (isFunction(name)) {
+ lastChild = this.element(name.apply());
+ // expand if object
+ } else if (isObject(name)) {
+ for (key in name) {
+ if (!hasProp.call(name, key)) continue;
+ val = name[key];
+ if (isFunction(val)) {
+ // evaluate if function
+ val = val.apply();
+ }
+ // assign attributes
+ if (!this.options.ignoreDecorators && this.stringify.convertAttKey && key.indexOf(this.stringify.convertAttKey) === 0) {
+ lastChild = this.attribute(key.substr(this.stringify.convertAttKey.length), val);
+ // skip empty arrays
+ } else if (!this.options.separateArrayItems && Array.isArray(val) && isEmpty(val)) {
+ lastChild = this.dummy();
+ // empty objects produce one node
+ } else if (isObject(val) && isEmpty(val)) {
+ lastChild = this.element(key);
+ // skip null and undefined nodes
+ } else if (!this.options.keepNullNodes && (val == null)) {
+ lastChild = this.dummy();
+
+ // expand list by creating child nodes
+ } else if (!this.options.separateArrayItems && Array.isArray(val)) {
+ for (k = 0, len1 = val.length; k < len1; k++) {
+ item = val[k];
+ childNode = {};
+ childNode[key] = item;
+ lastChild = this.element(childNode);
+ }
+
+ // expand child nodes under parent
+ } else if (isObject(val)) {
+ // if the key is #text expand child nodes under this node to support mixed content
+ if (!this.options.ignoreDecorators && this.stringify.convertTextKey && key.indexOf(this.stringify.convertTextKey) === 0) {
+ lastChild = this.element(val);
+ } else {
+ lastChild = this.element(key);
+ lastChild.element(val);
+ }
+ } else {
+
+ // text node
+ lastChild = this.element(key, val);
+ }
+ }
+ // skip null nodes
+ } else if (!this.options.keepNullNodes && text === null) {
+ lastChild = this.dummy();
+ } else {
+ // text node
+ if (!this.options.ignoreDecorators && this.stringify.convertTextKey && name.indexOf(this.stringify.convertTextKey) === 0) {
+ lastChild = this.text(text);
+ // cdata node
+ } else if (!this.options.ignoreDecorators && this.stringify.convertCDataKey && name.indexOf(this.stringify.convertCDataKey) === 0) {
+ lastChild = this.cdata(text);
+ // comment node
+ } else if (!this.options.ignoreDecorators && this.stringify.convertCommentKey && name.indexOf(this.stringify.convertCommentKey) === 0) {
+ lastChild = this.comment(text);
+ // raw text node
+ } else if (!this.options.ignoreDecorators && this.stringify.convertRawKey && name.indexOf(this.stringify.convertRawKey) === 0) {
+ lastChild = this.raw(text);
+ // processing instruction
+ } else if (!this.options.ignoreDecorators && this.stringify.convertPIKey && name.indexOf(this.stringify.convertPIKey) === 0) {
+ lastChild = this.instruction(name.substr(this.stringify.convertPIKey.length), text);
+ } else {
+ // element node
+ lastChild = this.node(name, attributes, text);
+ }
+ }
+ if (lastChild == null) {
+ throw new Error("Could not create any elements with: " + name + ". " + this.debugInfo());
+ }
+ return lastChild;
+ }
+
+ // Creates a child element node before the current node
+
+ // `name` node name or an object describing the XML tree
+ // `attributes` an object containing name/value pairs of attributes
+ // `text` element text
+ insertBefore(name, attributes, text) {
+ var child, i, newChild, refChild, removed;
+ // DOM level 1
+ // insertBefore(newChild, refChild) inserts the child node newChild before refChild
+ if (name != null ? name.type : void 0) {
+ newChild = name;
+ refChild = attributes;
+ newChild.setParent(this);
+ if (refChild) {
+ // temporarily remove children starting *with* refChild
+ i = children.indexOf(refChild);
+ removed = children.splice(i);
+
+ // add the new child
+ children.push(newChild);
+
+ // add back removed children after new child
+ Array.prototype.push.apply(children, removed);
+ } else {
+ children.push(newChild);
+ }
+ return newChild;
+ } else {
+ if (this.isRoot) {
+ throw new Error("Cannot insert elements at root level. " + this.debugInfo(name));
+ }
+
+ // temporarily remove children starting *with* this
+ i = this.parent.children.indexOf(this);
+ removed = this.parent.children.splice(i);
+
+ // add the new child
+ child = this.parent.element(name, attributes, text);
+
+ // add back removed children after new child
+ Array.prototype.push.apply(this.parent.children, removed);
+ return child;
+ }
+ }
+
+ // Creates a child element node after the current node
+
+ // `name` node name or an object describing the XML tree
+ // `attributes` an object containing name/value pairs of attributes
+ // `text` element text
+ insertAfter(name, attributes, text) {
+ var child, i, removed;
+ if (this.isRoot) {
+ throw new Error("Cannot insert elements at root level. " + this.debugInfo(name));
+ }
+
+ // temporarily remove children starting *after* this
+ i = this.parent.children.indexOf(this);
+ removed = this.parent.children.splice(i + 1);
+
+ // add the new child
+ child = this.parent.element(name, attributes, text);
+
+ // add back removed children after new child
+ Array.prototype.push.apply(this.parent.children, removed);
+ return child;
+ }
+
+ // Deletes a child element node
+
+ remove() {
+ var i, ref1;
+ if (this.isRoot) {
+ throw new Error("Cannot remove the root element. " + this.debugInfo());
+ }
+ i = this.parent.children.indexOf(this);
+ splice.apply(this.parent.children, [i, i - i + 1].concat(ref1 = [])), ref1;
+ return this.parent;
+ }
+
+ // Creates a node
+
+ // `name` name of the node
+ // `attributes` an object containing name/value pairs of attributes
+ // `text` element text
+ node(name, attributes, text) {
+ var child;
+ if (name != null) {
+ name = getValue(name);
+ }
+ attributes || (attributes = {});
+ attributes = getValue(attributes);
+ // swap argument order: text <-> attributes
+ if (!isObject(attributes)) {
+ [text, attributes] = [attributes, text];
+ }
+ child = new XMLElement(this, name, attributes);
+ if (text != null) {
+ child.text(text);
+ }
+ this.children.push(child);
+ return child;
+ }
+
+ // Creates a text node
+
+ // `value` element text
+ text(value) {
+ var child;
+ if (isObject(value)) {
+ this.element(value);
+ }
+ child = new XMLText(this, value);
+ this.children.push(child);
+ return this;
+ }
+
+ // Creates a CDATA node
+
+ // `value` element text without CDATA delimiters
+ cdata(value) {
+ var child;
+ child = new XMLCData(this, value);
+ this.children.push(child);
+ return this;
+ }
+
+ // Creates a comment node
+
+ // `value` comment text
+ comment(value) {
+ var child;
+ child = new XMLComment(this, value);
+ this.children.push(child);
+ return this;
+ }
+
+ // Creates a comment node before the current node
+
+ // `value` comment text
+ commentBefore(value) {
+ var child, i, removed;
+ // temporarily remove children starting *with* this
+ i = this.parent.children.indexOf(this);
+ removed = this.parent.children.splice(i);
+ // add the new child
+ child = this.parent.comment(value);
+ // add back removed children after new child
+ Array.prototype.push.apply(this.parent.children, removed);
+ return this;
+ }
+
+ // Creates a comment node after the current node
+
+ // `value` comment text
+ commentAfter(value) {
+ var child, i, removed;
+ // temporarily remove children starting *after* this
+ i = this.parent.children.indexOf(this);
+ removed = this.parent.children.splice(i + 1);
+ // add the new child
+ child = this.parent.comment(value);
+ // add back removed children after new child
+ Array.prototype.push.apply(this.parent.children, removed);
+ return this;
+ }
+
+ // Adds unescaped raw text
+
+ // `value` text
+ raw(value) {
+ var child;
+ child = new XMLRaw(this, value);
+ this.children.push(child);
+ return this;
+ }
+
+ // Adds a dummy node
+ dummy() {
+ var child;
+ child = new XMLDummy(this);
+ // Normally when a new node is created it is added to the child node collection.
+ // However, dummy nodes are never added to the XML tree. They are created while
+ // converting JS objects to XML nodes in order not to break the recursive function
+ // chain. They can be thought of as invisible nodes. They can be traversed through
+ // by using prev(), next(), up(), etc. functions but they do not exists in the tree.
+
+ // @children.push child
+ return child;
+ }
+
+ // Adds a processing instruction
+
+ // `target` instruction target
+ // `value` instruction value
+ instruction(target, value) {
+ var insTarget, insValue, instruction, j, len;
+ if (target != null) {
+ target = getValue(target);
+ }
+ if (value != null) {
+ value = getValue(value);
+ }
+ if (Array.isArray(target)) { // expand if array
+ for (j = 0, len = target.length; j < len; j++) {
+ insTarget = target[j];
+ this.instruction(insTarget);
+ }
+ } else if (isObject(target)) { // expand if object
+ for (insTarget in target) {
+ if (!hasProp.call(target, insTarget)) continue;
+ insValue = target[insTarget];
+ this.instruction(insTarget, insValue);
+ }
+ } else {
+ if (isFunction(value)) {
+ value = value.apply();
+ }
+ instruction = new XMLProcessingInstruction(this, target, value);
+ this.children.push(instruction);
+ }
+ return this;
+ }
+
+ // Creates a processing instruction node before the current node
+
+ // `target` instruction target
+ // `value` instruction value
+ instructionBefore(target, value) {
+ var child, i, removed;
+ // temporarily remove children starting *with* this
+ i = this.parent.children.indexOf(this);
+ removed = this.parent.children.splice(i);
+ // add the new child
+ child = this.parent.instruction(target, value);
+ // add back removed children after new child
+ Array.prototype.push.apply(this.parent.children, removed);
+ return this;
+ }
+
+ // Creates a processing instruction node after the current node
+
+ // `target` instruction target
+ // `value` instruction value
+ instructionAfter(target, value) {
+ var child, i, removed;
+ // temporarily remove children starting *after* this
+ i = this.parent.children.indexOf(this);
+ removed = this.parent.children.splice(i + 1);
+ // add the new child
+ child = this.parent.instruction(target, value);
+ // add back removed children after new child
+ Array.prototype.push.apply(this.parent.children, removed);
+ return this;
+ }
+
+ // Creates the xml declaration
+
+ // `version` A version number string, e.g. 1.0
+ // `encoding` Encoding declaration, e.g. UTF-8
+ // `standalone` standalone document declaration: true or false
+ declaration(version, encoding, standalone) {
+ var doc, xmldec;
+ doc = this.document();
+ xmldec = new XMLDeclaration(doc, version, encoding, standalone);
+ // Replace XML declaration if exists, otherwise insert at top
+ if (doc.children.length === 0) {
+ doc.children.unshift(xmldec);
+ } else if (doc.children[0].type === NodeType.Declaration) {
+ doc.children[0] = xmldec;
+ } else {
+ doc.children.unshift(xmldec);
+ }
+ return doc.root() || doc;
+ }
+
+ // Creates the document type declaration
+
+ // `pubID` the public identifier of the external subset
+ // `sysID` the system identifier of the external subset
+ dtd(pubID, sysID) {
+ var child, doc, doctype, i, j, k, len, len1, ref1, ref2;
+ doc = this.document();
+ doctype = new XMLDocType(doc, pubID, sysID);
+ ref1 = doc.children;
+ // Replace DTD if exists
+ for (i = j = 0, len = ref1.length; j < len; i = ++j) {
+ child = ref1[i];
+ if (child.type === NodeType.DocType) {
+ doc.children[i] = doctype;
+ return doctype;
+ }
+ }
+ ref2 = doc.children;
+ // insert before root node if the root node exists
+ for (i = k = 0, len1 = ref2.length; k < len1; i = ++k) {
+ child = ref2[i];
+ if (child.isRoot) {
+ doc.children.splice(i, 0, doctype);
+ return doctype;
+ }
+ }
+ // otherwise append to end
+ doc.children.push(doctype);
+ return doctype;
+ }
+
+ // Gets the parent node
+ up() {
+ if (this.isRoot) {
+ throw new Error("The root node has no parent. Use doc() if you need to get the document object.");
+ }
+ return this.parent;
+ }
+
+ // Gets the root node
+ root() {
+ var node;
+ node = this;
+ while (node) {
+ if (node.type === NodeType.Document) {
+ return node.rootObject;
+ } else if (node.isRoot) {
+ return node;
+ } else {
+ node = node.parent;
+ }
+ }
+ }
+
+ // Gets the node representing the XML document
+ document() {
+ var node;
+ node = this;
+ while (node) {
+ if (node.type === NodeType.Document) {
+ return node;
+ } else {
+ node = node.parent;
+ }
+ }
+ }
+
+ // Ends the document and converts string
+ end(options) {
+ return this.document().end(options);
+ }
+
+ // Gets the previous node
+ prev() {
+ var i;
+ i = this.parent.children.indexOf(this);
+ if (i < 1) {
+ throw new Error("Already at the first node. " + this.debugInfo());
+ }
+ return this.parent.children[i - 1];
+ }
+
+ // Gets the next node
+ next() {
+ var i;
+ i = this.parent.children.indexOf(this);
+ if (i === -1 || i === this.parent.children.length - 1) {
+ throw new Error("Already at the last node. " + this.debugInfo());
+ }
+ return this.parent.children[i + 1];
+ }
+
+ // Imports cloned root from another XML document
+
+ // `doc` the XML document to insert nodes from
+ importDocument(doc) {
+ var child, clonedRoot, j, len, ref1;
+ clonedRoot = doc.root().clone();
+ clonedRoot.parent = this;
+ clonedRoot.isRoot = false;
+ this.children.push(clonedRoot);
+ // set properties if imported element becomes the root node
+ if (this.type === NodeType.Document) {
+ clonedRoot.isRoot = true;
+ clonedRoot.documentObject = this;
+ this.rootObject = clonedRoot;
+ // set dtd name
+ if (this.children) {
+ ref1 = this.children;
+ for (j = 0, len = ref1.length; j < len; j++) {
+ child = ref1[j];
+ if (child.type === NodeType.DocType) {
+ child.name = clonedRoot.name;
+ break;
+ }
+ }
+ }
+ }
+ return this;
+ }
+
+
+ // Returns debug string for this node
+ debugInfo(name) {
+ var ref1, ref2;
+ name = name || this.name;
+ if ((name == null) && !((ref1 = this.parent) != null ? ref1.name : void 0)) {
+ return "";
+ } else if (name == null) {
+ return "parent: <" + this.parent.name + ">";
+ } else if (!((ref2 = this.parent) != null ? ref2.name : void 0)) {
+ return "node: <" + name + ">";
+ } else {
+ return "node: <" + name + ">, parent: <" + this.parent.name + ">";
+ }
+ }
+
+ // Aliases
+ ele(name, attributes, text) {
+ return this.element(name, attributes, text);
+ }
+
+ nod(name, attributes, text) {
+ return this.node(name, attributes, text);
+ }
+
+ txt(value) {
+ return this.text(value);
+ }
+
+ dat(value) {
+ return this.cdata(value);
+ }
+
+ com(value) {
+ return this.comment(value);
+ }
+
+ ins(target, value) {
+ return this.instruction(target, value);
+ }
+
+ doc() {
+ return this.document();
+ }
+
+ dec(version, encoding, standalone) {
+ return this.declaration(version, encoding, standalone);
+ }
+
+ e(name, attributes, text) {
+ return this.element(name, attributes, text);
+ }
+
+ n(name, attributes, text) {
+ return this.node(name, attributes, text);
+ }
+
+ t(value) {
+ return this.text(value);
+ }
+
+ d(value) {
+ return this.cdata(value);
+ }
+
+ c(value) {
+ return this.comment(value);
+ }
+
+ r(value) {
+ return this.raw(value);
+ }
+
+ i(target, value) {
+ return this.instruction(target, value);
+ }
+
+ u() {
+ return this.up();
+ }
+
+ // can be deprecated in a future release
+ importXMLBuilder(doc) {
+ return this.importDocument(doc);
+ }
+
+ // Adds or modifies an attribute.
+
+ // `name` attribute name
+ // `value` attribute value
+ attribute(name, value) {
+ throw new Error("attribute() applies to element nodes only.");
+ }
+
+ att(name, value) {
+ return this.attribute(name, value);
+ }
+
+ a(name, value) {
+ return this.attribute(name, value);
+ }
+
+ // Removes an attribute
+
+ // `name` attribute name
+ removeAttribute(name) {
+ throw new Error("attribute() applies to element nodes only.");
+ }
+
+ // DOM level 1 functions to be implemented later
+ replaceChild(newChild, oldChild) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ removeChild(oldChild) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ appendChild(newChild) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ hasChildNodes() {
+ return this.children.length !== 0;
+ }
+
+ cloneNode(deep) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ normalize() {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ // DOM level 2
+ isSupported(feature, version) {
+ return true;
+ }
+
+ hasAttributes() {
+ return this.attribs.length !== 0;
+ }
+
+ // DOM level 3 functions to be implemented later
+ compareDocumentPosition(other) {
+ var ref, res;
+ ref = this;
+ if (ref === other) {
+ return 0;
+ } else if (this.document() !== other.document()) {
+ res = DocumentPosition.Disconnected | DocumentPosition.ImplementationSpecific;
+ if (Math.random() < 0.5) {
+ res |= DocumentPosition.Preceding;
+ } else {
+ res |= DocumentPosition.Following;
+ }
+ return res;
+ } else if (ref.isAncestor(other)) {
+ return DocumentPosition.Contains | DocumentPosition.Preceding;
+ } else if (ref.isDescendant(other)) {
+ return DocumentPosition.Contains | DocumentPosition.Following;
+ } else if (ref.isPreceding(other)) {
+ return DocumentPosition.Preceding;
+ } else {
+ return DocumentPosition.Following;
+ }
+ }
+
+ isSameNode(other) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ lookupPrefix(namespaceURI) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ isDefaultNamespace(namespaceURI) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ lookupNamespaceURI(prefix) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ isEqualNode(node) {
+ var i, j, ref1;
+ if (node.nodeType !== this.nodeType) {
+ return false;
+ }
+ if (node.children.length !== this.children.length) {
+ return false;
+ }
+ for (i = j = 0, ref1 = this.children.length - 1; (0 <= ref1 ? j <= ref1 : j >= ref1); i = 0 <= ref1 ? ++j : --j) {
+ if (!this.children[i].isEqualNode(node.children[i])) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ getFeature(feature, version) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ setUserData(key, data, handler) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ getUserData(key) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ // Returns true if other is an inclusive descendant of node,
+ // and false otherwise.
+ contains(other) {
+ if (!other) {
+ return false;
+ }
+ return other === this || this.isDescendant(other);
+ }
+
+ // An object A is called a descendant of an object B, if either A is
+ // a child of B or A is a child of an object C that is a descendant of B.
+ isDescendant(node) {
+ var child, isDescendantChild, j, len, ref1;
+ ref1 = this.children;
+ for (j = 0, len = ref1.length; j < len; j++) {
+ child = ref1[j];
+ if (node === child) {
+ return true;
+ }
+ isDescendantChild = child.isDescendant(node);
+ if (isDescendantChild) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ // An object A is called an ancestor of an object B if and only if
+ // B is a descendant of A.
+ isAncestor(node) {
+ return node.isDescendant(this);
+ }
+
+ // An object A is preceding an object B if A and B are in the
+ // same tree and A comes before B in tree order.
+ isPreceding(node) {
+ var nodePos, thisPos;
+ nodePos = this.treePosition(node);
+ thisPos = this.treePosition(this);
+ if (nodePos === -1 || thisPos === -1) {
+ return false;
+ } else {
+ return nodePos < thisPos;
+ }
+ }
+
+ // An object A is folllowing an object B if A and B are in the
+ // same tree and A comes after B in tree order.
+ isFollowing(node) {
+ var nodePos, thisPos;
+ nodePos = this.treePosition(node);
+ thisPos = this.treePosition(this);
+ if (nodePos === -1 || thisPos === -1) {
+ return false;
+ } else {
+ return nodePos > thisPos;
+ }
+ }
+
+ // Returns the preorder position of the given node in the tree, or -1
+ // if the node is not in the tree.
+ treePosition(node) {
+ var found, pos;
+ pos = 0;
+ found = false;
+ this.foreachTreeNode(this.document(), function(childNode) {
+ pos++;
+ if (!found && childNode === node) {
+ return found = true;
+ }
+ });
+ if (found) {
+ return pos;
+ } else {
+ return -1;
+ }
+ }
+
+
+ // Depth-first preorder traversal through the XML tree
+ foreachTreeNode(node, func) {
+ var child, j, len, ref1, res;
+ node || (node = this.document());
+ ref1 = node.children;
+ for (j = 0, len = ref1.length; j < len; j++) {
+ child = ref1[j];
+ if (res = func(child)) {
+ return res;
+ } else {
+ res = this.foreachTreeNode(child, func);
+ if (res) {
+ return res;
+ }
+ }
+ }
+ }
+
+ };
+
+ // DOM level 1
+ Object.defineProperty(XMLNode.prototype, 'nodeName', {
+ get: function() {
+ return this.name;
+ }
+ });
+
+ Object.defineProperty(XMLNode.prototype, 'nodeType', {
+ get: function() {
+ return this.type;
+ }
+ });
+
+ Object.defineProperty(XMLNode.prototype, 'nodeValue', {
+ get: function() {
+ return this.value;
+ }
+ });
+
+ Object.defineProperty(XMLNode.prototype, 'parentNode', {
+ get: function() {
+ return this.parent;
+ }
+ });
+
+ Object.defineProperty(XMLNode.prototype, 'childNodes', {
+ get: function() {
+ if (!this.childNodeList || !this.childNodeList.nodes) {
+ this.childNodeList = new XMLNodeList(this.children);
+ }
+ return this.childNodeList;
+ }
+ });
+
+ Object.defineProperty(XMLNode.prototype, 'firstChild', {
+ get: function() {
+ return this.children[0] || null;
+ }
+ });
+
+ Object.defineProperty(XMLNode.prototype, 'lastChild', {
+ get: function() {
+ return this.children[this.children.length - 1] || null;
+ }
+ });
+
+ Object.defineProperty(XMLNode.prototype, 'previousSibling', {
+ get: function() {
+ var i;
+ i = this.parent.children.indexOf(this);
+ return this.parent.children[i - 1] || null;
+ }
+ });
+
+ Object.defineProperty(XMLNode.prototype, 'nextSibling', {
+ get: function() {
+ var i;
+ i = this.parent.children.indexOf(this);
+ return this.parent.children[i + 1] || null;
+ }
+ });
+
+ Object.defineProperty(XMLNode.prototype, 'ownerDocument', {
+ get: function() {
+ return this.document() || null;
+ }
+ });
+
+ // DOM level 3
+ Object.defineProperty(XMLNode.prototype, 'textContent', {
+ get: function() {
+ var child, j, len, ref1, str;
+ if (this.nodeType === NodeType.Element || this.nodeType === NodeType.DocumentFragment) {
+ str = '';
+ ref1 = this.children;
+ for (j = 0, len = ref1.length; j < len; j++) {
+ child = ref1[j];
+ if (child.textContent) {
+ str += child.textContent;
+ }
+ }
+ return str;
+ } else {
+ return null;
+ }
+ },
+ set: function(value) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+ });
+
+ return XMLNode;
+
+ }).call(this);
+
+}).call(this);
+
+},{"./DocumentPosition":4,"./NodeType":5,"./Utility":6,"./XMLCData":9,"./XMLComment":11,"./XMLDeclaration":20,"./XMLDocType":21,"./XMLDummy":24,"./XMLElement":25,"./XMLNamedNodeMap":26,"./XMLNodeList":28,"./XMLProcessingInstruction":29,"./XMLRaw":30,"./XMLText":34}],28:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ // Represents a list of nodes
+ var XMLNodeList;
+
+ module.exports = XMLNodeList = (function() {
+ class XMLNodeList {
+ // Initializes a new instance of `XMLNodeList`
+ // This is just a wrapper around an ordinary
+ // JS array.
+
+ // `nodes` the array containing nodes.
+ constructor(nodes) {
+ this.nodes = nodes;
+ }
+
+ // Creates and returns a deep clone of `this`
+
+ clone() {
+ // this class should not be cloned since it wraps
+ // around a given array. The calling function should check
+ // whether the wrapped array is null and supply a new array
+ // (from the clone).
+ return this.nodes = null;
+ }
+
+ // DOM Level 1
+ item(index) {
+ return this.nodes[index] || null;
+ }
+
+ };
+
+ // DOM level 1
+ Object.defineProperty(XMLNodeList.prototype, 'length', {
+ get: function() {
+ return this.nodes.length || 0;
+ }
+ });
+
+ return XMLNodeList;
+
+ }).call(this);
+
+}).call(this);
+
+},{}],29:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, XMLCharacterData, XMLProcessingInstruction;
+
+ NodeType = require('./NodeType');
+
+ XMLCharacterData = require('./XMLCharacterData');
+
+ // Represents a processing instruction
+ module.exports = XMLProcessingInstruction = class XMLProcessingInstruction extends XMLCharacterData {
+ // Initializes a new instance of `XMLProcessingInstruction`
+
+ // `parent` the parent node
+ // `target` instruction target
+ // `value` instruction value
+ constructor(parent, target, value) {
+ super(parent);
+ if (target == null) {
+ throw new Error("Missing instruction target. " + this.debugInfo());
+ }
+ this.type = NodeType.ProcessingInstruction;
+ this.target = this.stringify.insTarget(target);
+ this.name = this.target;
+ if (value) {
+ this.value = this.stringify.insValue(value);
+ }
+ }
+
+ // Creates and returns a deep clone of `this`
+ clone() {
+ return Object.create(this);
+ }
+
+ // Converts the XML fragment to string
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation for pretty print
+ // `options.offset` how many indentations to add to every line for pretty print
+ // `options.newline` newline sequence for pretty print
+ toString(options) {
+ return this.options.writer.processingInstruction(this, this.options.writer.filterOptions(options));
+ }
+
+ isEqualNode(node) {
+ if (!super.isEqualNode(node)) {
+ return false;
+ }
+ if (node.target !== this.target) {
+ return false;
+ }
+ return true;
+ }
+
+ };
+
+}).call(this);
+
+},{"./NodeType":5,"./XMLCharacterData":10}],30:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, XMLNode, XMLRaw;
+
+ NodeType = require('./NodeType');
+
+ XMLNode = require('./XMLNode');
+
+ // Represents a raw node
+ module.exports = XMLRaw = class XMLRaw extends XMLNode {
+ // Initializes a new instance of `XMLRaw`
+
+ // `text` raw text
+ constructor(parent, text) {
+ super(parent);
+ if (text == null) {
+ throw new Error("Missing raw text. " + this.debugInfo());
+ }
+ this.type = NodeType.Raw;
+ this.value = this.stringify.raw(text);
+ }
+
+ // Creates and returns a deep clone of `this`
+ clone() {
+ return Object.create(this);
+ }
+
+ // Converts the XML fragment to string
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation for pretty print
+ // `options.offset` how many indentations to add to every line for pretty print
+ // `options.newline` newline sequence for pretty print
+ toString(options) {
+ return this.options.writer.raw(this, this.options.writer.filterOptions(options));
+ }
+
+ };
+
+}).call(this);
+
+},{"./NodeType":5,"./XMLNode":27}],31:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, WriterState, XMLStreamWriter, XMLWriterBase,
+ hasProp = {}.hasOwnProperty;
+
+ NodeType = require('./NodeType');
+
+ XMLWriterBase = require('./XMLWriterBase');
+
+ WriterState = require('./WriterState');
+
+ // Prints XML nodes to a stream
+ module.exports = XMLStreamWriter = class XMLStreamWriter extends XMLWriterBase {
+ // Initializes a new instance of `XMLStreamWriter`
+
+ // `stream` output stream
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation string
+ // `options.newline` newline sequence
+ // `options.offset` a fixed number of indentations to add to every line
+ // `options.allowEmpty` do not self close empty element tags
+ // 'options.dontPrettyTextNodes' if any text is present in node, don't indent or LF
+ // `options.spaceBeforeSlash` add a space before the closing slash of empty elements
+ constructor(stream, options) {
+ super(options);
+ this.stream = stream;
+ }
+
+ endline(node, options, level) {
+ if (node.isLastRootNode && options.state === WriterState.CloseTag) {
+ return '';
+ } else {
+ return super.endline(node, options, level);
+ }
+ }
+
+ document(doc, options) {
+ var child, i, j, k, len1, len2, ref, ref1, results;
+ ref = doc.children;
+ // set a flag so that we don't insert a newline after the last root level node
+ for (i = j = 0, len1 = ref.length; j < len1; i = ++j) {
+ child = ref[i];
+ child.isLastRootNode = i === doc.children.length - 1;
+ }
+ options = this.filterOptions(options);
+ ref1 = doc.children;
+ results = [];
+ for (k = 0, len2 = ref1.length; k < len2; k++) {
+ child = ref1[k];
+ results.push(this.writeChildNode(child, options, 0));
+ }
+ return results;
+ }
+
+ cdata(node, options, level) {
+ return this.stream.write(super.cdata(node, options, level));
+ }
+
+ comment(node, options, level) {
+ return this.stream.write(super.comment(node, options, level));
+ }
+
+ declaration(node, options, level) {
+ return this.stream.write(super.declaration(node, options, level));
+ }
+
+ docType(node, options, level) {
+ var child, j, len1, ref;
+ level || (level = 0);
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ this.stream.write(this.indent(node, options, level));
+ this.stream.write('<!DOCTYPE ' + node.root().name);
+ // external identifier
+ if (node.pubID && node.sysID) {
+ this.stream.write(' PUBLIC "' + node.pubID + '" "' + node.sysID + '"');
+ } else if (node.sysID) {
+ this.stream.write(' SYSTEM "' + node.sysID + '"');
+ }
+ // internal subset
+ if (node.children.length > 0) {
+ this.stream.write(' [');
+ this.stream.write(this.endline(node, options, level));
+ options.state = WriterState.InsideTag;
+ ref = node.children;
+ for (j = 0, len1 = ref.length; j < len1; j++) {
+ child = ref[j];
+ this.writeChildNode(child, options, level + 1);
+ }
+ options.state = WriterState.CloseTag;
+ this.stream.write(']');
+ }
+ // close tag
+ options.state = WriterState.CloseTag;
+ this.stream.write(options.spaceBeforeSlash + '>');
+ this.stream.write(this.endline(node, options, level));
+ options.state = WriterState.None;
+ return this.closeNode(node, options, level);
+ }
+
+ element(node, options, level) {
+ var att, attLen, child, childNodeCount, firstChildNode, j, len, len1, name, prettySuppressed, r, ratt, ref, ref1, ref2, rline;
+ level || (level = 0);
+ // open tag
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r = this.indent(node, options, level) + '<' + node.name;
+ // attributes
+ if (options.pretty && options.width > 0) {
+ len = r.length;
+ ref = node.attribs;
+ for (name in ref) {
+ if (!hasProp.call(ref, name)) continue;
+ att = ref[name];
+ ratt = this.attribute(att, options, level);
+ attLen = ratt.length;
+ if (len + attLen > options.width) {
+ rline = this.indent(node, options, level + 1) + ratt;
+ r += this.endline(node, options, level) + rline;
+ len = rline.length;
+ } else {
+ rline = ' ' + ratt;
+ r += rline;
+ len += rline.length;
+ }
+ }
+ } else {
+ ref1 = node.attribs;
+ for (name in ref1) {
+ if (!hasProp.call(ref1, name)) continue;
+ att = ref1[name];
+ r += this.attribute(att, options, level);
+ }
+ }
+ this.stream.write(r);
+ childNodeCount = node.children.length;
+ firstChildNode = childNodeCount === 0 ? null : node.children[0];
+ if (childNodeCount === 0 || node.children.every(function(e) {
+ return (e.type === NodeType.Text || e.type === NodeType.Raw || e.type === NodeType.CData) && e.value === '';
+ })) {
+ // empty element
+ if (options.allowEmpty) {
+ this.stream.write('>');
+ options.state = WriterState.CloseTag;
+ this.stream.write('</' + node.name + '>');
+ } else {
+ options.state = WriterState.CloseTag;
+ this.stream.write(options.spaceBeforeSlash + '/>');
+ }
+ } else if (options.pretty && childNodeCount === 1 && (firstChildNode.type === NodeType.Text || firstChildNode.type === NodeType.Raw || firstChildNode.type === NodeType.CData) && (firstChildNode.value != null)) {
+ // do not indent text-only nodes
+ this.stream.write('>');
+ options.state = WriterState.InsideTag;
+ options.suppressPrettyCount++;
+ prettySuppressed = true;
+ this.writeChildNode(firstChildNode, options, level + 1);
+ options.suppressPrettyCount--;
+ prettySuppressed = false;
+ options.state = WriterState.CloseTag;
+ this.stream.write('</' + node.name + '>');
+ } else {
+ this.stream.write('>' + this.endline(node, options, level));
+ options.state = WriterState.InsideTag;
+ ref2 = node.children;
+ // inner tags
+ for (j = 0, len1 = ref2.length; j < len1; j++) {
+ child = ref2[j];
+ this.writeChildNode(child, options, level + 1);
+ }
+ // close tag
+ options.state = WriterState.CloseTag;
+ this.stream.write(this.indent(node, options, level) + '</' + node.name + '>');
+ }
+ this.stream.write(this.endline(node, options, level));
+ options.state = WriterState.None;
+ return this.closeNode(node, options, level);
+ }
+
+ processingInstruction(node, options, level) {
+ return this.stream.write(super.processingInstruction(node, options, level));
+ }
+
+ raw(node, options, level) {
+ return this.stream.write(super.raw(node, options, level));
+ }
+
+ text(node, options, level) {
+ return this.stream.write(super.text(node, options, level));
+ }
+
+ dtdAttList(node, options, level) {
+ return this.stream.write(super.dtdAttList(node, options, level));
+ }
+
+ dtdElement(node, options, level) {
+ return this.stream.write(super.dtdElement(node, options, level));
+ }
+
+ dtdEntity(node, options, level) {
+ return this.stream.write(super.dtdEntity(node, options, level));
+ }
+
+ dtdNotation(node, options, level) {
+ return this.stream.write(super.dtdNotation(node, options, level));
+ }
+
+ };
+
+}).call(this);
+
+},{"./NodeType":5,"./WriterState":7,"./XMLWriterBase":35}],32:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var XMLStringWriter, XMLWriterBase;
+
+ XMLWriterBase = require('./XMLWriterBase');
+
+ // Prints XML nodes as plain text
+ module.exports = XMLStringWriter = class XMLStringWriter extends XMLWriterBase {
+ // Initializes a new instance of `XMLStringWriter`
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation string
+ // `options.newline` newline sequence
+ // `options.offset` a fixed number of indentations to add to every line
+ // `options.allowEmpty` do not self close empty element tags
+ // 'options.dontPrettyTextNodes' if any text is present in node, don't indent or LF
+ // `options.spaceBeforeSlash` add a space before the closing slash of empty elements
+ constructor(options) {
+ super(options);
+ }
+
+ document(doc, options) {
+ var child, i, len, r, ref;
+ options = this.filterOptions(options);
+ r = '';
+ ref = doc.children;
+ for (i = 0, len = ref.length; i < len; i++) {
+ child = ref[i];
+ r += this.writeChildNode(child, options, 0);
+ }
+ // remove trailing newline
+ if (options.pretty && r.slice(-options.newline.length) === options.newline) {
+ r = r.slice(0, -options.newline.length);
+ }
+ return r;
+ }
+
+ };
+
+}).call(this);
+
+},{"./XMLWriterBase":35}],33:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ // Converts values to strings
+ var XMLStringifier,
+ hasProp = {}.hasOwnProperty;
+
+ module.exports = XMLStringifier = (function() {
+ class XMLStringifier {
+ // Initializes a new instance of `XMLStringifier`
+
+ // `options.version` The version number string of the XML spec to validate against, e.g. 1.0
+ // `options.noDoubleEncoding` whether existing html entities are encoded: true or false
+ // `options.stringify` a set of functions to use for converting values to strings
+ // `options.noValidation` whether values will be validated and escaped or returned as is
+ // `options.invalidCharReplacement` a character to replace invalid characters and disable character validation
+ constructor(options) {
+ var key, ref, value;
+ // Checks whether the given string contains legal characters
+ // Fails with an exception on error
+
+ // `str` the string to check
+ this.assertLegalChar = this.assertLegalChar.bind(this);
+ // Checks whether the given string contains legal characters for a name
+ // Fails with an exception on error
+
+ // `str` the string to check
+ this.assertLegalName = this.assertLegalName.bind(this);
+ options || (options = {});
+ this.options = options;
+ if (!this.options.version) {
+ this.options.version = '1.0';
+ }
+ ref = options.stringify || {};
+ for (key in ref) {
+ if (!hasProp.call(ref, key)) continue;
+ value = ref[key];
+ this[key] = value;
+ }
+ }
+
+ // Defaults
+ name(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ return this.assertLegalName('' + val || '');
+ }
+
+ text(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ return this.assertLegalChar(this.textEscape('' + val || ''));
+ }
+
+ cdata(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ val = '' + val || '';
+ val = val.replace(']]>', ']]]]><![CDATA[>');
+ return this.assertLegalChar(val);
+ }
+
+ comment(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ val = '' + val || '';
+ if (val.match(/--/)) {
+ throw new Error("Comment text cannot contain double-hypen: " + val);
+ }
+ return this.assertLegalChar(val);
+ }
+
+ raw(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ return '' + val || '';
+ }
+
+ attValue(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ return this.assertLegalChar(this.attEscape(val = '' + val || ''));
+ }
+
+ insTarget(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ return this.assertLegalChar('' + val || '');
+ }
+
+ insValue(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ val = '' + val || '';
+ if (val.match(/\?>/)) {
+ throw new Error("Invalid processing instruction value: " + val);
+ }
+ return this.assertLegalChar(val);
+ }
+
+ xmlVersion(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ val = '' + val || '';
+ if (!val.match(/1\.[0-9]+/)) {
+ throw new Error("Invalid version number: " + val);
+ }
+ return val;
+ }
+
+ xmlEncoding(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ val = '' + val || '';
+ if (!val.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/)) {
+ throw new Error("Invalid encoding: " + val);
+ }
+ return this.assertLegalChar(val);
+ }
+
+ xmlStandalone(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ if (val) {
+ return "yes";
+ } else {
+ return "no";
+ }
+ }
+
+ dtdPubID(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ return this.assertLegalChar('' + val || '');
+ }
+
+ dtdSysID(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ return this.assertLegalChar('' + val || '');
+ }
+
+ dtdElementValue(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ return this.assertLegalChar('' + val || '');
+ }
+
+ dtdAttType(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ return this.assertLegalChar('' + val || '');
+ }
+
+ dtdAttDefault(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ return this.assertLegalChar('' + val || '');
+ }
+
+ dtdEntityValue(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ return this.assertLegalChar('' + val || '');
+ }
+
+ dtdNData(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ return this.assertLegalChar('' + val || '');
+ }
+
+ assertLegalChar(str) {
+ var regex, res;
+ if (this.options.noValidation) {
+ return str;
+ }
+ if (this.options.version === '1.0') {
+ // Valid characters from https://www.w3.org/TR/xml/#charsets
+ // any Unicode character, excluding the surrogate blocks, FFFE, and FFFF.
+ // #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]
+ // This ES5 compatible Regexp has been generated using the "regenerate" NPM module:
+ // let xml_10_InvalidChars = regenerate()
+ // .addRange(0x0000, 0x0008)
+ // .add(0x000B, 0x000C)
+ // .addRange(0x000E, 0x001F)
+ // .addRange(0xD800, 0xDFFF)
+ // .addRange(0xFFFE, 0xFFFF)
+ regex = /[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g;
+ if (this.options.invalidCharReplacement !== void 0) {
+ str = str.replace(regex, this.options.invalidCharReplacement);
+ } else if (res = str.match(regex)) {
+ throw new Error(`Invalid character in string: ${str} at index ${res.index}`);
+ }
+ } else if (this.options.version === '1.1') {
+ // Valid characters from https://www.w3.org/TR/xml11/#charsets
+ // any Unicode character, excluding the surrogate blocks, FFFE, and FFFF.
+ // [#x1-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]
+ // This ES5 compatible Regexp has been generated using the "regenerate" NPM module:
+ // let xml_11_InvalidChars = regenerate()
+ // .add(0x0000)
+ // .addRange(0xD800, 0xDFFF)
+ // .addRange(0xFFFE, 0xFFFF)
+ regex = /[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g;
+ if (this.options.invalidCharReplacement !== void 0) {
+ str = str.replace(regex, this.options.invalidCharReplacement);
+ } else if (res = str.match(regex)) {
+ throw new Error(`Invalid character in string: ${str} at index ${res.index}`);
+ }
+ }
+ return str;
+ }
+
+ assertLegalName(str) {
+ var regex;
+ if (this.options.noValidation) {
+ return str;
+ }
+ str = this.assertLegalChar(str);
+ regex = /^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/;
+ if (!str.match(regex)) {
+ throw new Error(`Invalid character in name: ${str}`);
+ }
+ return str;
+ }
+
+ // Escapes special characters in text
+
+ // See http://www.w3.org/TR/2000/WD-xml-c14n-20000119.html#charescaping
+
+ // `str` the string to escape
+ textEscape(str) {
+ var ampregex;
+ if (this.options.noValidation) {
+ return str;
+ }
+ ampregex = this.options.noDoubleEncoding ? /(?!&(lt|gt|amp|apos|quot);)&/g : /&/g;
+ return str.replace(ampregex, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\r/g, '&#xD;');
+ }
+
+ // Escapes special characters in attribute values
+
+ // See http://www.w3.org/TR/2000/WD-xml-c14n-20000119.html#charescaping
+
+ // `str` the string to escape
+ attEscape(str) {
+ var ampregex;
+ if (this.options.noValidation) {
+ return str;
+ }
+ ampregex = this.options.noDoubleEncoding ? /(?!&(lt|gt|amp|apos|quot);)&/g : /&/g;
+ return str.replace(ampregex, '&amp;').replace(/</g, '&lt;').replace(/"/g, '&quot;').replace(/\t/g, '&#x9;').replace(/\n/g, '&#xA;').replace(/\r/g, '&#xD;');
+ }
+
+ };
+
+ // strings to match while converting from JS objects
+ XMLStringifier.prototype.convertAttKey = '@';
+
+ XMLStringifier.prototype.convertPIKey = '?';
+
+ XMLStringifier.prototype.convertTextKey = '#text';
+
+ XMLStringifier.prototype.convertCDataKey = '#cdata';
+
+ XMLStringifier.prototype.convertCommentKey = '#comment';
+
+ XMLStringifier.prototype.convertRawKey = '#raw';
+
+ return XMLStringifier;
+
+ }).call(this);
+
+}).call(this);
+
+},{}],34:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, XMLCharacterData, XMLText;
+
+ NodeType = require('./NodeType');
+
+ XMLCharacterData = require('./XMLCharacterData');
+
+ // Represents a text node
+ module.exports = XMLText = (function() {
+ class XMLText extends XMLCharacterData {
+ // Initializes a new instance of `XMLText`
+
+ // `text` element text
+ constructor(parent, text) {
+ super(parent);
+ if (text == null) {
+ throw new Error("Missing element text. " + this.debugInfo());
+ }
+ this.name = "#text";
+ this.type = NodeType.Text;
+ this.value = this.stringify.text(text);
+ }
+
+ // Creates and returns a deep clone of `this`
+ clone() {
+ return Object.create(this);
+ }
+
+ // Converts the XML fragment to string
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation for pretty print
+ // `options.offset` how many indentations to add to every line for pretty print
+ // `options.newline` newline sequence for pretty print
+ toString(options) {
+ return this.options.writer.text(this, this.options.writer.filterOptions(options));
+ }
+
+ // DOM level 1 functions to be implemented later
+ splitText(offset) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ // DOM level 3 functions to be implemented later
+ replaceWholeText(content) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ };
+
+ // DOM level 3
+ Object.defineProperty(XMLText.prototype, 'isElementContentWhitespace', {
+ get: function() {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+ });
+
+ Object.defineProperty(XMLText.prototype, 'wholeText', {
+ get: function() {
+ var next, prev, str;
+ str = '';
+ prev = this.previousSibling;
+ while (prev) {
+ str = prev.data + str;
+ prev = prev.previousSibling;
+ }
+ str += this.data;
+ next = this.nextSibling;
+ while (next) {
+ str = str + next.data;
+ next = next.nextSibling;
+ }
+ return str;
+ }
+ });
+
+ return XMLText;
+
+ }).call(this);
+
+}).call(this);
+
+},{"./NodeType":5,"./XMLCharacterData":10}],35:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, WriterState, XMLCData, XMLComment, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDeclaration, XMLDocType, XMLDummy, XMLElement, XMLProcessingInstruction, XMLRaw, XMLText, XMLWriterBase, assign,
+ hasProp = {}.hasOwnProperty;
+
+ ({assign} = require('./Utility'));
+
+ NodeType = require('./NodeType');
+
+ XMLDeclaration = require('./XMLDeclaration');
+
+ XMLDocType = require('./XMLDocType');
+
+ XMLCData = require('./XMLCData');
+
+ XMLComment = require('./XMLComment');
+
+ XMLElement = require('./XMLElement');
+
+ XMLRaw = require('./XMLRaw');
+
+ XMLText = require('./XMLText');
+
+ XMLProcessingInstruction = require('./XMLProcessingInstruction');
+
+ XMLDummy = require('./XMLDummy');
+
+ XMLDTDAttList = require('./XMLDTDAttList');
+
+ XMLDTDElement = require('./XMLDTDElement');
+
+ XMLDTDEntity = require('./XMLDTDEntity');
+
+ XMLDTDNotation = require('./XMLDTDNotation');
+
+ WriterState = require('./WriterState');
+
+ // Base class for XML writers
+ module.exports = XMLWriterBase = class XMLWriterBase {
+ // Initializes a new instance of `XMLWriterBase`
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation string
+ // `options.newline` newline sequence
+ // `options.offset` a fixed number of indentations to add to every line
+ // `options.width` maximum column width
+ // `options.allowEmpty` do not self close empty element tags
+ // 'options.dontPrettyTextNodes' if any text is present in node, don't indent or LF
+ // `options.spaceBeforeSlash` add a space before the closing slash of empty elements
+ constructor(options) {
+ var key, ref, value;
+ options || (options = {});
+ this.options = options;
+ ref = options.writer || {};
+ for (key in ref) {
+ if (!hasProp.call(ref, key)) continue;
+ value = ref[key];
+ this["_" + key] = this[key];
+ this[key] = value;
+ }
+ }
+
+ // Filters writer options and provides defaults
+
+ // `options` writer options
+ filterOptions(options) {
+ var filteredOptions, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7;
+ options || (options = {});
+ options = assign({}, this.options, options);
+ filteredOptions = {
+ writer: this
+ };
+ filteredOptions.pretty = options.pretty || false;
+ filteredOptions.allowEmpty = options.allowEmpty || false;
+ filteredOptions.indent = (ref = options.indent) != null ? ref : ' ';
+ filteredOptions.newline = (ref1 = options.newline) != null ? ref1 : '\n';
+ filteredOptions.offset = (ref2 = options.offset) != null ? ref2 : 0;
+ filteredOptions.width = (ref3 = options.width) != null ? ref3 : 0;
+ filteredOptions.dontPrettyTextNodes = (ref4 = (ref5 = options.dontPrettyTextNodes) != null ? ref5 : options.dontprettytextnodes) != null ? ref4 : 0;
+ filteredOptions.spaceBeforeSlash = (ref6 = (ref7 = options.spaceBeforeSlash) != null ? ref7 : options.spacebeforeslash) != null ? ref6 : '';
+ if (filteredOptions.spaceBeforeSlash === true) {
+ filteredOptions.spaceBeforeSlash = ' ';
+ }
+ filteredOptions.suppressPrettyCount = 0;
+ filteredOptions.user = {};
+ filteredOptions.state = WriterState.None;
+ return filteredOptions;
+ }
+
+ // Returns the indentation string for the current level
+
+ // `node` current node
+ // `options` writer options
+ // `level` current indentation level
+ indent(node, options, level) {
+ var indentLevel;
+ if (!options.pretty || options.suppressPrettyCount) {
+ return '';
+ } else if (options.pretty) {
+ indentLevel = (level || 0) + options.offset + 1;
+ if (indentLevel > 0) {
+ return new Array(indentLevel).join(options.indent);
+ }
+ }
+ return '';
+ }
+
+ // Returns the newline string
+
+ // `node` current node
+ // `options` writer options
+ // `level` current indentation level
+ endline(node, options, level) {
+ if (!options.pretty || options.suppressPrettyCount) {
+ return '';
+ } else {
+ return options.newline;
+ }
+ }
+
+ attribute(att, options, level) {
+ var r;
+ this.openAttribute(att, options, level);
+ if (options.pretty && options.width > 0) {
+ r = att.name + '="' + att.value + '"';
+ } else {
+ r = ' ' + att.name + '="' + att.value + '"';
+ }
+ this.closeAttribute(att, options, level);
+ return r;
+ }
+
+ cdata(node, options, level) {
+ var r;
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r = this.indent(node, options, level) + '<![CDATA[';
+ options.state = WriterState.InsideTag;
+ r += node.value;
+ options.state = WriterState.CloseTag;
+ r += ']]>' + this.endline(node, options, level);
+ options.state = WriterState.None;
+ this.closeNode(node, options, level);
+ return r;
+ }
+
+ comment(node, options, level) {
+ var r;
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r = this.indent(node, options, level) + '<!-- ';
+ options.state = WriterState.InsideTag;
+ r += node.value;
+ options.state = WriterState.CloseTag;
+ r += ' -->' + this.endline(node, options, level);
+ options.state = WriterState.None;
+ this.closeNode(node, options, level);
+ return r;
+ }
+
+ declaration(node, options, level) {
+ var r;
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r = this.indent(node, options, level) + '<?xml';
+ options.state = WriterState.InsideTag;
+ r += ' version="' + node.version + '"';
+ if (node.encoding != null) {
+ r += ' encoding="' + node.encoding + '"';
+ }
+ if (node.standalone != null) {
+ r += ' standalone="' + node.standalone + '"';
+ }
+ options.state = WriterState.CloseTag;
+ r += options.spaceBeforeSlash + '?>';
+ r += this.endline(node, options, level);
+ options.state = WriterState.None;
+ this.closeNode(node, options, level);
+ return r;
+ }
+
+ docType(node, options, level) {
+ var child, i, len1, r, ref;
+ level || (level = 0);
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r = this.indent(node, options, level);
+ r += '<!DOCTYPE ' + node.root().name;
+ // external identifier
+ if (node.pubID && node.sysID) {
+ r += ' PUBLIC "' + node.pubID + '" "' + node.sysID + '"';
+ } else if (node.sysID) {
+ r += ' SYSTEM "' + node.sysID + '"';
+ }
+ // internal subset
+ if (node.children.length > 0) {
+ r += ' [';
+ r += this.endline(node, options, level);
+ options.state = WriterState.InsideTag;
+ ref = node.children;
+ for (i = 0, len1 = ref.length; i < len1; i++) {
+ child = ref[i];
+ r += this.writeChildNode(child, options, level + 1);
+ }
+ options.state = WriterState.CloseTag;
+ r += ']';
+ }
+ // close tag
+ options.state = WriterState.CloseTag;
+ r += options.spaceBeforeSlash + '>';
+ r += this.endline(node, options, level);
+ options.state = WriterState.None;
+ this.closeNode(node, options, level);
+ return r;
+ }
+
+ element(node, options, level) {
+ var att, attLen, child, childNodeCount, firstChildNode, i, j, len, len1, len2, name, prettySuppressed, r, ratt, ref, ref1, ref2, ref3, rline;
+ level || (level = 0);
+ prettySuppressed = false;
+ // open tag
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r = this.indent(node, options, level) + '<' + node.name;
+ // attributes
+ if (options.pretty && options.width > 0) {
+ len = r.length;
+ ref = node.attribs;
+ for (name in ref) {
+ if (!hasProp.call(ref, name)) continue;
+ att = ref[name];
+ ratt = this.attribute(att, options, level);
+ attLen = ratt.length;
+ if (len + attLen > options.width) {
+ rline = this.indent(node, options, level + 1) + ratt;
+ r += this.endline(node, options, level) + rline;
+ len = rline.length;
+ } else {
+ rline = ' ' + ratt;
+ r += rline;
+ len += rline.length;
+ }
+ }
+ } else {
+ ref1 = node.attribs;
+ for (name in ref1) {
+ if (!hasProp.call(ref1, name)) continue;
+ att = ref1[name];
+ r += this.attribute(att, options, level);
+ }
+ }
+ childNodeCount = node.children.length;
+ firstChildNode = childNodeCount === 0 ? null : node.children[0];
+ if (childNodeCount === 0 || node.children.every(function(e) {
+ return (e.type === NodeType.Text || e.type === NodeType.Raw || e.type === NodeType.CData) && e.value === '';
+ })) {
+ // empty element
+ if (options.allowEmpty) {
+ r += '>';
+ options.state = WriterState.CloseTag;
+ r += '</' + node.name + '>' + this.endline(node, options, level);
+ } else {
+ options.state = WriterState.CloseTag;
+ r += options.spaceBeforeSlash + '/>' + this.endline(node, options, level);
+ }
+ } else if (options.pretty && childNodeCount === 1 && (firstChildNode.type === NodeType.Text || firstChildNode.type === NodeType.Raw || firstChildNode.type === NodeType.CData) && (firstChildNode.value != null)) {
+ // do not indent text-only nodes
+ r += '>';
+ options.state = WriterState.InsideTag;
+ options.suppressPrettyCount++;
+ prettySuppressed = true;
+ r += this.writeChildNode(firstChildNode, options, level + 1);
+ options.suppressPrettyCount--;
+ prettySuppressed = false;
+ options.state = WriterState.CloseTag;
+ r += '</' + node.name + '>' + this.endline(node, options, level);
+ } else {
+ // if ANY are a text node, then suppress pretty now
+ if (options.dontPrettyTextNodes) {
+ ref2 = node.children;
+ for (i = 0, len1 = ref2.length; i < len1; i++) {
+ child = ref2[i];
+ if ((child.type === NodeType.Text || child.type === NodeType.Raw || child.type === NodeType.CData) && (child.value != null)) {
+ options.suppressPrettyCount++;
+ prettySuppressed = true;
+ break;
+ }
+ }
+ }
+ // close the opening tag, after dealing with newline
+ r += '>' + this.endline(node, options, level);
+ options.state = WriterState.InsideTag;
+ ref3 = node.children;
+ // inner tags
+ for (j = 0, len2 = ref3.length; j < len2; j++) {
+ child = ref3[j];
+ r += this.writeChildNode(child, options, level + 1);
+ }
+ // close tag
+ options.state = WriterState.CloseTag;
+ r += this.indent(node, options, level) + '</' + node.name + '>';
+ if (prettySuppressed) {
+ options.suppressPrettyCount--;
+ }
+ r += this.endline(node, options, level);
+ options.state = WriterState.None;
+ }
+ this.closeNode(node, options, level);
+ return r;
+ }
+
+ writeChildNode(node, options, level) {
+ switch (node.type) {
+ case NodeType.CData:
+ return this.cdata(node, options, level);
+ case NodeType.Comment:
+ return this.comment(node, options, level);
+ case NodeType.Element:
+ return this.element(node, options, level);
+ case NodeType.Raw:
+ return this.raw(node, options, level);
+ case NodeType.Text:
+ return this.text(node, options, level);
+ case NodeType.ProcessingInstruction:
+ return this.processingInstruction(node, options, level);
+ case NodeType.Dummy:
+ return '';
+ case NodeType.Declaration:
+ return this.declaration(node, options, level);
+ case NodeType.DocType:
+ return this.docType(node, options, level);
+ case NodeType.AttributeDeclaration:
+ return this.dtdAttList(node, options, level);
+ case NodeType.ElementDeclaration:
+ return this.dtdElement(node, options, level);
+ case NodeType.EntityDeclaration:
+ return this.dtdEntity(node, options, level);
+ case NodeType.NotationDeclaration:
+ return this.dtdNotation(node, options, level);
+ default:
+ throw new Error("Unknown XML node type: " + node.constructor.name);
+ }
+ }
+
+ processingInstruction(node, options, level) {
+ var r;
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r = this.indent(node, options, level) + '<?';
+ options.state = WriterState.InsideTag;
+ r += node.target;
+ if (node.value) {
+ r += ' ' + node.value;
+ }
+ options.state = WriterState.CloseTag;
+ r += options.spaceBeforeSlash + '?>';
+ r += this.endline(node, options, level);
+ options.state = WriterState.None;
+ this.closeNode(node, options, level);
+ return r;
+ }
+
+ raw(node, options, level) {
+ var r;
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r = this.indent(node, options, level);
+ options.state = WriterState.InsideTag;
+ r += node.value;
+ options.state = WriterState.CloseTag;
+ r += this.endline(node, options, level);
+ options.state = WriterState.None;
+ this.closeNode(node, options, level);
+ return r;
+ }
+
+ text(node, options, level) {
+ var r;
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r = this.indent(node, options, level);
+ options.state = WriterState.InsideTag;
+ r += node.value;
+ options.state = WriterState.CloseTag;
+ r += this.endline(node, options, level);
+ options.state = WriterState.None;
+ this.closeNode(node, options, level);
+ return r;
+ }
+
+ dtdAttList(node, options, level) {
+ var r;
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r = this.indent(node, options, level) + '<!ATTLIST';
+ options.state = WriterState.InsideTag;
+ r += ' ' + node.elementName + ' ' + node.attributeName + ' ' + node.attributeType;
+ if (node.defaultValueType !== '#DEFAULT') {
+ r += ' ' + node.defaultValueType;
+ }
+ if (node.defaultValue) {
+ r += ' "' + node.defaultValue + '"';
+ }
+ options.state = WriterState.CloseTag;
+ r += options.spaceBeforeSlash + '>' + this.endline(node, options, level);
+ options.state = WriterState.None;
+ this.closeNode(node, options, level);
+ return r;
+ }
+
+ dtdElement(node, options, level) {
+ var r;
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r = this.indent(node, options, level) + '<!ELEMENT';
+ options.state = WriterState.InsideTag;
+ r += ' ' + node.name + ' ' + node.value;
+ options.state = WriterState.CloseTag;
+ r += options.spaceBeforeSlash + '>' + this.endline(node, options, level);
+ options.state = WriterState.None;
+ this.closeNode(node, options, level);
+ return r;
+ }
+
+ dtdEntity(node, options, level) {
+ var r;
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r = this.indent(node, options, level) + '<!ENTITY';
+ options.state = WriterState.InsideTag;
+ if (node.pe) {
+ r += ' %';
+ }
+ r += ' ' + node.name;
+ if (node.value) {
+ r += ' "' + node.value + '"';
+ } else {
+ if (node.pubID && node.sysID) {
+ r += ' PUBLIC "' + node.pubID + '" "' + node.sysID + '"';
+ } else if (node.sysID) {
+ r += ' SYSTEM "' + node.sysID + '"';
+ }
+ if (node.nData) {
+ r += ' NDATA ' + node.nData;
+ }
+ }
+ options.state = WriterState.CloseTag;
+ r += options.spaceBeforeSlash + '>' + this.endline(node, options, level);
+ options.state = WriterState.None;
+ this.closeNode(node, options, level);
+ return r;
+ }
+
+ dtdNotation(node, options, level) {
+ var r;
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r = this.indent(node, options, level) + '<!NOTATION';
+ options.state = WriterState.InsideTag;
+ r += ' ' + node.name;
+ if (node.pubID && node.sysID) {
+ r += ' PUBLIC "' + node.pubID + '" "' + node.sysID + '"';
+ } else if (node.pubID) {
+ r += ' PUBLIC "' + node.pubID + '"';
+ } else if (node.sysID) {
+ r += ' SYSTEM "' + node.sysID + '"';
+ }
+ options.state = WriterState.CloseTag;
+ r += options.spaceBeforeSlash + '>' + this.endline(node, options, level);
+ options.state = WriterState.None;
+ this.closeNode(node, options, level);
+ return r;
+ }
+
+ openNode(node, options, level) {}
+
+ closeNode(node, options, level) {}
+
+ openAttribute(att, options, level) {}
+
+ closeAttribute(att, options, level) {}
+
+ };
+
+}).call(this);
+
+},{"./NodeType":5,"./Utility":6,"./WriterState":7,"./XMLCData":9,"./XMLComment":11,"./XMLDTDAttList":16,"./XMLDTDElement":17,"./XMLDTDEntity":18,"./XMLDTDNotation":19,"./XMLDeclaration":20,"./XMLDocType":21,"./XMLDummy":24,"./XMLElement":25,"./XMLProcessingInstruction":29,"./XMLRaw":30,"./XMLText":34}],36:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, WriterState, XMLDOMImplementation, XMLDocument, XMLDocumentCB, XMLStreamWriter, XMLStringWriter, assign, isFunction;
+
+ ({assign, isFunction} = require('./Utility'));
+
+ XMLDOMImplementation = require('./XMLDOMImplementation');
+
+ XMLDocument = require('./XMLDocument');
+
+ XMLDocumentCB = require('./XMLDocumentCB');
+
+ XMLStringWriter = require('./XMLStringWriter');
+
+ XMLStreamWriter = require('./XMLStreamWriter');
+
+ NodeType = require('./NodeType');
+
+ WriterState = require('./WriterState');
+
+ // Creates a new document and returns the root node for
+ // chain-building the document tree
+
+ // `name` name of the root element
+
+ // `xmldec.version` A version number string, e.g. 1.0
+ // `xmldec.encoding` Encoding declaration, e.g. UTF-8
+ // `xmldec.standalone` standalone document declaration: true or false
+
+ // `doctype.pubID` public identifier of the external subset
+ // `doctype.sysID` system identifier of the external subset
+
+ // `options.headless` whether XML declaration and doctype will be included:
+ // true or false
+ // `options.keepNullNodes` whether nodes with null values will be kept
+ // or ignored: true or false
+ // `options.keepNullAttributes` whether attributes with null values will be
+ // kept or ignored: true or false
+ // `options.ignoreDecorators` whether decorator strings will be ignored when
+ // converting JS objects: true or false
+ // `options.separateArrayItems` whether array items are created as separate
+ // nodes when passed as an object value: true or false
+ // `options.noDoubleEncoding` whether existing html entities are encoded:
+ // true or false
+ // `options.stringify` a set of functions to use for converting values to
+ // strings
+ // `options.writer` the default XML writer to use for converting nodes to
+ // string. If the default writer is not set, the built-in XMLStringWriter
+ // will be used instead.
+ module.exports.create = function(name, xmldec, doctype, options) {
+ var doc, root;
+ if (name == null) {
+ throw new Error("Root element needs a name.");
+ }
+ options = assign({}, xmldec, doctype, options);
+ // create the document node
+ doc = new XMLDocument(options);
+ // add the root node
+ root = doc.element(name);
+ // prolog
+ if (!options.headless) {
+ doc.declaration(options);
+ if ((options.pubID != null) || (options.sysID != null)) {
+ doc.dtd(options);
+ }
+ }
+ return root;
+ };
+
+ // Creates a new document and returns the document node for
+ // chain-building the document tree
+
+ // `options.keepNullNodes` whether nodes with null values will be kept
+ // or ignored: true or false
+ // `options.keepNullAttributes` whether attributes with null values will be
+ // kept or ignored: true or false
+ // `options.ignoreDecorators` whether decorator strings will be ignored when
+ // converting JS objects: true or false
+ // `options.separateArrayItems` whether array items are created as separate
+ // nodes when passed as an object value: true or false
+ // `options.noDoubleEncoding` whether existing html entities are encoded:
+ // true or false
+ // `options.stringify` a set of functions to use for converting values to
+ // strings
+ // `options.writer` the default XML writer to use for converting nodes to
+ // string. If the default writer is not set, the built-in XMLStringWriter
+ // will be used instead.
+
+ // `onData` the function to be called when a new chunk of XML is output. The
+ // string containing the XML chunk is passed to `onData` as its single
+ // argument.
+ // `onEnd` the function to be called when the XML document is completed with
+ // `end`. `onEnd` does not receive any arguments.
+ module.exports.begin = function(options, onData, onEnd) {
+ if (isFunction(options)) {
+ [onData, onEnd] = [options, onData];
+ options = {};
+ }
+ if (onData) {
+ return new XMLDocumentCB(options, onData, onEnd);
+ } else {
+ return new XMLDocument(options);
+ }
+ };
+
+ module.exports.stringWriter = function(options) {
+ return new XMLStringWriter(options);
+ };
+
+ module.exports.streamWriter = function(stream, options) {
+ return new XMLStreamWriter(stream, options);
+ };
+
+ module.exports.implementation = new XMLDOMImplementation();
+
+ module.exports.nodeType = NodeType;
+
+ module.exports.writerState = WriterState;
+
+}).call(this);
+
+},{"./NodeType":5,"./Utility":6,"./WriterState":7,"./XMLDOMImplementation":14,"./XMLDocument":22,"./XMLDocumentCB":23,"./XMLStreamWriter":31,"./XMLStringWriter":32}]},{},[1])(1)
+});
diff --git a/generator/node_modules/plist/dist/plist-parse.js b/generator/node_modules/plist/dist/plist-parse.js
new file mode 100644
index 0000000..b8c7eb1
--- /dev/null
+++ b/generator/node_modules/plist/dist/plist-parse.js
@@ -0,0 +1,7456 @@
+(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.plist = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
+(function (Buffer){(function (){
+/**
+ * Module dependencies.
+ */
+
+const { DOMParser } = require('@xmldom/xmldom');
+
+/**
+ * Module exports.
+ */
+
+exports.parse = parse;
+
+var TEXT_NODE = 3;
+var CDATA_NODE = 4;
+var COMMENT_NODE = 8;
+
+
+/**
+ * We ignore raw text (usually whitespace), <!-- xml comments -->,
+ * and raw CDATA nodes.
+ *
+ * @param {Element} node
+ * @returns {Boolean}
+ * @api private
+ */
+
+function shouldIgnoreNode (node) {
+ return node.nodeType === TEXT_NODE
+ || node.nodeType === COMMENT_NODE
+ || node.nodeType === CDATA_NODE;
+}
+
+/**
+ * Check if the node is empty. Some plist file has such node:
+ * <key />
+ * this node shoud be ignored.
+ *
+ * @see https://github.com/TooTallNate/plist.js/issues/66
+ * @param {Element} node
+ * @returns {Boolean}
+ * @api private
+ */
+function isEmptyNode(node){
+ if(!node.childNodes || node.childNodes.length === 0) {
+ return true;
+ } else {
+ return false;
+ }
+}
+
+function invariant(test, message) {
+ if (!test) {
+ throw new Error(message);
+ }
+}
+
+/**
+ * Parses a Plist XML string. Returns an Object.
+ *
+ * @param {String} xml - the XML String to decode
+ * @returns {Mixed} the decoded value from the Plist XML
+ * @api public
+ */
+
+function parse (xml) {
+ var doc = new DOMParser().parseFromString(xml);
+ invariant(
+ doc.documentElement.nodeName === 'plist',
+ 'malformed document. First element should be <plist>'
+ );
+ var plist = parsePlistXML(doc.documentElement);
+
+ // the root <plist> node gets interpreted as an Array,
+ // so pull out the inner data first
+ if (plist.length == 1) plist = plist[0];
+
+ return plist;
+}
+
+/**
+ * Convert an XML based plist document into a JSON representation.
+ *
+ * @param {Object} xml_node - current XML node in the plist
+ * @returns {Mixed} built up JSON object
+ * @api private
+ */
+
+function parsePlistXML (node) {
+ var i, new_obj, key, val, new_arr, res, counter, type;
+
+ if (!node)
+ return null;
+
+ if (node.nodeName === 'plist') {
+ new_arr = [];
+ if (isEmptyNode(node)) {
+ return new_arr;
+ }
+ for (i=0; i < node.childNodes.length; i++) {
+ if (!shouldIgnoreNode(node.childNodes[i])) {
+ new_arr.push( parsePlistXML(node.childNodes[i]));
+ }
+ }
+ return new_arr;
+ } else if (node.nodeName === 'dict') {
+ new_obj = {};
+ key = null;
+ counter = 0;
+ if (isEmptyNode(node)) {
+ return new_obj;
+ }
+ for (i=0; i < node.childNodes.length; i++) {
+ if (shouldIgnoreNode(node.childNodes[i])) continue;
+ if (counter % 2 === 0) {
+ invariant(
+ node.childNodes[i].nodeName === 'key',
+ 'Missing key while parsing <dict/>.'
+ );
+ key = parsePlistXML(node.childNodes[i]);
+ } else {
+ invariant(
+ node.childNodes[i].nodeName !== 'key',
+ 'Unexpected key "'
+ + parsePlistXML(node.childNodes[i])
+ + '" while parsing <dict/>.'
+ );
+ new_obj[key] = parsePlistXML(node.childNodes[i]);
+ }
+ counter += 1;
+ }
+ if (counter % 2 === 1) {
+ new_obj[key] = '';
+ }
+
+ return new_obj;
+
+ } else if (node.nodeName === 'array') {
+ new_arr = [];
+ if (isEmptyNode(node)) {
+ return new_arr;
+ }
+ for (i=0; i < node.childNodes.length; i++) {
+ if (!shouldIgnoreNode(node.childNodes[i])) {
+ res = parsePlistXML(node.childNodes[i]);
+ if (null != res) new_arr.push(res);
+ }
+ }
+ return new_arr;
+
+ } else if (node.nodeName === '#text') {
+ // TODO: what should we do with text types? (CDATA sections)
+
+ } else if (node.nodeName === 'key') {
+ if (isEmptyNode(node)) {
+ return '';
+ }
+
+ invariant(
+ node.childNodes[0].nodeValue !== '__proto__',
+ '__proto__ keys can lead to prototype pollution. More details on CVE-2022-22912'
+ );
+
+ return node.childNodes[0].nodeValue;
+ } else if (node.nodeName === 'string') {
+ res = '';
+ if (isEmptyNode(node)) {
+ return res;
+ }
+ for (i=0; i < node.childNodes.length; i++) {
+ var type = node.childNodes[i].nodeType;
+ if (type === TEXT_NODE || type === CDATA_NODE) {
+ res += node.childNodes[i].nodeValue;
+ }
+ }
+ return res;
+
+ } else if (node.nodeName === 'integer') {
+ invariant(
+ !isEmptyNode(node),
+ 'Cannot parse "" as integer.'
+ );
+ return parseInt(node.childNodes[0].nodeValue, 10);
+
+ } else if (node.nodeName === 'real') {
+ invariant(
+ !isEmptyNode(node),
+ 'Cannot parse "" as real.'
+ );
+ res = '';
+ for (i=0; i < node.childNodes.length; i++) {
+ if (node.childNodes[i].nodeType === TEXT_NODE) {
+ res += node.childNodes[i].nodeValue;
+ }
+ }
+ return parseFloat(res);
+
+ } else if (node.nodeName === 'data') {
+ res = '';
+ if (isEmptyNode(node)) {
+ return Buffer.from(res, 'base64');
+ }
+ for (i=0; i < node.childNodes.length; i++) {
+ if (node.childNodes[i].nodeType === TEXT_NODE) {
+ res += node.childNodes[i].nodeValue.replace(/\s+/g, '');
+ }
+ }
+ return Buffer.from(res, 'base64');
+
+ } else if (node.nodeName === 'date') {
+ invariant(
+ !isEmptyNode(node),
+ 'Cannot parse "" as Date.'
+ )
+ return new Date(node.childNodes[0].nodeValue);
+
+ } else if (node.nodeName === 'null') {
+ return null;
+
+ } else if (node.nodeName === 'true') {
+ return true;
+
+ } else if (node.nodeName === 'false') {
+ return false;
+ } else {
+ throw new Error('Invalid PLIST tag ' + node.nodeName);
+ }
+}
+
+}).call(this)}).call(this,require("buffer").Buffer)
+},{"@xmldom/xmldom":6,"buffer":9}],2:[function(require,module,exports){
+'use strict'
+
+/**
+ * Ponyfill for `Array.prototype.find` which is only available in ES6 runtimes.
+ *
+ * Works with anything that has a `length` property and index access properties, including NodeList.
+ *
+ * @template {unknown} T
+ * @param {Array<T> | ({length:number, [number]: T})} list
+ * @param {function (item: T, index: number, list:Array<T> | ({length:number, [number]: T})):boolean} predicate
+ * @param {Partial<Pick<ArrayConstructor['prototype'], 'find'>>?} ac `Array.prototype` by default,
+ * allows injecting a custom implementation in tests
+ * @returns {T | undefined}
+ *
+ * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find
+ * @see https://tc39.es/ecma262/multipage/indexed-collections.html#sec-array.prototype.find
+ */
+function find(list, predicate, ac) {
+ if (ac === undefined) {
+ ac = Array.prototype;
+ }
+ if (list && typeof ac.find === 'function') {
+ return ac.find.call(list, predicate);
+ }
+ for (var i = 0; i < list.length; i++) {
+ if (Object.prototype.hasOwnProperty.call(list, i)) {
+ var item = list[i];
+ if (predicate.call(undefined, item, i, list)) {
+ return item;
+ }
+ }
+ }
+}
+
+/**
+ * "Shallow freezes" an object to render it immutable.
+ * Uses `Object.freeze` if available,
+ * otherwise the immutability is only in the type.
+ *
+ * Is used to create "enum like" objects.
+ *
+ * @template T
+ * @param {T} object the object to freeze
+ * @param {Pick<ObjectConstructor, 'freeze'> = Object} oc `Object` by default,
+ * allows to inject custom object constructor for tests
+ * @returns {Readonly<T>}
+ *
+ * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze
+ */
+function freeze(object, oc) {
+ if (oc === undefined) {
+ oc = Object
+ }
+ return oc && typeof oc.freeze === 'function' ? oc.freeze(object) : object
+}
+
+/**
+ * Since we can not rely on `Object.assign` we provide a simplified version
+ * that is sufficient for our needs.
+ *
+ * @param {Object} target
+ * @param {Object | null | undefined} source
+ *
+ * @returns {Object} target
+ * @throws TypeError if target is not an object
+ *
+ * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign
+ * @see https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.assign
+ */
+function assign(target, source) {
+ if (target === null || typeof target !== 'object') {
+ throw new TypeError('target is not an object')
+ }
+ for (var key in source) {
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
+ target[key] = source[key]
+ }
+ }
+ return target
+}
+
+/**
+ * All mime types that are allowed as input to `DOMParser.parseFromString`
+ *
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString#Argument02 MDN
+ * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#domparsersupportedtype WHATWG HTML Spec
+ * @see DOMParser.prototype.parseFromString
+ */
+var MIME_TYPE = freeze({
+ /**
+ * `text/html`, the only mime type that triggers treating an XML document as HTML.
+ *
+ * @see DOMParser.SupportedType.isHTML
+ * @see https://www.iana.org/assignments/media-types/text/html IANA MimeType registration
+ * @see https://en.wikipedia.org/wiki/HTML Wikipedia
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString MDN
+ * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-domparser-parsefromstring WHATWG HTML Spec
+ */
+ HTML: 'text/html',
+
+ /**
+ * Helper method to check a mime type if it indicates an HTML document
+ *
+ * @param {string} [value]
+ * @returns {boolean}
+ *
+ * @see https://www.iana.org/assignments/media-types/text/html IANA MimeType registration
+ * @see https://en.wikipedia.org/wiki/HTML Wikipedia
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString MDN
+ * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-domparser-parsefromstring */
+ isHTML: function (value) {
+ return value === MIME_TYPE.HTML
+ },
+
+ /**
+ * `application/xml`, the standard mime type for XML documents.
+ *
+ * @see https://www.iana.org/assignments/media-types/application/xml IANA MimeType registration
+ * @see https://tools.ietf.org/html/rfc7303#section-9.1 RFC 7303
+ * @see https://en.wikipedia.org/wiki/XML_and_MIME Wikipedia
+ */
+ XML_APPLICATION: 'application/xml',
+
+ /**
+ * `text/html`, an alias for `application/xml`.
+ *
+ * @see https://tools.ietf.org/html/rfc7303#section-9.2 RFC 7303
+ * @see https://www.iana.org/assignments/media-types/text/xml IANA MimeType registration
+ * @see https://en.wikipedia.org/wiki/XML_and_MIME Wikipedia
+ */
+ XML_TEXT: 'text/xml',
+
+ /**
+ * `application/xhtml+xml`, indicates an XML document that has the default HTML namespace,
+ * but is parsed as an XML document.
+ *
+ * @see https://www.iana.org/assignments/media-types/application/xhtml+xml IANA MimeType registration
+ * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocument WHATWG DOM Spec
+ * @see https://en.wikipedia.org/wiki/XHTML Wikipedia
+ */
+ XML_XHTML_APPLICATION: 'application/xhtml+xml',
+
+ /**
+ * `image/svg+xml`,
+ *
+ * @see https://www.iana.org/assignments/media-types/image/svg+xml IANA MimeType registration
+ * @see https://www.w3.org/TR/SVG11/ W3C SVG 1.1
+ * @see https://en.wikipedia.org/wiki/Scalable_Vector_Graphics Wikipedia
+ */
+ XML_SVG_IMAGE: 'image/svg+xml',
+})
+
+/**
+ * Namespaces that are used in this code base.
+ *
+ * @see http://www.w3.org/TR/REC-xml-names
+ */
+var NAMESPACE = freeze({
+ /**
+ * The XHTML namespace.
+ *
+ * @see http://www.w3.org/1999/xhtml
+ */
+ HTML: 'http://www.w3.org/1999/xhtml',
+
+ /**
+ * Checks if `uri` equals `NAMESPACE.HTML`.
+ *
+ * @param {string} [uri]
+ *
+ * @see NAMESPACE.HTML
+ */
+ isHTML: function (uri) {
+ return uri === NAMESPACE.HTML
+ },
+
+ /**
+ * The SVG namespace.
+ *
+ * @see http://www.w3.org/2000/svg
+ */
+ SVG: 'http://www.w3.org/2000/svg',
+
+ /**
+ * The `xml:` namespace.
+ *
+ * @see http://www.w3.org/XML/1998/namespace
+ */
+ XML: 'http://www.w3.org/XML/1998/namespace',
+
+ /**
+ * The `xmlns:` namespace
+ *
+ * @see https://www.w3.org/2000/xmlns/
+ */
+ XMLNS: 'http://www.w3.org/2000/xmlns/',
+})
+
+exports.assign = assign;
+exports.find = find;
+exports.freeze = freeze;
+exports.MIME_TYPE = MIME_TYPE;
+exports.NAMESPACE = NAMESPACE;
+
+},{}],3:[function(require,module,exports){
+var conventions = require("./conventions");
+var dom = require('./dom')
+var entities = require('./entities');
+var sax = require('./sax');
+
+var DOMImplementation = dom.DOMImplementation;
+
+var NAMESPACE = conventions.NAMESPACE;
+
+var ParseError = sax.ParseError;
+var XMLReader = sax.XMLReader;
+
+/**
+ * Normalizes line ending according to https://www.w3.org/TR/xml11/#sec-line-ends:
+ *
+ * > XML parsed entities are often stored in computer files which,
+ * > for editing convenience, are organized into lines.
+ * > These lines are typically separated by some combination
+ * > of the characters CARRIAGE RETURN (#xD) and LINE FEED (#xA).
+ * >
+ * > To simplify the tasks of applications, the XML processor must behave
+ * > as if it normalized all line breaks in external parsed entities (including the document entity)
+ * > on input, before parsing, by translating all of the following to a single #xA character:
+ * >
+ * > 1. the two-character sequence #xD #xA
+ * > 2. the two-character sequence #xD #x85
+ * > 3. the single character #x85
+ * > 4. the single character #x2028
+ * > 5. any #xD character that is not immediately followed by #xA or #x85.
+ *
+ * @param {string} input
+ * @returns {string}
+ */
+function normalizeLineEndings(input) {
+ return input
+ .replace(/\r[\n\u0085]/g, '\n')
+ .replace(/[\r\u0085\u2028]/g, '\n')
+}
+
+/**
+ * @typedef Locator
+ * @property {number} [columnNumber]
+ * @property {number} [lineNumber]
+ */
+
+/**
+ * @typedef DOMParserOptions
+ * @property {DOMHandler} [domBuilder]
+ * @property {Function} [errorHandler]
+ * @property {(string) => string} [normalizeLineEndings] used to replace line endings before parsing
+ * defaults to `normalizeLineEndings`
+ * @property {Locator} [locator]
+ * @property {Record<string, string>} [xmlns]
+ *
+ * @see normalizeLineEndings
+ */
+
+/**
+ * The DOMParser interface provides the ability to parse XML or HTML source code
+ * from a string into a DOM `Document`.
+ *
+ * _xmldom is different from the spec in that it allows an `options` parameter,
+ * to override the default behavior._
+ *
+ * @param {DOMParserOptions} [options]
+ * @constructor
+ *
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser
+ * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-parsing-and-serialization
+ */
+function DOMParser(options){
+ this.options = options ||{locator:{}};
+}
+
+DOMParser.prototype.parseFromString = function(source,mimeType){
+ var options = this.options;
+ var sax = new XMLReader();
+ var domBuilder = options.domBuilder || new DOMHandler();//contentHandler and LexicalHandler
+ var errorHandler = options.errorHandler;
+ var locator = options.locator;
+ var defaultNSMap = options.xmlns||{};
+ var isHTML = /\/x?html?$/.test(mimeType);//mimeType.toLowerCase().indexOf('html') > -1;
+ var entityMap = isHTML ? entities.HTML_ENTITIES : entities.XML_ENTITIES;
+ if(locator){
+ domBuilder.setDocumentLocator(locator)
+ }
+
+ sax.errorHandler = buildErrorHandler(errorHandler,domBuilder,locator);
+ sax.domBuilder = options.domBuilder || domBuilder;
+ if(isHTML){
+ defaultNSMap[''] = NAMESPACE.HTML;
+ }
+ defaultNSMap.xml = defaultNSMap.xml || NAMESPACE.XML;
+ var normalize = options.normalizeLineEndings || normalizeLineEndings;
+ if (source && typeof source === 'string') {
+ sax.parse(
+ normalize(source),
+ defaultNSMap,
+ entityMap
+ )
+ } else {
+ sax.errorHandler.error('invalid doc source')
+ }
+ return domBuilder.doc;
+}
+function buildErrorHandler(errorImpl,domBuilder,locator){
+ if(!errorImpl){
+ if(domBuilder instanceof DOMHandler){
+ return domBuilder;
+ }
+ errorImpl = domBuilder ;
+ }
+ var errorHandler = {}
+ var isCallback = errorImpl instanceof Function;
+ locator = locator||{}
+ function build(key){
+ var fn = errorImpl[key];
+ if(!fn && isCallback){
+ fn = errorImpl.length == 2?function(msg){errorImpl(key,msg)}:errorImpl;
+ }
+ errorHandler[key] = fn && function(msg){
+ fn('[xmldom '+key+']\t'+msg+_locator(locator));
+ }||function(){};
+ }
+ build('warning');
+ build('error');
+ build('fatalError');
+ return errorHandler;
+}
+
+//console.log('#\n\n\n\n\n\n\n####')
+/**
+ * +ContentHandler+ErrorHandler
+ * +LexicalHandler+EntityResolver2
+ * -DeclHandler-DTDHandler
+ *
+ * DefaultHandler:EntityResolver, DTDHandler, ContentHandler, ErrorHandler
+ * DefaultHandler2:DefaultHandler,LexicalHandler, DeclHandler, EntityResolver2
+ * @link http://www.saxproject.org/apidoc/org/xml/sax/helpers/DefaultHandler.html
+ */
+function DOMHandler() {
+ this.cdata = false;
+}
+function position(locator,node){
+ node.lineNumber = locator.lineNumber;
+ node.columnNumber = locator.columnNumber;
+}
+/**
+ * @see org.xml.sax.ContentHandler#startDocument
+ * @link http://www.saxproject.org/apidoc/org/xml/sax/ContentHandler.html
+ */
+DOMHandler.prototype = {
+ startDocument : function() {
+ this.doc = new DOMImplementation().createDocument(null, null, null);
+ if (this.locator) {
+ this.doc.documentURI = this.locator.systemId;
+ }
+ },
+ startElement:function(namespaceURI, localName, qName, attrs) {
+ var doc = this.doc;
+ var el = doc.createElementNS(namespaceURI, qName||localName);
+ var len = attrs.length;
+ appendElement(this, el);
+ this.currentElement = el;
+
+ this.locator && position(this.locator,el)
+ for (var i = 0 ; i < len; i++) {
+ var namespaceURI = attrs.getURI(i);
+ var value = attrs.getValue(i);
+ var qName = attrs.getQName(i);
+ var attr = doc.createAttributeNS(namespaceURI, qName);
+ this.locator &&position(attrs.getLocator(i),attr);
+ attr.value = attr.nodeValue = value;
+ el.setAttributeNode(attr)
+ }
+ },
+ endElement:function(namespaceURI, localName, qName) {
+ var current = this.currentElement
+ var tagName = current.tagName;
+ this.currentElement = current.parentNode;
+ },
+ startPrefixMapping:function(prefix, uri) {
+ },
+ endPrefixMapping:function(prefix) {
+ },
+ processingInstruction:function(target, data) {
+ var ins = this.doc.createProcessingInstruction(target, data);
+ this.locator && position(this.locator,ins)
+ appendElement(this, ins);
+ },
+ ignorableWhitespace:function(ch, start, length) {
+ },
+ characters:function(chars, start, length) {
+ chars = _toString.apply(this,arguments)
+ //console.log(chars)
+ if(chars){
+ if (this.cdata) {
+ var charNode = this.doc.createCDATASection(chars);
+ } else {
+ var charNode = this.doc.createTextNode(chars);
+ }
+ if(this.currentElement){
+ this.currentElement.appendChild(charNode);
+ }else if(/^\s*$/.test(chars)){
+ this.doc.appendChild(charNode);
+ //process xml
+ }
+ this.locator && position(this.locator,charNode)
+ }
+ },
+ skippedEntity:function(name) {
+ },
+ endDocument:function() {
+ this.doc.normalize();
+ },
+ setDocumentLocator:function (locator) {
+ if(this.locator = locator){// && !('lineNumber' in locator)){
+ locator.lineNumber = 0;
+ }
+ },
+ //LexicalHandler
+ comment:function(chars, start, length) {
+ chars = _toString.apply(this,arguments)
+ var comm = this.doc.createComment(chars);
+ this.locator && position(this.locator,comm)
+ appendElement(this, comm);
+ },
+
+ startCDATA:function() {
+ //used in characters() methods
+ this.cdata = true;
+ },
+ endCDATA:function() {
+ this.cdata = false;
+ },
+
+ startDTD:function(name, publicId, systemId) {
+ var impl = this.doc.implementation;
+ if (impl && impl.createDocumentType) {
+ var dt = impl.createDocumentType(name, publicId, systemId);
+ this.locator && position(this.locator,dt)
+ appendElement(this, dt);
+ this.doc.doctype = dt;
+ }
+ },
+ /**
+ * @see org.xml.sax.ErrorHandler
+ * @link http://www.saxproject.org/apidoc/org/xml/sax/ErrorHandler.html
+ */
+ warning:function(error) {
+ console.warn('[xmldom warning]\t'+error,_locator(this.locator));
+ },
+ error:function(error) {
+ console.error('[xmldom error]\t'+error,_locator(this.locator));
+ },
+ fatalError:function(error) {
+ throw new ParseError(error, this.locator);
+ }
+}
+function _locator(l){
+ if(l){
+ return '\n@'+(l.systemId ||'')+'#[line:'+l.lineNumber+',col:'+l.columnNumber+']'
+ }
+}
+function _toString(chars,start,length){
+ if(typeof chars == 'string'){
+ return chars.substr(start,length)
+ }else{//java sax connect width xmldom on rhino(what about: "? && !(chars instanceof String)")
+ if(chars.length >= start+length || start){
+ return new java.lang.String(chars,start,length)+'';
+ }
+ return chars;
+ }
+}
+
+/*
+ * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/LexicalHandler.html
+ * used method of org.xml.sax.ext.LexicalHandler:
+ * #comment(chars, start, length)
+ * #startCDATA()
+ * #endCDATA()
+ * #startDTD(name, publicId, systemId)
+ *
+ *
+ * IGNORED method of org.xml.sax.ext.LexicalHandler:
+ * #endDTD()
+ * #startEntity(name)
+ * #endEntity(name)
+ *
+ *
+ * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/DeclHandler.html
+ * IGNORED method of org.xml.sax.ext.DeclHandler
+ * #attributeDecl(eName, aName, type, mode, value)
+ * #elementDecl(name, model)
+ * #externalEntityDecl(name, publicId, systemId)
+ * #internalEntityDecl(name, value)
+ * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/EntityResolver2.html
+ * IGNORED method of org.xml.sax.EntityResolver2
+ * #resolveEntity(String name,String publicId,String baseURI,String systemId)
+ * #resolveEntity(publicId, systemId)
+ * #getExternalSubset(name, baseURI)
+ * @link http://www.saxproject.org/apidoc/org/xml/sax/DTDHandler.html
+ * IGNORED method of org.xml.sax.DTDHandler
+ * #notationDecl(name, publicId, systemId) {};
+ * #unparsedEntityDecl(name, publicId, systemId, notationName) {};
+ */
+"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(key){
+ DOMHandler.prototype[key] = function(){return null}
+})
+
+/* Private static helpers treated below as private instance methods, so don't need to add these to the public API; we might use a Relator to also get rid of non-standard public properties */
+function appendElement (hander,node) {
+ if (!hander.currentElement) {
+ hander.doc.appendChild(node);
+ } else {
+ hander.currentElement.appendChild(node);
+ }
+}//appendChild and setAttributeNS are preformance key
+
+exports.__DOMHandler = DOMHandler;
+exports.normalizeLineEndings = normalizeLineEndings;
+exports.DOMParser = DOMParser;
+
+},{"./conventions":2,"./dom":4,"./entities":5,"./sax":7}],4:[function(require,module,exports){
+var conventions = require("./conventions");
+
+var find = conventions.find;
+var NAMESPACE = conventions.NAMESPACE;
+
+/**
+ * A prerequisite for `[].filter`, to drop elements that are empty
+ * @param {string} input
+ * @returns {boolean}
+ */
+function notEmptyString (input) {
+ return input !== ''
+}
+/**
+ * @see https://infra.spec.whatwg.org/#split-on-ascii-whitespace
+ * @see https://infra.spec.whatwg.org/#ascii-whitespace
+ *
+ * @param {string} input
+ * @returns {string[]} (can be empty)
+ */
+function splitOnASCIIWhitespace(input) {
+ // U+0009 TAB, U+000A LF, U+000C FF, U+000D CR, U+0020 SPACE
+ return input ? input.split(/[\t\n\f\r ]+/).filter(notEmptyString) : []
+}
+
+/**
+ * Adds element as a key to current if it is not already present.
+ *
+ * @param {Record<string, boolean | undefined>} current
+ * @param {string} element
+ * @returns {Record<string, boolean | undefined>}
+ */
+function orderedSetReducer (current, element) {
+ if (!current.hasOwnProperty(element)) {
+ current[element] = true;
+ }
+ return current;
+}
+
+/**
+ * @see https://infra.spec.whatwg.org/#ordered-set
+ * @param {string} input
+ * @returns {string[]}
+ */
+function toOrderedSet(input) {
+ if (!input) return [];
+ var list = splitOnASCIIWhitespace(input);
+ return Object.keys(list.reduce(orderedSetReducer, {}))
+}
+
+/**
+ * Uses `list.indexOf` to implement something like `Array.prototype.includes`,
+ * which we can not rely on being available.
+ *
+ * @param {any[]} list
+ * @returns {function(any): boolean}
+ */
+function arrayIncludes (list) {
+ return function(element) {
+ return list && list.indexOf(element) !== -1;
+ }
+}
+
+function copy(src,dest){
+ for(var p in src){
+ if (Object.prototype.hasOwnProperty.call(src, p)) {
+ dest[p] = src[p];
+ }
+ }
+}
+
+/**
+^\w+\.prototype\.([_\w]+)\s*=\s*((?:.*\{\s*?[\r\n][\s\S]*?^})|\S.*?(?=[;\r\n]));?
+^\w+\.prototype\.([_\w]+)\s*=\s*(\S.*?(?=[;\r\n]));?
+ */
+function _extends(Class,Super){
+ var pt = Class.prototype;
+ if(!(pt instanceof Super)){
+ function t(){};
+ t.prototype = Super.prototype;
+ t = new t();
+ copy(pt,t);
+ Class.prototype = pt = t;
+ }
+ if(pt.constructor != Class){
+ if(typeof Class != 'function'){
+ console.error("unknown Class:"+Class)
+ }
+ pt.constructor = Class
+ }
+}
+
+// Node Types
+var NodeType = {}
+var ELEMENT_NODE = NodeType.ELEMENT_NODE = 1;
+var ATTRIBUTE_NODE = NodeType.ATTRIBUTE_NODE = 2;
+var TEXT_NODE = NodeType.TEXT_NODE = 3;
+var CDATA_SECTION_NODE = NodeType.CDATA_SECTION_NODE = 4;
+var ENTITY_REFERENCE_NODE = NodeType.ENTITY_REFERENCE_NODE = 5;
+var ENTITY_NODE = NodeType.ENTITY_NODE = 6;
+var PROCESSING_INSTRUCTION_NODE = NodeType.PROCESSING_INSTRUCTION_NODE = 7;
+var COMMENT_NODE = NodeType.COMMENT_NODE = 8;
+var DOCUMENT_NODE = NodeType.DOCUMENT_NODE = 9;
+var DOCUMENT_TYPE_NODE = NodeType.DOCUMENT_TYPE_NODE = 10;
+var DOCUMENT_FRAGMENT_NODE = NodeType.DOCUMENT_FRAGMENT_NODE = 11;
+var NOTATION_NODE = NodeType.NOTATION_NODE = 12;
+
+// ExceptionCode
+var ExceptionCode = {}
+var ExceptionMessage = {};
+var INDEX_SIZE_ERR = ExceptionCode.INDEX_SIZE_ERR = ((ExceptionMessage[1]="Index size error"),1);
+var DOMSTRING_SIZE_ERR = ExceptionCode.DOMSTRING_SIZE_ERR = ((ExceptionMessage[2]="DOMString size error"),2);
+var HIERARCHY_REQUEST_ERR = ExceptionCode.HIERARCHY_REQUEST_ERR = ((ExceptionMessage[3]="Hierarchy request error"),3);
+var WRONG_DOCUMENT_ERR = ExceptionCode.WRONG_DOCUMENT_ERR = ((ExceptionMessage[4]="Wrong document"),4);
+var INVALID_CHARACTER_ERR = ExceptionCode.INVALID_CHARACTER_ERR = ((ExceptionMessage[5]="Invalid character"),5);
+var NO_DATA_ALLOWED_ERR = ExceptionCode.NO_DATA_ALLOWED_ERR = ((ExceptionMessage[6]="No data allowed"),6);
+var NO_MODIFICATION_ALLOWED_ERR = ExceptionCode.NO_MODIFICATION_ALLOWED_ERR = ((ExceptionMessage[7]="No modification allowed"),7);
+var NOT_FOUND_ERR = ExceptionCode.NOT_FOUND_ERR = ((ExceptionMessage[8]="Not found"),8);
+var NOT_SUPPORTED_ERR = ExceptionCode.NOT_SUPPORTED_ERR = ((ExceptionMessage[9]="Not supported"),9);
+var INUSE_ATTRIBUTE_ERR = ExceptionCode.INUSE_ATTRIBUTE_ERR = ((ExceptionMessage[10]="Attribute in use"),10);
+//level2
+var INVALID_STATE_ERR = ExceptionCode.INVALID_STATE_ERR = ((ExceptionMessage[11]="Invalid state"),11);
+var SYNTAX_ERR = ExceptionCode.SYNTAX_ERR = ((ExceptionMessage[12]="Syntax error"),12);
+var INVALID_MODIFICATION_ERR = ExceptionCode.INVALID_MODIFICATION_ERR = ((ExceptionMessage[13]="Invalid modification"),13);
+var NAMESPACE_ERR = ExceptionCode.NAMESPACE_ERR = ((ExceptionMessage[14]="Invalid namespace"),14);
+var INVALID_ACCESS_ERR = ExceptionCode.INVALID_ACCESS_ERR = ((ExceptionMessage[15]="Invalid access"),15);
+
+/**
+ * DOM Level 2
+ * Object DOMException
+ * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html
+ * @see http://www.w3.org/TR/REC-DOM-Level-1/ecma-script-language-binding.html
+ */
+function DOMException(code, message) {
+ if(message instanceof Error){
+ var error = message;
+ }else{
+ error = this;
+ Error.call(this, ExceptionMessage[code]);
+ this.message = ExceptionMessage[code];
+ if(Error.captureStackTrace) Error.captureStackTrace(this, DOMException);
+ }
+ error.code = code;
+ if(message) this.message = this.message + ": " + message;
+ return error;
+};
+DOMException.prototype = Error.prototype;
+copy(ExceptionCode,DOMException)
+
+/**
+ * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-536297177
+ * The NodeList interface provides the abstraction of an ordered collection of nodes, without defining or constraining how this collection is implemented. NodeList objects in the DOM are live.
+ * The items in the NodeList are accessible via an integral index, starting from 0.
+ */
+function NodeList() {
+};
+NodeList.prototype = {
+ /**
+ * The number of nodes in the list. The range of valid child node indices is 0 to length-1 inclusive.
+ * @standard level1
+ */
+ length:0,
+ /**
+ * Returns the indexth item in the collection. If index is greater than or equal to the number of nodes in the list, this returns null.
+ * @standard level1
+ * @param index unsigned long
+ * Index into the collection.
+ * @return Node
+ * The node at the indexth position in the NodeList, or null if that is not a valid index.
+ */
+ item: function(index) {
+ return this[index] || null;
+ },
+ toString:function(isHTML,nodeFilter){
+ for(var buf = [], i = 0;i<this.length;i++){
+ serializeToString(this[i],buf,isHTML,nodeFilter);
+ }
+ return buf.join('');
+ },
+ /**
+ * @private
+ * @param {function (Node):boolean} predicate
+ * @returns {Node[]}
+ */
+ filter: function (predicate) {
+ return Array.prototype.filter.call(this, predicate);
+ },
+ /**
+ * @private
+ * @param {Node} item
+ * @returns {number}
+ */
+ indexOf: function (item) {
+ return Array.prototype.indexOf.call(this, item);
+ },
+};
+
+function LiveNodeList(node,refresh){
+ this._node = node;
+ this._refresh = refresh
+ _updateLiveList(this);
+}
+function _updateLiveList(list){
+ var inc = list._node._inc || list._node.ownerDocument._inc;
+ if(list._inc != inc){
+ var ls = list._refresh(list._node);
+ //console.log(ls.length)
+ __set__(list,'length',ls.length);
+ copy(ls,list);
+ list._inc = inc;
+ }
+}
+LiveNodeList.prototype.item = function(i){
+ _updateLiveList(this);
+ return this[i];
+}
+
+_extends(LiveNodeList,NodeList);
+
+/**
+ * Objects implementing the NamedNodeMap interface are used
+ * to represent collections of nodes that can be accessed by name.
+ * Note that NamedNodeMap does not inherit from NodeList;
+ * NamedNodeMaps are not maintained in any particular order.
+ * Objects contained in an object implementing NamedNodeMap may also be accessed by an ordinal index,
+ * but this is simply to allow convenient enumeration of the contents of a NamedNodeMap,
+ * and does not imply that the DOM specifies an order to these Nodes.
+ * NamedNodeMap objects in the DOM are live.
+ * used for attributes or DocumentType entities
+ */
+function NamedNodeMap() {
+};
+
+function _findNodeIndex(list,node){
+ var i = list.length;
+ while(i--){
+ if(list[i] === node){return i}
+ }
+}
+
+function _addNamedNode(el,list,newAttr,oldAttr){
+ if(oldAttr){
+ list[_findNodeIndex(list,oldAttr)] = newAttr;
+ }else{
+ list[list.length++] = newAttr;
+ }
+ if(el){
+ newAttr.ownerElement = el;
+ var doc = el.ownerDocument;
+ if(doc){
+ oldAttr && _onRemoveAttribute(doc,el,oldAttr);
+ _onAddAttribute(doc,el,newAttr);
+ }
+ }
+}
+function _removeNamedNode(el,list,attr){
+ //console.log('remove attr:'+attr)
+ var i = _findNodeIndex(list,attr);
+ if(i>=0){
+ var lastIndex = list.length-1
+ while(i<lastIndex){
+ list[i] = list[++i]
+ }
+ list.length = lastIndex;
+ if(el){
+ var doc = el.ownerDocument;
+ if(doc){
+ _onRemoveAttribute(doc,el,attr);
+ attr.ownerElement = null;
+ }
+ }
+ }else{
+ throw new DOMException(NOT_FOUND_ERR,new Error(el.tagName+'@'+attr))
+ }
+}
+NamedNodeMap.prototype = {
+ length:0,
+ item:NodeList.prototype.item,
+ getNamedItem: function(key) {
+// if(key.indexOf(':')>0 || key == 'xmlns'){
+// return null;
+// }
+ //console.log()
+ var i = this.length;
+ while(i--){
+ var attr = this[i];
+ //console.log(attr.nodeName,key)
+ if(attr.nodeName == key){
+ return attr;
+ }
+ }
+ },
+ setNamedItem: function(attr) {
+ var el = attr.ownerElement;
+ if(el && el!=this._ownerElement){
+ throw new DOMException(INUSE_ATTRIBUTE_ERR);
+ }
+ var oldAttr = this.getNamedItem(attr.nodeName);
+ _addNamedNode(this._ownerElement,this,attr,oldAttr);
+ return oldAttr;
+ },
+ /* returns Node */
+ setNamedItemNS: function(attr) {// raises: WRONG_DOCUMENT_ERR,NO_MODIFICATION_ALLOWED_ERR,INUSE_ATTRIBUTE_ERR
+ var el = attr.ownerElement, oldAttr;
+ if(el && el!=this._ownerElement){
+ throw new DOMException(INUSE_ATTRIBUTE_ERR);
+ }
+ oldAttr = this.getNamedItemNS(attr.namespaceURI,attr.localName);
+ _addNamedNode(this._ownerElement,this,attr,oldAttr);
+ return oldAttr;
+ },
+
+ /* returns Node */
+ removeNamedItem: function(key) {
+ var attr = this.getNamedItem(key);
+ _removeNamedNode(this._ownerElement,this,attr);
+ return attr;
+
+
+ },// raises: NOT_FOUND_ERR,NO_MODIFICATION_ALLOWED_ERR
+
+ //for level2
+ removeNamedItemNS:function(namespaceURI,localName){
+ var attr = this.getNamedItemNS(namespaceURI,localName);
+ _removeNamedNode(this._ownerElement,this,attr);
+ return attr;
+ },
+ getNamedItemNS: function(namespaceURI, localName) {
+ var i = this.length;
+ while(i--){
+ var node = this[i];
+ if(node.localName == localName && node.namespaceURI == namespaceURI){
+ return node;
+ }
+ }
+ return null;
+ }
+};
+
+/**
+ * The DOMImplementation interface represents an object providing methods
+ * which are not dependent on any particular document.
+ * Such an object is returned by the `Document.implementation` property.
+ *
+ * __The individual methods describe the differences compared to the specs.__
+ *
+ * @constructor
+ *
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation MDN
+ * @see https://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-102161490 DOM Level 1 Core (Initial)
+ * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-102161490 DOM Level 2 Core
+ * @see https://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-102161490 DOM Level 3 Core
+ * @see https://dom.spec.whatwg.org/#domimplementation DOM Living Standard
+ */
+function DOMImplementation() {
+}
+
+DOMImplementation.prototype = {
+ /**
+ * The DOMImplementation.hasFeature() method returns a Boolean flag indicating if a given feature is supported.
+ * The different implementations fairly diverged in what kind of features were reported.
+ * The latest version of the spec settled to force this method to always return true, where the functionality was accurate and in use.
+ *
+ * @deprecated It is deprecated and modern browsers return true in all cases.
+ *
+ * @param {string} feature
+ * @param {string} [version]
+ * @returns {boolean} always true
+ *
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/hasFeature MDN
+ * @see https://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-5CED94D7 DOM Level 1 Core
+ * @see https://dom.spec.whatwg.org/#dom-domimplementation-hasfeature DOM Living Standard
+ */
+ hasFeature: function(feature, version) {
+ return true;
+ },
+ /**
+ * Creates an XML Document object of the specified type with its document element.
+ *
+ * __It behaves slightly different from the description in the living standard__:
+ * - There is no interface/class `XMLDocument`, it returns a `Document` instance.
+ * - `contentType`, `encoding`, `mode`, `origin`, `url` fields are currently not declared.
+ * - this implementation is not validating names or qualified names
+ * (when parsing XML strings, the SAX parser takes care of that)
+ *
+ * @param {string|null} namespaceURI
+ * @param {string} qualifiedName
+ * @param {DocumentType=null} doctype
+ * @returns {Document}
+ *
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createDocument MDN
+ * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#Level-2-Core-DOM-createDocument DOM Level 2 Core (initial)
+ * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocument DOM Level 2 Core
+ *
+ * @see https://dom.spec.whatwg.org/#validate-and-extract DOM: Validate and extract
+ * @see https://www.w3.org/TR/xml/#NT-NameStartChar XML Spec: Names
+ * @see https://www.w3.org/TR/xml-names/#ns-qualnames XML Namespaces: Qualified names
+ */
+ createDocument: function(namespaceURI, qualifiedName, doctype){
+ var doc = new Document();
+ doc.implementation = this;
+ doc.childNodes = new NodeList();
+ doc.doctype = doctype || null;
+ if (doctype){
+ doc.appendChild(doctype);
+ }
+ if (qualifiedName){
+ var root = doc.createElementNS(namespaceURI, qualifiedName);
+ doc.appendChild(root);
+ }
+ return doc;
+ },
+ /**
+ * Returns a doctype, with the given `qualifiedName`, `publicId`, and `systemId`.
+ *
+ * __This behavior is slightly different from the in the specs__:
+ * - this implementation is not validating names or qualified names
+ * (when parsing XML strings, the SAX parser takes care of that)
+ *
+ * @param {string} qualifiedName
+ * @param {string} [publicId]
+ * @param {string} [systemId]
+ * @returns {DocumentType} which can either be used with `DOMImplementation.createDocument` upon document creation
+ * or can be put into the document via methods like `Node.insertBefore()` or `Node.replaceChild()`
+ *
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createDocumentType MDN
+ * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#Level-2-Core-DOM-createDocType DOM Level 2 Core
+ * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocumenttype DOM Living Standard
+ *
+ * @see https://dom.spec.whatwg.org/#validate-and-extract DOM: Validate and extract
+ * @see https://www.w3.org/TR/xml/#NT-NameStartChar XML Spec: Names
+ * @see https://www.w3.org/TR/xml-names/#ns-qualnames XML Namespaces: Qualified names
+ */
+ createDocumentType: function(qualifiedName, publicId, systemId){
+ var node = new DocumentType();
+ node.name = qualifiedName;
+ node.nodeName = qualifiedName;
+ node.publicId = publicId || '';
+ node.systemId = systemId || '';
+
+ return node;
+ }
+};
+
+
+/**
+ * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-1950641247
+ */
+
+function Node() {
+};
+
+Node.prototype = {
+ firstChild : null,
+ lastChild : null,
+ previousSibling : null,
+ nextSibling : null,
+ attributes : null,
+ parentNode : null,
+ childNodes : null,
+ ownerDocument : null,
+ nodeValue : null,
+ namespaceURI : null,
+ prefix : null,
+ localName : null,
+ // Modified in DOM Level 2:
+ insertBefore:function(newChild, refChild){//raises
+ return _insertBefore(this,newChild,refChild);
+ },
+ replaceChild:function(newChild, oldChild){//raises
+ _insertBefore(this, newChild,oldChild, assertPreReplacementValidityInDocument);
+ if(oldChild){
+ this.removeChild(oldChild);
+ }
+ },
+ removeChild:function(oldChild){
+ return _removeChild(this,oldChild);
+ },
+ appendChild:function(newChild){
+ return this.insertBefore(newChild,null);
+ },
+ hasChildNodes:function(){
+ return this.firstChild != null;
+ },
+ cloneNode:function(deep){
+ return cloneNode(this.ownerDocument||this,this,deep);
+ },
+ // Modified in DOM Level 2:
+ normalize:function(){
+ var child = this.firstChild;
+ while(child){
+ var next = child.nextSibling;
+ if(next && next.nodeType == TEXT_NODE && child.nodeType == TEXT_NODE){
+ this.removeChild(next);
+ child.appendData(next.data);
+ }else{
+ child.normalize();
+ child = next;
+ }
+ }
+ },
+ // Introduced in DOM Level 2:
+ isSupported:function(feature, version){
+ return this.ownerDocument.implementation.hasFeature(feature,version);
+ },
+ // Introduced in DOM Level 2:
+ hasAttributes:function(){
+ return this.attributes.length>0;
+ },
+ /**
+ * Look up the prefix associated to the given namespace URI, starting from this node.
+ * **The default namespace declarations are ignored by this method.**
+ * See Namespace Prefix Lookup for details on the algorithm used by this method.
+ *
+ * _Note: The implementation seems to be incomplete when compared to the algorithm described in the specs._
+ *
+ * @param {string | null} namespaceURI
+ * @returns {string | null}
+ * @see https://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-lookupNamespacePrefix
+ * @see https://www.w3.org/TR/DOM-Level-3-Core/namespaces-algorithms.html#lookupNamespacePrefixAlgo
+ * @see https://dom.spec.whatwg.org/#dom-node-lookupprefix
+ * @see https://github.com/xmldom/xmldom/issues/322
+ */
+ lookupPrefix:function(namespaceURI){
+ var el = this;
+ while(el){
+ var map = el._nsMap;
+ //console.dir(map)
+ if(map){
+ for(var n in map){
+ if (Object.prototype.hasOwnProperty.call(map, n) && map[n] === namespaceURI) {
+ return n;
+ }
+ }
+ }
+ el = el.nodeType == ATTRIBUTE_NODE?el.ownerDocument : el.parentNode;
+ }
+ return null;
+ },
+ // Introduced in DOM Level 3:
+ lookupNamespaceURI:function(prefix){
+ var el = this;
+ while(el){
+ var map = el._nsMap;
+ //console.dir(map)
+ if(map){
+ if(Object.prototype.hasOwnProperty.call(map, prefix)){
+ return map[prefix] ;
+ }
+ }
+ el = el.nodeType == ATTRIBUTE_NODE?el.ownerDocument : el.parentNode;
+ }
+ return null;
+ },
+ // Introduced in DOM Level 3:
+ isDefaultNamespace:function(namespaceURI){
+ var prefix = this.lookupPrefix(namespaceURI);
+ return prefix == null;
+ }
+};
+
+
+function _xmlEncoder(c){
+ return c == '<' && '&lt;' ||
+ c == '>' && '&gt;' ||
+ c == '&' && '&amp;' ||
+ c == '"' && '&quot;' ||
+ '&#'+c.charCodeAt()+';'
+}
+
+
+copy(NodeType,Node);
+copy(NodeType,Node.prototype);
+
+/**
+ * @param callback return true for continue,false for break
+ * @return boolean true: break visit;
+ */
+function _visitNode(node,callback){
+ if(callback(node)){
+ return true;
+ }
+ if(node = node.firstChild){
+ do{
+ if(_visitNode(node,callback)){return true}
+ }while(node=node.nextSibling)
+ }
+}
+
+
+
+function Document(){
+ this.ownerDocument = this;
+}
+
+function _onAddAttribute(doc,el,newAttr){
+ doc && doc._inc++;
+ var ns = newAttr.namespaceURI ;
+ if(ns === NAMESPACE.XMLNS){
+ //update namespace
+ el._nsMap[newAttr.prefix?newAttr.localName:''] = newAttr.value
+ }
+}
+
+function _onRemoveAttribute(doc,el,newAttr,remove){
+ doc && doc._inc++;
+ var ns = newAttr.namespaceURI ;
+ if(ns === NAMESPACE.XMLNS){
+ //update namespace
+ delete el._nsMap[newAttr.prefix?newAttr.localName:'']
+ }
+}
+
+/**
+ * Updates `el.childNodes`, updating the indexed items and it's `length`.
+ * Passing `newChild` means it will be appended.
+ * Otherwise it's assumed that an item has been removed,
+ * and `el.firstNode` and it's `.nextSibling` are used
+ * to walk the current list of child nodes.
+ *
+ * @param {Document} doc
+ * @param {Node} el
+ * @param {Node} [newChild]
+ * @private
+ */
+function _onUpdateChild (doc, el, newChild) {
+ if(doc && doc._inc){
+ doc._inc++;
+ //update childNodes
+ var cs = el.childNodes;
+ if (newChild) {
+ cs[cs.length++] = newChild;
+ } else {
+ var child = el.firstChild;
+ var i = 0;
+ while (child) {
+ cs[i++] = child;
+ child = child.nextSibling;
+ }
+ cs.length = i;
+ delete cs[cs.length];
+ }
+ }
+}
+
+/**
+ * Removes the connections between `parentNode` and `child`
+ * and any existing `child.previousSibling` or `child.nextSibling`.
+ *
+ * @see https://github.com/xmldom/xmldom/issues/135
+ * @see https://github.com/xmldom/xmldom/issues/145
+ *
+ * @param {Node} parentNode
+ * @param {Node} child
+ * @returns {Node} the child that was removed.
+ * @private
+ */
+function _removeChild (parentNode, child) {
+ var previous = child.previousSibling;
+ var next = child.nextSibling;
+ if (previous) {
+ previous.nextSibling = next;
+ } else {
+ parentNode.firstChild = next;
+ }
+ if (next) {
+ next.previousSibling = previous;
+ } else {
+ parentNode.lastChild = previous;
+ }
+ child.parentNode = null;
+ child.previousSibling = null;
+ child.nextSibling = null;
+ _onUpdateChild(parentNode.ownerDocument, parentNode);
+ return child;
+}
+
+/**
+ * Returns `true` if `node` can be a parent for insertion.
+ * @param {Node} node
+ * @returns {boolean}
+ */
+function hasValidParentNodeType(node) {
+ return (
+ node &&
+ (node.nodeType === Node.DOCUMENT_NODE || node.nodeType === Node.DOCUMENT_FRAGMENT_NODE || node.nodeType === Node.ELEMENT_NODE)
+ );
+}
+
+/**
+ * Returns `true` if `node` can be inserted according to it's `nodeType`.
+ * @param {Node} node
+ * @returns {boolean}
+ */
+function hasInsertableNodeType(node) {
+ return (
+ node &&
+ (isElementNode(node) ||
+ isTextNode(node) ||
+ isDocTypeNode(node) ||
+ node.nodeType === Node.DOCUMENT_FRAGMENT_NODE ||
+ node.nodeType === Node.COMMENT_NODE ||
+ node.nodeType === Node.PROCESSING_INSTRUCTION_NODE)
+ );
+}
+
+/**
+ * Returns true if `node` is a DOCTYPE node
+ * @param {Node} node
+ * @returns {boolean}
+ */
+function isDocTypeNode(node) {
+ return node && node.nodeType === Node.DOCUMENT_TYPE_NODE;
+}
+
+/**
+ * Returns true if the node is an element
+ * @param {Node} node
+ * @returns {boolean}
+ */
+function isElementNode(node) {
+ return node && node.nodeType === Node.ELEMENT_NODE;
+}
+/**
+ * Returns true if `node` is a text node
+ * @param {Node} node
+ * @returns {boolean}
+ */
+function isTextNode(node) {
+ return node && node.nodeType === Node.TEXT_NODE;
+}
+
+/**
+ * Check if en element node can be inserted before `child`, or at the end if child is falsy,
+ * according to the presence and position of a doctype node on the same level.
+ *
+ * @param {Document} doc The document node
+ * @param {Node} child the node that would become the nextSibling if the element would be inserted
+ * @returns {boolean} `true` if an element can be inserted before child
+ * @private
+ * https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity
+ */
+function isElementInsertionPossible(doc, child) {
+ var parentChildNodes = doc.childNodes || [];
+ if (find(parentChildNodes, isElementNode) || isDocTypeNode(child)) {
+ return false;
+ }
+ var docTypeNode = find(parentChildNodes, isDocTypeNode);
+ return !(child && docTypeNode && parentChildNodes.indexOf(docTypeNode) > parentChildNodes.indexOf(child));
+}
+
+/**
+ * Check if en element node can be inserted before `child`, or at the end if child is falsy,
+ * according to the presence and position of a doctype node on the same level.
+ *
+ * @param {Node} doc The document node
+ * @param {Node} child the node that would become the nextSibling if the element would be inserted
+ * @returns {boolean} `true` if an element can be inserted before child
+ * @private
+ * https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity
+ */
+function isElementReplacementPossible(doc, child) {
+ var parentChildNodes = doc.childNodes || [];
+
+ function hasElementChildThatIsNotChild(node) {
+ return isElementNode(node) && node !== child;
+ }
+
+ if (find(parentChildNodes, hasElementChildThatIsNotChild)) {
+ return false;
+ }
+ var docTypeNode = find(parentChildNodes, isDocTypeNode);
+ return !(child && docTypeNode && parentChildNodes.indexOf(docTypeNode) > parentChildNodes.indexOf(child));
+}
+
+/**
+ * @private
+ * Steps 1-5 of the checks before inserting and before replacing a child are the same.
+ *
+ * @param {Node} parent the parent node to insert `node` into
+ * @param {Node} node the node to insert
+ * @param {Node=} child the node that should become the `nextSibling` of `node`
+ * @returns {Node}
+ * @throws DOMException for several node combinations that would create a DOM that is not well-formed.
+ * @throws DOMException if `child` is provided but is not a child of `parent`.
+ * @see https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity
+ * @see https://dom.spec.whatwg.org/#concept-node-replace
+ */
+function assertPreInsertionValidity1to5(parent, node, child) {
+ // 1. If `parent` is not a Document, DocumentFragment, or Element node, then throw a "HierarchyRequestError" DOMException.
+ if (!hasValidParentNodeType(parent)) {
+ throw new DOMException(HIERARCHY_REQUEST_ERR, 'Unexpected parent node type ' + parent.nodeType);
+ }
+ // 2. If `node` is a host-including inclusive ancestor of `parent`, then throw a "HierarchyRequestError" DOMException.
+ // not implemented!
+ // 3. If `child` is non-null and its parent is not `parent`, then throw a "NotFoundError" DOMException.
+ if (child && child.parentNode !== parent) {
+ throw new DOMException(NOT_FOUND_ERR, 'child not in parent');
+ }
+ if (
+ // 4. If `node` is not a DocumentFragment, DocumentType, Element, or CharacterData node, then throw a "HierarchyRequestError" DOMException.
+ !hasInsertableNodeType(node) ||
+ // 5. If either `node` is a Text node and `parent` is a document,
+ // the sax parser currently adds top level text nodes, this will be fixed in 0.9.0
+ // || (node.nodeType === Node.TEXT_NODE && parent.nodeType === Node.DOCUMENT_NODE)
+ // or `node` is a doctype and `parent` is not a document, then throw a "HierarchyRequestError" DOMException.
+ (isDocTypeNode(node) && parent.nodeType !== Node.DOCUMENT_NODE)
+ ) {
+ throw new DOMException(
+ HIERARCHY_REQUEST_ERR,
+ 'Unexpected node type ' + node.nodeType + ' for parent node type ' + parent.nodeType
+ );
+ }
+}
+
+/**
+ * @private
+ * Step 6 of the checks before inserting and before replacing a child are different.
+ *
+ * @param {Document} parent the parent node to insert `node` into
+ * @param {Node} node the node to insert
+ * @param {Node | undefined} child the node that should become the `nextSibling` of `node`
+ * @returns {Node}
+ * @throws DOMException for several node combinations that would create a DOM that is not well-formed.
+ * @throws DOMException if `child` is provided but is not a child of `parent`.
+ * @see https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity
+ * @see https://dom.spec.whatwg.org/#concept-node-replace
+ */
+function assertPreInsertionValidityInDocument(parent, node, child) {
+ var parentChildNodes = parent.childNodes || [];
+ var nodeChildNodes = node.childNodes || [];
+
+ // DocumentFragment
+ if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
+ var nodeChildElements = nodeChildNodes.filter(isElementNode);
+ // If node has more than one element child or has a Text node child.
+ if (nodeChildElements.length > 1 || find(nodeChildNodes, isTextNode)) {
+ throw new DOMException(HIERARCHY_REQUEST_ERR, 'More than one element or text in fragment');
+ }
+ // Otherwise, if `node` has one element child and either `parent` has an element child,
+ // `child` is a doctype, or `child` is non-null and a doctype is following `child`.
+ if (nodeChildElements.length === 1 && !isElementInsertionPossible(parent, child)) {
+ throw new DOMException(HIERARCHY_REQUEST_ERR, 'Element in fragment can not be inserted before doctype');
+ }
+ }
+ // Element
+ if (isElementNode(node)) {
+ // `parent` has an element child, `child` is a doctype,
+ // or `child` is non-null and a doctype is following `child`.
+ if (!isElementInsertionPossible(parent, child)) {
+ throw new DOMException(HIERARCHY_REQUEST_ERR, 'Only one element can be added and only after doctype');
+ }
+ }
+ // DocumentType
+ if (isDocTypeNode(node)) {
+ // `parent` has a doctype child,
+ if (find(parentChildNodes, isDocTypeNode)) {
+ throw new DOMException(HIERARCHY_REQUEST_ERR, 'Only one doctype is allowed');
+ }
+ var parentElementChild = find(parentChildNodes, isElementNode);
+ // `child` is non-null and an element is preceding `child`,
+ if (child && parentChildNodes.indexOf(parentElementChild) < parentChildNodes.indexOf(child)) {
+ throw new DOMException(HIERARCHY_REQUEST_ERR, 'Doctype can only be inserted before an element');
+ }
+ // or `child` is null and `parent` has an element child.
+ if (!child && parentElementChild) {
+ throw new DOMException(HIERARCHY_REQUEST_ERR, 'Doctype can not be appended since element is present');
+ }
+ }
+}
+
+/**
+ * @private
+ * Step 6 of the checks before inserting and before replacing a child are different.
+ *
+ * @param {Document} parent the parent node to insert `node` into
+ * @param {Node} node the node to insert
+ * @param {Node | undefined} child the node that should become the `nextSibling` of `node`
+ * @returns {Node}
+ * @throws DOMException for several node combinations that would create a DOM that is not well-formed.
+ * @throws DOMException if `child` is provided but is not a child of `parent`.
+ * @see https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity
+ * @see https://dom.spec.whatwg.org/#concept-node-replace
+ */
+function assertPreReplacementValidityInDocument(parent, node, child) {
+ var parentChildNodes = parent.childNodes || [];
+ var nodeChildNodes = node.childNodes || [];
+
+ // DocumentFragment
+ if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
+ var nodeChildElements = nodeChildNodes.filter(isElementNode);
+ // If `node` has more than one element child or has a Text node child.
+ if (nodeChildElements.length > 1 || find(nodeChildNodes, isTextNode)) {
+ throw new DOMException(HIERARCHY_REQUEST_ERR, 'More than one element or text in fragment');
+ }
+ // Otherwise, if `node` has one element child and either `parent` has an element child that is not `child` or a doctype is following `child`.
+ if (nodeChildElements.length === 1 && !isElementReplacementPossible(parent, child)) {
+ throw new DOMException(HIERARCHY_REQUEST_ERR, 'Element in fragment can not be inserted before doctype');
+ }
+ }
+ // Element
+ if (isElementNode(node)) {
+ // `parent` has an element child that is not `child` or a doctype is following `child`.
+ if (!isElementReplacementPossible(parent, child)) {
+ throw new DOMException(HIERARCHY_REQUEST_ERR, 'Only one element can be added and only after doctype');
+ }
+ }
+ // DocumentType
+ if (isDocTypeNode(node)) {
+ function hasDoctypeChildThatIsNotChild(node) {
+ return isDocTypeNode(node) && node !== child;
+ }
+
+ // `parent` has a doctype child that is not `child`,
+ if (find(parentChildNodes, hasDoctypeChildThatIsNotChild)) {
+ throw new DOMException(HIERARCHY_REQUEST_ERR, 'Only one doctype is allowed');
+ }
+ var parentElementChild = find(parentChildNodes, isElementNode);
+ // or an element is preceding `child`.
+ if (child && parentChildNodes.indexOf(parentElementChild) < parentChildNodes.indexOf(child)) {
+ throw new DOMException(HIERARCHY_REQUEST_ERR, 'Doctype can only be inserted before an element');
+ }
+ }
+}
+
+/**
+ * @private
+ * @param {Node} parent the parent node to insert `node` into
+ * @param {Node} node the node to insert
+ * @param {Node=} child the node that should become the `nextSibling` of `node`
+ * @returns {Node}
+ * @throws DOMException for several node combinations that would create a DOM that is not well-formed.
+ * @throws DOMException if `child` is provided but is not a child of `parent`.
+ * @see https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity
+ */
+function _insertBefore(parent, node, child, _inDocumentAssertion) {
+ // To ensure pre-insertion validity of a node into a parent before a child, run these steps:
+ assertPreInsertionValidity1to5(parent, node, child);
+
+ // If parent is a document, and any of the statements below, switched on the interface node implements,
+ // are true, then throw a "HierarchyRequestError" DOMException.
+ if (parent.nodeType === Node.DOCUMENT_NODE) {
+ (_inDocumentAssertion || assertPreInsertionValidityInDocument)(parent, node, child);
+ }
+
+ var cp = node.parentNode;
+ if(cp){
+ cp.removeChild(node);//remove and update
+ }
+ if(node.nodeType === DOCUMENT_FRAGMENT_NODE){
+ var newFirst = node.firstChild;
+ if (newFirst == null) {
+ return node;
+ }
+ var newLast = node.lastChild;
+ }else{
+ newFirst = newLast = node;
+ }
+ var pre = child ? child.previousSibling : parent.lastChild;
+
+ newFirst.previousSibling = pre;
+ newLast.nextSibling = child;
+
+
+ if(pre){
+ pre.nextSibling = newFirst;
+ }else{
+ parent.firstChild = newFirst;
+ }
+ if(child == null){
+ parent.lastChild = newLast;
+ }else{
+ child.previousSibling = newLast;
+ }
+ do{
+ newFirst.parentNode = parent;
+ }while(newFirst !== newLast && (newFirst= newFirst.nextSibling))
+ _onUpdateChild(parent.ownerDocument||parent, parent);
+ //console.log(parent.lastChild.nextSibling == null)
+ if (node.nodeType == DOCUMENT_FRAGMENT_NODE) {
+ node.firstChild = node.lastChild = null;
+ }
+ return node;
+}
+
+/**
+ * Appends `newChild` to `parentNode`.
+ * If `newChild` is already connected to a `parentNode` it is first removed from it.
+ *
+ * @see https://github.com/xmldom/xmldom/issues/135
+ * @see https://github.com/xmldom/xmldom/issues/145
+ * @param {Node} parentNode
+ * @param {Node} newChild
+ * @returns {Node}
+ * @private
+ */
+function _appendSingleChild (parentNode, newChild) {
+ if (newChild.parentNode) {
+ newChild.parentNode.removeChild(newChild);
+ }
+ newChild.parentNode = parentNode;
+ newChild.previousSibling = parentNode.lastChild;
+ newChild.nextSibling = null;
+ if (newChild.previousSibling) {
+ newChild.previousSibling.nextSibling = newChild;
+ } else {
+ parentNode.firstChild = newChild;
+ }
+ parentNode.lastChild = newChild;
+ _onUpdateChild(parentNode.ownerDocument, parentNode, newChild);
+ return newChild;
+}
+
+Document.prototype = {
+ //implementation : null,
+ nodeName : '#document',
+ nodeType : DOCUMENT_NODE,
+ /**
+ * The DocumentType node of the document.
+ *
+ * @readonly
+ * @type DocumentType
+ */
+ doctype : null,
+ documentElement : null,
+ _inc : 1,
+
+ insertBefore : function(newChild, refChild){//raises
+ if(newChild.nodeType == DOCUMENT_FRAGMENT_NODE){
+ var child = newChild.firstChild;
+ while(child){
+ var next = child.nextSibling;
+ this.insertBefore(child,refChild);
+ child = next;
+ }
+ return newChild;
+ }
+ _insertBefore(this, newChild, refChild);
+ newChild.ownerDocument = this;
+ if (this.documentElement === null && newChild.nodeType === ELEMENT_NODE) {
+ this.documentElement = newChild;
+ }
+
+ return newChild;
+ },
+ removeChild : function(oldChild){
+ if(this.documentElement == oldChild){
+ this.documentElement = null;
+ }
+ return _removeChild(this,oldChild);
+ },
+ replaceChild: function (newChild, oldChild) {
+ //raises
+ _insertBefore(this, newChild, oldChild, assertPreReplacementValidityInDocument);
+ newChild.ownerDocument = this;
+ if (oldChild) {
+ this.removeChild(oldChild);
+ }
+ if (isElementNode(newChild)) {
+ this.documentElement = newChild;
+ }
+ },
+ // Introduced in DOM Level 2:
+ importNode : function(importedNode,deep){
+ return importNode(this,importedNode,deep);
+ },
+ // Introduced in DOM Level 2:
+ getElementById : function(id){
+ var rtv = null;
+ _visitNode(this.documentElement,function(node){
+ if(node.nodeType == ELEMENT_NODE){
+ if(node.getAttribute('id') == id){
+ rtv = node;
+ return true;
+ }
+ }
+ })
+ return rtv;
+ },
+
+ /**
+ * The `getElementsByClassName` method of `Document` interface returns an array-like object
+ * of all child elements which have **all** of the given class name(s).
+ *
+ * Returns an empty list if `classeNames` is an empty string or only contains HTML white space characters.
+ *
+ *
+ * Warning: This is a live LiveNodeList.
+ * Changes in the DOM will reflect in the array as the changes occur.
+ * If an element selected by this array no longer qualifies for the selector,
+ * it will automatically be removed. Be aware of this for iteration purposes.
+ *
+ * @param {string} classNames is a string representing the class name(s) to match; multiple class names are separated by (ASCII-)whitespace
+ *
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementsByClassName
+ * @see https://dom.spec.whatwg.org/#concept-getelementsbyclassname
+ */
+ getElementsByClassName: function(classNames) {
+ var classNamesSet = toOrderedSet(classNames)
+ return new LiveNodeList(this, function(base) {
+ var ls = [];
+ if (classNamesSet.length > 0) {
+ _visitNode(base.documentElement, function(node) {
+ if(node !== base && node.nodeType === ELEMENT_NODE) {
+ var nodeClassNames = node.getAttribute('class')
+ // can be null if the attribute does not exist
+ if (nodeClassNames) {
+ // before splitting and iterating just compare them for the most common case
+ var matches = classNames === nodeClassNames;
+ if (!matches) {
+ var nodeClassNamesSet = toOrderedSet(nodeClassNames)
+ matches = classNamesSet.every(arrayIncludes(nodeClassNamesSet))
+ }
+ if(matches) {
+ ls.push(node);
+ }
+ }
+ }
+ });
+ }
+ return ls;
+ });
+ },
+
+ //document factory method:
+ createElement : function(tagName){
+ var node = new Element();
+ node.ownerDocument = this;
+ node.nodeName = tagName;
+ node.tagName = tagName;
+ node.localName = tagName;
+ node.childNodes = new NodeList();
+ var attrs = node.attributes = new NamedNodeMap();
+ attrs._ownerElement = node;
+ return node;
+ },
+ createDocumentFragment : function(){
+ var node = new DocumentFragment();
+ node.ownerDocument = this;
+ node.childNodes = new NodeList();
+ return node;
+ },
+ createTextNode : function(data){
+ var node = new Text();
+ node.ownerDocument = this;
+ node.appendData(data)
+ return node;
+ },
+ createComment : function(data){
+ var node = new Comment();
+ node.ownerDocument = this;
+ node.appendData(data)
+ return node;
+ },
+ createCDATASection : function(data){
+ var node = new CDATASection();
+ node.ownerDocument = this;
+ node.appendData(data)
+ return node;
+ },
+ createProcessingInstruction : function(target,data){
+ var node = new ProcessingInstruction();
+ node.ownerDocument = this;
+ node.tagName = node.target = target;
+ node.nodeValue= node.data = data;
+ return node;
+ },
+ createAttribute : function(name){
+ var node = new Attr();
+ node.ownerDocument = this;
+ node.name = name;
+ node.nodeName = name;
+ node.localName = name;
+ node.specified = true;
+ return node;
+ },
+ createEntityReference : function(name){
+ var node = new EntityReference();
+ node.ownerDocument = this;
+ node.nodeName = name;
+ return node;
+ },
+ // Introduced in DOM Level 2:
+ createElementNS : function(namespaceURI,qualifiedName){
+ var node = new Element();
+ var pl = qualifiedName.split(':');
+ var attrs = node.attributes = new NamedNodeMap();
+ node.childNodes = new NodeList();
+ node.ownerDocument = this;
+ node.nodeName = qualifiedName;
+ node.tagName = qualifiedName;
+ node.namespaceURI = namespaceURI;
+ if(pl.length == 2){
+ node.prefix = pl[0];
+ node.localName = pl[1];
+ }else{
+ //el.prefix = null;
+ node.localName = qualifiedName;
+ }
+ attrs._ownerElement = node;
+ return node;
+ },
+ // Introduced in DOM Level 2:
+ createAttributeNS : function(namespaceURI,qualifiedName){
+ var node = new Attr();
+ var pl = qualifiedName.split(':');
+ node.ownerDocument = this;
+ node.nodeName = qualifiedName;
+ node.name = qualifiedName;
+ node.namespaceURI = namespaceURI;
+ node.specified = true;
+ if(pl.length == 2){
+ node.prefix = pl[0];
+ node.localName = pl[1];
+ }else{
+ //el.prefix = null;
+ node.localName = qualifiedName;
+ }
+ return node;
+ }
+};
+_extends(Document,Node);
+
+
+function Element() {
+ this._nsMap = {};
+};
+Element.prototype = {
+ nodeType : ELEMENT_NODE,
+ hasAttribute : function(name){
+ return this.getAttributeNode(name)!=null;
+ },
+ getAttribute : function(name){
+ var attr = this.getAttributeNode(name);
+ return attr && attr.value || '';
+ },
+ getAttributeNode : function(name){
+ return this.attributes.getNamedItem(name);
+ },
+ setAttribute : function(name, value){
+ var attr = this.ownerDocument.createAttribute(name);
+ attr.value = attr.nodeValue = "" + value;
+ this.setAttributeNode(attr)
+ },
+ removeAttribute : function(name){
+ var attr = this.getAttributeNode(name)
+ attr && this.removeAttributeNode(attr);
+ },
+
+ //four real opeartion method
+ appendChild:function(newChild){
+ if(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){
+ return this.insertBefore(newChild,null);
+ }else{
+ return _appendSingleChild(this,newChild);
+ }
+ },
+ setAttributeNode : function(newAttr){
+ return this.attributes.setNamedItem(newAttr);
+ },
+ setAttributeNodeNS : function(newAttr){
+ return this.attributes.setNamedItemNS(newAttr);
+ },
+ removeAttributeNode : function(oldAttr){
+ //console.log(this == oldAttr.ownerElement)
+ return this.attributes.removeNamedItem(oldAttr.nodeName);
+ },
+ //get real attribute name,and remove it by removeAttributeNode
+ removeAttributeNS : function(namespaceURI, localName){
+ var old = this.getAttributeNodeNS(namespaceURI, localName);
+ old && this.removeAttributeNode(old);
+ },
+
+ hasAttributeNS : function(namespaceURI, localName){
+ return this.getAttributeNodeNS(namespaceURI, localName)!=null;
+ },
+ getAttributeNS : function(namespaceURI, localName){
+ var attr = this.getAttributeNodeNS(namespaceURI, localName);
+ return attr && attr.value || '';
+ },
+ setAttributeNS : function(namespaceURI, qualifiedName, value){
+ var attr = this.ownerDocument.createAttributeNS(namespaceURI, qualifiedName);
+ attr.value = attr.nodeValue = "" + value;
+ this.setAttributeNode(attr)
+ },
+ getAttributeNodeNS : function(namespaceURI, localName){
+ return this.attributes.getNamedItemNS(namespaceURI, localName);
+ },
+
+ getElementsByTagName : function(tagName){
+ return new LiveNodeList(this,function(base){
+ var ls = [];
+ _visitNode(base,function(node){
+ if(node !== base && node.nodeType == ELEMENT_NODE && (tagName === '*' || node.tagName == tagName)){
+ ls.push(node);
+ }
+ });
+ return ls;
+ });
+ },
+ getElementsByTagNameNS : function(namespaceURI, localName){
+ return new LiveNodeList(this,function(base){
+ var ls = [];
+ _visitNode(base,function(node){
+ if(node !== base && node.nodeType === ELEMENT_NODE && (namespaceURI === '*' || node.namespaceURI === namespaceURI) && (localName === '*' || node.localName == localName)){
+ ls.push(node);
+ }
+ });
+ return ls;
+
+ });
+ }
+};
+Document.prototype.getElementsByTagName = Element.prototype.getElementsByTagName;
+Document.prototype.getElementsByTagNameNS = Element.prototype.getElementsByTagNameNS;
+
+
+_extends(Element,Node);
+function Attr() {
+};
+Attr.prototype.nodeType = ATTRIBUTE_NODE;
+_extends(Attr,Node);
+
+
+function CharacterData() {
+};
+CharacterData.prototype = {
+ data : '',
+ substringData : function(offset, count) {
+ return this.data.substring(offset, offset+count);
+ },
+ appendData: function(text) {
+ text = this.data+text;
+ this.nodeValue = this.data = text;
+ this.length = text.length;
+ },
+ insertData: function(offset,text) {
+ this.replaceData(offset,0,text);
+
+ },
+ appendChild:function(newChild){
+ throw new Error(ExceptionMessage[HIERARCHY_REQUEST_ERR])
+ },
+ deleteData: function(offset, count) {
+ this.replaceData(offset,count,"");
+ },
+ replaceData: function(offset, count, text) {
+ var start = this.data.substring(0,offset);
+ var end = this.data.substring(offset+count);
+ text = start + text + end;
+ this.nodeValue = this.data = text;
+ this.length = text.length;
+ }
+}
+_extends(CharacterData,Node);
+function Text() {
+};
+Text.prototype = {
+ nodeName : "#text",
+ nodeType : TEXT_NODE,
+ splitText : function(offset) {
+ var text = this.data;
+ var newText = text.substring(offset);
+ text = text.substring(0, offset);
+ this.data = this.nodeValue = text;
+ this.length = text.length;
+ var newNode = this.ownerDocument.createTextNode(newText);
+ if(this.parentNode){
+ this.parentNode.insertBefore(newNode, this.nextSibling);
+ }
+ return newNode;
+ }
+}
+_extends(Text,CharacterData);
+function Comment() {
+};
+Comment.prototype = {
+ nodeName : "#comment",
+ nodeType : COMMENT_NODE
+}
+_extends(Comment,CharacterData);
+
+function CDATASection() {
+};
+CDATASection.prototype = {
+ nodeName : "#cdata-section",
+ nodeType : CDATA_SECTION_NODE
+}
+_extends(CDATASection,CharacterData);
+
+
+function DocumentType() {
+};
+DocumentType.prototype.nodeType = DOCUMENT_TYPE_NODE;
+_extends(DocumentType,Node);
+
+function Notation() {
+};
+Notation.prototype.nodeType = NOTATION_NODE;
+_extends(Notation,Node);
+
+function Entity() {
+};
+Entity.prototype.nodeType = ENTITY_NODE;
+_extends(Entity,Node);
+
+function EntityReference() {
+};
+EntityReference.prototype.nodeType = ENTITY_REFERENCE_NODE;
+_extends(EntityReference,Node);
+
+function DocumentFragment() {
+};
+DocumentFragment.prototype.nodeName = "#document-fragment";
+DocumentFragment.prototype.nodeType = DOCUMENT_FRAGMENT_NODE;
+_extends(DocumentFragment,Node);
+
+
+function ProcessingInstruction() {
+}
+ProcessingInstruction.prototype.nodeType = PROCESSING_INSTRUCTION_NODE;
+_extends(ProcessingInstruction,Node);
+function XMLSerializer(){}
+XMLSerializer.prototype.serializeToString = function(node,isHtml,nodeFilter){
+ return nodeSerializeToString.call(node,isHtml,nodeFilter);
+}
+Node.prototype.toString = nodeSerializeToString;
+function nodeSerializeToString(isHtml,nodeFilter){
+ var buf = [];
+ var refNode = this.nodeType == 9 && this.documentElement || this;
+ var prefix = refNode.prefix;
+ var uri = refNode.namespaceURI;
+
+ if(uri && prefix == null){
+ //console.log(prefix)
+ var prefix = refNode.lookupPrefix(uri);
+ if(prefix == null){
+ //isHTML = true;
+ var visibleNamespaces=[
+ {namespace:uri,prefix:null}
+ //{namespace:uri,prefix:''}
+ ]
+ }
+ }
+ serializeToString(this,buf,isHtml,nodeFilter,visibleNamespaces);
+ //console.log('###',this.nodeType,uri,prefix,buf.join(''))
+ return buf.join('');
+}
+
+function needNamespaceDefine(node, isHTML, visibleNamespaces) {
+ var prefix = node.prefix || '';
+ var uri = node.namespaceURI;
+ // According to [Namespaces in XML 1.0](https://www.w3.org/TR/REC-xml-names/#ns-using) ,
+ // and more specifically https://www.w3.org/TR/REC-xml-names/#nsc-NoPrefixUndecl :
+ // > In a namespace declaration for a prefix [...], the attribute value MUST NOT be empty.
+ // in a similar manner [Namespaces in XML 1.1](https://www.w3.org/TR/xml-names11/#ns-using)
+ // and more specifically https://www.w3.org/TR/xml-names11/#nsc-NSDeclared :
+ // > [...] Furthermore, the attribute value [...] must not be an empty string.
+ // so serializing empty namespace value like xmlns:ds="" would produce an invalid XML document.
+ if (!uri) {
+ return false;
+ }
+ if (prefix === "xml" && uri === NAMESPACE.XML || uri === NAMESPACE.XMLNS) {
+ return false;
+ }
+
+ var i = visibleNamespaces.length
+ while (i--) {
+ var ns = visibleNamespaces[i];
+ // get namespace prefix
+ if (ns.prefix === prefix) {
+ return ns.namespace !== uri;
+ }
+ }
+ return true;
+}
+/**
+ * Well-formed constraint: No < in Attribute Values
+ * > The replacement text of any entity referred to directly or indirectly
+ * > in an attribute value must not contain a <.
+ * @see https://www.w3.org/TR/xml11/#CleanAttrVals
+ * @see https://www.w3.org/TR/xml11/#NT-AttValue
+ *
+ * Literal whitespace other than space that appear in attribute values
+ * are serialized as their entity references, so they will be preserved.
+ * (In contrast to whitespace literals in the input which are normalized to spaces)
+ * @see https://www.w3.org/TR/xml11/#AVNormalize
+ * @see https://w3c.github.io/DOM-Parsing/#serializing-an-element-s-attributes
+ */
+function addSerializedAttribute(buf, qualifiedName, value) {
+ buf.push(' ', qualifiedName, '="', value.replace(/[<>&"\t\n\r]/g, _xmlEncoder), '"')
+}
+
+function serializeToString(node,buf,isHTML,nodeFilter,visibleNamespaces){
+ if (!visibleNamespaces) {
+ visibleNamespaces = [];
+ }
+
+ if(nodeFilter){
+ node = nodeFilter(node);
+ if(node){
+ if(typeof node == 'string'){
+ buf.push(node);
+ return;
+ }
+ }else{
+ return;
+ }
+ //buf.sort.apply(attrs, attributeSorter);
+ }
+
+ switch(node.nodeType){
+ case ELEMENT_NODE:
+ var attrs = node.attributes;
+ var len = attrs.length;
+ var child = node.firstChild;
+ var nodeName = node.tagName;
+
+ isHTML = NAMESPACE.isHTML(node.namespaceURI) || isHTML
+
+ var prefixedNodeName = nodeName
+ if (!isHTML && !node.prefix && node.namespaceURI) {
+ var defaultNS
+ // lookup current default ns from `xmlns` attribute
+ for (var ai = 0; ai < attrs.length; ai++) {
+ if (attrs.item(ai).name === 'xmlns') {
+ defaultNS = attrs.item(ai).value
+ break
+ }
+ }
+ if (!defaultNS) {
+ // lookup current default ns in visibleNamespaces
+ for (var nsi = visibleNamespaces.length - 1; nsi >= 0; nsi--) {
+ var namespace = visibleNamespaces[nsi]
+ if (namespace.prefix === '' && namespace.namespace === node.namespaceURI) {
+ defaultNS = namespace.namespace
+ break
+ }
+ }
+ }
+ if (defaultNS !== node.namespaceURI) {
+ for (var nsi = visibleNamespaces.length - 1; nsi >= 0; nsi--) {
+ var namespace = visibleNamespaces[nsi]
+ if (namespace.namespace === node.namespaceURI) {
+ if (namespace.prefix) {
+ prefixedNodeName = namespace.prefix + ':' + nodeName
+ }
+ break
+ }
+ }
+ }
+ }
+
+ buf.push('<', prefixedNodeName);
+
+ for(var i=0;i<len;i++){
+ // add namespaces for attributes
+ var attr = attrs.item(i);
+ if (attr.prefix == 'xmlns') {
+ visibleNamespaces.push({ prefix: attr.localName, namespace: attr.value });
+ }else if(attr.nodeName == 'xmlns'){
+ visibleNamespaces.push({ prefix: '', namespace: attr.value });
+ }
+ }
+
+ for(var i=0;i<len;i++){
+ var attr = attrs.item(i);
+ if (needNamespaceDefine(attr,isHTML, visibleNamespaces)) {
+ var prefix = attr.prefix||'';
+ var uri = attr.namespaceURI;
+ addSerializedAttribute(buf, prefix ? 'xmlns:' + prefix : "xmlns", uri);
+ visibleNamespaces.push({ prefix: prefix, namespace:uri });
+ }
+ serializeToString(attr,buf,isHTML,nodeFilter,visibleNamespaces);
+ }
+
+ // add namespace for current node
+ if (nodeName === prefixedNodeName && needNamespaceDefine(node, isHTML, visibleNamespaces)) {
+ var prefix = node.prefix||'';
+ var uri = node.namespaceURI;
+ addSerializedAttribute(buf, prefix ? 'xmlns:' + prefix : "xmlns", uri);
+ visibleNamespaces.push({ prefix: prefix, namespace:uri });
+ }
+
+ if(child || isHTML && !/^(?:meta|link|img|br|hr|input)$/i.test(nodeName)){
+ buf.push('>');
+ //if is cdata child node
+ if(isHTML && /^script$/i.test(nodeName)){
+ while(child){
+ if(child.data){
+ buf.push(child.data);
+ }else{
+ serializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());
+ }
+ child = child.nextSibling;
+ }
+ }else
+ {
+ while(child){
+ serializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());
+ child = child.nextSibling;
+ }
+ }
+ buf.push('</',prefixedNodeName,'>');
+ }else{
+ buf.push('/>');
+ }
+ // remove added visible namespaces
+ //visibleNamespaces.length = startVisibleNamespaces;
+ return;
+ case DOCUMENT_NODE:
+ case DOCUMENT_FRAGMENT_NODE:
+ var child = node.firstChild;
+ while(child){
+ serializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());
+ child = child.nextSibling;
+ }
+ return;
+ case ATTRIBUTE_NODE:
+ return addSerializedAttribute(buf, node.name, node.value);
+ case TEXT_NODE:
+ /**
+ * The ampersand character (&) and the left angle bracket (<) must not appear in their literal form,
+ * except when used as markup delimiters, or within a comment, a processing instruction, or a CDATA section.
+ * If they are needed elsewhere, they must be escaped using either numeric character references or the strings
+ * `&amp;` and `&lt;` respectively.
+ * The right angle bracket (>) may be represented using the string " &gt; ", and must, for compatibility,
+ * be escaped using either `&gt;` or a character reference when it appears in the string `]]>` in content,
+ * when that string is not marking the end of a CDATA section.
+ *
+ * In the content of elements, character data is any string of characters
+ * which does not contain the start-delimiter of any markup
+ * and does not include the CDATA-section-close delimiter, `]]>`.
+ *
+ * @see https://www.w3.org/TR/xml/#NT-CharData
+ * @see https://w3c.github.io/DOM-Parsing/#xml-serializing-a-text-node
+ */
+ return buf.push(node.data
+ .replace(/[<&>]/g,_xmlEncoder)
+ );
+ case CDATA_SECTION_NODE:
+ return buf.push( '<![CDATA[',node.data,']]>');
+ case COMMENT_NODE:
+ return buf.push( "<!--",node.data,"-->");
+ case DOCUMENT_TYPE_NODE:
+ var pubid = node.publicId;
+ var sysid = node.systemId;
+ buf.push('<!DOCTYPE ',node.name);
+ if(pubid){
+ buf.push(' PUBLIC ', pubid);
+ if (sysid && sysid!='.') {
+ buf.push(' ', sysid);
+ }
+ buf.push('>');
+ }else if(sysid && sysid!='.'){
+ buf.push(' SYSTEM ', sysid, '>');
+ }else{
+ var sub = node.internalSubset;
+ if(sub){
+ buf.push(" [",sub,"]");
+ }
+ buf.push(">");
+ }
+ return;
+ case PROCESSING_INSTRUCTION_NODE:
+ return buf.push( "<?",node.target," ",node.data,"?>");
+ case ENTITY_REFERENCE_NODE:
+ return buf.push( '&',node.nodeName,';');
+ //case ENTITY_NODE:
+ //case NOTATION_NODE:
+ default:
+ buf.push('??',node.nodeName);
+ }
+}
+function importNode(doc,node,deep){
+ var node2;
+ switch (node.nodeType) {
+ case ELEMENT_NODE:
+ node2 = node.cloneNode(false);
+ node2.ownerDocument = doc;
+ //var attrs = node2.attributes;
+ //var len = attrs.length;
+ //for(var i=0;i<len;i++){
+ //node2.setAttributeNodeNS(importNode(doc,attrs.item(i),deep));
+ //}
+ case DOCUMENT_FRAGMENT_NODE:
+ break;
+ case ATTRIBUTE_NODE:
+ deep = true;
+ break;
+ //case ENTITY_REFERENCE_NODE:
+ //case PROCESSING_INSTRUCTION_NODE:
+ ////case TEXT_NODE:
+ //case CDATA_SECTION_NODE:
+ //case COMMENT_NODE:
+ // deep = false;
+ // break;
+ //case DOCUMENT_NODE:
+ //case DOCUMENT_TYPE_NODE:
+ //cannot be imported.
+ //case ENTITY_NODE:
+ //case NOTATION_NODE:
+ //can not hit in level3
+ //default:throw e;
+ }
+ if(!node2){
+ node2 = node.cloneNode(false);//false
+ }
+ node2.ownerDocument = doc;
+ node2.parentNode = null;
+ if(deep){
+ var child = node.firstChild;
+ while(child){
+ node2.appendChild(importNode(doc,child,deep));
+ child = child.nextSibling;
+ }
+ }
+ return node2;
+}
+//
+//var _relationMap = {firstChild:1,lastChild:1,previousSibling:1,nextSibling:1,
+// attributes:1,childNodes:1,parentNode:1,documentElement:1,doctype,};
+function cloneNode(doc,node,deep){
+ var node2 = new node.constructor();
+ for (var n in node) {
+ if (Object.prototype.hasOwnProperty.call(node, n)) {
+ var v = node[n];
+ if (typeof v != "object") {
+ if (v != node2[n]) {
+ node2[n] = v;
+ }
+ }
+ }
+ }
+ if(node.childNodes){
+ node2.childNodes = new NodeList();
+ }
+ node2.ownerDocument = doc;
+ switch (node2.nodeType) {
+ case ELEMENT_NODE:
+ var attrs = node.attributes;
+ var attrs2 = node2.attributes = new NamedNodeMap();
+ var len = attrs.length
+ attrs2._ownerElement = node2;
+ for(var i=0;i<len;i++){
+ node2.setAttributeNode(cloneNode(doc,attrs.item(i),true));
+ }
+ break;;
+ case ATTRIBUTE_NODE:
+ deep = true;
+ }
+ if(deep){
+ var child = node.firstChild;
+ while(child){
+ node2.appendChild(cloneNode(doc,child,deep));
+ child = child.nextSibling;
+ }
+ }
+ return node2;
+}
+
+function __set__(object,key,value){
+ object[key] = value
+}
+//do dynamic
+try{
+ if(Object.defineProperty){
+ Object.defineProperty(LiveNodeList.prototype,'length',{
+ get:function(){
+ _updateLiveList(this);
+ return this.$$length;
+ }
+ });
+
+ Object.defineProperty(Node.prototype,'textContent',{
+ get:function(){
+ return getTextContent(this);
+ },
+
+ set:function(data){
+ switch(this.nodeType){
+ case ELEMENT_NODE:
+ case DOCUMENT_FRAGMENT_NODE:
+ while(this.firstChild){
+ this.removeChild(this.firstChild);
+ }
+ if(data || String(data)){
+ this.appendChild(this.ownerDocument.createTextNode(data));
+ }
+ break;
+
+ default:
+ this.data = data;
+ this.value = data;
+ this.nodeValue = data;
+ }
+ }
+ })
+
+ function getTextContent(node){
+ switch(node.nodeType){
+ case ELEMENT_NODE:
+ case DOCUMENT_FRAGMENT_NODE:
+ var buf = [];
+ node = node.firstChild;
+ while(node){
+ if(node.nodeType!==7 && node.nodeType !==8){
+ buf.push(getTextContent(node));
+ }
+ node = node.nextSibling;
+ }
+ return buf.join('');
+ default:
+ return node.nodeValue;
+ }
+ }
+
+ __set__ = function(object,key,value){
+ //console.log(value)
+ object['$$'+key] = value
+ }
+ }
+}catch(e){//ie8
+}
+
+//if(typeof require == 'function'){
+ exports.DocumentType = DocumentType;
+ exports.DOMException = DOMException;
+ exports.DOMImplementation = DOMImplementation;
+ exports.Element = Element;
+ exports.Node = Node;
+ exports.NodeList = NodeList;
+ exports.XMLSerializer = XMLSerializer;
+//}
+
+},{"./conventions":2}],5:[function(require,module,exports){
+'use strict';
+
+var freeze = require('./conventions').freeze;
+
+/**
+ * The entities that are predefined in every XML document.
+ *
+ * @see https://www.w3.org/TR/2006/REC-xml11-20060816/#sec-predefined-ent W3C XML 1.1
+ * @see https://www.w3.org/TR/2008/REC-xml-20081126/#sec-predefined-ent W3C XML 1.0
+ * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Predefined_entities_in_XML Wikipedia
+ */
+exports.XML_ENTITIES = freeze({
+ amp: '&',
+ apos: "'",
+ gt: '>',
+ lt: '<',
+ quot: '"',
+});
+
+/**
+ * A map of all entities that are detected in an HTML document.
+ * They contain all entries from `XML_ENTITIES`.
+ *
+ * @see XML_ENTITIES
+ * @see DOMParser.parseFromString
+ * @see DOMImplementation.prototype.createHTMLDocument
+ * @see https://html.spec.whatwg.org/#named-character-references WHATWG HTML(5) Spec
+ * @see https://html.spec.whatwg.org/entities.json JSON
+ * @see https://www.w3.org/TR/xml-entity-names/ W3C XML Entity Names
+ * @see https://www.w3.org/TR/html4/sgml/entities.html W3C HTML4/SGML
+ * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Character_entity_references_in_HTML Wikipedia (HTML)
+ * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Entities_representing_special_characters_in_XHTML Wikpedia (XHTML)
+ */
+exports.HTML_ENTITIES = freeze({
+ Aacute: '\u00C1',
+ aacute: '\u00E1',
+ Abreve: '\u0102',
+ abreve: '\u0103',
+ ac: '\u223E',
+ acd: '\u223F',
+ acE: '\u223E\u0333',
+ Acirc: '\u00C2',
+ acirc: '\u00E2',
+ acute: '\u00B4',
+ Acy: '\u0410',
+ acy: '\u0430',
+ AElig: '\u00C6',
+ aelig: '\u00E6',
+ af: '\u2061',
+ Afr: '\uD835\uDD04',
+ afr: '\uD835\uDD1E',
+ Agrave: '\u00C0',
+ agrave: '\u00E0',
+ alefsym: '\u2135',
+ aleph: '\u2135',
+ Alpha: '\u0391',
+ alpha: '\u03B1',
+ Amacr: '\u0100',
+ amacr: '\u0101',
+ amalg: '\u2A3F',
+ AMP: '\u0026',
+ amp: '\u0026',
+ And: '\u2A53',
+ and: '\u2227',
+ andand: '\u2A55',
+ andd: '\u2A5C',
+ andslope: '\u2A58',
+ andv: '\u2A5A',
+ ang: '\u2220',
+ ange: '\u29A4',
+ angle: '\u2220',
+ angmsd: '\u2221',
+ angmsdaa: '\u29A8',
+ angmsdab: '\u29A9',
+ angmsdac: '\u29AA',
+ angmsdad: '\u29AB',
+ angmsdae: '\u29AC',
+ angmsdaf: '\u29AD',
+ angmsdag: '\u29AE',
+ angmsdah: '\u29AF',
+ angrt: '\u221F',
+ angrtvb: '\u22BE',
+ angrtvbd: '\u299D',
+ angsph: '\u2222',
+ angst: '\u00C5',
+ angzarr: '\u237C',
+ Aogon: '\u0104',
+ aogon: '\u0105',
+ Aopf: '\uD835\uDD38',
+ aopf: '\uD835\uDD52',
+ ap: '\u2248',
+ apacir: '\u2A6F',
+ apE: '\u2A70',
+ ape: '\u224A',
+ apid: '\u224B',
+ apos: '\u0027',
+ ApplyFunction: '\u2061',
+ approx: '\u2248',
+ approxeq: '\u224A',
+ Aring: '\u00C5',
+ aring: '\u00E5',
+ Ascr: '\uD835\uDC9C',
+ ascr: '\uD835\uDCB6',
+ Assign: '\u2254',
+ ast: '\u002A',
+ asymp: '\u2248',
+ asympeq: '\u224D',
+ Atilde: '\u00C3',
+ atilde: '\u00E3',
+ Auml: '\u00C4',
+ auml: '\u00E4',
+ awconint: '\u2233',
+ awint: '\u2A11',
+ backcong: '\u224C',
+ backepsilon: '\u03F6',
+ backprime: '\u2035',
+ backsim: '\u223D',
+ backsimeq: '\u22CD',
+ Backslash: '\u2216',
+ Barv: '\u2AE7',
+ barvee: '\u22BD',
+ Barwed: '\u2306',
+ barwed: '\u2305',
+ barwedge: '\u2305',
+ bbrk: '\u23B5',
+ bbrktbrk: '\u23B6',
+ bcong: '\u224C',
+ Bcy: '\u0411',
+ bcy: '\u0431',
+ bdquo: '\u201E',
+ becaus: '\u2235',
+ Because: '\u2235',
+ because: '\u2235',
+ bemptyv: '\u29B0',
+ bepsi: '\u03F6',
+ bernou: '\u212C',
+ Bernoullis: '\u212C',
+ Beta: '\u0392',
+ beta: '\u03B2',
+ beth: '\u2136',
+ between: '\u226C',
+ Bfr: '\uD835\uDD05',
+ bfr: '\uD835\uDD1F',
+ bigcap: '\u22C2',
+ bigcirc: '\u25EF',
+ bigcup: '\u22C3',
+ bigodot: '\u2A00',
+ bigoplus: '\u2A01',
+ bigotimes: '\u2A02',
+ bigsqcup: '\u2A06',
+ bigstar: '\u2605',
+ bigtriangledown: '\u25BD',
+ bigtriangleup: '\u25B3',
+ biguplus: '\u2A04',
+ bigvee: '\u22C1',
+ bigwedge: '\u22C0',
+ bkarow: '\u290D',
+ blacklozenge: '\u29EB',
+ blacksquare: '\u25AA',
+ blacktriangle: '\u25B4',
+ blacktriangledown: '\u25BE',
+ blacktriangleleft: '\u25C2',
+ blacktriangleright: '\u25B8',
+ blank: '\u2423',
+ blk12: '\u2592',
+ blk14: '\u2591',
+ blk34: '\u2593',
+ block: '\u2588',
+ bne: '\u003D\u20E5',
+ bnequiv: '\u2261\u20E5',
+ bNot: '\u2AED',
+ bnot: '\u2310',
+ Bopf: '\uD835\uDD39',
+ bopf: '\uD835\uDD53',
+ bot: '\u22A5',
+ bottom: '\u22A5',
+ bowtie: '\u22C8',
+ boxbox: '\u29C9',
+ boxDL: '\u2557',
+ boxDl: '\u2556',
+ boxdL: '\u2555',
+ boxdl: '\u2510',
+ boxDR: '\u2554',
+ boxDr: '\u2553',
+ boxdR: '\u2552',
+ boxdr: '\u250C',
+ boxH: '\u2550',
+ boxh: '\u2500',
+ boxHD: '\u2566',
+ boxHd: '\u2564',
+ boxhD: '\u2565',
+ boxhd: '\u252C',
+ boxHU: '\u2569',
+ boxHu: '\u2567',
+ boxhU: '\u2568',
+ boxhu: '\u2534',
+ boxminus: '\u229F',
+ boxplus: '\u229E',
+ boxtimes: '\u22A0',
+ boxUL: '\u255D',
+ boxUl: '\u255C',
+ boxuL: '\u255B',
+ boxul: '\u2518',
+ boxUR: '\u255A',
+ boxUr: '\u2559',
+ boxuR: '\u2558',
+ boxur: '\u2514',
+ boxV: '\u2551',
+ boxv: '\u2502',
+ boxVH: '\u256C',
+ boxVh: '\u256B',
+ boxvH: '\u256A',
+ boxvh: '\u253C',
+ boxVL: '\u2563',
+ boxVl: '\u2562',
+ boxvL: '\u2561',
+ boxvl: '\u2524',
+ boxVR: '\u2560',
+ boxVr: '\u255F',
+ boxvR: '\u255E',
+ boxvr: '\u251C',
+ bprime: '\u2035',
+ Breve: '\u02D8',
+ breve: '\u02D8',
+ brvbar: '\u00A6',
+ Bscr: '\u212C',
+ bscr: '\uD835\uDCB7',
+ bsemi: '\u204F',
+ bsim: '\u223D',
+ bsime: '\u22CD',
+ bsol: '\u005C',
+ bsolb: '\u29C5',
+ bsolhsub: '\u27C8',
+ bull: '\u2022',
+ bullet: '\u2022',
+ bump: '\u224E',
+ bumpE: '\u2AAE',
+ bumpe: '\u224F',
+ Bumpeq: '\u224E',
+ bumpeq: '\u224F',
+ Cacute: '\u0106',
+ cacute: '\u0107',
+ Cap: '\u22D2',
+ cap: '\u2229',
+ capand: '\u2A44',
+ capbrcup: '\u2A49',
+ capcap: '\u2A4B',
+ capcup: '\u2A47',
+ capdot: '\u2A40',
+ CapitalDifferentialD: '\u2145',
+ caps: '\u2229\uFE00',
+ caret: '\u2041',
+ caron: '\u02C7',
+ Cayleys: '\u212D',
+ ccaps: '\u2A4D',
+ Ccaron: '\u010C',
+ ccaron: '\u010D',
+ Ccedil: '\u00C7',
+ ccedil: '\u00E7',
+ Ccirc: '\u0108',
+ ccirc: '\u0109',
+ Cconint: '\u2230',
+ ccups: '\u2A4C',
+ ccupssm: '\u2A50',
+ Cdot: '\u010A',
+ cdot: '\u010B',
+ cedil: '\u00B8',
+ Cedilla: '\u00B8',
+ cemptyv: '\u29B2',
+ cent: '\u00A2',
+ CenterDot: '\u00B7',
+ centerdot: '\u00B7',
+ Cfr: '\u212D',
+ cfr: '\uD835\uDD20',
+ CHcy: '\u0427',
+ chcy: '\u0447',
+ check: '\u2713',
+ checkmark: '\u2713',
+ Chi: '\u03A7',
+ chi: '\u03C7',
+ cir: '\u25CB',
+ circ: '\u02C6',
+ circeq: '\u2257',
+ circlearrowleft: '\u21BA',
+ circlearrowright: '\u21BB',
+ circledast: '\u229B',
+ circledcirc: '\u229A',
+ circleddash: '\u229D',
+ CircleDot: '\u2299',
+ circledR: '\u00AE',
+ circledS: '\u24C8',
+ CircleMinus: '\u2296',
+ CirclePlus: '\u2295',
+ CircleTimes: '\u2297',
+ cirE: '\u29C3',
+ cire: '\u2257',
+ cirfnint: '\u2A10',
+ cirmid: '\u2AEF',
+ cirscir: '\u29C2',
+ ClockwiseContourIntegral: '\u2232',
+ CloseCurlyDoubleQuote: '\u201D',
+ CloseCurlyQuote: '\u2019',
+ clubs: '\u2663',
+ clubsuit: '\u2663',
+ Colon: '\u2237',
+ colon: '\u003A',
+ Colone: '\u2A74',
+ colone: '\u2254',
+ coloneq: '\u2254',
+ comma: '\u002C',
+ commat: '\u0040',
+ comp: '\u2201',
+ compfn: '\u2218',
+ complement: '\u2201',
+ complexes: '\u2102',
+ cong: '\u2245',
+ congdot: '\u2A6D',
+ Congruent: '\u2261',
+ Conint: '\u222F',
+ conint: '\u222E',
+ ContourIntegral: '\u222E',
+ Copf: '\u2102',
+ copf: '\uD835\uDD54',
+ coprod: '\u2210',
+ Coproduct: '\u2210',
+ COPY: '\u00A9',
+ copy: '\u00A9',
+ copysr: '\u2117',
+ CounterClockwiseContourIntegral: '\u2233',
+ crarr: '\u21B5',
+ Cross: '\u2A2F',
+ cross: '\u2717',
+ Cscr: '\uD835\uDC9E',
+ cscr: '\uD835\uDCB8',
+ csub: '\u2ACF',
+ csube: '\u2AD1',
+ csup: '\u2AD0',
+ csupe: '\u2AD2',
+ ctdot: '\u22EF',
+ cudarrl: '\u2938',
+ cudarrr: '\u2935',
+ cuepr: '\u22DE',
+ cuesc: '\u22DF',
+ cularr: '\u21B6',
+ cularrp: '\u293D',
+ Cup: '\u22D3',
+ cup: '\u222A',
+ cupbrcap: '\u2A48',
+ CupCap: '\u224D',
+ cupcap: '\u2A46',
+ cupcup: '\u2A4A',
+ cupdot: '\u228D',
+ cupor: '\u2A45',
+ cups: '\u222A\uFE00',
+ curarr: '\u21B7',
+ curarrm: '\u293C',
+ curlyeqprec: '\u22DE',
+ curlyeqsucc: '\u22DF',
+ curlyvee: '\u22CE',
+ curlywedge: '\u22CF',
+ curren: '\u00A4',
+ curvearrowleft: '\u21B6',
+ curvearrowright: '\u21B7',
+ cuvee: '\u22CE',
+ cuwed: '\u22CF',
+ cwconint: '\u2232',
+ cwint: '\u2231',
+ cylcty: '\u232D',
+ Dagger: '\u2021',
+ dagger: '\u2020',
+ daleth: '\u2138',
+ Darr: '\u21A1',
+ dArr: '\u21D3',
+ darr: '\u2193',
+ dash: '\u2010',
+ Dashv: '\u2AE4',
+ dashv: '\u22A3',
+ dbkarow: '\u290F',
+ dblac: '\u02DD',
+ Dcaron: '\u010E',
+ dcaron: '\u010F',
+ Dcy: '\u0414',
+ dcy: '\u0434',
+ DD: '\u2145',
+ dd: '\u2146',
+ ddagger: '\u2021',
+ ddarr: '\u21CA',
+ DDotrahd: '\u2911',
+ ddotseq: '\u2A77',
+ deg: '\u00B0',
+ Del: '\u2207',
+ Delta: '\u0394',
+ delta: '\u03B4',
+ demptyv: '\u29B1',
+ dfisht: '\u297F',
+ Dfr: '\uD835\uDD07',
+ dfr: '\uD835\uDD21',
+ dHar: '\u2965',
+ dharl: '\u21C3',
+ dharr: '\u21C2',
+ DiacriticalAcute: '\u00B4',
+ DiacriticalDot: '\u02D9',
+ DiacriticalDoubleAcute: '\u02DD',
+ DiacriticalGrave: '\u0060',
+ DiacriticalTilde: '\u02DC',
+ diam: '\u22C4',
+ Diamond: '\u22C4',
+ diamond: '\u22C4',
+ diamondsuit: '\u2666',
+ diams: '\u2666',
+ die: '\u00A8',
+ DifferentialD: '\u2146',
+ digamma: '\u03DD',
+ disin: '\u22F2',
+ div: '\u00F7',
+ divide: '\u00F7',
+ divideontimes: '\u22C7',
+ divonx: '\u22C7',
+ DJcy: '\u0402',
+ djcy: '\u0452',
+ dlcorn: '\u231E',
+ dlcrop: '\u230D',
+ dollar: '\u0024',
+ Dopf: '\uD835\uDD3B',
+ dopf: '\uD835\uDD55',
+ Dot: '\u00A8',
+ dot: '\u02D9',
+ DotDot: '\u20DC',
+ doteq: '\u2250',
+ doteqdot: '\u2251',
+ DotEqual: '\u2250',
+ dotminus: '\u2238',
+ dotplus: '\u2214',
+ dotsquare: '\u22A1',
+ doublebarwedge: '\u2306',
+ DoubleContourIntegral: '\u222F',
+ DoubleDot: '\u00A8',
+ DoubleDownArrow: '\u21D3',
+ DoubleLeftArrow: '\u21D0',
+ DoubleLeftRightArrow: '\u21D4',
+ DoubleLeftTee: '\u2AE4',
+ DoubleLongLeftArrow: '\u27F8',
+ DoubleLongLeftRightArrow: '\u27FA',
+ DoubleLongRightArrow: '\u27F9',
+ DoubleRightArrow: '\u21D2',
+ DoubleRightTee: '\u22A8',
+ DoubleUpArrow: '\u21D1',
+ DoubleUpDownArrow: '\u21D5',
+ DoubleVerticalBar: '\u2225',
+ DownArrow: '\u2193',
+ Downarrow: '\u21D3',
+ downarrow: '\u2193',
+ DownArrowBar: '\u2913',
+ DownArrowUpArrow: '\u21F5',
+ DownBreve: '\u0311',
+ downdownarrows: '\u21CA',
+ downharpoonleft: '\u21C3',
+ downharpoonright: '\u21C2',
+ DownLeftRightVector: '\u2950',
+ DownLeftTeeVector: '\u295E',
+ DownLeftVector: '\u21BD',
+ DownLeftVectorBar: '\u2956',
+ DownRightTeeVector: '\u295F',
+ DownRightVector: '\u21C1',
+ DownRightVectorBar: '\u2957',
+ DownTee: '\u22A4',
+ DownTeeArrow: '\u21A7',
+ drbkarow: '\u2910',
+ drcorn: '\u231F',
+ drcrop: '\u230C',
+ Dscr: '\uD835\uDC9F',
+ dscr: '\uD835\uDCB9',
+ DScy: '\u0405',
+ dscy: '\u0455',
+ dsol: '\u29F6',
+ Dstrok: '\u0110',
+ dstrok: '\u0111',
+ dtdot: '\u22F1',
+ dtri: '\u25BF',
+ dtrif: '\u25BE',
+ duarr: '\u21F5',
+ duhar: '\u296F',
+ dwangle: '\u29A6',
+ DZcy: '\u040F',
+ dzcy: '\u045F',
+ dzigrarr: '\u27FF',
+ Eacute: '\u00C9',
+ eacute: '\u00E9',
+ easter: '\u2A6E',
+ Ecaron: '\u011A',
+ ecaron: '\u011B',
+ ecir: '\u2256',
+ Ecirc: '\u00CA',
+ ecirc: '\u00EA',
+ ecolon: '\u2255',
+ Ecy: '\u042D',
+ ecy: '\u044D',
+ eDDot: '\u2A77',
+ Edot: '\u0116',
+ eDot: '\u2251',
+ edot: '\u0117',
+ ee: '\u2147',
+ efDot: '\u2252',
+ Efr: '\uD835\uDD08',
+ efr: '\uD835\uDD22',
+ eg: '\u2A9A',
+ Egrave: '\u00C8',
+ egrave: '\u00E8',
+ egs: '\u2A96',
+ egsdot: '\u2A98',
+ el: '\u2A99',
+ Element: '\u2208',
+ elinters: '\u23E7',
+ ell: '\u2113',
+ els: '\u2A95',
+ elsdot: '\u2A97',
+ Emacr: '\u0112',
+ emacr: '\u0113',
+ empty: '\u2205',
+ emptyset: '\u2205',
+ EmptySmallSquare: '\u25FB',
+ emptyv: '\u2205',
+ EmptyVerySmallSquare: '\u25AB',
+ emsp: '\u2003',
+ emsp13: '\u2004',
+ emsp14: '\u2005',
+ ENG: '\u014A',
+ eng: '\u014B',
+ ensp: '\u2002',
+ Eogon: '\u0118',
+ eogon: '\u0119',
+ Eopf: '\uD835\uDD3C',
+ eopf: '\uD835\uDD56',
+ epar: '\u22D5',
+ eparsl: '\u29E3',
+ eplus: '\u2A71',
+ epsi: '\u03B5',
+ Epsilon: '\u0395',
+ epsilon: '\u03B5',
+ epsiv: '\u03F5',
+ eqcirc: '\u2256',
+ eqcolon: '\u2255',
+ eqsim: '\u2242',
+ eqslantgtr: '\u2A96',
+ eqslantless: '\u2A95',
+ Equal: '\u2A75',
+ equals: '\u003D',
+ EqualTilde: '\u2242',
+ equest: '\u225F',
+ Equilibrium: '\u21CC',
+ equiv: '\u2261',
+ equivDD: '\u2A78',
+ eqvparsl: '\u29E5',
+ erarr: '\u2971',
+ erDot: '\u2253',
+ Escr: '\u2130',
+ escr: '\u212F',
+ esdot: '\u2250',
+ Esim: '\u2A73',
+ esim: '\u2242',
+ Eta: '\u0397',
+ eta: '\u03B7',
+ ETH: '\u00D0',
+ eth: '\u00F0',
+ Euml: '\u00CB',
+ euml: '\u00EB',
+ euro: '\u20AC',
+ excl: '\u0021',
+ exist: '\u2203',
+ Exists: '\u2203',
+ expectation: '\u2130',
+ ExponentialE: '\u2147',
+ exponentiale: '\u2147',
+ fallingdotseq: '\u2252',
+ Fcy: '\u0424',
+ fcy: '\u0444',
+ female: '\u2640',
+ ffilig: '\uFB03',
+ fflig: '\uFB00',
+ ffllig: '\uFB04',
+ Ffr: '\uD835\uDD09',
+ ffr: '\uD835\uDD23',
+ filig: '\uFB01',
+ FilledSmallSquare: '\u25FC',
+ FilledVerySmallSquare: '\u25AA',
+ fjlig: '\u0066\u006A',
+ flat: '\u266D',
+ fllig: '\uFB02',
+ fltns: '\u25B1',
+ fnof: '\u0192',
+ Fopf: '\uD835\uDD3D',
+ fopf: '\uD835\uDD57',
+ ForAll: '\u2200',
+ forall: '\u2200',
+ fork: '\u22D4',
+ forkv: '\u2AD9',
+ Fouriertrf: '\u2131',
+ fpartint: '\u2A0D',
+ frac12: '\u00BD',
+ frac13: '\u2153',
+ frac14: '\u00BC',
+ frac15: '\u2155',
+ frac16: '\u2159',
+ frac18: '\u215B',
+ frac23: '\u2154',
+ frac25: '\u2156',
+ frac34: '\u00BE',
+ frac35: '\u2157',
+ frac38: '\u215C',
+ frac45: '\u2158',
+ frac56: '\u215A',
+ frac58: '\u215D',
+ frac78: '\u215E',
+ frasl: '\u2044',
+ frown: '\u2322',
+ Fscr: '\u2131',
+ fscr: '\uD835\uDCBB',
+ gacute: '\u01F5',
+ Gamma: '\u0393',
+ gamma: '\u03B3',
+ Gammad: '\u03DC',
+ gammad: '\u03DD',
+ gap: '\u2A86',
+ Gbreve: '\u011E',
+ gbreve: '\u011F',
+ Gcedil: '\u0122',
+ Gcirc: '\u011C',
+ gcirc: '\u011D',
+ Gcy: '\u0413',
+ gcy: '\u0433',
+ Gdot: '\u0120',
+ gdot: '\u0121',
+ gE: '\u2267',
+ ge: '\u2265',
+ gEl: '\u2A8C',
+ gel: '\u22DB',
+ geq: '\u2265',
+ geqq: '\u2267',
+ geqslant: '\u2A7E',
+ ges: '\u2A7E',
+ gescc: '\u2AA9',
+ gesdot: '\u2A80',
+ gesdoto: '\u2A82',
+ gesdotol: '\u2A84',
+ gesl: '\u22DB\uFE00',
+ gesles: '\u2A94',
+ Gfr: '\uD835\uDD0A',
+ gfr: '\uD835\uDD24',
+ Gg: '\u22D9',
+ gg: '\u226B',
+ ggg: '\u22D9',
+ gimel: '\u2137',
+ GJcy: '\u0403',
+ gjcy: '\u0453',
+ gl: '\u2277',
+ gla: '\u2AA5',
+ glE: '\u2A92',
+ glj: '\u2AA4',
+ gnap: '\u2A8A',
+ gnapprox: '\u2A8A',
+ gnE: '\u2269',
+ gne: '\u2A88',
+ gneq: '\u2A88',
+ gneqq: '\u2269',
+ gnsim: '\u22E7',
+ Gopf: '\uD835\uDD3E',
+ gopf: '\uD835\uDD58',
+ grave: '\u0060',
+ GreaterEqual: '\u2265',
+ GreaterEqualLess: '\u22DB',
+ GreaterFullEqual: '\u2267',
+ GreaterGreater: '\u2AA2',
+ GreaterLess: '\u2277',
+ GreaterSlantEqual: '\u2A7E',
+ GreaterTilde: '\u2273',
+ Gscr: '\uD835\uDCA2',
+ gscr: '\u210A',
+ gsim: '\u2273',
+ gsime: '\u2A8E',
+ gsiml: '\u2A90',
+ Gt: '\u226B',
+ GT: '\u003E',
+ gt: '\u003E',
+ gtcc: '\u2AA7',
+ gtcir: '\u2A7A',
+ gtdot: '\u22D7',
+ gtlPar: '\u2995',
+ gtquest: '\u2A7C',
+ gtrapprox: '\u2A86',
+ gtrarr: '\u2978',
+ gtrdot: '\u22D7',
+ gtreqless: '\u22DB',
+ gtreqqless: '\u2A8C',
+ gtrless: '\u2277',
+ gtrsim: '\u2273',
+ gvertneqq: '\u2269\uFE00',
+ gvnE: '\u2269\uFE00',
+ Hacek: '\u02C7',
+ hairsp: '\u200A',
+ half: '\u00BD',
+ hamilt: '\u210B',
+ HARDcy: '\u042A',
+ hardcy: '\u044A',
+ hArr: '\u21D4',
+ harr: '\u2194',
+ harrcir: '\u2948',
+ harrw: '\u21AD',
+ Hat: '\u005E',
+ hbar: '\u210F',
+ Hcirc: '\u0124',
+ hcirc: '\u0125',
+ hearts: '\u2665',
+ heartsuit: '\u2665',
+ hellip: '\u2026',
+ hercon: '\u22B9',
+ Hfr: '\u210C',
+ hfr: '\uD835\uDD25',
+ HilbertSpace: '\u210B',
+ hksearow: '\u2925',
+ hkswarow: '\u2926',
+ hoarr: '\u21FF',
+ homtht: '\u223B',
+ hookleftarrow: '\u21A9',
+ hookrightarrow: '\u21AA',
+ Hopf: '\u210D',
+ hopf: '\uD835\uDD59',
+ horbar: '\u2015',
+ HorizontalLine: '\u2500',
+ Hscr: '\u210B',
+ hscr: '\uD835\uDCBD',
+ hslash: '\u210F',
+ Hstrok: '\u0126',
+ hstrok: '\u0127',
+ HumpDownHump: '\u224E',
+ HumpEqual: '\u224F',
+ hybull: '\u2043',
+ hyphen: '\u2010',
+ Iacute: '\u00CD',
+ iacute: '\u00ED',
+ ic: '\u2063',
+ Icirc: '\u00CE',
+ icirc: '\u00EE',
+ Icy: '\u0418',
+ icy: '\u0438',
+ Idot: '\u0130',
+ IEcy: '\u0415',
+ iecy: '\u0435',
+ iexcl: '\u00A1',
+ iff: '\u21D4',
+ Ifr: '\u2111',
+ ifr: '\uD835\uDD26',
+ Igrave: '\u00CC',
+ igrave: '\u00EC',
+ ii: '\u2148',
+ iiiint: '\u2A0C',
+ iiint: '\u222D',
+ iinfin: '\u29DC',
+ iiota: '\u2129',
+ IJlig: '\u0132',
+ ijlig: '\u0133',
+ Im: '\u2111',
+ Imacr: '\u012A',
+ imacr: '\u012B',
+ image: '\u2111',
+ ImaginaryI: '\u2148',
+ imagline: '\u2110',
+ imagpart: '\u2111',
+ imath: '\u0131',
+ imof: '\u22B7',
+ imped: '\u01B5',
+ Implies: '\u21D2',
+ in: '\u2208',
+ incare: '\u2105',
+ infin: '\u221E',
+ infintie: '\u29DD',
+ inodot: '\u0131',
+ Int: '\u222C',
+ int: '\u222B',
+ intcal: '\u22BA',
+ integers: '\u2124',
+ Integral: '\u222B',
+ intercal: '\u22BA',
+ Intersection: '\u22C2',
+ intlarhk: '\u2A17',
+ intprod: '\u2A3C',
+ InvisibleComma: '\u2063',
+ InvisibleTimes: '\u2062',
+ IOcy: '\u0401',
+ iocy: '\u0451',
+ Iogon: '\u012E',
+ iogon: '\u012F',
+ Iopf: '\uD835\uDD40',
+ iopf: '\uD835\uDD5A',
+ Iota: '\u0399',
+ iota: '\u03B9',
+ iprod: '\u2A3C',
+ iquest: '\u00BF',
+ Iscr: '\u2110',
+ iscr: '\uD835\uDCBE',
+ isin: '\u2208',
+ isindot: '\u22F5',
+ isinE: '\u22F9',
+ isins: '\u22F4',
+ isinsv: '\u22F3',
+ isinv: '\u2208',
+ it: '\u2062',
+ Itilde: '\u0128',
+ itilde: '\u0129',
+ Iukcy: '\u0406',
+ iukcy: '\u0456',
+ Iuml: '\u00CF',
+ iuml: '\u00EF',
+ Jcirc: '\u0134',
+ jcirc: '\u0135',
+ Jcy: '\u0419',
+ jcy: '\u0439',
+ Jfr: '\uD835\uDD0D',
+ jfr: '\uD835\uDD27',
+ jmath: '\u0237',
+ Jopf: '\uD835\uDD41',
+ jopf: '\uD835\uDD5B',
+ Jscr: '\uD835\uDCA5',
+ jscr: '\uD835\uDCBF',
+ Jsercy: '\u0408',
+ jsercy: '\u0458',
+ Jukcy: '\u0404',
+ jukcy: '\u0454',
+ Kappa: '\u039A',
+ kappa: '\u03BA',
+ kappav: '\u03F0',
+ Kcedil: '\u0136',
+ kcedil: '\u0137',
+ Kcy: '\u041A',
+ kcy: '\u043A',
+ Kfr: '\uD835\uDD0E',
+ kfr: '\uD835\uDD28',
+ kgreen: '\u0138',
+ KHcy: '\u0425',
+ khcy: '\u0445',
+ KJcy: '\u040C',
+ kjcy: '\u045C',
+ Kopf: '\uD835\uDD42',
+ kopf: '\uD835\uDD5C',
+ Kscr: '\uD835\uDCA6',
+ kscr: '\uD835\uDCC0',
+ lAarr: '\u21DA',
+ Lacute: '\u0139',
+ lacute: '\u013A',
+ laemptyv: '\u29B4',
+ lagran: '\u2112',
+ Lambda: '\u039B',
+ lambda: '\u03BB',
+ Lang: '\u27EA',
+ lang: '\u27E8',
+ langd: '\u2991',
+ langle: '\u27E8',
+ lap: '\u2A85',
+ Laplacetrf: '\u2112',
+ laquo: '\u00AB',
+ Larr: '\u219E',
+ lArr: '\u21D0',
+ larr: '\u2190',
+ larrb: '\u21E4',
+ larrbfs: '\u291F',
+ larrfs: '\u291D',
+ larrhk: '\u21A9',
+ larrlp: '\u21AB',
+ larrpl: '\u2939',
+ larrsim: '\u2973',
+ larrtl: '\u21A2',
+ lat: '\u2AAB',
+ lAtail: '\u291B',
+ latail: '\u2919',
+ late: '\u2AAD',
+ lates: '\u2AAD\uFE00',
+ lBarr: '\u290E',
+ lbarr: '\u290C',
+ lbbrk: '\u2772',
+ lbrace: '\u007B',
+ lbrack: '\u005B',
+ lbrke: '\u298B',
+ lbrksld: '\u298F',
+ lbrkslu: '\u298D',
+ Lcaron: '\u013D',
+ lcaron: '\u013E',
+ Lcedil: '\u013B',
+ lcedil: '\u013C',
+ lceil: '\u2308',
+ lcub: '\u007B',
+ Lcy: '\u041B',
+ lcy: '\u043B',
+ ldca: '\u2936',
+ ldquo: '\u201C',
+ ldquor: '\u201E',
+ ldrdhar: '\u2967',
+ ldrushar: '\u294B',
+ ldsh: '\u21B2',
+ lE: '\u2266',
+ le: '\u2264',
+ LeftAngleBracket: '\u27E8',
+ LeftArrow: '\u2190',
+ Leftarrow: '\u21D0',
+ leftarrow: '\u2190',
+ LeftArrowBar: '\u21E4',
+ LeftArrowRightArrow: '\u21C6',
+ leftarrowtail: '\u21A2',
+ LeftCeiling: '\u2308',
+ LeftDoubleBracket: '\u27E6',
+ LeftDownTeeVector: '\u2961',
+ LeftDownVector: '\u21C3',
+ LeftDownVectorBar: '\u2959',
+ LeftFloor: '\u230A',
+ leftharpoondown: '\u21BD',
+ leftharpoonup: '\u21BC',
+ leftleftarrows: '\u21C7',
+ LeftRightArrow: '\u2194',
+ Leftrightarrow: '\u21D4',
+ leftrightarrow: '\u2194',
+ leftrightarrows: '\u21C6',
+ leftrightharpoons: '\u21CB',
+ leftrightsquigarrow: '\u21AD',
+ LeftRightVector: '\u294E',
+ LeftTee: '\u22A3',
+ LeftTeeArrow: '\u21A4',
+ LeftTeeVector: '\u295A',
+ leftthreetimes: '\u22CB',
+ LeftTriangle: '\u22B2',
+ LeftTriangleBar: '\u29CF',
+ LeftTriangleEqual: '\u22B4',
+ LeftUpDownVector: '\u2951',
+ LeftUpTeeVector: '\u2960',
+ LeftUpVector: '\u21BF',
+ LeftUpVectorBar: '\u2958',
+ LeftVector: '\u21BC',
+ LeftVectorBar: '\u2952',
+ lEg: '\u2A8B',
+ leg: '\u22DA',
+ leq: '\u2264',
+ leqq: '\u2266',
+ leqslant: '\u2A7D',
+ les: '\u2A7D',
+ lescc: '\u2AA8',
+ lesdot: '\u2A7F',
+ lesdoto: '\u2A81',
+ lesdotor: '\u2A83',
+ lesg: '\u22DA\uFE00',
+ lesges: '\u2A93',
+ lessapprox: '\u2A85',
+ lessdot: '\u22D6',
+ lesseqgtr: '\u22DA',
+ lesseqqgtr: '\u2A8B',
+ LessEqualGreater: '\u22DA',
+ LessFullEqual: '\u2266',
+ LessGreater: '\u2276',
+ lessgtr: '\u2276',
+ LessLess: '\u2AA1',
+ lesssim: '\u2272',
+ LessSlantEqual: '\u2A7D',
+ LessTilde: '\u2272',
+ lfisht: '\u297C',
+ lfloor: '\u230A',
+ Lfr: '\uD835\uDD0F',
+ lfr: '\uD835\uDD29',
+ lg: '\u2276',
+ lgE: '\u2A91',
+ lHar: '\u2962',
+ lhard: '\u21BD',
+ lharu: '\u21BC',
+ lharul: '\u296A',
+ lhblk: '\u2584',
+ LJcy: '\u0409',
+ ljcy: '\u0459',
+ Ll: '\u22D8',
+ ll: '\u226A',
+ llarr: '\u21C7',
+ llcorner: '\u231E',
+ Lleftarrow: '\u21DA',
+ llhard: '\u296B',
+ lltri: '\u25FA',
+ Lmidot: '\u013F',
+ lmidot: '\u0140',
+ lmoust: '\u23B0',
+ lmoustache: '\u23B0',
+ lnap: '\u2A89',
+ lnapprox: '\u2A89',
+ lnE: '\u2268',
+ lne: '\u2A87',
+ lneq: '\u2A87',
+ lneqq: '\u2268',
+ lnsim: '\u22E6',
+ loang: '\u27EC',
+ loarr: '\u21FD',
+ lobrk: '\u27E6',
+ LongLeftArrow: '\u27F5',
+ Longleftarrow: '\u27F8',
+ longleftarrow: '\u27F5',
+ LongLeftRightArrow: '\u27F7',
+ Longleftrightarrow: '\u27FA',
+ longleftrightarrow: '\u27F7',
+ longmapsto: '\u27FC',
+ LongRightArrow: '\u27F6',
+ Longrightarrow: '\u27F9',
+ longrightarrow: '\u27F6',
+ looparrowleft: '\u21AB',
+ looparrowright: '\u21AC',
+ lopar: '\u2985',
+ Lopf: '\uD835\uDD43',
+ lopf: '\uD835\uDD5D',
+ loplus: '\u2A2D',
+ lotimes: '\u2A34',
+ lowast: '\u2217',
+ lowbar: '\u005F',
+ LowerLeftArrow: '\u2199',
+ LowerRightArrow: '\u2198',
+ loz: '\u25CA',
+ lozenge: '\u25CA',
+ lozf: '\u29EB',
+ lpar: '\u0028',
+ lparlt: '\u2993',
+ lrarr: '\u21C6',
+ lrcorner: '\u231F',
+ lrhar: '\u21CB',
+ lrhard: '\u296D',
+ lrm: '\u200E',
+ lrtri: '\u22BF',
+ lsaquo: '\u2039',
+ Lscr: '\u2112',
+ lscr: '\uD835\uDCC1',
+ Lsh: '\u21B0',
+ lsh: '\u21B0',
+ lsim: '\u2272',
+ lsime: '\u2A8D',
+ lsimg: '\u2A8F',
+ lsqb: '\u005B',
+ lsquo: '\u2018',
+ lsquor: '\u201A',
+ Lstrok: '\u0141',
+ lstrok: '\u0142',
+ Lt: '\u226A',
+ LT: '\u003C',
+ lt: '\u003C',
+ ltcc: '\u2AA6',
+ ltcir: '\u2A79',
+ ltdot: '\u22D6',
+ lthree: '\u22CB',
+ ltimes: '\u22C9',
+ ltlarr: '\u2976',
+ ltquest: '\u2A7B',
+ ltri: '\u25C3',
+ ltrie: '\u22B4',
+ ltrif: '\u25C2',
+ ltrPar: '\u2996',
+ lurdshar: '\u294A',
+ luruhar: '\u2966',
+ lvertneqq: '\u2268\uFE00',
+ lvnE: '\u2268\uFE00',
+ macr: '\u00AF',
+ male: '\u2642',
+ malt: '\u2720',
+ maltese: '\u2720',
+ Map: '\u2905',
+ map: '\u21A6',
+ mapsto: '\u21A6',
+ mapstodown: '\u21A7',
+ mapstoleft: '\u21A4',
+ mapstoup: '\u21A5',
+ marker: '\u25AE',
+ mcomma: '\u2A29',
+ Mcy: '\u041C',
+ mcy: '\u043C',
+ mdash: '\u2014',
+ mDDot: '\u223A',
+ measuredangle: '\u2221',
+ MediumSpace: '\u205F',
+ Mellintrf: '\u2133',
+ Mfr: '\uD835\uDD10',
+ mfr: '\uD835\uDD2A',
+ mho: '\u2127',
+ micro: '\u00B5',
+ mid: '\u2223',
+ midast: '\u002A',
+ midcir: '\u2AF0',
+ middot: '\u00B7',
+ minus: '\u2212',
+ minusb: '\u229F',
+ minusd: '\u2238',
+ minusdu: '\u2A2A',
+ MinusPlus: '\u2213',
+ mlcp: '\u2ADB',
+ mldr: '\u2026',
+ mnplus: '\u2213',
+ models: '\u22A7',
+ Mopf: '\uD835\uDD44',
+ mopf: '\uD835\uDD5E',
+ mp: '\u2213',
+ Mscr: '\u2133',
+ mscr: '\uD835\uDCC2',
+ mstpos: '\u223E',
+ Mu: '\u039C',
+ mu: '\u03BC',
+ multimap: '\u22B8',
+ mumap: '\u22B8',
+ nabla: '\u2207',
+ Nacute: '\u0143',
+ nacute: '\u0144',
+ nang: '\u2220\u20D2',
+ nap: '\u2249',
+ napE: '\u2A70\u0338',
+ napid: '\u224B\u0338',
+ napos: '\u0149',
+ napprox: '\u2249',
+ natur: '\u266E',
+ natural: '\u266E',
+ naturals: '\u2115',
+ nbsp: '\u00A0',
+ nbump: '\u224E\u0338',
+ nbumpe: '\u224F\u0338',
+ ncap: '\u2A43',
+ Ncaron: '\u0147',
+ ncaron: '\u0148',
+ Ncedil: '\u0145',
+ ncedil: '\u0146',
+ ncong: '\u2247',
+ ncongdot: '\u2A6D\u0338',
+ ncup: '\u2A42',
+ Ncy: '\u041D',
+ ncy: '\u043D',
+ ndash: '\u2013',
+ ne: '\u2260',
+ nearhk: '\u2924',
+ neArr: '\u21D7',
+ nearr: '\u2197',
+ nearrow: '\u2197',
+ nedot: '\u2250\u0338',
+ NegativeMediumSpace: '\u200B',
+ NegativeThickSpace: '\u200B',
+ NegativeThinSpace: '\u200B',
+ NegativeVeryThinSpace: '\u200B',
+ nequiv: '\u2262',
+ nesear: '\u2928',
+ nesim: '\u2242\u0338',
+ NestedGreaterGreater: '\u226B',
+ NestedLessLess: '\u226A',
+ NewLine: '\u000A',
+ nexist: '\u2204',
+ nexists: '\u2204',
+ Nfr: '\uD835\uDD11',
+ nfr: '\uD835\uDD2B',
+ ngE: '\u2267\u0338',
+ nge: '\u2271',
+ ngeq: '\u2271',
+ ngeqq: '\u2267\u0338',
+ ngeqslant: '\u2A7E\u0338',
+ nges: '\u2A7E\u0338',
+ nGg: '\u22D9\u0338',
+ ngsim: '\u2275',
+ nGt: '\u226B\u20D2',
+ ngt: '\u226F',
+ ngtr: '\u226F',
+ nGtv: '\u226B\u0338',
+ nhArr: '\u21CE',
+ nharr: '\u21AE',
+ nhpar: '\u2AF2',
+ ni: '\u220B',
+ nis: '\u22FC',
+ nisd: '\u22FA',
+ niv: '\u220B',
+ NJcy: '\u040A',
+ njcy: '\u045A',
+ nlArr: '\u21CD',
+ nlarr: '\u219A',
+ nldr: '\u2025',
+ nlE: '\u2266\u0338',
+ nle: '\u2270',
+ nLeftarrow: '\u21CD',
+ nleftarrow: '\u219A',
+ nLeftrightarrow: '\u21CE',
+ nleftrightarrow: '\u21AE',
+ nleq: '\u2270',
+ nleqq: '\u2266\u0338',
+ nleqslant: '\u2A7D\u0338',
+ nles: '\u2A7D\u0338',
+ nless: '\u226E',
+ nLl: '\u22D8\u0338',
+ nlsim: '\u2274',
+ nLt: '\u226A\u20D2',
+ nlt: '\u226E',
+ nltri: '\u22EA',
+ nltrie: '\u22EC',
+ nLtv: '\u226A\u0338',
+ nmid: '\u2224',
+ NoBreak: '\u2060',
+ NonBreakingSpace: '\u00A0',
+ Nopf: '\u2115',
+ nopf: '\uD835\uDD5F',
+ Not: '\u2AEC',
+ not: '\u00AC',
+ NotCongruent: '\u2262',
+ NotCupCap: '\u226D',
+ NotDoubleVerticalBar: '\u2226',
+ NotElement: '\u2209',
+ NotEqual: '\u2260',
+ NotEqualTilde: '\u2242\u0338',
+ NotExists: '\u2204',
+ NotGreater: '\u226F',
+ NotGreaterEqual: '\u2271',
+ NotGreaterFullEqual: '\u2267\u0338',
+ NotGreaterGreater: '\u226B\u0338',
+ NotGreaterLess: '\u2279',
+ NotGreaterSlantEqual: '\u2A7E\u0338',
+ NotGreaterTilde: '\u2275',
+ NotHumpDownHump: '\u224E\u0338',
+ NotHumpEqual: '\u224F\u0338',
+ notin: '\u2209',
+ notindot: '\u22F5\u0338',
+ notinE: '\u22F9\u0338',
+ notinva: '\u2209',
+ notinvb: '\u22F7',
+ notinvc: '\u22F6',
+ NotLeftTriangle: '\u22EA',
+ NotLeftTriangleBar: '\u29CF\u0338',
+ NotLeftTriangleEqual: '\u22EC',
+ NotLess: '\u226E',
+ NotLessEqual: '\u2270',
+ NotLessGreater: '\u2278',
+ NotLessLess: '\u226A\u0338',
+ NotLessSlantEqual: '\u2A7D\u0338',
+ NotLessTilde: '\u2274',
+ NotNestedGreaterGreater: '\u2AA2\u0338',
+ NotNestedLessLess: '\u2AA1\u0338',
+ notni: '\u220C',
+ notniva: '\u220C',
+ notnivb: '\u22FE',
+ notnivc: '\u22FD',
+ NotPrecedes: '\u2280',
+ NotPrecedesEqual: '\u2AAF\u0338',
+ NotPrecedesSlantEqual: '\u22E0',
+ NotReverseElement: '\u220C',
+ NotRightTriangle: '\u22EB',
+ NotRightTriangleBar: '\u29D0\u0338',
+ NotRightTriangleEqual: '\u22ED',
+ NotSquareSubset: '\u228F\u0338',
+ NotSquareSubsetEqual: '\u22E2',
+ NotSquareSuperset: '\u2290\u0338',
+ NotSquareSupersetEqual: '\u22E3',
+ NotSubset: '\u2282\u20D2',
+ NotSubsetEqual: '\u2288',
+ NotSucceeds: '\u2281',
+ NotSucceedsEqual: '\u2AB0\u0338',
+ NotSucceedsSlantEqual: '\u22E1',
+ NotSucceedsTilde: '\u227F\u0338',
+ NotSuperset: '\u2283\u20D2',
+ NotSupersetEqual: '\u2289',
+ NotTilde: '\u2241',
+ NotTildeEqual: '\u2244',
+ NotTildeFullEqual: '\u2247',
+ NotTildeTilde: '\u2249',
+ NotVerticalBar: '\u2224',
+ npar: '\u2226',
+ nparallel: '\u2226',
+ nparsl: '\u2AFD\u20E5',
+ npart: '\u2202\u0338',
+ npolint: '\u2A14',
+ npr: '\u2280',
+ nprcue: '\u22E0',
+ npre: '\u2AAF\u0338',
+ nprec: '\u2280',
+ npreceq: '\u2AAF\u0338',
+ nrArr: '\u21CF',
+ nrarr: '\u219B',
+ nrarrc: '\u2933\u0338',
+ nrarrw: '\u219D\u0338',
+ nRightarrow: '\u21CF',
+ nrightarrow: '\u219B',
+ nrtri: '\u22EB',
+ nrtrie: '\u22ED',
+ nsc: '\u2281',
+ nsccue: '\u22E1',
+ nsce: '\u2AB0\u0338',
+ Nscr: '\uD835\uDCA9',
+ nscr: '\uD835\uDCC3',
+ nshortmid: '\u2224',
+ nshortparallel: '\u2226',
+ nsim: '\u2241',
+ nsime: '\u2244',
+ nsimeq: '\u2244',
+ nsmid: '\u2224',
+ nspar: '\u2226',
+ nsqsube: '\u22E2',
+ nsqsupe: '\u22E3',
+ nsub: '\u2284',
+ nsubE: '\u2AC5\u0338',
+ nsube: '\u2288',
+ nsubset: '\u2282\u20D2',
+ nsubseteq: '\u2288',
+ nsubseteqq: '\u2AC5\u0338',
+ nsucc: '\u2281',
+ nsucceq: '\u2AB0\u0338',
+ nsup: '\u2285',
+ nsupE: '\u2AC6\u0338',
+ nsupe: '\u2289',
+ nsupset: '\u2283\u20D2',
+ nsupseteq: '\u2289',
+ nsupseteqq: '\u2AC6\u0338',
+ ntgl: '\u2279',
+ Ntilde: '\u00D1',
+ ntilde: '\u00F1',
+ ntlg: '\u2278',
+ ntriangleleft: '\u22EA',
+ ntrianglelefteq: '\u22EC',
+ ntriangleright: '\u22EB',
+ ntrianglerighteq: '\u22ED',
+ Nu: '\u039D',
+ nu: '\u03BD',
+ num: '\u0023',
+ numero: '\u2116',
+ numsp: '\u2007',
+ nvap: '\u224D\u20D2',
+ nVDash: '\u22AF',
+ nVdash: '\u22AE',
+ nvDash: '\u22AD',
+ nvdash: '\u22AC',
+ nvge: '\u2265\u20D2',
+ nvgt: '\u003E\u20D2',
+ nvHarr: '\u2904',
+ nvinfin: '\u29DE',
+ nvlArr: '\u2902',
+ nvle: '\u2264\u20D2',
+ nvlt: '\u003C\u20D2',
+ nvltrie: '\u22B4\u20D2',
+ nvrArr: '\u2903',
+ nvrtrie: '\u22B5\u20D2',
+ nvsim: '\u223C\u20D2',
+ nwarhk: '\u2923',
+ nwArr: '\u21D6',
+ nwarr: '\u2196',
+ nwarrow: '\u2196',
+ nwnear: '\u2927',
+ Oacute: '\u00D3',
+ oacute: '\u00F3',
+ oast: '\u229B',
+ ocir: '\u229A',
+ Ocirc: '\u00D4',
+ ocirc: '\u00F4',
+ Ocy: '\u041E',
+ ocy: '\u043E',
+ odash: '\u229D',
+ Odblac: '\u0150',
+ odblac: '\u0151',
+ odiv: '\u2A38',
+ odot: '\u2299',
+ odsold: '\u29BC',
+ OElig: '\u0152',
+ oelig: '\u0153',
+ ofcir: '\u29BF',
+ Ofr: '\uD835\uDD12',
+ ofr: '\uD835\uDD2C',
+ ogon: '\u02DB',
+ Ograve: '\u00D2',
+ ograve: '\u00F2',
+ ogt: '\u29C1',
+ ohbar: '\u29B5',
+ ohm: '\u03A9',
+ oint: '\u222E',
+ olarr: '\u21BA',
+ olcir: '\u29BE',
+ olcross: '\u29BB',
+ oline: '\u203E',
+ olt: '\u29C0',
+ Omacr: '\u014C',
+ omacr: '\u014D',
+ Omega: '\u03A9',
+ omega: '\u03C9',
+ Omicron: '\u039F',
+ omicron: '\u03BF',
+ omid: '\u29B6',
+ ominus: '\u2296',
+ Oopf: '\uD835\uDD46',
+ oopf: '\uD835\uDD60',
+ opar: '\u29B7',
+ OpenCurlyDoubleQuote: '\u201C',
+ OpenCurlyQuote: '\u2018',
+ operp: '\u29B9',
+ oplus: '\u2295',
+ Or: '\u2A54',
+ or: '\u2228',
+ orarr: '\u21BB',
+ ord: '\u2A5D',
+ order: '\u2134',
+ orderof: '\u2134',
+ ordf: '\u00AA',
+ ordm: '\u00BA',
+ origof: '\u22B6',
+ oror: '\u2A56',
+ orslope: '\u2A57',
+ orv: '\u2A5B',
+ oS: '\u24C8',
+ Oscr: '\uD835\uDCAA',
+ oscr: '\u2134',
+ Oslash: '\u00D8',
+ oslash: '\u00F8',
+ osol: '\u2298',
+ Otilde: '\u00D5',
+ otilde: '\u00F5',
+ Otimes: '\u2A37',
+ otimes: '\u2297',
+ otimesas: '\u2A36',
+ Ouml: '\u00D6',
+ ouml: '\u00F6',
+ ovbar: '\u233D',
+ OverBar: '\u203E',
+ OverBrace: '\u23DE',
+ OverBracket: '\u23B4',
+ OverParenthesis: '\u23DC',
+ par: '\u2225',
+ para: '\u00B6',
+ parallel: '\u2225',
+ parsim: '\u2AF3',
+ parsl: '\u2AFD',
+ part: '\u2202',
+ PartialD: '\u2202',
+ Pcy: '\u041F',
+ pcy: '\u043F',
+ percnt: '\u0025',
+ period: '\u002E',
+ permil: '\u2030',
+ perp: '\u22A5',
+ pertenk: '\u2031',
+ Pfr: '\uD835\uDD13',
+ pfr: '\uD835\uDD2D',
+ Phi: '\u03A6',
+ phi: '\u03C6',
+ phiv: '\u03D5',
+ phmmat: '\u2133',
+ phone: '\u260E',
+ Pi: '\u03A0',
+ pi: '\u03C0',
+ pitchfork: '\u22D4',
+ piv: '\u03D6',
+ planck: '\u210F',
+ planckh: '\u210E',
+ plankv: '\u210F',
+ plus: '\u002B',
+ plusacir: '\u2A23',
+ plusb: '\u229E',
+ pluscir: '\u2A22',
+ plusdo: '\u2214',
+ plusdu: '\u2A25',
+ pluse: '\u2A72',
+ PlusMinus: '\u00B1',
+ plusmn: '\u00B1',
+ plussim: '\u2A26',
+ plustwo: '\u2A27',
+ pm: '\u00B1',
+ Poincareplane: '\u210C',
+ pointint: '\u2A15',
+ Popf: '\u2119',
+ popf: '\uD835\uDD61',
+ pound: '\u00A3',
+ Pr: '\u2ABB',
+ pr: '\u227A',
+ prap: '\u2AB7',
+ prcue: '\u227C',
+ prE: '\u2AB3',
+ pre: '\u2AAF',
+ prec: '\u227A',
+ precapprox: '\u2AB7',
+ preccurlyeq: '\u227C',
+ Precedes: '\u227A',
+ PrecedesEqual: '\u2AAF',
+ PrecedesSlantEqual: '\u227C',
+ PrecedesTilde: '\u227E',
+ preceq: '\u2AAF',
+ precnapprox: '\u2AB9',
+ precneqq: '\u2AB5',
+ precnsim: '\u22E8',
+ precsim: '\u227E',
+ Prime: '\u2033',
+ prime: '\u2032',
+ primes: '\u2119',
+ prnap: '\u2AB9',
+ prnE: '\u2AB5',
+ prnsim: '\u22E8',
+ prod: '\u220F',
+ Product: '\u220F',
+ profalar: '\u232E',
+ profline: '\u2312',
+ profsurf: '\u2313',
+ prop: '\u221D',
+ Proportion: '\u2237',
+ Proportional: '\u221D',
+ propto: '\u221D',
+ prsim: '\u227E',
+ prurel: '\u22B0',
+ Pscr: '\uD835\uDCAB',
+ pscr: '\uD835\uDCC5',
+ Psi: '\u03A8',
+ psi: '\u03C8',
+ puncsp: '\u2008',
+ Qfr: '\uD835\uDD14',
+ qfr: '\uD835\uDD2E',
+ qint: '\u2A0C',
+ Qopf: '\u211A',
+ qopf: '\uD835\uDD62',
+ qprime: '\u2057',
+ Qscr: '\uD835\uDCAC',
+ qscr: '\uD835\uDCC6',
+ quaternions: '\u210D',
+ quatint: '\u2A16',
+ quest: '\u003F',
+ questeq: '\u225F',
+ QUOT: '\u0022',
+ quot: '\u0022',
+ rAarr: '\u21DB',
+ race: '\u223D\u0331',
+ Racute: '\u0154',
+ racute: '\u0155',
+ radic: '\u221A',
+ raemptyv: '\u29B3',
+ Rang: '\u27EB',
+ rang: '\u27E9',
+ rangd: '\u2992',
+ range: '\u29A5',
+ rangle: '\u27E9',
+ raquo: '\u00BB',
+ Rarr: '\u21A0',
+ rArr: '\u21D2',
+ rarr: '\u2192',
+ rarrap: '\u2975',
+ rarrb: '\u21E5',
+ rarrbfs: '\u2920',
+ rarrc: '\u2933',
+ rarrfs: '\u291E',
+ rarrhk: '\u21AA',
+ rarrlp: '\u21AC',
+ rarrpl: '\u2945',
+ rarrsim: '\u2974',
+ Rarrtl: '\u2916',
+ rarrtl: '\u21A3',
+ rarrw: '\u219D',
+ rAtail: '\u291C',
+ ratail: '\u291A',
+ ratio: '\u2236',
+ rationals: '\u211A',
+ RBarr: '\u2910',
+ rBarr: '\u290F',
+ rbarr: '\u290D',
+ rbbrk: '\u2773',
+ rbrace: '\u007D',
+ rbrack: '\u005D',
+ rbrke: '\u298C',
+ rbrksld: '\u298E',
+ rbrkslu: '\u2990',
+ Rcaron: '\u0158',
+ rcaron: '\u0159',
+ Rcedil: '\u0156',
+ rcedil: '\u0157',
+ rceil: '\u2309',
+ rcub: '\u007D',
+ Rcy: '\u0420',
+ rcy: '\u0440',
+ rdca: '\u2937',
+ rdldhar: '\u2969',
+ rdquo: '\u201D',
+ rdquor: '\u201D',
+ rdsh: '\u21B3',
+ Re: '\u211C',
+ real: '\u211C',
+ realine: '\u211B',
+ realpart: '\u211C',
+ reals: '\u211D',
+ rect: '\u25AD',
+ REG: '\u00AE',
+ reg: '\u00AE',
+ ReverseElement: '\u220B',
+ ReverseEquilibrium: '\u21CB',
+ ReverseUpEquilibrium: '\u296F',
+ rfisht: '\u297D',
+ rfloor: '\u230B',
+ Rfr: '\u211C',
+ rfr: '\uD835\uDD2F',
+ rHar: '\u2964',
+ rhard: '\u21C1',
+ rharu: '\u21C0',
+ rharul: '\u296C',
+ Rho: '\u03A1',
+ rho: '\u03C1',
+ rhov: '\u03F1',
+ RightAngleBracket: '\u27E9',
+ RightArrow: '\u2192',
+ Rightarrow: '\u21D2',
+ rightarrow: '\u2192',
+ RightArrowBar: '\u21E5',
+ RightArrowLeftArrow: '\u21C4',
+ rightarrowtail: '\u21A3',
+ RightCeiling: '\u2309',
+ RightDoubleBracket: '\u27E7',
+ RightDownTeeVector: '\u295D',
+ RightDownVector: '\u21C2',
+ RightDownVectorBar: '\u2955',
+ RightFloor: '\u230B',
+ rightharpoondown: '\u21C1',
+ rightharpoonup: '\u21C0',
+ rightleftarrows: '\u21C4',
+ rightleftharpoons: '\u21CC',
+ rightrightarrows: '\u21C9',
+ rightsquigarrow: '\u219D',
+ RightTee: '\u22A2',
+ RightTeeArrow: '\u21A6',
+ RightTeeVector: '\u295B',
+ rightthreetimes: '\u22CC',
+ RightTriangle: '\u22B3',
+ RightTriangleBar: '\u29D0',
+ RightTriangleEqual: '\u22B5',
+ RightUpDownVector: '\u294F',
+ RightUpTeeVector: '\u295C',
+ RightUpVector: '\u21BE',
+ RightUpVectorBar: '\u2954',
+ RightVector: '\u21C0',
+ RightVectorBar: '\u2953',
+ ring: '\u02DA',
+ risingdotseq: '\u2253',
+ rlarr: '\u21C4',
+ rlhar: '\u21CC',
+ rlm: '\u200F',
+ rmoust: '\u23B1',
+ rmoustache: '\u23B1',
+ rnmid: '\u2AEE',
+ roang: '\u27ED',
+ roarr: '\u21FE',
+ robrk: '\u27E7',
+ ropar: '\u2986',
+ Ropf: '\u211D',
+ ropf: '\uD835\uDD63',
+ roplus: '\u2A2E',
+ rotimes: '\u2A35',
+ RoundImplies: '\u2970',
+ rpar: '\u0029',
+ rpargt: '\u2994',
+ rppolint: '\u2A12',
+ rrarr: '\u21C9',
+ Rrightarrow: '\u21DB',
+ rsaquo: '\u203A',
+ Rscr: '\u211B',
+ rscr: '\uD835\uDCC7',
+ Rsh: '\u21B1',
+ rsh: '\u21B1',
+ rsqb: '\u005D',
+ rsquo: '\u2019',
+ rsquor: '\u2019',
+ rthree: '\u22CC',
+ rtimes: '\u22CA',
+ rtri: '\u25B9',
+ rtrie: '\u22B5',
+ rtrif: '\u25B8',
+ rtriltri: '\u29CE',
+ RuleDelayed: '\u29F4',
+ ruluhar: '\u2968',
+ rx: '\u211E',
+ Sacute: '\u015A',
+ sacute: '\u015B',
+ sbquo: '\u201A',
+ Sc: '\u2ABC',
+ sc: '\u227B',
+ scap: '\u2AB8',
+ Scaron: '\u0160',
+ scaron: '\u0161',
+ sccue: '\u227D',
+ scE: '\u2AB4',
+ sce: '\u2AB0',
+ Scedil: '\u015E',
+ scedil: '\u015F',
+ Scirc: '\u015C',
+ scirc: '\u015D',
+ scnap: '\u2ABA',
+ scnE: '\u2AB6',
+ scnsim: '\u22E9',
+ scpolint: '\u2A13',
+ scsim: '\u227F',
+ Scy: '\u0421',
+ scy: '\u0441',
+ sdot: '\u22C5',
+ sdotb: '\u22A1',
+ sdote: '\u2A66',
+ searhk: '\u2925',
+ seArr: '\u21D8',
+ searr: '\u2198',
+ searrow: '\u2198',
+ sect: '\u00A7',
+ semi: '\u003B',
+ seswar: '\u2929',
+ setminus: '\u2216',
+ setmn: '\u2216',
+ sext: '\u2736',
+ Sfr: '\uD835\uDD16',
+ sfr: '\uD835\uDD30',
+ sfrown: '\u2322',
+ sharp: '\u266F',
+ SHCHcy: '\u0429',
+ shchcy: '\u0449',
+ SHcy: '\u0428',
+ shcy: '\u0448',
+ ShortDownArrow: '\u2193',
+ ShortLeftArrow: '\u2190',
+ shortmid: '\u2223',
+ shortparallel: '\u2225',
+ ShortRightArrow: '\u2192',
+ ShortUpArrow: '\u2191',
+ shy: '\u00AD',
+ Sigma: '\u03A3',
+ sigma: '\u03C3',
+ sigmaf: '\u03C2',
+ sigmav: '\u03C2',
+ sim: '\u223C',
+ simdot: '\u2A6A',
+ sime: '\u2243',
+ simeq: '\u2243',
+ simg: '\u2A9E',
+ simgE: '\u2AA0',
+ siml: '\u2A9D',
+ simlE: '\u2A9F',
+ simne: '\u2246',
+ simplus: '\u2A24',
+ simrarr: '\u2972',
+ slarr: '\u2190',
+ SmallCircle: '\u2218',
+ smallsetminus: '\u2216',
+ smashp: '\u2A33',
+ smeparsl: '\u29E4',
+ smid: '\u2223',
+ smile: '\u2323',
+ smt: '\u2AAA',
+ smte: '\u2AAC',
+ smtes: '\u2AAC\uFE00',
+ SOFTcy: '\u042C',
+ softcy: '\u044C',
+ sol: '\u002F',
+ solb: '\u29C4',
+ solbar: '\u233F',
+ Sopf: '\uD835\uDD4A',
+ sopf: '\uD835\uDD64',
+ spades: '\u2660',
+ spadesuit: '\u2660',
+ spar: '\u2225',
+ sqcap: '\u2293',
+ sqcaps: '\u2293\uFE00',
+ sqcup: '\u2294',
+ sqcups: '\u2294\uFE00',
+ Sqrt: '\u221A',
+ sqsub: '\u228F',
+ sqsube: '\u2291',
+ sqsubset: '\u228F',
+ sqsubseteq: '\u2291',
+ sqsup: '\u2290',
+ sqsupe: '\u2292',
+ sqsupset: '\u2290',
+ sqsupseteq: '\u2292',
+ squ: '\u25A1',
+ Square: '\u25A1',
+ square: '\u25A1',
+ SquareIntersection: '\u2293',
+ SquareSubset: '\u228F',
+ SquareSubsetEqual: '\u2291',
+ SquareSuperset: '\u2290',
+ SquareSupersetEqual: '\u2292',
+ SquareUnion: '\u2294',
+ squarf: '\u25AA',
+ squf: '\u25AA',
+ srarr: '\u2192',
+ Sscr: '\uD835\uDCAE',
+ sscr: '\uD835\uDCC8',
+ ssetmn: '\u2216',
+ ssmile: '\u2323',
+ sstarf: '\u22C6',
+ Star: '\u22C6',
+ star: '\u2606',
+ starf: '\u2605',
+ straightepsilon: '\u03F5',
+ straightphi: '\u03D5',
+ strns: '\u00AF',
+ Sub: '\u22D0',
+ sub: '\u2282',
+ subdot: '\u2ABD',
+ subE: '\u2AC5',
+ sube: '\u2286',
+ subedot: '\u2AC3',
+ submult: '\u2AC1',
+ subnE: '\u2ACB',
+ subne: '\u228A',
+ subplus: '\u2ABF',
+ subrarr: '\u2979',
+ Subset: '\u22D0',
+ subset: '\u2282',
+ subseteq: '\u2286',
+ subseteqq: '\u2AC5',
+ SubsetEqual: '\u2286',
+ subsetneq: '\u228A',
+ subsetneqq: '\u2ACB',
+ subsim: '\u2AC7',
+ subsub: '\u2AD5',
+ subsup: '\u2AD3',
+ succ: '\u227B',
+ succapprox: '\u2AB8',
+ succcurlyeq: '\u227D',
+ Succeeds: '\u227B',
+ SucceedsEqual: '\u2AB0',
+ SucceedsSlantEqual: '\u227D',
+ SucceedsTilde: '\u227F',
+ succeq: '\u2AB0',
+ succnapprox: '\u2ABA',
+ succneqq: '\u2AB6',
+ succnsim: '\u22E9',
+ succsim: '\u227F',
+ SuchThat: '\u220B',
+ Sum: '\u2211',
+ sum: '\u2211',
+ sung: '\u266A',
+ Sup: '\u22D1',
+ sup: '\u2283',
+ sup1: '\u00B9',
+ sup2: '\u00B2',
+ sup3: '\u00B3',
+ supdot: '\u2ABE',
+ supdsub: '\u2AD8',
+ supE: '\u2AC6',
+ supe: '\u2287',
+ supedot: '\u2AC4',
+ Superset: '\u2283',
+ SupersetEqual: '\u2287',
+ suphsol: '\u27C9',
+ suphsub: '\u2AD7',
+ suplarr: '\u297B',
+ supmult: '\u2AC2',
+ supnE: '\u2ACC',
+ supne: '\u228B',
+ supplus: '\u2AC0',
+ Supset: '\u22D1',
+ supset: '\u2283',
+ supseteq: '\u2287',
+ supseteqq: '\u2AC6',
+ supsetneq: '\u228B',
+ supsetneqq: '\u2ACC',
+ supsim: '\u2AC8',
+ supsub: '\u2AD4',
+ supsup: '\u2AD6',
+ swarhk: '\u2926',
+ swArr: '\u21D9',
+ swarr: '\u2199',
+ swarrow: '\u2199',
+ swnwar: '\u292A',
+ szlig: '\u00DF',
+ Tab: '\u0009',
+ target: '\u2316',
+ Tau: '\u03A4',
+ tau: '\u03C4',
+ tbrk: '\u23B4',
+ Tcaron: '\u0164',
+ tcaron: '\u0165',
+ Tcedil: '\u0162',
+ tcedil: '\u0163',
+ Tcy: '\u0422',
+ tcy: '\u0442',
+ tdot: '\u20DB',
+ telrec: '\u2315',
+ Tfr: '\uD835\uDD17',
+ tfr: '\uD835\uDD31',
+ there4: '\u2234',
+ Therefore: '\u2234',
+ therefore: '\u2234',
+ Theta: '\u0398',
+ theta: '\u03B8',
+ thetasym: '\u03D1',
+ thetav: '\u03D1',
+ thickapprox: '\u2248',
+ thicksim: '\u223C',
+ ThickSpace: '\u205F\u200A',
+ thinsp: '\u2009',
+ ThinSpace: '\u2009',
+ thkap: '\u2248',
+ thksim: '\u223C',
+ THORN: '\u00DE',
+ thorn: '\u00FE',
+ Tilde: '\u223C',
+ tilde: '\u02DC',
+ TildeEqual: '\u2243',
+ TildeFullEqual: '\u2245',
+ TildeTilde: '\u2248',
+ times: '\u00D7',
+ timesb: '\u22A0',
+ timesbar: '\u2A31',
+ timesd: '\u2A30',
+ tint: '\u222D',
+ toea: '\u2928',
+ top: '\u22A4',
+ topbot: '\u2336',
+ topcir: '\u2AF1',
+ Topf: '\uD835\uDD4B',
+ topf: '\uD835\uDD65',
+ topfork: '\u2ADA',
+ tosa: '\u2929',
+ tprime: '\u2034',
+ TRADE: '\u2122',
+ trade: '\u2122',
+ triangle: '\u25B5',
+ triangledown: '\u25BF',
+ triangleleft: '\u25C3',
+ trianglelefteq: '\u22B4',
+ triangleq: '\u225C',
+ triangleright: '\u25B9',
+ trianglerighteq: '\u22B5',
+ tridot: '\u25EC',
+ trie: '\u225C',
+ triminus: '\u2A3A',
+ TripleDot: '\u20DB',
+ triplus: '\u2A39',
+ trisb: '\u29CD',
+ tritime: '\u2A3B',
+ trpezium: '\u23E2',
+ Tscr: '\uD835\uDCAF',
+ tscr: '\uD835\uDCC9',
+ TScy: '\u0426',
+ tscy: '\u0446',
+ TSHcy: '\u040B',
+ tshcy: '\u045B',
+ Tstrok: '\u0166',
+ tstrok: '\u0167',
+ twixt: '\u226C',
+ twoheadleftarrow: '\u219E',
+ twoheadrightarrow: '\u21A0',
+ Uacute: '\u00DA',
+ uacute: '\u00FA',
+ Uarr: '\u219F',
+ uArr: '\u21D1',
+ uarr: '\u2191',
+ Uarrocir: '\u2949',
+ Ubrcy: '\u040E',
+ ubrcy: '\u045E',
+ Ubreve: '\u016C',
+ ubreve: '\u016D',
+ Ucirc: '\u00DB',
+ ucirc: '\u00FB',
+ Ucy: '\u0423',
+ ucy: '\u0443',
+ udarr: '\u21C5',
+ Udblac: '\u0170',
+ udblac: '\u0171',
+ udhar: '\u296E',
+ ufisht: '\u297E',
+ Ufr: '\uD835\uDD18',
+ ufr: '\uD835\uDD32',
+ Ugrave: '\u00D9',
+ ugrave: '\u00F9',
+ uHar: '\u2963',
+ uharl: '\u21BF',
+ uharr: '\u21BE',
+ uhblk: '\u2580',
+ ulcorn: '\u231C',
+ ulcorner: '\u231C',
+ ulcrop: '\u230F',
+ ultri: '\u25F8',
+ Umacr: '\u016A',
+ umacr: '\u016B',
+ uml: '\u00A8',
+ UnderBar: '\u005F',
+ UnderBrace: '\u23DF',
+ UnderBracket: '\u23B5',
+ UnderParenthesis: '\u23DD',
+ Union: '\u22C3',
+ UnionPlus: '\u228E',
+ Uogon: '\u0172',
+ uogon: '\u0173',
+ Uopf: '\uD835\uDD4C',
+ uopf: '\uD835\uDD66',
+ UpArrow: '\u2191',
+ Uparrow: '\u21D1',
+ uparrow: '\u2191',
+ UpArrowBar: '\u2912',
+ UpArrowDownArrow: '\u21C5',
+ UpDownArrow: '\u2195',
+ Updownarrow: '\u21D5',
+ updownarrow: '\u2195',
+ UpEquilibrium: '\u296E',
+ upharpoonleft: '\u21BF',
+ upharpoonright: '\u21BE',
+ uplus: '\u228E',
+ UpperLeftArrow: '\u2196',
+ UpperRightArrow: '\u2197',
+ Upsi: '\u03D2',
+ upsi: '\u03C5',
+ upsih: '\u03D2',
+ Upsilon: '\u03A5',
+ upsilon: '\u03C5',
+ UpTee: '\u22A5',
+ UpTeeArrow: '\u21A5',
+ upuparrows: '\u21C8',
+ urcorn: '\u231D',
+ urcorner: '\u231D',
+ urcrop: '\u230E',
+ Uring: '\u016E',
+ uring: '\u016F',
+ urtri: '\u25F9',
+ Uscr: '\uD835\uDCB0',
+ uscr: '\uD835\uDCCA',
+ utdot: '\u22F0',
+ Utilde: '\u0168',
+ utilde: '\u0169',
+ utri: '\u25B5',
+ utrif: '\u25B4',
+ uuarr: '\u21C8',
+ Uuml: '\u00DC',
+ uuml: '\u00FC',
+ uwangle: '\u29A7',
+ vangrt: '\u299C',
+ varepsilon: '\u03F5',
+ varkappa: '\u03F0',
+ varnothing: '\u2205',
+ varphi: '\u03D5',
+ varpi: '\u03D6',
+ varpropto: '\u221D',
+ vArr: '\u21D5',
+ varr: '\u2195',
+ varrho: '\u03F1',
+ varsigma: '\u03C2',
+ varsubsetneq: '\u228A\uFE00',
+ varsubsetneqq: '\u2ACB\uFE00',
+ varsupsetneq: '\u228B\uFE00',
+ varsupsetneqq: '\u2ACC\uFE00',
+ vartheta: '\u03D1',
+ vartriangleleft: '\u22B2',
+ vartriangleright: '\u22B3',
+ Vbar: '\u2AEB',
+ vBar: '\u2AE8',
+ vBarv: '\u2AE9',
+ Vcy: '\u0412',
+ vcy: '\u0432',
+ VDash: '\u22AB',
+ Vdash: '\u22A9',
+ vDash: '\u22A8',
+ vdash: '\u22A2',
+ Vdashl: '\u2AE6',
+ Vee: '\u22C1',
+ vee: '\u2228',
+ veebar: '\u22BB',
+ veeeq: '\u225A',
+ vellip: '\u22EE',
+ Verbar: '\u2016',
+ verbar: '\u007C',
+ Vert: '\u2016',
+ vert: '\u007C',
+ VerticalBar: '\u2223',
+ VerticalLine: '\u007C',
+ VerticalSeparator: '\u2758',
+ VerticalTilde: '\u2240',
+ VeryThinSpace: '\u200A',
+ Vfr: '\uD835\uDD19',
+ vfr: '\uD835\uDD33',
+ vltri: '\u22B2',
+ vnsub: '\u2282\u20D2',
+ vnsup: '\u2283\u20D2',
+ Vopf: '\uD835\uDD4D',
+ vopf: '\uD835\uDD67',
+ vprop: '\u221D',
+ vrtri: '\u22B3',
+ Vscr: '\uD835\uDCB1',
+ vscr: '\uD835\uDCCB',
+ vsubnE: '\u2ACB\uFE00',
+ vsubne: '\u228A\uFE00',
+ vsupnE: '\u2ACC\uFE00',
+ vsupne: '\u228B\uFE00',
+ Vvdash: '\u22AA',
+ vzigzag: '\u299A',
+ Wcirc: '\u0174',
+ wcirc: '\u0175',
+ wedbar: '\u2A5F',
+ Wedge: '\u22C0',
+ wedge: '\u2227',
+ wedgeq: '\u2259',
+ weierp: '\u2118',
+ Wfr: '\uD835\uDD1A',
+ wfr: '\uD835\uDD34',
+ Wopf: '\uD835\uDD4E',
+ wopf: '\uD835\uDD68',
+ wp: '\u2118',
+ wr: '\u2240',
+ wreath: '\u2240',
+ Wscr: '\uD835\uDCB2',
+ wscr: '\uD835\uDCCC',
+ xcap: '\u22C2',
+ xcirc: '\u25EF',
+ xcup: '\u22C3',
+ xdtri: '\u25BD',
+ Xfr: '\uD835\uDD1B',
+ xfr: '\uD835\uDD35',
+ xhArr: '\u27FA',
+ xharr: '\u27F7',
+ Xi: '\u039E',
+ xi: '\u03BE',
+ xlArr: '\u27F8',
+ xlarr: '\u27F5',
+ xmap: '\u27FC',
+ xnis: '\u22FB',
+ xodot: '\u2A00',
+ Xopf: '\uD835\uDD4F',
+ xopf: '\uD835\uDD69',
+ xoplus: '\u2A01',
+ xotime: '\u2A02',
+ xrArr: '\u27F9',
+ xrarr: '\u27F6',
+ Xscr: '\uD835\uDCB3',
+ xscr: '\uD835\uDCCD',
+ xsqcup: '\u2A06',
+ xuplus: '\u2A04',
+ xutri: '\u25B3',
+ xvee: '\u22C1',
+ xwedge: '\u22C0',
+ Yacute: '\u00DD',
+ yacute: '\u00FD',
+ YAcy: '\u042F',
+ yacy: '\u044F',
+ Ycirc: '\u0176',
+ ycirc: '\u0177',
+ Ycy: '\u042B',
+ ycy: '\u044B',
+ yen: '\u00A5',
+ Yfr: '\uD835\uDD1C',
+ yfr: '\uD835\uDD36',
+ YIcy: '\u0407',
+ yicy: '\u0457',
+ Yopf: '\uD835\uDD50',
+ yopf: '\uD835\uDD6A',
+ Yscr: '\uD835\uDCB4',
+ yscr: '\uD835\uDCCE',
+ YUcy: '\u042E',
+ yucy: '\u044E',
+ Yuml: '\u0178',
+ yuml: '\u00FF',
+ Zacute: '\u0179',
+ zacute: '\u017A',
+ Zcaron: '\u017D',
+ zcaron: '\u017E',
+ Zcy: '\u0417',
+ zcy: '\u0437',
+ Zdot: '\u017B',
+ zdot: '\u017C',
+ zeetrf: '\u2128',
+ ZeroWidthSpace: '\u200B',
+ Zeta: '\u0396',
+ zeta: '\u03B6',
+ Zfr: '\u2128',
+ zfr: '\uD835\uDD37',
+ ZHcy: '\u0416',
+ zhcy: '\u0436',
+ zigrarr: '\u21DD',
+ Zopf: '\u2124',
+ zopf: '\uD835\uDD6B',
+ Zscr: '\uD835\uDCB5',
+ zscr: '\uD835\uDCCF',
+ zwj: '\u200D',
+ zwnj: '\u200C',
+});
+
+/**
+ * @deprecated use `HTML_ENTITIES` instead
+ * @see HTML_ENTITIES
+ */
+exports.entityMap = exports.HTML_ENTITIES;
+
+},{"./conventions":2}],6:[function(require,module,exports){
+var dom = require('./dom')
+exports.DOMImplementation = dom.DOMImplementation
+exports.XMLSerializer = dom.XMLSerializer
+exports.DOMParser = require('./dom-parser').DOMParser
+
+},{"./dom":4,"./dom-parser":3}],7:[function(require,module,exports){
+var NAMESPACE = require("./conventions").NAMESPACE;
+
+//[4] NameStartChar ::= ":" | [A-Z] | "_" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]
+//[4a] NameChar ::= NameStartChar | "-" | "." | [0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040]
+//[5] Name ::= NameStartChar (NameChar)*
+var nameStartChar = /[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]///\u10000-\uEFFFF
+var nameChar = new RegExp("[\\-\\.0-9"+nameStartChar.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]");
+var tagNamePattern = new RegExp('^'+nameStartChar.source+nameChar.source+'*(?:\:'+nameStartChar.source+nameChar.source+'*)?$');
+//var tagNamePattern = /^[a-zA-Z_][\w\-\.]*(?:\:[a-zA-Z_][\w\-\.]*)?$/
+//var handlers = 'resolveEntity,getExternalSubset,characters,endDocument,endElement,endPrefixMapping,ignorableWhitespace,processingInstruction,setDocumentLocator,skippedEntity,startDocument,startElement,startPrefixMapping,notationDecl,unparsedEntityDecl,error,fatalError,warning,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,comment,endCDATA,endDTD,endEntity,startCDATA,startDTD,startEntity'.split(',')
+
+//S_TAG, S_ATTR, S_EQ, S_ATTR_NOQUOT_VALUE
+//S_ATTR_SPACE, S_ATTR_END, S_TAG_SPACE, S_TAG_CLOSE
+var S_TAG = 0;//tag name offerring
+var S_ATTR = 1;//attr name offerring
+var S_ATTR_SPACE=2;//attr name end and space offer
+var S_EQ = 3;//=space?
+var S_ATTR_NOQUOT_VALUE = 4;//attr value(no quot value only)
+var S_ATTR_END = 5;//attr value end and no space(quot end)
+var S_TAG_SPACE = 6;//(attr value end || tag end ) && (space offer)
+var S_TAG_CLOSE = 7;//closed el<el />
+
+/**
+ * Creates an error that will not be caught by XMLReader aka the SAX parser.
+ *
+ * @param {string} message
+ * @param {any?} locator Optional, can provide details about the location in the source
+ * @constructor
+ */
+function ParseError(message, locator) {
+ this.message = message
+ this.locator = locator
+ if(Error.captureStackTrace) Error.captureStackTrace(this, ParseError);
+}
+ParseError.prototype = new Error();
+ParseError.prototype.name = ParseError.name
+
+function XMLReader(){
+
+}
+
+XMLReader.prototype = {
+ parse:function(source,defaultNSMap,entityMap){
+ var domBuilder = this.domBuilder;
+ domBuilder.startDocument();
+ _copy(defaultNSMap ,defaultNSMap = {})
+ parse(source,defaultNSMap,entityMap,
+ domBuilder,this.errorHandler);
+ domBuilder.endDocument();
+ }
+}
+function parse(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){
+ function fixedFromCharCode(code) {
+ // String.prototype.fromCharCode does not supports
+ // > 2 bytes unicode chars directly
+ if (code > 0xffff) {
+ code -= 0x10000;
+ var surrogate1 = 0xd800 + (code >> 10)
+ , surrogate2 = 0xdc00 + (code & 0x3ff);
+
+ return String.fromCharCode(surrogate1, surrogate2);
+ } else {
+ return String.fromCharCode(code);
+ }
+ }
+ function entityReplacer(a){
+ var k = a.slice(1,-1);
+ if (Object.hasOwnProperty.call(entityMap, k)) {
+ return entityMap[k];
+ }else if(k.charAt(0) === '#'){
+ return fixedFromCharCode(parseInt(k.substr(1).replace('x','0x')))
+ }else{
+ errorHandler.error('entity not found:'+a);
+ return a;
+ }
+ }
+ function appendText(end){//has some bugs
+ if(end>start){
+ var xt = source.substring(start,end).replace(/&#?\w+;/g,entityReplacer);
+ locator&&position(start);
+ domBuilder.characters(xt,0,end-start);
+ start = end
+ }
+ }
+ function position(p,m){
+ while(p>=lineEnd && (m = linePattern.exec(source))){
+ lineStart = m.index;
+ lineEnd = lineStart + m[0].length;
+ locator.lineNumber++;
+ //console.log('line++:',locator,startPos,endPos)
+ }
+ locator.columnNumber = p-lineStart+1;
+ }
+ var lineStart = 0;
+ var lineEnd = 0;
+ var linePattern = /.*(?:\r\n?|\n)|.*$/g
+ var locator = domBuilder.locator;
+
+ var parseStack = [{currentNSMap:defaultNSMapCopy}]
+ var closeMap = {};
+ var start = 0;
+ while(true){
+ try{
+ var tagStart = source.indexOf('<',start);
+ if(tagStart<0){
+ if(!source.substr(start).match(/^\s*$/)){
+ var doc = domBuilder.doc;
+ var text = doc.createTextNode(source.substr(start));
+ doc.appendChild(text);
+ domBuilder.currentElement = text;
+ }
+ return;
+ }
+ if(tagStart>start){
+ appendText(tagStart);
+ }
+ switch(source.charAt(tagStart+1)){
+ case '/':
+ var end = source.indexOf('>',tagStart+3);
+ var tagName = source.substring(tagStart + 2, end).replace(/[ \t\n\r]+$/g, '');
+ var config = parseStack.pop();
+ if(end<0){
+
+ tagName = source.substring(tagStart+2).replace(/[\s<].*/,'');
+ errorHandler.error("end tag name: "+tagName+' is not complete:'+config.tagName);
+ end = tagStart+1+tagName.length;
+ }else if(tagName.match(/\s</)){
+ tagName = tagName.replace(/[\s<].*/,'');
+ errorHandler.error("end tag name: "+tagName+' maybe not complete');
+ end = tagStart+1+tagName.length;
+ }
+ var localNSMap = config.localNSMap;
+ var endMatch = config.tagName == tagName;
+ var endIgnoreCaseMach = endMatch || config.tagName&&config.tagName.toLowerCase() == tagName.toLowerCase()
+ if(endIgnoreCaseMach){
+ domBuilder.endElement(config.uri,config.localName,tagName);
+ if(localNSMap){
+ for (var prefix in localNSMap) {
+ if (Object.prototype.hasOwnProperty.call(localNSMap, prefix)) {
+ domBuilder.endPrefixMapping(prefix);
+ }
+ }
+ }
+ if(!endMatch){
+ errorHandler.fatalError("end tag name: "+tagName+' is not match the current start tagName:'+config.tagName ); // No known test case
+ }
+ }else{
+ parseStack.push(config)
+ }
+
+ end++;
+ break;
+ // end elment
+ case '?':// <?...?>
+ locator&&position(tagStart);
+ end = parseInstruction(source,tagStart,domBuilder);
+ break;
+ case '!':// <!doctype,<![CDATA,<!--
+ locator&&position(tagStart);
+ end = parseDCC(source,tagStart,domBuilder,errorHandler);
+ break;
+ default:
+ locator&&position(tagStart);
+ var el = new ElementAttributes();
+ var currentNSMap = parseStack[parseStack.length-1].currentNSMap;
+ //elStartEnd
+ var end = parseElementStartPart(source,tagStart,el,currentNSMap,entityReplacer,errorHandler);
+ var len = el.length;
+
+
+ if(!el.closed && fixSelfClosed(source,end,el.tagName,closeMap)){
+ el.closed = true;
+ if(!entityMap.nbsp){
+ errorHandler.warning('unclosed xml attribute');
+ }
+ }
+ if(locator && len){
+ var locator2 = copyLocator(locator,{});
+ //try{//attribute position fixed
+ for(var i = 0;i<len;i++){
+ var a = el[i];
+ position(a.offset);
+ a.locator = copyLocator(locator,{});
+ }
+ domBuilder.locator = locator2
+ if(appendElement(el,domBuilder,currentNSMap)){
+ parseStack.push(el)
+ }
+ domBuilder.locator = locator;
+ }else{
+ if(appendElement(el,domBuilder,currentNSMap)){
+ parseStack.push(el)
+ }
+ }
+
+ if (NAMESPACE.isHTML(el.uri) && !el.closed) {
+ end = parseHtmlSpecialContent(source,end,el.tagName,entityReplacer,domBuilder)
+ } else {
+ end++;
+ }
+ }
+ }catch(e){
+ if (e instanceof ParseError) {
+ throw e;
+ }
+ errorHandler.error('element parse error: '+e)
+ end = -1;
+ }
+ if(end>start){
+ start = end;
+ }else{
+ //TODO: 这里有可能sax回退,有位置错误风险
+ appendText(Math.max(tagStart,start)+1);
+ }
+ }
+}
+function copyLocator(f,t){
+ t.lineNumber = f.lineNumber;
+ t.columnNumber = f.columnNumber;
+ return t;
+}
+
+/**
+ * @see #appendElement(source,elStartEnd,el,selfClosed,entityReplacer,domBuilder,parseStack);
+ * @return end of the elementStartPart(end of elementEndPart for selfClosed el)
+ */
+function parseElementStartPart(source,start,el,currentNSMap,entityReplacer,errorHandler){
+
+ /**
+ * @param {string} qname
+ * @param {string} value
+ * @param {number} startIndex
+ */
+ function addAttribute(qname, value, startIndex) {
+ if (el.attributeNames.hasOwnProperty(qname)) {
+ errorHandler.fatalError('Attribute ' + qname + ' redefined')
+ }
+ el.addValue(
+ qname,
+ // @see https://www.w3.org/TR/xml/#AVNormalize
+ // since the xmldom sax parser does not "interpret" DTD the following is not implemented:
+ // - recursive replacement of (DTD) entity references
+ // - trimming and collapsing multiple spaces into a single one for attributes that are not of type CDATA
+ value.replace(/[\t\n\r]/g, ' ').replace(/&#?\w+;/g, entityReplacer),
+ startIndex
+ )
+ }
+ var attrName;
+ var value;
+ var p = ++start;
+ var s = S_TAG;//status
+ while(true){
+ var c = source.charAt(p);
+ switch(c){
+ case '=':
+ if(s === S_ATTR){//attrName
+ attrName = source.slice(start,p);
+ s = S_EQ;
+ }else if(s === S_ATTR_SPACE){
+ s = S_EQ;
+ }else{
+ //fatalError: equal must after attrName or space after attrName
+ throw new Error('attribute equal must after attrName'); // No known test case
+ }
+ break;
+ case '\'':
+ case '"':
+ if(s === S_EQ || s === S_ATTR //|| s == S_ATTR_SPACE
+ ){//equal
+ if(s === S_ATTR){
+ errorHandler.warning('attribute value must after "="')
+ attrName = source.slice(start,p)
+ }
+ start = p+1;
+ p = source.indexOf(c,start)
+ if(p>0){
+ value = source.slice(start, p);
+ addAttribute(attrName, value, start-1);
+ s = S_ATTR_END;
+ }else{
+ //fatalError: no end quot match
+ throw new Error('attribute value no end \''+c+'\' match');
+ }
+ }else if(s == S_ATTR_NOQUOT_VALUE){
+ value = source.slice(start, p);
+ addAttribute(attrName, value, start);
+ errorHandler.warning('attribute "'+attrName+'" missed start quot('+c+')!!');
+ start = p+1;
+ s = S_ATTR_END
+ }else{
+ //fatalError: no equal before
+ throw new Error('attribute value must after "="'); // No known test case
+ }
+ break;
+ case '/':
+ switch(s){
+ case S_TAG:
+ el.setTagName(source.slice(start,p));
+ case S_ATTR_END:
+ case S_TAG_SPACE:
+ case S_TAG_CLOSE:
+ s =S_TAG_CLOSE;
+ el.closed = true;
+ case S_ATTR_NOQUOT_VALUE:
+ case S_ATTR:
+ break;
+ case S_ATTR_SPACE:
+ el.closed = true;
+ break;
+ //case S_EQ:
+ default:
+ throw new Error("attribute invalid close char('/')") // No known test case
+ }
+ break;
+ case ''://end document
+ errorHandler.error('unexpected end of input');
+ if(s == S_TAG){
+ el.setTagName(source.slice(start,p));
+ }
+ return p;
+ case '>':
+ switch(s){
+ case S_TAG:
+ el.setTagName(source.slice(start,p));
+ case S_ATTR_END:
+ case S_TAG_SPACE:
+ case S_TAG_CLOSE:
+ break;//normal
+ case S_ATTR_NOQUOT_VALUE://Compatible state
+ case S_ATTR:
+ value = source.slice(start,p);
+ if(value.slice(-1) === '/'){
+ el.closed = true;
+ value = value.slice(0,-1)
+ }
+ case S_ATTR_SPACE:
+ if(s === S_ATTR_SPACE){
+ value = attrName;
+ }
+ if(s == S_ATTR_NOQUOT_VALUE){
+ errorHandler.warning('attribute "'+value+'" missed quot(")!');
+ addAttribute(attrName, value, start)
+ }else{
+ if(!NAMESPACE.isHTML(currentNSMap['']) || !value.match(/^(?:disabled|checked|selected)$/i)){
+ errorHandler.warning('attribute "'+value+'" missed value!! "'+value+'" instead!!')
+ }
+ addAttribute(value, value, start)
+ }
+ break;
+ case S_EQ:
+ throw new Error('attribute value missed!!');
+ }
+// console.log(tagName,tagNamePattern,tagNamePattern.test(tagName))
+ return p;
+ /*xml space '\x20' | #x9 | #xD | #xA; */
+ case '\u0080':
+ c = ' ';
+ default:
+ if(c<= ' '){//space
+ switch(s){
+ case S_TAG:
+ el.setTagName(source.slice(start,p));//tagName
+ s = S_TAG_SPACE;
+ break;
+ case S_ATTR:
+ attrName = source.slice(start,p)
+ s = S_ATTR_SPACE;
+ break;
+ case S_ATTR_NOQUOT_VALUE:
+ var value = source.slice(start, p);
+ errorHandler.warning('attribute "'+value+'" missed quot(")!!');
+ addAttribute(attrName, value, start)
+ case S_ATTR_END:
+ s = S_TAG_SPACE;
+ break;
+ //case S_TAG_SPACE:
+ //case S_EQ:
+ //case S_ATTR_SPACE:
+ // void();break;
+ //case S_TAG_CLOSE:
+ //ignore warning
+ }
+ }else{//not space
+//S_TAG, S_ATTR, S_EQ, S_ATTR_NOQUOT_VALUE
+//S_ATTR_SPACE, S_ATTR_END, S_TAG_SPACE, S_TAG_CLOSE
+ switch(s){
+ //case S_TAG:void();break;
+ //case S_ATTR:void();break;
+ //case S_ATTR_NOQUOT_VALUE:void();break;
+ case S_ATTR_SPACE:
+ var tagName = el.tagName;
+ if (!NAMESPACE.isHTML(currentNSMap['']) || !attrName.match(/^(?:disabled|checked|selected)$/i)) {
+ errorHandler.warning('attribute "'+attrName+'" missed value!! "'+attrName+'" instead2!!')
+ }
+ addAttribute(attrName, attrName, start);
+ start = p;
+ s = S_ATTR;
+ break;
+ case S_ATTR_END:
+ errorHandler.warning('attribute space is required"'+attrName+'"!!')
+ case S_TAG_SPACE:
+ s = S_ATTR;
+ start = p;
+ break;
+ case S_EQ:
+ s = S_ATTR_NOQUOT_VALUE;
+ start = p;
+ break;
+ case S_TAG_CLOSE:
+ throw new Error("elements closed character '/' and '>' must be connected to");
+ }
+ }
+ }//end outer switch
+ //console.log('p++',p)
+ p++;
+ }
+}
+/**
+ * @return true if has new namespace define
+ */
+function appendElement(el,domBuilder,currentNSMap){
+ var tagName = el.tagName;
+ var localNSMap = null;
+ //var currentNSMap = parseStack[parseStack.length-1].currentNSMap;
+ var i = el.length;
+ while(i--){
+ var a = el[i];
+ var qName = a.qName;
+ var value = a.value;
+ var nsp = qName.indexOf(':');
+ if(nsp>0){
+ var prefix = a.prefix = qName.slice(0,nsp);
+ var localName = qName.slice(nsp+1);
+ var nsPrefix = prefix === 'xmlns' && localName
+ }else{
+ localName = qName;
+ prefix = null
+ nsPrefix = qName === 'xmlns' && ''
+ }
+ //can not set prefix,because prefix !== ''
+ a.localName = localName ;
+ //prefix == null for no ns prefix attribute
+ if(nsPrefix !== false){//hack!!
+ if(localNSMap == null){
+ localNSMap = {}
+ //console.log(currentNSMap,0)
+ _copy(currentNSMap,currentNSMap={})
+ //console.log(currentNSMap,1)
+ }
+ currentNSMap[nsPrefix] = localNSMap[nsPrefix] = value;
+ a.uri = NAMESPACE.XMLNS
+ domBuilder.startPrefixMapping(nsPrefix, value)
+ }
+ }
+ var i = el.length;
+ while(i--){
+ a = el[i];
+ var prefix = a.prefix;
+ if(prefix){//no prefix attribute has no namespace
+ if(prefix === 'xml'){
+ a.uri = NAMESPACE.XML;
+ }if(prefix !== 'xmlns'){
+ a.uri = currentNSMap[prefix || '']
+
+ //{console.log('###'+a.qName,domBuilder.locator.systemId+'',currentNSMap,a.uri)}
+ }
+ }
+ }
+ var nsp = tagName.indexOf(':');
+ if(nsp>0){
+ prefix = el.prefix = tagName.slice(0,nsp);
+ localName = el.localName = tagName.slice(nsp+1);
+ }else{
+ prefix = null;//important!!
+ localName = el.localName = tagName;
+ }
+ //no prefix element has default namespace
+ var ns = el.uri = currentNSMap[prefix || ''];
+ domBuilder.startElement(ns,localName,tagName,el);
+ //endPrefixMapping and startPrefixMapping have not any help for dom builder
+ //localNSMap = null
+ if(el.closed){
+ domBuilder.endElement(ns,localName,tagName);
+ if(localNSMap){
+ for (prefix in localNSMap) {
+ if (Object.prototype.hasOwnProperty.call(localNSMap, prefix)) {
+ domBuilder.endPrefixMapping(prefix);
+ }
+ }
+ }
+ }else{
+ el.currentNSMap = currentNSMap;
+ el.localNSMap = localNSMap;
+ //parseStack.push(el);
+ return true;
+ }
+}
+function parseHtmlSpecialContent(source,elStartEnd,tagName,entityReplacer,domBuilder){
+ if(/^(?:script|textarea)$/i.test(tagName)){
+ var elEndStart = source.indexOf('</'+tagName+'>',elStartEnd);
+ var text = source.substring(elStartEnd+1,elEndStart);
+ if(/[&<]/.test(text)){
+ if(/^script$/i.test(tagName)){
+ //if(!/\]\]>/.test(text)){
+ //lexHandler.startCDATA();
+ domBuilder.characters(text,0,text.length);
+ //lexHandler.endCDATA();
+ return elEndStart;
+ //}
+ }//}else{//text area
+ text = text.replace(/&#?\w+;/g,entityReplacer);
+ domBuilder.characters(text,0,text.length);
+ return elEndStart;
+ //}
+
+ }
+ }
+ return elStartEnd+1;
+}
+function fixSelfClosed(source,elStartEnd,tagName,closeMap){
+ //if(tagName in closeMap){
+ var pos = closeMap[tagName];
+ if(pos == null){
+ //console.log(tagName)
+ pos = source.lastIndexOf('</'+tagName+'>')
+ if(pos<elStartEnd){//忘记闭合
+ pos = source.lastIndexOf('</'+tagName)
+ }
+ closeMap[tagName] =pos
+ }
+ return pos<elStartEnd;
+ //}
+}
+
+function _copy (source, target) {
+ for (var n in source) {
+ if (Object.prototype.hasOwnProperty.call(source, n)) {
+ target[n] = source[n];
+ }
+ }
+}
+
+function parseDCC(source,start,domBuilder,errorHandler){//sure start with '<!'
+ var next= source.charAt(start+2)
+ switch(next){
+ case '-':
+ if(source.charAt(start + 3) === '-'){
+ var end = source.indexOf('-->',start+4);
+ //append comment source.substring(4,end)//<!--
+ if(end>start){
+ domBuilder.comment(source,start+4,end-start-4);
+ return end+3;
+ }else{
+ errorHandler.error("Unclosed comment");
+ return -1;
+ }
+ }else{
+ //error
+ return -1;
+ }
+ default:
+ if(source.substr(start+3,6) == 'CDATA['){
+ var end = source.indexOf(']]>',start+9);
+ domBuilder.startCDATA();
+ domBuilder.characters(source,start+9,end-start-9);
+ domBuilder.endCDATA()
+ return end+3;
+ }
+ //<!DOCTYPE
+ //startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId)
+ var matchs = split(source,start);
+ var len = matchs.length;
+ if(len>1 && /!doctype/i.test(matchs[0][0])){
+ var name = matchs[1][0];
+ var pubid = false;
+ var sysid = false;
+ if(len>3){
+ if(/^public$/i.test(matchs[2][0])){
+ pubid = matchs[3][0];
+ sysid = len>4 && matchs[4][0];
+ }else if(/^system$/i.test(matchs[2][0])){
+ sysid = matchs[3][0];
+ }
+ }
+ var lastMatch = matchs[len-1]
+ domBuilder.startDTD(name, pubid, sysid);
+ domBuilder.endDTD();
+
+ return lastMatch.index+lastMatch[0].length
+ }
+ }
+ return -1;
+}
+
+
+
+function parseInstruction(source,start,domBuilder){
+ var end = source.indexOf('?>',start);
+ if(end){
+ var match = source.substring(start,end).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);
+ if(match){
+ var len = match[0].length;
+ domBuilder.processingInstruction(match[1], match[2]) ;
+ return end+2;
+ }else{//error
+ return -1;
+ }
+ }
+ return -1;
+}
+
+function ElementAttributes(){
+ this.attributeNames = {}
+}
+ElementAttributes.prototype = {
+ setTagName:function(tagName){
+ if(!tagNamePattern.test(tagName)){
+ throw new Error('invalid tagName:'+tagName)
+ }
+ this.tagName = tagName
+ },
+ addValue:function(qName, value, offset) {
+ if(!tagNamePattern.test(qName)){
+ throw new Error('invalid attribute:'+qName)
+ }
+ this.attributeNames[qName] = this.length;
+ this[this.length++] = {qName:qName,value:value,offset:offset}
+ },
+ length:0,
+ getLocalName:function(i){return this[i].localName},
+ getLocator:function(i){return this[i].locator},
+ getQName:function(i){return this[i].qName},
+ getURI:function(i){return this[i].uri},
+ getValue:function(i){return this[i].value}
+// ,getIndex:function(uri, localName)){
+// if(localName){
+//
+// }else{
+// var qName = uri
+// }
+// },
+// getValue:function(){return this.getValue(this.getIndex.apply(this,arguments))},
+// getType:function(uri,localName){}
+// getType:function(i){},
+}
+
+
+
+function split(source,start){
+ var match;
+ var buf = [];
+ var reg = /'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;
+ reg.lastIndex = start;
+ reg.exec(source);//skip <
+ while(match = reg.exec(source)){
+ buf.push(match);
+ if(match[1])return buf;
+ }
+}
+
+exports.XMLReader = XMLReader;
+exports.ParseError = ParseError;
+
+},{"./conventions":2}],8:[function(require,module,exports){
+'use strict'
+
+exports.byteLength = byteLength
+exports.toByteArray = toByteArray
+exports.fromByteArray = fromByteArray
+
+var lookup = []
+var revLookup = []
+var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
+
+var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
+for (var i = 0, len = code.length; i < len; ++i) {
+ lookup[i] = code[i]
+ revLookup[code.charCodeAt(i)] = i
+}
+
+// Support decoding URL-safe base64 strings, as Node.js does.
+// See: https://en.wikipedia.org/wiki/Base64#URL_applications
+revLookup['-'.charCodeAt(0)] = 62
+revLookup['_'.charCodeAt(0)] = 63
+
+function getLens (b64) {
+ var len = b64.length
+
+ if (len % 4 > 0) {
+ throw new Error('Invalid string. Length must be a multiple of 4')
+ }
+
+ // Trim off extra bytes after placeholder bytes are found
+ // See: https://github.com/beatgammit/base64-js/issues/42
+ var validLen = b64.indexOf('=')
+ if (validLen === -1) validLen = len
+
+ var placeHoldersLen = validLen === len
+ ? 0
+ : 4 - (validLen % 4)
+
+ return [validLen, placeHoldersLen]
+}
+
+// base64 is 4/3 + up to two characters of the original data
+function byteLength (b64) {
+ var lens = getLens(b64)
+ var validLen = lens[0]
+ var placeHoldersLen = lens[1]
+ return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
+}
+
+function _byteLength (b64, validLen, placeHoldersLen) {
+ return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
+}
+
+function toByteArray (b64) {
+ var tmp
+ var lens = getLens(b64)
+ var validLen = lens[0]
+ var placeHoldersLen = lens[1]
+
+ var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
+
+ var curByte = 0
+
+ // if there are placeholders, only get up to the last complete 4 chars
+ var len = placeHoldersLen > 0
+ ? validLen - 4
+ : validLen
+
+ var i
+ for (i = 0; i < len; i += 4) {
+ tmp =
+ (revLookup[b64.charCodeAt(i)] << 18) |
+ (revLookup[b64.charCodeAt(i + 1)] << 12) |
+ (revLookup[b64.charCodeAt(i + 2)] << 6) |
+ revLookup[b64.charCodeAt(i + 3)]
+ arr[curByte++] = (tmp >> 16) & 0xFF
+ arr[curByte++] = (tmp >> 8) & 0xFF
+ arr[curByte++] = tmp & 0xFF
+ }
+
+ if (placeHoldersLen === 2) {
+ tmp =
+ (revLookup[b64.charCodeAt(i)] << 2) |
+ (revLookup[b64.charCodeAt(i + 1)] >> 4)
+ arr[curByte++] = tmp & 0xFF
+ }
+
+ if (placeHoldersLen === 1) {
+ tmp =
+ (revLookup[b64.charCodeAt(i)] << 10) |
+ (revLookup[b64.charCodeAt(i + 1)] << 4) |
+ (revLookup[b64.charCodeAt(i + 2)] >> 2)
+ arr[curByte++] = (tmp >> 8) & 0xFF
+ arr[curByte++] = tmp & 0xFF
+ }
+
+ return arr
+}
+
+function tripletToBase64 (num) {
+ return lookup[num >> 18 & 0x3F] +
+ lookup[num >> 12 & 0x3F] +
+ lookup[num >> 6 & 0x3F] +
+ lookup[num & 0x3F]
+}
+
+function encodeChunk (uint8, start, end) {
+ var tmp
+ var output = []
+ for (var i = start; i < end; i += 3) {
+ tmp =
+ ((uint8[i] << 16) & 0xFF0000) +
+ ((uint8[i + 1] << 8) & 0xFF00) +
+ (uint8[i + 2] & 0xFF)
+ output.push(tripletToBase64(tmp))
+ }
+ return output.join('')
+}
+
+function fromByteArray (uint8) {
+ var tmp
+ var len = uint8.length
+ var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
+ var parts = []
+ var maxChunkLength = 16383 // must be multiple of 3
+
+ // go through the array every three bytes, we'll deal with trailing stuff later
+ for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
+ parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
+ }
+
+ // pad the end with zeros, but make sure to not forget the extra bytes
+ if (extraBytes === 1) {
+ tmp = uint8[len - 1]
+ parts.push(
+ lookup[tmp >> 2] +
+ lookup[(tmp << 4) & 0x3F] +
+ '=='
+ )
+ } else if (extraBytes === 2) {
+ tmp = (uint8[len - 2] << 8) + uint8[len - 1]
+ parts.push(
+ lookup[tmp >> 10] +
+ lookup[(tmp >> 4) & 0x3F] +
+ lookup[(tmp << 2) & 0x3F] +
+ '='
+ )
+ }
+
+ return parts.join('')
+}
+
+},{}],9:[function(require,module,exports){
+(function (Buffer){(function (){
+/*!
+ * The buffer module from node.js, for the browser.
+ *
+ * @author Feross Aboukhadijeh <https://feross.org>
+ * @license MIT
+ */
+/* eslint-disable no-proto */
+
+'use strict'
+
+var base64 = require('base64-js')
+var ieee754 = require('ieee754')
+
+exports.Buffer = Buffer
+exports.SlowBuffer = SlowBuffer
+exports.INSPECT_MAX_BYTES = 50
+
+var K_MAX_LENGTH = 0x7fffffff
+exports.kMaxLength = K_MAX_LENGTH
+
+/**
+ * If `Buffer.TYPED_ARRAY_SUPPORT`:
+ * === true Use Uint8Array implementation (fastest)
+ * === false Print warning and recommend using `buffer` v4.x which has an Object
+ * implementation (most compatible, even IE6)
+ *
+ * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
+ * Opera 11.6+, iOS 4.2+.
+ *
+ * We report that the browser does not support typed arrays if the are not subclassable
+ * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`
+ * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support
+ * for __proto__ and has a buggy typed array implementation.
+ */
+Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport()
+
+if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&
+ typeof console.error === 'function') {
+ console.error(
+ 'This browser lacks typed array (Uint8Array) support which is required by ' +
+ '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'
+ )
+}
+
+function typedArraySupport () {
+ // Can typed array instances can be augmented?
+ try {
+ var arr = new Uint8Array(1)
+ arr.__proto__ = { __proto__: Uint8Array.prototype, foo: function () { return 42 } }
+ return arr.foo() === 42
+ } catch (e) {
+ return false
+ }
+}
+
+Object.defineProperty(Buffer.prototype, 'parent', {
+ enumerable: true,
+ get: function () {
+ if (!Buffer.isBuffer(this)) return undefined
+ return this.buffer
+ }
+})
+
+Object.defineProperty(Buffer.prototype, 'offset', {
+ enumerable: true,
+ get: function () {
+ if (!Buffer.isBuffer(this)) return undefined
+ return this.byteOffset
+ }
+})
+
+function createBuffer (length) {
+ if (length > K_MAX_LENGTH) {
+ throw new RangeError('The value "' + length + '" is invalid for option "size"')
+ }
+ // Return an augmented `Uint8Array` instance
+ var buf = new Uint8Array(length)
+ buf.__proto__ = Buffer.prototype
+ return buf
+}
+
+/**
+ * The Buffer constructor returns instances of `Uint8Array` that have their
+ * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
+ * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
+ * and the `Uint8Array` methods. Square bracket notation works as expected -- it
+ * returns a single octet.
+ *
+ * The `Uint8Array` prototype remains unmodified.
+ */
+
+function Buffer (arg, encodingOrOffset, length) {
+ // Common case.
+ if (typeof arg === 'number') {
+ if (typeof encodingOrOffset === 'string') {
+ throw new TypeError(
+ 'The "string" argument must be of type string. Received type number'
+ )
+ }
+ return allocUnsafe(arg)
+ }
+ return from(arg, encodingOrOffset, length)
+}
+
+// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
+if (typeof Symbol !== 'undefined' && Symbol.species != null &&
+ Buffer[Symbol.species] === Buffer) {
+ Object.defineProperty(Buffer, Symbol.species, {
+ value: null,
+ configurable: true,
+ enumerable: false,
+ writable: false
+ })
+}
+
+Buffer.poolSize = 8192 // not used by this implementation
+
+function from (value, encodingOrOffset, length) {
+ if (typeof value === 'string') {
+ return fromString(value, encodingOrOffset)
+ }
+
+ if (ArrayBuffer.isView(value)) {
+ return fromArrayLike(value)
+ }
+
+ if (value == null) {
+ throw TypeError(
+ 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +
+ 'or Array-like Object. Received type ' + (typeof value)
+ )
+ }
+
+ if (isInstance(value, ArrayBuffer) ||
+ (value && isInstance(value.buffer, ArrayBuffer))) {
+ return fromArrayBuffer(value, encodingOrOffset, length)
+ }
+
+ if (typeof value === 'number') {
+ throw new TypeError(
+ 'The "value" argument must not be of type number. Received type number'
+ )
+ }
+
+ var valueOf = value.valueOf && value.valueOf()
+ if (valueOf != null && valueOf !== value) {
+ return Buffer.from(valueOf, encodingOrOffset, length)
+ }
+
+ var b = fromObject(value)
+ if (b) return b
+
+ if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null &&
+ typeof value[Symbol.toPrimitive] === 'function') {
+ return Buffer.from(
+ value[Symbol.toPrimitive]('string'), encodingOrOffset, length
+ )
+ }
+
+ throw new TypeError(
+ 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +
+ 'or Array-like Object. Received type ' + (typeof value)
+ )
+}
+
+/**
+ * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
+ * if value is a number.
+ * Buffer.from(str[, encoding])
+ * Buffer.from(array)
+ * Buffer.from(buffer)
+ * Buffer.from(arrayBuffer[, byteOffset[, length]])
+ **/
+Buffer.from = function (value, encodingOrOffset, length) {
+ return from(value, encodingOrOffset, length)
+}
+
+// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:
+// https://github.com/feross/buffer/pull/148
+Buffer.prototype.__proto__ = Uint8Array.prototype
+Buffer.__proto__ = Uint8Array
+
+function assertSize (size) {
+ if (typeof size !== 'number') {
+ throw new TypeError('"size" argument must be of type number')
+ } else if (size < 0) {
+ throw new RangeError('The value "' + size + '" is invalid for option "size"')
+ }
+}
+
+function alloc (size, fill, encoding) {
+ assertSize(size)
+ if (size <= 0) {
+ return createBuffer(size)
+ }
+ if (fill !== undefined) {
+ // Only pay attention to encoding if it's a string. This
+ // prevents accidentally sending in a number that would
+ // be interpretted as a start offset.
+ return typeof encoding === 'string'
+ ? createBuffer(size).fill(fill, encoding)
+ : createBuffer(size).fill(fill)
+ }
+ return createBuffer(size)
+}
+
+/**
+ * Creates a new filled Buffer instance.
+ * alloc(size[, fill[, encoding]])
+ **/
+Buffer.alloc = function (size, fill, encoding) {
+ return alloc(size, fill, encoding)
+}
+
+function allocUnsafe (size) {
+ assertSize(size)
+ return createBuffer(size < 0 ? 0 : checked(size) | 0)
+}
+
+/**
+ * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
+ * */
+Buffer.allocUnsafe = function (size) {
+ return allocUnsafe(size)
+}
+/**
+ * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
+ */
+Buffer.allocUnsafeSlow = function (size) {
+ return allocUnsafe(size)
+}
+
+function fromString (string, encoding) {
+ if (typeof encoding !== 'string' || encoding === '') {
+ encoding = 'utf8'
+ }
+
+ if (!Buffer.isEncoding(encoding)) {
+ throw new TypeError('Unknown encoding: ' + encoding)
+ }
+
+ var length = byteLength(string, encoding) | 0
+ var buf = createBuffer(length)
+
+ var actual = buf.write(string, encoding)
+
+ if (actual !== length) {
+ // Writing a hex string, for example, that contains invalid characters will
+ // cause everything after the first invalid character to be ignored. (e.g.
+ // 'abxxcd' will be treated as 'ab')
+ buf = buf.slice(0, actual)
+ }
+
+ return buf
+}
+
+function fromArrayLike (array) {
+ var length = array.length < 0 ? 0 : checked(array.length) | 0
+ var buf = createBuffer(length)
+ for (var i = 0; i < length; i += 1) {
+ buf[i] = array[i] & 255
+ }
+ return buf
+}
+
+function fromArrayBuffer (array, byteOffset, length) {
+ if (byteOffset < 0 || array.byteLength < byteOffset) {
+ throw new RangeError('"offset" is outside of buffer bounds')
+ }
+
+ if (array.byteLength < byteOffset + (length || 0)) {
+ throw new RangeError('"length" is outside of buffer bounds')
+ }
+
+ var buf
+ if (byteOffset === undefined && length === undefined) {
+ buf = new Uint8Array(array)
+ } else if (length === undefined) {
+ buf = new Uint8Array(array, byteOffset)
+ } else {
+ buf = new Uint8Array(array, byteOffset, length)
+ }
+
+ // Return an augmented `Uint8Array` instance
+ buf.__proto__ = Buffer.prototype
+ return buf
+}
+
+function fromObject (obj) {
+ if (Buffer.isBuffer(obj)) {
+ var len = checked(obj.length) | 0
+ var buf = createBuffer(len)
+
+ if (buf.length === 0) {
+ return buf
+ }
+
+ obj.copy(buf, 0, 0, len)
+ return buf
+ }
+
+ if (obj.length !== undefined) {
+ if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {
+ return createBuffer(0)
+ }
+ return fromArrayLike(obj)
+ }
+
+ if (obj.type === 'Buffer' && Array.isArray(obj.data)) {
+ return fromArrayLike(obj.data)
+ }
+}
+
+function checked (length) {
+ // Note: cannot use `length < K_MAX_LENGTH` here because that fails when
+ // length is NaN (which is otherwise coerced to zero.)
+ if (length >= K_MAX_LENGTH) {
+ throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
+ 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')
+ }
+ return length | 0
+}
+
+function SlowBuffer (length) {
+ if (+length != length) { // eslint-disable-line eqeqeq
+ length = 0
+ }
+ return Buffer.alloc(+length)
+}
+
+Buffer.isBuffer = function isBuffer (b) {
+ return b != null && b._isBuffer === true &&
+ b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false
+}
+
+Buffer.compare = function compare (a, b) {
+ if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength)
+ if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength)
+ if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
+ throw new TypeError(
+ 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
+ )
+ }
+
+ if (a === b) return 0
+
+ var x = a.length
+ var y = b.length
+
+ for (var i = 0, len = Math.min(x, y); i < len; ++i) {
+ if (a[i] !== b[i]) {
+ x = a[i]
+ y = b[i]
+ break
+ }
+ }
+
+ if (x < y) return -1
+ if (y < x) return 1
+ return 0
+}
+
+Buffer.isEncoding = function isEncoding (encoding) {
+ switch (String(encoding).toLowerCase()) {
+ case 'hex':
+ case 'utf8':
+ case 'utf-8':
+ case 'ascii':
+ case 'latin1':
+ case 'binary':
+ case 'base64':
+ case 'ucs2':
+ case 'ucs-2':
+ case 'utf16le':
+ case 'utf-16le':
+ return true
+ default:
+ return false
+ }
+}
+
+Buffer.concat = function concat (list, length) {
+ if (!Array.isArray(list)) {
+ throw new TypeError('"list" argument must be an Array of Buffers')
+ }
+
+ if (list.length === 0) {
+ return Buffer.alloc(0)
+ }
+
+ var i
+ if (length === undefined) {
+ length = 0
+ for (i = 0; i < list.length; ++i) {
+ length += list[i].length
+ }
+ }
+
+ var buffer = Buffer.allocUnsafe(length)
+ var pos = 0
+ for (i = 0; i < list.length; ++i) {
+ var buf = list[i]
+ if (isInstance(buf, Uint8Array)) {
+ buf = Buffer.from(buf)
+ }
+ if (!Buffer.isBuffer(buf)) {
+ throw new TypeError('"list" argument must be an Array of Buffers')
+ }
+ buf.copy(buffer, pos)
+ pos += buf.length
+ }
+ return buffer
+}
+
+function byteLength (string, encoding) {
+ if (Buffer.isBuffer(string)) {
+ return string.length
+ }
+ if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {
+ return string.byteLength
+ }
+ if (typeof string !== 'string') {
+ throw new TypeError(
+ 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' +
+ 'Received type ' + typeof string
+ )
+ }
+
+ var len = string.length
+ var mustMatch = (arguments.length > 2 && arguments[2] === true)
+ if (!mustMatch && len === 0) return 0
+
+ // Use a for loop to avoid recursion
+ var loweredCase = false
+ for (;;) {
+ switch (encoding) {
+ case 'ascii':
+ case 'latin1':
+ case 'binary':
+ return len
+ case 'utf8':
+ case 'utf-8':
+ return utf8ToBytes(string).length
+ case 'ucs2':
+ case 'ucs-2':
+ case 'utf16le':
+ case 'utf-16le':
+ return len * 2
+ case 'hex':
+ return len >>> 1
+ case 'base64':
+ return base64ToBytes(string).length
+ default:
+ if (loweredCase) {
+ return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8
+ }
+ encoding = ('' + encoding).toLowerCase()
+ loweredCase = true
+ }
+ }
+}
+Buffer.byteLength = byteLength
+
+function slowToString (encoding, start, end) {
+ var loweredCase = false
+
+ // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
+ // property of a typed array.
+
+ // This behaves neither like String nor Uint8Array in that we set start/end
+ // to their upper/lower bounds if the value passed is out of range.
+ // undefined is handled specially as per ECMA-262 6th Edition,
+ // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
+ if (start === undefined || start < 0) {
+ start = 0
+ }
+ // Return early if start > this.length. Done here to prevent potential uint32
+ // coercion fail below.
+ if (start > this.length) {
+ return ''
+ }
+
+ if (end === undefined || end > this.length) {
+ end = this.length
+ }
+
+ if (end <= 0) {
+ return ''
+ }
+
+ // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
+ end >>>= 0
+ start >>>= 0
+
+ if (end <= start) {
+ return ''
+ }
+
+ if (!encoding) encoding = 'utf8'
+
+ while (true) {
+ switch (encoding) {
+ case 'hex':
+ return hexSlice(this, start, end)
+
+ case 'utf8':
+ case 'utf-8':
+ return utf8Slice(this, start, end)
+
+ case 'ascii':
+ return asciiSlice(this, start, end)
+
+ case 'latin1':
+ case 'binary':
+ return latin1Slice(this, start, end)
+
+ case 'base64':
+ return base64Slice(this, start, end)
+
+ case 'ucs2':
+ case 'ucs-2':
+ case 'utf16le':
+ case 'utf-16le':
+ return utf16leSlice(this, start, end)
+
+ default:
+ if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
+ encoding = (encoding + '').toLowerCase()
+ loweredCase = true
+ }
+ }
+}
+
+// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)
+// to detect a Buffer instance. It's not possible to use `instanceof Buffer`
+// reliably in a browserify context because there could be multiple different
+// copies of the 'buffer' package in use. This method works even for Buffer
+// instances that were created from another copy of the `buffer` package.
+// See: https://github.com/feross/buffer/issues/154
+Buffer.prototype._isBuffer = true
+
+function swap (b, n, m) {
+ var i = b[n]
+ b[n] = b[m]
+ b[m] = i
+}
+
+Buffer.prototype.swap16 = function swap16 () {
+ var len = this.length
+ if (len % 2 !== 0) {
+ throw new RangeError('Buffer size must be a multiple of 16-bits')
+ }
+ for (var i = 0; i < len; i += 2) {
+ swap(this, i, i + 1)
+ }
+ return this
+}
+
+Buffer.prototype.swap32 = function swap32 () {
+ var len = this.length
+ if (len % 4 !== 0) {
+ throw new RangeError('Buffer size must be a multiple of 32-bits')
+ }
+ for (var i = 0; i < len; i += 4) {
+ swap(this, i, i + 3)
+ swap(this, i + 1, i + 2)
+ }
+ return this
+}
+
+Buffer.prototype.swap64 = function swap64 () {
+ var len = this.length
+ if (len % 8 !== 0) {
+ throw new RangeError('Buffer size must be a multiple of 64-bits')
+ }
+ for (var i = 0; i < len; i += 8) {
+ swap(this, i, i + 7)
+ swap(this, i + 1, i + 6)
+ swap(this, i + 2, i + 5)
+ swap(this, i + 3, i + 4)
+ }
+ return this
+}
+
+Buffer.prototype.toString = function toString () {
+ var length = this.length
+ if (length === 0) return ''
+ if (arguments.length === 0) return utf8Slice(this, 0, length)
+ return slowToString.apply(this, arguments)
+}
+
+Buffer.prototype.toLocaleString = Buffer.prototype.toString
+
+Buffer.prototype.equals = function equals (b) {
+ if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
+ if (this === b) return true
+ return Buffer.compare(this, b) === 0
+}
+
+Buffer.prototype.inspect = function inspect () {
+ var str = ''
+ var max = exports.INSPECT_MAX_BYTES
+ str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim()
+ if (this.length > max) str += ' ... '
+ return '<Buffer ' + str + '>'
+}
+
+Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
+ if (isInstance(target, Uint8Array)) {
+ target = Buffer.from(target, target.offset, target.byteLength)
+ }
+ if (!Buffer.isBuffer(target)) {
+ throw new TypeError(
+ 'The "target" argument must be one of type Buffer or Uint8Array. ' +
+ 'Received type ' + (typeof target)
+ )
+ }
+
+ if (start === undefined) {
+ start = 0
+ }
+ if (end === undefined) {
+ end = target ? target.length : 0
+ }
+ if (thisStart === undefined) {
+ thisStart = 0
+ }
+ if (thisEnd === undefined) {
+ thisEnd = this.length
+ }
+
+ if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
+ throw new RangeError('out of range index')
+ }
+
+ if (thisStart >= thisEnd && start >= end) {
+ return 0
+ }
+ if (thisStart >= thisEnd) {
+ return -1
+ }
+ if (start >= end) {
+ return 1
+ }
+
+ start >>>= 0
+ end >>>= 0
+ thisStart >>>= 0
+ thisEnd >>>= 0
+
+ if (this === target) return 0
+
+ var x = thisEnd - thisStart
+ var y = end - start
+ var len = Math.min(x, y)
+
+ var thisCopy = this.slice(thisStart, thisEnd)
+ var targetCopy = target.slice(start, end)
+
+ for (var i = 0; i < len; ++i) {
+ if (thisCopy[i] !== targetCopy[i]) {
+ x = thisCopy[i]
+ y = targetCopy[i]
+ break
+ }
+ }
+
+ if (x < y) return -1
+ if (y < x) return 1
+ return 0
+}
+
+// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
+// OR the last index of `val` in `buffer` at offset <= `byteOffset`.
+//
+// Arguments:
+// - buffer - a Buffer to search
+// - val - a string, Buffer, or number
+// - byteOffset - an index into `buffer`; will be clamped to an int32
+// - encoding - an optional encoding, relevant is val is a string
+// - dir - true for indexOf, false for lastIndexOf
+function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
+ // Empty buffer means no match
+ if (buffer.length === 0) return -1
+
+ // Normalize byteOffset
+ if (typeof byteOffset === 'string') {
+ encoding = byteOffset
+ byteOffset = 0
+ } else if (byteOffset > 0x7fffffff) {
+ byteOffset = 0x7fffffff
+ } else if (byteOffset < -0x80000000) {
+ byteOffset = -0x80000000
+ }
+ byteOffset = +byteOffset // Coerce to Number.
+ if (numberIsNaN(byteOffset)) {
+ // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
+ byteOffset = dir ? 0 : (buffer.length - 1)
+ }
+
+ // Normalize byteOffset: negative offsets start from the end of the buffer
+ if (byteOffset < 0) byteOffset = buffer.length + byteOffset
+ if (byteOffset >= buffer.length) {
+ if (dir) return -1
+ else byteOffset = buffer.length - 1
+ } else if (byteOffset < 0) {
+ if (dir) byteOffset = 0
+ else return -1
+ }
+
+ // Normalize val
+ if (typeof val === 'string') {
+ val = Buffer.from(val, encoding)
+ }
+
+ // Finally, search either indexOf (if dir is true) or lastIndexOf
+ if (Buffer.isBuffer(val)) {
+ // Special case: looking for empty string/buffer always fails
+ if (val.length === 0) {
+ return -1
+ }
+ return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
+ } else if (typeof val === 'number') {
+ val = val & 0xFF // Search for a byte value [0-255]
+ if (typeof Uint8Array.prototype.indexOf === 'function') {
+ if (dir) {
+ return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
+ } else {
+ return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
+ }
+ }
+ return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
+ }
+
+ throw new TypeError('val must be string, number or Buffer')
+}
+
+function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
+ var indexSize = 1
+ var arrLength = arr.length
+ var valLength = val.length
+
+ if (encoding !== undefined) {
+ encoding = String(encoding).toLowerCase()
+ if (encoding === 'ucs2' || encoding === 'ucs-2' ||
+ encoding === 'utf16le' || encoding === 'utf-16le') {
+ if (arr.length < 2 || val.length < 2) {
+ return -1
+ }
+ indexSize = 2
+ arrLength /= 2
+ valLength /= 2
+ byteOffset /= 2
+ }
+ }
+
+ function read (buf, i) {
+ if (indexSize === 1) {
+ return buf[i]
+ } else {
+ return buf.readUInt16BE(i * indexSize)
+ }
+ }
+
+ var i
+ if (dir) {
+ var foundIndex = -1
+ for (i = byteOffset; i < arrLength; i++) {
+ if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
+ if (foundIndex === -1) foundIndex = i
+ if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
+ } else {
+ if (foundIndex !== -1) i -= i - foundIndex
+ foundIndex = -1
+ }
+ }
+ } else {
+ if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
+ for (i = byteOffset; i >= 0; i--) {
+ var found = true
+ for (var j = 0; j < valLength; j++) {
+ if (read(arr, i + j) !== read(val, j)) {
+ found = false
+ break
+ }
+ }
+ if (found) return i
+ }
+ }
+
+ return -1
+}
+
+Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
+ return this.indexOf(val, byteOffset, encoding) !== -1
+}
+
+Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
+ return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
+}
+
+Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
+ return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
+}
+
+function hexWrite (buf, string, offset, length) {
+ offset = Number(offset) || 0
+ var remaining = buf.length - offset
+ if (!length) {
+ length = remaining
+ } else {
+ length = Number(length)
+ if (length > remaining) {
+ length = remaining
+ }
+ }
+
+ var strLen = string.length
+
+ if (length > strLen / 2) {
+ length = strLen / 2
+ }
+ for (var i = 0; i < length; ++i) {
+ var parsed = parseInt(string.substr(i * 2, 2), 16)
+ if (numberIsNaN(parsed)) return i
+ buf[offset + i] = parsed
+ }
+ return i
+}
+
+function utf8Write (buf, string, offset, length) {
+ return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
+}
+
+function asciiWrite (buf, string, offset, length) {
+ return blitBuffer(asciiToBytes(string), buf, offset, length)
+}
+
+function latin1Write (buf, string, offset, length) {
+ return asciiWrite(buf, string, offset, length)
+}
+
+function base64Write (buf, string, offset, length) {
+ return blitBuffer(base64ToBytes(string), buf, offset, length)
+}
+
+function ucs2Write (buf, string, offset, length) {
+ return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
+}
+
+Buffer.prototype.write = function write (string, offset, length, encoding) {
+ // Buffer#write(string)
+ if (offset === undefined) {
+ encoding = 'utf8'
+ length = this.length
+ offset = 0
+ // Buffer#write(string, encoding)
+ } else if (length === undefined && typeof offset === 'string') {
+ encoding = offset
+ length = this.length
+ offset = 0
+ // Buffer#write(string, offset[, length][, encoding])
+ } else if (isFinite(offset)) {
+ offset = offset >>> 0
+ if (isFinite(length)) {
+ length = length >>> 0
+ if (encoding === undefined) encoding = 'utf8'
+ } else {
+ encoding = length
+ length = undefined
+ }
+ } else {
+ throw new Error(
+ 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
+ )
+ }
+
+ var remaining = this.length - offset
+ if (length === undefined || length > remaining) length = remaining
+
+ if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
+ throw new RangeError('Attempt to write outside buffer bounds')
+ }
+
+ if (!encoding) encoding = 'utf8'
+
+ var loweredCase = false
+ for (;;) {
+ switch (encoding) {
+ case 'hex':
+ return hexWrite(this, string, offset, length)
+
+ case 'utf8':
+ case 'utf-8':
+ return utf8Write(this, string, offset, length)
+
+ case 'ascii':
+ return asciiWrite(this, string, offset, length)
+
+ case 'latin1':
+ case 'binary':
+ return latin1Write(this, string, offset, length)
+
+ case 'base64':
+ // Warning: maxLength not taken into account in base64Write
+ return base64Write(this, string, offset, length)
+
+ case 'ucs2':
+ case 'ucs-2':
+ case 'utf16le':
+ case 'utf-16le':
+ return ucs2Write(this, string, offset, length)
+
+ default:
+ if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
+ encoding = ('' + encoding).toLowerCase()
+ loweredCase = true
+ }
+ }
+}
+
+Buffer.prototype.toJSON = function toJSON () {
+ return {
+ type: 'Buffer',
+ data: Array.prototype.slice.call(this._arr || this, 0)
+ }
+}
+
+function base64Slice (buf, start, end) {
+ if (start === 0 && end === buf.length) {
+ return base64.fromByteArray(buf)
+ } else {
+ return base64.fromByteArray(buf.slice(start, end))
+ }
+}
+
+function utf8Slice (buf, start, end) {
+ end = Math.min(buf.length, end)
+ var res = []
+
+ var i = start
+ while (i < end) {
+ var firstByte = buf[i]
+ var codePoint = null
+ var bytesPerSequence = (firstByte > 0xEF) ? 4
+ : (firstByte > 0xDF) ? 3
+ : (firstByte > 0xBF) ? 2
+ : 1
+
+ if (i + bytesPerSequence <= end) {
+ var secondByte, thirdByte, fourthByte, tempCodePoint
+
+ switch (bytesPerSequence) {
+ case 1:
+ if (firstByte < 0x80) {
+ codePoint = firstByte
+ }
+ break
+ case 2:
+ secondByte = buf[i + 1]
+ if ((secondByte & 0xC0) === 0x80) {
+ tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
+ if (tempCodePoint > 0x7F) {
+ codePoint = tempCodePoint
+ }
+ }
+ break
+ case 3:
+ secondByte = buf[i + 1]
+ thirdByte = buf[i + 2]
+ if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
+ tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
+ if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
+ codePoint = tempCodePoint
+ }
+ }
+ break
+ case 4:
+ secondByte = buf[i + 1]
+ thirdByte = buf[i + 2]
+ fourthByte = buf[i + 3]
+ if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
+ tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
+ if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
+ codePoint = tempCodePoint
+ }
+ }
+ }
+ }
+
+ if (codePoint === null) {
+ // we did not generate a valid codePoint so insert a
+ // replacement char (U+FFFD) and advance only 1 byte
+ codePoint = 0xFFFD
+ bytesPerSequence = 1
+ } else if (codePoint > 0xFFFF) {
+ // encode to utf16 (surrogate pair dance)
+ codePoint -= 0x10000
+ res.push(codePoint >>> 10 & 0x3FF | 0xD800)
+ codePoint = 0xDC00 | codePoint & 0x3FF
+ }
+
+ res.push(codePoint)
+ i += bytesPerSequence
+ }
+
+ return decodeCodePointsArray(res)
+}
+
+// Based on http://stackoverflow.com/a/22747272/680742, the browser with
+// the lowest limit is Chrome, with 0x10000 args.
+// We go 1 magnitude less, for safety
+var MAX_ARGUMENTS_LENGTH = 0x1000
+
+function decodeCodePointsArray (codePoints) {
+ var len = codePoints.length
+ if (len <= MAX_ARGUMENTS_LENGTH) {
+ return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
+ }
+
+ // Decode in chunks to avoid "call stack size exceeded".
+ var res = ''
+ var i = 0
+ while (i < len) {
+ res += String.fromCharCode.apply(
+ String,
+ codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
+ )
+ }
+ return res
+}
+
+function asciiSlice (buf, start, end) {
+ var ret = ''
+ end = Math.min(buf.length, end)
+
+ for (var i = start; i < end; ++i) {
+ ret += String.fromCharCode(buf[i] & 0x7F)
+ }
+ return ret
+}
+
+function latin1Slice (buf, start, end) {
+ var ret = ''
+ end = Math.min(buf.length, end)
+
+ for (var i = start; i < end; ++i) {
+ ret += String.fromCharCode(buf[i])
+ }
+ return ret
+}
+
+function hexSlice (buf, start, end) {
+ var len = buf.length
+
+ if (!start || start < 0) start = 0
+ if (!end || end < 0 || end > len) end = len
+
+ var out = ''
+ for (var i = start; i < end; ++i) {
+ out += toHex(buf[i])
+ }
+ return out
+}
+
+function utf16leSlice (buf, start, end) {
+ var bytes = buf.slice(start, end)
+ var res = ''
+ for (var i = 0; i < bytes.length; i += 2) {
+ res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))
+ }
+ return res
+}
+
+Buffer.prototype.slice = function slice (start, end) {
+ var len = this.length
+ start = ~~start
+ end = end === undefined ? len : ~~end
+
+ if (start < 0) {
+ start += len
+ if (start < 0) start = 0
+ } else if (start > len) {
+ start = len
+ }
+
+ if (end < 0) {
+ end += len
+ if (end < 0) end = 0
+ } else if (end > len) {
+ end = len
+ }
+
+ if (end < start) end = start
+
+ var newBuf = this.subarray(start, end)
+ // Return an augmented `Uint8Array` instance
+ newBuf.__proto__ = Buffer.prototype
+ return newBuf
+}
+
+/*
+ * Need to make sure that buffer isn't trying to write out of bounds.
+ */
+function checkOffset (offset, ext, length) {
+ if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
+ if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
+}
+
+Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
+ offset = offset >>> 0
+ byteLength = byteLength >>> 0
+ if (!noAssert) checkOffset(offset, byteLength, this.length)
+
+ var val = this[offset]
+ var mul = 1
+ var i = 0
+ while (++i < byteLength && (mul *= 0x100)) {
+ val += this[offset + i] * mul
+ }
+
+ return val
+}
+
+Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
+ offset = offset >>> 0
+ byteLength = byteLength >>> 0
+ if (!noAssert) {
+ checkOffset(offset, byteLength, this.length)
+ }
+
+ var val = this[offset + --byteLength]
+ var mul = 1
+ while (byteLength > 0 && (mul *= 0x100)) {
+ val += this[offset + --byteLength] * mul
+ }
+
+ return val
+}
+
+Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
+ offset = offset >>> 0
+ if (!noAssert) checkOffset(offset, 1, this.length)
+ return this[offset]
+}
+
+Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
+ offset = offset >>> 0
+ if (!noAssert) checkOffset(offset, 2, this.length)
+ return this[offset] | (this[offset + 1] << 8)
+}
+
+Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
+ offset = offset >>> 0
+ if (!noAssert) checkOffset(offset, 2, this.length)
+ return (this[offset] << 8) | this[offset + 1]
+}
+
+Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
+ offset = offset >>> 0
+ if (!noAssert) checkOffset(offset, 4, this.length)
+
+ return ((this[offset]) |
+ (this[offset + 1] << 8) |
+ (this[offset + 2] << 16)) +
+ (this[offset + 3] * 0x1000000)
+}
+
+Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
+ offset = offset >>> 0
+ if (!noAssert) checkOffset(offset, 4, this.length)
+
+ return (this[offset] * 0x1000000) +
+ ((this[offset + 1] << 16) |
+ (this[offset + 2] << 8) |
+ this[offset + 3])
+}
+
+Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
+ offset = offset >>> 0
+ byteLength = byteLength >>> 0
+ if (!noAssert) checkOffset(offset, byteLength, this.length)
+
+ var val = this[offset]
+ var mul = 1
+ var i = 0
+ while (++i < byteLength && (mul *= 0x100)) {
+ val += this[offset + i] * mul
+ }
+ mul *= 0x80
+
+ if (val >= mul) val -= Math.pow(2, 8 * byteLength)
+
+ return val
+}
+
+Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
+ offset = offset >>> 0
+ byteLength = byteLength >>> 0
+ if (!noAssert) checkOffset(offset, byteLength, this.length)
+
+ var i = byteLength
+ var mul = 1
+ var val = this[offset + --i]
+ while (i > 0 && (mul *= 0x100)) {
+ val += this[offset + --i] * mul
+ }
+ mul *= 0x80
+
+ if (val >= mul) val -= Math.pow(2, 8 * byteLength)
+
+ return val
+}
+
+Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
+ offset = offset >>> 0
+ if (!noAssert) checkOffset(offset, 1, this.length)
+ if (!(this[offset] & 0x80)) return (this[offset])
+ return ((0xff - this[offset] + 1) * -1)
+}
+
+Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
+ offset = offset >>> 0
+ if (!noAssert) checkOffset(offset, 2, this.length)
+ var val = this[offset] | (this[offset + 1] << 8)
+ return (val & 0x8000) ? val | 0xFFFF0000 : val
+}
+
+Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
+ offset = offset >>> 0
+ if (!noAssert) checkOffset(offset, 2, this.length)
+ var val = this[offset + 1] | (this[offset] << 8)
+ return (val & 0x8000) ? val | 0xFFFF0000 : val
+}
+
+Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
+ offset = offset >>> 0
+ if (!noAssert) checkOffset(offset, 4, this.length)
+
+ return (this[offset]) |
+ (this[offset + 1] << 8) |
+ (this[offset + 2] << 16) |
+ (this[offset + 3] << 24)
+}
+
+Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
+ offset = offset >>> 0
+ if (!noAssert) checkOffset(offset, 4, this.length)
+
+ return (this[offset] << 24) |
+ (this[offset + 1] << 16) |
+ (this[offset + 2] << 8) |
+ (this[offset + 3])
+}
+
+Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
+ offset = offset >>> 0
+ if (!noAssert) checkOffset(offset, 4, this.length)
+ return ieee754.read(this, offset, true, 23, 4)
+}
+
+Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
+ offset = offset >>> 0
+ if (!noAssert) checkOffset(offset, 4, this.length)
+ return ieee754.read(this, offset, false, 23, 4)
+}
+
+Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
+ offset = offset >>> 0
+ if (!noAssert) checkOffset(offset, 8, this.length)
+ return ieee754.read(this, offset, true, 52, 8)
+}
+
+Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
+ offset = offset >>> 0
+ if (!noAssert) checkOffset(offset, 8, this.length)
+ return ieee754.read(this, offset, false, 52, 8)
+}
+
+function checkInt (buf, value, offset, ext, max, min) {
+ if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
+ if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
+ if (offset + ext > buf.length) throw new RangeError('Index out of range')
+}
+
+Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
+ value = +value
+ offset = offset >>> 0
+ byteLength = byteLength >>> 0
+ if (!noAssert) {
+ var maxBytes = Math.pow(2, 8 * byteLength) - 1
+ checkInt(this, value, offset, byteLength, maxBytes, 0)
+ }
+
+ var mul = 1
+ var i = 0
+ this[offset] = value & 0xFF
+ while (++i < byteLength && (mul *= 0x100)) {
+ this[offset + i] = (value / mul) & 0xFF
+ }
+
+ return offset + byteLength
+}
+
+Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
+ value = +value
+ offset = offset >>> 0
+ byteLength = byteLength >>> 0
+ if (!noAssert) {
+ var maxBytes = Math.pow(2, 8 * byteLength) - 1
+ checkInt(this, value, offset, byteLength, maxBytes, 0)
+ }
+
+ var i = byteLength - 1
+ var mul = 1
+ this[offset + i] = value & 0xFF
+ while (--i >= 0 && (mul *= 0x100)) {
+ this[offset + i] = (value / mul) & 0xFF
+ }
+
+ return offset + byteLength
+}
+
+Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
+ value = +value
+ offset = offset >>> 0
+ if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
+ this[offset] = (value & 0xff)
+ return offset + 1
+}
+
+Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
+ value = +value
+ offset = offset >>> 0
+ if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
+ this[offset] = (value & 0xff)
+ this[offset + 1] = (value >>> 8)
+ return offset + 2
+}
+
+Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
+ value = +value
+ offset = offset >>> 0
+ if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
+ this[offset] = (value >>> 8)
+ this[offset + 1] = (value & 0xff)
+ return offset + 2
+}
+
+Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
+ value = +value
+ offset = offset >>> 0
+ if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
+ this[offset + 3] = (value >>> 24)
+ this[offset + 2] = (value >>> 16)
+ this[offset + 1] = (value >>> 8)
+ this[offset] = (value & 0xff)
+ return offset + 4
+}
+
+Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
+ value = +value
+ offset = offset >>> 0
+ if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
+ this[offset] = (value >>> 24)
+ this[offset + 1] = (value >>> 16)
+ this[offset + 2] = (value >>> 8)
+ this[offset + 3] = (value & 0xff)
+ return offset + 4
+}
+
+Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
+ value = +value
+ offset = offset >>> 0
+ if (!noAssert) {
+ var limit = Math.pow(2, (8 * byteLength) - 1)
+
+ checkInt(this, value, offset, byteLength, limit - 1, -limit)
+ }
+
+ var i = 0
+ var mul = 1
+ var sub = 0
+ this[offset] = value & 0xFF
+ while (++i < byteLength && (mul *= 0x100)) {
+ if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
+ sub = 1
+ }
+ this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
+ }
+
+ return offset + byteLength
+}
+
+Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
+ value = +value
+ offset = offset >>> 0
+ if (!noAssert) {
+ var limit = Math.pow(2, (8 * byteLength) - 1)
+
+ checkInt(this, value, offset, byteLength, limit - 1, -limit)
+ }
+
+ var i = byteLength - 1
+ var mul = 1
+ var sub = 0
+ this[offset + i] = value & 0xFF
+ while (--i >= 0 && (mul *= 0x100)) {
+ if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
+ sub = 1
+ }
+ this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
+ }
+
+ return offset + byteLength
+}
+
+Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
+ value = +value
+ offset = offset >>> 0
+ if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
+ if (value < 0) value = 0xff + value + 1
+ this[offset] = (value & 0xff)
+ return offset + 1
+}
+
+Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
+ value = +value
+ offset = offset >>> 0
+ if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
+ this[offset] = (value & 0xff)
+ this[offset + 1] = (value >>> 8)
+ return offset + 2
+}
+
+Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
+ value = +value
+ offset = offset >>> 0
+ if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
+ this[offset] = (value >>> 8)
+ this[offset + 1] = (value & 0xff)
+ return offset + 2
+}
+
+Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
+ value = +value
+ offset = offset >>> 0
+ if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
+ this[offset] = (value & 0xff)
+ this[offset + 1] = (value >>> 8)
+ this[offset + 2] = (value >>> 16)
+ this[offset + 3] = (value >>> 24)
+ return offset + 4
+}
+
+Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
+ value = +value
+ offset = offset >>> 0
+ if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
+ if (value < 0) value = 0xffffffff + value + 1
+ this[offset] = (value >>> 24)
+ this[offset + 1] = (value >>> 16)
+ this[offset + 2] = (value >>> 8)
+ this[offset + 3] = (value & 0xff)
+ return offset + 4
+}
+
+function checkIEEE754 (buf, value, offset, ext, max, min) {
+ if (offset + ext > buf.length) throw new RangeError('Index out of range')
+ if (offset < 0) throw new RangeError('Index out of range')
+}
+
+function writeFloat (buf, value, offset, littleEndian, noAssert) {
+ value = +value
+ offset = offset >>> 0
+ if (!noAssert) {
+ checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
+ }
+ ieee754.write(buf, value, offset, littleEndian, 23, 4)
+ return offset + 4
+}
+
+Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
+ return writeFloat(this, value, offset, true, noAssert)
+}
+
+Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
+ return writeFloat(this, value, offset, false, noAssert)
+}
+
+function writeDouble (buf, value, offset, littleEndian, noAssert) {
+ value = +value
+ offset = offset >>> 0
+ if (!noAssert) {
+ checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
+ }
+ ieee754.write(buf, value, offset, littleEndian, 52, 8)
+ return offset + 8
+}
+
+Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
+ return writeDouble(this, value, offset, true, noAssert)
+}
+
+Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
+ return writeDouble(this, value, offset, false, noAssert)
+}
+
+// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
+Buffer.prototype.copy = function copy (target, targetStart, start, end) {
+ if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer')
+ if (!start) start = 0
+ if (!end && end !== 0) end = this.length
+ if (targetStart >= target.length) targetStart = target.length
+ if (!targetStart) targetStart = 0
+ if (end > 0 && end < start) end = start
+
+ // Copy 0 bytes; we're done
+ if (end === start) return 0
+ if (target.length === 0 || this.length === 0) return 0
+
+ // Fatal error conditions
+ if (targetStart < 0) {
+ throw new RangeError('targetStart out of bounds')
+ }
+ if (start < 0 || start >= this.length) throw new RangeError('Index out of range')
+ if (end < 0) throw new RangeError('sourceEnd out of bounds')
+
+ // Are we oob?
+ if (end > this.length) end = this.length
+ if (target.length - targetStart < end - start) {
+ end = target.length - targetStart + start
+ }
+
+ var len = end - start
+
+ if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') {
+ // Use built-in when available, missing from IE11
+ this.copyWithin(targetStart, start, end)
+ } else if (this === target && start < targetStart && targetStart < end) {
+ // descending copy from end
+ for (var i = len - 1; i >= 0; --i) {
+ target[i + targetStart] = this[i + start]
+ }
+ } else {
+ Uint8Array.prototype.set.call(
+ target,
+ this.subarray(start, end),
+ targetStart
+ )
+ }
+
+ return len
+}
+
+// Usage:
+// buffer.fill(number[, offset[, end]])
+// buffer.fill(buffer[, offset[, end]])
+// buffer.fill(string[, offset[, end]][, encoding])
+Buffer.prototype.fill = function fill (val, start, end, encoding) {
+ // Handle string cases:
+ if (typeof val === 'string') {
+ if (typeof start === 'string') {
+ encoding = start
+ start = 0
+ end = this.length
+ } else if (typeof end === 'string') {
+ encoding = end
+ end = this.length
+ }
+ if (encoding !== undefined && typeof encoding !== 'string') {
+ throw new TypeError('encoding must be a string')
+ }
+ if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
+ throw new TypeError('Unknown encoding: ' + encoding)
+ }
+ if (val.length === 1) {
+ var code = val.charCodeAt(0)
+ if ((encoding === 'utf8' && code < 128) ||
+ encoding === 'latin1') {
+ // Fast path: If `val` fits into a single byte, use that numeric value.
+ val = code
+ }
+ }
+ } else if (typeof val === 'number') {
+ val = val & 255
+ }
+
+ // Invalid ranges are not set to a default, so can range check early.
+ if (start < 0 || this.length < start || this.length < end) {
+ throw new RangeError('Out of range index')
+ }
+
+ if (end <= start) {
+ return this
+ }
+
+ start = start >>> 0
+ end = end === undefined ? this.length : end >>> 0
+
+ if (!val) val = 0
+
+ var i
+ if (typeof val === 'number') {
+ for (i = start; i < end; ++i) {
+ this[i] = val
+ }
+ } else {
+ var bytes = Buffer.isBuffer(val)
+ ? val
+ : Buffer.from(val, encoding)
+ var len = bytes.length
+ if (len === 0) {
+ throw new TypeError('The value "' + val +
+ '" is invalid for argument "value"')
+ }
+ for (i = 0; i < end - start; ++i) {
+ this[i + start] = bytes[i % len]
+ }
+ }
+
+ return this
+}
+
+// HELPER FUNCTIONS
+// ================
+
+var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g
+
+function base64clean (str) {
+ // Node takes equal signs as end of the Base64 encoding
+ str = str.split('=')[0]
+ // Node strips out invalid characters like \n and \t from the string, base64-js does not
+ str = str.trim().replace(INVALID_BASE64_RE, '')
+ // Node converts strings with length < 2 to ''
+ if (str.length < 2) return ''
+ // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
+ while (str.length % 4 !== 0) {
+ str = str + '='
+ }
+ return str
+}
+
+function toHex (n) {
+ if (n < 16) return '0' + n.toString(16)
+ return n.toString(16)
+}
+
+function utf8ToBytes (string, units) {
+ units = units || Infinity
+ var codePoint
+ var length = string.length
+ var leadSurrogate = null
+ var bytes = []
+
+ for (var i = 0; i < length; ++i) {
+ codePoint = string.charCodeAt(i)
+
+ // is surrogate component
+ if (codePoint > 0xD7FF && codePoint < 0xE000) {
+ // last char was a lead
+ if (!leadSurrogate) {
+ // no lead yet
+ if (codePoint > 0xDBFF) {
+ // unexpected trail
+ if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
+ continue
+ } else if (i + 1 === length) {
+ // unpaired lead
+ if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
+ continue
+ }
+
+ // valid lead
+ leadSurrogate = codePoint
+
+ continue
+ }
+
+ // 2 leads in a row
+ if (codePoint < 0xDC00) {
+ if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
+ leadSurrogate = codePoint
+ continue
+ }
+
+ // valid surrogate pair
+ codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
+ } else if (leadSurrogate) {
+ // valid bmp char, but last char was a lead
+ if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
+ }
+
+ leadSurrogate = null
+
+ // encode utf8
+ if (codePoint < 0x80) {
+ if ((units -= 1) < 0) break
+ bytes.push(codePoint)
+ } else if (codePoint < 0x800) {
+ if ((units -= 2) < 0) break
+ bytes.push(
+ codePoint >> 0x6 | 0xC0,
+ codePoint & 0x3F | 0x80
+ )
+ } else if (codePoint < 0x10000) {
+ if ((units -= 3) < 0) break
+ bytes.push(
+ codePoint >> 0xC | 0xE0,
+ codePoint >> 0x6 & 0x3F | 0x80,
+ codePoint & 0x3F | 0x80
+ )
+ } else if (codePoint < 0x110000) {
+ if ((units -= 4) < 0) break
+ bytes.push(
+ codePoint >> 0x12 | 0xF0,
+ codePoint >> 0xC & 0x3F | 0x80,
+ codePoint >> 0x6 & 0x3F | 0x80,
+ codePoint & 0x3F | 0x80
+ )
+ } else {
+ throw new Error('Invalid code point')
+ }
+ }
+
+ return bytes
+}
+
+function asciiToBytes (str) {
+ var byteArray = []
+ for (var i = 0; i < str.length; ++i) {
+ // Node's code seems to be doing this and not & 0x7F..
+ byteArray.push(str.charCodeAt(i) & 0xFF)
+ }
+ return byteArray
+}
+
+function utf16leToBytes (str, units) {
+ var c, hi, lo
+ var byteArray = []
+ for (var i = 0; i < str.length; ++i) {
+ if ((units -= 2) < 0) break
+
+ c = str.charCodeAt(i)
+ hi = c >> 8
+ lo = c % 256
+ byteArray.push(lo)
+ byteArray.push(hi)
+ }
+
+ return byteArray
+}
+
+function base64ToBytes (str) {
+ return base64.toByteArray(base64clean(str))
+}
+
+function blitBuffer (src, dst, offset, length) {
+ for (var i = 0; i < length; ++i) {
+ if ((i + offset >= dst.length) || (i >= src.length)) break
+ dst[i + offset] = src[i]
+ }
+ return i
+}
+
+// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass
+// the `instanceof` check but they should be treated as of that type.
+// See: https://github.com/feross/buffer/issues/166
+function isInstance (obj, type) {
+ return obj instanceof type ||
+ (obj != null && obj.constructor != null && obj.constructor.name != null &&
+ obj.constructor.name === type.name)
+}
+function numberIsNaN (obj) {
+ // For IE11 support
+ return obj !== obj // eslint-disable-line no-self-compare
+}
+
+}).call(this)}).call(this,require("buffer").Buffer)
+},{"base64-js":8,"buffer":9,"ieee754":10}],10:[function(require,module,exports){
+/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
+exports.read = function (buffer, offset, isLE, mLen, nBytes) {
+ var e, m
+ var eLen = (nBytes * 8) - mLen - 1
+ var eMax = (1 << eLen) - 1
+ var eBias = eMax >> 1
+ var nBits = -7
+ var i = isLE ? (nBytes - 1) : 0
+ var d = isLE ? -1 : 1
+ var s = buffer[offset + i]
+
+ i += d
+
+ e = s & ((1 << (-nBits)) - 1)
+ s >>= (-nBits)
+ nBits += eLen
+ for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}
+
+ m = e & ((1 << (-nBits)) - 1)
+ e >>= (-nBits)
+ nBits += mLen
+ for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}
+
+ if (e === 0) {
+ e = 1 - eBias
+ } else if (e === eMax) {
+ return m ? NaN : ((s ? -1 : 1) * Infinity)
+ } else {
+ m = m + Math.pow(2, mLen)
+ e = e - eBias
+ }
+ return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
+}
+
+exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
+ var e, m, c
+ var eLen = (nBytes * 8) - mLen - 1
+ var eMax = (1 << eLen) - 1
+ var eBias = eMax >> 1
+ var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
+ var i = isLE ? 0 : (nBytes - 1)
+ var d = isLE ? 1 : -1
+ var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
+
+ value = Math.abs(value)
+
+ if (isNaN(value) || value === Infinity) {
+ m = isNaN(value) ? 1 : 0
+ e = eMax
+ } else {
+ e = Math.floor(Math.log(value) / Math.LN2)
+ if (value * (c = Math.pow(2, -e)) < 1) {
+ e--
+ c *= 2
+ }
+ if (e + eBias >= 1) {
+ value += rt / c
+ } else {
+ value += rt * Math.pow(2, 1 - eBias)
+ }
+ if (value * c >= 2) {
+ e++
+ c /= 2
+ }
+
+ if (e + eBias >= eMax) {
+ m = 0
+ e = eMax
+ } else if (e + eBias >= 1) {
+ m = ((value * c) - 1) * Math.pow(2, mLen)
+ e = e + eBias
+ } else {
+ m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
+ e = 0
+ }
+ }
+
+ for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
+
+ e = (e << mLen) | m
+ eLen += mLen
+ for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
+
+ buffer[offset + i - d] |= s * 128
+}
+
+},{}]},{},[1])(1)
+});
diff --git a/generator/node_modules/plist/dist/plist.js b/generator/node_modules/plist/dist/plist.js
new file mode 100644
index 0000000..5a779d0
--- /dev/null
+++ b/generator/node_modules/plist/dist/plist.js
@@ -0,0 +1,9888 @@
+(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.plist = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
+/**
+ * Parser functions.
+ */
+
+var parserFunctions = require('./lib/parse');
+Object.keys(parserFunctions).forEach(function (k) { exports[k] = parserFunctions[k]; });
+
+/**
+ * Builder functions.
+ */
+
+var builderFunctions = require('./lib/build');
+Object.keys(builderFunctions).forEach(function (k) { exports[k] = builderFunctions[k]; });
+
+},{"./lib/build":2,"./lib/parse":3}],2:[function(require,module,exports){
+(function (Buffer){(function (){
+/**
+ * Module dependencies.
+ */
+
+var base64 = require('base64-js');
+var xmlbuilder = require('xmlbuilder');
+
+/**
+ * Module exports.
+ */
+
+exports.build = build;
+
+/**
+ * Accepts a `Date` instance and returns an ISO date string.
+ *
+ * @param {Date} d - Date instance to serialize
+ * @returns {String} ISO date string representation of `d`
+ * @api private
+ */
+
+function ISODateString(d){
+ function pad(n){
+ return n < 10 ? '0' + n : n;
+ }
+ return d.getUTCFullYear()+'-'
+ + pad(d.getUTCMonth()+1)+'-'
+ + pad(d.getUTCDate())+'T'
+ + pad(d.getUTCHours())+':'
+ + pad(d.getUTCMinutes())+':'
+ + pad(d.getUTCSeconds())+'Z';
+}
+
+/**
+ * Returns the internal "type" of `obj` via the
+ * `Object.prototype.toString()` trick.
+ *
+ * @param {Mixed} obj - any value
+ * @returns {String} the internal "type" name
+ * @api private
+ */
+
+var toString = Object.prototype.toString;
+function type (obj) {
+ var m = toString.call(obj).match(/\[object (.*)\]/);
+ return m ? m[1] : m;
+}
+
+/**
+ * Generate an XML plist string from the input object `obj`.
+ *
+ * @param {Object} obj - the object to convert
+ * @param {Object} [opts] - optional options object
+ * @returns {String} converted plist XML string
+ * @api public
+ */
+
+function build (obj, opts) {
+ var XMLHDR = {
+ version: '1.0',
+ encoding: 'UTF-8'
+ };
+
+ var XMLDTD = {
+ pubid: '-//Apple//DTD PLIST 1.0//EN',
+ sysid: 'http://www.apple.com/DTDs/PropertyList-1.0.dtd'
+ };
+
+ var doc = xmlbuilder.create('plist');
+
+ doc.dec(XMLHDR.version, XMLHDR.encoding, XMLHDR.standalone);
+ doc.dtd(XMLDTD.pubid, XMLDTD.sysid);
+ doc.att('version', '1.0');
+
+ walk_obj(obj, doc);
+
+ if (!opts) opts = {};
+ // default `pretty` to `true`
+ opts.pretty = opts.pretty !== false;
+ return doc.end(opts);
+}
+
+/**
+ * depth first, recursive traversal of a javascript object. when complete,
+ * next_child contains a reference to the build XML object.
+ *
+ * @api private
+ */
+
+function walk_obj(next, next_child) {
+ var tag_type, i, prop;
+ var name = type(next);
+
+ if ('Undefined' == name) {
+ return;
+ } else if (Array.isArray(next)) {
+ next_child = next_child.ele('array');
+ for (i = 0; i < next.length; i++) {
+ walk_obj(next[i], next_child);
+ }
+
+ } else if (Buffer.isBuffer(next)) {
+ next_child.ele('data').raw(next.toString('base64'));
+
+ } else if ('Object' == name) {
+ next_child = next_child.ele('dict');
+ for (prop in next) {
+ if (next.hasOwnProperty(prop)) {
+ next_child.ele('key').txt(prop);
+ walk_obj(next[prop], next_child);
+ }
+ }
+
+ } else if ('Number' == name) {
+ // detect if this is an integer or real
+ // TODO: add an ability to force one way or another via a "cast"
+ tag_type = (next % 1 === 0) ? 'integer' : 'real';
+ next_child.ele(tag_type).txt(next.toString());
+
+ } else if ('Date' == name) {
+ next_child.ele('date').txt(ISODateString(new Date(next)));
+
+ } else if ('Boolean' == name) {
+ next_child.ele(next ? 'true' : 'false');
+
+ } else if ('String' == name) {
+ next_child.ele('string').txt(next);
+
+ } else if ('ArrayBuffer' == name) {
+ next_child.ele('data').raw(base64.fromByteArray(next));
+
+ } else if (next && next.buffer && 'ArrayBuffer' == type(next.buffer)) {
+ // a typed array
+ next_child.ele('data').raw(base64.fromByteArray(new Uint8Array(next.buffer), next_child));
+
+ } else if ('Null' === name) {
+ next_child.ele('null').txt('');
+
+ }
+}
+
+}).call(this)}).call(this,{"isBuffer":require("../node_modules/is-buffer/index.js")})
+},{"../node_modules/is-buffer/index.js":11,"base64-js":8,"xmlbuilder":44}],3:[function(require,module,exports){
+(function (Buffer){(function (){
+/**
+ * Module dependencies.
+ */
+
+const { DOMParser } = require('@xmldom/xmldom');
+
+/**
+ * Module exports.
+ */
+
+exports.parse = parse;
+
+var TEXT_NODE = 3;
+var CDATA_NODE = 4;
+var COMMENT_NODE = 8;
+
+
+/**
+ * We ignore raw text (usually whitespace), <!-- xml comments -->,
+ * and raw CDATA nodes.
+ *
+ * @param {Element} node
+ * @returns {Boolean}
+ * @api private
+ */
+
+function shouldIgnoreNode (node) {
+ return node.nodeType === TEXT_NODE
+ || node.nodeType === COMMENT_NODE
+ || node.nodeType === CDATA_NODE;
+}
+
+/**
+ * Check if the node is empty. Some plist file has such node:
+ * <key />
+ * this node shoud be ignored.
+ *
+ * @see https://github.com/TooTallNate/plist.js/issues/66
+ * @param {Element} node
+ * @returns {Boolean}
+ * @api private
+ */
+function isEmptyNode(node){
+ if(!node.childNodes || node.childNodes.length === 0) {
+ return true;
+ } else {
+ return false;
+ }
+}
+
+function invariant(test, message) {
+ if (!test) {
+ throw new Error(message);
+ }
+}
+
+/**
+ * Parses a Plist XML string. Returns an Object.
+ *
+ * @param {String} xml - the XML String to decode
+ * @returns {Mixed} the decoded value from the Plist XML
+ * @api public
+ */
+
+function parse (xml) {
+ var doc = new DOMParser().parseFromString(xml);
+ invariant(
+ doc.documentElement.nodeName === 'plist',
+ 'malformed document. First element should be <plist>'
+ );
+ var plist = parsePlistXML(doc.documentElement);
+
+ // the root <plist> node gets interpreted as an Array,
+ // so pull out the inner data first
+ if (plist.length == 1) plist = plist[0];
+
+ return plist;
+}
+
+/**
+ * Convert an XML based plist document into a JSON representation.
+ *
+ * @param {Object} xml_node - current XML node in the plist
+ * @returns {Mixed} built up JSON object
+ * @api private
+ */
+
+function parsePlistXML (node) {
+ var i, new_obj, key, val, new_arr, res, counter, type;
+
+ if (!node)
+ return null;
+
+ if (node.nodeName === 'plist') {
+ new_arr = [];
+ if (isEmptyNode(node)) {
+ return new_arr;
+ }
+ for (i=0; i < node.childNodes.length; i++) {
+ if (!shouldIgnoreNode(node.childNodes[i])) {
+ new_arr.push( parsePlistXML(node.childNodes[i]));
+ }
+ }
+ return new_arr;
+ } else if (node.nodeName === 'dict') {
+ new_obj = {};
+ key = null;
+ counter = 0;
+ if (isEmptyNode(node)) {
+ return new_obj;
+ }
+ for (i=0; i < node.childNodes.length; i++) {
+ if (shouldIgnoreNode(node.childNodes[i])) continue;
+ if (counter % 2 === 0) {
+ invariant(
+ node.childNodes[i].nodeName === 'key',
+ 'Missing key while parsing <dict/>.'
+ );
+ key = parsePlistXML(node.childNodes[i]);
+ } else {
+ invariant(
+ node.childNodes[i].nodeName !== 'key',
+ 'Unexpected key "'
+ + parsePlistXML(node.childNodes[i])
+ + '" while parsing <dict/>.'
+ );
+ new_obj[key] = parsePlistXML(node.childNodes[i]);
+ }
+ counter += 1;
+ }
+ if (counter % 2 === 1) {
+ new_obj[key] = '';
+ }
+
+ return new_obj;
+
+ } else if (node.nodeName === 'array') {
+ new_arr = [];
+ if (isEmptyNode(node)) {
+ return new_arr;
+ }
+ for (i=0; i < node.childNodes.length; i++) {
+ if (!shouldIgnoreNode(node.childNodes[i])) {
+ res = parsePlistXML(node.childNodes[i]);
+ if (null != res) new_arr.push(res);
+ }
+ }
+ return new_arr;
+
+ } else if (node.nodeName === '#text') {
+ // TODO: what should we do with text types? (CDATA sections)
+
+ } else if (node.nodeName === 'key') {
+ if (isEmptyNode(node)) {
+ return '';
+ }
+
+ invariant(
+ node.childNodes[0].nodeValue !== '__proto__',
+ '__proto__ keys can lead to prototype pollution. More details on CVE-2022-22912'
+ );
+
+ return node.childNodes[0].nodeValue;
+ } else if (node.nodeName === 'string') {
+ res = '';
+ if (isEmptyNode(node)) {
+ return res;
+ }
+ for (i=0; i < node.childNodes.length; i++) {
+ var type = node.childNodes[i].nodeType;
+ if (type === TEXT_NODE || type === CDATA_NODE) {
+ res += node.childNodes[i].nodeValue;
+ }
+ }
+ return res;
+
+ } else if (node.nodeName === 'integer') {
+ invariant(
+ !isEmptyNode(node),
+ 'Cannot parse "" as integer.'
+ );
+ return parseInt(node.childNodes[0].nodeValue, 10);
+
+ } else if (node.nodeName === 'real') {
+ invariant(
+ !isEmptyNode(node),
+ 'Cannot parse "" as real.'
+ );
+ res = '';
+ for (i=0; i < node.childNodes.length; i++) {
+ if (node.childNodes[i].nodeType === TEXT_NODE) {
+ res += node.childNodes[i].nodeValue;
+ }
+ }
+ return parseFloat(res);
+
+ } else if (node.nodeName === 'data') {
+ res = '';
+ if (isEmptyNode(node)) {
+ return Buffer.from(res, 'base64');
+ }
+ for (i=0; i < node.childNodes.length; i++) {
+ if (node.childNodes[i].nodeType === TEXT_NODE) {
+ res += node.childNodes[i].nodeValue.replace(/\s+/g, '');
+ }
+ }
+ return Buffer.from(res, 'base64');
+
+ } else if (node.nodeName === 'date') {
+ invariant(
+ !isEmptyNode(node),
+ 'Cannot parse "" as Date.'
+ )
+ return new Date(node.childNodes[0].nodeValue);
+
+ } else if (node.nodeName === 'null') {
+ return null;
+
+ } else if (node.nodeName === 'true') {
+ return true;
+
+ } else if (node.nodeName === 'false') {
+ return false;
+ } else {
+ throw new Error('Invalid PLIST tag ' + node.nodeName);
+ }
+}
+
+}).call(this)}).call(this,require("buffer").Buffer)
+},{"./xmldom/dom-parser":4,"buffer":9}],4:[function(require,module,exports){
+function DOMParser(options){
+ this.options = options ||{locator:{}};
+}
+
+DOMParser.prototype.parseFromString = function(source,mimeType){
+ var options = this.options;
+ var sax = new XMLReader();
+ var domBuilder = options.domBuilder || new DOMHandler();//contentHandler and LexicalHandler
+ var errorHandler = options.errorHandler;
+ var locator = options.locator;
+ var defaultNSMap = options.xmlns||{};
+ var isHTML = /\/x?html?$/.test(mimeType);//mimeType.toLowerCase().indexOf('html') > -1;
+ var entityMap = isHTML?htmlEntity.entityMap:{'lt':'<','gt':'>','amp':'&','quot':'"','apos':"'"};
+ if(locator){
+ domBuilder.setDocumentLocator(locator)
+ }
+
+ sax.errorHandler = buildErrorHandler(errorHandler,domBuilder,locator);
+ sax.domBuilder = options.domBuilder || domBuilder;
+ if(isHTML){
+ defaultNSMap['']= 'http://www.w3.org/1999/xhtml';
+ }
+ defaultNSMap.xml = defaultNSMap.xml || 'http://www.w3.org/XML/1998/namespace';
+ if(source && typeof source === 'string'){
+ sax.parse(source,defaultNSMap,entityMap);
+ }else{
+ sax.errorHandler.error("invalid doc source");
+ }
+ return domBuilder.doc;
+}
+function buildErrorHandler(errorImpl,domBuilder,locator){
+ if(!errorImpl){
+ if(domBuilder instanceof DOMHandler){
+ return domBuilder;
+ }
+ errorImpl = domBuilder ;
+ }
+ var errorHandler = {}
+ var isCallback = errorImpl instanceof Function;
+ locator = locator||{}
+ function build(key){
+ var fn = errorImpl[key];
+ if(!fn && isCallback){
+ fn = errorImpl.length == 2?function(msg){errorImpl(key,msg)}:errorImpl;
+ }
+ errorHandler[key] = fn && function(msg){
+ fn('[xmldom '+key+']\t'+msg+_locator(locator));
+ }||function(){};
+ }
+ build('warning');
+ build('error');
+ build('fatalError');
+ return errorHandler;
+}
+
+//console.log('#\n\n\n\n\n\n\n####')
+/**
+ * +ContentHandler+ErrorHandler
+ * +LexicalHandler+EntityResolver2
+ * -DeclHandler-DTDHandler
+ *
+ * DefaultHandler:EntityResolver, DTDHandler, ContentHandler, ErrorHandler
+ * DefaultHandler2:DefaultHandler,LexicalHandler, DeclHandler, EntityResolver2
+ * @link http://www.saxproject.org/apidoc/org/xml/sax/helpers/DefaultHandler.html
+ */
+function DOMHandler() {
+ this.cdata = false;
+}
+function position(locator,node){
+ node.lineNumber = locator.lineNumber;
+ node.columnNumber = locator.columnNumber;
+}
+/**
+ * @see org.xml.sax.ContentHandler#startDocument
+ * @link http://www.saxproject.org/apidoc/org/xml/sax/ContentHandler.html
+ */
+DOMHandler.prototype = {
+ startDocument : function() {
+ this.doc = new DOMImplementation().createDocument(null, null, null);
+ if (this.locator) {
+ this.doc.documentURI = this.locator.systemId;
+ }
+ },
+ startElement:function(namespaceURI, localName, qName, attrs) {
+ var doc = this.doc;
+ var el = doc.createElementNS(namespaceURI, qName||localName);
+ var len = attrs.length;
+ appendElement(this, el);
+ this.currentElement = el;
+
+ this.locator && position(this.locator,el)
+ for (var i = 0 ; i < len; i++) {
+ var namespaceURI = attrs.getURI(i);
+ var value = attrs.getValue(i);
+ var qName = attrs.getQName(i);
+ var attr = doc.createAttributeNS(namespaceURI, qName);
+ this.locator &&position(attrs.getLocator(i),attr);
+ attr.value = attr.nodeValue = value;
+ el.setAttributeNode(attr)
+ }
+ },
+ endElement:function(namespaceURI, localName, qName) {
+ var current = this.currentElement
+ var tagName = current.tagName;
+ this.currentElement = current.parentNode;
+ },
+ startPrefixMapping:function(prefix, uri) {
+ },
+ endPrefixMapping:function(prefix) {
+ },
+ processingInstruction:function(target, data) {
+ var ins = this.doc.createProcessingInstruction(target, data);
+ this.locator && position(this.locator,ins)
+ appendElement(this, ins);
+ },
+ ignorableWhitespace:function(ch, start, length) {
+ },
+ characters:function(chars, start, length) {
+ chars = _toString.apply(this,arguments)
+ //console.log(chars)
+ if(chars){
+ if (this.cdata) {
+ var charNode = this.doc.createCDATASection(chars);
+ } else {
+ var charNode = this.doc.createTextNode(chars);
+ }
+ if(this.currentElement){
+ this.currentElement.appendChild(charNode);
+ }else if(/^\s*$/.test(chars)){
+ this.doc.appendChild(charNode);
+ //process xml
+ }
+ this.locator && position(this.locator,charNode)
+ }
+ },
+ skippedEntity:function(name) {
+ },
+ endDocument:function() {
+ this.doc.normalize();
+ },
+ setDocumentLocator:function (locator) {
+ if(this.locator = locator){// && !('lineNumber' in locator)){
+ locator.lineNumber = 0;
+ }
+ },
+ //LexicalHandler
+ comment:function(chars, start, length) {
+ chars = _toString.apply(this,arguments)
+ var comm = this.doc.createComment(chars);
+ this.locator && position(this.locator,comm)
+ appendElement(this, comm);
+ },
+
+ startCDATA:function() {
+ //used in characters() methods
+ this.cdata = true;
+ },
+ endCDATA:function() {
+ this.cdata = false;
+ },
+
+ startDTD:function(name, publicId, systemId) {
+ var impl = this.doc.implementation;
+ if (impl && impl.createDocumentType) {
+ var dt = impl.createDocumentType(name, publicId, systemId);
+ this.locator && position(this.locator,dt)
+ appendElement(this, dt);
+ }
+ },
+ /**
+ * @see org.xml.sax.ErrorHandler
+ * @link http://www.saxproject.org/apidoc/org/xml/sax/ErrorHandler.html
+ */
+ warning:function(error) {
+ console.warn('[xmldom warning]\t'+error,_locator(this.locator));
+ },
+ error:function(error) {
+ console.error('[xmldom error]\t'+error,_locator(this.locator));
+ },
+ fatalError:function(error) {
+ throw new ParseError(error, this.locator);
+ }
+}
+function _locator(l){
+ if(l){
+ return '\n@'+(l.systemId ||'')+'#[line:'+l.lineNumber+',col:'+l.columnNumber+']'
+ }
+}
+function _toString(chars,start,length){
+ if(typeof chars == 'string'){
+ return chars.substr(start,length)
+ }else{//java sax connect width xmldom on rhino(what about: "? && !(chars instanceof String)")
+ if(chars.length >= start+length || start){
+ return new java.lang.String(chars,start,length)+'';
+ }
+ return chars;
+ }
+}
+
+/*
+ * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/LexicalHandler.html
+ * used method of org.xml.sax.ext.LexicalHandler:
+ * #comment(chars, start, length)
+ * #startCDATA()
+ * #endCDATA()
+ * #startDTD(name, publicId, systemId)
+ *
+ *
+ * IGNORED method of org.xml.sax.ext.LexicalHandler:
+ * #endDTD()
+ * #startEntity(name)
+ * #endEntity(name)
+ *
+ *
+ * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/DeclHandler.html
+ * IGNORED method of org.xml.sax.ext.DeclHandler
+ * #attributeDecl(eName, aName, type, mode, value)
+ * #elementDecl(name, model)
+ * #externalEntityDecl(name, publicId, systemId)
+ * #internalEntityDecl(name, value)
+ * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/EntityResolver2.html
+ * IGNORED method of org.xml.sax.EntityResolver2
+ * #resolveEntity(String name,String publicId,String baseURI,String systemId)
+ * #resolveEntity(publicId, systemId)
+ * #getExternalSubset(name, baseURI)
+ * @link http://www.saxproject.org/apidoc/org/xml/sax/DTDHandler.html
+ * IGNORED method of org.xml.sax.DTDHandler
+ * #notationDecl(name, publicId, systemId) {};
+ * #unparsedEntityDecl(name, publicId, systemId, notationName) {};
+ */
+"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(key){
+ DOMHandler.prototype[key] = function(){return null}
+})
+
+/* Private static helpers treated below as private instance methods, so don't need to add these to the public API; we might use a Relator to also get rid of non-standard public properties */
+function appendElement (hander,node) {
+ if (!hander.currentElement) {
+ hander.doc.appendChild(node);
+ } else {
+ hander.currentElement.appendChild(node);
+ }
+}//appendChild and setAttributeNS are preformance key
+
+//if(typeof require == 'function'){
+var htmlEntity = require('./entities');
+var sax = require('./sax');
+var XMLReader = sax.XMLReader;
+var ParseError = sax.ParseError;
+var DOMImplementation = exports.DOMImplementation = require('./dom').DOMImplementation;
+exports.XMLSerializer = require('./dom').XMLSerializer ;
+exports.DOMParser = DOMParser;
+exports.__DOMHandler = DOMHandler;
+//}
+
+},{"./dom":5,"./entities":6,"./sax":7}],5:[function(require,module,exports){
+function copy(src,dest){
+ for(var p in src){
+ dest[p] = src[p];
+ }
+}
+/**
+^\w+\.prototype\.([_\w]+)\s*=\s*((?:.*\{\s*?[\r\n][\s\S]*?^})|\S.*?(?=[;\r\n]));?
+^\w+\.prototype\.([_\w]+)\s*=\s*(\S.*?(?=[;\r\n]));?
+ */
+function _extends(Class,Super){
+ var pt = Class.prototype;
+ if(!(pt instanceof Super)){
+ function t(){};
+ t.prototype = Super.prototype;
+ t = new t();
+ copy(pt,t);
+ Class.prototype = pt = t;
+ }
+ if(pt.constructor != Class){
+ if(typeof Class != 'function'){
+ console.error("unknow Class:"+Class)
+ }
+ pt.constructor = Class
+ }
+}
+var htmlns = 'http://www.w3.org/1999/xhtml' ;
+// Node Types
+var NodeType = {}
+var ELEMENT_NODE = NodeType.ELEMENT_NODE = 1;
+var ATTRIBUTE_NODE = NodeType.ATTRIBUTE_NODE = 2;
+var TEXT_NODE = NodeType.TEXT_NODE = 3;
+var CDATA_SECTION_NODE = NodeType.CDATA_SECTION_NODE = 4;
+var ENTITY_REFERENCE_NODE = NodeType.ENTITY_REFERENCE_NODE = 5;
+var ENTITY_NODE = NodeType.ENTITY_NODE = 6;
+var PROCESSING_INSTRUCTION_NODE = NodeType.PROCESSING_INSTRUCTION_NODE = 7;
+var COMMENT_NODE = NodeType.COMMENT_NODE = 8;
+var DOCUMENT_NODE = NodeType.DOCUMENT_NODE = 9;
+var DOCUMENT_TYPE_NODE = NodeType.DOCUMENT_TYPE_NODE = 10;
+var DOCUMENT_FRAGMENT_NODE = NodeType.DOCUMENT_FRAGMENT_NODE = 11;
+var NOTATION_NODE = NodeType.NOTATION_NODE = 12;
+
+// ExceptionCode
+var ExceptionCode = {}
+var ExceptionMessage = {};
+var INDEX_SIZE_ERR = ExceptionCode.INDEX_SIZE_ERR = ((ExceptionMessage[1]="Index size error"),1);
+var DOMSTRING_SIZE_ERR = ExceptionCode.DOMSTRING_SIZE_ERR = ((ExceptionMessage[2]="DOMString size error"),2);
+var HIERARCHY_REQUEST_ERR = ExceptionCode.HIERARCHY_REQUEST_ERR = ((ExceptionMessage[3]="Hierarchy request error"),3);
+var WRONG_DOCUMENT_ERR = ExceptionCode.WRONG_DOCUMENT_ERR = ((ExceptionMessage[4]="Wrong document"),4);
+var INVALID_CHARACTER_ERR = ExceptionCode.INVALID_CHARACTER_ERR = ((ExceptionMessage[5]="Invalid character"),5);
+var NO_DATA_ALLOWED_ERR = ExceptionCode.NO_DATA_ALLOWED_ERR = ((ExceptionMessage[6]="No data allowed"),6);
+var NO_MODIFICATION_ALLOWED_ERR = ExceptionCode.NO_MODIFICATION_ALLOWED_ERR = ((ExceptionMessage[7]="No modification allowed"),7);
+var NOT_FOUND_ERR = ExceptionCode.NOT_FOUND_ERR = ((ExceptionMessage[8]="Not found"),8);
+var NOT_SUPPORTED_ERR = ExceptionCode.NOT_SUPPORTED_ERR = ((ExceptionMessage[9]="Not supported"),9);
+var INUSE_ATTRIBUTE_ERR = ExceptionCode.INUSE_ATTRIBUTE_ERR = ((ExceptionMessage[10]="Attribute in use"),10);
+//level2
+var INVALID_STATE_ERR = ExceptionCode.INVALID_STATE_ERR = ((ExceptionMessage[11]="Invalid state"),11);
+var SYNTAX_ERR = ExceptionCode.SYNTAX_ERR = ((ExceptionMessage[12]="Syntax error"),12);
+var INVALID_MODIFICATION_ERR = ExceptionCode.INVALID_MODIFICATION_ERR = ((ExceptionMessage[13]="Invalid modification"),13);
+var NAMESPACE_ERR = ExceptionCode.NAMESPACE_ERR = ((ExceptionMessage[14]="Invalid namespace"),14);
+var INVALID_ACCESS_ERR = ExceptionCode.INVALID_ACCESS_ERR = ((ExceptionMessage[15]="Invalid access"),15);
+
+/**
+ * DOM Level 2
+ * Object DOMException
+ * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html
+ * @see http://www.w3.org/TR/REC-DOM-Level-1/ecma-script-language-binding.html
+ */
+function DOMException(code, message) {
+ if(message instanceof Error){
+ var error = message;
+ }else{
+ error = this;
+ Error.call(this, ExceptionMessage[code]);
+ this.message = ExceptionMessage[code];
+ if(Error.captureStackTrace) Error.captureStackTrace(this, DOMException);
+ }
+ error.code = code;
+ if(message) this.message = this.message + ": " + message;
+ return error;
+};
+DOMException.prototype = Error.prototype;
+copy(ExceptionCode,DOMException)
+/**
+ * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-536297177
+ * The NodeList interface provides the abstraction of an ordered collection of nodes, without defining or constraining how this collection is implemented. NodeList objects in the DOM are live.
+ * The items in the NodeList are accessible via an integral index, starting from 0.
+ */
+function NodeList() {
+};
+NodeList.prototype = {
+ /**
+ * The number of nodes in the list. The range of valid child node indices is 0 to length-1 inclusive.
+ * @standard level1
+ */
+ length:0,
+ /**
+ * Returns the indexth item in the collection. If index is greater than or equal to the number of nodes in the list, this returns null.
+ * @standard level1
+ * @param index unsigned long
+ * Index into the collection.
+ * @return Node
+ * The node at the indexth position in the NodeList, or null if that is not a valid index.
+ */
+ item: function(index) {
+ return this[index] || null;
+ },
+ toString:function(isHTML,nodeFilter){
+ for(var buf = [], i = 0;i<this.length;i++){
+ serializeToString(this[i],buf,isHTML,nodeFilter);
+ }
+ return buf.join('');
+ }
+};
+function LiveNodeList(node,refresh){
+ this._node = node;
+ this._refresh = refresh
+ _updateLiveList(this);
+}
+function _updateLiveList(list){
+ var inc = list._node._inc || list._node.ownerDocument._inc;
+ if(list._inc != inc){
+ var ls = list._refresh(list._node);
+ //console.log(ls.length)
+ __set__(list,'length',ls.length);
+ copy(ls,list);
+ list._inc = inc;
+ }
+}
+LiveNodeList.prototype.item = function(i){
+ _updateLiveList(this);
+ return this[i];
+}
+
+_extends(LiveNodeList,NodeList);
+/**
+ *
+ * Objects implementing the NamedNodeMap interface are used to represent collections of nodes that can be accessed by name. Note that NamedNodeMap does not inherit from NodeList; NamedNodeMaps are not maintained in any particular order. Objects contained in an object implementing NamedNodeMap may also be accessed by an ordinal index, but this is simply to allow convenient enumeration of the contents of a NamedNodeMap, and does not imply that the DOM specifies an order to these Nodes.
+ * NamedNodeMap objects in the DOM are live.
+ * used for attributes or DocumentType entities
+ */
+function NamedNodeMap() {
+};
+
+function _findNodeIndex(list,node){
+ var i = list.length;
+ while(i--){
+ if(list[i] === node){return i}
+ }
+}
+
+function _addNamedNode(el,list,newAttr,oldAttr){
+ if(oldAttr){
+ list[_findNodeIndex(list,oldAttr)] = newAttr;
+ }else{
+ list[list.length++] = newAttr;
+ }
+ if(el){
+ newAttr.ownerElement = el;
+ var doc = el.ownerDocument;
+ if(doc){
+ oldAttr && _onRemoveAttribute(doc,el,oldAttr);
+ _onAddAttribute(doc,el,newAttr);
+ }
+ }
+}
+function _removeNamedNode(el,list,attr){
+ //console.log('remove attr:'+attr)
+ var i = _findNodeIndex(list,attr);
+ if(i>=0){
+ var lastIndex = list.length-1
+ while(i<lastIndex){
+ list[i] = list[++i]
+ }
+ list.length = lastIndex;
+ if(el){
+ var doc = el.ownerDocument;
+ if(doc){
+ _onRemoveAttribute(doc,el,attr);
+ attr.ownerElement = null;
+ }
+ }
+ }else{
+ throw DOMException(NOT_FOUND_ERR,new Error(el.tagName+'@'+attr))
+ }
+}
+NamedNodeMap.prototype = {
+ length:0,
+ item:NodeList.prototype.item,
+ getNamedItem: function(key) {
+// if(key.indexOf(':')>0 || key == 'xmlns'){
+// return null;
+// }
+ //console.log()
+ var i = this.length;
+ while(i--){
+ var attr = this[i];
+ //console.log(attr.nodeName,key)
+ if(attr.nodeName == key){
+ return attr;
+ }
+ }
+ },
+ setNamedItem: function(attr) {
+ var el = attr.ownerElement;
+ if(el && el!=this._ownerElement){
+ throw new DOMException(INUSE_ATTRIBUTE_ERR);
+ }
+ var oldAttr = this.getNamedItem(attr.nodeName);
+ _addNamedNode(this._ownerElement,this,attr,oldAttr);
+ return oldAttr;
+ },
+ /* returns Node */
+ setNamedItemNS: function(attr) {// raises: WRONG_DOCUMENT_ERR,NO_MODIFICATION_ALLOWED_ERR,INUSE_ATTRIBUTE_ERR
+ var el = attr.ownerElement, oldAttr;
+ if(el && el!=this._ownerElement){
+ throw new DOMException(INUSE_ATTRIBUTE_ERR);
+ }
+ oldAttr = this.getNamedItemNS(attr.namespaceURI,attr.localName);
+ _addNamedNode(this._ownerElement,this,attr,oldAttr);
+ return oldAttr;
+ },
+
+ /* returns Node */
+ removeNamedItem: function(key) {
+ var attr = this.getNamedItem(key);
+ _removeNamedNode(this._ownerElement,this,attr);
+ return attr;
+
+
+ },// raises: NOT_FOUND_ERR,NO_MODIFICATION_ALLOWED_ERR
+
+ //for level2
+ removeNamedItemNS:function(namespaceURI,localName){
+ var attr = this.getNamedItemNS(namespaceURI,localName);
+ _removeNamedNode(this._ownerElement,this,attr);
+ return attr;
+ },
+ getNamedItemNS: function(namespaceURI, localName) {
+ var i = this.length;
+ while(i--){
+ var node = this[i];
+ if(node.localName == localName && node.namespaceURI == namespaceURI){
+ return node;
+ }
+ }
+ return null;
+ }
+};
+/**
+ * @see http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-102161490
+ */
+function DOMImplementation(/* Object */ features) {
+ this._features = {};
+ if (features) {
+ for (var feature in features) {
+ this._features = features[feature];
+ }
+ }
+};
+
+DOMImplementation.prototype = {
+ hasFeature: function(/* string */ feature, /* string */ version) {
+ var versions = this._features[feature.toLowerCase()];
+ if (versions && (!version || version in versions)) {
+ return true;
+ } else {
+ return false;
+ }
+ },
+ // Introduced in DOM Level 2:
+ createDocument:function(namespaceURI, qualifiedName, doctype){// raises:INVALID_CHARACTER_ERR,NAMESPACE_ERR,WRONG_DOCUMENT_ERR
+ var doc = new Document();
+ doc.implementation = this;
+ doc.childNodes = new NodeList();
+ doc.doctype = doctype;
+ if(doctype){
+ doc.appendChild(doctype);
+ }
+ if(qualifiedName){
+ var root = doc.createElementNS(namespaceURI,qualifiedName);
+ doc.appendChild(root);
+ }
+ return doc;
+ },
+ // Introduced in DOM Level 2:
+ createDocumentType:function(qualifiedName, publicId, systemId){// raises:INVALID_CHARACTER_ERR,NAMESPACE_ERR
+ var node = new DocumentType();
+ node.name = qualifiedName;
+ node.nodeName = qualifiedName;
+ node.publicId = publicId;
+ node.systemId = systemId;
+ // Introduced in DOM Level 2:
+ //readonly attribute DOMString internalSubset;
+
+ //TODO:..
+ // readonly attribute NamedNodeMap entities;
+ // readonly attribute NamedNodeMap notations;
+ return node;
+ }
+};
+
+
+/**
+ * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-1950641247
+ */
+
+function Node() {
+};
+
+Node.prototype = {
+ firstChild : null,
+ lastChild : null,
+ previousSibling : null,
+ nextSibling : null,
+ attributes : null,
+ parentNode : null,
+ childNodes : null,
+ ownerDocument : null,
+ nodeValue : null,
+ namespaceURI : null,
+ prefix : null,
+ localName : null,
+ // Modified in DOM Level 2:
+ insertBefore:function(newChild, refChild){//raises
+ return _insertBefore(this,newChild,refChild);
+ },
+ replaceChild:function(newChild, oldChild){//raises
+ this.insertBefore(newChild,oldChild);
+ if(oldChild){
+ this.removeChild(oldChild);
+ }
+ },
+ removeChild:function(oldChild){
+ return _removeChild(this,oldChild);
+ },
+ appendChild:function(newChild){
+ return this.insertBefore(newChild,null);
+ },
+ hasChildNodes:function(){
+ return this.firstChild != null;
+ },
+ cloneNode:function(deep){
+ return cloneNode(this.ownerDocument||this,this,deep);
+ },
+ // Modified in DOM Level 2:
+ normalize:function(){
+ var child = this.firstChild;
+ while(child){
+ var next = child.nextSibling;
+ if(next && next.nodeType == TEXT_NODE && child.nodeType == TEXT_NODE){
+ this.removeChild(next);
+ child.appendData(next.data);
+ }else{
+ child.normalize();
+ child = next;
+ }
+ }
+ },
+ // Introduced in DOM Level 2:
+ isSupported:function(feature, version){
+ return this.ownerDocument.implementation.hasFeature(feature,version);
+ },
+ // Introduced in DOM Level 2:
+ hasAttributes:function(){
+ return this.attributes.length>0;
+ },
+ lookupPrefix:function(namespaceURI){
+ var el = this;
+ while(el){
+ var map = el._nsMap;
+ //console.dir(map)
+ if(map){
+ for(var n in map){
+ if(map[n] == namespaceURI){
+ return n;
+ }
+ }
+ }
+ el = el.nodeType == ATTRIBUTE_NODE?el.ownerDocument : el.parentNode;
+ }
+ return null;
+ },
+ // Introduced in DOM Level 3:
+ lookupNamespaceURI:function(prefix){
+ var el = this;
+ while(el){
+ var map = el._nsMap;
+ //console.dir(map)
+ if(map){
+ if(prefix in map){
+ return map[prefix] ;
+ }
+ }
+ el = el.nodeType == ATTRIBUTE_NODE?el.ownerDocument : el.parentNode;
+ }
+ return null;
+ },
+ // Introduced in DOM Level 3:
+ isDefaultNamespace:function(namespaceURI){
+ var prefix = this.lookupPrefix(namespaceURI);
+ return prefix == null;
+ }
+};
+
+
+function _xmlEncoder(c){
+ return c == '<' && '&lt;' ||
+ c == '>' && '&gt;' ||
+ c == '&' && '&amp;' ||
+ c == '"' && '&quot;' ||
+ '&#'+c.charCodeAt()+';'
+}
+
+
+copy(NodeType,Node);
+copy(NodeType,Node.prototype);
+
+/**
+ * @param callback return true for continue,false for break
+ * @return boolean true: break visit;
+ */
+function _visitNode(node,callback){
+ if(callback(node)){
+ return true;
+ }
+ if(node = node.firstChild){
+ do{
+ if(_visitNode(node,callback)){return true}
+ }while(node=node.nextSibling)
+ }
+}
+
+
+
+function Document(){
+}
+function _onAddAttribute(doc,el,newAttr){
+ doc && doc._inc++;
+ var ns = newAttr.namespaceURI ;
+ if(ns == 'http://www.w3.org/2000/xmlns/'){
+ //update namespace
+ el._nsMap[newAttr.prefix?newAttr.localName:''] = newAttr.value
+ }
+}
+function _onRemoveAttribute(doc,el,newAttr,remove){
+ doc && doc._inc++;
+ var ns = newAttr.namespaceURI ;
+ if(ns == 'http://www.w3.org/2000/xmlns/'){
+ //update namespace
+ delete el._nsMap[newAttr.prefix?newAttr.localName:'']
+ }
+}
+function _onUpdateChild(doc,el,newChild){
+ if(doc && doc._inc){
+ doc._inc++;
+ //update childNodes
+ var cs = el.childNodes;
+ if(newChild){
+ cs[cs.length++] = newChild;
+ }else{
+ //console.log(1)
+ var child = el.firstChild;
+ var i = 0;
+ while(child){
+ cs[i++] = child;
+ child =child.nextSibling;
+ }
+ cs.length = i;
+ }
+ }
+}
+
+/**
+ * attributes;
+ * children;
+ *
+ * writeable properties:
+ * nodeValue,Attr:value,CharacterData:data
+ * prefix
+ */
+function _removeChild(parentNode,child){
+ var previous = child.previousSibling;
+ var next = child.nextSibling;
+ if(previous){
+ previous.nextSibling = next;
+ }else{
+ parentNode.firstChild = next
+ }
+ if(next){
+ next.previousSibling = previous;
+ }else{
+ parentNode.lastChild = previous;
+ }
+ _onUpdateChild(parentNode.ownerDocument,parentNode);
+ return child;
+}
+/**
+ * preformance key(refChild == null)
+ */
+function _insertBefore(parentNode,newChild,nextChild){
+ var cp = newChild.parentNode;
+ if(cp){
+ cp.removeChild(newChild);//remove and update
+ }
+ if(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){
+ var newFirst = newChild.firstChild;
+ if (newFirst == null) {
+ return newChild;
+ }
+ var newLast = newChild.lastChild;
+ }else{
+ newFirst = newLast = newChild;
+ }
+ var pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;
+
+ newFirst.previousSibling = pre;
+ newLast.nextSibling = nextChild;
+
+
+ if(pre){
+ pre.nextSibling = newFirst;
+ }else{
+ parentNode.firstChild = newFirst;
+ }
+ if(nextChild == null){
+ parentNode.lastChild = newLast;
+ }else{
+ nextChild.previousSibling = newLast;
+ }
+ do{
+ newFirst.parentNode = parentNode;
+ }while(newFirst !== newLast && (newFirst= newFirst.nextSibling))
+ _onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);
+ //console.log(parentNode.lastChild.nextSibling == null)
+ if (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {
+ newChild.firstChild = newChild.lastChild = null;
+ }
+ return newChild;
+}
+function _appendSingleChild(parentNode,newChild){
+ var cp = newChild.parentNode;
+ if(cp){
+ var pre = parentNode.lastChild;
+ cp.removeChild(newChild);//remove and update
+ var pre = parentNode.lastChild;
+ }
+ var pre = parentNode.lastChild;
+ newChild.parentNode = parentNode;
+ newChild.previousSibling = pre;
+ newChild.nextSibling = null;
+ if(pre){
+ pre.nextSibling = newChild;
+ }else{
+ parentNode.firstChild = newChild;
+ }
+ parentNode.lastChild = newChild;
+ _onUpdateChild(parentNode.ownerDocument,parentNode,newChild);
+ return newChild;
+ //console.log("__aa",parentNode.lastChild.nextSibling == null)
+}
+Document.prototype = {
+ //implementation : null,
+ nodeName : '#document',
+ nodeType : DOCUMENT_NODE,
+ doctype : null,
+ documentElement : null,
+ _inc : 1,
+
+ insertBefore : function(newChild, refChild){//raises
+ if(newChild.nodeType == DOCUMENT_FRAGMENT_NODE){
+ var child = newChild.firstChild;
+ while(child){
+ var next = child.nextSibling;
+ this.insertBefore(child,refChild);
+ child = next;
+ }
+ return newChild;
+ }
+ if(this.documentElement == null && newChild.nodeType == ELEMENT_NODE){
+ this.documentElement = newChild;
+ }
+
+ return _insertBefore(this,newChild,refChild),(newChild.ownerDocument = this),newChild;
+ },
+ removeChild : function(oldChild){
+ if(this.documentElement == oldChild){
+ this.documentElement = null;
+ }
+ return _removeChild(this,oldChild);
+ },
+ // Introduced in DOM Level 2:
+ importNode : function(importedNode,deep){
+ return importNode(this,importedNode,deep);
+ },
+ // Introduced in DOM Level 2:
+ getElementById : function(id){
+ var rtv = null;
+ _visitNode(this.documentElement,function(node){
+ if(node.nodeType == ELEMENT_NODE){
+ if(node.getAttribute('id') == id){
+ rtv = node;
+ return true;
+ }
+ }
+ })
+ return rtv;
+ },
+
+ getElementsByClassName: function(className) {
+ var pattern = new RegExp("(^|\\s)" + className + "(\\s|$)");
+ return new LiveNodeList(this, function(base) {
+ var ls = [];
+ _visitNode(base.documentElement, function(node) {
+ if(node !== base && node.nodeType == ELEMENT_NODE) {
+ if(pattern.test(node.getAttribute('class'))) {
+ ls.push(node);
+ }
+ }
+ });
+ return ls;
+ });
+ },
+
+ //document factory method:
+ createElement : function(tagName){
+ var node = new Element();
+ node.ownerDocument = this;
+ node.nodeName = tagName;
+ node.tagName = tagName;
+ node.childNodes = new NodeList();
+ var attrs = node.attributes = new NamedNodeMap();
+ attrs._ownerElement = node;
+ return node;
+ },
+ createDocumentFragment : function(){
+ var node = new DocumentFragment();
+ node.ownerDocument = this;
+ node.childNodes = new NodeList();
+ return node;
+ },
+ createTextNode : function(data){
+ var node = new Text();
+ node.ownerDocument = this;
+ node.appendData(data)
+ return node;
+ },
+ createComment : function(data){
+ var node = new Comment();
+ node.ownerDocument = this;
+ node.appendData(data)
+ return node;
+ },
+ createCDATASection : function(data){
+ var node = new CDATASection();
+ node.ownerDocument = this;
+ node.appendData(data)
+ return node;
+ },
+ createProcessingInstruction : function(target,data){
+ var node = new ProcessingInstruction();
+ node.ownerDocument = this;
+ node.tagName = node.target = target;
+ node.nodeValue= node.data = data;
+ return node;
+ },
+ createAttribute : function(name){
+ var node = new Attr();
+ node.ownerDocument = this;
+ node.name = name;
+ node.nodeName = name;
+ node.localName = name;
+ node.specified = true;
+ return node;
+ },
+ createEntityReference : function(name){
+ var node = new EntityReference();
+ node.ownerDocument = this;
+ node.nodeName = name;
+ return node;
+ },
+ // Introduced in DOM Level 2:
+ createElementNS : function(namespaceURI,qualifiedName){
+ var node = new Element();
+ var pl = qualifiedName.split(':');
+ var attrs = node.attributes = new NamedNodeMap();
+ node.childNodes = new NodeList();
+ node.ownerDocument = this;
+ node.nodeName = qualifiedName;
+ node.tagName = qualifiedName;
+ node.namespaceURI = namespaceURI;
+ if(pl.length == 2){
+ node.prefix = pl[0];
+ node.localName = pl[1];
+ }else{
+ //el.prefix = null;
+ node.localName = qualifiedName;
+ }
+ attrs._ownerElement = node;
+ return node;
+ },
+ // Introduced in DOM Level 2:
+ createAttributeNS : function(namespaceURI,qualifiedName){
+ var node = new Attr();
+ var pl = qualifiedName.split(':');
+ node.ownerDocument = this;
+ node.nodeName = qualifiedName;
+ node.name = qualifiedName;
+ node.namespaceURI = namespaceURI;
+ node.specified = true;
+ if(pl.length == 2){
+ node.prefix = pl[0];
+ node.localName = pl[1];
+ }else{
+ //el.prefix = null;
+ node.localName = qualifiedName;
+ }
+ return node;
+ }
+};
+_extends(Document,Node);
+
+
+function Element() {
+ this._nsMap = {};
+};
+Element.prototype = {
+ nodeType : ELEMENT_NODE,
+ hasAttribute : function(name){
+ return this.getAttributeNode(name)!=null;
+ },
+ getAttribute : function(name){
+ var attr = this.getAttributeNode(name);
+ return attr && attr.value || '';
+ },
+ getAttributeNode : function(name){
+ return this.attributes.getNamedItem(name);
+ },
+ setAttribute : function(name, value){
+ var attr = this.ownerDocument.createAttribute(name);
+ attr.value = attr.nodeValue = "" + value;
+ this.setAttributeNode(attr)
+ },
+ removeAttribute : function(name){
+ var attr = this.getAttributeNode(name)
+ attr && this.removeAttributeNode(attr);
+ },
+
+ //four real opeartion method
+ appendChild:function(newChild){
+ if(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){
+ return this.insertBefore(newChild,null);
+ }else{
+ return _appendSingleChild(this,newChild);
+ }
+ },
+ setAttributeNode : function(newAttr){
+ return this.attributes.setNamedItem(newAttr);
+ },
+ setAttributeNodeNS : function(newAttr){
+ return this.attributes.setNamedItemNS(newAttr);
+ },
+ removeAttributeNode : function(oldAttr){
+ //console.log(this == oldAttr.ownerElement)
+ return this.attributes.removeNamedItem(oldAttr.nodeName);
+ },
+ //get real attribute name,and remove it by removeAttributeNode
+ removeAttributeNS : function(namespaceURI, localName){
+ var old = this.getAttributeNodeNS(namespaceURI, localName);
+ old && this.removeAttributeNode(old);
+ },
+
+ hasAttributeNS : function(namespaceURI, localName){
+ return this.getAttributeNodeNS(namespaceURI, localName)!=null;
+ },
+ getAttributeNS : function(namespaceURI, localName){
+ var attr = this.getAttributeNodeNS(namespaceURI, localName);
+ return attr && attr.value || '';
+ },
+ setAttributeNS : function(namespaceURI, qualifiedName, value){
+ var attr = this.ownerDocument.createAttributeNS(namespaceURI, qualifiedName);
+ attr.value = attr.nodeValue = "" + value;
+ this.setAttributeNode(attr)
+ },
+ getAttributeNodeNS : function(namespaceURI, localName){
+ return this.attributes.getNamedItemNS(namespaceURI, localName);
+ },
+
+ getElementsByTagName : function(tagName){
+ return new LiveNodeList(this,function(base){
+ var ls = [];
+ _visitNode(base,function(node){
+ if(node !== base && node.nodeType == ELEMENT_NODE && (tagName === '*' || node.tagName == tagName)){
+ ls.push(node);
+ }
+ });
+ return ls;
+ });
+ },
+ getElementsByTagNameNS : function(namespaceURI, localName){
+ return new LiveNodeList(this,function(base){
+ var ls = [];
+ _visitNode(base,function(node){
+ if(node !== base && node.nodeType === ELEMENT_NODE && (namespaceURI === '*' || node.namespaceURI === namespaceURI) && (localName === '*' || node.localName == localName)){
+ ls.push(node);
+ }
+ });
+ return ls;
+
+ });
+ }
+};
+Document.prototype.getElementsByTagName = Element.prototype.getElementsByTagName;
+Document.prototype.getElementsByTagNameNS = Element.prototype.getElementsByTagNameNS;
+
+
+_extends(Element,Node);
+function Attr() {
+};
+Attr.prototype.nodeType = ATTRIBUTE_NODE;
+_extends(Attr,Node);
+
+
+function CharacterData() {
+};
+CharacterData.prototype = {
+ data : '',
+ substringData : function(offset, count) {
+ return this.data.substring(offset, offset+count);
+ },
+ appendData: function(text) {
+ text = this.data+text;
+ this.nodeValue = this.data = text;
+ this.length = text.length;
+ },
+ insertData: function(offset,text) {
+ this.replaceData(offset,0,text);
+
+ },
+ appendChild:function(newChild){
+ throw new Error(ExceptionMessage[HIERARCHY_REQUEST_ERR])
+ },
+ deleteData: function(offset, count) {
+ this.replaceData(offset,count,"");
+ },
+ replaceData: function(offset, count, text) {
+ var start = this.data.substring(0,offset);
+ var end = this.data.substring(offset+count);
+ text = start + text + end;
+ this.nodeValue = this.data = text;
+ this.length = text.length;
+ }
+}
+_extends(CharacterData,Node);
+function Text() {
+};
+Text.prototype = {
+ nodeName : "#text",
+ nodeType : TEXT_NODE,
+ splitText : function(offset) {
+ var text = this.data;
+ var newText = text.substring(offset);
+ text = text.substring(0, offset);
+ this.data = this.nodeValue = text;
+ this.length = text.length;
+ var newNode = this.ownerDocument.createTextNode(newText);
+ if(this.parentNode){
+ this.parentNode.insertBefore(newNode, this.nextSibling);
+ }
+ return newNode;
+ }
+}
+_extends(Text,CharacterData);
+function Comment() {
+};
+Comment.prototype = {
+ nodeName : "#comment",
+ nodeType : COMMENT_NODE
+}
+_extends(Comment,CharacterData);
+
+function CDATASection() {
+};
+CDATASection.prototype = {
+ nodeName : "#cdata-section",
+ nodeType : CDATA_SECTION_NODE
+}
+_extends(CDATASection,CharacterData);
+
+
+function DocumentType() {
+};
+DocumentType.prototype.nodeType = DOCUMENT_TYPE_NODE;
+_extends(DocumentType,Node);
+
+function Notation() {
+};
+Notation.prototype.nodeType = NOTATION_NODE;
+_extends(Notation,Node);
+
+function Entity() {
+};
+Entity.prototype.nodeType = ENTITY_NODE;
+_extends(Entity,Node);
+
+function EntityReference() {
+};
+EntityReference.prototype.nodeType = ENTITY_REFERENCE_NODE;
+_extends(EntityReference,Node);
+
+function DocumentFragment() {
+};
+DocumentFragment.prototype.nodeName = "#document-fragment";
+DocumentFragment.prototype.nodeType = DOCUMENT_FRAGMENT_NODE;
+_extends(DocumentFragment,Node);
+
+
+function ProcessingInstruction() {
+}
+ProcessingInstruction.prototype.nodeType = PROCESSING_INSTRUCTION_NODE;
+_extends(ProcessingInstruction,Node);
+function XMLSerializer(){}
+XMLSerializer.prototype.serializeToString = function(node,isHtml,nodeFilter){
+ return nodeSerializeToString.call(node,isHtml,nodeFilter);
+}
+Node.prototype.toString = nodeSerializeToString;
+function nodeSerializeToString(isHtml,nodeFilter){
+ var buf = [];
+ var refNode = this.nodeType == 9 && this.documentElement || this;
+ var prefix = refNode.prefix;
+ var uri = refNode.namespaceURI;
+
+ if(uri && prefix == null){
+ //console.log(prefix)
+ var prefix = refNode.lookupPrefix(uri);
+ if(prefix == null){
+ //isHTML = true;
+ var visibleNamespaces=[
+ {namespace:uri,prefix:null}
+ //{namespace:uri,prefix:''}
+ ]
+ }
+ }
+ serializeToString(this,buf,isHtml,nodeFilter,visibleNamespaces);
+ //console.log('###',this.nodeType,uri,prefix,buf.join(''))
+ return buf.join('');
+}
+function needNamespaceDefine(node,isHTML, visibleNamespaces) {
+ var prefix = node.prefix||'';
+ var uri = node.namespaceURI;
+ if (!prefix && !uri){
+ return false;
+ }
+ if (prefix === "xml" && uri === "http://www.w3.org/XML/1998/namespace"
+ || uri == 'http://www.w3.org/2000/xmlns/'){
+ return false;
+ }
+
+ var i = visibleNamespaces.length
+ //console.log('@@@@',node.tagName,prefix,uri,visibleNamespaces)
+ while (i--) {
+ var ns = visibleNamespaces[i];
+ // get namespace prefix
+ //console.log(node.nodeType,node.tagName,ns.prefix,prefix)
+ if (ns.prefix == prefix){
+ return ns.namespace != uri;
+ }
+ }
+ //console.log(isHTML,uri,prefix=='')
+ //if(isHTML && prefix ==null && uri == 'http://www.w3.org/1999/xhtml'){
+ // return false;
+ //}
+ //node.flag = '11111'
+ //console.error(3,true,node.flag,node.prefix,node.namespaceURI)
+ return true;
+}
+function serializeToString(node,buf,isHTML,nodeFilter,visibleNamespaces){
+ if(nodeFilter){
+ node = nodeFilter(node);
+ if(node){
+ if(typeof node == 'string'){
+ buf.push(node);
+ return;
+ }
+ }else{
+ return;
+ }
+ //buf.sort.apply(attrs, attributeSorter);
+ }
+ switch(node.nodeType){
+ case ELEMENT_NODE:
+ if (!visibleNamespaces) visibleNamespaces = [];
+ var startVisibleNamespaces = visibleNamespaces.length;
+ var attrs = node.attributes;
+ var len = attrs.length;
+ var child = node.firstChild;
+ var nodeName = node.tagName;
+
+ isHTML = (htmlns === node.namespaceURI) ||isHTML
+ buf.push('<',nodeName);
+
+
+
+ for(var i=0;i<len;i++){
+ // add namespaces for attributes
+ var attr = attrs.item(i);
+ if (attr.prefix == 'xmlns') {
+ visibleNamespaces.push({ prefix: attr.localName, namespace: attr.value });
+ }else if(attr.nodeName == 'xmlns'){
+ visibleNamespaces.push({ prefix: '', namespace: attr.value });
+ }
+ }
+ for(var i=0;i<len;i++){
+ var attr = attrs.item(i);
+ if (needNamespaceDefine(attr,isHTML, visibleNamespaces)) {
+ var prefix = attr.prefix||'';
+ var uri = attr.namespaceURI;
+ var ns = prefix ? ' xmlns:' + prefix : " xmlns";
+ buf.push(ns, '="' , uri , '"');
+ visibleNamespaces.push({ prefix: prefix, namespace:uri });
+ }
+ serializeToString(attr,buf,isHTML,nodeFilter,visibleNamespaces);
+ }
+ // add namespace for current node
+ if (needNamespaceDefine(node,isHTML, visibleNamespaces)) {
+ var prefix = node.prefix||'';
+ var uri = node.namespaceURI;
+ if (uri) {
+ // Avoid empty namespace value like xmlns:ds=""
+ // Empty namespace URL will we produce an invalid XML document
+ var ns = prefix ? ' xmlns:' + prefix : " xmlns";
+ buf.push(ns, '="' , uri , '"');
+ visibleNamespaces.push({ prefix: prefix, namespace:uri });
+ }
+ }
+
+ if(child || isHTML && !/^(?:meta|link|img|br|hr|input)$/i.test(nodeName)){
+ buf.push('>');
+ //if is cdata child node
+ if(isHTML && /^script$/i.test(nodeName)){
+ while(child){
+ if(child.data){
+ buf.push(child.data);
+ }else{
+ serializeToString(child,buf,isHTML,nodeFilter,visibleNamespaces);
+ }
+ child = child.nextSibling;
+ }
+ }else
+ {
+ while(child){
+ serializeToString(child,buf,isHTML,nodeFilter,visibleNamespaces);
+ child = child.nextSibling;
+ }
+ }
+ buf.push('</',nodeName,'>');
+ }else{
+ buf.push('/>');
+ }
+ // remove added visible namespaces
+ //visibleNamespaces.length = startVisibleNamespaces;
+ return;
+ case DOCUMENT_NODE:
+ case DOCUMENT_FRAGMENT_NODE:
+ var child = node.firstChild;
+ while(child){
+ serializeToString(child,buf,isHTML,nodeFilter,visibleNamespaces);
+ child = child.nextSibling;
+ }
+ return;
+ case ATTRIBUTE_NODE:
+ /**
+ * Well-formedness constraint: No < in Attribute Values
+ * The replacement text of any entity referred to directly or indirectly in an attribute value must not contain a <.
+ * @see https://www.w3.org/TR/xml/#CleanAttrVals
+ * @see https://www.w3.org/TR/xml/#NT-AttValue
+ */
+ return buf.push(' ', node.name, '="', node.value.replace(/[<&"]/g,_xmlEncoder), '"');
+ case TEXT_NODE:
+ /**
+ * The ampersand character (&) and the left angle bracket (<) must not appear in their literal form,
+ * except when used as markup delimiters, or within a comment, a processing instruction, or a CDATA section.
+ * If they are needed elsewhere, they must be escaped using either numeric character references or the strings
+ * `&amp;` and `&lt;` respectively.
+ * The right angle bracket (>) may be represented using the string " &gt; ", and must, for compatibility,
+ * be escaped using either `&gt;` or a character reference when it appears in the string `]]>` in content,
+ * when that string is not marking the end of a CDATA section.
+ *
+ * In the content of elements, character data is any string of characters
+ * which does not contain the start-delimiter of any markup
+ * and does not include the CDATA-section-close delimiter, `]]>`.
+ *
+ * @see https://www.w3.org/TR/xml/#NT-CharData
+ */
+ return buf.push(node.data
+ .replace(/[<&]/g,_xmlEncoder)
+ .replace(/]]>/g, ']]&gt;')
+ );
+ case CDATA_SECTION_NODE:
+ return buf.push( '<![CDATA[',node.data,']]>');
+ case COMMENT_NODE:
+ return buf.push( "<!--",node.data,"-->");
+ case DOCUMENT_TYPE_NODE:
+ var pubid = node.publicId;
+ var sysid = node.systemId;
+ buf.push('<!DOCTYPE ',node.name);
+ if(pubid){
+ buf.push(' PUBLIC ', pubid);
+ if (sysid && sysid!='.') {
+ buf.push(' ', sysid);
+ }
+ buf.push('>');
+ }else if(sysid && sysid!='.'){
+ buf.push(' SYSTEM ', sysid, '>');
+ }else{
+ var sub = node.internalSubset;
+ if(sub){
+ buf.push(" [",sub,"]");
+ }
+ buf.push(">");
+ }
+ return;
+ case PROCESSING_INSTRUCTION_NODE:
+ return buf.push( "<?",node.target," ",node.data,"?>");
+ case ENTITY_REFERENCE_NODE:
+ return buf.push( '&',node.nodeName,';');
+ //case ENTITY_NODE:
+ //case NOTATION_NODE:
+ default:
+ buf.push('??',node.nodeName);
+ }
+}
+function importNode(doc,node,deep){
+ var node2;
+ switch (node.nodeType) {
+ case ELEMENT_NODE:
+ node2 = node.cloneNode(false);
+ node2.ownerDocument = doc;
+ //var attrs = node2.attributes;
+ //var len = attrs.length;
+ //for(var i=0;i<len;i++){
+ //node2.setAttributeNodeNS(importNode(doc,attrs.item(i),deep));
+ //}
+ case DOCUMENT_FRAGMENT_NODE:
+ break;
+ case ATTRIBUTE_NODE:
+ deep = true;
+ break;
+ //case ENTITY_REFERENCE_NODE:
+ //case PROCESSING_INSTRUCTION_NODE:
+ ////case TEXT_NODE:
+ //case CDATA_SECTION_NODE:
+ //case COMMENT_NODE:
+ // deep = false;
+ // break;
+ //case DOCUMENT_NODE:
+ //case DOCUMENT_TYPE_NODE:
+ //cannot be imported.
+ //case ENTITY_NODE:
+ //case NOTATION_NODE:
+ //can not hit in level3
+ //default:throw e;
+ }
+ if(!node2){
+ node2 = node.cloneNode(false);//false
+ }
+ node2.ownerDocument = doc;
+ node2.parentNode = null;
+ if(deep){
+ var child = node.firstChild;
+ while(child){
+ node2.appendChild(importNode(doc,child,deep));
+ child = child.nextSibling;
+ }
+ }
+ return node2;
+}
+//
+//var _relationMap = {firstChild:1,lastChild:1,previousSibling:1,nextSibling:1,
+// attributes:1,childNodes:1,parentNode:1,documentElement:1,doctype,};
+function cloneNode(doc,node,deep){
+ var node2 = new node.constructor();
+ for(var n in node){
+ var v = node[n];
+ if(typeof v != 'object' ){
+ if(v != node2[n]){
+ node2[n] = v;
+ }
+ }
+ }
+ if(node.childNodes){
+ node2.childNodes = new NodeList();
+ }
+ node2.ownerDocument = doc;
+ switch (node2.nodeType) {
+ case ELEMENT_NODE:
+ var attrs = node.attributes;
+ var attrs2 = node2.attributes = new NamedNodeMap();
+ var len = attrs.length
+ attrs2._ownerElement = node2;
+ for(var i=0;i<len;i++){
+ node2.setAttributeNode(cloneNode(doc,attrs.item(i),true));
+ }
+ break;;
+ case ATTRIBUTE_NODE:
+ deep = true;
+ }
+ if(deep){
+ var child = node.firstChild;
+ while(child){
+ node2.appendChild(cloneNode(doc,child,deep));
+ child = child.nextSibling;
+ }
+ }
+ return node2;
+}
+
+function __set__(object,key,value){
+ object[key] = value
+}
+//do dynamic
+try{
+ if(Object.defineProperty){
+ Object.defineProperty(LiveNodeList.prototype,'length',{
+ get:function(){
+ _updateLiveList(this);
+ return this.$$length;
+ }
+ });
+ Object.defineProperty(Node.prototype,'textContent',{
+ get:function(){
+ return getTextContent(this);
+ },
+ set:function(data){
+ switch(this.nodeType){
+ case ELEMENT_NODE:
+ case DOCUMENT_FRAGMENT_NODE:
+ while(this.firstChild){
+ this.removeChild(this.firstChild);
+ }
+ if(data || String(data)){
+ this.appendChild(this.ownerDocument.createTextNode(data));
+ }
+ break;
+ default:
+ //TODO:
+ this.data = data;
+ this.value = data;
+ this.nodeValue = data;
+ }
+ }
+ })
+
+ function getTextContent(node){
+ switch(node.nodeType){
+ case ELEMENT_NODE:
+ case DOCUMENT_FRAGMENT_NODE:
+ var buf = [];
+ node = node.firstChild;
+ while(node){
+ if(node.nodeType!==7 && node.nodeType !==8){
+ buf.push(getTextContent(node));
+ }
+ node = node.nextSibling;
+ }
+ return buf.join('');
+ default:
+ return node.nodeValue;
+ }
+ }
+ __set__ = function(object,key,value){
+ //console.log(value)
+ object['$$'+key] = value
+ }
+ }
+}catch(e){//ie8
+}
+
+//if(typeof require == 'function'){
+ exports.Node = Node;
+ exports.DOMException = DOMException;
+ exports.DOMImplementation = DOMImplementation;
+ exports.XMLSerializer = XMLSerializer;
+//}
+
+},{}],6:[function(require,module,exports){
+exports.entityMap = {
+ lt: '<',
+ gt: '>',
+ amp: '&',
+ quot: '"',
+ apos: "'",
+ Agrave: "À",
+ Aacute: "Á",
+ Acirc: "Â",
+ Atilde: "Ã",
+ Auml: "Ä",
+ Aring: "Å",
+ AElig: "Æ",
+ Ccedil: "Ç",
+ Egrave: "È",
+ Eacute: "É",
+ Ecirc: "Ê",
+ Euml: "Ë",
+ Igrave: "Ì",
+ Iacute: "Í",
+ Icirc: "Î",
+ Iuml: "Ï",
+ ETH: "Ð",
+ Ntilde: "Ñ",
+ Ograve: "Ò",
+ Oacute: "Ó",
+ Ocirc: "Ô",
+ Otilde: "Õ",
+ Ouml: "Ö",
+ Oslash: "Ø",
+ Ugrave: "Ù",
+ Uacute: "Ú",
+ Ucirc: "Û",
+ Uuml: "Ü",
+ Yacute: "Ý",
+ THORN: "Þ",
+ szlig: "ß",
+ agrave: "à",
+ aacute: "á",
+ acirc: "â",
+ atilde: "ã",
+ auml: "ä",
+ aring: "å",
+ aelig: "æ",
+ ccedil: "ç",
+ egrave: "è",
+ eacute: "é",
+ ecirc: "ê",
+ euml: "ë",
+ igrave: "ì",
+ iacute: "í",
+ icirc: "î",
+ iuml: "ï",
+ eth: "ð",
+ ntilde: "ñ",
+ ograve: "ò",
+ oacute: "ó",
+ ocirc: "ô",
+ otilde: "õ",
+ ouml: "ö",
+ oslash: "ø",
+ ugrave: "ù",
+ uacute: "ú",
+ ucirc: "û",
+ uuml: "ü",
+ yacute: "ý",
+ thorn: "þ",
+ yuml: "ÿ",
+ nbsp: "\u00a0",
+ iexcl: "¡",
+ cent: "¢",
+ pound: "£",
+ curren: "¤",
+ yen: "¥",
+ brvbar: "¦",
+ sect: "§",
+ uml: "¨",
+ copy: "©",
+ ordf: "ª",
+ laquo: "«",
+ not: "¬",
+ shy: "­­",
+ reg: "®",
+ macr: "¯",
+ deg: "°",
+ plusmn: "±",
+ sup2: "²",
+ sup3: "³",
+ acute: "´",
+ micro: "µ",
+ para: "¶",
+ middot: "·",
+ cedil: "¸",
+ sup1: "¹",
+ ordm: "º",
+ raquo: "»",
+ frac14: "¼",
+ frac12: "½",
+ frac34: "¾",
+ iquest: "¿",
+ times: "×",
+ divide: "÷",
+ forall: "∀",
+ part: "∂",
+ exist: "∃",
+ empty: "∅",
+ nabla: "∇",
+ isin: "∈",
+ notin: "∉",
+ ni: "∋",
+ prod: "∏",
+ sum: "∑",
+ minus: "−",
+ lowast: "∗",
+ radic: "√",
+ prop: "∝",
+ infin: "∞",
+ ang: "∠",
+ and: "∧",
+ or: "∨",
+ cap: "∩",
+ cup: "∪",
+ 'int': "∫",
+ there4: "∴",
+ sim: "∼",
+ cong: "≅",
+ asymp: "≈",
+ ne: "≠",
+ equiv: "≡",
+ le: "≤",
+ ge: "≥",
+ sub: "⊂",
+ sup: "⊃",
+ nsub: "⊄",
+ sube: "⊆",
+ supe: "⊇",
+ oplus: "⊕",
+ otimes: "⊗",
+ perp: "⊥",
+ sdot: "⋅",
+ Alpha: "Α",
+ Beta: "Β",
+ Gamma: "Γ",
+ Delta: "Δ",
+ Epsilon: "Ε",
+ Zeta: "Ζ",
+ Eta: "Η",
+ Theta: "Θ",
+ Iota: "Ι",
+ Kappa: "Κ",
+ Lambda: "Λ",
+ Mu: "Μ",
+ Nu: "Ν",
+ Xi: "Ξ",
+ Omicron: "Ο",
+ Pi: "Π",
+ Rho: "Ρ",
+ Sigma: "Σ",
+ Tau: "Τ",
+ Upsilon: "Υ",
+ Phi: "Φ",
+ Chi: "Χ",
+ Psi: "Ψ",
+ Omega: "Ω",
+ alpha: "α",
+ beta: "β",
+ gamma: "γ",
+ delta: "δ",
+ epsilon: "ε",
+ zeta: "ζ",
+ eta: "η",
+ theta: "θ",
+ iota: "ι",
+ kappa: "κ",
+ lambda: "λ",
+ mu: "μ",
+ nu: "ν",
+ xi: "ξ",
+ omicron: "ο",
+ pi: "π",
+ rho: "ρ",
+ sigmaf: "ς",
+ sigma: "σ",
+ tau: "τ",
+ upsilon: "υ",
+ phi: "φ",
+ chi: "χ",
+ psi: "ψ",
+ omega: "ω",
+ thetasym: "ϑ",
+ upsih: "ϒ",
+ piv: "ϖ",
+ OElig: "Œ",
+ oelig: "œ",
+ Scaron: "Š",
+ scaron: "š",
+ Yuml: "Ÿ",
+ fnof: "ƒ",
+ circ: "ˆ",
+ tilde: "˜",
+ ensp: " ",
+ emsp: " ",
+ thinsp: " ",
+ zwnj: "‌",
+ zwj: "‍",
+ lrm: "‎",
+ rlm: "‏",
+ ndash: "–",
+ mdash: "—",
+ lsquo: "‘",
+ rsquo: "’",
+ sbquo: "‚",
+ ldquo: "“",
+ rdquo: "”",
+ bdquo: "„",
+ dagger: "†",
+ Dagger: "‡",
+ bull: "•",
+ hellip: "…",
+ permil: "‰",
+ prime: "′",
+ Prime: "″",
+ lsaquo: "‹",
+ rsaquo: "›",
+ oline: "‾",
+ euro: "€",
+ trade: "™",
+ larr: "←",
+ uarr: "↑",
+ rarr: "→",
+ darr: "↓",
+ harr: "↔",
+ crarr: "↵",
+ lceil: "⌈",
+ rceil: "⌉",
+ lfloor: "⌊",
+ rfloor: "⌋",
+ loz: "◊",
+ spades: "♠",
+ clubs: "♣",
+ hearts: "♥",
+ diams: "♦"
+};
+
+},{}],7:[function(require,module,exports){
+//[4] NameStartChar ::= ":" | [A-Z] | "_" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]
+//[4a] NameChar ::= NameStartChar | "-" | "." | [0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040]
+//[5] Name ::= NameStartChar (NameChar)*
+var nameStartChar = /[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]///\u10000-\uEFFFF
+var nameChar = new RegExp("[\\-\\.0-9"+nameStartChar.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]");
+var tagNamePattern = new RegExp('^'+nameStartChar.source+nameChar.source+'*(?:\:'+nameStartChar.source+nameChar.source+'*)?$');
+//var tagNamePattern = /^[a-zA-Z_][\w\-\.]*(?:\:[a-zA-Z_][\w\-\.]*)?$/
+//var handlers = 'resolveEntity,getExternalSubset,characters,endDocument,endElement,endPrefixMapping,ignorableWhitespace,processingInstruction,setDocumentLocator,skippedEntity,startDocument,startElement,startPrefixMapping,notationDecl,unparsedEntityDecl,error,fatalError,warning,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,comment,endCDATA,endDTD,endEntity,startCDATA,startDTD,startEntity'.split(',')
+
+//S_TAG, S_ATTR, S_EQ, S_ATTR_NOQUOT_VALUE
+//S_ATTR_SPACE, S_ATTR_END, S_TAG_SPACE, S_TAG_CLOSE
+var S_TAG = 0;//tag name offerring
+var S_ATTR = 1;//attr name offerring
+var S_ATTR_SPACE=2;//attr name end and space offer
+var S_EQ = 3;//=space?
+var S_ATTR_NOQUOT_VALUE = 4;//attr value(no quot value only)
+var S_ATTR_END = 5;//attr value end and no space(quot end)
+var S_TAG_SPACE = 6;//(attr value end || tag end ) && (space offer)
+var S_TAG_CLOSE = 7;//closed el<el />
+
+/**
+ * Creates an error that will not be caught by XMLReader aka the SAX parser.
+ *
+ * @param {string} message
+ * @param {any?} locator Optional, can provide details about the location in the source
+ * @constructor
+ */
+function ParseError(message, locator) {
+ this.message = message
+ this.locator = locator
+ if(Error.captureStackTrace) Error.captureStackTrace(this, ParseError);
+}
+ParseError.prototype = new Error();
+ParseError.prototype.name = ParseError.name
+
+function XMLReader(){
+
+}
+
+XMLReader.prototype = {
+ parse:function(source,defaultNSMap,entityMap){
+ var domBuilder = this.domBuilder;
+ domBuilder.startDocument();
+ _copy(defaultNSMap ,defaultNSMap = {})
+ parse(source,defaultNSMap,entityMap,
+ domBuilder,this.errorHandler);
+ domBuilder.endDocument();
+ }
+}
+function parse(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){
+ function fixedFromCharCode(code) {
+ // String.prototype.fromCharCode does not supports
+ // > 2 bytes unicode chars directly
+ if (code > 0xffff) {
+ code -= 0x10000;
+ var surrogate1 = 0xd800 + (code >> 10)
+ , surrogate2 = 0xdc00 + (code & 0x3ff);
+
+ return String.fromCharCode(surrogate1, surrogate2);
+ } else {
+ return String.fromCharCode(code);
+ }
+ }
+ function entityReplacer(a){
+ var k = a.slice(1,-1);
+ if(k in entityMap){
+ return entityMap[k];
+ }else if(k.charAt(0) === '#'){
+ return fixedFromCharCode(parseInt(k.substr(1).replace('x','0x')))
+ }else{
+ errorHandler.error('entity not found:'+a);
+ return a;
+ }
+ }
+ function appendText(end){//has some bugs
+ if(end>start){
+ var xt = source.substring(start,end).replace(/&#?\w+;/g,entityReplacer);
+ locator&&position(start);
+ domBuilder.characters(xt,0,end-start);
+ start = end
+ }
+ }
+ function position(p,m){
+ while(p>=lineEnd && (m = linePattern.exec(source))){
+ lineStart = m.index;
+ lineEnd = lineStart + m[0].length;
+ locator.lineNumber++;
+ //console.log('line++:',locator,startPos,endPos)
+ }
+ locator.columnNumber = p-lineStart+1;
+ }
+ var lineStart = 0;
+ var lineEnd = 0;
+ var linePattern = /.*(?:\r\n?|\n)|.*$/g
+ var locator = domBuilder.locator;
+
+ var parseStack = [{currentNSMap:defaultNSMapCopy}]
+ var closeMap = {};
+ var start = 0;
+ while(true){
+ try{
+ var tagStart = source.indexOf('<',start);
+ if(tagStart<0){
+ if(!source.substr(start).match(/^\s*$/)){
+ var doc = domBuilder.doc;
+ var text = doc.createTextNode(source.substr(start));
+ doc.appendChild(text);
+ domBuilder.currentElement = text;
+ }
+ return;
+ }
+ if(tagStart>start){
+ appendText(tagStart);
+ }
+ switch(source.charAt(tagStart+1)){
+ case '/':
+ var end = source.indexOf('>',tagStart+3);
+ var tagName = source.substring(tagStart+2,end);
+ var config = parseStack.pop();
+ if(end<0){
+
+ tagName = source.substring(tagStart+2).replace(/[\s<].*/,'');
+ errorHandler.error("end tag name: "+tagName+' is not complete:'+config.tagName);
+ end = tagStart+1+tagName.length;
+ }else if(tagName.match(/\s</)){
+ tagName = tagName.replace(/[\s<].*/,'');
+ errorHandler.error("end tag name: "+tagName+' maybe not complete');
+ end = tagStart+1+tagName.length;
+ }
+ var localNSMap = config.localNSMap;
+ var endMatch = config.tagName == tagName;
+ var endIgnoreCaseMach = endMatch || config.tagName&&config.tagName.toLowerCase() == tagName.toLowerCase()
+ if(endIgnoreCaseMach){
+ domBuilder.endElement(config.uri,config.localName,tagName);
+ if(localNSMap){
+ for(var prefix in localNSMap){
+ domBuilder.endPrefixMapping(prefix) ;
+ }
+ }
+ if(!endMatch){
+ errorHandler.fatalError("end tag name: "+tagName+' is not match the current start tagName:'+config.tagName ); // No known test case
+ }
+ }else{
+ parseStack.push(config)
+ }
+
+ end++;
+ break;
+ // end elment
+ case '?':// <?...?>
+ locator&&position(tagStart);
+ end = parseInstruction(source,tagStart,domBuilder);
+ break;
+ case '!':// <!doctype,<![CDATA,<!--
+ locator&&position(tagStart);
+ end = parseDCC(source,tagStart,domBuilder,errorHandler);
+ break;
+ default:
+ locator&&position(tagStart);
+ var el = new ElementAttributes();
+ var currentNSMap = parseStack[parseStack.length-1].currentNSMap;
+ //elStartEnd
+ var end = parseElementStartPart(source,tagStart,el,currentNSMap,entityReplacer,errorHandler);
+ var len = el.length;
+
+
+ if(!el.closed && fixSelfClosed(source,end,el.tagName,closeMap)){
+ el.closed = true;
+ if(!entityMap.nbsp){
+ errorHandler.warning('unclosed xml attribute');
+ }
+ }
+ if(locator && len){
+ var locator2 = copyLocator(locator,{});
+ //try{//attribute position fixed
+ for(var i = 0;i<len;i++){
+ var a = el[i];
+ position(a.offset);
+ a.locator = copyLocator(locator,{});
+ }
+ domBuilder.locator = locator2
+ if(appendElement(el,domBuilder,currentNSMap)){
+ parseStack.push(el)
+ }
+ domBuilder.locator = locator;
+ }else{
+ if(appendElement(el,domBuilder,currentNSMap)){
+ parseStack.push(el)
+ }
+ }
+
+
+
+ if(el.uri === 'http://www.w3.org/1999/xhtml' && !el.closed){
+ end = parseHtmlSpecialContent(source,end,el.tagName,entityReplacer,domBuilder)
+ }else{
+ end++;
+ }
+ }
+ }catch(e){
+ if (e instanceof ParseError) {
+ throw e;
+ }
+ errorHandler.error('element parse error: '+e)
+ end = -1;
+ }
+ if(end>start){
+ start = end;
+ }else{
+ //TODO: 这里有可能sax回退,有位置错误风险
+ appendText(Math.max(tagStart,start)+1);
+ }
+ }
+}
+function copyLocator(f,t){
+ t.lineNumber = f.lineNumber;
+ t.columnNumber = f.columnNumber;
+ return t;
+}
+
+/**
+ * @see #appendElement(source,elStartEnd,el,selfClosed,entityReplacer,domBuilder,parseStack);
+ * @return end of the elementStartPart(end of elementEndPart for selfClosed el)
+ */
+function parseElementStartPart(source,start,el,currentNSMap,entityReplacer,errorHandler){
+
+ /**
+ * @param {string} qname
+ * @param {string} value
+ * @param {number} startIndex
+ */
+ function addAttribute(qname, value, startIndex) {
+ if (qname in el.attributeNames) errorHandler.fatalError('Attribute ' + qname + ' redefined')
+ el.addValue(qname, value, startIndex)
+ }
+ var attrName;
+ var value;
+ var p = ++start;
+ var s = S_TAG;//status
+ while(true){
+ var c = source.charAt(p);
+ switch(c){
+ case '=':
+ if(s === S_ATTR){//attrName
+ attrName = source.slice(start,p);
+ s = S_EQ;
+ }else if(s === S_ATTR_SPACE){
+ s = S_EQ;
+ }else{
+ //fatalError: equal must after attrName or space after attrName
+ throw new Error('attribute equal must after attrName'); // No known test case
+ }
+ break;
+ case '\'':
+ case '"':
+ if(s === S_EQ || s === S_ATTR //|| s == S_ATTR_SPACE
+ ){//equal
+ if(s === S_ATTR){
+ errorHandler.warning('attribute value must after "="')
+ attrName = source.slice(start,p)
+ }
+ start = p+1;
+ p = source.indexOf(c,start)
+ if(p>0){
+ value = source.slice(start,p).replace(/&#?\w+;/g,entityReplacer);
+ addAttribute(attrName, value, start-1);
+ s = S_ATTR_END;
+ }else{
+ //fatalError: no end quot match
+ throw new Error('attribute value no end \''+c+'\' match');
+ }
+ }else if(s == S_ATTR_NOQUOT_VALUE){
+ value = source.slice(start,p).replace(/&#?\w+;/g,entityReplacer);
+ //console.log(attrName,value,start,p)
+ addAttribute(attrName, value, start);
+ //console.dir(el)
+ errorHandler.warning('attribute "'+attrName+'" missed start quot('+c+')!!');
+ start = p+1;
+ s = S_ATTR_END
+ }else{
+ //fatalError: no equal before
+ throw new Error('attribute value must after "="'); // No known test case
+ }
+ break;
+ case '/':
+ switch(s){
+ case S_TAG:
+ el.setTagName(source.slice(start,p));
+ case S_ATTR_END:
+ case S_TAG_SPACE:
+ case S_TAG_CLOSE:
+ s =S_TAG_CLOSE;
+ el.closed = true;
+ case S_ATTR_NOQUOT_VALUE:
+ case S_ATTR:
+ case S_ATTR_SPACE:
+ break;
+ //case S_EQ:
+ default:
+ throw new Error("attribute invalid close char('/')") // No known test case
+ }
+ break;
+ case ''://end document
+ errorHandler.error('unexpected end of input');
+ if(s == S_TAG){
+ el.setTagName(source.slice(start,p));
+ }
+ return p;
+ case '>':
+ switch(s){
+ case S_TAG:
+ el.setTagName(source.slice(start,p));
+ case S_ATTR_END:
+ case S_TAG_SPACE:
+ case S_TAG_CLOSE:
+ break;//normal
+ case S_ATTR_NOQUOT_VALUE://Compatible state
+ case S_ATTR:
+ value = source.slice(start,p);
+ if(value.slice(-1) === '/'){
+ el.closed = true;
+ value = value.slice(0,-1)
+ }
+ case S_ATTR_SPACE:
+ if(s === S_ATTR_SPACE){
+ value = attrName;
+ }
+ if(s == S_ATTR_NOQUOT_VALUE){
+ errorHandler.warning('attribute "'+value+'" missed quot(")!');
+ addAttribute(attrName, value.replace(/&#?\w+;/g,entityReplacer), start)
+ }else{
+ if(currentNSMap[''] !== 'http://www.w3.org/1999/xhtml' || !value.match(/^(?:disabled|checked|selected)$/i)){
+ errorHandler.warning('attribute "'+value+'" missed value!! "'+value+'" instead!!')
+ }
+ addAttribute(value, value, start)
+ }
+ break;
+ case S_EQ:
+ throw new Error('attribute value missed!!');
+ }
+// console.log(tagName,tagNamePattern,tagNamePattern.test(tagName))
+ return p;
+ /*xml space '\x20' | #x9 | #xD | #xA; */
+ case '\u0080':
+ c = ' ';
+ default:
+ if(c<= ' '){//space
+ switch(s){
+ case S_TAG:
+ el.setTagName(source.slice(start,p));//tagName
+ s = S_TAG_SPACE;
+ break;
+ case S_ATTR:
+ attrName = source.slice(start,p)
+ s = S_ATTR_SPACE;
+ break;
+ case S_ATTR_NOQUOT_VALUE:
+ var value = source.slice(start,p).replace(/&#?\w+;/g,entityReplacer);
+ errorHandler.warning('attribute "'+value+'" missed quot(")!!');
+ addAttribute(attrName, value, start)
+ case S_ATTR_END:
+ s = S_TAG_SPACE;
+ break;
+ //case S_TAG_SPACE:
+ //case S_EQ:
+ //case S_ATTR_SPACE:
+ // void();break;
+ //case S_TAG_CLOSE:
+ //ignore warning
+ }
+ }else{//not space
+//S_TAG, S_ATTR, S_EQ, S_ATTR_NOQUOT_VALUE
+//S_ATTR_SPACE, S_ATTR_END, S_TAG_SPACE, S_TAG_CLOSE
+ switch(s){
+ //case S_TAG:void();break;
+ //case S_ATTR:void();break;
+ //case S_ATTR_NOQUOT_VALUE:void();break;
+ case S_ATTR_SPACE:
+ var tagName = el.tagName;
+ if(currentNSMap[''] !== 'http://www.w3.org/1999/xhtml' || !attrName.match(/^(?:disabled|checked|selected)$/i)){
+ errorHandler.warning('attribute "'+attrName+'" missed value!! "'+attrName+'" instead2!!')
+ }
+ addAttribute(attrName, attrName, start);
+ start = p;
+ s = S_ATTR;
+ break;
+ case S_ATTR_END:
+ errorHandler.warning('attribute space is required"'+attrName+'"!!')
+ case S_TAG_SPACE:
+ s = S_ATTR;
+ start = p;
+ break;
+ case S_EQ:
+ s = S_ATTR_NOQUOT_VALUE;
+ start = p;
+ break;
+ case S_TAG_CLOSE:
+ throw new Error("elements closed character '/' and '>' must be connected to");
+ }
+ }
+ }//end outer switch
+ //console.log('p++',p)
+ p++;
+ }
+}
+/**
+ * @return true if has new namespace define
+ */
+function appendElement(el,domBuilder,currentNSMap){
+ var tagName = el.tagName;
+ var localNSMap = null;
+ //var currentNSMap = parseStack[parseStack.length-1].currentNSMap;
+ var i = el.length;
+ while(i--){
+ var a = el[i];
+ var qName = a.qName;
+ var value = a.value;
+ var nsp = qName.indexOf(':');
+ if(nsp>0){
+ var prefix = a.prefix = qName.slice(0,nsp);
+ var localName = qName.slice(nsp+1);
+ var nsPrefix = prefix === 'xmlns' && localName
+ }else{
+ localName = qName;
+ prefix = null
+ nsPrefix = qName === 'xmlns' && ''
+ }
+ //can not set prefix,because prefix !== ''
+ a.localName = localName ;
+ //prefix == null for no ns prefix attribute
+ if(nsPrefix !== false){//hack!!
+ if(localNSMap == null){
+ localNSMap = {}
+ //console.log(currentNSMap,0)
+ _copy(currentNSMap,currentNSMap={})
+ //console.log(currentNSMap,1)
+ }
+ currentNSMap[nsPrefix] = localNSMap[nsPrefix] = value;
+ a.uri = 'http://www.w3.org/2000/xmlns/'
+ domBuilder.startPrefixMapping(nsPrefix, value)
+ }
+ }
+ var i = el.length;
+ while(i--){
+ a = el[i];
+ var prefix = a.prefix;
+ if(prefix){//no prefix attribute has no namespace
+ if(prefix === 'xml'){
+ a.uri = 'http://www.w3.org/XML/1998/namespace';
+ }if(prefix !== 'xmlns'){
+ a.uri = currentNSMap[prefix || '']
+
+ //{console.log('###'+a.qName,domBuilder.locator.systemId+'',currentNSMap,a.uri)}
+ }
+ }
+ }
+ var nsp = tagName.indexOf(':');
+ if(nsp>0){
+ prefix = el.prefix = tagName.slice(0,nsp);
+ localName = el.localName = tagName.slice(nsp+1);
+ }else{
+ prefix = null;//important!!
+ localName = el.localName = tagName;
+ }
+ //no prefix element has default namespace
+ var ns = el.uri = currentNSMap[prefix || ''];
+ domBuilder.startElement(ns,localName,tagName,el);
+ //endPrefixMapping and startPrefixMapping have not any help for dom builder
+ //localNSMap = null
+ if(el.closed){
+ domBuilder.endElement(ns,localName,tagName);
+ if(localNSMap){
+ for(prefix in localNSMap){
+ domBuilder.endPrefixMapping(prefix)
+ }
+ }
+ }else{
+ el.currentNSMap = currentNSMap;
+ el.localNSMap = localNSMap;
+ //parseStack.push(el);
+ return true;
+ }
+}
+function parseHtmlSpecialContent(source,elStartEnd,tagName,entityReplacer,domBuilder){
+ if(/^(?:script|textarea)$/i.test(tagName)){
+ var elEndStart = source.indexOf('</'+tagName+'>',elStartEnd);
+ var text = source.substring(elStartEnd+1,elEndStart);
+ if(/[&<]/.test(text)){
+ if(/^script$/i.test(tagName)){
+ //if(!/\]\]>/.test(text)){
+ //lexHandler.startCDATA();
+ domBuilder.characters(text,0,text.length);
+ //lexHandler.endCDATA();
+ return elEndStart;
+ //}
+ }//}else{//text area
+ text = text.replace(/&#?\w+;/g,entityReplacer);
+ domBuilder.characters(text,0,text.length);
+ return elEndStart;
+ //}
+
+ }
+ }
+ return elStartEnd+1;
+}
+function fixSelfClosed(source,elStartEnd,tagName,closeMap){
+ //if(tagName in closeMap){
+ var pos = closeMap[tagName];
+ if(pos == null){
+ //console.log(tagName)
+ pos = source.lastIndexOf('</'+tagName+'>')
+ if(pos<elStartEnd){//忘记闭合
+ pos = source.lastIndexOf('</'+tagName)
+ }
+ closeMap[tagName] =pos
+ }
+ return pos<elStartEnd;
+ //}
+}
+function _copy(source,target){
+ for(var n in source){target[n] = source[n]}
+}
+function parseDCC(source,start,domBuilder,errorHandler){//sure start with '<!'
+ var next= source.charAt(start+2)
+ switch(next){
+ case '-':
+ if(source.charAt(start + 3) === '-'){
+ var end = source.indexOf('-->',start+4);
+ //append comment source.substring(4,end)//<!--
+ if(end>start){
+ domBuilder.comment(source,start+4,end-start-4);
+ return end+3;
+ }else{
+ errorHandler.error("Unclosed comment");
+ return -1;
+ }
+ }else{
+ //error
+ return -1;
+ }
+ default:
+ if(source.substr(start+3,6) == 'CDATA['){
+ var end = source.indexOf(']]>',start+9);
+ domBuilder.startCDATA();
+ domBuilder.characters(source,start+9,end-start-9);
+ domBuilder.endCDATA()
+ return end+3;
+ }
+ //<!DOCTYPE
+ //startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId)
+ var matchs = split(source,start);
+ var len = matchs.length;
+ if(len>1 && /!doctype/i.test(matchs[0][0])){
+ var name = matchs[1][0];
+ var pubid = false;
+ var sysid = false;
+ if(len>3){
+ if(/^public$/i.test(matchs[2][0])){
+ pubid = matchs[3][0];
+ sysid = len>4 && matchs[4][0];
+ }else if(/^system$/i.test(matchs[2][0])){
+ sysid = matchs[3][0];
+ }
+ }
+ var lastMatch = matchs[len-1]
+ domBuilder.startDTD(name, pubid, sysid);
+ domBuilder.endDTD();
+
+ return lastMatch.index+lastMatch[0].length
+ }
+ }
+ return -1;
+}
+
+
+
+function parseInstruction(source,start,domBuilder){
+ var end = source.indexOf('?>',start);
+ if(end){
+ var match = source.substring(start,end).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);
+ if(match){
+ var len = match[0].length;
+ domBuilder.processingInstruction(match[1], match[2]) ;
+ return end+2;
+ }else{//error
+ return -1;
+ }
+ }
+ return -1;
+}
+
+function ElementAttributes(){
+ this.attributeNames = {}
+}
+ElementAttributes.prototype = {
+ setTagName:function(tagName){
+ if(!tagNamePattern.test(tagName)){
+ throw new Error('invalid tagName:'+tagName)
+ }
+ this.tagName = tagName
+ },
+ addValue:function(qName, value, offset) {
+ if(!tagNamePattern.test(qName)){
+ throw new Error('invalid attribute:'+qName)
+ }
+ this.attributeNames[qName] = this.length;
+ this[this.length++] = {qName:qName,value:value,offset:offset}
+ },
+ length:0,
+ getLocalName:function(i){return this[i].localName},
+ getLocator:function(i){return this[i].locator},
+ getQName:function(i){return this[i].qName},
+ getURI:function(i){return this[i].uri},
+ getValue:function(i){return this[i].value}
+// ,getIndex:function(uri, localName)){
+// if(localName){
+//
+// }else{
+// var qName = uri
+// }
+// },
+// getValue:function(){return this.getValue(this.getIndex.apply(this,arguments))},
+// getType:function(uri,localName){}
+// getType:function(i){},
+}
+
+
+
+function split(source,start){
+ var match;
+ var buf = [];
+ var reg = /'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;
+ reg.lastIndex = start;
+ reg.exec(source);//skip <
+ while(match = reg.exec(source)){
+ buf.push(match);
+ if(match[1])return buf;
+ }
+}
+
+exports.XMLReader = XMLReader;
+exports.ParseError = ParseError;
+
+},{}],8:[function(require,module,exports){
+'use strict'
+
+exports.byteLength = byteLength
+exports.toByteArray = toByteArray
+exports.fromByteArray = fromByteArray
+
+var lookup = []
+var revLookup = []
+var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
+
+var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
+for (var i = 0, len = code.length; i < len; ++i) {
+ lookup[i] = code[i]
+ revLookup[code.charCodeAt(i)] = i
+}
+
+// Support decoding URL-safe base64 strings, as Node.js does.
+// See: https://en.wikipedia.org/wiki/Base64#URL_applications
+revLookup['-'.charCodeAt(0)] = 62
+revLookup['_'.charCodeAt(0)] = 63
+
+function getLens (b64) {
+ var len = b64.length
+
+ if (len % 4 > 0) {
+ throw new Error('Invalid string. Length must be a multiple of 4')
+ }
+
+ // Trim off extra bytes after placeholder bytes are found
+ // See: https://github.com/beatgammit/base64-js/issues/42
+ var validLen = b64.indexOf('=')
+ if (validLen === -1) validLen = len
+
+ var placeHoldersLen = validLen === len
+ ? 0
+ : 4 - (validLen % 4)
+
+ return [validLen, placeHoldersLen]
+}
+
+// base64 is 4/3 + up to two characters of the original data
+function byteLength (b64) {
+ var lens = getLens(b64)
+ var validLen = lens[0]
+ var placeHoldersLen = lens[1]
+ return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
+}
+
+function _byteLength (b64, validLen, placeHoldersLen) {
+ return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
+}
+
+function toByteArray (b64) {
+ var tmp
+ var lens = getLens(b64)
+ var validLen = lens[0]
+ var placeHoldersLen = lens[1]
+
+ var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
+
+ var curByte = 0
+
+ // if there are placeholders, only get up to the last complete 4 chars
+ var len = placeHoldersLen > 0
+ ? validLen - 4
+ : validLen
+
+ var i
+ for (i = 0; i < len; i += 4) {
+ tmp =
+ (revLookup[b64.charCodeAt(i)] << 18) |
+ (revLookup[b64.charCodeAt(i + 1)] << 12) |
+ (revLookup[b64.charCodeAt(i + 2)] << 6) |
+ revLookup[b64.charCodeAt(i + 3)]
+ arr[curByte++] = (tmp >> 16) & 0xFF
+ arr[curByte++] = (tmp >> 8) & 0xFF
+ arr[curByte++] = tmp & 0xFF
+ }
+
+ if (placeHoldersLen === 2) {
+ tmp =
+ (revLookup[b64.charCodeAt(i)] << 2) |
+ (revLookup[b64.charCodeAt(i + 1)] >> 4)
+ arr[curByte++] = tmp & 0xFF
+ }
+
+ if (placeHoldersLen === 1) {
+ tmp =
+ (revLookup[b64.charCodeAt(i)] << 10) |
+ (revLookup[b64.charCodeAt(i + 1)] << 4) |
+ (revLookup[b64.charCodeAt(i + 2)] >> 2)
+ arr[curByte++] = (tmp >> 8) & 0xFF
+ arr[curByte++] = tmp & 0xFF
+ }
+
+ return arr
+}
+
+function tripletToBase64 (num) {
+ return lookup[num >> 18 & 0x3F] +
+ lookup[num >> 12 & 0x3F] +
+ lookup[num >> 6 & 0x3F] +
+ lookup[num & 0x3F]
+}
+
+function encodeChunk (uint8, start, end) {
+ var tmp
+ var output = []
+ for (var i = start; i < end; i += 3) {
+ tmp =
+ ((uint8[i] << 16) & 0xFF0000) +
+ ((uint8[i + 1] << 8) & 0xFF00) +
+ (uint8[i + 2] & 0xFF)
+ output.push(tripletToBase64(tmp))
+ }
+ return output.join('')
+}
+
+function fromByteArray (uint8) {
+ var tmp
+ var len = uint8.length
+ var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
+ var parts = []
+ var maxChunkLength = 16383 // must be multiple of 3
+
+ // go through the array every three bytes, we'll deal with trailing stuff later
+ for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
+ parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
+ }
+
+ // pad the end with zeros, but make sure to not forget the extra bytes
+ if (extraBytes === 1) {
+ tmp = uint8[len - 1]
+ parts.push(
+ lookup[tmp >> 2] +
+ lookup[(tmp << 4) & 0x3F] +
+ '=='
+ )
+ } else if (extraBytes === 2) {
+ tmp = (uint8[len - 2] << 8) + uint8[len - 1]
+ parts.push(
+ lookup[tmp >> 10] +
+ lookup[(tmp >> 4) & 0x3F] +
+ lookup[(tmp << 2) & 0x3F] +
+ '='
+ )
+ }
+
+ return parts.join('')
+}
+
+},{}],9:[function(require,module,exports){
+(function (Buffer){(function (){
+/*!
+ * The buffer module from node.js, for the browser.
+ *
+ * @author Feross Aboukhadijeh <https://feross.org>
+ * @license MIT
+ */
+/* eslint-disable no-proto */
+
+'use strict'
+
+var base64 = require('base64-js')
+var ieee754 = require('ieee754')
+
+exports.Buffer = Buffer
+exports.SlowBuffer = SlowBuffer
+exports.INSPECT_MAX_BYTES = 50
+
+var K_MAX_LENGTH = 0x7fffffff
+exports.kMaxLength = K_MAX_LENGTH
+
+/**
+ * If `Buffer.TYPED_ARRAY_SUPPORT`:
+ * === true Use Uint8Array implementation (fastest)
+ * === false Print warning and recommend using `buffer` v4.x which has an Object
+ * implementation (most compatible, even IE6)
+ *
+ * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
+ * Opera 11.6+, iOS 4.2+.
+ *
+ * We report that the browser does not support typed arrays if the are not subclassable
+ * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`
+ * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support
+ * for __proto__ and has a buggy typed array implementation.
+ */
+Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport()
+
+if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&
+ typeof console.error === 'function') {
+ console.error(
+ 'This browser lacks typed array (Uint8Array) support which is required by ' +
+ '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'
+ )
+}
+
+function typedArraySupport () {
+ // Can typed array instances can be augmented?
+ try {
+ var arr = new Uint8Array(1)
+ arr.__proto__ = { __proto__: Uint8Array.prototype, foo: function () { return 42 } }
+ return arr.foo() === 42
+ } catch (e) {
+ return false
+ }
+}
+
+Object.defineProperty(Buffer.prototype, 'parent', {
+ enumerable: true,
+ get: function () {
+ if (!Buffer.isBuffer(this)) return undefined
+ return this.buffer
+ }
+})
+
+Object.defineProperty(Buffer.prototype, 'offset', {
+ enumerable: true,
+ get: function () {
+ if (!Buffer.isBuffer(this)) return undefined
+ return this.byteOffset
+ }
+})
+
+function createBuffer (length) {
+ if (length > K_MAX_LENGTH) {
+ throw new RangeError('The value "' + length + '" is invalid for option "size"')
+ }
+ // Return an augmented `Uint8Array` instance
+ var buf = new Uint8Array(length)
+ buf.__proto__ = Buffer.prototype
+ return buf
+}
+
+/**
+ * The Buffer constructor returns instances of `Uint8Array` that have their
+ * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
+ * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
+ * and the `Uint8Array` methods. Square bracket notation works as expected -- it
+ * returns a single octet.
+ *
+ * The `Uint8Array` prototype remains unmodified.
+ */
+
+function Buffer (arg, encodingOrOffset, length) {
+ // Common case.
+ if (typeof arg === 'number') {
+ if (typeof encodingOrOffset === 'string') {
+ throw new TypeError(
+ 'The "string" argument must be of type string. Received type number'
+ )
+ }
+ return allocUnsafe(arg)
+ }
+ return from(arg, encodingOrOffset, length)
+}
+
+// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
+if (typeof Symbol !== 'undefined' && Symbol.species != null &&
+ Buffer[Symbol.species] === Buffer) {
+ Object.defineProperty(Buffer, Symbol.species, {
+ value: null,
+ configurable: true,
+ enumerable: false,
+ writable: false
+ })
+}
+
+Buffer.poolSize = 8192 // not used by this implementation
+
+function from (value, encodingOrOffset, length) {
+ if (typeof value === 'string') {
+ return fromString(value, encodingOrOffset)
+ }
+
+ if (ArrayBuffer.isView(value)) {
+ return fromArrayLike(value)
+ }
+
+ if (value == null) {
+ throw TypeError(
+ 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +
+ 'or Array-like Object. Received type ' + (typeof value)
+ )
+ }
+
+ if (isInstance(value, ArrayBuffer) ||
+ (value && isInstance(value.buffer, ArrayBuffer))) {
+ return fromArrayBuffer(value, encodingOrOffset, length)
+ }
+
+ if (typeof value === 'number') {
+ throw new TypeError(
+ 'The "value" argument must not be of type number. Received type number'
+ )
+ }
+
+ var valueOf = value.valueOf && value.valueOf()
+ if (valueOf != null && valueOf !== value) {
+ return Buffer.from(valueOf, encodingOrOffset, length)
+ }
+
+ var b = fromObject(value)
+ if (b) return b
+
+ if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null &&
+ typeof value[Symbol.toPrimitive] === 'function') {
+ return Buffer.from(
+ value[Symbol.toPrimitive]('string'), encodingOrOffset, length
+ )
+ }
+
+ throw new TypeError(
+ 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +
+ 'or Array-like Object. Received type ' + (typeof value)
+ )
+}
+
+/**
+ * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
+ * if value is a number.
+ * Buffer.from(str[, encoding])
+ * Buffer.from(array)
+ * Buffer.from(buffer)
+ * Buffer.from(arrayBuffer[, byteOffset[, length]])
+ **/
+Buffer.from = function (value, encodingOrOffset, length) {
+ return from(value, encodingOrOffset, length)
+}
+
+// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:
+// https://github.com/feross/buffer/pull/148
+Buffer.prototype.__proto__ = Uint8Array.prototype
+Buffer.__proto__ = Uint8Array
+
+function assertSize (size) {
+ if (typeof size !== 'number') {
+ throw new TypeError('"size" argument must be of type number')
+ } else if (size < 0) {
+ throw new RangeError('The value "' + size + '" is invalid for option "size"')
+ }
+}
+
+function alloc (size, fill, encoding) {
+ assertSize(size)
+ if (size <= 0) {
+ return createBuffer(size)
+ }
+ if (fill !== undefined) {
+ // Only pay attention to encoding if it's a string. This
+ // prevents accidentally sending in a number that would
+ // be interpretted as a start offset.
+ return typeof encoding === 'string'
+ ? createBuffer(size).fill(fill, encoding)
+ : createBuffer(size).fill(fill)
+ }
+ return createBuffer(size)
+}
+
+/**
+ * Creates a new filled Buffer instance.
+ * alloc(size[, fill[, encoding]])
+ **/
+Buffer.alloc = function (size, fill, encoding) {
+ return alloc(size, fill, encoding)
+}
+
+function allocUnsafe (size) {
+ assertSize(size)
+ return createBuffer(size < 0 ? 0 : checked(size) | 0)
+}
+
+/**
+ * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
+ * */
+Buffer.allocUnsafe = function (size) {
+ return allocUnsafe(size)
+}
+/**
+ * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
+ */
+Buffer.allocUnsafeSlow = function (size) {
+ return allocUnsafe(size)
+}
+
+function fromString (string, encoding) {
+ if (typeof encoding !== 'string' || encoding === '') {
+ encoding = 'utf8'
+ }
+
+ if (!Buffer.isEncoding(encoding)) {
+ throw new TypeError('Unknown encoding: ' + encoding)
+ }
+
+ var length = byteLength(string, encoding) | 0
+ var buf = createBuffer(length)
+
+ var actual = buf.write(string, encoding)
+
+ if (actual !== length) {
+ // Writing a hex string, for example, that contains invalid characters will
+ // cause everything after the first invalid character to be ignored. (e.g.
+ // 'abxxcd' will be treated as 'ab')
+ buf = buf.slice(0, actual)
+ }
+
+ return buf
+}
+
+function fromArrayLike (array) {
+ var length = array.length < 0 ? 0 : checked(array.length) | 0
+ var buf = createBuffer(length)
+ for (var i = 0; i < length; i += 1) {
+ buf[i] = array[i] & 255
+ }
+ return buf
+}
+
+function fromArrayBuffer (array, byteOffset, length) {
+ if (byteOffset < 0 || array.byteLength < byteOffset) {
+ throw new RangeError('"offset" is outside of buffer bounds')
+ }
+
+ if (array.byteLength < byteOffset + (length || 0)) {
+ throw new RangeError('"length" is outside of buffer bounds')
+ }
+
+ var buf
+ if (byteOffset === undefined && length === undefined) {
+ buf = new Uint8Array(array)
+ } else if (length === undefined) {
+ buf = new Uint8Array(array, byteOffset)
+ } else {
+ buf = new Uint8Array(array, byteOffset, length)
+ }
+
+ // Return an augmented `Uint8Array` instance
+ buf.__proto__ = Buffer.prototype
+ return buf
+}
+
+function fromObject (obj) {
+ if (Buffer.isBuffer(obj)) {
+ var len = checked(obj.length) | 0
+ var buf = createBuffer(len)
+
+ if (buf.length === 0) {
+ return buf
+ }
+
+ obj.copy(buf, 0, 0, len)
+ return buf
+ }
+
+ if (obj.length !== undefined) {
+ if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {
+ return createBuffer(0)
+ }
+ return fromArrayLike(obj)
+ }
+
+ if (obj.type === 'Buffer' && Array.isArray(obj.data)) {
+ return fromArrayLike(obj.data)
+ }
+}
+
+function checked (length) {
+ // Note: cannot use `length < K_MAX_LENGTH` here because that fails when
+ // length is NaN (which is otherwise coerced to zero.)
+ if (length >= K_MAX_LENGTH) {
+ throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
+ 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')
+ }
+ return length | 0
+}
+
+function SlowBuffer (length) {
+ if (+length != length) { // eslint-disable-line eqeqeq
+ length = 0
+ }
+ return Buffer.alloc(+length)
+}
+
+Buffer.isBuffer = function isBuffer (b) {
+ return b != null && b._isBuffer === true &&
+ b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false
+}
+
+Buffer.compare = function compare (a, b) {
+ if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength)
+ if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength)
+ if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
+ throw new TypeError(
+ 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
+ )
+ }
+
+ if (a === b) return 0
+
+ var x = a.length
+ var y = b.length
+
+ for (var i = 0, len = Math.min(x, y); i < len; ++i) {
+ if (a[i] !== b[i]) {
+ x = a[i]
+ y = b[i]
+ break
+ }
+ }
+
+ if (x < y) return -1
+ if (y < x) return 1
+ return 0
+}
+
+Buffer.isEncoding = function isEncoding (encoding) {
+ switch (String(encoding).toLowerCase()) {
+ case 'hex':
+ case 'utf8':
+ case 'utf-8':
+ case 'ascii':
+ case 'latin1':
+ case 'binary':
+ case 'base64':
+ case 'ucs2':
+ case 'ucs-2':
+ case 'utf16le':
+ case 'utf-16le':
+ return true
+ default:
+ return false
+ }
+}
+
+Buffer.concat = function concat (list, length) {
+ if (!Array.isArray(list)) {
+ throw new TypeError('"list" argument must be an Array of Buffers')
+ }
+
+ if (list.length === 0) {
+ return Buffer.alloc(0)
+ }
+
+ var i
+ if (length === undefined) {
+ length = 0
+ for (i = 0; i < list.length; ++i) {
+ length += list[i].length
+ }
+ }
+
+ var buffer = Buffer.allocUnsafe(length)
+ var pos = 0
+ for (i = 0; i < list.length; ++i) {
+ var buf = list[i]
+ if (isInstance(buf, Uint8Array)) {
+ buf = Buffer.from(buf)
+ }
+ if (!Buffer.isBuffer(buf)) {
+ throw new TypeError('"list" argument must be an Array of Buffers')
+ }
+ buf.copy(buffer, pos)
+ pos += buf.length
+ }
+ return buffer
+}
+
+function byteLength (string, encoding) {
+ if (Buffer.isBuffer(string)) {
+ return string.length
+ }
+ if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {
+ return string.byteLength
+ }
+ if (typeof string !== 'string') {
+ throw new TypeError(
+ 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' +
+ 'Received type ' + typeof string
+ )
+ }
+
+ var len = string.length
+ var mustMatch = (arguments.length > 2 && arguments[2] === true)
+ if (!mustMatch && len === 0) return 0
+
+ // Use a for loop to avoid recursion
+ var loweredCase = false
+ for (;;) {
+ switch (encoding) {
+ case 'ascii':
+ case 'latin1':
+ case 'binary':
+ return len
+ case 'utf8':
+ case 'utf-8':
+ return utf8ToBytes(string).length
+ case 'ucs2':
+ case 'ucs-2':
+ case 'utf16le':
+ case 'utf-16le':
+ return len * 2
+ case 'hex':
+ return len >>> 1
+ case 'base64':
+ return base64ToBytes(string).length
+ default:
+ if (loweredCase) {
+ return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8
+ }
+ encoding = ('' + encoding).toLowerCase()
+ loweredCase = true
+ }
+ }
+}
+Buffer.byteLength = byteLength
+
+function slowToString (encoding, start, end) {
+ var loweredCase = false
+
+ // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
+ // property of a typed array.
+
+ // This behaves neither like String nor Uint8Array in that we set start/end
+ // to their upper/lower bounds if the value passed is out of range.
+ // undefined is handled specially as per ECMA-262 6th Edition,
+ // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
+ if (start === undefined || start < 0) {
+ start = 0
+ }
+ // Return early if start > this.length. Done here to prevent potential uint32
+ // coercion fail below.
+ if (start > this.length) {
+ return ''
+ }
+
+ if (end === undefined || end > this.length) {
+ end = this.length
+ }
+
+ if (end <= 0) {
+ return ''
+ }
+
+ // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
+ end >>>= 0
+ start >>>= 0
+
+ if (end <= start) {
+ return ''
+ }
+
+ if (!encoding) encoding = 'utf8'
+
+ while (true) {
+ switch (encoding) {
+ case 'hex':
+ return hexSlice(this, start, end)
+
+ case 'utf8':
+ case 'utf-8':
+ return utf8Slice(this, start, end)
+
+ case 'ascii':
+ return asciiSlice(this, start, end)
+
+ case 'latin1':
+ case 'binary':
+ return latin1Slice(this, start, end)
+
+ case 'base64':
+ return base64Slice(this, start, end)
+
+ case 'ucs2':
+ case 'ucs-2':
+ case 'utf16le':
+ case 'utf-16le':
+ return utf16leSlice(this, start, end)
+
+ default:
+ if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
+ encoding = (encoding + '').toLowerCase()
+ loweredCase = true
+ }
+ }
+}
+
+// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)
+// to detect a Buffer instance. It's not possible to use `instanceof Buffer`
+// reliably in a browserify context because there could be multiple different
+// copies of the 'buffer' package in use. This method works even for Buffer
+// instances that were created from another copy of the `buffer` package.
+// See: https://github.com/feross/buffer/issues/154
+Buffer.prototype._isBuffer = true
+
+function swap (b, n, m) {
+ var i = b[n]
+ b[n] = b[m]
+ b[m] = i
+}
+
+Buffer.prototype.swap16 = function swap16 () {
+ var len = this.length
+ if (len % 2 !== 0) {
+ throw new RangeError('Buffer size must be a multiple of 16-bits')
+ }
+ for (var i = 0; i < len; i += 2) {
+ swap(this, i, i + 1)
+ }
+ return this
+}
+
+Buffer.prototype.swap32 = function swap32 () {
+ var len = this.length
+ if (len % 4 !== 0) {
+ throw new RangeError('Buffer size must be a multiple of 32-bits')
+ }
+ for (var i = 0; i < len; i += 4) {
+ swap(this, i, i + 3)
+ swap(this, i + 1, i + 2)
+ }
+ return this
+}
+
+Buffer.prototype.swap64 = function swap64 () {
+ var len = this.length
+ if (len % 8 !== 0) {
+ throw new RangeError('Buffer size must be a multiple of 64-bits')
+ }
+ for (var i = 0; i < len; i += 8) {
+ swap(this, i, i + 7)
+ swap(this, i + 1, i + 6)
+ swap(this, i + 2, i + 5)
+ swap(this, i + 3, i + 4)
+ }
+ return this
+}
+
+Buffer.prototype.toString = function toString () {
+ var length = this.length
+ if (length === 0) return ''
+ if (arguments.length === 0) return utf8Slice(this, 0, length)
+ return slowToString.apply(this, arguments)
+}
+
+Buffer.prototype.toLocaleString = Buffer.prototype.toString
+
+Buffer.prototype.equals = function equals (b) {
+ if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
+ if (this === b) return true
+ return Buffer.compare(this, b) === 0
+}
+
+Buffer.prototype.inspect = function inspect () {
+ var str = ''
+ var max = exports.INSPECT_MAX_BYTES
+ str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim()
+ if (this.length > max) str += ' ... '
+ return '<Buffer ' + str + '>'
+}
+
+Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
+ if (isInstance(target, Uint8Array)) {
+ target = Buffer.from(target, target.offset, target.byteLength)
+ }
+ if (!Buffer.isBuffer(target)) {
+ throw new TypeError(
+ 'The "target" argument must be one of type Buffer or Uint8Array. ' +
+ 'Received type ' + (typeof target)
+ )
+ }
+
+ if (start === undefined) {
+ start = 0
+ }
+ if (end === undefined) {
+ end = target ? target.length : 0
+ }
+ if (thisStart === undefined) {
+ thisStart = 0
+ }
+ if (thisEnd === undefined) {
+ thisEnd = this.length
+ }
+
+ if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
+ throw new RangeError('out of range index')
+ }
+
+ if (thisStart >= thisEnd && start >= end) {
+ return 0
+ }
+ if (thisStart >= thisEnd) {
+ return -1
+ }
+ if (start >= end) {
+ return 1
+ }
+
+ start >>>= 0
+ end >>>= 0
+ thisStart >>>= 0
+ thisEnd >>>= 0
+
+ if (this === target) return 0
+
+ var x = thisEnd - thisStart
+ var y = end - start
+ var len = Math.min(x, y)
+
+ var thisCopy = this.slice(thisStart, thisEnd)
+ var targetCopy = target.slice(start, end)
+
+ for (var i = 0; i < len; ++i) {
+ if (thisCopy[i] !== targetCopy[i]) {
+ x = thisCopy[i]
+ y = targetCopy[i]
+ break
+ }
+ }
+
+ if (x < y) return -1
+ if (y < x) return 1
+ return 0
+}
+
+// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
+// OR the last index of `val` in `buffer` at offset <= `byteOffset`.
+//
+// Arguments:
+// - buffer - a Buffer to search
+// - val - a string, Buffer, or number
+// - byteOffset - an index into `buffer`; will be clamped to an int32
+// - encoding - an optional encoding, relevant is val is a string
+// - dir - true for indexOf, false for lastIndexOf
+function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
+ // Empty buffer means no match
+ if (buffer.length === 0) return -1
+
+ // Normalize byteOffset
+ if (typeof byteOffset === 'string') {
+ encoding = byteOffset
+ byteOffset = 0
+ } else if (byteOffset > 0x7fffffff) {
+ byteOffset = 0x7fffffff
+ } else if (byteOffset < -0x80000000) {
+ byteOffset = -0x80000000
+ }
+ byteOffset = +byteOffset // Coerce to Number.
+ if (numberIsNaN(byteOffset)) {
+ // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
+ byteOffset = dir ? 0 : (buffer.length - 1)
+ }
+
+ // Normalize byteOffset: negative offsets start from the end of the buffer
+ if (byteOffset < 0) byteOffset = buffer.length + byteOffset
+ if (byteOffset >= buffer.length) {
+ if (dir) return -1
+ else byteOffset = buffer.length - 1
+ } else if (byteOffset < 0) {
+ if (dir) byteOffset = 0
+ else return -1
+ }
+
+ // Normalize val
+ if (typeof val === 'string') {
+ val = Buffer.from(val, encoding)
+ }
+
+ // Finally, search either indexOf (if dir is true) or lastIndexOf
+ if (Buffer.isBuffer(val)) {
+ // Special case: looking for empty string/buffer always fails
+ if (val.length === 0) {
+ return -1
+ }
+ return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
+ } else if (typeof val === 'number') {
+ val = val & 0xFF // Search for a byte value [0-255]
+ if (typeof Uint8Array.prototype.indexOf === 'function') {
+ if (dir) {
+ return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
+ } else {
+ return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
+ }
+ }
+ return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
+ }
+
+ throw new TypeError('val must be string, number or Buffer')
+}
+
+function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
+ var indexSize = 1
+ var arrLength = arr.length
+ var valLength = val.length
+
+ if (encoding !== undefined) {
+ encoding = String(encoding).toLowerCase()
+ if (encoding === 'ucs2' || encoding === 'ucs-2' ||
+ encoding === 'utf16le' || encoding === 'utf-16le') {
+ if (arr.length < 2 || val.length < 2) {
+ return -1
+ }
+ indexSize = 2
+ arrLength /= 2
+ valLength /= 2
+ byteOffset /= 2
+ }
+ }
+
+ function read (buf, i) {
+ if (indexSize === 1) {
+ return buf[i]
+ } else {
+ return buf.readUInt16BE(i * indexSize)
+ }
+ }
+
+ var i
+ if (dir) {
+ var foundIndex = -1
+ for (i = byteOffset; i < arrLength; i++) {
+ if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
+ if (foundIndex === -1) foundIndex = i
+ if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
+ } else {
+ if (foundIndex !== -1) i -= i - foundIndex
+ foundIndex = -1
+ }
+ }
+ } else {
+ if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
+ for (i = byteOffset; i >= 0; i--) {
+ var found = true
+ for (var j = 0; j < valLength; j++) {
+ if (read(arr, i + j) !== read(val, j)) {
+ found = false
+ break
+ }
+ }
+ if (found) return i
+ }
+ }
+
+ return -1
+}
+
+Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
+ return this.indexOf(val, byteOffset, encoding) !== -1
+}
+
+Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
+ return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
+}
+
+Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
+ return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
+}
+
+function hexWrite (buf, string, offset, length) {
+ offset = Number(offset) || 0
+ var remaining = buf.length - offset
+ if (!length) {
+ length = remaining
+ } else {
+ length = Number(length)
+ if (length > remaining) {
+ length = remaining
+ }
+ }
+
+ var strLen = string.length
+
+ if (length > strLen / 2) {
+ length = strLen / 2
+ }
+ for (var i = 0; i < length; ++i) {
+ var parsed = parseInt(string.substr(i * 2, 2), 16)
+ if (numberIsNaN(parsed)) return i
+ buf[offset + i] = parsed
+ }
+ return i
+}
+
+function utf8Write (buf, string, offset, length) {
+ return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
+}
+
+function asciiWrite (buf, string, offset, length) {
+ return blitBuffer(asciiToBytes(string), buf, offset, length)
+}
+
+function latin1Write (buf, string, offset, length) {
+ return asciiWrite(buf, string, offset, length)
+}
+
+function base64Write (buf, string, offset, length) {
+ return blitBuffer(base64ToBytes(string), buf, offset, length)
+}
+
+function ucs2Write (buf, string, offset, length) {
+ return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
+}
+
+Buffer.prototype.write = function write (string, offset, length, encoding) {
+ // Buffer#write(string)
+ if (offset === undefined) {
+ encoding = 'utf8'
+ length = this.length
+ offset = 0
+ // Buffer#write(string, encoding)
+ } else if (length === undefined && typeof offset === 'string') {
+ encoding = offset
+ length = this.length
+ offset = 0
+ // Buffer#write(string, offset[, length][, encoding])
+ } else if (isFinite(offset)) {
+ offset = offset >>> 0
+ if (isFinite(length)) {
+ length = length >>> 0
+ if (encoding === undefined) encoding = 'utf8'
+ } else {
+ encoding = length
+ length = undefined
+ }
+ } else {
+ throw new Error(
+ 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
+ )
+ }
+
+ var remaining = this.length - offset
+ if (length === undefined || length > remaining) length = remaining
+
+ if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
+ throw new RangeError('Attempt to write outside buffer bounds')
+ }
+
+ if (!encoding) encoding = 'utf8'
+
+ var loweredCase = false
+ for (;;) {
+ switch (encoding) {
+ case 'hex':
+ return hexWrite(this, string, offset, length)
+
+ case 'utf8':
+ case 'utf-8':
+ return utf8Write(this, string, offset, length)
+
+ case 'ascii':
+ return asciiWrite(this, string, offset, length)
+
+ case 'latin1':
+ case 'binary':
+ return latin1Write(this, string, offset, length)
+
+ case 'base64':
+ // Warning: maxLength not taken into account in base64Write
+ return base64Write(this, string, offset, length)
+
+ case 'ucs2':
+ case 'ucs-2':
+ case 'utf16le':
+ case 'utf-16le':
+ return ucs2Write(this, string, offset, length)
+
+ default:
+ if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
+ encoding = ('' + encoding).toLowerCase()
+ loweredCase = true
+ }
+ }
+}
+
+Buffer.prototype.toJSON = function toJSON () {
+ return {
+ type: 'Buffer',
+ data: Array.prototype.slice.call(this._arr || this, 0)
+ }
+}
+
+function base64Slice (buf, start, end) {
+ if (start === 0 && end === buf.length) {
+ return base64.fromByteArray(buf)
+ } else {
+ return base64.fromByteArray(buf.slice(start, end))
+ }
+}
+
+function utf8Slice (buf, start, end) {
+ end = Math.min(buf.length, end)
+ var res = []
+
+ var i = start
+ while (i < end) {
+ var firstByte = buf[i]
+ var codePoint = null
+ var bytesPerSequence = (firstByte > 0xEF) ? 4
+ : (firstByte > 0xDF) ? 3
+ : (firstByte > 0xBF) ? 2
+ : 1
+
+ if (i + bytesPerSequence <= end) {
+ var secondByte, thirdByte, fourthByte, tempCodePoint
+
+ switch (bytesPerSequence) {
+ case 1:
+ if (firstByte < 0x80) {
+ codePoint = firstByte
+ }
+ break
+ case 2:
+ secondByte = buf[i + 1]
+ if ((secondByte & 0xC0) === 0x80) {
+ tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
+ if (tempCodePoint > 0x7F) {
+ codePoint = tempCodePoint
+ }
+ }
+ break
+ case 3:
+ secondByte = buf[i + 1]
+ thirdByte = buf[i + 2]
+ if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
+ tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
+ if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
+ codePoint = tempCodePoint
+ }
+ }
+ break
+ case 4:
+ secondByte = buf[i + 1]
+ thirdByte = buf[i + 2]
+ fourthByte = buf[i + 3]
+ if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
+ tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
+ if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
+ codePoint = tempCodePoint
+ }
+ }
+ }
+ }
+
+ if (codePoint === null) {
+ // we did not generate a valid codePoint so insert a
+ // replacement char (U+FFFD) and advance only 1 byte
+ codePoint = 0xFFFD
+ bytesPerSequence = 1
+ } else if (codePoint > 0xFFFF) {
+ // encode to utf16 (surrogate pair dance)
+ codePoint -= 0x10000
+ res.push(codePoint >>> 10 & 0x3FF | 0xD800)
+ codePoint = 0xDC00 | codePoint & 0x3FF
+ }
+
+ res.push(codePoint)
+ i += bytesPerSequence
+ }
+
+ return decodeCodePointsArray(res)
+}
+
+// Based on http://stackoverflow.com/a/22747272/680742, the browser with
+// the lowest limit is Chrome, with 0x10000 args.
+// We go 1 magnitude less, for safety
+var MAX_ARGUMENTS_LENGTH = 0x1000
+
+function decodeCodePointsArray (codePoints) {
+ var len = codePoints.length
+ if (len <= MAX_ARGUMENTS_LENGTH) {
+ return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
+ }
+
+ // Decode in chunks to avoid "call stack size exceeded".
+ var res = ''
+ var i = 0
+ while (i < len) {
+ res += String.fromCharCode.apply(
+ String,
+ codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
+ )
+ }
+ return res
+}
+
+function asciiSlice (buf, start, end) {
+ var ret = ''
+ end = Math.min(buf.length, end)
+
+ for (var i = start; i < end; ++i) {
+ ret += String.fromCharCode(buf[i] & 0x7F)
+ }
+ return ret
+}
+
+function latin1Slice (buf, start, end) {
+ var ret = ''
+ end = Math.min(buf.length, end)
+
+ for (var i = start; i < end; ++i) {
+ ret += String.fromCharCode(buf[i])
+ }
+ return ret
+}
+
+function hexSlice (buf, start, end) {
+ var len = buf.length
+
+ if (!start || start < 0) start = 0
+ if (!end || end < 0 || end > len) end = len
+
+ var out = ''
+ for (var i = start; i < end; ++i) {
+ out += toHex(buf[i])
+ }
+ return out
+}
+
+function utf16leSlice (buf, start, end) {
+ var bytes = buf.slice(start, end)
+ var res = ''
+ for (var i = 0; i < bytes.length; i += 2) {
+ res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))
+ }
+ return res
+}
+
+Buffer.prototype.slice = function slice (start, end) {
+ var len = this.length
+ start = ~~start
+ end = end === undefined ? len : ~~end
+
+ if (start < 0) {
+ start += len
+ if (start < 0) start = 0
+ } else if (start > len) {
+ start = len
+ }
+
+ if (end < 0) {
+ end += len
+ if (end < 0) end = 0
+ } else if (end > len) {
+ end = len
+ }
+
+ if (end < start) end = start
+
+ var newBuf = this.subarray(start, end)
+ // Return an augmented `Uint8Array` instance
+ newBuf.__proto__ = Buffer.prototype
+ return newBuf
+}
+
+/*
+ * Need to make sure that buffer isn't trying to write out of bounds.
+ */
+function checkOffset (offset, ext, length) {
+ if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
+ if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
+}
+
+Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
+ offset = offset >>> 0
+ byteLength = byteLength >>> 0
+ if (!noAssert) checkOffset(offset, byteLength, this.length)
+
+ var val = this[offset]
+ var mul = 1
+ var i = 0
+ while (++i < byteLength && (mul *= 0x100)) {
+ val += this[offset + i] * mul
+ }
+
+ return val
+}
+
+Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
+ offset = offset >>> 0
+ byteLength = byteLength >>> 0
+ if (!noAssert) {
+ checkOffset(offset, byteLength, this.length)
+ }
+
+ var val = this[offset + --byteLength]
+ var mul = 1
+ while (byteLength > 0 && (mul *= 0x100)) {
+ val += this[offset + --byteLength] * mul
+ }
+
+ return val
+}
+
+Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
+ offset = offset >>> 0
+ if (!noAssert) checkOffset(offset, 1, this.length)
+ return this[offset]
+}
+
+Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
+ offset = offset >>> 0
+ if (!noAssert) checkOffset(offset, 2, this.length)
+ return this[offset] | (this[offset + 1] << 8)
+}
+
+Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
+ offset = offset >>> 0
+ if (!noAssert) checkOffset(offset, 2, this.length)
+ return (this[offset] << 8) | this[offset + 1]
+}
+
+Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
+ offset = offset >>> 0
+ if (!noAssert) checkOffset(offset, 4, this.length)
+
+ return ((this[offset]) |
+ (this[offset + 1] << 8) |
+ (this[offset + 2] << 16)) +
+ (this[offset + 3] * 0x1000000)
+}
+
+Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
+ offset = offset >>> 0
+ if (!noAssert) checkOffset(offset, 4, this.length)
+
+ return (this[offset] * 0x1000000) +
+ ((this[offset + 1] << 16) |
+ (this[offset + 2] << 8) |
+ this[offset + 3])
+}
+
+Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
+ offset = offset >>> 0
+ byteLength = byteLength >>> 0
+ if (!noAssert) checkOffset(offset, byteLength, this.length)
+
+ var val = this[offset]
+ var mul = 1
+ var i = 0
+ while (++i < byteLength && (mul *= 0x100)) {
+ val += this[offset + i] * mul
+ }
+ mul *= 0x80
+
+ if (val >= mul) val -= Math.pow(2, 8 * byteLength)
+
+ return val
+}
+
+Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
+ offset = offset >>> 0
+ byteLength = byteLength >>> 0
+ if (!noAssert) checkOffset(offset, byteLength, this.length)
+
+ var i = byteLength
+ var mul = 1
+ var val = this[offset + --i]
+ while (i > 0 && (mul *= 0x100)) {
+ val += this[offset + --i] * mul
+ }
+ mul *= 0x80
+
+ if (val >= mul) val -= Math.pow(2, 8 * byteLength)
+
+ return val
+}
+
+Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
+ offset = offset >>> 0
+ if (!noAssert) checkOffset(offset, 1, this.length)
+ if (!(this[offset] & 0x80)) return (this[offset])
+ return ((0xff - this[offset] + 1) * -1)
+}
+
+Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
+ offset = offset >>> 0
+ if (!noAssert) checkOffset(offset, 2, this.length)
+ var val = this[offset] | (this[offset + 1] << 8)
+ return (val & 0x8000) ? val | 0xFFFF0000 : val
+}
+
+Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
+ offset = offset >>> 0
+ if (!noAssert) checkOffset(offset, 2, this.length)
+ var val = this[offset + 1] | (this[offset] << 8)
+ return (val & 0x8000) ? val | 0xFFFF0000 : val
+}
+
+Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
+ offset = offset >>> 0
+ if (!noAssert) checkOffset(offset, 4, this.length)
+
+ return (this[offset]) |
+ (this[offset + 1] << 8) |
+ (this[offset + 2] << 16) |
+ (this[offset + 3] << 24)
+}
+
+Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
+ offset = offset >>> 0
+ if (!noAssert) checkOffset(offset, 4, this.length)
+
+ return (this[offset] << 24) |
+ (this[offset + 1] << 16) |
+ (this[offset + 2] << 8) |
+ (this[offset + 3])
+}
+
+Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
+ offset = offset >>> 0
+ if (!noAssert) checkOffset(offset, 4, this.length)
+ return ieee754.read(this, offset, true, 23, 4)
+}
+
+Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
+ offset = offset >>> 0
+ if (!noAssert) checkOffset(offset, 4, this.length)
+ return ieee754.read(this, offset, false, 23, 4)
+}
+
+Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
+ offset = offset >>> 0
+ if (!noAssert) checkOffset(offset, 8, this.length)
+ return ieee754.read(this, offset, true, 52, 8)
+}
+
+Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
+ offset = offset >>> 0
+ if (!noAssert) checkOffset(offset, 8, this.length)
+ return ieee754.read(this, offset, false, 52, 8)
+}
+
+function checkInt (buf, value, offset, ext, max, min) {
+ if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
+ if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
+ if (offset + ext > buf.length) throw new RangeError('Index out of range')
+}
+
+Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
+ value = +value
+ offset = offset >>> 0
+ byteLength = byteLength >>> 0
+ if (!noAssert) {
+ var maxBytes = Math.pow(2, 8 * byteLength) - 1
+ checkInt(this, value, offset, byteLength, maxBytes, 0)
+ }
+
+ var mul = 1
+ var i = 0
+ this[offset] = value & 0xFF
+ while (++i < byteLength && (mul *= 0x100)) {
+ this[offset + i] = (value / mul) & 0xFF
+ }
+
+ return offset + byteLength
+}
+
+Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
+ value = +value
+ offset = offset >>> 0
+ byteLength = byteLength >>> 0
+ if (!noAssert) {
+ var maxBytes = Math.pow(2, 8 * byteLength) - 1
+ checkInt(this, value, offset, byteLength, maxBytes, 0)
+ }
+
+ var i = byteLength - 1
+ var mul = 1
+ this[offset + i] = value & 0xFF
+ while (--i >= 0 && (mul *= 0x100)) {
+ this[offset + i] = (value / mul) & 0xFF
+ }
+
+ return offset + byteLength
+}
+
+Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
+ value = +value
+ offset = offset >>> 0
+ if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
+ this[offset] = (value & 0xff)
+ return offset + 1
+}
+
+Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
+ value = +value
+ offset = offset >>> 0
+ if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
+ this[offset] = (value & 0xff)
+ this[offset + 1] = (value >>> 8)
+ return offset + 2
+}
+
+Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
+ value = +value
+ offset = offset >>> 0
+ if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
+ this[offset] = (value >>> 8)
+ this[offset + 1] = (value & 0xff)
+ return offset + 2
+}
+
+Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
+ value = +value
+ offset = offset >>> 0
+ if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
+ this[offset + 3] = (value >>> 24)
+ this[offset + 2] = (value >>> 16)
+ this[offset + 1] = (value >>> 8)
+ this[offset] = (value & 0xff)
+ return offset + 4
+}
+
+Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
+ value = +value
+ offset = offset >>> 0
+ if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
+ this[offset] = (value >>> 24)
+ this[offset + 1] = (value >>> 16)
+ this[offset + 2] = (value >>> 8)
+ this[offset + 3] = (value & 0xff)
+ return offset + 4
+}
+
+Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
+ value = +value
+ offset = offset >>> 0
+ if (!noAssert) {
+ var limit = Math.pow(2, (8 * byteLength) - 1)
+
+ checkInt(this, value, offset, byteLength, limit - 1, -limit)
+ }
+
+ var i = 0
+ var mul = 1
+ var sub = 0
+ this[offset] = value & 0xFF
+ while (++i < byteLength && (mul *= 0x100)) {
+ if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
+ sub = 1
+ }
+ this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
+ }
+
+ return offset + byteLength
+}
+
+Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
+ value = +value
+ offset = offset >>> 0
+ if (!noAssert) {
+ var limit = Math.pow(2, (8 * byteLength) - 1)
+
+ checkInt(this, value, offset, byteLength, limit - 1, -limit)
+ }
+
+ var i = byteLength - 1
+ var mul = 1
+ var sub = 0
+ this[offset + i] = value & 0xFF
+ while (--i >= 0 && (mul *= 0x100)) {
+ if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
+ sub = 1
+ }
+ this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
+ }
+
+ return offset + byteLength
+}
+
+Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
+ value = +value
+ offset = offset >>> 0
+ if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
+ if (value < 0) value = 0xff + value + 1
+ this[offset] = (value & 0xff)
+ return offset + 1
+}
+
+Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
+ value = +value
+ offset = offset >>> 0
+ if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
+ this[offset] = (value & 0xff)
+ this[offset + 1] = (value >>> 8)
+ return offset + 2
+}
+
+Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
+ value = +value
+ offset = offset >>> 0
+ if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
+ this[offset] = (value >>> 8)
+ this[offset + 1] = (value & 0xff)
+ return offset + 2
+}
+
+Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
+ value = +value
+ offset = offset >>> 0
+ if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
+ this[offset] = (value & 0xff)
+ this[offset + 1] = (value >>> 8)
+ this[offset + 2] = (value >>> 16)
+ this[offset + 3] = (value >>> 24)
+ return offset + 4
+}
+
+Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
+ value = +value
+ offset = offset >>> 0
+ if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
+ if (value < 0) value = 0xffffffff + value + 1
+ this[offset] = (value >>> 24)
+ this[offset + 1] = (value >>> 16)
+ this[offset + 2] = (value >>> 8)
+ this[offset + 3] = (value & 0xff)
+ return offset + 4
+}
+
+function checkIEEE754 (buf, value, offset, ext, max, min) {
+ if (offset + ext > buf.length) throw new RangeError('Index out of range')
+ if (offset < 0) throw new RangeError('Index out of range')
+}
+
+function writeFloat (buf, value, offset, littleEndian, noAssert) {
+ value = +value
+ offset = offset >>> 0
+ if (!noAssert) {
+ checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
+ }
+ ieee754.write(buf, value, offset, littleEndian, 23, 4)
+ return offset + 4
+}
+
+Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
+ return writeFloat(this, value, offset, true, noAssert)
+}
+
+Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
+ return writeFloat(this, value, offset, false, noAssert)
+}
+
+function writeDouble (buf, value, offset, littleEndian, noAssert) {
+ value = +value
+ offset = offset >>> 0
+ if (!noAssert) {
+ checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
+ }
+ ieee754.write(buf, value, offset, littleEndian, 52, 8)
+ return offset + 8
+}
+
+Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
+ return writeDouble(this, value, offset, true, noAssert)
+}
+
+Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
+ return writeDouble(this, value, offset, false, noAssert)
+}
+
+// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
+Buffer.prototype.copy = function copy (target, targetStart, start, end) {
+ if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer')
+ if (!start) start = 0
+ if (!end && end !== 0) end = this.length
+ if (targetStart >= target.length) targetStart = target.length
+ if (!targetStart) targetStart = 0
+ if (end > 0 && end < start) end = start
+
+ // Copy 0 bytes; we're done
+ if (end === start) return 0
+ if (target.length === 0 || this.length === 0) return 0
+
+ // Fatal error conditions
+ if (targetStart < 0) {
+ throw new RangeError('targetStart out of bounds')
+ }
+ if (start < 0 || start >= this.length) throw new RangeError('Index out of range')
+ if (end < 0) throw new RangeError('sourceEnd out of bounds')
+
+ // Are we oob?
+ if (end > this.length) end = this.length
+ if (target.length - targetStart < end - start) {
+ end = target.length - targetStart + start
+ }
+
+ var len = end - start
+
+ if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') {
+ // Use built-in when available, missing from IE11
+ this.copyWithin(targetStart, start, end)
+ } else if (this === target && start < targetStart && targetStart < end) {
+ // descending copy from end
+ for (var i = len - 1; i >= 0; --i) {
+ target[i + targetStart] = this[i + start]
+ }
+ } else {
+ Uint8Array.prototype.set.call(
+ target,
+ this.subarray(start, end),
+ targetStart
+ )
+ }
+
+ return len
+}
+
+// Usage:
+// buffer.fill(number[, offset[, end]])
+// buffer.fill(buffer[, offset[, end]])
+// buffer.fill(string[, offset[, end]][, encoding])
+Buffer.prototype.fill = function fill (val, start, end, encoding) {
+ // Handle string cases:
+ if (typeof val === 'string') {
+ if (typeof start === 'string') {
+ encoding = start
+ start = 0
+ end = this.length
+ } else if (typeof end === 'string') {
+ encoding = end
+ end = this.length
+ }
+ if (encoding !== undefined && typeof encoding !== 'string') {
+ throw new TypeError('encoding must be a string')
+ }
+ if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
+ throw new TypeError('Unknown encoding: ' + encoding)
+ }
+ if (val.length === 1) {
+ var code = val.charCodeAt(0)
+ if ((encoding === 'utf8' && code < 128) ||
+ encoding === 'latin1') {
+ // Fast path: If `val` fits into a single byte, use that numeric value.
+ val = code
+ }
+ }
+ } else if (typeof val === 'number') {
+ val = val & 255
+ }
+
+ // Invalid ranges are not set to a default, so can range check early.
+ if (start < 0 || this.length < start || this.length < end) {
+ throw new RangeError('Out of range index')
+ }
+
+ if (end <= start) {
+ return this
+ }
+
+ start = start >>> 0
+ end = end === undefined ? this.length : end >>> 0
+
+ if (!val) val = 0
+
+ var i
+ if (typeof val === 'number') {
+ for (i = start; i < end; ++i) {
+ this[i] = val
+ }
+ } else {
+ var bytes = Buffer.isBuffer(val)
+ ? val
+ : Buffer.from(val, encoding)
+ var len = bytes.length
+ if (len === 0) {
+ throw new TypeError('The value "' + val +
+ '" is invalid for argument "value"')
+ }
+ for (i = 0; i < end - start; ++i) {
+ this[i + start] = bytes[i % len]
+ }
+ }
+
+ return this
+}
+
+// HELPER FUNCTIONS
+// ================
+
+var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g
+
+function base64clean (str) {
+ // Node takes equal signs as end of the Base64 encoding
+ str = str.split('=')[0]
+ // Node strips out invalid characters like \n and \t from the string, base64-js does not
+ str = str.trim().replace(INVALID_BASE64_RE, '')
+ // Node converts strings with length < 2 to ''
+ if (str.length < 2) return ''
+ // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
+ while (str.length % 4 !== 0) {
+ str = str + '='
+ }
+ return str
+}
+
+function toHex (n) {
+ if (n < 16) return '0' + n.toString(16)
+ return n.toString(16)
+}
+
+function utf8ToBytes (string, units) {
+ units = units || Infinity
+ var codePoint
+ var length = string.length
+ var leadSurrogate = null
+ var bytes = []
+
+ for (var i = 0; i < length; ++i) {
+ codePoint = string.charCodeAt(i)
+
+ // is surrogate component
+ if (codePoint > 0xD7FF && codePoint < 0xE000) {
+ // last char was a lead
+ if (!leadSurrogate) {
+ // no lead yet
+ if (codePoint > 0xDBFF) {
+ // unexpected trail
+ if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
+ continue
+ } else if (i + 1 === length) {
+ // unpaired lead
+ if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
+ continue
+ }
+
+ // valid lead
+ leadSurrogate = codePoint
+
+ continue
+ }
+
+ // 2 leads in a row
+ if (codePoint < 0xDC00) {
+ if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
+ leadSurrogate = codePoint
+ continue
+ }
+
+ // valid surrogate pair
+ codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
+ } else if (leadSurrogate) {
+ // valid bmp char, but last char was a lead
+ if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
+ }
+
+ leadSurrogate = null
+
+ // encode utf8
+ if (codePoint < 0x80) {
+ if ((units -= 1) < 0) break
+ bytes.push(codePoint)
+ } else if (codePoint < 0x800) {
+ if ((units -= 2) < 0) break
+ bytes.push(
+ codePoint >> 0x6 | 0xC0,
+ codePoint & 0x3F | 0x80
+ )
+ } else if (codePoint < 0x10000) {
+ if ((units -= 3) < 0) break
+ bytes.push(
+ codePoint >> 0xC | 0xE0,
+ codePoint >> 0x6 & 0x3F | 0x80,
+ codePoint & 0x3F | 0x80
+ )
+ } else if (codePoint < 0x110000) {
+ if ((units -= 4) < 0) break
+ bytes.push(
+ codePoint >> 0x12 | 0xF0,
+ codePoint >> 0xC & 0x3F | 0x80,
+ codePoint >> 0x6 & 0x3F | 0x80,
+ codePoint & 0x3F | 0x80
+ )
+ } else {
+ throw new Error('Invalid code point')
+ }
+ }
+
+ return bytes
+}
+
+function asciiToBytes (str) {
+ var byteArray = []
+ for (var i = 0; i < str.length; ++i) {
+ // Node's code seems to be doing this and not & 0x7F..
+ byteArray.push(str.charCodeAt(i) & 0xFF)
+ }
+ return byteArray
+}
+
+function utf16leToBytes (str, units) {
+ var c, hi, lo
+ var byteArray = []
+ for (var i = 0; i < str.length; ++i) {
+ if ((units -= 2) < 0) break
+
+ c = str.charCodeAt(i)
+ hi = c >> 8
+ lo = c % 256
+ byteArray.push(lo)
+ byteArray.push(hi)
+ }
+
+ return byteArray
+}
+
+function base64ToBytes (str) {
+ return base64.toByteArray(base64clean(str))
+}
+
+function blitBuffer (src, dst, offset, length) {
+ for (var i = 0; i < length; ++i) {
+ if ((i + offset >= dst.length) || (i >= src.length)) break
+ dst[i + offset] = src[i]
+ }
+ return i
+}
+
+// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass
+// the `instanceof` check but they should be treated as of that type.
+// See: https://github.com/feross/buffer/issues/166
+function isInstance (obj, type) {
+ return obj instanceof type ||
+ (obj != null && obj.constructor != null && obj.constructor.name != null &&
+ obj.constructor.name === type.name)
+}
+function numberIsNaN (obj) {
+ // For IE11 support
+ return obj !== obj // eslint-disable-line no-self-compare
+}
+
+}).call(this)}).call(this,require("buffer").Buffer)
+},{"base64-js":8,"buffer":9,"ieee754":10}],10:[function(require,module,exports){
+/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
+exports.read = function (buffer, offset, isLE, mLen, nBytes) {
+ var e, m
+ var eLen = (nBytes * 8) - mLen - 1
+ var eMax = (1 << eLen) - 1
+ var eBias = eMax >> 1
+ var nBits = -7
+ var i = isLE ? (nBytes - 1) : 0
+ var d = isLE ? -1 : 1
+ var s = buffer[offset + i]
+
+ i += d
+
+ e = s & ((1 << (-nBits)) - 1)
+ s >>= (-nBits)
+ nBits += eLen
+ for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}
+
+ m = e & ((1 << (-nBits)) - 1)
+ e >>= (-nBits)
+ nBits += mLen
+ for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}
+
+ if (e === 0) {
+ e = 1 - eBias
+ } else if (e === eMax) {
+ return m ? NaN : ((s ? -1 : 1) * Infinity)
+ } else {
+ m = m + Math.pow(2, mLen)
+ e = e - eBias
+ }
+ return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
+}
+
+exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
+ var e, m, c
+ var eLen = (nBytes * 8) - mLen - 1
+ var eMax = (1 << eLen) - 1
+ var eBias = eMax >> 1
+ var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
+ var i = isLE ? 0 : (nBytes - 1)
+ var d = isLE ? 1 : -1
+ var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
+
+ value = Math.abs(value)
+
+ if (isNaN(value) || value === Infinity) {
+ m = isNaN(value) ? 1 : 0
+ e = eMax
+ } else {
+ e = Math.floor(Math.log(value) / Math.LN2)
+ if (value * (c = Math.pow(2, -e)) < 1) {
+ e--
+ c *= 2
+ }
+ if (e + eBias >= 1) {
+ value += rt / c
+ } else {
+ value += rt * Math.pow(2, 1 - eBias)
+ }
+ if (value * c >= 2) {
+ e++
+ c /= 2
+ }
+
+ if (e + eBias >= eMax) {
+ m = 0
+ e = eMax
+ } else if (e + eBias >= 1) {
+ m = ((value * c) - 1) * Math.pow(2, mLen)
+ e = e + eBias
+ } else {
+ m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
+ e = 0
+ }
+ }
+
+ for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
+
+ e = (e << mLen) | m
+ eLen += mLen
+ for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
+
+ buffer[offset + i - d] |= s * 128
+}
+
+},{}],11:[function(require,module,exports){
+/*!
+ * Determine if an object is a Buffer
+ *
+ * @author Feross Aboukhadijeh <https://feross.org>
+ * @license MIT
+ */
+
+// The _isBuffer check is for Safari 5-7 support, because it's missing
+// Object.prototype.constructor. Remove this eventually
+module.exports = function (obj) {
+ return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)
+}
+
+function isBuffer (obj) {
+ return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
+}
+
+// For Node v0.10 support. Remove this eventually.
+function isSlowBuffer (obj) {
+ return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))
+}
+
+},{}],12:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ module.exports = {
+ Disconnected: 1,
+ Preceding: 2,
+ Following: 4,
+ Contains: 8,
+ ContainedBy: 16,
+ ImplementationSpecific: 32
+ };
+
+}).call(this);
+
+},{}],13:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(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,
+ // Numeric codes up to 200 are reserved to W3C for possible future use.
+ // Following are types internal to this library:
+ Declaration: 201,
+ Raw: 202,
+ AttributeDeclaration: 203,
+ ElementDeclaration: 204,
+ Dummy: 205
+ };
+
+}).call(this);
+
+},{}],14:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ // Copies all enumerable own properties from `sources` to `target`
+ var assign, getValue, isArray, isEmpty, isFunction, isObject, isPlainObject,
+ hasProp = {}.hasOwnProperty;
+
+ assign = function(target, ...sources) {
+ var i, key, len, source;
+ 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;
+ };
+
+ // Determines if `val` is a Function object
+ isFunction = function(val) {
+ return !!val && Object.prototype.toString.call(val) === '[object Function]';
+ };
+
+ // Determines if `val` is an Object
+ isObject = function(val) {
+ var ref;
+ return !!val && ((ref = typeof val) === 'function' || ref === 'object');
+ };
+
+ // Determines if `val` is an Array
+ isArray = function(val) {
+ if (isFunction(Array.isArray)) {
+ return Array.isArray(val);
+ } else {
+ return Object.prototype.toString.call(val) === '[object Array]';
+ }
+ };
+
+ // Determines if `val` is an empty Array or an Object with no own properties
+ 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;
+ }
+ };
+
+ // Determines if `val` is a plain Object
+ 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));
+ };
+
+ // Gets the primitive value of an object
+ getValue = function(obj) {
+ if (isFunction(obj.valueOf)) {
+ return obj.valueOf();
+ } else {
+ return obj;
+ }
+ };
+
+ module.exports.assign = assign;
+
+ module.exports.isFunction = isFunction;
+
+ module.exports.isObject = isObject;
+
+ module.exports.isArray = isArray;
+
+ module.exports.isEmpty = isEmpty;
+
+ module.exports.isPlainObject = isPlainObject;
+
+ module.exports.getValue = getValue;
+
+}).call(this);
+
+},{}],15:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ module.exports = {
+ None: 0,
+ OpenTag: 1,
+ InsideTag: 2,
+ CloseTag: 3
+ };
+
+}).call(this);
+
+},{}],16:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, XMLAttribute, XMLNode;
+
+ NodeType = require('./NodeType');
+
+ XMLNode = require('./XMLNode');
+
+ // Represents an attribute
+ module.exports = XMLAttribute = (function() {
+ class XMLAttribute {
+ // Initializes a new instance of `XMLAttribute`
+
+ // `parent` the parent node
+ // `name` attribute target
+ // `value` attribute value
+ constructor(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;
+ // DOM level 3
+ this.isId = false;
+ this.schemaTypeInfo = null;
+ }
+
+ // Creates and returns a deep clone of `this`
+ clone() {
+ return Object.create(this);
+ }
+
+ // Converts the XML fragment to string
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation for pretty print
+ // `options.offset` how many indentations to add to every line for pretty print
+ // `options.newline` newline sequence for pretty print
+ toString(options) {
+ return this.options.writer.attribute(this, this.options.writer.filterOptions(options));
+ }
+
+
+ // Returns debug string for this node
+ debugInfo(name) {
+ name = name || this.name;
+ if (name == null) {
+ return "parent: <" + this.parent.name + ">";
+ } else {
+ return "attribute: {" + name + "}, parent: <" + this.parent.name + ">";
+ }
+ }
+
+ isEqualNode(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;
+ }
+
+ };
+
+ // DOM level 1
+ Object.defineProperty(XMLAttribute.prototype, 'nodeType', {
+ get: function() {
+ return this.type;
+ }
+ });
+
+ Object.defineProperty(XMLAttribute.prototype, 'ownerElement', {
+ get: function() {
+ return this.parent;
+ }
+ });
+
+ // DOM level 3
+ Object.defineProperty(XMLAttribute.prototype, 'textContent', {
+ get: function() {
+ return this.value;
+ },
+ set: function(value) {
+ return this.value = value || '';
+ }
+ });
+
+ // DOM level 4
+ Object.defineProperty(XMLAttribute.prototype, 'namespaceURI', {
+ get: function() {
+ return '';
+ }
+ });
+
+ Object.defineProperty(XMLAttribute.prototype, 'prefix', {
+ get: function() {
+ return '';
+ }
+ });
+
+ Object.defineProperty(XMLAttribute.prototype, 'localName', {
+ get: function() {
+ return this.name;
+ }
+ });
+
+ Object.defineProperty(XMLAttribute.prototype, 'specified', {
+ get: function() {
+ return true;
+ }
+ });
+
+ return XMLAttribute;
+
+ }).call(this);
+
+}).call(this);
+
+},{"./NodeType":13,"./XMLNode":35}],17:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, XMLCData, XMLCharacterData;
+
+ NodeType = require('./NodeType');
+
+ XMLCharacterData = require('./XMLCharacterData');
+
+ // Represents a CDATA node
+ module.exports = XMLCData = class XMLCData extends XMLCharacterData {
+ // Initializes a new instance of `XMLCData`
+
+ // `text` CDATA text
+ constructor(parent, text) {
+ super(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);
+ }
+
+ // Creates and returns a deep clone of `this`
+ clone() {
+ return Object.create(this);
+ }
+
+ // Converts the XML fragment to string
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation for pretty print
+ // `options.offset` how many indentations to add to every line for pretty print
+ // `options.newline` newline sequence for pretty print
+ toString(options) {
+ return this.options.writer.cdata(this, this.options.writer.filterOptions(options));
+ }
+
+ };
+
+}).call(this);
+
+},{"./NodeType":13,"./XMLCharacterData":18}],18:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var XMLCharacterData, XMLNode;
+
+ XMLNode = require('./XMLNode');
+
+ // Represents a character data node
+ module.exports = XMLCharacterData = (function() {
+ class XMLCharacterData extends XMLNode {
+ // Initializes a new instance of `XMLCharacterData`
+
+ constructor(parent) {
+ super(parent);
+ this.value = '';
+ }
+
+
+ // Creates and returns a deep clone of `this`
+ clone() {
+ return Object.create(this);
+ }
+
+ // DOM level 1 functions to be implemented later
+ substringData(offset, count) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ appendData(arg) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ insertData(offset, arg) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ deleteData(offset, count) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ replaceData(offset, count, arg) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ isEqualNode(node) {
+ if (!super.isEqualNode(node)) {
+ return false;
+ }
+ if (node.data !== this.data) {
+ return false;
+ }
+ return true;
+ }
+
+ };
+
+ // DOM level 1
+ Object.defineProperty(XMLCharacterData.prototype, 'data', {
+ get: function() {
+ return this.value;
+ },
+ set: function(value) {
+ return this.value = value || '';
+ }
+ });
+
+ Object.defineProperty(XMLCharacterData.prototype, 'length', {
+ get: function() {
+ return this.value.length;
+ }
+ });
+
+ // DOM level 3
+ Object.defineProperty(XMLCharacterData.prototype, 'textContent', {
+ get: function() {
+ return this.value;
+ },
+ set: function(value) {
+ return this.value = value || '';
+ }
+ });
+
+ return XMLCharacterData;
+
+ }).call(this);
+
+}).call(this);
+
+},{"./XMLNode":35}],19:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, XMLCharacterData, XMLComment;
+
+ NodeType = require('./NodeType');
+
+ XMLCharacterData = require('./XMLCharacterData');
+
+ // Represents a comment node
+ module.exports = XMLComment = class XMLComment extends XMLCharacterData {
+ // Initializes a new instance of `XMLComment`
+
+ // `text` comment text
+ constructor(parent, text) {
+ super(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);
+ }
+
+ // Creates and returns a deep clone of `this`
+ clone() {
+ return Object.create(this);
+ }
+
+ // Converts the XML fragment to string
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation for pretty print
+ // `options.offset` how many indentations to add to every line for pretty print
+ // `options.newline` newline sequence for pretty print
+ toString(options) {
+ return this.options.writer.comment(this, this.options.writer.filterOptions(options));
+ }
+
+ };
+
+}).call(this);
+
+},{"./NodeType":13,"./XMLCharacterData":18}],20:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var XMLDOMConfiguration, XMLDOMErrorHandler, XMLDOMStringList;
+
+ XMLDOMErrorHandler = require('./XMLDOMErrorHandler');
+
+ XMLDOMStringList = require('./XMLDOMStringList');
+
+ // Implements the DOMConfiguration interface
+ module.exports = XMLDOMConfiguration = (function() {
+ class XMLDOMConfiguration {
+ constructor() {
+ 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);
+ }
+
+ // Gets the value of a parameter.
+
+ // `name` name of the parameter
+ getParameter(name) {
+ if (this.params.hasOwnProperty(name)) {
+ return this.params[name];
+ } else {
+ return null;
+ }
+ }
+
+ // Checks if setting a parameter to a specific value is supported.
+
+ // `name` name of the parameter
+ // `value` parameter value
+ canSetParameter(name, value) {
+ return true;
+ }
+
+ // Sets the value of a parameter.
+
+ // `name` name of the parameter
+ // `value` new value or null if the user wishes to unset the parameter
+ setParameter(name, value) {
+ if (value != null) {
+ return this.params[name] = value;
+ } else {
+ return delete this.params[name];
+ }
+ }
+
+ };
+
+ // Returns the list of parameter names
+ Object.defineProperty(XMLDOMConfiguration.prototype, 'parameterNames', {
+ get: function() {
+ return new XMLDOMStringList(Object.keys(this.defaultParams));
+ }
+ });
+
+ return XMLDOMConfiguration;
+
+ }).call(this);
+
+}).call(this);
+
+},{"./XMLDOMErrorHandler":21,"./XMLDOMStringList":23}],21:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ // Represents the error handler for DOM operations
+ var XMLDOMErrorHandler;
+
+ module.exports = XMLDOMErrorHandler = class XMLDOMErrorHandler {
+ // Initializes a new instance of `XMLDOMErrorHandler`
+
+ constructor() {}
+
+ // Called on the error handler when an error occurs.
+
+ // `error` the error message as a string
+ handleError(error) {
+ throw new Error(error);
+ }
+
+ };
+
+}).call(this);
+
+},{}],22:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ // Implements the DOMImplementation interface
+ var XMLDOMImplementation;
+
+ module.exports = XMLDOMImplementation = class XMLDOMImplementation {
+ // Tests if the DOM implementation implements a specific feature.
+
+ // `feature` package name of the feature to test. In Level 1, the
+ // legal values are "HTML" and "XML" (case-insensitive).
+ // `version` version number of the package name to test.
+ // In Level 1, this is the string "1.0". If the version is
+ // not specified, supporting any version of the feature will
+ // cause the method to return true.
+ hasFeature(feature, version) {
+ return true;
+ }
+
+ // Creates a new document type declaration.
+
+ // `qualifiedName` qualified name of the document type to be created
+ // `publicId` public identifier of the external subset
+ // `systemId` system identifier of the external subset
+ createDocumentType(qualifiedName, publicId, systemId) {
+ throw new Error("This DOM method is not implemented.");
+ }
+
+ // Creates a new document.
+
+ // `namespaceURI` namespace URI of the document element to create
+ // `qualifiedName` the qualified name of the document to be created
+ // `doctype` the type of document to be created or null
+ createDocument(namespaceURI, qualifiedName, doctype) {
+ throw new Error("This DOM method is not implemented.");
+ }
+
+ // Creates a new HTML document.
+
+ // `title` document title
+ createHTMLDocument(title) {
+ throw new Error("This DOM method is not implemented.");
+ }
+
+ // Returns a specialized object which implements the specialized APIs
+ // of the specified feature and version.
+
+ // `feature` name of the feature requested.
+ // `version` version number of the feature to test
+ getFeature(feature, version) {
+ throw new Error("This DOM method is not implemented.");
+ }
+
+ };
+
+}).call(this);
+
+},{}],23:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ // Represents a list of string entries
+ var XMLDOMStringList;
+
+ module.exports = XMLDOMStringList = (function() {
+ class XMLDOMStringList {
+ // Initializes a new instance of `XMLDOMStringList`
+ // This is just a wrapper around an ordinary
+ // JS array.
+
+ // `arr` the array of string values
+ constructor(arr) {
+ this.arr = arr || [];
+ }
+
+ // Returns the indexth item in the collection.
+
+ // `index` index into the collection
+ item(index) {
+ return this.arr[index] || null;
+ }
+
+ // Test if a string is part of this DOMStringList.
+
+ // `str` the string to look for
+ contains(str) {
+ return this.arr.indexOf(str) !== -1;
+ }
+
+ };
+
+ // Returns the number of strings in the list.
+ Object.defineProperty(XMLDOMStringList.prototype, 'length', {
+ get: function() {
+ return this.arr.length;
+ }
+ });
+
+ return XMLDOMStringList;
+
+ }).call(this);
+
+}).call(this);
+
+},{}],24:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, XMLDTDAttList, XMLNode;
+
+ XMLNode = require('./XMLNode');
+
+ NodeType = require('./NodeType');
+
+ // Represents an attribute list
+ module.exports = XMLDTDAttList = class XMLDTDAttList extends XMLNode {
+ // Initializes a new instance of `XMLDTDAttList`
+
+ // `parent` the parent `XMLDocType` element
+ // `elementName` the name of the element containing this attribute
+ // `attributeName` attribute name
+ // `attributeType` type of the attribute
+ // `defaultValueType` default value type (either #REQUIRED, #IMPLIED,
+ // #FIXED or #DEFAULT)
+ // `defaultValue` default value of the attribute
+ // (only used for #FIXED or #DEFAULT)
+ constructor(parent, elementName, attributeName, attributeType, defaultValueType, defaultValue) {
+ super(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;
+ }
+
+ // Converts the XML fragment to string
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation for pretty print
+ // `options.offset` how many indentations to add to every line for pretty print
+ // `options.newline` newline sequence for pretty print
+ toString(options) {
+ return this.options.writer.dtdAttList(this, this.options.writer.filterOptions(options));
+ }
+
+ };
+
+}).call(this);
+
+},{"./NodeType":13,"./XMLNode":35}],25:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, XMLDTDElement, XMLNode;
+
+ XMLNode = require('./XMLNode');
+
+ NodeType = require('./NodeType');
+
+ // Represents an attribute
+ module.exports = XMLDTDElement = class XMLDTDElement extends XMLNode {
+ // Initializes a new instance of `XMLDTDElement`
+
+ // `parent` the parent `XMLDocType` element
+ // `name` element name
+ // `value` element content (defaults to #PCDATA)
+ constructor(parent, name, value) {
+ super(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);
+ }
+
+ // Converts the XML fragment to string
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation for pretty print
+ // `options.offset` how many indentations to add to every line for pretty print
+ // `options.newline` newline sequence for pretty print
+ toString(options) {
+ return this.options.writer.dtdElement(this, this.options.writer.filterOptions(options));
+ }
+
+ };
+
+}).call(this);
+
+},{"./NodeType":13,"./XMLNode":35}],26:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, XMLDTDEntity, XMLNode, isObject;
+
+ ({isObject} = require('./Utility'));
+
+ XMLNode = require('./XMLNode');
+
+ NodeType = require('./NodeType');
+
+ // Represents an entity declaration in the DTD
+ module.exports = XMLDTDEntity = (function() {
+ class XMLDTDEntity extends XMLNode {
+ // Initializes a new instance of `XMLDTDEntity`
+
+ // `parent` the parent `XMLDocType` element
+ // `pe` whether this is a parameter entity or a general entity
+ // defaults to `false` (general entity)
+ // `name` the name of the entity
+ // `value` internal entity value or an object with external entity details
+ // `value.pubID` public identifier
+ // `value.sysID` system identifier
+ // `value.nData` notation declaration
+ constructor(parent, pe, name, value) {
+ super(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));
+ }
+ }
+ }
+
+ // Converts the XML fragment to string
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation for pretty print
+ // `options.offset` how many indentations to add to every line for pretty print
+ // `options.newline` newline sequence for pretty print
+ toString(options) {
+ return this.options.writer.dtdEntity(this, this.options.writer.filterOptions(options));
+ }
+
+ };
+
+ // DOM level 1
+ Object.defineProperty(XMLDTDEntity.prototype, 'publicId', {
+ get: function() {
+ return this.pubID;
+ }
+ });
+
+ Object.defineProperty(XMLDTDEntity.prototype, 'systemId', {
+ get: function() {
+ return this.sysID;
+ }
+ });
+
+ Object.defineProperty(XMLDTDEntity.prototype, 'notationName', {
+ get: function() {
+ return this.nData || null;
+ }
+ });
+
+ // DOM level 3
+ Object.defineProperty(XMLDTDEntity.prototype, 'inputEncoding', {
+ get: function() {
+ return null;
+ }
+ });
+
+ Object.defineProperty(XMLDTDEntity.prototype, 'xmlEncoding', {
+ get: function() {
+ return null;
+ }
+ });
+
+ Object.defineProperty(XMLDTDEntity.prototype, 'xmlVersion', {
+ get: function() {
+ return null;
+ }
+ });
+
+ return XMLDTDEntity;
+
+ }).call(this);
+
+}).call(this);
+
+},{"./NodeType":13,"./Utility":14,"./XMLNode":35}],27:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, XMLDTDNotation, XMLNode;
+
+ XMLNode = require('./XMLNode');
+
+ NodeType = require('./NodeType');
+
+ // Represents a NOTATION entry in the DTD
+ module.exports = XMLDTDNotation = (function() {
+ class XMLDTDNotation extends XMLNode {
+ // Initializes a new instance of `XMLDTDNotation`
+
+ // `parent` the parent `XMLDocType` element
+ // `name` the name of the notation
+ // `value` an object with external entity details
+ // `value.pubID` public identifier
+ // `value.sysID` system identifier
+ constructor(parent, name, value) {
+ super(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);
+ }
+ }
+
+ // Converts the XML fragment to string
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation for pretty print
+ // `options.offset` how many indentations to add to every line for pretty print
+ // `options.newline` newline sequence for pretty print
+ toString(options) {
+ return this.options.writer.dtdNotation(this, this.options.writer.filterOptions(options));
+ }
+
+ };
+
+ // DOM level 1
+ Object.defineProperty(XMLDTDNotation.prototype, 'publicId', {
+ get: function() {
+ return this.pubID;
+ }
+ });
+
+ Object.defineProperty(XMLDTDNotation.prototype, 'systemId', {
+ get: function() {
+ return this.sysID;
+ }
+ });
+
+ return XMLDTDNotation;
+
+ }).call(this);
+
+}).call(this);
+
+},{"./NodeType":13,"./XMLNode":35}],28:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, XMLDeclaration, XMLNode, isObject;
+
+ ({isObject} = require('./Utility'));
+
+ XMLNode = require('./XMLNode');
+
+ NodeType = require('./NodeType');
+
+ // Represents the XML declaration
+ module.exports = XMLDeclaration = class XMLDeclaration extends XMLNode {
+ // Initializes a new instance of `XMLDeclaration`
+
+ // `parent` the document object
+
+ // `version` A version number string, e.g. 1.0
+ // `encoding` Encoding declaration, e.g. UTF-8
+ // `standalone` standalone document declaration: true or false
+ constructor(parent, version, encoding, standalone) {
+ super(parent);
+ // arguments may also be passed as an object
+ if (isObject(version)) {
+ ({version, encoding, standalone} = version);
+ }
+ 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);
+ }
+ }
+
+ // Converts to string
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation for pretty print
+ // `options.offset` how many indentations to add to every line for pretty print
+ // `options.newline` newline sequence for pretty print
+ toString(options) {
+ return this.options.writer.declaration(this, this.options.writer.filterOptions(options));
+ }
+
+ };
+
+}).call(this);
+
+},{"./NodeType":13,"./Utility":14,"./XMLNode":35}],29:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDocType, XMLNamedNodeMap, XMLNode, isObject;
+
+ ({isObject} = require('./Utility'));
+
+ XMLNode = require('./XMLNode');
+
+ NodeType = require('./NodeType');
+
+ XMLDTDAttList = require('./XMLDTDAttList');
+
+ XMLDTDEntity = require('./XMLDTDEntity');
+
+ XMLDTDElement = require('./XMLDTDElement');
+
+ XMLDTDNotation = require('./XMLDTDNotation');
+
+ XMLNamedNodeMap = require('./XMLNamedNodeMap');
+
+ // Represents doctype declaration
+ module.exports = XMLDocType = (function() {
+ class XMLDocType extends XMLNode {
+ // Initializes a new instance of `XMLDocType`
+
+ // `parent` the document object
+
+ // `pubID` public identifier of the external subset
+ // `sysID` system identifier of the external subset
+ constructor(parent, pubID, sysID) {
+ var child, i, len, ref;
+ super(parent);
+ this.type = NodeType.DocType;
+ // set DTD name to the name of the root node
+ 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;
+ // arguments may also be passed as an object
+ if (isObject(pubID)) {
+ ({pubID, sysID} = pubID);
+ }
+ if (sysID == null) {
+ [sysID, pubID] = [pubID, sysID];
+ }
+ if (pubID != null) {
+ this.pubID = this.stringify.dtdPubID(pubID);
+ }
+ if (sysID != null) {
+ this.sysID = this.stringify.dtdSysID(sysID);
+ }
+ }
+
+ // Creates an element type declaration
+
+ // `name` element name
+ // `value` element content (defaults to #PCDATA)
+ element(name, value) {
+ var child;
+ child = new XMLDTDElement(this, name, value);
+ this.children.push(child);
+ return this;
+ }
+
+ // Creates an attribute declaration
+
+ // `elementName` the name of the element containing this attribute
+ // `attributeName` attribute name
+ // `attributeType` type of the attribute (defaults to CDATA)
+ // `defaultValueType` default value type (either #REQUIRED, #IMPLIED, #FIXED or
+ // #DEFAULT) (defaults to #IMPLIED)
+ // `defaultValue` default value of the attribute
+ // (only used for #FIXED or #DEFAULT)
+ attList(elementName, attributeName, attributeType, defaultValueType, defaultValue) {
+ var child;
+ child = new XMLDTDAttList(this, elementName, attributeName, attributeType, defaultValueType, defaultValue);
+ this.children.push(child);
+ return this;
+ }
+
+ // Creates a general entity declaration
+
+ // `name` the name of the entity
+ // `value` internal entity value or an object with external entity details
+ // `value.pubID` public identifier
+ // `value.sysID` system identifier
+ // `value.nData` notation declaration
+ entity(name, value) {
+ var child;
+ child = new XMLDTDEntity(this, false, name, value);
+ this.children.push(child);
+ return this;
+ }
+
+ // Creates a parameter entity declaration
+
+ // `name` the name of the entity
+ // `value` internal entity value or an object with external entity details
+ // `value.pubID` public identifier
+ // `value.sysID` system identifier
+ pEntity(name, value) {
+ var child;
+ child = new XMLDTDEntity(this, true, name, value);
+ this.children.push(child);
+ return this;
+ }
+
+ // Creates a NOTATION declaration
+
+ // `name` the name of the notation
+ // `value` an object with external entity details
+ // `value.pubID` public identifier
+ // `value.sysID` system identifier
+ notation(name, value) {
+ var child;
+ child = new XMLDTDNotation(this, name, value);
+ this.children.push(child);
+ return this;
+ }
+
+ // Converts to string
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation for pretty print
+ // `options.offset` how many indentations to add to every line for pretty print
+ // `options.newline` newline sequence for pretty print
+ toString(options) {
+ return this.options.writer.docType(this, this.options.writer.filterOptions(options));
+ }
+
+ // Aliases
+ ele(name, value) {
+ return this.element(name, value);
+ }
+
+ att(elementName, attributeName, attributeType, defaultValueType, defaultValue) {
+ return this.attList(elementName, attributeName, attributeType, defaultValueType, defaultValue);
+ }
+
+ ent(name, value) {
+ return this.entity(name, value);
+ }
+
+ pent(name, value) {
+ return this.pEntity(name, value);
+ }
+
+ not(name, value) {
+ return this.notation(name, value);
+ }
+
+ up() {
+ return this.root() || this.documentObject;
+ }
+
+ isEqualNode(node) {
+ if (!super.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;
+ }
+
+ };
+
+ // DOM level 1
+ Object.defineProperty(XMLDocType.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(XMLDocType.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);
+ }
+ });
+
+ // DOM level 2
+ Object.defineProperty(XMLDocType.prototype, 'publicId', {
+ get: function() {
+ return this.pubID;
+ }
+ });
+
+ Object.defineProperty(XMLDocType.prototype, 'systemId', {
+ get: function() {
+ return this.sysID;
+ }
+ });
+
+ Object.defineProperty(XMLDocType.prototype, 'internalSubset', {
+ get: function() {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+ });
+
+ return XMLDocType;
+
+ }).call(this);
+
+}).call(this);
+
+},{"./NodeType":13,"./Utility":14,"./XMLDTDAttList":24,"./XMLDTDElement":25,"./XMLDTDEntity":26,"./XMLDTDNotation":27,"./XMLNamedNodeMap":34,"./XMLNode":35}],30:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, XMLDOMConfiguration, XMLDOMImplementation, XMLDocument, XMLNode, XMLStringWriter, XMLStringifier, isPlainObject;
+
+ ({isPlainObject} = require('./Utility'));
+
+ XMLDOMImplementation = require('./XMLDOMImplementation');
+
+ XMLDOMConfiguration = require('./XMLDOMConfiguration');
+
+ XMLNode = require('./XMLNode');
+
+ NodeType = require('./NodeType');
+
+ XMLStringifier = require('./XMLStringifier');
+
+ XMLStringWriter = require('./XMLStringWriter');
+
+ // Represents an XML builder
+ module.exports = XMLDocument = (function() {
+ class XMLDocument extends XMLNode {
+ // Initializes a new instance of `XMLDocument`
+
+ // `options.keepNullNodes` whether nodes with null values will be kept
+ // or ignored: true or false
+ // `options.keepNullAttributes` whether attributes with null values will be
+ // kept or ignored: true or false
+ // `options.ignoreDecorators` whether decorator strings will be ignored when
+ // converting JS objects: true or false
+ // `options.separateArrayItems` whether array items are created as separate
+ // nodes when passed as an object value: true or false
+ // `options.noDoubleEncoding` whether existing html entities are encoded:
+ // true or false
+ // `options.stringify` a set of functions to use for converting values to
+ // strings
+ // `options.writer` the default XML writer to use for converting nodes to
+ // string. If the default writer is not set, the built-in XMLStringWriter
+ // will be used instead.
+ constructor(options) {
+ super(null);
+ this.name = "#document";
+ this.type = NodeType.Document;
+ this.documentURI = null;
+ this.domConfig = new XMLDOMConfiguration();
+ options || (options = {});
+ if (!options.writer) {
+ options.writer = new XMLStringWriter();
+ }
+ this.options = options;
+ this.stringify = new XMLStringifier(options);
+ }
+
+ // Ends the document and passes it to the given XML writer
+
+ // `writer` is either an XML writer or a plain object to pass to the
+ // constructor of the default XML writer. The default writer is assigned when
+ // creating the XML document. Following flags are recognized by the
+ // built-in XMLStringWriter:
+ // `writer.pretty` pretty prints the result
+ // `writer.indent` indentation for pretty print
+ // `writer.offset` how many indentations to add to every line for pretty print
+ // `writer.newline` newline sequence for pretty print
+ end(writer) {
+ var writerOptions;
+ writerOptions = {};
+ if (!writer) {
+ writer = this.options.writer;
+ } else if (isPlainObject(writer)) {
+ writerOptions = writer;
+ writer = this.options.writer;
+ }
+ return writer.document(this, writer.filterOptions(writerOptions));
+ }
+
+ // Converts the XML document to string
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation for pretty print
+ // `options.offset` how many indentations to add to every line for pretty print
+ // `options.newline` newline sequence for pretty print
+ toString(options) {
+ return this.options.writer.document(this, this.options.writer.filterOptions(options));
+ }
+
+ // DOM level 1 functions to be implemented later
+ createElement(tagName) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ createDocumentFragment() {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ createTextNode(data) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ createComment(data) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ createCDATASection(data) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ createProcessingInstruction(target, data) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ createAttribute(name) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ createEntityReference(name) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ getElementsByTagName(tagname) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ // DOM level 2 functions to be implemented later
+ importNode(importedNode, deep) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ createElementNS(namespaceURI, qualifiedName) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ createAttributeNS(namespaceURI, qualifiedName) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ getElementsByTagNameNS(namespaceURI, localName) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ getElementById(elementId) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ // DOM level 3 functions to be implemented later
+ adoptNode(source) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ normalizeDocument() {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ renameNode(node, namespaceURI, qualifiedName) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ // DOM level 4 functions to be implemented later
+ getElementsByClassName(classNames) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ createEvent(eventInterface) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ createRange() {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ createNodeIterator(root, whatToShow, filter) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ createTreeWalker(root, whatToShow, filter) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ };
+
+ // DOM level 1
+ Object.defineProperty(XMLDocument.prototype, 'implementation', {
+ value: new XMLDOMImplementation()
+ });
+
+ Object.defineProperty(XMLDocument.prototype, 'doctype', {
+ get: function() {
+ var child, i, len, ref;
+ ref = this.children;
+ for (i = 0, len = ref.length; i < len; i++) {
+ child = ref[i];
+ if (child.type === NodeType.DocType) {
+ return child;
+ }
+ }
+ return null;
+ }
+ });
+
+ Object.defineProperty(XMLDocument.prototype, 'documentElement', {
+ get: function() {
+ return this.rootObject || null;
+ }
+ });
+
+ // DOM level 3
+ Object.defineProperty(XMLDocument.prototype, 'inputEncoding', {
+ get: function() {
+ return null;
+ }
+ });
+
+ Object.defineProperty(XMLDocument.prototype, 'strictErrorChecking', {
+ get: function() {
+ return false;
+ }
+ });
+
+ Object.defineProperty(XMLDocument.prototype, 'xmlEncoding', {
+ get: function() {
+ if (this.children.length !== 0 && this.children[0].type === NodeType.Declaration) {
+ return this.children[0].encoding;
+ } else {
+ return null;
+ }
+ }
+ });
+
+ Object.defineProperty(XMLDocument.prototype, 'xmlStandalone', {
+ get: function() {
+ if (this.children.length !== 0 && this.children[0].type === NodeType.Declaration) {
+ return this.children[0].standalone === 'yes';
+ } else {
+ return false;
+ }
+ }
+ });
+
+ Object.defineProperty(XMLDocument.prototype, 'xmlVersion', {
+ get: function() {
+ if (this.children.length !== 0 && this.children[0].type === NodeType.Declaration) {
+ return this.children[0].version;
+ } else {
+ return "1.0";
+ }
+ }
+ });
+
+ // DOM level 4
+ Object.defineProperty(XMLDocument.prototype, 'URL', {
+ get: function() {
+ return this.documentURI;
+ }
+ });
+
+ Object.defineProperty(XMLDocument.prototype, 'origin', {
+ get: function() {
+ return null;
+ }
+ });
+
+ Object.defineProperty(XMLDocument.prototype, 'compatMode', {
+ get: function() {
+ return null;
+ }
+ });
+
+ Object.defineProperty(XMLDocument.prototype, 'characterSet', {
+ get: function() {
+ return null;
+ }
+ });
+
+ Object.defineProperty(XMLDocument.prototype, 'contentType', {
+ get: function() {
+ return null;
+ }
+ });
+
+ return XMLDocument;
+
+ }).call(this);
+
+}).call(this);
+
+},{"./NodeType":13,"./Utility":14,"./XMLDOMConfiguration":20,"./XMLDOMImplementation":22,"./XMLNode":35,"./XMLStringWriter":40,"./XMLStringifier":41}],31:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, WriterState, XMLAttribute, XMLCData, XMLComment, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDeclaration, XMLDocType, XMLDocument, XMLDocumentCB, XMLElement, XMLProcessingInstruction, XMLRaw, XMLStringWriter, XMLStringifier, XMLText, getValue, isFunction, isObject, isPlainObject,
+ hasProp = {}.hasOwnProperty;
+
+ ({isObject, isFunction, isPlainObject, getValue} = require('./Utility'));
+
+ NodeType = require('./NodeType');
+
+ XMLDocument = require('./XMLDocument');
+
+ XMLElement = require('./XMLElement');
+
+ XMLCData = require('./XMLCData');
+
+ XMLComment = require('./XMLComment');
+
+ XMLRaw = require('./XMLRaw');
+
+ XMLText = require('./XMLText');
+
+ XMLProcessingInstruction = require('./XMLProcessingInstruction');
+
+ XMLDeclaration = require('./XMLDeclaration');
+
+ XMLDocType = require('./XMLDocType');
+
+ XMLDTDAttList = require('./XMLDTDAttList');
+
+ XMLDTDEntity = require('./XMLDTDEntity');
+
+ XMLDTDElement = require('./XMLDTDElement');
+
+ XMLDTDNotation = require('./XMLDTDNotation');
+
+ XMLAttribute = require('./XMLAttribute');
+
+ XMLStringifier = require('./XMLStringifier');
+
+ XMLStringWriter = require('./XMLStringWriter');
+
+ WriterState = require('./WriterState');
+
+ // Represents an XML builder
+ module.exports = XMLDocumentCB = class XMLDocumentCB {
+ // Initializes a new instance of `XMLDocumentCB`
+
+ // `options.keepNullNodes` whether nodes with null values will be kept
+ // or ignored: true or false
+ // `options.keepNullAttributes` whether attributes with null values will be
+ // kept or ignored: true or false
+ // `options.ignoreDecorators` whether decorator strings will be ignored when
+ // converting JS objects: true or false
+ // `options.separateArrayItems` whether array items are created as separate
+ // nodes when passed as an object value: true or false
+ // `options.noDoubleEncoding` whether existing html entities are encoded:
+ // true or false
+ // `options.stringify` a set of functions to use for converting values to
+ // strings
+ // `options.writer` the default XML writer to use for converting nodes to
+ // string. If the default writer is not set, the built-in XMLStringWriter
+ // will be used instead.
+
+ // `onData` the function to be called when a new chunk of XML is output. The
+ // string containing the XML chunk is passed to `onData` as its first
+ // argument, and the current indentation level as its second argument.
+ // `onEnd` the function to be called when the XML document is completed with
+ // `end`. `onEnd` does not receive any arguments.
+ constructor(options, onData, onEnd) {
+ var writerOptions;
+ this.name = "?xml";
+ this.type = NodeType.Document;
+ options || (options = {});
+ writerOptions = {};
+ if (!options.writer) {
+ options.writer = new XMLStringWriter();
+ } else if (isPlainObject(options.writer)) {
+ writerOptions = options.writer;
+ options.writer = new XMLStringWriter();
+ }
+ this.options = options;
+ this.writer = options.writer;
+ this.writerOptions = this.writer.filterOptions(writerOptions);
+ this.stringify = new XMLStringifier(options);
+ this.onDataCallback = onData || function() {};
+ this.onEndCallback = onEnd || function() {};
+ this.currentNode = null;
+ this.currentLevel = -1;
+ this.openTags = {};
+ this.documentStarted = false;
+ this.documentCompleted = false;
+ this.root = null;
+ }
+
+ // Creates a child element node from the given XMLNode
+
+ // `node` the child node
+ createChildNode(node) {
+ var att, attName, attributes, child, i, len, ref, ref1;
+ switch (node.type) {
+ case NodeType.CData:
+ this.cdata(node.value);
+ break;
+ case NodeType.Comment:
+ this.comment(node.value);
+ break;
+ case NodeType.Element:
+ attributes = {};
+ ref = node.attribs;
+ for (attName in ref) {
+ if (!hasProp.call(ref, attName)) continue;
+ att = ref[attName];
+ attributes[attName] = att.value;
+ }
+ this.node(node.name, attributes);
+ break;
+ case NodeType.Dummy:
+ this.dummy();
+ break;
+ case NodeType.Raw:
+ this.raw(node.value);
+ break;
+ case NodeType.Text:
+ this.text(node.value);
+ break;
+ case NodeType.ProcessingInstruction:
+ this.instruction(node.target, node.value);
+ break;
+ default:
+ throw new Error("This XML node type is not supported in a JS object: " + node.constructor.name);
+ }
+ ref1 = node.children;
+ // write child nodes recursively
+ for (i = 0, len = ref1.length; i < len; i++) {
+ child = ref1[i];
+ this.createChildNode(child);
+ if (child.type === NodeType.Element) {
+ this.up();
+ }
+ }
+ return this;
+ }
+
+ // Creates a dummy node
+
+ dummy() {
+ // no-op, just return this
+ return this;
+ }
+
+ // Creates a node
+
+ // `name` name of the node
+ // `attributes` an object containing name/value pairs of attributes
+ // `text` element text
+ node(name, attributes, text) {
+ if (name == null) {
+ throw new Error("Missing node name.");
+ }
+ if (this.root && this.currentLevel === -1) {
+ throw new Error("Document can only have one root node. " + this.debugInfo(name));
+ }
+ this.openCurrent();
+ name = getValue(name);
+ if (attributes == null) {
+ attributes = {};
+ }
+ attributes = getValue(attributes);
+ // swap argument order: text <-> attributes
+ if (!isObject(attributes)) {
+ [text, attributes] = [attributes, text];
+ }
+ this.currentNode = new XMLElement(this, name, attributes);
+ this.currentNode.children = false;
+ this.currentLevel++;
+ this.openTags[this.currentLevel] = this.currentNode;
+ if (text != null) {
+ this.text(text);
+ }
+ return this;
+ }
+
+ // Creates a child element node or an element type declaration when called
+ // inside the DTD
+
+ // `name` name of the node
+ // `attributes` an object containing name/value pairs of attributes
+ // `text` element text
+ element(name, attributes, text) {
+ var child, i, len, oldValidationFlag, ref, root;
+ if (this.currentNode && this.currentNode.type === NodeType.DocType) {
+ this.dtdElement(...arguments);
+ } else {
+ if (Array.isArray(name) || isObject(name) || isFunction(name)) {
+ oldValidationFlag = this.options.noValidation;
+ this.options.noValidation = true;
+ root = new XMLDocument(this.options).element('TEMP_ROOT');
+ root.element(name);
+ this.options.noValidation = oldValidationFlag;
+ ref = root.children;
+ for (i = 0, len = ref.length; i < len; i++) {
+ child = ref[i];
+ this.createChildNode(child);
+ if (child.type === NodeType.Element) {
+ this.up();
+ }
+ }
+ } else {
+ this.node(name, attributes, text);
+ }
+ }
+ return this;
+ }
+
+ // Adds or modifies an attribute
+
+ // `name` attribute name
+ // `value` attribute value
+ attribute(name, value) {
+ var attName, attValue;
+ if (!this.currentNode || this.currentNode.children) {
+ throw new Error("att() can only be used immediately after an ele() call in callback mode. " + this.debugInfo(name));
+ }
+ if (name != null) {
+ name = getValue(name);
+ }
+ if (isObject(name)) { // expand if object
+ 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.currentNode.attribs[name] = new XMLAttribute(this, name, "");
+ } else if (value != null) {
+ this.currentNode.attribs[name] = new XMLAttribute(this, name, value);
+ }
+ }
+ return this;
+ }
+
+ // Creates a text node
+
+ // `value` element text
+ text(value) {
+ var node;
+ this.openCurrent();
+ node = new XMLText(this, value);
+ this.onData(this.writer.text(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
+ return this;
+ }
+
+ // Creates a CDATA node
+
+ // `value` element text without CDATA delimiters
+ cdata(value) {
+ var node;
+ this.openCurrent();
+ node = new XMLCData(this, value);
+ this.onData(this.writer.cdata(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
+ return this;
+ }
+
+ // Creates a comment node
+
+ // `value` comment text
+ comment(value) {
+ var node;
+ this.openCurrent();
+ node = new XMLComment(this, value);
+ this.onData(this.writer.comment(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
+ return this;
+ }
+
+ // Adds unescaped raw text
+
+ // `value` text
+ raw(value) {
+ var node;
+ this.openCurrent();
+ node = new XMLRaw(this, value);
+ this.onData(this.writer.raw(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
+ return this;
+ }
+
+ // Adds a processing instruction
+
+ // `target` instruction target
+ // `value` instruction value
+ instruction(target, value) {
+ var i, insTarget, insValue, len, node;
+ this.openCurrent();
+ if (target != null) {
+ target = getValue(target);
+ }
+ if (value != null) {
+ value = getValue(value);
+ }
+ if (Array.isArray(target)) { // expand if array
+ for (i = 0, len = target.length; i < len; i++) {
+ insTarget = target[i];
+ this.instruction(insTarget);
+ }
+ } else if (isObject(target)) { // expand if object
+ for (insTarget in target) {
+ if (!hasProp.call(target, insTarget)) continue;
+ insValue = target[insTarget];
+ this.instruction(insTarget, insValue);
+ }
+ } else {
+ if (isFunction(value)) {
+ value = value.apply();
+ }
+ node = new XMLProcessingInstruction(this, target, value);
+ this.onData(this.writer.processingInstruction(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
+ }
+ return this;
+ }
+
+ // Creates the xml declaration
+
+ // `version` A version number string, e.g. 1.0
+ // `encoding` Encoding declaration, e.g. UTF-8
+ // `standalone` standalone document declaration: true or false
+ declaration(version, encoding, standalone) {
+ var node;
+ this.openCurrent();
+ if (this.documentStarted) {
+ throw new Error("declaration() must be the first node.");
+ }
+ node = new XMLDeclaration(this, version, encoding, standalone);
+ this.onData(this.writer.declaration(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
+ return this;
+ }
+
+ // Creates the document type declaration
+
+ // `root` the name of the root node
+ // `pubID` the public identifier of the external subset
+ // `sysID` the system identifier of the external subset
+ doctype(root, pubID, sysID) {
+ this.openCurrent();
+ if (root == null) {
+ throw new Error("Missing root node name.");
+ }
+ if (this.root) {
+ throw new Error("dtd() must come before the root node.");
+ }
+ this.currentNode = new XMLDocType(this, pubID, sysID);
+ this.currentNode.rootNodeName = root;
+ this.currentNode.children = false;
+ this.currentLevel++;
+ this.openTags[this.currentLevel] = this.currentNode;
+ return this;
+ }
+
+ // Creates an element type declaration
+
+ // `name` element name
+ // `value` element content (defaults to #PCDATA)
+ dtdElement(name, value) {
+ var node;
+ this.openCurrent();
+ node = new XMLDTDElement(this, name, value);
+ this.onData(this.writer.dtdElement(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
+ return this;
+ }
+
+ // Creates an attribute declaration
+
+ // `elementName` the name of the element containing this attribute
+ // `attributeName` attribute name
+ // `attributeType` type of the attribute (defaults to CDATA)
+ // `defaultValueType` default value type (either #REQUIRED, #IMPLIED, #FIXED or
+ // #DEFAULT) (defaults to #IMPLIED)
+ // `defaultValue` default value of the attribute
+ // (only used for #FIXED or #DEFAULT)
+ attList(elementName, attributeName, attributeType, defaultValueType, defaultValue) {
+ var node;
+ this.openCurrent();
+ node = new XMLDTDAttList(this, elementName, attributeName, attributeType, defaultValueType, defaultValue);
+ this.onData(this.writer.dtdAttList(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
+ return this;
+ }
+
+ // Creates a general entity declaration
+
+ // `name` the name of the entity
+ // `value` internal entity value or an object with external entity details
+ // `value.pubID` public identifier
+ // `value.sysID` system identifier
+ // `value.nData` notation declaration
+ entity(name, value) {
+ var node;
+ this.openCurrent();
+ node = new XMLDTDEntity(this, false, name, value);
+ this.onData(this.writer.dtdEntity(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
+ return this;
+ }
+
+ // Creates a parameter entity declaration
+
+ // `name` the name of the entity
+ // `value` internal entity value or an object with external entity details
+ // `value.pubID` public identifier
+ // `value.sysID` system identifier
+ pEntity(name, value) {
+ var node;
+ this.openCurrent();
+ node = new XMLDTDEntity(this, true, name, value);
+ this.onData(this.writer.dtdEntity(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
+ return this;
+ }
+
+ // Creates a NOTATION declaration
+
+ // `name` the name of the notation
+ // `value` an object with external entity details
+ // `value.pubID` public identifier
+ // `value.sysID` system identifier
+ notation(name, value) {
+ var node;
+ this.openCurrent();
+ node = new XMLDTDNotation(this, name, value);
+ this.onData(this.writer.dtdNotation(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
+ return this;
+ }
+
+ // Gets the parent node
+ up() {
+ if (this.currentLevel < 0) {
+ throw new Error("The document node has no parent.");
+ }
+ if (this.currentNode) {
+ if (this.currentNode.children) {
+ this.closeNode(this.currentNode);
+ } else {
+ this.openNode(this.currentNode);
+ }
+ this.currentNode = null;
+ } else {
+ this.closeNode(this.openTags[this.currentLevel]);
+ }
+ delete this.openTags[this.currentLevel];
+ this.currentLevel--;
+ return this;
+ }
+
+ // Ends the document
+ end() {
+ while (this.currentLevel >= 0) {
+ this.up();
+ }
+ return this.onEnd();
+ }
+
+ // Opens the current parent node
+ openCurrent() {
+ if (this.currentNode) {
+ this.currentNode.children = true;
+ return this.openNode(this.currentNode);
+ }
+ }
+
+ // Writes the opening tag of the current node or the entire node if it has
+ // no child nodes
+ openNode(node) {
+ var att, chunk, name, ref;
+ if (!node.isOpen) {
+ if (!this.root && this.currentLevel === 0 && node.type === NodeType.Element) {
+ this.root = node;
+ }
+ chunk = '';
+ if (node.type === NodeType.Element) {
+ this.writerOptions.state = WriterState.OpenTag;
+ chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + '<' + node.name;
+ ref = node.attribs;
+ for (name in ref) {
+ if (!hasProp.call(ref, name)) continue;
+ att = ref[name];
+ chunk += this.writer.attribute(att, this.writerOptions, this.currentLevel);
+ }
+ chunk += (node.children ? '>' : '/>') + this.writer.endline(node, this.writerOptions, this.currentLevel);
+ this.writerOptions.state = WriterState.InsideTag; // if node.type is NodeType.DocType
+ } else {
+ this.writerOptions.state = WriterState.OpenTag;
+ chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + '<!DOCTYPE ' + node.rootNodeName;
+
+ // external identifier
+ if (node.pubID && node.sysID) {
+ chunk += ' PUBLIC "' + node.pubID + '" "' + node.sysID + '"';
+ } else if (node.sysID) {
+ chunk += ' SYSTEM "' + node.sysID + '"';
+ }
+
+ // internal subset
+ if (node.children) {
+ chunk += ' [';
+ this.writerOptions.state = WriterState.InsideTag;
+ } else {
+ this.writerOptions.state = WriterState.CloseTag;
+ chunk += '>';
+ }
+ chunk += this.writer.endline(node, this.writerOptions, this.currentLevel);
+ }
+ this.onData(chunk, this.currentLevel);
+ return node.isOpen = true;
+ }
+ }
+
+ // Writes the closing tag of the current node
+ closeNode(node) {
+ var chunk;
+ if (!node.isClosed) {
+ chunk = '';
+ this.writerOptions.state = WriterState.CloseTag;
+ if (node.type === NodeType.Element) {
+ chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + '</' + node.name + '>' + this.writer.endline(node, this.writerOptions, this.currentLevel); // if node.type is NodeType.DocType
+ } else {
+ chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + ']>' + this.writer.endline(node, this.writerOptions, this.currentLevel);
+ }
+ this.writerOptions.state = WriterState.None;
+ this.onData(chunk, this.currentLevel);
+ return node.isClosed = true;
+ }
+ }
+
+ // Called when a new chunk of XML is output
+
+ // `chunk` a string containing the XML chunk
+ // `level` current indentation level
+ onData(chunk, level) {
+ this.documentStarted = true;
+ return this.onDataCallback(chunk, level + 1);
+ }
+
+ // Called when the XML document is completed
+ onEnd() {
+ this.documentCompleted = true;
+ return this.onEndCallback();
+ }
+
+ // Returns debug string
+ debugInfo(name) {
+ if (name == null) {
+ return "";
+ } else {
+ return "node: <" + name + ">";
+ }
+ }
+
+ // Node aliases
+ ele() {
+ return this.element(...arguments);
+ }
+
+ nod(name, attributes, text) {
+ return this.node(name, attributes, text);
+ }
+
+ txt(value) {
+ return this.text(value);
+ }
+
+ dat(value) {
+ return this.cdata(value);
+ }
+
+ com(value) {
+ return this.comment(value);
+ }
+
+ ins(target, value) {
+ return this.instruction(target, value);
+ }
+
+ dec(version, encoding, standalone) {
+ return this.declaration(version, encoding, standalone);
+ }
+
+ dtd(root, pubID, sysID) {
+ return this.doctype(root, pubID, sysID);
+ }
+
+ e(name, attributes, text) {
+ return this.element(name, attributes, text);
+ }
+
+ n(name, attributes, text) {
+ return this.node(name, attributes, text);
+ }
+
+ t(value) {
+ return this.text(value);
+ }
+
+ d(value) {
+ return this.cdata(value);
+ }
+
+ c(value) {
+ return this.comment(value);
+ }
+
+ r(value) {
+ return this.raw(value);
+ }
+
+ i(target, value) {
+ return this.instruction(target, value);
+ }
+
+ // Attribute aliases
+ att() {
+ if (this.currentNode && this.currentNode.type === NodeType.DocType) {
+ return this.attList(...arguments);
+ } else {
+ return this.attribute(...arguments);
+ }
+ }
+
+ a() {
+ if (this.currentNode && this.currentNode.type === NodeType.DocType) {
+ return this.attList(...arguments);
+ } else {
+ return this.attribute(...arguments);
+ }
+ }
+
+ // DTD aliases
+ // att() and ele() are defined above
+ ent(name, value) {
+ return this.entity(name, value);
+ }
+
+ pent(name, value) {
+ return this.pEntity(name, value);
+ }
+
+ not(name, value) {
+ return this.notation(name, value);
+ }
+
+ };
+
+}).call(this);
+
+},{"./NodeType":13,"./Utility":14,"./WriterState":15,"./XMLAttribute":16,"./XMLCData":17,"./XMLComment":19,"./XMLDTDAttList":24,"./XMLDTDElement":25,"./XMLDTDEntity":26,"./XMLDTDNotation":27,"./XMLDeclaration":28,"./XMLDocType":29,"./XMLDocument":30,"./XMLElement":33,"./XMLProcessingInstruction":37,"./XMLRaw":38,"./XMLStringWriter":40,"./XMLStringifier":41,"./XMLText":42}],32:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, XMLDummy, XMLNode;
+
+ XMLNode = require('./XMLNode');
+
+ NodeType = require('./NodeType');
+
+ // Represents a raw node
+ module.exports = XMLDummy = class XMLDummy extends XMLNode {
+ // Initializes a new instance of `XMLDummy`
+
+ // `XMLDummy` is a special node representing a node with
+ // a null value. Dummy nodes are created while recursively
+ // building the XML tree. Simply skipping null values doesn't
+ // work because that would break the recursive chain.
+ constructor(parent) {
+ super(parent);
+ this.type = NodeType.Dummy;
+ }
+
+ // Creates and returns a deep clone of `this`
+ clone() {
+ return Object.create(this);
+ }
+
+ // Converts the XML fragment to string
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation for pretty print
+ // `options.offset` how many indentations to add to every line for pretty print
+ // `options.newline` newline sequence for pretty print
+ toString(options) {
+ return '';
+ }
+
+ };
+
+}).call(this);
+
+},{"./NodeType":13,"./XMLNode":35}],33:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, XMLAttribute, XMLElement, XMLNamedNodeMap, XMLNode, getValue, isFunction, isObject,
+ hasProp = {}.hasOwnProperty;
+
+ ({isObject, isFunction, getValue} = require('./Utility'));
+
+ XMLNode = require('./XMLNode');
+
+ NodeType = require('./NodeType');
+
+ XMLAttribute = require('./XMLAttribute');
+
+ XMLNamedNodeMap = require('./XMLNamedNodeMap');
+
+ // Represents an element of the XML document
+ module.exports = XMLElement = (function() {
+ class XMLElement extends XMLNode {
+ // Initializes a new instance of `XMLElement`
+
+ // `parent` the parent node
+ // `name` element name
+ // `attributes` an object containing name/value pairs of attributes
+ constructor(parent, name, attributes) {
+ var child, j, len, ref;
+ super(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);
+ }
+ // set properties if this is the root node
+ if (parent.type === NodeType.Document) {
+ this.isRoot = true;
+ this.documentObject = parent;
+ parent.rootObject = this;
+ // set dtd name
+ if (parent.children) {
+ ref = parent.children;
+ for (j = 0, len = ref.length; j < len; j++) {
+ child = ref[j];
+ if (child.type === NodeType.DocType) {
+ child.name = this.name;
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ // Creates and returns a deep clone of `this`
+
+ clone() {
+ var att, attName, clonedSelf, ref;
+ clonedSelf = Object.create(this);
+ // remove document element
+ if (clonedSelf.isRoot) {
+ clonedSelf.documentObject = null;
+ }
+ // clone attributes
+ clonedSelf.attribs = {};
+ ref = this.attribs;
+ for (attName in ref) {
+ if (!hasProp.call(ref, attName)) continue;
+ att = ref[attName];
+ clonedSelf.attribs[attName] = att.clone();
+ }
+ // clone child nodes
+ clonedSelf.children = [];
+ this.children.forEach(function(child) {
+ var clonedChild;
+ clonedChild = child.clone();
+ clonedChild.parent = clonedSelf;
+ return clonedSelf.children.push(clonedChild);
+ });
+ return clonedSelf;
+ }
+
+ // Adds or modifies an attribute
+
+ // `name` attribute name
+ // `value` attribute value
+ attribute(name, value) {
+ var attName, attValue;
+ if (name != null) {
+ name = getValue(name);
+ }
+ if (isObject(name)) { // expand if object
+ 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;
+ }
+
+ // Removes an attribute
+
+ // `name` attribute name
+ removeAttribute(name) {
+ var attName, j, len;
+ // Also defined in DOM level 1
+ // removeAttribute(name) removes an attribute by name.
+ if (name == null) {
+ throw new Error("Missing attribute name. " + this.debugInfo());
+ }
+ name = getValue(name);
+ if (Array.isArray(name)) { // expand if array
+ for (j = 0, len = name.length; j < len; j++) {
+ attName = name[j];
+ delete this.attribs[attName];
+ }
+ } else {
+ delete this.attribs[name];
+ }
+ return this;
+ }
+
+ // Converts the XML fragment to string
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation for pretty print
+ // `options.offset` how many indentations to add to every line for pretty print
+ // `options.newline` newline sequence for pretty print
+ // `options.allowEmpty` do not self close empty element tags
+ toString(options) {
+ return this.options.writer.element(this, this.options.writer.filterOptions(options));
+ }
+
+ // Aliases
+ att(name, value) {
+ return this.attribute(name, value);
+ }
+
+ a(name, value) {
+ return this.attribute(name, value);
+ }
+
+ // DOM Level 1
+ getAttribute(name) {
+ if (this.attribs.hasOwnProperty(name)) {
+ return this.attribs[name].value;
+ } else {
+ return null;
+ }
+ }
+
+ setAttribute(name, value) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ getAttributeNode(name) {
+ if (this.attribs.hasOwnProperty(name)) {
+ return this.attribs[name];
+ } else {
+ return null;
+ }
+ }
+
+ setAttributeNode(newAttr) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ removeAttributeNode(oldAttr) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ getElementsByTagName(name) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ // DOM Level 2
+ getAttributeNS(namespaceURI, localName) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ setAttributeNS(namespaceURI, qualifiedName, value) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ removeAttributeNS(namespaceURI, localName) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ getAttributeNodeNS(namespaceURI, localName) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ setAttributeNodeNS(newAttr) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ getElementsByTagNameNS(namespaceURI, localName) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ hasAttribute(name) {
+ return this.attribs.hasOwnProperty(name);
+ }
+
+ hasAttributeNS(namespaceURI, localName) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ // DOM Level 3
+ setIdAttribute(name, isId) {
+ if (this.attribs.hasOwnProperty(name)) {
+ return this.attribs[name].isId;
+ } else {
+ return isId;
+ }
+ }
+
+ setIdAttributeNS(namespaceURI, localName, isId) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ setIdAttributeNode(idAttr, isId) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ // DOM Level 4
+ getElementsByTagName(tagname) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ getElementsByTagNameNS(namespaceURI, localName) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ getElementsByClassName(classNames) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ isEqualNode(node) {
+ var i, j, ref;
+ if (!super.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, ref = this.attribs.length - 1; (0 <= ref ? j <= ref : j >= ref); i = 0 <= ref ? ++j : --j) {
+ if (!this.attribs[i].isEqualNode(node.attribs[i])) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ };
+
+ // DOM level 1
+ Object.defineProperty(XMLElement.prototype, 'tagName', {
+ get: function() {
+ return this.name;
+ }
+ });
+
+ // DOM level 4
+ Object.defineProperty(XMLElement.prototype, 'namespaceURI', {
+ get: function() {
+ return '';
+ }
+ });
+
+ Object.defineProperty(XMLElement.prototype, 'prefix', {
+ get: function() {
+ return '';
+ }
+ });
+
+ Object.defineProperty(XMLElement.prototype, 'localName', {
+ get: function() {
+ return this.name;
+ }
+ });
+
+ Object.defineProperty(XMLElement.prototype, 'id', {
+ get: function() {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+ });
+
+ Object.defineProperty(XMLElement.prototype, 'className', {
+ get: function() {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+ });
+
+ Object.defineProperty(XMLElement.prototype, 'classList', {
+ get: function() {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+ });
+
+ Object.defineProperty(XMLElement.prototype, 'attributes', {
+ get: function() {
+ if (!this.attributeMap || !this.attributeMap.nodes) {
+ this.attributeMap = new XMLNamedNodeMap(this.attribs);
+ }
+ return this.attributeMap;
+ }
+ });
+
+ return XMLElement;
+
+ }).call(this);
+
+}).call(this);
+
+},{"./NodeType":13,"./Utility":14,"./XMLAttribute":16,"./XMLNamedNodeMap":34,"./XMLNode":35}],34:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ // Represents a map of nodes accessed by a string key
+ var XMLNamedNodeMap;
+
+ module.exports = XMLNamedNodeMap = (function() {
+ class XMLNamedNodeMap {
+ // Initializes a new instance of `XMLNamedNodeMap`
+ // This is just a wrapper around an ordinary
+ // JS object.
+
+ // `nodes` the object containing nodes.
+ constructor(nodes) {
+ this.nodes = nodes;
+ }
+
+ // Creates and returns a deep clone of `this`
+
+ clone() {
+ // this class should not be cloned since it wraps
+ // around a given object. The calling function should check
+ // whether the wrapped object is null and supply a new object
+ // (from the clone).
+ return this.nodes = null;
+ }
+
+ // DOM Level 1
+ getNamedItem(name) {
+ return this.nodes[name];
+ }
+
+ setNamedItem(node) {
+ var oldNode;
+ oldNode = this.nodes[node.nodeName];
+ this.nodes[node.nodeName] = node;
+ return oldNode || null;
+ }
+
+ removeNamedItem(name) {
+ var oldNode;
+ oldNode = this.nodes[name];
+ delete this.nodes[name];
+ return oldNode || null;
+ }
+
+ item(index) {
+ return this.nodes[Object.keys(this.nodes)[index]] || null;
+ }
+
+ // DOM level 2 functions to be implemented later
+ getNamedItemNS(namespaceURI, localName) {
+ throw new Error("This DOM method is not implemented.");
+ }
+
+ setNamedItemNS(node) {
+ throw new Error("This DOM method is not implemented.");
+ }
+
+ removeNamedItemNS(namespaceURI, localName) {
+ throw new Error("This DOM method is not implemented.");
+ }
+
+ };
+
+
+ // DOM level 1
+ Object.defineProperty(XMLNamedNodeMap.prototype, 'length', {
+ get: function() {
+ return Object.keys(this.nodes).length || 0;
+ }
+ });
+
+ return XMLNamedNodeMap;
+
+ }).call(this);
+
+}).call(this);
+
+},{}],35:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var DocumentPosition, NodeType, XMLCData, XMLComment, XMLDeclaration, XMLDocType, XMLDummy, XMLElement, XMLNamedNodeMap, XMLNode, XMLNodeList, XMLProcessingInstruction, XMLRaw, XMLText, getValue, isEmpty, isFunction, isObject,
+ hasProp = {}.hasOwnProperty,
+ splice = [].splice;
+
+ ({isObject, isFunction, isEmpty, getValue} = require('./Utility'));
+
+ XMLElement = null;
+
+ XMLCData = null;
+
+ XMLComment = null;
+
+ XMLDeclaration = null;
+
+ XMLDocType = null;
+
+ XMLRaw = null;
+
+ XMLText = null;
+
+ XMLProcessingInstruction = null;
+
+ XMLDummy = null;
+
+ NodeType = null;
+
+ XMLNodeList = null;
+
+ XMLNamedNodeMap = null;
+
+ DocumentPosition = null;
+
+ // Represents a generic XMl element
+ module.exports = XMLNode = (function() {
+ class XMLNode {
+ // Initializes a new instance of `XMLNode`
+
+ // `parent` the parent node
+ constructor(parent1) {
+ this.parent = parent1;
+ if (this.parent) {
+ this.options = this.parent.options;
+ this.stringify = this.parent.stringify;
+ }
+ this.value = null;
+ this.children = [];
+ this.baseURI = null;
+ // first execution, load dependencies that are otherwise
+ // circular (so we can't load them at the top)
+ if (!XMLElement) {
+ XMLElement = require('./XMLElement');
+ XMLCData = require('./XMLCData');
+ XMLComment = require('./XMLComment');
+ XMLDeclaration = require('./XMLDeclaration');
+ XMLDocType = require('./XMLDocType');
+ XMLRaw = require('./XMLRaw');
+ XMLText = require('./XMLText');
+ XMLProcessingInstruction = require('./XMLProcessingInstruction');
+ XMLDummy = require('./XMLDummy');
+ NodeType = require('./NodeType');
+ XMLNodeList = require('./XMLNodeList');
+ XMLNamedNodeMap = require('./XMLNamedNodeMap');
+ DocumentPosition = require('./DocumentPosition');
+ }
+ }
+
+
+ // Sets the parent node of this node and its children recursively
+
+ // `parent` the parent node
+ setParent(parent) {
+ var child, j, len, ref1, results;
+ this.parent = parent;
+ if (parent) {
+ this.options = parent.options;
+ this.stringify = parent.stringify;
+ }
+ ref1 = this.children;
+ results = [];
+ for (j = 0, len = ref1.length; j < len; j++) {
+ child = ref1[j];
+ results.push(child.setParent(this));
+ }
+ return results;
+ }
+
+ // Creates a child element node
+
+ // `name` node name or an object describing the XML tree
+ // `attributes` an object containing name/value pairs of attributes
+ // `text` element text
+ element(name, attributes, text) {
+ var childNode, item, j, k, key, lastChild, len, len1, val;
+ lastChild = null;
+ if (attributes === null && (text == null)) {
+ [attributes, text] = [{}, null];
+ }
+ if (attributes == null) {
+ attributes = {};
+ }
+ attributes = getValue(attributes);
+ // swap argument order: text <-> attributes
+ if (!isObject(attributes)) {
+ [text, attributes] = [attributes, text];
+ }
+ if (name != null) {
+ name = getValue(name);
+ }
+ // expand if array
+ if (Array.isArray(name)) {
+ for (j = 0, len = name.length; j < len; j++) {
+ item = name[j];
+ lastChild = this.element(item);
+ }
+ // evaluate if function
+ } else if (isFunction(name)) {
+ lastChild = this.element(name.apply());
+ // expand if object
+ } else if (isObject(name)) {
+ for (key in name) {
+ if (!hasProp.call(name, key)) continue;
+ val = name[key];
+ if (isFunction(val)) {
+ // evaluate if function
+ val = val.apply();
+ }
+ // assign attributes
+ if (!this.options.ignoreDecorators && this.stringify.convertAttKey && key.indexOf(this.stringify.convertAttKey) === 0) {
+ lastChild = this.attribute(key.substr(this.stringify.convertAttKey.length), val);
+ // skip empty arrays
+ } else if (!this.options.separateArrayItems && Array.isArray(val) && isEmpty(val)) {
+ lastChild = this.dummy();
+ // empty objects produce one node
+ } else if (isObject(val) && isEmpty(val)) {
+ lastChild = this.element(key);
+ // skip null and undefined nodes
+ } else if (!this.options.keepNullNodes && (val == null)) {
+ lastChild = this.dummy();
+
+ // expand list by creating child nodes
+ } else if (!this.options.separateArrayItems && Array.isArray(val)) {
+ for (k = 0, len1 = val.length; k < len1; k++) {
+ item = val[k];
+ childNode = {};
+ childNode[key] = item;
+ lastChild = this.element(childNode);
+ }
+
+ // expand child nodes under parent
+ } else if (isObject(val)) {
+ // if the key is #text expand child nodes under this node to support mixed content
+ if (!this.options.ignoreDecorators && this.stringify.convertTextKey && key.indexOf(this.stringify.convertTextKey) === 0) {
+ lastChild = this.element(val);
+ } else {
+ lastChild = this.element(key);
+ lastChild.element(val);
+ }
+ } else {
+
+ // text node
+ lastChild = this.element(key, val);
+ }
+ }
+ // skip null nodes
+ } else if (!this.options.keepNullNodes && text === null) {
+ lastChild = this.dummy();
+ } else {
+ // text node
+ if (!this.options.ignoreDecorators && this.stringify.convertTextKey && name.indexOf(this.stringify.convertTextKey) === 0) {
+ lastChild = this.text(text);
+ // cdata node
+ } else if (!this.options.ignoreDecorators && this.stringify.convertCDataKey && name.indexOf(this.stringify.convertCDataKey) === 0) {
+ lastChild = this.cdata(text);
+ // comment node
+ } else if (!this.options.ignoreDecorators && this.stringify.convertCommentKey && name.indexOf(this.stringify.convertCommentKey) === 0) {
+ lastChild = this.comment(text);
+ // raw text node
+ } else if (!this.options.ignoreDecorators && this.stringify.convertRawKey && name.indexOf(this.stringify.convertRawKey) === 0) {
+ lastChild = this.raw(text);
+ // processing instruction
+ } else if (!this.options.ignoreDecorators && this.stringify.convertPIKey && name.indexOf(this.stringify.convertPIKey) === 0) {
+ lastChild = this.instruction(name.substr(this.stringify.convertPIKey.length), text);
+ } else {
+ // element node
+ lastChild = this.node(name, attributes, text);
+ }
+ }
+ if (lastChild == null) {
+ throw new Error("Could not create any elements with: " + name + ". " + this.debugInfo());
+ }
+ return lastChild;
+ }
+
+ // Creates a child element node before the current node
+
+ // `name` node name or an object describing the XML tree
+ // `attributes` an object containing name/value pairs of attributes
+ // `text` element text
+ insertBefore(name, attributes, text) {
+ var child, i, newChild, refChild, removed;
+ // DOM level 1
+ // insertBefore(newChild, refChild) inserts the child node newChild before refChild
+ if (name != null ? name.type : void 0) {
+ newChild = name;
+ refChild = attributes;
+ newChild.setParent(this);
+ if (refChild) {
+ // temporarily remove children starting *with* refChild
+ i = children.indexOf(refChild);
+ removed = children.splice(i);
+
+ // add the new child
+ children.push(newChild);
+
+ // add back removed children after new child
+ Array.prototype.push.apply(children, removed);
+ } else {
+ children.push(newChild);
+ }
+ return newChild;
+ } else {
+ if (this.isRoot) {
+ throw new Error("Cannot insert elements at root level. " + this.debugInfo(name));
+ }
+
+ // temporarily remove children starting *with* this
+ i = this.parent.children.indexOf(this);
+ removed = this.parent.children.splice(i);
+
+ // add the new child
+ child = this.parent.element(name, attributes, text);
+
+ // add back removed children after new child
+ Array.prototype.push.apply(this.parent.children, removed);
+ return child;
+ }
+ }
+
+ // Creates a child element node after the current node
+
+ // `name` node name or an object describing the XML tree
+ // `attributes` an object containing name/value pairs of attributes
+ // `text` element text
+ insertAfter(name, attributes, text) {
+ var child, i, removed;
+ if (this.isRoot) {
+ throw new Error("Cannot insert elements at root level. " + this.debugInfo(name));
+ }
+
+ // temporarily remove children starting *after* this
+ i = this.parent.children.indexOf(this);
+ removed = this.parent.children.splice(i + 1);
+
+ // add the new child
+ child = this.parent.element(name, attributes, text);
+
+ // add back removed children after new child
+ Array.prototype.push.apply(this.parent.children, removed);
+ return child;
+ }
+
+ // Deletes a child element node
+
+ remove() {
+ var i, ref1;
+ if (this.isRoot) {
+ throw new Error("Cannot remove the root element. " + this.debugInfo());
+ }
+ i = this.parent.children.indexOf(this);
+ splice.apply(this.parent.children, [i, i - i + 1].concat(ref1 = [])), ref1;
+ return this.parent;
+ }
+
+ // Creates a node
+
+ // `name` name of the node
+ // `attributes` an object containing name/value pairs of attributes
+ // `text` element text
+ node(name, attributes, text) {
+ var child;
+ if (name != null) {
+ name = getValue(name);
+ }
+ attributes || (attributes = {});
+ attributes = getValue(attributes);
+ // swap argument order: text <-> attributes
+ if (!isObject(attributes)) {
+ [text, attributes] = [attributes, text];
+ }
+ child = new XMLElement(this, name, attributes);
+ if (text != null) {
+ child.text(text);
+ }
+ this.children.push(child);
+ return child;
+ }
+
+ // Creates a text node
+
+ // `value` element text
+ text(value) {
+ var child;
+ if (isObject(value)) {
+ this.element(value);
+ }
+ child = new XMLText(this, value);
+ this.children.push(child);
+ return this;
+ }
+
+ // Creates a CDATA node
+
+ // `value` element text without CDATA delimiters
+ cdata(value) {
+ var child;
+ child = new XMLCData(this, value);
+ this.children.push(child);
+ return this;
+ }
+
+ // Creates a comment node
+
+ // `value` comment text
+ comment(value) {
+ var child;
+ child = new XMLComment(this, value);
+ this.children.push(child);
+ return this;
+ }
+
+ // Creates a comment node before the current node
+
+ // `value` comment text
+ commentBefore(value) {
+ var child, i, removed;
+ // temporarily remove children starting *with* this
+ i = this.parent.children.indexOf(this);
+ removed = this.parent.children.splice(i);
+ // add the new child
+ child = this.parent.comment(value);
+ // add back removed children after new child
+ Array.prototype.push.apply(this.parent.children, removed);
+ return this;
+ }
+
+ // Creates a comment node after the current node
+
+ // `value` comment text
+ commentAfter(value) {
+ var child, i, removed;
+ // temporarily remove children starting *after* this
+ i = this.parent.children.indexOf(this);
+ removed = this.parent.children.splice(i + 1);
+ // add the new child
+ child = this.parent.comment(value);
+ // add back removed children after new child
+ Array.prototype.push.apply(this.parent.children, removed);
+ return this;
+ }
+
+ // Adds unescaped raw text
+
+ // `value` text
+ raw(value) {
+ var child;
+ child = new XMLRaw(this, value);
+ this.children.push(child);
+ return this;
+ }
+
+ // Adds a dummy node
+ dummy() {
+ var child;
+ child = new XMLDummy(this);
+ // Normally when a new node is created it is added to the child node collection.
+ // However, dummy nodes are never added to the XML tree. They are created while
+ // converting JS objects to XML nodes in order not to break the recursive function
+ // chain. They can be thought of as invisible nodes. They can be traversed through
+ // by using prev(), next(), up(), etc. functions but they do not exists in the tree.
+
+ // @children.push child
+ return child;
+ }
+
+ // Adds a processing instruction
+
+ // `target` instruction target
+ // `value` instruction value
+ instruction(target, value) {
+ var insTarget, insValue, instruction, j, len;
+ if (target != null) {
+ target = getValue(target);
+ }
+ if (value != null) {
+ value = getValue(value);
+ }
+ if (Array.isArray(target)) { // expand if array
+ for (j = 0, len = target.length; j < len; j++) {
+ insTarget = target[j];
+ this.instruction(insTarget);
+ }
+ } else if (isObject(target)) { // expand if object
+ for (insTarget in target) {
+ if (!hasProp.call(target, insTarget)) continue;
+ insValue = target[insTarget];
+ this.instruction(insTarget, insValue);
+ }
+ } else {
+ if (isFunction(value)) {
+ value = value.apply();
+ }
+ instruction = new XMLProcessingInstruction(this, target, value);
+ this.children.push(instruction);
+ }
+ return this;
+ }
+
+ // Creates a processing instruction node before the current node
+
+ // `target` instruction target
+ // `value` instruction value
+ instructionBefore(target, value) {
+ var child, i, removed;
+ // temporarily remove children starting *with* this
+ i = this.parent.children.indexOf(this);
+ removed = this.parent.children.splice(i);
+ // add the new child
+ child = this.parent.instruction(target, value);
+ // add back removed children after new child
+ Array.prototype.push.apply(this.parent.children, removed);
+ return this;
+ }
+
+ // Creates a processing instruction node after the current node
+
+ // `target` instruction target
+ // `value` instruction value
+ instructionAfter(target, value) {
+ var child, i, removed;
+ // temporarily remove children starting *after* this
+ i = this.parent.children.indexOf(this);
+ removed = this.parent.children.splice(i + 1);
+ // add the new child
+ child = this.parent.instruction(target, value);
+ // add back removed children after new child
+ Array.prototype.push.apply(this.parent.children, removed);
+ return this;
+ }
+
+ // Creates the xml declaration
+
+ // `version` A version number string, e.g. 1.0
+ // `encoding` Encoding declaration, e.g. UTF-8
+ // `standalone` standalone document declaration: true or false
+ declaration(version, encoding, standalone) {
+ var doc, xmldec;
+ doc = this.document();
+ xmldec = new XMLDeclaration(doc, version, encoding, standalone);
+ // Replace XML declaration if exists, otherwise insert at top
+ if (doc.children.length === 0) {
+ doc.children.unshift(xmldec);
+ } else if (doc.children[0].type === NodeType.Declaration) {
+ doc.children[0] = xmldec;
+ } else {
+ doc.children.unshift(xmldec);
+ }
+ return doc.root() || doc;
+ }
+
+ // Creates the document type declaration
+
+ // `pubID` the public identifier of the external subset
+ // `sysID` the system identifier of the external subset
+ dtd(pubID, sysID) {
+ var child, doc, doctype, i, j, k, len, len1, ref1, ref2;
+ doc = this.document();
+ doctype = new XMLDocType(doc, pubID, sysID);
+ ref1 = doc.children;
+ // Replace DTD if exists
+ for (i = j = 0, len = ref1.length; j < len; i = ++j) {
+ child = ref1[i];
+ if (child.type === NodeType.DocType) {
+ doc.children[i] = doctype;
+ return doctype;
+ }
+ }
+ ref2 = doc.children;
+ // insert before root node if the root node exists
+ for (i = k = 0, len1 = ref2.length; k < len1; i = ++k) {
+ child = ref2[i];
+ if (child.isRoot) {
+ doc.children.splice(i, 0, doctype);
+ return doctype;
+ }
+ }
+ // otherwise append to end
+ doc.children.push(doctype);
+ return doctype;
+ }
+
+ // Gets the parent node
+ up() {
+ if (this.isRoot) {
+ throw new Error("The root node has no parent. Use doc() if you need to get the document object.");
+ }
+ return this.parent;
+ }
+
+ // Gets the root node
+ root() {
+ var node;
+ node = this;
+ while (node) {
+ if (node.type === NodeType.Document) {
+ return node.rootObject;
+ } else if (node.isRoot) {
+ return node;
+ } else {
+ node = node.parent;
+ }
+ }
+ }
+
+ // Gets the node representing the XML document
+ document() {
+ var node;
+ node = this;
+ while (node) {
+ if (node.type === NodeType.Document) {
+ return node;
+ } else {
+ node = node.parent;
+ }
+ }
+ }
+
+ // Ends the document and converts string
+ end(options) {
+ return this.document().end(options);
+ }
+
+ // Gets the previous node
+ prev() {
+ var i;
+ i = this.parent.children.indexOf(this);
+ if (i < 1) {
+ throw new Error("Already at the first node. " + this.debugInfo());
+ }
+ return this.parent.children[i - 1];
+ }
+
+ // Gets the next node
+ next() {
+ var i;
+ i = this.parent.children.indexOf(this);
+ if (i === -1 || i === this.parent.children.length - 1) {
+ throw new Error("Already at the last node. " + this.debugInfo());
+ }
+ return this.parent.children[i + 1];
+ }
+
+ // Imports cloned root from another XML document
+
+ // `doc` the XML document to insert nodes from
+ importDocument(doc) {
+ var child, clonedRoot, j, len, ref1;
+ clonedRoot = doc.root().clone();
+ clonedRoot.parent = this;
+ clonedRoot.isRoot = false;
+ this.children.push(clonedRoot);
+ // set properties if imported element becomes the root node
+ if (this.type === NodeType.Document) {
+ clonedRoot.isRoot = true;
+ clonedRoot.documentObject = this;
+ this.rootObject = clonedRoot;
+ // set dtd name
+ if (this.children) {
+ ref1 = this.children;
+ for (j = 0, len = ref1.length; j < len; j++) {
+ child = ref1[j];
+ if (child.type === NodeType.DocType) {
+ child.name = clonedRoot.name;
+ break;
+ }
+ }
+ }
+ }
+ return this;
+ }
+
+
+ // Returns debug string for this node
+ debugInfo(name) {
+ var ref1, ref2;
+ name = name || this.name;
+ if ((name == null) && !((ref1 = this.parent) != null ? ref1.name : void 0)) {
+ return "";
+ } else if (name == null) {
+ return "parent: <" + this.parent.name + ">";
+ } else if (!((ref2 = this.parent) != null ? ref2.name : void 0)) {
+ return "node: <" + name + ">";
+ } else {
+ return "node: <" + name + ">, parent: <" + this.parent.name + ">";
+ }
+ }
+
+ // Aliases
+ ele(name, attributes, text) {
+ return this.element(name, attributes, text);
+ }
+
+ nod(name, attributes, text) {
+ return this.node(name, attributes, text);
+ }
+
+ txt(value) {
+ return this.text(value);
+ }
+
+ dat(value) {
+ return this.cdata(value);
+ }
+
+ com(value) {
+ return this.comment(value);
+ }
+
+ ins(target, value) {
+ return this.instruction(target, value);
+ }
+
+ doc() {
+ return this.document();
+ }
+
+ dec(version, encoding, standalone) {
+ return this.declaration(version, encoding, standalone);
+ }
+
+ e(name, attributes, text) {
+ return this.element(name, attributes, text);
+ }
+
+ n(name, attributes, text) {
+ return this.node(name, attributes, text);
+ }
+
+ t(value) {
+ return this.text(value);
+ }
+
+ d(value) {
+ return this.cdata(value);
+ }
+
+ c(value) {
+ return this.comment(value);
+ }
+
+ r(value) {
+ return this.raw(value);
+ }
+
+ i(target, value) {
+ return this.instruction(target, value);
+ }
+
+ u() {
+ return this.up();
+ }
+
+ // can be deprecated in a future release
+ importXMLBuilder(doc) {
+ return this.importDocument(doc);
+ }
+
+ // Adds or modifies an attribute.
+
+ // `name` attribute name
+ // `value` attribute value
+ attribute(name, value) {
+ throw new Error("attribute() applies to element nodes only.");
+ }
+
+ att(name, value) {
+ return this.attribute(name, value);
+ }
+
+ a(name, value) {
+ return this.attribute(name, value);
+ }
+
+ // Removes an attribute
+
+ // `name` attribute name
+ removeAttribute(name) {
+ throw new Error("attribute() applies to element nodes only.");
+ }
+
+ // DOM level 1 functions to be implemented later
+ replaceChild(newChild, oldChild) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ removeChild(oldChild) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ appendChild(newChild) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ hasChildNodes() {
+ return this.children.length !== 0;
+ }
+
+ cloneNode(deep) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ normalize() {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ // DOM level 2
+ isSupported(feature, version) {
+ return true;
+ }
+
+ hasAttributes() {
+ return this.attribs.length !== 0;
+ }
+
+ // DOM level 3 functions to be implemented later
+ compareDocumentPosition(other) {
+ var ref, res;
+ ref = this;
+ if (ref === other) {
+ return 0;
+ } else if (this.document() !== other.document()) {
+ res = DocumentPosition.Disconnected | DocumentPosition.ImplementationSpecific;
+ if (Math.random() < 0.5) {
+ res |= DocumentPosition.Preceding;
+ } else {
+ res |= DocumentPosition.Following;
+ }
+ return res;
+ } else if (ref.isAncestor(other)) {
+ return DocumentPosition.Contains | DocumentPosition.Preceding;
+ } else if (ref.isDescendant(other)) {
+ return DocumentPosition.Contains | DocumentPosition.Following;
+ } else if (ref.isPreceding(other)) {
+ return DocumentPosition.Preceding;
+ } else {
+ return DocumentPosition.Following;
+ }
+ }
+
+ isSameNode(other) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ lookupPrefix(namespaceURI) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ isDefaultNamespace(namespaceURI) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ lookupNamespaceURI(prefix) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ isEqualNode(node) {
+ var i, j, ref1;
+ if (node.nodeType !== this.nodeType) {
+ return false;
+ }
+ if (node.children.length !== this.children.length) {
+ return false;
+ }
+ for (i = j = 0, ref1 = this.children.length - 1; (0 <= ref1 ? j <= ref1 : j >= ref1); i = 0 <= ref1 ? ++j : --j) {
+ if (!this.children[i].isEqualNode(node.children[i])) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ getFeature(feature, version) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ setUserData(key, data, handler) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ getUserData(key) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ // Returns true if other is an inclusive descendant of node,
+ // and false otherwise.
+ contains(other) {
+ if (!other) {
+ return false;
+ }
+ return other === this || this.isDescendant(other);
+ }
+
+ // An object A is called a descendant of an object B, if either A is
+ // a child of B or A is a child of an object C that is a descendant of B.
+ isDescendant(node) {
+ var child, isDescendantChild, j, len, ref1;
+ ref1 = this.children;
+ for (j = 0, len = ref1.length; j < len; j++) {
+ child = ref1[j];
+ if (node === child) {
+ return true;
+ }
+ isDescendantChild = child.isDescendant(node);
+ if (isDescendantChild) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ // An object A is called an ancestor of an object B if and only if
+ // B is a descendant of A.
+ isAncestor(node) {
+ return node.isDescendant(this);
+ }
+
+ // An object A is preceding an object B if A and B are in the
+ // same tree and A comes before B in tree order.
+ isPreceding(node) {
+ var nodePos, thisPos;
+ nodePos = this.treePosition(node);
+ thisPos = this.treePosition(this);
+ if (nodePos === -1 || thisPos === -1) {
+ return false;
+ } else {
+ return nodePos < thisPos;
+ }
+ }
+
+ // An object A is folllowing an object B if A and B are in the
+ // same tree and A comes after B in tree order.
+ isFollowing(node) {
+ var nodePos, thisPos;
+ nodePos = this.treePosition(node);
+ thisPos = this.treePosition(this);
+ if (nodePos === -1 || thisPos === -1) {
+ return false;
+ } else {
+ return nodePos > thisPos;
+ }
+ }
+
+ // Returns the preorder position of the given node in the tree, or -1
+ // if the node is not in the tree.
+ treePosition(node) {
+ var found, pos;
+ pos = 0;
+ found = false;
+ this.foreachTreeNode(this.document(), function(childNode) {
+ pos++;
+ if (!found && childNode === node) {
+ return found = true;
+ }
+ });
+ if (found) {
+ return pos;
+ } else {
+ return -1;
+ }
+ }
+
+
+ // Depth-first preorder traversal through the XML tree
+ foreachTreeNode(node, func) {
+ var child, j, len, ref1, res;
+ node || (node = this.document());
+ ref1 = node.children;
+ for (j = 0, len = ref1.length; j < len; j++) {
+ child = ref1[j];
+ if (res = func(child)) {
+ return res;
+ } else {
+ res = this.foreachTreeNode(child, func);
+ if (res) {
+ return res;
+ }
+ }
+ }
+ }
+
+ };
+
+ // DOM level 1
+ Object.defineProperty(XMLNode.prototype, 'nodeName', {
+ get: function() {
+ return this.name;
+ }
+ });
+
+ Object.defineProperty(XMLNode.prototype, 'nodeType', {
+ get: function() {
+ return this.type;
+ }
+ });
+
+ Object.defineProperty(XMLNode.prototype, 'nodeValue', {
+ get: function() {
+ return this.value;
+ }
+ });
+
+ Object.defineProperty(XMLNode.prototype, 'parentNode', {
+ get: function() {
+ return this.parent;
+ }
+ });
+
+ Object.defineProperty(XMLNode.prototype, 'childNodes', {
+ get: function() {
+ if (!this.childNodeList || !this.childNodeList.nodes) {
+ this.childNodeList = new XMLNodeList(this.children);
+ }
+ return this.childNodeList;
+ }
+ });
+
+ Object.defineProperty(XMLNode.prototype, 'firstChild', {
+ get: function() {
+ return this.children[0] || null;
+ }
+ });
+
+ Object.defineProperty(XMLNode.prototype, 'lastChild', {
+ get: function() {
+ return this.children[this.children.length - 1] || null;
+ }
+ });
+
+ Object.defineProperty(XMLNode.prototype, 'previousSibling', {
+ get: function() {
+ var i;
+ i = this.parent.children.indexOf(this);
+ return this.parent.children[i - 1] || null;
+ }
+ });
+
+ Object.defineProperty(XMLNode.prototype, 'nextSibling', {
+ get: function() {
+ var i;
+ i = this.parent.children.indexOf(this);
+ return this.parent.children[i + 1] || null;
+ }
+ });
+
+ Object.defineProperty(XMLNode.prototype, 'ownerDocument', {
+ get: function() {
+ return this.document() || null;
+ }
+ });
+
+ // DOM level 3
+ Object.defineProperty(XMLNode.prototype, 'textContent', {
+ get: function() {
+ var child, j, len, ref1, str;
+ if (this.nodeType === NodeType.Element || this.nodeType === NodeType.DocumentFragment) {
+ str = '';
+ ref1 = this.children;
+ for (j = 0, len = ref1.length; j < len; j++) {
+ child = ref1[j];
+ if (child.textContent) {
+ str += child.textContent;
+ }
+ }
+ return str;
+ } else {
+ return null;
+ }
+ },
+ set: function(value) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+ });
+
+ return XMLNode;
+
+ }).call(this);
+
+}).call(this);
+
+},{"./DocumentPosition":12,"./NodeType":13,"./Utility":14,"./XMLCData":17,"./XMLComment":19,"./XMLDeclaration":28,"./XMLDocType":29,"./XMLDummy":32,"./XMLElement":33,"./XMLNamedNodeMap":34,"./XMLNodeList":36,"./XMLProcessingInstruction":37,"./XMLRaw":38,"./XMLText":42}],36:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ // Represents a list of nodes
+ var XMLNodeList;
+
+ module.exports = XMLNodeList = (function() {
+ class XMLNodeList {
+ // Initializes a new instance of `XMLNodeList`
+ // This is just a wrapper around an ordinary
+ // JS array.
+
+ // `nodes` the array containing nodes.
+ constructor(nodes) {
+ this.nodes = nodes;
+ }
+
+ // Creates and returns a deep clone of `this`
+
+ clone() {
+ // this class should not be cloned since it wraps
+ // around a given array. The calling function should check
+ // whether the wrapped array is null and supply a new array
+ // (from the clone).
+ return this.nodes = null;
+ }
+
+ // DOM Level 1
+ item(index) {
+ return this.nodes[index] || null;
+ }
+
+ };
+
+ // DOM level 1
+ Object.defineProperty(XMLNodeList.prototype, 'length', {
+ get: function() {
+ return this.nodes.length || 0;
+ }
+ });
+
+ return XMLNodeList;
+
+ }).call(this);
+
+}).call(this);
+
+},{}],37:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, XMLCharacterData, XMLProcessingInstruction;
+
+ NodeType = require('./NodeType');
+
+ XMLCharacterData = require('./XMLCharacterData');
+
+ // Represents a processing instruction
+ module.exports = XMLProcessingInstruction = class XMLProcessingInstruction extends XMLCharacterData {
+ // Initializes a new instance of `XMLProcessingInstruction`
+
+ // `parent` the parent node
+ // `target` instruction target
+ // `value` instruction value
+ constructor(parent, target, value) {
+ super(parent);
+ if (target == null) {
+ throw new Error("Missing instruction target. " + this.debugInfo());
+ }
+ this.type = NodeType.ProcessingInstruction;
+ this.target = this.stringify.insTarget(target);
+ this.name = this.target;
+ if (value) {
+ this.value = this.stringify.insValue(value);
+ }
+ }
+
+ // Creates and returns a deep clone of `this`
+ clone() {
+ return Object.create(this);
+ }
+
+ // Converts the XML fragment to string
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation for pretty print
+ // `options.offset` how many indentations to add to every line for pretty print
+ // `options.newline` newline sequence for pretty print
+ toString(options) {
+ return this.options.writer.processingInstruction(this, this.options.writer.filterOptions(options));
+ }
+
+ isEqualNode(node) {
+ if (!super.isEqualNode(node)) {
+ return false;
+ }
+ if (node.target !== this.target) {
+ return false;
+ }
+ return true;
+ }
+
+ };
+
+}).call(this);
+
+},{"./NodeType":13,"./XMLCharacterData":18}],38:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, XMLNode, XMLRaw;
+
+ NodeType = require('./NodeType');
+
+ XMLNode = require('./XMLNode');
+
+ // Represents a raw node
+ module.exports = XMLRaw = class XMLRaw extends XMLNode {
+ // Initializes a new instance of `XMLRaw`
+
+ // `text` raw text
+ constructor(parent, text) {
+ super(parent);
+ if (text == null) {
+ throw new Error("Missing raw text. " + this.debugInfo());
+ }
+ this.type = NodeType.Raw;
+ this.value = this.stringify.raw(text);
+ }
+
+ // Creates and returns a deep clone of `this`
+ clone() {
+ return Object.create(this);
+ }
+
+ // Converts the XML fragment to string
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation for pretty print
+ // `options.offset` how many indentations to add to every line for pretty print
+ // `options.newline` newline sequence for pretty print
+ toString(options) {
+ return this.options.writer.raw(this, this.options.writer.filterOptions(options));
+ }
+
+ };
+
+}).call(this);
+
+},{"./NodeType":13,"./XMLNode":35}],39:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, WriterState, XMLStreamWriter, XMLWriterBase,
+ hasProp = {}.hasOwnProperty;
+
+ NodeType = require('./NodeType');
+
+ XMLWriterBase = require('./XMLWriterBase');
+
+ WriterState = require('./WriterState');
+
+ // Prints XML nodes to a stream
+ module.exports = XMLStreamWriter = class XMLStreamWriter extends XMLWriterBase {
+ // Initializes a new instance of `XMLStreamWriter`
+
+ // `stream` output stream
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation string
+ // `options.newline` newline sequence
+ // `options.offset` a fixed number of indentations to add to every line
+ // `options.allowEmpty` do not self close empty element tags
+ // 'options.dontPrettyTextNodes' if any text is present in node, don't indent or LF
+ // `options.spaceBeforeSlash` add a space before the closing slash of empty elements
+ constructor(stream, options) {
+ super(options);
+ this.stream = stream;
+ }
+
+ endline(node, options, level) {
+ if (node.isLastRootNode && options.state === WriterState.CloseTag) {
+ return '';
+ } else {
+ return super.endline(node, options, level);
+ }
+ }
+
+ document(doc, options) {
+ var child, i, j, k, len1, len2, ref, ref1, results;
+ ref = doc.children;
+ // set a flag so that we don't insert a newline after the last root level node
+ for (i = j = 0, len1 = ref.length; j < len1; i = ++j) {
+ child = ref[i];
+ child.isLastRootNode = i === doc.children.length - 1;
+ }
+ options = this.filterOptions(options);
+ ref1 = doc.children;
+ results = [];
+ for (k = 0, len2 = ref1.length; k < len2; k++) {
+ child = ref1[k];
+ results.push(this.writeChildNode(child, options, 0));
+ }
+ return results;
+ }
+
+ cdata(node, options, level) {
+ return this.stream.write(super.cdata(node, options, level));
+ }
+
+ comment(node, options, level) {
+ return this.stream.write(super.comment(node, options, level));
+ }
+
+ declaration(node, options, level) {
+ return this.stream.write(super.declaration(node, options, level));
+ }
+
+ docType(node, options, level) {
+ var child, j, len1, ref;
+ level || (level = 0);
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ this.stream.write(this.indent(node, options, level));
+ this.stream.write('<!DOCTYPE ' + node.root().name);
+ // external identifier
+ if (node.pubID && node.sysID) {
+ this.stream.write(' PUBLIC "' + node.pubID + '" "' + node.sysID + '"');
+ } else if (node.sysID) {
+ this.stream.write(' SYSTEM "' + node.sysID + '"');
+ }
+ // internal subset
+ if (node.children.length > 0) {
+ this.stream.write(' [');
+ this.stream.write(this.endline(node, options, level));
+ options.state = WriterState.InsideTag;
+ ref = node.children;
+ for (j = 0, len1 = ref.length; j < len1; j++) {
+ child = ref[j];
+ this.writeChildNode(child, options, level + 1);
+ }
+ options.state = WriterState.CloseTag;
+ this.stream.write(']');
+ }
+ // close tag
+ options.state = WriterState.CloseTag;
+ this.stream.write(options.spaceBeforeSlash + '>');
+ this.stream.write(this.endline(node, options, level));
+ options.state = WriterState.None;
+ return this.closeNode(node, options, level);
+ }
+
+ element(node, options, level) {
+ var att, attLen, child, childNodeCount, firstChildNode, j, len, len1, name, prettySuppressed, r, ratt, ref, ref1, ref2, rline;
+ level || (level = 0);
+ // open tag
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r = this.indent(node, options, level) + '<' + node.name;
+ // attributes
+ if (options.pretty && options.width > 0) {
+ len = r.length;
+ ref = node.attribs;
+ for (name in ref) {
+ if (!hasProp.call(ref, name)) continue;
+ att = ref[name];
+ ratt = this.attribute(att, options, level);
+ attLen = ratt.length;
+ if (len + attLen > options.width) {
+ rline = this.indent(node, options, level + 1) + ratt;
+ r += this.endline(node, options, level) + rline;
+ len = rline.length;
+ } else {
+ rline = ' ' + ratt;
+ r += rline;
+ len += rline.length;
+ }
+ }
+ } else {
+ ref1 = node.attribs;
+ for (name in ref1) {
+ if (!hasProp.call(ref1, name)) continue;
+ att = ref1[name];
+ r += this.attribute(att, options, level);
+ }
+ }
+ this.stream.write(r);
+ childNodeCount = node.children.length;
+ firstChildNode = childNodeCount === 0 ? null : node.children[0];
+ if (childNodeCount === 0 || node.children.every(function(e) {
+ return (e.type === NodeType.Text || e.type === NodeType.Raw || e.type === NodeType.CData) && e.value === '';
+ })) {
+ // empty element
+ if (options.allowEmpty) {
+ this.stream.write('>');
+ options.state = WriterState.CloseTag;
+ this.stream.write('</' + node.name + '>');
+ } else {
+ options.state = WriterState.CloseTag;
+ this.stream.write(options.spaceBeforeSlash + '/>');
+ }
+ } else if (options.pretty && childNodeCount === 1 && (firstChildNode.type === NodeType.Text || firstChildNode.type === NodeType.Raw || firstChildNode.type === NodeType.CData) && (firstChildNode.value != null)) {
+ // do not indent text-only nodes
+ this.stream.write('>');
+ options.state = WriterState.InsideTag;
+ options.suppressPrettyCount++;
+ prettySuppressed = true;
+ this.writeChildNode(firstChildNode, options, level + 1);
+ options.suppressPrettyCount--;
+ prettySuppressed = false;
+ options.state = WriterState.CloseTag;
+ this.stream.write('</' + node.name + '>');
+ } else {
+ this.stream.write('>' + this.endline(node, options, level));
+ options.state = WriterState.InsideTag;
+ ref2 = node.children;
+ // inner tags
+ for (j = 0, len1 = ref2.length; j < len1; j++) {
+ child = ref2[j];
+ this.writeChildNode(child, options, level + 1);
+ }
+ // close tag
+ options.state = WriterState.CloseTag;
+ this.stream.write(this.indent(node, options, level) + '</' + node.name + '>');
+ }
+ this.stream.write(this.endline(node, options, level));
+ options.state = WriterState.None;
+ return this.closeNode(node, options, level);
+ }
+
+ processingInstruction(node, options, level) {
+ return this.stream.write(super.processingInstruction(node, options, level));
+ }
+
+ raw(node, options, level) {
+ return this.stream.write(super.raw(node, options, level));
+ }
+
+ text(node, options, level) {
+ return this.stream.write(super.text(node, options, level));
+ }
+
+ dtdAttList(node, options, level) {
+ return this.stream.write(super.dtdAttList(node, options, level));
+ }
+
+ dtdElement(node, options, level) {
+ return this.stream.write(super.dtdElement(node, options, level));
+ }
+
+ dtdEntity(node, options, level) {
+ return this.stream.write(super.dtdEntity(node, options, level));
+ }
+
+ dtdNotation(node, options, level) {
+ return this.stream.write(super.dtdNotation(node, options, level));
+ }
+
+ };
+
+}).call(this);
+
+},{"./NodeType":13,"./WriterState":15,"./XMLWriterBase":43}],40:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var XMLStringWriter, XMLWriterBase;
+
+ XMLWriterBase = require('./XMLWriterBase');
+
+ // Prints XML nodes as plain text
+ module.exports = XMLStringWriter = class XMLStringWriter extends XMLWriterBase {
+ // Initializes a new instance of `XMLStringWriter`
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation string
+ // `options.newline` newline sequence
+ // `options.offset` a fixed number of indentations to add to every line
+ // `options.allowEmpty` do not self close empty element tags
+ // 'options.dontPrettyTextNodes' if any text is present in node, don't indent or LF
+ // `options.spaceBeforeSlash` add a space before the closing slash of empty elements
+ constructor(options) {
+ super(options);
+ }
+
+ document(doc, options) {
+ var child, i, len, r, ref;
+ options = this.filterOptions(options);
+ r = '';
+ ref = doc.children;
+ for (i = 0, len = ref.length; i < len; i++) {
+ child = ref[i];
+ r += this.writeChildNode(child, options, 0);
+ }
+ // remove trailing newline
+ if (options.pretty && r.slice(-options.newline.length) === options.newline) {
+ r = r.slice(0, -options.newline.length);
+ }
+ return r;
+ }
+
+ };
+
+}).call(this);
+
+},{"./XMLWriterBase":43}],41:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ // Converts values to strings
+ var XMLStringifier,
+ hasProp = {}.hasOwnProperty;
+
+ module.exports = XMLStringifier = (function() {
+ class XMLStringifier {
+ // Initializes a new instance of `XMLStringifier`
+
+ // `options.version` The version number string of the XML spec to validate against, e.g. 1.0
+ // `options.noDoubleEncoding` whether existing html entities are encoded: true or false
+ // `options.stringify` a set of functions to use for converting values to strings
+ // `options.noValidation` whether values will be validated and escaped or returned as is
+ // `options.invalidCharReplacement` a character to replace invalid characters and disable character validation
+ constructor(options) {
+ var key, ref, value;
+ // Checks whether the given string contains legal characters
+ // Fails with an exception on error
+
+ // `str` the string to check
+ this.assertLegalChar = this.assertLegalChar.bind(this);
+ // Checks whether the given string contains legal characters for a name
+ // Fails with an exception on error
+
+ // `str` the string to check
+ this.assertLegalName = this.assertLegalName.bind(this);
+ options || (options = {});
+ this.options = options;
+ if (!this.options.version) {
+ this.options.version = '1.0';
+ }
+ ref = options.stringify || {};
+ for (key in ref) {
+ if (!hasProp.call(ref, key)) continue;
+ value = ref[key];
+ this[key] = value;
+ }
+ }
+
+ // Defaults
+ name(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ return this.assertLegalName('' + val || '');
+ }
+
+ text(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ return this.assertLegalChar(this.textEscape('' + val || ''));
+ }
+
+ cdata(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ val = '' + val || '';
+ val = val.replace(']]>', ']]]]><![CDATA[>');
+ return this.assertLegalChar(val);
+ }
+
+ comment(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ val = '' + val || '';
+ if (val.match(/--/)) {
+ throw new Error("Comment text cannot contain double-hypen: " + val);
+ }
+ return this.assertLegalChar(val);
+ }
+
+ raw(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ return '' + val || '';
+ }
+
+ attValue(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ return this.assertLegalChar(this.attEscape(val = '' + val || ''));
+ }
+
+ insTarget(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ return this.assertLegalChar('' + val || '');
+ }
+
+ insValue(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ val = '' + val || '';
+ if (val.match(/\?>/)) {
+ throw new Error("Invalid processing instruction value: " + val);
+ }
+ return this.assertLegalChar(val);
+ }
+
+ xmlVersion(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ val = '' + val || '';
+ if (!val.match(/1\.[0-9]+/)) {
+ throw new Error("Invalid version number: " + val);
+ }
+ return val;
+ }
+
+ xmlEncoding(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ val = '' + val || '';
+ if (!val.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/)) {
+ throw new Error("Invalid encoding: " + val);
+ }
+ return this.assertLegalChar(val);
+ }
+
+ xmlStandalone(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ if (val) {
+ return "yes";
+ } else {
+ return "no";
+ }
+ }
+
+ dtdPubID(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ return this.assertLegalChar('' + val || '');
+ }
+
+ dtdSysID(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ return this.assertLegalChar('' + val || '');
+ }
+
+ dtdElementValue(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ return this.assertLegalChar('' + val || '');
+ }
+
+ dtdAttType(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ return this.assertLegalChar('' + val || '');
+ }
+
+ dtdAttDefault(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ return this.assertLegalChar('' + val || '');
+ }
+
+ dtdEntityValue(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ return this.assertLegalChar('' + val || '');
+ }
+
+ dtdNData(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ return this.assertLegalChar('' + val || '');
+ }
+
+ assertLegalChar(str) {
+ var regex, res;
+ if (this.options.noValidation) {
+ return str;
+ }
+ if (this.options.version === '1.0') {
+ // Valid characters from https://www.w3.org/TR/xml/#charsets
+ // any Unicode character, excluding the surrogate blocks, FFFE, and FFFF.
+ // #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]
+ // This ES5 compatible Regexp has been generated using the "regenerate" NPM module:
+ // let xml_10_InvalidChars = regenerate()
+ // .addRange(0x0000, 0x0008)
+ // .add(0x000B, 0x000C)
+ // .addRange(0x000E, 0x001F)
+ // .addRange(0xD800, 0xDFFF)
+ // .addRange(0xFFFE, 0xFFFF)
+ regex = /[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g;
+ if (this.options.invalidCharReplacement !== void 0) {
+ str = str.replace(regex, this.options.invalidCharReplacement);
+ } else if (res = str.match(regex)) {
+ throw new Error(`Invalid character in string: ${str} at index ${res.index}`);
+ }
+ } else if (this.options.version === '1.1') {
+ // Valid characters from https://www.w3.org/TR/xml11/#charsets
+ // any Unicode character, excluding the surrogate blocks, FFFE, and FFFF.
+ // [#x1-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]
+ // This ES5 compatible Regexp has been generated using the "regenerate" NPM module:
+ // let xml_11_InvalidChars = regenerate()
+ // .add(0x0000)
+ // .addRange(0xD800, 0xDFFF)
+ // .addRange(0xFFFE, 0xFFFF)
+ regex = /[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g;
+ if (this.options.invalidCharReplacement !== void 0) {
+ str = str.replace(regex, this.options.invalidCharReplacement);
+ } else if (res = str.match(regex)) {
+ throw new Error(`Invalid character in string: ${str} at index ${res.index}`);
+ }
+ }
+ return str;
+ }
+
+ assertLegalName(str) {
+ var regex;
+ if (this.options.noValidation) {
+ return str;
+ }
+ str = this.assertLegalChar(str);
+ regex = /^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/;
+ if (!str.match(regex)) {
+ throw new Error(`Invalid character in name: ${str}`);
+ }
+ return str;
+ }
+
+ // Escapes special characters in text
+
+ // See http://www.w3.org/TR/2000/WD-xml-c14n-20000119.html#charescaping
+
+ // `str` the string to escape
+ textEscape(str) {
+ var ampregex;
+ if (this.options.noValidation) {
+ return str;
+ }
+ ampregex = this.options.noDoubleEncoding ? /(?!&(lt|gt|amp|apos|quot);)&/g : /&/g;
+ return str.replace(ampregex, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\r/g, '&#xD;');
+ }
+
+ // Escapes special characters in attribute values
+
+ // See http://www.w3.org/TR/2000/WD-xml-c14n-20000119.html#charescaping
+
+ // `str` the string to escape
+ attEscape(str) {
+ var ampregex;
+ if (this.options.noValidation) {
+ return str;
+ }
+ ampregex = this.options.noDoubleEncoding ? /(?!&(lt|gt|amp|apos|quot);)&/g : /&/g;
+ return str.replace(ampregex, '&amp;').replace(/</g, '&lt;').replace(/"/g, '&quot;').replace(/\t/g, '&#x9;').replace(/\n/g, '&#xA;').replace(/\r/g, '&#xD;');
+ }
+
+ };
+
+ // strings to match while converting from JS objects
+ XMLStringifier.prototype.convertAttKey = '@';
+
+ XMLStringifier.prototype.convertPIKey = '?';
+
+ XMLStringifier.prototype.convertTextKey = '#text';
+
+ XMLStringifier.prototype.convertCDataKey = '#cdata';
+
+ XMLStringifier.prototype.convertCommentKey = '#comment';
+
+ XMLStringifier.prototype.convertRawKey = '#raw';
+
+ return XMLStringifier;
+
+ }).call(this);
+
+}).call(this);
+
+},{}],42:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, XMLCharacterData, XMLText;
+
+ NodeType = require('./NodeType');
+
+ XMLCharacterData = require('./XMLCharacterData');
+
+ // Represents a text node
+ module.exports = XMLText = (function() {
+ class XMLText extends XMLCharacterData {
+ // Initializes a new instance of `XMLText`
+
+ // `text` element text
+ constructor(parent, text) {
+ super(parent);
+ if (text == null) {
+ throw new Error("Missing element text. " + this.debugInfo());
+ }
+ this.name = "#text";
+ this.type = NodeType.Text;
+ this.value = this.stringify.text(text);
+ }
+
+ // Creates and returns a deep clone of `this`
+ clone() {
+ return Object.create(this);
+ }
+
+ // Converts the XML fragment to string
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation for pretty print
+ // `options.offset` how many indentations to add to every line for pretty print
+ // `options.newline` newline sequence for pretty print
+ toString(options) {
+ return this.options.writer.text(this, this.options.writer.filterOptions(options));
+ }
+
+ // DOM level 1 functions to be implemented later
+ splitText(offset) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ // DOM level 3 functions to be implemented later
+ replaceWholeText(content) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ };
+
+ // DOM level 3
+ Object.defineProperty(XMLText.prototype, 'isElementContentWhitespace', {
+ get: function() {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+ });
+
+ Object.defineProperty(XMLText.prototype, 'wholeText', {
+ get: function() {
+ var next, prev, str;
+ str = '';
+ prev = this.previousSibling;
+ while (prev) {
+ str = prev.data + str;
+ prev = prev.previousSibling;
+ }
+ str += this.data;
+ next = this.nextSibling;
+ while (next) {
+ str = str + next.data;
+ next = next.nextSibling;
+ }
+ return str;
+ }
+ });
+
+ return XMLText;
+
+ }).call(this);
+
+}).call(this);
+
+},{"./NodeType":13,"./XMLCharacterData":18}],43:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, WriterState, XMLCData, XMLComment, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDeclaration, XMLDocType, XMLDummy, XMLElement, XMLProcessingInstruction, XMLRaw, XMLText, XMLWriterBase, assign,
+ hasProp = {}.hasOwnProperty;
+
+ ({assign} = require('./Utility'));
+
+ NodeType = require('./NodeType');
+
+ XMLDeclaration = require('./XMLDeclaration');
+
+ XMLDocType = require('./XMLDocType');
+
+ XMLCData = require('./XMLCData');
+
+ XMLComment = require('./XMLComment');
+
+ XMLElement = require('./XMLElement');
+
+ XMLRaw = require('./XMLRaw');
+
+ XMLText = require('./XMLText');
+
+ XMLProcessingInstruction = require('./XMLProcessingInstruction');
+
+ XMLDummy = require('./XMLDummy');
+
+ XMLDTDAttList = require('./XMLDTDAttList');
+
+ XMLDTDElement = require('./XMLDTDElement');
+
+ XMLDTDEntity = require('./XMLDTDEntity');
+
+ XMLDTDNotation = require('./XMLDTDNotation');
+
+ WriterState = require('./WriterState');
+
+ // Base class for XML writers
+ module.exports = XMLWriterBase = class XMLWriterBase {
+ // Initializes a new instance of `XMLWriterBase`
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation string
+ // `options.newline` newline sequence
+ // `options.offset` a fixed number of indentations to add to every line
+ // `options.width` maximum column width
+ // `options.allowEmpty` do not self close empty element tags
+ // 'options.dontPrettyTextNodes' if any text is present in node, don't indent or LF
+ // `options.spaceBeforeSlash` add a space before the closing slash of empty elements
+ constructor(options) {
+ var key, ref, value;
+ options || (options = {});
+ this.options = options;
+ ref = options.writer || {};
+ for (key in ref) {
+ if (!hasProp.call(ref, key)) continue;
+ value = ref[key];
+ this["_" + key] = this[key];
+ this[key] = value;
+ }
+ }
+
+ // Filters writer options and provides defaults
+
+ // `options` writer options
+ filterOptions(options) {
+ var filteredOptions, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7;
+ options || (options = {});
+ options = assign({}, this.options, options);
+ filteredOptions = {
+ writer: this
+ };
+ filteredOptions.pretty = options.pretty || false;
+ filteredOptions.allowEmpty = options.allowEmpty || false;
+ filteredOptions.indent = (ref = options.indent) != null ? ref : ' ';
+ filteredOptions.newline = (ref1 = options.newline) != null ? ref1 : '\n';
+ filteredOptions.offset = (ref2 = options.offset) != null ? ref2 : 0;
+ filteredOptions.width = (ref3 = options.width) != null ? ref3 : 0;
+ filteredOptions.dontPrettyTextNodes = (ref4 = (ref5 = options.dontPrettyTextNodes) != null ? ref5 : options.dontprettytextnodes) != null ? ref4 : 0;
+ filteredOptions.spaceBeforeSlash = (ref6 = (ref7 = options.spaceBeforeSlash) != null ? ref7 : options.spacebeforeslash) != null ? ref6 : '';
+ if (filteredOptions.spaceBeforeSlash === true) {
+ filteredOptions.spaceBeforeSlash = ' ';
+ }
+ filteredOptions.suppressPrettyCount = 0;
+ filteredOptions.user = {};
+ filteredOptions.state = WriterState.None;
+ return filteredOptions;
+ }
+
+ // Returns the indentation string for the current level
+
+ // `node` current node
+ // `options` writer options
+ // `level` current indentation level
+ indent(node, options, level) {
+ var indentLevel;
+ if (!options.pretty || options.suppressPrettyCount) {
+ return '';
+ } else if (options.pretty) {
+ indentLevel = (level || 0) + options.offset + 1;
+ if (indentLevel > 0) {
+ return new Array(indentLevel).join(options.indent);
+ }
+ }
+ return '';
+ }
+
+ // Returns the newline string
+
+ // `node` current node
+ // `options` writer options
+ // `level` current indentation level
+ endline(node, options, level) {
+ if (!options.pretty || options.suppressPrettyCount) {
+ return '';
+ } else {
+ return options.newline;
+ }
+ }
+
+ attribute(att, options, level) {
+ var r;
+ this.openAttribute(att, options, level);
+ if (options.pretty && options.width > 0) {
+ r = att.name + '="' + att.value + '"';
+ } else {
+ r = ' ' + att.name + '="' + att.value + '"';
+ }
+ this.closeAttribute(att, options, level);
+ return r;
+ }
+
+ cdata(node, options, level) {
+ var r;
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r = this.indent(node, options, level) + '<![CDATA[';
+ options.state = WriterState.InsideTag;
+ r += node.value;
+ options.state = WriterState.CloseTag;
+ r += ']]>' + this.endline(node, options, level);
+ options.state = WriterState.None;
+ this.closeNode(node, options, level);
+ return r;
+ }
+
+ comment(node, options, level) {
+ var r;
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r = this.indent(node, options, level) + '<!-- ';
+ options.state = WriterState.InsideTag;
+ r += node.value;
+ options.state = WriterState.CloseTag;
+ r += ' -->' + this.endline(node, options, level);
+ options.state = WriterState.None;
+ this.closeNode(node, options, level);
+ return r;
+ }
+
+ declaration(node, options, level) {
+ var r;
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r = this.indent(node, options, level) + '<?xml';
+ options.state = WriterState.InsideTag;
+ r += ' version="' + node.version + '"';
+ if (node.encoding != null) {
+ r += ' encoding="' + node.encoding + '"';
+ }
+ if (node.standalone != null) {
+ r += ' standalone="' + node.standalone + '"';
+ }
+ options.state = WriterState.CloseTag;
+ r += options.spaceBeforeSlash + '?>';
+ r += this.endline(node, options, level);
+ options.state = WriterState.None;
+ this.closeNode(node, options, level);
+ return r;
+ }
+
+ docType(node, options, level) {
+ var child, i, len1, r, ref;
+ level || (level = 0);
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r = this.indent(node, options, level);
+ r += '<!DOCTYPE ' + node.root().name;
+ // external identifier
+ if (node.pubID && node.sysID) {
+ r += ' PUBLIC "' + node.pubID + '" "' + node.sysID + '"';
+ } else if (node.sysID) {
+ r += ' SYSTEM "' + node.sysID + '"';
+ }
+ // internal subset
+ if (node.children.length > 0) {
+ r += ' [';
+ r += this.endline(node, options, level);
+ options.state = WriterState.InsideTag;
+ ref = node.children;
+ for (i = 0, len1 = ref.length; i < len1; i++) {
+ child = ref[i];
+ r += this.writeChildNode(child, options, level + 1);
+ }
+ options.state = WriterState.CloseTag;
+ r += ']';
+ }
+ // close tag
+ options.state = WriterState.CloseTag;
+ r += options.spaceBeforeSlash + '>';
+ r += this.endline(node, options, level);
+ options.state = WriterState.None;
+ this.closeNode(node, options, level);
+ return r;
+ }
+
+ element(node, options, level) {
+ var att, attLen, child, childNodeCount, firstChildNode, i, j, len, len1, len2, name, prettySuppressed, r, ratt, ref, ref1, ref2, ref3, rline;
+ level || (level = 0);
+ prettySuppressed = false;
+ // open tag
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r = this.indent(node, options, level) + '<' + node.name;
+ // attributes
+ if (options.pretty && options.width > 0) {
+ len = r.length;
+ ref = node.attribs;
+ for (name in ref) {
+ if (!hasProp.call(ref, name)) continue;
+ att = ref[name];
+ ratt = this.attribute(att, options, level);
+ attLen = ratt.length;
+ if (len + attLen > options.width) {
+ rline = this.indent(node, options, level + 1) + ratt;
+ r += this.endline(node, options, level) + rline;
+ len = rline.length;
+ } else {
+ rline = ' ' + ratt;
+ r += rline;
+ len += rline.length;
+ }
+ }
+ } else {
+ ref1 = node.attribs;
+ for (name in ref1) {
+ if (!hasProp.call(ref1, name)) continue;
+ att = ref1[name];
+ r += this.attribute(att, options, level);
+ }
+ }
+ childNodeCount = node.children.length;
+ firstChildNode = childNodeCount === 0 ? null : node.children[0];
+ if (childNodeCount === 0 || node.children.every(function(e) {
+ return (e.type === NodeType.Text || e.type === NodeType.Raw || e.type === NodeType.CData) && e.value === '';
+ })) {
+ // empty element
+ if (options.allowEmpty) {
+ r += '>';
+ options.state = WriterState.CloseTag;
+ r += '</' + node.name + '>' + this.endline(node, options, level);
+ } else {
+ options.state = WriterState.CloseTag;
+ r += options.spaceBeforeSlash + '/>' + this.endline(node, options, level);
+ }
+ } else if (options.pretty && childNodeCount === 1 && (firstChildNode.type === NodeType.Text || firstChildNode.type === NodeType.Raw || firstChildNode.type === NodeType.CData) && (firstChildNode.value != null)) {
+ // do not indent text-only nodes
+ r += '>';
+ options.state = WriterState.InsideTag;
+ options.suppressPrettyCount++;
+ prettySuppressed = true;
+ r += this.writeChildNode(firstChildNode, options, level + 1);
+ options.suppressPrettyCount--;
+ prettySuppressed = false;
+ options.state = WriterState.CloseTag;
+ r += '</' + node.name + '>' + this.endline(node, options, level);
+ } else {
+ // if ANY are a text node, then suppress pretty now
+ if (options.dontPrettyTextNodes) {
+ ref2 = node.children;
+ for (i = 0, len1 = ref2.length; i < len1; i++) {
+ child = ref2[i];
+ if ((child.type === NodeType.Text || child.type === NodeType.Raw || child.type === NodeType.CData) && (child.value != null)) {
+ options.suppressPrettyCount++;
+ prettySuppressed = true;
+ break;
+ }
+ }
+ }
+ // close the opening tag, after dealing with newline
+ r += '>' + this.endline(node, options, level);
+ options.state = WriterState.InsideTag;
+ ref3 = node.children;
+ // inner tags
+ for (j = 0, len2 = ref3.length; j < len2; j++) {
+ child = ref3[j];
+ r += this.writeChildNode(child, options, level + 1);
+ }
+ // close tag
+ options.state = WriterState.CloseTag;
+ r += this.indent(node, options, level) + '</' + node.name + '>';
+ if (prettySuppressed) {
+ options.suppressPrettyCount--;
+ }
+ r += this.endline(node, options, level);
+ options.state = WriterState.None;
+ }
+ this.closeNode(node, options, level);
+ return r;
+ }
+
+ writeChildNode(node, options, level) {
+ switch (node.type) {
+ case NodeType.CData:
+ return this.cdata(node, options, level);
+ case NodeType.Comment:
+ return this.comment(node, options, level);
+ case NodeType.Element:
+ return this.element(node, options, level);
+ case NodeType.Raw:
+ return this.raw(node, options, level);
+ case NodeType.Text:
+ return this.text(node, options, level);
+ case NodeType.ProcessingInstruction:
+ return this.processingInstruction(node, options, level);
+ case NodeType.Dummy:
+ return '';
+ case NodeType.Declaration:
+ return this.declaration(node, options, level);
+ case NodeType.DocType:
+ return this.docType(node, options, level);
+ case NodeType.AttributeDeclaration:
+ return this.dtdAttList(node, options, level);
+ case NodeType.ElementDeclaration:
+ return this.dtdElement(node, options, level);
+ case NodeType.EntityDeclaration:
+ return this.dtdEntity(node, options, level);
+ case NodeType.NotationDeclaration:
+ return this.dtdNotation(node, options, level);
+ default:
+ throw new Error("Unknown XML node type: " + node.constructor.name);
+ }
+ }
+
+ processingInstruction(node, options, level) {
+ var r;
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r = this.indent(node, options, level) + '<?';
+ options.state = WriterState.InsideTag;
+ r += node.target;
+ if (node.value) {
+ r += ' ' + node.value;
+ }
+ options.state = WriterState.CloseTag;
+ r += options.spaceBeforeSlash + '?>';
+ r += this.endline(node, options, level);
+ options.state = WriterState.None;
+ this.closeNode(node, options, level);
+ return r;
+ }
+
+ raw(node, options, level) {
+ var r;
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r = this.indent(node, options, level);
+ options.state = WriterState.InsideTag;
+ r += node.value;
+ options.state = WriterState.CloseTag;
+ r += this.endline(node, options, level);
+ options.state = WriterState.None;
+ this.closeNode(node, options, level);
+ return r;
+ }
+
+ text(node, options, level) {
+ var r;
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r = this.indent(node, options, level);
+ options.state = WriterState.InsideTag;
+ r += node.value;
+ options.state = WriterState.CloseTag;
+ r += this.endline(node, options, level);
+ options.state = WriterState.None;
+ this.closeNode(node, options, level);
+ return r;
+ }
+
+ dtdAttList(node, options, level) {
+ var r;
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r = this.indent(node, options, level) + '<!ATTLIST';
+ options.state = WriterState.InsideTag;
+ r += ' ' + node.elementName + ' ' + node.attributeName + ' ' + node.attributeType;
+ if (node.defaultValueType !== '#DEFAULT') {
+ r += ' ' + node.defaultValueType;
+ }
+ if (node.defaultValue) {
+ r += ' "' + node.defaultValue + '"';
+ }
+ options.state = WriterState.CloseTag;
+ r += options.spaceBeforeSlash + '>' + this.endline(node, options, level);
+ options.state = WriterState.None;
+ this.closeNode(node, options, level);
+ return r;
+ }
+
+ dtdElement(node, options, level) {
+ var r;
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r = this.indent(node, options, level) + '<!ELEMENT';
+ options.state = WriterState.InsideTag;
+ r += ' ' + node.name + ' ' + node.value;
+ options.state = WriterState.CloseTag;
+ r += options.spaceBeforeSlash + '>' + this.endline(node, options, level);
+ options.state = WriterState.None;
+ this.closeNode(node, options, level);
+ return r;
+ }
+
+ dtdEntity(node, options, level) {
+ var r;
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r = this.indent(node, options, level) + '<!ENTITY';
+ options.state = WriterState.InsideTag;
+ if (node.pe) {
+ r += ' %';
+ }
+ r += ' ' + node.name;
+ if (node.value) {
+ r += ' "' + node.value + '"';
+ } else {
+ if (node.pubID && node.sysID) {
+ r += ' PUBLIC "' + node.pubID + '" "' + node.sysID + '"';
+ } else if (node.sysID) {
+ r += ' SYSTEM "' + node.sysID + '"';
+ }
+ if (node.nData) {
+ r += ' NDATA ' + node.nData;
+ }
+ }
+ options.state = WriterState.CloseTag;
+ r += options.spaceBeforeSlash + '>' + this.endline(node, options, level);
+ options.state = WriterState.None;
+ this.closeNode(node, options, level);
+ return r;
+ }
+
+ dtdNotation(node, options, level) {
+ var r;
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r = this.indent(node, options, level) + '<!NOTATION';
+ options.state = WriterState.InsideTag;
+ r += ' ' + node.name;
+ if (node.pubID && node.sysID) {
+ r += ' PUBLIC "' + node.pubID + '" "' + node.sysID + '"';
+ } else if (node.pubID) {
+ r += ' PUBLIC "' + node.pubID + '"';
+ } else if (node.sysID) {
+ r += ' SYSTEM "' + node.sysID + '"';
+ }
+ options.state = WriterState.CloseTag;
+ r += options.spaceBeforeSlash + '>' + this.endline(node, options, level);
+ options.state = WriterState.None;
+ this.closeNode(node, options, level);
+ return r;
+ }
+
+ openNode(node, options, level) {}
+
+ closeNode(node, options, level) {}
+
+ openAttribute(att, options, level) {}
+
+ closeAttribute(att, options, level) {}
+
+ };
+
+}).call(this);
+
+},{"./NodeType":13,"./Utility":14,"./WriterState":15,"./XMLCData":17,"./XMLComment":19,"./XMLDTDAttList":24,"./XMLDTDElement":25,"./XMLDTDEntity":26,"./XMLDTDNotation":27,"./XMLDeclaration":28,"./XMLDocType":29,"./XMLDummy":32,"./XMLElement":33,"./XMLProcessingInstruction":37,"./XMLRaw":38,"./XMLText":42}],44:[function(require,module,exports){
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, WriterState, XMLDOMImplementation, XMLDocument, XMLDocumentCB, XMLStreamWriter, XMLStringWriter, assign, isFunction;
+
+ ({assign, isFunction} = require('./Utility'));
+
+ XMLDOMImplementation = require('./XMLDOMImplementation');
+
+ XMLDocument = require('./XMLDocument');
+
+ XMLDocumentCB = require('./XMLDocumentCB');
+
+ XMLStringWriter = require('./XMLStringWriter');
+
+ XMLStreamWriter = require('./XMLStreamWriter');
+
+ NodeType = require('./NodeType');
+
+ WriterState = require('./WriterState');
+
+ // Creates a new document and returns the root node for
+ // chain-building the document tree
+
+ // `name` name of the root element
+
+ // `xmldec.version` A version number string, e.g. 1.0
+ // `xmldec.encoding` Encoding declaration, e.g. UTF-8
+ // `xmldec.standalone` standalone document declaration: true or false
+
+ // `doctype.pubID` public identifier of the external subset
+ // `doctype.sysID` system identifier of the external subset
+
+ // `options.headless` whether XML declaration and doctype will be included:
+ // true or false
+ // `options.keepNullNodes` whether nodes with null values will be kept
+ // or ignored: true or false
+ // `options.keepNullAttributes` whether attributes with null values will be
+ // kept or ignored: true or false
+ // `options.ignoreDecorators` whether decorator strings will be ignored when
+ // converting JS objects: true or false
+ // `options.separateArrayItems` whether array items are created as separate
+ // nodes when passed as an object value: true or false
+ // `options.noDoubleEncoding` whether existing html entities are encoded:
+ // true or false
+ // `options.stringify` a set of functions to use for converting values to
+ // strings
+ // `options.writer` the default XML writer to use for converting nodes to
+ // string. If the default writer is not set, the built-in XMLStringWriter
+ // will be used instead.
+ module.exports.create = function(name, xmldec, doctype, options) {
+ var doc, root;
+ if (name == null) {
+ throw new Error("Root element needs a name.");
+ }
+ options = assign({}, xmldec, doctype, options);
+ // create the document node
+ doc = new XMLDocument(options);
+ // add the root node
+ root = doc.element(name);
+ // prolog
+ if (!options.headless) {
+ doc.declaration(options);
+ if ((options.pubID != null) || (options.sysID != null)) {
+ doc.dtd(options);
+ }
+ }
+ return root;
+ };
+
+ // Creates a new document and returns the document node for
+ // chain-building the document tree
+
+ // `options.keepNullNodes` whether nodes with null values will be kept
+ // or ignored: true or false
+ // `options.keepNullAttributes` whether attributes with null values will be
+ // kept or ignored: true or false
+ // `options.ignoreDecorators` whether decorator strings will be ignored when
+ // converting JS objects: true or false
+ // `options.separateArrayItems` whether array items are created as separate
+ // nodes when passed as an object value: true or false
+ // `options.noDoubleEncoding` whether existing html entities are encoded:
+ // true or false
+ // `options.stringify` a set of functions to use for converting values to
+ // strings
+ // `options.writer` the default XML writer to use for converting nodes to
+ // string. If the default writer is not set, the built-in XMLStringWriter
+ // will be used instead.
+
+ // `onData` the function to be called when a new chunk of XML is output. The
+ // string containing the XML chunk is passed to `onData` as its single
+ // argument.
+ // `onEnd` the function to be called when the XML document is completed with
+ // `end`. `onEnd` does not receive any arguments.
+ module.exports.begin = function(options, onData, onEnd) {
+ if (isFunction(options)) {
+ [onData, onEnd] = [options, onData];
+ options = {};
+ }
+ if (onData) {
+ return new XMLDocumentCB(options, onData, onEnd);
+ } else {
+ return new XMLDocument(options);
+ }
+ };
+
+ module.exports.stringWriter = function(options) {
+ return new XMLStringWriter(options);
+ };
+
+ module.exports.streamWriter = function(stream, options) {
+ return new XMLStreamWriter(stream, options);
+ };
+
+ module.exports.implementation = new XMLDOMImplementation();
+
+ module.exports.nodeType = NodeType;
+
+ module.exports.writerState = WriterState;
+
+}).call(this);
+
+},{"./NodeType":13,"./Utility":14,"./WriterState":15,"./XMLDOMImplementation":22,"./XMLDocument":30,"./XMLDocumentCB":31,"./XMLStreamWriter":39,"./XMLStringWriter":40}]},{},[1])(1)
+});
diff --git a/generator/node_modules/plist/examples/browser/index.html b/generator/node_modules/plist/examples/browser/index.html
new file mode 100644
index 0000000..8ce7d92
--- /dev/null
+++ b/generator/node_modules/plist/examples/browser/index.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>plist.js browser example</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ </head>
+ <body>
+ <script src="../../dist/plist.js"></script>
+ <script>
+ // TODO: add <input type=file> drag and drop example
+ console.log(plist);
+ </script>
+ </body>
+</html>
diff --git a/generator/node_modules/plist/index.js b/generator/node_modules/plist/index.js
new file mode 100644
index 0000000..d7385ae
--- /dev/null
+++ b/generator/node_modules/plist/index.js
@@ -0,0 +1,13 @@
+/**
+ * Parser functions.
+ */
+
+var parserFunctions = require('./lib/parse');
+Object.keys(parserFunctions).forEach(function (k) { exports[k] = parserFunctions[k]; });
+
+/**
+ * Builder functions.
+ */
+
+var builderFunctions = require('./lib/build');
+Object.keys(builderFunctions).forEach(function (k) { exports[k] = builderFunctions[k]; });
diff --git a/generator/node_modules/plist/lib/build.js b/generator/node_modules/plist/lib/build.js
new file mode 100644
index 0000000..c2a84b1
--- /dev/null
+++ b/generator/node_modules/plist/lib/build.js
@@ -0,0 +1,143 @@
+/**
+ * Module dependencies.
+ */
+
+var base64 = require('base64-js');
+var xmlbuilder = require('xmlbuilder');
+
+/**
+ * Module exports.
+ */
+
+exports.build = build;
+
+/**
+ * Accepts a `Date` instance and returns an ISO date string.
+ *
+ * @param {Date} d - Date instance to serialize
+ * @returns {String} ISO date string representation of `d`
+ * @api private
+ */
+
+function ISODateString(d){
+ function pad(n){
+ return n < 10 ? '0' + n : n;
+ }
+ return d.getUTCFullYear()+'-'
+ + pad(d.getUTCMonth()+1)+'-'
+ + pad(d.getUTCDate())+'T'
+ + pad(d.getUTCHours())+':'
+ + pad(d.getUTCMinutes())+':'
+ + pad(d.getUTCSeconds())+'Z';
+}
+
+/**
+ * Returns the internal "type" of `obj` via the
+ * `Object.prototype.toString()` trick.
+ *
+ * @param {Mixed} obj - any value
+ * @returns {String} the internal "type" name
+ * @api private
+ */
+
+var toString = Object.prototype.toString;
+function type (obj) {
+ var m = toString.call(obj).match(/\[object (.*)\]/);
+ return m ? m[1] : m;
+}
+
+/**
+ * Generate an XML plist string from the input object `obj`.
+ *
+ * @param {Object} obj - the object to convert
+ * @param {Object} [opts] - optional options object
+ * @returns {String} converted plist XML string
+ * @api public
+ */
+
+function build (obj, opts) {
+ var XMLHDR = {
+ version: '1.0',
+ encoding: 'UTF-8'
+ };
+
+ var XMLDTD = {
+ pubid: '-//Apple//DTD PLIST 1.0//EN',
+ sysid: 'http://www.apple.com/DTDs/PropertyList-1.0.dtd'
+ };
+
+ var doc = xmlbuilder.create('plist');
+
+ doc.dec(XMLHDR.version, XMLHDR.encoding, XMLHDR.standalone);
+ doc.dtd(XMLDTD.pubid, XMLDTD.sysid);
+ doc.att('version', '1.0');
+
+ walk_obj(obj, doc);
+
+ if (!opts) opts = {};
+ // default `pretty` to `true`
+ opts.pretty = opts.pretty !== false;
+ return doc.end(opts);
+}
+
+/**
+ * depth first, recursive traversal of a javascript object. when complete,
+ * next_child contains a reference to the build XML object.
+ *
+ * @api private
+ */
+
+function walk_obj(next, next_child) {
+ var tag_type, i, prop;
+ var name = type(next);
+
+ if ('Undefined' == name) {
+ return;
+ } else if (Array.isArray(next)) {
+ next_child = next_child.ele('array');
+ for (i = 0; i < next.length; i++) {
+ walk_obj(next[i], next_child);
+ }
+
+ } else if (Buffer.isBuffer(next)) {
+ next_child.ele('data').raw(next.toString('base64'));
+
+ } else if ('Object' == name) {
+ next_child = next_child.ele('dict');
+ for (prop in next) {
+ if (next.hasOwnProperty(prop)) {
+ next_child.ele('key').txt(prop);
+ walk_obj(next[prop], next_child);
+ }
+ }
+
+ } else if ('Number' == name) {
+ // detect if this is an integer or real
+ // TODO: add an ability to force one way or another via a "cast"
+ tag_type = (next % 1 === 0) ? 'integer' : 'real';
+ next_child.ele(tag_type).txt(next.toString());
+
+ } else if ('BigInt' == name) {
+ next_child.ele('integer').txt(next);
+
+ } else if ('Date' == name) {
+ next_child.ele('date').txt(ISODateString(new Date(next)));
+
+ } else if ('Boolean' == name) {
+ next_child.ele(next ? 'true' : 'false');
+
+ } else if ('String' == name) {
+ next_child.ele('string').txt(next);
+
+ } else if ('ArrayBuffer' == name) {
+ next_child.ele('data').raw(base64.fromByteArray(next));
+
+ } else if (next && next.buffer && 'ArrayBuffer' == type(next.buffer)) {
+ // a typed array
+ next_child.ele('data').raw(base64.fromByteArray(new Uint8Array(next.buffer), next_child));
+
+ } else if ('Null' === name) {
+ next_child.ele('null').txt('');
+
+ }
+}
diff --git a/generator/node_modules/plist/lib/parse.js b/generator/node_modules/plist/lib/parse.js
new file mode 100644
index 0000000..b5e7496
--- /dev/null
+++ b/generator/node_modules/plist/lib/parse.js
@@ -0,0 +1,227 @@
+/**
+ * Module dependencies.
+ */
+
+const { DOMParser } = require('@xmldom/xmldom');
+
+/**
+ * Module exports.
+ */
+
+exports.parse = parse;
+
+var TEXT_NODE = 3;
+var CDATA_NODE = 4;
+var COMMENT_NODE = 8;
+
+
+/**
+ * We ignore raw text (usually whitespace), <!-- xml comments -->,
+ * and raw CDATA nodes.
+ *
+ * @param {Element} node
+ * @returns {Boolean}
+ * @api private
+ */
+
+function shouldIgnoreNode (node) {
+ return node.nodeType === TEXT_NODE
+ || node.nodeType === COMMENT_NODE
+ || node.nodeType === CDATA_NODE;
+}
+
+/**
+ * Check if the node is empty. Some plist file has such node:
+ * <key />
+ * this node shoud be ignored.
+ *
+ * @see https://github.com/TooTallNate/plist.js/issues/66
+ * @param {Element} node
+ * @returns {Boolean}
+ * @api private
+ */
+function isEmptyNode(node){
+ if(!node.childNodes || node.childNodes.length === 0) {
+ return true;
+ } else {
+ return false;
+ }
+}
+
+function invariant(test, message) {
+ if (!test) {
+ throw new Error(message);
+ }
+}
+
+/**
+ * Parses a Plist XML string. Returns an Object.
+ *
+ * @param {String} xml - the XML String to decode
+ * @returns {Mixed} the decoded value from the Plist XML
+ * @api public
+ */
+
+function parse (xml) {
+ var doc = new DOMParser().parseFromString(xml);
+ invariant(
+ doc.documentElement.nodeName === 'plist',
+ 'malformed document. First element should be <plist>'
+ );
+ var plist = parsePlistXML(doc.documentElement);
+
+ // the root <plist> node gets interpreted as an Array,
+ // so pull out the inner data first
+ if (plist.length == 1) plist = plist[0];
+
+ return plist;
+}
+
+/**
+ * Convert an XML based plist document into a JSON representation.
+ *
+ * @param {Object} xml_node - current XML node in the plist
+ * @returns {Mixed} built up JSON object
+ * @api private
+ */
+
+function parsePlistXML (node) {
+ var i, new_obj, key, val, new_arr, res, counter, type;
+
+ if (!node)
+ return null;
+
+ if (node.nodeName === 'plist') {
+ new_arr = [];
+ if (isEmptyNode(node)) {
+ return new_arr;
+ }
+ for (i=0; i < node.childNodes.length; i++) {
+ if (!shouldIgnoreNode(node.childNodes[i])) {
+ new_arr.push( parsePlistXML(node.childNodes[i]));
+ }
+ }
+ return new_arr;
+ } else if (node.nodeName === 'dict') {
+ new_obj = {};
+ key = null;
+ counter = 0;
+ if (isEmptyNode(node)) {
+ return new_obj;
+ }
+ for (i=0; i < node.childNodes.length; i++) {
+ if (shouldIgnoreNode(node.childNodes[i])) continue;
+ if (counter % 2 === 0) {
+ invariant(
+ node.childNodes[i].nodeName === 'key',
+ 'Missing key while parsing <dict/>.'
+ );
+ key = parsePlistXML(node.childNodes[i]);
+ } else {
+ invariant(
+ node.childNodes[i].nodeName !== 'key',
+ 'Unexpected key "'
+ + parsePlistXML(node.childNodes[i])
+ + '" while parsing <dict/>.'
+ );
+ new_obj[key] = parsePlistXML(node.childNodes[i]);
+ }
+ counter += 1;
+ }
+ if (counter % 2 === 1) {
+ new_obj[key] = '';
+ }
+
+ return new_obj;
+
+ } else if (node.nodeName === 'array') {
+ new_arr = [];
+ if (isEmptyNode(node)) {
+ return new_arr;
+ }
+ for (i=0; i < node.childNodes.length; i++) {
+ if (!shouldIgnoreNode(node.childNodes[i])) {
+ res = parsePlistXML(node.childNodes[i]);
+ if (null != res) new_arr.push(res);
+ }
+ }
+ return new_arr;
+
+ } else if (node.nodeName === '#text') {
+ // TODO: what should we do with text types? (CDATA sections)
+
+ } else if (node.nodeName === 'key') {
+ if (isEmptyNode(node)) {
+ return '';
+ }
+
+ invariant(
+ node.childNodes[0].nodeValue !== '__proto__',
+ '__proto__ keys can lead to prototype pollution. More details on CVE-2022-22912'
+ );
+
+ return node.childNodes[0].nodeValue;
+ } else if (node.nodeName === 'string') {
+ res = '';
+ if (isEmptyNode(node)) {
+ return res;
+ }
+ for (i=0; i < node.childNodes.length; i++) {
+ var type = node.childNodes[i].nodeType;
+ if (type === TEXT_NODE || type === CDATA_NODE) {
+ res += node.childNodes[i].nodeValue;
+ }
+ }
+ return res;
+
+ } else if (node.nodeName === 'integer') {
+ invariant(
+ !isEmptyNode(node),
+ 'Cannot parse "" as integer.'
+ );
+ return parseInt(node.childNodes[0].nodeValue, 10);
+
+ } else if (node.nodeName === 'real') {
+ invariant(
+ !isEmptyNode(node),
+ 'Cannot parse "" as real.'
+ );
+ res = '';
+ for (i=0; i < node.childNodes.length; i++) {
+ if (node.childNodes[i].nodeType === TEXT_NODE) {
+ res += node.childNodes[i].nodeValue;
+ }
+ }
+ return parseFloat(res);
+
+ } else if (node.nodeName === 'data') {
+ res = '';
+ if (isEmptyNode(node)) {
+ return Buffer.from(res, 'base64');
+ }
+ for (i=0; i < node.childNodes.length; i++) {
+ if (node.childNodes[i].nodeType === TEXT_NODE) {
+ res += node.childNodes[i].nodeValue.replace(/\s+/g, '');
+ }
+ }
+ return Buffer.from(res, 'base64');
+
+ } else if (node.nodeName === 'date') {
+ invariant(
+ !isEmptyNode(node),
+ 'Cannot parse "" as Date.'
+ )
+ return new Date(node.childNodes[0].nodeValue);
+
+ } else if (node.nodeName === 'null') {
+ return null;
+
+ } else if (node.nodeName === 'true') {
+ return true;
+
+ } else if (node.nodeName === 'false') {
+ return false;
+ } else {
+ throw new Error('Invalid PLIST tag ' + node.nodeName);
+ }
+}
diff --git a/generator/node_modules/plist/package.json b/generator/node_modules/plist/package.json
new file mode 100644
index 0000000..ec86a62
--- /dev/null
+++ b/generator/node_modules/plist/package.json
@@ -0,0 +1,44 @@
+{
+ "name": "plist",
+ "description": "Apple's property list parser/builder for Node.js and browsers",
+ "version": "3.1.0",
+ "author": "Nathan Rajlich <nathan@tootallnate.net>",
+ "contributors": [
+ "Hans Huebner <hans.huebner@gmail.com>",
+ "Pierre Metrailler",
+ "Mike Reinstein <reinstein.mike@gmail.com>",
+ "Vladimir Tsvang",
+ "Mathieu D'Amours"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/TooTallNate/node-plist.git"
+ },
+ "license": "MIT",
+ "keywords": [
+ "apple",
+ "browser",
+ "mac",
+ "plist",
+ "parser",
+ "xml"
+ ],
+ "main": "index.js",
+ "dependencies": {
+ "@xmldom/xmldom": "^0.8.8",
+ "base64-js": "^1.5.1",
+ "xmlbuilder": "^15.1.1"
+ },
+ "devDependencies": {
+ "browserify": "^17.0.0",
+ "mocha": "^9.2.2",
+ "multiline": "^2.0.0",
+ "zuul": "3.12.0"
+ },
+ "scripts": {
+ "test": "make test"
+ },
+ "engines": {
+ "node": ">=10.4.0"
+ }
+}
diff --git a/generator/node_modules/xmlbuilder/.nycrc b/generator/node_modules/xmlbuilder/.nycrc
new file mode 100644
index 0000000..a21df9b
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/.nycrc
@@ -0,0 +1,6 @@
+{
+ "reporter": ["lcov", "text"],
+ "extension": [".coffee"],
+ "sourceMap": false,
+ "instrument": false
+} \ No newline at end of file
diff --git a/generator/node_modules/xmlbuilder/.vscode/launch.json b/generator/node_modules/xmlbuilder/.vscode/launch.json
new file mode 100644
index 0000000..45a0637
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/.vscode/launch.json
@@ -0,0 +1,23 @@
+{
+ // Use IntelliSense to learn about possible attributes.
+ // Hover to view descriptions of existing attributes.
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
+ "version": "0.2.0",
+ "configurations": [
+ {
+ "type": "node",
+ "request": "launch",
+ "name": "Debug Coffee",
+ "skipFiles": [
+ "<node_internals>/**"
+ ],
+ "program": "${workspaceFolder}/node_modules/mocha/bin/mocha",
+ "args": [
+ "\"test/**/*.coffee\""
+ ],
+ "outFiles": [
+ "${workspaceFolder}/**/*.js"
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/generator/node_modules/xmlbuilder/CHANGELOG.md b/generator/node_modules/xmlbuilder/CHANGELOG.md
new file mode 100644
index 0000000..77974ed
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/CHANGELOG.md
@@ -0,0 +1,593 @@
+# Change Log
+
+All notable changes to this project are documented in this file. This project adheres to [Semantic Versioning](http://semver.org/#semantic-versioning-200).
+
+## [15.1.1] - 2020-04-09
+
+- Fixed a bug where the `noDoubleEncoding` flag kept named entities other than [those specified in the spec](https://www.w3.org/TR/xml/#sec-predefined-ent) (see [#16](https://github.com/oozcitak/xmlbuilder2/issues/16) in `xmlbuilder2`).
+
+## [15.1.0] - 2020-03-20
+
+- Added the `invalidCharReplacement` option to replace invalid characters with a user supplied replacement character. See [#147](https://github.com/oozcitak/xmlbuilder-js/issues/147).
+
+## [15.0.1] - 2020-03-10
+
+- Pretty printing now keeps single CDATA nodes in-line with their parent elements also with the stream writer.
+
+## [15.0.0] - 2020-03-10
+
+- Pretty printing now keeps single CDATA nodes in-line with their parent elements. See [#224](https://github.com/oozcitak/xmlbuilder-js/issues/224).
+
+## [14.0.0] - 2020-02-14
+
+- Removed support for node.js 6.0\. Minimum required version is now 8.0.
+
+## [13.0.2] - 2019-05-22
+
+- Fixed a bug where importing a document into an empty parent document did not set the root node. See [#213](https://github.com/oozcitak/xmlbuilder-js/issues/213).
+
+## [13.0.1] - 2019-05-10
+
+- Corrected typings for doctype and character data nodes. See [#211](https://github.com/oozcitak/xmlbuilder-js/issues/211).
+
+## [13.0.0] - 2019-05-07
+
+- Rewrote all TypeSript typings to be strictly compatible with the API. This is a breaking change for TypeScript users only.
+
+## [12.0.1] - 2019-04-30
+
+- Added option for pretty printing attributes.
+
+## [12.0.0] - 2019-04-03
+
+- Removed support for node.js 4.0 and 5.0\. Minimum required version is now 6.0.
+
+## [11.0.1] - 2019-03-22
+
+- Added TypeScript typings. See [#200](https://github.com/oozcitak/xmlbuilder-js/issues/200).
+
+## [11.0.0] - 2019-02-18
+
+- Calling `end()` with arguments no longer overwrites writer options. See [#120](https://github.com/oozcitak/xmlbuilder-js/issues/120).
+- Added writer state and customizable space and endline functions to help customize writer behavior. Also added `openNode` and `closeNode` functions to writer. See [#193](https://github.com/oozcitak/xmlbuilder-js/issues/193).
+- Fixed a bug where writer functions would not be called for nodes with a single child node in pretty print mode. See [#195](https://github.com/oozcitak/xmlbuilder-js/issues/195).
+- Renamed `elEscape` to `textEscape` in `XMLStringifier`.
+- Fixed a bug where empty arrays would produce child nodes. See [#190](https://github.com/oozcitak/xmlbuilder-js/issues/190).
+- Removed the `skipNullAttributes` option. `null` attributes are now skipped by default. Added the `keepNullAttributes` option in case someone needs the old behavior.
+- Removed the `skipNullNodes` option. `null` nodes are now skipped by default. Added the `keepNullNodes` option in case someone needs the old behavior.
+- `undefined` values are now skipped when converting JS objects.
+- Renamed stringify functions. See [#194](https://github.com/oozcitak/xmlbuilder-js/issues/194):
+
+ - `eleName` -> `name`
+ - `attName` -> `name`
+ - `eleText` -> `text`
+
+- Fixed argument order for `attribute` function in the writer. See [#196](https://github.com/oozcitak/xmlbuilder-js/issues/196).
+- Added `openAttribute` and `closeAttribute` functions to writer. See [#196](https://github.com/oozcitak/xmlbuilder-js/issues/196).
+- Added node types to node objects. Node types and writer states are exported by the module with the `nodeType` and `writerState` properties.
+- Fixed a bug where array items would not be correctly converted. See [#159](https://github.com/oozcitak/xmlbuilder-js/issues/159).
+- Fixed a bug where mixed-content inside JS objects with `#text` decorator would not be correctly converted. See [#171](https://github.com/oozcitak/xmlbuilder-js/issues/171).
+- Fixed a bug where JS objects would not be expanded in callback mode. See [#173](https://github.com/oozcitak/xmlbuilder-js/issues/173).
+- Fixed a bug where character validation would not obey document's XML version. Added separate validation for XML 1.0 and XML 1.1 documents. See [#169](https://github.com/oozcitak/xmlbuilder-js/issues/169).
+- Fixed a bug where names would not be validated according to the spec. See [#49](https://github.com/oozcitak/xmlbuilder-js/issues/49).
+- Renamed `text` property to `value` in comment and cdata nodes to unify the API.
+- Removed `doctype` function to prevent name clash with DOM implementation. Use the `dtd` function instead.
+- Removed dummy nodes from the XML tree (Those were created while chain-building the tree).
+- Renamed `attributes`property to `attribs` to prevent name clash with DOM property with the same name.
+- Implemented the DOM standard (read-only) to support XPath lookups. XML namespaces are not currently supported. See [#122](https://github.com/oozcitak/xmlbuilder-js/issues/122).
+
+## [10.1.1] - 2018-10-24
+
+- Fixed an edge case where a null node at root level would be printed although `skipNullNodes` was set. See [#187](https://github.com/oozcitak/xmlbuilder-js/issues/187).
+
+## [10.1.0] - 2018-10-10
+
+- Added the `skipNullNodes` option to skip nodes with null values. See [#158](https://github.com/oozcitak/xmlbuilder-js/issues/158).
+
+## [10.0.0] - 2018-04-26
+
+- Added current indentation level as a parameter to the onData function when in callback mode. See [#125](https://github.com/oozcitak/xmlbuilder-js/issues/125).
+- Added name of the current node and parent node to error messages where possible. See [#152](https://github.com/oozcitak/xmlbuilder-js/issues/152). This has the potential to break code depending on the content of error messages.
+- Fixed an issue where objects created with Object.create(null) created an error. See [#176](https://github.com/oozcitak/xmlbuilder-js/issues/176).
+- Added test builds for node.js v8 and v10.
+
+## [9.0.7] - 2018-02-09
+
+- Simplified regex used for validating encoding.
+
+## [9.0.4] - 2017-08-16
+
+- `spacebeforeslash` writer option accepts `true` as well as space char(s).
+
+## [9.0.3] - 2017-08-15
+
+- `spacebeforeslash` writer option can now be used with XML fragments.
+
+## [9.0.2] - 2017-08-15
+
+- Added the `spacebeforeslash` writer option to add a space character before closing tags of empty elements. See [#157](https://github.com/oozcitak/xmlbuilder-js/issues/157).
+
+## [9.0.1] - 2017-06-19
+
+- Fixed character validity checks to work with node.js 4.0 and 5.0\. See [#161](https://github.com/oozcitak/xmlbuilder-js/issues/161).
+
+## [9.0.0] - 2017-05-05
+
+- Removed case conversion options.
+- Removed support for node.js 4.0 and 5.0\. Minimum required version is now 6.0.
+- Fixed valid char filter to use XML 1.1 instead of 1.0\. See [#147](https://github.com/oozcitak/xmlbuilder-js/issues/147).
+- Added options for negative indentation and suppressing pretty printing of text nodes. See [#145](https://github.com/oozcitak/xmlbuilder-js/issues/145).
+
+## [8.2.2] - 2016-04-08
+
+- Falsy values can now be used as a text node in callback mode.
+
+## [8.2.1] - 2016-04-07
+
+- Falsy values can now be used as a text node. See [#117](https://github.com/oozcitak/xmlbuilder-js/issues/117).
+
+## [8.2.0] - 2016-04-01
+
+- Removed lodash dependency to keep the library small and simple. See [#114](https://github.com/oozcitak/xmlbuilder-js/issues/114), [#53](https://github.com/oozcitak/xmlbuilder-js/issues/53), and [#43](https://github.com/oozcitak/xmlbuilder-js/issues/43).
+- Added title case to name conversion options.
+
+## [8.1.0] - 2016-03-29
+
+- Added the callback option to the `begin` export function. When used with a callback function, the XML document will be generated in chunks and each chunk will be passed to the supplied function. In this mode, `begin` uses a different code path and the builder should use much less memory since the entire XML tree is not kept. There are a few drawbacks though. For example, traversing the document tree or adding attributes to a node after it is written is not possible. It is also not possible to remove nodes or attributes.
+
+```javascript
+var result = '';
+
+builder.begin(function(chunk) { result += chunk; })
+ .dec()
+ .ele('root')
+ .ele('xmlbuilder').up()
+ .end();
+```
+
+- Replaced native `Object.assign` with `lodash.assign` to support old JS engines. See [#111](https://github.com/oozcitak/xmlbuilder-js/issues/111).
+
+## [8.0.0] - 2016-03-25
+
+- Added the `begin` export function. See the wiki for details.
+- Added the ability to add comments and processing instructions before and after the root element. Added `commentBefore`, `commentAfter`, `instructionBefore` and `instructionAfter` functions for this purpose.
+- Dropped support for old node.js releases. Minimum required node.js version is now 4.0.
+
+## [7.0.0] - 2016-03-21
+
+- Processing instructions are now created as regular nodes. This is a major breaking change if you are using processing instructions. Previously processing instructions were inserted before their parent node. After this change processing instructions are appended to the children of the parent node. Note that it is not currently possible to insert processing instructions before or after the root element.
+
+ ```javascript
+ root.ele('node').ins('pi');
+ // pre-v7
+ <?pi?><node/>
+ // v7
+ <node><?pi?></node>
+ ```
+
+## [6.0.0] - 2016-03-20
+
+- Added custom XML writers. The default string conversion functions are now collected under the `XMLStringWriter` class which can be accessed by the `stringWriter(options)` function exported by the module. An `XMLStreamWriter` is also added which outputs the XML document to a writable stream. A stream writer can be created by calling the `streamWriter(stream, options)` function exported by the module. Both classes are heavily customizable and the details are added to the wiki. It is also possible to write an XML writer from scratch and use it when calling `end()` on the XML document.
+
+## [5.0.1] - 2016-03-08
+
+- Moved require statements for text case conversion to the top of files to reduce lazy requires.
+
+## [5.0.0] - 2016-03-05
+
+- Added text case option for element names and attribute names. Valid cases are `lower`, `upper`, `camel`, `kebab` and `snake`.
+- Attribute and element values are escaped according to the [Canonical XML 1.0 specification](http://www.w3.org/TR/2000/WD-xml-c14n-20000119.html#charescaping). See [#54](https://github.com/oozcitak/xmlbuilder-js/issues/54) and [#86](https://github.com/oozcitak/xmlbuilder-js/issues/86).
+- Added the `allowEmpty` option to `end()`. When this option is set, empty elements are not self-closed.
+- Added support for [nested CDATA](https://en.wikipedia.org/wiki/CDATA#Nesting). The triad `]]>` in CDATA is now automatically replaced with `]]]]><![CDATA[>`.
+
+## [4.2.1] - 2016-01-15
+
+- Updated lodash dependency to 4.0.0.
+
+## [4.2.0] - 2015-12-16
+
+- Added the `noDoubleEncoding` option to `create()` to control whether existing html entities are encoded.
+
+## [4.1.0] - 2015-11-11
+
+- Added the `separateArrayItems` option to `create()` to control how arrays are handled when converting from objects. e.g.
+
+```javascript
+root.ele({ number: [ "one", "two" ]});
+// with separateArrayItems: true
+<number>
+ <one/>
+ <two/>
+</number>
+// with separateArrayItems: false
+<number>one</number>
+<number>two</number>
+```
+
+## [4.0.0] - 2015-11-01
+
+- Removed the `#list` decorator. Array items are now created as child nodes by default.
+- Fixed a bug where the XML encoding string was checked partially.
+
+## [3.1.0] - 2015-09-19
+
+- `#list` decorator ignores empty arrays.
+
+## [3.0.0] - 2015-09-10
+
+- Allow `\r`, `\n` and `\t` in attribute values without escaping. See [#86](https://github.com/oozcitak/xmlbuilder-js/issues/86).
+
+## [2.6.5] - 2015-09-09
+
+- Use native `isArray` instead of lodash.
+- Indentation of processing instructions are set to the parent element's.
+
+## [2.6.4] - 2015-05-27
+
+- Updated lodash dependency to 3.5.0.
+
+## [2.6.3] - 2015-05-27
+
+- Bumped version because previous release was not published on npm.
+
+## [2.6.2] - 2015-03-10
+
+- Updated lodash dependency to 3.5.0.
+
+## [2.6.1] - 2015-02-20
+
+- Updated lodash dependency to 3.3.0.
+
+## [2.6.0] - 2015-02-20
+
+- Fixed a bug where the `XMLNode` constructor overwrote the super class parent.
+- Removed document property from cloned nodes.
+- Switched to mocha.js for testing.
+
+## [2.5.2] - 2015-02-16
+
+- Updated lodash dependency to 3.2.0.
+
+## [2.5.1] - 2015-02-09
+
+- Updated lodash dependency to 3.1.0.
+- Support all node >= 0.8.
+
+## [2.5.0] - 2015-00-03
+
+- Updated lodash dependency to 3.0.0.
+
+## [2.4.6] - 2015-01-26
+
+- Show more information from attribute creation with null values.
+- Added iojs as an engine.
+- Self close elements with empty text.
+
+## [2.4.5] - 2014-11-15
+
+- Fixed prepublish script to run on windows.
+- Fixed bug in XMLStringifier where an undefined value was used while reporting an invalid encoding value.
+- Moved require statements to the top of files to reduce lazy requires. See [#62](https://github.com/oozcitak/xmlbuilder-js/issues/62).
+
+## [2.4.4] - 2014-09-08
+
+- Added the `offset` option to `toString()` for use in XML fragments.
+
+## [2.4.3] - 2014-08-13
+
+- Corrected license in package description.
+
+## [2.4.2] - 2014-08-13
+
+- Dropped performance test and memwatch dependency.
+
+## [2.4.1] - 2014-08-12
+
+- Fixed a bug where empty indent string was omitted when pretty printing. See [#59](https://github.com/oozcitak/xmlbuilder-js/issues/59).
+
+## [2.4.0] - 2014-08-04
+
+- Correct cases of pubID and sysID.
+- Use single lodash instead of separate npm modules. See [#53](https://github.com/oozcitak/xmlbuilder-js/issues/53).
+- Escape according to Canonical XML 1.0\. See [#54](https://github.com/oozcitak/xmlbuilder-js/issues/54).
+
+## [2.3.0] - 2014-07-17
+
+- Convert objects to JS primitives while sanitizing user input.
+- Object builder preserves items with null values. See [#44](https://github.com/oozcitak/xmlbuilder-js/issues/44).
+- Use modularized lodash functions to cut down dependencies.
+- Process empty objects when converting from objects so that we don't throw on empty child objects.
+
+## [2.2.1] - 2014-04-04
+
+- Bumped version because previous release was not published on npm.
+
+## [2.2.0] - 2014-04-04
+
+- Switch to lodash from underscore.
+- Removed legacy `ext` option from `create()`.
+- Drop old node versions: 0.4, 0.5, 0.6\. 0.8 is the minimum requirement from now on.
+
+## [2.1.0] - 2013-12-30
+
+- Removed duplicate null checks from constructors.
+- Fixed node count in performance test.
+- Added option for skipping null attribute values. See [#26](https://github.com/oozcitak/xmlbuilder-js/issues/26).
+- Allow multiple values in `att()` and `ins()`.
+- Added ability to run individual performance tests.
+- Added flag for ignoring decorator strings.
+
+## [2.0.1] - 2013-12-24
+
+- Removed performance tests from npm package.
+
+## [2.0.0] - 2013-12-24
+
+- Combined loops for speed up.
+- Added support for the DTD and XML declaration.
+- `clone` includes attributes.
+- Added performance tests.
+- Evaluate attribute value if function.
+- Evaluate instruction value if function.
+
+## [1.1.2] - 2013-12-11
+
+- Changed processing instruction decorator to `?`.
+
+## [1.1.1] - 2013-12-11
+
+- Added processing instructions to JS object conversion.
+
+## [1.1.0] - 2013-12-10
+
+- Added license to package.
+- `create()` and `element()` accept JS object to fully build the document.
+- Added `nod()` and `n()` aliases for `node()`.
+- Renamed `convertAttChar` decorator to `convertAttKey`.
+- Ignore empty decorator strings when converting JS objects.
+
+## [1.0.2] - 2013-11-27
+
+- Removed temp file which was accidentally included in the package.
+
+## [1.0.1] - 2013-11-27
+
+- Custom stringify functions affect current instance only.
+
+## [1.0.0] - 2013-11-27
+
+- Added processing instructions.
+- Added stringify functions to sanitize and convert input values.
+- Added option for headless XML documents.
+- Added vows tests.
+- Removed Makefile. Using npm publish scripts instead.
+- Removed the `begin()` function. `create()` begins the document by creating the root node.
+
+## [0.4.3] - 2013-11-08
+
+- Added option to include surrogate pairs in XML content. See [#29](https://github.com/oozcitak/xmlbuilder-js/issues/29).
+- Fixed empty value string representation in pretty mode.
+- Added pre and postpublish scripts to package.json.
+- Filtered out prototype properties when appending attributes. See [#31](https://github.com/oozcitak/xmlbuilder-js/issues/31).
+
+## [0.4.2] - 2012-09-14
+
+- Removed README.md from `.npmignore`.
+
+## [0.4.1] - 2012-08-31
+
+- Removed `begin()` calls in favor of `XMLBuilder` constructor.
+- Added the `end()` function. `end()` is a convenience over `doc().toString()`.
+
+## [0.4.0] - 2012-08-31
+
+- Added arguments to `XMLBuilder` constructor to allow the name of the root element and XML prolog to be defined in one line.
+- Soft deprecated `begin()`.
+
+## [0.3.11] - 2012-08-13
+
+- Package keywords are fixed to be an array of values.
+
+## [0.3.10] - 2012-08-13
+
+- Brought back npm package contents which were lost due to incorrect configuration of `package.json` in previous releases.
+
+## [0.3.3] - 2012-07-27
+
+- Implemented `importXMLBuilder()`.
+
+## [0.3.2] - 2012-07-20
+
+- Fixed a duplicated escaping problem on `element()`.
+- Fixed a problem with text node creation from empty string.
+- Calling `root()` on the document element returns the root element.
+- `XMLBuilder` no longer extends `XMLFragment`.
+
+## [0.3.1] - 2011-11-28
+
+- Added guards for document element so that nodes cannot be inserted at document level.
+
+## [0.3.0] - 2011-11-28
+
+- Added `doc()` to return the document element.
+
+## [0.2.2] - 2011-11-28
+
+- Prevent code relying on `up()`'s older behavior to break.
+
+## [0.2.1] - 2011-11-28
+
+- Added the `root()` function.
+
+## [0.2.0] - 2011-11-21
+
+- Added Travis-CI integration.
+- Added coffee-script dependency.
+- Added insert, traversal and delete functions.
+
+## [0.1.7] - 2011-10-25
+
+- No changes. Accidental release.
+
+## [0.1.6] - 2011-10-25
+
+- Corrected `package.json` bugs link to `url` from `web`.
+
+## [0.1.5] - 2011-08-08
+
+- Added missing npm package contents.
+
+## [0.1.4] - 2011-07-29
+
+- Text-only nodes are no longer indented.
+- Added documentation for multiple instances.
+
+## [0.1.3] - 2011-07-27
+
+- Exported the `create()` function to return a new instance. This allows multiple builder instances to be constructed.
+- Fixed `u()` function so that it now correctly calls `up()`.
+- Fixed typo in `element()` so that `attributes` and `text` can be passed interchangeably.
+
+## [0.1.2] - 2011-06-03
+
+- `ele()` accepts element text.
+- `attributes()` now overrides existing attributes if passed the same attribute name.
+
+## [0.1.1] - 2011-05-19
+
+- Added the raw output option.
+- Removed most validity checks.
+
+## [0.1.0] - 2011-04-27
+
+- `text()` and `cdata()` now return parent element.
+- Attribute values are escaped.
+
+## [0.0.7] - 2011-04-23
+
+- Coerced text values to string.
+
+## [0.0.6] - 2011-02-23
+
+- Added support for XML comments.
+- Text nodes are checked against CharData.
+
+## [0.0.5] - 2010-12-31
+
+- Corrected the name of the main npm module in `package.json`.
+
+## [0.0.4] - 2010-12-28
+
+- Added `.npmignore`.
+
+## [0.0.3] - 2010-12-27
+
+- root element is now constructed in `begin()`.
+- moved prolog to `begin()`.
+- Added the ability to have CDATA in element text.
+- Removed unused prolog aliases.
+- Removed `builder()` function from main module.
+- Added the name of the main npm module in `package.json`.
+
+## [0.0.2] - 2010-11-03
+
+- `element()` expands nested arrays.
+- Added pretty printing.
+- Added the `up()`, `build()` and `prolog()` functions.
+- Added readme.
+
+## 0.0.1 - 2010-11-02
+
+- Initial release
+
+[0.0.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.0.1...v0.0.2
+[0.0.3]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.0.2...v0.0.3
+[0.0.4]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.0.3...v0.0.4
+[0.0.5]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.0.4...v0.0.5
+[0.0.6]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.0.5...v0.0.6
+[0.0.7]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.0.6...v0.0.7
+[0.1.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.0.7...v0.1.0
+[0.1.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.1.0...v0.1.1
+[0.1.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.1.1...v0.1.2
+[0.1.3]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.1.2...v0.1.3
+[0.1.4]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.1.3...v0.1.4
+[0.1.5]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.1.4...v0.1.5
+[0.1.6]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.1.5...v0.1.6
+[0.1.7]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.1.6...v0.1.7
+[0.2.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.1.7...v0.2.0
+[0.2.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.2.0...v0.2.1
+[0.2.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.2.1...v0.2.2
+[0.3.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.2.2...v0.3.0
+[0.3.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.3.0...v0.3.1
+[0.3.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.3.1...v0.3.2
+[0.3.3]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.3.2...v0.3.3
+[0.3.10]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.3.3...v0.3.10
+[0.3.11]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.3.10...v0.3.11
+[0.4.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.3.11...v0.4.0
+[0.4.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.4.0...v0.4.1
+[0.4.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.4.1...v0.4.2
+[0.4.3]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.4.2...v0.4.3
+[1.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.4.3...v1.0.0
+[1.0.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v1.0.0...v1.0.1
+[1.0.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v1.0.1...v1.0.2
+[1.1.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v1.0.2...v1.1.0
+[1.1.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v1.1.0...v1.1.1
+[1.1.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v1.1.1...v1.1.2
+[2.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v1.1.2...v2.0.0
+[2.0.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.0.0...v2.0.1
+[2.1.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.0.1...v2.1.0
+[2.2.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.1.0...v2.2.0
+[2.2.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.2.0...v2.2.1
+[2.3.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.2.1...v2.3.0
+[2.4.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.3.0...v2.4.0
+[2.4.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.4.0...v2.4.1
+[2.4.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.4.1...v2.4.2
+[2.4.3]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.4.2...v2.4.3
+[2.4.4]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.4.3...v2.4.4
+[2.4.5]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.4.4...v2.4.5
+[2.4.6]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.4.5...v2.4.6
+[2.5.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.4.6...v2.5.0
+[2.5.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.5.0...v2.5.1
+[2.5.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.5.1...v2.5.2
+[2.6.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.5.2...v2.6.0
+[2.6.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.6.0...v2.6.1
+[2.6.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.6.1...v2.6.2
+[2.6.3]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.6.2...v2.6.3
+[2.6.4]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.6.3...v2.6.4
+[2.6.5]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.6.4...v2.6.5
+[3.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.6.5...v3.0.0
+[3.1.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v3.0.0...v3.1.0
+[4.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v3.1.0...v4.0.0
+[4.1.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v4.0.0...v4.1.0
+[4.2.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v4.1.0...v4.2.0
+[4.2.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v4.2.0...v4.2.1
+[5.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v4.2.1...v5.0.0
+[5.0.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v5.0.0...v5.0.1
+[6.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v5.0.1...v6.0.0
+[7.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v6.0.0...v7.0.0
+[8.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v7.0.0...v8.0.0
+[8.1.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v8.0.0...v8.1.0
+[8.2.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v8.1.0...v8.2.0
+[8.2.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v8.2.0...v8.2.1
+[8.2.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v8.2.1...v8.2.2
+[9.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v8.2.2...v9.0.0
+[9.0.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v9.0.0...v9.0.1
+[9.0.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v9.0.1...v9.0.2
+[9.0.3]: https://github.com/oozcitak/xmlbuilder-js/compare/v9.0.2...v9.0.3
+[9.0.4]: https://github.com/oozcitak/xmlbuilder-js/compare/v9.0.3...v9.0.4
+[9.0.7]: https://github.com/oozcitak/xmlbuilder-js/compare/v9.0.4...v9.0.7
+[10.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v9.0.7...v10.0.0
+[10.1.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v10.0.0...v10.1.0
+[10.1.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v10.1.0...v10.1.1
+[11.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v10.1.1...v11.0.0
+[11.0.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v11.0.0...v11.0.1
+[12.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v11.0.1...v12.0.0
+[12.0.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v12.0.0...v12.0.1
+[13.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v12.0.1...v13.0.0
+[13.0.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v13.0.0...v13.0.1
+[13.0.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v13.0.1...v13.0.2
+[14.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v13.0.2...v14.0.0
+[15.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v14.0.0...v15.0.0
+[15.0.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v15.0.0...v15.0.1
+[15.1.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v15.0.1...v15.1.0
+[15.1.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v15.1.0...v15.1.1
diff --git a/generator/node_modules/xmlbuilder/LICENSE b/generator/node_modules/xmlbuilder/LICENSE
new file mode 100644
index 0000000..9fb9700
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2013 Ozgur Ozcitak
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/generator/node_modules/xmlbuilder/README.md b/generator/node_modules/xmlbuilder/README.md
new file mode 100644
index 0000000..d15b627
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/README.md
@@ -0,0 +1,103 @@
+# xmlbuilder-js
+
+An XML builder for [node.js](https://nodejs.org/) similar to
+[java-xmlbuilder](https://github.com/jmurty/java-xmlbuilder).
+
+[![License](http://img.shields.io/npm/l/xmlbuilder.svg?style=flat-square)](http://opensource.org/licenses/MIT)
+[![NPM Version](http://img.shields.io/npm/v/xmlbuilder.svg?style=flat-square)](https://npmjs.com/package/xmlbuilder)
+[![NPM Downloads](https://img.shields.io/npm/dm/xmlbuilder.svg?style=flat-square)](https://npmjs.com/package/xmlbuilder)
+
+[![Travis Build Status](http://img.shields.io/travis/oozcitak/xmlbuilder-js.svg?style=flat-square)](http://travis-ci.org/oozcitak/xmlbuilder-js)
+[![AppVeyor Build status](https://ci.appveyor.com/api/projects/status/bf7odb20hj77isry?svg=true)](https://ci.appveyor.com/project/oozcitak/xmlbuilder-js)
+[![Dev Dependency Status](http://img.shields.io/david/dev/oozcitak/xmlbuilder-js.svg?style=flat-square)](https://david-dm.org/oozcitak/xmlbuilder-js)
+[![Code Coverage](https://img.shields.io/coveralls/oozcitak/xmlbuilder-js.svg?style=flat-square)](https://coveralls.io/github/oozcitak/xmlbuilder-js)
+
+### Announcing `xmlbuilder2`:
+
+The new release of `xmlbuilder` is available at [`xmlbuilder2`](https://github.com/oozcitak/xmlbuilder2)! `xmlbuilder2` has been redesigned from the ground up to be fully conforming to the [modern DOM specification](https://dom.spec.whatwg.org). It supports XML namespaces, provides built-in converters for multiple formats, collection functions, and more. Please see [upgrading from xmlbuilder](https://oozcitak.github.io/xmlbuilder2/upgrading-from-xmlbuilder.html) in the wiki.
+
+New development will be focused towards `xmlbuilder2`; `xmlbuilder` will only receive critical bug fixes.
+
+### Installation:
+
+``` sh
+npm install xmlbuilder
+```
+
+### Usage:
+
+``` js
+var builder = require('xmlbuilder');
+
+var xml = builder.create('root')
+ .ele('xmlbuilder')
+ .ele('repo', {'type': 'git'}, 'git://github.com/oozcitak/xmlbuilder-js.git')
+ .end({ pretty: true});
+
+console.log(xml);
+```
+
+will result in:
+
+``` xml
+<?xml version="1.0"?>
+<root>
+ <xmlbuilder>
+ <repo type="git">git://github.com/oozcitak/xmlbuilder-js.git</repo>
+ </xmlbuilder>
+</root>
+```
+
+It is also possible to convert objects into nodes:
+
+``` js
+var builder = require('xmlbuilder');
+
+var obj = {
+ root: {
+ xmlbuilder: {
+ repo: {
+ '@type': 'git', // attributes start with @
+ '#text': 'git://github.com/oozcitak/xmlbuilder-js.git' // text node
+ }
+ }
+ }
+};
+
+var xml = builder.create(obj).end({ pretty: true});
+console.log(xml);
+```
+
+If you need to do some processing:
+
+``` js
+var builder = require('xmlbuilder');
+
+var root = builder.create('squares');
+root.com('f(x) = x^2');
+for(var i = 1; i <= 5; i++)
+{
+ var item = root.ele('data');
+ item.att('x', i);
+ item.att('y', i * i);
+}
+
+var xml = root.end({ pretty: true});
+console.log(xml);
+```
+
+This will result in:
+
+``` xml
+<?xml version="1.0"?>
+<squares>
+ <!-- f(x) = x^2 -->
+ <data x="1" y="1"/>
+ <data x="2" y="4"/>
+ <data x="3" y="9"/>
+ <data x="4" y="16"/>
+ <data x="5" y="25"/>
+</squares>
+```
+
+See the [wiki](https://github.com/oozcitak/xmlbuilder-js/wiki) for details and [examples](https://github.com/oozcitak/xmlbuilder-js/wiki/Examples) for more complex examples.
diff --git a/generator/node_modules/xmlbuilder/lib/Derivation.js b/generator/node_modules/xmlbuilder/lib/Derivation.js
new file mode 100644
index 0000000..ae3d951
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/lib/Derivation.js
@@ -0,0 +1,10 @@
+// Generated by CoffeeScript 2.4.1
+(function() {
+ module.exports = {
+ Restriction: 1,
+ Extension: 2,
+ Union: 4,
+ List: 8
+ };
+
+}).call(this);
diff --git a/generator/node_modules/xmlbuilder/lib/DocumentPosition.js b/generator/node_modules/xmlbuilder/lib/DocumentPosition.js
new file mode 100644
index 0000000..55abc5c
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/lib/DocumentPosition.js
@@ -0,0 +1,12 @@
+// Generated by CoffeeScript 2.4.1
+(function() {
+ module.exports = {
+ Disconnected: 1,
+ Preceding: 2,
+ Following: 4,
+ Contains: 8,
+ ContainedBy: 16,
+ ImplementationSpecific: 32
+ };
+
+}).call(this);
diff --git a/generator/node_modules/xmlbuilder/lib/NodeType.js b/generator/node_modules/xmlbuilder/lib/NodeType.js
new file mode 100644
index 0000000..40990ca
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/lib/NodeType.js
@@ -0,0 +1,25 @@
+// Generated by CoffeeScript 2.4.1
+(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,
+ // Numeric codes up to 200 are reserved to W3C for possible future use.
+ // Following are types internal to this library:
+ Declaration: 201,
+ Raw: 202,
+ AttributeDeclaration: 203,
+ ElementDeclaration: 204,
+ Dummy: 205
+ };
+
+}).call(this);
diff --git a/generator/node_modules/xmlbuilder/lib/OperationType.js b/generator/node_modules/xmlbuilder/lib/OperationType.js
new file mode 100644
index 0000000..47b1046
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/lib/OperationType.js
@@ -0,0 +1,11 @@
+// Generated by CoffeeScript 2.4.1
+(function() {
+ module.exports = {
+ Clones: 1,
+ Imported: 2,
+ Deleted: 3,
+ Renamed: 4,
+ Adopted: 5
+ };
+
+}).call(this);
diff --git a/generator/node_modules/xmlbuilder/lib/Utility.js b/generator/node_modules/xmlbuilder/lib/Utility.js
new file mode 100644
index 0000000..c338865
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/lib/Utility.js
@@ -0,0 +1,88 @@
+// Generated by CoffeeScript 2.4.1
+(function() {
+ // Copies all enumerable own properties from `sources` to `target`
+ var assign, getValue, isArray, isEmpty, isFunction, isObject, isPlainObject,
+ hasProp = {}.hasOwnProperty;
+
+ assign = function(target, ...sources) {
+ var i, key, len, source;
+ 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;
+ };
+
+ // Determines if `val` is a Function object
+ isFunction = function(val) {
+ return !!val && Object.prototype.toString.call(val) === '[object Function]';
+ };
+
+ // Determines if `val` is an Object
+ isObject = function(val) {
+ var ref;
+ return !!val && ((ref = typeof val) === 'function' || ref === 'object');
+ };
+
+ // Determines if `val` is an Array
+ isArray = function(val) {
+ if (isFunction(Array.isArray)) {
+ return Array.isArray(val);
+ } else {
+ return Object.prototype.toString.call(val) === '[object Array]';
+ }
+ };
+
+ // Determines if `val` is an empty Array or an Object with no own properties
+ 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;
+ }
+ };
+
+ // Determines if `val` is a plain Object
+ 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));
+ };
+
+ // Gets the primitive value of an object
+ getValue = function(obj) {
+ if (isFunction(obj.valueOf)) {
+ return obj.valueOf();
+ } else {
+ return obj;
+ }
+ };
+
+ module.exports.assign = assign;
+
+ module.exports.isFunction = isFunction;
+
+ module.exports.isObject = isObject;
+
+ module.exports.isArray = isArray;
+
+ module.exports.isEmpty = isEmpty;
+
+ module.exports.isPlainObject = isPlainObject;
+
+ module.exports.getValue = getValue;
+
+}).call(this);
diff --git a/generator/node_modules/xmlbuilder/lib/WriterState.js b/generator/node_modules/xmlbuilder/lib/WriterState.js
new file mode 100644
index 0000000..b1cd7a4
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/lib/WriterState.js
@@ -0,0 +1,10 @@
+// Generated by CoffeeScript 2.4.1
+(function() {
+ module.exports = {
+ None: 0,
+ OpenTag: 1,
+ InsideTag: 2,
+ CloseTag: 3
+ };
+
+}).call(this);
diff --git a/generator/node_modules/xmlbuilder/lib/XMLAttribute.js b/generator/node_modules/xmlbuilder/lib/XMLAttribute.js
new file mode 100644
index 0000000..71922b7
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/lib/XMLAttribute.js
@@ -0,0 +1,130 @@
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, XMLAttribute, XMLNode;
+
+ NodeType = require('./NodeType');
+
+ XMLNode = require('./XMLNode');
+
+ // Represents an attribute
+ module.exports = XMLAttribute = (function() {
+ class XMLAttribute {
+ // Initializes a new instance of `XMLAttribute`
+
+ // `parent` the parent node
+ // `name` attribute target
+ // `value` attribute value
+ constructor(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;
+ // DOM level 3
+ this.isId = false;
+ this.schemaTypeInfo = null;
+ }
+
+ // Creates and returns a deep clone of `this`
+ clone() {
+ return Object.create(this);
+ }
+
+ // Converts the XML fragment to string
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation for pretty print
+ // `options.offset` how many indentations to add to every line for pretty print
+ // `options.newline` newline sequence for pretty print
+ toString(options) {
+ return this.options.writer.attribute(this, this.options.writer.filterOptions(options));
+ }
+
+
+ // Returns debug string for this node
+ debugInfo(name) {
+ name = name || this.name;
+ if (name == null) {
+ return "parent: <" + this.parent.name + ">";
+ } else {
+ return "attribute: {" + name + "}, parent: <" + this.parent.name + ">";
+ }
+ }
+
+ isEqualNode(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;
+ }
+
+ };
+
+ // DOM level 1
+ Object.defineProperty(XMLAttribute.prototype, 'nodeType', {
+ get: function() {
+ return this.type;
+ }
+ });
+
+ Object.defineProperty(XMLAttribute.prototype, 'ownerElement', {
+ get: function() {
+ return this.parent;
+ }
+ });
+
+ // DOM level 3
+ Object.defineProperty(XMLAttribute.prototype, 'textContent', {
+ get: function() {
+ return this.value;
+ },
+ set: function(value) {
+ return this.value = value || '';
+ }
+ });
+
+ // DOM level 4
+ Object.defineProperty(XMLAttribute.prototype, 'namespaceURI', {
+ get: function() {
+ return '';
+ }
+ });
+
+ Object.defineProperty(XMLAttribute.prototype, 'prefix', {
+ get: function() {
+ return '';
+ }
+ });
+
+ Object.defineProperty(XMLAttribute.prototype, 'localName', {
+ get: function() {
+ return this.name;
+ }
+ });
+
+ Object.defineProperty(XMLAttribute.prototype, 'specified', {
+ get: function() {
+ return true;
+ }
+ });
+
+ return XMLAttribute;
+
+ }).call(this);
+
+}).call(this);
diff --git a/generator/node_modules/xmlbuilder/lib/XMLCData.js b/generator/node_modules/xmlbuilder/lib/XMLCData.js
new file mode 100644
index 0000000..91a4410
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/lib/XMLCData.js
@@ -0,0 +1,41 @@
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, XMLCData, XMLCharacterData;
+
+ NodeType = require('./NodeType');
+
+ XMLCharacterData = require('./XMLCharacterData');
+
+ // Represents a CDATA node
+ module.exports = XMLCData = class XMLCData extends XMLCharacterData {
+ // Initializes a new instance of `XMLCData`
+
+ // `text` CDATA text
+ constructor(parent, text) {
+ super(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);
+ }
+
+ // Creates and returns a deep clone of `this`
+ clone() {
+ return Object.create(this);
+ }
+
+ // Converts the XML fragment to string
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation for pretty print
+ // `options.offset` how many indentations to add to every line for pretty print
+ // `options.newline` newline sequence for pretty print
+ toString(options) {
+ return this.options.writer.cdata(this, this.options.writer.filterOptions(options));
+ }
+
+ };
+
+}).call(this);
diff --git a/generator/node_modules/xmlbuilder/lib/XMLCharacterData.js b/generator/node_modules/xmlbuilder/lib/XMLCharacterData.js
new file mode 100644
index 0000000..13b9c00
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/lib/XMLCharacterData.js
@@ -0,0 +1,86 @@
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var XMLCharacterData, XMLNode;
+
+ XMLNode = require('./XMLNode');
+
+ // Represents a character data node
+ module.exports = XMLCharacterData = (function() {
+ class XMLCharacterData extends XMLNode {
+ // Initializes a new instance of `XMLCharacterData`
+
+ constructor(parent) {
+ super(parent);
+ this.value = '';
+ }
+
+
+ // Creates and returns a deep clone of `this`
+ clone() {
+ return Object.create(this);
+ }
+
+ // DOM level 1 functions to be implemented later
+ substringData(offset, count) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ appendData(arg) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ insertData(offset, arg) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ deleteData(offset, count) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ replaceData(offset, count, arg) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ isEqualNode(node) {
+ if (!super.isEqualNode(node)) {
+ return false;
+ }
+ if (node.data !== this.data) {
+ return false;
+ }
+ return true;
+ }
+
+ };
+
+ // DOM level 1
+ Object.defineProperty(XMLCharacterData.prototype, 'data', {
+ get: function() {
+ return this.value;
+ },
+ set: function(value) {
+ return this.value = value || '';
+ }
+ });
+
+ Object.defineProperty(XMLCharacterData.prototype, 'length', {
+ get: function() {
+ return this.value.length;
+ }
+ });
+
+ // DOM level 3
+ Object.defineProperty(XMLCharacterData.prototype, 'textContent', {
+ get: function() {
+ return this.value;
+ },
+ set: function(value) {
+ return this.value = value || '';
+ }
+ });
+
+ return XMLCharacterData;
+
+ }).call(this);
+
+}).call(this);
diff --git a/generator/node_modules/xmlbuilder/lib/XMLComment.js b/generator/node_modules/xmlbuilder/lib/XMLComment.js
new file mode 100644
index 0000000..2254d63
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/lib/XMLComment.js
@@ -0,0 +1,41 @@
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, XMLCharacterData, XMLComment;
+
+ NodeType = require('./NodeType');
+
+ XMLCharacterData = require('./XMLCharacterData');
+
+ // Represents a comment node
+ module.exports = XMLComment = class XMLComment extends XMLCharacterData {
+ // Initializes a new instance of `XMLComment`
+
+ // `text` comment text
+ constructor(parent, text) {
+ super(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);
+ }
+
+ // Creates and returns a deep clone of `this`
+ clone() {
+ return Object.create(this);
+ }
+
+ // Converts the XML fragment to string
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation for pretty print
+ // `options.offset` how many indentations to add to every line for pretty print
+ // `options.newline` newline sequence for pretty print
+ toString(options) {
+ return this.options.writer.comment(this, this.options.writer.filterOptions(options));
+ }
+
+ };
+
+}).call(this);
diff --git a/generator/node_modules/xmlbuilder/lib/XMLDOMConfiguration.js b/generator/node_modules/xmlbuilder/lib/XMLDOMConfiguration.js
new file mode 100644
index 0000000..32e896d
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/lib/XMLDOMConfiguration.js
@@ -0,0 +1,80 @@
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var XMLDOMConfiguration, XMLDOMErrorHandler, XMLDOMStringList;
+
+ XMLDOMErrorHandler = require('./XMLDOMErrorHandler');
+
+ XMLDOMStringList = require('./XMLDOMStringList');
+
+ // Implements the DOMConfiguration interface
+ module.exports = XMLDOMConfiguration = (function() {
+ class XMLDOMConfiguration {
+ constructor() {
+ 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);
+ }
+
+ // Gets the value of a parameter.
+
+ // `name` name of the parameter
+ getParameter(name) {
+ if (this.params.hasOwnProperty(name)) {
+ return this.params[name];
+ } else {
+ return null;
+ }
+ }
+
+ // Checks if setting a parameter to a specific value is supported.
+
+ // `name` name of the parameter
+ // `value` parameter value
+ canSetParameter(name, value) {
+ return true;
+ }
+
+ // Sets the value of a parameter.
+
+ // `name` name of the parameter
+ // `value` new value or null if the user wishes to unset the parameter
+ setParameter(name, value) {
+ if (value != null) {
+ return this.params[name] = value;
+ } else {
+ return delete this.params[name];
+ }
+ }
+
+ };
+
+ // Returns the list of parameter names
+ Object.defineProperty(XMLDOMConfiguration.prototype, 'parameterNames', {
+ get: function() {
+ return new XMLDOMStringList(Object.keys(this.defaultParams));
+ }
+ });
+
+ return XMLDOMConfiguration;
+
+ }).call(this);
+
+}).call(this);
diff --git a/generator/node_modules/xmlbuilder/lib/XMLDOMErrorHandler.js b/generator/node_modules/xmlbuilder/lib/XMLDOMErrorHandler.js
new file mode 100644
index 0000000..b546a0c
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/lib/XMLDOMErrorHandler.js
@@ -0,0 +1,20 @@
+// Generated by CoffeeScript 2.4.1
+(function() {
+ // Represents the error handler for DOM operations
+ var XMLDOMErrorHandler;
+
+ module.exports = XMLDOMErrorHandler = class XMLDOMErrorHandler {
+ // Initializes a new instance of `XMLDOMErrorHandler`
+
+ constructor() {}
+
+ // Called on the error handler when an error occurs.
+
+ // `error` the error message as a string
+ handleError(error) {
+ throw new Error(error);
+ }
+
+ };
+
+}).call(this);
diff --git a/generator/node_modules/xmlbuilder/lib/XMLDOMImplementation.js b/generator/node_modules/xmlbuilder/lib/XMLDOMImplementation.js
new file mode 100644
index 0000000..4b5be79
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/lib/XMLDOMImplementation.js
@@ -0,0 +1,55 @@
+// Generated by CoffeeScript 2.4.1
+(function() {
+ // Implements the DOMImplementation interface
+ var XMLDOMImplementation;
+
+ module.exports = XMLDOMImplementation = class XMLDOMImplementation {
+ // Tests if the DOM implementation implements a specific feature.
+
+ // `feature` package name of the feature to test. In Level 1, the
+ // legal values are "HTML" and "XML" (case-insensitive).
+ // `version` version number of the package name to test.
+ // In Level 1, this is the string "1.0". If the version is
+ // not specified, supporting any version of the feature will
+ // cause the method to return true.
+ hasFeature(feature, version) {
+ return true;
+ }
+
+ // Creates a new document type declaration.
+
+ // `qualifiedName` qualified name of the document type to be created
+ // `publicId` public identifier of the external subset
+ // `systemId` system identifier of the external subset
+ createDocumentType(qualifiedName, publicId, systemId) {
+ throw new Error("This DOM method is not implemented.");
+ }
+
+ // Creates a new document.
+
+ // `namespaceURI` namespace URI of the document element to create
+ // `qualifiedName` the qualified name of the document to be created
+ // `doctype` the type of document to be created or null
+ createDocument(namespaceURI, qualifiedName, doctype) {
+ throw new Error("This DOM method is not implemented.");
+ }
+
+ // Creates a new HTML document.
+
+ // `title` document title
+ createHTMLDocument(title) {
+ throw new Error("This DOM method is not implemented.");
+ }
+
+ // Returns a specialized object which implements the specialized APIs
+ // of the specified feature and version.
+
+ // `feature` name of the feature requested.
+ // `version` version number of the feature to test
+ getFeature(feature, version) {
+ throw new Error("This DOM method is not implemented.");
+ }
+
+ };
+
+}).call(this);
diff --git a/generator/node_modules/xmlbuilder/lib/XMLDOMStringList.js b/generator/node_modules/xmlbuilder/lib/XMLDOMStringList.js
new file mode 100644
index 0000000..7e87e8e
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/lib/XMLDOMStringList.js
@@ -0,0 +1,44 @@
+// Generated by CoffeeScript 2.4.1
+(function() {
+ // Represents a list of string entries
+ var XMLDOMStringList;
+
+ module.exports = XMLDOMStringList = (function() {
+ class XMLDOMStringList {
+ // Initializes a new instance of `XMLDOMStringList`
+ // This is just a wrapper around an ordinary
+ // JS array.
+
+ // `arr` the array of string values
+ constructor(arr) {
+ this.arr = arr || [];
+ }
+
+ // Returns the indexth item in the collection.
+
+ // `index` index into the collection
+ item(index) {
+ return this.arr[index] || null;
+ }
+
+ // Test if a string is part of this DOMStringList.
+
+ // `str` the string to look for
+ contains(str) {
+ return this.arr.indexOf(str) !== -1;
+ }
+
+ };
+
+ // Returns the number of strings in the list.
+ Object.defineProperty(XMLDOMStringList.prototype, 'length', {
+ get: function() {
+ return this.arr.length;
+ }
+ });
+
+ return XMLDOMStringList;
+
+ }).call(this);
+
+}).call(this);
diff --git a/generator/node_modules/xmlbuilder/lib/XMLDTDAttList.js b/generator/node_modules/xmlbuilder/lib/XMLDTDAttList.js
new file mode 100644
index 0000000..8637ea2
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/lib/XMLDTDAttList.js
@@ -0,0 +1,66 @@
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, XMLDTDAttList, XMLNode;
+
+ XMLNode = require('./XMLNode');
+
+ NodeType = require('./NodeType');
+
+ // Represents an attribute list
+ module.exports = XMLDTDAttList = class XMLDTDAttList extends XMLNode {
+ // Initializes a new instance of `XMLDTDAttList`
+
+ // `parent` the parent `XMLDocType` element
+ // `elementName` the name of the element containing this attribute
+ // `attributeName` attribute name
+ // `attributeType` type of the attribute
+ // `defaultValueType` default value type (either #REQUIRED, #IMPLIED,
+ // #FIXED or #DEFAULT)
+ // `defaultValue` default value of the attribute
+ // (only used for #FIXED or #DEFAULT)
+ constructor(parent, elementName, attributeName, attributeType, defaultValueType, defaultValue) {
+ super(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;
+ }
+
+ // Converts the XML fragment to string
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation for pretty print
+ // `options.offset` how many indentations to add to every line for pretty print
+ // `options.newline` newline sequence for pretty print
+ toString(options) {
+ return this.options.writer.dtdAttList(this, this.options.writer.filterOptions(options));
+ }
+
+ };
+
+}).call(this);
diff --git a/generator/node_modules/xmlbuilder/lib/XMLDTDElement.js b/generator/node_modules/xmlbuilder/lib/XMLDTDElement.js
new file mode 100644
index 0000000..a154679
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/lib/XMLDTDElement.js
@@ -0,0 +1,44 @@
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, XMLDTDElement, XMLNode;
+
+ XMLNode = require('./XMLNode');
+
+ NodeType = require('./NodeType');
+
+ // Represents an attribute
+ module.exports = XMLDTDElement = class XMLDTDElement extends XMLNode {
+ // Initializes a new instance of `XMLDTDElement`
+
+ // `parent` the parent `XMLDocType` element
+ // `name` element name
+ // `value` element content (defaults to #PCDATA)
+ constructor(parent, name, value) {
+ super(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);
+ }
+
+ // Converts the XML fragment to string
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation for pretty print
+ // `options.offset` how many indentations to add to every line for pretty print
+ // `options.newline` newline sequence for pretty print
+ toString(options) {
+ return this.options.writer.dtdElement(this, this.options.writer.filterOptions(options));
+ }
+
+ };
+
+}).call(this);
diff --git a/generator/node_modules/xmlbuilder/lib/XMLDTDEntity.js b/generator/node_modules/xmlbuilder/lib/XMLDTDEntity.js
new file mode 100644
index 0000000..76bf665
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/lib/XMLDTDEntity.js
@@ -0,0 +1,115 @@
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, XMLDTDEntity, XMLNode, isObject;
+
+ ({isObject} = require('./Utility'));
+
+ XMLNode = require('./XMLNode');
+
+ NodeType = require('./NodeType');
+
+ // Represents an entity declaration in the DTD
+ module.exports = XMLDTDEntity = (function() {
+ class XMLDTDEntity extends XMLNode {
+ // Initializes a new instance of `XMLDTDEntity`
+
+ // `parent` the parent `XMLDocType` element
+ // `pe` whether this is a parameter entity or a general entity
+ // defaults to `false` (general entity)
+ // `name` the name of the entity
+ // `value` internal entity value or an object with external entity details
+ // `value.pubID` public identifier
+ // `value.sysID` system identifier
+ // `value.nData` notation declaration
+ constructor(parent, pe, name, value) {
+ super(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));
+ }
+ }
+ }
+
+ // Converts the XML fragment to string
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation for pretty print
+ // `options.offset` how many indentations to add to every line for pretty print
+ // `options.newline` newline sequence for pretty print
+ toString(options) {
+ return this.options.writer.dtdEntity(this, this.options.writer.filterOptions(options));
+ }
+
+ };
+
+ // DOM level 1
+ Object.defineProperty(XMLDTDEntity.prototype, 'publicId', {
+ get: function() {
+ return this.pubID;
+ }
+ });
+
+ Object.defineProperty(XMLDTDEntity.prototype, 'systemId', {
+ get: function() {
+ return this.sysID;
+ }
+ });
+
+ Object.defineProperty(XMLDTDEntity.prototype, 'notationName', {
+ get: function() {
+ return this.nData || null;
+ }
+ });
+
+ // DOM level 3
+ Object.defineProperty(XMLDTDEntity.prototype, 'inputEncoding', {
+ get: function() {
+ return null;
+ }
+ });
+
+ Object.defineProperty(XMLDTDEntity.prototype, 'xmlEncoding', {
+ get: function() {
+ return null;
+ }
+ });
+
+ Object.defineProperty(XMLDTDEntity.prototype, 'xmlVersion', {
+ get: function() {
+ return null;
+ }
+ });
+
+ return XMLDTDEntity;
+
+ }).call(this);
+
+}).call(this);
diff --git a/generator/node_modules/xmlbuilder/lib/XMLDTDNotation.js b/generator/node_modules/xmlbuilder/lib/XMLDTDNotation.js
new file mode 100644
index 0000000..37a469a
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/lib/XMLDTDNotation.js
@@ -0,0 +1,66 @@
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, XMLDTDNotation, XMLNode;
+
+ XMLNode = require('./XMLNode');
+
+ NodeType = require('./NodeType');
+
+ // Represents a NOTATION entry in the DTD
+ module.exports = XMLDTDNotation = (function() {
+ class XMLDTDNotation extends XMLNode {
+ // Initializes a new instance of `XMLDTDNotation`
+
+ // `parent` the parent `XMLDocType` element
+ // `name` the name of the notation
+ // `value` an object with external entity details
+ // `value.pubID` public identifier
+ // `value.sysID` system identifier
+ constructor(parent, name, value) {
+ super(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);
+ }
+ }
+
+ // Converts the XML fragment to string
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation for pretty print
+ // `options.offset` how many indentations to add to every line for pretty print
+ // `options.newline` newline sequence for pretty print
+ toString(options) {
+ return this.options.writer.dtdNotation(this, this.options.writer.filterOptions(options));
+ }
+
+ };
+
+ // DOM level 1
+ Object.defineProperty(XMLDTDNotation.prototype, 'publicId', {
+ get: function() {
+ return this.pubID;
+ }
+ });
+
+ Object.defineProperty(XMLDTDNotation.prototype, 'systemId', {
+ get: function() {
+ return this.sysID;
+ }
+ });
+
+ return XMLDTDNotation;
+
+ }).call(this);
+
+}).call(this);
diff --git a/generator/node_modules/xmlbuilder/lib/XMLDeclaration.js b/generator/node_modules/xmlbuilder/lib/XMLDeclaration.js
new file mode 100644
index 0000000..90b8edc
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/lib/XMLDeclaration.js
@@ -0,0 +1,51 @@
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, XMLDeclaration, XMLNode, isObject;
+
+ ({isObject} = require('./Utility'));
+
+ XMLNode = require('./XMLNode');
+
+ NodeType = require('./NodeType');
+
+ // Represents the XML declaration
+ module.exports = XMLDeclaration = class XMLDeclaration extends XMLNode {
+ // Initializes a new instance of `XMLDeclaration`
+
+ // `parent` the document object
+
+ // `version` A version number string, e.g. 1.0
+ // `encoding` Encoding declaration, e.g. UTF-8
+ // `standalone` standalone document declaration: true or false
+ constructor(parent, version, encoding, standalone) {
+ super(parent);
+ // arguments may also be passed as an object
+ if (isObject(version)) {
+ ({version, encoding, standalone} = version);
+ }
+ 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);
+ }
+ }
+
+ // Converts to string
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation for pretty print
+ // `options.offset` how many indentations to add to every line for pretty print
+ // `options.newline` newline sequence for pretty print
+ toString(options) {
+ return this.options.writer.declaration(this, this.options.writer.filterOptions(options));
+ }
+
+ };
+
+}).call(this);
diff --git a/generator/node_modules/xmlbuilder/lib/XMLDocType.js b/generator/node_modules/xmlbuilder/lib/XMLDocType.js
new file mode 100644
index 0000000..4af825f
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/lib/XMLDocType.js
@@ -0,0 +1,235 @@
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDocType, XMLNamedNodeMap, XMLNode, isObject;
+
+ ({isObject} = require('./Utility'));
+
+ XMLNode = require('./XMLNode');
+
+ NodeType = require('./NodeType');
+
+ XMLDTDAttList = require('./XMLDTDAttList');
+
+ XMLDTDEntity = require('./XMLDTDEntity');
+
+ XMLDTDElement = require('./XMLDTDElement');
+
+ XMLDTDNotation = require('./XMLDTDNotation');
+
+ XMLNamedNodeMap = require('./XMLNamedNodeMap');
+
+ // Represents doctype declaration
+ module.exports = XMLDocType = (function() {
+ class XMLDocType extends XMLNode {
+ // Initializes a new instance of `XMLDocType`
+
+ // `parent` the document object
+
+ // `pubID` public identifier of the external subset
+ // `sysID` system identifier of the external subset
+ constructor(parent, pubID, sysID) {
+ var child, i, len, ref;
+ super(parent);
+ this.type = NodeType.DocType;
+ // set DTD name to the name of the root node
+ 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;
+ // arguments may also be passed as an object
+ if (isObject(pubID)) {
+ ({pubID, sysID} = pubID);
+ }
+ if (sysID == null) {
+ [sysID, pubID] = [pubID, sysID];
+ }
+ if (pubID != null) {
+ this.pubID = this.stringify.dtdPubID(pubID);
+ }
+ if (sysID != null) {
+ this.sysID = this.stringify.dtdSysID(sysID);
+ }
+ }
+
+ // Creates an element type declaration
+
+ // `name` element name
+ // `value` element content (defaults to #PCDATA)
+ element(name, value) {
+ var child;
+ child = new XMLDTDElement(this, name, value);
+ this.children.push(child);
+ return this;
+ }
+
+ // Creates an attribute declaration
+
+ // `elementName` the name of the element containing this attribute
+ // `attributeName` attribute name
+ // `attributeType` type of the attribute (defaults to CDATA)
+ // `defaultValueType` default value type (either #REQUIRED, #IMPLIED, #FIXED or
+ // #DEFAULT) (defaults to #IMPLIED)
+ // `defaultValue` default value of the attribute
+ // (only used for #FIXED or #DEFAULT)
+ attList(elementName, attributeName, attributeType, defaultValueType, defaultValue) {
+ var child;
+ child = new XMLDTDAttList(this, elementName, attributeName, attributeType, defaultValueType, defaultValue);
+ this.children.push(child);
+ return this;
+ }
+
+ // Creates a general entity declaration
+
+ // `name` the name of the entity
+ // `value` internal entity value or an object with external entity details
+ // `value.pubID` public identifier
+ // `value.sysID` system identifier
+ // `value.nData` notation declaration
+ entity(name, value) {
+ var child;
+ child = new XMLDTDEntity(this, false, name, value);
+ this.children.push(child);
+ return this;
+ }
+
+ // Creates a parameter entity declaration
+
+ // `name` the name of the entity
+ // `value` internal entity value or an object with external entity details
+ // `value.pubID` public identifier
+ // `value.sysID` system identifier
+ pEntity(name, value) {
+ var child;
+ child = new XMLDTDEntity(this, true, name, value);
+ this.children.push(child);
+ return this;
+ }
+
+ // Creates a NOTATION declaration
+
+ // `name` the name of the notation
+ // `value` an object with external entity details
+ // `value.pubID` public identifier
+ // `value.sysID` system identifier
+ notation(name, value) {
+ var child;
+ child = new XMLDTDNotation(this, name, value);
+ this.children.push(child);
+ return this;
+ }
+
+ // Converts to string
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation for pretty print
+ // `options.offset` how many indentations to add to every line for pretty print
+ // `options.newline` newline sequence for pretty print
+ toString(options) {
+ return this.options.writer.docType(this, this.options.writer.filterOptions(options));
+ }
+
+ // Aliases
+ ele(name, value) {
+ return this.element(name, value);
+ }
+
+ att(elementName, attributeName, attributeType, defaultValueType, defaultValue) {
+ return this.attList(elementName, attributeName, attributeType, defaultValueType, defaultValue);
+ }
+
+ ent(name, value) {
+ return this.entity(name, value);
+ }
+
+ pent(name, value) {
+ return this.pEntity(name, value);
+ }
+
+ not(name, value) {
+ return this.notation(name, value);
+ }
+
+ up() {
+ return this.root() || this.documentObject;
+ }
+
+ isEqualNode(node) {
+ if (!super.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;
+ }
+
+ };
+
+ // DOM level 1
+ Object.defineProperty(XMLDocType.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(XMLDocType.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);
+ }
+ });
+
+ // DOM level 2
+ Object.defineProperty(XMLDocType.prototype, 'publicId', {
+ get: function() {
+ return this.pubID;
+ }
+ });
+
+ Object.defineProperty(XMLDocType.prototype, 'systemId', {
+ get: function() {
+ return this.sysID;
+ }
+ });
+
+ Object.defineProperty(XMLDocType.prototype, 'internalSubset', {
+ get: function() {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+ });
+
+ return XMLDocType;
+
+ }).call(this);
+
+}).call(this);
diff --git a/generator/node_modules/xmlbuilder/lib/XMLDocument.js b/generator/node_modules/xmlbuilder/lib/XMLDocument.js
new file mode 100644
index 0000000..56ec08f
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/lib/XMLDocument.js
@@ -0,0 +1,282 @@
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, XMLDOMConfiguration, XMLDOMImplementation, XMLDocument, XMLNode, XMLStringWriter, XMLStringifier, isPlainObject;
+
+ ({isPlainObject} = require('./Utility'));
+
+ XMLDOMImplementation = require('./XMLDOMImplementation');
+
+ XMLDOMConfiguration = require('./XMLDOMConfiguration');
+
+ XMLNode = require('./XMLNode');
+
+ NodeType = require('./NodeType');
+
+ XMLStringifier = require('./XMLStringifier');
+
+ XMLStringWriter = require('./XMLStringWriter');
+
+ // Represents an XML builder
+ module.exports = XMLDocument = (function() {
+ class XMLDocument extends XMLNode {
+ // Initializes a new instance of `XMLDocument`
+
+ // `options.keepNullNodes` whether nodes with null values will be kept
+ // or ignored: true or false
+ // `options.keepNullAttributes` whether attributes with null values will be
+ // kept or ignored: true or false
+ // `options.ignoreDecorators` whether decorator strings will be ignored when
+ // converting JS objects: true or false
+ // `options.separateArrayItems` whether array items are created as separate
+ // nodes when passed as an object value: true or false
+ // `options.noDoubleEncoding` whether existing html entities are encoded:
+ // true or false
+ // `options.stringify` a set of functions to use for converting values to
+ // strings
+ // `options.writer` the default XML writer to use for converting nodes to
+ // string. If the default writer is not set, the built-in XMLStringWriter
+ // will be used instead.
+ constructor(options) {
+ super(null);
+ this.name = "#document";
+ this.type = NodeType.Document;
+ this.documentURI = null;
+ this.domConfig = new XMLDOMConfiguration();
+ options || (options = {});
+ if (!options.writer) {
+ options.writer = new XMLStringWriter();
+ }
+ this.options = options;
+ this.stringify = new XMLStringifier(options);
+ }
+
+ // Ends the document and passes it to the given XML writer
+
+ // `writer` is either an XML writer or a plain object to pass to the
+ // constructor of the default XML writer. The default writer is assigned when
+ // creating the XML document. Following flags are recognized by the
+ // built-in XMLStringWriter:
+ // `writer.pretty` pretty prints the result
+ // `writer.indent` indentation for pretty print
+ // `writer.offset` how many indentations to add to every line for pretty print
+ // `writer.newline` newline sequence for pretty print
+ end(writer) {
+ var writerOptions;
+ writerOptions = {};
+ if (!writer) {
+ writer = this.options.writer;
+ } else if (isPlainObject(writer)) {
+ writerOptions = writer;
+ writer = this.options.writer;
+ }
+ return writer.document(this, writer.filterOptions(writerOptions));
+ }
+
+ // Converts the XML document to string
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation for pretty print
+ // `options.offset` how many indentations to add to every line for pretty print
+ // `options.newline` newline sequence for pretty print
+ toString(options) {
+ return this.options.writer.document(this, this.options.writer.filterOptions(options));
+ }
+
+ // DOM level 1 functions to be implemented later
+ createElement(tagName) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ createDocumentFragment() {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ createTextNode(data) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ createComment(data) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ createCDATASection(data) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ createProcessingInstruction(target, data) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ createAttribute(name) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ createEntityReference(name) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ getElementsByTagName(tagname) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ // DOM level 2 functions to be implemented later
+ importNode(importedNode, deep) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ createElementNS(namespaceURI, qualifiedName) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ createAttributeNS(namespaceURI, qualifiedName) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ getElementsByTagNameNS(namespaceURI, localName) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ getElementById(elementId) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ // DOM level 3 functions to be implemented later
+ adoptNode(source) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ normalizeDocument() {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ renameNode(node, namespaceURI, qualifiedName) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ // DOM level 4 functions to be implemented later
+ getElementsByClassName(classNames) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ createEvent(eventInterface) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ createRange() {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ createNodeIterator(root, whatToShow, filter) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ createTreeWalker(root, whatToShow, filter) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ };
+
+ // DOM level 1
+ Object.defineProperty(XMLDocument.prototype, 'implementation', {
+ value: new XMLDOMImplementation()
+ });
+
+ Object.defineProperty(XMLDocument.prototype, 'doctype', {
+ get: function() {
+ var child, i, len, ref;
+ ref = this.children;
+ for (i = 0, len = ref.length; i < len; i++) {
+ child = ref[i];
+ if (child.type === NodeType.DocType) {
+ return child;
+ }
+ }
+ return null;
+ }
+ });
+
+ Object.defineProperty(XMLDocument.prototype, 'documentElement', {
+ get: function() {
+ return this.rootObject || null;
+ }
+ });
+
+ // DOM level 3
+ Object.defineProperty(XMLDocument.prototype, 'inputEncoding', {
+ get: function() {
+ return null;
+ }
+ });
+
+ Object.defineProperty(XMLDocument.prototype, 'strictErrorChecking', {
+ get: function() {
+ return false;
+ }
+ });
+
+ Object.defineProperty(XMLDocument.prototype, 'xmlEncoding', {
+ get: function() {
+ if (this.children.length !== 0 && this.children[0].type === NodeType.Declaration) {
+ return this.children[0].encoding;
+ } else {
+ return null;
+ }
+ }
+ });
+
+ Object.defineProperty(XMLDocument.prototype, 'xmlStandalone', {
+ get: function() {
+ if (this.children.length !== 0 && this.children[0].type === NodeType.Declaration) {
+ return this.children[0].standalone === 'yes';
+ } else {
+ return false;
+ }
+ }
+ });
+
+ Object.defineProperty(XMLDocument.prototype, 'xmlVersion', {
+ get: function() {
+ if (this.children.length !== 0 && this.children[0].type === NodeType.Declaration) {
+ return this.children[0].version;
+ } else {
+ return "1.0";
+ }
+ }
+ });
+
+ // DOM level 4
+ Object.defineProperty(XMLDocument.prototype, 'URL', {
+ get: function() {
+ return this.documentURI;
+ }
+ });
+
+ Object.defineProperty(XMLDocument.prototype, 'origin', {
+ get: function() {
+ return null;
+ }
+ });
+
+ Object.defineProperty(XMLDocument.prototype, 'compatMode', {
+ get: function() {
+ return null;
+ }
+ });
+
+ Object.defineProperty(XMLDocument.prototype, 'characterSet', {
+ get: function() {
+ return null;
+ }
+ });
+
+ Object.defineProperty(XMLDocument.prototype, 'contentType', {
+ get: function() {
+ return null;
+ }
+ });
+
+ return XMLDocument;
+
+ }).call(this);
+
+}).call(this);
diff --git a/generator/node_modules/xmlbuilder/lib/XMLDocumentCB.js b/generator/node_modules/xmlbuilder/lib/XMLDocumentCB.js
new file mode 100644
index 0000000..c55a4bf
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/lib/XMLDocumentCB.js
@@ -0,0 +1,650 @@
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, WriterState, XMLAttribute, XMLCData, XMLComment, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDeclaration, XMLDocType, XMLDocument, XMLDocumentCB, XMLElement, XMLProcessingInstruction, XMLRaw, XMLStringWriter, XMLStringifier, XMLText, getValue, isFunction, isObject, isPlainObject,
+ hasProp = {}.hasOwnProperty;
+
+ ({isObject, isFunction, isPlainObject, getValue} = require('./Utility'));
+
+ NodeType = require('./NodeType');
+
+ XMLDocument = require('./XMLDocument');
+
+ XMLElement = require('./XMLElement');
+
+ XMLCData = require('./XMLCData');
+
+ XMLComment = require('./XMLComment');
+
+ XMLRaw = require('./XMLRaw');
+
+ XMLText = require('./XMLText');
+
+ XMLProcessingInstruction = require('./XMLProcessingInstruction');
+
+ XMLDeclaration = require('./XMLDeclaration');
+
+ XMLDocType = require('./XMLDocType');
+
+ XMLDTDAttList = require('./XMLDTDAttList');
+
+ XMLDTDEntity = require('./XMLDTDEntity');
+
+ XMLDTDElement = require('./XMLDTDElement');
+
+ XMLDTDNotation = require('./XMLDTDNotation');
+
+ XMLAttribute = require('./XMLAttribute');
+
+ XMLStringifier = require('./XMLStringifier');
+
+ XMLStringWriter = require('./XMLStringWriter');
+
+ WriterState = require('./WriterState');
+
+ // Represents an XML builder
+ module.exports = XMLDocumentCB = class XMLDocumentCB {
+ // Initializes a new instance of `XMLDocumentCB`
+
+ // `options.keepNullNodes` whether nodes with null values will be kept
+ // or ignored: true or false
+ // `options.keepNullAttributes` whether attributes with null values will be
+ // kept or ignored: true or false
+ // `options.ignoreDecorators` whether decorator strings will be ignored when
+ // converting JS objects: true or false
+ // `options.separateArrayItems` whether array items are created as separate
+ // nodes when passed as an object value: true or false
+ // `options.noDoubleEncoding` whether existing html entities are encoded:
+ // true or false
+ // `options.stringify` a set of functions to use for converting values to
+ // strings
+ // `options.writer` the default XML writer to use for converting nodes to
+ // string. If the default writer is not set, the built-in XMLStringWriter
+ // will be used instead.
+
+ // `onData` the function to be called when a new chunk of XML is output. The
+ // string containing the XML chunk is passed to `onData` as its first
+ // argument, and the current indentation level as its second argument.
+ // `onEnd` the function to be called when the XML document is completed with
+ // `end`. `onEnd` does not receive any arguments.
+ constructor(options, onData, onEnd) {
+ var writerOptions;
+ this.name = "?xml";
+ this.type = NodeType.Document;
+ options || (options = {});
+ writerOptions = {};
+ if (!options.writer) {
+ options.writer = new XMLStringWriter();
+ } else if (isPlainObject(options.writer)) {
+ writerOptions = options.writer;
+ options.writer = new XMLStringWriter();
+ }
+ this.options = options;
+ this.writer = options.writer;
+ this.writerOptions = this.writer.filterOptions(writerOptions);
+ this.stringify = new XMLStringifier(options);
+ this.onDataCallback = onData || function() {};
+ this.onEndCallback = onEnd || function() {};
+ this.currentNode = null;
+ this.currentLevel = -1;
+ this.openTags = {};
+ this.documentStarted = false;
+ this.documentCompleted = false;
+ this.root = null;
+ }
+
+ // Creates a child element node from the given XMLNode
+
+ // `node` the child node
+ createChildNode(node) {
+ var att, attName, attributes, child, i, len, ref, ref1;
+ switch (node.type) {
+ case NodeType.CData:
+ this.cdata(node.value);
+ break;
+ case NodeType.Comment:
+ this.comment(node.value);
+ break;
+ case NodeType.Element:
+ attributes = {};
+ ref = node.attribs;
+ for (attName in ref) {
+ if (!hasProp.call(ref, attName)) continue;
+ att = ref[attName];
+ attributes[attName] = att.value;
+ }
+ this.node(node.name, attributes);
+ break;
+ case NodeType.Dummy:
+ this.dummy();
+ break;
+ case NodeType.Raw:
+ this.raw(node.value);
+ break;
+ case NodeType.Text:
+ this.text(node.value);
+ break;
+ case NodeType.ProcessingInstruction:
+ this.instruction(node.target, node.value);
+ break;
+ default:
+ throw new Error("This XML node type is not supported in a JS object: " + node.constructor.name);
+ }
+ ref1 = node.children;
+ // write child nodes recursively
+ for (i = 0, len = ref1.length; i < len; i++) {
+ child = ref1[i];
+ this.createChildNode(child);
+ if (child.type === NodeType.Element) {
+ this.up();
+ }
+ }
+ return this;
+ }
+
+ // Creates a dummy node
+
+ dummy() {
+ // no-op, just return this
+ return this;
+ }
+
+ // Creates a node
+
+ // `name` name of the node
+ // `attributes` an object containing name/value pairs of attributes
+ // `text` element text
+ node(name, attributes, text) {
+ if (name == null) {
+ throw new Error("Missing node name.");
+ }
+ if (this.root && this.currentLevel === -1) {
+ throw new Error("Document can only have one root node. " + this.debugInfo(name));
+ }
+ this.openCurrent();
+ name = getValue(name);
+ if (attributes == null) {
+ attributes = {};
+ }
+ attributes = getValue(attributes);
+ // swap argument order: text <-> attributes
+ if (!isObject(attributes)) {
+ [text, attributes] = [attributes, text];
+ }
+ this.currentNode = new XMLElement(this, name, attributes);
+ this.currentNode.children = false;
+ this.currentLevel++;
+ this.openTags[this.currentLevel] = this.currentNode;
+ if (text != null) {
+ this.text(text);
+ }
+ return this;
+ }
+
+ // Creates a child element node or an element type declaration when called
+ // inside the DTD
+
+ // `name` name of the node
+ // `attributes` an object containing name/value pairs of attributes
+ // `text` element text
+ element(name, attributes, text) {
+ var child, i, len, oldValidationFlag, ref, root;
+ if (this.currentNode && this.currentNode.type === NodeType.DocType) {
+ this.dtdElement(...arguments);
+ } else {
+ if (Array.isArray(name) || isObject(name) || isFunction(name)) {
+ oldValidationFlag = this.options.noValidation;
+ this.options.noValidation = true;
+ root = new XMLDocument(this.options).element('TEMP_ROOT');
+ root.element(name);
+ this.options.noValidation = oldValidationFlag;
+ ref = root.children;
+ for (i = 0, len = ref.length; i < len; i++) {
+ child = ref[i];
+ this.createChildNode(child);
+ if (child.type === NodeType.Element) {
+ this.up();
+ }
+ }
+ } else {
+ this.node(name, attributes, text);
+ }
+ }
+ return this;
+ }
+
+ // Adds or modifies an attribute
+
+ // `name` attribute name
+ // `value` attribute value
+ attribute(name, value) {
+ var attName, attValue;
+ if (!this.currentNode || this.currentNode.children) {
+ throw new Error("att() can only be used immediately after an ele() call in callback mode. " + this.debugInfo(name));
+ }
+ if (name != null) {
+ name = getValue(name);
+ }
+ if (isObject(name)) { // expand if object
+ 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.currentNode.attribs[name] = new XMLAttribute(this, name, "");
+ } else if (value != null) {
+ this.currentNode.attribs[name] = new XMLAttribute(this, name, value);
+ }
+ }
+ return this;
+ }
+
+ // Creates a text node
+
+ // `value` element text
+ text(value) {
+ var node;
+ this.openCurrent();
+ node = new XMLText(this, value);
+ this.onData(this.writer.text(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
+ return this;
+ }
+
+ // Creates a CDATA node
+
+ // `value` element text without CDATA delimiters
+ cdata(value) {
+ var node;
+ this.openCurrent();
+ node = new XMLCData(this, value);
+ this.onData(this.writer.cdata(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
+ return this;
+ }
+
+ // Creates a comment node
+
+ // `value` comment text
+ comment(value) {
+ var node;
+ this.openCurrent();
+ node = new XMLComment(this, value);
+ this.onData(this.writer.comment(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
+ return this;
+ }
+
+ // Adds unescaped raw text
+
+ // `value` text
+ raw(value) {
+ var node;
+ this.openCurrent();
+ node = new XMLRaw(this, value);
+ this.onData(this.writer.raw(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
+ return this;
+ }
+
+ // Adds a processing instruction
+
+ // `target` instruction target
+ // `value` instruction value
+ instruction(target, value) {
+ var i, insTarget, insValue, len, node;
+ this.openCurrent();
+ if (target != null) {
+ target = getValue(target);
+ }
+ if (value != null) {
+ value = getValue(value);
+ }
+ if (Array.isArray(target)) { // expand if array
+ for (i = 0, len = target.length; i < len; i++) {
+ insTarget = target[i];
+ this.instruction(insTarget);
+ }
+ } else if (isObject(target)) { // expand if object
+ for (insTarget in target) {
+ if (!hasProp.call(target, insTarget)) continue;
+ insValue = target[insTarget];
+ this.instruction(insTarget, insValue);
+ }
+ } else {
+ if (isFunction(value)) {
+ value = value.apply();
+ }
+ node = new XMLProcessingInstruction(this, target, value);
+ this.onData(this.writer.processingInstruction(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
+ }
+ return this;
+ }
+
+ // Creates the xml declaration
+
+ // `version` A version number string, e.g. 1.0
+ // `encoding` Encoding declaration, e.g. UTF-8
+ // `standalone` standalone document declaration: true or false
+ declaration(version, encoding, standalone) {
+ var node;
+ this.openCurrent();
+ if (this.documentStarted) {
+ throw new Error("declaration() must be the first node.");
+ }
+ node = new XMLDeclaration(this, version, encoding, standalone);
+ this.onData(this.writer.declaration(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
+ return this;
+ }
+
+ // Creates the document type declaration
+
+ // `root` the name of the root node
+ // `pubID` the public identifier of the external subset
+ // `sysID` the system identifier of the external subset
+ doctype(root, pubID, sysID) {
+ this.openCurrent();
+ if (root == null) {
+ throw new Error("Missing root node name.");
+ }
+ if (this.root) {
+ throw new Error("dtd() must come before the root node.");
+ }
+ this.currentNode = new XMLDocType(this, pubID, sysID);
+ this.currentNode.rootNodeName = root;
+ this.currentNode.children = false;
+ this.currentLevel++;
+ this.openTags[this.currentLevel] = this.currentNode;
+ return this;
+ }
+
+ // Creates an element type declaration
+
+ // `name` element name
+ // `value` element content (defaults to #PCDATA)
+ dtdElement(name, value) {
+ var node;
+ this.openCurrent();
+ node = new XMLDTDElement(this, name, value);
+ this.onData(this.writer.dtdElement(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
+ return this;
+ }
+
+ // Creates an attribute declaration
+
+ // `elementName` the name of the element containing this attribute
+ // `attributeName` attribute name
+ // `attributeType` type of the attribute (defaults to CDATA)
+ // `defaultValueType` default value type (either #REQUIRED, #IMPLIED, #FIXED or
+ // #DEFAULT) (defaults to #IMPLIED)
+ // `defaultValue` default value of the attribute
+ // (only used for #FIXED or #DEFAULT)
+ attList(elementName, attributeName, attributeType, defaultValueType, defaultValue) {
+ var node;
+ this.openCurrent();
+ node = new XMLDTDAttList(this, elementName, attributeName, attributeType, defaultValueType, defaultValue);
+ this.onData(this.writer.dtdAttList(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
+ return this;
+ }
+
+ // Creates a general entity declaration
+
+ // `name` the name of the entity
+ // `value` internal entity value or an object with external entity details
+ // `value.pubID` public identifier
+ // `value.sysID` system identifier
+ // `value.nData` notation declaration
+ entity(name, value) {
+ var node;
+ this.openCurrent();
+ node = new XMLDTDEntity(this, false, name, value);
+ this.onData(this.writer.dtdEntity(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
+ return this;
+ }
+
+ // Creates a parameter entity declaration
+
+ // `name` the name of the entity
+ // `value` internal entity value or an object with external entity details
+ // `value.pubID` public identifier
+ // `value.sysID` system identifier
+ pEntity(name, value) {
+ var node;
+ this.openCurrent();
+ node = new XMLDTDEntity(this, true, name, value);
+ this.onData(this.writer.dtdEntity(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
+ return this;
+ }
+
+ // Creates a NOTATION declaration
+
+ // `name` the name of the notation
+ // `value` an object with external entity details
+ // `value.pubID` public identifier
+ // `value.sysID` system identifier
+ notation(name, value) {
+ var node;
+ this.openCurrent();
+ node = new XMLDTDNotation(this, name, value);
+ this.onData(this.writer.dtdNotation(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
+ return this;
+ }
+
+ // Gets the parent node
+ up() {
+ if (this.currentLevel < 0) {
+ throw new Error("The document node has no parent.");
+ }
+ if (this.currentNode) {
+ if (this.currentNode.children) {
+ this.closeNode(this.currentNode);
+ } else {
+ this.openNode(this.currentNode);
+ }
+ this.currentNode = null;
+ } else {
+ this.closeNode(this.openTags[this.currentLevel]);
+ }
+ delete this.openTags[this.currentLevel];
+ this.currentLevel--;
+ return this;
+ }
+
+ // Ends the document
+ end() {
+ while (this.currentLevel >= 0) {
+ this.up();
+ }
+ return this.onEnd();
+ }
+
+ // Opens the current parent node
+ openCurrent() {
+ if (this.currentNode) {
+ this.currentNode.children = true;
+ return this.openNode(this.currentNode);
+ }
+ }
+
+ // Writes the opening tag of the current node or the entire node if it has
+ // no child nodes
+ openNode(node) {
+ var att, chunk, name, ref;
+ if (!node.isOpen) {
+ if (!this.root && this.currentLevel === 0 && node.type === NodeType.Element) {
+ this.root = node;
+ }
+ chunk = '';
+ if (node.type === NodeType.Element) {
+ this.writerOptions.state = WriterState.OpenTag;
+ chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + '<' + node.name;
+ ref = node.attribs;
+ for (name in ref) {
+ if (!hasProp.call(ref, name)) continue;
+ att = ref[name];
+ chunk += this.writer.attribute(att, this.writerOptions, this.currentLevel);
+ }
+ chunk += (node.children ? '>' : '/>') + this.writer.endline(node, this.writerOptions, this.currentLevel);
+ this.writerOptions.state = WriterState.InsideTag; // if node.type is NodeType.DocType
+ } else {
+ this.writerOptions.state = WriterState.OpenTag;
+ chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + '<!DOCTYPE ' + node.rootNodeName;
+
+ // external identifier
+ if (node.pubID && node.sysID) {
+ chunk += ' PUBLIC "' + node.pubID + '" "' + node.sysID + '"';
+ } else if (node.sysID) {
+ chunk += ' SYSTEM "' + node.sysID + '"';
+ }
+
+ // internal subset
+ if (node.children) {
+ chunk += ' [';
+ this.writerOptions.state = WriterState.InsideTag;
+ } else {
+ this.writerOptions.state = WriterState.CloseTag;
+ chunk += '>';
+ }
+ chunk += this.writer.endline(node, this.writerOptions, this.currentLevel);
+ }
+ this.onData(chunk, this.currentLevel);
+ return node.isOpen = true;
+ }
+ }
+
+ // Writes the closing tag of the current node
+ closeNode(node) {
+ var chunk;
+ if (!node.isClosed) {
+ chunk = '';
+ this.writerOptions.state = WriterState.CloseTag;
+ if (node.type === NodeType.Element) {
+ chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + '</' + node.name + '>' + this.writer.endline(node, this.writerOptions, this.currentLevel); // if node.type is NodeType.DocType
+ } else {
+ chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + ']>' + this.writer.endline(node, this.writerOptions, this.currentLevel);
+ }
+ this.writerOptions.state = WriterState.None;
+ this.onData(chunk, this.currentLevel);
+ return node.isClosed = true;
+ }
+ }
+
+ // Called when a new chunk of XML is output
+
+ // `chunk` a string containing the XML chunk
+ // `level` current indentation level
+ onData(chunk, level) {
+ this.documentStarted = true;
+ return this.onDataCallback(chunk, level + 1);
+ }
+
+ // Called when the XML document is completed
+ onEnd() {
+ this.documentCompleted = true;
+ return this.onEndCallback();
+ }
+
+ // Returns debug string
+ debugInfo(name) {
+ if (name == null) {
+ return "";
+ } else {
+ return "node: <" + name + ">";
+ }
+ }
+
+ // Node aliases
+ ele() {
+ return this.element(...arguments);
+ }
+
+ nod(name, attributes, text) {
+ return this.node(name, attributes, text);
+ }
+
+ txt(value) {
+ return this.text(value);
+ }
+
+ dat(value) {
+ return this.cdata(value);
+ }
+
+ com(value) {
+ return this.comment(value);
+ }
+
+ ins(target, value) {
+ return this.instruction(target, value);
+ }
+
+ dec(version, encoding, standalone) {
+ return this.declaration(version, encoding, standalone);
+ }
+
+ dtd(root, pubID, sysID) {
+ return this.doctype(root, pubID, sysID);
+ }
+
+ e(name, attributes, text) {
+ return this.element(name, attributes, text);
+ }
+
+ n(name, attributes, text) {
+ return this.node(name, attributes, text);
+ }
+
+ t(value) {
+ return this.text(value);
+ }
+
+ d(value) {
+ return this.cdata(value);
+ }
+
+ c(value) {
+ return this.comment(value);
+ }
+
+ r(value) {
+ return this.raw(value);
+ }
+
+ i(target, value) {
+ return this.instruction(target, value);
+ }
+
+ // Attribute aliases
+ att() {
+ if (this.currentNode && this.currentNode.type === NodeType.DocType) {
+ return this.attList(...arguments);
+ } else {
+ return this.attribute(...arguments);
+ }
+ }
+
+ a() {
+ if (this.currentNode && this.currentNode.type === NodeType.DocType) {
+ return this.attList(...arguments);
+ } else {
+ return this.attribute(...arguments);
+ }
+ }
+
+ // DTD aliases
+ // att() and ele() are defined above
+ ent(name, value) {
+ return this.entity(name, value);
+ }
+
+ pent(name, value) {
+ return this.pEntity(name, value);
+ }
+
+ not(name, value) {
+ return this.notation(name, value);
+ }
+
+ };
+
+}).call(this);
diff --git a/generator/node_modules/xmlbuilder/lib/XMLDocumentFragment.js b/generator/node_modules/xmlbuilder/lib/XMLDocumentFragment.js
new file mode 100644
index 0000000..fbd42ba
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/lib/XMLDocumentFragment.js
@@ -0,0 +1,21 @@
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, XMLDocumentFragment, XMLNode;
+
+ XMLNode = require('./XMLNode');
+
+ NodeType = require('./NodeType');
+
+ // Represents a CDATA node
+ module.exports = XMLDocumentFragment = class XMLDocumentFragment extends XMLNode {
+ // Initializes a new instance of `XMLDocumentFragment`
+
+ constructor() {
+ super(null);
+ this.name = "#document-fragment";
+ this.type = NodeType.DocumentFragment;
+ }
+
+ };
+
+}).call(this);
diff --git a/generator/node_modules/xmlbuilder/lib/XMLDummy.js b/generator/node_modules/xmlbuilder/lib/XMLDummy.js
new file mode 100644
index 0000000..06ab8af
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/lib/XMLDummy.js
@@ -0,0 +1,39 @@
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, XMLDummy, XMLNode;
+
+ XMLNode = require('./XMLNode');
+
+ NodeType = require('./NodeType');
+
+ // Represents a raw node
+ module.exports = XMLDummy = class XMLDummy extends XMLNode {
+ // Initializes a new instance of `XMLDummy`
+
+ // `XMLDummy` is a special node representing a node with
+ // a null value. Dummy nodes are created while recursively
+ // building the XML tree. Simply skipping null values doesn't
+ // work because that would break the recursive chain.
+ constructor(parent) {
+ super(parent);
+ this.type = NodeType.Dummy;
+ }
+
+ // Creates and returns a deep clone of `this`
+ clone() {
+ return Object.create(this);
+ }
+
+ // Converts the XML fragment to string
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation for pretty print
+ // `options.offset` how many indentations to add to every line for pretty print
+ // `options.newline` newline sequence for pretty print
+ toString(options) {
+ return '';
+ }
+
+ };
+
+}).call(this);
diff --git a/generator/node_modules/xmlbuilder/lib/XMLElement.js b/generator/node_modules/xmlbuilder/lib/XMLElement.js
new file mode 100644
index 0000000..3e9da57
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/lib/XMLElement.js
@@ -0,0 +1,334 @@
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, XMLAttribute, XMLElement, XMLNamedNodeMap, XMLNode, getValue, isFunction, isObject,
+ hasProp = {}.hasOwnProperty;
+
+ ({isObject, isFunction, getValue} = require('./Utility'));
+
+ XMLNode = require('./XMLNode');
+
+ NodeType = require('./NodeType');
+
+ XMLAttribute = require('./XMLAttribute');
+
+ XMLNamedNodeMap = require('./XMLNamedNodeMap');
+
+ // Represents an element of the XML document
+ module.exports = XMLElement = (function() {
+ class XMLElement extends XMLNode {
+ // Initializes a new instance of `XMLElement`
+
+ // `parent` the parent node
+ // `name` element name
+ // `attributes` an object containing name/value pairs of attributes
+ constructor(parent, name, attributes) {
+ var child, j, len, ref;
+ super(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);
+ }
+ // set properties if this is the root node
+ if (parent.type === NodeType.Document) {
+ this.isRoot = true;
+ this.documentObject = parent;
+ parent.rootObject = this;
+ // set dtd name
+ if (parent.children) {
+ ref = parent.children;
+ for (j = 0, len = ref.length; j < len; j++) {
+ child = ref[j];
+ if (child.type === NodeType.DocType) {
+ child.name = this.name;
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ // Creates and returns a deep clone of `this`
+
+ clone() {
+ var att, attName, clonedSelf, ref;
+ clonedSelf = Object.create(this);
+ // remove document element
+ if (clonedSelf.isRoot) {
+ clonedSelf.documentObject = null;
+ }
+ // clone attributes
+ clonedSelf.attribs = {};
+ ref = this.attribs;
+ for (attName in ref) {
+ if (!hasProp.call(ref, attName)) continue;
+ att = ref[attName];
+ clonedSelf.attribs[attName] = att.clone();
+ }
+ // clone child nodes
+ clonedSelf.children = [];
+ this.children.forEach(function(child) {
+ var clonedChild;
+ clonedChild = child.clone();
+ clonedChild.parent = clonedSelf;
+ return clonedSelf.children.push(clonedChild);
+ });
+ return clonedSelf;
+ }
+
+ // Adds or modifies an attribute
+
+ // `name` attribute name
+ // `value` attribute value
+ attribute(name, value) {
+ var attName, attValue;
+ if (name != null) {
+ name = getValue(name);
+ }
+ if (isObject(name)) { // expand if object
+ 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;
+ }
+
+ // Removes an attribute
+
+ // `name` attribute name
+ removeAttribute(name) {
+ var attName, j, len;
+ // Also defined in DOM level 1
+ // removeAttribute(name) removes an attribute by name.
+ if (name == null) {
+ throw new Error("Missing attribute name. " + this.debugInfo());
+ }
+ name = getValue(name);
+ if (Array.isArray(name)) { // expand if array
+ for (j = 0, len = name.length; j < len; j++) {
+ attName = name[j];
+ delete this.attribs[attName];
+ }
+ } else {
+ delete this.attribs[name];
+ }
+ return this;
+ }
+
+ // Converts the XML fragment to string
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation for pretty print
+ // `options.offset` how many indentations to add to every line for pretty print
+ // `options.newline` newline sequence for pretty print
+ // `options.allowEmpty` do not self close empty element tags
+ toString(options) {
+ return this.options.writer.element(this, this.options.writer.filterOptions(options));
+ }
+
+ // Aliases
+ att(name, value) {
+ return this.attribute(name, value);
+ }
+
+ a(name, value) {
+ return this.attribute(name, value);
+ }
+
+ // DOM Level 1
+ getAttribute(name) {
+ if (this.attribs.hasOwnProperty(name)) {
+ return this.attribs[name].value;
+ } else {
+ return null;
+ }
+ }
+
+ setAttribute(name, value) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ getAttributeNode(name) {
+ if (this.attribs.hasOwnProperty(name)) {
+ return this.attribs[name];
+ } else {
+ return null;
+ }
+ }
+
+ setAttributeNode(newAttr) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ removeAttributeNode(oldAttr) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ getElementsByTagName(name) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ // DOM Level 2
+ getAttributeNS(namespaceURI, localName) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ setAttributeNS(namespaceURI, qualifiedName, value) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ removeAttributeNS(namespaceURI, localName) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ getAttributeNodeNS(namespaceURI, localName) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ setAttributeNodeNS(newAttr) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ getElementsByTagNameNS(namespaceURI, localName) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ hasAttribute(name) {
+ return this.attribs.hasOwnProperty(name);
+ }
+
+ hasAttributeNS(namespaceURI, localName) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ // DOM Level 3
+ setIdAttribute(name, isId) {
+ if (this.attribs.hasOwnProperty(name)) {
+ return this.attribs[name].isId;
+ } else {
+ return isId;
+ }
+ }
+
+ setIdAttributeNS(namespaceURI, localName, isId) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ setIdAttributeNode(idAttr, isId) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ // DOM Level 4
+ getElementsByTagName(tagname) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ getElementsByTagNameNS(namespaceURI, localName) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ getElementsByClassName(classNames) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ isEqualNode(node) {
+ var i, j, ref;
+ if (!super.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, ref = this.attribs.length - 1; (0 <= ref ? j <= ref : j >= ref); i = 0 <= ref ? ++j : --j) {
+ if (!this.attribs[i].isEqualNode(node.attribs[i])) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ };
+
+ // DOM level 1
+ Object.defineProperty(XMLElement.prototype, 'tagName', {
+ get: function() {
+ return this.name;
+ }
+ });
+
+ // DOM level 4
+ Object.defineProperty(XMLElement.prototype, 'namespaceURI', {
+ get: function() {
+ return '';
+ }
+ });
+
+ Object.defineProperty(XMLElement.prototype, 'prefix', {
+ get: function() {
+ return '';
+ }
+ });
+
+ Object.defineProperty(XMLElement.prototype, 'localName', {
+ get: function() {
+ return this.name;
+ }
+ });
+
+ Object.defineProperty(XMLElement.prototype, 'id', {
+ get: function() {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+ });
+
+ Object.defineProperty(XMLElement.prototype, 'className', {
+ get: function() {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+ });
+
+ Object.defineProperty(XMLElement.prototype, 'classList', {
+ get: function() {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+ });
+
+ Object.defineProperty(XMLElement.prototype, 'attributes', {
+ get: function() {
+ if (!this.attributeMap || !this.attributeMap.nodes) {
+ this.attributeMap = new XMLNamedNodeMap(this.attribs);
+ }
+ return this.attributeMap;
+ }
+ });
+
+ return XMLElement;
+
+ }).call(this);
+
+}).call(this);
diff --git a/generator/node_modules/xmlbuilder/lib/XMLNamedNodeMap.js b/generator/node_modules/xmlbuilder/lib/XMLNamedNodeMap.js
new file mode 100644
index 0000000..8c91969
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/lib/XMLNamedNodeMap.js
@@ -0,0 +1,77 @@
+// Generated by CoffeeScript 2.4.1
+(function() {
+ // Represents a map of nodes accessed by a string key
+ var XMLNamedNodeMap;
+
+ module.exports = XMLNamedNodeMap = (function() {
+ class XMLNamedNodeMap {
+ // Initializes a new instance of `XMLNamedNodeMap`
+ // This is just a wrapper around an ordinary
+ // JS object.
+
+ // `nodes` the object containing nodes.
+ constructor(nodes) {
+ this.nodes = nodes;
+ }
+
+ // Creates and returns a deep clone of `this`
+
+ clone() {
+ // this class should not be cloned since it wraps
+ // around a given object. The calling function should check
+ // whether the wrapped object is null and supply a new object
+ // (from the clone).
+ return this.nodes = null;
+ }
+
+ // DOM Level 1
+ getNamedItem(name) {
+ return this.nodes[name];
+ }
+
+ setNamedItem(node) {
+ var oldNode;
+ oldNode = this.nodes[node.nodeName];
+ this.nodes[node.nodeName] = node;
+ return oldNode || null;
+ }
+
+ removeNamedItem(name) {
+ var oldNode;
+ oldNode = this.nodes[name];
+ delete this.nodes[name];
+ return oldNode || null;
+ }
+
+ item(index) {
+ return this.nodes[Object.keys(this.nodes)[index]] || null;
+ }
+
+ // DOM level 2 functions to be implemented later
+ getNamedItemNS(namespaceURI, localName) {
+ throw new Error("This DOM method is not implemented.");
+ }
+
+ setNamedItemNS(node) {
+ throw new Error("This DOM method is not implemented.");
+ }
+
+ removeNamedItemNS(namespaceURI, localName) {
+ throw new Error("This DOM method is not implemented.");
+ }
+
+ };
+
+
+ // DOM level 1
+ Object.defineProperty(XMLNamedNodeMap.prototype, 'length', {
+ get: function() {
+ return Object.keys(this.nodes).length || 0;
+ }
+ });
+
+ return XMLNamedNodeMap;
+
+ }).call(this);
+
+}).call(this);
diff --git a/generator/node_modules/xmlbuilder/lib/XMLNode.js b/generator/node_modules/xmlbuilder/lib/XMLNode.js
new file mode 100644
index 0000000..0ade97b
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/lib/XMLNode.js
@@ -0,0 +1,999 @@
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var DocumentPosition, NodeType, XMLCData, XMLComment, XMLDeclaration, XMLDocType, XMLDummy, XMLElement, XMLNamedNodeMap, XMLNode, XMLNodeList, XMLProcessingInstruction, XMLRaw, XMLText, getValue, isEmpty, isFunction, isObject,
+ hasProp = {}.hasOwnProperty,
+ splice = [].splice;
+
+ ({isObject, isFunction, isEmpty, getValue} = require('./Utility'));
+
+ XMLElement = null;
+
+ XMLCData = null;
+
+ XMLComment = null;
+
+ XMLDeclaration = null;
+
+ XMLDocType = null;
+
+ XMLRaw = null;
+
+ XMLText = null;
+
+ XMLProcessingInstruction = null;
+
+ XMLDummy = null;
+
+ NodeType = null;
+
+ XMLNodeList = null;
+
+ XMLNamedNodeMap = null;
+
+ DocumentPosition = null;
+
+ // Represents a generic XMl element
+ module.exports = XMLNode = (function() {
+ class XMLNode {
+ // Initializes a new instance of `XMLNode`
+
+ // `parent` the parent node
+ constructor(parent1) {
+ this.parent = parent1;
+ if (this.parent) {
+ this.options = this.parent.options;
+ this.stringify = this.parent.stringify;
+ }
+ this.value = null;
+ this.children = [];
+ this.baseURI = null;
+ // first execution, load dependencies that are otherwise
+ // circular (so we can't load them at the top)
+ if (!XMLElement) {
+ XMLElement = require('./XMLElement');
+ XMLCData = require('./XMLCData');
+ XMLComment = require('./XMLComment');
+ XMLDeclaration = require('./XMLDeclaration');
+ XMLDocType = require('./XMLDocType');
+ XMLRaw = require('./XMLRaw');
+ XMLText = require('./XMLText');
+ XMLProcessingInstruction = require('./XMLProcessingInstruction');
+ XMLDummy = require('./XMLDummy');
+ NodeType = require('./NodeType');
+ XMLNodeList = require('./XMLNodeList');
+ XMLNamedNodeMap = require('./XMLNamedNodeMap');
+ DocumentPosition = require('./DocumentPosition');
+ }
+ }
+
+
+ // Sets the parent node of this node and its children recursively
+
+ // `parent` the parent node
+ setParent(parent) {
+ var child, j, len, ref1, results;
+ this.parent = parent;
+ if (parent) {
+ this.options = parent.options;
+ this.stringify = parent.stringify;
+ }
+ ref1 = this.children;
+ results = [];
+ for (j = 0, len = ref1.length; j < len; j++) {
+ child = ref1[j];
+ results.push(child.setParent(this));
+ }
+ return results;
+ }
+
+ // Creates a child element node
+
+ // `name` node name or an object describing the XML tree
+ // `attributes` an object containing name/value pairs of attributes
+ // `text` element text
+ element(name, attributes, text) {
+ var childNode, item, j, k, key, lastChild, len, len1, val;
+ lastChild = null;
+ if (attributes === null && (text == null)) {
+ [attributes, text] = [{}, null];
+ }
+ if (attributes == null) {
+ attributes = {};
+ }
+ attributes = getValue(attributes);
+ // swap argument order: text <-> attributes
+ if (!isObject(attributes)) {
+ [text, attributes] = [attributes, text];
+ }
+ if (name != null) {
+ name = getValue(name);
+ }
+ // expand if array
+ if (Array.isArray(name)) {
+ for (j = 0, len = name.length; j < len; j++) {
+ item = name[j];
+ lastChild = this.element(item);
+ }
+ // evaluate if function
+ } else if (isFunction(name)) {
+ lastChild = this.element(name.apply());
+ // expand if object
+ } else if (isObject(name)) {
+ for (key in name) {
+ if (!hasProp.call(name, key)) continue;
+ val = name[key];
+ if (isFunction(val)) {
+ // evaluate if function
+ val = val.apply();
+ }
+ // assign attributes
+ if (!this.options.ignoreDecorators && this.stringify.convertAttKey && key.indexOf(this.stringify.convertAttKey) === 0) {
+ lastChild = this.attribute(key.substr(this.stringify.convertAttKey.length), val);
+ // skip empty arrays
+ } else if (!this.options.separateArrayItems && Array.isArray(val) && isEmpty(val)) {
+ lastChild = this.dummy();
+ // empty objects produce one node
+ } else if (isObject(val) && isEmpty(val)) {
+ lastChild = this.element(key);
+ // skip null and undefined nodes
+ } else if (!this.options.keepNullNodes && (val == null)) {
+ lastChild = this.dummy();
+
+ // expand list by creating child nodes
+ } else if (!this.options.separateArrayItems && Array.isArray(val)) {
+ for (k = 0, len1 = val.length; k < len1; k++) {
+ item = val[k];
+ childNode = {};
+ childNode[key] = item;
+ lastChild = this.element(childNode);
+ }
+
+ // expand child nodes under parent
+ } else if (isObject(val)) {
+ // if the key is #text expand child nodes under this node to support mixed content
+ if (!this.options.ignoreDecorators && this.stringify.convertTextKey && key.indexOf(this.stringify.convertTextKey) === 0) {
+ lastChild = this.element(val);
+ } else {
+ lastChild = this.element(key);
+ lastChild.element(val);
+ }
+ } else {
+
+ // text node
+ lastChild = this.element(key, val);
+ }
+ }
+ // skip null nodes
+ } else if (!this.options.keepNullNodes && text === null) {
+ lastChild = this.dummy();
+ } else {
+ // text node
+ if (!this.options.ignoreDecorators && this.stringify.convertTextKey && name.indexOf(this.stringify.convertTextKey) === 0) {
+ lastChild = this.text(text);
+ // cdata node
+ } else if (!this.options.ignoreDecorators && this.stringify.convertCDataKey && name.indexOf(this.stringify.convertCDataKey) === 0) {
+ lastChild = this.cdata(text);
+ // comment node
+ } else if (!this.options.ignoreDecorators && this.stringify.convertCommentKey && name.indexOf(this.stringify.convertCommentKey) === 0) {
+ lastChild = this.comment(text);
+ // raw text node
+ } else if (!this.options.ignoreDecorators && this.stringify.convertRawKey && name.indexOf(this.stringify.convertRawKey) === 0) {
+ lastChild = this.raw(text);
+ // processing instruction
+ } else if (!this.options.ignoreDecorators && this.stringify.convertPIKey && name.indexOf(this.stringify.convertPIKey) === 0) {
+ lastChild = this.instruction(name.substr(this.stringify.convertPIKey.length), text);
+ } else {
+ // element node
+ lastChild = this.node(name, attributes, text);
+ }
+ }
+ if (lastChild == null) {
+ throw new Error("Could not create any elements with: " + name + ". " + this.debugInfo());
+ }
+ return lastChild;
+ }
+
+ // Creates a child element node before the current node
+
+ // `name` node name or an object describing the XML tree
+ // `attributes` an object containing name/value pairs of attributes
+ // `text` element text
+ insertBefore(name, attributes, text) {
+ var child, i, newChild, refChild, removed;
+ // DOM level 1
+ // insertBefore(newChild, refChild) inserts the child node newChild before refChild
+ if (name != null ? name.type : void 0) {
+ newChild = name;
+ refChild = attributes;
+ newChild.setParent(this);
+ if (refChild) {
+ // temporarily remove children starting *with* refChild
+ i = children.indexOf(refChild);
+ removed = children.splice(i);
+
+ // add the new child
+ children.push(newChild);
+
+ // add back removed children after new child
+ Array.prototype.push.apply(children, removed);
+ } else {
+ children.push(newChild);
+ }
+ return newChild;
+ } else {
+ if (this.isRoot) {
+ throw new Error("Cannot insert elements at root level. " + this.debugInfo(name));
+ }
+
+ // temporarily remove children starting *with* this
+ i = this.parent.children.indexOf(this);
+ removed = this.parent.children.splice(i);
+
+ // add the new child
+ child = this.parent.element(name, attributes, text);
+
+ // add back removed children after new child
+ Array.prototype.push.apply(this.parent.children, removed);
+ return child;
+ }
+ }
+
+ // Creates a child element node after the current node
+
+ // `name` node name or an object describing the XML tree
+ // `attributes` an object containing name/value pairs of attributes
+ // `text` element text
+ insertAfter(name, attributes, text) {
+ var child, i, removed;
+ if (this.isRoot) {
+ throw new Error("Cannot insert elements at root level. " + this.debugInfo(name));
+ }
+
+ // temporarily remove children starting *after* this
+ i = this.parent.children.indexOf(this);
+ removed = this.parent.children.splice(i + 1);
+
+ // add the new child
+ child = this.parent.element(name, attributes, text);
+
+ // add back removed children after new child
+ Array.prototype.push.apply(this.parent.children, removed);
+ return child;
+ }
+
+ // Deletes a child element node
+
+ remove() {
+ var i, ref1;
+ if (this.isRoot) {
+ throw new Error("Cannot remove the root element. " + this.debugInfo());
+ }
+ i = this.parent.children.indexOf(this);
+ splice.apply(this.parent.children, [i, i - i + 1].concat(ref1 = [])), ref1;
+ return this.parent;
+ }
+
+ // Creates a node
+
+ // `name` name of the node
+ // `attributes` an object containing name/value pairs of attributes
+ // `text` element text
+ node(name, attributes, text) {
+ var child;
+ if (name != null) {
+ name = getValue(name);
+ }
+ attributes || (attributes = {});
+ attributes = getValue(attributes);
+ // swap argument order: text <-> attributes
+ if (!isObject(attributes)) {
+ [text, attributes] = [attributes, text];
+ }
+ child = new XMLElement(this, name, attributes);
+ if (text != null) {
+ child.text(text);
+ }
+ this.children.push(child);
+ return child;
+ }
+
+ // Creates a text node
+
+ // `value` element text
+ text(value) {
+ var child;
+ if (isObject(value)) {
+ this.element(value);
+ }
+ child = new XMLText(this, value);
+ this.children.push(child);
+ return this;
+ }
+
+ // Creates a CDATA node
+
+ // `value` element text without CDATA delimiters
+ cdata(value) {
+ var child;
+ child = new XMLCData(this, value);
+ this.children.push(child);
+ return this;
+ }
+
+ // Creates a comment node
+
+ // `value` comment text
+ comment(value) {
+ var child;
+ child = new XMLComment(this, value);
+ this.children.push(child);
+ return this;
+ }
+
+ // Creates a comment node before the current node
+
+ // `value` comment text
+ commentBefore(value) {
+ var child, i, removed;
+ // temporarily remove children starting *with* this
+ i = this.parent.children.indexOf(this);
+ removed = this.parent.children.splice(i);
+ // add the new child
+ child = this.parent.comment(value);
+ // add back removed children after new child
+ Array.prototype.push.apply(this.parent.children, removed);
+ return this;
+ }
+
+ // Creates a comment node after the current node
+
+ // `value` comment text
+ commentAfter(value) {
+ var child, i, removed;
+ // temporarily remove children starting *after* this
+ i = this.parent.children.indexOf(this);
+ removed = this.parent.children.splice(i + 1);
+ // add the new child
+ child = this.parent.comment(value);
+ // add back removed children after new child
+ Array.prototype.push.apply(this.parent.children, removed);
+ return this;
+ }
+
+ // Adds unescaped raw text
+
+ // `value` text
+ raw(value) {
+ var child;
+ child = new XMLRaw(this, value);
+ this.children.push(child);
+ return this;
+ }
+
+ // Adds a dummy node
+ dummy() {
+ var child;
+ child = new XMLDummy(this);
+ // Normally when a new node is created it is added to the child node collection.
+ // However, dummy nodes are never added to the XML tree. They are created while
+ // converting JS objects to XML nodes in order not to break the recursive function
+ // chain. They can be thought of as invisible nodes. They can be traversed through
+ // by using prev(), next(), up(), etc. functions but they do not exists in the tree.
+
+ // @children.push child
+ return child;
+ }
+
+ // Adds a processing instruction
+
+ // `target` instruction target
+ // `value` instruction value
+ instruction(target, value) {
+ var insTarget, insValue, instruction, j, len;
+ if (target != null) {
+ target = getValue(target);
+ }
+ if (value != null) {
+ value = getValue(value);
+ }
+ if (Array.isArray(target)) { // expand if array
+ for (j = 0, len = target.length; j < len; j++) {
+ insTarget = target[j];
+ this.instruction(insTarget);
+ }
+ } else if (isObject(target)) { // expand if object
+ for (insTarget in target) {
+ if (!hasProp.call(target, insTarget)) continue;
+ insValue = target[insTarget];
+ this.instruction(insTarget, insValue);
+ }
+ } else {
+ if (isFunction(value)) {
+ value = value.apply();
+ }
+ instruction = new XMLProcessingInstruction(this, target, value);
+ this.children.push(instruction);
+ }
+ return this;
+ }
+
+ // Creates a processing instruction node before the current node
+
+ // `target` instruction target
+ // `value` instruction value
+ instructionBefore(target, value) {
+ var child, i, removed;
+ // temporarily remove children starting *with* this
+ i = this.parent.children.indexOf(this);
+ removed = this.parent.children.splice(i);
+ // add the new child
+ child = this.parent.instruction(target, value);
+ // add back removed children after new child
+ Array.prototype.push.apply(this.parent.children, removed);
+ return this;
+ }
+
+ // Creates a processing instruction node after the current node
+
+ // `target` instruction target
+ // `value` instruction value
+ instructionAfter(target, value) {
+ var child, i, removed;
+ // temporarily remove children starting *after* this
+ i = this.parent.children.indexOf(this);
+ removed = this.parent.children.splice(i + 1);
+ // add the new child
+ child = this.parent.instruction(target, value);
+ // add back removed children after new child
+ Array.prototype.push.apply(this.parent.children, removed);
+ return this;
+ }
+
+ // Creates the xml declaration
+
+ // `version` A version number string, e.g. 1.0
+ // `encoding` Encoding declaration, e.g. UTF-8
+ // `standalone` standalone document declaration: true or false
+ declaration(version, encoding, standalone) {
+ var doc, xmldec;
+ doc = this.document();
+ xmldec = new XMLDeclaration(doc, version, encoding, standalone);
+ // Replace XML declaration if exists, otherwise insert at top
+ if (doc.children.length === 0) {
+ doc.children.unshift(xmldec);
+ } else if (doc.children[0].type === NodeType.Declaration) {
+ doc.children[0] = xmldec;
+ } else {
+ doc.children.unshift(xmldec);
+ }
+ return doc.root() || doc;
+ }
+
+ // Creates the document type declaration
+
+ // `pubID` the public identifier of the external subset
+ // `sysID` the system identifier of the external subset
+ dtd(pubID, sysID) {
+ var child, doc, doctype, i, j, k, len, len1, ref1, ref2;
+ doc = this.document();
+ doctype = new XMLDocType(doc, pubID, sysID);
+ ref1 = doc.children;
+ // Replace DTD if exists
+ for (i = j = 0, len = ref1.length; j < len; i = ++j) {
+ child = ref1[i];
+ if (child.type === NodeType.DocType) {
+ doc.children[i] = doctype;
+ return doctype;
+ }
+ }
+ ref2 = doc.children;
+ // insert before root node if the root node exists
+ for (i = k = 0, len1 = ref2.length; k < len1; i = ++k) {
+ child = ref2[i];
+ if (child.isRoot) {
+ doc.children.splice(i, 0, doctype);
+ return doctype;
+ }
+ }
+ // otherwise append to end
+ doc.children.push(doctype);
+ return doctype;
+ }
+
+ // Gets the parent node
+ up() {
+ if (this.isRoot) {
+ throw new Error("The root node has no parent. Use doc() if you need to get the document object.");
+ }
+ return this.parent;
+ }
+
+ // Gets the root node
+ root() {
+ var node;
+ node = this;
+ while (node) {
+ if (node.type === NodeType.Document) {
+ return node.rootObject;
+ } else if (node.isRoot) {
+ return node;
+ } else {
+ node = node.parent;
+ }
+ }
+ }
+
+ // Gets the node representing the XML document
+ document() {
+ var node;
+ node = this;
+ while (node) {
+ if (node.type === NodeType.Document) {
+ return node;
+ } else {
+ node = node.parent;
+ }
+ }
+ }
+
+ // Ends the document and converts string
+ end(options) {
+ return this.document().end(options);
+ }
+
+ // Gets the previous node
+ prev() {
+ var i;
+ i = this.parent.children.indexOf(this);
+ if (i < 1) {
+ throw new Error("Already at the first node. " + this.debugInfo());
+ }
+ return this.parent.children[i - 1];
+ }
+
+ // Gets the next node
+ next() {
+ var i;
+ i = this.parent.children.indexOf(this);
+ if (i === -1 || i === this.parent.children.length - 1) {
+ throw new Error("Already at the last node. " + this.debugInfo());
+ }
+ return this.parent.children[i + 1];
+ }
+
+ // Imports cloned root from another XML document
+
+ // `doc` the XML document to insert nodes from
+ importDocument(doc) {
+ var child, clonedRoot, j, len, ref1;
+ clonedRoot = doc.root().clone();
+ clonedRoot.parent = this;
+ clonedRoot.isRoot = false;
+ this.children.push(clonedRoot);
+ // set properties if imported element becomes the root node
+ if (this.type === NodeType.Document) {
+ clonedRoot.isRoot = true;
+ clonedRoot.documentObject = this;
+ this.rootObject = clonedRoot;
+ // set dtd name
+ if (this.children) {
+ ref1 = this.children;
+ for (j = 0, len = ref1.length; j < len; j++) {
+ child = ref1[j];
+ if (child.type === NodeType.DocType) {
+ child.name = clonedRoot.name;
+ break;
+ }
+ }
+ }
+ }
+ return this;
+ }
+
+
+ // Returns debug string for this node
+ debugInfo(name) {
+ var ref1, ref2;
+ name = name || this.name;
+ if ((name == null) && !((ref1 = this.parent) != null ? ref1.name : void 0)) {
+ return "";
+ } else if (name == null) {
+ return "parent: <" + this.parent.name + ">";
+ } else if (!((ref2 = this.parent) != null ? ref2.name : void 0)) {
+ return "node: <" + name + ">";
+ } else {
+ return "node: <" + name + ">, parent: <" + this.parent.name + ">";
+ }
+ }
+
+ // Aliases
+ ele(name, attributes, text) {
+ return this.element(name, attributes, text);
+ }
+
+ nod(name, attributes, text) {
+ return this.node(name, attributes, text);
+ }
+
+ txt(value) {
+ return this.text(value);
+ }
+
+ dat(value) {
+ return this.cdata(value);
+ }
+
+ com(value) {
+ return this.comment(value);
+ }
+
+ ins(target, value) {
+ return this.instruction(target, value);
+ }
+
+ doc() {
+ return this.document();
+ }
+
+ dec(version, encoding, standalone) {
+ return this.declaration(version, encoding, standalone);
+ }
+
+ e(name, attributes, text) {
+ return this.element(name, attributes, text);
+ }
+
+ n(name, attributes, text) {
+ return this.node(name, attributes, text);
+ }
+
+ t(value) {
+ return this.text(value);
+ }
+
+ d(value) {
+ return this.cdata(value);
+ }
+
+ c(value) {
+ return this.comment(value);
+ }
+
+ r(value) {
+ return this.raw(value);
+ }
+
+ i(target, value) {
+ return this.instruction(target, value);
+ }
+
+ u() {
+ return this.up();
+ }
+
+ // can be deprecated in a future release
+ importXMLBuilder(doc) {
+ return this.importDocument(doc);
+ }
+
+ // Adds or modifies an attribute.
+
+ // `name` attribute name
+ // `value` attribute value
+ attribute(name, value) {
+ throw new Error("attribute() applies to element nodes only.");
+ }
+
+ att(name, value) {
+ return this.attribute(name, value);
+ }
+
+ a(name, value) {
+ return this.attribute(name, value);
+ }
+
+ // Removes an attribute
+
+ // `name` attribute name
+ removeAttribute(name) {
+ throw new Error("attribute() applies to element nodes only.");
+ }
+
+ // DOM level 1 functions to be implemented later
+ replaceChild(newChild, oldChild) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ removeChild(oldChild) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ appendChild(newChild) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ hasChildNodes() {
+ return this.children.length !== 0;
+ }
+
+ cloneNode(deep) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ normalize() {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ // DOM level 2
+ isSupported(feature, version) {
+ return true;
+ }
+
+ hasAttributes() {
+ return this.attribs.length !== 0;
+ }
+
+ // DOM level 3 functions to be implemented later
+ compareDocumentPosition(other) {
+ var ref, res;
+ ref = this;
+ if (ref === other) {
+ return 0;
+ } else if (this.document() !== other.document()) {
+ res = DocumentPosition.Disconnected | DocumentPosition.ImplementationSpecific;
+ if (Math.random() < 0.5) {
+ res |= DocumentPosition.Preceding;
+ } else {
+ res |= DocumentPosition.Following;
+ }
+ return res;
+ } else if (ref.isAncestor(other)) {
+ return DocumentPosition.Contains | DocumentPosition.Preceding;
+ } else if (ref.isDescendant(other)) {
+ return DocumentPosition.Contains | DocumentPosition.Following;
+ } else if (ref.isPreceding(other)) {
+ return DocumentPosition.Preceding;
+ } else {
+ return DocumentPosition.Following;
+ }
+ }
+
+ isSameNode(other) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ lookupPrefix(namespaceURI) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ isDefaultNamespace(namespaceURI) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ lookupNamespaceURI(prefix) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ isEqualNode(node) {
+ var i, j, ref1;
+ if (node.nodeType !== this.nodeType) {
+ return false;
+ }
+ if (node.children.length !== this.children.length) {
+ return false;
+ }
+ for (i = j = 0, ref1 = this.children.length - 1; (0 <= ref1 ? j <= ref1 : j >= ref1); i = 0 <= ref1 ? ++j : --j) {
+ if (!this.children[i].isEqualNode(node.children[i])) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ getFeature(feature, version) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ setUserData(key, data, handler) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ getUserData(key) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ // Returns true if other is an inclusive descendant of node,
+ // and false otherwise.
+ contains(other) {
+ if (!other) {
+ return false;
+ }
+ return other === this || this.isDescendant(other);
+ }
+
+ // An object A is called a descendant of an object B, if either A is
+ // a child of B or A is a child of an object C that is a descendant of B.
+ isDescendant(node) {
+ var child, isDescendantChild, j, len, ref1;
+ ref1 = this.children;
+ for (j = 0, len = ref1.length; j < len; j++) {
+ child = ref1[j];
+ if (node === child) {
+ return true;
+ }
+ isDescendantChild = child.isDescendant(node);
+ if (isDescendantChild) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ // An object A is called an ancestor of an object B if and only if
+ // B is a descendant of A.
+ isAncestor(node) {
+ return node.isDescendant(this);
+ }
+
+ // An object A is preceding an object B if A and B are in the
+ // same tree and A comes before B in tree order.
+ isPreceding(node) {
+ var nodePos, thisPos;
+ nodePos = this.treePosition(node);
+ thisPos = this.treePosition(this);
+ if (nodePos === -1 || thisPos === -1) {
+ return false;
+ } else {
+ return nodePos < thisPos;
+ }
+ }
+
+ // An object A is folllowing an object B if A and B are in the
+ // same tree and A comes after B in tree order.
+ isFollowing(node) {
+ var nodePos, thisPos;
+ nodePos = this.treePosition(node);
+ thisPos = this.treePosition(this);
+ if (nodePos === -1 || thisPos === -1) {
+ return false;
+ } else {
+ return nodePos > thisPos;
+ }
+ }
+
+ // Returns the preorder position of the given node in the tree, or -1
+ // if the node is not in the tree.
+ treePosition(node) {
+ var found, pos;
+ pos = 0;
+ found = false;
+ this.foreachTreeNode(this.document(), function(childNode) {
+ pos++;
+ if (!found && childNode === node) {
+ return found = true;
+ }
+ });
+ if (found) {
+ return pos;
+ } else {
+ return -1;
+ }
+ }
+
+
+ // Depth-first preorder traversal through the XML tree
+ foreachTreeNode(node, func) {
+ var child, j, len, ref1, res;
+ node || (node = this.document());
+ ref1 = node.children;
+ for (j = 0, len = ref1.length; j < len; j++) {
+ child = ref1[j];
+ if (res = func(child)) {
+ return res;
+ } else {
+ res = this.foreachTreeNode(child, func);
+ if (res) {
+ return res;
+ }
+ }
+ }
+ }
+
+ };
+
+ // DOM level 1
+ Object.defineProperty(XMLNode.prototype, 'nodeName', {
+ get: function() {
+ return this.name;
+ }
+ });
+
+ Object.defineProperty(XMLNode.prototype, 'nodeType', {
+ get: function() {
+ return this.type;
+ }
+ });
+
+ Object.defineProperty(XMLNode.prototype, 'nodeValue', {
+ get: function() {
+ return this.value;
+ }
+ });
+
+ Object.defineProperty(XMLNode.prototype, 'parentNode', {
+ get: function() {
+ return this.parent;
+ }
+ });
+
+ Object.defineProperty(XMLNode.prototype, 'childNodes', {
+ get: function() {
+ if (!this.childNodeList || !this.childNodeList.nodes) {
+ this.childNodeList = new XMLNodeList(this.children);
+ }
+ return this.childNodeList;
+ }
+ });
+
+ Object.defineProperty(XMLNode.prototype, 'firstChild', {
+ get: function() {
+ return this.children[0] || null;
+ }
+ });
+
+ Object.defineProperty(XMLNode.prototype, 'lastChild', {
+ get: function() {
+ return this.children[this.children.length - 1] || null;
+ }
+ });
+
+ Object.defineProperty(XMLNode.prototype, 'previousSibling', {
+ get: function() {
+ var i;
+ i = this.parent.children.indexOf(this);
+ return this.parent.children[i - 1] || null;
+ }
+ });
+
+ Object.defineProperty(XMLNode.prototype, 'nextSibling', {
+ get: function() {
+ var i;
+ i = this.parent.children.indexOf(this);
+ return this.parent.children[i + 1] || null;
+ }
+ });
+
+ Object.defineProperty(XMLNode.prototype, 'ownerDocument', {
+ get: function() {
+ return this.document() || null;
+ }
+ });
+
+ // DOM level 3
+ Object.defineProperty(XMLNode.prototype, 'textContent', {
+ get: function() {
+ var child, j, len, ref1, str;
+ if (this.nodeType === NodeType.Element || this.nodeType === NodeType.DocumentFragment) {
+ str = '';
+ ref1 = this.children;
+ for (j = 0, len = ref1.length; j < len; j++) {
+ child = ref1[j];
+ if (child.textContent) {
+ str += child.textContent;
+ }
+ }
+ return str;
+ } else {
+ return null;
+ }
+ },
+ set: function(value) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+ });
+
+ return XMLNode;
+
+ }).call(this);
+
+}).call(this);
diff --git a/generator/node_modules/xmlbuilder/lib/XMLNodeFilter.js b/generator/node_modules/xmlbuilder/lib/XMLNodeFilter.js
new file mode 100644
index 0000000..3f33f45
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/lib/XMLNodeFilter.js
@@ -0,0 +1,51 @@
+// Generated by CoffeeScript 2.4.1
+(function() {
+ // Represents a node filter
+ var XMLNodeFilter;
+
+ module.exports = XMLNodeFilter = (function() {
+ class XMLNodeFilter {
+ // DOM level 4 functions to be implemented later
+ acceptNode(node) {
+ throw new Error("This DOM method is not implemented.");
+ }
+
+ };
+
+ XMLNodeFilter.prototype.FilterAccept = 1;
+
+ XMLNodeFilter.prototype.FilterReject = 2;
+
+ XMLNodeFilter.prototype.FilterSkip = 3;
+
+ XMLNodeFilter.prototype.ShowAll = 0xffffffff;
+
+ XMLNodeFilter.prototype.ShowElement = 0x1;
+
+ XMLNodeFilter.prototype.ShowAttribute = 0x2;
+
+ XMLNodeFilter.prototype.ShowText = 0x4;
+
+ XMLNodeFilter.prototype.ShowCDataSection = 0x8;
+
+ XMLNodeFilter.prototype.ShowEntityReference = 0x10;
+
+ XMLNodeFilter.prototype.ShowEntity = 0x20;
+
+ XMLNodeFilter.prototype.ShowProcessingInstruction = 0x40;
+
+ XMLNodeFilter.prototype.ShowComment = 0x80;
+
+ XMLNodeFilter.prototype.ShowDocument = 0x100;
+
+ XMLNodeFilter.prototype.ShowDocumentType = 0x200;
+
+ XMLNodeFilter.prototype.ShowDocumentFragment = 0x400;
+
+ XMLNodeFilter.prototype.ShowNotation = 0x800;
+
+ return XMLNodeFilter;
+
+ }).call(this);
+
+}).call(this);
diff --git a/generator/node_modules/xmlbuilder/lib/XMLNodeList.js b/generator/node_modules/xmlbuilder/lib/XMLNodeList.js
new file mode 100644
index 0000000..8570096
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/lib/XMLNodeList.js
@@ -0,0 +1,45 @@
+// Generated by CoffeeScript 2.4.1
+(function() {
+ // Represents a list of nodes
+ var XMLNodeList;
+
+ module.exports = XMLNodeList = (function() {
+ class XMLNodeList {
+ // Initializes a new instance of `XMLNodeList`
+ // This is just a wrapper around an ordinary
+ // JS array.
+
+ // `nodes` the array containing nodes.
+ constructor(nodes) {
+ this.nodes = nodes;
+ }
+
+ // Creates and returns a deep clone of `this`
+
+ clone() {
+ // this class should not be cloned since it wraps
+ // around a given array. The calling function should check
+ // whether the wrapped array is null and supply a new array
+ // (from the clone).
+ return this.nodes = null;
+ }
+
+ // DOM Level 1
+ item(index) {
+ return this.nodes[index] || null;
+ }
+
+ };
+
+ // DOM level 1
+ Object.defineProperty(XMLNodeList.prototype, 'length', {
+ get: function() {
+ return this.nodes.length || 0;
+ }
+ });
+
+ return XMLNodeList;
+
+ }).call(this);
+
+}).call(this);
diff --git a/generator/node_modules/xmlbuilder/lib/XMLProcessingInstruction.js b/generator/node_modules/xmlbuilder/lib/XMLProcessingInstruction.js
new file mode 100644
index 0000000..88b8fcd
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/lib/XMLProcessingInstruction.js
@@ -0,0 +1,56 @@
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, XMLCharacterData, XMLProcessingInstruction;
+
+ NodeType = require('./NodeType');
+
+ XMLCharacterData = require('./XMLCharacterData');
+
+ // Represents a processing instruction
+ module.exports = XMLProcessingInstruction = class XMLProcessingInstruction extends XMLCharacterData {
+ // Initializes a new instance of `XMLProcessingInstruction`
+
+ // `parent` the parent node
+ // `target` instruction target
+ // `value` instruction value
+ constructor(parent, target, value) {
+ super(parent);
+ if (target == null) {
+ throw new Error("Missing instruction target. " + this.debugInfo());
+ }
+ this.type = NodeType.ProcessingInstruction;
+ this.target = this.stringify.insTarget(target);
+ this.name = this.target;
+ if (value) {
+ this.value = this.stringify.insValue(value);
+ }
+ }
+
+ // Creates and returns a deep clone of `this`
+ clone() {
+ return Object.create(this);
+ }
+
+ // Converts the XML fragment to string
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation for pretty print
+ // `options.offset` how many indentations to add to every line for pretty print
+ // `options.newline` newline sequence for pretty print
+ toString(options) {
+ return this.options.writer.processingInstruction(this, this.options.writer.filterOptions(options));
+ }
+
+ isEqualNode(node) {
+ if (!super.isEqualNode(node)) {
+ return false;
+ }
+ if (node.target !== this.target) {
+ return false;
+ }
+ return true;
+ }
+
+ };
+
+}).call(this);
diff --git a/generator/node_modules/xmlbuilder/lib/XMLRaw.js b/generator/node_modules/xmlbuilder/lib/XMLRaw.js
new file mode 100644
index 0000000..4addc8b
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/lib/XMLRaw.js
@@ -0,0 +1,40 @@
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, XMLNode, XMLRaw;
+
+ NodeType = require('./NodeType');
+
+ XMLNode = require('./XMLNode');
+
+ // Represents a raw node
+ module.exports = XMLRaw = class XMLRaw extends XMLNode {
+ // Initializes a new instance of `XMLRaw`
+
+ // `text` raw text
+ constructor(parent, text) {
+ super(parent);
+ if (text == null) {
+ throw new Error("Missing raw text. " + this.debugInfo());
+ }
+ this.type = NodeType.Raw;
+ this.value = this.stringify.raw(text);
+ }
+
+ // Creates and returns a deep clone of `this`
+ clone() {
+ return Object.create(this);
+ }
+
+ // Converts the XML fragment to string
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation for pretty print
+ // `options.offset` how many indentations to add to every line for pretty print
+ // `options.newline` newline sequence for pretty print
+ toString(options) {
+ return this.options.writer.raw(this, this.options.writer.filterOptions(options));
+ }
+
+ };
+
+}).call(this);
diff --git a/generator/node_modules/xmlbuilder/lib/XMLStreamWriter.js b/generator/node_modules/xmlbuilder/lib/XMLStreamWriter.js
new file mode 100644
index 0000000..c0422a2
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/lib/XMLStreamWriter.js
@@ -0,0 +1,209 @@
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, WriterState, XMLStreamWriter, XMLWriterBase,
+ hasProp = {}.hasOwnProperty;
+
+ NodeType = require('./NodeType');
+
+ XMLWriterBase = require('./XMLWriterBase');
+
+ WriterState = require('./WriterState');
+
+ // Prints XML nodes to a stream
+ module.exports = XMLStreamWriter = class XMLStreamWriter extends XMLWriterBase {
+ // Initializes a new instance of `XMLStreamWriter`
+
+ // `stream` output stream
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation string
+ // `options.newline` newline sequence
+ // `options.offset` a fixed number of indentations to add to every line
+ // `options.allowEmpty` do not self close empty element tags
+ // 'options.dontPrettyTextNodes' if any text is present in node, don't indent or LF
+ // `options.spaceBeforeSlash` add a space before the closing slash of empty elements
+ constructor(stream, options) {
+ super(options);
+ this.stream = stream;
+ }
+
+ endline(node, options, level) {
+ if (node.isLastRootNode && options.state === WriterState.CloseTag) {
+ return '';
+ } else {
+ return super.endline(node, options, level);
+ }
+ }
+
+ document(doc, options) {
+ var child, i, j, k, len1, len2, ref, ref1, results;
+ ref = doc.children;
+ // set a flag so that we don't insert a newline after the last root level node
+ for (i = j = 0, len1 = ref.length; j < len1; i = ++j) {
+ child = ref[i];
+ child.isLastRootNode = i === doc.children.length - 1;
+ }
+ options = this.filterOptions(options);
+ ref1 = doc.children;
+ results = [];
+ for (k = 0, len2 = ref1.length; k < len2; k++) {
+ child = ref1[k];
+ results.push(this.writeChildNode(child, options, 0));
+ }
+ return results;
+ }
+
+ cdata(node, options, level) {
+ return this.stream.write(super.cdata(node, options, level));
+ }
+
+ comment(node, options, level) {
+ return this.stream.write(super.comment(node, options, level));
+ }
+
+ declaration(node, options, level) {
+ return this.stream.write(super.declaration(node, options, level));
+ }
+
+ docType(node, options, level) {
+ var child, j, len1, ref;
+ level || (level = 0);
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ this.stream.write(this.indent(node, options, level));
+ this.stream.write('<!DOCTYPE ' + node.root().name);
+ // external identifier
+ if (node.pubID && node.sysID) {
+ this.stream.write(' PUBLIC "' + node.pubID + '" "' + node.sysID + '"');
+ } else if (node.sysID) {
+ this.stream.write(' SYSTEM "' + node.sysID + '"');
+ }
+ // internal subset
+ if (node.children.length > 0) {
+ this.stream.write(' [');
+ this.stream.write(this.endline(node, options, level));
+ options.state = WriterState.InsideTag;
+ ref = node.children;
+ for (j = 0, len1 = ref.length; j < len1; j++) {
+ child = ref[j];
+ this.writeChildNode(child, options, level + 1);
+ }
+ options.state = WriterState.CloseTag;
+ this.stream.write(']');
+ }
+ // close tag
+ options.state = WriterState.CloseTag;
+ this.stream.write(options.spaceBeforeSlash + '>');
+ this.stream.write(this.endline(node, options, level));
+ options.state = WriterState.None;
+ return this.closeNode(node, options, level);
+ }
+
+ element(node, options, level) {
+ var att, attLen, child, childNodeCount, firstChildNode, j, len, len1, name, prettySuppressed, r, ratt, ref, ref1, ref2, rline;
+ level || (level = 0);
+ // open tag
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r = this.indent(node, options, level) + '<' + node.name;
+ // attributes
+ if (options.pretty && options.width > 0) {
+ len = r.length;
+ ref = node.attribs;
+ for (name in ref) {
+ if (!hasProp.call(ref, name)) continue;
+ att = ref[name];
+ ratt = this.attribute(att, options, level);
+ attLen = ratt.length;
+ if (len + attLen > options.width) {
+ rline = this.indent(node, options, level + 1) + ratt;
+ r += this.endline(node, options, level) + rline;
+ len = rline.length;
+ } else {
+ rline = ' ' + ratt;
+ r += rline;
+ len += rline.length;
+ }
+ }
+ } else {
+ ref1 = node.attribs;
+ for (name in ref1) {
+ if (!hasProp.call(ref1, name)) continue;
+ att = ref1[name];
+ r += this.attribute(att, options, level);
+ }
+ }
+ this.stream.write(r);
+ childNodeCount = node.children.length;
+ firstChildNode = childNodeCount === 0 ? null : node.children[0];
+ if (childNodeCount === 0 || node.children.every(function(e) {
+ return (e.type === NodeType.Text || e.type === NodeType.Raw || e.type === NodeType.CData) && e.value === '';
+ })) {
+ // empty element
+ if (options.allowEmpty) {
+ this.stream.write('>');
+ options.state = WriterState.CloseTag;
+ this.stream.write('</' + node.name + '>');
+ } else {
+ options.state = WriterState.CloseTag;
+ this.stream.write(options.spaceBeforeSlash + '/>');
+ }
+ } else if (options.pretty && childNodeCount === 1 && (firstChildNode.type === NodeType.Text || firstChildNode.type === NodeType.Raw || firstChildNode.type === NodeType.CData) && (firstChildNode.value != null)) {
+ // do not indent text-only nodes
+ this.stream.write('>');
+ options.state = WriterState.InsideTag;
+ options.suppressPrettyCount++;
+ prettySuppressed = true;
+ this.writeChildNode(firstChildNode, options, level + 1);
+ options.suppressPrettyCount--;
+ prettySuppressed = false;
+ options.state = WriterState.CloseTag;
+ this.stream.write('</' + node.name + '>');
+ } else {
+ this.stream.write('>' + this.endline(node, options, level));
+ options.state = WriterState.InsideTag;
+ ref2 = node.children;
+ // inner tags
+ for (j = 0, len1 = ref2.length; j < len1; j++) {
+ child = ref2[j];
+ this.writeChildNode(child, options, level + 1);
+ }
+ // close tag
+ options.state = WriterState.CloseTag;
+ this.stream.write(this.indent(node, options, level) + '</' + node.name + '>');
+ }
+ this.stream.write(this.endline(node, options, level));
+ options.state = WriterState.None;
+ return this.closeNode(node, options, level);
+ }
+
+ processingInstruction(node, options, level) {
+ return this.stream.write(super.processingInstruction(node, options, level));
+ }
+
+ raw(node, options, level) {
+ return this.stream.write(super.raw(node, options, level));
+ }
+
+ text(node, options, level) {
+ return this.stream.write(super.text(node, options, level));
+ }
+
+ dtdAttList(node, options, level) {
+ return this.stream.write(super.dtdAttList(node, options, level));
+ }
+
+ dtdElement(node, options, level) {
+ return this.stream.write(super.dtdElement(node, options, level));
+ }
+
+ dtdEntity(node, options, level) {
+ return this.stream.write(super.dtdEntity(node, options, level));
+ }
+
+ dtdNotation(node, options, level) {
+ return this.stream.write(super.dtdNotation(node, options, level));
+ }
+
+ };
+
+}).call(this);
diff --git a/generator/node_modules/xmlbuilder/lib/XMLStringWriter.js b/generator/node_modules/xmlbuilder/lib/XMLStringWriter.js
new file mode 100644
index 0000000..969caf5
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/lib/XMLStringWriter.js
@@ -0,0 +1,40 @@
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var XMLStringWriter, XMLWriterBase;
+
+ XMLWriterBase = require('./XMLWriterBase');
+
+ // Prints XML nodes as plain text
+ module.exports = XMLStringWriter = class XMLStringWriter extends XMLWriterBase {
+ // Initializes a new instance of `XMLStringWriter`
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation string
+ // `options.newline` newline sequence
+ // `options.offset` a fixed number of indentations to add to every line
+ // `options.allowEmpty` do not self close empty element tags
+ // 'options.dontPrettyTextNodes' if any text is present in node, don't indent or LF
+ // `options.spaceBeforeSlash` add a space before the closing slash of empty elements
+ constructor(options) {
+ super(options);
+ }
+
+ document(doc, options) {
+ var child, i, len, r, ref;
+ options = this.filterOptions(options);
+ r = '';
+ ref = doc.children;
+ for (i = 0, len = ref.length; i < len; i++) {
+ child = ref[i];
+ r += this.writeChildNode(child, options, 0);
+ }
+ // remove trailing newline
+ if (options.pretty && r.slice(-options.newline.length) === options.newline) {
+ r = r.slice(0, -options.newline.length);
+ }
+ return r;
+ }
+
+ };
+
+}).call(this);
diff --git a/generator/node_modules/xmlbuilder/lib/XMLStringifier.js b/generator/node_modules/xmlbuilder/lib/XMLStringifier.js
new file mode 100644
index 0000000..1a7cbb0
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/lib/XMLStringifier.js
@@ -0,0 +1,291 @@
+// Generated by CoffeeScript 2.4.1
+(function() {
+ // Converts values to strings
+ var XMLStringifier,
+ hasProp = {}.hasOwnProperty;
+
+ module.exports = XMLStringifier = (function() {
+ class XMLStringifier {
+ // Initializes a new instance of `XMLStringifier`
+
+ // `options.version` The version number string of the XML spec to validate against, e.g. 1.0
+ // `options.noDoubleEncoding` whether existing html entities are encoded: true or false
+ // `options.stringify` a set of functions to use for converting values to strings
+ // `options.noValidation` whether values will be validated and escaped or returned as is
+ // `options.invalidCharReplacement` a character to replace invalid characters and disable character validation
+ constructor(options) {
+ var key, ref, value;
+ // Checks whether the given string contains legal characters
+ // Fails with an exception on error
+
+ // `str` the string to check
+ this.assertLegalChar = this.assertLegalChar.bind(this);
+ // Checks whether the given string contains legal characters for a name
+ // Fails with an exception on error
+
+ // `str` the string to check
+ this.assertLegalName = this.assertLegalName.bind(this);
+ options || (options = {});
+ this.options = options;
+ if (!this.options.version) {
+ this.options.version = '1.0';
+ }
+ ref = options.stringify || {};
+ for (key in ref) {
+ if (!hasProp.call(ref, key)) continue;
+ value = ref[key];
+ this[key] = value;
+ }
+ }
+
+ // Defaults
+ name(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ return this.assertLegalName('' + val || '');
+ }
+
+ text(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ return this.assertLegalChar(this.textEscape('' + val || ''));
+ }
+
+ cdata(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ val = '' + val || '';
+ val = val.replace(']]>', ']]]]><![CDATA[>');
+ return this.assertLegalChar(val);
+ }
+
+ comment(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ val = '' + val || '';
+ if (val.match(/--/)) {
+ throw new Error("Comment text cannot contain double-hypen: " + val);
+ }
+ return this.assertLegalChar(val);
+ }
+
+ raw(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ return '' + val || '';
+ }
+
+ attValue(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ return this.assertLegalChar(this.attEscape(val = '' + val || ''));
+ }
+
+ insTarget(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ return this.assertLegalChar('' + val || '');
+ }
+
+ insValue(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ val = '' + val || '';
+ if (val.match(/\?>/)) {
+ throw new Error("Invalid processing instruction value: " + val);
+ }
+ return this.assertLegalChar(val);
+ }
+
+ xmlVersion(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ val = '' + val || '';
+ if (!val.match(/1\.[0-9]+/)) {
+ throw new Error("Invalid version number: " + val);
+ }
+ return val;
+ }
+
+ xmlEncoding(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ val = '' + val || '';
+ if (!val.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/)) {
+ throw new Error("Invalid encoding: " + val);
+ }
+ return this.assertLegalChar(val);
+ }
+
+ xmlStandalone(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ if (val) {
+ return "yes";
+ } else {
+ return "no";
+ }
+ }
+
+ dtdPubID(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ return this.assertLegalChar('' + val || '');
+ }
+
+ dtdSysID(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ return this.assertLegalChar('' + val || '');
+ }
+
+ dtdElementValue(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ return this.assertLegalChar('' + val || '');
+ }
+
+ dtdAttType(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ return this.assertLegalChar('' + val || '');
+ }
+
+ dtdAttDefault(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ return this.assertLegalChar('' + val || '');
+ }
+
+ dtdEntityValue(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ return this.assertLegalChar('' + val || '');
+ }
+
+ dtdNData(val) {
+ if (this.options.noValidation) {
+ return val;
+ }
+ return this.assertLegalChar('' + val || '');
+ }
+
+ assertLegalChar(str) {
+ var regex, res;
+ if (this.options.noValidation) {
+ return str;
+ }
+ if (this.options.version === '1.0') {
+ // Valid characters from https://www.w3.org/TR/xml/#charsets
+ // any Unicode character, excluding the surrogate blocks, FFFE, and FFFF.
+ // #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]
+ // This ES5 compatible Regexp has been generated using the "regenerate" NPM module:
+ // let xml_10_InvalidChars = regenerate()
+ // .addRange(0x0000, 0x0008)
+ // .add(0x000B, 0x000C)
+ // .addRange(0x000E, 0x001F)
+ // .addRange(0xD800, 0xDFFF)
+ // .addRange(0xFFFE, 0xFFFF)
+ regex = /[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g;
+ if (this.options.invalidCharReplacement !== void 0) {
+ str = str.replace(regex, this.options.invalidCharReplacement);
+ } else if (res = str.match(regex)) {
+ throw new Error(`Invalid character in string: ${str} at index ${res.index}`);
+ }
+ } else if (this.options.version === '1.1') {
+ // Valid characters from https://www.w3.org/TR/xml11/#charsets
+ // any Unicode character, excluding the surrogate blocks, FFFE, and FFFF.
+ // [#x1-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]
+ // This ES5 compatible Regexp has been generated using the "regenerate" NPM module:
+ // let xml_11_InvalidChars = regenerate()
+ // .add(0x0000)
+ // .addRange(0xD800, 0xDFFF)
+ // .addRange(0xFFFE, 0xFFFF)
+ regex = /[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g;
+ if (this.options.invalidCharReplacement !== void 0) {
+ str = str.replace(regex, this.options.invalidCharReplacement);
+ } else if (res = str.match(regex)) {
+ throw new Error(`Invalid character in string: ${str} at index ${res.index}`);
+ }
+ }
+ return str;
+ }
+
+ assertLegalName(str) {
+ var regex;
+ if (this.options.noValidation) {
+ return str;
+ }
+ str = this.assertLegalChar(str);
+ regex = /^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/;
+ if (!str.match(regex)) {
+ throw new Error(`Invalid character in name: ${str}`);
+ }
+ return str;
+ }
+
+ // Escapes special characters in text
+
+ // See http://www.w3.org/TR/2000/WD-xml-c14n-20000119.html#charescaping
+
+ // `str` the string to escape
+ textEscape(str) {
+ var ampregex;
+ if (this.options.noValidation) {
+ return str;
+ }
+ ampregex = this.options.noDoubleEncoding ? /(?!&(lt|gt|amp|apos|quot);)&/g : /&/g;
+ return str.replace(ampregex, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\r/g, '&#xD;');
+ }
+
+ // Escapes special characters in attribute values
+
+ // See http://www.w3.org/TR/2000/WD-xml-c14n-20000119.html#charescaping
+
+ // `str` the string to escape
+ attEscape(str) {
+ var ampregex;
+ if (this.options.noValidation) {
+ return str;
+ }
+ ampregex = this.options.noDoubleEncoding ? /(?!&(lt|gt|amp|apos|quot);)&/g : /&/g;
+ return str.replace(ampregex, '&amp;').replace(/</g, '&lt;').replace(/"/g, '&quot;').replace(/\t/g, '&#x9;').replace(/\n/g, '&#xA;').replace(/\r/g, '&#xD;');
+ }
+
+ };
+
+ // strings to match while converting from JS objects
+ XMLStringifier.prototype.convertAttKey = '@';
+
+ XMLStringifier.prototype.convertPIKey = '?';
+
+ XMLStringifier.prototype.convertTextKey = '#text';
+
+ XMLStringifier.prototype.convertCDataKey = '#cdata';
+
+ XMLStringifier.prototype.convertCommentKey = '#comment';
+
+ XMLStringifier.prototype.convertRawKey = '#raw';
+
+ return XMLStringifier;
+
+ }).call(this);
+
+}).call(this);
diff --git a/generator/node_modules/xmlbuilder/lib/XMLText.js b/generator/node_modules/xmlbuilder/lib/XMLText.js
new file mode 100644
index 0000000..24f9d4b
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/lib/XMLText.js
@@ -0,0 +1,82 @@
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, XMLCharacterData, XMLText;
+
+ NodeType = require('./NodeType');
+
+ XMLCharacterData = require('./XMLCharacterData');
+
+ // Represents a text node
+ module.exports = XMLText = (function() {
+ class XMLText extends XMLCharacterData {
+ // Initializes a new instance of `XMLText`
+
+ // `text` element text
+ constructor(parent, text) {
+ super(parent);
+ if (text == null) {
+ throw new Error("Missing element text. " + this.debugInfo());
+ }
+ this.name = "#text";
+ this.type = NodeType.Text;
+ this.value = this.stringify.text(text);
+ }
+
+ // Creates and returns a deep clone of `this`
+ clone() {
+ return Object.create(this);
+ }
+
+ // Converts the XML fragment to string
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation for pretty print
+ // `options.offset` how many indentations to add to every line for pretty print
+ // `options.newline` newline sequence for pretty print
+ toString(options) {
+ return this.options.writer.text(this, this.options.writer.filterOptions(options));
+ }
+
+ // DOM level 1 functions to be implemented later
+ splitText(offset) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ // DOM level 3 functions to be implemented later
+ replaceWholeText(content) {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+
+ };
+
+ // DOM level 3
+ Object.defineProperty(XMLText.prototype, 'isElementContentWhitespace', {
+ get: function() {
+ throw new Error("This DOM method is not implemented." + this.debugInfo());
+ }
+ });
+
+ Object.defineProperty(XMLText.prototype, 'wholeText', {
+ get: function() {
+ var next, prev, str;
+ str = '';
+ prev = this.previousSibling;
+ while (prev) {
+ str = prev.data + str;
+ prev = prev.previousSibling;
+ }
+ str += this.data;
+ next = this.nextSibling;
+ while (next) {
+ str = str + next.data;
+ next = next.nextSibling;
+ }
+ return str;
+ }
+ });
+
+ return XMLText;
+
+ }).call(this);
+
+}).call(this);
diff --git a/generator/node_modules/xmlbuilder/lib/XMLTypeInfo.js b/generator/node_modules/xmlbuilder/lib/XMLTypeInfo.js
new file mode 100644
index 0000000..1de000a
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/lib/XMLTypeInfo.js
@@ -0,0 +1,23 @@
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var Derivation, XMLTypeInfo;
+
+ Derivation = require('./Derivation');
+
+ // Represents a type referenced from element or attribute nodes.
+ module.exports = XMLTypeInfo = class XMLTypeInfo {
+ // Initializes a new instance of `XMLTypeInfo`
+
+ constructor(typeName, typeNamespace) {
+ this.typeName = typeName;
+ this.typeNamespace = typeNamespace;
+ }
+
+ // DOM level 3 functions to be implemented later
+ isDerivedFrom(typeNamespaceArg, typeNameArg, derivationMethod) {
+ throw new Error("This DOM method is not implemented.");
+ }
+
+ };
+
+}).call(this);
diff --git a/generator/node_modules/xmlbuilder/lib/XMLUserDataHandler.js b/generator/node_modules/xmlbuilder/lib/XMLUserDataHandler.js
new file mode 100644
index 0000000..97ade4f
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/lib/XMLUserDataHandler.js
@@ -0,0 +1,27 @@
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var OperationType, XMLUserDataHandler;
+
+ OperationType = require('./OperationType');
+
+ // Represents a handler that gets called when its associated
+ // node object is being cloned, imported, or renamed.
+ module.exports = XMLUserDataHandler = class XMLUserDataHandler {
+ // Initializes a new instance of `XMLUserDataHandler`
+
+ constructor() {}
+
+ // Called whenever the node for which this handler is
+ // registered is imported or cloned.
+
+ // `operation` type of operation that is being performed on the node
+ // `key` the key for which this handler is being called
+ // `data` the data for which this handler is being called
+ // `src` the node being cloned, adopted, imported, or renamed
+ // This is null when the node is being deleted.
+ // `dst` the node newly created if any, or null
+ handle(operation, key, data, src, dst) {}
+
+ };
+
+}).call(this);
diff --git a/generator/node_modules/xmlbuilder/lib/XMLWriterBase.js b/generator/node_modules/xmlbuilder/lib/XMLWriterBase.js
new file mode 100644
index 0000000..42c0195
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/lib/XMLWriterBase.js
@@ -0,0 +1,485 @@
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, WriterState, XMLCData, XMLComment, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDeclaration, XMLDocType, XMLDummy, XMLElement, XMLProcessingInstruction, XMLRaw, XMLText, XMLWriterBase, assign,
+ hasProp = {}.hasOwnProperty;
+
+ ({assign} = require('./Utility'));
+
+ NodeType = require('./NodeType');
+
+ XMLDeclaration = require('./XMLDeclaration');
+
+ XMLDocType = require('./XMLDocType');
+
+ XMLCData = require('./XMLCData');
+
+ XMLComment = require('./XMLComment');
+
+ XMLElement = require('./XMLElement');
+
+ XMLRaw = require('./XMLRaw');
+
+ XMLText = require('./XMLText');
+
+ XMLProcessingInstruction = require('./XMLProcessingInstruction');
+
+ XMLDummy = require('./XMLDummy');
+
+ XMLDTDAttList = require('./XMLDTDAttList');
+
+ XMLDTDElement = require('./XMLDTDElement');
+
+ XMLDTDEntity = require('./XMLDTDEntity');
+
+ XMLDTDNotation = require('./XMLDTDNotation');
+
+ WriterState = require('./WriterState');
+
+ // Base class for XML writers
+ module.exports = XMLWriterBase = class XMLWriterBase {
+ // Initializes a new instance of `XMLWriterBase`
+
+ // `options.pretty` pretty prints the result
+ // `options.indent` indentation string
+ // `options.newline` newline sequence
+ // `options.offset` a fixed number of indentations to add to every line
+ // `options.width` maximum column width
+ // `options.allowEmpty` do not self close empty element tags
+ // 'options.dontPrettyTextNodes' if any text is present in node, don't indent or LF
+ // `options.spaceBeforeSlash` add a space before the closing slash of empty elements
+ constructor(options) {
+ var key, ref, value;
+ options || (options = {});
+ this.options = options;
+ ref = options.writer || {};
+ for (key in ref) {
+ if (!hasProp.call(ref, key)) continue;
+ value = ref[key];
+ this["_" + key] = this[key];
+ this[key] = value;
+ }
+ }
+
+ // Filters writer options and provides defaults
+
+ // `options` writer options
+ filterOptions(options) {
+ var filteredOptions, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7;
+ options || (options = {});
+ options = assign({}, this.options, options);
+ filteredOptions = {
+ writer: this
+ };
+ filteredOptions.pretty = options.pretty || false;
+ filteredOptions.allowEmpty = options.allowEmpty || false;
+ filteredOptions.indent = (ref = options.indent) != null ? ref : ' ';
+ filteredOptions.newline = (ref1 = options.newline) != null ? ref1 : '\n';
+ filteredOptions.offset = (ref2 = options.offset) != null ? ref2 : 0;
+ filteredOptions.width = (ref3 = options.width) != null ? ref3 : 0;
+ filteredOptions.dontPrettyTextNodes = (ref4 = (ref5 = options.dontPrettyTextNodes) != null ? ref5 : options.dontprettytextnodes) != null ? ref4 : 0;
+ filteredOptions.spaceBeforeSlash = (ref6 = (ref7 = options.spaceBeforeSlash) != null ? ref7 : options.spacebeforeslash) != null ? ref6 : '';
+ if (filteredOptions.spaceBeforeSlash === true) {
+ filteredOptions.spaceBeforeSlash = ' ';
+ }
+ filteredOptions.suppressPrettyCount = 0;
+ filteredOptions.user = {};
+ filteredOptions.state = WriterState.None;
+ return filteredOptions;
+ }
+
+ // Returns the indentation string for the current level
+
+ // `node` current node
+ // `options` writer options
+ // `level` current indentation level
+ indent(node, options, level) {
+ var indentLevel;
+ if (!options.pretty || options.suppressPrettyCount) {
+ return '';
+ } else if (options.pretty) {
+ indentLevel = (level || 0) + options.offset + 1;
+ if (indentLevel > 0) {
+ return new Array(indentLevel).join(options.indent);
+ }
+ }
+ return '';
+ }
+
+ // Returns the newline string
+
+ // `node` current node
+ // `options` writer options
+ // `level` current indentation level
+ endline(node, options, level) {
+ if (!options.pretty || options.suppressPrettyCount) {
+ return '';
+ } else {
+ return options.newline;
+ }
+ }
+
+ attribute(att, options, level) {
+ var r;
+ this.openAttribute(att, options, level);
+ if (options.pretty && options.width > 0) {
+ r = att.name + '="' + att.value + '"';
+ } else {
+ r = ' ' + att.name + '="' + att.value + '"';
+ }
+ this.closeAttribute(att, options, level);
+ return r;
+ }
+
+ cdata(node, options, level) {
+ var r;
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r = this.indent(node, options, level) + '<![CDATA[';
+ options.state = WriterState.InsideTag;
+ r += node.value;
+ options.state = WriterState.CloseTag;
+ r += ']]>' + this.endline(node, options, level);
+ options.state = WriterState.None;
+ this.closeNode(node, options, level);
+ return r;
+ }
+
+ comment(node, options, level) {
+ var r;
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r = this.indent(node, options, level) + '<!-- ';
+ options.state = WriterState.InsideTag;
+ r += node.value;
+ options.state = WriterState.CloseTag;
+ r += ' -->' + this.endline(node, options, level);
+ options.state = WriterState.None;
+ this.closeNode(node, options, level);
+ return r;
+ }
+
+ declaration(node, options, level) {
+ var r;
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r = this.indent(node, options, level) + '<?xml';
+ options.state = WriterState.InsideTag;
+ r += ' version="' + node.version + '"';
+ if (node.encoding != null) {
+ r += ' encoding="' + node.encoding + '"';
+ }
+ if (node.standalone != null) {
+ r += ' standalone="' + node.standalone + '"';
+ }
+ options.state = WriterState.CloseTag;
+ r += options.spaceBeforeSlash + '?>';
+ r += this.endline(node, options, level);
+ options.state = WriterState.None;
+ this.closeNode(node, options, level);
+ return r;
+ }
+
+ docType(node, options, level) {
+ var child, i, len1, r, ref;
+ level || (level = 0);
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r = this.indent(node, options, level);
+ r += '<!DOCTYPE ' + node.root().name;
+ // external identifier
+ if (node.pubID && node.sysID) {
+ r += ' PUBLIC "' + node.pubID + '" "' + node.sysID + '"';
+ } else if (node.sysID) {
+ r += ' SYSTEM "' + node.sysID + '"';
+ }
+ // internal subset
+ if (node.children.length > 0) {
+ r += ' [';
+ r += this.endline(node, options, level);
+ options.state = WriterState.InsideTag;
+ ref = node.children;
+ for (i = 0, len1 = ref.length; i < len1; i++) {
+ child = ref[i];
+ r += this.writeChildNode(child, options, level + 1);
+ }
+ options.state = WriterState.CloseTag;
+ r += ']';
+ }
+ // close tag
+ options.state = WriterState.CloseTag;
+ r += options.spaceBeforeSlash + '>';
+ r += this.endline(node, options, level);
+ options.state = WriterState.None;
+ this.closeNode(node, options, level);
+ return r;
+ }
+
+ element(node, options, level) {
+ var att, attLen, child, childNodeCount, firstChildNode, i, j, len, len1, len2, name, prettySuppressed, r, ratt, ref, ref1, ref2, ref3, rline;
+ level || (level = 0);
+ prettySuppressed = false;
+ // open tag
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r = this.indent(node, options, level) + '<' + node.name;
+ // attributes
+ if (options.pretty && options.width > 0) {
+ len = r.length;
+ ref = node.attribs;
+ for (name in ref) {
+ if (!hasProp.call(ref, name)) continue;
+ att = ref[name];
+ ratt = this.attribute(att, options, level);
+ attLen = ratt.length;
+ if (len + attLen > options.width) {
+ rline = this.indent(node, options, level + 1) + ratt;
+ r += this.endline(node, options, level) + rline;
+ len = rline.length;
+ } else {
+ rline = ' ' + ratt;
+ r += rline;
+ len += rline.length;
+ }
+ }
+ } else {
+ ref1 = node.attribs;
+ for (name in ref1) {
+ if (!hasProp.call(ref1, name)) continue;
+ att = ref1[name];
+ r += this.attribute(att, options, level);
+ }
+ }
+ childNodeCount = node.children.length;
+ firstChildNode = childNodeCount === 0 ? null : node.children[0];
+ if (childNodeCount === 0 || node.children.every(function(e) {
+ return (e.type === NodeType.Text || e.type === NodeType.Raw || e.type === NodeType.CData) && e.value === '';
+ })) {
+ // empty element
+ if (options.allowEmpty) {
+ r += '>';
+ options.state = WriterState.CloseTag;
+ r += '</' + node.name + '>' + this.endline(node, options, level);
+ } else {
+ options.state = WriterState.CloseTag;
+ r += options.spaceBeforeSlash + '/>' + this.endline(node, options, level);
+ }
+ } else if (options.pretty && childNodeCount === 1 && (firstChildNode.type === NodeType.Text || firstChildNode.type === NodeType.Raw || firstChildNode.type === NodeType.CData) && (firstChildNode.value != null)) {
+ // do not indent text-only nodes
+ r += '>';
+ options.state = WriterState.InsideTag;
+ options.suppressPrettyCount++;
+ prettySuppressed = true;
+ r += this.writeChildNode(firstChildNode, options, level + 1);
+ options.suppressPrettyCount--;
+ prettySuppressed = false;
+ options.state = WriterState.CloseTag;
+ r += '</' + node.name + '>' + this.endline(node, options, level);
+ } else {
+ // if ANY are a text node, then suppress pretty now
+ if (options.dontPrettyTextNodes) {
+ ref2 = node.children;
+ for (i = 0, len1 = ref2.length; i < len1; i++) {
+ child = ref2[i];
+ if ((child.type === NodeType.Text || child.type === NodeType.Raw || child.type === NodeType.CData) && (child.value != null)) {
+ options.suppressPrettyCount++;
+ prettySuppressed = true;
+ break;
+ }
+ }
+ }
+ // close the opening tag, after dealing with newline
+ r += '>' + this.endline(node, options, level);
+ options.state = WriterState.InsideTag;
+ ref3 = node.children;
+ // inner tags
+ for (j = 0, len2 = ref3.length; j < len2; j++) {
+ child = ref3[j];
+ r += this.writeChildNode(child, options, level + 1);
+ }
+ // close tag
+ options.state = WriterState.CloseTag;
+ r += this.indent(node, options, level) + '</' + node.name + '>';
+ if (prettySuppressed) {
+ options.suppressPrettyCount--;
+ }
+ r += this.endline(node, options, level);
+ options.state = WriterState.None;
+ }
+ this.closeNode(node, options, level);
+ return r;
+ }
+
+ writeChildNode(node, options, level) {
+ switch (node.type) {
+ case NodeType.CData:
+ return this.cdata(node, options, level);
+ case NodeType.Comment:
+ return this.comment(node, options, level);
+ case NodeType.Element:
+ return this.element(node, options, level);
+ case NodeType.Raw:
+ return this.raw(node, options, level);
+ case NodeType.Text:
+ return this.text(node, options, level);
+ case NodeType.ProcessingInstruction:
+ return this.processingInstruction(node, options, level);
+ case NodeType.Dummy:
+ return '';
+ case NodeType.Declaration:
+ return this.declaration(node, options, level);
+ case NodeType.DocType:
+ return this.docType(node, options, level);
+ case NodeType.AttributeDeclaration:
+ return this.dtdAttList(node, options, level);
+ case NodeType.ElementDeclaration:
+ return this.dtdElement(node, options, level);
+ case NodeType.EntityDeclaration:
+ return this.dtdEntity(node, options, level);
+ case NodeType.NotationDeclaration:
+ return this.dtdNotation(node, options, level);
+ default:
+ throw new Error("Unknown XML node type: " + node.constructor.name);
+ }
+ }
+
+ processingInstruction(node, options, level) {
+ var r;
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r = this.indent(node, options, level) + '<?';
+ options.state = WriterState.InsideTag;
+ r += node.target;
+ if (node.value) {
+ r += ' ' + node.value;
+ }
+ options.state = WriterState.CloseTag;
+ r += options.spaceBeforeSlash + '?>';
+ r += this.endline(node, options, level);
+ options.state = WriterState.None;
+ this.closeNode(node, options, level);
+ return r;
+ }
+
+ raw(node, options, level) {
+ var r;
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r = this.indent(node, options, level);
+ options.state = WriterState.InsideTag;
+ r += node.value;
+ options.state = WriterState.CloseTag;
+ r += this.endline(node, options, level);
+ options.state = WriterState.None;
+ this.closeNode(node, options, level);
+ return r;
+ }
+
+ text(node, options, level) {
+ var r;
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r = this.indent(node, options, level);
+ options.state = WriterState.InsideTag;
+ r += node.value;
+ options.state = WriterState.CloseTag;
+ r += this.endline(node, options, level);
+ options.state = WriterState.None;
+ this.closeNode(node, options, level);
+ return r;
+ }
+
+ dtdAttList(node, options, level) {
+ var r;
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r = this.indent(node, options, level) + '<!ATTLIST';
+ options.state = WriterState.InsideTag;
+ r += ' ' + node.elementName + ' ' + node.attributeName + ' ' + node.attributeType;
+ if (node.defaultValueType !== '#DEFAULT') {
+ r += ' ' + node.defaultValueType;
+ }
+ if (node.defaultValue) {
+ r += ' "' + node.defaultValue + '"';
+ }
+ options.state = WriterState.CloseTag;
+ r += options.spaceBeforeSlash + '>' + this.endline(node, options, level);
+ options.state = WriterState.None;
+ this.closeNode(node, options, level);
+ return r;
+ }
+
+ dtdElement(node, options, level) {
+ var r;
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r = this.indent(node, options, level) + '<!ELEMENT';
+ options.state = WriterState.InsideTag;
+ r += ' ' + node.name + ' ' + node.value;
+ options.state = WriterState.CloseTag;
+ r += options.spaceBeforeSlash + '>' + this.endline(node, options, level);
+ options.state = WriterState.None;
+ this.closeNode(node, options, level);
+ return r;
+ }
+
+ dtdEntity(node, options, level) {
+ var r;
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r = this.indent(node, options, level) + '<!ENTITY';
+ options.state = WriterState.InsideTag;
+ if (node.pe) {
+ r += ' %';
+ }
+ r += ' ' + node.name;
+ if (node.value) {
+ r += ' "' + node.value + '"';
+ } else {
+ if (node.pubID && node.sysID) {
+ r += ' PUBLIC "' + node.pubID + '" "' + node.sysID + '"';
+ } else if (node.sysID) {
+ r += ' SYSTEM "' + node.sysID + '"';
+ }
+ if (node.nData) {
+ r += ' NDATA ' + node.nData;
+ }
+ }
+ options.state = WriterState.CloseTag;
+ r += options.spaceBeforeSlash + '>' + this.endline(node, options, level);
+ options.state = WriterState.None;
+ this.closeNode(node, options, level);
+ return r;
+ }
+
+ dtdNotation(node, options, level) {
+ var r;
+ this.openNode(node, options, level);
+ options.state = WriterState.OpenTag;
+ r = this.indent(node, options, level) + '<!NOTATION';
+ options.state = WriterState.InsideTag;
+ r += ' ' + node.name;
+ if (node.pubID && node.sysID) {
+ r += ' PUBLIC "' + node.pubID + '" "' + node.sysID + '"';
+ } else if (node.pubID) {
+ r += ' PUBLIC "' + node.pubID + '"';
+ } else if (node.sysID) {
+ r += ' SYSTEM "' + node.sysID + '"';
+ }
+ options.state = WriterState.CloseTag;
+ r += options.spaceBeforeSlash + '>' + this.endline(node, options, level);
+ options.state = WriterState.None;
+ this.closeNode(node, options, level);
+ return r;
+ }
+
+ openNode(node, options, level) {}
+
+ closeNode(node, options, level) {}
+
+ openAttribute(att, options, level) {}
+
+ closeAttribute(att, options, level) {}
+
+ };
+
+}).call(this);
diff --git a/generator/node_modules/xmlbuilder/lib/index.js b/generator/node_modules/xmlbuilder/lib/index.js
new file mode 100644
index 0000000..c9ff150
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/lib/index.js
@@ -0,0 +1,120 @@
+// Generated by CoffeeScript 2.4.1
+(function() {
+ var NodeType, WriterState, XMLDOMImplementation, XMLDocument, XMLDocumentCB, XMLStreamWriter, XMLStringWriter, assign, isFunction;
+
+ ({assign, isFunction} = require('./Utility'));
+
+ XMLDOMImplementation = require('./XMLDOMImplementation');
+
+ XMLDocument = require('./XMLDocument');
+
+ XMLDocumentCB = require('./XMLDocumentCB');
+
+ XMLStringWriter = require('./XMLStringWriter');
+
+ XMLStreamWriter = require('./XMLStreamWriter');
+
+ NodeType = require('./NodeType');
+
+ WriterState = require('./WriterState');
+
+ // Creates a new document and returns the root node for
+ // chain-building the document tree
+
+ // `name` name of the root element
+
+ // `xmldec.version` A version number string, e.g. 1.0
+ // `xmldec.encoding` Encoding declaration, e.g. UTF-8
+ // `xmldec.standalone` standalone document declaration: true or false
+
+ // `doctype.pubID` public identifier of the external subset
+ // `doctype.sysID` system identifier of the external subset
+
+ // `options.headless` whether XML declaration and doctype will be included:
+ // true or false
+ // `options.keepNullNodes` whether nodes with null values will be kept
+ // or ignored: true or false
+ // `options.keepNullAttributes` whether attributes with null values will be
+ // kept or ignored: true or false
+ // `options.ignoreDecorators` whether decorator strings will be ignored when
+ // converting JS objects: true or false
+ // `options.separateArrayItems` whether array items are created as separate
+ // nodes when passed as an object value: true or false
+ // `options.noDoubleEncoding` whether existing html entities are encoded:
+ // true or false
+ // `options.stringify` a set of functions to use for converting values to
+ // strings
+ // `options.writer` the default XML writer to use for converting nodes to
+ // string. If the default writer is not set, the built-in XMLStringWriter
+ // will be used instead.
+ module.exports.create = function(name, xmldec, doctype, options) {
+ var doc, root;
+ if (name == null) {
+ throw new Error("Root element needs a name.");
+ }
+ options = assign({}, xmldec, doctype, options);
+ // create the document node
+ doc = new XMLDocument(options);
+ // add the root node
+ root = doc.element(name);
+ // prolog
+ if (!options.headless) {
+ doc.declaration(options);
+ if ((options.pubID != null) || (options.sysID != null)) {
+ doc.dtd(options);
+ }
+ }
+ return root;
+ };
+
+ // Creates a new document and returns the document node for
+ // chain-building the document tree
+
+ // `options.keepNullNodes` whether nodes with null values will be kept
+ // or ignored: true or false
+ // `options.keepNullAttributes` whether attributes with null values will be
+ // kept or ignored: true or false
+ // `options.ignoreDecorators` whether decorator strings will be ignored when
+ // converting JS objects: true or false
+ // `options.separateArrayItems` whether array items are created as separate
+ // nodes when passed as an object value: true or false
+ // `options.noDoubleEncoding` whether existing html entities are encoded:
+ // true or false
+ // `options.stringify` a set of functions to use for converting values to
+ // strings
+ // `options.writer` the default XML writer to use for converting nodes to
+ // string. If the default writer is not set, the built-in XMLStringWriter
+ // will be used instead.
+
+ // `onData` the function to be called when a new chunk of XML is output. The
+ // string containing the XML chunk is passed to `onData` as its single
+ // argument.
+ // `onEnd` the function to be called when the XML document is completed with
+ // `end`. `onEnd` does not receive any arguments.
+ module.exports.begin = function(options, onData, onEnd) {
+ if (isFunction(options)) {
+ [onData, onEnd] = [options, onData];
+ options = {};
+ }
+ if (onData) {
+ return new XMLDocumentCB(options, onData, onEnd);
+ } else {
+ return new XMLDocument(options);
+ }
+ };
+
+ module.exports.stringWriter = function(options) {
+ return new XMLStringWriter(options);
+ };
+
+ module.exports.streamWriter = function(stream, options) {
+ return new XMLStreamWriter(stream, options);
+ };
+
+ module.exports.implementation = new XMLDOMImplementation();
+
+ module.exports.nodeType = NodeType;
+
+ module.exports.writerState = WriterState;
+
+}).call(this);
diff --git a/generator/node_modules/xmlbuilder/package.json b/generator/node_modules/xmlbuilder/package.json
new file mode 100644
index 0000000..8a06b18
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/package.json
@@ -0,0 +1,51 @@
+{
+ "name": "xmlbuilder",
+ "version": "15.1.1",
+ "keywords": [
+ "xml",
+ "xmlbuilder"
+ ],
+ "homepage": "http://github.com/oozcitak/xmlbuilder-js",
+ "description": "An XML builder for node.js",
+ "author": "Ozgur Ozcitak <oozcitak@gmail.com>",
+ "contributors": [],
+ "license": "MIT",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/oozcitak/xmlbuilder-js.git"
+ },
+ "bugs": {
+ "url": "http://github.com/oozcitak/xmlbuilder-js/issues"
+ },
+ "main": "./lib/index",
+ "typings": "./typings/index.d.ts",
+ "engines": {
+ "node": ">=8.0"
+ },
+ "dependencies": {},
+ "devDependencies": {
+ "coffee-coverage": "*",
+ "coffeescript": "2.4.1",
+ "coveralls": "*",
+ "istanbul": "*",
+ "mocha": "*",
+ "nyc": "*",
+ "xpath": "*",
+ "git-state": "*"
+ },
+ "mocha": {
+ "require": [
+ "coffeescript/register",
+ "coffee-coverage/register-istanbul",
+ "test/common.coffee"
+ ],
+ "recursive": true,
+ "ui": "tdd",
+ "reporter": "dot"
+ },
+ "scripts": {
+ "prepublishOnly": "coffee -co lib src",
+ "test": "nyc mocha \"test/**/*.coffee\"",
+ "perf": "coffee ./perf/index.coffee"
+ }
+}
diff --git a/generator/node_modules/xmlbuilder/perf/basic/escaping.coffee b/generator/node_modules/xmlbuilder/perf/basic/escaping.coffee
new file mode 100644
index 0000000..126825d
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/perf/basic/escaping.coffee
@@ -0,0 +1,244 @@
+XMLStringifier = require('../../src/XMLStringifier')
+stringify = new XMLStringifier()
+
+perf 'Text escaping', 100000, (run) ->
+ text = '&<>\r&<>\r&<>\r&<>\r&<>\r&<>\r&<>\r&<>\r&<>\r&<>\r&<>\r&<>\r&<>\r&<>\r&<>\r&<>\r&<>\r&<>\r&<>\r&<>\r&<>\r&<>\r&<>\r&<>\r'
+ run () -> stringify.textEscape(text)
+
+perf 'Text escaping (no replacement)', 100000, (run) ->
+ text = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque faucibus dui metus, quis mattis nibh sollicitudin ut.'
+ run () -> stringify.textEscape(text)
+
+perf 'Attribute value escaping', 100000, (run) ->
+ att = '&<"\t\n\r&<"\t\n\r&<"\t\n\r&<"\t\n\r&<"\t\n\r&<"\t\n\r&<"\t\n\r&<"\t\n\r&<"\t\n\r&<"\t\n\r&<"\t\n\r&<"\t\n\r&<"\t\n\r'
+ run () -> stringify.attEscape(att)
+
+perf 'Attribute value escaping (no replacement)', 100000, (run) ->
+ att = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque faucibus dui metus, quis mattis nibh sollicitudin ut.'
+ run () -> stringify.attEscape(att)
+
+perf 'Text escaping (long text)', 100000, (run) ->
+ text = """
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque faucibus dui metus, quis mattis nibh sollicitudin ut. Suspendisse efficitur vestibulum purus ut luctus. Maecenas mollis purus sit amet enim sollicitudin dapibus. Aenean eget enim maximus, semper lacus eget, posuere sapien. Maecenas iaculis ipsum in facilisis commodo. Integer tincidunt, mi ut interdum euismod, massa ligula tincidunt sem, in dapibus ipsum risus quis mauris. Nullam maximus mi quis mollis rhoncus. Donec sollicitudin, neque fringilla feugiat vulputate, risus elit luctus nisi, in varius magna enim sed lorem. Phasellus elementum lacus in nisi pharetra, nec semper arcu sodales. Suspendisse ac condimentum magna, vel pretium massa. Duis vehicula neque sapien, id cursus nulla vestibulum at. Sed vehicula consequat eros, in hendrerit risus dictum quis. Nunc nec sodales leo. Suspendisse ut lorem in ipsum bibendum imperdiet sit amet a orci. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.
+
+Mauris elementum luctus nisi eget suscipit. Donec vel molestie est. Nam molestie libero ac magna varius mollis. Donec sem massa, luctus et metus sed, pellentesque porttitor lectus. Donec volutpat erat id efficitur tempus. Pellentesque mattis molestie erat nec cursus. Donec est arcu, hendrerit sit amet accumsan non, tincidunt dignissim massa. Suspendisse eget varius diam, faucibus porta odio. Vivamus auctor lectus orci, eget luctus dolor aliquet semper. Nam pulvinar tempus arcu, a semper lorem tincidunt quis. Nam dolor velit, dapibus sed augue ac, condimentum placerat ipsum. Suspendisse dapibus, sapien non ultricies convallis, sapien dolor viverra nibh, non hendrerit leo ipsum quis mi. Cras aliquet nec velit at scelerisque. Sed id commodo nunc, at dignissim nisi.
+
+In eget pretium nulla, vitae laoreet mauris. Mauris ac dui at purus dapibus iaculis et a neque. Pellentesque ut sapien nibh. Duis nulla erat, gravida eget dolor et, euismod blandit enim. Integer maximus facilisis purus, non posuere nulla commodo ut. Integer non facilisis mauris. Phasellus libero sapien, sollicitudin in massa vel, porttitor rhoncus lectus. Fusce interdum felis vel metus consequat, sed tempor urna imperdiet. Pellentesque sit amet ultricies nibh. In viverra tellus in sodales pellentesque. Nullam nisl leo, hendrerit vitae ipsum eget, ullamcorper dictum orci. Maecenas ac metus id lacus pellentesque vestibulum ac eget lacus. Nam congue eros sed dapibus auctor. Cras a purus ut urna viverra consequat. Fusce quis arcu condimentum, vestibulum eros eu, fermentum eros.
+
+In ut mauris at augue consectetur hendrerit at eget lorem. Fusce a lacus eget mi commodo molestie eu eu ante. Pellentesque congue feugiat varius. Suspendisse lacinia, mauris ac rutrum molestie, nulla ex aliquet urna, at vestibulum nunc turpis id justo. Suspendisse est leo, euismod consequat mollis id, varius eget velit. Suspendisse quis euismod orci. Vestibulum quis blandit risus. Donec eget sagittis mauris. Curabitur eu ligula nec ante suscipit congue. Fusce efficitur scelerisque varius. Integer pulvinar eros a volutpat bibendum. Vivamus vitae est id velit pharetra venenatis. In quis interdum mi.
+
+Pellentesque faucibus ultricies diam, id laoreet sem dignissim et. Ut elementum urna eget leo vestibulum, quis varius enim porttitor. Fusce vitae laoreet velit. Quisque at tempor quam, non mollis augue. Pellentesque pharetra consectetur erat id porttitor. Fusce feugiat erat purus. Morbi nec ultrices leo. Integer purus nunc, posuere ut nisi at, tempor ultricies tellus. Nullam eu accumsan magna. Cras vestibulum ipsum vitae dui commodo laoreet. Suspendisse non elementum metus, et ultricies dui.
+
+Mauris id lorem id mauris dictum iaculis. Phasellus molestie purus sit amet diam sollicitudin scelerisque. Suspendisse potenti. Vestibulum pharetra eu odio id ornare. Etiam fringilla, massa a finibus auctor, est leo posuere ante, vitae malesuada enim nisi condimentum nunc. Quisque blandit finibus molestie. Donec sed iaculis sapien. Vivamus suscipit nibh ut elit venenatis, lacinia eleifend nisi pulvinar. Nunc faucibus magna nec felis viverra dignissim. Sed maximus sem erat, vel accumsan erat dignissim ac. Pellentesque rutrum elit lectus, vel efficitur nisi tristique at. Vivamus non volutpat turpis, non fringilla nisl. Duis tincidunt faucibus massa a interdum. Ut ac nulla id nulla ornare dapibus. Interdum et malesuada fames ac ante ipsum primis in faucibus.
+
+In pretium neque vel mauris imperdiet, nec porta nunc tristique. Nullam id volutpat tortor. Nunc augue orci, vehicula in consectetur in, euismod sit amet lectus. Duis vehicula sagittis tortor, ut cursus ipsum finibus in. Sed vel dui eros. Fusce vehicula justo et lobortis suscipit. Nulla varius, arcu sit amet pulvinar consectetur, urna dolor suscipit nisi, feugiat interdum augue sem a justo. Proin vitae felis mattis, tempus justo ornare, pharetra sem. Nam dictum lorem et nisl lobortis mattis. Curabitur nibh nulla, pulvinar nec justo a, consectetur consectetur erat. Phasellus semper nisl est, et molestie nisl consectetur a. Maecenas ut placerat elit. Ut mattis tincidunt ex, semper hendrerit neque ultrices nec. Curabitur leo massa, dictum at libero eget, molestie luctus risus. In aliquet a erat sed accumsan. Vestibulum venenatis ante ligula, sit amet vestibulum est mollis vitae.
+
+Donec interdum augue eget feugiat venenatis. Mauris interdum tristique urna eu cursus. Donec sit amet diam volutpat massa posuere lacinia a quis lorem. Vivamus et condimentum eros. Sed eleifend dolor eros, laoreet lobortis risus elementum ac. Donec eget semper mauris. Etiam gravida arcu tortor, id egestas sapien vestibulum et. Curabitur tristique urna at nibh bibendum, et blandit turpis feugiat. Cras dignissim lectus rhoncus elit consectetur vestibulum. Ut finibus nisl in sapien mollis, eu faucibus nisi blandit. Ut velit felis, luctus condimentum quam vel, accumsan blandit sem.
+
+Nullam eros risus, ultrices vitae ipsum eget, cursus mollis turpis. Aenean sagittis nibh sit amet viverra lobortis. Quisque ut neque enim. In velit tortor, vulputate sit amet tristique eu, tempor eu tortor. Integer molestie ante vitae odio ultricies imperdiet. Nulla ut finibus lectus. Etiam ac metus malesuada, gravida neque sit amet, consequat nulla. Pellentesque eu arcu ut odio egestas vehicula sed a augue. Nulla egestas condimentum condimentum. Mauris ultrices viverra odio at egestas. Proin sem purus, sodales a tincidunt id, bibendum ut lacus. Aliquam eget laoreet lectus, eu varius sem. Mauris mattis vehicula sem, id egestas dui consectetur nec. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.
+
+Etiam quis dolor ac ante luctus volutpat. Donec aliquam gravida auctor. Nulla suscipit arcu ut molestie sodales. Nunc convallis enim accumsan, porttitor augue sit amet, gravida orci. Donec mollis urna ligula, a sodales quam vulputate non. Pellentesque in suscipit orci. Fusce scelerisque metus sit amet nisl hendrerit, et viverra purus luctus. Phasellus ac imperdiet lacus, sit amet convallis nisl. Mauris vel massa pellentesque, mattis augue sit amet, posuere lectus. Proin ac sagittis ipsum. Nam ligula purus, consequat sed odio at, suscipit pulvinar augue. Donec hendrerit tempus felis accumsan lobortis.
+
+Donec id neque cursus, accumsan dui sed, dapibus lectus. In tempus felis odio. Vivamus dignissim commodo ante, nec egestas urna sagittis ut. Integer maximus malesuada pharetra. Praesent dui mauris, malesuada ac tempus eget, cursus lobortis arcu. Sed nec consectetur purus. Maecenas eget pellentesque nisl.
+
+Vestibulum a neque turpis. Aenean porta fermentum maximus. In at leo dignissim, laoreet metus at, condimentum augue. Pellentesque vitae enim efficitur, tristique ex vitae, commodo mi. Donec vehicula euismod sapien, at pulvinar tellus molestie a. Etiam ut leo consectetur, condimentum sapien scelerisque, tempor metus. Maecenas nisi risus, varius eget viverra rhoncus, mattis vel massa.
+
+Proin tempor lacinia augue et varius. Mauris a velit metus. Quisque a lorem est. Sed ex sapien, rutrum sit amet vestibulum non, efficitur ut ante. Sed quis arcu mollis, tempor est non, ultricies metus. Sed at rutrum risus. Proin efficitur, tellus vitae consequat condimentum, metus purus facilisis libero, sit amet venenatis sapien elit eu libero. Praesent eget elit nec nisl egestas maximus ac ut odio. Pellentesque a ligula arcu. Nunc nibh arcu, efficitur ut feugiat sed, aliquam sit amet ipsum. Phasellus pharetra ut est sit amet dignissim. In consequat ultricies pretium. Proin euismod, ex id condimentum tempus, nulla tortor faucibus dolor, et efficitur velit arcu sit amet sem. Fusce finibus congue volutpat. Morbi ornare lectus ornare ex sodales, ut rhoncus neque consectetur. Aliquam lobortis scelerisque arcu sit amet elementum.
+
+Nullam quis diam in mi varius fringilla. Phasellus nibh quam, vehicula et pellentesque a, pellentesque eu tellus. Nam ac auctor erat. Quisque laoreet, libero non ullamcorper vestibulum, risus nisl consectetur diam, quis porta erat sapien vitae dui. Aenean efficitur, libero a tincidunt commodo, sapien purus blandit sem, vel auctor ante augue ac metus. Pellentesque eu mi urna. Sed condimentum, lacus sit amet varius feugiat, neque ex rhoncus enim, in fermentum turpis metus a libero. Praesent risus purus, malesuada nec accumsan in, tempor ac tellus. Etiam posuere lacinia feugiat. Praesent sagittis, nulla sed scelerisque lacinia, ipsum mi laoreet elit, ut lacinia quam dui semper nibh.
+
+In eget purus placerat, euismod justo at, feugiat eros. Aliquam eget tristique erat. Praesent vehicula neque vitae ex pretium, at sagittis erat tincidunt. Duis nec facilisis lorem. Sed pharetra ut tellus a feugiat. Suspendisse luctus placerat laoreet. Pellentesque eu tempus quam. Quisque eu magna a velit ultricies ullamcorper ac in erat. Mauris ex purus, pellentesque eget congue nec, bibendum at arcu. Nam eros ipsum, pellentesque a massa eget, porta efficitur mi.
+
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse tempor ex a posuere ornare. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Pellentesque faucibus convallis lectus, et ullamcorper nisl pharetra ac. Vivamus eu tortor at dui tempor vulputate. Suspendisse at magna quis ipsum fringilla sodales in vel tellus. Phasellus tellus dolor, sollicitudin ac odio vitae, pellentesque ullamcorper justo. Interdum et malesuada fames ac ante ipsum primis in faucibus. Quisque volutpat convallis sem. Ut varius, sapien vitae tincidunt malesuada, orci ante tempus nisl, eget iaculis turpis mauris ac orci.
+
+Aliquam pretium hendrerit ligula, ut euismod est imperdiet id. Fusce leo massa, blandit sit amet sagittis ut, elementum quis odio. Sed sit amet urna a sem elementum tincidunt id eu libero. In convallis nisi et tellus mollis mollis. Nullam id pretium lorem. Phasellus vel sodales arcu. Integer nec erat vitae justo accumsan porttitor accumsan a eros. Nunc mattis sagittis velit, ut tempor neque maximus in. Nulla vulputate purus non metus venenatis ultrices a non tellus. Praesent sodales nisi quis efficitur imperdiet. Donec a quam id risus interdum sollicitudin eget et orci. Donec hendrerit vel sem in condimentum.
+
+Praesent vel ultricies lorem. Vestibulum tempus malesuada elit a gravida. Proin cursus nisl urna, et finibus nisl porttitor sed. Donec tristique leo vel sem pharetra maximus. Praesent eleifend felis eu imperdiet semper. Etiam pretium mauris diam. Nam quam nisl, laoreet eget scelerisque accumsan, luctus quis dui. Integer at ornare odio.
+
+Sed id tellus velit. Pellentesque vitae condimentum justo. Vestibulum fringilla mauris nec laoreet tincidunt. Maecenas arcu ligula, euismod ut convallis ac, tincidunt id nibh. Aliquam eu sollicitudin velit. Nulla nec sapien leo. Nullam venenatis vel justo vestibulum accumsan. Pellentesque sapien magna, dignissim eget lorem in, condimentum efficitur nisi. Sed quis turpis pellentesque metus aliquam sollicitudin eget vel orci. Sed ac orci nec libero posuere aliquam at quis velit. Quisque at pellentesque quam. Quisque venenatis felis est, eu scelerisque dui elementum non.
+
+Duis venenatis eleifend commodo. In hac habitasse platea dictumst. Proin elementum, mi sed suscipit blandit, purus quam lacinia lectus, ut venenatis felis elit at nulla. Aenean dignissim lacus ac lectus lacinia convallis. Donec fringilla leo purus. Suspendisse potenti. Curabitur aliquam sodales dui ut imperdiet.
+
+Nam in ex id augue facilisis ornare non nec lorem. Nam dolor ex, facilisis nec dignissim vel, mollis eget ex. Aliquam consectetur turpis eget quam pellentesque, at pretium dolor volutpat. Cras sed velit quis dolor scelerisque rhoncus sit amet vel lectus. Sed lacinia arcu convallis mattis aliquet. Proin faucibus vulputate varius. Nullam vel dictum libero. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nulla facilisi. Aliquam mauris ex, faucibus nec tempor quis, placerat maximus augue. Suspendisse commodo pretium sem quis laoreet. Vivamus porta, urna eu tincidunt semper, purus sem tempor sem, ut condimentum diam nibh vel mi. Donec sit amet tellus sit amet mauris vestibulum feugiat. Aliquam in orci quis est feugiat porttitor. Aliquam nec metus ac urna viverra tincidunt.
+
+Nunc ac orci cursus, faucibus justo nec, lobortis tortor. Nulla tincidunt scelerisque risus, at blandit arcu elementum sed. Maecenas non justo dapibus, tincidunt nibh in, porta neque. Sed non mi id leo vestibulum iaculis. Nam ultricies odio eget arcu vehicula tempus. Suspendisse maximus consectetur arcu, id dapibus lacus mollis et. Fusce nec vulputate nulla. Nam dictum eget sapien id interdum. Duis mi sem, gravida nec dolor vel, elementum facilisis tellus. Integer vel accumsan diam. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed in commodo ex. Praesent commodo porttitor ipsum. Vestibulum volutpat diam at tellus feugiat, id sodales magna bibendum. Mauris odio eros, rutrum at scelerisque eget, porta sed turpis. Suspendisse porta dictum cursus.
+
+Mauris accumsan finibus mi sit amet auctor. Aliquam erat volutpat. Vestibulum at euismod sapien, euismod tincidunt lectus. Mauris aliquet sapien at erat vestibulum, a vestibulum dui bibendum. Etiam vel vulputate justo. Nam vitae ultrices nisl, eu dapibus ex. Quisque volutpat nibh vitae semper tristique. Mauris in nibh lectus. Maecenas elit leo, ultricies quis bibendum sed, rhoncus et neque. Sed elementum nec dui id lobortis. Vestibulum sollicitudin arcu nulla, sit amet lobortis urna ultrices a. Cras fermentum dolor id faucibus pretium. Pellentesque congue quam metus, quis consequat leo sollicitudin vitae.
+
+Integer congue, neque a scelerisque varius, purus nibh fringilla nunc, sit amet pretium felis sapien vel orci. Donec mattis ac orci in viverra. Suspendisse a justo sollicitudin lacus efficitur ullamcorper. Mauris faucibus nisl quis dolor volutpat aliquam. Aenean venenatis, odio et rhoncus lobortis, risus ligula finibus massa, non dignissim augue nisl vel arcu. Nullam fringilla odio at libero scelerisque, vitae placerat nisi fringilla. Etiam quis urna turpis. Quisque quis leo ante. Duis nec elit massa. Sed porttitor, nulla id efficitur blandit, purus ligula vulputate lectus, quis molestie metus orci ac tellus. Donec sapien massa, suscipit eu tristique ac, posuere sed lorem. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aliquam erat volutpat. Duis bibendum erat eget felis tempor, eget imperdiet nibh vestibulum. In hac habitasse platea dictumst. Quisque vehicula pulvinar turpis, ac dictum risus auctor varius.
+
+Praesent ac ex vestibulum, dapibus lacus in, malesuada diam. Sed in turpis in justo venenatis pharetra. Fusce sed lobortis nisl. Phasellus faucibus magna ante, malesuada placerat justo faucibus tempus. Phasellus hendrerit fermentum felis. Proin malesuada, urna vel tincidunt pharetra, eros ante bibendum sem, nec viverra nunc arcu at mauris. Sed et lorem pharetra, feugiat tortor vitae, rutrum lacus. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed mauris leo, condimentum at risus eget, aliquam consequat mauris. Mauris id auctor purus.
+
+Aenean augue mauris, cursus quis elit eget, molestie pharetra sem. Mauris congue felis ut nibh facilisis, ut pharetra arcu pharetra. Curabitur semper mattis orci eu dictum. Phasellus hendrerit scelerisque dignissim. Sed aliquet nunc scelerisque, facilisis nulla at, posuere lorem. Maecenas blandit, lectus nec varius bibendum, nibh risus posuere turpis, id pretium justo elit vitae ligula. Sed risus ante, congue quis libero consequat, laoreet convallis diam.
+
+Aenean sagittis ex vel semper ullamcorper. Donec mattis, ipsum tincidunt aliquet vehicula, elit tellus porta mi, a convallis quam orci ac lectus. Proin aliquam nulla in erat mattis placerat. Aliquam ligula sem, egestas ac turpis vitae, facilisis iaculis mauris. Donec ac egestas urna, ac iaculis orci. Integer urna magna, eleifend sed nunc vitae, commodo lobortis massa. Aenean ultrices pulvinar dui, non blandit lorem pretium quis. Praesent in molestie purus, vestibulum interdum quam. Pellentesque auctor erat non mauris fringilla eleifend.
+
+Etiam blandit vel leo nec pulvinar. Phasellus elementum facilisis mi et egestas. Praesent finibus, elit vel venenatis sodales, turpis nibh tincidunt turpis, eu venenatis urna tortor at massa. Proin iaculis ipsum ut elit maximus tincidunt. Suspendisse justo turpis, sollicitudin ut eros quis, dictum placerat nibh. Sed mattis ornare pulvinar. Cras lacus purus, interdum vitae commodo sollicitudin, suscipit eu quam. Mauris luctus laoreet metus at posuere. Etiam faucibus diam quis purus vulputate, nec blandit lorem bibendum.
+
+Aliquam nisl neque, vulputate eu arcu id, elementum dictum sapien. Aliquam aliquam, mauris eget vestibulum accumsan, metus tellus vulputate urna, nec volutpat felis turpis ac nulla. Morbi pretium magna bibendum eros ultricies lobortis. Vestibulum euismod vitae nibh in posuere. Vivamus in iaculis mi. Pellentesque iaculis ex nec tellus pulvinar interdum. Integer a tincidunt risus, eu faucibus mi. Vivamus posuere sapien eu orci scelerisque rutrum at eu leo. Nullam consectetur est eu justo congue commodo. Vestibulum ac finibus velit. Donec faucibus nulla at risus rhoncus, a vulputate magna pulvinar. Aliquam condimentum rhoncus lacus sed hendrerit.
+
+Morbi non hendrerit nisl, eu fringilla erat. Praesent ac dolor sit amet libero tempus porttitor. Cras vel sem elementum, venenatis ipsum vel, molestie tellus. Aliquam erat volutpat. Maecenas malesuada urna nec diam sodales pharetra. Aliquam non lobortis metus. Donec eleifend mollis eros in condimentum. Suspendisse sagittis consequat justo, vitae tincidunt orci luctus vel. Ut lobortis tincidunt libero. Sed dignissim lorem sit amet nibh aliquam, pharetra pulvinar justo consequat. Suspendisse sed dictum massa. Ut fermentum, dolor a fringilla bibendum, lorem ligula scelerisque turpis, in porta justo neque non lectus. Suspendisse pellentesque risus sit amet ligula pretium condimentum. Fusce odio tortor, pulvinar in dapibus nec, pharetra eget nisi. Suspendisse luctus eros eget mauris pretium blandit.
+
+Nam vel fermentum nulla. Sed tincidunt tellus id mattis dapibus. Quisque ac congue libero, nec elementum nulla. Phasellus quam eros, congue eu lacinia a, interdum et eros. Aenean suscipit risus interdum mauris porttitor, vehicula auctor tellus molestie. Donec efficitur nisi eget ex interdum sollicitudin. Nunc ultricies maximus quam, at pulvinar eros volutpat quis. Nam venenatis mauris enim, sed malesuada tortor eleifend sit amet. Cras imperdiet convallis viverra. Proin purus nulla, bibendum in aliquam quis, sollicitudin a risus. Proin vehicula tincidunt tortor quis lacinia. Praesent tristique odio sed orci consequat, ut pulvinar mauris semper. Mauris felis mi, ultricies a dolor id, viverra laoreet orci. Nam ex mi, semper nec imperdiet sed, posuere et eros.
+
+Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Donec scelerisque ipsum sed libero tempor, in vulputate ante sodales. Sed vehicula nulla non ante blandit, quis porttitor diam auctor. Nulla sodales risus ut dui vulputate, nec elementum sem volutpat. Quisque id blandit quam. Proin interdum quis lacus ac suscipit. Etiam a scelerisque sapien. Praesent cursus, mi eget dapibus hendrerit, nibh eros elementum lacus, sit amet congue dui nunc at dui. Phasellus tristique nulla ut tincidunt faucibus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Suspendisse efficitur congue purus, a viverra sapien tristique vel.
+
+Vestibulum elementum pellentesque turpis. Phasellus id quam sit amet ex sodales malesuada. Morbi iaculis quis nibh vitae finibus. Nullam vitae luctus nisl, ac varius leo. Fusce sed quam eu enim volutpat blandit. Etiam ornare aliquam mi, eget porttitor magna euismod non. Curabitur porta vel metus ut mollis.
+
+Aenean sit amet sagittis lacus. Quisque in dui commodo, rutrum massa tincidunt, hendrerit mauris. Maecenas sit amet nisl facilisis, interdum eros rhoncus, malesuada nisl. Aliquam condimentum erat dui, eget dignissim magna volutpat vitae. Mauris porttitor, risus ut auctor porttitor, sem nisl interdum nisi, ac tempus est enim in tortor. Sed rhoncus magna ac feugiat pharetra. Nulla scelerisque quis neque ut porttitor. Ut lacinia in ipsum sit amet lobortis. Aliquam eu justo vel leo facilisis tristique. Pellentesque cursus, lacus a rhoncus auctor, erat velit vehicula diam, et fermentum erat mauris fermentum turpis. Donec quam sapien, laoreet sodales sagittis ac, sodales vitae lectus. Donec vitae lorem rutrum, lobortis libero maximus, condimentum sapien. Pellentesque mi lorem, rhoncus vel lacinia a, venenatis et velit.
+
+Curabitur malesuada ante vel maximus luctus. Etiam dui lectus, condimentum eget lobortis eget, eleifend pellentesque ligula. Nam eu pharetra urna, sit amet facilisis turpis. Mauris tincidunt vestibulum turpis nec suscipit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Pellentesque egestas commodo finibus. Donec pellentesque nec libero et imperdiet. Cras cursus purus ut libero pretium vulputate. Mauris non arcu purus. Donec sollicitudin dignissim massa ac tincidunt. Donec non consectetur turpis, et venenatis dui.
+
+Nam mattis urna dolor, a varius sem tempor a. Vivamus porttitor dignissim metus vel ultrices. Integer ac justo vel nisl consequat efficitur. Maecenas sit amet hendrerit elit. Suspendisse lobortis semper mauris id convallis. Duis nibh dui, lacinia a turpis sed, interdum aliquam ex. Praesent tempor rhoncus nibh vel dictum. Quisque feugiat mi sit amet nunc fermentum pellentesque. Ut porta lacinia erat eu pulvinar. Nulla vestibulum fermentum felis, eu ultricies lectus. Ut eget lobortis sapien. Aenean consectetur in nisl interdum mattis. Sed a ipsum pharetra, congue augue a, accumsan ex. Quisque luctus sapien non tincidunt vulputate.
+
+Aenean auctor consectetur urna et rhoncus. Vivamus mattis tortor at massa porta, in auctor quam porttitor. Nulla facilisi. Sed auctor ipsum tortor, quis hendrerit risus convallis eget. Vivamus a mollis nulla, at fringilla risus. In a cursus dui, nec vehicula elit. Donec in sodales ante, quis gravida est. Sed interdum mi non ornare lacinia. Cras placerat cursus dolor nec euismod. Nulla vel velit quis nibh aliquam eleifend. Cras mattis vitae erat nec gravida. Vestibulum luctus sagittis nibh, a pretium neque dictum eget. Quisque vitae consequat dui. Donec libero eros, pharetra sit amet sapien id, euismod gravida mi.
+
+Duis tristique nisi id urna feugiat, sed aliquet nulla imperdiet. Ut quis felis finibus, lobortis nunc eu, sodales risus. Fusce at euismod risus. Nunc pulvinar libero volutpat, mattis eros facilisis, mollis nibh. Maecenas augue nunc, mollis sit amet volutpat et, interdum eu augue. Etiam porttitor tortor sem, vitae hendrerit nulla lobortis ut. In non sollicitudin eros. Cras bibendum lorem id odio sollicitudin euismod. Aliquam ullamcorper purus at turpis accumsan blandit. Donec at interdum arcu. Nam fermentum est lectus, vel tincidunt purus sollicitudin a. Aliquam vel orci massa.
+
+Fusce fringilla et justo et interdum. Fusce molestie, tellus vitae elementum lobortis, enim augue condimentum nulla, a semper enim quam in dui. Vestibulum a pharetra felis. Proin eu sollicitudin leo. In vestibulum rhoncus augue, non ultrices turpis. Donec maximus neque semper tellus condimentum, in aliquam dui posuere. Sed ultrices nisl purus, quis sollicitudin eros laoreet quis. Praesent nunc nisl, varius at suscipit sed, tristique at neque.
+
+Quisque aliquam tincidunt augue vitae rhoncus. Interdum et malesuada fames ac ante ipsum primis in faucibus. Proin eu luctus erat. Nullam auctor, purus a eleifend efficitur, metus ligula accumsan quam, quis bibendum enim lacus quis neque. Maecenas lacinia ipsum molestie felis accumsan, in dignissim purus aliquet. Nunc turpis massa, ultricies in lacinia ut, luctus ut felis. Morbi magna nisi, sodales in arcu sit amet, efficitur mattis velit. Ut scelerisque enim nibh, vel pretium urna varius vel. Cras vitae accumsan nunc, ut iaculis tortor. Nam vitae laoreet orci, sit amet rutrum mi. Nunc blandit purus eu hendrerit tempor. Vestibulum tincidunt pharetra purus ut sodales. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
+
+Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nulla sed laoreet urna, sit amet commodo erat. Fusce euismod justo erat, et placerat odio accumsan finibus. Proin pellentesque ligula ut nibh condimentum, sed ornare justo faucibus. Fusce consectetur sapien nec dui varius, vel pharetra felis molestie. Duis accumsan odio metus, ut varius orci finibus nec. Sed non ipsum vitae est aliquet mollis. Pellentesque facilisis feugiat suscipit.
+
+Mauris ut enim sit amet metus bibendum finibus. Suspendisse iaculis, tellus maximus placerat elementum, libero turpis fermentum dolor, ut lacinia sapien ipsum a nulla. Etiam sollicitudin dictum dolor, ac congue sem pulvinar nec. Ut egestas urna non neque volutpat egestas. Integer porta vel orci volutpat tincidunt. In egestas fringilla ipsum ac pharetra. Fusce justo dui, dignissim sed leo at, tincidunt finibus magna. Pellentesque vel nunc risus. Praesent lacinia blandit convallis. Cras eget magna metus. Maecenas fringilla dolor eu quam dictum consequat. Donec pellentesque eleifend velit, a commodo dui faucibus eu. Phasellus pretium nulla ipsum, et interdum magna interdum et. Mauris a sem ullamcorper, consectetur quam accumsan, porttitor eros.
+
+Praesent facilisis, ipsum ac tincidunt auctor, tellus ipsum convallis magna, vel maximus sem lorem et tortor. Sed elit diam, faucibus sed turpis eget, commodo facilisis nunc. Vestibulum vitae arcu tristique, varius libero molestie, sollicitudin mi. In tincidunt nisl in eros imperdiet faucibus. Cras ex ipsum, vehicula eget neque eget, viverra pellentesque erat. Suspendisse vitae tristique dolor. Nulla ornare imperdiet metus id mollis. Fusce ligula ex, aliquam sed purus quis, venenatis volutpat lectus. Sed iaculis ante sit amet massa consequat interdum. Ut feugiat risus sit amet commodo euismod. Sed tristique quam sit amet lacinia cursus. Donec faucibus, erat a dapibus rhoncus, orci est interdum ex, sit amet semper massa quam et lectus.
+
+Suspendisse mollis turpis aliquam felis efficitur, eu ultrices tellus suscipit. Aenean at congue erat, vel ultricies eros. Quisque hendrerit arcu ut est aliquet, et vehicula lectus ullamcorper. Pellentesque posuere neque nec auctor scelerisque. Phasellus rhoncus odio ac nisl ornare condimentum. Nam nec arcu porttitor tellus faucibus malesuada id a est. Vivamus id facilisis ante. Proin quis risus ipsum. In sed nibh at nisl tempus interdum. Ut sit amet malesuada nisl, id pharetra metus. Nulla lorem velit, euismod nec dictum at, porttitor ac erat. Aliquam est leo, elementum nec ultricies nec, interdum sed libero. Quisque mattis placerat scelerisque. Praesent vulputate sit amet felis non tristique.
+
+Phasellus odio ex, ultricies et tincidunt sit amet, auctor id felis. Fusce facilisis nibh risus, eget placerat nunc pellentesque vel. Morbi cursus metus eu arcu viverra rutrum. Nulla eget dolor blandit, pulvinar sem aliquet, hendrerit purus. Fusce sodales venenatis posuere. Cras egestas placerat odio non scelerisque. Praesent tincidunt maximus semper. Vivamus eget libero massa. Cras auctor orci sed nibh sagittis ultrices. Curabitur leo lacus, suscipit ac pharetra vel, euismod eu turpis. Aenean quis justo efficitur, mattis nisl sed, mollis lacus. Integer feugiat non metus vitae faucibus. Morbi sem massa, pretium id risus a, congue volutpat mi. Vivamus lacinia enim lorem, id malesuada ante vehicula non. Praesent ac urna quis justo malesuada euismod.
+
+Integer sed ligula id purus dictum tempus eu non ex. Phasellus tincidunt lectus in imperdiet porttitor. Integer ligula dolor, porttitor et congue vitae, elementum eget sem. Proin a libero in enim efficitur mollis. Proin molestie metus dolor, in fermentum massa condimentum at. Cras eget auctor odio, a luctus sapien. Nulla in hendrerit leo, sed venenatis augue. Proin mollis vestibulum magna. Nulla dapibus lacus nec condimentum maximus. Phasellus id efficitur enim. Vivamus molestie mauris at condimentum elementum. Maecenas ultrices mauris quis tincidunt viverra. Ut eget ultricies ligula. Nulla id fermentum nisl, in ultrices velit.
+
+Nunc blandit tellus sed est auctor condimentum. Integer fringilla aliquam libero, id sagittis ipsum lacinia sit amet. Donec sit amet nunc felis. Vestibulum at commodo arcu, a malesuada est. Aenean ultrices, mauris in pellentesque posuere, mi orci fermentum justo, vitae rutrum neque erat a nisi. In sed urna quis sem egestas faucibus ut quis ipsum. Quisque porta lectus sit amet urna ultricies iaculis.
+
+Praesent ultrices odio nisl, eu consequat dolor sollicitudin nec. Suspendisse dignissim lobortis nulla nec molestie. Duis in diam sed est dignissim faucibus vitae in metus. Phasellus lacinia urna eros, vitae vulputate sem fermentum eget. Suspendisse et efficitur dolor. Mauris faucibus sodales felis eu luctus. Cras non mattis lacus. Proin in lobortis sapien. Nulla at augue sed est congue sollicitudin.
+
+Nunc nisi lorem, dapibus id tincidunt quis, sollicitudin sit amet justo. In mollis orci pretium aliquam fermentum. Fusce sodales mi eget tellus posuere ullamcorper. Sed varius sagittis elit, in feugiat odio maximus sed. Cras eleifend massa sit amet mi suscipit, vel laoreet leo pretium. Quisque neque erat, mollis eget elementum non, blandit in lectus. Sed dignissim felis ac felis convallis elementum molestie id lectus. Nullam fermentum lorem mi, in placerat quam mollis vitae. Pellentesque ultrices, nibh at sagittis molestie, augue mauris bibendum dui, ut ultricies lorem magna eu massa. Quisque quis purus eu nisi rhoncus tempor. Donec eget fringilla massa. Vivamus sed varius elit. Aenean egestas tellus eget magna dapibus hendrerit. Nunc vel leo eu purus tempus mollis.
+
+Praesent sagittis eget lectus non vestibulum. Fusce id elit nisi. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Donec id malesuada justo, non ornare felis. Nulla ultricies lorem ex, et accumsan ex volutpat sodales. Pellentesque venenatis neque in hendrerit blandit. Donec dapibus est fermentum lacus fringilla, ut volutpat tellus consectetur. Maecenas id semper tortor. In pellentesque aliquet elit, non vulputate augue mollis fermentum. Nullam posuere eget elit a placerat. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
+
+Phasellus vestibulum tristique quam a faucibus. Proin sit amet sem et leo posuere efficitur vitae et ante. Nullam congue nisl augue, in ultricies orci tempor quis. Aliquam erat volutpat. In luctus, sapien at venenatis fermentum, lorem urna ultrices elit, ac volutpat metus purus eu turpis. Phasellus semper cursus mi, vitae tempor est accumsan at. Integer accumsan nec augue vitae viverra. Sed tempus cursus enim non dapibus. In commodo neque in ultricies semper. Proin auctor lacinia eros, ut tempor lectus pulvinar quis. Ut fermentum vulputate pellentesque. Duis tempor ante quis metus consectetur maximus. Curabitur a tincidunt enim.
+
+Vestibulum dictum, urna a fringilla imperdiet, tortor arcu mattis odio, et efficitur dui neque ac mauris. Vestibulum auctor risus lacus. Integer elementum erat nisl, id vehicula enim mattis in. Vestibulum consequat neque ante, in sodales magna pulvinar in. Vivamus interdum eros non magna aliquam tristique. Ut aliquam congue ante in gravida. Sed eu turpis sollicitudin, suscipit ligula id, commodo tellus. Aliquam eu sapien vitae augue gravida egestas nec sit amet turpis. Curabitur vulputate vulputate dui, et facilisis lectus tincidunt nec. Integer tristique vitae quam condimentum maximus. Ut ultricies convallis nisl eu elementum.
+
+Curabitur non nisi lectus. Aliquam finibus lorem id dui molestie, sed ullamcorper quam lobortis. Maecenas in gravida urna. Pellentesque consequat risus vel nibh tempus facilisis. Etiam auctor lacinia lacus vitae vulputate. Etiam bibendum arcu at ipsum elementum, id sodales nunc convallis. Phasellus elementum mi non sapien blandit suscipit. Integer accumsan et justo nec mattis. Vestibulum quis erat viverra, condimentum enim eget, auctor tortor. Nunc ac mauris sit amet urna pellentesque malesuada. Fusce urna justo, finibus eget blandit eget, volutpat eu nisi. In nisi nunc, sodales sit amet tempor eu, feugiat feugiat tellus. Nulla felis purus, gravida eu iaculis in, interdum id purus. In hac habitasse platea dictumst. Aenean consequat, quam tincidunt sodales lacinia, ex dui faucibus massa, ut porta dolor justo et mi.
+
+Donec a massa porta, vehicula diam et, pulvinar tortor. Duis tincidunt, nibh ut pharetra hendrerit, est orci egestas urna, et sollicitudin massa lacus aliquam ex. Curabitur in quam sed elit scelerisque pretium nec rhoncus nulla. In a ligula.
+ """
+
+ run () -> stringify.textEscape(text)
+
+perf 'Attribute value escaping (long value)', 100000, (run) ->
+ text = """
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque faucibus dui metus, quis mattis nibh sollicitudin ut. Suspendisse efficitur vestibulum purus ut luctus. Maecenas mollis purus sit amet enim sollicitudin dapibus. Aenean eget enim maximus, semper lacus eget, posuere sapien. Maecenas iaculis ipsum in facilisis commodo. Integer tincidunt, mi ut interdum euismod, massa ligula tincidunt sem, in dapibus ipsum risus quis mauris. Nullam maximus mi quis mollis rhoncus. Donec sollicitudin, neque fringilla feugiat vulputate, risus elit luctus nisi, in varius magna enim sed lorem. Phasellus elementum lacus in nisi pharetra, nec semper arcu sodales. Suspendisse ac condimentum magna, vel pretium massa. Duis vehicula neque sapien, id cursus nulla vestibulum at. Sed vehicula consequat eros, in hendrerit risus dictum quis. Nunc nec sodales leo. Suspendisse ut lorem in ipsum bibendum imperdiet sit amet a orci. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.
+
+Mauris elementum luctus nisi eget suscipit. Donec vel molestie est. Nam molestie libero ac magna varius mollis. Donec sem massa, luctus et metus sed, pellentesque porttitor lectus. Donec volutpat erat id efficitur tempus. Pellentesque mattis molestie erat nec cursus. Donec est arcu, hendrerit sit amet accumsan non, tincidunt dignissim massa. Suspendisse eget varius diam, faucibus porta odio. Vivamus auctor lectus orci, eget luctus dolor aliquet semper. Nam pulvinar tempus arcu, a semper lorem tincidunt quis. Nam dolor velit, dapibus sed augue ac, condimentum placerat ipsum. Suspendisse dapibus, sapien non ultricies convallis, sapien dolor viverra nibh, non hendrerit leo ipsum quis mi. Cras aliquet nec velit at scelerisque. Sed id commodo nunc, at dignissim nisi.
+
+In eget pretium nulla, vitae laoreet mauris. Mauris ac dui at purus dapibus iaculis et a neque. Pellentesque ut sapien nibh. Duis nulla erat, gravida eget dolor et, euismod blandit enim. Integer maximus facilisis purus, non posuere nulla commodo ut. Integer non facilisis mauris. Phasellus libero sapien, sollicitudin in massa vel, porttitor rhoncus lectus. Fusce interdum felis vel metus consequat, sed tempor urna imperdiet. Pellentesque sit amet ultricies nibh. In viverra tellus in sodales pellentesque. Nullam nisl leo, hendrerit vitae ipsum eget, ullamcorper dictum orci. Maecenas ac metus id lacus pellentesque vestibulum ac eget lacus. Nam congue eros sed dapibus auctor. Cras a purus ut urna viverra consequat. Fusce quis arcu condimentum, vestibulum eros eu, fermentum eros.
+
+In ut mauris at augue consectetur hendrerit at eget lorem. Fusce a lacus eget mi commodo molestie eu eu ante. Pellentesque congue feugiat varius. Suspendisse lacinia, mauris ac rutrum molestie, nulla ex aliquet urna, at vestibulum nunc turpis id justo. Suspendisse est leo, euismod consequat mollis id, varius eget velit. Suspendisse quis euismod orci. Vestibulum quis blandit risus. Donec eget sagittis mauris. Curabitur eu ligula nec ante suscipit congue. Fusce efficitur scelerisque varius. Integer pulvinar eros a volutpat bibendum. Vivamus vitae est id velit pharetra venenatis. In quis interdum mi.
+
+Pellentesque faucibus ultricies diam, id laoreet sem dignissim et. Ut elementum urna eget leo vestibulum, quis varius enim porttitor. Fusce vitae laoreet velit. Quisque at tempor quam, non mollis augue. Pellentesque pharetra consectetur erat id porttitor. Fusce feugiat erat purus. Morbi nec ultrices leo. Integer purus nunc, posuere ut nisi at, tempor ultricies tellus. Nullam eu accumsan magna. Cras vestibulum ipsum vitae dui commodo laoreet. Suspendisse non elementum metus, et ultricies dui.
+
+Mauris id lorem id mauris dictum iaculis. Phasellus molestie purus sit amet diam sollicitudin scelerisque. Suspendisse potenti. Vestibulum pharetra eu odio id ornare. Etiam fringilla, massa a finibus auctor, est leo posuere ante, vitae malesuada enim nisi condimentum nunc. Quisque blandit finibus molestie. Donec sed iaculis sapien. Vivamus suscipit nibh ut elit venenatis, lacinia eleifend nisi pulvinar. Nunc faucibus magna nec felis viverra dignissim. Sed maximus sem erat, vel accumsan erat dignissim ac. Pellentesque rutrum elit lectus, vel efficitur nisi tristique at. Vivamus non volutpat turpis, non fringilla nisl. Duis tincidunt faucibus massa a interdum. Ut ac nulla id nulla ornare dapibus. Interdum et malesuada fames ac ante ipsum primis in faucibus.
+
+In pretium neque vel mauris imperdiet, nec porta nunc tristique. Nullam id volutpat tortor. Nunc augue orci, vehicula in consectetur in, euismod sit amet lectus. Duis vehicula sagittis tortor, ut cursus ipsum finibus in. Sed vel dui eros. Fusce vehicula justo et lobortis suscipit. Nulla varius, arcu sit amet pulvinar consectetur, urna dolor suscipit nisi, feugiat interdum augue sem a justo. Proin vitae felis mattis, tempus justo ornare, pharetra sem. Nam dictum lorem et nisl lobortis mattis. Curabitur nibh nulla, pulvinar nec justo a, consectetur consectetur erat. Phasellus semper nisl est, et molestie nisl consectetur a. Maecenas ut placerat elit. Ut mattis tincidunt ex, semper hendrerit neque ultrices nec. Curabitur leo massa, dictum at libero eget, molestie luctus risus. In aliquet a erat sed accumsan. Vestibulum venenatis ante ligula, sit amet vestibulum est mollis vitae.
+
+Donec interdum augue eget feugiat venenatis. Mauris interdum tristique urna eu cursus. Donec sit amet diam volutpat massa posuere lacinia a quis lorem. Vivamus et condimentum eros. Sed eleifend dolor eros, laoreet lobortis risus elementum ac. Donec eget semper mauris. Etiam gravida arcu tortor, id egestas sapien vestibulum et. Curabitur tristique urna at nibh bibendum, et blandit turpis feugiat. Cras dignissim lectus rhoncus elit consectetur vestibulum. Ut finibus nisl in sapien mollis, eu faucibus nisi blandit. Ut velit felis, luctus condimentum quam vel, accumsan blandit sem.
+
+Nullam eros risus, ultrices vitae ipsum eget, cursus mollis turpis. Aenean sagittis nibh sit amet viverra lobortis. Quisque ut neque enim. In velit tortor, vulputate sit amet tristique eu, tempor eu tortor. Integer molestie ante vitae odio ultricies imperdiet. Nulla ut finibus lectus. Etiam ac metus malesuada, gravida neque sit amet, consequat nulla. Pellentesque eu arcu ut odio egestas vehicula sed a augue. Nulla egestas condimentum condimentum. Mauris ultrices viverra odio at egestas. Proin sem purus, sodales a tincidunt id, bibendum ut lacus. Aliquam eget laoreet lectus, eu varius sem. Mauris mattis vehicula sem, id egestas dui consectetur nec. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.
+
+Etiam quis dolor ac ante luctus volutpat. Donec aliquam gravida auctor. Nulla suscipit arcu ut molestie sodales. Nunc convallis enim accumsan, porttitor augue sit amet, gravida orci. Donec mollis urna ligula, a sodales quam vulputate non. Pellentesque in suscipit orci. Fusce scelerisque metus sit amet nisl hendrerit, et viverra purus luctus. Phasellus ac imperdiet lacus, sit amet convallis nisl. Mauris vel massa pellentesque, mattis augue sit amet, posuere lectus. Proin ac sagittis ipsum. Nam ligula purus, consequat sed odio at, suscipit pulvinar augue. Donec hendrerit tempus felis accumsan lobortis.
+
+Donec id neque cursus, accumsan dui sed, dapibus lectus. In tempus felis odio. Vivamus dignissim commodo ante, nec egestas urna sagittis ut. Integer maximus malesuada pharetra. Praesent dui mauris, malesuada ac tempus eget, cursus lobortis arcu. Sed nec consectetur purus. Maecenas eget pellentesque nisl.
+
+Vestibulum a neque turpis. Aenean porta fermentum maximus. In at leo dignissim, laoreet metus at, condimentum augue. Pellentesque vitae enim efficitur, tristique ex vitae, commodo mi. Donec vehicula euismod sapien, at pulvinar tellus molestie a. Etiam ut leo consectetur, condimentum sapien scelerisque, tempor metus. Maecenas nisi risus, varius eget viverra rhoncus, mattis vel massa.
+
+Proin tempor lacinia augue et varius. Mauris a velit metus. Quisque a lorem est. Sed ex sapien, rutrum sit amet vestibulum non, efficitur ut ante. Sed quis arcu mollis, tempor est non, ultricies metus. Sed at rutrum risus. Proin efficitur, tellus vitae consequat condimentum, metus purus facilisis libero, sit amet venenatis sapien elit eu libero. Praesent eget elit nec nisl egestas maximus ac ut odio. Pellentesque a ligula arcu. Nunc nibh arcu, efficitur ut feugiat sed, aliquam sit amet ipsum. Phasellus pharetra ut est sit amet dignissim. In consequat ultricies pretium. Proin euismod, ex id condimentum tempus, nulla tortor faucibus dolor, et efficitur velit arcu sit amet sem. Fusce finibus congue volutpat. Morbi ornare lectus ornare ex sodales, ut rhoncus neque consectetur. Aliquam lobortis scelerisque arcu sit amet elementum.
+
+Nullam quis diam in mi varius fringilla. Phasellus nibh quam, vehicula et pellentesque a, pellentesque eu tellus. Nam ac auctor erat. Quisque laoreet, libero non ullamcorper vestibulum, risus nisl consectetur diam, quis porta erat sapien vitae dui. Aenean efficitur, libero a tincidunt commodo, sapien purus blandit sem, vel auctor ante augue ac metus. Pellentesque eu mi urna. Sed condimentum, lacus sit amet varius feugiat, neque ex rhoncus enim, in fermentum turpis metus a libero. Praesent risus purus, malesuada nec accumsan in, tempor ac tellus. Etiam posuere lacinia feugiat. Praesent sagittis, nulla sed scelerisque lacinia, ipsum mi laoreet elit, ut lacinia quam dui semper nibh.
+
+In eget purus placerat, euismod justo at, feugiat eros. Aliquam eget tristique erat. Praesent vehicula neque vitae ex pretium, at sagittis erat tincidunt. Duis nec facilisis lorem. Sed pharetra ut tellus a feugiat. Suspendisse luctus placerat laoreet. Pellentesque eu tempus quam. Quisque eu magna a velit ultricies ullamcorper ac in erat. Mauris ex purus, pellentesque eget congue nec, bibendum at arcu. Nam eros ipsum, pellentesque a massa eget, porta efficitur mi.
+
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse tempor ex a posuere ornare. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Pellentesque faucibus convallis lectus, et ullamcorper nisl pharetra ac. Vivamus eu tortor at dui tempor vulputate. Suspendisse at magna quis ipsum fringilla sodales in vel tellus. Phasellus tellus dolor, sollicitudin ac odio vitae, pellentesque ullamcorper justo. Interdum et malesuada fames ac ante ipsum primis in faucibus. Quisque volutpat convallis sem. Ut varius, sapien vitae tincidunt malesuada, orci ante tempus nisl, eget iaculis turpis mauris ac orci.
+
+Aliquam pretium hendrerit ligula, ut euismod est imperdiet id. Fusce leo massa, blandit sit amet sagittis ut, elementum quis odio. Sed sit amet urna a sem elementum tincidunt id eu libero. In convallis nisi et tellus mollis mollis. Nullam id pretium lorem. Phasellus vel sodales arcu. Integer nec erat vitae justo accumsan porttitor accumsan a eros. Nunc mattis sagittis velit, ut tempor neque maximus in. Nulla vulputate purus non metus venenatis ultrices a non tellus. Praesent sodales nisi quis efficitur imperdiet. Donec a quam id risus interdum sollicitudin eget et orci. Donec hendrerit vel sem in condimentum.
+
+Praesent vel ultricies lorem. Vestibulum tempus malesuada elit a gravida. Proin cursus nisl urna, et finibus nisl porttitor sed. Donec tristique leo vel sem pharetra maximus. Praesent eleifend felis eu imperdiet semper. Etiam pretium mauris diam. Nam quam nisl, laoreet eget scelerisque accumsan, luctus quis dui. Integer at ornare odio.
+
+Sed id tellus velit. Pellentesque vitae condimentum justo. Vestibulum fringilla mauris nec laoreet tincidunt. Maecenas arcu ligula, euismod ut convallis ac, tincidunt id nibh. Aliquam eu sollicitudin velit. Nulla nec sapien leo. Nullam venenatis vel justo vestibulum accumsan. Pellentesque sapien magna, dignissim eget lorem in, condimentum efficitur nisi. Sed quis turpis pellentesque metus aliquam sollicitudin eget vel orci. Sed ac orci nec libero posuere aliquam at quis velit. Quisque at pellentesque quam. Quisque venenatis felis est, eu scelerisque dui elementum non.
+
+Duis venenatis eleifend commodo. In hac habitasse platea dictumst. Proin elementum, mi sed suscipit blandit, purus quam lacinia lectus, ut venenatis felis elit at nulla. Aenean dignissim lacus ac lectus lacinia convallis. Donec fringilla leo purus. Suspendisse potenti. Curabitur aliquam sodales dui ut imperdiet.
+
+Nam in ex id augue facilisis ornare non nec lorem. Nam dolor ex, facilisis nec dignissim vel, mollis eget ex. Aliquam consectetur turpis eget quam pellentesque, at pretium dolor volutpat. Cras sed velit quis dolor scelerisque rhoncus sit amet vel lectus. Sed lacinia arcu convallis mattis aliquet. Proin faucibus vulputate varius. Nullam vel dictum libero. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nulla facilisi. Aliquam mauris ex, faucibus nec tempor quis, placerat maximus augue. Suspendisse commodo pretium sem quis laoreet. Vivamus porta, urna eu tincidunt semper, purus sem tempor sem, ut condimentum diam nibh vel mi. Donec sit amet tellus sit amet mauris vestibulum feugiat. Aliquam in orci quis est feugiat porttitor. Aliquam nec metus ac urna viverra tincidunt.
+
+Nunc ac orci cursus, faucibus justo nec, lobortis tortor. Nulla tincidunt scelerisque risus, at blandit arcu elementum sed. Maecenas non justo dapibus, tincidunt nibh in, porta neque. Sed non mi id leo vestibulum iaculis. Nam ultricies odio eget arcu vehicula tempus. Suspendisse maximus consectetur arcu, id dapibus lacus mollis et. Fusce nec vulputate nulla. Nam dictum eget sapien id interdum. Duis mi sem, gravida nec dolor vel, elementum facilisis tellus. Integer vel accumsan diam. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed in commodo ex. Praesent commodo porttitor ipsum. Vestibulum volutpat diam at tellus feugiat, id sodales magna bibendum. Mauris odio eros, rutrum at scelerisque eget, porta sed turpis. Suspendisse porta dictum cursus.
+
+Mauris accumsan finibus mi sit amet auctor. Aliquam erat volutpat. Vestibulum at euismod sapien, euismod tincidunt lectus. Mauris aliquet sapien at erat vestibulum, a vestibulum dui bibendum. Etiam vel vulputate justo. Nam vitae ultrices nisl, eu dapibus ex. Quisque volutpat nibh vitae semper tristique. Mauris in nibh lectus. Maecenas elit leo, ultricies quis bibendum sed, rhoncus et neque. Sed elementum nec dui id lobortis. Vestibulum sollicitudin arcu nulla, sit amet lobortis urna ultrices a. Cras fermentum dolor id faucibus pretium. Pellentesque congue quam metus, quis consequat leo sollicitudin vitae.
+
+Integer congue, neque a scelerisque varius, purus nibh fringilla nunc, sit amet pretium felis sapien vel orci. Donec mattis ac orci in viverra. Suspendisse a justo sollicitudin lacus efficitur ullamcorper. Mauris faucibus nisl quis dolor volutpat aliquam. Aenean venenatis, odio et rhoncus lobortis, risus ligula finibus massa, non dignissim augue nisl vel arcu. Nullam fringilla odio at libero scelerisque, vitae placerat nisi fringilla. Etiam quis urna turpis. Quisque quis leo ante. Duis nec elit massa. Sed porttitor, nulla id efficitur blandit, purus ligula vulputate lectus, quis molestie metus orci ac tellus. Donec sapien massa, suscipit eu tristique ac, posuere sed lorem. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aliquam erat volutpat. Duis bibendum erat eget felis tempor, eget imperdiet nibh vestibulum. In hac habitasse platea dictumst. Quisque vehicula pulvinar turpis, ac dictum risus auctor varius.
+
+Praesent ac ex vestibulum, dapibus lacus in, malesuada diam. Sed in turpis in justo venenatis pharetra. Fusce sed lobortis nisl. Phasellus faucibus magna ante, malesuada placerat justo faucibus tempus. Phasellus hendrerit fermentum felis. Proin malesuada, urna vel tincidunt pharetra, eros ante bibendum sem, nec viverra nunc arcu at mauris. Sed et lorem pharetra, feugiat tortor vitae, rutrum lacus. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed mauris leo, condimentum at risus eget, aliquam consequat mauris. Mauris id auctor purus.
+
+Aenean augue mauris, cursus quis elit eget, molestie pharetra sem. Mauris congue felis ut nibh facilisis, ut pharetra arcu pharetra. Curabitur semper mattis orci eu dictum. Phasellus hendrerit scelerisque dignissim. Sed aliquet nunc scelerisque, facilisis nulla at, posuere lorem. Maecenas blandit, lectus nec varius bibendum, nibh risus posuere turpis, id pretium justo elit vitae ligula. Sed risus ante, congue quis libero consequat, laoreet convallis diam.
+
+Aenean sagittis ex vel semper ullamcorper. Donec mattis, ipsum tincidunt aliquet vehicula, elit tellus porta mi, a convallis quam orci ac lectus. Proin aliquam nulla in erat mattis placerat. Aliquam ligula sem, egestas ac turpis vitae, facilisis iaculis mauris. Donec ac egestas urna, ac iaculis orci. Integer urna magna, eleifend sed nunc vitae, commodo lobortis massa. Aenean ultrices pulvinar dui, non blandit lorem pretium quis. Praesent in molestie purus, vestibulum interdum quam. Pellentesque auctor erat non mauris fringilla eleifend.
+
+Etiam blandit vel leo nec pulvinar. Phasellus elementum facilisis mi et egestas. Praesent finibus, elit vel venenatis sodales, turpis nibh tincidunt turpis, eu venenatis urna tortor at massa. Proin iaculis ipsum ut elit maximus tincidunt. Suspendisse justo turpis, sollicitudin ut eros quis, dictum placerat nibh. Sed mattis ornare pulvinar. Cras lacus purus, interdum vitae commodo sollicitudin, suscipit eu quam. Mauris luctus laoreet metus at posuere. Etiam faucibus diam quis purus vulputate, nec blandit lorem bibendum.
+
+Aliquam nisl neque, vulputate eu arcu id, elementum dictum sapien. Aliquam aliquam, mauris eget vestibulum accumsan, metus tellus vulputate urna, nec volutpat felis turpis ac nulla. Morbi pretium magna bibendum eros ultricies lobortis. Vestibulum euismod vitae nibh in posuere. Vivamus in iaculis mi. Pellentesque iaculis ex nec tellus pulvinar interdum. Integer a tincidunt risus, eu faucibus mi. Vivamus posuere sapien eu orci scelerisque rutrum at eu leo. Nullam consectetur est eu justo congue commodo. Vestibulum ac finibus velit. Donec faucibus nulla at risus rhoncus, a vulputate magna pulvinar. Aliquam condimentum rhoncus lacus sed hendrerit.
+
+Morbi non hendrerit nisl, eu fringilla erat. Praesent ac dolor sit amet libero tempus porttitor. Cras vel sem elementum, venenatis ipsum vel, molestie tellus. Aliquam erat volutpat. Maecenas malesuada urna nec diam sodales pharetra. Aliquam non lobortis metus. Donec eleifend mollis eros in condimentum. Suspendisse sagittis consequat justo, vitae tincidunt orci luctus vel. Ut lobortis tincidunt libero. Sed dignissim lorem sit amet nibh aliquam, pharetra pulvinar justo consequat. Suspendisse sed dictum massa. Ut fermentum, dolor a fringilla bibendum, lorem ligula scelerisque turpis, in porta justo neque non lectus. Suspendisse pellentesque risus sit amet ligula pretium condimentum. Fusce odio tortor, pulvinar in dapibus nec, pharetra eget nisi. Suspendisse luctus eros eget mauris pretium blandit.
+
+Nam vel fermentum nulla. Sed tincidunt tellus id mattis dapibus. Quisque ac congue libero, nec elementum nulla. Phasellus quam eros, congue eu lacinia a, interdum et eros. Aenean suscipit risus interdum mauris porttitor, vehicula auctor tellus molestie. Donec efficitur nisi eget ex interdum sollicitudin. Nunc ultricies maximus quam, at pulvinar eros volutpat quis. Nam venenatis mauris enim, sed malesuada tortor eleifend sit amet. Cras imperdiet convallis viverra. Proin purus nulla, bibendum in aliquam quis, sollicitudin a risus. Proin vehicula tincidunt tortor quis lacinia. Praesent tristique odio sed orci consequat, ut pulvinar mauris semper. Mauris felis mi, ultricies a dolor id, viverra laoreet orci. Nam ex mi, semper nec imperdiet sed, posuere et eros.
+
+Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Donec scelerisque ipsum sed libero tempor, in vulputate ante sodales. Sed vehicula nulla non ante blandit, quis porttitor diam auctor. Nulla sodales risus ut dui vulputate, nec elementum sem volutpat. Quisque id blandit quam. Proin interdum quis lacus ac suscipit. Etiam a scelerisque sapien. Praesent cursus, mi eget dapibus hendrerit, nibh eros elementum lacus, sit amet congue dui nunc at dui. Phasellus tristique nulla ut tincidunt faucibus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Suspendisse efficitur congue purus, a viverra sapien tristique vel.
+
+Vestibulum elementum pellentesque turpis. Phasellus id quam sit amet ex sodales malesuada. Morbi iaculis quis nibh vitae finibus. Nullam vitae luctus nisl, ac varius leo. Fusce sed quam eu enim volutpat blandit. Etiam ornare aliquam mi, eget porttitor magna euismod non. Curabitur porta vel metus ut mollis.
+
+Aenean sit amet sagittis lacus. Quisque in dui commodo, rutrum massa tincidunt, hendrerit mauris. Maecenas sit amet nisl facilisis, interdum eros rhoncus, malesuada nisl. Aliquam condimentum erat dui, eget dignissim magna volutpat vitae. Mauris porttitor, risus ut auctor porttitor, sem nisl interdum nisi, ac tempus est enim in tortor. Sed rhoncus magna ac feugiat pharetra. Nulla scelerisque quis neque ut porttitor. Ut lacinia in ipsum sit amet lobortis. Aliquam eu justo vel leo facilisis tristique. Pellentesque cursus, lacus a rhoncus auctor, erat velit vehicula diam, et fermentum erat mauris fermentum turpis. Donec quam sapien, laoreet sodales sagittis ac, sodales vitae lectus. Donec vitae lorem rutrum, lobortis libero maximus, condimentum sapien. Pellentesque mi lorem, rhoncus vel lacinia a, venenatis et velit.
+
+Curabitur malesuada ante vel maximus luctus. Etiam dui lectus, condimentum eget lobortis eget, eleifend pellentesque ligula. Nam eu pharetra urna, sit amet facilisis turpis. Mauris tincidunt vestibulum turpis nec suscipit. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Pellentesque egestas commodo finibus. Donec pellentesque nec libero et imperdiet. Cras cursus purus ut libero pretium vulputate. Mauris non arcu purus. Donec sollicitudin dignissim massa ac tincidunt. Donec non consectetur turpis, et venenatis dui.
+
+Nam mattis urna dolor, a varius sem tempor a. Vivamus porttitor dignissim metus vel ultrices. Integer ac justo vel nisl consequat efficitur. Maecenas sit amet hendrerit elit. Suspendisse lobortis semper mauris id convallis. Duis nibh dui, lacinia a turpis sed, interdum aliquam ex. Praesent tempor rhoncus nibh vel dictum. Quisque feugiat mi sit amet nunc fermentum pellentesque. Ut porta lacinia erat eu pulvinar. Nulla vestibulum fermentum felis, eu ultricies lectus. Ut eget lobortis sapien. Aenean consectetur in nisl interdum mattis. Sed a ipsum pharetra, congue augue a, accumsan ex. Quisque luctus sapien non tincidunt vulputate.
+
+Aenean auctor consectetur urna et rhoncus. Vivamus mattis tortor at massa porta, in auctor quam porttitor. Nulla facilisi. Sed auctor ipsum tortor, quis hendrerit risus convallis eget. Vivamus a mollis nulla, at fringilla risus. In a cursus dui, nec vehicula elit. Donec in sodales ante, quis gravida est. Sed interdum mi non ornare lacinia. Cras placerat cursus dolor nec euismod. Nulla vel velit quis nibh aliquam eleifend. Cras mattis vitae erat nec gravida. Vestibulum luctus sagittis nibh, a pretium neque dictum eget. Quisque vitae consequat dui. Donec libero eros, pharetra sit amet sapien id, euismod gravida mi.
+
+Duis tristique nisi id urna feugiat, sed aliquet nulla imperdiet. Ut quis felis finibus, lobortis nunc eu, sodales risus. Fusce at euismod risus. Nunc pulvinar libero volutpat, mattis eros facilisis, mollis nibh. Maecenas augue nunc, mollis sit amet volutpat et, interdum eu augue. Etiam porttitor tortor sem, vitae hendrerit nulla lobortis ut. In non sollicitudin eros. Cras bibendum lorem id odio sollicitudin euismod. Aliquam ullamcorper purus at turpis accumsan blandit. Donec at interdum arcu. Nam fermentum est lectus, vel tincidunt purus sollicitudin a. Aliquam vel orci massa.
+
+Fusce fringilla et justo et interdum. Fusce molestie, tellus vitae elementum lobortis, enim augue condimentum nulla, a semper enim quam in dui. Vestibulum a pharetra felis. Proin eu sollicitudin leo. In vestibulum rhoncus augue, non ultrices turpis. Donec maximus neque semper tellus condimentum, in aliquam dui posuere. Sed ultrices nisl purus, quis sollicitudin eros laoreet quis. Praesent nunc nisl, varius at suscipit sed, tristique at neque.
+
+Quisque aliquam tincidunt augue vitae rhoncus. Interdum et malesuada fames ac ante ipsum primis in faucibus. Proin eu luctus erat. Nullam auctor, purus a eleifend efficitur, metus ligula accumsan quam, quis bibendum enim lacus quis neque. Maecenas lacinia ipsum molestie felis accumsan, in dignissim purus aliquet. Nunc turpis massa, ultricies in lacinia ut, luctus ut felis. Morbi magna nisi, sodales in arcu sit amet, efficitur mattis velit. Ut scelerisque enim nibh, vel pretium urna varius vel. Cras vitae accumsan nunc, ut iaculis tortor. Nam vitae laoreet orci, sit amet rutrum mi. Nunc blandit purus eu hendrerit tempor. Vestibulum tincidunt pharetra purus ut sodales. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
+
+Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nulla sed laoreet urna, sit amet commodo erat. Fusce euismod justo erat, et placerat odio accumsan finibus. Proin pellentesque ligula ut nibh condimentum, sed ornare justo faucibus. Fusce consectetur sapien nec dui varius, vel pharetra felis molestie. Duis accumsan odio metus, ut varius orci finibus nec. Sed non ipsum vitae est aliquet mollis. Pellentesque facilisis feugiat suscipit.
+
+Mauris ut enim sit amet metus bibendum finibus. Suspendisse iaculis, tellus maximus placerat elementum, libero turpis fermentum dolor, ut lacinia sapien ipsum a nulla. Etiam sollicitudin dictum dolor, ac congue sem pulvinar nec. Ut egestas urna non neque volutpat egestas. Integer porta vel orci volutpat tincidunt. In egestas fringilla ipsum ac pharetra. Fusce justo dui, dignissim sed leo at, tincidunt finibus magna. Pellentesque vel nunc risus. Praesent lacinia blandit convallis. Cras eget magna metus. Maecenas fringilla dolor eu quam dictum consequat. Donec pellentesque eleifend velit, a commodo dui faucibus eu. Phasellus pretium nulla ipsum, et interdum magna interdum et. Mauris a sem ullamcorper, consectetur quam accumsan, porttitor eros.
+
+Praesent facilisis, ipsum ac tincidunt auctor, tellus ipsum convallis magna, vel maximus sem lorem et tortor. Sed elit diam, faucibus sed turpis eget, commodo facilisis nunc. Vestibulum vitae arcu tristique, varius libero molestie, sollicitudin mi. In tincidunt nisl in eros imperdiet faucibus. Cras ex ipsum, vehicula eget neque eget, viverra pellentesque erat. Suspendisse vitae tristique dolor. Nulla ornare imperdiet metus id mollis. Fusce ligula ex, aliquam sed purus quis, venenatis volutpat lectus. Sed iaculis ante sit amet massa consequat interdum. Ut feugiat risus sit amet commodo euismod. Sed tristique quam sit amet lacinia cursus. Donec faucibus, erat a dapibus rhoncus, orci est interdum ex, sit amet semper massa quam et lectus.
+
+Suspendisse mollis turpis aliquam felis efficitur, eu ultrices tellus suscipit. Aenean at congue erat, vel ultricies eros. Quisque hendrerit arcu ut est aliquet, et vehicula lectus ullamcorper. Pellentesque posuere neque nec auctor scelerisque. Phasellus rhoncus odio ac nisl ornare condimentum. Nam nec arcu porttitor tellus faucibus malesuada id a est. Vivamus id facilisis ante. Proin quis risus ipsum. In sed nibh at nisl tempus interdum. Ut sit amet malesuada nisl, id pharetra metus. Nulla lorem velit, euismod nec dictum at, porttitor ac erat. Aliquam est leo, elementum nec ultricies nec, interdum sed libero. Quisque mattis placerat scelerisque. Praesent vulputate sit amet felis non tristique.
+
+Phasellus odio ex, ultricies et tincidunt sit amet, auctor id felis. Fusce facilisis nibh risus, eget placerat nunc pellentesque vel. Morbi cursus metus eu arcu viverra rutrum. Nulla eget dolor blandit, pulvinar sem aliquet, hendrerit purus. Fusce sodales venenatis posuere. Cras egestas placerat odio non scelerisque. Praesent tincidunt maximus semper. Vivamus eget libero massa. Cras auctor orci sed nibh sagittis ultrices. Curabitur leo lacus, suscipit ac pharetra vel, euismod eu turpis. Aenean quis justo efficitur, mattis nisl sed, mollis lacus. Integer feugiat non metus vitae faucibus. Morbi sem massa, pretium id risus a, congue volutpat mi. Vivamus lacinia enim lorem, id malesuada ante vehicula non. Praesent ac urna quis justo malesuada euismod.
+
+Integer sed ligula id purus dictum tempus eu non ex. Phasellus tincidunt lectus in imperdiet porttitor. Integer ligula dolor, porttitor et congue vitae, elementum eget sem. Proin a libero in enim efficitur mollis. Proin molestie metus dolor, in fermentum massa condimentum at. Cras eget auctor odio, a luctus sapien. Nulla in hendrerit leo, sed venenatis augue. Proin mollis vestibulum magna. Nulla dapibus lacus nec condimentum maximus. Phasellus id efficitur enim. Vivamus molestie mauris at condimentum elementum. Maecenas ultrices mauris quis tincidunt viverra. Ut eget ultricies ligula. Nulla id fermentum nisl, in ultrices velit.
+
+Nunc blandit tellus sed est auctor condimentum. Integer fringilla aliquam libero, id sagittis ipsum lacinia sit amet. Donec sit amet nunc felis. Vestibulum at commodo arcu, a malesuada est. Aenean ultrices, mauris in pellentesque posuere, mi orci fermentum justo, vitae rutrum neque erat a nisi. In sed urna quis sem egestas faucibus ut quis ipsum. Quisque porta lectus sit amet urna ultricies iaculis.
+
+Praesent ultrices odio nisl, eu consequat dolor sollicitudin nec. Suspendisse dignissim lobortis nulla nec molestie. Duis in diam sed est dignissim faucibus vitae in metus. Phasellus lacinia urna eros, vitae vulputate sem fermentum eget. Suspendisse et efficitur dolor. Mauris faucibus sodales felis eu luctus. Cras non mattis lacus. Proin in lobortis sapien. Nulla at augue sed est congue sollicitudin.
+
+Nunc nisi lorem, dapibus id tincidunt quis, sollicitudin sit amet justo. In mollis orci pretium aliquam fermentum. Fusce sodales mi eget tellus posuere ullamcorper. Sed varius sagittis elit, in feugiat odio maximus sed. Cras eleifend massa sit amet mi suscipit, vel laoreet leo pretium. Quisque neque erat, mollis eget elementum non, blandit in lectus. Sed dignissim felis ac felis convallis elementum molestie id lectus. Nullam fermentum lorem mi, in placerat quam mollis vitae. Pellentesque ultrices, nibh at sagittis molestie, augue mauris bibendum dui, ut ultricies lorem magna eu massa. Quisque quis purus eu nisi rhoncus tempor. Donec eget fringilla massa. Vivamus sed varius elit. Aenean egestas tellus eget magna dapibus hendrerit. Nunc vel leo eu purus tempus mollis.
+
+Praesent sagittis eget lectus non vestibulum. Fusce id elit nisi. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Donec id malesuada justo, non ornare felis. Nulla ultricies lorem ex, et accumsan ex volutpat sodales. Pellentesque venenatis neque in hendrerit blandit. Donec dapibus est fermentum lacus fringilla, ut volutpat tellus consectetur. Maecenas id semper tortor. In pellentesque aliquet elit, non vulputate augue mollis fermentum. Nullam posuere eget elit a placerat. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
+
+Phasellus vestibulum tristique quam a faucibus. Proin sit amet sem et leo posuere efficitur vitae et ante. Nullam congue nisl augue, in ultricies orci tempor quis. Aliquam erat volutpat. In luctus, sapien at venenatis fermentum, lorem urna ultrices elit, ac volutpat metus purus eu turpis. Phasellus semper cursus mi, vitae tempor est accumsan at. Integer accumsan nec augue vitae viverra. Sed tempus cursus enim non dapibus. In commodo neque in ultricies semper. Proin auctor lacinia eros, ut tempor lectus pulvinar quis. Ut fermentum vulputate pellentesque. Duis tempor ante quis metus consectetur maximus. Curabitur a tincidunt enim.
+
+Vestibulum dictum, urna a fringilla imperdiet, tortor arcu mattis odio, et efficitur dui neque ac mauris. Vestibulum auctor risus lacus. Integer elementum erat nisl, id vehicula enim mattis in. Vestibulum consequat neque ante, in sodales magna pulvinar in. Vivamus interdum eros non magna aliquam tristique. Ut aliquam congue ante in gravida. Sed eu turpis sollicitudin, suscipit ligula id, commodo tellus. Aliquam eu sapien vitae augue gravida egestas nec sit amet turpis. Curabitur vulputate vulputate dui, et facilisis lectus tincidunt nec. Integer tristique vitae quam condimentum maximus. Ut ultricies convallis nisl eu elementum.
+
+Curabitur non nisi lectus. Aliquam finibus lorem id dui molestie, sed ullamcorper quam lobortis. Maecenas in gravida urna. Pellentesque consequat risus vel nibh tempus facilisis. Etiam auctor lacinia lacus vitae vulputate. Etiam bibendum arcu at ipsum elementum, id sodales nunc convallis. Phasellus elementum mi non sapien blandit suscipit. Integer accumsan et justo nec mattis. Vestibulum quis erat viverra, condimentum enim eget, auctor tortor. Nunc ac mauris sit amet urna pellentesque malesuada. Fusce urna justo, finibus eget blandit eget, volutpat eu nisi. In nisi nunc, sodales sit amet tempor eu, feugiat feugiat tellus. Nulla felis purus, gravida eu iaculis in, interdum id purus. In hac habitasse platea dictumst. Aenean consequat, quam tincidunt sodales lacinia, ex dui faucibus massa, ut porta dolor justo et mi.
+
+Donec a massa porta, vehicula diam et, pulvinar tortor. Duis tincidunt, nibh ut pharetra hendrerit, est orci egestas urna, et sollicitudin massa lacus aliquam ex. Curabitur in quam sed elit scelerisque pretium nec rhoncus nulla. In a ligula.
+ """
+
+ run () -> stringify.attEscape(text)
diff --git a/generator/node_modules/xmlbuilder/perf/basic/object.coffee b/generator/node_modules/xmlbuilder/perf/basic/object.coffee
new file mode 100644
index 0000000..ac7df51
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/perf/basic/object.coffee
@@ -0,0 +1,21 @@
+perf 'Create simple object', 100000, (run) ->
+ obj =
+ ele: "simple element"
+ person:
+ name: "John"
+ '@age': 35
+ '?pi': 'mypi'
+ '#comment': 'Good guy'
+ '#cdata': 'well formed!'
+ unescaped:
+ '#raw': '&<>&'
+ address:
+ city: "Istanbul"
+ street: "End of long and winding road"
+ contact:
+ phone: [ "555-1234", "555-1235" ]
+ id: () -> return 42
+ details:
+ '#text': 'classified'
+
+ run () -> xml(obj)
diff --git a/generator/node_modules/xmlbuilder/perf/index.coffee b/generator/node_modules/xmlbuilder/perf/index.coffee
new file mode 100644
index 0000000..3bd0f93
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/perf/index.coffee
@@ -0,0 +1,161 @@
+builder = require('../src/index')
+git = require('git-state')
+fs = require('fs')
+path = require('path')
+{ performance, PerformanceObserver } = require('perf_hooks')
+
+global.xml = builder.create
+global.doc = builder.begin
+
+global.perf = (description, count, func) ->
+
+ totalTime = 0
+
+ callback = (userFunction) ->
+ startTime = performance.now()
+ for i in [1..count]
+ userFunction()
+ endTime = performance.now()
+ totalTime += endTime - startTime
+ func(callback)
+
+ averageTime = totalTime / count
+
+ version = require('../package.json').version
+ working = gitWorking(gitDir)
+ if working then version = version + "*"
+ if not perfObj[version] then perfObj[version] = { }
+
+ perfObj[version][description] = averageTime.toFixed(4)
+
+readPerf = (filename) ->
+ if not fs.existsSync(filename) then fs.closeSync(fs.openSync(filename, 'w'))
+ str = fs.readFileSync(filename, 'utf8')
+ if str then JSON.parse(str) else { }
+
+runPerf = (dirPath) ->
+ for file from walkDir(dirPath)
+ filename = path.basename(file)
+ if filename is "index.coffee" or filename is "perf.list" then continue
+ require(file)
+
+walkDir = (dirPath) ->
+ for file in fs.readdirSync(dirPath)
+ filePath = path.join(dirPath, file)
+ stat = fs.statSync(filePath)
+ if stat.isFile() then yield filePath else if stat.isDirectory() then yield from walkDir(filePath)
+ return undefined
+
+gitWorking = (dirPath) ->
+ return git.isGitSync(dirPath) and git.dirtySync(dirPath)
+
+printPerf = (perfObj) ->
+ sorted = sortByVersion(perfObj)
+
+ for sortedItems in sorted
+ version = sortedItems.version
+ items = sortedItems.item
+ sortedItem = sortByDesc(items)
+
+ if parseVersion(version)[3]
+ console.log "\x1b[4mv%s (Working Tree):\x1b[0m", version
+ else
+ console.log "\x1b[4mv%s:\x1b[0m", version
+
+ longestDescription = 0
+ for item in sortedItem
+ descriptionLength = item.description.length
+ if descriptionLength > longestDescription
+ longestDescription = descriptionLength
+
+ for item in sortedItem
+ description = item.description
+ averageTime = item.averageTime
+ prevItem = findPrevPerf(sorted, version, description)
+ if prevItem
+ if averageTime < prevItem.item[description]
+ console.log " - \x1b[36m%s\x1b[0m \x1b[1m\x1b[32m%s\x1b[0m ms (v%s was \x1b[1m%s\x1b[0m ms, -\x1b[1m%s\x1b[0m%)", padRight(description, longestDescription), averageTime, prevItem.version, prevItem.item[description], (-100*(averageTime - prevItem.item[description]) / prevItem.item[description]).toFixed(0)
+ else if averageTime > prevItem.item[description]
+ console.log " - \x1b[36m%s\x1b[0m \x1b[1m\x1b[31m%s\x1b[0m ms (v%s was \x1b[1m%s\x1b[0m ms, +\x1b[1m%s\x1b[0m%)", padRight(description, longestDescription), averageTime, prevItem.version, prevItem.item[description], (100*(averageTime - prevItem.item[description]) / prevItem.item[description]).toFixed(0)
+ else
+ console.log " - \x1b[36m%s\x1b[0m \x1b[1m%s\x1b[0m ms (v%s was \x1b[1m%s\x1b[0m ms, \x1b[1m%s\x1b[0m%)", padRight(description, longestDescription), averageTime, prevItem.version, prevItem.item[description], (100*(averageTime - prevItem.item[description]) / prevItem.item[description]).toFixed(0)
+ else
+ console.log " - \x1b[36m%s\x1b[0m \x1b[1m%s\x1b[0m ms (no previous result)", padRight(description, longestDescription), averageTime
+
+padRight = (str, len) ->
+ str + " ".repeat(len - str.length)
+
+writePerf = (filename, perfObj) ->
+ writePerfObj = { }
+ for version, items of perfObj
+ if not parseVersion(version)[3]
+ writePerfObj[version] = items
+ fs.writeFileSync(filename, JSON.stringify(writePerfObj, null, 2) , 'utf-8')
+
+findPrevPerf = (sorted, version, description) ->
+ prev = undefined
+ for item in sorted
+ if compareVersion(item.version, version) is -1
+ if item.item[description]
+ prev = item
+ return prev
+
+sortByVersion = (perfObj) ->
+ sorted = []
+ for version, items of perfObj
+ sorted.push
+ version: version
+ item: items
+ sorted.sort (item1, item2) ->
+ compareVersion(item1.version, item2.version)
+
+sortByDesc = (item) ->
+ sorted = []
+ for description, averageTime of item
+ sorted.push
+ description: description
+ averageTime: averageTime
+ sorted.sort (item1, item2) ->
+ if item1.description < item2.description then -1 else 1
+
+parseVersion = (version) ->
+ isDirty = version[version.length - 1] is "*"
+ if isDirty then version = version.substr(0, version.length - 1)
+ v = version.split('.')
+ v.push(isDirty)
+ return v
+
+compareVersion = (v1, v2) ->
+ v1 = parseVersion(v1)
+ v2 = parseVersion(v2)
+
+ if v1[0] < v2[0]
+ -1
+ else if v1[0] > v2[0]
+ 1
+ else # v1[0] = v2[0]
+ if v1[1] < v2[1]
+ -1
+ else if v1[1] > v2[1]
+ 1
+ else # v1[1] = v2[1]
+ if v1[2] < v2[2]
+ -1
+ else if v1[2] > v2[2]
+ 1
+ else # v1[2] = v2[2]
+ if v1[3] and not v2[3]
+ 1
+ else if v2[3] and not v1[3]
+ -1
+ else
+ 0
+
+
+perfDir = __dirname
+gitDir = path.resolve(__dirname, '..')
+perfFile = path.join(perfDir, './perf.list')
+perfObj = readPerf(perfFile)
+runPerf(perfDir)
+printPerf(perfObj)
+writePerf(perfFile, perfObj)
diff --git a/generator/node_modules/xmlbuilder/perf/perf.list b/generator/node_modules/xmlbuilder/perf/perf.list
new file mode 100644
index 0000000..711b077
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/perf/perf.list
@@ -0,0 +1,11 @@
+{
+ "13.0.2": {
+ "Attribute value escaping": "0.0058",
+ "Attribute value escaping (long value)": "0.0159",
+ "Attribute value escaping (no replacement)": "0.0002",
+ "Create simple object": "0.0218",
+ "Text escaping": "0.0061",
+ "Text escaping (long text)": "0.0046",
+ "Text escaping (no replacement)": "0.0002"
+ }
+} \ No newline at end of file
diff --git a/generator/node_modules/xmlbuilder/typings/index.d.ts b/generator/node_modules/xmlbuilder/typings/index.d.ts
new file mode 100644
index 0000000..27bf269
--- /dev/null
+++ b/generator/node_modules/xmlbuilder/typings/index.d.ts
@@ -0,0 +1,1771 @@
+
+import { Writable } from 'stream';
+
+export = xmlbuilder;
+
+/**
+ * Type definitions for [xmlbuilder](https://github.com/oozcitak/xmlbuilder-js)
+ *
+ * Original definitions on [DefinitelyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped) by:
+ * - Wallymathieu <https://github.com/wallymathieu>
+ * - GaikwadPratik <https://github.com/GaikwadPratik>
+ */
+declare namespace xmlbuilder {
+ /**
+ * Creates a new XML document and returns the root element node.
+ *
+ * @param nameOrObject - name of the root element or a JS object to be
+ * converted to an XML tree
+ * @param xmldecOrOptions - XML declaration or create options
+ * @param doctypeOrOptions - Doctype declaration or create options
+ * @param options - create options
+ */
+ function create(nameOrObject: string | { [name: string]: Object },
+ xmldecOrOptions?: CreateOptions, doctypeOrOptions?: CreateOptions,
+ options?: CreateOptions): XMLElement;
+
+ /**
+ * Defines the options used while creating an XML document with the `create`
+ * function.
+ */
+ interface CreateOptions {
+ /**
+ * A version number string, e.g. `1.0`
+ */
+ version?: string;
+ /**
+ * Encoding declaration, e.g. `UTF-8`
+ */
+ encoding?: string;
+ /**
+ * Standalone document declaration: `true` or `false`
+ */
+ standalone?: boolean;
+
+ /**
+ * Public identifier of the DTD
+ */
+ pubID?: string;
+ /**
+ * System identifier of the DTD
+ */
+ sysID?: string;
+
+ /**
+ * Whether XML declaration and doctype will be included
+ */
+ headless?: boolean;
+ /**
+ * Whether nodes with `null` values will be kept or ignored
+ */
+ keepNullNodes?: boolean;
+ /**
+ * Whether attributes with `null` values will be kept or ignored
+ */
+ keepNullAttributes?: boolean;
+ /**
+ * Whether decorator strings will be ignored when converting JS
+ * objects
+ */
+ ignoreDecorators?: boolean;
+ /**
+ * Whether array items are created as separate nodes when passed
+ * as an object value
+ */
+ separateArrayItems?: boolean;
+ /**
+ * Whether existing html entities are encoded
+ */
+ noDoubleEncoding?: boolean;
+ /**
+ * Whether values will be validated and escaped or returned as is
+ */
+ noValidation?: boolean;
+ /**
+ * A character to replace invalid characters in all values. This also
+ * disables character validation.
+ */
+ invalidCharReplacement?: string;
+ /**
+ * A set of functions to use for converting values to strings
+ */
+ stringify?: XMLStringifier;
+ /**
+ * The default XML writer to use for converting nodes to string.
+ * If the default writer is not set, the built-in `XMLStringWriter`
+ * will be used instead.
+ */
+ writer?: XMLWriter;
+ }
+
+ /**
+ * Defines the functions used for converting values to strings.
+ */
+ interface XMLStringifier {
+ /**
+ * Converts an element or attribute name to string
+ */
+ name?: (v: any) => string;
+ /**
+ * Converts the contents of a text node to string
+ */
+ text?: (v: any) => string;
+ /**
+ * Converts the contents of a CDATA node to string
+ */
+ cdata?: (v: any) => string;
+ /**
+ * Converts the contents of a comment node to string
+ */
+ comment?: (v: any) => string;
+ /**
+ * Converts the contents of a raw text node to string
+ */
+ raw?: (v: any) => string;
+ /**
+ * Converts attribute value to string
+ */
+ attValue?: (v: any) => string;
+ /**
+ * Converts processing instruction target to string
+ */
+ insTarget?: (v: any) => string;
+ /**
+ * Converts processing instruction value to string
+ */
+ insValue?: (v: any) => string;
+ /**
+ * Converts XML version to string
+ */
+ xmlVersion?: (v: any) => string;
+ /**
+ * Converts XML encoding to string
+ */
+ xmlEncoding?: (v: any) => string;
+ /**
+ * Converts standalone document declaration to string
+ */
+ xmlStandalone?: (v: any) => string;
+ /**
+ * Converts DocType public identifier to string
+ */
+ dtdPubID?: (v: any) => string;
+ /**
+ * Converts DocType system identifier to string
+ */
+ dtdSysID?: (v: any) => string;
+ /**
+ * Converts `!ELEMENT` node content inside Doctype to string
+ */
+ dtdElementValue?: (v: any) => string;
+ /**
+ * Converts `!ATTLIST` node type inside DocType to string
+ */
+ dtdAttType?: (v: any) => string;
+ /**
+ * Converts `!ATTLIST` node default value inside DocType to string
+ */
+ dtdAttDefault?: (v: any) => string;
+ /**
+ * Converts `!ENTITY` node content inside Doctype to string
+ */
+ dtdEntityValue?: (v: any) => string;
+ /**
+ * Converts `!NOTATION` node content inside Doctype to string
+ */
+ dtdNData?: (v: any) => string;
+
+ /**
+ * When prepended to a JS object key, converts the key-value pair
+ * to an attribute.
+ */
+ convertAttKey?: string;
+ /**
+ * When prepended to a JS object key, converts the key-value pair
+ * to a processing instruction node.
+ */
+ convertPIKey?: string;
+ /**
+ * When prepended to a JS object key, converts its value to a text node.
+ *
+ * _Note:_ Since JS objects cannot contain duplicate keys, multiple text
+ * nodes can be created by adding some unique text after each object
+ * key. For example: `{ '#text1': 'some text', '#text2': 'more text' };`
+ */
+ convertTextKey?: string;
+ /**
+ * When prepended to a JS object key, converts its value to a CDATA
+ * node.
+ */
+ convertCDataKey?: string;
+ /**
+ * When prepended to a JS object key, converts its value to a
+ * comment node.
+ */
+ convertCommentKey?: string;
+ /**
+ * When prepended to a JS object key, converts its value to a raw
+ * text node.
+ */
+ convertRawKey?: string;
+
+ /**
+ * Escapes special characters in text.
+ */
+ textEscape?: (v: string) => string;
+
+ /**
+ * Escapes special characters in attribute values.
+ */
+ attEscape?: (v: string) => string;
+ }
+
+ /**
+ * Represents a writer which outputs an XML document.
+ */
+ interface XMLWriter {
+ /**
+ * Writes the indentation string for the given level.
+ *
+ * @param node - current node
+ * @param options - writer options and state information
+ * @param level - current depth of the XML tree
+ */
+ indent?: (node: XMLNode, options: WriterOptions, level: number) => any
+
+ /**
+ * Writes the newline string.
+ *
+ * @param node - current node
+ * @param options - writer options and state information
+ * @param level - current depth of the XML tree
+ */
+ endline?: (node: XMLNode, options: WriterOptions, level: number) => any
+
+ /**
+ * Writes an attribute.
+ *
+ * @param att - current attribute
+ * @param options - writer options and state information
+ * @param level - current depth of the XML tree
+ */
+ attribute?: (att: XMLAttribute, options: WriterOptions,
+ level: number) => any
+
+ /**
+ * Writes a CDATA node.
+ *
+ * @param node - current node
+ * @param options - writer options and state information
+ * @param level - current depth of the XML tree
+ */
+ cdata?: (node: XMLCData, options: WriterOptions, level: number) => any
+
+ /**
+ * Writes a comment node.
+ *
+ * @param node - current node
+ * @param options - writer options and state information
+ * @param level - current depth of the XML tree
+ */
+ comment?: (node: XMLComment, options: WriterOptions,
+ level: number) => any
+
+ /**
+ * Writes the XML declaration (e.g. `<?xml version="1.0"?>`).
+ *
+ * @param node - XML declaration node
+ * @param options - writer options and state information
+ * @param level - current depth of the XML tree
+ */
+ declaration?: (node: XMLDeclaration, options: WriterOptions,
+ level: number) => any
+
+ /**
+ * Writes the DocType node and its children.
+ *
+ * _Note:_ Be careful when overriding this function as this function
+ * is also responsible for writing the internal subset of the DTD.
+ *
+ * @param node - DOCTYPE node
+ * @param options - writer options and state information
+ * @param level - current depth of the XML tree
+ */
+ docType?: (node: XMLDocType, options: WriterOptions,
+ level: number) => any
+
+ /**
+ * Writes an element node.
+ *
+ * _Note:_ Be careful when overriding this function as this function
+ * is also responsible for writing the element attributes and child
+ * nodes.
+ *
+ *
+ * @param node - current node
+ * @param options - writer options and state information
+ * @param level - current depth of the XML tree
+ */
+ element?: (node: XMLElement, options: WriterOptions,
+ level: number) => any
+
+ /**
+ * Writes a processing instruction node.
+ *
+ * @param node - current node
+ * @param options - writer options and state information
+ * @param level - current depth of the XML tree
+ */
+ processingInstruction?: (node: XMLProcessingInstruction,
+ options: WriterOptions, level: number) => any
+
+ /**
+ * Writes a raw text node.
+ *
+ * @param node - current node
+ * @param options - writer options and state information
+ * @param level - current depth of the XML tree
+ */
+ raw?: (node: XMLRaw, options: WriterOptions, level: number) => any
+
+ /**
+ * Writes a text node.
+ *
+ * @param node - current node
+ * @param options - writer options and state information
+ * @param level - current depth of the XML tree
+ */
+ text?: (node: XMLText, options: WriterOptions, level: number) => any
+
+ /**
+ * Writes an attribute node (`!ATTLIST`) inside the DTD.
+ *
+ * @param node - current node
+ * @param options - writer options and state information
+ * @param level - current depth of the XML tree
+ */
+ dtdAttList?: (node: XMLDTDAttList, options: WriterOptions,
+ level: number) => any
+
+ /**
+ * Writes an element node (`!ELEMENT`) inside the DTD.
+ *
+ * @param node - current node
+ * @param options - writer options and state information
+ * @param level - current depth of the XML tree
+ */
+ dtdElement?: (node: XMLDTDElement, options: WriterOptions,
+ level: number) => any
+
+ /**
+ * Writes an entity node (`!ENTITY`) inside the DTD.
+ *
+ * @param node - current node
+ * @param options - writer options and state information
+ * @param level - current depth of the XML tree
+ */
+ dtdEntity?: (node: XMLDTDEntity, options: WriterOptions,
+ level: number) => any
+
+ /**
+ * Writes a notation node (`!NOTATION`) inside the DTD.
+ *
+ * @param node - current node
+ * @param options - writer options and state information
+ * @param level - current depth of the XML tree
+ */
+ dtdNotation?: (node: XMLDTDNotation, options: WriterOptions,
+ level: number) => any
+
+ /**
+ * Called right after starting writing a node. This function does not
+ * produce any output, but can be used to alter the state of the writer.
+ *
+ * @param node - current node
+ * @param options - writer options and state information
+ * @param level - current depth of the XML tree
+ */
+ openNode?: (node: XMLNode, options: WriterOptions,
+ level: number) => void
+
+ /**
+ * Called right before completing writing a node. This function does not
+ * produce any output, but can be used to alter the state of the writer.
+ *
+ * @param node - current node
+ * @param options - writer options and state information
+ * @param level - current depth of the XML tree
+ */
+ closeNode?: (node: XMLNode, options: WriterOptions,
+ level: number) => void
+
+ /**
+ * Called right after starting writing an attribute. This function does
+ * not produce any output, but can be used to alter the state of the
+ * writer.
+ *
+ * @param node - current attribute
+ * @param options - writer options and state information
+ * @param level - current depth of the XML tree
+ */
+ openAttribute?: (att: XMLAttribute, options: WriterOptions,
+ level: number) => void
+
+ /**
+ * Called right before completing writing an attribute. This function
+ * does not produce any output, but can be used to alter the state of
+ * the writer.
+ *
+ * @param node - current attribute
+ * @param options - writer options and state information
+ * @param level - current depth of the XML tree
+ */
+ closeAttribute?: (att: XMLAttribute, options: WriterOptions,
+ level: number) => void
+ }
+
+ /**
+ * Defines the options passed to the XML writer.
+ */
+ interface WriterOptions {
+ /**
+ * Pretty print the XML tree
+ */
+ pretty?: boolean;
+ /**
+ * Indentation string for pretty printing
+ */
+ indent?: string;
+ /**
+ * Newline string for pretty printing
+ */
+ newline?: string;
+ /**
+ * A fixed number of indents to offset strings
+ */
+ offset?: number;
+ /**
+ * Maximum column width
+ */
+ width?: number;
+ /**
+ * Whether to output closing tags for empty element nodes
+ */
+ allowEmpty?: boolean;
+ /**
+ * Whether to pretty print text nodes
+ */
+ dontPrettyTextNodes?: boolean;
+ /**
+ * A string to insert before closing slash character
+ */
+ spaceBeforeSlash?: string | boolean;
+ /**
+ * User state object that is saved between writer functions
+ */
+ user?: any;
+ /**
+ * The current state of the writer
+ */
+ state?: WriterState;
+ /**
+ * Writer function overrides
+ */
+ writer?: XMLWriter;
+ }
+
+ /**
+ * Defines the state of the writer.
+ */
+ enum WriterState {
+ /**
+ * Writer state is unknown
+ */
+ None = 0,
+ /**
+ * Writer is at an opening tag, e.g. `<node>`
+ */
+ OpenTag = 1,
+ /**
+ * Writer is inside an element
+ */
+ InsideTag = 2,
+ /**
+ * Writer is at a closing tag, e.g. `</node>`
+ */
+ CloseTag = 3
+ }
+
+ /**
+ * Creates a new XML document and returns the document node.
+ * This function creates an empty document without the XML prolog or
+ * a root element.
+ *
+ * @param options - create options
+ */
+ function begin(options?: BeginOptions): XMLDocument;
+
+ /**
+ * Defines the options used while creating an XML document with the `begin`
+ * function.
+ */
+ interface BeginOptions {
+ /**
+ * Whether nodes with null values will be kept or ignored
+ */
+ keepNullNodes?: boolean;
+ /**
+ * Whether attributes with null values will be kept or ignored
+ */
+ keepNullAttributes?: boolean;
+ /**
+ * Whether decorator strings will be ignored when converting JS
+ * objects
+ */
+ ignoreDecorators?: boolean;
+ /**
+ * Whether array items are created as separate nodes when passed
+ * as an object value
+ */
+ separateArrayItems?: boolean;
+ /**
+ * Whether existing html entities are encoded
+ */
+ noDoubleEncoding?: boolean;
+ /**
+ * Whether values will be validated and escaped or returned as is
+ */
+ noValidation?: boolean;
+ /**
+ * A character to replace invalid characters in all values. This also
+ * disables character validation.
+ */
+ invalidCharReplacement?: string;
+ /**
+ * A set of functions to use for converting values to strings
+ */
+ stringify?: XMLStringifier;
+ /**
+ * The default XML writer to use for converting nodes to string.
+ * If the default writer is not set, the built-in XMLStringWriter
+ * will be used instead.
+ */
+ writer?: XMLWriter | WriterOptions;
+ }
+
+ /**
+ * A function to be called when a chunk of XML is written.
+ *
+ * @param chunk - a chunk of string that was written
+ * @param level - current depth of the XML tree
+ */
+ type OnDataCallback = (chunk: string, level: number) => void;
+
+ /**
+ * A function to be called when the XML doucment is completed.
+ */
+ type OnEndCallback = () => void;
+
+ /**
+ * Creates a new XML document in callback mode and returns the document
+ * node.
+ *
+ * @param options - create options
+ * @param onData - the function to be called when a new chunk of XML is
+ * output. The string containing the XML chunk is passed to `onData` as
+ * its first argument and the current depth of the tree is passed as its
+ * second argument.
+ * @param onEnd - the function to be called when the XML document is
+ * completed with `end`. `onEnd` does not receive any arguments.
+ */
+ function begin(options?: BeginOptions | OnDataCallback,
+ onData?: OnDataCallback | OnEndCallback,
+ onEnd?: OnEndCallback): XMLDocumentCB;
+
+ /**
+ * Creates and returns a default string writer.
+ *
+ * @param options - writer options
+ */
+ function stringWriter(options?: WriterOptions): XMLWriter
+
+ /**
+ * Creates and returns a default stream writer.
+ *
+ * @param stream - a writeable stream
+ * @param options - writer options
+ */
+ function streamWriter(stream: Writable, options?: WriterOptions): XMLWriter
+
+ /**
+ * Defines the type of a node in the XML document.
+ */
+ enum NodeType {
+ /**
+ * An element node
+ */
+ Element = 1,
+ /**
+ * An attribute node
+ */
+ Attribute = 2,
+ /**
+ * A text node
+ */
+ Text = 3,
+ /**
+ * A CDATA node
+ */
+ CData = 4,
+ /**
+ * An entity reference node inside DocType
+ */
+ EntityReference = 5,
+ /**
+ * An entity declaration node inside DocType
+ */
+ EntityDeclaration = 6,
+ /**
+ * A processing instruction node
+ */
+ ProcessingInstruction = 7,
+ /**
+ * A comment node
+ */
+ Comment = 8,
+ /**
+ * A document node
+ */
+ Document = 9,
+ /**
+ * A Doctype node
+ */
+ DocType = 10,
+ /**
+ * A document fragment node
+ */
+ DocumentFragment = 11,
+ /**
+ * A notation declaration node inside DocType
+ */
+ NotationDeclaration = 12,
+ /**
+ * An XML declaration node
+ */
+ Declaration = 201,
+ /**
+ * A raw text node
+ */
+ Raw = 202,
+ /**
+ * An attribute declaraiton node inside DocType
+ */
+ AttributeDeclaration = 203,
+ /**
+ * An element declaration node inside DocType
+ */
+ ElementDeclaration = 204
+ }
+
+ /**
+ * Defines the type of a node in the XML document.
+ */
+ export import nodeType = NodeType;
+
+ /**
+ * Defines the state of the writer.
+ */
+ export import writerState = WriterState;
+
+ /**
+ * Defines the settings used when converting the XML document to string.
+ */
+ interface XMLToStringOptions {
+ /**
+ * Pretty print the XML tree
+ */
+ pretty?: boolean;
+ /**
+ * Indentation string for pretty printing
+ */
+ indent?: string;
+ /**
+ * Newline string for pretty printing
+ */
+ newline?: string;
+ /**
+ * A fixed number of indents to offset strings
+ */
+ offset?: number;
+ /**
+ * Maximum column width
+ */
+ width?: number;
+ /**
+ * Whether to output closing tags for empty element nodes
+ */
+ allowEmpty?: boolean;
+ /**
+ * Whether to pretty print text nodes
+ */
+ dontPrettyTextNodes?: boolean;
+ /**
+ * A string to insert before closing slash character
+ */
+ spaceBeforeSlash?: string | boolean;
+ /**
+ * The default XML writer to use for converting nodes to string.
+ * If the default writer is not set, the built-in `XMLStringWriter`
+ * will be used instead.
+ */
+ writer?: XMLWriter;
+ }
+
+ /**
+ * Represents the XML document.
+ */
+ class XMLDocument extends XMLNode {
+ /**
+ * Converts the node to string
+ *
+ * @param options - conversion options
+ */
+ toString(options?: XMLToStringOptions): string;
+ }
+
+ /**
+ * Represents an XML attribute.
+ */
+ class XMLAttribute {
+ /**
+ * Type of the node
+ */
+ type: NodeType;
+ /**
+ * Parent element node
+ */
+ parent: XMLElement;
+ /**
+ * Attribute name
+ */
+ name: string;
+ /**
+ * Attribute value
+ */
+ value: string;
+
+ /**
+ * Creates a clone of this node
+ */
+ clone(): XMLAttribute;
+
+ /**
+ * Converts the node to string
+ *
+ * @param options - conversion options
+ */
+ toString(options?: XMLToStringOptions): string;
+ }
+
+ /**
+ * Represents the base class of XML nodes.
+ */
+ abstract class XMLNode {
+ /**
+ * Type of the node
+ */
+ type: NodeType;
+ /**
+ * Parent element node
+ */
+ parent: XMLElement;
+ /**
+ * Child nodes
+ */
+ children: XMLNode[]
+
+ /**
+ * Creates a new child node and appends it to the list of child nodes.
+ *
+ * _Aliases:_ `ele` and `e`
+ *
+ * @param name - node name or a JS object defining the nodes to insert
+ * @param attributes - node attributes
+ * @param text - node text
+ *
+ * @returns the last top level node created
+ */
+ element(name: any, attributes?: Object, text?: any): XMLElement;
+ ele(name: any, attributes?: Object, text?: any): XMLElement;
+ e(name: any, attributes?: Object, text?: any): XMLElement;
+
+ /**
+ * Adds or modifies an attribute.
+ *
+ * _Aliases:_ `att`, `a`
+ *
+ * @param name - attribute name
+ * @param value - attribute value
+ *
+ * @returns the parent element node
+ */
+ attribute(name: any, value?: any): XMLElement;
+ att(name: any, value?: any): XMLElement;
+ a(name: any, value?: any): XMLElement;
+
+ /**
+ * Creates a new sibling node and inserts it before this node.
+ *
+ * @param name - node name or a JS object defining the nodes to insert
+ * @param attributes - node attributes
+ * @param text - node text
+ *
+ * @returns the new node
+ */
+ insertBefore(name: any, attributes?: Object, text?: any): XMLElement;
+ /**
+ * Creates a new sibling node and inserts it after this node.
+ *
+ * @param name - node name or a JS object defining the nodes to insert
+ * @param attributes - node attributes
+ * @param text - node text
+ *
+ * @returns the new node
+ */
+ insertAfter(name: any, attributes?: Object, text?: any): XMLElement;
+ /**
+ * Removes this node from the tree.
+ *
+ * @returns the parent node
+ */
+ remove(): XMLElement;
+
+ /**
+ * Creates a new element node and appends it to the list of child nodes.
+ *
+ * _Aliases:_ `nod` and `n`
+ *
+ * @param name - element node name
+ * @param attributes - node attributes
+ * @param text - node text
+ *
+ * @returns the node created
+ */
+ node(name: string, attributes?: Object, text?: any): XMLElement;
+ nod(name: string, attributes?: Object, text?: any): XMLElement;
+ n(name: string, attributes?: Object, text?: any): XMLElement;
+
+ /**
+ * Creates a new text node and appends it to the list of child nodes.
+ *
+ * _Aliases:_ `txt` and `t`
+ *
+ * @param value - node value
+ *
+ * @returns the parent node
+ */
+ text(value: string): XMLElement;
+ txt(value: string): XMLElement;
+ t(value: string): XMLElement;
+
+ /**
+ * Creates a new CDATA node and appends it to the list of child nodes.
+ *
+ * _Aliases:_ `dat` and `d`
+ *
+ * @param value - node value
+ *
+ * @returns the parent node
+ */
+ cdata(value: string): XMLElement;
+ dat(value: string): XMLElement;
+ d(value: string): XMLElement;
+
+ /**
+ * Creates a new comment node and appends it to the list of child nodes.
+ *
+ * _Aliases:_ `com` and `c`
+ *
+ * @param value - node value
+ *
+ * @returns the parent node
+ */
+ comment(value: string): XMLElement;
+ com(value: string): XMLElement;
+ c(value: string): XMLElement;
+
+ /**
+ * Creates a comment node before the current node
+ *
+ * @param value - node value
+ *
+ * @returns the parent node
+ */
+ commentBefore(value: string): XMLElement;
+
+ /**
+ * Creates a comment node after the current node
+ *
+ * @param value - node value
+ *
+ * @returns the parent node
+ */
+ commentAfter(value: string): XMLElement;
+
+ /**
+ * Creates a new raw text node and appends it to the list of child
+ * nodes.
+ *
+ * _Alias:_ `r`
+ *
+ * @param value - node value
+ *
+ * @returns the parent node
+ */
+ raw(value: string): XMLElement;
+ r(value: string): XMLElement;
+
+ /**
+ * Creates a new processing instruction node and appends it to the list
+ * of child nodes.
+ *
+ * _Aliases:_ `ins` and `i`
+ *
+ * @param target - node target
+ * @param value - node value
+ *
+ * @returns the parent node
+ */
+ instruction(target: string, value: any): XMLElement;
+ instruction(array: Array<any>): XMLElement;
+ instruction(obj: Object): XMLElement;
+ ins(target: string, value: any): XMLElement;
+ ins(array: Array<any>): XMLElement;
+ ins(obj: Object): XMLElement;
+ i(target: string, value: any): XMLElement;
+ i(array: Array<any>): XMLElement;
+ i(obj: Object): XMLElement;
+
+ /**
+ * Creates a processing instruction node before the current node.
+ *
+ * @param target - node target
+ * @param value - node value
+ *
+ * @returns the parent node
+ */
+ instructionBefore(target: string, value: any): XMLElement;
+
+ /**
+ * Creates a processing instruction node after the current node.
+ *
+ * @param target - node target
+ * @param value - node value
+ *
+ * @returns the parent node
+ */
+ instructionAfter(target: string, value: any): XMLElement;
+
+ /**
+ * Creates the XML declaration.
+ *
+ * _Alias:_ `dec`
+ *
+ * @param version - version number string, e.g. `1.0`
+ * @param encoding - encoding declaration, e.g. `UTF-8`
+ * @param standalone - standalone document declaration: `true` or `false`
+ *
+ * @returns the root element node
+ */
+ declaration(version?: string |
+ { version?: string, encoding?: string, standalone?: boolean },
+ encoding?: string, standalone?: boolean): XMLElement;
+ dec(version?: string |
+ { version?: string, encoding?: string, standalone?: boolean },
+ encoding?: string, standalone?: boolean): XMLElement;
+
+ /**
+ * Creates the document type definition.
+ *
+ * _Alias:_ `dtd`
+ *
+ * @param pubID - public identifier of the DTD
+ * @param sysID - system identifier of the DTD
+ *
+ * @returns the DOCTYPE node
+ */
+ doctype(pubID?: string | { pubID?: string, sysID?: string },
+ sysID?: string): XMLDocType;
+ dtd(pubID?: string | { pubID?: string, sysID?: string },
+ sysID?: string): XMLDocType;
+
+ /**
+ * Takes the root node of the given XML document and appends it
+ * to child nodes.
+ *
+ * @param doc - the document whose root node to import
+ *
+ * @returns the current node
+ */
+ importDocument(doc: XMLNode): XMLElement;
+
+ /**
+ * Converts the XML document to string.
+ *
+ * @param options - conversion options
+ */
+ end(options?: XMLWriter | XMLToStringOptions): string;
+
+ /**
+ * Returns the previous sibling node.
+ */
+ prev(): XMLNode;
+ /**
+ * Returns the next sibling node.
+ */
+ next(): XMLNode;
+ /**
+ * Returns the parent node.
+ *
+ * _Alias:_ `u`
+ */
+ up(): XMLElement;
+ u(): XMLElement;
+ /**
+ * Returns the document node.
+ *
+ * _Alias:_ `doc`
+ */
+ document(): XMLDocument;
+ doc(): XMLDocument;
+
+ /**
+ * Returns the root element node.
+ */
+ root(): XMLElement;
+ }
+
+ /**
+ * Represents the base class of character data nodes.
+ */
+ abstract class XMLCharacterData extends XMLNode {
+ /**
+ * Node value
+ */
+ value: string;
+ }
+
+ /**
+ * Represents a CDATA node.
+ */
+ class XMLCData extends XMLCharacterData {
+ /**
+ * Converts the node to string
+ *
+ * @param options - conversion options
+ */
+ toString(options?: XMLToStringOptions): string;
+
+ /**
+ * Creates a clone of this node
+ */
+ clone(): XMLCData;
+ }
+
+ /**
+ * Represents a comment node.
+ */
+ class XMLComment extends XMLCharacterData {
+ /**
+ * Converts the node to string
+ *
+ * @param options - conversion options
+ */
+ toString(options?: XMLToStringOptions): string;
+
+ /**
+ * Creates a clone of this node
+ */
+ clone(): XMLComment;
+ }
+
+ /**
+ * Represents a processing instruction node.
+ */
+ class XMLProcessingInstruction extends XMLCharacterData {
+ /** Instruction target
+ */
+ target: string;
+
+ /**
+ * Converts the node to string
+ *
+ * @param options - conversion options
+ */
+ toString(options?: XMLToStringOptions): string;
+
+ /**
+ * Creates a clone of this node
+ */
+ clone(): XMLProcessingInstruction;
+ }
+
+ /**
+ * Represents a raw text node.
+ */
+ class XMLRaw extends XMLCharacterData {
+ /**
+ * Converts the node to string
+ *
+ * @param options - conversion options
+ */
+ toString(options?: XMLToStringOptions): string;
+
+ /**
+ * Creates a clone of this node
+ */
+ clone(): XMLRaw;
+ }
+
+ /**
+ * Represents a text node.
+ */
+ class XMLText extends XMLCharacterData {
+ /**
+ * Converts the node to string
+ *
+ * @param options - conversion options
+ */
+ toString(options?: XMLToStringOptions): string;
+
+ /**
+ * Creates a clone of this node
+ */
+ clone(): XMLText;
+ }
+
+ /**
+ * Represents the XML declaration.
+ */
+ class XMLDeclaration {
+ /**
+ * A version number string, e.g. `1.0`
+ */
+ version: string;
+ /**
+ * Encoding declaration, e.g. `UTF-8`
+ */
+ encoding: string;
+ /**
+ * Standalone document declaration: `true` or `false`
+ */
+ standalone: boolean;
+
+ /**
+ * Converts the node to string.
+ *
+ * @param options - conversion options
+ */
+ toString(options?: XMLToStringOptions): string;
+ }
+
+ /**
+ * Represents the document type definition.
+ */
+ class XMLDocType {
+ /**
+ * Type of the node
+ */
+ type: NodeType;
+ /**
+ * Parent element node
+ */
+ parent: XMLElement;
+ /**
+ * Child nodes
+ */
+ children: XMLNode[]
+
+ /**
+ * Public identifier of the DTD
+ */
+ pubID: string;
+ /**
+ * System identifier of the DTD
+ */
+ sysID: string;
+
+ /**
+ * Creates an element type declaration.
+ *
+ * _Alias:_ `ele`
+ *
+ * @param name - element name
+ * @param value - element content (defaults to `#PCDATA`)
+ *
+ * @returns the DOCTYPE node
+ */
+ element(name: string, value?: Object): XMLDocType;
+ ele(name: string, value?: Object): XMLDocType;
+
+ /**
+ * Creates an attribute declaration.
+ *
+ * _Alias:_ `att`
+ *
+ * @param elementName - the name of the element containing this attribute
+ * @param attributeName - attribute name
+ * @param attributeType - type of the attribute
+ * @param defaultValueType - default value type (either `#REQUIRED`,
+ * `#IMPLIED`, `#FIXED` or `#DEFAULT`)
+ * @param defaultValue - default value of the attribute (only used
+ * for `#FIXED` or `#DEFAULT`)
+ *
+ * @returns the DOCTYPE node
+ */
+ attList(elementName: string, attributeName: string, attributeType: string,
+ defaultValueType: string, defaultValue?: any): XMLDocType;
+ att(elementName: string, attributeName: string, attributeType: string,
+ defaultValueType: string, defaultValue?: any): XMLDocType;
+
+ /**
+ * Creates a general entity declaration.
+ *
+ * _Alias:_ `ent`
+ *
+ * @param name - the name of the entity
+ * @param value - entity parameters
+ *
+ * @returns the DOCTYPE node
+ */
+ entity(name: string, value: string |
+ { pubID?: string, sysID?: string, nData?: string }): XMLDocType;
+ ent(name: string, value: string |
+ { pubID?: string, sysID?: string, nData?: string }): XMLDocType;
+
+ /**
+ * Creates a parameter entity declaration.
+ *
+ * _Alias:_ `pent`
+ *
+ * @param name - the name of the entity
+ * @param value - entity parameters
+ *
+ * @returns the DOCTYPE node
+ */
+ pEntity(name: string, value: string |
+ { pubID?: string, sysID?: string }): XMLDocType;
+ pent(name: string, value: string |
+ { pubID?: string, sysID?: string }): XMLDocType;
+
+ /**
+ * Creates a notation declaration.
+ *
+ * _Alias:_ `not`
+ *
+ * @param name - the name of the entity
+ * @param value - entity parameters
+ *
+ * @returns the DOCTYPE node
+ */
+ notation(name: string,
+ value: { pubID?: string, sysID?: string }): XMLDocType;
+ not(name: string,
+ value: { pubID?: string, sysID?: string }): XMLDocType;
+
+ /**
+ * Creates a new CDATA node and appends it to the list of child nodes.
+ *
+ * _Alias:_ `dat`
+ *
+ * @param value - node value
+ *
+ * @returns the DOCTYPE node
+ */
+ cdata(value: string): XMLDocType;
+ dat(value: string): XMLDocType;
+
+ /**
+ * Creates a new comment child and appends it to the list of child
+ * nodes.
+ *
+ * _Alias:_ `com`
+ *
+ * @param value - node value
+ *
+ * @returns the DOCTYPE node
+ */
+ comment(value: string): XMLDocType;
+ com(value: string): XMLDocType;
+
+ /**
+ * Creates a new processing instruction node and appends it to the list
+ * of child nodes.
+ *
+ * _Alias:_ `ins`
+ *
+ * @param target - node target
+ * @param value - node value
+ *
+ * @returns the DOCTYPE node
+ */
+ instruction(target: string, value: any): XMLDocType;
+ instruction(array: Array<any>): XMLDocType;
+ instruction(obj: Object): XMLDocType;
+ ins(target: string, value: any): XMLDocType;
+ ins(array: Array<any>): XMLDocType;
+ ins(obj: Object): XMLDocType;
+
+ /**
+ * Returns the root element node.
+ *
+ * _Alias:_ `up`
+ */
+ root(): XMLElement;
+ up(): XMLElement;
+
+ /**
+ * Converts the node to string.
+ *
+ * @param options - conversion options
+ */
+ toString(options?: XMLToStringOptions): string;
+
+ /**
+ * Creates a clone of this node.
+ */
+ clone(): XMLDocType;
+
+ /**
+ * Returns the document node.
+ *
+ * _Alias:_ `doc`
+ */
+ document(): XMLDocument;
+ doc(): XMLDocument;
+
+ /**
+ * Converts the XML document to string.
+ *
+ * @param options - conversion options
+ */
+ end(options?: XMLWriter | XMLToStringOptions): string;
+ }
+
+ /**
+ * Represents an attribute list in the DTD.
+ */
+ class XMLDTDAttList {
+ /**
+ * The name of the element containing this attribute
+ */
+ elementName: string;
+ /**
+ * Attribute name
+ */
+ attributeName: string;
+ /**
+ * Type of the attribute
+ */
+ attributeType: string;
+ /**
+ * Default value type (either `#REQUIRED`, `#IMPLIED`, `#FIXED`
+ * or `#DEFAULT`)
+ */
+ defaultValueType: string;
+ /**
+ * Default value of the attribute (only used for `#FIXED` or
+ * `#DEFAULT`)
+ */
+ defaultValue: string;
+
+ /**
+ * Converts the node to string.
+ *
+ * @param options - conversion options
+ */
+ toString(options?: XMLToStringOptions): string;
+ }
+
+ /**
+ * Represents an element in the DTD.
+ */
+ class XMLDTDElement {
+ /**
+ * The name of the element
+ */
+ name: string;
+ /**
+ * Element content
+ */
+ value: string;
+
+ /**
+ * Converts the node to string.
+ *
+ * @param options - conversion options
+ */
+ toString(options?: XMLToStringOptions): string;
+ }
+
+ /**
+ * Represents an entity in the DTD.
+ */
+ class XMLDTDEntity {
+ /**
+ * Determines whether this is a parameter entity (`true`) or a
+ * general entity (`false`).
+ */
+ pe: boolean;
+ /**
+ * The name of the entity
+ */
+ name: string;
+ /**
+ * Public identifier
+ */
+ pubID: string;
+ /**
+ * System identifier
+ */
+ sysID: string;
+ /**
+ * Notation declaration
+ */
+ nData: string;
+
+ /**
+ * Converts the node to string.
+ *
+ * @param options - conversion options
+ */
+ toString(options?: XMLToStringOptions): string;
+ }
+
+ /**
+ * Represents a notation in the DTD.
+ */
+ class XMLDTDNotation {
+ /**
+ * The name of the notation
+ */
+ name: string;
+ /**
+ * Public identifier
+ */
+ pubID: string;
+ /**
+ * System identifier
+ */
+ sysID: string;
+
+ /**
+ * Converts the node to string.
+ *
+ * @param options - conversion options
+ */
+ toString(options?: XMLToStringOptions): string;
+ }
+
+ /**
+ * Represents an element node.
+ */
+ class XMLElement extends XMLNode {
+ /**
+ * Element node name
+ */
+ name: string;
+ /**
+ * Element attributes
+ */
+ attribs: { string: XMLAttribute };
+
+ /**
+ * Creates a clone of this node
+ */
+ clone(): XMLElement;
+
+ /**
+ * Adds or modifies an attribute.
+ *
+ * _Aliases:_ `att`, `a`
+ *
+ * @param name - attribute name
+ * @param value - attribute value
+ *
+ * @returns the parent element node
+ */
+ attribute(name: any, value?: any): XMLElement;
+ att(name: any, value?: any): XMLElement;
+ a(name: any, value?: any): XMLElement;
+
+ /**
+ * Removes an attribute.
+ *
+ * @param name - attribute name
+ *
+ * @returns the parent element node
+ */
+ removeAttribute(name: string | string[]): XMLElement;
+
+ /**
+ * Converts the node to string.
+ *
+ * @param options - conversion options
+ */
+ toString(options?: XMLToStringOptions): string;
+ }
+
+ /**
+ * Represents an XML document builder used in callback mode with the
+ * `begin` function.
+ */
+ class XMLDocumentCB {
+
+ /**
+ * Creates a new child node and appends it to the list of child nodes.
+ *
+ * _Aliases:_ `nod` and `n`
+ *
+ * @param name - element node name
+ * @param attributes - node attributes
+ * @param text - node text
+ *
+ * @returns the document builder object
+ */
+ node(name: string, attributes?: Object, text?: any): XMLDocumentCB;
+ nod(name: string, attributes?: Object, text?: any): XMLDocumentCB;
+ n(name: string, attributes?: Object, text?: any): XMLDocumentCB;
+
+ /**
+ * Creates a child element node.
+ *
+ * _Aliases:_ `ele` and `e`
+ *
+ * @param name - element node name or a JS object defining the nodes
+ * to insert
+ * @param attributes - node attributes
+ * @param text - node text
+ *
+ * @returns the document builder object
+ */
+ element(name: any, attributes?: Object, text?: any): XMLDocumentCB;
+ ele(name: any, attributes?: Object, text?: any): XMLDocumentCB;
+ e(name: any, attributes?: Object, text?: any): XMLDocumentCB;
+
+ /**
+ * Adds or modifies an attribute.
+ *
+ * _Aliases:_ `att` and `a`
+ *
+ * @param name - attribute name
+ * @param value - attribute value
+ *
+ * @returns the document builder object
+ */
+ attribute(name: any, value?: any): XMLDocumentCB;
+ att(name: any, value?: any): XMLDocumentCB;
+ a(name: any, value?: any): XMLDocumentCB;
+
+ /**
+ * Creates a new text node and appends it to the list of child nodes.
+ *
+ * _Aliases:_ `txt` and `t`
+ *
+ * @param value - node value
+ *
+ * @returns the document builder object
+ */
+ text(value: string): XMLDocumentCB;
+ txt(value: string): XMLDocumentCB;
+ t(value: string): XMLDocumentCB;
+
+ /**
+ * Creates a new CDATA node and appends it to the list of child nodes.
+ *
+ * _Aliases:_ `dat` and `d`
+ *
+ * @param value - node value
+ *
+ * @returns the document builder object
+ */
+ cdata(value: string): XMLDocumentCB;
+ dat(value: string): XMLDocumentCB;
+ d(value: string): XMLDocumentCB;
+
+ /**
+ * Creates a new comment node and appends it to the list of child nodes.
+ *
+ * _Aliases:_ `com` and `c`
+ *
+ * @param value - node value
+ *
+ * @returns the document builder object
+ */
+ comment(value: string): XMLDocumentCB;
+ com(value: string): XMLDocumentCB;
+ c(value: string): XMLDocumentCB;
+
+ /**
+ * Creates a new raw text node and appends it to the list of child
+ * nodes.
+ *
+ * _Alias:_ `r`
+ *
+ * @param value - node value
+ *
+ * @returns the document builder object
+ */
+ raw(value: string): XMLDocumentCB;
+ r(value: string): XMLDocumentCB;
+
+ /**
+ * Creates a new processing instruction node and appends it to the list
+ * of child nodes.
+ *
+ * _Aliases:_ `ins` and `i`
+ *
+ * @param target - node target
+ * @param value - node value
+ *
+ * @returns the document builder object
+ */
+ instruction(target: string, value: any): XMLDocumentCB;
+ instruction(array: Array<any>): XMLDocumentCB;
+ instruction(obj: Object): XMLDocumentCB;
+ ins(target: string, value: any): XMLDocumentCB;
+ ins(array: Array<any>): XMLDocumentCB;
+ ins(obj: Object): XMLDocumentCB;
+ i(target: string, value: any): XMLDocumentCB;
+ i(array: Array<any>): XMLDocumentCB;
+ i(obj: Object): XMLDocumentCB;
+
+ /**
+ * Creates the XML declaration.
+ *
+ * _Alias:_ `dec`
+ *
+ * @param version - version number string, e.g. `1.0`
+ * @param encoding - encoding declaration, e.g. `UTF-8`
+ * @param standalone - standalone document declaration: `true` or `false`
+ *
+ * @returns the document builder object
+ */
+ declaration(version?: string, encoding?: string,
+ standalone?: boolean): XMLDocumentCB;
+ dec(version?: string, encoding?: string,
+ standalone?: boolean): XMLDocumentCB;
+
+ /**
+ * Creates the document type definition.
+ *
+ * _Alias:_ `dtd`
+ *
+ * @param root - the name of the root node
+ * @param pubID - public identifier of the DTD
+ * @param sysID - system identifier of the DTD
+ *
+ * @returns the document builder object
+ */
+ doctype(root: string, pubID?: string, sysID?: string): XMLDocumentCB;
+ dtd(root: string, pubID?: string, sysID?: string): XMLDocumentCB;
+
+ /**
+ * Creates an element type declaration.
+ *
+ * _Aliases:_ `element` and `ele`
+ *
+ * @param name - element name
+ * @param value - element content (defaults to `#PCDATA`)
+ *
+ * @returns the document builder object
+ */
+ dtdElement(name: string, value?: Object): XMLDocumentCB;
+ element(name: string, value?: Object): XMLDocumentCB;
+ ele(name: string, value?: Object): XMLDocumentCB;
+
+ /**
+ * Creates an attribute declaration.
+ *
+ * _Alias:_ `att`
+ *
+ * @param elementName - the name of the element containing this attribute
+ * @param attributeName - attribute name
+ * @param attributeType - type of the attribute (defaults to `CDATA`)
+ * @param defaultValueType - default value type (either `#REQUIRED`,
+ * `#IMPLIED`, `#FIXED` or `#DEFAULT`) (defaults to `#IMPLIED`)
+ * @param defaultValue - default value of the attribute (only used
+ * for `#FIXED` or `#DEFAULT`)
+ *
+ * @returns the document builder object
+ */
+ attList(elementName: string, attributeName: string,
+ attributeType: string, defaultValueType?:
+ string, defaultValue?: any): XMLDocumentCB;
+ att(elementName: string, attributeName: string, attributeType: string,
+ defaultValueType?: string, defaultValue?: any): XMLDocumentCB;
+ a(elementName: string, attributeName: string, attributeType: string,
+ defaultValueType?: string, defaultValue?: any): XMLDocumentCB;
+
+ /**
+ * Creates a general entity declaration.
+ *
+ * _Alias:_ `ent`
+ *
+ * @param name - the name of the entity
+ * @param value - entity parameters
+ *
+ * @returns the document builder object
+ */
+ entity(name: string, value: string |
+ { pubID?: string, sysID?: string, nData?: string }): XMLDocumentCB;
+ ent(name: string, value: string |
+ { pubID?: string, sysID?: string, nData?: string }): XMLDocumentCB;
+
+ /**
+ * Creates a parameter entity declaration.
+ *
+ * _Alias:_ `pent`
+ *
+ * @param name - the name of the entity
+ * @param value - entity parameters
+ *
+ * @returns the document builder object
+ */
+ pEntity(name: string, value: string |
+ { pubID?: string, sysID?: string }): XMLDocumentCB;
+ pent(name: string, value: string |
+ { pubID?: string, sysID?: string }): XMLDocumentCB;
+
+ /**
+ * Creates a notation declaration.
+ *
+ * _Alias:_ `not`
+ *
+ * @param name - the name of the entity
+ * @param value - entity parameters
+ *
+ * @returns the document builder object
+ */
+ notation(name: string,
+ value: { pubID?: string, sysID?: string }): XMLDocumentCB;
+ not(name: string,
+ value: { pubID?: string, sysID?: string }): XMLDocumentCB;
+
+ /**
+ * Ends the document and calls the `onEnd` callback function.
+ */
+ end(): void;
+
+ /**
+ * Moves up to the parent node.
+ *
+ * _Alias:_ `u`
+ *
+ * @returns the document builder object
+ */
+ up(): XMLDocumentCB;
+ u(): XMLDocumentCB;
+ }
+
+}
diff --git a/generator/package-lock.json b/generator/package-lock.json
new file mode 100644
index 0000000..afd87fa
--- /dev/null
+++ b/generator/package-lock.json
@@ -0,0 +1,60 @@
+{
+ "name": "generator",
+ "lockfileVersion": 3,
+ "requires": true,
+ "packages": {
+ "": {
+ "dependencies": {
+ "plist": "^3.1.0"
+ }
+ },
+ "node_modules/@xmldom/xmldom": {
+ "version": "0.8.10",
+ "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.10.tgz",
+ "integrity": "sha512-2WALfTl4xo2SkGCYRt6rDTFfk9R1czmBvUQy12gK2KuRKIpWEhcbbzy8EZXtz/jkRqHX8bFEc6FC1HjX4TUWYw==",
+ "engines": {
+ "node": ">=10.0.0"
+ }
+ },
+ "node_modules/base64-js": {
+ "version": "1.5.1",
+ "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
+ "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ]
+ },
+ "node_modules/plist": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/plist/-/plist-3.1.0.tgz",
+ "integrity": "sha512-uysumyrvkUX0rX/dEVqt8gC3sTBzd4zoWfLeS29nb53imdaXVvLINYXTI2GNqzaMuvacNx4uJQ8+b3zXR0pkgQ==",
+ "dependencies": {
+ "@xmldom/xmldom": "^0.8.8",
+ "base64-js": "^1.5.1",
+ "xmlbuilder": "^15.1.1"
+ },
+ "engines": {
+ "node": ">=10.4.0"
+ }
+ },
+ "node_modules/xmlbuilder": {
+ "version": "15.1.1",
+ "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-15.1.1.tgz",
+ "integrity": "sha512-yMqGBqtXyeN1e3TGYvgNgDVZ3j84W4cwkOXQswghol6APgZWaff9lnbvN7MHYJOiXsvGPXtjTYJEiC9J2wv9Eg==",
+ "engines": {
+ "node": ">=8.0"
+ }
+ }
+ }
+}
diff --git a/generator/package.json b/generator/package.json
new file mode 100644
index 0000000..7573d31
--- /dev/null
+++ b/generator/package.json
@@ -0,0 +1,5 @@
+{
+ "dependencies": {
+ "plist": "^3.1.0"
+ }
+}
diff --git a/generator/post-en.rtf b/generator/post-en.rtf
new file mode 100644
index 0000000..252a4aa
--- /dev/null
+++ b/generator/post-en.rtf
@@ -0,0 +1,15 @@
+{\rtf1\ansi\ansicpg1252\cocoartf2761
+\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica-Bold;\f1\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+{\*\expandedcolortbl;;}
+\paperw11900\paperh16840\margl1440\margr1440\vieww12720\viewh7240\viewkind0
+\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
+
+\f0\b\fs24 \cf0 Atomic is now installed\
+\
+
+\f1\b0 Atomic has been successfully installed on this system. You may now close this installer and run your favourite Atomic-powered applications.\
+\
+If you are encountering issues with an Atomic application, try to contact the developer, update Atomic, and then contact Equestria.dev.\
+\
+Thank you.} \ No newline at end of file
diff --git a/generator/post-fr.rtf b/generator/post-fr.rtf
new file mode 100644
index 0000000..033a312
--- /dev/null
+++ b/generator/post-fr.rtf
@@ -0,0 +1,15 @@
+{\rtf1\ansi\ansicpg1252\cocoartf2761
+\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica-Bold;\f1\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+{\*\expandedcolortbl;;}
+\paperw11900\paperh16840\margl1440\margr1440\vieww12720\viewh7240\viewkind0
+\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
+
+\f0\b\fs24 \cf0 Atomic est d\'e9sormais install\'e9\
+\
+
+\f1\b0 Atomic a \'e9t\'e9 install\'e9 avec succ\'e8s sur ce syst\'e8me. Vous pouvez d\'e9sormais fermer cet installateur et utiliser vos applications Atomic pr\'e9f\'e9r\'e9es.\
+\
+Si vous rencontrez des probl\'e8mes avec une application Atomic, essayez de contacter le d\'e9veloppeur, de mettre \'e0 jour Atomic, puis de contacter Equestria.dev.\
+\
+Merci.} \ No newline at end of file
diff --git a/generator/readme-en.rtf b/generator/readme-en.rtf
new file mode 100644
index 0000000..9675a8e
--- /dev/null
+++ b/generator/readme-en.rtf
@@ -0,0 +1,13 @@
+{\rtf1\ansi\ansicpg1252\cocoartf2761
+\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica-Bold;\f1\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+{\*\expandedcolortbl;;}
+\paperw11900\paperh16840\margl1440\margr1440\vieww12720\viewh7240\viewkind0
+\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
+
+\f0\b\fs24 \cf0 Welcome to Atomic
+\f1\b0 \
+\
+Atomic is Equestria.dev's cross-platform application runtime. Atomic allows Equestria.dev to create a single package that makes many applications work, avoiding large repeated files.\
+\
+This assistant guides you through the installation of Atomic on this system, which will allow you to run and build Atomic applications.} \ No newline at end of file
diff --git a/generator/readme-fr.rtf b/generator/readme-fr.rtf
new file mode 100644
index 0000000..f91fb18
--- /dev/null
+++ b/generator/readme-fr.rtf
@@ -0,0 +1,13 @@
+{\rtf1\ansi\ansicpg1252\cocoartf2761
+\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica-Bold;\f1\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+{\*\expandedcolortbl;;}
+\paperw11900\paperh16840\margl1440\margr1440\vieww12720\viewh7240\viewkind0
+\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
+
+\f0\b\fs24 \cf0 Bienvenue sur Atomic
+\f1\b0 \
+\
+Atomic est le moteur d'application multi-plateforme de Equestria.dev. Atomic permet \'e0 Equestria.dev de cr\'e9er un seul paquet qui permet \'e0 de nombreuses applications de fonctionner, en \'e9vitant les gros fichiers r\'e9p\'e9t\'e9s.\
+\
+Cet assistant vous guide dans l'installation de Atomic sur cette machine, qui vous permettra d'ex\'e9cuter de concevoir des applications Atomic.} \ No newline at end of file
diff --git a/launcher/Cargo.lock b/launcher/Cargo.lock
index d8290e5..b9ecda2 100644
--- a/launcher/Cargo.lock
+++ b/launcher/Cargo.lock
@@ -48,7 +48,7 @@ dependencies = [
[[package]]
name = "launcher"
-version = "1.1.0"
+version = "1.2.0"
dependencies = [
"dirs",
"rustc_version_runtime",
diff --git a/launcher/Cargo.toml b/launcher/Cargo.toml
index 69ba84c..37fa64d 100644
--- a/launcher/Cargo.toml
+++ b/launcher/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "launcher"
-version = "1.1.0"
+version = "1.2.0"
edition = "2021"
[dependencies]
diff --git a/launcher/build.sh b/launcher/build.sh
index cf47f3c..7376544 100755
--- a/launcher/build.sh
+++ b/launcher/build.sh
@@ -10,3 +10,4 @@ cp target/x86_64-unknown-linux-gnu/release/launcher release/launcher-linux-x64
cp target/x86_64-apple-darwin/release/launcher release/launcher-darwin-x64
cp target/aarch64-unknown-linux-musl/release/launcher release/launcher-linux-arm64
cp target/aarch64-apple-darwin/release/launcher release/launcher-darwin-arm64
+cp -f release/* ../converter
diff --git a/launcher/src/constants.rs b/launcher/src/constants.rs
index eaf66fb..e9907f1 100644
--- a/launcher/src/constants.rs
+++ b/launcher/src/constants.rs
@@ -1,13 +1,11 @@
-// TODO: Rename these to "Atomic"
-
#[cfg(target_os = "macos")]
-pub const BINARY_PATH: &str = "Contents/MacOS/Electron";
+pub const BINARY_PATH: &str = "Contents/MacOS/Atomic";
#[cfg(target_os = "linux")]
-pub const BINARY_PATH: &str = "electron";
+pub const BINARY_PATH: &str = "atomic";
#[cfg(target_os = "windows")]
-pub const BINARY_PATH: &str = "electron.exe";
+pub const BINARY_PATH: &str = "atomic.exe";
#[cfg(target_os = "macos")]
pub const APP_FOLDER_PATH: &str = "../Resources/app";